@clickview/lite 0.104.0-rc.6 → 0.104.0-rc.7
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 +181 -180
- package/dist/bundles.json +1 -1
- package/dist/en.json +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/B1hsuVfV2.chunk.js +2 -0
- package/dist/scripts/{BwBWuxjr2.chunk.js.map → B1hsuVfV2.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/{BgPye7Nd2.chunk.js → B338pwKt2.chunk.js} +2 -2
- package/dist/scripts/{BgPye7Nd2.chunk.js.map → B338pwKt2.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/BTWmC6pW.chunk.js +5 -0
- package/dist/scripts/BTWmC6pW.chunk.js.map +1 -0
- 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/{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/Cr6TXzQQ2.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/{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/{app-DxHnJ6f2.js → app-CyGIKC-k.js} +3 -3
- package/dist/scripts/{app-DxHnJ6f2.js.map → app-CyGIKC-k.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/{DhdM2yGm.chunk.js → qRLSbnEr.chunk.js} +2 -2
- package/dist/scripts/{DhdM2yGm.chunk.js.map → qRLSbnEr.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/BwBWuxjr2.chunk.js +0 -2
- 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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pE,CAAC,EAAY,IAAM,CAAC,EAAY,GAElC,EACT,EAEA,gBAAgB,EAAqC,CACnD,OAAQ,EAAR,CACE,KAAK,EAAa,2BAClB,KAAK,EAAa,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
|
+
{"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,sB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n,x as r,y as i}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{t as a}from"./CQyJ7YGa.chunk.js";import{t as o}from"./e57H3T-k.chunk.js";import{t as s}from"./C2w0pmFW.chunk.js";import{t as c}from"./wrLrTezN.chunk.js";import{t as l}from"./BXTI9cmX.chunk.js";import{u}from"./BX0wDJmp.chunk.js";import{t as d}from"./C1SLt-ar.chunk.js";import{y as f}from"./NlCAcBdo.chunk.js";import{r as p}from"./Cr6TXzQQ2.chunk.js";import{n as m,t as h}from"./CmcCVXi32.chunk.js";import{t as g}from"./DGmmTRu72.chunk.js";import{n as _}from"./LoQS6GjP.chunk.js";import{t as v}from"./CqrjHjAN.chunk.js";import{t as y}from"./eoAypzU3.chunk.js";import{t as b}from"./XIE88U01.chunk.js";import{t as x}from"./BJZXCSV9.chunk.js";import{n as S,t as C}from"./C6-aC3vu.chunk.js";import{t as w}from"./B3gsVN-_.chunk.js";import{t as T}from"./B_-pJtOI2.chunk.js";import{t as E}from"./BugRosaL2.chunk.js";import{t as D}from"./DYDxLHiV2.chunk.js";import{n as O}from"./CpFtf-tI2.chunk.js";import{t as k}from"./DBkEQkKm2.chunk.js";import{t as A}from"./CzuHD4Ht.chunk.js";import{t as j}from"./DDJBf9pK2.chunk.js";import{n as M}from"./ChnNWPOK2.chunk.js";import{r as N,t as P}from"./C5uTRLOC2.chunk.js";import{t as F}from"./DewCxv4i.chunk.js";import{t as I}from"./B8gP8YoA.chunk.js";import{t as L}from"./M21xrW6i2.chunk.js";import{t as R}from"./DzgAvoez.chunk.js";import{t as z}from"./BnuuRu_J2.chunk.js";import{n as B,t as V}from"./CY_30Xdt.chunk.js";import{t as H}from"./
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
import{o as e}from"./DAXXjFlN.chunk.js";import{r as t}from"./snXCXfT6.chunk.js";import{_ as n,x as r,y as i}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{t as a}from"./CQyJ7YGa.chunk.js";import{t as o}from"./e57H3T-k.chunk.js";import{t as s}from"./C2w0pmFW.chunk.js";import{t as c}from"./wrLrTezN.chunk.js";import{t as l}from"./BXTI9cmX.chunk.js";import{u}from"./BX0wDJmp.chunk.js";import{t as d}from"./C1SLt-ar.chunk.js";import{y as f}from"./NlCAcBdo.chunk.js";import{r as p}from"./Cr6TXzQQ2.chunk.js";import{n as m,t as h}from"./CmcCVXi32.chunk.js";import{t as g}from"./DGmmTRu72.chunk.js";import{n as _}from"./LoQS6GjP.chunk.js";import{t as v}from"./CqrjHjAN.chunk.js";import{t as y}from"./eoAypzU3.chunk.js";import{t as b}from"./XIE88U01.chunk.js";import{t as x}from"./BJZXCSV9.chunk.js";import{n as S,t as C}from"./C6-aC3vu.chunk.js";import{t as w}from"./B3gsVN-_.chunk.js";import{t as T}from"./B_-pJtOI2.chunk.js";import{t as E}from"./BugRosaL2.chunk.js";import{t as D}from"./DYDxLHiV2.chunk.js";import{n as O}from"./CpFtf-tI2.chunk.js";import{t as k}from"./DBkEQkKm2.chunk.js";import{t as A}from"./CzuHD4Ht.chunk.js";import{t as j}from"./DDJBf9pK2.chunk.js";import{n as M}from"./ChnNWPOK2.chunk.js";import{r as N,t as P}from"./C5uTRLOC2.chunk.js";import{t as F}from"./DewCxv4i.chunk.js";import{t as I}from"./B8gP8YoA.chunk.js";import{t as L}from"./M21xrW6i2.chunk.js";import{t as R}from"./DzgAvoez.chunk.js";import{t as z}from"./BnuuRu_J2.chunk.js";import{n as B,t as V}from"./CY_30Xdt.chunk.js";import{t as H}from"./BTWmC6pW.chunk.js";import{t as U}from"./CC5Dr9aG.chunk.js";import{r as W}from"./yk6K0dmz2.chunk.js";import{t as G}from"./B5GEXNkP2.chunk.js";var K=e(s()),q=c(),J=`moviesAndTv.companyDashboardEmptyState`,Y=a.encloseNamespace(J);function X(e){let n=e.dashboard?.status===h.Archived;return(0,q.jsxs)(x,{children:[(0,q.jsx)(x.Image,{src:e.imageUrl,altText:Y(`info`)}),(0,q.jsx)(x.Heading,{children:(0,q.jsx)(O,{namespace:J,phrase:`heading`})}),(0,q.jsx)(x.Info,{children:(0,q.jsx)(O,{namespace:J,phrase:`info`})}),(0,q.jsx)(t,{title:n?a.getPhrase(J,`archivedCtaTooltip`):``,spanHack:!0,children:(0,q.jsx)(x.Cta,{text:a.getPhrase(J,`add`),appLink:e.addWidgetApplink?.(),className:`btn btn-dark`,icon:j,disabled:n})})]})}function Z(e){let t=d.sortBy(e.dashboard?.widgets,`index`);function n(t,n,r){let i=p.getWidgetParams(n,r,p.getDashboardTargetType(e.dashboard));return e.getWidgetContentRequest(t,i,r)}let r=e.isReadonly&&!t?.length;return(0,q.jsxs)(q.Fragment,{children:[!!t.length&&(0,q.jsxs)(q.Fragment,{children:[e.company?(0,q.jsx)(V,{heading:e.company.name,banner:e.company.banner,imageCdnUrl:e.commonVideoProps.imageCdnUrl,blockColourClass:P(e.company.name,N),actions:e.getBannerActions?.(),actionsDropdownClassName:`btn btn-outline-dark`}):(0,q.jsx)(B,{}),(0,q.jsx)(`div`,{className:`py-3 mb-3 border-bottom`,children:(0,q.jsx)(R,{breadcrumbs:e.getBreadcrumbs?.()})}),(0,q.jsx)(`div`,{className:`mt-3`,children:t.map(t=>(0,q.jsx)(H,{widgetCollection:m.Company,dashboardTarget:m.Company,id:t.id,getContentRequest:n,audiences:e.audiences,name:t.name,description:t.description,templateId:t.templateId,metadata:t.metadata,appLinks:e.widgetAppLinks,isScrollToTargetWidget:e?.scrollToWidgetId===t.id,widgetTypeId:t.widgetId,hasPermissions:e.hasPermissions,hasLocalPermissions:e.hasLocalPermissions,isPreviewing:e.isReadonly,settings:e.settings,imageCdnUrl:e.commonVideoProps.imageCdnUrl,commonVideoProps:e.commonVideoProps,classification:null,contentType:null,hasTableOfContents:!1,seeMoreLink:null,onClickRemoveItem:null,badgeComponent:null},t.id))})]}),r&&(0,q.jsx)(X,{dashboard:e.dashboard,isReadonly:e.isReadonly,imageUrl:e.emptyImageUrl,addWidgetApplink:e.widgetAppLinks.widgetWizard})]})}function Q({enabled:e=!0,to:t,applinkOptions:n},a=[]){(0,K.useEffect)(()=>{if(!(!e||!t)){if(typeof t==`string`){r.Redirect(t);return}i.trigger(t,n)}},[e,t,n,...a])}var $=a.encloseNamespace(`moviesAndTv.companyDashboard`);function ee(e,t){return{partner:E.getPartnerDashboardAppLink,partnerHome:E.getPartnerHomeAppLink,videoType:(n,r)=>k.getAppLink(n,{...r,moviesAndTv:!0,context:_.Widget,includeContext:e?.isAuthenticated},t),series:e=>D.getSeriesAppLink(e,{},t),playlist:e=>({application:l.PLAYLISTS,action:y.Playlists.PLAYLIST,args:[t,e.id,o.slugify(e.name)]}),getPreviewQuestionsAppLink:e=>A.getPreviewQuestionsAppLink(e),classification:()=>null,allTopics:()=>null,calendar:()=>null,calendarMonth:()=>null,classificationDirectory:()=>null,classificationLatestReleases:()=>null,company:()=>null,discover:()=>null,livestream:()=>null,watchHistory:()=>null,widgetVideoList:()=>null,widgetWizard:()=>null,searchSettings:()=>null,searchHome:()=>null}}function te(e){return!e?.partnerProfiles||e.partnerProfiles?.count===0?E.getPartnerHomeAppLink():e?.partnerProfiles?.count>1?E.getPartnerDashboardHubAppLink(e):E.getPartnerDashboardAppLink(e?.partnerProfiles?.data?.[0])}function ne(e,t){return e.isLoadingSettings?null:e.hasPartnerProfiles?L.company(t,!0):L.company(t)}function re(e){let t=g(null),r=u(ne(t,e.companyId)),i=u(v.currentUser()),{openInCurationStudioLabel:a,isUserCurator:s,getOpenInCurationStudioLink:c}=W();Q({enabled:!t.isLoadingSettings&&t.hasPartnerProfiles,to:r.hasCompleted?te(r.data):null},[r.hasCompleted,r.data]);let{commonVideoProps:d}=z({locationContext:f.VideoThumbnail,mtv:!0}),{hasPermissions:p,hasLocalPermissions:h}=w(),{dashboard:_,isPreviewing:x}=I({targetType:m.Company,queryParams:e.queryParams,companyId:e.companyId,enabled:!t.isLoadingSettings&&!t.hasPartnerProfiles});C(S.getDefaultMetadata({title:r.data?.name,phraseContext:{phraseHandler:$,titlePhrase:`pageTitle`,descriptionPhrase:`pageDescription`},canonicalLink:T.getCanonicalLink({stripPresentationSlug:!0,customAppLink:{application:l.MOVIES_AND_TV,action:y.MoviesAndTv.COMPANY_DASHBOARD,args:[e.presentationSlug,r.data?.id,o.slugify(r.data?.name)]}}),allowIndexing:!1})),M({id:e.companyId,app:`studios`});let E=U({name:r.data?.name});function D(){return r.hasCompleted?E:[]}function O(){return s?[{label:a,href:c(r.data?.typeId,r.data?.id),openInNewTab:!0}]:[]}return K.useEffect(()=>{!_.hasCompleted||_.data||n.throw(new b)},[_.data,_.hasCompleted]),(0,q.jsxs)(`div`,{className:`position-relative px-4`,children:[!!(x&&_.data)&&(0,q.jsx)(G,{status:_.data.status,type:`company`}),(0,q.jsx)(Z,{company:r.data,dashboard:_.data,getWidgetContentRequest:F.dashboardWidgetContent,getBannerActions:O,widgetAppLinks:ee(i.data,e.presentationSlug),getBreadcrumbs:D,hasPermissions:p,hasLocalPermissions:h,settings:t,commonVideoProps:d})]})}export{re as CompanyDashboardView};
|
|
2
|
+
//# sourceMappingURL=DFFJpTVB.chunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CAD-W-lP.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/movies-and-tv/components/company-dashboard/empty-state/CompanyDashboardEmptyState.tsx","../../../../libs/shared/src/apps/movies-and-tv/components/company-dashboard/CompanyDashboard.tsx","../../src/shared/hooks/useRedirect.ts","../../src/apps/movies-and-tv/views/company-dashboard/CompanyDashboardView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { EmptyState } from 'libs/shared/components/empty-states/EmptyState';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { Tooltip } from 'libs/shared/components/tooltip/Tooltip';\nimport { PlusSvg } from 'libs/shared/images/svg/actions/PlusSvg';\nimport { CuratedDashboard, DashboardStatus } from 'libs/shared/interfaces';\n\nconst namespace = 'moviesAndTv.companyDashboardEmptyState';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface CompanyDashboardEmptyStateProps {\n dashboard: CuratedDashboard;\n imageUrl: string;\n isReadonly: boolean;\n addWidgetApplink?: () => Core.AppLink;\n}\n\nexport function CompanyDashboardEmptyState(props: CompanyDashboardEmptyStateProps): JSX.Element {\n const isArchived = props.dashboard?.status === DashboardStatus.Archived;\n\n return (\n <EmptyState>\n <EmptyState.Image src={props.imageUrl} altText={getPhrase('info')} />\n <EmptyState.Heading>\n <Text namespace={namespace} phrase='heading' />\n </EmptyState.Heading>\n <EmptyState.Info>\n <Text namespace={namespace} phrase='info' />\n </EmptyState.Info>\n <Tooltip title={isArchived ? LanguageService.getPhrase(namespace, 'archivedCtaTooltip') : ''} spanHack>\n <EmptyState.Cta\n text={LanguageService.getPhrase(namespace, 'add')}\n appLink={props.addWidgetApplink?.()}\n className='btn btn-dark'\n icon={PlusSvg}\n disabled={isArchived}\n />\n </Tooltip>\n </EmptyState>\n );\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { Flight } from 'libs/common/flight';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { CompanyDashboardEmptyState } from 'libs/shared/apps/movies-and-tv/components/company-dashboard/empty-state/CompanyDashboardEmptyState';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { BannerHeader, PartialBannerHeader } from 'libs/shared/components/banner-header/BannerHeader';\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { WidgetContainerView } from 'libs/shared/components/widgets/curated-widgets/WidgetContainerView';\nimport { AllCompanyWidgetTemplates } from 'libs/shared/components/widgets/curated-widgets/WidgetProps';\nimport { BG_COLOUR_CLASS_NAMES } from 'libs/shared/constants/ColourClassNames';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { HasLocalPermissionsFunc, HasPermissionsFunc } from 'libs/shared/hooks/usePermissions';\nimport { Company, CuratedDashboard, CuratedWidgetQueryParams, DashboardTargetType, PresentationAudience } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { CuratedDashboardHelper } from 'libs/shared/utils/DashboardHelper';\nimport { getBgColorClass } from 'libs/shared/utils/getBgColorClass';\n\nexport interface CompanyDashboardProps {\n dashboard: CuratedDashboard;\n company: Company;\n getWidgetContentRequest: (\n id: string,\n params: CuratedWidgetQueryParams,\n widgetTemplate: WidgetTemplate\n ) => Flight.Request;\n hasPermissions: HasPermissionsFunc;\n hasLocalPermissions: HasLocalPermissionsFunc;\n audiences?: PresentationAudience[];\n emptyImageUrl?: string;\n widgetAppLinks?: AllCompanyWidgetTemplates['appLinks'] & {\n widgetWizard: () => Core.AppLink\n };\n scrollToWidgetId?: string;\n isReadonly?: boolean;\n getBreadcrumbs?: () => Breadcrumb[];\n getBannerActions?: () => ActionOptions[];\n commonVideoProps: CommonVideoProps;\n\n settings?: AllCompanyWidgetTemplates['settings'];\n}\n\nexport function CompanyDashboard(props: CompanyDashboardProps): JSX.Element {\n const widgets = ArrayHelper.sortBy(props.dashboard?.widgets, 'index');\n\n function getWidgetContentRequest(id: string, widgetTypeId: WidgetTypeId, template: WidgetTemplate): Flight.Request {\n const params = CuratedDashboardHelper.getWidgetParams(\n widgetTypeId,\n template,\n CuratedDashboardHelper.getDashboardTargetType(props.dashboard)\n );\n\n return props.getWidgetContentRequest(id, params, template);\n }\n\n const showEmptyState = props.isReadonly && !widgets?.length;\n\n return (\n <>\n {!!widgets.length &&\n <>\n {props.company ?\n (\n <BannerHeader\n heading={props.company.name}\n banner={props.company.banner}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n blockColourClass={getBgColorClass(props.company.name, BG_COLOUR_CLASS_NAMES)}\n actions={props.getBannerActions?.()}\n actionsDropdownClassName='btn btn-outline-dark'\n />\n ) : <PartialBannerHeader />\n }\n\n <div className='py-3 mb-3 border-bottom'>\n <Breadcrumbs breadcrumbs={props.getBreadcrumbs?.()} />\n </div>\n\n <div className='mt-3'>\n {widgets.map(widget => {\n return (\n <WidgetContainerView\n widgetCollection={DashboardTargetType.Company}\n dashboardTarget={DashboardTargetType.Company}\n key={widget.id}\n id={widget.id}\n getContentRequest={getWidgetContentRequest}\n audiences={props.audiences}\n name={widget.name}\n description={widget.description}\n templateId={widget.templateId}\n metadata={widget.metadata}\n appLinks={props.widgetAppLinks}\n isScrollToTargetWidget={props?.scrollToWidgetId === widget.id}\n widgetTypeId={widget.widgetId}\n hasPermissions={props.hasPermissions}\n hasLocalPermissions={props.hasLocalPermissions}\n isPreviewing={props.isReadonly}\n settings={props.settings}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n commonVideoProps={props.commonVideoProps}\n\n // TODO: Ideally we don't have to do this\n classification={null}\n contentType={null}\n hasTableOfContents={false}\n seeMoreLink={null}\n onClickRemoveItem={null}\n badgeComponent={null}\n />\n );\n })}\n </div>\n </>\n }\n\n {showEmptyState && (\n <CompanyDashboardEmptyState\n dashboard={props.dashboard}\n isReadonly={props.isReadonly}\n imageUrl={props.emptyImageUrl}\n addWidgetApplink={props.widgetAppLinks.widgetWizard}\n />\n )}\n </>\n );\n}\n","import { useEffect } from 'react';\n\nimport { AppLink, AppLinkHelper, AppLinkOptions, LocationUtils } from 'libs/common/backbone/core';\n\ntype BaseRedirectOptions = {\n /**\n * Whether the redirect should occur. \n * `true` by default.\n */\n enabled?: boolean\n};\n\ntype AppLinkRedirectOptions = {\n to: AppLink | null,\n applinkOptions?: AppLinkOptions\n};\n\ntype ExternalRedirectOptions = {\n to: string | null,\n applinkOptions?: never\n};\n\ntype UseRedirectOptions = BaseRedirectOptions & (AppLinkRedirectOptions | ExternalRedirectOptions);\n\nexport function useRedirect(\n { enabled = true, to, applinkOptions }: UseRedirectOptions,\n deps: React.DependencyList = []\n) {\n useEffect(() => {\n if (!enabled || !to)\n return;\n\n // External redirect\n if (typeof to === 'string') {\n LocationUtils.Redirect(to);\n return;\n }\n\n // Internal redirect\n AppLinkHelper.trigger(to, applinkOptions);\n }, [ enabled, to, applinkOptions, ...deps ]);\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/flight';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { CompanyDashboard, CompanyDashboardProps } from 'libs/shared/apps/movies-and-tv/components/company-dashboard/CompanyDashboard';\nimport { PreviewBanner } from 'libs/shared/apps/subjects/components/preview-banner/PreviewBanner';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { Breadcrumb } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { RelatedVideosContext } from 'libs/shared/enums/RelatedVideosContext';\nimport { NotFoundError } from 'libs/shared/errors/general/not-found/NotFoundError';\nimport { DashboardRequests } from 'libs/shared/flight-requests/DashboardRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { useCurationStudio } from 'libs/shared/hooks/useCurationStudio';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { SettingsHash, useSettings } from 'libs/shared/hooks/useSettings';\nimport { Company, CurrentUser, DashboardTargetType, Playlist, Series, VideoTypes } from 'libs/shared/interfaces';\nimport { GetVideoAppLinkOptions } from 'libs/shared/interfaces/VideoAppLinkOptions';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { CompanyRequests } from 'shared/flight-requests/CompanyRequests';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useDeepLinks } from 'shared/hooks/useDeepLinks';\nimport { useRedirect } from 'shared/hooks/useRedirect';\nimport { DashboardViewQueryParams } from 'shared/interfaces/query-params/DashboardViewQueryParams';\nimport { ContentPartnerAppLinkHelper } from 'shared/utils/ContentPartnerAppLinkHelper';\nimport { useFetchCuratedDashboard } from 'shared/utils/DashboardHelper';\nimport { InteractiveHelpers } from 'shared/utils/InteractiveHelper';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { SeriesAppLinkHelper } from 'apps/series/SeriesAppLinkHelper';\n\nconst namespace = 'moviesAndTv.companyDashboard';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nfunction getCompanyAppLinks(\n currentUser: CurrentUser,\n presentationSlug: string | null\n): CompanyDashboardProps['widgetAppLinks'] {\n return {\n partner: ContentPartnerAppLinkHelper.getPartnerDashboardAppLink,\n partnerHome: ContentPartnerAppLinkHelper.getPartnerHomeAppLink,\n videoType: (video: VideoTypes, opts: GetVideoAppLinkOptions) => (\n VideoAppLinkHelper.getAppLink(video, {\n ...opts,\n moviesAndTv: true,\n context: RelatedVideosContext.Widget,\n includeContext: currentUser?.isAuthenticated\n }, presentationSlug)\n ),\n\n series: (series: Series) => SeriesAppLinkHelper.getSeriesAppLink(series, {}, presentationSlug),\n\n playlist: (playlist: Playlist) => ({\n application: AppChannels.PLAYLISTS,\n action: Actions.Playlists.PLAYLIST,\n args: [ presentationSlug, playlist.id, TextHelper.slugify(playlist.name) ]\n }),\n\n getPreviewQuestionsAppLink: interactive => InteractiveHelpers.getPreviewQuestionsAppLink(interactive),\n \n // TODO: Find a nice way around having to pass these in\n classification: () => null,\n allTopics: () => null,\n calendar: () => null,\n calendarMonth: () => null,\n classificationDirectory: () => null,\n classificationLatestReleases: () => null,\n company: () => null,\n discover: () => null,\n livestream: () => null,\n watchHistory: () => null,\n widgetVideoList: () => null,\n widgetWizard: () => null,\n searchSettings: () => null,\n searchHome: () => null\n };\n}\n\n/**\n * If there are no partner profiles, we redirect to the partner index page.\n * If there is only one partner profile, we redirect to the partner dashboard page.\n * If there are multiple partner profiles, we redirect to the partner dashboard hub page.\n */\nfunction getRedirectAppLink(company: Company): Core.AppLink | null {\n if (!company?.partnerProfiles || company.partnerProfiles?.count === 0)\n return ContentPartnerAppLinkHelper.getPartnerHomeAppLink();\n \n if (company?.partnerProfiles?.count > 1)\n return ContentPartnerAppLinkHelper.getPartnerDashboardHubAppLink(company);\n\n return ContentPartnerAppLinkHelper.getPartnerDashboardAppLink(company?.partnerProfiles?.data?.[0]);\n}\n\nfunction getCompanyRequest(settings: SettingsHash, companyId: string): Flight.PublicRequest | null {\n if (settings.isLoadingSettings)\n return null;\n\n if (settings.hasPartnerProfiles)\n return CompanyRequests.company(companyId, true);\n\n return CompanyRequests.company(companyId);\n}\n\ninterface CompanyDashboardViewProps {\n presentationSlug: string | null;\n companyId: string;\n queryParams?: DashboardViewQueryParams;\n}\n\nexport function CompanyDashboardView(props: CompanyDashboardViewProps): JSX.Element {\n const settings = useSettings(null);\n const company = Flight.useBasicFetch<Company>(getCompanyRequest(settings, props.companyId));\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const { openInCurationStudioLabel, isUserCurator, getOpenInCurationStudioLink } = useCurationStudio();\n\n /**\n * Redirect to respective feature channel dashboard if it exists.\n * Only redirect if the user has partner profiles feature flag enabled.\n */\n useRedirect({\n enabled: !settings.isLoadingSettings && settings.hasPartnerProfiles,\n to: company.hasCompleted ? getRedirectAppLink(company.data) : null\n }, [ company.hasCompleted, company.data ]);\n\n const { commonVideoProps } = useCommonVideoProps({\n locationContext: LocationContext.VideoThumbnail,\n mtv: true\n });\n \n const { hasPermissions, hasLocalPermissions } = usePermissions();\n\n const {\n dashboard,\n isPreviewing\n } = useFetchCuratedDashboard({\n targetType: DashboardTargetType.Company,\n queryParams: props.queryParams,\n companyId: props.companyId,\n enabled: !settings.isLoadingSettings && !settings.hasPartnerProfiles\n });\n\n useSetPageMetadata(PageMetadataHelper.getDefaultMetadata({\n title: company.data?.name,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink({\n stripPresentationSlug: true,\n customAppLink: {\n application: AppChannels.MOVIES_AND_TV,\n action: Actions.MoviesAndTv.COMPANY_DASHBOARD,\n args: [ props.presentationSlug, company.data?.id, TextHelper.slugify(company.data?.name) ]\n }\n }),\n allowIndexing: false\n }));\n\n useDeepLinks({ id: props.companyId, app: 'studios' });\n\n const breadcrumbs = useBreadcrumbs({ name: company.data?.name });\n function getBreadcrumbs(): Breadcrumb[] {\n if (!company.hasCompleted)\n return [];\n\n return breadcrumbs;\n }\n\n function getBannerActions(): ActionOptions[] {\n if (!isUserCurator)\n return [];\n\n return [{\n label: openInCurationStudioLabel,\n href: getOpenInCurationStudioLink(company.data?.typeId, company.data?.id),\n openInNewTab: true\n }];\n }\n\n React.useEffect(() => {\n if (!dashboard.hasCompleted || dashboard.data)\n return;\n\n Core.ErrorHelper.throw(new NotFoundError());\n }, [ dashboard.data, dashboard.hasCompleted ]);\n\n return (\n <div className='position-relative px-4'>\n {!!(isPreviewing && dashboard.data) && <PreviewBanner status={dashboard.data.status} type='company' />}\n <CompanyDashboard\n company={company.data}\n dashboard={dashboard.data}\n getWidgetContentRequest={DashboardRequests.dashboardWidgetContent}\n getBannerActions={getBannerActions}\n widgetAppLinks={getCompanyAppLinks(currentUser.data, props.presentationSlug)}\n getBreadcrumbs={getBreadcrumbs}\n hasPermissions={hasPermissions}\n hasLocalPermissions={hasLocalPermissions}\n settings={settings}\n commonVideoProps={commonVideoProps}\n />\n </div>\n );\n}\n"],"mappings":"mqDAWM,EAAY,yCACZ,EAAY,EAAgB,iBAAiB,CAAS,EAS5D,SAAgB,EAA2B,EAAqD,CAC9F,IAAM,EAAa,EAAM,WAAW,SAAW,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EANQ,CAAC,CAOZ,CASA,OAPA,EAAM,cAAgB,CAChB,CAAC,EAAU,cAAgB,EAAU,MAGzC,EAAiB,MAAM,IAAI,CAAe,CAC5C,EAAG,CAAE,EAAU,KAAM,EAAU,YAAa,CAAC,GAG3C,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,kCAAf,CACG,CAAC,EAAE,GAAgB,EAAU,QAAS,EAAA,EAAA,IAAA,CAAC,EAAD,CAAe,OAAQ,EAAU,KAAK,OAAQ,KAAK,SAAW,CAAA,GACrG,EAAA,EAAA,IAAA,CAAC,EAAD,CACE,QAAS,EAAQ,KACjB,UAAW,EAAU,KACrB,wBAAyB,EAAkB,uBACzB,mBAClB,eAAgB,GAAmB,EAAY,KAAM,EAAM,gBAAgB,EAC3D,iBACA,iBACK,sBACX,WACQ,kBACnB,CAAA,CACE,GAET"}
|
|
1
|
+
{"version":3,"file":"DFFJpTVB.chunk.js","names":[],"sources":["../../../../libs/shared/src/apps/movies-and-tv/components/company-dashboard/empty-state/CompanyDashboardEmptyState.tsx","../../../../libs/shared/src/apps/movies-and-tv/components/company-dashboard/CompanyDashboard.tsx","../../src/shared/hooks/useRedirect.ts","../../src/apps/movies-and-tv/views/company-dashboard/CompanyDashboardView.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\n\nimport { EmptyState } from 'libs/shared/components/empty-states/EmptyState';\nimport { Text } from 'libs/shared/components/text/Text';\nimport { Tooltip } from 'libs/shared/components/tooltip/Tooltip';\nimport { PlusSvg } from 'libs/shared/images/svg/actions/PlusSvg';\nimport { CuratedDashboard, DashboardStatus } from 'libs/shared/interfaces';\n\nconst namespace = 'moviesAndTv.companyDashboardEmptyState';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\ninterface CompanyDashboardEmptyStateProps {\n dashboard: CuratedDashboard;\n imageUrl: string;\n isReadonly: boolean;\n addWidgetApplink?: () => Core.AppLink;\n}\n\nexport function CompanyDashboardEmptyState(props: CompanyDashboardEmptyStateProps): JSX.Element {\n const isArchived = props.dashboard?.status === DashboardStatus.Archived;\n\n return (\n <EmptyState>\n <EmptyState.Image src={props.imageUrl} altText={getPhrase('info')} />\n <EmptyState.Heading>\n <Text namespace={namespace} phrase='heading' />\n </EmptyState.Heading>\n <EmptyState.Info>\n <Text namespace={namespace} phrase='info' />\n </EmptyState.Info>\n <Tooltip title={isArchived ? LanguageService.getPhrase(namespace, 'archivedCtaTooltip') : ''} spanHack>\n <EmptyState.Cta\n text={LanguageService.getPhrase(namespace, 'add')}\n appLink={props.addWidgetApplink?.()}\n className='btn btn-dark'\n icon={PlusSvg}\n disabled={isArchived}\n />\n </Tooltip>\n </EmptyState>\n );\n}\n","import React from 'react';\n\nimport { Core } from 'libs/common/backbone/index';\nimport { Flight } from 'libs/common/flight';\nimport { ArrayHelper } from 'libs/common/react/utils/ArrayHelper';\n\nimport { CompanyDashboardEmptyState } from 'libs/shared/apps/movies-and-tv/components/company-dashboard/empty-state/CompanyDashboardEmptyState';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { BannerHeader, PartialBannerHeader } from 'libs/shared/components/banner-header/BannerHeader';\nimport { Breadcrumb, Breadcrumbs } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { WidgetContainerView } from 'libs/shared/components/widgets/curated-widgets/WidgetContainerView';\nimport { AllCompanyWidgetTemplates } from 'libs/shared/components/widgets/curated-widgets/WidgetProps';\nimport { BG_COLOUR_CLASS_NAMES } from 'libs/shared/constants/ColourClassNames';\nimport { WidgetTemplate } from 'libs/shared/enums/WidgetTemplate';\nimport { WidgetTypeId } from 'libs/shared/enums/WidgetTypeId';\nimport { HasLocalPermissionsFunc, HasPermissionsFunc } from 'libs/shared/hooks/usePermissions';\nimport { Company, CuratedDashboard, CuratedWidgetQueryParams, DashboardTargetType, PresentationAudience } from 'libs/shared/interfaces';\nimport { CommonVideoProps } from 'libs/shared/interfaces/CommonVideoProps';\nimport { CuratedDashboardHelper } from 'libs/shared/utils/DashboardHelper';\nimport { getBgColorClass } from 'libs/shared/utils/getBgColorClass';\n\nexport interface CompanyDashboardProps {\n dashboard: CuratedDashboard;\n company: Company;\n getWidgetContentRequest: (\n id: string,\n params: CuratedWidgetQueryParams,\n widgetTemplate: WidgetTemplate\n ) => Flight.Request;\n hasPermissions: HasPermissionsFunc;\n hasLocalPermissions: HasLocalPermissionsFunc;\n audiences?: PresentationAudience[];\n emptyImageUrl?: string;\n widgetAppLinks?: AllCompanyWidgetTemplates['appLinks'] & {\n widgetWizard: () => Core.AppLink\n };\n scrollToWidgetId?: string;\n isReadonly?: boolean;\n getBreadcrumbs?: () => Breadcrumb[];\n getBannerActions?: () => ActionOptions[];\n commonVideoProps: CommonVideoProps;\n\n settings?: AllCompanyWidgetTemplates['settings'];\n}\n\nexport function CompanyDashboard(props: CompanyDashboardProps): JSX.Element {\n const widgets = ArrayHelper.sortBy(props.dashboard?.widgets, 'index');\n\n function getWidgetContentRequest(id: string, widgetTypeId: WidgetTypeId, template: WidgetTemplate): Flight.Request {\n const params = CuratedDashboardHelper.getWidgetParams(\n widgetTypeId,\n template,\n CuratedDashboardHelper.getDashboardTargetType(props.dashboard)\n );\n\n return props.getWidgetContentRequest(id, params, template);\n }\n\n const showEmptyState = props.isReadonly && !widgets?.length;\n\n return (\n <>\n {!!widgets.length &&\n <>\n {props.company ?\n (\n <BannerHeader\n heading={props.company.name}\n banner={props.company.banner}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n blockColourClass={getBgColorClass(props.company.name, BG_COLOUR_CLASS_NAMES)}\n actions={props.getBannerActions?.()}\n actionsDropdownClassName='btn btn-outline-dark'\n />\n ) : <PartialBannerHeader />\n }\n\n <div className='py-3 mb-3 border-bottom'>\n <Breadcrumbs breadcrumbs={props.getBreadcrumbs?.()} />\n </div>\n\n <div className='mt-3'>\n {widgets.map(widget => {\n return (\n <WidgetContainerView\n widgetCollection={DashboardTargetType.Company}\n dashboardTarget={DashboardTargetType.Company}\n key={widget.id}\n id={widget.id}\n getContentRequest={getWidgetContentRequest}\n audiences={props.audiences}\n name={widget.name}\n description={widget.description}\n templateId={widget.templateId}\n metadata={widget.metadata}\n appLinks={props.widgetAppLinks}\n isScrollToTargetWidget={props?.scrollToWidgetId === widget.id}\n widgetTypeId={widget.widgetId}\n hasPermissions={props.hasPermissions}\n hasLocalPermissions={props.hasLocalPermissions}\n isPreviewing={props.isReadonly}\n settings={props.settings}\n imageCdnUrl={props.commonVideoProps.imageCdnUrl}\n commonVideoProps={props.commonVideoProps}\n\n // TODO: Ideally we don't have to do this\n classification={null}\n contentType={null}\n hasTableOfContents={false}\n seeMoreLink={null}\n onClickRemoveItem={null}\n badgeComponent={null}\n />\n );\n })}\n </div>\n </>\n }\n\n {showEmptyState && (\n <CompanyDashboardEmptyState\n dashboard={props.dashboard}\n isReadonly={props.isReadonly}\n imageUrl={props.emptyImageUrl}\n addWidgetApplink={props.widgetAppLinks.widgetWizard}\n />\n )}\n </>\n );\n}\n","import { useEffect } from 'react';\n\nimport { AppLink, AppLinkHelper, AppLinkOptions, LocationUtils } from 'libs/common/backbone/core';\n\ntype BaseRedirectOptions = {\n /**\n * Whether the redirect should occur. \n * `true` by default.\n */\n enabled?: boolean\n};\n\ntype AppLinkRedirectOptions = {\n to: AppLink | null,\n applinkOptions?: AppLinkOptions\n};\n\ntype ExternalRedirectOptions = {\n to: string | null,\n applinkOptions?: never\n};\n\ntype UseRedirectOptions = BaseRedirectOptions & (AppLinkRedirectOptions | ExternalRedirectOptions);\n\nexport function useRedirect(\n { enabled = true, to, applinkOptions }: UseRedirectOptions,\n deps: React.DependencyList = []\n) {\n useEffect(() => {\n if (!enabled || !to)\n return;\n\n // External redirect\n if (typeof to === 'string') {\n LocationUtils.Redirect(to);\n return;\n }\n\n // Internal redirect\n AppLinkHelper.trigger(to, applinkOptions);\n }, [ enabled, to, applinkOptions, ...deps ]);\n}\n","import React from 'react';\n\nimport { LanguageService } from 'libs/common/backbone/services/LanguageService';\nimport { Core } from 'libs/common/core';\nimport { Flight } from 'libs/common/flight';\nimport { TextHelper } from 'libs/common/react/utils/TextHelper';\n\nimport { LocationContext } from 'libs/analytics/interfaces';\n\nimport { CompanyDashboard, CompanyDashboardProps } from 'libs/shared/apps/movies-and-tv/components/company-dashboard/CompanyDashboard';\nimport { PreviewBanner } from 'libs/shared/apps/subjects/components/preview-banner/PreviewBanner';\nimport { ActionOptions } from 'libs/shared/components/actions/Actions';\nimport { Breadcrumb } from 'libs/shared/components/breadcrumbs/Breadcrumbs';\nimport { RelatedVideosContext } from 'libs/shared/enums/RelatedVideosContext';\nimport { NotFoundError } from 'libs/shared/errors/general/not-found/NotFoundError';\nimport { DashboardRequests } from 'libs/shared/flight-requests/DashboardRequests';\nimport { UserRequests } from 'libs/shared/flight-requests/UserRequests';\nimport { useBreadcrumbs } from 'libs/shared/hooks/useBreadcrumbs';\nimport { useCurationStudio } from 'libs/shared/hooks/useCurationStudio';\nimport { usePermissions } from 'libs/shared/hooks/usePermissions';\nimport { useSetPageMetadata } from 'libs/shared/hooks/useSetPageMetadata';\nimport { SettingsHash, useSettings } from 'libs/shared/hooks/useSettings';\nimport { Company, CurrentUser, DashboardTargetType, Playlist, Series, VideoTypes } from 'libs/shared/interfaces';\nimport { GetVideoAppLinkOptions } from 'libs/shared/interfaces/VideoAppLinkOptions';\nimport { PageMetadataHelper } from 'libs/shared/utils/PageMetadataHelper';\n\nimport { Actions } from 'shared/constants/LiteActions';\nimport { AppChannels } from 'shared/constants/LiteRadioChannels';\nimport { CompanyRequests } from 'shared/flight-requests/CompanyRequests';\nimport { useCommonVideoProps } from 'shared/hooks/useCommonVideoProps';\nimport { useDeepLinks } from 'shared/hooks/useDeepLinks';\nimport { useRedirect } from 'shared/hooks/useRedirect';\nimport { DashboardViewQueryParams } from 'shared/interfaces/query-params/DashboardViewQueryParams';\nimport { ContentPartnerAppLinkHelper } from 'shared/utils/ContentPartnerAppLinkHelper';\nimport { useFetchCuratedDashboard } from 'shared/utils/DashboardHelper';\nimport { InteractiveHelpers } from 'shared/utils/InteractiveHelper';\nimport { SeoHelper } from 'shared/utils/SeoHelper';\nimport { VideoAppLinkHelper } from 'shared/utils/VideoAppLinkHelper';\n\nimport { SeriesAppLinkHelper } from 'apps/series/SeriesAppLinkHelper';\n\nconst namespace = 'moviesAndTv.companyDashboard';\nconst getPhrase = LanguageService.encloseNamespace(namespace);\n\nfunction getCompanyAppLinks(\n currentUser: CurrentUser,\n presentationSlug: string | null\n): CompanyDashboardProps['widgetAppLinks'] {\n return {\n partner: ContentPartnerAppLinkHelper.getPartnerDashboardAppLink,\n partnerHome: ContentPartnerAppLinkHelper.getPartnerHomeAppLink,\n videoType: (video: VideoTypes, opts: GetVideoAppLinkOptions) => (\n VideoAppLinkHelper.getAppLink(video, {\n ...opts,\n moviesAndTv: true,\n context: RelatedVideosContext.Widget,\n includeContext: currentUser?.isAuthenticated\n }, presentationSlug)\n ),\n\n series: (series: Series) => SeriesAppLinkHelper.getSeriesAppLink(series, {}, presentationSlug),\n\n playlist: (playlist: Playlist) => ({\n application: AppChannels.PLAYLISTS,\n action: Actions.Playlists.PLAYLIST,\n args: [ presentationSlug, playlist.id, TextHelper.slugify(playlist.name) ]\n }),\n\n getPreviewQuestionsAppLink: interactive => InteractiveHelpers.getPreviewQuestionsAppLink(interactive),\n \n // TODO: Find a nice way around having to pass these in\n classification: () => null,\n allTopics: () => null,\n calendar: () => null,\n calendarMonth: () => null,\n classificationDirectory: () => null,\n classificationLatestReleases: () => null,\n company: () => null,\n discover: () => null,\n livestream: () => null,\n watchHistory: () => null,\n widgetVideoList: () => null,\n widgetWizard: () => null,\n searchSettings: () => null,\n searchHome: () => null\n };\n}\n\n/**\n * If there are no partner profiles, we redirect to the partner index page.\n * If there is only one partner profile, we redirect to the partner dashboard page.\n * If there are multiple partner profiles, we redirect to the partner dashboard hub page.\n */\nfunction getRedirectAppLink(company: Company): Core.AppLink | null {\n if (!company?.partnerProfiles || company.partnerProfiles?.count === 0)\n return ContentPartnerAppLinkHelper.getPartnerHomeAppLink();\n \n if (company?.partnerProfiles?.count > 1)\n return ContentPartnerAppLinkHelper.getPartnerDashboardHubAppLink(company);\n\n return ContentPartnerAppLinkHelper.getPartnerDashboardAppLink(company?.partnerProfiles?.data?.[0]);\n}\n\nfunction getCompanyRequest(settings: SettingsHash, companyId: string): Flight.PublicRequest | null {\n if (settings.isLoadingSettings)\n return null;\n\n if (settings.hasPartnerProfiles)\n return CompanyRequests.company(companyId, true);\n\n return CompanyRequests.company(companyId);\n}\n\ninterface CompanyDashboardViewProps {\n presentationSlug: string | null;\n companyId: string;\n queryParams?: DashboardViewQueryParams;\n}\n\nexport function CompanyDashboardView(props: CompanyDashboardViewProps): JSX.Element {\n const settings = useSettings(null);\n const company = Flight.useBasicFetch<Company>(getCompanyRequest(settings, props.companyId));\n const currentUser = Flight.useBasicFetch<CurrentUser>(UserRequests.currentUser());\n const { openInCurationStudioLabel, isUserCurator, getOpenInCurationStudioLink } = useCurationStudio();\n\n /**\n * Redirect to respective feature channel dashboard if it exists.\n * Only redirect if the user has partner profiles feature flag enabled.\n */\n useRedirect({\n enabled: !settings.isLoadingSettings && settings.hasPartnerProfiles,\n to: company.hasCompleted ? getRedirectAppLink(company.data) : null\n }, [ company.hasCompleted, company.data ]);\n\n const { commonVideoProps } = useCommonVideoProps({\n locationContext: LocationContext.VideoThumbnail,\n mtv: true\n });\n \n const { hasPermissions, hasLocalPermissions } = usePermissions();\n\n const {\n dashboard,\n isPreviewing\n } = useFetchCuratedDashboard({\n targetType: DashboardTargetType.Company,\n queryParams: props.queryParams,\n companyId: props.companyId,\n enabled: !settings.isLoadingSettings && !settings.hasPartnerProfiles\n });\n\n useSetPageMetadata(PageMetadataHelper.getDefaultMetadata({\n title: company.data?.name,\n phraseContext: {\n phraseHandler: getPhrase,\n titlePhrase: 'pageTitle',\n descriptionPhrase: 'pageDescription'\n },\n canonicalLink: SeoHelper.getCanonicalLink({\n stripPresentationSlug: true,\n customAppLink: {\n application: AppChannels.MOVIES_AND_TV,\n action: Actions.MoviesAndTv.COMPANY_DASHBOARD,\n args: [ props.presentationSlug, company.data?.id, TextHelper.slugify(company.data?.name) ]\n }\n }),\n allowIndexing: false\n }));\n\n useDeepLinks({ id: props.companyId, app: 'studios' });\n\n const breadcrumbs = useBreadcrumbs({ name: company.data?.name });\n function getBreadcrumbs(): Breadcrumb[] {\n if (!company.hasCompleted)\n return [];\n\n return breadcrumbs;\n }\n\n function getBannerActions(): ActionOptions[] {\n if (!isUserCurator)\n return [];\n\n return [{\n label: openInCurationStudioLabel,\n href: getOpenInCurationStudioLink(company.data?.typeId, company.data?.id),\n openInNewTab: true\n }];\n }\n\n React.useEffect(() => {\n if (!dashboard.hasCompleted || dashboard.data)\n return;\n\n Core.ErrorHelper.throw(new NotFoundError());\n }, [ dashboard.data, dashboard.hasCompleted ]);\n\n return (\n <div className='position-relative px-4'>\n {!!(isPreviewing && dashboard.data) && <PreviewBanner status={dashboard.data.status} type='company' />}\n <CompanyDashboard\n company={company.data}\n dashboard={dashboard.data}\n getWidgetContentRequest={DashboardRequests.dashboardWidgetContent}\n getBannerActions={getBannerActions}\n widgetAppLinks={getCompanyAppLinks(currentUser.data, props.presentationSlug)}\n getBreadcrumbs={getBreadcrumbs}\n hasPermissions={hasPermissions}\n hasLocalPermissions={hasLocalPermissions}\n settings={settings}\n commonVideoProps={commonVideoProps}\n />\n </div>\n );\n}\n"],"mappings":"mqDAWM,EAAY,yCACZ,EAAY,EAAgB,iBAAiB,CAAS,EAS5D,SAAgB,EAA2B,EAAqD,CAC9F,IAAM,EAAa,EAAM,WAAW,SAAW,EAAgB,SAE/D,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAA,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,EAAW,MAAZ,CAAkB,IAAK,EAAM,SAAU,QAAS,EAAU,MAAM,CAAI,CAAA,GACpE,EAAA,EAAA,IAAA,CAA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