From bce557cc2dc767628bed6aac87301a1be7c5431b Mon Sep 17 00:00:00 2001 From: rxliuli Date: Tue, 4 Nov 2025 05:03:50 +0800 Subject: init commit --- node_modules/@amp/amd-apps/dist/index.js | 17 + .../dist/rankers/engagement-based-demotion.js | 13 + .../amd-apps/dist/rankers/entities/candidate.js | 2 + .../dist/rankers/entities/engagement-event.js | 2 + .../@amp/amd-apps/dist/rankers/entities/index.js | 18 + node_modules/@amp/amd-apps/dist/rankers/index.js | 18 + .../node_modules/@jet/environment/index.js | 23 + .../@jet/environment/json/validation.js | 250 ++ .../environment/models/actions/alert-action.js | 3 + .../environment/models/actions/compound-action.js | 22 + .../environment/models/actions/empty-action.js | 21 + .../models/actions/external-url-action.js | 3 + .../@jet/environment/models/actions/flow-action.js | 3 + .../environment/models/actions/flow-back-action.js | 3 + .../@jet/environment/models/actions/http-action.js | 3 + .../models/actions/http-template-action.js | 3 + .../@jet/environment/models/actions/index.js | 26 + .../environment/models/actions/toast-action.js | 3 + .../@jet/environment/models/artwork.js | 39 + .../node_modules/@jet/environment/models/button.js | 3 + .../node_modules/@jet/environment/models/color.js | 196 ++ .../node_modules/@jet/environment/models/index.js | 25 + .../node_modules/@jet/environment/models/menu.js | 8 + .../@jet/environment/models/paragraph.js | 4 + .../@jet/environment/models/programmed-text.js | 5 + .../node_modules/@jet/environment/models/video.js | 3 + .../@jet/environment/types/globals/bag.js | 3 + .../@jet/environment/types/globals/bundle.js | 3 + .../environment/types/globals/cookie-provider.js | 3 + .../@jet/environment/types/globals/cryptography.js | 3 + .../@jet/environment/types/globals/host.js | 3 + .../@jet/environment/types/globals/index.js | 55 + .../@jet/environment/types/globals/jscookie.js | 3 + .../@jet/environment/types/globals/net.js | 19 + .../@jet/environment/types/globals/platform.js | 3 + .../@jet/environment/types/globals/plist.js | 3 + .../@jet/environment/types/globals/preprocessor.js | 3 + .../@jet/environment/types/globals/random.js | 3 + .../@jet/environment/types/globals/service.js | 3 + .../@jet/environment/types/globals/types.js | 16 + .../environment/types/javascriptcore/console.js | 14 + .../@jet/environment/types/javascriptcore/index.js | 18 + .../node_modules/@jet/environment/types/metrics.js | 57 + .../node_modules/@jet/environment/types/models.js | 3 + .../@jet/environment/types/optional.js | 71 + .../node_modules/@jet/environment/util/metatype.js | 10 + .../node_modules/@jet/environment/util/urls.js | 373 +++ .../media-api/src/models/attributes.ts | 289 ++ .../media-api/src/models/server-data.ts | 476 ++++ .../media-api/src/models/urls.ts | 469 ++++ .../@apple-media-services/media-api/src/network.ts | 403 +++ .../@floating-ui/core/dist/floating-ui.core.mjs | 1046 ++++++++ .../@floating-ui/dom/dist/floating-ui.dom.mjs | 759 ++++++ .../utils/dist/floating-ui.utils.dom.mjs | 154 ++ .../@floating-ui/utils/dist/floating-ui.utils.mjs | 138 + .../tmp/src/api/intents/app-event-page-intent.js | 14 + .../src/api/intents/arcade-grouping-page-intent.js | 10 + .../tmp/src/api/intents/bundle-page-intent.js | 16 + .../tmp/src/api/intents/category-tabs-intent.js | 8 + .../tmp/src/api/intents/charts-hub-page-intent.js | 13 + .../tmp/src/api/intents/charts-page-intent.js | 13 + .../tmp/src/api/intents/developer-page-intent.js | 19 + .../api/intents/editorial/editorial-page-intent.js | 37 + .../editorial-shelf-collection-page-intent.js | 14 + .../tmp/src/api/intents/eula-page-intent.js | 19 + .../tmp/src/api/intents/grouping-page-intent.js | 33 + .../tmp/src/api/intents/product-page-intent.js | 17 + .../tmp/src/api/intents/room-page-intent.js | 16 + .../intents/routable-arcade-see-all-page-intent.js | 11 + .../api/intents/routable-article-page-intent.js | 13 + .../tmp/src/api/intents/routable-intent.js | 4 + .../src/api/intents/routable-today-page-intent.js | 10 + .../src/api/intents/search-results-page-intent.js | 19 + .../intents/search/search-landing-page-intent.js | 14 + .../tmp/src/api/intents/see-all-page-intent.js | 13 + .../app-store/tmp/src/api/models/accessibility.js | 37 + .../tmp/src/api/models/actions/actions.js | 525 ++++ .../tmp/src/api/models/actions/base-action.js | 15 + .../tmp/src/api/models/actions/flow-action.js | 26 + .../app-store/tmp/src/api/models/ad-incidents.js | 26 + .../app-store/tmp/src/api/models/annotation.js | 50 + .../app-store/tmp/src/api/models/app-promotions.js | 186 ++ .../app-store/tmp/src/api/models/arcade-upsell.js | 18 + .../app-store/tmp/src/api/models/arcade.js | 240 ++ .../app-store/tmp/src/api/models/article-page.js | 18 + .../@jet-app/app-store/tmp/src/api/models/base.js | 596 +++++ .../app-store/tmp/src/api/models/categories.js | 20 + .../tmp/src/api/models/dynamic-generic-page.js | 15 + .../app-store/tmp/src/api/models/generic-page.js | 47 + .../app-store/tmp/src/api/models/hero-carousel.js | 37 + .../api/models/metrics/advert-action-metrics.js | 21 + .../tmp/src/api/models/metrics/metrics.js | 101 + .../app-store/tmp/src/api/models/page-facets.js | 88 + .../tmp/src/api/models/page-refresh-policy.js | 17 + .../tmp/src/api/models/preview-platform.js | 25 + .../app-store/tmp/src/api/models/privacy.js | 75 + .../src/api/models/product-media-gallery-page.js | 12 + .../tmp/src/api/models/product-page-shelf-ids.js | 45 + .../app-store/tmp/src/api/models/product.js | 58 + .../app-store/tmp/src/api/models/reviews.js | 115 + .../src/api/models/search/guided-search-actions.js | 31 + .../tmp/src/api/models/search/guided-search.js | 48 + .../tmp/src/api/models/search/search-categories.js | 96 + .../app-store/tmp/src/api/models/search/search.js | 283 ++ .../tmp/src/api/models/shelf-based-product.js | 25 + .../app-store/tmp/src/api/models/shelves.js | 709 +++++ .../app-store/tmp/src/api/models/today-page.js | 300 +++ .../app-store/tmp/src/api/models/top-charts.js | 63 + .../@jet-app/app-store/tmp/src/api/models/uber.js | 19 + .../tmp/src/api/models/web-renderable-page.js | 4 + .../app-store/tmp/src/api/typings/constants.js | 21 + .../@jet-app/app-store/tmp/src/api/util.js | 16 + .../common/accessibility/accessibility-common.js | 70 + .../common/account/account-links-regex-parser.js | 35 + .../app-store/tmp/src/common/ads/ad-common.js | 433 +++ .../tmp/src/common/ads/ad-incident-recorder.js | 116 + .../app-store/tmp/src/common/ads/ad-stitcher.js | 73 + .../tmp/src/common/ads/on-device-ad-fetch.js | 286 ++ .../tmp/src/common/ads/on-device-ad-stitch.js | 98 + .../tmp/src/common/app-events/app-events-common.js | 83 + .../src/common/app-promotions/app-event-detail.js | 131 + .../tmp/src/common/app-promotions/app-event.js | 243 ++ .../tmp/src/common/app-promotions/app-promotion.js | 120 + .../common/app-promotions/app-promotions-common.js | 385 +++ .../common/app-promotions/app-promotions-shelf.js | 120 + .../app-promotions/contingent-offer-detail.js | 106 + .../src/common/app-promotions/contingent-offer.js | 189 ++ .../src/common/app-promotions/offer-item-detail.js | 147 + .../tmp/src/common/app-promotions/offer-item.js | 206 ++ .../tmp/src/common/arcade/arcade-common.js | 441 +++ .../common/arcade/arcade-see-all-games-facets.js | 245 ++ .../src/common/arcade/arcade-see-all-request.js | 78 + .../src/common/arcade/arcade-see-all-routing.js | 5 + .../tmp/src/common/arcade/arcade-upsell.js | 257 ++ .../tmp/src/common/arcade/breakouts-common.js | 272 ++ .../arcade/render-arcade-see-all-games-page.js | 227 ++ .../builders/additional-page-requirement-util.js | 36 + .../tmp/src/common/builders/pagination.js | 51 + .../app-store/tmp/src/common/builders/routing.js | 321 +++ .../tmp/src/common/builders/url-mapping-utils.js | 42 + .../tmp/src/common/builders/url-mapping.js | 627 +++++ .../app-store/tmp/src/common/categories.js | 149 ++ .../app-store/tmp/src/common/charts/charts-hub.js | 39 + .../tmp/src/common/charts/charts-page-model.js | 156 ++ .../tmp/src/common/charts/charts-page-url.js | 12 + .../tmp/src/common/constants/video-constants.js | 34 + .../tmp/src/common/content/age-ratings.js | 105 + .../tmp/src/common/content/artwork/artwork.js | 71 + .../src/common/content/artwork/legacy-artwork.js | 33 + .../app-store/tmp/src/common/content/attributes.js | 328 +++ .../app-store/tmp/src/common/content/content.js | 2820 ++++++++++++++++++++ .../tmp/src/common/content/device-family.js | 91 + .../tmp/src/common/content/flow-preview.js | 485 ++++ .../tmp/src/common/content/game-controller.js | 77 + .../tmp/src/common/content/product-capabilities.js | 322 +++ .../app-store/tmp/src/common/content/sad.js | 93 + .../tmp/src/common/developer/developer-common.js | 611 +++++ .../tmp/src/common/developer/developer-request.js | 115 + .../editorial-pages/editorial-action-util.js | 58 + .../common/editorial-pages/editorial-data-util.js | 173 ++ .../common/editorial-pages/editorial-media-util.js | 511 ++++ .../editorial-page-component-media-util.js | 76 + .../editorial-page-controller-util.js | 209 ++ .../editorial-page-editorial-copy-util.js | 247 ++ .../editorial-pages/editorial-page-hero-util.js | 88 + .../editorial-page-intent-controller-utils.js | 5 + .../editorial-pages/editorial-page-lockup-utils.js | 91 + .../editorial-page-media-api-utils.js | 39 + .../editorial-page-overlay-content-util.js | 20 + .../editorial-page-arcade-lockup-builder.js | 17 + ...rial-page-arcade-see-all-games-shelf-builder.js | 71 + .../editorial-page-chart-shelf-builder.js | 106 + ...page-breakout-large-collection-shelf-builder.js | 94 + ...ditorial-page-brick-collection-shelf-builder.js | 146 + .../editorial-page-collection-shelf-common.js | 248 ++ ...editorial-page-hero-collection-shelf-builder.js | 137 + ...itorial-page-lockup-collection-shelf-builder.js | 193 ++ ...ial-page-story-card-collection-shelf-builder.js | 70 + .../editorial-page-story-card-utils.js | 128 + ...rial-page-text-only-collection-shelf-builder.js | 54 + ...e-text-with-artwork-collection-shelf-builder.js | 66 + .../index.js | 113 + .../editorial-page-engagement-shelf-builder.js | 4 + .../editorial-page-game-center-shelf-builder.js | 4 + .../editorial-page-header-shelf-builder.js | 157 ++ .../editorial-page-image-shelf-builder.js | 4 + ...torial-page-quick-links-marker-shelf-builder.js | 71 + .../editorial-page-marker-shelf-builder/index.js | 20 + ...editorial-page-recommendations-shelf-builder.js | 77 + .../editorial-page-tag-shelf-builder.js | 4 + .../editorial-page-text-shelf-builder.js | 19 + .../editorial-page-upsell-shelf-builder.js | 31 + .../editorial-page-video-clip-shelf-builder.js | 4 + .../editorial-page-shelf-builder/index.js | 83 + .../editorial-page-shelf-metrics.js | 51 + .../editorial-pages/editorial-page-shelf-token.js | 120 + .../common/editorial-pages/editorial-page-types.js | 139 + .../editorial-shelf-collection-page-utils.js | 120 + .../@jet-app/app-store/tmp/src/common/filtering.js | 446 ++++ .../tmp/src/common/grouping/grouping-common.js | 319 +++ .../tmp/src/common/grouping/grouping-page-url.js | 8 + .../tmp/src/common/grouping/grouping-request.js | 107 + .../tmp/src/common/grouping/grouping-types.js | 128 + .../grouping/hero/hero-carousel-overlay-common.js | 263 ++ .../tmp/src/common/grouping/hero/hero-common.js | 90 + .../src/common/grouping/render-grouping-page.js | 246 ++ .../tmp/src/common/grouping/shelf-batching.js | 27 + .../arcade-download-pack-shelf-controller.js | 295 ++ .../grouping-app-event-shelf-controller.js | 260 ++ .../grouping-arcade-footer-shelf-controller.js | 160 ++ .../grouping-brick-shelf-controller.js | 313 +++ .../grouping-category-shelf-controller.js | 207 ++ .../grouping-editorial-card-shelf-controller.js | 229 ++ ...ouping-editorial-story-card-shelf-controller.js | 143 + ...g-game-center-activity-feed-shelf-controller.js | 223 ++ ...ame-center-continue-playing-shelf-controller.js | 332 +++ ...r-popular-with-your-friends-shelf-controller.js | 314 +++ ...ng-game-center-reengagement-shelf-controller.js | 254 ++ ...me-center-suggested-friends-shelf-controller.js | 279 ++ .../grouping-hero-carousel-shelf-controller.js | 182 ++ .../grouping-horizontal-card-shelf-controller.js | 122 + .../grouping-large-breakout-shelf-controller.js | 193 ++ .../grouping-link-shelf-controller.js | 169 ++ .../grouping-lockup-shelf-controller-common.js | 608 +++++ .../grouping-lockup-shelf-controller.js | 104 + ...rouping-personalized-lockup-shelf-controller.js | 368 +++ .../grouping-ribbon-bar-shelf-controller.js | 269 ++ .../grouping-shelf-controller-common.js | 992 +++++++ .../shelf-controllers/grouping-shelf-controller.js | 395 +++ .../grouping-small-breakout-shelf-controller.js | 168 ++ .../grouping-tag-brick-shelf-controller.js | 246 ++ .../grouping-tags-header-shelf-controller.js | 92 + .../tmp/src/common/linking/external-deep-link.js | 73 + .../tmp/src/common/linking/os-update-links.js | 42 + .../@jet-app/app-store/tmp/src/common/locale.js | 36 + .../app-store/tmp/src/common/lockups/ad-lockups.js | 439 +++ .../tmp/src/common/lockups/editorial-context.js | 25 + .../app-store/tmp/src/common/lockups/lockups.js | 1920 +++++++++++++ .../app-store/tmp/src/common/metrics/builder.js | 257 ++ .../tmp/src/common/metrics/event-linter.js | 563 ++++ .../tmp/src/common/metrics/helpers/buy.js | 331 +++ .../tmp/src/common/metrics/helpers/clicks.js | 458 ++++ .../tmp/src/common/metrics/helpers/constants.js | 11 + .../tmp/src/common/metrics/helpers/impressions.js | 419 +++ .../legacy-metrics-identifier-fields-opt-out.js | 18 + .../tmp/src/common/metrics/helpers/location.js | 188 ++ .../tmp/src/common/metrics/helpers/media.js | 34 + .../tmp/src/common/metrics/helpers/misc.js | 46 + .../tmp/src/common/metrics/helpers/models.js | 671 +++++ .../tmp/src/common/metrics/helpers/page.js | 482 ++++ .../metrics/helpers/search-focus-impressions.js | 57 + .../metrics/helpers/search-result-impressions.js | 56 + .../metrics/helpers/search/search-shelves.js | 98 + .../tmp/src/common/metrics/helpers/util.js | 407 +++ .../src/common/metrics/metrics-referral-context.js | 370 +++ .../tmp/src/common/offers/external-purchases.js | 65 + .../tmp/src/common/offers/offer-formatting.js | 231 ++ .../app-store/tmp/src/common/offers/offers.js | 1735 ++++++++++++ .../on-device-impression-demotion.js | 73 + .../on-device-personalization-processing.js | 370 +++ .../personalization/on-device-personalization.js | 134 + .../on-device-recommendations-common.js | 190 ++ .../on-device-recommendations-today.js | 329 +++ .../tmp/src/common/placeholders/placeholders.js | 229 ++ .../app-store/tmp/src/common/preview-platform.js | 87 + .../tmp/src/common/privacy/privacy-footer-shelf.js | 87 + .../tmp/src/common/privacy/privacy-header-shelf.js | 427 +++ .../tmp/src/common/privacy/privacy-suppression.js | 34 + .../tmp/src/common/privacy/privacy-types-shelf.js | 322 +++ .../common/product-page/badges/badges-common.js | 123 + .../tmp/src/common/product-page/badges/badges.js | 153 ++ .../common/product-page/badges/category-badge.js | 29 + .../src/common/product-page/badges/chart-badge.js | 37 + .../product-page/badges/content-rating-badge.js | 76 + .../common/product-page/badges/controller-badge.js | 178 ++ .../common/product-page/badges/developer-badge.js | 56 + .../product-page/badges/editors-choice-badge.js | 55 + .../product-page/badges/friends-playing-badge.js | 23 + .../common/product-page/badges/language-badge.js | 27 + .../product-page/badges/multiplayer-badge.js | 63 + .../src/common/product-page/badges/rating-badge.js | 72 + .../src/common/product-page/badges/size-badge.js | 25 + .../badges/storefront-content-rating-badge.js | 75 + .../tmp/src/common/product-page/banner.js | 460 ++++ .../src/common/product-page/bundle-page-common.js | 19 + .../product-page/intent-controller-routing.js | 81 + .../src/common/product-page/product-page-common.js | 604 +++++ .../product-page/product-page-shelf-metrics.js | 82 + .../src/common/product-page/product-page-util.js | 65 + .../common/product-page/product-page-variants.js | 499 ++++ .../tmp/src/common/product-page/product-page.js | 225 ++ .../tmp/src/common/product-page/reviews.js | 1077 ++++++++ .../shelf-based/product-page-section-mapping.js | 40 + .../product-page-shelf-ordering-ios-arcade.js | 215 ++ .../product-page-shelf-ordering-ios.js | 247 ++ .../product-page-shelf-ordering-mac-arcade.js | 62 + .../product-page-shelf-ordering-mac.js | 70 + .../product-page-shelf-ordering-tvos-arcade.js | 50 + .../product-page-shelf-ordering-tvos.js | 50 + .../product-page-shelf-ordering-visionos-arcade.js | 54 + .../product-page-shelf-ordering-visionos.js | 50 + .../product-page-shelf-ordering-watch.js | 28 + .../product-page-shelf-ordering-web-arcade.js | 15 + .../product-page-shelf-ordering-web.js | 15 + .../product-page-shelf-ordering.js | 117 + .../shelf-based/shelf-based-product-page.js | 1059 ++++++++ .../product-page/shelves/accessibility-shelves.js | 544 ++++ .../product-page/shelves/achievements-shelf.js | 82 + .../product-page/shelves/action-links-shelf.js | 136 + .../shelves/annotations/annotations.js | 310 +++ .../shelves/annotations/category-annotation.js | 33 + .../annotations/compatibility-annotation.js | 169 ++ .../annotations/content-rating-annotation.js | 368 +++ .../shelves/annotations/controller-annotation.js | 68 + .../shelves/annotations/copyright-annotation.js | 18 + .../annotations/external-browser-annotation.js | 54 + .../annotations/external-purchases-annotation.js | 39 + .../shelves/annotations/game-license-annotation.js | 73 + .../shelves/annotations/high-motion-annotation.js | 53 + .../shelves/annotations/languages-annotation.js | 61 + .../shelves/annotations/location-annotation.js | 18 + .../annotations/product-capabilities-annotation.js | 25 + .../shelves/annotations/seller-annotation.js | 117 + .../shelves/annotations/size-annotation.js | 61 + .../annotations/spatial-controller-annotation.js | 60 + .../storefront-content-rating-annotation.js | 53 + .../annotations/top-in-app-purchases-annotation.js | 142 + .../shelves/annotations/version-annotation.js | 41 + .../product-page/shelves/bundle-children-shelf.js | 52 + .../product-page/shelves/bundle-parents-shelf.js | 46 + .../product-page/shelves/capabilities-shelf.js | 41 + .../product-page/shelves/description-shelf.js | 144 + .../product-page/shelves/editorial-quote-shelf.js | 36 + .../product-page/shelves/editors-choice-shelf.js | 63 + .../product-page/shelves/featured-in-shelf.js | 53 + .../product-page/shelves/friends-playing-shelf.js | 177 ++ .../product-page/shelves/in-app-purchases-shelf.js | 198 ++ .../src/common/product-page/shelves/links-shelf.js | 269 ++ .../shelves/more-by-developer-shelf.js | 192 ++ .../product-page/shelves/product-media-shelf.js | 244 ++ .../common/product-page/shelves/ribbon-shelf.js | 40 + .../shelves/shelf-based-reviews-shelves.js | 544 ++++ .../product-page/shelves/similar-items-shelf.js | 253 ++ .../product-page/shelves/small-story-card-shelf.js | 137 + .../product-page/shelves/text-links-shelf.js | 59 + .../common/product-page/shelves/textcard-shelf.js | 226 ++ .../shelves/version-history-shelves.js | 149 ++ .../src/common/product-page/shelves/video-shelf.js | 38 + .../src/common/refresh/page-refresh-controller.js | 123 + .../app-store/tmp/src/common/room/room-common.js | 139 + .../app-store/tmp/src/common/room/room-page.js | 105 + .../app-store/tmp/src/common/room/room-request.js | 48 + .../src/common/search/content/search-categories.js | 334 +++ .../common/search/content/search-content-common.js | 31 + .../search/content/search-lockup-collection.js | 171 ++ .../src/common/search/content/search-results.js | 723 +++++ .../src/common/search/content/search-shelves.js | 53 + .../tmp/src/common/search/custom-creative.js | 71 + .../search/guided-search/guided-search-metrics.js | 132 + .../common/search/guided-search/guided-search.js | 105 + .../common/search/landing/search-landing-cohort.js | 84 + .../landing/search-landing-shelf-controller.js | 836 ++++++ .../category-metadata-ribbon-item.js | 38 + .../metadata-ribbon/chart-metadata-ribbon-item.js | 75 + .../developer-metadata-ribbon-item.js | 37 + .../divider-metadata-ribbon-item.js | 8 + .../editors-choice-metadata-ribbon-item.js | 21 + .../game-controller-metadata-ribbon-item.js | 36 + .../metadata-ribbon-item-factory.js | 24 + .../search/metadata-ribbon/metadata-ribbon.js | 27 + ...nked-secondary-category-metadata-ribbon-item.js | 22 + .../search/metadata-ribbon/search-tags-ribbon.js | 72 + ...ondary-short-categories-metadata-ribbon-item.js | 27 + .../short-category-metadata-ribbon-item.js | 36 + .../star-rating-metadata-ribbon-item.js | 20 + .../metadata-ribbon/tag-metadata-ribbon-item.js | 18 + .../tmp/src/common/search/search-ads-odml.js | 87 + .../app-store/tmp/src/common/search/search-ads.js | 1047 ++++++++ .../tmp/src/common/search/search-common.js | 59 + .../tmp/src/common/search/search-facets.js | 146 + .../src/common/search/search-landing-page-utils.js | 386 +++ .../tmp/src/common/search/search-page-url.js | 5 + .../src/common/search/search-results-fetching.js | 496 ++++ .../search/search-results-learn-more-notice.js | 46 + .../src/common/search/search-results-pipeline.js | 248 ++ .../src/common/search/search-spell-correction.js | 98 + .../tmp/src/common/search/search-token.js | 57 + .../app-store/tmp/src/common/search/search.js | 1024 +++++++ .../common/search/shelves/search-history-shelf.js | 148 + .../src/common/search/sponsored-search-fetching.js | 122 + .../tmp/src/common/search/web-search-action.js | 23 + .../@jet-app/app-store/tmp/src/common/sharing.js | 428 +++ .../tmp/src/common/today/article-request.js | 86 + .../app-store/tmp/src/common/today/article.js | 1572 +++++++++++ .../category-detail-motion-16x9.js | 34 + .../category-detail-static-16x9.js | 49 + .../today/artwork/media-configurations/day-card.js | 51 + .../artwork/media-configurations/event-card.js | 51 + .../artwork/media-configurations/general-card.js | 51 + .../today/artwork/media-configurations/index.js | 85 + .../media-configurations/list-card-motion-21x9.js | 116 + .../media-configurations/list-card-static-21x9.js | 92 + .../artwork/media-configurations/media-card.js | 51 + .../media-configurations/store-front-video-4x3.js | 22 + .../media-configurations/store-front-video.js | 25 + .../media-configurations/story-card-motion-16x9.js | 34 + .../media-configurations/story-card-static-16x9.js | 49 + .../story-centered-motion-16x9.js | 34 + .../story-centered-static-16x9.js | 49 + .../universal-a-motion-16x9.js | 146 + .../universal-a-static-16x9.js | 107 + .../src/common/today/artwork/today-artwork-util.js | 267 ++ .../common/today/cards/today-ad-card-builder.js | 232 ++ .../today/cards/today-app-event-card-builder.js | 112 + .../common/today/cards/today-base-card-builder.js | 244 ++ .../today/cards/today-branded-card-builder.js | 58 + .../cards/today-full-bleed-image-card-builder.js | 37 + .../cards/today-in-app-purchase-card-builder.js | 62 + .../common/today/cards/today-list-card-builder.js | 71 + .../common/today/cards/today-river-card-builder.js | 62 + .../today/cards/today-short-image-card-builder.js | 42 + .../today/cards/today-single-app-card-builder.js | 81 + .../common/today/cards/today-video-card-builder.js | 33 + .../tmp/src/common/today/onboarding-cards.js | 23 + .../today/routable-article-page-url-utils.js | 32 + .../src/common/today/today-card-overlay-util.js | 111 + .../tmp/src/common/today/today-card-util.js | 785 ++++++ .../tmp/src/common/today/today-controller-util.js | 534 ++++ .../src/common/today/today-horizontal-card-util.js | 352 +++ .../tmp/src/common/today/today-parse-util.js | 1047 ++++++++ .../app-store/tmp/src/common/today/today-types.js | 118 + .../app-store/tmp/src/common/top-charts-common.js | 212 ++ .../tmp/src/common/top-charts/top-charts-page.js | 161 ++ .../app-store/tmp/src/common/util/app-tags-util.js | 25 + .../tmp/src/common/util/generate-routes.js | 183 ++ .../app-store/tmp/src/common/util/lottery.js | 62 + .../app-store/tmp/src/common/util/page-common.js | 25 + .../web-navigation/flow-action-presentation.js | 79 + .../common/web-navigation/inject-web-navigation.js | 32 + .../landing-page-links-by-platform.js | 62 + .../platform-landing-page-intent-controllers.js | 155 ++ .../web-navigation/platform-landing-page-utils.js | 139 + .../common/web-navigation/platform-selection.js | 115 + .../search-results-platform-selection.js | 28 + .../src/common/web-navigation/web-navigation.js | 28 + .../app-events/app-event-page-intent-controller.js | 42 + .../arcade-grouping-page-intent-controller.js | 71 + .../routable-arcade-see-all-page-controller.js | 42 + .../developer/developer-page-intent-controller.js | 28 + .../editorial-page-intent-controller.js | 55 + ...rial-shelf-collection-page-intent-controller.js | 35 + .../grouping/grouping-page-intent-controller.js | 58 + .../product-page/bundle-page-intent-controller.js | 61 + .../product-page/eula-page-intent-controller.js | 38 + .../product-page/product-page-intent-controller.js | 63 + .../product-page/see-all-intent-controller.js | 39 + .../room/room-page-intent-controller.js | 29 + .../search-landing-page-intent-controller.js | 34 + .../search/search-results-controller.js | 152 ++ .../routable-article-page-intent-controller.js | 53 + .../today/routable-today-page-intent-controller.js | 21 + .../charts-hub-page-intent-controller.js | 39 + .../top-charts/charts-page-intent-controller.js | 25 + .../category-tabs-intent-controller.js | 62 + .../amp-localization/amp-localization.js | 371 +++ .../src/foundation/dependencies/active-intent.js | 121 + .../dependencies/locale/locale-from-bag.js | 41 + .../src/foundation/dependencies/locale/locale.js | 3 + .../tmp/src/foundation/dependencies/seo.js | 3 + .../experimentation/app-store-experiments.js | 7 + .../experimentation/experiment-area-id.js | 10 + .../foundation/experimentation/experiment-cache.js | 63 + .../experimentation/product-page-experiments.js | 21 + .../experimentation/search-results-experiments.js | 10 + .../experimentation/today-ad-experiments.js | 15 + .../src/foundation/json-parsing/derived-data.js | 37 + .../tmp/src/foundation/json-parsing/server-data.js | 464 ++++ .../tmp/src/foundation/media/associations.js | 17 + .../tmp/src/foundation/media/attributes.js | 149 ++ .../tmp/src/foundation/media/data-fetching.js | 631 +++++ .../tmp/src/foundation/media/data-structure.js | 84 + .../app-store/tmp/src/foundation/media/network.js | 304 +++ .../src/foundation/media/platform-attributes.js | 143 + .../tmp/src/foundation/media/relationships.js | 43 + .../tmp/src/foundation/media/url-builder.js | 381 +++ .../app-store/tmp/src/foundation/media/util.js | 185 ++ .../tmp/src/foundation/metrics/buy-parameters.js | 112 + .../tmp/src/foundation/metrics/cookies.js | 27 + .../metrics/metrics-identifiers-cache.js | 245 ++ .../app-store/tmp/src/foundation/network/http.js | 42 + .../tmp/src/foundation/network/network.js | 123 + .../tmp/src/foundation/network/url-constants.js | 452 ++++ .../app-store/tmp/src/foundation/network/urls.js | 382 +++ .../src/foundation/routing/routing-components.js | 318 +++ .../tmp/src/foundation/runtime/action-provider.js | 13 + .../runtime/app-store-intent-dispatcher.js | 62 + .../foundation/runtime/app-store-object-graph.js | 380 +++ .../tmp/src/foundation/runtime/runtime.js | 52 + .../tmp/src/foundation/util/array-util.js | 32 + .../tmp/src/foundation/util/color-util.js | 231 ++ .../app-store/tmp/src/foundation/util/constants.js | 26 + .../app-store/tmp/src/foundation/util/date-util.js | 127 + .../app-store/tmp/src/foundation/util/errors.js | 13 + .../app-store/tmp/src/foundation/util/math-util.js | 32 + .../app-store/tmp/src/foundation/util/objects.js | 33 + .../tmp/src/foundation/util/promise-util.js | 215 ++ .../tmp/src/foundation/util/string-util.js | 127 + .../tmp/src/foundation/util/validation-util.js | 30 + .../tmp/src/foundation/wrappers/apple-silicon.js | 13 + .../app-store/tmp/src/foundation/wrappers/bag.js | 1126 ++++++++ .../tmp/src/foundation/wrappers/cached-bag.js | 82 + .../tmp/src/foundation/wrappers/client-ordering.js | 43 + .../tmp/src/foundation/wrappers/client.js | 204 ++ .../tmp/src/foundation/wrappers/console.js | 18 + .../app-store/tmp/src/foundation/wrappers/host.js | 64 + .../tmp/src/foundation/wrappers/localization.js | 437 +++ .../tmp/src/foundation/wrappers/properties.js | 74 + .../tmp/src/foundation/wrappers/storage.js | 22 + .../tmp/src/foundation/wrappers/wrapper.js | 6 + .../requests/recommendation-request-types.js | 49 + .../src/foundation/object-graph-types.js | 20 + .../@jet/engine/lib/actions/action-dispatcher.js | 64 + node_modules/@jet/engine/lib/actions/index.js | 13 + node_modules/@jet/engine/lib/dependencies/index.js | 17 + .../@jet/engine/lib/dependencies/jet-bag.js | 40 + .../@jet/engine/lib/dependencies/jet-host.js | 19 + .../engine/lib/dependencies/jet-network-fetch.js | 39 + .../lib/dependencies/localized-strings-bundle.js | 68 + .../dependencies/localized-strings-json-object.js | 21 + node_modules/@jet/engine/lib/index.js | 15 + .../@jet/engine/lib/metrics/aggregating/index.js | 16 + .../aggregating/metrics-fields-aggregator.js | 45 + .../metrics/aggregating/metrics-fields-builder.js | 15 + .../metrics/aggregating/metrics-fields-context.js | 2 + .../metrics/aggregating/metrics-fields-provider.js | 2 + .../engine/lib/metrics/field-providers/index.js | 13 + .../page-metrics-fields-provider.js | 19 + node_modules/@jet/engine/lib/metrics/index.js | 18 + .../@jet/engine/lib/metrics/linting/index.js | 13 + .../lib/metrics/linting/metrics-event-linter.js | 2 + .../@jet/engine/lib/metrics/metrics-pipeline.js | 34 + .../@jet/engine/lib/metrics/presenters/index.js | 13 + .../metrics/presenters/page-metrics-presenter.js | 52 + .../@jet/engine/lib/metrics/recording/index.js | 14 + .../metrics/recording/logging-event-recorder.js | 13 + .../metrics/recording/metrics-event-recorder.js | 2 + .../engine/node_modules/@jet/environment/index.js | 23 + .../@jet/environment/json/validation.js | 250 ++ .../environment/models/actions/alert-action.js | 3 + .../environment/models/actions/compound-action.js | 22 + .../environment/models/actions/empty-action.js | 21 + .../models/actions/external-url-action.js | 3 + .../@jet/environment/models/actions/flow-action.js | 3 + .../environment/models/actions/flow-back-action.js | 3 + .../@jet/environment/models/actions/http-action.js | 3 + .../models/actions/http-template-action.js | 3 + .../@jet/environment/models/actions/index.js | 26 + .../environment/models/actions/toast-action.js | 3 + .../@jet/environment/models/artwork.js | 39 + .../node_modules/@jet/environment/models/button.js | 3 + .../node_modules/@jet/environment/models/color.js | 196 ++ .../node_modules/@jet/environment/models/index.js | 25 + .../node_modules/@jet/environment/models/menu.js | 8 + .../@jet/environment/models/paragraph.js | 4 + .../@jet/environment/models/programmed-text.js | 5 + .../node_modules/@jet/environment/models/video.js | 3 + .../@jet/environment/types/globals/bag.js | 3 + .../@jet/environment/types/globals/bundle.js | 3 + .../environment/types/globals/cookie-provider.js | 3 + .../@jet/environment/types/globals/cryptography.js | 3 + .../@jet/environment/types/globals/host.js | 3 + .../@jet/environment/types/globals/index.js | 55 + .../@jet/environment/types/globals/jscookie.js | 3 + .../@jet/environment/types/globals/net.js | 19 + .../@jet/environment/types/globals/platform.js | 3 + .../@jet/environment/types/globals/plist.js | 3 + .../@jet/environment/types/globals/preprocessor.js | 3 + .../@jet/environment/types/globals/random.js | 3 + .../@jet/environment/types/globals/service.js | 3 + .../@jet/environment/types/globals/types.js | 16 + .../environment/types/javascriptcore/console.js | 14 + .../@jet/environment/types/javascriptcore/index.js | 18 + .../node_modules/@jet/environment/types/metrics.js | 57 + .../node_modules/@jet/environment/types/models.js | 3 + .../@jet/environment/types/optional.js | 71 + .../node_modules/@jet/environment/util/metatype.js | 10 + .../node_modules/@jet/environment/util/urls.js | 373 +++ .../@jet/environment/dependencies/index.js | 18 + .../@jet/environment/dependencies/jet-proxy.js | 106 + .../@jet/environment/dependencies/object-graph.js | 49 + .../dispatching/actions/action-provider.js | 18 + .../@jet/environment/dispatching/actions/index.js | 18 + .../environment/dispatching/base/dispatchable.js | 3 + .../environment/dispatching/base/dispatcher.js | 97 + .../@jet/environment/dispatching/base/index.js | 21 + .../dispatching/base/intent-controller.js | 12 + .../@jet/environment/dispatching/base/intent.js | 178 ++ node_modules/@jet/environment/dispatching/index.js | 19 + node_modules/@jet/environment/index.js | 22 + node_modules/@jet/environment/json/index.js | 19 + .../@jet/environment/json/reader/coercion.js | 139 + node_modules/@jet/environment/json/reader/index.js | 20 + .../@jet/environment/json/reader/key-path.js | 143 + .../@jet/environment/json/reader/object-cursor.js | 119 + .../@jet/environment/json/reader/object-reader.js | 428 +++ .../@jet/environment/json/reader/traverse.js | 36 + node_modules/@jet/environment/json/validation.js | 250 ++ node_modules/@jet/environment/metrics/builder.js | 456 ++++ node_modules/@jet/environment/metrics/cookies.js | 46 + .../@jet/environment/metrics/event-linter.js | 155 ++ .../metrics/fetch-timing-metrics-builder.js | 96 + .../@jet/environment/metrics/helpers/index.js | 21 + .../@jet/environment/metrics/helpers/location.js | 213 ++ .../@jet/environment/metrics/helpers/models.js | 3 + .../@jet/environment/metrics/helpers/numerics.js | 23 + .../@jet/environment/metrics/helpers/util.js | 76 + node_modules/@jet/environment/metrics/index.js | 23 + .../environment/metrics/parse-and-build-model.js | 116 + .../environment/models/actions/alert-action.js | 3 + .../environment/models/actions/compound-action.js | 22 + .../environment/models/actions/empty-action.js | 21 + .../models/actions/external-url-action.js | 3 + .../@jet/environment/models/actions/flow-action.js | 3 + .../environment/models/actions/flow-back-action.js | 3 + .../@jet/environment/models/actions/http-action.js | 3 + .../models/actions/http-template-action.js | 3 + .../@jet/environment/models/actions/index.js | 26 + .../environment/models/actions/toast-action.js | 3 + node_modules/@jet/environment/models/artwork.js | 39 + node_modules/@jet/environment/models/button.js | 3 + node_modules/@jet/environment/models/color.js | 196 ++ node_modules/@jet/environment/models/index.js | 25 + node_modules/@jet/environment/models/menu.js | 8 + node_modules/@jet/environment/models/paragraph.js | 4 + .../@jet/environment/models/programmed-text.js | 5 + node_modules/@jet/environment/models/video.js | 3 + node_modules/@jet/environment/routing/index.js | 20 + .../@jet/environment/routing/route-provider.js | 29 + .../@jet/environment/routing/router-factory.js | 22 + node_modules/@jet/environment/routing/router.js | 39 + .../@jet/environment/routing/routing-components.js | 295 ++ node_modules/@jet/environment/runtime/bootstrap.js | 47 + node_modules/@jet/environment/runtime/index.js | 19 + node_modules/@jet/environment/runtime/runtime.js | 35 + node_modules/@jet/environment/types/globals/bag.js | 3 + .../@jet/environment/types/globals/bundle.js | 3 + .../environment/types/globals/cookie-provider.js | 3 + .../@jet/environment/types/globals/cryptography.js | 3 + .../@jet/environment/types/globals/host.js | 3 + .../@jet/environment/types/globals/index.js | 55 + .../@jet/environment/types/globals/jscookie.js | 3 + node_modules/@jet/environment/types/globals/net.js | 19 + .../@jet/environment/types/globals/platform.js | 3 + .../@jet/environment/types/globals/plist.js | 3 + .../@jet/environment/types/globals/preprocessor.js | 3 + .../@jet/environment/types/globals/random.js | 3 + .../@jet/environment/types/globals/service.js | 3 + .../@jet/environment/types/globals/types.js | 16 + node_modules/@jet/environment/types/index.js | 22 + .../environment/types/javascriptcore/console.js | 14 + .../@jet/environment/types/javascriptcore/index.js | 18 + node_modules/@jet/environment/types/metrics.js | 57 + node_modules/@jet/environment/types/models.js | 3 + node_modules/@jet/environment/types/optional.js | 71 + node_modules/@jet/environment/util/clone.js | 18 + .../@jet/environment/util/expiring-value.js | 22 + node_modules/@jet/environment/util/index.js | 24 + node_modules/@jet/environment/util/metatype.js | 10 + node_modules/@jet/environment/util/promise.js | 9 + .../@jet/environment/util/rewindable-value.js | 58 + node_modules/@jet/environment/util/set.js | 92 + node_modules/@jet/environment/util/urls.js | 430 +++ node_modules/he/he.js | 345 +++ node_modules/svelte/src/runtime/easing/index.js | 309 +++ .../svelte/src/runtime/internal/Component.js | 524 ++++ .../svelte/src/runtime/internal/await_block.js | 100 + .../src/runtime/internal/disclose-version/index.js | 5 + node_modules/svelte/src/runtime/internal/dom.js | 1251 +++++++++ node_modules/svelte/src/runtime/internal/each.js | 143 + .../svelte/src/runtime/internal/environment.js | 19 + .../svelte/src/runtime/internal/globals.js | 8 + .../svelte/src/runtime/internal/lifecycle.js | 183 ++ node_modules/svelte/src/runtime/internal/loop.js | 45 + .../svelte/src/runtime/internal/scheduler.js | 135 + node_modules/svelte/src/runtime/internal/spread.js | 35 + .../svelte/src/runtime/internal/style_manager.js | 99 + .../svelte/src/runtime/internal/transitions.js | 461 ++++ node_modules/svelte/src/runtime/internal/utils.js | 291 ++ node_modules/svelte/src/runtime/store/index.js | 199 ++ .../svelte/src/runtime/transition/index.js | 255 ++ node_modules/svelte/src/shared/version.js | 10 + 691 files changed, 92364 insertions(+) create mode 100644 node_modules/@amp/amd-apps/dist/index.js create mode 100644 node_modules/@amp/amd-apps/dist/rankers/engagement-based-demotion.js create mode 100644 node_modules/@amp/amd-apps/dist/rankers/entities/candidate.js create mode 100644 node_modules/@amp/amd-apps/dist/rankers/entities/engagement-event.js create mode 100644 node_modules/@amp/amd-apps/dist/rankers/entities/index.js create mode 100644 node_modules/@amp/amd-apps/dist/rankers/index.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/index.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/json/validation.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/alert-action.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/compound-action.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/empty-action.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/external-url-action.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/flow-action.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/flow-back-action.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/http-action.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/http-template-action.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/index.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/toast-action.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/artwork.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/button.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/color.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/index.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/menu.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/paragraph.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/programmed-text.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/video.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/bag.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/bundle.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/cookie-provider.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/cryptography.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/host.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/index.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/jscookie.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/net.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/platform.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/plist.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/preprocessor.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/random.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/service.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/types.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/javascriptcore/console.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/javascriptcore/index.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/metrics.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/models.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/optional.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/util/metatype.js create mode 100644 node_modules/@apple-media-services/media-api/node_modules/@jet/environment/util/urls.js create mode 100644 node_modules/@apple-media-services/media-api/src/models/attributes.ts create mode 100644 node_modules/@apple-media-services/media-api/src/models/server-data.ts create mode 100644 node_modules/@apple-media-services/media-api/src/models/urls.ts create mode 100644 node_modules/@apple-media-services/media-api/src/network.ts create mode 100644 node_modules/@floating-ui/core/dist/floating-ui.core.mjs create mode 100644 node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs create mode 100644 node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs create mode 100644 node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/app-event-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/arcade-grouping-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/bundle-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/category-tabs-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/charts-hub-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/charts-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/developer-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/editorial/editorial-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/editorial/editorial-shelf-collection-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/eula-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/grouping-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/product-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/room-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/routable-arcade-see-all-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/routable-article-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/routable-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/routable-today-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/search-results-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/search/search-landing-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/intents/see-all-page-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/accessibility.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/actions/actions.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/actions/base-action.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/actions/flow-action.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/ad-incidents.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/app-promotions.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/arcade-upsell.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/arcade.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/article-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/base.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/categories.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/dynamic-generic-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/generic-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/hero-carousel.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/metrics/advert-action-metrics.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/metrics/metrics.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/page-facets.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/page-refresh-policy.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/preview-platform.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/privacy.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/product-media-gallery-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/product-page-shelf-ids.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/product.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/reviews.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/search/guided-search-actions.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/search/guided-search.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/search/search-categories.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/search/search.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/shelf-based-product.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/shelves.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/today-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/top-charts.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/uber.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/models/web-renderable-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/typings/constants.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/api/util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/accessibility/accessibility-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/account/account-links-regex-parser.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/ads/ad-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/ads/ad-incident-recorder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/ads/ad-stitcher.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/ads/on-device-ad-fetch.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/ads/on-device-ad-stitch.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/app-events/app-events-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/app-promotions/app-event-detail.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/app-promotions/app-event.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/app-promotions/app-promotion.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/app-promotions/app-promotions-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/app-promotions/app-promotions-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/app-promotions/contingent-offer-detail.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/app-promotions/contingent-offer.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/app-promotions/offer-item-detail.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/app-promotions/offer-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/arcade/arcade-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/arcade/arcade-see-all-games-facets.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/arcade/arcade-see-all-request.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/arcade/arcade-see-all-routing.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/arcade/arcade-upsell.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/arcade/breakouts-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/arcade/render-arcade-see-all-games-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/builders/additional-page-requirement-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/builders/pagination.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/builders/routing.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/builders/url-mapping-utils.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/builders/url-mapping.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/categories.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/charts/charts-hub.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/charts/charts-page-model.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/charts/charts-page-url.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/constants/video-constants.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/content/age-ratings.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/content/artwork/artwork.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/content/artwork/legacy-artwork.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/content/attributes.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/content/content.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/content/device-family.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/content/flow-preview.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/content/game-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/content/product-capabilities.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/content/sad.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/developer/developer-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/developer/developer-request.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-action-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-data-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-media-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-component-media-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-controller-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-editorial-copy-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-hero-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-intent-controller-utils.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-lockup-utils.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-media-api-utils.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-overlay-content-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-arcade-lockup-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-arcade-see-all-games-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-chart-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-collection-shelf-builder/editorial-page-breakout-large-collection-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-collection-shelf-builder/editorial-page-brick-collection-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-collection-shelf-builder/editorial-page-collection-shelf-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-collection-shelf-builder/editorial-page-hero-collection-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-collection-shelf-builder/editorial-page-lockup-collection-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-collection-shelf-builder/editorial-page-story-card-collection-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-collection-shelf-builder/editorial-page-story-card-utils.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-collection-shelf-builder/editorial-page-text-only-collection-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-collection-shelf-builder/editorial-page-text-with-artwork-collection-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-collection-shelf-builder/index.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-engagement-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-game-center-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-header-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-image-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-marker-shelf-builder/editorial-page-quick-links-marker-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-marker-shelf-builder/index.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-recommendations-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-tag-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-text-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-upsell-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/editorial-page-video-clip-shelf-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-builder/index.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-metrics.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-shelf-token.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-page-types.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/editorial-pages/editorial-shelf-collection-page-utils.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/filtering.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/grouping-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/grouping-page-url.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/grouping-request.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/grouping-types.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/hero/hero-carousel-overlay-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/hero/hero-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/render-grouping-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-batching.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/arcade-download-pack-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-app-event-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-arcade-footer-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-brick-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-category-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-editorial-card-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-editorial-story-card-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-game-center-activity-feed-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-game-center-continue-playing-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-game-center-popular-with-your-friends-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-game-center-reengagement-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-game-center-suggested-friends-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-hero-carousel-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-horizontal-card-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-large-breakout-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-link-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-lockup-shelf-controller-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-lockup-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-personalized-lockup-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-ribbon-bar-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-shelf-controller-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-small-breakout-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-tag-brick-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/grouping/shelf-controllers/grouping-tags-header-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/linking/external-deep-link.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/linking/os-update-links.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/locale.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/lockups/ad-lockups.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/lockups/editorial-context.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/lockups/lockups.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/event-linter.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/buy.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/clicks.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/constants.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/impressions.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/legacy-metrics-identifier-fields-opt-out.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/location.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/media.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/misc.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/models.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/search-focus-impressions.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/search-result-impressions.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/search/search-shelves.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/helpers/util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/metrics/metrics-referral-context.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/offers/external-purchases.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/offers/offer-formatting.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/offers/offers.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/personalization/on-device-impression-demotion.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/personalization/on-device-personalization-processing.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/personalization/on-device-personalization.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/personalization/on-device-recommendations-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/personalization/on-device-recommendations-today.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/placeholders/placeholders.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/preview-platform.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/privacy/privacy-footer-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/privacy/privacy-header-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/privacy/privacy-suppression.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/privacy/privacy-types-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/badges-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/badges.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/category-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/chart-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/content-rating-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/controller-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/developer-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/editors-choice-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/friends-playing-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/language-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/multiplayer-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/rating-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/size-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/badges/storefront-content-rating-badge.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/banner.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/bundle-page-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/intent-controller-routing.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/product-page-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/product-page-shelf-metrics.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/product-page-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/product-page-variants.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/product-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/reviews.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-section-mapping.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering-ios-arcade.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering-ios.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering-mac-arcade.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering-mac.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering-tvos-arcade.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering-tvos.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering-visionos-arcade.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering-visionos.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering-watch.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering-web-arcade.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering-web.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/product-page-shelf-ordering/product-page-shelf-ordering.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelf-based/shelf-based-product-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/accessibility-shelves.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/achievements-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/action-links-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/annotations.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/category-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/compatibility-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/content-rating-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/controller-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/copyright-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/external-browser-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/external-purchases-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/game-license-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/high-motion-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/languages-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/location-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/product-capabilities-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/seller-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/size-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/spatial-controller-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/storefront-content-rating-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/top-in-app-purchases-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/annotations/version-annotation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/bundle-children-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/bundle-parents-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/capabilities-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/description-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/editorial-quote-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/editors-choice-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/featured-in-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/friends-playing-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/in-app-purchases-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/links-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/more-by-developer-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/product-media-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/ribbon-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/shelf-based-reviews-shelves.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/similar-items-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/small-story-card-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/text-links-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/textcard-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/version-history-shelves.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/product-page/shelves/video-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/refresh/page-refresh-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/room/room-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/room/room-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/room/room-request.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/content/search-categories.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/content/search-content-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/content/search-lockup-collection.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/content/search-results.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/content/search-shelves.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/custom-creative.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/guided-search/guided-search-metrics.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/guided-search/guided-search.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/landing/search-landing-cohort.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/landing/search-landing-shelf-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/category-metadata-ribbon-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/chart-metadata-ribbon-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/developer-metadata-ribbon-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/divider-metadata-ribbon-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/editors-choice-metadata-ribbon-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/game-controller-metadata-ribbon-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/metadata-ribbon-item-factory.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/metadata-ribbon.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/ranked-secondary-category-metadata-ribbon-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/search-tags-ribbon.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/secondary-short-categories-metadata-ribbon-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/short-category-metadata-ribbon-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/star-rating-metadata-ribbon-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/metadata-ribbon/tag-metadata-ribbon-item.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search-ads-odml.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search-ads.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search-facets.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search-landing-page-utils.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search-page-url.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search-results-fetching.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search-results-learn-more-notice.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search-results-pipeline.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search-spell-correction.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search-token.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/search.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/shelves/search-history-shelf.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/sponsored-search-fetching.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/search/web-search-action.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/sharing.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/article-request.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/article.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/category-detail-motion-16x9.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/category-detail-static-16x9.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/day-card.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/event-card.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/general-card.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/index.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/list-card-motion-21x9.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/list-card-static-21x9.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/media-card.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/store-front-video-4x3.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/store-front-video.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/story-card-motion-16x9.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/story-card-static-16x9.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/story-centered-motion-16x9.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/story-centered-static-16x9.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/universal-a-motion-16x9.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/media-configurations/universal-a-static-16x9.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/artwork/today-artwork-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/cards/today-ad-card-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/cards/today-app-event-card-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/cards/today-base-card-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/cards/today-branded-card-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/cards/today-full-bleed-image-card-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/cards/today-in-app-purchase-card-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/cards/today-list-card-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/cards/today-river-card-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/cards/today-short-image-card-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/cards/today-single-app-card-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/cards/today-video-card-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/onboarding-cards.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/routable-article-page-url-utils.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/today-card-overlay-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/today-card-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/today-controller-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/today-horizontal-card-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/today-parse-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/today/today-types.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/top-charts-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/top-charts/top-charts-page.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/util/app-tags-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/util/generate-routes.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/util/lottery.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/util/page-common.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/web-navigation/flow-action-presentation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/web-navigation/inject-web-navigation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/web-navigation/landing-page-links-by-platform.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/web-navigation/platform-landing-page-intent-controllers.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/web-navigation/platform-landing-page-utils.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/web-navigation/platform-selection.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/web-navigation/search-results-platform-selection.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/common/web-navigation/web-navigation.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/app-events/app-event-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/arcade/arcade-grouping-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/arcade/routable-arcade-see-all-page-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/developer/developer-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/editorial-pages/editorial-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/editorial-pages/editorial-shelf-collection-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/grouping/grouping-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/product-page/bundle-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/product-page/eula-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/product-page/product-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/product-page/see-all-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/room/room-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/search/search-landing-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/search/search-results-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/today/routable-article-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/today/routable-today-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/top-charts/charts-hub-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/top-charts/charts-page-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/controllers/web-navigation/category-tabs-intent-controller.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/amp-localization/amp-localization.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/active-intent.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale-from-bag.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/seo.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/experimentation/app-store-experiments.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/experimentation/experiment-area-id.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/experimentation/experiment-cache.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/experimentation/product-page-experiments.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/experimentation/search-results-experiments.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/experimentation/today-ad-experiments.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/json-parsing/derived-data.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/json-parsing/server-data.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/media/associations.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/media/attributes.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/media/data-fetching.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/media/data-structure.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/media/network.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/media/platform-attributes.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/media/relationships.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/media/url-builder.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/media/util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/metrics/buy-parameters.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/metrics/cookies.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/metrics/metrics-identifiers-cache.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/network/http.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/network/network.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/network/url-constants.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/network/urls.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/routing/routing-components.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/runtime/action-provider.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/runtime/app-store-intent-dispatcher.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/runtime/app-store-object-graph.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/runtime/runtime.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/util/array-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/util/color-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/util/constants.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/util/date-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/util/errors.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/util/math-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/util/objects.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/util/promise-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/util/string-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/util/validation-util.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/apple-silicon.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/bag.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/cached-bag.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/client-ordering.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/client.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/console.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/host.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/localization.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/properties.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/storage.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/foundation/wrappers/wrapper.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/gameservicesui/src/foundation/media-api/requests/recommendation-request-types.js create mode 100644 node_modules/@jet-app/app-store/tmp/src/gameservicesui/src/foundation/object-graph-types.js create mode 100644 node_modules/@jet/engine/lib/actions/action-dispatcher.js create mode 100644 node_modules/@jet/engine/lib/actions/index.js create mode 100644 node_modules/@jet/engine/lib/dependencies/index.js create mode 100644 node_modules/@jet/engine/lib/dependencies/jet-bag.js create mode 100644 node_modules/@jet/engine/lib/dependencies/jet-host.js create mode 100644 node_modules/@jet/engine/lib/dependencies/jet-network-fetch.js create mode 100644 node_modules/@jet/engine/lib/dependencies/localized-strings-bundle.js create mode 100644 node_modules/@jet/engine/lib/dependencies/localized-strings-json-object.js create mode 100644 node_modules/@jet/engine/lib/index.js create mode 100644 node_modules/@jet/engine/lib/metrics/aggregating/index.js create mode 100644 node_modules/@jet/engine/lib/metrics/aggregating/metrics-fields-aggregator.js create mode 100644 node_modules/@jet/engine/lib/metrics/aggregating/metrics-fields-builder.js create mode 100644 node_modules/@jet/engine/lib/metrics/aggregating/metrics-fields-context.js create mode 100644 node_modules/@jet/engine/lib/metrics/aggregating/metrics-fields-provider.js create mode 100644 node_modules/@jet/engine/lib/metrics/field-providers/index.js create mode 100644 node_modules/@jet/engine/lib/metrics/field-providers/page-metrics-fields-provider.js create mode 100644 node_modules/@jet/engine/lib/metrics/index.js create mode 100644 node_modules/@jet/engine/lib/metrics/linting/index.js create mode 100644 node_modules/@jet/engine/lib/metrics/linting/metrics-event-linter.js create mode 100644 node_modules/@jet/engine/lib/metrics/metrics-pipeline.js create mode 100644 node_modules/@jet/engine/lib/metrics/presenters/index.js create mode 100644 node_modules/@jet/engine/lib/metrics/presenters/page-metrics-presenter.js create mode 100644 node_modules/@jet/engine/lib/metrics/recording/index.js create mode 100644 node_modules/@jet/engine/lib/metrics/recording/logging-event-recorder.js create mode 100644 node_modules/@jet/engine/lib/metrics/recording/metrics-event-recorder.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/index.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/json/validation.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/actions/alert-action.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/actions/compound-action.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/actions/empty-action.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/actions/external-url-action.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/actions/flow-action.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/actions/flow-back-action.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/actions/http-action.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/actions/http-template-action.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/actions/index.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/actions/toast-action.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/artwork.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/button.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/color.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/index.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/menu.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/paragraph.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/programmed-text.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/models/video.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/bag.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/bundle.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/cookie-provider.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/cryptography.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/host.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/index.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/jscookie.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/net.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/platform.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/plist.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/preprocessor.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/random.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/service.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/globals/types.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/javascriptcore/console.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/javascriptcore/index.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/metrics.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/models.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/types/optional.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/util/metatype.js create mode 100644 node_modules/@jet/engine/node_modules/@jet/environment/util/urls.js create mode 100644 node_modules/@jet/environment/dependencies/index.js create mode 100644 node_modules/@jet/environment/dependencies/jet-proxy.js create mode 100644 node_modules/@jet/environment/dependencies/object-graph.js create mode 100644 node_modules/@jet/environment/dispatching/actions/action-provider.js create mode 100644 node_modules/@jet/environment/dispatching/actions/index.js create mode 100644 node_modules/@jet/environment/dispatching/base/dispatchable.js create mode 100644 node_modules/@jet/environment/dispatching/base/dispatcher.js create mode 100644 node_modules/@jet/environment/dispatching/base/index.js create mode 100644 node_modules/@jet/environment/dispatching/base/intent-controller.js create mode 100644 node_modules/@jet/environment/dispatching/base/intent.js create mode 100644 node_modules/@jet/environment/dispatching/index.js create mode 100644 node_modules/@jet/environment/index.js create mode 100644 node_modules/@jet/environment/json/index.js create mode 100644 node_modules/@jet/environment/json/reader/coercion.js create mode 100644 node_modules/@jet/environment/json/reader/index.js create mode 100644 node_modules/@jet/environment/json/reader/key-path.js create mode 100644 node_modules/@jet/environment/json/reader/object-cursor.js create mode 100644 node_modules/@jet/environment/json/reader/object-reader.js create mode 100644 node_modules/@jet/environment/json/reader/traverse.js create mode 100644 node_modules/@jet/environment/json/validation.js create mode 100644 node_modules/@jet/environment/metrics/builder.js create mode 100644 node_modules/@jet/environment/metrics/cookies.js create mode 100644 node_modules/@jet/environment/metrics/event-linter.js create mode 100644 node_modules/@jet/environment/metrics/fetch-timing-metrics-builder.js create mode 100644 node_modules/@jet/environment/metrics/helpers/index.js create mode 100644 node_modules/@jet/environment/metrics/helpers/location.js create mode 100644 node_modules/@jet/environment/metrics/helpers/models.js create mode 100644 node_modules/@jet/environment/metrics/helpers/numerics.js create mode 100644 node_modules/@jet/environment/metrics/helpers/util.js create mode 100644 node_modules/@jet/environment/metrics/index.js create mode 100644 node_modules/@jet/environment/metrics/parse-and-build-model.js create mode 100644 node_modules/@jet/environment/models/actions/alert-action.js create mode 100644 node_modules/@jet/environment/models/actions/compound-action.js create mode 100644 node_modules/@jet/environment/models/actions/empty-action.js create mode 100644 node_modules/@jet/environment/models/actions/external-url-action.js create mode 100644 node_modules/@jet/environment/models/actions/flow-action.js create mode 100644 node_modules/@jet/environment/models/actions/flow-back-action.js create mode 100644 node_modules/@jet/environment/models/actions/http-action.js create mode 100644 node_modules/@jet/environment/models/actions/http-template-action.js create mode 100644 node_modules/@jet/environment/models/actions/index.js create mode 100644 node_modules/@jet/environment/models/actions/toast-action.js create mode 100644 node_modules/@jet/environment/models/artwork.js create mode 100644 node_modules/@jet/environment/models/button.js create mode 100644 node_modules/@jet/environment/models/color.js create mode 100644 node_modules/@jet/environment/models/index.js create mode 100644 node_modules/@jet/environment/models/menu.js create mode 100644 node_modules/@jet/environment/models/paragraph.js create mode 100644 node_modules/@jet/environment/models/programmed-text.js create mode 100644 node_modules/@jet/environment/models/video.js create mode 100644 node_modules/@jet/environment/routing/index.js create mode 100644 node_modules/@jet/environment/routing/route-provider.js create mode 100644 node_modules/@jet/environment/routing/router-factory.js create mode 100644 node_modules/@jet/environment/routing/router.js create mode 100644 node_modules/@jet/environment/routing/routing-components.js create mode 100644 node_modules/@jet/environment/runtime/bootstrap.js create mode 100644 node_modules/@jet/environment/runtime/index.js create mode 100644 node_modules/@jet/environment/runtime/runtime.js create mode 100644 node_modules/@jet/environment/types/globals/bag.js create mode 100644 node_modules/@jet/environment/types/globals/bundle.js create mode 100644 node_modules/@jet/environment/types/globals/cookie-provider.js create mode 100644 node_modules/@jet/environment/types/globals/cryptography.js create mode 100644 node_modules/@jet/environment/types/globals/host.js create mode 100644 node_modules/@jet/environment/types/globals/index.js create mode 100644 node_modules/@jet/environment/types/globals/jscookie.js create mode 100644 node_modules/@jet/environment/types/globals/net.js create mode 100644 node_modules/@jet/environment/types/globals/platform.js create mode 100644 node_modules/@jet/environment/types/globals/plist.js create mode 100644 node_modules/@jet/environment/types/globals/preprocessor.js create mode 100644 node_modules/@jet/environment/types/globals/random.js create mode 100644 node_modules/@jet/environment/types/globals/service.js create mode 100644 node_modules/@jet/environment/types/globals/types.js create mode 100644 node_modules/@jet/environment/types/index.js create mode 100644 node_modules/@jet/environment/types/javascriptcore/console.js create mode 100644 node_modules/@jet/environment/types/javascriptcore/index.js create mode 100644 node_modules/@jet/environment/types/metrics.js create mode 100644 node_modules/@jet/environment/types/models.js create mode 100644 node_modules/@jet/environment/types/optional.js create mode 100644 node_modules/@jet/environment/util/clone.js create mode 100644 node_modules/@jet/environment/util/expiring-value.js create mode 100644 node_modules/@jet/environment/util/index.js create mode 100644 node_modules/@jet/environment/util/metatype.js create mode 100644 node_modules/@jet/environment/util/promise.js create mode 100644 node_modules/@jet/environment/util/rewindable-value.js create mode 100644 node_modules/@jet/environment/util/set.js create mode 100644 node_modules/@jet/environment/util/urls.js create mode 100644 node_modules/he/he.js create mode 100644 node_modules/svelte/src/runtime/easing/index.js create mode 100644 node_modules/svelte/src/runtime/internal/Component.js create mode 100644 node_modules/svelte/src/runtime/internal/await_block.js create mode 100644 node_modules/svelte/src/runtime/internal/disclose-version/index.js create mode 100644 node_modules/svelte/src/runtime/internal/dom.js create mode 100644 node_modules/svelte/src/runtime/internal/each.js create mode 100644 node_modules/svelte/src/runtime/internal/environment.js create mode 100644 node_modules/svelte/src/runtime/internal/globals.js create mode 100644 node_modules/svelte/src/runtime/internal/lifecycle.js create mode 100644 node_modules/svelte/src/runtime/internal/loop.js create mode 100644 node_modules/svelte/src/runtime/internal/scheduler.js create mode 100644 node_modules/svelte/src/runtime/internal/spread.js create mode 100644 node_modules/svelte/src/runtime/internal/style_manager.js create mode 100644 node_modules/svelte/src/runtime/internal/transitions.js create mode 100644 node_modules/svelte/src/runtime/internal/utils.js create mode 100644 node_modules/svelte/src/runtime/store/index.js create mode 100644 node_modules/svelte/src/runtime/transition/index.js create mode 100644 node_modules/svelte/src/shared/version.js (limited to 'node_modules') diff --git a/node_modules/@amp/amd-apps/dist/index.js b/node_modules/@amp/amd-apps/dist/index.js new file mode 100644 index 0000000..30a5cd0 --- /dev/null +++ b/node_modules/@amp/amd-apps/dist/index.js @@ -0,0 +1,17 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./rankers"), exports); diff --git a/node_modules/@amp/amd-apps/dist/rankers/engagement-based-demotion.js b/node_modules/@amp/amd-apps/dist/rankers/engagement-based-demotion.js new file mode 100644 index 0000000..3248d25 --- /dev/null +++ b/node_modules/@amp/amd-apps/dist/rankers/engagement-based-demotion.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.demoteByEngagements = void 0; +/** + * Re-rank candidates by demoting candidates based on engagement events. + * @param candidates Recommendable entities + * @param engagementEvents Recorded engagement events + * @returns Reordered candidates + */ +function demoteByEngagements(candidates, _engagementEvents) { + return [...candidates]; +} +exports.demoteByEngagements = demoteByEngagements; diff --git a/node_modules/@amp/amd-apps/dist/rankers/entities/candidate.js b/node_modules/@amp/amd-apps/dist/rankers/entities/candidate.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@amp/amd-apps/dist/rankers/entities/candidate.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@amp/amd-apps/dist/rankers/entities/engagement-event.js b/node_modules/@amp/amd-apps/dist/rankers/entities/engagement-event.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/@amp/amd-apps/dist/rankers/entities/engagement-event.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@amp/amd-apps/dist/rankers/entities/index.js b/node_modules/@amp/amd-apps/dist/rankers/entities/index.js new file mode 100644 index 0000000..af3051a --- /dev/null +++ b/node_modules/@amp/amd-apps/dist/rankers/entities/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./candidate"), exports); +__exportStar(require("./engagement-event"), exports); diff --git a/node_modules/@amp/amd-apps/dist/rankers/index.js b/node_modules/@amp/amd-apps/dist/rankers/index.js new file mode 100644 index 0000000..4b1c2d9 --- /dev/null +++ b/node_modules/@amp/amd-apps/dist/rankers/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./entities"), exports); +__exportStar(require("./engagement-based-demotion"), exports); diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/index.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/index.js new file mode 100644 index 0000000..335aa3a --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/index.js @@ -0,0 +1,23 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./models"), exports); +__exportStar(require("./types/globals"), exports); +__exportStar(require("./types/javascriptcore"), exports); +__exportStar(require("./types/metrics"), exports); +__exportStar(require("./types/models"), exports); +__exportStar(require("./types/optional"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/json/validation.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/json/validation.js new file mode 100644 index 0000000..b338c4e --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/json/validation.js @@ -0,0 +1,250 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unexpectedNull = exports.catchingContext = exports.context = exports.recordValidationIncidents = exports.endContext = exports.getContextNames = exports.beginContext = exports.messageForRecoveryAction = exports.isValidatable = exports.unexpectedType = exports.extendedTypeof = void 0; +const optional_1 = require("../types/optional"); +/** + * Returns a string containing the type of a given value. + * This function augments the built in `typeof` operator + * to return sensible values for arrays and null values. + * + * @privateRemarks + * This function is exported for testing. + * + * @param value - The value to find the type of. + * @returns A string containing the type of `value`. + */ +function extendedTypeof(value) { + if (Array.isArray(value)) { + return "array"; + } + else if (value === null) { + return "null"; + } + else { + return typeof value; + } +} +exports.extendedTypeof = extendedTypeof; +/** + * Reports a non-fatal validation failure, logging a message to the console. + * @param recovery - The recovery action taken when the bad type was found. + * @param expected - The expected type of the value. + * @param actual - The actual value. + * @param pathString - A string containing the path to the value on the object which failed type validation. + */ +function unexpectedType(recovery, expected, actual, pathString) { + const actualType = extendedTypeof(actual); + const prettyPath = (0, optional_1.isSome)(pathString) && pathString.length > 0 ? pathString : ""; + trackIncident({ + type: "badType", + expected: expected, + // Our test assertions are matching the string interpolation of ${actual} value. + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + actual: `${actualType} (${actual})`, + objectPath: prettyPath, + contextNames: getContextNames(), + recoveryAction: recovery, + stack: new Error().stack, + }); +} +exports.unexpectedType = unexpectedType; +// endregion +/** + * Determines if a given object conforms to the Validatable interface + * @param possibleValidatable - An object that might be considered validatable + * + * @returns `true` if it is an instance of Validatable, `false` if not + */ +function isValidatable(possibleValidatable) { + if ((0, optional_1.isNothing)(possibleValidatable)) { + return false; + } + // MAINTAINER'S NOTE: We must check for either the existence of a pre-existing incidents + // property *or* the ability to add one. Failure to do so will cause + // problems for clients that either a) use interfaces to define their + // view models; or b) return collections from their service routes. + return (Object.prototype.hasOwnProperty.call(possibleValidatable, "$incidents") || + Object.isExtensible(possibleValidatable)); +} +exports.isValidatable = isValidatable; +/** + * Returns a developer-readable diagnostic message for a given recovery action. + * @param action - The recovery action to get the message for. + * @returns The message for `action`. + */ +function messageForRecoveryAction(action) { + switch (action) { + case "coercedValue": + return "Coerced format"; + case "defaultValue": + return "Default value used"; + case "ignoredValue": + return "Ignored value"; + default: + return "Unknown"; + } +} +exports.messageForRecoveryAction = messageForRecoveryAction; +// region Contexts +/** + * Shared validation context "stack". + * + * Because validation incidents propagate up the context stack, + * the representation used here is optimized for memory usage. + * A more literal representation of this would be a singly linked + * list describing a basic stack, but that will produce a large + * amount of unnecessary garbage and require copying `incidents` + * arrays backwards. + */ +const contextState = { + /// The names of each validation context on the stack. + nameStack: Array(), + /// All incidents reported so far. Cleared when the + /// context stack is emptied. + incidents: Array(), + // TODO: Removal of this is being tracked here: + // Intro Pricing: Un-suppress missing parent 'offers' error when server address missing key + /// The paths for incidents we wish to forgo tracking. + suppressedIncidentPaths: Array(), +}; +/** + * Begin a new validation context with a given name, + * pushing it onto the validation context stack. + * @param name - The name for the validation context. + */ +function beginContext(name) { + contextState.nameStack.push(name); +} +exports.beginContext = beginContext; +/** + * Traverses the validation context stack and collects all of the context names. + * @returns The names of all validation contexts on the stack, from oldest to newest. + */ +function getContextNames() { + if (contextState.nameStack.length === 0) { + return [""]; + } + return contextState.nameStack.slice(0); +} +exports.getContextNames = getContextNames; +/** + * Ends the current validation context + */ +function endContext() { + if (contextState.nameStack.length === 0) { + console.warn("endContext() called without active validation context, ignoring"); + } + contextState.nameStack.pop(); +} +exports.endContext = endContext; +/** + * Records validation incidents back into an object that implements Validatable. + * + * Note: This method has a side-effect that the incident queue and name stack are cleared + * to prepare for the next thread's invocation. + * + * @param possibleValidatable - An object that may conform to Validatable, onto which we + * want to stash our validation incidents + */ +function recordValidationIncidents(possibleValidatable) { + if (isValidatable(possibleValidatable)) { + possibleValidatable.$incidents = contextState.incidents; + } + contextState.incidents = []; + contextState.nameStack = []; + contextState.suppressedIncidentPaths = []; +} +exports.recordValidationIncidents = recordValidationIncidents; +/** + * Create a transient validation context, and call a function that will return a value. + * + * Prefer this function over manually calling begin/endContext, + * it is exception safe. + * + * @param name - The name of the context + * @param producer - A function that produces a result + * @returns The resulting type + */ +function context(name, producer, suppressingPath) { + let suppressingName = null; + if ((0, optional_1.isSome)(suppressingPath) && suppressingPath.length > 0) { + suppressingName = name; + contextState.suppressedIncidentPaths.push(suppressingPath); + } + let result; + try { + beginContext(name); + result = producer(); + } + catch (e) { + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (!e.hasThrown) { + unexpectedType("defaultValue", "no exception", e.message); + e.hasThrown = true; + } + throw e; + } + finally { + if (name === suppressingName) { + contextState.suppressedIncidentPaths.pop(); + } + endContext(); + } + return result; +} +exports.context = context; +/** + * Create a transient validation context, that catches errors and returns null + * + * @param name - The name of the context + * @param producer - A function that produces a result + * @param caught - An optional handler to provide a value when an error is caught + * @returns The resulting type + */ +function catchingContext(name, producer, caught) { + let result = null; + try { + result = context(name, producer); + } + catch (e) { + result = null; + if ((0, optional_1.isSome)(caught)) { + result = caught(e); + } + } + return result; +} +exports.catchingContext = catchingContext; +/** + * Track an incident within the current validation context. + * @param incident - An incident object describing the problem. + */ +function trackIncident(incident) { + if (contextState.suppressedIncidentPaths.includes(incident.objectPath)) { + return; + } + contextState.incidents.push(incident); +} +// endregion +// region Nullability +/** + * Reports a non-fatal error indicating a value was unexpectedly null. + * @param recovery - The recovery action taken when the null value was found. + * @param expected - The expected type of the value. + * @param pathString - A string containing the path to the value on the object which was null. + */ +function unexpectedNull(recovery, expected, pathString) { + const prettyPath = (0, optional_1.isSome)(pathString) && pathString.length > 0 ? pathString : ""; + trackIncident({ + type: "nullValue", + expected: expected, + actual: "null", + objectPath: prettyPath, + contextNames: getContextNames(), + recoveryAction: recovery, + stack: new Error().stack, + }); +} +exports.unexpectedNull = unexpectedNull; +// endregion +//# sourceMappingURL=validation.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/alert-action.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/alert-action.js new file mode 100644 index 0000000..fcc6ea5 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/alert-action.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=alert-action.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/compound-action.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/compound-action.js new file mode 100644 index 0000000..6c3e159 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/compound-action.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeCompoundAction = exports.isCompoundAction = void 0; +/** + * Custom type guard to determine if an action is a CompoundAction. + */ +function isCompoundAction(action) { + return (action === null || action === void 0 ? void 0 : action.$kind) === "compoundAction"; +} +exports.isCompoundAction = isCompoundAction; +/** + * Helper that returns a CompoundAction, given an ActionMetrics and ActionModel[] of subactions. + */ +function makeCompoundAction(actionMetrics, subactions) { + return { + $kind: "compoundAction", + subactions, + actionMetrics, + }; +} +exports.makeCompoundAction = makeCompoundAction; +//# sourceMappingURL=compound-action.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/empty-action.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/empty-action.js new file mode 100644 index 0000000..da7f93a --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/empty-action.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeEmptyAction = exports.isEmptyAction = void 0; +/** + * Custom type guard to determine if an action is an EmptyAction. + */ +function isEmptyAction(action) { + return (action === null || action === void 0 ? void 0 : action.$kind) === "emptyAction"; +} +exports.isEmptyAction = isEmptyAction; +/** + * Helper that returns an EmptyAction, given an ActionMetrics. + */ +function makeEmptyAction(actionMetrics) { + return { + $kind: "emptyAction", + actionMetrics, + }; +} +exports.makeEmptyAction = makeEmptyAction; +//# sourceMappingURL=empty-action.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/external-url-action.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/external-url-action.js new file mode 100644 index 0000000..479a640 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/external-url-action.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=external-url-action.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/flow-action.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/flow-action.js new file mode 100644 index 0000000..6f70d98 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/flow-action.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=flow-action.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/flow-back-action.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/flow-back-action.js new file mode 100644 index 0000000..75c66a2 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/flow-back-action.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=flow-back-action.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/http-action.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/http-action.js new file mode 100644 index 0000000..e1fb6c3 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/http-action.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=http-action.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/http-template-action.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/http-template-action.js new file mode 100644 index 0000000..6cb84d4 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/http-template-action.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=http-template-action.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/index.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/index.js new file mode 100644 index 0000000..ff961dd --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/index.js @@ -0,0 +1,26 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./alert-action"), exports); +__exportStar(require("./compound-action"), exports); +__exportStar(require("./empty-action"), exports); +__exportStar(require("./external-url-action"), exports); +__exportStar(require("./flow-action"), exports); +__exportStar(require("./flow-back-action"), exports); +__exportStar(require("./http-action"), exports); +__exportStar(require("./http-template-action"), exports); +__exportStar(require("./toast-action"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/toast-action.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/toast-action.js new file mode 100644 index 0000000..5d6a299 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/actions/toast-action.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=toast-action.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/artwork.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/artwork.js new file mode 100644 index 0000000..324138d --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/artwork.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeArtworkURLTemplate = void 0; +const validation = require("../json/validation"); +const optional_1 = require("../types/optional"); +const urls_1 = require("../util/urls"); +/** + * Regex to parse artwork URL template string. + */ +const URL_TEMPLATE_PARSER = new RegExp("^({w}|[0-9]+(?:.[0-9]*)?)x({h}|[0-9]+(?:.[0-9]*)?)({c}|[a-z]{2}).({f}|[a-z]+)$"); +/** + * Create an instance of artwork URL template from string. + * @param fromString - String to create artwork URL template from. + * @returns A new artwork URL template or `null` if string + * does not represent a valid artwork URL template. + */ +function makeArtworkURLTemplate(fromString) { + // A valid URL that ends with '{w}x{h}{c}.{f}' + // with any of placeholders possibly resolved to an actual value. + const url = new urls_1.URL(fromString); + if (url.pathname === undefined) { + validation.context("makeArtworkURLTemplate", () => { + validation.unexpectedType("ignoredValue", "A valid URL string", fromString); + }); + return null; + } + // Expecting 5 matches: whole string + width, height, crop code and format. + const lastPathComponent = fromString.substring(fromString.lastIndexOf("/") + 1); + const matches = URL_TEMPLATE_PARSER.exec(lastPathComponent); + if ((0, optional_1.isNothing)(matches) || matches.length !== 5) { + validation.context("makeArtworkURLTemplate", () => { + validation.unexpectedType("ignoredValue", "A valid artwork URL template ending with {w}x{h}{c}.{f} format", lastPathComponent); + }); + return null; + } + return fromString; +} +exports.makeArtworkURLTemplate = makeArtworkURLTemplate; +//# sourceMappingURL=artwork.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/button.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/button.js new file mode 100644 index 0000000..036c19a --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/button.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=button.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/color.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/color.js new file mode 100644 index 0000000..82ffd64 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/color.js @@ -0,0 +1,196 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.areEqual = exports.luminanceFrom = exports.dynamicWith = exports.named = exports.rgbWith = exports.htmlWith = exports.Color = void 0; +const optional_1 = require("../types/optional"); +// endregion +// region Constructors +// eslint-disable-next-line no-redeclare, @typescript-eslint/no-redeclare +exports.Color = { + /** + * Create new `HTMLColor` from hexadecimal string representation. + * + * @param hexString - Hexadecimal string representation. + */ + fromHex(string) { + if ((0, optional_1.isNothing)(string)) { + return null; + } + return { + $kind: "html", + value: string, + }; + }, + /** + * Create new `RBGColor` with RGB components and opacity value. + * + * @param red - Red color value. + * @param green - Green color value. + * @param blue - Blue color value. + * @param alpha - Opacity value. + */ + fromRGB(red, green, blue, alpha = 1.0) { + const newColor = { + $kind: "rgb", + red: red, + green: green, + blue: blue, + alpha: alpha, + }; + return newColor; + }, + /** + * Create new named color using the color name. + * + * @param name - The name of the color. + */ + named(name) { + const newColor = { + $kind: "named", + name: name, + }; + return newColor; + }, + /** + * Create new dynamic color with light and dark color variants. + * + * @param lightColor - The light color variant. + * @param lightHighContrastColor - The light hight-contrast color variant. + * @param darkColor - The dark color variant. + * @param darkHighContrastColor - The dark hight-contrast color variant. + */ + dynamicWith(lightColor, lightHighContrastColor, darkColor, darkHighContrastColor) { + const newColor = { + $kind: "dynamic", + lightColor: lightColor, + lightHighContrastColor: lightHighContrastColor, + darkColor: darkColor, + darkHighContrastColor: darkHighContrastColor, + }; + return newColor; + }, + // endregion + // region Properties + /** + * Get the luminance of the color. + * + * @param rgbColor - The RGB color to get luminance for. + */ + luminanceFrom(rgbColor) { + // Note: This is lifted from UIColor_Private + // Using RGB color components, calculates and returns (0.2126 * r) + (0.7152 * g) + (0.0722 * b). + return rgbColor.red * 0.2126 + rgbColor.green * 0.7152 + rgbColor.blue * 0.0722; + }, + // endregion + // region Identity + /** + * Compare two colors for equality. + * + * @param color1 - Left hand side color to compare. + * @param color2 - Right hand side color to compare. + * @returns A Boolean indicating whether the colors are equal. + */ + areEqual(color1, color2) { + if ((0, optional_1.isNothing)(color1)) { + return (0, optional_1.isNothing)(color2); + } + else if ((0, optional_1.isNothing)(color2)) { + return (0, optional_1.isNothing)(color1); + } + const kind1 = color1.$kind; + const kind2 = color2.$kind; + if (kind1 === "named" && kind2 === "named") { + const namedColor1 = color1; + const namedColor2 = color2; + return namedColor1.name === namedColor2.name; + } + else if (kind1 === "rgb" && kind2 === "rgb") { + const rgbColor1 = color1; + const rgbColor2 = color2; + return (rgbColor1.red === rgbColor2.red && + rgbColor1.green === rgbColor2.green && + rgbColor1.blue === rgbColor2.blue && + rgbColor1.alpha === rgbColor2.alpha); + } + else if (kind1 === "dynamic" && kind2 === "dynamic") { + const dynamicColor1 = color1; + const dynamicColor2 = color2; + return (exports.Color.areEqual(dynamicColor1.lightColor, dynamicColor2.lightColor) && + exports.Color.areEqual(dynamicColor1.lightHighContrastColor, dynamicColor2.lightHighContrastColor) && + exports.Color.areEqual(dynamicColor1.darkColor, dynamicColor2.darkColor) && + exports.Color.areEqual(dynamicColor1.darkHighContrastColor, dynamicColor2.darkHighContrastColor)); + } + else { + return false; + } + }, +}; +/** + * Create new `HTMLColor` from hexadecimal string representation. + * + * @param hexString - Hexadecimal string representation. + * + * @deprecated This symbol has been moved to `Color.fromHex` and will be removed + * in the future. + */ +const htmlWith = exports.Color.fromHex; +exports.htmlWith = htmlWith; +/** + * Create new `RBGColor` with RGB components and opacity value. + * + * @param red - Red color value. + * @param green - Green color value. + * @param blue - Blue color value. + * @param alpha - Opacity value. + * + * @deprecated This symbol has been moved to `Color.fromRGB` and will be removed + * in the future. + */ +const rgbWith = exports.Color.fromRGB; +exports.rgbWith = rgbWith; +/** + * Create new named color using the color name. + * + * @param name - The name of the color. + * + * @deprecated This symbol has been moved to `Color.named` and will be removed + * in the future. + */ +const named = exports.Color.named; +exports.named = named; +/** + * Create new dynamic color with light and dark color variants. + * + * @param lightColor - The light color variant. + * @param lightHighContrastColor - The light hight-contrast color variant. + * @param darkColor - The dark color variant. + * @param darkHighContrastColor - The dark hight-contrast color variant. + * + * @deprecated This symbol has been moved to `Color.dynamicWith` and will be removed + * in the future. + */ +const dynamicWith = exports.Color.dynamicWith; +exports.dynamicWith = dynamicWith; +/** + * Get the luminance of the color. + * + * @param rgbColor - The RGB color to get luminance for. + * + * @deprecated This symbol has been moved to `Color.luminanceFrom` and will be removed + * in the future. + */ +const luminanceFrom = exports.Color.luminanceFrom; +exports.luminanceFrom = luminanceFrom; +/** + * Compare two colors for equality. + * + * @param color1 - Left hand side color to compare. + * @param color2 - Right hand side color to compare. + * @returns A Boolean indicating whether the colors are equal. + * + * @deprecated This symbol has been moved to `Color.areEqual` and will be removed + * in the future. + */ +const areEqual = exports.Color.areEqual; +exports.areEqual = areEqual; +// endregion +//# sourceMappingURL=color.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/index.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/index.js new file mode 100644 index 0000000..a041c4c --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/index.js @@ -0,0 +1,25 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./actions"), exports); +__exportStar(require("./artwork"), exports); +__exportStar(require("./button"), exports); +__exportStar(require("./color"), exports); +__exportStar(require("./menu"), exports); +__exportStar(require("./paragraph"), exports); +__exportStar(require("./programmed-text"), exports); +__exportStar(require("./video"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/menu.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/menu.js new file mode 100644 index 0000000..200dc6b --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/menu.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.menuSeparatorID = void 0; +/** + * A standard identifier for including a separator in a menu. + */ +exports.menuSeparatorID = "com.apple.JetEngine.separator"; +//# sourceMappingURL=menu.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/paragraph.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/paragraph.js new file mode 100644 index 0000000..3518ea7 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/paragraph.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// endregion +//# sourceMappingURL=paragraph.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/programmed-text.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/programmed-text.js new file mode 100644 index 0000000..18a8337 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/programmed-text.js @@ -0,0 +1,5 @@ +"use strict"; +// region ProgrammedText +Object.defineProperty(exports, "__esModule", { value: true }); +// endregion +//# sourceMappingURL=programmed-text.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/video.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/video.js new file mode 100644 index 0000000..0f0031f --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/models/video.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=video.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/bag.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/bag.js new file mode 100644 index 0000000..ffe6106 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/bag.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=bag.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/bundle.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/bundle.js new file mode 100644 index 0000000..9a818e7 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/bundle.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=bundle.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/cookie-provider.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/cookie-provider.js new file mode 100644 index 0000000..e681941 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/cookie-provider.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=cookie-provider.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/cryptography.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/cryptography.js new file mode 100644 index 0000000..de648d8 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/cryptography.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=cryptography.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/host.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/host.js new file mode 100644 index 0000000..9dbd12d --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/host.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=host.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/index.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/index.js new file mode 100644 index 0000000..bc0f016 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/index.js @@ -0,0 +1,55 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/* `preprocessor` and `testContent` are normally replaced by inline literals while bundling an app's JS. + * + * If these values have not been set we want to provide defaults however + * attempting to access them can trigger a ReferenceError as the + * variables are undefined (distinct from a defined variable being set to + * `undefined`). + * + * `typeof` checks can safely test undefined variables, note that these checks will become: + * `typeof { DEBUG_BUILD: true, ... }` when webpack's DefinePlugin is used in @jet/build's webpack task. + * When these variables have not been replaced we need to use `globalThis` to set them on the global scope + * in order to avoid ReferenceErrors attempting to access them. + */ +if (typeof preprocessor === "undefined") { + globalThis.preprocessor = { + PRODUCTION_BUILD: false, + CARRY_BUILD: false, + DEBUG_BUILD: false, + INTERNAL_BUILD: false, + }; +} +if (typeof testContent === "undefined") { + globalThis.testContent = { + INCLUDE_TEST_CONTENT: false, + }; +} +__exportStar(require("./bag"), exports); +__exportStar(require("./bundle"), exports); +__exportStar(require("./cookie-provider"), exports); +__exportStar(require("./cryptography"), exports); +__exportStar(require("./host"), exports); +__exportStar(require("./jscookie"), exports); +__exportStar(require("./net"), exports); +__exportStar(require("./platform"), exports); +__exportStar(require("./plist"), exports); +__exportStar(require("./preprocessor"), exports); +__exportStar(require("./random"), exports); +__exportStar(require("./service"), exports); +__exportStar(require("./types"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/jscookie.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/jscookie.js new file mode 100644 index 0000000..bfd5e29 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/jscookie.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=jscookie.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/net.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/net.js new file mode 100644 index 0000000..eed04ec --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/net.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ProxiedNetwork = void 0; +/** + * `Network` object designed to wrap the bridged native network object, + * which automatically includes page intent instrumentation data in the fetch request. + */ +class ProxiedNetwork { + constructor(original, pageIntentInstrumentation) { + this.original = original; + this.pageIntentInstrumentation = pageIntentInstrumentation; + } + async fetch(request) { + request["$pageIntentInstrumentation"] = this.pageIntentInstrumentation; + return await this.original.fetch(request); + } +} +exports.ProxiedNetwork = ProxiedNetwork; +//# sourceMappingURL=net.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/platform.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/platform.js new file mode 100644 index 0000000..eafaa33 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/platform.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=platform.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/plist.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/plist.js new file mode 100644 index 0000000..29503e6 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/plist.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=plist.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/preprocessor.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/preprocessor.js new file mode 100644 index 0000000..a04398d --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/preprocessor.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=preprocessor.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/random.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/random.js new file mode 100644 index 0000000..3484776 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/random.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=random.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/service.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/service.js new file mode 100644 index 0000000..a4b3c49 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/service.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=service.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/types.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/types.js new file mode 100644 index 0000000..354ee66 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/globals/types.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.services = exports.random = exports.plist = exports.platform = exports.net = exports.localizer = exports.host = exports.cryptography = exports.cookieProvider = exports.bundle = exports.bag = void 0; +const metatype_1 = require("../../util/metatype"); +exports.bag = (0, metatype_1.makeMetatype)("jet-engine:bag"); +exports.bundle = (0, metatype_1.makeMetatype)("jet-engine:bundle"); +exports.cookieProvider = (0, metatype_1.makeMetatype)("jet-engine:cookieProvider"); +exports.cryptography = (0, metatype_1.makeMetatype)("jet-engine:cryptography"); +exports.host = (0, metatype_1.makeMetatype)("jet-engine:host"); +exports.localizer = (0, metatype_1.makeMetatype)("jet-engine:localizer"); +exports.net = (0, metatype_1.makeMetatype)("jet-engine:net"); +exports.platform = (0, metatype_1.makeMetatype)("jet-engine:platform"); +exports.plist = (0, metatype_1.makeMetatype)("jet-engine:plist"); +exports.random = (0, metatype_1.makeMetatype)("jet-engine:random"); +exports.services = (0, metatype_1.makeMetatype)("jet-engine:services"); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/javascriptcore/console.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/javascriptcore/console.js new file mode 100644 index 0000000..c4fb39a --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/javascriptcore/console.js @@ -0,0 +1,14 @@ +"use strict"; +/* + * Describes standard functionality available in JSContexts + * + * Types are defined here to allow us to match the behavior available in JSContext in the target OS + * which may not exactly match the definitions in standard TypeScript lib files, particularly on a + * pre-release OS. + * + * The living standard for the Console API is available at https://console.spec.whatwg.org + * The WebKit team has documented their interfaces at https://webkit.org/web-inspector/console-object-api/ + * The equivalent interface in Node is https://nodejs.org/api/console.html + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=console.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/javascriptcore/index.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/javascriptcore/index.js new file mode 100644 index 0000000..3d7b648 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/javascriptcore/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./console"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/metrics.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/metrics.js new file mode 100644 index 0000000..adc8456 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/metrics.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.notInstrumented = exports.PageInvocationPoint = exports.EMPTY_LINTED_METRICS_EVENT = void 0; +/** + * An empty linted metrics event. + * + * The empty events should be skipped from recording + * by metrics event recorders. + */ +exports.EMPTY_LINTED_METRICS_EVENT = { + fields: {}, + issues: [], +}; +var PageInvocationPoint; +(function (PageInvocationPoint) { + PageInvocationPoint["pageEnter"] = "pageEnter"; + PageInvocationPoint["pageExit"] = "pageExit"; + PageInvocationPoint["appExit"] = "appExit"; + PageInvocationPoint["appEnter"] = "appEnter"; + PageInvocationPoint["backButton"] = "backButton"; +})(PageInvocationPoint = exports.PageInvocationPoint || (exports.PageInvocationPoint = {})); +/** + * Returns an empty metrics instance of the specified metrics type. + * @param metricsType - Type of the metrics data to return. + * + * @deprecated Do not use, all metrics events should be instrumented. + */ +function notInstrumented(metricsType) { + switch (metricsType) { + case 0 /* NotInstrumentedMetricsType.ActionMetrics */: + return { + data: [], + custom: {}, + }; + case 1 /* NotInstrumentedMetricsType.FetchTimingMetrics */: + return {}; + case 2 /* NotInstrumentedMetricsType.PageMetrics */: + return { + instructions: [], + custom: {}, + }; + case 3 /* NotInstrumentedMetricsType.ImpressionMetrics */: + return { + id: { + id: "", + impressionIndex: NaN, + }, + fields: {}, + custom: {}, + }; + default: + return {}; + } +} +exports.notInstrumented = notInstrumented; +// endregion +//# sourceMappingURL=metrics.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/models.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/models.js new file mode 100644 index 0000000..b2dccd6 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/models.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/optional.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/optional.js new file mode 100644 index 0000000..ea3aaeb --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/types/optional.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.flatMapOptional = exports.mapOptional = exports.unsafeUnwrapOptional = exports.unwrapOptional = exports.isSome = exports.isNothing = exports.unsafeUninitialized = void 0; +/** + * Bypass the protection provided by the `Optional` type + * and pretend to produce a value of `Some` while + * actually returning `Nothing`. + */ +function unsafeUninitialized() { + return undefined; +} +exports.unsafeUninitialized = unsafeUninitialized; +/** + * Test whether an optional does not contain a value. + * + * @param value - An optional value to test. + */ +function isNothing(value) { + return value === undefined || value === null; +} +exports.isNothing = isNothing; +/** + * Test whether an optional contains a value. + * @param value - An optional value to test. + */ +function isSome(value) { + return value !== undefined && value !== null; +} +exports.isSome = isSome; +/** + * Unwrap the value contained in a given optional, + * throwing an error if there is no value. + * + * @param value - A value to unwrap. + */ +function unwrapOptional(value) { + if (isNothing(value)) { + throw new ReferenceError(); + } + return value; +} +exports.unwrapOptional = unwrapOptional; +/** + * Unwrap the value contained in a given optional + * without checking if the value exists. + * + * @param value - A value to unwrap. + */ +function unsafeUnwrapOptional(value) { + return value; +} +exports.unsafeUnwrapOptional = unsafeUnwrapOptional; +function mapOptional(value, body) { + if (isSome(value)) { + return body(value); + } + else { + return value; + } +} +exports.mapOptional = mapOptional; +function flatMapOptional(value, body) { + if (isSome(value)) { + return body(value); + } + else { + return value; + } +} +exports.flatMapOptional = flatMapOptional; +//# sourceMappingURL=optional.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/util/metatype.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/util/metatype.js new file mode 100644 index 0000000..372f58f --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/util/metatype.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeMetatype = void 0; +function makeMetatype(name) { + return { + name: name, + }; +} +exports.makeMetatype = makeMetatype; +//# sourceMappingURL=metatype.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/util/urls.js b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/util/urls.js new file mode 100644 index 0000000..9b52b6d --- /dev/null +++ b/node_modules/@apple-media-services/media-api/node_modules/@jet/environment/util/urls.js @@ -0,0 +1,373 @@ +"use strict"; +// MARK: - Parsing Regular Expressions +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = void 0; +const optional_1 = require("../types/optional"); +const protocolRegex = /^([a-z][a-z0-9.+-]*:)(\/\/)?([\S\s]*)/i; +const queryParamRegex = /([^=?&]+)=?([^&]*)/g; +const componentOrder = ["hash", "query", "pathname", "host"]; +class URL { + constructor(url) { + var _a; + this.query = {}; + if ((0, optional_1.isNothing)(url)) { + return; + } + // Split the protocol from the rest of the urls + let remainder = url; + const match = protocolRegex.exec(url); + if ((0, optional_1.isSome)(match)) { + // Pull out the protocol + let protocol = match[1]; + if (protocol !== null && protocol !== undefined) { + protocol = protocol.split(":")[0]; + } + this.protocol = protocol !== null && protocol !== void 0 ? protocol : undefined; + // Save the remainder + remainder = (_a = match[3]) !== null && _a !== void 0 ? _a : undefined; + } + // Then match each component in a specific order + let parse = { remainder: remainder, result: undefined }; + for (const component of componentOrder) { + if (parse === undefined || parse.remainder === undefined) { + break; + } + switch (component) { + case "hash": { + parse = splitUrlComponent(parse.remainder, "#", "suffix"); + this.hash = parse === null || parse === void 0 ? void 0 : parse.result; + break; + } + case "query": { + parse = splitUrlComponent(parse.remainder, "?", "suffix"); + if ((parse === null || parse === void 0 ? void 0 : parse.result) !== undefined) { + this.query = URL.queryFromString(parse.result); + } + break; + } + case "pathname": { + parse = splitUrlComponent(parse.remainder, "/", "suffix"); + if ((parse === null || parse === void 0 ? void 0 : parse.result) !== undefined) { + // Replace the initial /, since paths require it + this.pathname = "/" + parse.result; + } + break; + } + case "host": { + const authorityParse = splitUrlComponent(parse.remainder, "@", "prefix"); + const userInfo = authorityParse === null || authorityParse === void 0 ? void 0 : authorityParse.result; + const hostPort = authorityParse === null || authorityParse === void 0 ? void 0 : authorityParse.remainder; + if (userInfo !== undefined) { + const userInfoSplit = userInfo.split(":"); + this.username = decodeURIComponent(userInfoSplit[0]); + this.password = decodeURIComponent(userInfoSplit[1]); + } + if (hostPort !== undefined) { + const hostPortSplit = hostPort.split(":"); + this.host = hostPortSplit[0]; + this.port = hostPortSplit[1]; + } + break; + } + default: { + throw new Error("Unhandled case!"); + } + } + } + } + get(component) { + switch (component) { + // Exhaustive match to make sure TS property minifiers and other + // transformer plugins do not break this code. + case "protocol": + return this.protocol; + case "username": + return this.username; + case "password": + return this.password; + case "port": + return this.port; + case "pathname": + return this.pathname; + case "query": + return this.query; + case "hash": + return this.hash; + default: + // The fallback for component which is not a property of URL object. + return this[component]; + } + } + set(component, value) { + if (value === undefined) { + return this; + } + if (component === "query") { + if (typeof value === "string") { + value = URL.queryFromString(value); + } + } + switch (component) { + // Exhaustive match to make sure TS property minifiers and other + // transformer plugins do not break this code. + case "protocol": + this.protocol = value; + break; + case "username": + this.username = value; + break; + case "password": + this.password = value; + break; + case "port": + this.port = value; + break; + case "pathname": + this.pathname = value; + break; + case "query": + this.query = value; + break; + case "hash": + this.hash = value; + break; + default: + // The fallback for component which is not a property of URL object. + this[component] = value; + break; + } + return this; + } + append(component, value) { + let existingValue = this.get(component); + let newValue; + if (component === "query") { + if (existingValue === undefined) { + existingValue = {}; + } + if (typeof value === "string") { + value = URL.queryFromString(value); + } + if (typeof existingValue === "string") { + newValue = { existingValue, ...value }; + } + else { + newValue = { ...existingValue, ...value }; + } + } + else { + if (existingValue === undefined) { + existingValue = ""; + } + let existingValueString = existingValue; + if (existingValueString === undefined) { + existingValueString = ""; + } + let newValueString = existingValueString; + if (component === "pathname") { + const pathLength = existingValueString.length; + if (pathLength === 0 || existingValue[pathLength - 1] !== "/") { + newValueString += "/"; + } + } + // The component is not "query" so we treat value as string. + // eslint-disable-next-line @typescript-eslint/no-base-to-string, @typescript-eslint/restrict-plus-operands + newValueString += value; + newValue = newValueString; + } + return this.set(component, newValue); + } + param(key, value) { + if (key === null) { + return this; + } + if (this.query === undefined) { + this.query = {}; + } + if (value === undefined) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this.query[key]; + } + else { + this.query[key] = value; + } + return this; + } + removeParam(key) { + if (key === undefined || this.query === undefined) { + return this; + } + if (key in this.query) { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete this.query[key]; + } + return this; + } + path(value) { + return this.append("pathname", value); + } + pathExtension() { + var _a, _b; + // Extract path extension if one exists + if (this.pathname === undefined) { + return undefined; + } + const lastFilenameComponents = (_b = (_a = this.pathname + .split("/") + .filter((item) => item.length > 0) // Remove any double or trailing slashes + .pop()) === null || _a === void 0 ? void 0 : _a.split(".")) !== null && _b !== void 0 ? _b : []; + if (lastFilenameComponents.filter(function (part) { + return part !== ""; + }).length < 2 // Remove any empty parts (e.g. .ssh_config -> ["ssh_config"]) + ) { + return undefined; + } + return lastFilenameComponents.pop(); + } + /** + * Returns the path components of the URL + * @returns An array of non-empty path components from `urls`. + */ + pathComponents() { + if (this.pathname === undefined) { + return []; + } + return this.pathname.split("/").filter((component) => component.length > 0); + } + /** + * Same as toString + * + * @returns A string representation of the URL + */ + build() { + return this.toString(); + } + /** + * Converts the URL to a string + * + * @returns A string representation of the URL + */ + toString() { + let url = ""; + if (this.protocol !== undefined) { + url += this.protocol + "://"; + } + if (this.username !== undefined) { + url += encodeURIComponent(this.username); + if (this.password !== undefined) { + url += ":" + encodeURIComponent(this.password); + } + url += "@"; + } + if (this.host !== undefined) { + url += this.host; + if (this.port !== undefined) { + url += ":" + this.port; + } + } + if (this.pathname !== undefined) { + url += this.pathname; + } + if (this.query !== undefined && Object.keys(this.query).length !== 0) { + url += "?" + URL.toQueryString(this.query); + } + if (this.hash !== undefined) { + url += "#" + this.hash; + } + return url; + } + // ---------------- + // Static API + // ---------------- + /** + * Converts a string into a query dictionary + * @param query - The string to parse + * @returns The query dictionary containing the key-value pairs in the query string + */ + static queryFromString(query) { + const result = {}; + let parseResult = queryParamRegex.exec(query); + while (parseResult !== null && parseResult.length >= 3) { + // We support the legacy query format for "application/x-www-form-urlencoded" which can represent spaces as "+" symbols. + // https://url.spec.whatwg.org/#concept-urlencoded-parser + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#decoding_query_parameters_from_a_url + const key = decodeURIComponent(parseResult[1].replace(/\+/g, " ")); + const value = decodeURIComponent(parseResult[2].replace(/\+/g, " ")); + result[key] = value; + parseResult = queryParamRegex.exec(query); + } + return result; + } + /** + * Converts a query dictionary into a query string + * + * @param query - The query dictionary + * @returns The string representation of the query dictionary + */ + static toQueryString(query) { + let queryString = ""; + let first = true; + for (const key of Object.keys(query)) { + if (!first) { + queryString += "&"; + } + first = false; + queryString += encodeURIComponent(key); + const value = query[key]; + if (value !== null && value.length > 0) { + queryString += "=" + encodeURIComponent(value); + } + } + return queryString; + } + /** + * Convenience method to instantiate a URL from a string + * @param url - The URL string to parse + * @returns The new URL object representing the URL + */ + static from(url) { + return new URL(url); + } + /** + * Convenience method to instantiate a URL from numerous (optional) components + * @param protocol - The protocol type + * @param host - The host name + * @param path - The path + * @param query - The query + * @param hash - The hash + * @returns The new URL object representing the URL + */ + static fromComponents(protocol, host, path, query, hash) { + const url = new URL(); + url.protocol = protocol; + url.host = host; + url.pathname = path; + url.query = query !== null && query !== void 0 ? query : {}; + url.hash = hash; + return url; + } +} +exports.URL = URL; +// MARK: - Helpers +function splitUrlComponent(input, marker, style) { + const index = input.indexOf(marker); + let result; + let remainder = input; + if (index !== -1) { + const prefix = input.slice(0, index); + const suffix = input.slice(index + marker.length, input.length); + if (style === "prefix") { + result = prefix; + remainder = suffix; + } + else { + result = suffix; + remainder = prefix; + } + } + return { + result: result, + remainder: remainder, + }; +} +//# sourceMappingURL=urls.js.map \ No newline at end of file diff --git a/node_modules/@apple-media-services/media-api/src/models/attributes.ts b/node_modules/@apple-media-services/media-api/src/models/attributes.ts new file mode 100644 index 0000000..edb5fca --- /dev/null +++ b/node_modules/@apple-media-services/media-api/src/models/attributes.ts @@ -0,0 +1,289 @@ +import { Opt, isNothing } from "@jet/environment/types/optional"; +import * as serverData from "./server-data"; +import * as media from "./data-structure"; +import { JSONValue, MapLike, JSONData } from "./json-types"; +import * as errors from "./errors"; + +// region Generic Attribute retrieval + +// region Attribute retrieval + +/** + * Retrieve the specified attribute from the data, coercing it to a JSONData dictionary + * + * @param data The data from which to retrieve the attribute. + * @param attributePath The path of the attribute. + * @param defaultValue The object to return if the path search fails. + * @returns The dictionary of data + */ +export function attributeAsDictionary( + data: media.Data, + attributePath?: serverData.ObjectPath, + defaultValue?: MapLike, +): MapLike | null { + if (serverData.isNull(data)) { + return null; + } + return serverData.asDictionary(data.attributes, attributePath, defaultValue); +} + +/** + * Retrieve the specified attribute from the data, coercing it to an Interface + * + * @param data The data from which to retrieve the attribute. + * @param attributePath The path of the attribute. + * @param defaultValue The object to return if the path search fails. + * @returns The dictionary of data as an interface + */ +export function attributeAsInterface( + data: media.Data, + attributePath?: serverData.ObjectPath, + defaultValue?: JSONData, +): Interface | null { + return attributeAsDictionary(data, attributePath, defaultValue) as unknown as Interface; +} + +/** + * Retrieve the specified attribute from the data as an array, coercing to an empty array if the object is not an array. + * + * @param data The data from which to retrieve the attribute. + * @param attributePath The path of the attribute. + * @returns {any[]} The attribute value as an array. + */ +export function attributeAsArrayOrEmpty( + data: media.Data, + attributePath?: serverData.ObjectPath, +): T[] { + if (serverData.isNull(data)) { + return []; + } + return serverData.asArrayOrEmpty(data.attributes, attributePath); +} + +/** + * Retrieve the specified attribute from the data as a string. + * + * @param data The data from which to retrieve the attribute. + * @param attributePath The object path for the attribute. + * @param policy The validation policy to use when resolving this value. + * @returns {string} The attribute value as a string. + */ +export function attributeAsString( + data: media.Data, + attributePath?: serverData.ObjectPath, + policy: serverData.ValidationPolicy = "coercible", +): Opt { + if (serverData.isNull(data)) { + return null; + } + return serverData.asString(data.attributes, attributePath, policy); +} + +/** + * Retrieve the specified meta from the data as a string. + * + * @param data The data from which to retrieve the attribute. + * @param metaPath The object path for the meta. + * @param policy The validation policy to use when resolving this value. + * @returns {string} The meta value as a string. + */ +export function metaAsString( + data: media.Data, + metaPath?: serverData.ObjectPath, + policy: serverData.ValidationPolicy = "coercible", +): Opt { + if (serverData.isNull(data)) { + return null; + } + return serverData.asString(data.meta, metaPath, policy); +} + +/** + * Retrieve the specified attribute from the data as a date. + * + * @param data The data from which to retrieve the attribute. + * @param attributePath The object path for the attribute. + * @param policy The validation policy to use when resolving this value. + * @returns {Date} The attribute value as a date. + */ +export function attributeAsDate( + data: media.Data, + attributePath?: serverData.ObjectPath, + policy: serverData.ValidationPolicy = "coercible", +): Opt { + if (serverData.isNull(data)) { + return null; + } + const dateString = serverData.asString(data.attributes, attributePath, policy); + if (isNothing(dateString)) { + return null; + } + return new Date(dateString); +} + +/** + * Retrieve the specified attribute from the data as a boolean. + * + * @param data The data from which to retrieve the attribute. + * @param attributePath The path of the attribute. + * @param policy The validation policy to use when resolving this value. + * @returns {boolean} The attribute value as a boolean. + */ +export function attributeAsBoolean( + data: media.Data, + attributePath?: serverData.ObjectPath, + policy: serverData.ValidationPolicy = "coercible", +): boolean | null { + if (serverData.isNull(data)) { + return null; + } + return serverData.asBoolean(data.attributes, attributePath, policy); +} + +/** + * Retrieve the specified attribute from the data as a boolean, which will be `false` if the attribute does not exist. + * + * @param data The data from which to retrieve the attribute. + * @param attributePath The path of the attribute. + * @returns {boolean} The attribute value as a boolean, coercing to `false` if the value is not present.. + */ +export function attributeAsBooleanOrFalse(data: media.Data, attributePath?: serverData.ObjectPath): boolean { + if (serverData.isNull(data)) { + return false; + } + return serverData.asBooleanOrFalse(data.attributes, attributePath); +} + +/** + * Retrieve the specified attribute from the data as a number. + * + * @param data The data from which to retrieve the attribute. + * @param attributePath The path of the attribute. + * @param policy The validation policy to use when resolving this value. + * @returns {boolean} The attribute value as a number. + */ +export function attributeAsNumber( + data: media.Data, + attributePath?: serverData.ObjectPath, + policy: serverData.ValidationPolicy = "coercible", +): Opt { + if (serverData.isNull(data)) { + return null; + } + return serverData.asNumber(data.attributes, attributePath, policy); +} + +export function hasAttributes(data: media.Data): boolean { + return !serverData.isNull(serverData.asDictionary(data, "attributes")); +} + +/** + * The canonical way to detect if an item from Media API is hydrated or not. + * + * @param data The data from which to retrieve the attributes. + */ +export function isNotHydrated(data: media.Data): boolean { + return !hasAttributes(data); +} + +// region Custom Attributes + +/** + * Performs conversion for a custom variant of given attribute, if any are available. + * @param attribute Attribute to get custom attribute key for, if any. + */ +export function attributeKeyAsCustomAttributeKey(attribute: string): string | undefined { + return customAttributeMapping[attribute]; +} + +/** + * Whether or not given custom attributes key allows fallback to default page with AB testing treatment within a nondefault page. + * This is to allow AB testing to affect only icons within custom product pages. + */ +export function attributeAllowsNonDefaultTreatmentInNonDefaultPage(customAttribute: string): boolean { + return customAttribute === "customArtwork" || customAttribute === "customIconArtwork"; // Only the icon artwork. +} + +/** + * Defines mapping of attribute to custom attribute. + */ +const customAttributeMapping: { [key: string]: string } = { + artwork: "customArtwork", + iconArtwork: "customIconArtwork", + screenshotsByType: "customScreenshotsByType", + promotionalText: "customPromotionalText", + videoPreviewsByType: "customVideoPreviewsByType", + customScreenshotsByTypeForAd: "customScreenshotsByTypeForAd", + customVideoPreviewsByTypeForAd: "customVideoPreviewsByTypeForAd", +}; + +export function requiredAttributeAsString(data: media.Data, attributePath: serverData.ObjectPath): string { + const value = attributeAsString(data, attributePath); + if (isNothing(value)) { + throw new errors.MissingFieldError(data, concatObjectPaths("attributes", attributePath)); + } + return value; +} + +export function requiredAttributeAsDate(data: media.Data, attributePath: serverData.ObjectPath): Date { + const value = attributeAsDate(data, attributePath); + if (isNothing(value)) { + throw new errors.MissingFieldError(data, concatObjectPaths("attributes", attributePath)); + } + return value; +} + +export function requiredAttributeAsDictionary( + data: media.Data, + attributePath: serverData.ObjectPath, +): MapLike { + const value: MapLike | null = attributeAsDictionary(data, attributePath); + if (isNothing(value)) { + throw new errors.MissingFieldError(data, concatObjectPaths("attributes", attributePath)); + } + return value; +} + +export function requiredMeta(data: media.Data): MapLike { + const value = serverData.asDictionary(data, "meta"); + if (isNothing(value)) { + throw new errors.MissingFieldError(data, "meta"); + } + return value; +} + +export function requiredMetaAttributeAsString(data: media.Data, attributePath: serverData.ObjectPath): string { + const meta = requiredMeta(data); + const value = serverData.asString(meta, attributePath); + if (isNothing(value)) { + throw new errors.MissingFieldError(data, concatObjectPaths("meta", attributePath)); + } + return value; +} + +export function requiredMetaAttributeAsNumber(data: media.Data, attributePath: serverData.ObjectPath): number { + const meta = requiredMeta(data); + const value = serverData.asNumber(meta, attributePath); + if (isNothing(value)) { + throw new errors.MissingFieldError(data, concatObjectPaths("meta", attributePath)); + } + return value; +} + +export function concatObjectPaths(prefix: serverData.ObjectPath, suffix: serverData.ObjectPath): serverData.ObjectPath { + let finalPath: string[]; + if (Array.isArray(prefix)) { + finalPath = prefix; + } else { + finalPath = [prefix]; + } + + if (Array.isArray(suffix)) { + finalPath.push(...suffix); + } else { + finalPath.push(suffix); + } + return finalPath; +} + +// endregion diff --git a/node_modules/@apple-media-services/media-api/src/models/server-data.ts b/node_modules/@apple-media-services/media-api/src/models/server-data.ts new file mode 100644 index 0000000..a1aca3f --- /dev/null +++ b/node_modules/@apple-media-services/media-api/src/models/server-data.ts @@ -0,0 +1,476 @@ +// +// server-data.ts +// AppStoreKit +// +// Created by Kevin MacWhinnie on 8/17/16. +// Copyright (c) 2016 Apple Inc. All rights reserved. +// + +// TODO: Replace this utility for JSON Parsing +import * as validation from "@jet/environment/json/validation"; +import { Nothing, Opt, isNothing } from "@jet/environment/types/optional"; +import { JSONArray, JSONData, JSONValue, MapLike } from "./json-types"; + +// region Traversal + +/** + * Union type that describes the possible representations for an object traversal path. + */ +export type ObjectPath = string | string[]; + +/** + * Returns the string representation of a given object path. + * @param path The object path to coerce to a string. + * @returns A string representation of `path`. + */ +export function objectPathToString(path: Opt): Opt { + if (isNull(path)) { + return null; + } else if (Array.isArray(path)) { + return path.join("."); + } else { + return path; + } +} + +const PARSED_PATH_CACHE: { [key: string]: string[] } = {}; + +/** + * Traverse a nested JSON object structure, short-circuiting + * when finding `undefined` or `null` values. Usage: + * + * const object = {x: {y: {z: 42}}}; + * const meaningOfLife = serverData.traverse(object, 'x.y.z'); + * + * @param object The JSON object to traverse. + * @param path The path to search. If falsy, `object` will be returned without being traversed. + * @param defaultValue The object to return if the path search fails. + * @return The value at `path` if found; default value otherwise. + */ +export function traverse(object: JSONValue, path?: ObjectPath, defaultValue?: JSONValue): JSONValue { + if (object === undefined || object === null) { + return defaultValue; + } + + if (isNullOrEmpty(path)) { + return object; + } + + let components: string[]; + if (typeof path === "string") { + components = PARSED_PATH_CACHE[path]; + if (isNullOrEmpty(components)) { + // Fast Path: If the path contains only a single component, we can skip + // all of the work below here and speed up storefronts that + // don't have JIT compilation enabled. + if (!path.includes(".")) { + const value = object[path]; + if (value !== undefined && value !== null) { + return value; + } else { + return defaultValue; + } + } + + components = path.split("."); + PARSED_PATH_CACHE[path] = components; + } + } else { + components = path; + } + + let current: JSONValue = object; + for (const component of components) { + current = current[component]; + if (current === undefined || current === null) { + return defaultValue; + } + } + return current; +} + +// endregion + +// region Nullability + +/** + * Returns a bool indicating whether or not a given object null or undefined. + * @param object The object to test. + * @return true if the object is null or undefined; false otherwise. + */ +export function isNull(object: Type | Nothing): object is Nothing { + return object === null || object === undefined; +} + +/** + * Returns a bool indicating whether or not a given object is null or empty. + * @param object The object to test + * @return true if object is null or empty; false otherwise. + */ +export function isNullOrEmpty(object: Type | Nothing): object is Nothing { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return isNull(object) || Object.keys(object as any).length === 0; +} + +/** + * Returns a bool indicating whether or not a given object is non-null. + * @param object The object to test. + * @return true if the object is not null or undefined; false otherwise. + */ +export function isDefinedNonNull(object: Type | null | undefined): object is Type { + return typeof object !== "undefined" && object !== null; +} + +/** + * Returns a bool indicating whether or not a given object is non-null or empty. + * @param object The object to test. + * @return true if the object is not null or undefined and not empty; false otherwise. + */ +export function isDefinedNonNullNonEmpty(object: Type | Nothing): object is Type { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return isDefinedNonNull(object) && Object.keys(object as any).length !== 0; +} + +/** + * Checks if the passed string or number is a number + * + * @param value The value to check + * @return True if the value is an number, false if not + */ +export function isNumber(value: number | string | null | undefined): value is number { + if (isNull(value)) { + return false; + } + + let valueToCheck; + if (typeof value === "string") { + valueToCheck = parseInt(value); + } else { + valueToCheck = value; + } + + return !Number.isNaN(valueToCheck); +} + +/** + * Returns a bool indicating whether or not a given object is defined but empty. + * @param object The object to test. + * @return true if the object is not null and empty; false otherwise. + */ +export function isArrayDefinedNonNullAndEmpty(object: Type | null | undefined): object is Type { + return isDefinedNonNull(object) && object.length === 0; +} + +// endregion + +// region Defaulting Casts + +/** + * Check that a given object is an array, substituting an empty array if not. + * @param object The object to coerce. + * @param path The path to traverse on `object` to find an array. + * Omit this parameter if `object` is itself an array. + * @returns An untyped array. + */ +export function asArrayOrEmpty(object: JSONValue, path?: ObjectPath): T[] { + const target = traverse(object, path, null); + if (Array.isArray(target)) { + // Note: This is kind of a nasty cast, but I don't think we want to validate that everything is of type T + return target as T[]; + } else { + if (!isNull(target)) { + validation.context("asArrayOrEmpty", () => { + validation.unexpectedType("defaultValue", "array", target, objectPathToString(path)); + }); + } + return []; + } +} + +/** + * Check that a given object is a boolean, substituting the value `false` if not. + * @param object The object to coerce. + * @param path The path to traverse on `object` to find a boolean. + * Omit this parameter if `object` is itself a boolean. + * @returns A boolean from `object`, or defaults to `false`. + */ +export function asBooleanOrFalse(object: JSONValue, path?: ObjectPath): boolean { + const target = traverse(object, path, null); + if (typeof target === "boolean") { + return target; + } else { + if (!isNull(target)) { + validation.context("asBooleanOrFalse", () => { + validation.unexpectedType("defaultValue", "boolean", target, objectPathToString(path)); + }); + } + return false; + } +} + +// endregion + +// region Coercing Casts + +export type ValidationPolicy = "strict" | "coercible" | "none"; + +/** + * Safely coerce an object into a string. + * @param object The object to coerce. + * @param path The path to traverse on `object` to find a string. + * Omit this parameter if `object` is itself a string. + * @param policy The validation policy to use when resolving this value + * @returns A string from `object`, or `null` if `object` is null. + */ +export function asString(object: JSONValue, path?: ObjectPath, policy: ValidationPolicy = "coercible"): Opt { + const target = traverse(object, path, null); + if (isNull(target)) { + return target; + } else if (typeof target === "string") { + return target; + } else { + // We don't consider arbitrary objects as convertable to strings even through they will result in some value + const coercedValue = typeof target === "object" ? null : String(target); + switch (policy) { + case "strict": { + validation.context("asString", () => { + validation.unexpectedType("coercedValue", "string", target, objectPathToString(path)); + }); + break; + } + case "coercible": { + if (isNull(coercedValue)) { + validation.context("asString", () => { + validation.unexpectedType("coercedValue", "string", target, objectPathToString(path)); + }); + } + break; + } + case "none": + default: { + break; + } + } + + return coercedValue; + } +} + +/** + * Safely coerce an object into a date. + * @param object The object to coerce. + * @param path The path to traverse on `object` to find a date. + * @param policy The validation policy to use when resolving this value + * @returns A date from `object`, or `null` if `object` is null. + */ +export function asDate(object: JSONValue, path?: ObjectPath, policy: ValidationPolicy = "coercible"): Opt { + const dateString = asString(object, path, policy); + if (isNothing(dateString)) { + return null; + } + return new Date(dateString); +} + +/** + * Safely coerce an object into a number. + * @param object The object to coerce. + * @param path The path to traverse on `object` to find a number. + * Omit this parameter if `object` is itself a number. + * @param policy The validation policy to use when resolving this value + * @returns A number from `object`, or `null` if `object` is null. + */ +export function asNumber(object: JSONValue, path?: ObjectPath, policy: ValidationPolicy = "coercible"): Opt { + const target = traverse(object, path, null); + if (isNull(target) || typeof target === "number") { + return target; + } else { + const coercedValue = Number(target); + switch (policy) { + case "strict": { + validation.context("asNumber", () => { + validation.unexpectedType("coercedValue", "number", target, objectPathToString(path)); + }); + break; + } + case "coercible": { + if (isNaN(coercedValue)) { + validation.context("asNumber", () => { + validation.unexpectedType("coercedValue", "number", target, objectPathToString(path)); + }); + return null; + } + break; + } + case "none": + default: { + break; + } + } + + return coercedValue; + } +} + +/** + * Safely coerce an object into a dictionary. + * @param object The object to coerce. + * @param path The path to traverse on `object` to find the dictionary. + * Omit this parameter if `object` is itself a dictionary. + * @param defaultValue The object to return if the path search fails. + * @returns A sub-dictionary from `object`, or `null` if `object` is null. + */ +export function asDictionary( + object: JSONValue, + path?: ObjectPath, + defaultValue?: MapLike, +): MapLike | null { + const target = traverse(object, path, null); + if (target instanceof Object && !Array.isArray(target)) { + // Note: It's too expensive to actually validate this is a dictionary of { string : Type } at run time + return target as MapLike; + } else { + if (!isNull(target)) { + validation.context("asDictionary", () => { + validation.unexpectedType("defaultValue", "object", target, objectPathToString(path)); + }); + } + + if (isDefinedNonNull(defaultValue)) { + return defaultValue; + } + return null; + } +} + +/** + * Safely coerce an object into a given interface. + * @param object The object to coerce. + * @param path The path to traverse on `object` to find a string. + * Omit this parameter if `object` is itself a string. + * @param defaultValue The object to return if the path search fails. + * @returns A sub-dictionary from `object`, or `null` if `object` is null. + */ +export function asInterface( + object: JSONValue, + path?: ObjectPath, + defaultValue?: JSONData, +): Interface | null { + return asDictionary(object, path, defaultValue) as unknown as Interface; +} + +/** + * Coerce an object into a boolean. + * @param object The object to coerce. + * @param path The path to traverse on `object` to find a boolean. + * Omit this parameter if `object` is itself a boolean. + * @param policy The validation policy to use when resolving this value + * @returns A boolean from `object`, or `null` if `object` is null. + * @note This is distinct from `asBooleanOrFalse` in that it doesn't default to false, + * and it tries to convert string boolean values into actual boolean types + */ +export function asBoolean( + object: JSONValue, + path?: ObjectPath, + policy: ValidationPolicy = "coercible", +): boolean | null { + const target = traverse(object, path, null); + + // Value was null + if (isNull(target)) { + return null; + } + + // Value was boolean. + if (typeof target === "boolean") { + return target; + } + + // Value was string. + if (typeof target === "string") { + if (target === "true") { + return true; + } else if (target === "false") { + return false; + } + } + + // Else coerce. + const coercedValue = Boolean(target); + switch (policy) { + case "strict": { + validation.context("asBoolean", () => { + validation.unexpectedType("coercedValue", "number", target, objectPathToString(path)); + }); + break; + } + case "coercible": { + if (isNull(coercedValue)) { + validation.context("asBoolean", () => { + validation.unexpectedType("coercedValue", "number", target, objectPathToString(path)); + }); + return null; + } + break; + } + case "none": + default: { + break; + } + } + + return coercedValue; +} + +/** + * Attempts to coerce the passed value to a JSONValue + * + * Note: due to performance concerns this does not perform a deep inspection of Objects or Arrays. + * + * @param value The value to coerce + * @return A JSONValue or null if value is not a valid JSONValue type + */ +export function asJSONValue(value: unknown): JSONValue | null { + if (value === null || value === undefined) { + return null; + } + switch (typeof value) { + case "string": + case "number": + case "boolean": + return value as JSONValue; + case "object": + // Note: It's too expensive to actually validate this is an array of JSONValues at run time + if (Array.isArray(value)) { + return value as JSONValue; + } + // Note: It's too expensive to actually validate this is a dictionary of { string : JSONValue } at run time + return value as JSONValue; + default: + validation.context("asJSONValue", () => { + validation.unexpectedType("defaultValue", "JSONValue", typeof value); + }); + return null; + } +} + +/** + * Attempts to coerce the passed value to JSONData + * + * @param value The value to coerce + * @return A JSONData or null if the value is not a valid JSONData object + */ +export function asJSONData(value: unknown): JSONData | null { + if (value === null || value === undefined) { + return null; + } + if (value instanceof Object && !Array.isArray(value)) { + // Note: It's too expensive to actually validate this is a dictionary of { string : Type } at run time + return value as JSONData; + } + validation.context("asJSONValue", () => { + validation.unexpectedType("defaultValue", "object", typeof value); + }); + return null; +} + +// endregion diff --git a/node_modules/@apple-media-services/media-api/src/models/urls.ts b/node_modules/@apple-media-services/media-api/src/models/urls.ts new file mode 100644 index 0000000..c1c09f1 --- /dev/null +++ b/node_modules/@apple-media-services/media-api/src/models/urls.ts @@ -0,0 +1,469 @@ +/** + * Created by keithpk on 12/2/16. + */ + +import { isNothing, Nothing, Opt } from "@jet/environment/types/optional"; +import { isDefinedNonNullNonEmpty, isNullOrEmpty } from "./server-data"; + +export type Query = { + [key: string]: string | undefined; +}; + +export type URLComponent = "protocol" | "username" | "password" | "host" | "port" | "pathname" | "query" | "hash"; + +const protocolRegex = /^([a-z][a-z0-9.+-]*:)(\/\/)?([\S\s]*)/i; +const queryParamRegex = /([^=?&]+)=?([^&]*)/g; +const componentOrder: URLComponent[] = ["hash", "query", "pathname", "host"]; + +type URLSplitStyle = "prefix" | "suffix"; + +type URLSplitResult = { + result?: string; + remainder: string; +}; + +function splitUrlComponent(input: string, marker: string, style: URLSplitStyle): URLSplitResult { + const index = input.indexOf(marker); + let result; + let remainder = input; + if (index !== -1) { + const prefix = input.slice(0, index); + const suffix = input.slice(index + marker.length, input.length); + + if (style === "prefix") { + result = prefix; + remainder = suffix; + } else { + result = suffix; + remainder = prefix; + } + } + + // log("Token: " + marker + " String: " + input, " Result: " + result + " Remainder: " + remainder) + + return { + result: result, + remainder: remainder, + }; +} + +export class URL { + protocol?: Opt; + username: string; + password: string; + host?: Opt; + port: string; + pathname?: Opt; + query?: Query = {}; + hash?: string; + + constructor(url?: string) { + if (isNullOrEmpty(url)) { + return; + } + + // Split the protocol from the rest of the urls + let remainder = url; + const match = protocolRegex.exec(url); + if (match != null) { + // Pull out the protocol + let protocol = match[1]; + if (protocol) { + protocol = protocol.split(":")[0]; + } + + this.protocol = protocol; + + // Save the remainder + remainder = match[3]; + } + + // Then match each component in a specific order + let parse: URLSplitResult = { remainder: remainder, result: undefined }; + for (const component of componentOrder) { + if (!parse.remainder) { + break; + } + + switch (component) { + case "hash": { + parse = splitUrlComponent(parse.remainder, "#", "suffix"); + this.hash = parse.result; + break; + } + case "query": { + parse = splitUrlComponent(parse.remainder, "?", "suffix"); + if (isDefinedNonNullNonEmpty(parse.result)) { + this.query = URL.queryFromString(parse.result); + } + break; + } + case "pathname": { + parse = splitUrlComponent(parse.remainder, "/", "suffix"); + + if (isDefinedNonNullNonEmpty(parse.result)) { + // Replace the initial /, since paths require it + this.pathname = "/" + parse.result; + } + break; + } + case "host": { + if (parse.remainder) { + const authorityParse = splitUrlComponent(parse.remainder, "@", "prefix"); + const userInfo = authorityParse.result; + const hostPort = authorityParse.remainder; + if (isDefinedNonNullNonEmpty(userInfo)) { + const userInfoSplit = userInfo.split(":"); + this.username = decodeURIComponent(userInfoSplit[0]); + this.password = decodeURIComponent(userInfoSplit[1]); + } + + if (hostPort) { + const hostPortSplit = hostPort.split(":"); + this.host = hostPortSplit[0]; + this.port = hostPortSplit[1]; + } + } + break; + } + default: { + throw new Error("Unhandled case!"); + } + } + } + } + + set(component: URLComponent, value: string | Query): URL { + if (isNullOrEmpty(value)) { + return this; + } + + if (component === "query") { + if (typeof value === "string") { + value = URL.queryFromString(value); + } + } + + switch (component) { + // Exhaustive match to make sure TS property minifiers and other + // transformer plugins do not break this code. + case "protocol": + this.protocol = value as string; + break; + case "username": + this.username = value as string; + break; + case "password": + this.password = value as string; + break; + case "port": + this.port = value as string; + break; + case "pathname": + this.pathname = value as string; + break; + case "query": + this.query = value as Query; + break; + case "hash": + this.hash = value as string; + break; + default: + // The fallback for component which is not a property of URL object. + this[component] = value as string; + break; + } + return this; + } + + private get(component: URLComponent): string | Query | Nothing { + switch (component) { + // Exhaustive match to make sure TS property minifiers and other + // transformer plugins do not break this code. + case "protocol": + return this.protocol; + case "username": + return this.username; + case "password": + return this.password; + case "port": + return this.port; + case "pathname": + return this.pathname; + case "query": + return this.query; + case "hash": + return this.hash; + default: + // The fallback for component which is not a property of URL object. + return this[component]; + } + } + + append(component: URLComponent, value: string | Query): URL { + const existingValue = this.get(component); + let newValue; + + if (component === "query") { + if (typeof value === "string") { + value = URL.queryFromString(value); + } + + if (typeof existingValue === "string") { + newValue = { existingValue, ...value }; + } else { + newValue = { ...existingValue, ...value }; + } + } else { + let existingValueString = existingValue as string; + + if (!existingValueString) { + existingValueString = ""; + } + + let newValueString = existingValueString; + + if (component === "pathname") { + const pathLength = existingValueString.length; + if (!pathLength || existingValueString[pathLength - 1] !== "/") { + newValueString += "/"; + } + } + + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands, @typescript-eslint/no-base-to-string + newValueString += value; + newValue = newValueString; + } + + return this.set(component, newValue); + } + + param(key: string, value?: string): URL { + if (!key) { + return this; + } + if (this.query == null) { + this.query = {}; + } + this.query[key] = value; + return this; + } + + removeParam(key: string): URL { + if (!key || this.query == null) { + return this; + } + if (this.query[key] !== undefined) { + delete this.query[key]; + } + return this; + } + + /** + * Push a new string value onto the path for this url + * @returns URL this object with the updated path. + */ + path(value: string): URL { + return this.append("pathname", value); + } + + pathExtension(): Opt { + // Extract path extension if one exists + if (isNothing(this.pathname)) { + return null; + } + + const lastFilenameComponents = this.pathname + .split("/") + .filter((item) => item.length > 0) // Remove any double or trailing slashes + .pop() + ?.split("."); + if (lastFilenameComponents === undefined) { + return null; + } + if ( + lastFilenameComponents.filter((part) => { + return part !== ""; + }).length < 2 // Remove any empty parts (e.g. .ssh_config -> ["ssh_config"]) + ) { + return null; + } + + return lastFilenameComponents.pop(); + } + + /** + * Returns the path components of the URL + * @returns An array of non-empty path components from `urls`. + */ + pathComponents(): string[] { + if (isNullOrEmpty(this.pathname)) { + return []; + } + + return this.pathname.split("/").filter((component) => component.length > 0); + } + + /** + * Returns the last path component from this url, updating the url to not include this path component + * @returns String the last path component from this url. + */ + popPathComponent(): string | null { + if (isNullOrEmpty(this.pathname)) { + return null; + } + + const lastPathComponent = this.pathname.slice(this.pathname.lastIndexOf("/") + 1); + + if (lastPathComponent.length === 0) { + return null; + } + + this.pathname = this.pathname.slice(0, this.pathname.lastIndexOf("/")); + + return lastPathComponent; + } + + /** + * Same as toString + * + * @returns {string} A string representation of the URL + */ + build(): string { + return this.toString(); + } + + /** + * Converts the URL to a string + * + * @returns {string} A string representation of the URL + */ + toString(): string { + let url = ""; + + if (isDefinedNonNullNonEmpty(this.protocol)) { + url += this.protocol + "://"; + } + + if (this.username) { + url += encodeURIComponent(this.username); + + if (this.password) { + url += ":" + encodeURIComponent(this.password); + } + + url += "@"; + } + + if (isDefinedNonNullNonEmpty(this.host)) { + url += this.host; + + if (this.port) { + url += ":" + this.port; + } + } + + if (isDefinedNonNullNonEmpty(this.pathname)) { + url += this.pathname; + /// Trim off trailing path separators when we have a valid path + /// We don't do this unless pathname has elements otherwise we will trim the `://` + if (url.endsWith("/") && this.pathname.length > 0) { + url = url.slice(0, -1); + } + } + + if (this.query != null && Object.keys(this.query).length > 0) { + url += "?" + URL.toQueryString(this.query); + } + + if (isDefinedNonNullNonEmpty(this.hash)) { + url += "#" + this.hash; + } + + return url; + } + + // ---------------- + // Static API + // ---------------- + + /** + * Converts a string into a query dictionary + * @param query The string to parse + * @returns The query dictionary containing the key-value pairs in the query string + */ + static queryFromString(query: string): Query { + const result = {}; + + let parseResult = queryParamRegex.exec(query); + while (parseResult != null) { + const key = decodeURIComponent(parseResult[1]); + const value = decodeURIComponent(parseResult[2]); + result[key] = value; + parseResult = queryParamRegex.exec(query); + } + + return result; + } + + /** + * Converts a query dictionary into a query string + * + * @param query The query dictionary + * @returns {string} The string representation of the query dictionary + */ + static toQueryString(query: Query) { + let queryString = ""; + + let first = true; + for (const key of Object.keys(query)) { + if (!first) { + queryString += "&"; + } + first = false; + + queryString += encodeURIComponent(key); + + const value = query[key]; + if (isDefinedNonNullNonEmpty(value) && value.length) { + queryString += "=" + encodeURIComponent(value); + } + } + + return queryString; + } + + /** + * Convenience method to instantiate a URL from a string + * @param url The URL string to parse + * @returns {URL} The new URL object representing the URL + */ + static from(url: string): URL { + return new URL(url); + } + + /** + * Convenience method to instantiate a URL from numerous (optional) components + * @param protocol The protocol type + * @param host The host name + * @param path The path + * @param query The query + * @param hash The hash + * @returns {URL} The new URL object representing the URL + */ + static fromComponents( + protocol?: Opt, + host?: Opt, + path?: Opt, + query?: Query, + hash?: string, + ): URL { + const url = new URL(); + url.protocol = protocol; + url.host = host; + url.pathname = path; + url.query = query; + url.hash = hash; + return url; + } +} diff --git a/node_modules/@apple-media-services/media-api/src/network.ts b/node_modules/@apple-media-services/media-api/src/network.ts new file mode 100644 index 0000000..48f1ccf --- /dev/null +++ b/node_modules/@apple-media-services/media-api/src/network.ts @@ -0,0 +1,403 @@ +/** + * Created by ls on 9/7/2018. + * + * This `network.ts` is the NON-MEDIA API arm of network fetch requests. + * It is built on `Network` object and provides standard functionality, such as: + * 1. Parsing the body into specific format. + * 2. Adding timing metrics onto blob. + * + * This should *only* be used for objects that should have timing metrics, i.e. requests to Non-MediaAPI endpoints + * that will ultimately render some whole page. Otherwise, use `objectGraph.network.fetch` directly. + * + * @see `src/media/network.ts` for fetching from Media API endpoints + */ + +import { FetchRequest, FetchResponse, HTTPTimingMetrics } from "@jet/environment/types/globals/net"; +import { FetchTimingMetrics, MetricsFields } from "@jet/environment/types/metrics"; +import { FetchTimingMetricsBuilder } from "@jet/environment/metrics"; +import { isSome, Opt } from "@jet/environment/types/optional"; +import * as serverData from "./models/server-data"; +import { ParsedNetworkResponse } from "./models/data-structure"; +import { Request } from "./models/request"; +import * as urls from "./models/urls"; +import * as urlBuilder from "./url-builder"; +import { MediaConfigurationType, MediaTokenService } from "./models/mediapi-configuration"; +import { HTTPMethod, HTTPCachePolicy, HTTPSigningStyle, HTTPHeaders } from "@jet/environment"; + +/** @public */ +// eslint-disable-next-line @typescript-eslint/no-namespace +export namespace ResponseMetadata { + export const requestedUrl = "_jet-internal:metricsHelpers_requestedUrl"; + + /** + * Symbol used to place timing metrics values onto fetch responses + * without interfering with the data returned by the server. + */ + export const timingValues = "_jet-internal:metricsHelpers_timingValues"; + + /** + * Key used to access the page information gathered from a response's headers + */ + export const pageInformation = "_jet-internal:metricsHelpers_pageInformation"; + + /** + * Key used to access the content max-age gathered from a response's headers. + */ + export const contentMaxAge = "_jet-internal:responseMetadata_contentMaxAge"; +} + +/** + * Module's private fetch implementation built off `net` global. + * + * @param {FetchRequest} request describes fetch request. + * @param {(value: string) => Type} parser Some function parsing response body `string` into specific type. + * @returns {Promise} Promise resolving to specific object. + * @throws {Error} Throws error if status code of request is not 200. + * + * @note Similar to `fetchWithToken` in `media` module, but excludes media token specific functionality. + * Top level data fetches to endpoints that don't do redirects, and can benefit from metrics should + * call methods that build off of this instead of calling `objectGraph.network.fetch(...)` directly. + */ +export async function fetch( + configuration: MediaConfigurationType, + request: FetchRequest, + parser: (value: Opt) => Type, +): Promise { + const response = await configuration.network.fetch(request); + if (!response.ok) { + throw Error(`Bad Status code ${response.status} for ${request.url}`); + } + const parseStartTime = Date.now(); + const result = parser(response.body) as Type & ParsedNetworkResponse; + const parseEndTime = Date.now(); + + // Build full network timing metrics. + const completeTimingMetrics = networkTimingMetricsWithParseTime(response.metrics, parseStartTime, parseEndTime); + if (serverData.isDefinedNonNull(completeTimingMetrics)) { + result[ResponseMetadata.timingValues] = completeTimingMetrics; + } + result[ResponseMetadata.requestedUrl] = request.url.toString(); + return result; +} + +/** + * Fetch from an endpoint with JSON response body. + * + * @param {FetchRequest} request to fetch from endpoint with JSON response.. + * @returns {Promise} Promise resolving to body of response parsed as `Type`. + * @throws {Error} Throws error if status code of request is not 200. + */ +export async function fetchJSON(configuration: MediaConfigurationType, request: FetchRequest): Promise { + return await fetch(configuration, request, (body) => { + if (isSome(body)) { + return JSON.parse(body) as Type; + } else { + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return {} as Type; + } + }); +} + +/** + * Fetch from an endpoint with XML response body. + * + * @param {FetchRequest} request to fetch from endpoint with XML response. + * @returns {Promise} Promise resolving to body of response parsed as `Type`. + * @throws {Error} Throws error if status code of request is not 200. + */ +export async function fetchPlist(configuration: MediaConfigurationType, request: FetchRequest): Promise { + return await fetch(configuration, request, (body) => { + if (isSome(body)) { + return configuration.plist.parse(body) as Type; + } else { + throw new Error(`Could not fetch Plist, response body was not defined for ${request.url}`); + } + }); +} + +/** + * With network requests now being created and parsed in JS, different timing metrics are measured in both Native and JS. + * This function populates the missing values from `HTTPTimingMetrics`'s native counterpart, `JSNetworkPerformanceMetrics`. + * + * @param {HTTPTimingMetrics[] | null} responseMetrics Array of response metrics provided by native. + * @param {number} parseStartTime Time at which response body string parse began in JS. + * @param {number} parseEndTime Time at which response body string parse ended in JS. + * @returns {HTTPTimingMetrics | null} Fully populated timing metrics, or `null` if native response provided no metrics events to build off of. + */ +function networkTimingMetricsWithParseTime( + responseMetrics: HTTPTimingMetrics[] | null, + parseStartTime: number, + parseEndTime: number, +): FetchTimingMetrics | null { + // No metrics events to build from. + if (serverData.isNull(responseMetrics) || responseMetrics.length === 0) { + return null; + } + + // Append parse times to first partial timing metrics from native. + const firstPartialTimingMetrics: FetchTimingMetrics = { + ...responseMetrics[0], + parseStartTime: parseStartTime, + parseEndTime: parseEndTime, + }; + // Timing metrics with all properties populated. + return firstPartialTimingMetrics; +} + +export type FetchOptions = { + headers?: { [key: string]: string }; + method?: "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "CONNECT" | "OPTIONS" | "TRACE" | "PATCH"; + requestBodyString?: string; + timeout?: number; // in seconds. Check for feature 'supportsRequestTimeoutOption'. + /// When true the fetch wont throw if we dont get any data back for given request. + allowEmptyDataResponse?: boolean; + excludeIdentifierHeadersForAccount?: boolean; // Defaults to false + alwaysIncludeAuthKitHeaders?: boolean; // Defaults to true + alwaysIncludeMMeClientInfoAndDeviceHeaders?: boolean; // Defaults to true +}; + +/** + * Implements the MAPI fetch, building URL from MAPI Request and opaquely managing initial token request and refreshes. + * + * @param {MediaConfigurationType} configuration Base media API configuration. + * @param {Request} request MAPI Request to fetch with. + * @param {FetchOptions} [options] FetchOptions for the MAPI request. + * @returns {Promise} Promise resolving to some type for given MAPI request. + */ +export async function fetchData( + configuration: MediaConfigurationType, + mediaToken: MediaTokenService, + request: Request, + options?: FetchOptions, +): Promise { + const url = urlBuilder.buildURLFromRequest(configuration, request).toString(); + const startTime = Date.now(); + const token = await mediaToken.refreshToken(); + const response = await fetchWithToken( + configuration, + mediaToken, + url, + token, + options, + false, + configuration.fetchTimingMetricsBuilder, + ); + const endTime = Date.now(); + if (request.canonicalUrl) { + response[ResponseMetadata.requestedUrl] = request.canonicalUrl; + } + const roundTripTimeIncludingWaiting = endTime - startTime; + if (roundTripTimeIncludingWaiting > 500) { + console.warn("Fetch took too long (" + roundTripTimeIncludingWaiting.toString() + "ms) " + url); + } + return response; +} + +export function redirectParametersInUrl(configuration: MediaConfigurationType, url: urls.URL): string[] { + const redirectURLParams = configuration.redirectUrlWhitelistedQueryParams; + return redirectURLParams.filter((param) => serverData.isDefinedNonNull(url.query?.[param])); +} + +export type MediaAPIFetchRequest = { + url: string; + excludeIdentifierHeadersForAccount?: boolean; + alwaysIncludeAuthKitHeaders?: boolean; + alwaysIncludeMMeClientInfoAndDeviceHeaders?: boolean; + method?: Opt; + cache?: Opt; + signingStyle?: Opt; + headers?: Opt; + timeout?: Opt; + body?: Opt; +}; + +/** + * Given a built URL, token, and options, calls into native networking APIs to fetch content. + * + * @param {string} url URL to fetch data from. + * @param {string} token MAPI token key. + * @param {FetchOptions} options Fetch options for MAPI requests. + * @param {boolean} isRetry flag indicating whether this is a fetch retry following a 401 request, and media token was refreshed. + * @returns {Promise} Promise resolving to some type for given MAPI request. + */ +async function fetchWithToken( + configuration: MediaConfigurationType, + mediaToken: MediaTokenService, + url: string, + token: string, + options: FetchOptions = {}, + isRetry = false, + fetchTimingMetricsBuilder: Opt, +): Promise { + // Removes all affiliate/redirect params for caching (https://connectme.apple.com/docs/DOC-577671) + const filteredURL = new urls.URL(url); + const redirectParameters = redirectParametersInUrl(configuration, filteredURL); + for (const param of redirectParameters) { + filteredURL.removeParam(param); + } + const filteredUrlString = filteredURL.toString(); + + let headers = options.headers; + if (headers == null) { + headers = {}; + } + headers["Authorization"] = "Bearer " + token; + + const fetchRequest: MediaAPIFetchRequest = { + url: filteredUrlString, + excludeIdentifierHeadersForAccount: options.excludeIdentifierHeadersForAccount ?? false, + alwaysIncludeAuthKitHeaders: options.alwaysIncludeAuthKitHeaders ?? true, + alwaysIncludeMMeClientInfoAndDeviceHeaders: options.alwaysIncludeMMeClientInfoAndDeviceHeaders ?? true, + headers: headers, + method: options.method, + body: options.requestBodyString, + timeout: options.timeout, + }; + + const response = await configuration.network.fetch(fetchRequest); + + try { + if (response.status === 401 || response.status === 403) { + if (isRetry) { + throw Error("We refreshed the token but we still get 401 from the API"); + } + mediaToken.resetToken(); + return await mediaToken.refreshToken().then(async (newToken) => { + // Explicitly re-fetch with the original request so logging and metrics are correct + return await fetchWithToken( + configuration, + mediaToken, + url, + newToken, + options, + true, + fetchTimingMetricsBuilder, + ); + }); + } else if (response.status === 404) { + // item is not available in this storefront or perhaps not at all + throw noContentError(); + } else if (!response.ok) { + const correlationKey = response.headers["x-apple-jingle-correlation-key"] ?? "N/A"; + const error = new NetworkError( + `Bad Status code ${response.status} (correlationKey: ${correlationKey}) for ${filteredUrlString}, original ${url}`, + ); + error.statusCode = response.status; + throw error; + } + + const parser = (resp: FetchResponse) => { + const parseStartTime = Date.now(); + let result: Type & ParsedNetworkResponse; + if (serverData.isNull(resp.body) || resp.body === "") { + if (resp.status === 204) { + // 204 indicates a success, but the response will typically be empty + // Create a fake result so that we don't throw an error when JSON parsing + const emptyData: ParsedNetworkResponse = {}; + result = emptyData as Type & ParsedNetworkResponse; + } else { + throw noContentError(); + } + } else { + result = JSON.parse(resp.body) as Type & ParsedNetworkResponse; + } + const parseEndTime = Date.now(); + + result[ResponseMetadata.pageInformation] = serverData.asJSONData( + getPageInformationFromResponse(configuration, resp), + ); + if (resp.metrics.length > 0) { + const metrics: FetchTimingMetrics = { + ...resp.metrics[0], + parseStartTime: parseStartTime, + parseEndTime: parseEndTime, + }; + result[ResponseMetadata.timingValues] = metrics; + } else { + const fallbackMetrics: FetchTimingMetrics = { + pageURL: resp.url, + parseStartTime, + parseEndTime, + }; + result[ResponseMetadata.timingValues] = fallbackMetrics; + } + result[ResponseMetadata.contentMaxAge] = getContentTimeToLiveFromResponse(resp); + + // If we have an empty data object, throw a 204 (No Content). + if ( + Array.isArray(result.data) && + serverData.isArrayDefinedNonNullAndEmpty(result.data) && + !serverData.asBooleanOrFalse(options.allowEmptyDataResponse) + ) { + throw noContentError(); + } + + result[ResponseMetadata.requestedUrl] = url; + return result; + }; + if (isSome(fetchTimingMetricsBuilder)) { + return fetchTimingMetricsBuilder.measureParsing(response, parser); + } else { + return parser(response); + } + } catch (e) { + if (e instanceof NetworkError) { + throw e; + } + throw new Error(`Error Fetching - filtered: ${filteredUrlString}, original: ${url}, ${e.name}, ${e.message}`); + } +} + +export class NetworkError extends Error { + statusCode?: number; +} + +function noContentError(): NetworkError { + const error = new NetworkError(`No content`); + error.statusCode = 204; + return error; +} + +const serverInstanceHeader = "x-apple-application-instance"; + +const environmentDataCenterHeader = "x-apple-application-site"; + +function getPageInformationFromResponse( + configuration: MediaConfigurationType, + response: FetchResponse, +): MetricsFields | null { + const storeFrontHeader: string = configuration.storefrontIdentifier; + + let storeFront: Opt = null; + if (serverData.isDefinedNonNullNonEmpty(storeFrontHeader)) { + const storeFrontHeaderComponents: string[] = storeFrontHeader.split("-"); + if (serverData.isDefinedNonNullNonEmpty(storeFrontHeaderComponents)) { + storeFront = storeFrontHeaderComponents[0]; + } + } + + return { + serverInstance: response.headers[serverInstanceHeader], + storeFrontHeader: storeFrontHeader, + language: configuration.bagLanguage, + storeFront: storeFront, + environmentDataCenter: response.headers[environmentDataCenterHeader], + }; +} + +function getContentTimeToLiveFromResponse(response: FetchResponse): Opt { + const cacheControlHeaderKey = Object.keys(response.headers).find((key) => key.toLowerCase() === "cache-control"); + if (serverData.isNull(cacheControlHeaderKey) || cacheControlHeaderKey === "") { + return null; + } + + const headerValue = response.headers[cacheControlHeaderKey]; + if (serverData.isNullOrEmpty(headerValue)) { + return null; + } + const matches = headerValue.match(/max-age=(\d+)/); + if (serverData.isNull(matches) || matches.length < 2) { + return null; + } + return serverData.asNumber(matches[1]); +} diff --git a/node_modules/@floating-ui/core/dist/floating-ui.core.mjs b/node_modules/@floating-ui/core/dist/floating-ui.core.mjs new file mode 100644 index 0000000..17f6a80 --- /dev/null +++ b/node_modules/@floating-ui/core/dist/floating-ui.core.mjs @@ -0,0 +1,1046 @@ +import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils'; +export { rectToClientRect } from '@floating-ui/utils'; + +function computeCoordsFromPlacement(_ref, placement, rtl) { + let { + reference, + floating + } = _ref; + const sideAxis = getSideAxis(placement); + const alignmentAxis = getAlignmentAxis(placement); + const alignLength = getAxisLength(alignmentAxis); + const side = getSide(placement); + const isVertical = sideAxis === 'y'; + const commonX = reference.x + reference.width / 2 - floating.width / 2; + const commonY = reference.y + reference.height / 2 - floating.height / 2; + const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; + let coords; + switch (side) { + case 'top': + coords = { + x: commonX, + y: reference.y - floating.height + }; + break; + case 'bottom': + coords = { + x: commonX, + y: reference.y + reference.height + }; + break; + case 'right': + coords = { + x: reference.x + reference.width, + y: commonY + }; + break; + case 'left': + coords = { + x: reference.x - floating.width, + y: commonY + }; + break; + default: + coords = { + x: reference.x, + y: reference.y + }; + } + switch (getAlignment(placement)) { + case 'start': + coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); + break; + case 'end': + coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); + break; + } + return coords; +} + +/** + * Computes the `x` and `y` coordinates that will place the floating element + * next to a given reference element. + * + * This export does not have any `platform` interface logic. You will need to + * write one for the platform you are using Floating UI with. + */ +const computePosition = async (reference, floating, config) => { + const { + placement = 'bottom', + strategy = 'absolute', + middleware = [], + platform + } = config; + const validMiddleware = middleware.filter(Boolean); + const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); + let rects = await platform.getElementRects({ + reference, + floating, + strategy + }); + let { + x, + y + } = computeCoordsFromPlacement(rects, placement, rtl); + let statefulPlacement = placement; + let middlewareData = {}; + let resetCount = 0; + for (let i = 0; i < validMiddleware.length; i++) { + const { + name, + fn + } = validMiddleware[i]; + const { + x: nextX, + y: nextY, + data, + reset + } = await fn({ + x, + y, + initialPlacement: placement, + placement: statefulPlacement, + strategy, + middlewareData, + rects, + platform, + elements: { + reference, + floating + } + }); + x = nextX != null ? nextX : x; + y = nextY != null ? nextY : y; + middlewareData = { + ...middlewareData, + [name]: { + ...middlewareData[name], + ...data + } + }; + if (reset && resetCount <= 50) { + resetCount++; + if (typeof reset === 'object') { + if (reset.placement) { + statefulPlacement = reset.placement; + } + if (reset.rects) { + rects = reset.rects === true ? await platform.getElementRects({ + reference, + floating, + strategy + }) : reset.rects; + } + ({ + x, + y + } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); + } + i = -1; + } + } + return { + x, + y, + placement: statefulPlacement, + strategy, + middlewareData + }; +}; + +/** + * Resolves with an object of overflow side offsets that determine how much the + * element is overflowing a given clipping boundary on each side. + * - positive = overflowing the boundary by that number of pixels + * - negative = how many pixels left before it will overflow + * - 0 = lies flush with the boundary + * @see https://floating-ui.com/docs/detectOverflow + */ +async function detectOverflow(state, options) { + var _await$platform$isEle; + if (options === void 0) { + options = {}; + } + const { + x, + y, + platform, + rects, + elements, + strategy + } = state; + const { + boundary = 'clippingAncestors', + rootBoundary = 'viewport', + elementContext = 'floating', + altBoundary = false, + padding = 0 + } = evaluate(options, state); + const paddingObject = getPaddingObject(padding); + const altContext = elementContext === 'floating' ? 'reference' : 'floating'; + const element = elements[altBoundary ? altContext : elementContext]; + const clippingClientRect = rectToClientRect(await platform.getClippingRect({ + element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), + boundary, + rootBoundary, + strategy + })); + const rect = elementContext === 'floating' ? { + x, + y, + width: rects.floating.width, + height: rects.floating.height + } : rects.reference; + const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); + const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { + x: 1, + y: 1 + } : { + x: 1, + y: 1 + }; + const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ + elements, + rect, + offsetParent, + strategy + }) : rect); + return { + top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, + bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, + left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, + right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x + }; +} + +/** + * Provides data to position an inner element of the floating element so that it + * appears centered to the reference element. + * @see https://floating-ui.com/docs/arrow + */ +const arrow = options => ({ + name: 'arrow', + options, + async fn(state) { + const { + x, + y, + placement, + rects, + platform, + elements, + middlewareData + } = state; + // Since `element` is required, we don't Partial<> the type. + const { + element, + padding = 0 + } = evaluate(options, state) || {}; + if (element == null) { + return {}; + } + const paddingObject = getPaddingObject(padding); + const coords = { + x, + y + }; + const axis = getAlignmentAxis(placement); + const length = getAxisLength(axis); + const arrowDimensions = await platform.getDimensions(element); + const isYAxis = axis === 'y'; + const minProp = isYAxis ? 'top' : 'left'; + const maxProp = isYAxis ? 'bottom' : 'right'; + const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; + const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; + const startDiff = coords[axis] - rects.reference[axis]; + const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); + let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; + + // DOM platform can return `window` as the `offsetParent`. + if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { + clientSize = elements.floating[clientProp] || rects.floating[length]; + } + const centerToReference = endDiff / 2 - startDiff / 2; + + // If the padding is large enough that it causes the arrow to no longer be + // centered, modify the padding so that it is centered. + const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; + const minPadding = min(paddingObject[minProp], largestPossiblePadding); + const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); + + // Make sure the arrow doesn't overflow the floating element if the center + // point is outside the floating element's bounds. + const min$1 = minPadding; + const max = clientSize - arrowDimensions[length] - maxPadding; + const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; + const offset = clamp(min$1, center, max); + + // If the reference is small enough that the arrow's padding causes it to + // to point to nothing for an aligned placement, adjust the offset of the + // floating element itself. To ensure `shift()` continues to take action, + // a single reset is performed when this is true. + const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; + const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; + return { + [axis]: coords[axis] + alignmentOffset, + data: { + [axis]: offset, + centerOffset: center - offset - alignmentOffset, + ...(shouldAddOffset && { + alignmentOffset + }) + }, + reset: shouldAddOffset + }; + } +}); + +function getPlacementList(alignment, autoAlignment, allowedPlacements) { + const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); + return allowedPlacementsSortedByAlignment.filter(placement => { + if (alignment) { + return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); + } + return true; + }); +} +/** + * Optimizes the visibility of the floating element by choosing the placement + * that has the most space available automatically, without needing to specify a + * preferred placement. Alternative to `flip`. + * @see https://floating-ui.com/docs/autoPlacement + */ +const autoPlacement = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'autoPlacement', + options, + async fn(state) { + var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; + const { + rects, + middlewareData, + placement, + platform, + elements + } = state; + const { + crossAxis = false, + alignment, + allowedPlacements = placements, + autoAlignment = true, + ...detectOverflowOptions + } = evaluate(options, state); + const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; + const overflow = await detectOverflow(state, detectOverflowOptions); + const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; + const currentPlacement = placements$1[currentIndex]; + if (currentPlacement == null) { + return {}; + } + const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); + + // Make `computeCoords` start from the right place. + if (placement !== currentPlacement) { + return { + reset: { + placement: placements$1[0] + } + }; + } + const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; + const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { + placement: currentPlacement, + overflows: currentOverflows + }]; + const nextPlacement = placements$1[currentIndex + 1]; + + // There are more placements to check. + if (nextPlacement) { + return { + data: { + index: currentIndex + 1, + overflows: allOverflows + }, + reset: { + placement: nextPlacement + } + }; + } + const placementsSortedByMostSpace = allOverflows.map(d => { + const alignment = getAlignment(d.placement); + return [d.placement, alignment && crossAxis ? + // Check along the mainAxis and main crossAxis side. + d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : + // Check only the mainAxis. + d.overflows[0], d.overflows]; + }).sort((a, b) => a[1] - b[1]); + const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, + // Aligned placements should not check their opposite crossAxis + // side. + getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); + const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; + if (resetPlacement !== placement) { + return { + data: { + index: currentIndex + 1, + overflows: allOverflows + }, + reset: { + placement: resetPlacement + } + }; + } + return {}; + } + }; +}; + +/** + * Optimizes the visibility of the floating element by flipping the `placement` + * in order to keep it in view when the preferred placement(s) will overflow the + * clipping boundary. Alternative to `autoPlacement`. + * @see https://floating-ui.com/docs/flip + */ +const flip = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'flip', + options, + async fn(state) { + var _middlewareData$arrow, _middlewareData$flip; + const { + placement, + middlewareData, + rects, + initialPlacement, + platform, + elements + } = state; + const { + mainAxis: checkMainAxis = true, + crossAxis: checkCrossAxis = true, + fallbackPlacements: specifiedFallbackPlacements, + fallbackStrategy = 'bestFit', + fallbackAxisSideDirection = 'none', + flipAlignment = true, + ...detectOverflowOptions + } = evaluate(options, state); + + // If a reset by the arrow was caused due to an alignment offset being + // added, we should skip any logic now since `flip()` has already done its + // work. + // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 + if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { + return {}; + } + const side = getSide(placement); + const initialSideAxis = getSideAxis(initialPlacement); + const isBasePlacement = getSide(initialPlacement) === initialPlacement; + const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); + const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); + const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none'; + if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { + fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); + } + const placements = [initialPlacement, ...fallbackPlacements]; + const overflow = await detectOverflow(state, detectOverflowOptions); + const overflows = []; + let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; + if (checkMainAxis) { + overflows.push(overflow[side]); + } + if (checkCrossAxis) { + const sides = getAlignmentSides(placement, rects, rtl); + overflows.push(overflow[sides[0]], overflow[sides[1]]); + } + overflowsData = [...overflowsData, { + placement, + overflows + }]; + + // One or more sides is overflowing. + if (!overflows.every(side => side <= 0)) { + var _middlewareData$flip2, _overflowsData$filter; + const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; + const nextPlacement = placements[nextIndex]; + if (nextPlacement) { + var _overflowsData$; + const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false; + const hasInitialMainAxisOverflow = ((_overflowsData$ = overflowsData[0]) == null ? void 0 : _overflowsData$.overflows[0]) > 0; + if (!ignoreCrossAxisOverflow || hasInitialMainAxisOverflow) { + // Try next placement and re-run the lifecycle. + return { + data: { + index: nextIndex, + overflows: overflowsData + }, + reset: { + placement: nextPlacement + } + }; + } + } + + // First, find the candidates that fit on the mainAxis side of overflow, + // then find the placement that fits the best on the main crossAxis side. + let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; + + // Otherwise fallback. + if (!resetPlacement) { + switch (fallbackStrategy) { + case 'bestFit': + { + var _overflowsData$filter2; + const placement = (_overflowsData$filter2 = overflowsData.filter(d => { + if (hasFallbackAxisSideDirection) { + const currentSideAxis = getSideAxis(d.placement); + return currentSideAxis === initialSideAxis || + // Create a bias to the `y` side axis due to horizontal + // reading directions favoring greater width. + currentSideAxis === 'y'; + } + return true; + }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; + if (placement) { + resetPlacement = placement; + } + break; + } + case 'initialPlacement': + resetPlacement = initialPlacement; + break; + } + } + if (placement !== resetPlacement) { + return { + reset: { + placement: resetPlacement + } + }; + } + } + return {}; + } + }; +}; + +function getSideOffsets(overflow, rect) { + return { + top: overflow.top - rect.height, + right: overflow.right - rect.width, + bottom: overflow.bottom - rect.height, + left: overflow.left - rect.width + }; +} +function isAnySideFullyClipped(overflow) { + return sides.some(side => overflow[side] >= 0); +} +/** + * Provides data to hide the floating element in applicable situations, such as + * when it is not in the same clipping context as the reference element. + * @see https://floating-ui.com/docs/hide + */ +const hide = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'hide', + options, + async fn(state) { + const { + rects + } = state; + const { + strategy = 'referenceHidden', + ...detectOverflowOptions + } = evaluate(options, state); + switch (strategy) { + case 'referenceHidden': + { + const overflow = await detectOverflow(state, { + ...detectOverflowOptions, + elementContext: 'reference' + }); + const offsets = getSideOffsets(overflow, rects.reference); + return { + data: { + referenceHiddenOffsets: offsets, + referenceHidden: isAnySideFullyClipped(offsets) + } + }; + } + case 'escaped': + { + const overflow = await detectOverflow(state, { + ...detectOverflowOptions, + altBoundary: true + }); + const offsets = getSideOffsets(overflow, rects.floating); + return { + data: { + escapedOffsets: offsets, + escaped: isAnySideFullyClipped(offsets) + } + }; + } + default: + { + return {}; + } + } + } + }; +}; + +function getBoundingRect(rects) { + const minX = min(...rects.map(rect => rect.left)); + const minY = min(...rects.map(rect => rect.top)); + const maxX = max(...rects.map(rect => rect.right)); + const maxY = max(...rects.map(rect => rect.bottom)); + return { + x: minX, + y: minY, + width: maxX - minX, + height: maxY - minY + }; +} +function getRectsByLine(rects) { + const sortedRects = rects.slice().sort((a, b) => a.y - b.y); + const groups = []; + let prevRect = null; + for (let i = 0; i < sortedRects.length; i++) { + const rect = sortedRects[i]; + if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { + groups.push([rect]); + } else { + groups[groups.length - 1].push(rect); + } + prevRect = rect; + } + return groups.map(rect => rectToClientRect(getBoundingRect(rect))); +} +/** + * Provides improved positioning for inline reference elements that can span + * over multiple lines, such as hyperlinks or range selections. + * @see https://floating-ui.com/docs/inline + */ +const inline = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'inline', + options, + async fn(state) { + const { + placement, + elements, + rects, + platform, + strategy + } = state; + // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a + // ClientRect's bounds, despite the event listener being triggered. A + // padding of 2 seems to handle this issue. + const { + padding = 2, + x, + y + } = evaluate(options, state); + const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); + const clientRects = getRectsByLine(nativeClientRects); + const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); + const paddingObject = getPaddingObject(padding); + function getBoundingClientRect() { + // There are two rects and they are disjoined. + if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { + // Find the first rect in which the point is fully inside. + return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; + } + + // There are 2 or more connected rects. + if (clientRects.length >= 2) { + if (getSideAxis(placement) === 'y') { + const firstRect = clientRects[0]; + const lastRect = clientRects[clientRects.length - 1]; + const isTop = getSide(placement) === 'top'; + const top = firstRect.top; + const bottom = lastRect.bottom; + const left = isTop ? firstRect.left : lastRect.left; + const right = isTop ? firstRect.right : lastRect.right; + const width = right - left; + const height = bottom - top; + return { + top, + bottom, + left, + right, + width, + height, + x: left, + y: top + }; + } + const isLeftSide = getSide(placement) === 'left'; + const maxRight = max(...clientRects.map(rect => rect.right)); + const minLeft = min(...clientRects.map(rect => rect.left)); + const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); + const top = measureRects[0].top; + const bottom = measureRects[measureRects.length - 1].bottom; + const left = minLeft; + const right = maxRight; + const width = right - left; + const height = bottom - top; + return { + top, + bottom, + left, + right, + width, + height, + x: left, + y: top + }; + } + return fallback; + } + const resetRects = await platform.getElementRects({ + reference: { + getBoundingClientRect + }, + floating: elements.floating, + strategy + }); + if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { + return { + reset: { + rects: resetRects + } + }; + } + return {}; + } + }; +}; + +// For type backwards-compatibility, the `OffsetOptions` type was also +// Derivable. + +async function convertValueToCoords(state, options) { + const { + placement, + platform, + elements + } = state; + const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); + const side = getSide(placement); + const alignment = getAlignment(placement); + const isVertical = getSideAxis(placement) === 'y'; + const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1; + const crossAxisMulti = rtl && isVertical ? -1 : 1; + const rawValue = evaluate(options, state); + + // eslint-disable-next-line prefer-const + let { + mainAxis, + crossAxis, + alignmentAxis + } = typeof rawValue === 'number' ? { + mainAxis: rawValue, + crossAxis: 0, + alignmentAxis: null + } : { + mainAxis: rawValue.mainAxis || 0, + crossAxis: rawValue.crossAxis || 0, + alignmentAxis: rawValue.alignmentAxis + }; + if (alignment && typeof alignmentAxis === 'number') { + crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; + } + return isVertical ? { + x: crossAxis * crossAxisMulti, + y: mainAxis * mainAxisMulti + } : { + x: mainAxis * mainAxisMulti, + y: crossAxis * crossAxisMulti + }; +} + +/** + * Modifies the placement by translating the floating element along the + * specified axes. + * A number (shorthand for `mainAxis` or distance), or an axes configuration + * object may be passed. + * @see https://floating-ui.com/docs/offset + */ +const offset = function (options) { + if (options === void 0) { + options = 0; + } + return { + name: 'offset', + options, + async fn(state) { + var _middlewareData$offse, _middlewareData$arrow; + const { + x, + y, + placement, + middlewareData + } = state; + const diffCoords = await convertValueToCoords(state, options); + + // If the placement is the same and the arrow caused an alignment offset + // then we don't need to change the positioning coordinates. + if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { + return {}; + } + return { + x: x + diffCoords.x, + y: y + diffCoords.y, + data: { + ...diffCoords, + placement + } + }; + } + }; +}; + +/** + * Optimizes the visibility of the floating element by shifting it in order to + * keep it in view when it will overflow the clipping boundary. + * @see https://floating-ui.com/docs/shift + */ +const shift = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'shift', + options, + async fn(state) { + const { + x, + y, + placement + } = state; + const { + mainAxis: checkMainAxis = true, + crossAxis: checkCrossAxis = false, + limiter = { + fn: _ref => { + let { + x, + y + } = _ref; + return { + x, + y + }; + } + }, + ...detectOverflowOptions + } = evaluate(options, state); + const coords = { + x, + y + }; + const overflow = await detectOverflow(state, detectOverflowOptions); + const crossAxis = getSideAxis(getSide(placement)); + const mainAxis = getOppositeAxis(crossAxis); + let mainAxisCoord = coords[mainAxis]; + let crossAxisCoord = coords[crossAxis]; + if (checkMainAxis) { + const minSide = mainAxis === 'y' ? 'top' : 'left'; + const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; + const min = mainAxisCoord + overflow[minSide]; + const max = mainAxisCoord - overflow[maxSide]; + mainAxisCoord = clamp(min, mainAxisCoord, max); + } + if (checkCrossAxis) { + const minSide = crossAxis === 'y' ? 'top' : 'left'; + const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; + const min = crossAxisCoord + overflow[minSide]; + const max = crossAxisCoord - overflow[maxSide]; + crossAxisCoord = clamp(min, crossAxisCoord, max); + } + const limitedCoords = limiter.fn({ + ...state, + [mainAxis]: mainAxisCoord, + [crossAxis]: crossAxisCoord + }); + return { + ...limitedCoords, + data: { + x: limitedCoords.x - x, + y: limitedCoords.y - y, + enabled: { + [mainAxis]: checkMainAxis, + [crossAxis]: checkCrossAxis + } + } + }; + } + }; +}; +/** + * Built-in `limiter` that will stop `shift()` at a certain point. + */ +const limitShift = function (options) { + if (options === void 0) { + options = {}; + } + return { + options, + fn(state) { + const { + x, + y, + placement, + rects, + middlewareData + } = state; + const { + offset = 0, + mainAxis: checkMainAxis = true, + crossAxis: checkCrossAxis = true + } = evaluate(options, state); + const coords = { + x, + y + }; + const crossAxis = getSideAxis(placement); + const mainAxis = getOppositeAxis(crossAxis); + let mainAxisCoord = coords[mainAxis]; + let crossAxisCoord = coords[crossAxis]; + const rawOffset = evaluate(offset, state); + const computedOffset = typeof rawOffset === 'number' ? { + mainAxis: rawOffset, + crossAxis: 0 + } : { + mainAxis: 0, + crossAxis: 0, + ...rawOffset + }; + if (checkMainAxis) { + const len = mainAxis === 'y' ? 'height' : 'width'; + const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; + const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; + if (mainAxisCoord < limitMin) { + mainAxisCoord = limitMin; + } else if (mainAxisCoord > limitMax) { + mainAxisCoord = limitMax; + } + } + if (checkCrossAxis) { + var _middlewareData$offse, _middlewareData$offse2; + const len = mainAxis === 'y' ? 'width' : 'height'; + const isOriginSide = ['top', 'left'].includes(getSide(placement)); + const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); + const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); + if (crossAxisCoord < limitMin) { + crossAxisCoord = limitMin; + } else if (crossAxisCoord > limitMax) { + crossAxisCoord = limitMax; + } + } + return { + [mainAxis]: mainAxisCoord, + [crossAxis]: crossAxisCoord + }; + } + }; +}; + +/** + * Provides data that allows you to change the size of the floating element — + * for instance, prevent it from overflowing the clipping boundary or match the + * width of the reference element. + * @see https://floating-ui.com/docs/size + */ +const size = function (options) { + if (options === void 0) { + options = {}; + } + return { + name: 'size', + options, + async fn(state) { + var _state$middlewareData, _state$middlewareData2; + const { + placement, + rects, + platform, + elements + } = state; + const { + apply = () => {}, + ...detectOverflowOptions + } = evaluate(options, state); + const overflow = await detectOverflow(state, detectOverflowOptions); + const side = getSide(placement); + const alignment = getAlignment(placement); + const isYAxis = getSideAxis(placement) === 'y'; + const { + width, + height + } = rects.floating; + let heightSide; + let widthSide; + if (side === 'top' || side === 'bottom') { + heightSide = side; + widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; + } else { + widthSide = side; + heightSide = alignment === 'end' ? 'top' : 'bottom'; + } + const maximumClippingHeight = height - overflow.top - overflow.bottom; + const maximumClippingWidth = width - overflow.left - overflow.right; + const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); + const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); + const noShift = !state.middlewareData.shift; + let availableHeight = overflowAvailableHeight; + let availableWidth = overflowAvailableWidth; + if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { + availableWidth = maximumClippingWidth; + } + if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { + availableHeight = maximumClippingHeight; + } + if (noShift && !alignment) { + const xMin = max(overflow.left, 0); + const xMax = max(overflow.right, 0); + const yMin = max(overflow.top, 0); + const yMax = max(overflow.bottom, 0); + if (isYAxis) { + availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); + } else { + availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); + } + } + await apply({ + ...state, + availableWidth, + availableHeight + }); + const nextDimensions = await platform.getDimensions(elements.floating); + if (width !== nextDimensions.width || height !== nextDimensions.height) { + return { + reset: { + rects: true + } + }; + } + return {}; + } + }; +}; + +export { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size }; diff --git a/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs b/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs new file mode 100644 index 0000000..2c1ccbb --- /dev/null +++ b/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs @@ -0,0 +1,759 @@ +import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core'; +import { round, createCoords, max, min, floor } from '@floating-ui/utils'; +import { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom'; +export { getOverflowAncestors } from '@floating-ui/utils/dom'; + +function getCssDimensions(element) { + const css = getComputedStyle(element); + // In testing environments, the `width` and `height` properties are empty + // strings for SVG elements, returning NaN. Fallback to `0` in this case. + let width = parseFloat(css.width) || 0; + let height = parseFloat(css.height) || 0; + const hasOffset = isHTMLElement(element); + const offsetWidth = hasOffset ? element.offsetWidth : width; + const offsetHeight = hasOffset ? element.offsetHeight : height; + const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; + if (shouldFallback) { + width = offsetWidth; + height = offsetHeight; + } + return { + width, + height, + $: shouldFallback + }; +} + +function unwrapElement(element) { + return !isElement(element) ? element.contextElement : element; +} + +function getScale(element) { + const domElement = unwrapElement(element); + if (!isHTMLElement(domElement)) { + return createCoords(1); + } + const rect = domElement.getBoundingClientRect(); + const { + width, + height, + $ + } = getCssDimensions(domElement); + let x = ($ ? round(rect.width) : rect.width) / width; + let y = ($ ? round(rect.height) : rect.height) / height; + + // 0, NaN, or Infinity should always fallback to 1. + + if (!x || !Number.isFinite(x)) { + x = 1; + } + if (!y || !Number.isFinite(y)) { + y = 1; + } + return { + x, + y + }; +} + +const noOffsets = /*#__PURE__*/createCoords(0); +function getVisualOffsets(element) { + const win = getWindow(element); + if (!isWebKit() || !win.visualViewport) { + return noOffsets; + } + return { + x: win.visualViewport.offsetLeft, + y: win.visualViewport.offsetTop + }; +} +function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { + if (isFixed === void 0) { + isFixed = false; + } + if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { + return false; + } + return isFixed; +} + +function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { + if (includeScale === void 0) { + includeScale = false; + } + if (isFixedStrategy === void 0) { + isFixedStrategy = false; + } + const clientRect = element.getBoundingClientRect(); + const domElement = unwrapElement(element); + let scale = createCoords(1); + if (includeScale) { + if (offsetParent) { + if (isElement(offsetParent)) { + scale = getScale(offsetParent); + } + } else { + scale = getScale(element); + } + } + const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); + let x = (clientRect.left + visualOffsets.x) / scale.x; + let y = (clientRect.top + visualOffsets.y) / scale.y; + let width = clientRect.width / scale.x; + let height = clientRect.height / scale.y; + if (domElement) { + const win = getWindow(domElement); + const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; + let currentWin = win; + let currentIFrame = getFrameElement(currentWin); + while (currentIFrame && offsetParent && offsetWin !== currentWin) { + const iframeScale = getScale(currentIFrame); + const iframeRect = currentIFrame.getBoundingClientRect(); + const css = getComputedStyle(currentIFrame); + const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; + const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; + x *= iframeScale.x; + y *= iframeScale.y; + width *= iframeScale.x; + height *= iframeScale.y; + x += left; + y += top; + currentWin = getWindow(currentIFrame); + currentIFrame = getFrameElement(currentWin); + } + } + return rectToClientRect({ + width, + height, + x, + y + }); +} + +// If has a CSS width greater than the viewport, then this will be +// incorrect for RTL. +function getWindowScrollBarX(element, rect) { + const leftScroll = getNodeScroll(element).scrollLeft; + if (!rect) { + return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; + } + return rect.left + leftScroll; +} + +function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) { + if (ignoreScrollbarX === void 0) { + ignoreScrollbarX = false; + } + const htmlRect = documentElement.getBoundingClientRect(); + const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : + // RTL scrollbar. + getWindowScrollBarX(documentElement, htmlRect)); + const y = htmlRect.top + scroll.scrollTop; + return { + x, + y + }; +} + +function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { + let { + elements, + rect, + offsetParent, + strategy + } = _ref; + const isFixed = strategy === 'fixed'; + const documentElement = getDocumentElement(offsetParent); + const topLayer = elements ? isTopLayer(elements.floating) : false; + if (offsetParent === documentElement || topLayer && isFixed) { + return rect; + } + let scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + let scale = createCoords(1); + const offsets = createCoords(0); + const isOffsetParentAnElement = isHTMLElement(offsetParent); + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { + scroll = getNodeScroll(offsetParent); + } + if (isHTMLElement(offsetParent)) { + const offsetRect = getBoundingClientRect(offsetParent); + scale = getScale(offsetParent); + offsets.x = offsetRect.x + offsetParent.clientLeft; + offsets.y = offsetRect.y + offsetParent.clientTop; + } + } + const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0); + return { + width: rect.width * scale.x, + height: rect.height * scale.y, + x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, + y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y + }; +} + +function getClientRects(element) { + return Array.from(element.getClientRects()); +} + +// Gets the entire size of the scrollable document area, even extending outside +// of the `` and `` rect bounds if horizontally scrollable. +function getDocumentRect(element) { + const html = getDocumentElement(element); + const scroll = getNodeScroll(element); + const body = element.ownerDocument.body; + const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); + const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); + let x = -scroll.scrollLeft + getWindowScrollBarX(element); + const y = -scroll.scrollTop; + if (getComputedStyle(body).direction === 'rtl') { + x += max(html.clientWidth, body.clientWidth) - width; + } + return { + width, + height, + x, + y + }; +} + +function getViewportRect(element, strategy) { + const win = getWindow(element); + const html = getDocumentElement(element); + const visualViewport = win.visualViewport; + let width = html.clientWidth; + let height = html.clientHeight; + let x = 0; + let y = 0; + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + const visualViewportBased = isWebKit(); + if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { + x = visualViewport.offsetLeft; + y = visualViewport.offsetTop; + } + } + return { + width, + height, + x, + y + }; +} + +// Returns the inner client rect, subtracting scrollbars if present. +function getInnerBoundingClientRect(element, strategy) { + const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); + const top = clientRect.top + element.clientTop; + const left = clientRect.left + element.clientLeft; + const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); + const width = element.clientWidth * scale.x; + const height = element.clientHeight * scale.y; + const x = left * scale.x; + const y = top * scale.y; + return { + width, + height, + x, + y + }; +} +function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { + let rect; + if (clippingAncestor === 'viewport') { + rect = getViewportRect(element, strategy); + } else if (clippingAncestor === 'document') { + rect = getDocumentRect(getDocumentElement(element)); + } else if (isElement(clippingAncestor)) { + rect = getInnerBoundingClientRect(clippingAncestor, strategy); + } else { + const visualOffsets = getVisualOffsets(element); + rect = { + x: clippingAncestor.x - visualOffsets.x, + y: clippingAncestor.y - visualOffsets.y, + width: clippingAncestor.width, + height: clippingAncestor.height + }; + } + return rectToClientRect(rect); +} +function hasFixedPositionAncestor(element, stopNode) { + const parentNode = getParentNode(element); + if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { + return false; + } + return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); +} + +// A "clipping ancestor" is an `overflow` element with the characteristic of +// clipping (or hiding) child elements. This returns all clipping ancestors +// of the given element up the tree. +function getClippingElementAncestors(element, cache) { + const cachedResult = cache.get(element); + if (cachedResult) { + return cachedResult; + } + let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); + let currentContainingBlockComputedStyle = null; + const elementIsFixed = getComputedStyle(element).position === 'fixed'; + let currentNode = elementIsFixed ? getParentNode(element) : element; + + // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block + while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { + const computedStyle = getComputedStyle(currentNode); + const currentNodeIsContaining = isContainingBlock(currentNode); + if (!currentNodeIsContaining && computedStyle.position === 'fixed') { + currentContainingBlockComputedStyle = null; + } + const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); + if (shouldDropCurrentNode) { + // Drop non-containing blocks. + result = result.filter(ancestor => ancestor !== currentNode); + } else { + // Record last containing block for next iteration. + currentContainingBlockComputedStyle = computedStyle; + } + currentNode = getParentNode(currentNode); + } + cache.set(element, result); + return result; +} + +// Gets the maximum area that the element is visible in due to any number of +// clipping ancestors. +function getClippingRect(_ref) { + let { + element, + boundary, + rootBoundary, + strategy + } = _ref; + const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); + const clippingAncestors = [...elementClippingAncestors, rootBoundary]; + const firstClippingAncestor = clippingAncestors[0]; + const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { + const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); + accRect.top = max(rect.top, accRect.top); + accRect.right = min(rect.right, accRect.right); + accRect.bottom = min(rect.bottom, accRect.bottom); + accRect.left = max(rect.left, accRect.left); + return accRect; + }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); + return { + width: clippingRect.right - clippingRect.left, + height: clippingRect.bottom - clippingRect.top, + x: clippingRect.left, + y: clippingRect.top + }; +} + +function getDimensions(element) { + const { + width, + height + } = getCssDimensions(element); + return { + width, + height + }; +} + +function getRectRelativeToOffsetParent(element, offsetParent, strategy) { + const isOffsetParentAnElement = isHTMLElement(offsetParent); + const documentElement = getDocumentElement(offsetParent); + const isFixed = strategy === 'fixed'; + const rect = getBoundingClientRect(element, true, isFixed, offsetParent); + let scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + const offsets = createCoords(0); + + // If the scrollbar appears on the left (e.g. RTL systems). Use + // Firefox with layout.scrollbar.side = 3 in about:config to test this. + function setLeftRTLScrollbarOffset() { + offsets.x = getWindowScrollBarX(documentElement); + } + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { + scroll = getNodeScroll(offsetParent); + } + if (isOffsetParentAnElement) { + const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); + offsets.x = offsetRect.x + offsetParent.clientLeft; + offsets.y = offsetRect.y + offsetParent.clientTop; + } else if (documentElement) { + setLeftRTLScrollbarOffset(); + } + } + if (isFixed && !isOffsetParentAnElement && documentElement) { + setLeftRTLScrollbarOffset(); + } + const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); + const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; + const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; + return { + x, + y, + width: rect.width, + height: rect.height + }; +} + +function isStaticPositioned(element) { + return getComputedStyle(element).position === 'static'; +} + +function getTrueOffsetParent(element, polyfill) { + if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') { + return null; + } + if (polyfill) { + return polyfill(element); + } + let rawOffsetParent = element.offsetParent; + + // Firefox returns the element as the offsetParent if it's non-static, + // while Chrome and Safari return the element. The element must + // be used to perform the correct calculations even if the element is + // non-static. + if (getDocumentElement(element) === rawOffsetParent) { + rawOffsetParent = rawOffsetParent.ownerDocument.body; + } + return rawOffsetParent; +} + +// Gets the closest ancestor positioned element. Handles some edge cases, +// such as table ancestors and cross browser bugs. +function getOffsetParent(element, polyfill) { + const win = getWindow(element); + if (isTopLayer(element)) { + return win; + } + if (!isHTMLElement(element)) { + let svgOffsetParent = getParentNode(element); + while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { + if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { + return svgOffsetParent; + } + svgOffsetParent = getParentNode(svgOffsetParent); + } + return win; + } + let offsetParent = getTrueOffsetParent(element, polyfill); + while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { + offsetParent = getTrueOffsetParent(offsetParent, polyfill); + } + if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { + return win; + } + return offsetParent || getContainingBlock(element) || win; +} + +const getElementRects = async function (data) { + const getOffsetParentFn = this.getOffsetParent || getOffsetParent; + const getDimensionsFn = this.getDimensions; + const floatingDimensions = await getDimensionsFn(data.floating); + return { + reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), + floating: { + x: 0, + y: 0, + width: floatingDimensions.width, + height: floatingDimensions.height + } + }; +}; + +function isRTL(element) { + return getComputedStyle(element).direction === 'rtl'; +} + +const platform = { + convertOffsetParentRelativeRectToViewportRelativeRect, + getDocumentElement, + getClippingRect, + getOffsetParent, + getElementRects, + getClientRects, + getDimensions, + getScale, + isElement, + isRTL +}; + +function rectsAreEqual(a, b) { + return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; +} + +// https://samthor.au/2021/observing-dom/ +function observeMove(element, onMove) { + let io = null; + let timeoutId; + const root = getDocumentElement(element); + function cleanup() { + var _io; + clearTimeout(timeoutId); + (_io = io) == null || _io.disconnect(); + io = null; + } + function refresh(skip, threshold) { + if (skip === void 0) { + skip = false; + } + if (threshold === void 0) { + threshold = 1; + } + cleanup(); + const elementRectForRootMargin = element.getBoundingClientRect(); + const { + left, + top, + width, + height + } = elementRectForRootMargin; + if (!skip) { + onMove(); + } + if (!width || !height) { + return; + } + const insetTop = floor(top); + const insetRight = floor(root.clientWidth - (left + width)); + const insetBottom = floor(root.clientHeight - (top + height)); + const insetLeft = floor(left); + const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; + const options = { + rootMargin, + threshold: max(0, min(1, threshold)) || 1 + }; + let isFirstUpdate = true; + function handleObserve(entries) { + const ratio = entries[0].intersectionRatio; + if (ratio !== threshold) { + if (!isFirstUpdate) { + return refresh(); + } + if (!ratio) { + // If the reference is clipped, the ratio is 0. Throttle the refresh + // to prevent an infinite loop of updates. + timeoutId = setTimeout(() => { + refresh(false, 1e-7); + }, 1000); + } else { + refresh(false, ratio); + } + } + if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { + // It's possible that even though the ratio is reported as 1, the + // element is not actually fully within the IntersectionObserver's root + // area anymore. This can happen under performance constraints. This may + // be a bug in the browser's IntersectionObserver implementation. To + // work around this, we compare the element's bounding rect now with + // what it was at the time we created the IntersectionObserver. If they + // are not equal then the element moved, so we refresh. + refresh(); + } + isFirstUpdate = false; + } + + // Older browsers don't support a `document` as the root and will throw an + // error. + try { + io = new IntersectionObserver(handleObserve, { + ...options, + // Handle