@clickview/lite 0.104.0-rc.6 → 0.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +807 -806
- package/dist/bundles.json +1 -1
- package/dist/en.json +1 -1
- package/dist/scripts/{Dnz8CbEu.chunk.js → -QIG2ZHc.chunk.js} +3 -3
- package/dist/scripts/{Dnz8CbEu.chunk.js.map → -QIG2ZHc.chunk.js.map} +1 -1
- package/dist/scripts/{CEv1_bDW.chunk.js → -brFp4w1.chunk.js} +2 -2
- package/dist/scripts/{CEv1_bDW.chunk.js.map → -brFp4w1.chunk.js.map} +1 -1
- package/dist/scripts/{CX6c7KRp2.chunk.js → 0mx04bmJ2.chunk.js} +2 -2
- package/dist/scripts/{CX6c7KRp2.chunk.js.map → 0mx04bmJ2.chunk.js.map} +1 -1
- package/dist/scripts/{CMHxOVI7.chunk.js → 41LJfkjO.chunk.js} +2 -2
- package/dist/scripts/{CMHxOVI7.chunk.js.map → 41LJfkjO.chunk.js.map} +1 -1
- package/dist/scripts/{BBWnpWNB2.chunk.js → 7uvJMXC12.chunk.js} +2 -2
- package/dist/scripts/{BBWnpWNB2.chunk.js.map → 7uvJMXC12.chunk.js.map} +1 -1
- package/dist/scripts/{CaCm4N_d2.chunk.js → B-HfRX562.chunk.js} +2 -2
- package/dist/scripts/{CaCm4N_d2.chunk.js.map → B-HfRX562.chunk.js.map} +1 -1
- package/dist/scripts/{D9wxi5or2.chunk.js → B2_RD6Px2.chunk.js} +2 -2
- package/dist/scripts/{D9wxi5or2.chunk.js.map → B2_RD6Px2.chunk.js.map} +1 -1
- package/dist/scripts/{DSPMbDdF.chunk.js → B3_lC6bW.chunk.js} +2 -2
- package/dist/scripts/{DSPMbDdF.chunk.js.map → B3_lC6bW.chunk.js.map} +1 -1
- package/dist/scripts/{8JGe5Ug_2.chunk.js → B5GEXNkP2.chunk.js} +2 -2
- package/dist/scripts/{8JGe5Ug_2.chunk.js.map → B5GEXNkP2.chunk.js.map} +1 -1
- package/dist/scripts/{0Fek4oFk.chunk.js → BLE8DLAY.chunk.js} +2 -2
- package/dist/scripts/{0Fek4oFk.chunk.js.map → BLE8DLAY.chunk.js.map} +1 -1
- package/dist/scripts/{BgPye7Nd2.chunk.js → BRt-Kdnn2.chunk.js} +2 -2
- package/dist/scripts/{BgPye7Nd2.chunk.js.map → BRt-Kdnn2.chunk.js.map} +1 -1
- package/dist/scripts/BTWmC6pW.chunk.js +5 -0
- package/dist/scripts/BTWmC6pW.chunk.js.map +1 -0
- package/dist/scripts/{D3ncynN72.chunk.js → BVBpDZoT2.chunk.js} +3 -3
- package/dist/scripts/{D3ncynN72.chunk.js.map → BVBpDZoT2.chunk.js.map} +1 -1
- package/dist/scripts/{5PKjjI4Y.chunk.js → BapoiGsj.chunk.js} +2 -2
- package/dist/scripts/{5PKjjI4Y.chunk.js.map → BapoiGsj.chunk.js.map} +1 -1
- package/dist/scripts/{CNfmLVE82.chunk.js → Bc1JT5Y-2.chunk.js} +2 -2
- package/dist/scripts/{CNfmLVE82.chunk.js.map → Bc1JT5Y-2.chunk.js.map} +1 -1
- package/dist/scripts/{cDv6zuhh.chunk.js → BhE5KhcC.chunk.js} +2 -2
- package/dist/scripts/{cDv6zuhh.chunk.js.map → BhE5KhcC.chunk.js.map} +1 -1
- package/dist/scripts/{Bzk4AwVx2.chunk.js → BncgzKKQ2.chunk.js} +2 -2
- package/dist/scripts/{Bzk4AwVx2.chunk.js.map → BncgzKKQ2.chunk.js.map} +1 -1
- package/dist/scripts/{CV-fOLNI2.chunk.js → Bpf3Tyy12.chunk.js} +2 -2
- package/dist/scripts/{CV-fOLNI2.chunk.js.map → Bpf3Tyy12.chunk.js.map} +1 -1
- package/dist/scripts/{DPZnaz74.chunk.js → C1OiUBQI.chunk.js} +2 -2
- package/dist/scripts/{DPZnaz74.chunk.js.map → C1OiUBQI.chunk.js.map} +1 -1
- package/dist/scripts/{B1TqilLB.chunk.js → C6z8ii6C.chunk.js} +2 -2
- package/dist/scripts/{B1TqilLB.chunk.js.map → C6z8ii6C.chunk.js.map} +1 -1
- package/dist/scripts/{fMgBORUX.chunk.js → C8x-QH43.chunk.js} +2 -2
- package/dist/scripts/{fMgBORUX.chunk.js.map → C8x-QH43.chunk.js.map} +1 -1
- package/dist/scripts/{BiWUSyJr.chunk.js → CAkqvKfy.chunk.js} +2 -2
- package/dist/scripts/{BiWUSyJr.chunk.js.map → CAkqvKfy.chunk.js.map} +1 -1
- package/dist/scripts/{CjOMeOwb2.chunk.js → CGv0OFnc2.chunk.js} +2 -2
- package/dist/scripts/{CjOMeOwb2.chunk.js.map → CGv0OFnc2.chunk.js.map} +1 -1
- package/dist/scripts/{B82m7K0U.chunk.js → CJGWbJ4m.chunk.js} +2 -2
- package/dist/scripts/{B82m7K0U.chunk.js.map → CJGWbJ4m.chunk.js.map} +1 -1
- package/dist/scripts/{D-iyHqNw2.chunk.js → CLvImDXv2.chunk.js} +3 -3
- package/dist/scripts/{D-iyHqNw2.chunk.js.map → CLvImDXv2.chunk.js.map} +1 -1
- package/dist/scripts/{Cqq1N9xw.chunk.js → CM8248d7.chunk.js} +2 -2
- package/dist/scripts/{Cqq1N9xw.chunk.js.map → CM8248d7.chunk.js.map} +1 -1
- package/dist/scripts/Cr6TXzQQ2.chunk.js.map +1 -1
- package/dist/scripts/{B_TE5XUR2.chunk.js → CvilnM0u2.chunk.js} +2 -2
- package/dist/scripts/{B_TE5XUR2.chunk.js.map → CvilnM0u2.chunk.js.map} +1 -1
- package/dist/scripts/{AEOAlemi.chunk.js → Cwocc8uV.chunk.js} +2 -2
- package/dist/scripts/{AEOAlemi.chunk.js.map → Cwocc8uV.chunk.js.map} +1 -1
- package/dist/scripts/{Bld7iWR52.chunk.js → D-pn0sNx2.chunk.js} +2 -2
- package/dist/scripts/{Bld7iWR52.chunk.js.map → D-pn0sNx2.chunk.js.map} +1 -1
- package/dist/scripts/{Cyit3dMk.chunk.js → D78QEASE.chunk.js} +2 -2
- package/dist/scripts/{Cyit3dMk.chunk.js.map → D78QEASE.chunk.js.map} +1 -1
- package/dist/scripts/{Dtag-27K.chunk.js → DER8311r.chunk.js} +2 -2
- package/dist/scripts/{Dtag-27K.chunk.js.map → DER8311r.chunk.js.map} +1 -1
- package/dist/scripts/{CAD-W-lP.chunk.js → DFFJpTVB.chunk.js} +2 -2
- package/dist/scripts/{CAD-W-lP.chunk.js.map → DFFJpTVB.chunk.js.map} +1 -1
- package/dist/scripts/{CmnbQiBA.chunk.js → DSZaceCq.chunk.js} +2 -2
- package/dist/scripts/{CmnbQiBA.chunk.js.map → DSZaceCq.chunk.js.map} +1 -1
- package/dist/scripts/{CfNYFxJl2.chunk.js → D_1m0b_a2.chunk.js} +2 -2
- package/dist/scripts/{CfNYFxJl2.chunk.js.map → D_1m0b_a2.chunk.js.map} +1 -1
- package/dist/scripts/{-KvTbeQV.chunk.js → DhcRnxkp.chunk.js} +2 -2
- package/dist/scripts/{-KvTbeQV.chunk.js.map → DhcRnxkp.chunk.js.map} +1 -1
- package/dist/scripts/{DKDWcWxk.chunk.js → Dqn0sInF.chunk.js} +2 -2
- package/dist/scripts/{DKDWcWxk.chunk.js.map → Dqn0sInF.chunk.js.map} +1 -1
- package/dist/scripts/{DICsRDM42.chunk.js → Dz8KlJhf2.chunk.js} +2 -2
- package/dist/scripts/{DICsRDM42.chunk.js.map → Dz8KlJhf2.chunk.js.map} +1 -1
- package/dist/scripts/{D0b_r0MV.chunk.js → KjTtF4IH.chunk.js} +2 -2
- package/dist/scripts/{D0b_r0MV.chunk.js.map → KjTtF4IH.chunk.js.map} +1 -1
- package/dist/scripts/{CAs2Sere2.chunk.js → MW7W80HY2.chunk.js} +2 -2
- package/dist/scripts/{CAs2Sere2.chunk.js.map → MW7W80HY2.chunk.js.map} +1 -1
- package/dist/scripts/{CwFYdvvA.chunk.js → Okf3Hn0s.chunk.js} +2 -2
- package/dist/scripts/{CwFYdvvA.chunk.js.map → Okf3Hn0s.chunk.js.map} +1 -1
- package/dist/scripts/{Dt5731Ay.chunk.js → _lqYS5Jx.chunk.js} +2 -2
- package/dist/scripts/{Dt5731Ay.chunk.js.map → _lqYS5Jx.chunk.js.map} +1 -1
- package/dist/scripts/{app-DxHnJ6f2.js → app-H3wSQ-PR.js} +4 -4
- package/dist/scripts/{app-DxHnJ6f2.js.map → app-H3wSQ-PR.js.map} +1 -1
- package/dist/scripts/{Bkp6sdnZ2.chunk.js → dVOiGqhu2.chunk.js} +2 -2
- package/dist/scripts/{Bkp6sdnZ2.chunk.js.map → dVOiGqhu2.chunk.js.map} +1 -1
- package/dist/scripts/{B3AhKFfz.chunk.js → ftYw2FVB.chunk.js} +2 -2
- package/dist/scripts/{B3AhKFfz.chunk.js.map → ftYw2FVB.chunk.js.map} +1 -1
- package/dist/scripts/{DyE6EUDb.chunk.js → kjRiUKIL.chunk.js} +2 -2
- package/dist/scripts/{DyE6EUDb.chunk.js.map → kjRiUKIL.chunk.js.map} +1 -1
- package/dist/scripts/{B3y60nT5.chunk.js → pDWQ8Uj5.chunk.js} +2 -2
- package/dist/scripts/{B3y60nT5.chunk.js.map → pDWQ8Uj5.chunk.js.map} +1 -1
- package/dist/scripts/{BCqRKj1E2.chunk.js → s6NJOjzU2.chunk.js} +2 -2
- package/dist/scripts/{BCqRKj1E2.chunk.js.map → s6NJOjzU2.chunk.js.map} +1 -1
- package/package.json +1 -1
- package/dist/scripts/DCT6XY8t.chunk.js +0 -5
- package/dist/scripts/DCT6XY8t.chunk.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cr6TXzQQ2.chunk.js","names":[],"sources":["../../../../libs/shared/src/interfaces/models/curated-widget/CuratedWidget.ts","../../../../libs/shared/src/enums/WidgetStatus.ts","../../../../libs/shared/src/enums/WidgetTemplate.ts","../../../../libs/shared/src/enums/WidgetTypeId.ts","../../../../libs/shared/src/utils/DashboardHelper.ts","../../../../libs/shared/src/constants/WidgetTypeIdConfig.ts","../../../../libs/shared/src/utils/WidgetHelper.ts"],"sourcesContent":["import { HashObject } from 'libs/common/react/interfaces';\n\nimport { AllWidgetTemplateProps } from 'libs/shared/components/widgets/curated-widgets/WidgetProps';\nimport { ButtonIcon } from 'libs/shared/constants/WidgetThemingConstants';\nimport { WidgetStatus } from 'libs/shared/enums/WidgetStatus';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { CuratedObjectsWidgetData, CuratedWidgetContent, CuratedWidgetData } from 'libs/shared/interfaces';\n\nexport enum CuratedDashboardAppLink {\n LatestReleases = 'latest-releases',\n ExploreAllTopics = 'explore-all-topics',\n ClassificationLatestReleases = 'classification-latest-releases',\n ClassificationDirectory = 'classification-directory'\n}\n\nexport enum CuratedWidgetCtaAppLink {\n TopicDirectory = 'topic-directory',\n TopicNewReleases = 'topic-new-releases',\n CuratedTopic = 'curated-topic'\n}\n\nexport interface BaseWidget<TContent extends HashObject = HashObject> {\n id: string;\n index: number;\n templateId: WidgetTemplate;\n widgetId: WidgetTypeId;\n name: string;\n description?: string;\n content?: TContent;\n}\n\nexport interface WidgetCta {\n text?: string;\n href?: string;\n icon?: ButtonIcon;\n appLink?: CuratedWidgetCtaAppLink;\n}\n\nexport type WidgetMetadata = AllWidgetTemplateProps['metadata'] & {\n showInTableOfContents: boolean,\n tocIndentation: number,\n headingOptional: boolean,\n aiAddedVideo: boolean\n};\n\nexport interface WidgetPreference {\n id: string;\n index?: number;\n hidden?: boolean;\n}\n\nexport interface CuratedWidget<\n TData extends CuratedWidgetData = CuratedWidgetData,\n TContent extends CuratedWidgetContent = CuratedWidgetContent\n> extends BaseWidget<TContent> {\n id: string;\n dashboardId: string;\n data: TData;\n status: WidgetStatus;\n metadata?: Partial<WidgetMetadata>;\n preferences?: WidgetPreference[];\n cursor?: string;\n\n // If a widget has curriculum IDs set, then it won't be accessible to anyone who doesn't have one of those curriculums\n curriculumIds?: string[];\n}\n\nexport type CuratedMediaWidget<\n TContent extends CuratedWidgetContent = CuratedWidgetContent\n> = CuratedWidget<CuratedObjectsWidgetData, TContent>;\n","export enum WidgetStatus {\n Draft = 0,\n Published = 1,\n Archived = 2\n}\n\n","export enum WidgetTemplate {\n // Videos\n ThumbnailHeroMedia = 'thumbnail_hero_media',\n ThumbnailFeaturedMedia = 'thumbnail_featured_media',\n ThumbnailSlidingListSmall = 'thumbnail_sliding_list_small',\n ThumbnailSlidingListSmallV2 = 'thumbnail_sliding_list_small_v2',\n ThumbnailSlidingListLarge = 'thumbnail_sliding_list_large',\n ThumbnailFixedListMediaSmall = 'thumbnail_fixed_list_media_small',\n ThumbnailFixedListMediaLarge = 'thumbnail_fixed_list_media_large',\n ThumbnailFixedListFolderSmall = 'thumbnail_fixed_list_folder_small',\n ThumbnailVerticalList = 'thumbnail_vertical_list',\n PopoutThumbnailSlidingListLarge = 'popout_thumbnail_sliding_list_large',\n PopoutThumbnailSlidingListSmall = 'popout_thumbnail_sliding_list_small',\n FeaturedThumbnailSlidingList = 'featured_thumbnail_sliding_list',\n ThumbnailFixedListXLarge = 'thumbnail_fixed_list_xlarge',\n\n // Topics\n CoverSlidingPillListSmall = 'cover_sliding_pill_list_small',\n CoverFixedPillListLarge = 'cover_fixed_pill_list_large',\n StatsCoverFixedPillListLarge = 'stats_cover_fixed_pill_list_large',\n CoverFixedPillListXSmall = 'cover_fixed_pill_list_xsmall',\n ThumbnailFixedListLarge = 'thumbnail_fixed_list_large',\n ThumbnailFixedListSmall = 'thumbnail_fixed_list_small',\n EditableCoverFixedPillListSmall = 'editable_cover_fixed_pill_list_small',\n HeroBanner = 'hero_banner',\n HeroThumbnailSmall = 'hero_thumbnail_small',\n HeroBlockColourSmall = 'hero_block_colour_small',\n\n // Curriculum\n CurriculumResourcesAccordion = 'curriculum_resources_accordion',\n CurriculumCodeSearchResults = 'curriculum_code_search_results',\n\n // Playlists\n CoverFixedTileList = 'cover_fixed_tile_list',\n\n // Topics & Series\n PosterSlidingListLarge = 'poster_sliding_list_large',\n PosterSlidingListMedium = 'poster_sliding_list_medium',\n PosterSlidingListSmall = 'poster_sliding_list_small',\n PosterFixedListLarge = 'poster_fixed_list_large',\n\n // Blurbs & Topics\n HeroBannerSmall = 'hero_banner_small',\n\n // Text-based blurbs\n Heading = 'heading',\n AuthorReviewer = 'author_reviewer',\n Question = 'question',\n QuestionAccordion = 'question_accordion',\n FeedbackCta = 'feedback_cta',\n\n // Companies / Studios / Content Partners\n CircleLogoSlidingList = 'circle_logo_sliding_list',\n RectangularLogoSlidingList = 'rectangular_logo_sliding_list',\n RectangularLogoFixedList = 'rectangular_logo_fixed_list',\n ThumbnailFixedListSearchCta = 'thumbnail_fixed_list_search_cta',\n InfiniteThumbnailVerticalList = 'infinite_thumbnail_vertical_list',\n\n // Rating filters\n FilterSlidingPillListSmall = 'filter_sliding_pill_list_small',\n\n // Special events\n EventIconSlidingList = 'event_icon_sliding_list',\n\n // Tags filter\n TagSlidingList = 'tag_sliding_list',\n\n SearchSuggestionsBlurb = 'search_suggestions_blurb'\n}\n","export enum WidgetTypeId {\n // Video group\n CuratedMedia = 'curated_media',\n PlaylistMedia = 'playlist_media',\n SeriesMedia = 'series_media',\n ClassificationMedia = 'classification_media',\n LatestReleasedVideos = 'latest_released_videos',\n ContinueWatching = 'continue_watching_videos',\n BecauseYouWatched = 'because_you_watched',\n CompanyLatestReleasedVideo = 'company_latest_released_video',\n CompanyVideos = 'company_videos',\n ClassificationLatestReleasedVideo = 'classification_latest_released_video',\n ClassificationLatestReleasedVideosV2 = 'classification_latest_released_videos_v2',\n CompanyClassificationVideos = 'company_classification_videos',\n ClassificationDashboardMedia = 'classification_dashboard_media',\n ClassificationDashboardExternalMedia = 'classification_dashboard_external_media',\n ClassificationAllVideos = 'classification_all_videos',\n SeasonalClassificationMedia = 'seasonal_classification_media',\n TrendingClassificationsMedia = 'trending_classifications_media',\n ClassificationCurriculumMedia = 'classification_curriculum_media',\n\n // Topics group\n CuratedClassifications = 'curated_classifications',\n Classifications = 'classifications',\n ClassificationLatestReleasedVideos = 'classification_latest_released_videos',\n SpecialEventClassifications = 'special_event_classifications',\n LatestReleasedClassifications = 'latest_released_classifications',\n TrendingClassifications = 'trending_classifications',\n PersonalisedTopics = 'personalised_classifications',\n\n // Series group\n CuratedSeries = 'curated_series',\n\n // Playlists group\n CuratedPlaylists = 'curated_playlists',\n\n // Blurb group\n Blurb = 'blurb',\n DynamicBlurb = 'dynamic_blurb',\n AuthorReviewer = 'author_reviewer',\n Faq = 'faq',\n Feedback = 'feedback',\n\n // Network group\n CuratedCompanies = 'curated_companies',\n\n // Partner Profile group\n CuratedContentPartners = 'curated_content_partners',\n ContentPartnerLatestReleasedVideos = 'content_partner_latest_released_videos',\n ContentPartnerSeries = 'content_partner_series',\n ContentPartnerVideos = 'content_partner_videos',\n SpotlightContentPartners = 'spotlight_curated_content_partners',\n ContentPartners = 'content_partners',\n ContentPartnersHub = 'content_partners_hub',\n TrendingContentPartnersVideo = 'content_partner_trending_videos',\n ContentPartnerAllVideos = 'content_partner_all_videos',\n\n // Search filter group\n Ratings = 'ratings',\n\n // Presentations group\n Presentations = 'presentations',\n\n // Livestreams group\n UpcomingLivestreams = 'upcoming_livestreams',\n\n // Multimedia group\n CuratedMultimedia = 'curated_multimedia',\n\n // Legacy widget types\n ClassificationPlaylists = 'classification_playlists',\n ClassificationSeries = 'classification_series',\n ClassificationFeaturedVideo = 'classification_featured_video',\n ClassificationPinnedVideos = 'classification_pinned_videos',\n\n // Search widget types\n SearchRelevantTopics = 'search_relevant_topics',\n SearchCompanies = 'search_companies',\n SearchTopResults = 'search_top_results',\n SearchSeries = 'search_series',\n SearchPlaylists = 'search_playlists',\n SearchMyVideosFolder = 'search_my_videos_folders',\n SearchMySchoolLibraryFolder = 'search_my_school_library_folders',\n SearchMyVideos = 'search_my_videos',\n SearchMySchoolLibraryVideos = 'search_my_school_library_videos',\n SearchExchangeArchive = 'search_exchange_archive',\n SearchClickViewLive = 'search_clickview_live',\n SearchRelatedResults = 'search_related_results',\n SearchTags = 'search_tags',\n SearchCurriculumCode = 'search_curriculum_code',\n SearchSuggestions = 'search_suggestions',\n SearchContentPartners = 'search_content_partners'\n}\n","import { FormikContextType } from 'formik';\n\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { SearchResultObjectTypes } from 'libs/shared/apps/search/interfaces';\nimport { GetCustomParamOptions, WidgetTypeIdConfig } from 'libs/shared/constants/WidgetTypeIdConfig';\nimport { UserGroup } from 'libs/shared/enums/UserGroup';\nimport { OnlineUserRole } from 'libs/shared/enums/UserRole';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { SettingsHash } from 'libs/shared/hooks/useSettings';\nimport { BaseObject, ClassificationCurriculumInfo, ClassificationDashboardInfo, ClassificationDirectoryInfo, CuratedDashboard, CuratedMediaWidget, CuratedWidget, CuratedWidgetQueryParams, DashboardTargetInfo, DashboardTargetType, PartnerProfileDashboardInfo, UnknownDashboardTargetInfo } from 'libs/shared/interfaces';\n\ninterface LatestReleasesTimeRange {\n from: string;\n to: string;\n}\n\nexport const DashboardHelper = {\n\n /**\n * Same implementation as GetUserGroup() in Online.\n * @param userRole \n */\n getUserGroup(userRole: OnlineUserRole): UserGroup {\n if (userRole === OnlineUserRole.Student)\n return UserGroup.Learner;\n\n return UserGroup.Staff;\n }\n};\n\nexport const CuratedDashboardHelper = {\n onSelectCuratedObject(\n selectedObj: SearchResultObjectTypes | BaseObject,\n formikProps: FormikContextType<CuratedMediaWidget<BaseObject[]>>\n ) {\n const data = {\n ...formikProps.values.data,\n objectIds: ArrayHelper.addOrRemoveImmutable(formikProps.values.data.objectIds || [], selectedObj.id)\n };\n \n formikProps.setFieldValue('data', data);\n \n formikProps.setTouched({\n ...formikProps.touched,\n data: {\n objectIds: true\n }\n });\n },\n\n onRemoveCuratedObject(\n objectId: string,\n formikProps: FormikContextType<CuratedMediaWidget<BaseObject[]>>\n ) {\n const newData = {\n ...formikProps.values.data,\n objectIds: formikProps.values.data.objectIds.filter(id => id !== objectId)\n };\n\n formikProps.setFieldValue('data', newData);\n },\n\n getDashboardTarget(info: DashboardTargetInfo): string {\n if (info.targetType === DashboardTargetType.Discover)\n return `discover:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.Classification)\n return `classification:${info.classificationId}`;\n\n if (info.targetType === DashboardTargetType.ClassificationDirectory)\n return `classification:${info.classificationId}:directory`;\n\n if (info.targetType === DashboardTargetType.ClassificationCurriculum)\n return `classification:${info.classificationId}:curriculum`;\n\n if (info.targetType === DashboardTargetType.MoviesAndTv)\n return `moviesAndTv:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.Company)\n return `company:${info.companyId}:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.PartnerProfile)\n return `partnerprofile:${info.slug}`;\n\n if (info.targetType === DashboardTargetType.DiscoverPartnerProfiles)\n return `discover:partners`;\n\n if (info.targetType === DashboardTargetType.PartnerProfileHub)\n return `discover:partners:hub`;\n\n return null;\n },\n\n getUnknownDashboardTarget(options: UnknownDashboardTargetInfo): string {\n const {\n presentationId,\n companyId,\n targetType,\n classificationId,\n slug\n } = options;\n\n if (targetType === DashboardTargetType.Discover) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Discover,\n presentationId\n });\n }\n \n if (targetType === DashboardTargetType.MoviesAndTv) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.MoviesAndTv,\n presentationId\n });\n }\n \n if (targetType === DashboardTargetType.Company) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Company,\n presentationId,\n companyId\n });\n }\n \n if (targetType === DashboardTargetType.Classification) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Classification,\n classificationId\n });\n }\n \n if (targetType === DashboardTargetType.ClassificationDirectory) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.ClassificationDirectory,\n classificationId\n });\n }\n \n if (targetType === DashboardTargetType.ClassificationCurriculum) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.ClassificationCurriculum,\n classificationId\n });\n }\n\n if (targetType === DashboardTargetType.PartnerProfile) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.PartnerProfile,\n slug\n });\n }\n\n if (targetType === DashboardTargetType.DiscoverPartnerProfiles) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.DiscoverPartnerProfiles\n });\n }\n\n if (targetType === DashboardTargetType.PartnerProfileHub) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.PartnerProfileHub\n });\n }\n },\n\n getDashboardTargetInfo(dashboard: CuratedDashboard): DashboardTargetInfo {\n const type = CuratedDashboardHelper.getDashboardTargetType(dashboard);\n const split = dashboard?.target?.split(':');\n\n if (type === DashboardTargetType.Discover) {\n return {\n targetType: DashboardTargetType.Discover,\n presentationId: split[2]\n };\n }\n\n if (type === DashboardTargetType.Classification) {\n return {\n targetType: DashboardTargetType.Classification,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.ClassificationDirectory) {\n return {\n targetType: DashboardTargetType.ClassificationDirectory,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.ClassificationCurriculum) {\n return {\n targetType: DashboardTargetType.ClassificationCurriculum,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.MoviesAndTv) {\n return {\n targetType: DashboardTargetType.MoviesAndTv,\n presentationId: split[2]\n };\n }\n\n if (type === DashboardTargetType.Company) {\n return {\n targetType: DashboardTargetType.Company,\n companyId: split[1],\n presentationId: split[3]\n };\n }\n\n if (type === DashboardTargetType.PartnerProfile) {\n return {\n targetType: DashboardTargetType.PartnerProfile,\n slug: split[1]\n };\n }\n\n return null;\n },\n\n getDashboardTargetType(dashboard: CuratedDashboard): DashboardTargetType {\n if (!dashboard?.target)\n return null;\n\n if (dashboard.target.startsWith('discover')) {\n if (dashboard.target.endsWith('partners'))\n return DashboardTargetType.DiscoverPartnerProfiles;\n\n if (dashboard.target.endsWith('hub'))\n return DashboardTargetType.PartnerProfileHub;\n\n return DashboardTargetType.Discover;\n }\n\n if (dashboard.target.startsWith('classification')) {\n if (dashboard.target.endsWith('directory'))\n return DashboardTargetType.ClassificationDirectory;\n\n if (dashboard.target.endsWith('curriculum'))\n return DashboardTargetType.ClassificationCurriculum;\n\n return DashboardTargetType.Classification;\n }\n\n if (dashboard.target.startsWith('moviesAndTv'))\n return DashboardTargetType.MoviesAndTv;\n\n if (dashboard.target.startsWith('company')) {\n return DashboardTargetType.Company;\n }\n\n if (dashboard.target.startsWith('partnerprofile'))\n return DashboardTargetType.PartnerProfile;\n\n return null;\n },\n\n isType(dashboard: CuratedDashboard, target: DashboardTargetType): boolean {\n return CuratedDashboardHelper.getDashboardTargetType(dashboard) === target;\n },\n\n isCuratedDashboard(obj: BaseObject): obj is CuratedDashboard {\n const dashboard = obj as CuratedDashboard;\n\n const targetType = CuratedDashboardHelper.getDashboardTargetType(dashboard);\n\n if (targetType === DashboardTargetType.Discover)\n return true;\n\n if (targetType === DashboardTargetType.Classification)\n return true;\n\n if (targetType === DashboardTargetType.ClassificationDirectory)\n return true;\n\n if (targetType === DashboardTargetType.ClassificationCurriculum)\n return true;\n\n if (targetType === DashboardTargetType.MoviesAndTv)\n return true;\n\n if (targetType === DashboardTargetType.Company)\n return true;\n\n return false;\n },\n\n getLatestReleasedTimeRange(): LatestReleasesTimeRange {\n const now = new Date();\n const from = DateHelper.format(DateHelper.endOf(DateHelper.subtract(now, 2, 'month'), 'day'), 'YYYY-MM-DD');\n const to = DateHelper.format(DateHelper.endOf(now, 'day'), 'YYYY-MM-DD');\n return { from, to };\n },\n\n getWidgetParams(\n widgetTypeId: WidgetTypeId,\n templateId: WidgetTemplate,\n target: DashboardTargetType,\n audienceIds?: string | string[],\n preferredCurriculumId?: string,\n options?: GetCustomParamOptions\n ): CuratedWidgetQueryParams {\n const params: CuratedWidgetQueryParams = { };\n\n if (audienceIds)\n params.audienceId = audienceIds;\n\n if (widgetTypeId === WidgetTypeId.ClassificationCurriculumMedia)\n params.curriculumPresentationId = preferredCurriculumId;\n\n return {\n ...params,\n ...WidgetTypeIdConfig[widgetTypeId]?.getCustomParams?.(templateId, target, options)\n };\n },\n\n isSystemGeneratedDashboard(widgets: CuratedWidget[]): boolean {\n const systemGeneratedClassificationWidgetTypes = new Set<WidgetTypeId>([\n WidgetTypeId.ClassificationFeaturedVideo,\n WidgetTypeId.ClassificationPinnedVideos,\n WidgetTypeId.ClassificationPlaylists,\n WidgetTypeId.ClassificationSeries\n ]);\n\n return widgets?.some(widget => systemGeneratedClassificationWidgetTypes.has(widget.widgetId));\n },\n\n isClassificationDashboard(\n targetInfo: DashboardTargetInfo\n ): targetInfo is ClassificationDashboardInfo | ClassificationDirectoryInfo | ClassificationCurriculumInfo {\n return [\n DashboardTargetType.Classification,\n DashboardTargetType.ClassificationDirectory,\n DashboardTargetType.ClassificationCurriculum\n ].includes(targetInfo?.targetType);\n },\n\n isContentPartnerDashboard(targetInfo: DashboardTargetInfo): targetInfo is PartnerProfileDashboardInfo {\n return targetInfo?.targetType === DashboardTargetType.PartnerProfile;\n },\n\n isDirectoryDashboard(\n targetInfo: DashboardTargetInfo\n ): targetInfo is ClassificationDirectoryInfo {\n return targetInfo?.targetType === DashboardTargetType.ClassificationDirectory;\n },\n\n isWidgetTypeEnabled(\n widgetTypeId: WidgetTypeId,\n settingsHash: SettingsHash,\n targetType: DashboardTargetType\n ): boolean {\n const config = WidgetTypeIdConfig[widgetTypeId];\n \n return config?.predicate?.({ settingsHash, targetType }) ?? true;\n }\n};\n","import { Core } from 'libs/common/backbone/index';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { SourceFilterOptions, TypeFilterOptions } from '../apps/search/interfaces';\nimport { WidgetAppLinks } from '../components/widgets/curated-widgets/WidgetProps';\nimport { WidgetTemplate } from '../enums/WidgetTemplate';\nimport { WidgetTypeId } from '../enums/WidgetTypeId';\nimport { SettingsHash } from '../hooks/useSettings';\nimport { CuratedWidgetContent, CuratedWidgetQueryParams, DashboardTargetType, Series } from '../interfaces';\nimport { CuratedDashboardHelper } from '../utils/DashboardHelper';\n\ninterface WidgetTypeIdPredicateOptions {\n settingsHash: SettingsHash;\n targetType: DashboardTargetType;\n}\n\nexport interface GetCustomParamOptions {\n params?: CuratedWidgetQueryParams;\n}\n\ninterface WidgetTypeIdConfigType {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => CuratedWidgetQueryParams;\n minContent?: number;\n getCollectionAppLink?: (\n appLinks: Partial<WidgetAppLinks>,\n content?: CuratedWidgetContent\n ) => Core.AppLink;\n /**\n * Predicate used to determine if the widget\n * should be displayed based on the target\n * type and settings. Useful for feature flagging widgets.\n */\n predicate?: (options: WidgetTypeIdPredicateOptions) => boolean;\n}\n\nfunction partnerProfileWidgetTypeIdPredicate(options: WidgetTypeIdPredicateOptions): boolean {\n return options.settingsHash?.hasPartnerProfiles ?? false;\n}\n\nexport const WidgetTypeIdConfig: Record<WidgetTypeId, WidgetTypeIdConfigType> = {\n [WidgetTypeId.CuratedMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.PlaylistMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SeriesMedia]: {\n getCustomParams: (widgetTemplate: WidgetTemplate) => {\n switch (widgetTemplate) {\n case WidgetTemplate.ThumbnailFixedListMediaLarge:\n return { limit: 2 };\n case WidgetTemplate.ThumbnailHeroMedia:\n case WidgetTemplate.ThumbnailFeaturedMedia:\n return { limit: 1 };\n default:\n return { limit: 12 };\n }\n },\n getCollectionAppLink: (appLinks, content) => appLinks?.series?.(ArrayHelper.first(content) as Series)\n },\n [WidgetTypeId.ClassificationMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.LatestReleasedVideos]: {\n getCustomParams: () => {\n return CuratedDashboardHelper.getLatestReleasedTimeRange();\n }\n },\n [WidgetTypeId.ContinueWatching]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks?.watchHistory?.()\n },\n [WidgetTypeId.BecauseYouWatched]: {\n getCustomParams: (widgetTemplate: WidgetTemplate) => {\n switch (widgetTemplate) {\n case WidgetTemplate.PopoutThumbnailSlidingListLarge:\n return { limit: 3 };\n default:\n return { limit: 4 };\n }\n },\n minContent: 3\n },\n [WidgetTypeId.CompanyLatestReleasedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.CompanyVideos]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationLatestReleasedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationLatestReleasedVideosV2]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n [WidgetTypeId.SeasonalClassificationMedia]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n [WidgetTypeId.CompanyClassificationVideos]: {\n getCustomParams: () => ({}),\n minContent: 4\n },\n [WidgetTypeId.TrendingClassificationsMedia]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n\n [WidgetTypeId.CuratedClassifications]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.TrendingClassifications]: {\n getCustomParams: () => {\n return {\n limit: 6\n };\n },\n minContent: 3\n },\n [WidgetTypeId.Classifications]: {\n getCustomParams: (template: WidgetTemplate, targetType: DashboardTargetType) => {\n if (targetType === DashboardTargetType.Discover) {\n if (template === WidgetTemplate.EditableCoverFixedPillListSmall) {\n return {\n canBePreferred: true,\n isFollowing: true\n };\n }\n\n if ([ WidgetTemplate.PosterSlidingListSmall, WidgetTemplate.CoverFixedPillListXSmall ].includes(template)) {\n return {\n canBePreferred: true\n };\n }\n }\n\n return {};\n }\n },\n [WidgetTypeId.ClassificationLatestReleasedVideos]: {\n getCustomParams: () => {\n return CuratedDashboardHelper.getLatestReleasedTimeRange();\n }\n },\n [WidgetTypeId.SpecialEventClassifications]: {\n getCustomParams: () => ({\n from: DateHelper.format(new Date(), 'YYYY-MM-DD')\n })\n },\n [WidgetTypeId.LatestReleasedClassifications]: {\n getCustomParams: () => {\n return {\n limit: 6\n };\n },\n minContent: 3\n },\n [WidgetTypeId.PersonalisedTopics]: {\n getCustomParams: () => {\n return {\n limit: 5\n };\n },\n minContent: 4\n },\n\n [WidgetTypeId.CuratedSeries]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.CuratedPlaylists]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.Blurb]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.DynamicBlurb]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.AuthorReviewer]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.Faq]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.Feedback]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.CuratedCompanies]: {\n getCustomParams: () => ({}),\n predicate: options => {\n if (options.settingsHash?.hasPartnerProfiles)\n return false;\n return true;\n }\n },\n\n [WidgetTypeId.Ratings]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.Presentations]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.UpcomingLivestreams]: {\n getCustomParams: () => ({\n from: DateHelper.format(new Date(), 'YYYY-MM-DD')\n })\n },\n\n [WidgetTypeId.CuratedMultimedia]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.ClassificationPlaylists]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationSeries]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationFeaturedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationPinnedVideos]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationDashboardExternalMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationDashboardMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationAllVideos]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.SearchRelevantTopics]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchRelevantTopics],\n type: [TypeFilterOptions.Classification]\n })\n },\n [WidgetTypeId.SearchCompanies]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchCompanies],\n type: [TypeFilterOptions.Company]\n }),\n predicate: options => {\n if (options.settingsHash?.hasPartnerProfiles)\n return false;\n return true;\n }\n },\n [WidgetTypeId.SearchSeries]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchSeries],\n type: [TypeFilterOptions.Series]\n })\n },\n [WidgetTypeId.SearchPlaylists]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchPlaylists],\n type: [TypeFilterOptions.Playlist]\n })\n },\n [WidgetTypeId.SearchMyVideosFolder]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMyVideosFolder],\n source: [SourceFilterOptions.MyVideos]\n })\n },\n [WidgetTypeId.SearchMySchoolLibraryFolder]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMySchoolLibraryFolder],\n source: [SourceFilterOptions.School]\n })\n },\n [WidgetTypeId.SearchMyVideos]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMyVideos],\n source: [SourceFilterOptions.MyVideos]\n })\n },\n [WidgetTypeId.SearchMySchoolLibraryVideos]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMySchoolLibraryVideos],\n source: [SourceFilterOptions.School]\n })\n },\n [WidgetTypeId.SearchExchangeArchive]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchExchangeArchive],\n source: [SourceFilterOptions.ExchangeArchive]\n })\n },\n [WidgetTypeId.SearchClickViewLive]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchClickViewLive],\n source: [SourceFilterOptions.LiveStreams]\n }),\n predicate: options => options.settingsHash?.clickViewLive ?? false\n },\n [WidgetTypeId.SearchRelatedResults]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchTopResults]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationCurriculumMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchTags]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchCurriculumCode]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchSuggestions]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchContentPartners]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchContentPartners],\n type: [TypeFilterOptions.PartnerProfile]\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.CuratedContentPartners]: {\n getCustomParams: () => ({\n limit: 12\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerLatestReleasedVideos]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerSeries]: {\n getCollectionAppLink: appLinks => {\n return appLinks?.scopedSearchHome?.({\n type: [TypeFilterOptions.Series]\n });\n },\n getCustomParams: () => ({\n limit: 12\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerVideos]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.SpotlightContentPartners]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartners]: {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => ({\n letterPrefix: options?.params?.letterPrefix,\n sort: options?.params?.sort\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnersHub]: {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => {\n if (targetType !== DashboardTargetType.PartnerProfileHub)\n return {};\n\n return {\n objectId: options?.params?.objectId\n };\n },\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.TrendingContentPartnersVideo]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerAllVideos]: {\n getCustomParams: (widgetTemplate: WidgetTemplate) => {\n if (widgetTemplate === WidgetTemplate.ThumbnailFixedListSearchCta)\n return { limit: 3 };\n\n return {};\n },\n predicate: partnerProfileWidgetTypeIdPredicate\n }\n};\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { ObjectHelper } from 'libs/common/react/utils/ObjectHelper';\n\nimport { AnalyticsOptions, ClickDescriptor, EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { WidgetStatus } from 'libs/shared/enums/WidgetStatus';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { Breakpoints } from 'libs/shared/hooks/useBreakpoints';\nimport { UseTransformerFunc } from 'libs/shared/hooks/useTransformer';\nimport { BaseWidget, CuratedDashboardAppLink, CuratedWidget, CuratedWidgetContent, Playlist, Presentation, Series, Video, VideoTypes, VideoWidgetTemplateContent, WidgetMetadata, WidgetPreference } from 'libs/shared/interfaces';\n\nimport { AnyWidgetTemplateProps } from '../components/widgets/curated-widgets/WidgetProps';\nimport { WidgetTypeIdConfig } from '../constants/WidgetTypeIdConfig';\nimport { MasterType } from '../enums/MasterType';\n\nimport { MasterTypeHelper } from './MasterTypeHelper';\n\nenum WidgetStatusString {\n Draft = 'Draft',\n Published = 'Published',\n Archived = 'Archived'\n}\n\nexport const WidgetHelper = {\n /**\n * Used by both the FixedWidget and DynamicWidget\n */\n getSliderAnalyticsOptions: (): AnalyticsOptions => ({\n actionType: UserAction.Click,\n location: LocationContext.SlidingList,\n entity: EntityType.Widget,\n descriptor: ClickDescriptor.Slide\n }),\n\n /**\n * Used by both the FixedWidget and DynamicWidget\n */\n getSliderItemAnalyticsOptions: (): AnalyticsOptions => ({\n location: LocationContext.SlidingListItem\n }),\n\n getSliderHeadingAnalyticsOptions: (): AnalyticsOptions => ({\n actionType: UserAction.Click,\n location: LocationContext.SlidingList,\n entity: EntityType.Widget,\n descriptor: ClickDescriptor.Title\n }),\n\n useGetContent(\n content: CuratedWidgetContent,\n widgetTypeId: WidgetTypeId,\n isPreviewing: boolean,\n preferences: WidgetPreference[],\n removedItemIds: string[]\n ): { content: CuratedWidgetContent, unfilteredContent: CuratedWidgetContent } {\n return React.useMemo(() => {\n if (!content)\n return { content: null, unfilteredContent: null };\n\n if (!Array.isArray(content))\n return { content, unfilteredContent: content };\n\n const preferencesHash = preferences?.reduce((acc: HashObject, current) => {\n acc[current.id] = current;\n return acc;\n }, {}) ?? {};\n\n const removedItemIdsHash = removedItemIds.reduce((acc: HashObject, current) => {\n acc[current] = true;\n return acc;\n }, {});\n\n const contentCopy = [...content];\n \n const sortedContent = contentCopy.sort((a, b) => {\n if (!('id' in a) || !('id' in b))\n return 0;\n\n const aIndex = preferencesHash[a.id]?.index ?? contentCopy.findIndex(c => 'id' in c && c.id === a.id);\n const bIndex = preferencesHash[b.id]?.index ?? contentCopy.findIndex(c => 'id' in c && c.id === b.id);\n\n if (aIndex < bIndex)\n return -1;\n\n if (aIndex > bIndex)\n return 1;\n\n return 0;\n });\n\n if (WidgetHelper.isBelowContentMinimum(sortedContent, widgetTypeId) && !isPreviewing) {\n return {\n content: [],\n unfilteredContent: sortedContent\n };\n }\n\n const filteredContent = sortedContent.filter(item => {\n if (preferencesHash['id' in item && item.id]?.hidden)\n return false;\n\n if (removedItemIdsHash['id' in item && item.id])\n return false;\n\n return true;\n });\n\n return {\n content: filteredContent,\n unfilteredContent: sortedContent\n };\n }, [ content, preferences ]);\n },\n\n isBelowContentMinimum(content: CuratedWidgetContent, widgetTypeId: WidgetTypeId): boolean {\n const minContent = WidgetTypeIdConfig[widgetTypeId]?.minContent || 0;\n return content?.length < minContent;\n },\n\n getCustomAppLink(props: AnyWidgetTemplateProps): Core.AppLink | null {\n if (\n !('metadata' in props) ||\n !('appLinks' in props) ||\n !('appLink' in props.metadata)\n ) {\n return null;\n }\n\n if (props.metadata?.appLink === CuratedDashboardAppLink.LatestReleases && 'latestReleases' in props.appLinks)\n return props.appLinks?.latestReleases?.();\n\n if (props.metadata?.appLink === CuratedDashboardAppLink.ExploreAllTopics && 'allTopics' in props.appLinks && 'presentation' in props)\n return props.appLinks?.allTopics?.(props.presentation.id);\n\n return null;\n },\n\n getWidgetStatus(widget: CuratedWidget): WidgetStatus {\n let status = widget.status;\n\n if (typeof (status) === 'string') {\n switch (status) {\n case WidgetStatusString.Archived:\n status = WidgetStatus.Archived;\n break;\n case WidgetStatusString.Published:\n status = WidgetStatus.Published;\n break;\n case WidgetStatusString.Draft:\n status = WidgetStatus.Draft;\n break;\n }\n }\n\n return status;\n },\n\n formatResponseData(widget: CuratedWidget, presentation?: Presentation): CuratedWidget {\n const content = widget.content;\n\n if (!content)\n return widget;\n\n if ('author' in content) {\n widget.content = [content] as CuratedWidgetContent;\n return widget;\n }\n\n if ('data' in content)\n widget.content = content.data as CuratedWidgetContent;\n else if (!Array.isArray(content))\n widget.content = [content]; // Handle `classification_featured_video` widgets, which don't return content as an array\n\n switch (widget.widgetId) {\n case WidgetTypeId.ClassificationSeries:\n widget.content = widget.content.filter((c): c is Series => 'tallPoster' in c && !!c.tallPoster?.id);\n break;\n case WidgetTypeId.ClassificationPlaylists:\n widget.content = widget.content.filter((c): c is Playlist => 'cover' in c && !!c.cover?.id);\n break;\n case WidgetTypeId.ContinueWatching:\n widget.content = widget.content.map(c => 'object' in c && c.object);\n default:\n break;\n case WidgetTypeId.Presentations:\n widget.content = widget.content.filter((c): c is Presentation => 'id' in c && c.id.toString() !== presentation?.id?.toString());\n break;\n }\n\n return widget;\n },\n \n isWidgetInTableOfContents(metadata: Partial<WidgetMetadata>): boolean {\n return !!metadata?.showInTableOfContents;\n },\n\n /**\n * Widget container view won't render a widget with no content typically,\n * but some widgets (such as blurbs) have no content, but should render anyway.\n */\n hasNoContent(widgetTypeId: WidgetTypeId): boolean {\n if ([ WidgetTypeId.Blurb, WidgetTypeId.Feedback ].includes(widgetTypeId)) return true;\n\n return false;\n },\n\n /**\n * If any widgets should be hidden on smaller screen sizes, add them here.\n * If this needs to be more flexible at some point, it should be added to\n * the widget settings and metadata object.\n */\n canDisplayOnScreenSize(\n breakpoints: Breakpoints,\n widgetTypeId: WidgetTypeId,\n widgetTemplate: WidgetTemplate\n ): boolean {\n if (widgetTypeId === WidgetTypeId.Blurb && widgetTemplate === WidgetTemplate.HeroBannerSmall)\n return !breakpoints.xs && !breakpoints.sm;\n\n return true;\n },\n\n isCompanyWidget(widgetTypeId: WidgetTypeId): boolean {\n switch (widgetTypeId) {\n case WidgetTypeId.CompanyLatestReleasedVideo:\n case WidgetTypeId.CompanyVideos:\n case WidgetTypeId.UpcomingLivestreams:\n return true;\n default:\n return false;\n }\n },\n\n getVideoContent(content: VideoWidgetTemplateContent): VideoTypes[] {\n const firstItem = ArrayHelper.first<Video | Series>(content);\n\n if (MasterTypeHelper.isType<Series>(firstItem, MasterType.Series))\n return firstItem.videos.data;\n\n return content as VideoTypes[];\n },\n\n showRemoveButton(widgetTypeId: WidgetTypeId): boolean {\n return widgetTypeId === WidgetTypeId.ContinueWatching;\n },\n\n /**\n * Paginated data returns more widgets so if we dont merge the widget content by widget type id,\n * it would add another widget to the page rather than appending content to the relevant\n * search result index\n * \n * For example:\n * Say we receive these widgets for a query:\n * - topics widget\n * - related results widget\n * \n * If a user scrolls down to the end of page we fetch more items from the last widget\n * which in this case is 'related results widget'. \n * Now our overall response looks like this\n * - topics widget\n * - related results widget\n * - related results widget\n * \n * Since this is a new widget item entry it will be rendered as a new widget with seprate headings etc.\n * In this case we want to combine these two widgets data into one so its looks like this again:\n * - topics widget\n * - related results widget (data is combined)\n * \n * But what if widget we get recieve has a different widget template id. This currently happens for\n * the 'series widget' - series widget can have the tall poster template or the thumbnail like template.\n * \n * so to visualize this it can be like:\n * - topics widget\n * - top results widget\n * - series widget (template: tall poster)\n * - series widget (template: thumbnail)\n * \n * Since they technically will look different based on the template id we will not merge the data in this case.\n * It will merge the data to the same widget as long as the combination of widget Id + template Id is the same.\n * \n * Since they are separate widgets they will render duplicate headings - we handle this in css instead which\n * checks for adjacent siblings and if its the same widget - it hides the widget heading so it will look\n * like its a single widget rather than separate widgets.\n * \n * - Nish\n */\n mergeWidgets<T extends BaseWidget>(\n items: T[],\n mergeContent: (target: T, source: T) => void\n ): T[] {\n const widgets = ObjectHelper.deepClone(items);\n const groupedWidgets = ArrayHelper.groupBy(widgets, 'widgetId');\n const mergedWidgets: T[] = [];\n\n for (const widgetGroup of Object.values(groupedWidgets)) {\n let currentMergedWidget: T | null = null;\n const groupMergedWidgets: T[] = [];\n\n for (const widget of widgetGroup) {\n if (!currentMergedWidget) {\n currentMergedWidget = widget;\n continue;\n }\n\n if (widget.templateId !== currentMergedWidget.templateId) {\n groupMergedWidgets.push(currentMergedWidget);\n currentMergedWidget = widget;\n continue;\n }\n\n mergeContent(currentMergedWidget, widget);\n }\n\n if (currentMergedWidget) {\n groupMergedWidgets.push(currentMergedWidget);\n }\n mergedWidgets.push(...groupMergedWidgets);\n }\n\n return mergedWidgets;\n },\n\n mergeCuratedWidgets(data: CuratedWidget[]): CuratedWidget[] {\n if (!data) return data;\n\n return WidgetHelper.mergeWidgets(data, (target, source) => {\n target.content = [\n ...(target.content || []),\n ...source.content\n ];\n });\n },\n\n getWidgetResultsTransformers(): Array<UseTransformerFunc<CuratedWidget[]>> {\n return [\n data => WidgetHelper.mergeCuratedWidgets(data)\n ];\n }\n};\n"],"mappings":"iaASA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,eAAA,kBACA,EAAA,iBAAA,qBACA,EAAA,6BAAA,iCACA,EAAA,wBAAA,4BACF,EAAA,CAAA,CAAA,EAEY,EAAL,SAAA,EAAA,OACL,GAAA,eAAA,kBACA,EAAA,iBAAA,qBACA,EAAA,aAAA,iBACF,EAAA,CAAA,CAAA,WCpBY,EAAL,SAAA,EAAA,OACL,GAAA,EAAA,MAAA,GAAA,QACA,EAAA,EAAA,UAAA,GAAA,YACA,EAAA,EAAA,SAAA,GAAA,YACF,EAAA,CAAA,CAAA,ECJY,EAAL,SAAA,EAAA,OAEL,GAAA,mBAAA,uBACA,EAAA,uBAAA,2BACA,EAAA,0BAAA,+BACA,EAAA,4BAAA,kCACA,EAAA,0BAAA,+BACA,EAAA,6BAAA,mCACA,EAAA,6BAAA,mCACA,EAAA,8BAAA,oCACA,EAAA,sBAAA,0BACA,EAAA,gCAAA,sCACA,EAAA,gCAAA,sCACA,EAAA,6BAAA,kCACA,EAAA,yBAAA,8BAGA,EAAA,0BAAA,gCACA,EAAA,wBAAA,8BACA,EAAA,6BAAA,oCACA,EAAA,yBAAA,+BACA,EAAA,wBAAA,6BACA,EAA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ACT,QACE,MAAO,EACX,CACF,EAEA,gBAAgB,EAAmD,CACjE,IAAM,EAAY,EAAY,MAAsB,CAAO,EAK3D,OAHI,EAAiB,OAAe,EAAW,EAAW,MAAM,EACvD,EAAU,OAAO,KAEnB,CACT,EAEA,iBAAiB,EAAqC,CACpD,OAAO,IAAiB,EAAa,gBACvC,EA0CA,aACE,EACA,EACK,CACL,IAAM,EAAU,EAAa,UAAU,CAAK,EACtC,EAAiB,EAAY,QAAQ,EAAS,UAAU,EACxD,EAAqB,CAAC,EAE5B,IAAK,IAAM,KAAe,OAAO,OAAO,CAAc,EAAG,CACvD,IAAI,EAAgC,KAC9B,EAA0B,CAAC,EAEjC,IAAK,IAAM,KAAU,EAAa,CAChC,GAAI,CAAC,EAAqB,CACxB,EAAsB,EACtB,QACF,CAEA,GAAI,EAAO,aAAe,EAAoB,WAAY,CACxD,EAAmB,KAAK,CAAmB,EAC3C,EAAsB,EACtB,QACF,CAEA,EAAa,EAAqB,CAAM,CAC1C,CAEI,GACF,EAAmB,KAAK,CAAmB,EAE7C,EAAc,KAAK,GAAG,CAAkB,CAC1C,CAEA,OAAO,CACT,EAEA,oBAAoB,EAAwC,CAG1D,OAFK,GAEE,EAAa,aAAa,GAAO,EAAQ,IAAW,CACzD,EAAO,QAAU,CACf,GAAI,EAAO,SAAW,CAAC,EACvB,GAAG,EAAO,OACZ,CACF,CAAC,CACH,EAEA,8BAA2E,CACzE,MAAO,CACL,GAAQ,EAAa,oBAAoB,CAAI,CAC/C,CACF,CACF"}
|
|
1
|
+
{"version":3,"file":"Cr6TXzQQ2.chunk.js","names":[],"sources":["../../../../libs/shared/src/interfaces/models/curated-widget/CuratedWidget.ts","../../../../libs/shared/src/enums/WidgetStatus.ts","../../../../libs/shared/src/enums/WidgetTemplate.ts","../../../../libs/shared/src/enums/WidgetTypeId.ts","../../../../libs/shared/src/utils/DashboardHelper.ts","../../../../libs/shared/src/constants/WidgetTypeIdConfig.ts","../../../../libs/shared/src/utils/WidgetHelper.ts"],"sourcesContent":["import { HashObject } from 'libs/common/react/interfaces';\n\nimport { AllWidgetTemplateProps } from 'libs/shared/components/widgets/curated-widgets/WidgetProps';\nimport { ButtonIcon } from 'libs/shared/constants/WidgetThemingConstants';\nimport { WidgetStatus } from 'libs/shared/enums/WidgetStatus';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { CuratedObjectsWidgetData, CuratedWidgetContent, CuratedWidgetData } from 'libs/shared/interfaces';\n\nexport enum CuratedDashboardAppLink {\n LatestReleases = 'latest-releases',\n ExploreAllTopics = 'explore-all-topics',\n ClassificationLatestReleases = 'classification-latest-releases',\n ClassificationDirectory = 'classification-directory'\n}\n\nexport enum CuratedWidgetCtaAppLink {\n TopicDirectory = 'topic-directory',\n TopicNewReleases = 'topic-new-releases',\n CuratedTopic = 'curated-topic'\n}\n\nexport interface BaseWidget<TContent extends HashObject = HashObject> {\n id: string;\n index: number;\n templateId: WidgetTemplate;\n widgetId: WidgetTypeId;\n name: string;\n description?: string;\n content?: TContent;\n}\n\nexport interface WidgetCta {\n text?: string;\n href?: string;\n icon?: ButtonIcon;\n appLink?: CuratedWidgetCtaAppLink;\n style?: string;\n}\n\nexport interface WidgetSubtitle {\n text?: string;\n href?: string;\n}\n\nexport type WidgetMetadata = AllWidgetTemplateProps['metadata'] & {\n showInTableOfContents: boolean,\n tocIndentation: number,\n headingOptional: boolean,\n aiAddedVideo: boolean\n};\n\nexport interface WidgetPreference {\n id: string;\n index?: number;\n hidden?: boolean;\n}\n\nexport interface CuratedWidget<\n TData extends CuratedWidgetData = CuratedWidgetData,\n TContent extends CuratedWidgetContent = CuratedWidgetContent\n> extends BaseWidget<TContent> {\n id: string;\n dashboardId: string;\n data: TData;\n status: WidgetStatus;\n metadata?: Partial<WidgetMetadata>;\n preferences?: WidgetPreference[];\n cursor?: string;\n\n // If a widget has curriculum IDs set, then it won't be accessible to anyone who doesn't have one of those curriculums\n curriculumIds?: string[];\n}\n\nexport type CuratedMediaWidget<\n TContent extends CuratedWidgetContent = CuratedWidgetContent\n> = CuratedWidget<CuratedObjectsWidgetData, TContent>;\n","export enum WidgetStatus {\n Draft = 0,\n Published = 1,\n Archived = 2\n}\n\n","export enum WidgetTemplate {\n // Videos\n ThumbnailHeroMedia = 'thumbnail_hero_media',\n ThumbnailFeaturedMedia = 'thumbnail_featured_media',\n ThumbnailSlidingListSmall = 'thumbnail_sliding_list_small',\n ThumbnailSlidingListSmallV2 = 'thumbnail_sliding_list_small_v2',\n ThumbnailSlidingListLarge = 'thumbnail_sliding_list_large',\n ThumbnailFixedListMediaSmall = 'thumbnail_fixed_list_media_small',\n ThumbnailFixedListMediaLarge = 'thumbnail_fixed_list_media_large',\n ThumbnailFixedListFolderSmall = 'thumbnail_fixed_list_folder_small',\n ThumbnailVerticalList = 'thumbnail_vertical_list',\n PopoutThumbnailSlidingListLarge = 'popout_thumbnail_sliding_list_large',\n PopoutThumbnailSlidingListSmall = 'popout_thumbnail_sliding_list_small',\n FeaturedThumbnailSlidingList = 'featured_thumbnail_sliding_list',\n ThumbnailFixedListXLarge = 'thumbnail_fixed_list_xlarge',\n\n // Topics\n CoverSlidingPillListSmall = 'cover_sliding_pill_list_small',\n CoverFixedPillListLarge = 'cover_fixed_pill_list_large',\n StatsCoverFixedPillListLarge = 'stats_cover_fixed_pill_list_large',\n CoverFixedPillListXSmall = 'cover_fixed_pill_list_xsmall',\n ThumbnailFixedListLarge = 'thumbnail_fixed_list_large',\n ThumbnailFixedListSmall = 'thumbnail_fixed_list_small',\n EditableCoverFixedPillListSmall = 'editable_cover_fixed_pill_list_small',\n HeroBanner = 'hero_banner',\n HeroThumbnailSmall = 'hero_thumbnail_small',\n HeroBlockColourSmall = 'hero_block_colour_small',\n\n // Curriculum\n CurriculumResourcesAccordion = 'curriculum_resources_accordion',\n CurriculumCodeSearchResults = 'curriculum_code_search_results',\n\n // Playlists\n CoverFixedTileList = 'cover_fixed_tile_list',\n\n // Topics & Series\n PosterSlidingListLarge = 'poster_sliding_list_large',\n PosterSlidingListMedium = 'poster_sliding_list_medium',\n PosterSlidingListSmall = 'poster_sliding_list_small',\n PosterFixedListLarge = 'poster_fixed_list_large',\n\n // Blurbs & Topics\n HeroBannerSmall = 'hero_banner_small',\n\n // Text-based blurbs\n Heading = 'heading',\n AuthorReviewer = 'author_reviewer',\n Question = 'question',\n QuestionAccordion = 'question_accordion',\n FeedbackCta = 'feedback_cta',\n\n // Companies / Studios / Content Partners\n CircleLogoSlidingList = 'circle_logo_sliding_list',\n RectangularLogoSlidingList = 'rectangular_logo_sliding_list',\n RectangularLogoFixedList = 'rectangular_logo_fixed_list',\n ThumbnailFixedListSearchCta = 'thumbnail_fixed_list_search_cta',\n InfiniteThumbnailVerticalList = 'infinite_thumbnail_vertical_list',\n\n // Rating filters\n FilterSlidingPillListSmall = 'filter_sliding_pill_list_small',\n\n // Special events\n EventIconSlidingList = 'event_icon_sliding_list',\n\n // Tags filter\n TagSlidingList = 'tag_sliding_list',\n\n SearchSuggestionsBlurb = 'search_suggestions_blurb'\n}\n","export enum WidgetTypeId {\n // Video group\n CuratedMedia = 'curated_media',\n PlaylistMedia = 'playlist_media',\n SeriesMedia = 'series_media',\n ClassificationMedia = 'classification_media',\n LatestReleasedVideos = 'latest_released_videos',\n ContinueWatching = 'continue_watching_videos',\n BecauseYouWatched = 'because_you_watched',\n CompanyLatestReleasedVideo = 'company_latest_released_video',\n CompanyVideos = 'company_videos',\n ClassificationLatestReleasedVideo = 'classification_latest_released_video',\n ClassificationLatestReleasedVideosV2 = 'classification_latest_released_videos_v2',\n CompanyClassificationVideos = 'company_classification_videos',\n ClassificationDashboardMedia = 'classification_dashboard_media',\n ClassificationDashboardExternalMedia = 'classification_dashboard_external_media',\n ClassificationAllVideos = 'classification_all_videos',\n SeasonalClassificationMedia = 'seasonal_classification_media',\n TrendingClassificationsMedia = 'trending_classifications_media',\n ClassificationCurriculumMedia = 'classification_curriculum_media',\n\n // Topics group\n CuratedClassifications = 'curated_classifications',\n Classifications = 'classifications',\n ClassificationLatestReleasedVideos = 'classification_latest_released_videos',\n SpecialEventClassifications = 'special_event_classifications',\n LatestReleasedClassifications = 'latest_released_classifications',\n TrendingClassifications = 'trending_classifications',\n PersonalisedTopics = 'personalised_classifications',\n\n // Series group\n CuratedSeries = 'curated_series',\n\n // Playlists group\n CuratedPlaylists = 'curated_playlists',\n\n // Blurb group\n Blurb = 'blurb',\n DynamicBlurb = 'dynamic_blurb',\n AuthorReviewer = 'author_reviewer',\n Faq = 'faq',\n Feedback = 'feedback',\n\n // Network group\n CuratedCompanies = 'curated_companies',\n\n // Partner Profile group\n CuratedContentPartners = 'curated_content_partners',\n ContentPartnerLatestReleasedVideos = 'content_partner_latest_released_videos',\n ContentPartnerSeries = 'content_partner_series',\n ContentPartnerVideos = 'content_partner_videos',\n SpotlightContentPartners = 'spotlight_curated_content_partners',\n ContentPartners = 'content_partners',\n ContentPartnersHub = 'content_partners_hub',\n TrendingContentPartnersVideo = 'content_partner_trending_videos',\n ContentPartnerAllVideos = 'content_partner_all_videos',\n\n // Search filter group\n Ratings = 'ratings',\n\n // Presentations group\n Presentations = 'presentations',\n\n // Livestreams group\n UpcomingLivestreams = 'upcoming_livestreams',\n\n // Multimedia group\n CuratedMultimedia = 'curated_multimedia',\n\n // Legacy widget types\n ClassificationPlaylists = 'classification_playlists',\n ClassificationSeries = 'classification_series',\n ClassificationFeaturedVideo = 'classification_featured_video',\n ClassificationPinnedVideos = 'classification_pinned_videos',\n\n // Search widget types\n SearchRelevantTopics = 'search_relevant_topics',\n SearchCompanies = 'search_companies',\n SearchTopResults = 'search_top_results',\n SearchSeries = 'search_series',\n SearchPlaylists = 'search_playlists',\n SearchMyVideosFolder = 'search_my_videos_folders',\n SearchMySchoolLibraryFolder = 'search_my_school_library_folders',\n SearchMyVideos = 'search_my_videos',\n SearchMySchoolLibraryVideos = 'search_my_school_library_videos',\n SearchExchangeArchive = 'search_exchange_archive',\n SearchClickViewLive = 'search_clickview_live',\n SearchRelatedResults = 'search_related_results',\n SearchTags = 'search_tags',\n SearchCurriculumCode = 'search_curriculum_code',\n SearchSuggestions = 'search_suggestions',\n SearchContentPartners = 'search_content_partners'\n}\n","import { FormikContextType } from 'formik';\n\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { SearchResultObjectTypes } from 'libs/shared/apps/search/interfaces';\nimport { GetCustomParamOptions, WidgetTypeIdConfig } from 'libs/shared/constants/WidgetTypeIdConfig';\nimport { UserGroup } from 'libs/shared/enums/UserGroup';\nimport { OnlineUserRole } from 'libs/shared/enums/UserRole';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { SettingsHash } from 'libs/shared/hooks/useSettings';\nimport { BaseObject, ClassificationCurriculumInfo, ClassificationDashboardInfo, ClassificationDirectoryInfo, CuratedDashboard, CuratedMediaWidget, CuratedWidget, CuratedWidgetQueryParams, DashboardTargetInfo, DashboardTargetType, PartnerProfileDashboardInfo, UnknownDashboardTargetInfo } from 'libs/shared/interfaces';\n\ninterface LatestReleasesTimeRange {\n from: string;\n to: string;\n}\n\nexport const DashboardHelper = {\n\n /**\n * Same implementation as GetUserGroup() in Online.\n * @param userRole \n */\n getUserGroup(userRole: OnlineUserRole): UserGroup {\n if (userRole === OnlineUserRole.Student)\n return UserGroup.Learner;\n\n return UserGroup.Staff;\n }\n};\n\nexport const CuratedDashboardHelper = {\n onSelectCuratedObject(\n selectedObj: SearchResultObjectTypes | BaseObject,\n formikProps: FormikContextType<CuratedMediaWidget<BaseObject[]>>\n ) {\n const data = {\n ...formikProps.values.data,\n objectIds: ArrayHelper.addOrRemoveImmutable(formikProps.values.data.objectIds || [], selectedObj.id)\n };\n \n formikProps.setFieldValue('data', data);\n \n formikProps.setTouched({\n ...formikProps.touched,\n data: {\n objectIds: true\n }\n });\n },\n\n onRemoveCuratedObject(\n objectId: string,\n formikProps: FormikContextType<CuratedMediaWidget<BaseObject[]>>\n ) {\n const newData = {\n ...formikProps.values.data,\n objectIds: formikProps.values.data.objectIds.filter(id => id !== objectId)\n };\n\n formikProps.setFieldValue('data', newData);\n },\n\n getDashboardTarget(info: DashboardTargetInfo): string {\n if (info.targetType === DashboardTargetType.Discover)\n return `discover:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.Classification)\n return `classification:${info.classificationId}`;\n\n if (info.targetType === DashboardTargetType.ClassificationDirectory)\n return `classification:${info.classificationId}:directory`;\n\n if (info.targetType === DashboardTargetType.ClassificationCurriculum)\n return `classification:${info.classificationId}:curriculum`;\n\n if (info.targetType === DashboardTargetType.MoviesAndTv)\n return `moviesAndTv:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.Company)\n return `company:${info.companyId}:presentation:${info.presentationId}`;\n\n if (info.targetType === DashboardTargetType.PartnerProfile)\n return `partnerprofile:${info.slug}`;\n\n if (info.targetType === DashboardTargetType.DiscoverPartnerProfiles)\n return `discover:partners`;\n\n if (info.targetType === DashboardTargetType.PartnerProfileHub)\n return `discover:partners:hub`;\n\n return null;\n },\n\n getUnknownDashboardTarget(options: UnknownDashboardTargetInfo): string {\n const {\n presentationId,\n companyId,\n targetType,\n classificationId,\n slug\n } = options;\n\n if (targetType === DashboardTargetType.Discover) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Discover,\n presentationId\n });\n }\n \n if (targetType === DashboardTargetType.MoviesAndTv) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.MoviesAndTv,\n presentationId\n });\n }\n \n if (targetType === DashboardTargetType.Company) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Company,\n presentationId,\n companyId\n });\n }\n \n if (targetType === DashboardTargetType.Classification) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.Classification,\n classificationId\n });\n }\n \n if (targetType === DashboardTargetType.ClassificationDirectory) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.ClassificationDirectory,\n classificationId\n });\n }\n \n if (targetType === DashboardTargetType.ClassificationCurriculum) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.ClassificationCurriculum,\n classificationId\n });\n }\n\n if (targetType === DashboardTargetType.PartnerProfile) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.PartnerProfile,\n slug\n });\n }\n\n if (targetType === DashboardTargetType.DiscoverPartnerProfiles) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.DiscoverPartnerProfiles\n });\n }\n\n if (targetType === DashboardTargetType.PartnerProfileHub) {\n return CuratedDashboardHelper.getDashboardTarget({\n targetType: DashboardTargetType.PartnerProfileHub\n });\n }\n },\n\n getDashboardTargetInfo(dashboard: CuratedDashboard): DashboardTargetInfo {\n const type = CuratedDashboardHelper.getDashboardTargetType(dashboard);\n const split = dashboard?.target?.split(':');\n\n if (type === DashboardTargetType.Discover) {\n return {\n targetType: DashboardTargetType.Discover,\n presentationId: split[2]\n };\n }\n\n if (type === DashboardTargetType.Classification) {\n return {\n targetType: DashboardTargetType.Classification,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.ClassificationDirectory) {\n return {\n targetType: DashboardTargetType.ClassificationDirectory,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.ClassificationCurriculum) {\n return {\n targetType: DashboardTargetType.ClassificationCurriculum,\n classificationId: split[1]\n };\n }\n\n if (type === DashboardTargetType.MoviesAndTv) {\n return {\n targetType: DashboardTargetType.MoviesAndTv,\n presentationId: split[2]\n };\n }\n\n if (type === DashboardTargetType.Company) {\n return {\n targetType: DashboardTargetType.Company,\n companyId: split[1],\n presentationId: split[3]\n };\n }\n\n if (type === DashboardTargetType.PartnerProfile) {\n return {\n targetType: DashboardTargetType.PartnerProfile,\n slug: split[1]\n };\n }\n\n return null;\n },\n\n getDashboardTargetType(dashboard: CuratedDashboard): DashboardTargetType {\n if (!dashboard?.target)\n return null;\n\n if (dashboard.target.startsWith('discover')) {\n if (dashboard.target.endsWith('partners'))\n return DashboardTargetType.DiscoverPartnerProfiles;\n\n if (dashboard.target.endsWith('hub'))\n return DashboardTargetType.PartnerProfileHub;\n\n return DashboardTargetType.Discover;\n }\n\n if (dashboard.target.startsWith('classification')) {\n if (dashboard.target.endsWith('directory'))\n return DashboardTargetType.ClassificationDirectory;\n\n if (dashboard.target.endsWith('curriculum'))\n return DashboardTargetType.ClassificationCurriculum;\n\n return DashboardTargetType.Classification;\n }\n\n if (dashboard.target.startsWith('moviesAndTv'))\n return DashboardTargetType.MoviesAndTv;\n\n if (dashboard.target.startsWith('company')) {\n return DashboardTargetType.Company;\n }\n\n if (dashboard.target.startsWith('partnerprofile'))\n return DashboardTargetType.PartnerProfile;\n\n return null;\n },\n\n isType(dashboard: CuratedDashboard, target: DashboardTargetType): boolean {\n return CuratedDashboardHelper.getDashboardTargetType(dashboard) === target;\n },\n\n isCuratedDashboard(obj: BaseObject): obj is CuratedDashboard {\n const dashboard = obj as CuratedDashboard;\n\n const targetType = CuratedDashboardHelper.getDashboardTargetType(dashboard);\n\n if (targetType === DashboardTargetType.Discover)\n return true;\n\n if (targetType === DashboardTargetType.Classification)\n return true;\n\n if (targetType === DashboardTargetType.ClassificationDirectory)\n return true;\n\n if (targetType === DashboardTargetType.ClassificationCurriculum)\n return true;\n\n if (targetType === DashboardTargetType.MoviesAndTv)\n return true;\n\n if (targetType === DashboardTargetType.Company)\n return true;\n\n return false;\n },\n\n getLatestReleasedTimeRange(): LatestReleasesTimeRange {\n const now = new Date();\n const from = DateHelper.format(DateHelper.endOf(DateHelper.subtract(now, 2, 'month'), 'day'), 'YYYY-MM-DD');\n const to = DateHelper.format(DateHelper.endOf(now, 'day'), 'YYYY-MM-DD');\n return { from, to };\n },\n\n getWidgetParams(\n widgetTypeId: WidgetTypeId,\n templateId: WidgetTemplate,\n target: DashboardTargetType,\n audienceIds?: string | string[],\n preferredCurriculumId?: string,\n options?: GetCustomParamOptions\n ): CuratedWidgetQueryParams {\n const params: CuratedWidgetQueryParams = { };\n\n if (audienceIds)\n params.audienceId = audienceIds;\n\n if (widgetTypeId === WidgetTypeId.ClassificationCurriculumMedia)\n params.curriculumPresentationId = preferredCurriculumId;\n\n return {\n ...params,\n ...WidgetTypeIdConfig[widgetTypeId]?.getCustomParams?.(templateId, target, options)\n };\n },\n\n isSystemGeneratedDashboard(widgets: CuratedWidget[]): boolean {\n const systemGeneratedClassificationWidgetTypes = new Set<WidgetTypeId>([\n WidgetTypeId.ClassificationFeaturedVideo,\n WidgetTypeId.ClassificationPinnedVideos,\n WidgetTypeId.ClassificationPlaylists,\n WidgetTypeId.ClassificationSeries\n ]);\n\n return widgets?.some(widget => systemGeneratedClassificationWidgetTypes.has(widget.widgetId));\n },\n\n isClassificationDashboard(\n targetInfo: DashboardTargetInfo\n ): targetInfo is ClassificationDashboardInfo | ClassificationDirectoryInfo | ClassificationCurriculumInfo {\n return [\n DashboardTargetType.Classification,\n DashboardTargetType.ClassificationDirectory,\n DashboardTargetType.ClassificationCurriculum\n ].includes(targetInfo?.targetType);\n },\n\n isContentPartnerDashboard(targetInfo: DashboardTargetInfo): targetInfo is PartnerProfileDashboardInfo {\n return targetInfo?.targetType === DashboardTargetType.PartnerProfile;\n },\n\n isDirectoryDashboard(\n targetInfo: DashboardTargetInfo\n ): targetInfo is ClassificationDirectoryInfo {\n return targetInfo?.targetType === DashboardTargetType.ClassificationDirectory;\n },\n\n isWidgetTypeEnabled(\n widgetTypeId: WidgetTypeId,\n settingsHash: SettingsHash,\n targetType: DashboardTargetType\n ): boolean {\n const config = WidgetTypeIdConfig[widgetTypeId];\n \n return config?.predicate?.({ settingsHash, targetType }) ?? true;\n }\n};\n","import { Core } from 'libs/common/backbone/index';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { DateHelper } from 'libs/common/react/utils/DateHelper';\n\nimport { SourceFilterOptions, TypeFilterOptions } from '../apps/search/interfaces';\nimport { WidgetAppLinks } from '../components/widgets/curated-widgets/WidgetProps';\nimport { WidgetTemplate } from '../enums/WidgetTemplate';\nimport { WidgetTypeId } from '../enums/WidgetTypeId';\nimport { SettingsHash } from '../hooks/useSettings';\nimport { CuratedWidgetContent, CuratedWidgetQueryParams, DashboardTargetType, Series } from '../interfaces';\nimport { CuratedDashboardHelper } from '../utils/DashboardHelper';\n\ninterface WidgetTypeIdPredicateOptions {\n settingsHash: SettingsHash;\n targetType: DashboardTargetType;\n}\n\nexport interface GetCustomParamOptions {\n params?: CuratedWidgetQueryParams;\n}\n\ninterface WidgetTypeIdConfigType {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => CuratedWidgetQueryParams;\n minContent?: number;\n getCollectionAppLink?: (\n appLinks: Partial<WidgetAppLinks>,\n content?: CuratedWidgetContent\n ) => Core.AppLink;\n /**\n * Predicate used to determine if the widget\n * should be displayed based on the target\n * type and settings. Useful for feature flagging widgets.\n */\n predicate?: (options: WidgetTypeIdPredicateOptions) => boolean;\n}\n\nfunction partnerProfileWidgetTypeIdPredicate(options: WidgetTypeIdPredicateOptions): boolean {\n return options.settingsHash?.hasPartnerProfiles ?? false;\n}\n\nexport const WidgetTypeIdConfig: Record<WidgetTypeId, WidgetTypeIdConfigType> = {\n [WidgetTypeId.CuratedMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.PlaylistMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SeriesMedia]: {\n getCustomParams: (widgetTemplate: WidgetTemplate) => {\n switch (widgetTemplate) {\n case WidgetTemplate.ThumbnailFixedListMediaLarge:\n return { limit: 2 };\n case WidgetTemplate.ThumbnailHeroMedia:\n case WidgetTemplate.ThumbnailFeaturedMedia:\n return { limit: 1 };\n default:\n return { limit: 12 };\n }\n },\n getCollectionAppLink: (appLinks, content) => appLinks?.series?.(ArrayHelper.first(content) as Series)\n },\n [WidgetTypeId.ClassificationMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.LatestReleasedVideos]: {\n getCustomParams: () => {\n return CuratedDashboardHelper.getLatestReleasedTimeRange();\n }\n },\n [WidgetTypeId.ContinueWatching]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks?.watchHistory?.()\n },\n [WidgetTypeId.BecauseYouWatched]: {\n getCustomParams: (widgetTemplate: WidgetTemplate) => {\n switch (widgetTemplate) {\n case WidgetTemplate.PopoutThumbnailSlidingListLarge:\n return { limit: 3 };\n default:\n return { limit: 4 };\n }\n },\n minContent: 3\n },\n [WidgetTypeId.CompanyLatestReleasedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.CompanyVideos]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationLatestReleasedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationLatestReleasedVideosV2]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n [WidgetTypeId.SeasonalClassificationMedia]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n [WidgetTypeId.CompanyClassificationVideos]: {\n getCustomParams: () => ({}),\n minContent: 4\n },\n [WidgetTypeId.TrendingClassificationsMedia]: {\n getCustomParams: () => {\n return {\n limit: 12\n };\n },\n minContent: 4\n },\n\n [WidgetTypeId.CuratedClassifications]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.TrendingClassifications]: {\n getCustomParams: () => {\n return {\n limit: 6\n };\n },\n minContent: 3\n },\n [WidgetTypeId.Classifications]: {\n getCustomParams: (template: WidgetTemplate, targetType: DashboardTargetType) => {\n if (targetType === DashboardTargetType.Discover) {\n if (template === WidgetTemplate.EditableCoverFixedPillListSmall) {\n return {\n canBePreferred: true,\n isFollowing: true\n };\n }\n\n if ([ WidgetTemplate.PosterSlidingListSmall, WidgetTemplate.CoverFixedPillListXSmall ].includes(template)) {\n return {\n canBePreferred: true\n };\n }\n }\n\n return {};\n }\n },\n [WidgetTypeId.ClassificationLatestReleasedVideos]: {\n getCustomParams: () => {\n return CuratedDashboardHelper.getLatestReleasedTimeRange();\n }\n },\n [WidgetTypeId.SpecialEventClassifications]: {\n getCustomParams: () => ({\n from: DateHelper.format(new Date(), 'YYYY-MM-DD')\n })\n },\n [WidgetTypeId.LatestReleasedClassifications]: {\n getCustomParams: () => {\n return {\n limit: 6\n };\n },\n minContent: 3\n },\n [WidgetTypeId.PersonalisedTopics]: {\n getCustomParams: () => {\n return {\n limit: 5\n };\n },\n minContent: 4\n },\n\n [WidgetTypeId.CuratedSeries]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.CuratedPlaylists]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.Blurb]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.DynamicBlurb]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.AuthorReviewer]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.Faq]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.Feedback]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.CuratedCompanies]: {\n getCustomParams: () => ({}),\n predicate: options => {\n if (options.settingsHash?.hasPartnerProfiles)\n return false;\n return true;\n }\n },\n\n [WidgetTypeId.Ratings]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.Presentations]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.UpcomingLivestreams]: {\n getCustomParams: () => ({\n from: DateHelper.format(new Date(), 'YYYY-MM-DD')\n })\n },\n\n [WidgetTypeId.CuratedMultimedia]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.ClassificationPlaylists]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationSeries]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationFeaturedVideo]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationPinnedVideos]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationDashboardExternalMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationDashboardMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationAllVideos]: {\n getCustomParams: () => ({})\n },\n\n [WidgetTypeId.SearchRelevantTopics]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchRelevantTopics],\n type: [TypeFilterOptions.Classification]\n })\n },\n [WidgetTypeId.SearchCompanies]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchCompanies],\n type: [TypeFilterOptions.Company]\n }),\n predicate: options => {\n if (options.settingsHash?.hasPartnerProfiles)\n return false;\n return true;\n }\n },\n [WidgetTypeId.SearchSeries]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchSeries],\n type: [TypeFilterOptions.Series]\n })\n },\n [WidgetTypeId.SearchPlaylists]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchPlaylists],\n type: [TypeFilterOptions.Playlist]\n })\n },\n [WidgetTypeId.SearchMyVideosFolder]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMyVideosFolder],\n source: [SourceFilterOptions.MyVideos]\n })\n },\n [WidgetTypeId.SearchMySchoolLibraryFolder]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMySchoolLibraryFolder],\n source: [SourceFilterOptions.School]\n })\n },\n [WidgetTypeId.SearchMyVideos]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMyVideos],\n source: [SourceFilterOptions.MyVideos]\n })\n },\n [WidgetTypeId.SearchMySchoolLibraryVideos]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchMySchoolLibraryVideos],\n source: [SourceFilterOptions.School]\n })\n },\n [WidgetTypeId.SearchExchangeArchive]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchExchangeArchive],\n source: [SourceFilterOptions.ExchangeArchive]\n })\n },\n [WidgetTypeId.SearchClickViewLive]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchClickViewLive],\n source: [SourceFilterOptions.LiveStreams]\n }),\n predicate: options => options.settingsHash?.clickViewLive ?? false\n },\n [WidgetTypeId.SearchRelatedResults]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchTopResults]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.ClassificationCurriculumMedia]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchTags]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchCurriculumCode]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchSuggestions]: {\n getCustomParams: () => ({})\n },\n [WidgetTypeId.SearchContentPartners]: {\n getCustomParams: () => ({}),\n getCollectionAppLink: appLinks => appLinks.searchHome({\n focus: [WidgetTypeId.SearchContentPartners],\n type: [TypeFilterOptions.PartnerProfile]\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.CuratedContentPartners]: {\n getCustomParams: () => ({\n limit: 12\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerLatestReleasedVideos]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerSeries]: {\n getCollectionAppLink: appLinks => {\n return appLinks?.scopedSearchHome?.({\n type: [TypeFilterOptions.Series]\n });\n },\n getCustomParams: () => ({\n limit: 12\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerVideos]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.SpotlightContentPartners]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartners]: {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => ({\n letterPrefix: options?.params?.letterPrefix,\n sort: options?.params?.sort\n }),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnersHub]: {\n getCustomParams: (\n widgetTemplate: WidgetTemplate,\n targetType: DashboardTargetType,\n options?: GetCustomParamOptions\n ) => {\n if (targetType !== DashboardTargetType.PartnerProfileHub)\n return {};\n\n return {\n objectId: options?.params?.objectId\n };\n },\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.TrendingContentPartnersVideo]: {\n getCustomParams: () => ({}),\n predicate: partnerProfileWidgetTypeIdPredicate\n },\n [WidgetTypeId.ContentPartnerAllVideos]: {\n getCustomParams: (widgetTemplate: WidgetTemplate) => {\n if (widgetTemplate === WidgetTemplate.ThumbnailFixedListSearchCta)\n return { limit: 3 };\n\n return {};\n },\n predicate: partnerProfileWidgetTypeIdPredicate\n }\n};\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { HashObject } from 'libs/common/react/interfaces';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\nimport { ObjectHelper } from 'libs/common/react/utils/ObjectHelper';\n\nimport { AnalyticsOptions, ClickDescriptor, EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { WidgetStatus } from 'libs/shared/enums/WidgetStatus';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { Breakpoints } from 'libs/shared/hooks/useBreakpoints';\nimport { UseTransformerFunc } from 'libs/shared/hooks/useTransformer';\nimport { BaseWidget, CuratedDashboardAppLink, CuratedWidget, CuratedWidgetContent, Playlist, Presentation, Series, Video, VideoTypes, VideoWidgetTemplateContent, WidgetMetadata, WidgetPreference } from 'libs/shared/interfaces';\n\nimport { AnyWidgetTemplateProps } from '../components/widgets/curated-widgets/WidgetProps';\nimport { WidgetTypeIdConfig } from '../constants/WidgetTypeIdConfig';\nimport { MasterType } from '../enums/MasterType';\n\nimport { MasterTypeHelper } from './MasterTypeHelper';\n\nenum WidgetStatusString {\n Draft = 'Draft',\n Published = 'Published',\n Archived = 'Archived'\n}\n\nexport const WidgetHelper = {\n /**\n * Used by both the FixedWidget and DynamicWidget\n */\n getSliderAnalyticsOptions: (): AnalyticsOptions => ({\n actionType: UserAction.Click,\n location: LocationContext.SlidingList,\n entity: EntityType.Widget,\n descriptor: ClickDescriptor.Slide\n }),\n\n /**\n * Used by both the FixedWidget and DynamicWidget\n */\n getSliderItemAnalyticsOptions: (): AnalyticsOptions => ({\n location: LocationContext.SlidingListItem\n }),\n\n getSliderHeadingAnalyticsOptions: (): AnalyticsOptions => ({\n actionType: UserAction.Click,\n location: LocationContext.SlidingList,\n entity: EntityType.Widget,\n descriptor: ClickDescriptor.Title\n }),\n\n useGetContent(\n content: CuratedWidgetContent,\n widgetTypeId: WidgetTypeId,\n isPreviewing: boolean,\n preferences: WidgetPreference[],\n removedItemIds: string[]\n ): { content: CuratedWidgetContent, unfilteredContent: CuratedWidgetContent } {\n return React.useMemo(() => {\n if (!content)\n return { content: null, unfilteredContent: null };\n\n if (!Array.isArray(content))\n return { content, unfilteredContent: content };\n\n const preferencesHash = preferences?.reduce((acc: HashObject, current) => {\n acc[current.id] = current;\n return acc;\n }, {}) ?? {};\n\n const removedItemIdsHash = removedItemIds.reduce((acc: HashObject, current) => {\n acc[current] = true;\n return acc;\n }, {});\n\n const contentCopy = [...content];\n \n const sortedContent = contentCopy.sort((a, b) => {\n if (!('id' in a) || !('id' in b))\n return 0;\n\n const aIndex = preferencesHash[a.id]?.index ?? contentCopy.findIndex(c => 'id' in c && c.id === a.id);\n const bIndex = preferencesHash[b.id]?.index ?? contentCopy.findIndex(c => 'id' in c && c.id === b.id);\n\n if (aIndex < bIndex)\n return -1;\n\n if (aIndex > bIndex)\n return 1;\n\n return 0;\n });\n\n if (WidgetHelper.isBelowContentMinimum(sortedContent, widgetTypeId) && !isPreviewing) {\n return {\n content: [],\n unfilteredContent: sortedContent\n };\n }\n\n const filteredContent = sortedContent.filter(item => {\n if (preferencesHash['id' in item && item.id]?.hidden)\n return false;\n\n if (removedItemIdsHash['id' in item && item.id])\n return false;\n\n return true;\n });\n\n return {\n content: filteredContent,\n unfilteredContent: sortedContent\n };\n }, [ content, preferences ]);\n },\n\n isBelowContentMinimum(content: CuratedWidgetContent, widgetTypeId: WidgetTypeId): boolean {\n const minContent = WidgetTypeIdConfig[widgetTypeId]?.minContent || 0;\n return content?.length < minContent;\n },\n\n getCustomAppLink(props: AnyWidgetTemplateProps): Core.AppLink | null {\n if (\n !('metadata' in props) ||\n !('appLinks' in props) ||\n !('appLink' in props.metadata)\n ) {\n return null;\n }\n\n if (props.metadata?.appLink === CuratedDashboardAppLink.LatestReleases && 'latestReleases' in props.appLinks)\n return props.appLinks?.latestReleases?.();\n\n if (props.metadata?.appLink === CuratedDashboardAppLink.ExploreAllTopics && 'allTopics' in props.appLinks && 'presentation' in props)\n return props.appLinks?.allTopics?.(props.presentation.id);\n\n return null;\n },\n\n getWidgetStatus(widget: CuratedWidget): WidgetStatus {\n let status = widget.status;\n\n if (typeof (status) === 'string') {\n switch (status) {\n case WidgetStatusString.Archived:\n status = WidgetStatus.Archived;\n break;\n case WidgetStatusString.Published:\n status = WidgetStatus.Published;\n break;\n case WidgetStatusString.Draft:\n status = WidgetStatus.Draft;\n break;\n }\n }\n\n return status;\n },\n\n formatResponseData(widget: CuratedWidget, presentation?: Presentation): CuratedWidget {\n const content = widget.content;\n\n if (!content)\n return widget;\n\n if ('author' in content) {\n widget.content = [content] as CuratedWidgetContent;\n return widget;\n }\n\n if ('data' in content)\n widget.content = content.data as CuratedWidgetContent;\n else if (!Array.isArray(content))\n widget.content = [content]; // Handle `classification_featured_video` widgets, which don't return content as an array\n\n switch (widget.widgetId) {\n case WidgetTypeId.ClassificationSeries:\n widget.content = widget.content.filter((c): c is Series => 'tallPoster' in c && !!c.tallPoster?.id);\n break;\n case WidgetTypeId.ClassificationPlaylists:\n widget.content = widget.content.filter((c): c is Playlist => 'cover' in c && !!c.cover?.id);\n break;\n case WidgetTypeId.ContinueWatching:\n widget.content = widget.content.map(c => 'object' in c && c.object);\n default:\n break;\n case WidgetTypeId.Presentations:\n widget.content = widget.content.filter((c): c is Presentation => 'id' in c && c.id.toString() !== presentation?.id?.toString());\n break;\n }\n\n return widget;\n },\n \n isWidgetInTableOfContents(metadata: Partial<WidgetMetadata>): boolean {\n return !!metadata?.showInTableOfContents;\n },\n\n /**\n * Widget container view won't render a widget with no content typically,\n * but some widgets (such as blurbs) have no content, but should render anyway.\n */\n hasNoContent(widgetTypeId: WidgetTypeId): boolean {\n if ([ WidgetTypeId.Blurb, WidgetTypeId.Feedback ].includes(widgetTypeId)) return true;\n\n return false;\n },\n\n /**\n * If any widgets should be hidden on smaller screen sizes, add them here.\n * If this needs to be more flexible at some point, it should be added to\n * the widget settings and metadata object.\n */\n canDisplayOnScreenSize(\n breakpoints: Breakpoints,\n widgetTypeId: WidgetTypeId,\n widgetTemplate: WidgetTemplate\n ): boolean {\n if (widgetTypeId === WidgetTypeId.Blurb && widgetTemplate === WidgetTemplate.HeroBannerSmall)\n return !breakpoints.xs && !breakpoints.sm;\n\n return true;\n },\n\n isCompanyWidget(widgetTypeId: WidgetTypeId): boolean {\n switch (widgetTypeId) {\n case WidgetTypeId.CompanyLatestReleasedVideo:\n case WidgetTypeId.CompanyVideos:\n case WidgetTypeId.UpcomingLivestreams:\n return true;\n default:\n return false;\n }\n },\n\n getVideoContent(content: VideoWidgetTemplateContent): VideoTypes[] {\n const firstItem = ArrayHelper.first<Video | Series>(content);\n\n if (MasterTypeHelper.isType<Series>(firstItem, MasterType.Series))\n return firstItem.videos.data;\n\n return content as VideoTypes[];\n },\n\n showRemoveButton(widgetTypeId: WidgetTypeId): boolean {\n return widgetTypeId === WidgetTypeId.ContinueWatching;\n },\n\n /**\n * Paginated data returns more widgets so if we dont merge the widget content by widget type id,\n * it would add another widget to the page rather than appending content to the relevant\n * search result index\n * \n * For example:\n * Say we receive these widgets for a query:\n * - topics widget\n * - related results widget\n * \n * If a user scrolls down to the end of page we fetch more items from the last widget\n * which in this case is 'related results widget'. \n * Now our overall response looks like this\n * - topics widget\n * - related results widget\n * - related results widget\n * \n * Since this is a new widget item entry it will be rendered as a new widget with seprate headings etc.\n * In this case we want to combine these two widgets data into one so its looks like this again:\n * - topics widget\n * - related results widget (data is combined)\n * \n * But what if widget we get recieve has a different widget template id. This currently happens for\n * the 'series widget' - series widget can have the tall poster template or the thumbnail like template.\n * \n * so to visualize this it can be like:\n * - topics widget\n * - top results widget\n * - series widget (template: tall poster)\n * - series widget (template: thumbnail)\n * \n * Since they technically will look different based on the template id we will not merge the data in this case.\n * It will merge the data to the same widget as long as the combination of widget Id + template Id is the same.\n * \n * Since they are separate widgets they will render duplicate headings - we handle this in css instead which\n * checks for adjacent siblings and if its the same widget - it hides the widget heading so it will look\n * like its a single widget rather than separate widgets.\n * \n * - Nish\n */\n mergeWidgets<T extends BaseWidget>(\n items: T[],\n mergeContent: (target: T, source: T) => void\n ): T[] {\n const widgets = ObjectHelper.deepClone(items);\n const groupedWidgets = ArrayHelper.groupBy(widgets, 'widgetId');\n const mergedWidgets: T[] = [];\n\n for (const widgetGroup of Object.values(groupedWidgets)) {\n let currentMergedWidget: T | null = null;\n const groupMergedWidgets: T[] = [];\n\n for (const widget of widgetGroup) {\n if (!currentMergedWidget) {\n currentMergedWidget = widget;\n continue;\n }\n\n if (widget.templateId !== currentMergedWidget.templateId) {\n groupMergedWidgets.push(currentMergedWidget);\n currentMergedWidget = widget;\n continue;\n }\n\n mergeContent(currentMergedWidget, widget);\n }\n\n if (currentMergedWidget) {\n groupMergedWidgets.push(currentMergedWidget);\n }\n mergedWidgets.push(...groupMergedWidgets);\n }\n\n return mergedWidgets;\n },\n\n mergeCuratedWidgets(data: CuratedWidget[]): CuratedWidget[] {\n if (!data) return data;\n\n return WidgetHelper.mergeWidgets(data, (target, source) => {\n target.content = [\n ...(target.content || []),\n ...source.content\n ];\n });\n },\n\n getWidgetResultsTransformers(): Array<UseTransformerFunc<CuratedWidget[]>> {\n return [\n data => WidgetHelper.mergeCuratedWidgets(data)\n ];\n }\n};\n"],"mappings":"iaASA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,eAAA,kBACA,EAAA,iBAAA,qBACA,EAAA,6BAAA,iCACA,EAAA,wBAAA,4BACF,EAAA,CAAA,CAAA,EAEY,EAAL,SAAA,EAAA,OACL,GAAA,eAAA,kBACA,EAAA,iBAAA,qBACA,EAAA,aAAA,iBACF,EAAA,CAAA,CAAA,WCpBY,EAAL,SAAA,EAAA,OACL,GAAA,EAAA,MAAA,GAAA,QACA,EAAA,EAAA,UAAA,GAAA,YACA,EAAA,EAAA,SAAA,GAAA,YACF,EAAA,CAAA,CAAA,ECJY,EAAL,SAAA,EAAA,OAEL,GAAA,mBAAA,uBACA,EAAA,uBAAA,2BACA,EAAA,0BAAA,+BACA,EAAA,4BAAA,kCACA,EAAA,0BAAA,+BACA,EAAA,6BAAA,mCACA,EAAA,6BAAA,mCACA,EAAA,8BAAA,oCACA,EAAA,sBAAA,0BACA,EAAA,gCAAA,sCACA,EAAA,gCAAA,sCACA,EAAA,6BAAA,kCACA,EAAA,yBAAA,8BAGA,EAAA,0BAAA,gCACA,EAAA,wBAAA,8BACA,EAAA,6BAAA,oCACA,EAAA,y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a,cAClB,KAAK,EAAa,oBAChB,MAAO,GACT,QACE,MAAO,EACX,CACF,EAEA,gBAAgB,EAAmD,CACjE,IAAM,EAAY,EAAY,MAAsB,CAAO,EAK3D,OAHI,EAAiB,OAAe,EAAW,EAAW,MAAM,EACvD,EAAU,OAAO,KAEnB,CACT,EAEA,iBAAiB,EAAqC,CACpD,OAAO,IAAiB,EAAa,gBACvC,EA0CA,aACE,EACA,EACK,CACL,IAAM,EAAU,EAAa,UAAU,CAAK,EACtC,EAAiB,EAAY,QAAQ,EAAS,UAAU,EACxD,EAAqB,CAAC,EAE5B,IAAK,IAAM,KAAe,OAAO,OAAO,CAAc,EAAG,CACvD,IAAI,EAAgC,KAC9B,EAA0B,CAAC,EAEjC,IAAK,IAAM,KAAU,EAAa,CAChC,GAAI,CAAC,EAAqB,CACxB,EAAsB,EACtB,QACF,CAEA,GAAI,EAAO,aAAe,EAAoB,WAAY,CACxD,EAAmB,KAAK,CAAmB,EAC3C,EAAsB,EACtB,QACF,CAEA,EAAa,EAAqB,CAAM,CAC1C,CAEI,GACF,EAAmB,KAAK,CAAmB,EAE7C,EAAc,KAAK,GAAG,CAAkB,CAC1C,CAEA,OAAO,CACT,EAEA,oBAAoB,EAAwC,CAG1D,OAFK,GAEE,EAAa,aAAa,GAAO,EAAQ,IAAW,CACzD,EAAO,QAAU,CACf,GAAI,EAAO,SAAW,CAAC,EACvB,GAAG,EAAO,OACZ,CACF,CAAC,CACH,EAEA,8BAA2E,CACzE,MAAO,CACL,GAAQ,EAAa,oBAAoB,CAAI,CAC/C,CACF,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./DAXXjFlN.chunk.js";import{y as t}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{n}from"./B785hxeE.chunk.js";import{t as r}from"./e57H3T-k.chunk.js";import{t as i}from"./C2w0pmFW.chunk.js";import{t as a}from"./wrLrTezN.chunk.js";import{t as o}from"./BXTI9cmX.chunk.js";import{l as ee,y as te,z as ne}from"./NlCAcBdo.chunk.js";import{t as re}from"./CVHQXNzi2.chunk.js";import{t as s}from"./BrbeV-Gn2.chunk.js";import{t as c}from"./eoAypzU3.chunk.js";import{t as ie}from"./CgCqPbjJ.chunk.js";import{t as l}from"./7-GJWRH82.chunk.js";import{t as ae}from"./dLd5d3X22.chunk.js";import{t as oe}from"./QCFxJYkI2.chunk.js";import{t as se}from"./B2INd6bh.chunk.js";import{t as u}from"./B3gsVN-_.chunk.js";import{a as d,o as f}from"./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import{o as e}from"./DAXXjFlN.chunk.js";import{y as t}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{n}from"./B785hxeE.chunk.js";import{t as r}from"./e57H3T-k.chunk.js";import{t as i}from"./C2w0pmFW.chunk.js";import{t as a}from"./wrLrTezN.chunk.js";import{t as o}from"./BXTI9cmX.chunk.js";import{l as ee,y as te,z as ne}from"./NlCAcBdo.chunk.js";import{t as re}from"./CVHQXNzi2.chunk.js";import{t as s}from"./BrbeV-Gn2.chunk.js";import{t as c}from"./eoAypzU3.chunk.js";import{t as ie}from"./CgCqPbjJ.chunk.js";import{t as l}from"./7-GJWRH82.chunk.js";import{t as ae}from"./dLd5d3X22.chunk.js";import{t as oe}from"./QCFxJYkI2.chunk.js";import{t as se}from"./B2INd6bh.chunk.js";import{t as u}from"./B3gsVN-_.chunk.js";import{a as d,o as f}from"./CLvImDXv2.chunk.js";import{n as p}from"./CpFtf-tI2.chunk.js";import{t as m}from"./DBkEQkKm2.chunk.js";import{t as h}from"./CzuHD4Ht.chunk.js";import{n as ce}from"./xa4cS6Fq.chunk.js";import{t as le}from"./WvK58Ge12.chunk.js";import{t as ue}from"./CvHvrB-t.chunk.js";import{l as de}from"./BOJK8LI1.chunk.js";import{t as fe}from"./DzgAvoez.chunk.js";import{o as g,r as _}from"./CpgHBpMp.chunk.js";import{n as v,t as y}from"./CvtZ8ZFA2.chunk.js";import{t as b}from"./BPavmm8c.chunk.js";import{a as pe,i as me,n as he,t as ge}from"./Bf9r1ZoF2.chunk.js";import{_ as x,a as _e,d as ve,f as S,g as ye,h as be,i as xe,l as C,m as w,n as T,o as E,p as D,r as O,s as k,t as A,u as j}from"./D-pn0sNx2.chunk.js";import{n as M,t as Se}from"./B3p3SaM12.chunk.js";import{n as Ce,r as we}from"./BgOLbASl2.chunk.js";var N=e(i()),P=a(),F=`shared.playClip`;function Te(e){let{hasPermissions:t}=u(),n=v({location:y.VideoItem,presentationSlug:null});return(0,P.jsxs)(`section`,{className:`play-page-section`,id:b.ClippedFrom,ref:t=>{t&&e.headingRef?.current&&e.headingRef.current.set(b.ClippedFrom,t)},children:[(0,P.jsx)(`h2`,{className:`h4 mb-0`,children:(0,P.jsx)(p,{namespace:F,phrase:`clippedFrom`})}),(0,P.jsx)(g.Provider,{value:n,children:(0,P.jsx)(_,{videos:[e.originalVideo],getVideoAppLink:(t,n)=>m.getAppLink(t,{...n,context:e.queryParams.context,contextId:e.queryParams.contextId,playNext:e.queryParams.playNext,shareId:e.shareId,moviesAndTv:e.queryParams.mtv,includeContext:e.currentUser?.isAuthenticated},null),hasPermissions:t,presentationAudiences:e.audiences,getPreviewQuestionsAppLink:e=>h.getPreviewQuestionsAppLink(e),commonVideoProps:e.commonVideoProps})})]})}var I={main:`_main_1ujkn_1`,expandedToc:`_expandedToc_1ujkn_1`,theatreMode:`_theatreMode_1ujkn_4`,theatreModeContent:`_theatreModeContent_1ujkn_7`,theatreModePlayPageContainer:`_theatreModePlayPageContainer_1ujkn_17`,theatreModeLeftContent:`_theatreModeLeftContent_1ujkn_21`},Ee=(e,t,n)=>r=>n?{application:o.VIDEOS,action:c.Videos.PREVIEW_PDF,args:[r.id],params:{videoId:e,shareId:t}}:{application:o.SIGN_UP,action:c.SignUp.SIGN_UP};function L(e){let i=ce(),{hasPermissions:a}=u(),{canConsume:p}=s.getCanBeConsumed(e.clip),h=E(e.hasTheatreMode,i),g=T(e.hasTheatreMode,i.mode,i.defaultDisplayMode);function _(e){i.playerRef?.current?.toggleTheatreMode?.(e)}let{tableOfContentsActiveId:v,setTableOfContentsActiveId:y,controlledId:F,setControlledId:L,tableOfContentsExpanded:R,onToggleTableOfContents:z}=xe(e.tableOfContentsId,e.hasTheatreMode,h),B=ye(e.clip)&&e.featureAccess.canViewGlance,{headingRef:V,headingElements:H}=O(B),U=H.map(t=>({id:t.id,name:A.getSectionHeading(t.id,{clips:e.clips,interactives:e.interactives,resources:e.clip.resources?.data,isPlayClipPage:!0})}));we({setActiveId:y,headingElements:H,controlledId:F,setControlledId:L}),Ce(H,F);let De=s.isVideoTypeArchived(e.clip),W=a(n.StudentExperience),G=N.useRef(!1),K=Ee(e.clip.id,e.shareId,e.featureAccess.canViewResourceItems);C({resourcePopupId:e.queryParams?.resourceId,resources:e.clip.resources?.data,getResourceAppLink:K});function q(){G.current=!i?.playerRef?.current?.isPaused(),i?.playerRef?.current?.pause()}function J(){G.current&&i?.playerRef?.current?.play()}function Y(){return!(!e.clip._parentVideo||!e.clip._canBeConsumed?.value||!e.currentUser?.isAuthenticated||!e.hasProduct(oe.Primary)||W)}function Oe(){return Y()?{application:o.VIDEOS,action:c.Videos.PLAY_VIDEO,args:[null,e.clip._parentVideo.id,r.slugify(e.clip._parentVideo.name)]}:null}let ke=i.mode===`picture-in-picture`||e.featureAccess.canViewPublicLayout,Ae=e.clips?.filter(t=>t.id.toString()!==e.clip.id.toString())??[],X={hasTheatreMode:e.hasTheatreMode,shouldShowSideTableOfContents:e.shouldShowSideTableOfContents,tableOfContentsExpanded:R,theatreMode:h},je=k(X),Me=_e(X),[,Z]=ae(ie.PLAY_PAGE_CONTAINER_CLASS_NAME),Q=M(e.clip,a(n.StudentExperience)),$=Q.filter(le.isResource);function Ne(){if($.length===1){ue.downloadResource($[0],{clipId:e.clip.id,clipName:e.clip.name},{location:te.PlayClip,actionType:ne.Download,entity:ee.Resource});return}t.trigger({application:o.VIDEOS,action:c.Videos.RESOURCE_DOWNLOAD,args:[e.clip?.id,e.shareId]})}return N.useEffect(()=>{Z(h?I.theatreModePlayPageContainer:``)},[h]),N.useEffect(()=>()=>Z(``),[]),(0,P.jsxs)(`div`,{className:`px-4 play-page-sections-container ${e.shouldShowSideTableOfContents?`row g-0`:``}`,children:[(0,P.jsxs)(`main`,{className:`${I.main} ${je}`,children:[!!e.breadcrumbs?.length&&(0,P.jsx)(`div`,{className:`mb-2`,children:(0,P.jsx)(fe,{breadcrumbs:e.breadcrumbs})}),(0,P.jsx)(ge,{restrictions:e.clip._restrictions,yearGroups:e.commonVideoProps.yearGroups,objectId:e.clip.id,objectTypeId:re.Clip,canManageVideoAccess:e.canManageVideoAccess}),De&&(0,P.jsx)(pe,{typeId:e.clip.typeId,hasStudentExperience:W}),(0,P.jsxs)(`section`,{id:b.Video,className:`mb-2 ${se.GLOBAL_PLAYER_SELECTOR}`,ref:e=>{e&&V?.current&&V.current.set(b.Video,e)},children:[p&&(0,P.jsx)(de,{objectId:e.clip.id,objectTypeId:e.clip.typeId,shareId:e.shareId,context:e.queryParams?.context,contextId:e.queryParams?.contextId,moviesAndTv:e.queryParams?.mtv,playNext:e.queryParams?.playNext,startTime:e.queryParams?.t??e.queryParams?.startTime,mode:`default`,location:`play-page`},e.clip.id),(0,P.jsx)(`div`,{className:ke?``:`d-none`,children:(0,P.jsx)(j,{video:e.clip,type:`pip`})})]}),(0,P.jsxs)(`div`,{className:Me,children:[(0,P.jsxs)(`div`,{className:g?`${I.theatreModeLeftContent}`:`w-100`,children:[(0,P.jsx)(ve,{presentationSlug:null,media:e.clip,yearGroups:e.commonVideoProps.yearGroups,audiences:e.audiences,originalVideoAppLink:Oe(),featureAccess:e.featureAccess,shareId:e.shareId,showTitlePadlock:!e.commonVideoProps.hasStudentExperience&&!e.commonVideoProps.hasGuestExperience}),B?(0,P.jsx)(be,{video:e.clip,pointsOfInterest:e.pointsOfInterest,setStartTime:e=>i.playerRef.current?.currentTime(e),getTagAppLink:e=>({application:o.SEARCH,action:c.Search.HOME,params:{tagOrClassification:e.name}}),suppressInteractivity:e.featureAccess.canViewPublicLayout,canViewGlance:B}):(0,P.jsx)(x,{video:e.clip,currentUser:e.currentUser,onLaunchImmersiveReader:q,onExitImmersiveReader:J,getTagAppLink:e=>({application:o.SEARCH,action:c.Search.HOME,params:{tagOrClassification:e.name}}),headingRef:V,suppressInteractivity:e.featureAccess.canViewPublicLayout,getLibraryAppLink:f,getFolderAppLink:d}),(0,P.jsx)(Se,{video:e.clip,canViewResources:e.featureAccess.canViewResourceItems,imageCdnUrl:e.commonVideoProps.imageCdnUrl,getAppLink:K,analyticsData:{clipId:e.clip.id,clipName:e.clip.name},resourceThumbnailFallbackUrl:l.Fallbacks.RESOURCE_THUMBNAIL,headingRef:V,onDownloadClick:Ne,resources:Q,downloadableResources:$,aboutResourcesAppLink:m.getAboutResourceAppLink()}),(0,P.jsx)(D,{presentationSlug:null,video:e.clip,interactives:e.interactives,analyticsData:{clipId:e.clip.id,clipName:e.clip.name},canViewInteractives:e.featureAccess.canViewInteractives,headingRef:V,commonVideoProps:e.commonVideoProps}),(0,P.jsx)(w,{presentationSlug:null,clips:Ae||[],video:e.clip,canViewClips:e.featureAccess.canViewClips,audiences:e.audiences,headingRef:V,analyticsData:{clipId:e.clip.id,clipName:e.clip.name},commonVideoProps:e.commonVideoProps}),B&&(0,P.jsx)(x,{video:e.clip,currentUser:e.currentUser,onLaunchImmersiveReader:q,onExitImmersiveReader:J,getTagAppLink:e=>({application:o.SEARCH,action:c.Search.HOME,params:{tagOrClassification:e.name}}),headingRef:V,suppressInteractivity:e.featureAccess.canViewPublicLayout,showHeading:!0,getLibraryAppLink:a(n.ViewLibraries)?f:null,getFolderAppLink:a(n.ViewLibraries)?d:null}),!!Y()&&(0,P.jsx)(Te,{originalVideo:e.clip._parentVideo,shareId:e.shareId,queryParams:e.queryParams,audiences:e.audiences,headingRef:V,currentUser:e.currentUser,commonVideoProps:e.commonVideoProps}),!s.isUgc(e.clip._parentVideo)&&(0,P.jsx)(he,{headingRef:V,media:e.clip,parentVideo:e.clip._parentVideo,contentRegion:e.currentUser.contentRegion,shareId:e.shareId,presentationSlug:null}),(0,P.jsx)(me,{presentationSlug:null,currentVideo:e.clip,relatedVideos:e.relatedVideos,currentUser:e.currentUser,audiences:e.audiences,getVideoAppLink:(t,n)=>m.getAppLink(t,{...n,context:e.queryParams.context,contextId:e.queryParams.contextId,playNext:e.queryParams.playNext,shareId:e.shareId,moviesAndTv:e.queryParams.mtv,includeContext:e.currentUser?.isAuthenticated},null),moviesAndTv:e.queryParams.mtv,commonVideoProps:e.commonVideoProps})]}),h&&(0,P.jsx)(S,{isExpanded:R,setIsExpanded:z,toggleTheatreMode:null,items:U,activeId:v,setControlledId:L,analyticsData:{videoId:e.clip.id,videoName:e.clip.name},showInSide:e.shouldShowSideTableOfContents,isTheatreMode:!0,hasTranscription:e.hasTheatreMode,shouldShow:U.length>=3})]})]}),!h&&(0,P.jsx)(S,{isExpanded:R,setIsExpanded:z,toggleTheatreMode:e.hasTheatreMode?_:null,items:U,activeId:v,setControlledId:L,analyticsData:{videoId:e.clip.id,videoName:e.clip.name},showInSide:e.shouldShowSideTableOfContents,isTheatreMode:!1,hasTranscription:e.hasTheatreMode,shouldShow:U.length>=3})]})}export{L as t};
|
|
2
|
+
//# sourceMappingURL=CvilnM0u2.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"B_TE5XUR2.chunk.js","names":[],"sources":["../../src/shared/views/play-clip/components/clipped-from/ClippedFrom.tsx","../../src/shared/views/play-clip/components/play-clip/play-clip.module.scss","../../src/shared/views/play-clip/components/play-clip/PlayClip.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Text } from 'libs/shared/components/text/Text';\nimport { VideoList } from 'libs/shared/components/video-list/VideoList';\nimport { VideoActionsContext } from 'libs/shared/context/VideoActionsContext';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { CurrentUser, PresentationAudience, VideoTypes } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { PlayPageAnchor } from 'libs/shared/interfaces/PlayPageAnchor';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\n\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { InteractiveHelpers } from 'shared/utils/InteractiveHelper';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nconst namespace = 'shared.playClip';\n\ninterface ClippedFromProps {\n originalVideo: VideoTypes;\n queryParams: PlayViewQueryParams;\n audiences: PresentationAudience[];\n shareId?: string;\n headingRef: React.MutableRefObject<Map<PlayPageAnchor, HTMLElement>>;\n currentUser: CurrentUser;\n commonVideoProps: CommonVideoProps;\n}\n\nexport function ClippedFrom(props: ClippedFromProps) {\n const { hasPermissions } = usePermissions();\n const videoActions = useVideoActions({ location: VideoActionsLocation.VideoItem, presentationSlug: null });\n\n return (\n <section\n className='play-page-section'\n id={PlayPageAnchor.ClippedFrom}\n ref={el => {\n (el && props.headingRef?.current) && props.headingRef.current.set(PlayPageAnchor.ClippedFrom, el);\n }}\n >\n <h2 className='h4 mb-0'><Text namespace={namespace} phrase='clippedFrom' /></h2>\n <VideoActionsContext.Provider value={videoActions}>\n <VideoList\n videos={[props.originalVideo]}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareId,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n hasPermissions={hasPermissions}\n presentationAudiences={props.audiences}\n getPreviewQuestionsAppLink={interactive => InteractiveHelpers.getPreviewQuestionsAppLink(interactive)}\n commonVideoProps={props.commonVideoProps}\n />\n </VideoActionsContext.Provider>\n </section>\n );\n}\n","@import '~styles/utils/include-media';\n:local {\n .main.expandedToc {\n width: calc(100% - 15rem); //minus sidebar toc width and margin\n }\n\n .main.theatreMode {\n width: 100% !important;\n }\n\n .theatreModeContent {\n display: flex;\n margin: auto !important;\n\n @include media('<=xl') {\n max-width: 100%;\n }\n }\n\n .theatreModePlayPageContainer {\n //override TeacherLayoutComponent container style\n @media (min-width: 1200px) {\n max-width: none !important;\n }\n }\n\n .theatreModeLeftContent {\n width: calc(100% - 15rem);\n @include media('<=lg') {\n width: 100%;\n }\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/core';\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { VideoDetailsWithScrollbarV2 } from 'libs/shared/components/play-page/details/VideoDetailsV2';\nimport { hasGlanceData } from 'libs/shared/components/play-page/glance/VideoAtAGlanceUtilsV2';\nimport { VideoAtAGlanceV2 } from 'libs/shared/components/play-page/glance/VideoAtAGlanceV2';\nimport { getResources, PlayPageResources } from 'libs/shared/components/play-page/resources-widget/PlayPageResources';\nimport { SeoConstants } from 'libs/shared/constants/SeoConstants';\nimport { GlobalPlayerConsumer } from 'libs/shared/context/player-context/components/GlobalPlayerConsumer';\nimport { usePlayerContext } from 'libs/shared/context/player-context/PlayerContext';\nimport { MasterType } from 'libs/shared/enums/MasterType';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { ProductId } from 'libs/shared/enums/ProductId';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { HasProductFunc } from 'libs/shared/hooks/UseProducts';\nimport { useTableOfContentsActiveHeading } from 'libs/shared/hooks/useTableOfContentsActiveHeading';\nimport { useTableOfContentsScroll } from 'libs/shared/hooks/useTableOfContentsScroll';\nimport { Clip, CurrentUser, InteractiveMetadata, Link, PointOfInterest, PresentationAudience, Resource } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { PlayPageAnchor } from 'libs/shared/interfaces/PlayPageAnchor';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { DownloadHelper } from 'libs/shared/utils/DownloadHelper';\nimport { MasterTypeHelper } from 'libs/shared/utils/MasterTypeHelper';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { CitationWidget } from 'shared/components/citations/CitationWidget';\nimport { ArchivedBanner } from 'shared/components/play-page/ArchivedBanner';\nimport { PlayPageClips } from 'shared/components/play-page/components/play-page-clips/PlayPageClips';\nimport { PlayPageInteractives } from 'shared/components/play-page/components/play-page-interactives/PlayPageInteractives';\nimport { TableOfContentsContainer, TOC_IGNORE_BOUNDARY } from 'shared/components/play-page/components/table-of-contents/TableOfContents';\nimport { PlayPageTitleAndActions } from 'shared/components/play-page/components/title-and-actions/PlayPageTitleAndActions';\nimport { getFolderAppLink, getLibraryAppLink } from 'shared/components/play-page/PlayPageUtils';\nimport { RestrictionBanner } from 'shared/components/play-page/RestrictionBanner';\nimport { PlayerPlaceholder } from 'shared/components/player-placeholder/PlayerPlaceholder';\nimport { RelatedVideos } from 'shared/components/related-videos/RelatedVideos';\nimport { ImageUrls } from 'shared/constants/ImageUrls';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { ViewModelKeys } from 'shared/constants/LiteViewModels';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { VideoFeaturesHash } from 'shared/hooks/useVideoFeatureAccess';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\nimport { useResourcePopup } from 'shared/views/play/components/play-page/hooks/useResourcePopup';\nimport { getContentClassName, getIsTheatreMode, getMainClassName } from 'shared/views/play/components/play-page/PlayPageUtils';\nimport { usePlayPageTableOfContent } from 'shared/views/play/hooks/usePlayPageTableOfContent';\nimport { useSectionHeadings } from 'shared/views/play/hooks/useSectionHeadings';\nimport { useTheatreModeStyle } from 'shared/views/play/hooks/useTheatreStyle';\nimport { PlayPageUtils } from 'shared/views/play/PlayPageUtil';\nimport { ClippedFrom } from 'shared/views/play-clip/components/clipped-from/ClippedFrom';\n\nimport styles from './play-clip.module.scss';\n\nconst getResourceAppLink = (videoId: string, shareId: string, canViewResource: boolean) =>\n (resource: Resource | Link) => {\n if (!canViewResource) {\n return {\n application: AppChannels.SIGN_UP,\n action: Actions.SignUp.SIGN_UP\n };\n }\n\n return {\n application: AppChannels.VIDEOS,\n action: Actions.Videos.PREVIEW_PDF,\n args: [resource.id],\n params: {\n videoId: videoId,\n shareId: shareId\n }\n };\n };\n\ninterface PlayClipProps {\n clip: Clip;\n clips: Clip[];\n interactives: InteractiveMetadata[];\n currentUser: CurrentUser;\n relatedVideos: RelatedVideosHash;\n queryParams: PlayViewQueryParams;\n hasProduct: HasProductFunc;\n audiences: PresentationAudience[];\n shareId?: string;\n canManageVideoAccess: boolean;\n pointsOfInterest?: PointOfInterest[];\n featureAccess: VideoFeaturesHash;\n tableOfContentsId: string;\n shouldShowSideTableOfContents: boolean;\n hasTopicDirectories: boolean;\n hasTheatreMode: boolean;\n breadcrumbs?: Breadcrumb[];\n commonVideoProps: CommonVideoProps;\n}\n\nexport function PlayClip(props: PlayClipProps): JSX.Element {\n const playerContext = usePlayerContext();\n\n const { hasPermissions } = usePermissions();\n const { canConsume } = VideoHelper.getCanBeConsumed(props.clip);\n \n const theatreMode = getIsTheatreMode(props.hasTheatreMode, playerContext);\n const shouldUseTheareModeStyle = useTheatreModeStyle(\n props.hasTheatreMode,\n playerContext.mode,\n playerContext.defaultDisplayMode\n );\n\n function toggleTheatreMode(value: boolean) {\n playerContext.playerRef?.current?.toggleTheatreMode?.(value);\n }\n\n const {\n tableOfContentsActiveId,\n setTableOfContentsActiveId,\n controlledId,\n setControlledId,\n tableOfContentsExpanded,\n onToggleTableOfContents\n } = usePlayPageTableOfContent(props.tableOfContentsId, props.hasTheatreMode, theatreMode);\n\n const hasGlance = hasGlanceData(props.clip) && props.featureAccess.canViewGlance;\n\n const { headingRef, headingElements } = useSectionHeadings(hasGlance);\n const items = headingElements.map(ele => {\n return {\n id: ele.id as PlayPageAnchor,\n name: PlayPageUtils.getSectionHeading(\n ele.id as PlayPageAnchor,\n {\n clips: props.clips,\n interactives: props.interactives,\n resources: props.clip.resources?.data,\n isPlayClipPage: true\n }\n )\n };\n });\n\n useTableOfContentsActiveHeading({\n setActiveId: setTableOfContentsActiveId,\n headingElements,\n controlledId,\n setControlledId\n });\n\n useTableOfContentsScroll(headingElements, controlledId);\n\n const isArchived = VideoHelper.isVideoTypeArchived(props.clip);\n const hasStudentExperience = hasPermissions(PermissionName.StudentExperience);\n /**\n * Need to use a ref because if we use state, onExitImmersiveReader will have a stale\n * reference of the state. This is because the state is changed in onLaunchImmersiveReader\n * which is passed in at the same time as onExitImmersiveReader\n */\n const shouldPlayOnExitImmersiveReader = React.useRef(false);\n\n const clipResourceAppLink = getResourceAppLink(\n props.clip.id,\n props.shareId,\n props.featureAccess.canViewResourceItems\n );\n\n useResourcePopup({\n resourcePopupId: props.queryParams?.resourceId,\n resources: props.clip.resources?.data,\n getResourceAppLink: clipResourceAppLink\n });\n\n function onLaunchImmersiveReader(): void {\n shouldPlayOnExitImmersiveReader.current = !playerContext?.playerRef?.current?.isPaused();\n playerContext?.playerRef?.current?.pause();\n }\n\n function onExitImmersiveReader(): void {\n if (!shouldPlayOnExitImmersiveReader.current)\n return;\n\n playerContext?.playerRef?.current?.play();\n }\n\n function canAccessOriginal(): boolean {\n if (!props.clip._parentVideo || !props.clip._canBeConsumed?.value)\n return false;\n\n if (!props.currentUser?.isAuthenticated)\n return false;\n\n if (!props.hasProduct(ProductId.Primary))\n return false;\n\n if (hasStudentExperience)\n return false;\n\n return true;\n }\n\n function getOriginalVideoAppLink(): Core.AppLink {\n if (!canAccessOriginal())\n return null;\n \n return {\n application: AppChannels.VIDEOS,\n action: Actions.Videos.PLAY_VIDEO,\n args: [\n null,\n props.clip._parentVideo.id,\n TextHelper.slugify(props.clip._parentVideo.name)\n ]\n };\n }\n\n const showPlayerPlaceholder = playerContext.mode === 'picture-in-picture' || props.featureAccess.canViewPublicLayout;\n\n const otherClips = props.clips?.filter(c => c.id.toString() !== props.clip.id.toString()) ?? [];\n\n const calcClassNameProps = {\n hasTheatreMode: props.hasTheatreMode,\n shouldShowSideTableOfContents: props.shouldShowSideTableOfContents,\n tableOfContentsExpanded,\n theatreMode\n };\n const mainClassName = getMainClassName(calcClassNameProps);\n const contentClassName = getContentClassName(calcClassNameProps);\n\n const [ , setContainerClassName ] = useViewModel(ViewModelKeys.PLAY_PAGE_CONTAINER_CLASS_NAME);\n\n const resources = getResources(props.clip, hasPermissions(PermissionName.StudentExperience));\n const downloadableResources = resources.filter(MasterTypeHelper.isResource);\n\n function onDownloadClick() {\n if (downloadableResources.length === 1) {\n DownloadHelper.downloadResource(\n downloadableResources[0],\n { clipId: props.clip.id, clipName: props.clip.name },\n { location: LocationContext.PlayClip, actionType: UserAction.Download, entity: EntityType.Resource }\n );\n return;\n }\n \n Core.AppLinkHelper.trigger({\n application: AppChannels.VIDEOS,\n action: Actions.Videos.RESOURCE_DOWNLOAD,\n args: [ props.clip?.id, props.shareId ]\n });\n }\n \n React.useEffect(() => {\n if (!theatreMode) {\n setContainerClassName('');\n } else {\n setContainerClassName(styles.theatreModePlayPageContainer);\n }\n }, [theatreMode]);\n\n React.useEffect(() => {\n return () => setContainerClassName('');\n }, []);\n\n return (\n <div className={`px-4 play-page-sections-container ${props.shouldShowSideTableOfContents ? 'row g-0' : ''}`}>\n <main className={`${styles.main} ${mainClassName}`}>\n {!!props.breadcrumbs?.length && (\n <div className='mb-2'>\n <Breadcrumbs breadcrumbs={props.breadcrumbs} />\n </div>\n )}\n\n <RestrictionBanner\n restrictions={props.clip._restrictions}\n yearGroups={props.commonVideoProps.yearGroups}\n objectId={props.clip.id}\n objectTypeId={MasterType.Clip}\n canManageVideoAccess={props.canManageVideoAccess}\n />\n\n {isArchived && (\n <ArchivedBanner\n typeId={props.clip.typeId}\n hasStudentExperience={hasStudentExperience}\n />\n )}\n\n <section\n id={PlayPageAnchor.Video}\n className={`mb-2 ${SeoConstants.GLOBAL_PLAYER_SELECTOR}`}\n ref={el => { (el && headingRef?.current) && headingRef.current.set(PlayPageAnchor.Video, el); }}\n >\n {canConsume && (\n <GlobalPlayerConsumer\n key={props.clip.id}\n objectId={props.clip.id}\n objectTypeId={props.clip.typeId}\n shareId={props.shareId}\n context={props.queryParams?.context}\n contextId={props.queryParams?.contextId}\n moviesAndTv={props.queryParams?.mtv}\n playNext={props.queryParams?.playNext}\n startTime={props.queryParams?.t ?? props.queryParams?.startTime}\n mode='default'\n location='play-page'\n />\n )}\n\n <div className={showPlayerPlaceholder ? '' : 'd-none'}>\n <PlayerPlaceholder\n video={props.clip}\n type='pip'\n />\n </div>\n </section>\n\n <div className={contentClassName}>\n <div className={shouldUseTheareModeStyle ? `${styles.theatreModeLeftContent}` : 'w-100'}>\n <PlayPageTitleAndActions\n presentationSlug={null}\n media={props.clip}\n yearGroups={props.commonVideoProps.yearGroups}\n audiences={props.audiences}\n originalVideoAppLink={getOriginalVideoAppLink()}\n featureAccess={props.featureAccess}\n shareId={props.shareId}\n showTitlePadlock={!props.commonVideoProps.hasStudentExperience\n && !props.commonVideoProps.hasGuestExperience}\n />\n\n {/* if no glance render video details here */}\n {hasGlance ? (\n <VideoAtAGlanceV2\n video={props.clip}\n pointsOfInterest={props.pointsOfInterest}\n setStartTime={(time: number) => playerContext.playerRef.current?.currentTime(time)}\n getTagAppLink={tag => ({\n application: AppChannels.SEARCH,\n action: Actions.Search.HOME,\n params: { tagOrClassification: tag.name }\n })}\n suppressInteractivity={props.featureAccess.canViewPublicLayout}\n canViewGlance={hasGlance}\n />\n ) : (\n <VideoDetailsWithScrollbarV2\n video={props.clip}\n currentUser={props.currentUser}\n onLaunchImmersiveReader={onLaunchImmersiveReader}\n onExitImmersiveReader={onExitImmersiveReader}\n getTagAppLink={tag => ({\n application: AppChannels.SEARCH,\n action: Actions.Search.HOME,\n params: { tagOrClassification: tag.name }\n })}\n headingRef={headingRef}\n suppressInteractivity={props.featureAccess.canViewPublicLayout}\n getLibraryAppLink={getLibraryAppLink}\n getFolderAppLink={getFolderAppLink}\n />\n )}\n\n <PlayPageResources\n video={props.clip}\n canViewResources={props.featureAccess.canViewResourceItems}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n getAppLink={clipResourceAppLink}\n analyticsData={{ clipId: props.clip.id, clipName: props.clip.name }}\n resourceThumbnailFallbackUrl={ImageUrls.Fallbacks.RESOURCE_THUMBNAIL}\n headingRef={headingRef}\n onDownloadClick={onDownloadClick}\n resources={resources}\n downloadableResources={downloadableResources}\n aboutResourcesAppLink={VideoAppLinkHelper.getAboutResourceAppLink()}\n />\n\n <PlayPageInteractives\n presentationSlug={null}\n video={props.clip}\n interactives={props.interactives}\n analyticsData={{ clipId: props.clip.id, clipName: props.clip.name }}\n canViewInteractives={props.featureAccess.canViewInteractives}\n headingRef={headingRef}\n commonVideoProps={props.commonVideoProps}\n />\n\n <PlayPageClips\n presentationSlug={null}\n clips={otherClips || []}\n video={props.clip}\n canViewClips={props.featureAccess.canViewClips}\n audiences={props.audiences}\n headingRef={headingRef}\n analyticsData={{ clipId: props.clip.id, clipName: props.clip.name }}\n commonVideoProps={props.commonVideoProps}\n />\n\n {/* if has glance, render video details here */}\n {hasGlance && (\n <VideoDetailsWithScrollbarV2\n video={props.clip}\n currentUser={props.currentUser}\n onLaunchImmersiveReader={onLaunchImmersiveReader}\n onExitImmersiveReader={onExitImmersiveReader}\n getTagAppLink={tag => ({\n application: AppChannels.SEARCH,\n action: Actions.Search.HOME,\n params: { tagOrClassification: tag.name }\n })}\n headingRef={headingRef}\n suppressInteractivity={props.featureAccess.canViewPublicLayout}\n showHeading\n getLibraryAppLink={hasPermissions(PermissionName.ViewLibraries) ? getLibraryAppLink : null}\n getFolderAppLink={hasPermissions(PermissionName.ViewLibraries) ? getFolderAppLink : null}\n />\n )}\n \n {!!canAccessOriginal() && (\n <ClippedFrom\n originalVideo={props.clip._parentVideo}\n shareId={props.shareId}\n queryParams={props.queryParams}\n audiences={props.audiences}\n headingRef={headingRef}\n currentUser={props.currentUser}\n commonVideoProps={props.commonVideoProps}\n />\n )}\n\n {!VideoHelper.isUgc(props.clip._parentVideo) && (\n <CitationWidget\n headingRef={headingRef}\n media={props.clip}\n parentVideo={props.clip._parentVideo}\n contentRegion={props.currentUser.contentRegion}\n shareId={props.shareId}\n presentationSlug={null}\n />\n )}\n\n <RelatedVideos\n presentationSlug={null}\n currentVideo={props.clip}\n relatedVideos={props.relatedVideos}\n currentUser={props.currentUser}\n audiences={props.audiences}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareId,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n moviesAndTv={props.queryParams.mtv}\n commonVideoProps={props.commonVideoProps}\n />\n </div>\n {theatreMode && (\n <TableOfContentsContainer\n isExpanded={tableOfContentsExpanded}\n setIsExpanded={onToggleTableOfContents}\n toggleTheatreMode={ null}\n items={items}\n activeId={tableOfContentsActiveId}\n setControlledId={setControlledId}\n analyticsData={{ videoId: props.clip.id, videoName: props.clip.name }}\n showInSide={props.shouldShowSideTableOfContents}\n isTheatreMode={true}\n hasTranscription={props.hasTheatreMode}\n shouldShow={items.length >= TOC_IGNORE_BOUNDARY}\n />\n )}\n </div>\n </main>\n\n {!theatreMode && (\n <TableOfContentsContainer\n isExpanded={tableOfContentsExpanded}\n setIsExpanded={onToggleTableOfContents}\n toggleTheatreMode={props.hasTheatreMode ? toggleTheatreMode : null}\n items={items}\n activeId={tableOfContentsActiveId}\n setControlledId={setControlledId}\n analyticsData={{ videoId: props.clip.id, videoName: props.clip.name }}\n showInSide={props.shouldShowSideTableOfContents}\n isTheatreMode={false}\n hasTranscription={props.hasTheatreMode}\n shouldShow={items.length >= TOC_IGNORE_BOUNDARY}\n />\n )}\n </div>\n );\n}\n"],"mappings":"wiDAeM,EAAY,kBAYlB,SAAgB,GAAY,EAAyB,CACnD,GAAM,CAAE,kBAAmB,EAAe,EACpC,EAAe,EAAgB,CAAE,SAAU,EAAqB,UAAW,iBAAkB,IAAK,CAAC,EAEzG,OACE,EAAA,EAAA,KAAA,CAAC,UAAD,CACE,UAAU,oBACV,GAAI,EAAe,YACnB,IAAK,GAAM,CACT,GAAO,EAAM,YAAY,SAAY,EAAM,WAAW,QAAQ,IAAI,EAAe,YAAa,CAAE,CAClG,WALF,EAOE,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,oBAAU,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,YAAW,OAAO,aAAe,CAAA,CAAK,CAAA,GAC/E,EAAA,EAAA,IAAA,CAAC,EAAoB,SAArB,CAA8B,MAAO,YACnC,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,OAAQ,CAAC,EAAM,aAAa,EAC5B,iBAAkB,EAAG,IAAS,EAAmB,WAAW,EAAG,CAC7D,GAAG,EACH,QAAS,EAAM,YAAY,QAC3B,UAAW,EAAM,YAAY,UAC7B,SAAU,EAAM,YAAY,SAC5B,QAAS,EAAM,QACf,YAAa,EAAM,YAAY,IAC/B,eAAgB,EAAM,aAAa,eACrC,EAAG,IAAI,EACS,iBAChB,sBAAuB,EAAM,UAC7B,2BAA4B,GAAe,EAAmB,2BAA2B,CAAW,EACpG,iBAAkB,EAAM,gBACzB,CAAA,CAC2B,CAAA,CACvB,GAEb,qREFM,IAAsB,EAAiB,EAAiB,IAC3D,GACM,EAOE,CACL,YAAa,EAAY,OACzB,OAAQ,EAAQ,OAAO,YACvB,KAAM,CAAC,EAAS,EAAE,EAClB,OAAQ,CACG,UACA,SACX,CACF,EAdS,CAC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AAM,KACpB,cAAe,EAAM,cACrB,YAAa,EAAM,YACnB,UAAW,EAAM,UACjB,iBAAkB,EAAG,IAAS,EAAmB,WAAW,EAAG,CAC7D,GAAG,EACH,QAAS,EAAM,YAAY,QAC3B,UAAW,EAAM,YAAY,UAC7B,SAAU,EAAM,YAAY,SAC5B,QAAS,EAAM,QACf,YAAa,EAAM,YAAY,IAC/B,eAAgB,EAAM,aAAa,eACrC,EAAG,IAAI,EACP,YAAa,EAAM,YAAY,IAC/B,iBAAkB,EAAM,gBACzB,CAAA,CACE,IACJ,IACC,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,WAAY,EACZ,cAAe,EACf,kBAAoB,KACb,QACP,SAAU,EACO,kBACjB,cAAe,CAAE,QAAS,EAAM,KAAK,GAAI,UAAW,EAAM,KAAK,IAAK,EACpE,WAAY,EAAM,8BAClB,cAAe,GACf,iBAAkB,EAAM,eACxB,WAAY,EAAM,QAAA,CACnB,CAAA,CAEA,GACD,IAEL,CAAC,IACA,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,WAAY,EACZ,cAAe,EACf,kBAAmB,EAAM,eAAiB,EAAoB,KACvD,QACP,SAAU,EACO,kBACjB,cAAe,CAAE,QAAS,EAAM,KAAK,GAAI,UAAW,EAAM,KAAK,IAAK,EACpE,WAAY,EAAM,8BAClB,cAAe,GACf,iBAAkB,EAAM,eACxB,WAAY,EAAM,QAAA,CACnB,CAAA,CAEA,GAET"}
|
|
1
|
+
{"version":3,"file":"CvilnM0u2.chunk.js","names":[],"sources":["../../src/shared/views/play-clip/components/clipped-from/ClippedFrom.tsx","../../src/shared/views/play-clip/components/play-clip/play-clip.module.scss","../../src/shared/views/play-clip/components/play-clip/PlayClip.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Text } from 'libs/shared/components/text/Text';\nimport { VideoList } from 'libs/shared/components/video-list/VideoList';\nimport { VideoActionsContext } from 'libs/shared/context/VideoActionsContext';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { CurrentUser, PresentationAudience, VideoTypes } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { PlayPageAnchor } from 'libs/shared/interfaces/PlayPageAnchor';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\n\nimport { useVideoActions, VideoActionsLocation } from 'shared/hooks/use-video-actions/useVideoActions';\nimport { InteractiveHelpers } from 'shared/utils/InteractiveHelper';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nconst namespace = 'shared.playClip';\n\ninterface ClippedFromProps {\n originalVideo: VideoTypes;\n queryParams: PlayViewQueryParams;\n audiences: PresentationAudience[];\n shareId?: string;\n headingRef: React.MutableRefObject<Map<PlayPageAnchor, HTMLElement>>;\n currentUser: CurrentUser;\n commonVideoProps: CommonVideoProps;\n}\n\nexport function ClippedFrom(props: ClippedFromProps) {\n const { hasPermissions } = usePermissions();\n const videoActions = useVideoActions({ location: VideoActionsLocation.VideoItem, presentationSlug: null });\n\n return (\n <section\n className='play-page-section'\n id={PlayPageAnchor.ClippedFrom}\n ref={el => {\n (el && props.headingRef?.current) && props.headingRef.current.set(PlayPageAnchor.ClippedFrom, el);\n }}\n >\n <h2 className='h4 mb-0'><Text namespace={namespace} phrase='clippedFrom' /></h2>\n <VideoActionsContext.Provider value={videoActions}>\n <VideoList\n videos={[props.originalVideo]}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareId,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n hasPermissions={hasPermissions}\n presentationAudiences={props.audiences}\n getPreviewQuestionsAppLink={interactive => InteractiveHelpers.getPreviewQuestionsAppLink(interactive)}\n commonVideoProps={props.commonVideoProps}\n />\n </VideoActionsContext.Provider>\n </section>\n );\n}\n","@import '~styles/utils/include-media';\n:local {\n .main.expandedToc {\n width: calc(100% - 15rem); //minus sidebar toc width and margin\n }\n\n .main.theatreMode {\n width: 100% !important;\n }\n\n .theatreModeContent {\n display: flex;\n margin: auto !important;\n\n @include media('<=xl') {\n max-width: 100%;\n }\n }\n\n .theatreModePlayPageContainer {\n //override TeacherLayoutComponent container style\n @media (min-width: 1200px) {\n max-width: none !important;\n }\n }\n\n .theatreModeLeftContent {\n width: calc(100% - 15rem);\n @include media('<=lg') {\n width: 100%;\n }\n }\n}","import React from 'react';\n\nimport { Core } from 'libs/common/core';\nimport { useViewModel } from 'libs/common/react/hooks/UseViewModel';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { EntityType, LocationContext, UserAction } from 'libs/analytics/interfaces';\n\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { VideoDetailsWithScrollbarV2 } from 'libs/shared/components/play-page/details/VideoDetailsV2';\nimport { hasGlanceData } from 'libs/shared/components/play-page/glance/VideoAtAGlanceUtilsV2';\nimport { VideoAtAGlanceV2 } from 'libs/shared/components/play-page/glance/VideoAtAGlanceV2';\nimport { getResources, PlayPageResources } from 'libs/shared/components/play-page/resources-widget/PlayPageResources';\nimport { SeoConstants } from 'libs/shared/constants/SeoConstants';\nimport { GlobalPlayerConsumer } from 'libs/shared/context/player-context/components/GlobalPlayerConsumer';\nimport { usePlayerContext } from 'libs/shared/context/player-context/PlayerContext';\nimport { MasterType } from 'libs/shared/enums/MasterType';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { ProductId } from 'libs/shared/enums/ProductId';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { HasProductFunc } from 'libs/shared/hooks/UseProducts';\nimport { useTableOfContentsActiveHeading } from 'libs/shared/hooks/useTableOfContentsActiveHeading';\nimport { useTableOfContentsScroll } from 'libs/shared/hooks/useTableOfContentsScroll';\nimport { Clip, CurrentUser, InteractiveMetadata, Link, PointOfInterest, PresentationAudience, Resource } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { PlayPageAnchor } from 'libs/shared/interfaces/PlayPageAnchor';\nimport { PlayViewQueryParams } from 'libs/shared/interfaces/query-params/PlayViewQueryParams';\nimport { DownloadHelper } from 'libs/shared/utils/DownloadHelper';\nimport { MasterTypeHelper } from 'libs/shared/utils/MasterTypeHelper';\nimport { VideoHelper } from 'libs/shared/utils/VideoHelper';\n\nimport { CitationWidget } from 'shared/components/citations/CitationWidget';\nimport { ArchivedBanner } from 'shared/components/play-page/ArchivedBanner';\nimport { PlayPageClips } from 'shared/components/play-page/components/play-page-clips/PlayPageClips';\nimport { PlayPageInteractives } from 'shared/components/play-page/components/play-page-interactives/PlayPageInteractives';\nimport { TableOfContentsContainer, TOC_IGNORE_BOUNDARY } from 'shared/components/play-page/components/table-of-contents/TableOfContents';\nimport { PlayPageTitleAndActions } from 'shared/components/play-page/components/title-and-actions/PlayPageTitleAndActions';\nimport { getFolderAppLink, getLibraryAppLink } from 'shared/components/play-page/PlayPageUtils';\nimport { RestrictionBanner } from 'shared/components/play-page/RestrictionBanner';\nimport { PlayerPlaceholder } from 'shared/components/player-placeholder/PlayerPlaceholder';\nimport { RelatedVideos } from 'shared/components/related-videos/RelatedVideos';\nimport { ImageUrls } from 'shared/constants/ImageUrls';\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { ViewModelKeys } from 'shared/constants/LiteViewModels';\nimport { RelatedVideosHash } from 'shared/hooks/useGetRelatedVideos';\nimport { VideoFeaturesHash } from 'shared/hooks/useVideoFeatureAccess';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\nimport { useResourcePopup } from 'shared/views/play/components/play-page/hooks/useResourcePopup';\nimport { getContentClassName, getIsTheatreMode, getMainClassName } from 'shared/views/play/components/play-page/PlayPageUtils';\nimport { usePlayPageTableOfContent } from 'shared/views/play/hooks/usePlayPageTableOfContent';\nimport { useSectionHeadings } from 'shared/views/play/hooks/useSectionHeadings';\nimport { useTheatreModeStyle } from 'shared/views/play/hooks/useTheatreStyle';\nimport { PlayPageUtils } from 'shared/views/play/PlayPageUtil';\nimport { ClippedFrom } from 'shared/views/play-clip/components/clipped-from/ClippedFrom';\n\nimport styles from './play-clip.module.scss';\n\nconst getResourceAppLink = (videoId: string, shareId: string, canViewResource: boolean) =>\n (resource: Resource | Link) => {\n if (!canViewResource) {\n return {\n application: AppChannels.SIGN_UP,\n action: Actions.SignUp.SIGN_UP\n };\n }\n\n return {\n application: AppChannels.VIDEOS,\n action: Actions.Videos.PREVIEW_PDF,\n args: [resource.id],\n params: {\n videoId: videoId,\n shareId: shareId\n }\n };\n };\n\ninterface PlayClipProps {\n clip: Clip;\n clips: Clip[];\n interactives: InteractiveMetadata[];\n currentUser: CurrentUser;\n relatedVideos: RelatedVideosHash;\n queryParams: PlayViewQueryParams;\n hasProduct: HasProductFunc;\n audiences: PresentationAudience[];\n shareId?: string;\n canManageVideoAccess: boolean;\n pointsOfInterest?: PointOfInterest[];\n featureAccess: VideoFeaturesHash;\n tableOfContentsId: string;\n shouldShowSideTableOfContents: boolean;\n hasTopicDirectories: boolean;\n hasTheatreMode: boolean;\n breadcrumbs?: Breadcrumb[];\n commonVideoProps: CommonVideoProps;\n}\n\nexport function PlayClip(props: PlayClipProps): JSX.Element {\n const playerContext = usePlayerContext();\n\n const { hasPermissions } = usePermissions();\n const { canConsume } = VideoHelper.getCanBeConsumed(props.clip);\n \n const theatreMode = getIsTheatreMode(props.hasTheatreMode, playerContext);\n const shouldUseTheareModeStyle = useTheatreModeStyle(\n props.hasTheatreMode,\n playerContext.mode,\n playerContext.defaultDisplayMode\n );\n\n function toggleTheatreMode(value: boolean) {\n playerContext.playerRef?.current?.toggleTheatreMode?.(value);\n }\n\n const {\n tableOfContentsActiveId,\n setTableOfContentsActiveId,\n controlledId,\n setControlledId,\n tableOfContentsExpanded,\n onToggleTableOfContents\n } = usePlayPageTableOfContent(props.tableOfContentsId, props.hasTheatreMode, theatreMode);\n\n const hasGlance = hasGlanceData(props.clip) && props.featureAccess.canViewGlance;\n\n const { headingRef, headingElements } = useSectionHeadings(hasGlance);\n const items = headingElements.map(ele => {\n return {\n id: ele.id as PlayPageAnchor,\n name: PlayPageUtils.getSectionHeading(\n ele.id as PlayPageAnchor,\n {\n clips: props.clips,\n interactives: props.interactives,\n resources: props.clip.resources?.data,\n isPlayClipPage: true\n }\n )\n };\n });\n\n useTableOfContentsActiveHeading({\n setActiveId: setTableOfContentsActiveId,\n headingElements,\n controlledId,\n setControlledId\n });\n\n useTableOfContentsScroll(headingElements, controlledId);\n\n const isArchived = VideoHelper.isVideoTypeArchived(props.clip);\n const hasStudentExperience = hasPermissions(PermissionName.StudentExperience);\n /**\n * Need to use a ref because if we use state, onExitImmersiveReader will have a stale\n * reference of the state. This is because the state is changed in onLaunchImmersiveReader\n * which is passed in at the same time as onExitImmersiveReader\n */\n const shouldPlayOnExitImmersiveReader = React.useRef(false);\n\n const clipResourceAppLink = getResourceAppLink(\n props.clip.id,\n props.shareId,\n props.featureAccess.canViewResourceItems\n );\n\n useResourcePopup({\n resourcePopupId: props.queryParams?.resourceId,\n resources: props.clip.resources?.data,\n getResourceAppLink: clipResourceAppLink\n });\n\n function onLaunchImmersiveReader(): void {\n shouldPlayOnExitImmersiveReader.current = !playerContext?.playerRef?.current?.isPaused();\n playerContext?.playerRef?.current?.pause();\n }\n\n function onExitImmersiveReader(): void {\n if (!shouldPlayOnExitImmersiveReader.current)\n return;\n\n playerContext?.playerRef?.current?.play();\n }\n\n function canAccessOriginal(): boolean {\n if (!props.clip._parentVideo || !props.clip._canBeConsumed?.value)\n return false;\n\n if (!props.currentUser?.isAuthenticated)\n return false;\n\n if (!props.hasProduct(ProductId.Primary))\n return false;\n\n if (hasStudentExperience)\n return false;\n\n return true;\n }\n\n function getOriginalVideoAppLink(): Core.AppLink {\n if (!canAccessOriginal())\n return null;\n \n return {\n application: AppChannels.VIDEOS,\n action: Actions.Videos.PLAY_VIDEO,\n args: [\n null,\n props.clip._parentVideo.id,\n TextHelper.slugify(props.clip._parentVideo.name)\n ]\n };\n }\n\n const showPlayerPlaceholder = playerContext.mode === 'picture-in-picture' || props.featureAccess.canViewPublicLayout;\n\n const otherClips = props.clips?.filter(c => c.id.toString() !== props.clip.id.toString()) ?? [];\n\n const calcClassNameProps = {\n hasTheatreMode: props.hasTheatreMode,\n shouldShowSideTableOfContents: props.shouldShowSideTableOfContents,\n tableOfContentsExpanded,\n theatreMode\n };\n const mainClassName = getMainClassName(calcClassNameProps);\n const contentClassName = getContentClassName(calcClassNameProps);\n\n const [ , setContainerClassName ] = useViewModel(ViewModelKeys.PLAY_PAGE_CONTAINER_CLASS_NAME);\n\n const resources = getResources(props.clip, hasPermissions(PermissionName.StudentExperience));\n const downloadableResources = resources.filter(MasterTypeHelper.isResource);\n\n function onDownloadClick() {\n if (downloadableResources.length === 1) {\n DownloadHelper.downloadResource(\n downloadableResources[0],\n { clipId: props.clip.id, clipName: props.clip.name },\n { location: LocationContext.PlayClip, actionType: UserAction.Download, entity: EntityType.Resource }\n );\n return;\n }\n \n Core.AppLinkHelper.trigger({\n application: AppChannels.VIDEOS,\n action: Actions.Videos.RESOURCE_DOWNLOAD,\n args: [ props.clip?.id, props.shareId ]\n });\n }\n \n React.useEffect(() => {\n if (!theatreMode) {\n setContainerClassName('');\n } else {\n setContainerClassName(styles.theatreModePlayPageContainer);\n }\n }, [theatreMode]);\n\n React.useEffect(() => {\n return () => setContainerClassName('');\n }, []);\n\n return (\n <div className={`px-4 play-page-sections-container ${props.shouldShowSideTableOfContents ? 'row g-0' : ''}`}>\n <main className={`${styles.main} ${mainClassName}`}>\n {!!props.breadcrumbs?.length && (\n <div className='mb-2'>\n <Breadcrumbs breadcrumbs={props.breadcrumbs} />\n </div>\n )}\n\n <RestrictionBanner\n restrictions={props.clip._restrictions}\n yearGroups={props.commonVideoProps.yearGroups}\n objectId={props.clip.id}\n objectTypeId={MasterType.Clip}\n canManageVideoAccess={props.canManageVideoAccess}\n />\n\n {isArchived && (\n <ArchivedBanner\n typeId={props.clip.typeId}\n hasStudentExperience={hasStudentExperience}\n />\n )}\n\n <section\n id={PlayPageAnchor.Video}\n className={`mb-2 ${SeoConstants.GLOBAL_PLAYER_SELECTOR}`}\n ref={el => { (el && headingRef?.current) && headingRef.current.set(PlayPageAnchor.Video, el); }}\n >\n {canConsume && (\n <GlobalPlayerConsumer\n key={props.clip.id}\n objectId={props.clip.id}\n objectTypeId={props.clip.typeId}\n shareId={props.shareId}\n context={props.queryParams?.context}\n contextId={props.queryParams?.contextId}\n moviesAndTv={props.queryParams?.mtv}\n playNext={props.queryParams?.playNext}\n startTime={props.queryParams?.t ?? props.queryParams?.startTime}\n mode='default'\n location='play-page'\n />\n )}\n\n <div className={showPlayerPlaceholder ? '' : 'd-none'}>\n <PlayerPlaceholder\n video={props.clip}\n type='pip'\n />\n </div>\n </section>\n\n <div className={contentClassName}>\n <div className={shouldUseTheareModeStyle ? `${styles.theatreModeLeftContent}` : 'w-100'}>\n <PlayPageTitleAndActions\n presentationSlug={null}\n media={props.clip}\n yearGroups={props.commonVideoProps.yearGroups}\n audiences={props.audiences}\n originalVideoAppLink={getOriginalVideoAppLink()}\n featureAccess={props.featureAccess}\n shareId={props.shareId}\n showTitlePadlock={!props.commonVideoProps.hasStudentExperience\n && !props.commonVideoProps.hasGuestExperience}\n />\n\n {/* if no glance render video details here */}\n {hasGlance ? (\n <VideoAtAGlanceV2\n video={props.clip}\n pointsOfInterest={props.pointsOfInterest}\n setStartTime={(time: number) => playerContext.playerRef.current?.currentTime(time)}\n getTagAppLink={tag => ({\n application: AppChannels.SEARCH,\n action: Actions.Search.HOME,\n params: { tagOrClassification: tag.name }\n })}\n suppressInteractivity={props.featureAccess.canViewPublicLayout}\n canViewGlance={hasGlance}\n />\n ) : (\n <VideoDetailsWithScrollbarV2\n video={props.clip}\n currentUser={props.currentUser}\n onLaunchImmersiveReader={onLaunchImmersiveReader}\n onExitImmersiveReader={onExitImmersiveReader}\n getTagAppLink={tag => ({\n application: AppChannels.SEARCH,\n action: Actions.Search.HOME,\n params: { tagOrClassification: tag.name }\n })}\n headingRef={headingRef}\n suppressInteractivity={props.featureAccess.canViewPublicLayout}\n getLibraryAppLink={getLibraryAppLink}\n getFolderAppLink={getFolderAppLink}\n />\n )}\n\n <PlayPageResources\n video={props.clip}\n canViewResources={props.featureAccess.canViewResourceItems}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n getAppLink={clipResourceAppLink}\n analyticsData={{ clipId: props.clip.id, clipName: props.clip.name }}\n resourceThumbnailFallbackUrl={ImageUrls.Fallbacks.RESOURCE_THUMBNAIL}\n headingRef={headingRef}\n onDownloadClick={onDownloadClick}\n resources={resources}\n downloadableResources={downloadableResources}\n aboutResourcesAppLink={VideoAppLinkHelper.getAboutResourceAppLink()}\n />\n\n <PlayPageInteractives\n presentationSlug={null}\n video={props.clip}\n interactives={props.interactives}\n analyticsData={{ clipId: props.clip.id, clipName: props.clip.name }}\n canViewInteractives={props.featureAccess.canViewInteractives}\n headingRef={headingRef}\n commonVideoProps={props.commonVideoProps}\n />\n\n <PlayPageClips\n presentationSlug={null}\n clips={otherClips || []}\n video={props.clip}\n canViewClips={props.featureAccess.canViewClips}\n audiences={props.audiences}\n headingRef={headingRef}\n analyticsData={{ clipId: props.clip.id, clipName: props.clip.name }}\n commonVideoProps={props.commonVideoProps}\n />\n\n {/* if has glance, render video details here */}\n {hasGlance && (\n <VideoDetailsWithScrollbarV2\n video={props.clip}\n currentUser={props.currentUser}\n onLaunchImmersiveReader={onLaunchImmersiveReader}\n onExitImmersiveReader={onExitImmersiveReader}\n getTagAppLink={tag => ({\n application: AppChannels.SEARCH,\n action: Actions.Search.HOME,\n params: { tagOrClassification: tag.name }\n })}\n headingRef={headingRef}\n suppressInteractivity={props.featureAccess.canViewPublicLayout}\n showHeading\n getLibraryAppLink={hasPermissions(PermissionName.ViewLibraries) ? getLibraryAppLink : null}\n getFolderAppLink={hasPermissions(PermissionName.ViewLibraries) ? getFolderAppLink : null}\n />\n )}\n \n {!!canAccessOriginal() && (\n <ClippedFrom\n originalVideo={props.clip._parentVideo}\n shareId={props.shareId}\n queryParams={props.queryParams}\n audiences={props.audiences}\n headingRef={headingRef}\n currentUser={props.currentUser}\n commonVideoProps={props.commonVideoProps}\n />\n )}\n\n {!VideoHelper.isUgc(props.clip._parentVideo) && (\n <CitationWidget\n headingRef={headingRef}\n media={props.clip}\n parentVideo={props.clip._parentVideo}\n contentRegion={props.currentUser.contentRegion}\n shareId={props.shareId}\n presentationSlug={null}\n />\n )}\n\n <RelatedVideos\n presentationSlug={null}\n currentVideo={props.clip}\n relatedVideos={props.relatedVideos}\n currentUser={props.currentUser}\n audiences={props.audiences}\n getVideoAppLink={(v, opts) => VideoAppLinkHelper.getAppLink(v, {\n ...opts,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n playNext: props.queryParams.playNext,\n shareId: props.shareId,\n moviesAndTv: props.queryParams.mtv,\n includeContext: props.currentUser?.isAuthenticated\n }, null)}\n moviesAndTv={props.queryParams.mtv}\n commonVideoProps={props.commonVideoProps}\n />\n </div>\n {theatreMode && (\n <TableOfContentsContainer\n isExpanded={tableOfContentsExpanded}\n setIsExpanded={onToggleTableOfContents}\n toggleTheatreMode={ null}\n items={items}\n activeId={tableOfContentsActiveId}\n setControlledId={setControlledId}\n analyticsData={{ videoId: props.clip.id, videoName: props.clip.name }}\n showInSide={props.shouldShowSideTableOfContents}\n isTheatreMode={true}\n hasTranscription={props.hasTheatreMode}\n shouldShow={items.length >= TOC_IGNORE_BOUNDARY}\n />\n )}\n </div>\n </main>\n\n {!theatreMode && (\n <TableOfContentsContainer\n isExpanded={tableOfContentsExpanded}\n setIsExpanded={onToggleTableOfContents}\n toggleTheatreMode={props.hasTheatreMode ? toggleTheatreMode : null}\n items={items}\n activeId={tableOfContentsActiveId}\n setControlledId={setControlledId}\n analyticsData={{ videoId: props.clip.id, videoName: props.clip.name }}\n showInSide={props.shouldShowSideTableOfContents}\n isTheatreMode={false}\n hasTranscription={props.hasTheatreMode}\n shouldShow={items.length >= TOC_IGNORE_BOUNDARY}\n />\n )}\n </div>\n );\n}\n"],"mappings":"wiDAeM,EAAY,kBAYlB,SAAgB,GAAY,EAAyB,CACnD,GAAM,CAAE,kBAAmB,EAAe,EACpC,EAAe,EAAgB,CAAE,SAAU,EAAqB,UAAW,iBAAkB,IAAK,CAAC,EAEzG,OACE,EAAA,EAAA,KAAA,CAAC,UAAD,CACE,UAAU,oBACV,GAAI,EAAe,YACnB,IAAK,GAAM,CACT,GAAO,EAAM,YAAY,SAAY,EAAM,WAAW,QAAQ,IAAI,EAAe,YAAa,CAAE,CAClG,WALF,EAOE,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,oBAAU,EAAA,EAAA,IAAA,CAAC,EAAD,CAAiB,YAAW,OAAO,aAAe,CAAA,CAAK,CAAA,GAC/E,EAAA,EAAA,IAAA,CAAC,EAAoB,SAArB,CAA8B,MAAO,YACnC,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,OAAQ,CAAC,EAAM,aAAa,EAC5B,iBAAkB,EAAG,IAAS,EAAmB,WAAW,EAAG,CAC7D,GAAG,EACH,QAAS,EAAM,YAAY,QAC3B,UAAW,EAAM,YAAY,UAC7B,SAAU,EAAM,YAAY,SAC5B,QAAS,EAAM,QACf,YAAa,EAAM,YAAY,IAC/B,eAAgB,EAAM,aAAa,eACrC,EAAG,IAAI,EACS,iBAChB,sBAAuB,EAAM,UAC7B,2BAA4B,GAAe,EAAmB,2BAA2B,CAAW,EACpG,iBAAkB,EAAM,gBACzB,CAAA,CAC2B,CAAA,CACvB,GAEb,qREFM,IAAsB,EAAiB,EAAiB,IAC3D,GACM,EAOE,CACL,YAAa,EAAY,OACzB,OAAQ,EAAQ,OAAO,YACvB,KAAM,CAAC,EAAS,EAAE,EAClB,OAAQ,CAC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ACE,iBAAkB,KAClB,aAAc,EAAM,KACpB,cAAe,EAAM,cACrB,YAAa,EAAM,YACnB,UAAW,EAAM,UACjB,iBAAkB,EAAG,IAAS,EAAmB,WAAW,EAAG,CAC7D,GAAG,EACH,QAAS,EAAM,YAAY,QAC3B,UAAW,EAAM,YAAY,UAC7B,SAAU,EAAM,YAAY,SAC5B,QAAS,EAAM,QACf,YAAa,EAAM,YAAY,IAC/B,eAAgB,EAAM,aAAa,eACrC,EAAG,IAAI,EACP,YAAa,EAAM,YAAY,IAC/B,iBAAkB,EAAM,gBACzB,CAAA,CACE,IACJ,IACC,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,WAAY,EACZ,cAAe,EACf,kBAAoB,KACb,QACP,SAAU,EACO,kBACjB,cAAe,CAAE,QAAS,EAAM,KAAK,GAAI,UAAW,EAAM,KAAK,IAAK,EACpE,WAAY,EAAM,8BAClB,cAAe,GACf,iBAAkB,EAAM,eACxB,WAAY,EAAM,QAAA,CACnB,CAAA,CAEA,GACD,IAEL,CAAC,IACA,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,WAAY,EACZ,cAAe,EACf,kBAAmB,EAAM,eAAiB,EAAoB,KACvD,QACP,SAAU,EACO,kBACjB,cAAe,CAAE,QAAS,EAAM,KAAK,GAAI,UAAW,EAAM,KAAK,IAAK,EACpE,WAAY,EAAM,8BAClB,cAAe,GACf,iBAAkB,EAAM,eACxB,WAAY,EAAM,QAAA,CACnB,CAAA,CAEA,GAET"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./DAXXjFlN.chunk.js";import{n as e}from"./B785hxeE.chunk.js";import{t}from"./C2w0pmFW.chunk.js";import{t as n}from"./wrLrTezN.chunk.js";import{u as r}from"./BX0wDJmp.chunk.js";import{y as i}from"./NlCAcBdo.chunk.js";import{t as a}from"./xwiwWcv12.chunk.js";import{t as o}from"./CVHQXNzi2.chunk.js";import{t as s}from"./BC8PeYqm.chunk.js";import{t as c}from"./CqrjHjAN.chunk.js";import{t as l}from"./D_gWf2lC.chunk.js";import{t as u}from"./DruDe9vI.chunk.js";import{n as d,t as f}from"./C6-aC3vu.chunk.js";import{n as p,t as m}from"./BGhJ8TEx.chunk.js";import{t as h}from"./7LGxCHGV.chunk.js";import{t as g}from"./B3gsVN-_.chunk.js";import{r as _}from"./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import"./DAXXjFlN.chunk.js";import{n as e}from"./B785hxeE.chunk.js";import{t}from"./C2w0pmFW.chunk.js";import{t as n}from"./wrLrTezN.chunk.js";import{u as r}from"./BX0wDJmp.chunk.js";import{y as i}from"./NlCAcBdo.chunk.js";import{t as a}from"./xwiwWcv12.chunk.js";import{t as o}from"./CVHQXNzi2.chunk.js";import{t as s}from"./BC8PeYqm.chunk.js";import{t as c}from"./CqrjHjAN.chunk.js";import{t as l}from"./D_gWf2lC.chunk.js";import{t as u}from"./DruDe9vI.chunk.js";import{n as d,t as f}from"./C6-aC3vu.chunk.js";import{n as p,t as m}from"./BGhJ8TEx.chunk.js";import{t as h}from"./7LGxCHGV.chunk.js";import{t as g}from"./B3gsVN-_.chunk.js";import{r as _}from"./CLvImDXv2.chunk.js";import{n as v,t as y}from"./CdI1ZlaQ.chunk.js";import{t as b}from"./CpKc1O_Y.chunk.js";import{n as x}from"./ChnNWPOK2.chunk.js";import{t as S}from"./C9XBZFiR.chunk.js";import{t as C}from"./BnuuRu_J2.chunk.js";import{t as w}from"./BYaCUOEW2.chunk.js";import{t as T}from"./DNuJUXpr2.chunk.js";import{t as E}from"./DJXt6rKd2.chunk.js";import{n as D,r as O,t as k}from"./0mx04bmJ2.chunk.js";t();var A=n(),j={notFound:v,forbidden:{privacy:b}};function M(e){return e?._parentClip||e?._parentVideo}function N(t){let{hasPermissions:n}=g(),v=r(l.config()),N=r(c.token()),P=r(c.currentUser()),F=r(s.sharedInteractiveMetadata(t.objectId,t.shareId)),I=r(u.getShareObject(t.shareId)),L=r(I.data&&(I.data.objectTypeId===o.Interactive?m.createViewKey(t.shareId,p.Share):m.createViewKey(t.objectId,p.MasterObject,t.shareId))),R=w(),z=r(P.data?.isAuthenticated&&a.yearGroups(P.data.customerId)),B=O(I.data),V=r(B&&F.data&&s.interactive(F.data.interactiveId)),H=r(B&&F.data&&s.videoInteractives(M(F.data).id)),{commonVideoProps:U,hasCommonVideoPropsCompleted:W}=C({locationContext:B?i.PreviewSharedInteractive:i.PlaySharedInteractive}),G=_({video:F.data,context:t.queryParams.context,contextId:t.queryParams.contextId,moviesAndTv:t.queryParams.mtv,currentUser:P.data});S(F,j),h(F,{private:b}),x({id:t.objectId,app:`interactives`,shareId:t.shareId}),T(G.videos??[]),f(d.getInteractiveMetadata({content:F.data}));let K=F.data&&v.hasCompleted&&P.hasCompleted&&(!B||V.hasCompleted)&&I.hasCompleted&&L.hasCompleted&&N.hasCompleted&&W;return B?K?(0,A.jsx)(k,{currentUser:P.data,queryParams:t.queryParams,interactive:F.data,interactives:H.data?.data,isPreviewPreventScrubbingEnabled:V.data.preventScrubbing,audiences:R.data,relatedVideos:G,canManageVideoAccess:n(e.ManageVideoAccess),commonVideoProps:U}):(0,A.jsx)(E,{}):K?(0,A.jsx)(D,{interactive:F.data,currentUser:P.data,config:v.data,audiences:R.data,yearGroups:z.data,queryParams:t.queryParams,viewKey:L.data,relatedVideos:G,shareLink:I.data,startTime:t.queryParams?.t,token:N.data,collectAnonResults:!P.data?.isAuthenticated&&!!y.getAnonUser(t.shareId),commonVideoProps:U}):(0,A.jsx)(A.Fragment,{})}export{N as SharedInteractiveView};
|
|
2
|
+
//# sourceMappingURL=Cwocc8uV.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"Cwocc8uV.chunk.js","names":[],"sources":["../../src/apps/share/views/shared-interactive/SharedInteractiveView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Flight } from 'libs/common/flight';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { ShareRequests } from 'libs/shared/apps/share/flight-requests/ShareRequests';\nimport { MasterType } from 'libs/shared/enums/MasterType';\nimport { MediaIdType } from 'libs/shared/enums/MediaIdType';\nimport { PermissionName } from 'libs/shared/enums/PermissionName';\nimport { ConfigRequests } from 'libs/shared/flight-requests/ConfigRequests';\nimport { CustomerRequests } from 'libs/shared/flight-requests/CustomerRequests';\nimport { InteractiveRequests } from 'libs/shared/flight-requests/InteractiveRequests';\nimport { PlayerRequests } from 'libs/shared/flight-requests/PlayerRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useCannotConsumeError } from 'libs/shared/hooks/useCannotConsumeError';\nimport { useHandleObjectError } from 'libs/shared/hooks/UseHandleObjectError';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { Clip, Config, CurrentUser, Interactive, InteractiveCollection, InteractiveMetadata, PlayerViewKey, UnionShareObject, Video, YearGroup } from 'libs/shared/interfaces';\nimport { AuthToken } from 'libs/shared/interfaces/models/AuthToken';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useDeepLinks } from 'shared/hooks/useDeepLinks';\nimport { useGetRelatedVideos } from 'shared/hooks/useGetRelatedVideos';\nimport { usePresentationAudiences } from 'shared/hooks/usePresentationAudiences';\nimport { useShouldPreviewInteractive } from 'shared/hooks/useShouldPreviewInteractive';\nimport { useVideoMixin } from 'shared/hooks/useVideoMixin';\n\nimport { InteractivePartialLoading } from 'apps/interactives/components/interactive-partial-loading/InteractivePartialLoading';\nimport { PlayInteractive } from 'apps/interactives/components/play-interactive/PlayInteractive';\nimport { PreviewInteractive } from 'apps/interactives/components/preview-interactive/PreviewInteractive';\nimport { ShareLinkNotFoundError } from 'apps/share/errors/share-link-not-found/ShareLinkNotFoundError';\nimport { ShareLinkPrivateError } from 'apps/share/errors/share-link-private/ShareLinkPrivateError';\nimport { ShareLinkFilterHelpers } from 'apps/share/filters/share-link-filter/ShareLinkFilterHelpers';\nimport { ShareLinkViewProps } from 'apps/share/interfaces/ShareLinkViewProps';\n\nconst videoErrors = {\n notFound: ShareLinkNotFoundError,\n forbidden: {\n privacy: ShareLinkPrivateError\n }\n};\n\nfunction getSourceVideo(interactive: InteractiveMetadata): Clip | Video {\n return interactive?._parentClip || interactive?._parentVideo;\n}\n\nexport function SharedInteractiveView(props: ShareLinkViewProps): JSX.Element {\n const { hasPermissions } = usePermissions();\n\n const config = Flight.useBasicFetch<Config>(ConfigRequests.config());\n const token = Flight.useBasicFetch<AuthToken>(UserRequests.token());\n\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const interactiveMetadata = Flight.useBasicFetch<InteractiveMetadata>(\n InteractiveRequests.sharedInteractiveMetadata(props.objectId, props.shareId)\n );\n\n const shareLink = Flight.useBasicFetch<UnionShareObject>(\n ShareRequests.getShareObject(props.shareId)\n );\n\n /**\n * If the shareLink type isn't an interactive, then it's a playlist and needs to be\n * used as context for fetching\n */\n const viewKeyRequest = shareLink.data && (shareLink.data.objectTypeId === MasterType.Interactive ?\n PlayerRequests.createViewKey(props.shareId, MediaIdType.Share) :\n PlayerRequests.createViewKey(props.objectId, MediaIdType.MasterObject, props.shareId));\n const viewKey = Flight.useBasicFetch<PlayerViewKey>(viewKeyRequest);\n const audiences = usePresentationAudiences();\n const yearGroups = Flight.useBasicFetch<YearGroup[]>(\n currentUser.data?.isAuthenticated && CustomerRequests.yearGroups(currentUser.data.customerId)\n );\n\n /**\n * Authenticated staff with Lite product access get the interactive \"Preview\" view instead\n * of the usual play view.\n */\n const shouldPreviewInteractive = useShouldPreviewInteractive(shareLink.data);\n const interactive = Flight.useBasicFetch<Interactive>(\n shouldPreviewInteractive && interactiveMetadata.data &&\n InteractiveRequests.interactive(interactiveMetadata.data.interactiveId)\n );\n const interactives = Flight.useBasicFetch<InteractiveCollection>(\n shouldPreviewInteractive && interactiveMetadata.data &&\n InteractiveRequests.videoInteractives(getSourceVideo(interactiveMetadata.data).id)\n );\n\n const locationContext = shouldPreviewInteractive ?\n LocationContext.PreviewSharedInteractive :\n LocationContext.PlaySharedInteractive;\n const {\n commonVideoProps,\n hasCommonVideoPropsCompleted\n } = useCommonVideoProps({ locationContext });\n\n const relatedVideos = useGetRelatedVideos({\n video: interactiveMetadata.data,\n context: props.queryParams.context,\n contextId: props.queryParams.contextId,\n moviesAndTv: props.queryParams.mtv,\n currentUser: currentUser.data\n });\n\n useHandleObjectError(interactiveMetadata, videoErrors);\n useCannotConsumeError(interactiveMetadata, { private: ShareLinkPrivateError });\n useDeepLinks({ id: props.objectId, app: 'interactives', shareId: props.shareId });\n useVideoMixin(relatedVideos.videos ?? []);\n useSetPageMetadata(PageMetadataHelper.getInteractiveMetadata({ content: interactiveMetadata.data }));\n\n const hasLoaded = (\n interactiveMetadata.data &&\n config.hasCompleted &&\n currentUser.hasCompleted &&\n (!shouldPreviewInteractive || interactive.hasCompleted) &&\n shareLink.hasCompleted &&\n viewKey.hasCompleted &&\n token.hasCompleted &&\n hasCommonVideoPropsCompleted\n );\n\n if (shouldPreviewInteractive) {\n // For staff, the interactive is previewed\n if (!hasLoaded)\n return <InteractivePartialLoading />;\n\n return (\n <PreviewInteractive\n currentUser={currentUser.data}\n queryParams={props.queryParams}\n interactive={interactiveMetadata.data}\n interactives={interactives.data?.data}\n isPreviewPreventScrubbingEnabled={interactive.data.preventScrubbing}\n audiences={audiences.data}\n relatedVideos={relatedVideos}\n canManageVideoAccess={hasPermissions(PermissionName.ManageVideoAccess)}\n commonVideoProps={commonVideoProps}\n />\n );\n }\n\n if (!hasLoaded)\n return <></>;\n\n return (\n <PlayInteractive\n interactive={interactiveMetadata.data}\n currentUser={currentUser.data}\n config={config.data}\n audiences={audiences.data}\n yearGroups={yearGroups.data}\n queryParams={props.queryParams}\n viewKey={viewKey.data}\n relatedVideos={relatedVideos}\n shareLink={shareLink.data}\n startTime={props.queryParams?.t}\n token={token.data}\n collectAnonResults={!currentUser.data?.isAuthenticated && !!ShareLinkFilterHelpers.getAnonUser(props.shareId)}\n commonVideoProps={commonVideoProps}\n />\n );\n}\n"],"mappings":"yjCAsCM,EAAc,CAClB,SAAU,EACV,UAAW,CACT,QAAS,CACX,CACF,EAEA,SAAS,EAAe,EAAgD,CACtE,OAAO,GAAa,aAAe,GAAa,YAClD,CAEA,SAAgB,EAAsB,EAAwC,CAC5E,GAAM,CAAE,kBAAmB,EAAe,EAEpC,EAAS,EAA6B,EAAe,OAAO,CAAC,EAC7D,EAAQ,EAAgC,EAAa,MAAM,CAAC,EAE5D,EAAc,EAAkC,EAAa,YAAY,CAAC,EAC1E,EAAsB,EAC1B,EAAoB,0BAA0B,EAAM,SAAU,EAAM,OAAO,CAC7E,EAEM,EAAY,EAChB,EAAc,eAAe,EAAM,OAAO,CAC5C,EASM,EAAU,EAHO,EAAU,OAAS,EAAU,KAAK,eAAiB,EAAW,YACnF,EAAe,cAAc,EAAM,QAAS,EAAY,KAAK,EAC7D,EAAe,cAAc,EAAM,SAAU,EAAY,aAAc,EAAM,OAAO,EACpB,EAC5D,EAAY,EAAyB,EACrC,EAAa,EACjB,EAAY,MAAM,iBAAmB,EAAiB,WAAW,EAAY,KAAK,UAAU,CAC9F,EAMM,EAA2B,EAA4B,EAAU,IAAI,EACrE,EAAc,EAClB,GAA4B,EAAoB,MAChD,EAAoB,YAAY,EAAoB,KAAK,aAAa,CACxE,EACM,EAAe,EACnB,GAA4B,EAAoB,MAChD,EAAoB,kBAAkB,EAAe,EAAoB,IAAI,CAAC,CAAC,EAAE,CACnF,EAKM,CACJ,mBACA,gCACE,EAAoB,CAAE,gBANF,EACtB,EAAgB,yBAChB,EAAgB,qBAIwB,CAAC,EAErC,EAAgB,EAAoB,CACxC,MAAO,EAAoB,KAC3B,QAAS,EAAM,YAAY,QAC3B,UAAW,EAAM,YAAY,UAC7B,YAAa,EAAM,YAAY,IAC/B,YAAa,EAAY,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