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tB3iD,GAAS,GAAKA,EAAQ2iD,EAAiB5iD,QACzC8jD,EAAsB,IACjBlB,EAAiBnC,MAAM,EAAGxgD,MAC1B2iD,EAAiBnC,MAAMxgD,EAAQ,IAEpC4iD,EAAoBiB,IAEpBn4B,EAAsBmG,WACpB,CAACpG,EAAyBqG,YAAYyE,OACtC9K,EAAyBuG,SAASC,KAClC5S,EACA,kCAAkCw4B,KAGtC,MAAMiM,EAAyB,UAAQD,ETlMG,GSmM1CnB,EAAuBoB,GACnBtL,GAAgBsL,EAAuB/jD,QACzCgiD,EAAgB+B,EAAuB/jD,OAAS,E,GAEjD,CAAC4iD,EAAkBnK,EAAc/sB,EAA0BC,IAE9D,OAAI3nB,EACK,gBAAC00B,GAAW,MAInB,uBAAKzf,UAAU,aACb,gBAAC8oC,EAAW,CACVvJ,YAAakK,GAAuB,GACpCjK,aAAcA,EACduJ,gBAAiBA,EACjBtkD,KAAMA,EACNwgD,iBAAkBA,EAClBtyB,WAAYA,EACZruB,cAAeA,EACfhB,YAAaA,EACb6G,MAAOkgD,EACPlL,MAAOA,EACPuI,gBAAiBA,EACjBC,oBAAqBA,GACrB/0B,mBAAoBA,EACpBC,YAAaA,EACb+sB,4BAAiC,OAAJr4C,QAAI,IAAJA,OAAI,EAAJA,EAAMq4C,4BACnCgI,mBAAoBA,GACpBr1B,aAAcA,EACdO,OAAQA,EACRzlB,OAAQA,EACRolB,yBAA0BA,EAC1BC,sBAAuBA,EACvBszB,gBAAiBA,GACjBjzB,oBAAqBA,EACrBkzB,iBAAkBA,KAI1B,IA3NyB,CAACr/C,GAAK0qB,UAAU,CAAC,MAAQ,CAChD,UAAWvjB,OAAOwjB,QAAO,QAAwBD,O","sources":["../../../../overview/packages/fluent-page-view-constructor/src/performance-chart-card/preference.js","../../../../overview/packages/fluent-page-view-constructor/src/performance-chart-card/container.js","../../../../overview/packages/fluent-page-view-constructor/src/performance-chart-card/use-data.js","../../../../overview/packages/overview-diagnostic-card/src/const.js","../../../../overview/packages/overview-diagnostic-card/src/status-details-helpers/utils.js","../../../../overview/packages/overview-diagnostic-card/src/status-details-helpers/get-billing-detail.js","../../../../overview/packages/overview-diagnostic-card/src/status-details-helpers/get-campaign-status.js","../../../../overview/packages/overview-diagnostic-card/src/status-details-helpers/get-editorial-status.js","../../../../overview/packages/overview-diagnostic-card/src/status-details-helpers/get-bidding-status.js","../../../../overview/packages/overview-diagnostic-card/src/status-details-helpers/get-invalid-event-strings.js","../../../../overview/packages/overview-diagnostic-card/src/status-details-helpers/get-conversion-status.js","../../../../overview/packages/overview-diagnostic-card/src/card-status-text-helper.js","../../../../overview/packages/overview-diagnostic-card/src/use-data.js","../../../../overview/packages/overview-diagnostic-card/src/status-details-helpers/get-diagnostics-detail.js","../../../../overview/packages/overview-diagnostic-card/src/shimmer.js","../../../../overview/packages/overview-diagnostic-card/src/index.js","../../../../overview/packages/overview-top-changes-card-fluent/src/top-changes-card.tsx","../../../../overview/packages/overview-top-changes-card-fluent/src/use-top-changes-data.ts","../../../../overview/packages/overview-top-changes-card-fluent/src/use-fluctuation-popup.tsx","../../../../overview/packages/overview-welcome-tips-card/src/use-dashboard-preferences.ts","../../../../overview/packages/overview-welcome-tips-card/src/use-welcome-tip-pages.ts","../../../../overview/packages/overview-welcome-tips-card/src/welcome-tips-card.tsx","../../overview/src/style/overview-page-style.js","../../overview/src/style/styles.js","../../overview/src/use-overview-window-size-change.js","../../../../overview/packages/fluent-page-view-constructor/src/card-view-constructor.js","../../overview/src/pmax-single-campaign-page/default-cards-state.js","../../overview/src/pmax-single-campaign-page/use-initialize-backbone-view.js","../../overview/src/const.js","../../overview/src/pmax-single-campaign-page/pmax-single-campaign.js","../../overview/src/style/legacy/styles.js","../../overview/src/overview-page.js","../../overview/src/legacy-deps/conversion-tracking-imports.js","../../overview/src/legacy-deps/grid-card-imports.js","../../overview/src/legacy-deps/recommendations-imports.js","../../overview/src/legacy-deps/top-changes-imports.js","../../overview/src/legacy-deps/index.js","../../overview/src/get-child-perf-markers.js","../../overview/src/helper/use-stable-object.js","../../overview/src/helper/use-welcome-tips.js","../../overview/src/style/overview-page-phase-2-style.js","../../overview/src/too-many-accounts/too-many-accounts.js","../../overview/src/overview-page-phase-2.js","../../overview/src/too-many-accounts/use-has-too-many-accounts.js","../../overview/src/legacy-deps-pmax/deps.js","../../../../overview/packages/overview-competition-card/src/card/shimmer-card.tsx","../../../../overview/packages/overview-competition-card/src/styles/no-data-styles.ts","../../../../overview/packages/overview-competition-card/src/card/no-data-card.tsx","../../../../overview/packages/overview-competition-card/src/styles/card-styles.ts","../../../../overview/packages/overview-competition-card/src/data/use-auction-insight-data.ts","../../../../overview/packages/overview-competition-card/src/card/competition-card.tsx","../../../../overview/packages/overview-competition-card/src/data/with-auction-insight-data.tsx","../../../../overview/packages/overview-competition-card/src/card/with-filter-data.tsx","../../../../overview/packages/overview-competition-card/src/card-header/use-preference-metrics.ts","../../../../overview/packages/overview-competition-card/src/utils/get-campaign-type.ts","../../../../overview/packages/overview-competition-card/src/styles/filter-styles.ts","../../../../overview/packages/overview-competition-card/src/card-header/competition-filter.tsx","../../../../overview/packages/overview-competition-card/src/data/with-competitors-data.tsx","../../../../overview/packages/overview-device-card-fluent/src/constants/metrics-data.ts","../../../../overview/packages/overview-device-card-fluent/src/constants/device-color.ts","../../../../overview/packages/overview-device-card-fluent/src/utils/metric-mapper.ts","../../../../overview/packages/overview-device-card-fluent/src/utils/callout-legend-icon.tsx","../../../../overview/packages/overview-device-card-fluent/src/helpers/default-card-custom-callout.tsx","../../../../overview/packages/overview-device-card-fluent/src/styles/dropdown-styles.js","../../../../overview/packages/overview-device-card-fluent/src/styles/devices-default-card.js","../../../../overview/packages/overview-device-card-fluent/src/card/devices-default-card.tsx","../../../../overview/packages/overview-device-card-fluent/src/styles/devices-comparison-card.js","../../../../overview/packages/overview-device-card-fluent/src/helpers/svg-pattern-comparison-state.tsx","../../../../overview/packages/overview-device-card-fluent/src/utils/legend-key-map.ts","../../../../overview/packages/overview-device-card-fluent/src/utils/segment-data-extractor.ts","../../../../overview/packages/overview-device-card-fluent/src/utils/numeric-value-extractor.ts","../../../../overview/packages/overview-device-card-fluent/src/utils/total-percentage-calculator.ts","../../../../overview/packages/overview-device-card-fluent/src/card/devices-comparison-card.tsx","../../../../overview/packages/overview-device-card-fluent/src/helpers/shimmer-element.tsx","../../../../overview/packages/overview-device-card-fluent/src/styles/shimmer-card.js","../../../../overview/packages/overview-device-card-fluent/src/card/shimmer-card.tsx","../../../../overview/packages/overview-device-card-fluent/src/media/computer-icon-svg.js","../../../../overview/packages/overview-device-card-fluent/src/media/tablet-icon-svg.js","../../../../overview/packages/overview-device-card-fluent/src/media/mobile-icon-svg.js","../../../../overview/packages/overview-device-card-fluent/src/media/connectedTV-icon-svg.js","../../../../overview/packages/overview-device-card-fluent/src/styles/devices-card.js","../../../../overview/packages/overview-device-card-fluent/src/utils/device-legend.tsx","../../../../overview/packages/overview-device-card-fluent/src/card/devices-card.tsx","../../../../overview/packages/overview-device-card-fluent/src/card/use-data.tsx","../../../../overview/packages/overview-grid-card-fluent/src/order-by-helper.ts","../../../../overview/packages/overview-grid-card-fluent/src/consts.ts","../../../../overview/packages/overview-grid-card-fluent/src/grid-data-table.tsx","../../../../overview/packages/overview-grid-card-fluent/src/use-grid-data.ts","../../../../overview/packages/overview-grid-card-fluent/src/overview-grid-card-style.tsx","../../../../overview/packages/overview-grid-card-fluent/src/overview-ad-group-table.tsx","../../../../overview/packages/overview-grid-card-fluent/src/use-combined-call-data.ts","../../../../overview/packages/overview-grid-card-fluent/src/overview-account-table.tsx","../../../../overview/packages/overview-grid-card-fluent/src/overview-campaign-table.tsx","../../../../overview/packages/overview-grid-card-fluent/src/overview-keyword-table.tsx","../../../../overview/packages/overview-grid-card-fluent/src/search-term-components/adgroup-selector-data.ts","../../../../overview/packages/overview-grid-card-fluent/src/search-term-components/campaign-adgroup-selector.tsx","../../../../overview/packages/overview-grid-card-fluent/src/search-term-components/add-keyword-drawer.tsx","../../../../overview/packages/overview-grid-card-fluent/src/overview-search-term-table.tsx","../../../../overview/packages/overview-recommendations-card/src/const.ts","../../../../overview/packages/overview-recommendations-card/src/card-data.ts","../../../../overview/packages/overview-recommendations-card/src/components/empty-content.tsx","../../../../overview/packages/overview-recommendations-card/src/components/coupon-flag.tsx","../../../../overview/packages/overview-recommendations-card/src/components/tip-item.tsx","../../../../overview/packages/overview-recommendations-card/src/components/carousel-item.tsx","../../../../overview/packages/overview-recommendations-card/src/types.ts","../../../../overview/packages/overview-recommendations-card/src/components/card-content.tsx","../../../../overview/packages/overview-recommendations-card/src/components/shimmer-card.tsx","../../../../overview/packages/overview-recommendations-card/src/overview-recommendations-card.tsx","../../../../overview/packages/overview-recommendations-card/src/use-recommendations-data.ts"],"sourcesContent":["import _ from 'underscore';\r\nimport { defaultMetrics } from '@bingads-webui-campaign-legacy/dashboard-cards/performance-card/defaultMetrics';\r\nimport config from '@bingads-webui-component-legacy/config/index';\r\nimport { allMetrics } from '@bingads-webui-campaign/overview-cards-common';\r\nimport {\r\n setPreferenceForCard,\r\n getPreferenceForDashboard,\r\n getCardPreferenceOptions\r\n} from '@bingads-webui-campaign/fluent-page-data';\r\n\r\nconst permissions = config.get('Permissions');\r\nconst validMetricIndexes = [0, 1, 2, 3];\r\nconst defaultSelectedMetricIndexes = [0, 1];\r\nconst availableMetricKeys = allMetrics(permissions);\r\n\r\nexport function getPreference({\r\n preferenceService,\r\n preferenceName,\r\n dashboardPreferenceKey,\r\n cardId,\r\n activity,\r\n}) {\r\n const get = () => {\r\n const boardPreference = getPreferenceForDashboard({ preference: preferenceService, preferenceName, dashboardPreferenceKey });\r\n let cardPreferenceOptions = getCardPreferenceOptions(boardPreference, cardId);\r\n\r\n if (!cardPreferenceOptions\r\n || !_.isArray(cardPreferenceOptions.metrics)\r\n || _.some(cardPreferenceOptions.metrics, metric => !availableMetricKeys.includes(metric))\r\n || cardPreferenceOptions.metrics.length !== 4\r\n || !_.isArray(cardPreferenceOptions.selectedMetricIndexes)\r\n || cardPreferenceOptions.selectedMetricIndexes.length > 4\r\n || _.some(cardPreferenceOptions.selectedMetricIndexes, index => !validMetricIndexes.includes(index))\r\n ) {\r\n activity.trace(`Error preference format for perf chart: ${JSON.stringify(cardPreferenceOptions)}`);\r\n cardPreferenceOptions = null;\r\n }\r\n\r\n return cardPreferenceOptions || {\r\n selectedMetricIndexes: defaultSelectedMetricIndexes,\r\n // Expert account mode is 1\r\n metrics: defaultMetrics(permissions, 1),\r\n };\r\n };\r\n const set = (data) => {\r\n setPreferenceForCard({\r\n preference: preferenceService,\r\n preferenceName,\r\n dashboardPreferenceKey,\r\n cardId,\r\n cardOptions: data,\r\n });\r\n };\r\n\r\n return {\r\n get,\r\n set,\r\n };\r\n}\r\n","import _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport React, { useCallback, useMemo, useContext } from 'react';\r\n\r\nimport { PerformanceCard, PerformanceCardFluent } from '@bingads-webui-campaign-react/performance-card';\r\nimport { PerfMarkerFactory } from '@bingads-webui/performance-marker';\r\nimport { InstrumentationContext } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { cardPerformanceId } from '@bingads-webui-campaign/fluent-page-consts';\r\n\r\nimport { useData } from './use-data';\r\nimport { getPreference } from './preference';\r\n\r\nexport const preferenceName = 'dashboard/preferences';\r\nexport const dashboardPreferenceKey = 'default-campaign-performancemax';\r\nconst defaultGetCardsConfig = () => [{ id: cardPerformanceId }];\r\n\r\nconst perfMarker = PerfMarkerFactory.createMarker('Overview_PerformanceCard');\r\nperfMarker.willInit();\r\n\r\nexport const PerformanceCardContainer = (props) => {\r\n const {\r\n dateRange,\r\n filter,\r\n serverContext,\r\n perfMarkerUtils,\r\n sesId,\r\n i18n,\r\n preferenceService,\r\n selectedMetricIndexes,\r\n metrics,\r\n patchPreference,\r\n getCardsConfig,\r\n responsiveSize,\r\n shellContentElement,\r\n campaignType,\r\n constructOptions,\r\n } = props;\r\n const {\r\n CurrentAccount: {\r\n TimeZone,\r\n },\r\n } = serverContext;\r\n const instrumentation = useContext(InstrumentationContext);\r\n const { activity } = useMemo(() => instrumentation.createScenarioAndActivity({\r\n scenarioName: 'Fluent2OverviewPage',\r\n activityName: 'FluentPerformanceCard',\r\n }), [instrumentation]);\r\n const {\r\n willFetchData,\r\n willRender,\r\n done,\r\n } = perfMarkerUtils;\r\n\r\n const {\r\n initialSelectedMetricIndexesFromPreference,\r\n initialMetricsFromPreference,\r\n preferencePatch,\r\n } = useMemo(() => {\r\n // non pmax single campaign overview page is using new preference structure.\r\n if (selectedMetricIndexes && metrics && patchPreference) {\r\n return {\r\n initialSelectedMetricIndexesFromPreference: selectedMetricIndexes,\r\n initialMetricsFromPreference: metrics,\r\n preferencePatch: patchPreference,\r\n };\r\n }\r\n\r\n // in pmax single campaign overview page, we reuse the old preference structure from legacy overview page.\r\n // we may want to remove this after all the single campaign overview pages are migrated to new preference structure.\r\n const {\r\n get,\r\n set,\r\n } = getPreference({\r\n preferenceService,\r\n preferenceName,\r\n dashboardPreferenceKey,\r\n cardId: cardPerformanceId,\r\n activity,\r\n });\r\n const { selectedMetricIndexes: selectedMetricIndexesFromLegacy, metrics: metricsFromLegacy } = get();\r\n return {\r\n initialSelectedMetricIndexesFromPreference: selectedMetricIndexesFromLegacy,\r\n initialMetricsFromPreference: metricsFromLegacy,\r\n preferencePatch: set,\r\n };\r\n }, [activity, metrics, patchPreference, preferenceService, selectedMetricIndexes]);\r\n\r\n const {\r\n selectedMetricIndexes: selectedMetricIndexesFromDataHook,\r\n setSelectedMetricIndexes,\r\n visibleMetrics,\r\n setVisibleMetrics,\r\n performanceData,\r\n aggregatedMetricPickerData,\r\n hideCurrency,\r\n granularity,\r\n isLoading,\r\n isFirstDataLoaded,\r\n hasError,\r\n } = useData({\r\n dateRange,\r\n filter,\r\n i18n,\r\n initialSelectedMetricIndexesFromPreference,\r\n initialMetricsFromPreference,\r\n getCardsConfig,\r\n sesId,\r\n activity,\r\n willRender,\r\n willFetchData,\r\n campaignType,\r\n constructOptions,\r\n });\r\n\r\n const onMetricUpdate = useCallback((newSelectedMetricIndexes, newVisibleMetrics) => {\r\n setSelectedMetricIndexes(newSelectedMetricIndexes);\r\n setVisibleMetrics(newVisibleMetrics);\r\n\r\n preferencePatch({\r\n metrics: newVisibleMetrics,\r\n selectedMetricIndexes: newSelectedMetricIndexes,\r\n });\r\n }, [setSelectedMetricIndexes, setVisibleMetrics, preferencePatch]);\r\n\r\n if (isFirstDataLoaded) {\r\n done();\r\n }\r\n\r\n const Card = useMemo(() => (_.get(serverContext, ['Permissions', 'IsFluentPerformanceLinechartEnabled'], false) ? PerformanceCardFluent : PerformanceCard), [serverContext]);\r\n return (\r\n \r\n );\r\n};\r\n\r\nPerformanceCardContainer.propTypes = {\r\n dateRange: PropTypes.shape({\r\n start: PropTypes.instanceOf(Date).isRequired,\r\n end: PropTypes.instanceOf(Date).isRequired,\r\n compared: PropTypes.shape({\r\n start: PropTypes.instanceOf(Date).isRequired,\r\n end: PropTypes.instanceOf(Date).isRequired,\r\n }),\r\n }).isRequired,\r\n filter: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\r\n serverContext: PropTypes.shape({\r\n Urls: PropTypes.shape({\r\n ClientCenterBaseUrl: PropTypes.string.isRequired,\r\n }).isRequired,\r\n CurrentAccount: PropTypes.shape({\r\n TimeZone: PropTypes.number.isRequired,\r\n }),\r\n }).isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n sesId: PropTypes.number,\r\n preferenceService: PropTypes.shape({}),\r\n selectedMetricIndexes: PropTypes.arrayOf(PropTypes.number),\r\n metrics: PropTypes.arrayOf(PropTypes.string),\r\n patchPreference: PropTypes.func,\r\n getCardsConfig: PropTypes.func,\r\n responsiveSize: PropTypes.string.isRequired,\r\n perfMarkerUtils: PropTypes.shape({\r\n willFetchData: PropTypes.func.isRequired,\r\n willRender: PropTypes.func.isRequired,\r\n done: PropTypes.func.isRequired,\r\n }).isRequired,\r\n shellContentElement: PropTypes.instanceOf(Element),\r\n campaignType: PropTypes.oneOfType([\r\n PropTypes.string,\r\n PropTypes.number,\r\n ]).isRequired,\r\n};\r\n\r\nPerformanceCardContainer.defaultProps = {\r\n sesId: -1,\r\n selectedMetricIndexes: null,\r\n metrics: null,\r\n patchPreference: null,\r\n getCardsConfig: defaultGetCardsConfig,\r\n shellContentElement: document.querySelector('body'),\r\n preferenceService: undefined,\r\n};\r\n","import { useState, useEffect, useMemo, useContext } from 'react';\r\nimport stringify from 'json-stable-stringify';\r\nimport _ from 'underscore';\r\n\r\n// Move legacy deps and data reading out from UI component\r\nimport edm from '@bingads-webui-component-legacy/edm-campaign/index';\r\nimport {\r\n getFilteredTotalsMetrics,\r\n availableGranularities,\r\n fetchAggregatedData,\r\n allMetrics,\r\n metricToDisplayNameMap,\r\n AccountsMode,\r\n} from '@bingads-webui-campaign/overview-cards-common';\r\n\r\nimport dateUtil from '@bingads-webui-component-legacy/humanize/date';\r\nimport { fetchPerformanceTimeSeries } from '@bingads-webui-campaign-legacy/performance-graph/data-fetch';\r\nimport jsdata from '@bingads-webui-component-legacy/js-data-campaign/index';\r\nimport config from '@bingads-webui-component-legacy/config/index';\r\nimport { formatMetric } from '@bingads-webui-campaign-legacy/performance-metric-formatter/index';\r\nimport legacyPreference from '@bingads-webui-component-legacy/preference/service/index';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { cardPerformanceId } from '@bingads-webui-campaign/fluent-page-consts';\r\n\r\nimport {\r\n getNavigationLevel,\r\n NavigationLevel,\r\n useIsPreferenceInitialized,\r\n} from '@bingads-webui-campaign/fluent-page-data';\r\n\r\n\r\nexport function useData({\r\n dateRange,\r\n filter,\r\n i18n,\r\n initialSelectedMetricIndexesFromPreference,\r\n initialMetricsFromPreference,\r\n getCardsConfig,\r\n sesId,\r\n activity,\r\n willRender,\r\n willFetchData,\r\n campaignType,\r\n constructOptions,\r\n}) {\r\n const [selectedMetricIndexes, setSelectedMetricIndexes] = useState([]);\r\n const [visibleMetrics, setVisibleMetrics] = useState([]);\r\n const [performanceData, setPerformanceData] = useState([]);\r\n const [aggregatedMetricPickerData, setAggregatedMetricPickerData] = useState([]);\r\n const [hideCurrency, setHideCurrency] = useState(false);\r\n const [isChartLoading, setIsChartLoading] = useState(false);\r\n const [isMetricLoading, setIsMetricLoading] = useState(false);\r\n const [isFirstDataLoaded, setIsFirstDataLoaded] = useState(false);\r\n const [hasError, setHasError] = useState(false);\r\n const { scope } = useContext(ScopeContext);\r\n\r\n const navigationLevel = useMemo(() => getNavigationLevel(scope.values), [scope.values]);\r\n const granularity = useMemo(() => availableGranularities(dateRange, dateUtil)[0], [dateRange]);\r\n const isPreferenceInitialized = useIsPreferenceInitialized(legacyPreference);\r\n useEffect(() => {\r\n if (isPreferenceInitialized && _.isEmpty(visibleMetrics)) {\r\n setSelectedMetricIndexes(initialSelectedMetricIndexesFromPreference);\r\n setVisibleMetrics(initialMetricsFromPreference);\r\n }\r\n }, [isPreferenceInitialized, visibleMetrics, initialSelectedMetricIndexesFromPreference, initialMetricsFromPreference]);\r\n\r\n const isLoading = isChartLoading || isMetricLoading;\r\n const dateString = stringify(dateRange);\r\n const filterString = stringify(filter);\r\n\r\n const entitySet = useMemo(() => {\r\n if (constructOptions) {\r\n return constructOptions({\r\n campaignType,\r\n navigationLevel,\r\n }).entitySet;\r\n }\r\n\r\n // Now Pmax Campaign Overview page is using this path without constructOptions\r\n // After we merge Pmax Campaign Overview page into our new page, we can remove this.\r\n return edm.currentAccount.Campaigns;\r\n }, [campaignType, constructOptions, navigationLevel]);\r\n\r\n const params = new URLSearchParams(document.location.search);\r\n const campaignId = params.get('campaignId');\r\n const extendedFilter = useMemo(() => {\r\n let extraFilter = [];\r\n if (constructOptions) {\r\n ({ extraFilter = [] } = constructOptions({\r\n campaignType,\r\n navigationLevel,\r\n }));\r\n // Now Pmax Campaign Overview page is using this path without constructOptions\r\n // After we merge Pmax Campaign Overview page into our new page, we can remove this.\r\n } else if (campaignId) {\r\n extraFilter = [{\r\n filter: {\r\n key: 'CampaignId',\r\n value: {\r\n query: {\r\n Id: Number(campaignId),\r\n },\r\n },\r\n },\r\n }];\r\n }\r\n\r\n let baseFilter = filter || [];\r\n if (campaignId) {\r\n // If we have campaign Id in query, we should not apply any campaign status filter anymore.\r\n baseFilter = baseFilter.filter(item => _.isEmpty(_.result(item, ['filter', 'value', 'query', 'CampaignStatus'])));\r\n }\r\n return [\r\n ...baseFilter,\r\n ...extraFilter,\r\n ];\r\n // we cannot check object filter here, because it will always be a different object\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [campaignId, constructOptions, filterString]);\r\n const fetchSingleTile = navigationLevel === NavigationLevel.Campaign;\r\n\r\n useEffect(() => {\r\n if (dateRange && filter && !isLoading) {\r\n setIsChartLoading(true);\r\n setIsMetricLoading(true);\r\n setHasError(false);\r\n setAggregatedMetricPickerData([]);\r\n activity.trace(`Load fluent perf chart data with new date and filter value: date: ${dateString} filter: ${filterString}`);\r\n willFetchData();\r\n fetchPerformanceTimeSeries({\r\n entitySet,\r\n movingAverage: false,\r\n period: dateRange,\r\n filter: extendedFilter,\r\n campaignType,\r\n granularity,\r\n navigationLevel,\r\n // TODO: this is used for account level call, we need to handle this in the future\r\n getCardsConfig,\r\n fetchSingleTile,\r\n accountsMode: 1,\r\n dfmCacheKey: `${cardPerformanceId}-time-series`,\r\n }).then((data) => {\r\n // This interface is weird, it still resolves if there is an error\r\n if (!data || !data.performanceTimeSeries) {\r\n setHasError(true);\r\n activity.error(`Load fluent perf chart data error: ${JSON.stringify(data)}`);\r\n return;\r\n }\r\n\r\n setPerformanceData(data.performanceTimeSeries);\r\n }).finally(() => {\r\n setIsChartLoading(false);\r\n setIsFirstDataLoaded(true);\r\n willRender();\r\n }).catch((e) => {\r\n setHasError(true);\r\n activity.error(`Load fluent perf chart data error: ${JSON.stringify(e)}`);\r\n });\r\n\r\n const permissions = config.get('Permissions');\r\n fetchAggregatedData({\r\n entitySet,\r\n dateRange,\r\n filter: extendedFilter,\r\n jsdata,\r\n dateUtil,\r\n navigationLevel,\r\n getCardsConfig,\r\n fetchSingleTile,\r\n accountsMode: 1,\r\n permissions,\r\n dfmCacheKey: `${cardPerformanceId}-aggregated-data`,\r\n campaignType,\r\n }).then((data) => {\r\n // This interface is weird, it still resolves if there is an error\r\n if (!data || (!data.raw && !data.OverallTotals)) {\r\n setHasError(true);\r\n activity.error(`Load fluent perf chart aggregated data error: ${JSON.stringify(data)}`);\r\n return;\r\n }\r\n const totalMetrics = getFilteredTotalsMetrics({\r\n data,\r\n metric: 'PerformanceMetrics',\r\n }) || {};\r\n const availableMetricKeys = allMetrics(permissions, AccountsMode.Expert, campaignType);\r\n const availableTotalMetrics = _.pick(totalMetrics, availableMetricKeys);\r\n setHideCurrency(data.AccountsHaveDifferentCurrencies);\r\n const metricPickerData = Object.keys(availableTotalMetrics).map((key) => {\r\n const metric = totalMetrics[key];\r\n return {\r\n key,\r\n total: formatMetric(\r\n key,\r\n metric || 0,\r\n { hideCurrency: data.AccountsHaveDifferentCurrencies }\r\n ),\r\n displayName: i18n.getString(metricToDisplayNameMap[key]),\r\n };\r\n });\r\n setAggregatedMetricPickerData(metricPickerData);\r\n }).finally(() => {\r\n setIsMetricLoading(false);\r\n }).catch((e) => {\r\n setHasError(true);\r\n activity.error(`Load fluent perf chart aggregated data error: ${JSON.stringify(e)}`);\r\n });\r\n }\r\n\r\n // we only update when dateString, filterString, sesId change\r\n // we cannot check object dateRange and filter here, because they will always be a different object\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [dateString, filterString, sesId, campaignType]);\r\n\r\n return {\r\n selectedMetricIndexes,\r\n setSelectedMetricIndexes,\r\n visibleMetrics,\r\n setVisibleMetrics,\r\n performanceData,\r\n aggregatedMetricPickerData,\r\n hideCurrency,\r\n granularity,\r\n isLoading,\r\n isFirstDataLoaded,\r\n hasError,\r\n };\r\n}\r\n","export const DetailCardsKey = {\r\n campaign: 'campaign',\r\n billing: 'billing',\r\n editorial: 'editorial',\r\n conversionTracking: 'conversionTracking',\r\n bidding: 'bidding',\r\n assetGroup: 'assetGroup',\r\n};\r\n","import _ from 'underscore';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\n\r\nexport const isCampaignEditorialPending\r\n = assetGroups => assetGroups.every(assetGroup => assetGroup.DeliveryStatus === 'EditorialUnderAppeal' || assetGroup.DeliveryStatus === 'EditorialPending');\r\n\r\nexport function statusAndActionReport({\r\n activity,\r\n type,\r\n status,\r\n details,\r\n action,\r\n}) {\r\n const message = {\r\n type,\r\n action,\r\n status,\r\n details,\r\n };\r\n activity.trace(JSON.stringify(message));\r\n}\r\n\r\nexport function auditPointDisplayed({\r\n activity,\r\n auditPoint,\r\n area,\r\n}) {\r\n activity.trace(`Diagnostic card: display ${auditPoint} area:${area}`);\r\n}\r\n\r\nexport function getFullProductUrl(routeName, scope, extraParams = []) {\r\n const baseParams = ['aid', 'cid', 'uid'];\r\n const params = baseParams.concat(extraParams);\r\n const pathname = getRoutePathById(allSiteMap, routeName);\r\n const search = params.reduce((result, param) => {\r\n const value = _.get(scope, ['values', param]);\r\n if (value != null) {\r\n return result.concat(`${param}=${value}`);\r\n }\r\n return result;\r\n }, []).join('&');\r\n\r\n return `${pathname}?${search}`;\r\n}\r\n","import { isSDK } from '@bingads-webui-campaign-react/sdk-utils';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\nimport { Status } from '@bingads-webui-campaign-react/diagnostic-card';\r\n\r\nimport { DetailCardsKey } from '../const';\r\nimport { statusAndActionReport, auditPointDisplayed, getFullProductUrl } from './utils';\r\n\r\nconst BILLING_ISSUE_LIST = ['PrepayAccountOutOfBalance', 'AddPaymentInstrument'];\r\nconst BANNER_ALERT = 'BannerAlert';\r\nconst DANGER = 'danger';\r\n\r\nexport function getBillingDetail({\r\n billing,\r\n i18n,\r\n scope,\r\n ccBaseUrl,\r\n activity,\r\n}) {\r\n const name = i18n.getString(_TL_('Billing'));\r\n const key = DetailCardsKey.billing;\r\n\r\n const paymentError = billing.find(notification => notification.alertType === BANNER_ALERT\r\n && notification.NotificationLevel === DANGER\r\n && BILLING_ISSUE_LIST.includes(notification.NotificationId));\r\n\r\n if (paymentError) {\r\n statusAndActionReport({\r\n activity,\r\n type: 'billing',\r\n status: Status.Error,\r\n });\r\n\r\n auditPointDisplayed({ activity, auditPoint: 'Payment failed', area: 'Payment' });\r\n return {\r\n name,\r\n key,\r\n status: Status.Error,\r\n statusLabelMsg: i18n.getString(_TL_('Failed')),\r\n cardTitle: i18n.getString(_TL_('Payment failed')),\r\n cardMsg: i18n.getString(_TL_('The previous payment failed. Please make sure your payment method is still valid.')),\r\n onCardButtonClicked: () => {\r\n statusAndActionReport({\r\n activity,\r\n type: 'billing',\r\n action: 'navigate to payment methods page',\r\n details: 'AuditPoint: Payment failed',\r\n });\r\n\r\n const ccBaseUrlNoTrailingSlash = ccBaseUrl.replace(/\\/$/, '');\r\n if (!isSDK()) {\r\n const paymentPath = getRoutePathById(allSiteMap, 'paymentMethods');\r\n scope.remove(['campaignId']);\r\n scope.save(`${ccBaseUrlNoTrailingSlash}${paymentPath}`);\r\n } else {\r\n const url = `${ccBaseUrlNoTrailingSlash}${getFullProductUrl('paymentMethods', scope)}`;\r\n window.open(url);\r\n }\r\n },\r\n cardButtonText: i18n.getString(_TL_('Check payment method')),\r\n };\r\n }\r\n\r\n statusAndActionReport({\r\n activity,\r\n type: 'billing',\r\n status: Status.Active,\r\n });\r\n\r\n return {\r\n name,\r\n key,\r\n status: Status.Active,\r\n statusLabelMsg: i18n.getString(_TL_('Active')),\r\n };\r\n}\r\n","import _ from 'underscore';\r\nimport { edmCampaign } from '@bingads-webui/edm-campaign';\r\nimport { isSDK } from '@bingads-webui-campaign-react/sdk-utils';\r\nimport { Status } from '@bingads-webui-campaign-react/diagnostic-card';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\n\r\nimport { statusAndActionReport, auditPointDisplayed, getFullProductUrl } from './utils';\r\nimport { DetailCardsKey } from '../const';\r\n\r\nconst STATUS_TEXT = {\r\n Active: _TL_('Active'),\r\n Paused: _TL_('Paused'),\r\n UnderReview: _TL_('Under review'),\r\n BudgetPaused: _TL_('Budget paused'),\r\n};\r\n\r\nconst getCardDetails = ({\r\n auditPoint, scope, i18n, activity, alertHelper, locale,\r\n}) => {\r\n const {\r\n values: {\r\n cid,\r\n aid,\r\n campaignId,\r\n },\r\n } = scope;\r\n\r\n const onNavigateToBudgetEditSettingsPage = () => {\r\n statusAndActionReport({\r\n activity,\r\n type: 'campaign',\r\n action: 'navigate to settings page',\r\n details: `AuditPoint: ${auditPoint}`,\r\n });\r\n\r\n if (!isSDK()) {\r\n scope.save(getRoutePathById(allSiteMap, 'settings'));\r\n } else {\r\n const url = getRoutePathById(allSiteMap, 'sdk-budget-settings');\r\n scope.save(url);\r\n }\r\n };\r\n\r\n const onNavigateToAssetGroupsPage = () => {\r\n statusAndActionReport({\r\n activity,\r\n type: 'campaign',\r\n action: 'navigate to asset groups page',\r\n details: `AuditPoint: ${auditPoint}`,\r\n });\r\n\r\n scope.save(getRoutePathById(allSiteMap, 'appadsassetgroups'));\r\n };\r\n\r\n auditPointDisplayed({ activity, auditPoint, area: 'Campaign' });\r\n\r\n switch (auditPoint) {\r\n case 'CampaignStatusUserPaused':\r\n return {\r\n cardTitle: i18n.getString(_TL_('Reactivate your campaign')),\r\n cardMsg: i18n.getString(_TL_('A paused campaign cannot generate impressions or conversions.')),\r\n onCardButtonClicked: () => {\r\n statusAndActionReport({\r\n activity,\r\n type: 'campaign',\r\n action: 'unpause campaign',\r\n details: `AuditPoint: ${auditPoint}`,\r\n });\r\n\r\n edmCampaign\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid)\r\n .Campaigns.$withKey(campaignId)\r\n .bulkUpdate({\r\n Id: campaignId,\r\n Status: 'Active',\r\n }).then(() => {\r\n alertHelper.showSuccess(i18n.getString(_TL_('Campaign reactivated.')));\r\n }, (e) => {\r\n activity.error(JSON.stringify(e));\r\n alertHelper.showError(i18n.getString(_TL_('We\\'ve encountered an error and can\\'t continue. Please contact support for further assistance.')));\r\n });\r\n },\r\n cardButtonText: i18n.getString(_TL_('Reactivate')),\r\n };\r\n\r\n case 'AllAssetGroupsEditorialPending':\r\n return {\r\n cardMsg: i18n.getString(_TL_('There are one or multiple asset groups in this campaign still under editorial review.')),\r\n };\r\n\r\n case 'CampaignStatusBudgetPaused':\r\n case 'CampaignStatusActiveButBudgetPaused':\r\n return {\r\n statusLabelMsg: i18n.getString(_TL_('Eligible (limited)')),\r\n status: Status.Warning,\r\n cardTitle: i18n.getString(_TL_('Campaign is eligible but limited by budget')),\r\n cardMsg: i18n.getString(_TL_('Your campaign ran out of budget recently, which caused your ads not being shown as often as they could be. Raising your budget can help make sure you don\\'t lose out on potential customers. To resume your ads now, you can increase your budget.')),\r\n onCardButtonClicked: onNavigateToBudgetEditSettingsPage,\r\n cardButtonText: i18n.getString(_TL_('Fix now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/53050/1`,\r\n };\r\n\r\n case 'CampaignStatusOutOfBudget':\r\n case 'CampaignStatusPausedAndOutOfBudget':\r\n return {\r\n statusLabelMsg: i18n.getString(_TL_('Paused by budget constraint')),\r\n cardTitle: i18n.getString(_TL_('Paused campaign due to budget constraints')),\r\n cardMsg: i18n.getString(_TL_('Because your campaign has run out of budget, we\\'ve paused your ads. Ad delivery will resume at the start of the next day. To resume your ads now, you can increase your budget.')),\r\n onCardButtonClicked: onNavigateToBudgetEditSettingsPage,\r\n cardButtonText: i18n.getString(_TL_('Fix now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/53050/1`,\r\n };\r\n\r\n case 'MissVideoAsset':\r\n return {\r\n statusLabelMsg: i18n.getString(_TL_('Missing Video')),\r\n cardTitle: i18n.getString(_TL_('Missing video assets')),\r\n cardMsg: i18n.getString(_TL_('Your campaign has no video assets. Add videos now to boost your campaign\\'s reach and improve performance.')),\r\n onCardButtonClicked: onNavigateToAssetGroupsPage,\r\n cardButtonText: i18n.getString(_TL_('Review')),\r\n };\r\n\r\n case 'CampaignStatusActive':\r\n return {};\r\n\r\n default:\r\n activity.error(`Audit point mapping not found in getCampaignStatus:${auditPoint}`);\r\n return {};\r\n }\r\n};\r\n\r\nexport const getCampaignStatus = ({\r\n details, scope, i18n, activity, locale, alertHelper,\r\n}) => {\r\n if (_.isEmpty(details)\r\n || _.isEmpty(_.get(details, 'Value'))\r\n || _.get(details, ['Value', 'ErrorCode'], 0) !== 0\r\n || _.get(details, ['Value', 'ErrorMessage'])) {\r\n statusAndActionReport({\r\n activity,\r\n type: 'campaign',\r\n details: `Error - details: ${JSON.stringify(details)}`,\r\n });\r\n return {\r\n name: i18n.getString(_TL_('Campaign')),\r\n key: DetailCardsKey.campaign,\r\n };\r\n }\r\n\r\n const status = _.get(details, ['Value', 'Status']);\r\n const auditPoint = _.get(details, ['Value', 'AuditPoints', 0]);\r\n\r\n const cardDetails = getCardDetails({\r\n auditPoint, scope, i18n, activity, alertHelper, locale,\r\n });\r\n\r\n let statusIcon = Status.Error;\r\n\r\n if (status === 'Active') {\r\n statusIcon = Status.Active;\r\n } else if (status === 'UnderReview') {\r\n statusIcon = Status.Pending;\r\n }\r\n\r\n return {\r\n name: i18n.getString(_TL_('Campaign')),\r\n key: DetailCardsKey.campaign,\r\n\r\n status: statusIcon,\r\n statusLabelMsg: i18n.getString(_.get(STATUS_TEXT, status, _TL_(''))),\r\n\r\n ...cardDetails,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport { isSDK } from '@bingads-webui-campaign-react/sdk-utils';\r\nimport { Status } from '@bingads-webui-campaign-react/diagnostic-card';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\n\r\nimport { statusAndActionReport, auditPointDisplayed, getFullProductUrl } from './utils';\r\nimport { DetailCardsKey } from '../const';\r\n\r\nconst STATUS_TEXT = {\r\n InReview: _TL_('In review'),\r\n Rejected: _TL_('Rejected'),\r\n Approved: _TL_('Approved'),\r\n Limited: _TL_('Limited'),\r\n};\r\n\r\n\r\nconst getCardDetails = ({\r\n auditPoint, scope, i18n, activity, locale, campaignType,\r\n}) => {\r\n const isCampaignTypeApp = (campaignType && campaignType === 'App') ?? false;\r\n\r\n const onCardButtonClicked = () => {\r\n statusAndActionReport({\r\n activity,\r\n type: 'editorial',\r\n action: 'navigate to asset groups page',\r\n details: `AuditPoint: ${auditPoint}`,\r\n });\r\n\r\n if (!isSDK()) {\r\n const assetGroupUrl = isCampaignTypeApp ? getRoutePathById(allSiteMap, 'appads-asset-groups') : getRoutePathById(allSiteMap, 'asset-groups');\r\n scope.save(assetGroupUrl);\r\n } else {\r\n const url = getFullProductUrl('asset-groups', scope, ['campaignId']);\r\n window.open(url);\r\n }\r\n };\r\n\r\n auditPointDisplayed({ activity, auditPoint, area: 'Editorial' });\r\n\r\n switch (auditPoint) {\r\n case 'AllAssetGroupsEditorialRejected':\r\n case 'AllAssetGroupsEditorialAppealRejected':\r\n case 'AllAssetGroupsEditorialRejectedOrAppealRejected':\r\n return {\r\n cardTitle: i18n.getString(_TL_('All assets rejected')),\r\n cardMsg: i18n.getString(_TL_('None of your assets meet our requirements. Please check and fix them.')),\r\n onCardButtonClicked,\r\n cardButtonText: i18n.getString(_TL_('Fix assets')),\r\n };\r\n\r\n case 'AllAssetGroupsEditorialLimited':\r\n return {\r\n status: Status.Warning,\r\n statusLabelMsg: i18n.getString(_TL_('Approved limited')),\r\n cardMsg: i18n.getString(_TL_('The asset groups have been approved in at least one of your targeted locations, but have also been disapproved in at least one other targeted location.')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/52302/1`,\r\n cardTitle: i18n.getString(_TL_('Asset groups editorial limited')),\r\n onCardButtonClicked,\r\n cardButtonText: i18n.getString(_TL_('Fix assets')),\r\n };\r\n\r\n case 'NoAssetGroups':\r\n return {\r\n statusLabelMsg: i18n.getString(_TL_('No asset group')),\r\n cardTitle: i18n.getString(_TL_('There are no asset groups in this campaign')),\r\n cardMsg: i18n.getString(_TL_('Looks like your campaign doesn\\'t have asset groups yet. Create at least one asset group to get started.')),\r\n onCardButtonClicked,\r\n cardButtonText: i18n.getString(_TL_('Fix now')),\r\n learnMoreLink: isCampaignTypeApp ? `https://help.ads.microsoft.com/#apex/ads/${locale}/60350/0/#TechnicalRequirements` : `https://help.ads.microsoft.com/#apex/ads/${locale}/60176/0`,\r\n };\r\n\r\n case 'NoActiveAssetGroups':\r\n return {\r\n statusLabelMsg: i18n.getString(_TL_('No active asset group')),\r\n cardTitle: i18n.getString(_TL_('There are no active asset groups in this campaign')),\r\n cardMsg: i18n.getString(_TL_('Your campaign did not perform because there are no active asset groups. To receive clicks and conversions, add an active asset group.')),\r\n onCardButtonClicked,\r\n cardButtonText: i18n.getString(_TL_('Fix now')),\r\n learnMoreLink: isCampaignTypeApp ? `https://help.ads.microsoft.com/#apex/ads/${locale}/60350/0/#TechnicalRequirements` : `https://help.ads.microsoft.com/#apex/ads/${locale}/60176/0`,\r\n };\r\n\r\n case 'AllAssetGroupsEditorialUnderAppeal':\r\n case 'AllAssetGroupsEditorialUnderAppealOrPending':\r\n return {\r\n cardMsg: i18n.getString(_TL_('One or multiple asset groups in this campaign are under editorial review.')),\r\n };\r\n\r\n case 'AllAssetGroupsEditorialApproved':\r\n case 'AllAssetGroupsEditorialPending':\r\n return {};\r\n\r\n\r\n case 'AllAdGroupsEditorialRejected':\r\n case 'AllAdGroupsEditorialAppealRejected':\r\n case 'AllAdGroupsEditorialRejectedOrAppealRejected':\r\n return {\r\n cardTitle: i18n.getString(_TL_('All ad groups rejected')),\r\n cardMsg: i18n.getString(_TL_('None of your ad groups meet our requirements. Please check and fix them.')),\r\n onCardButtonClicked,\r\n cardButtonText: i18n.getString(_TL_('Fix ad groups')),\r\n };\r\n\r\n case 'AllAdGroupsEditorialLimited':\r\n return {\r\n status: Status.Warning,\r\n statusLabelMsg: i18n.getString(_TL_('Approved limited')),\r\n cardMsg: i18n.getString(_TL_('The ad groups have been approved in at least one of your targeted locations, but have also been disapproved in at least one other targeted location.')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/52302/1`,\r\n cardTitle: i18n.getString(_TL_('Ad groups editorial limited')),\r\n onCardButtonClicked,\r\n cardButtonText: i18n.getString(_TL_('Fix ad groups')),\r\n };\r\n\r\n case 'NoAdGroups':\r\n return {\r\n statusLabelMsg: i18n.getString(_TL_('No ad group')),\r\n cardTitle: i18n.getString(_TL_('There are no ad groups in this campaign')),\r\n cardMsg: i18n.getString(_TL_('Looks like your campaign doesn\\'t have ad groups yet. Create at least one ad group to get started.')),\r\n onCardButtonClicked,\r\n cardButtonText: i18n.getString(_TL_('Fix now')),\r\n learnMoreLink: isCampaignTypeApp ? `https://help.ads.microsoft.com/#apex/ads/${locale}/60350/0/#TechnicalRequirements` : `https://help.ads.microsoft.com/#apex/ads/${locale}/60176/0`,\r\n };\r\n\r\n case 'NoActiveAdGroups':\r\n return {\r\n statusLabelMsg: i18n.getString(_TL_('No active ad group')),\r\n cardTitle: i18n.getString(_TL_('There are no active ad groups in this campaign')),\r\n cardMsg: i18n.getString(_TL_('Your campaign did not perform because there are no active ad groups. To receive clicks and conversions, add an active ad group.')),\r\n onCardButtonClicked,\r\n cardButtonText: i18n.getString(_TL_('Fix now')),\r\n learnMoreLink: isCampaignTypeApp ? `https://help.ads.microsoft.com/#apex/ads/${locale}/60350/0/#TechnicalRequirements` : `https://help.ads.microsoft.com/#apex/ads/${locale}/60176/0`,\r\n };\r\n\r\n case 'AllAdGroupsEditorialUnderAppeal':\r\n case 'AllAdGroupsEditorialUnderAppealOrPending':\r\n return {\r\n cardMsg: i18n.getString(_TL_('One or multiple ad groups in this campaign are under editorial review.')),\r\n };\r\n\r\n case 'AllAdGroupsEditorialApproved':\r\n case 'AllAdGroupsEditorialPending':\r\n return {};\r\n\r\n default:\r\n activity.error(`Audit point mapping not found in getEditorialStatus:${auditPoint}`);\r\n return {};\r\n }\r\n};\r\n\r\nexport const getEditorialStatus = ({\r\n details, scope, i18n, activity, locale, campaignType,\r\n}) => {\r\n if (_.isEmpty(details)\r\n || _.isEmpty(_.get(details, 'Value'))\r\n || _.get(details, ['Value', 'ErrorCode'], 0) !== 0\r\n || _.get(details, ['Value', 'ErrorMessage'])) {\r\n statusAndActionReport({\r\n activity,\r\n type: 'editorial',\r\n details: `Error - details: ${JSON.stringify(details)}`,\r\n });\r\n return {\r\n name: i18n.getString(_TL_('Editorial')),\r\n key: DetailCardsKey.editorial,\r\n };\r\n }\r\n\r\n const status = _.get(details, ['Value', 'Status']);\r\n const auditPoint = _.get(details, ['Value', 'AuditPoints', 0]);\r\n\r\n const cardDetails = getCardDetails({\r\n auditPoint, scope, i18n, activity, locale, campaignType,\r\n });\r\n let statusIcon = Status.Error;\r\n if (status === 'Approved') {\r\n statusIcon = Status.Active;\r\n } else if (status === 'InReview') {\r\n statusIcon = Status.Pending;\r\n }\r\n\r\n return {\r\n name: i18n.getString(_TL_('Editorial')),\r\n key: DetailCardsKey.editorial,\r\n\r\n status: statusIcon,\r\n statusLabelMsg: i18n.getString(_.get(STATUS_TEXT, status, _TL_(''))),\r\n\r\n ...cardDetails,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport { Status } from '@bingads-webui-campaign-react/diagnostic-card';\r\nimport { isSDK } from '@bingads-webui-campaign-react/sdk-utils';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\n\r\nimport { statusAndActionReport, auditPointDisplayed, getFullProductUrl } from './utils';\r\nimport { DetailCardsKey } from '../const';\r\n\r\nconst STATUS_TEXT = {\r\n NoIssue: _TL_('No issue'),\r\n InappropriateTarget: _TL_('Inappropriate target'),\r\n};\r\n\r\nexport const getBiddingStatus = ({\r\n details, scope, i18n, activity, locale,\r\n}) => {\r\n if (_.isEmpty(details)\r\n || _.isEmpty(_.get(details, 'Value'))\r\n || _.get(details, ['Value', 'ErrorCode'], 0) !== 0\r\n || _.get(details, ['Value', 'ErrorMessage'])) {\r\n statusAndActionReport({\r\n activity,\r\n type: 'bidding',\r\n details: `Error - details: ${JSON.stringify(details)}`,\r\n });\r\n return {\r\n name: i18n.getString(_TL_('Bid strategy')),\r\n key: DetailCardsKey.bidding,\r\n };\r\n }\r\n\r\n const status = _.get(details, ['Value', 'Status']);\r\n const auditPoint = _.get(details, ['Value', 'AuditPoints', 0]);\r\n\r\n if (!['AutoBiddingLimitedUnAttainableTarget', 'BiddingStatusNormal'].includes(auditPoint)) {\r\n activity.error(`Audit point mapping not found in getBiddingStatus:${auditPoint}`);\r\n }\r\n\r\n auditPointDisplayed({ activity, auditPoint, area: 'Bidding' });\r\n\r\n const cardDetails = auditPoint === 'AutoBiddingLimitedUnAttainableTarget' ? {\r\n statusLabelMsg: i18n.getString(_TL_('Limited by auto-bidding target')),\r\n cardTitle: i18n.getString(_TL_('Set an appropriate target for your bid strategy')),\r\n cardMsg: i18n.getString(_TL_('Your campaign\\'s performance is limited by your bid\\'s target . You\\'ll improve your conversion rate by decreasing the target ROAS or increasing the target CPA.')),\r\n onCardButtonClicked: () => {\r\n statusAndActionReport({\r\n activity,\r\n type: 'bidding',\r\n action: 'navigate to settings page',\r\n details: `AuditPoint: ${auditPoint}`,\r\n });\r\n\r\n if (!isSDK()) {\r\n scope.save(getRoutePathById(allSiteMap, 'settings'));\r\n } else {\r\n const url = getRoutePathById(allSiteMap, 'sdk-budget-settings');\r\n scope.save(url);\r\n }\r\n },\r\n cardButtonText: i18n.getString(_TL_('Fix now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/56786/1`,\r\n } : {};\r\n\r\n return {\r\n name: i18n.getString(_TL_('Bid strategy')),\r\n key: DetailCardsKey.bidding,\r\n\r\n status: status === 'NoIssue' ? Status.Active : Status.Error,\r\n statusLabelMsg: i18n.getString(_.get(STATUS_TEXT, status, _TL_(''))),\r\n\r\n ...cardDetails,\r\n };\r\n};\r\n","import _ from 'underscore';\r\n\r\nconst ACTION_OPERATOR_TEXT = {\r\n EqualsTo: _TL_('\"Action Equals to {{value}}\"'),\r\n BeginsWith: _TL_('\"Action Begins with {{value}}\"'),\r\n Contains: _TL_('\"Action Contains {{value}}\"'),\r\n RegularExpression: _TL_('\"Action Regular expression {{value}}\"'),\r\n};\r\n\r\nconst CATEGORY_OPERATOR_TEXT = {\r\n EqualsTo: _TL_('\"Category Equals to {{value}}\"'),\r\n BeginsWith: _TL_('\"Category Begins with {{value}}\"'),\r\n Contains: _TL_('\"Category Contains {{value}}\"'),\r\n RegularExpression: _TL_('\"Category Regular expression {{value}}\"'),\r\n};\r\n\r\nconst LABEL_OPERATOR_TEXT = {\r\n EqualsTo: _TL_('\"Label Equals to {{value}}\"'),\r\n BeginsWith: _TL_('\"Label Begins with {{value}}\"'),\r\n Contains: _TL_('\"Label Contains {{value}}\"'),\r\n RegularExpression: _TL_('\"Label Regular expression {{value}}\"'),\r\n};\r\n\r\nconst VALUE_OPERATOR_TEXT = {\r\n EqualsTo: _TL_('\"Value Equals to {{value}}\"'),\r\n LessThan: _TL_('\"Value Less than {{value}}\"'),\r\n GreaterThan: _TL_('\"Value Greater than {{value}}\"'),\r\n};\r\n\r\nexport const getInvalidEventStrings = ({ i18n, fix = {} }) => {\r\n const {\r\n CurrentEventCategory,\r\n CurrentEventCategoryOperator,\r\n CurrentEventAction,\r\n CurrentEventActionOperator,\r\n CurrentEventLabel,\r\n CurrentEventLabelOperator,\r\n CurrentEventValue,\r\n CurrentEventValueOperator,\r\n SuggestedEventCategory,\r\n SuggestedEventCategoryOperator,\r\n SuggestedEventAction,\r\n SuggestedEventActionOperator,\r\n SuggestedEventLabel,\r\n SuggestedEventLabelOperator,\r\n SuggestedEventValue,\r\n SuggestedEventValueOperator,\r\n } = fix;\r\n\r\n const currentArray = [];\r\n const suggestedArray = [];\r\n if (!_.isEmpty(CurrentEventActionOperator) && !_.isEmpty(CurrentEventAction)) {\r\n currentArray.push(i18n.getString(ACTION_OPERATOR_TEXT[CurrentEventActionOperator] || _TL_(''), { value: CurrentEventAction }));\r\n }\r\n if (!_.isEmpty(SuggestedEventActionOperator) && !_.isEmpty(SuggestedEventAction)) {\r\n suggestedArray.push(i18n.getString(ACTION_OPERATOR_TEXT[SuggestedEventActionOperator] || _TL_(''), { value: SuggestedEventAction }));\r\n }\r\n\r\n if (!_.isEmpty(CurrentEventCategoryOperator) && !_.isEmpty(CurrentEventCategory)) {\r\n currentArray.push(i18n.getString(CATEGORY_OPERATOR_TEXT[CurrentEventCategoryOperator] || _TL_(''), { value: CurrentEventCategory }));\r\n }\r\n if (!_.isEmpty(SuggestedEventCategoryOperator) && !_.isEmpty(SuggestedEventCategory)) {\r\n suggestedArray.push(i18n.getString(CATEGORY_OPERATOR_TEXT[SuggestedEventCategoryOperator] || _TL_(''), { value: SuggestedEventCategory }));\r\n }\r\n\r\n if (!_.isEmpty(CurrentEventLabelOperator) && !_.isEmpty(CurrentEventLabel)) {\r\n currentArray.push(i18n.getString(LABEL_OPERATOR_TEXT[CurrentEventLabelOperator] || _TL_(''), { value: CurrentEventLabel }));\r\n }\r\n if (!_.isEmpty(SuggestedEventLabelOperator) && !_.isEmpty(SuggestedEventLabel)) {\r\n suggestedArray.push(i18n.getString(LABEL_OPERATOR_TEXT[SuggestedEventLabelOperator] || _TL_(''), { value: SuggestedEventLabel }));\r\n }\r\n\r\n if (!_.isEmpty(CurrentEventValueOperator) && !_.isEmpty(CurrentEventValue)) {\r\n currentArray.push(i18n.getString(VALUE_OPERATOR_TEXT[CurrentEventValueOperator] || _TL_(''), { value: CurrentEventValue }));\r\n }\r\n if (!_.isEmpty(SuggestedEventValueOperator) && !_.isEmpty(SuggestedEventValue)) {\r\n suggestedArray.push(i18n.getString(VALUE_OPERATOR_TEXT[SuggestedEventValueOperator] || _TL_(''), { value: SuggestedEventValue }));\r\n }\r\n\r\n\r\n return { current: currentArray.join(', '), suggested: suggestedArray.join(', ') };\r\n};\r\n","import _ from 'underscore';\r\nimport { isSDK } from '@bingads-webui-campaign-react/sdk-utils';\r\nimport { Status } from '@bingads-webui-campaign-react/diagnostic-card';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\nimport { CampaignTypes } from '@bingads-webui-campaign-react/constants';\r\n\r\nimport { getInvalidEventStrings } from './get-invalid-event-strings';\r\nimport { statusAndActionReport, auditPointDisplayed, getFullProductUrl } from './utils';\r\nimport { DetailCardsKey } from '../const';\r\n\r\nconst STATUS_TEXT = {\r\n NotSetUpGoal: _TL_('No conversion goal'),\r\n NotSetUpGoalMaxClicks: _TL_('No conversion goal'),\r\n Unverified: _TL_('Unverified UET tag'),\r\n UnverifiedMaxClicks: _TL_('Unverified UET tag'),\r\n Active: _TL_('Recording conversions'),\r\n RecordingConversions: _TL_('Recording conversions'),\r\n NoConversions: _TL_('No conversions'),\r\n NoConversionsMaxClicks: _TL_('No conversions'),\r\n NoConversionGoal: _TL_('No conversion goal'),\r\n NoConversionGoalMaxClicks: _TL_('No conversion goal'),\r\n Pending: _TL_('Pending'),\r\n PendingMaxClicks: _TL_('Pending'),\r\n MissGoalWithRevenueValue: _TL_('No goal to track revenue'),\r\n MissGoalWithRevenueValueMaxClicks: _TL_('No goal to track revenue'),\r\n InactiveDueToTagUnavailable: _TL_('Unavailable UET'),\r\n InactiveDueToTagUnavailableMaxClicks: _TL_('Unavailable UET'),\r\n TagInactive: _TL_('Inactive UET tag'),\r\n TagInactiveMaxClicks: _TL_('Inactive UET tag'),\r\n NoRecentConversion: _TL_('No recent conversions'),\r\n NoRecentConversionMaxClicks: _TL_('No recent conversions'),\r\n};\r\n\r\nconst AUDIT_POINT_STATUS_TEXT = {\r\n TrackingStatusUnverified: _TL_('Unverified UET tag'),\r\n TrackingStatusTagInactive: _TL_('Inactive UET tag'),\r\n TrackingStatusInactiveDueToTagUnavailable: _TL_('Incorrect UET tag'),\r\n TrackingStatusUnverified_UETMismatch: _TL_('UET Unverified'),\r\n TrackingStatusTagInactive_UETMismatch: _TL_('UET Inactive'),\r\n TrackingStatusInactiveDueToTagUnavailable_UETMismatch: _TL_('UET Unavailable'),\r\n};\r\n\r\nconst AUDIT_POINT_TITLE_TEXT = {\r\n TrackingStatusUnverified: _TL_('UET tag is not verified'),\r\n TrackingStatusTagInactive: _TL_('UET tag is inactive'),\r\n TrackingStatusInactiveDueToTagUnavailable: _TL_('UET tag is incorrect'),\r\n};\r\n\r\nconst OPERATORS_TEXT = {\r\n EqualsTo: _TL_('Equals to'),\r\n BeginsWith: _TL_('Begins with'),\r\n Contains: _TL_('Contains'),\r\n RegularExpression: _TL_('Regular expression'),\r\n};\r\n\r\nconst CHANGE_TO_MAIN_GOAL_TEXT = {\r\n TrackingStatusNoConversions_ChangeToMainGoal: _TL_('Your campaign has not recorded any conversions in the past seven days. We recommend setting {{GoalName}} as the campaign\\'s conversion goal or changing this goal to “include in conversions”, as it may help optimize this campaign for better performance.'),\r\n TrackingStatusUnverified_ChangeToMainGoal: _TL_('We haven\\'t received any user activity data from the UET tag on your website. We recommend setting {{GoalName}} as the campaign\\'s conversion goal or changing this goal to “include in conversions”, as it may help optimize this campaign for better performance.'),\r\n TrackingStatusTagInactive_ChangeToMainGoal: _TL_('We haven\\'t received any user activity data from the UET tag in the last 24 hours. We recommend setting {{GoalName}} as the campaign\\'s conversion goal or changing this goal to “include in conversions”, as it may help optimize this campaign for better performance.'),\r\n TrackingStatusInactiveDueToTagUnavailable_ChangeToMainGoal: _TL_('The account no longer has access to the UET tag. We recommend setting {{GoalName}} as the campaign\\'s conversion goal or changing this goal to “include in conversions”, as it may help optimize this campaign for better performance.'),\r\n ConversionGoalPending_ChangeToMainGoal: _TL_('We are waiting for this campaign to record conversions. We recommend setting {{GoalName}} as the campaign\\'s conversion goal or changing this goal to “include in conversions”, as it may help optimize this campaign for better performance.'),\r\n};\r\n\r\nconst getCardDetails = ({\r\n auditPoint, scope, i18n, activity, locale, serverContext, campaignType, details,\r\n}) => {\r\n const onClickNavigateToUETTagPage = () => {\r\n statusAndActionReport({\r\n activity,\r\n type: 'conversion',\r\n action: 'navigate to uet tag page',\r\n details: `AuditPoint: ${auditPoint}`,\r\n });\r\n\r\n if (!isSDK()) {\r\n scope.remove(['campaignId']);\r\n scope.save(getRoutePathById(allSiteMap, 'uet-tag'));\r\n } else {\r\n const url = getFullProductUrl('uet-tag', scope);\r\n window.open(url);\r\n }\r\n };\r\n\r\n const onClickNavigateToOfflineConversionsPage = () => {\r\n statusAndActionReport({\r\n activity,\r\n type: 'conversion',\r\n action: 'navigate to offline conversions page',\r\n details: `AuditPoint: ${auditPoint}`,\r\n });\r\n\r\n if (!isSDK()) {\r\n scope.remove(['campaignId']);\r\n scope.save(getRoutePathById(allSiteMap, 'offline-conversions'));\r\n } else {\r\n const url = getFullProductUrl('offline-conversions', scope);\r\n window.open(url);\r\n }\r\n };\r\n\r\n const onClickNavigateToConversionGoalsPage = () => {\r\n statusAndActionReport({\r\n activity,\r\n type: 'conversion',\r\n action: 'navigate to conversion goals page',\r\n details: `AuditPoint: ${auditPoint}`,\r\n });\r\n\r\n if (!isSDK()) {\r\n scope.remove(['campaignId']);\r\n scope.save(getRoutePathById(allSiteMap, 'conversion-goals'));\r\n } else {\r\n const url = getFullProductUrl('conversion-goals', scope);\r\n window.open(url);\r\n }\r\n };\r\n\r\n auditPointDisplayed({ activity, auditPoint, area: 'Conversion' });\r\n let strings = {};\r\n\r\n if (campaignType !== CampaignTypes.Audience && (_.get(serverContext, ['DynamicPermissions', 'DiagnosticCMMTApi']) || _.get(serverContext, ['DynamicPermissions', 'ConversionWarningImprovement']))) {\r\n switch (auditPoint) {\r\n case 'HasNoValidGoalAtCampaignOrAccountLevel':\r\n case 'HasNoValidGoalAtCampaignOrAccountLevel_NoAccountGoal':\r\n return {\r\n cardTitle: i18n.getString(_TL_('Configure conversion goal')),\r\n cardMsg: i18n.getString(_TL_('This campaign doesn\\'t have a conversion goal configured. Please review your campaign settings to assign a goal or create a new conversion goal.')),\r\n onCardButtonClicked: onClickNavigateToConversionGoalsPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/56709/2`,\r\n };\r\n\r\n case 'HasNoValidGoalAtCampaignOrAccountLevel_ChangeToMainGoal':\r\n return {\r\n cardTitle: i18n.getString(_TL_('Configure conversion goals')),\r\n cardMsg: i18n.getString(_TL_('Your campaign is tracking conversions, but “Include in conversions” is not selected. Please add a campaign level goal or update your existing goals to include conversions.')),\r\n onCardButtonClicked: onClickNavigateToConversionGoalsPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/60138/2-500`,\r\n };\r\n\r\n case 'TrackingStatusNoConversions_NotUploadOfflineConversion':\r\n if (!details || !details.GoalWithTopPriority || !details.GoalWithTopPriority.GoalName) {\r\n activity.error(`Details missing for audit point ${auditPoint} - details: ${JSON.stringify(details)}`);\r\n }\r\n return {\r\n cardTitle: i18n.getString(_TL_('Upload offline conversions')),\r\n cardMsg: i18n.getString(_TL_('There are no offline conversions uploaded for {{GoalName}}. Please visit your offline goals to upload conversions associated to this campaign.'), details.GoalWithTopPriority),\r\n onCardButtonClicked: onClickNavigateToOfflineConversionsPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/56852/1/#ext:conversiongoals`,\r\n };\r\n\r\n case 'TrackingStatusNoConversions_EventGoalInvalidParameter':\r\n if (!details || !details.FixEventGoal || (!details.FixEventGoal || !details.GoalWithTopPriority || !details.GoalWithTopPriority.GoalName)) {\r\n activity.error(`Details missing for audit point ${auditPoint} - details: ${JSON.stringify(details)}`);\r\n }\r\n // eslint-disable-next-line no-case-declarations\r\n const { current, suggested } = getInvalidEventStrings({ i18n, fix: details.FixEventGoal });\r\n if (_.isEmpty(current) || _.isEmpty(suggested)) {\r\n activity.error(`Details string missing for audit point ${auditPoint} - details: ${JSON.stringify(details)} current: ${current} suggested: ${suggested}`);\r\n }\r\n return {\r\n cardTitle: i18n.getString(_TL_('Conversion goal setting error')),\r\n cardMsg: i18n.getString(_TL_('We have identified a potential error in your conversion goal event parameters for {{GoalName}}. The current setting is {{current}}. We recommend changing this to {{suggested}}.'), { current, suggested, GoalName: details.GoalWithTopPriority.GoalName }),\r\n onCardButtonClicked: onClickNavigateToConversionGoalsPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/?#apex/ads/${locale}/56709/2-500`,\r\n };\r\n\r\n case 'TrackingStatusNoConversions_UrlGoalInvalidParameter':\r\n if (!details || !details.FixDestinationUrlGoal\r\n || !details.FixDestinationUrlGoal.CurrentDestinationUrlOperatorName || !details.FixDestinationUrlGoal.CurrentDestinationUrl\r\n || !details.FixDestinationUrlGoal.SuggestedDestinationUrlOperatorName || !details.FixDestinationUrlGoal.SuggestedDestinationUrl\r\n || !details.GoalWithTopPriority || !details.GoalWithTopPriority.GoalName\r\n ) {\r\n activity.error(`Details missing for audit point ${auditPoint} - details: ${JSON.stringify(details)}`);\r\n }\r\n // eslint-disable-next-line no-case-declarations\r\n strings = {\r\n ...details.FixDestinationUrlGoal,\r\n CurrentDestinationUrlOperatorName: i18n.getString(OPERATORS_TEXT[details.FixDestinationUrlGoal.CurrentDestinationUrlOperatorName]),\r\n SuggestedDestinationUrlOperatorName: i18n.getString(OPERATORS_TEXT[details.FixDestinationUrlGoal.SuggestedDestinationUrlOperatorName]),\r\n GoalName: details.GoalWithTopPriority.GoalName,\r\n };\r\n return {\r\n cardTitle: i18n.getString(_TL_('Invalid Destination URL')),\r\n cardMsg: i18n.getString(_TL_('Your campaign has not recorded any conversions in the past seven days. The current URL setting for {{GoalName}} is \"{{CurrentDestinationUrlOperatorName}} {{CurrentDestinationUrl}}\". We recommend changing this to \"{{SuggestedDestinationUrlOperatorName}} {{SuggestedDestinationUrl}}\".'), strings),\r\n onCardButtonClicked: onClickNavigateToConversionGoalsPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/?#apex/ads/${locale}/56709/2-500`,\r\n };\r\n\r\n case 'TrackingStatusNoConversions_UETMismatch':\r\n if (!details || !details.UETMismatch || !details.UETMismatch.SuggestedTagName\r\n || !details.GoalWithTopPriority || !details.GoalWithTopPriority.GoalName\r\n ) {\r\n activity.error(`Details missing for audit point ${auditPoint} - details: ${JSON.stringify(details)}`);\r\n }\r\n // eslint-disable-next-line no-case-declarations\r\n strings = {\r\n SuggestedTagName: details.UETMismatch.SuggestedTagName,\r\n GoalName: details.GoalWithTopPriority.GoalName,\r\n };\r\n return {\r\n statusLabelMsg: i18n.getString(_TL_('Incorrectly matched UET tags')),\r\n cardTitle: i18n.getString(_TL_('Incorrectly matched UET tags')),\r\n cardMsg: i18n.getString(_TL_('Your campaign has not recorded any conversions in the past seven days. Your campaign is recording conversion events from a different UET tag for {{GoalName}}. We recommend using {{SuggestedTagName}}. Please check that the goal is using the correct UET tag.'), strings),\r\n onCardButtonClicked: onClickNavigateToConversionGoalsPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/56685/2-500`,\r\n };\r\n\r\n case 'TrackingStatusNoConversions_UETActiveMissingConversionEvent':\r\n if (!details || !details.GoalWithTopPriority || !details.GoalWithTopPriority.GoalName) {\r\n activity.error(`Details missing for audit point ${auditPoint} - details: ${JSON.stringify(details)}`);\r\n }\r\n return {\r\n cardTitle: i18n.getString(_TL_('Missing conversion events')),\r\n cardMsg: i18n.getString(_TL_('Your campaign has not recorded any conversions in the past seven days. We\\'ve detected the UET tag on your website, but there have been no conversion events matching your definition in the last seven days for {{GoalName}}. Check that the goal has the correct event definition.'), details.GoalWithTopPriority),\r\n onCardButtonClicked: onClickNavigateToUETTagPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/?#apex/ads/${locale}/56951/2`,\r\n };\r\n\r\n case 'TrackingStatusNoConversions':\r\n return {\r\n cardTitle: i18n.getString(_TL_('No recent conversions')),\r\n cardMsg: i18n.getString(_TL_('Your campaign has not recorded any conversions in the past seven days. Please review common issues related to conversion tracking, conversion goals and offline conversions. For further questions, please contact Support.')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/60398/2`,\r\n };\r\n\r\n case 'TrackingStatusUnverified_UETMismatch':\r\n case 'TrackingStatusTagInactive_UETMismatch':\r\n case 'TrackingStatusInactiveDueToTagUnavailable_UETMismatch':\r\n if (!details || !details.UETMismatch || !details.UETMismatch.SuggestedTagName\r\n || !details.GoalWithTopPriority || !details.GoalWithTopPriority.GoalName\r\n ) {\r\n activity.error(`Details missing for audit point ${auditPoint} - details: ${JSON.stringify(details)}`);\r\n }\r\n strings = {\r\n SuggestedTagName: details.UETMismatch.SuggestedTagName,\r\n GoalName: details.GoalWithTopPriority.GoalName,\r\n };\r\n return {\r\n statusLabelMsg: i18n.getString(_.get(AUDIT_POINT_STATUS_TEXT, auditPoint, _TL_(''))),\r\n cardTitle: i18n.getString(_TL_('Incorrectly matched UET tags')),\r\n cardMsg: i18n.getString(_TL_('Your campaign has not recorded any conversions in the past seven days. Your campaign is recording conversion events from a different UET tag for {{GoalName}}. We recommend using {{SuggestedTagName}} and ensure that the goal is using the correct UET tag.'), strings),\r\n onCardButtonClicked: onClickNavigateToConversionGoalsPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/?#apex/ads/${locale}/56951/2`,\r\n };\r\n\r\n case 'TrackingStatusUnverified':\r\n return {\r\n cardTitle: i18n.getString(_TL_('UET tag is not verified')),\r\n cardMsg: i18n.getString(_TL_('We haven\\'t received any user activity data from the UET tag on your website. It can take up to 24 hours for Microsoft Advertising to verify.')),\r\n onCardButtonClicked: onClickNavigateToUETTagPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/?#apex/ads/${locale}/56951/2`,\r\n };\r\n\r\n case 'TrackingStatusTagInactive':\r\n return {\r\n cardTitle: i18n.getString(_TL_('Inactive UET tag')),\r\n cardMsg: i18n.getString(_TL_('We haven\\'t received any user activity data from the UET tag in the last 24 hours. Make sure that the UET tag tracking code is still on your website.')),\r\n onCardButtonClicked: onClickNavigateToUETTagPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/?#apex/ads/${locale}/56951/2`,\r\n };\r\n\r\n case 'TrackingStatusInactiveDueToTagUnavailable':\r\n return {\r\n cardTitle: i18n.getString(_TL_('Unavailable UET')),\r\n cardMsg: i18n.getString(_TL_('The account no longer has access to the UET tag. It is possible that the UET tag permissions in another manager account were removed, or this account was transferred and subsequently lost permission to a UET tag in a previous manager account.')),\r\n onCardButtonClicked: onClickNavigateToConversionGoalsPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/?#apex/ads/${locale}/56951/2`,\r\n };\r\n\r\n case 'MissGoalWithRevenueValue':\r\n return {\r\n cardTitle: i18n.getString(_TL_('Revenue value not set up')),\r\n cardMsg: i18n.getString(_TL_('You haven\\'t set a specific revenue value for this conversion goal.')),\r\n onCardButtonClicked: onClickNavigateToConversionGoalsPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/56687/2`,\r\n };\r\n\r\n case 'TrackingStatusNoConversions_ChangeToMainGoal':\r\n case 'TrackingStatusUnverified_ChangeToMainGoal':\r\n case 'TrackingStatusTagInactive_ChangeToMainGoal':\r\n case 'TrackingStatusInactiveDueToTagUnavailable_ChangeToMainGoal':\r\n case 'ConversionGoalPending_ChangeToMainGoal':\r\n if (!details || !details.GoalWithTopPriority || !details.GoalWithTopPriority.GoalName) {\r\n activity.error(`Details missing for audit point ${auditPoint} - details: ${JSON.stringify(details)}`);\r\n }\r\n return {\r\n cardTitle: i18n.getString(_TL_('Change goal to “include in conversions”')),\r\n cardMsg: i18n.getString(_.get(CHANGE_TO_MAIN_GOAL_TEXT, auditPoint, _TL_('')), details.GoalWithTopPriority),\r\n onCardButtonClicked: onClickNavigateToConversionGoalsPage,\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/?#apex/ads/${locale}/56920/1`,\r\n };\r\n\r\n case 'ConversionGoalPending':\r\n return {\r\n cardTitle: i18n.getString(_TL_('Check your conversion tracking')),\r\n cardMsg: i18n.getString(_TL_('Tag verified at least for one conversion goal, but no conversion data yet.')),\r\n };\r\n\r\n case 'TrackingStatusRecordingConversions':\r\n return {};\r\n\r\n default:\r\n activity.error(`Audit point mapping not found for new API in getConversionStatus:${auditPoint}`);\r\n return {};\r\n }\r\n }\r\n\r\n switch (auditPoint) {\r\n case 'HasNoValidGoalAtCampaignOrAccountLevel':\r\n case 'HasNoValidGoalAtCampaignOrAccountLevel_NoAccountGoal':\r\n return {\r\n cardTitle: i18n.getString(_TL_('Create conversion goal')),\r\n cardMsg: i18n.getString(_TL_('Your campaign doesn\\'t have a conversion goal to track conversions. When you create a conversion goal and associate it with this campaign, you can specify which actions count as conversions.')),\r\n onCardButtonClicked: () => {\r\n statusAndActionReport({\r\n activity,\r\n type: 'conversion',\r\n action: 'navigate to goal creation page',\r\n details: `AuditPoint: ${auditPoint}`,\r\n });\r\n\r\n const isAutoGoalEnabled = _.get(serverContext.DynamicPermissions, 'AllowAutoGoalWizard', false);\r\n let routeName = 'conversion-goals-create';\r\n\r\n if (isAutoGoalEnabled) {\r\n routeName = 'conversion-goals-auto-create';\r\n }\r\n\r\n if (!isSDK()) {\r\n scope.remove(['campaignId']);\r\n scope.save(getRoutePathById(allSiteMap, routeName));\r\n } else {\r\n const url = getFullProductUrl(routeName, scope);\r\n window.open(url);\r\n }\r\n },\r\n cardButtonText: i18n.getString(_TL_('Set up now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/56709/2`,\r\n };\r\n\r\n case 'MissGoalWithRevenueValue':\r\n return {\r\n statusLabelMsg: i18n.getString(_TL_('No goal to track revenue')),\r\n cardTitle: i18n.getString(_TL_('Check you conversion tracking')),\r\n cardMsg: i18n.getString(_TL_('Something doesn\\'t seem right with your conversion tracking. Please check your conversion tracking setup.')),\r\n onCardButtonClicked: () => {\r\n statusAndActionReport({\r\n activity,\r\n type: 'conversion',\r\n action: 'navigate to conversion goals page',\r\n details: `AuditPoint: ${auditPoint}`,\r\n });\r\n\r\n if (!isSDK()) {\r\n scope.remove(['campaignId']);\r\n scope.save(getRoutePathById(allSiteMap, 'conversion-goals'));\r\n } else {\r\n const url = getFullProductUrl('conversion-goals', scope);\r\n window.open(url);\r\n }\r\n },\r\n cardButtonText: i18n.getString(_TL_('Check now')),\r\n };\r\n\r\n case 'TrackingStatusUnverified':\r\n case 'TrackingStatusTagInactive':\r\n case 'TrackingStatusInactiveDueToTagUnavailable':\r\n return {\r\n statusLabelMsg: i18n.getString(_.get(AUDIT_POINT_STATUS_TEXT, auditPoint, _TL_(''))),\r\n cardTitle: i18n.getString(_.get(AUDIT_POINT_TITLE_TEXT, auditPoint, _TL_(''))),\r\n cardMsg: i18n.getString(_TL_('Something doesn\\'t seem right with your UET tag. Please check your UET tag setup.')),\r\n onCardButtonClicked: onClickNavigateToUETTagPage,\r\n cardButtonText: i18n.getString(_TL_('Check now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/apex/index/3/${locale}/56692`,\r\n };\r\n\r\n case 'TrackingStatusNoConversions':\r\n return {\r\n cardTitle: i18n.getString(_TL_('There are no conversions for this campaign')),\r\n cardMsg: i18n.getString(_TL_('You\\'ve received no conversions for this campaign in the past 7 days. Please review common issues with UET tracking, conversion goals, and offline conversions or contact Support for additional help.')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/60398/2`,\r\n };\r\n\r\n case 'NoOfflineConversions':\r\n return {\r\n cardTitle: i18n.getString(_TL_('There are no conversions for this campaign')),\r\n cardMsg: i18n.getString(_TL_('There are no conversions recorded for this campaign in the past 7 days. Please check the UET setup for your online conversion tracking. Please also ensure your import tool is operating correctly, and that your offline conversions are imported.')),\r\n onCardButtonClicked: onClickNavigateToOfflineConversionsPage,\r\n cardButtonText: i18n.getString(_TL_('Fix now')),\r\n learnMoreLink: `https://help.ads.microsoft.com/#apex/ads/${locale}/56852/2`,\r\n };\r\n\r\n case 'ConversionGoalPending':\r\n return {\r\n cardTitle: i18n.getString(_TL_('Check your conversion tracking')),\r\n cardMsg: i18n.getString(_TL_('Tag verified at least for one conversion goal, but no conversion data yet.')),\r\n };\r\n\r\n case 'TrackingStatusRecordingConversions':\r\n case 'HasOfflineConversions':\r\n case 'HasValidAccountLevelGoal':\r\n return {};\r\n\r\n default:\r\n activity.error(`Audit point mapping not found in getConversionStatus:${auditPoint}`);\r\n return {};\r\n }\r\n};\r\n\r\nexport const isConversionApplicable = ({\r\n conversionDetails,\r\n}) => {\r\n const statusValue = _.get(conversionDetails, ['Value', 'Status']);\r\n return statusValue !== 'ConversionNotApplicable';\r\n};\r\n\r\nexport const getConversionStatus = ({\r\n details, scope, i18n, activity, locale, serverContext, campaignType,\r\n}) => {\r\n if (_.isEmpty(details)\r\n || _.isEmpty(_.get(details, 'Value'))\r\n || _.get(details, ['Value', 'ErrorCode'], 0) !== 0\r\n || _.get(details, ['Value', 'ErrorMessage'])) {\r\n statusAndActionReport({\r\n activity,\r\n type: 'conversion',\r\n details: `Error - details: ${JSON.stringify(details)}`,\r\n });\r\n return {\r\n name: i18n.getString(_TL_('Conversions')),\r\n key: DetailCardsKey.conversionTracking,\r\n };\r\n }\r\n\r\n const statusValue = _.get(details, ['Value', 'Status']);\r\n const auditPoint = _.get(details, ['Value', 'AuditPoints', 0]);\r\n const parsed = JSON.parse(_.get(details, ['Value', 'DiagnosticDetails'], '{}'));\r\n const diagnosticDetails = { ..._.get(parsed, ['GoalWithTopPriorityDiagnose'], {}), GoalWithTopPriority: _.get(parsed, ['GoalWithTopPriority'], {}) };\r\n\r\n const cardDetails = getCardDetails({\r\n auditPoint, scope, i18n, activity, locale, serverContext, campaignType, details: diagnosticDetails,\r\n });\r\n\r\n let status = Status.Error;\r\n if (statusValue === 'Active' || statusValue === 'RecordingConversions') {\r\n status = Status.Active;\r\n } else if (statusValue === 'Pending' || statusValue === 'PendingMaxClicks') {\r\n status = Status.Pending;\r\n } else if (statusValue === 'NoConversions' || (statusValue && statusValue.includes('MaxClicks'))) {\r\n status = Status.Warning;\r\n }\r\n\r\n return {\r\n name: i18n.getString(_TL_('Conversions')),\r\n key: DetailCardsKey.conversionTracking,\r\n\r\n status,\r\n statusLabelMsg: i18n.getString(_.get(STATUS_TEXT, statusValue, _TL_(''))),\r\n\r\n ...cardDetails,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport { Status } from '@bingads-webui-campaign-react/diagnostic-card';\r\n\r\nimport { DetailCardsKey } from './const';\r\n\r\nconst CardStatus = {\r\n Error: {\r\n title: _TL_('Your campaign\\'s performance is blocked'),\r\n text: _TL_('Troubleshoot your campaign\\'s performance by following these steps:'),\r\n },\r\n Warning: {\r\n title: _TL_('Let\\'s improve your campaign\\'s performance'),\r\n text: _TL_('You can improve your campaigns by using following these steps:'),\r\n },\r\n Active: {\r\n title: _TL_('Your campaign is performing well'),\r\n text: _TL_('Check in regularly to ensure your campaign continues to perform.'),\r\n },\r\n Pending: {\r\n title: _TL_('Your campaign is under review'),\r\n text: _TL_('The review may take up to two days. In the meantime, please consider these suggestions to optimize your campaign.'),\r\n },\r\n};\r\n\r\nconst hasError = details => details.some(item => item.status === Status.Error);\r\nconst hasWarning = details => details.some(item => item.status === Status.Warning);\r\nconst isCampaignActive = (details) => {\r\n const campaignDetail = details.find(item => item.key === DetailCardsKey.campaign);\r\n return _.get(campaignDetail, 'status') === Status.Active;\r\n};\r\n\r\nconst logStatusText = ({ status, texts, activity }) => activity.trace(`DiagnosticCard status text - status:${status} title:${texts.title} text:${texts.text}`);\r\n\r\nexport function getCardStatusText(details, activity, i18n) {\r\n let texts = {};\r\n\r\n if (hasError(details)) {\r\n texts = CardStatus.Error;\r\n logStatusText({ status: 'Error', texts, activity });\r\n } else if (hasWarning(details)) {\r\n texts = CardStatus.Warning;\r\n logStatusText({ status: 'Warning', texts, activity });\r\n } else if (isCampaignActive(details)) {\r\n texts = CardStatus.Active;\r\n logStatusText({ status: 'Active', texts, activity });\r\n } else {\r\n texts = CardStatus.Pending;\r\n logStatusText({ status: 'Pending', texts, activity });\r\n }\r\n\r\n return {\r\n campaignStatusTitle: i18n.getString(texts.title),\r\n campaignStatusMsg: i18n.getString(texts.text),\r\n };\r\n}\r\n","import _ from 'underscore';\r\nimport { useContext, useEffect, useState, useMemo } from 'react';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { InstrumentationContext } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { AlertHelper } from '@bingads-webui-campaign/alert-helper';\r\nimport { CampaignTypes } from '@bingads-webui-campaign-react/constants';\r\nimport {\r\n getBillingStatus,\r\n getCampaignDiagnostics,\r\n Areas,\r\n getAreasForCampaignType,\r\n} from '@bingads-webui-campaign-react/pmax-overview-data';\r\n\r\nimport { getBillingDetail } from './status-details-helpers/get-billing-detail';\r\nimport { getDiagnosticsDetail } from './status-details-helpers/get-diagnostics-detail';\r\nimport { getCardStatusText } from './card-status-text-helper';\r\n\r\nexport function useData({\r\n serverContext,\r\n i18n,\r\n perfMarker,\r\n sesId,\r\n campaignType,\r\n}) {\r\n const [billing, setBilling] = useState(null);\r\n const [diagnosticsData, setDiagnosticsData] = useState(null);\r\n const [isDataFetchDone, setIsDataFetchDone] = useState(false);\r\n const [error, setError] = useState(null);\r\n\r\n const instrumentation = useContext(InstrumentationContext);\r\n const { activity } = useMemo(() => instrumentation.createScenarioAndActivity({\r\n scenarioName: 'Fluent2OverviewPage',\r\n activityName: 'DiagnosticCard',\r\n }), [instrumentation]);\r\n const alertHelper = useMemo(() => new AlertHelper({ i18n }), [i18n]);\r\n\r\n const areas = useMemo(() => getAreasForCampaignType({ activity, campaignType }), [activity, campaignType]);\r\n\r\n const { scope } = useContext(ScopeContext);\r\n const {\r\n values: {\r\n cid: scopeCID,\r\n aid,\r\n uid,\r\n campaignId,\r\n },\r\n } = scope;\r\n const cid = _.get(serverContext, ['CurrentAccount', 'AdvertiserCustomerID']) || scopeCID;\r\n\r\n useEffect(() => {\r\n if (areas.includes(Areas.Billing)) {\r\n getBillingStatus({\r\n cid: scopeCID, aid, uid, ccBaseUrl: _.get(serverContext, ['Urls', 'ClientCenterBaseUrl']), set: setBilling, dfmCacheKey: 'Diagnostic-BillingStatus', setError,\r\n });\r\n }\r\n\r\n // We don't want to overwrite the Audience campaigns pilot\r\n const isNewConversionsEnabled = campaignType !== CampaignTypes.Audience && (_.get(serverContext, ['DynamicPermissions', 'DiagnosticCMMTApi']) || _.get(serverContext, ['DynamicPermissions', 'ConversionWarningImprovement']));\r\n // This pilot checks only applies to Audience campaigns\r\n const isNewApiEnabledForAudienceCampaigns = campaignType === CampaignTypes.Audience && _.get(serverContext, ['DynamicPermissions', 'AudienceUnderspendShowTileUseNewAPI']);\r\n // New API doesn't support App campaigns yet\r\n const withNewApi = campaignType !== CampaignTypes.App && (isNewConversionsEnabled || isNewApiEnabledForAudienceCampaigns);\r\n getCampaignDiagnostics({\r\n cid,\r\n aid,\r\n campaignId,\r\n timeZoneId: _.get(serverContext, ['CurrentAccount', 'TimeZone']),\r\n adInsightBaseUrl: _.get(serverContext, ['ServicesEndpoints', 'AdInsightAPI']),\r\n Token: _.get(serverContext, 'Token'),\r\n set: setDiagnosticsData,\r\n setError,\r\n dfmCacheKey: 'Diagnostic-DiagnosticData',\r\n areas: _.without(areas, Areas.Billing),\r\n campaignType,\r\n withNewApi,\r\n useNewConversionDiagnostics: isNewConversionsEnabled,\r\n });\r\n }, [serverContext, aid, campaignId, cid, uid, sesId, scopeCID, areas, campaignType]);\r\n\r\n const billingDetail = useMemo(() => {\r\n if (!billing || !Array.isArray(billing)) {\r\n return null;\r\n }\r\n\r\n return getBillingDetail({\r\n billing,\r\n i18n,\r\n scope,\r\n ccBaseUrl: _.get(serverContext, ['Urls', 'ClientCenterBaseUrl']),\r\n activity,\r\n });\r\n }, [serverContext, activity, billing, i18n, scope]);\r\n\r\n const diagnosticsDetail = useMemo(() => {\r\n if (!diagnosticsData || !Array.isArray(_.get(diagnosticsData, 'CampaignDiagnosticDetail'))) {\r\n return {};\r\n }\r\n return getDiagnosticsDetail({\r\n diagnosticsData, i18n, scope, activity, serverContext, alertHelper, areas, campaignType,\r\n });\r\n }, [diagnosticsData, i18n, scope, activity, serverContext, alertHelper, areas, campaignType]);\r\n\r\n const rawDetails = useMemo(() => _.reduce(\r\n areas,\r\n (acc, a) => {\r\n if (a === Areas.Billing) {\r\n acc.push(billingDetail);\r\n } else if (diagnosticsDetail[a] !== undefined) {\r\n acc.push(diagnosticsDetail[a]);\r\n }\r\n return acc;\r\n },\r\n []\r\n ), [billingDetail, areas, diagnosticsDetail]);\r\n const totalStatusCount = rawDetails.length;\r\n const details = useMemo(\r\n () => rawDetails.filter(Boolean),\r\n [rawDetails]\r\n );\r\n\r\n useEffect(() => {\r\n if (!isDataFetchDone && details.length === totalStatusCount) {\r\n setIsDataFetchDone(true);\r\n perfMarker.done();\r\n }\r\n }, [details, isDataFetchDone, perfMarker, totalStatusCount]);\r\n\r\n useEffect(() => {\r\n if (error) {\r\n if (details.length > 0) {\r\n // If we have some details to show, we can dismiss the shimmer\r\n setIsDataFetchDone(true);\r\n }\r\n\r\n // readyState 0 means we didn't even send out the request (browser lose focus, unload, etc)\r\n if (error.readyState && error.readyState !== 0) {\r\n activity.error(`Diagnostic data fetch error: ${JSON.stringify(error)}`);\r\n alertHelper.showError(i18n.getString(_TL_('We’ve encountered an error and can’t continue. Please contact support for further assistance.')));\r\n }\r\n }\r\n }, [activity, alertHelper, details.length, error, i18n]);\r\n\r\n const {\r\n campaignStatusTitle,\r\n campaignStatusMsg,\r\n } = getCardStatusText(details, activity, i18n);\r\n\r\n return {\r\n isDataFetchDone,\r\n campaignStatusTitle,\r\n campaignStatusMsg,\r\n details,\r\n totalStatusCount,\r\n };\r\n}\r\n","import _ from 'underscore';\r\nimport { Areas } from '@bingads-webui-campaign-react/pmax-overview-data';\r\n\r\nimport { getCampaignStatus } from './get-campaign-status';\r\nimport { getEditorialStatus } from './get-editorial-status';\r\nimport { getBiddingStatus } from './get-bidding-status';\r\nimport { getConversionStatus, isConversionApplicable } from './get-conversion-status';\r\n\r\nexport function getDiagnosticsDetail({\r\n diagnosticsData,\r\n i18n,\r\n scope,\r\n activity,\r\n serverContext,\r\n alertHelper,\r\n areas,\r\n campaignType,\r\n}) {\r\n activity.trace(`getDiagnosticsDetail - diagnosticsData: ${JSON.stringify(diagnosticsData)}`);\r\n const details = _.get(diagnosticsData, 'CampaignDiagnosticDetail', []);\r\n const locale = _.get(serverContext, ['CurrentLocale'], 'en-us').toLowerCase().split('-')[0];\r\n\r\n const result = {};\r\n\r\n if (areas.includes(Areas.Campaign)) {\r\n const campaignDetails = _.findWhere(details, { Key: 'Campaign' });\r\n result[Areas.Campaign] = getCampaignStatus({\r\n details: campaignDetails, scope, i18n, activity, locale, alertHelper,\r\n });\r\n }\r\n\r\n if (areas.includes(Areas.Editorial)) {\r\n const editorialDetails = _.findWhere(details, { Key: 'EditorialStatus' });\r\n result[Areas.Editorial] = getEditorialStatus({\r\n details: editorialDetails, scope, i18n, activity, locale, campaignType,\r\n });\r\n }\r\n\r\n if (areas.includes(Areas.Bidding)) {\r\n const biddingDetails = _.findWhere(details, { Key: 'Bidding' });\r\n result[Areas.Bidding] = getBiddingStatus({\r\n details: biddingDetails, scope, i18n, activity, locale,\r\n });\r\n }\r\n\r\n if (areas.includes(Areas.Conversion)) {\r\n const conversionDetails = _.findWhere(details, { Key: 'Conversion' });\r\n if (isConversionApplicable({ conversionDetails })) {\r\n result[Areas.Conversion] = getConversionStatus({\r\n details: conversionDetails, scope, i18n, activity, locale, serverContext, campaignType,\r\n });\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Shimmer, ShimmerElementType, Separator, mergeStyles } from '@fluentui/react';\r\n\r\nconst wrapperClass = mergeStyles({\r\n padding: 2,\r\n overflowX: 'hidden',\r\n selectors: {\r\n '& > .ms-Shimmer-container': {\r\n margin: '8px 0',\r\n },\r\n },\r\n});\r\n\r\nconst titleShimmerClass = mergeStyles({\r\n width: 'min(320px, 80%)',\r\n});\r\n\r\nconst messageShimmerClass = mergeStyles({\r\n width: 'min(520px, 95%)',\r\n});\r\n\r\nconst shimmerWithElement1stRow = [\r\n { type: ShimmerElementType.line, height: 36 },\r\n];\r\nconst shimmerWithElement2ndRow = [\r\n { type: ShimmerElementType.line, height: 16 },\r\n];\r\nconst shimmerWithElement3rdRow = [\r\n { type: ShimmerElementType.line, height: 6 },\r\n];\r\nconst shimmerWithElement4thRow = [\r\n { type: ShimmerElementType.line, height: 22 },\r\n { type: ShimmerElementType.gap, width: '10%' },\r\n { type: ShimmerElementType.line, height: 22 },\r\n { type: ShimmerElementType.gap, width: '10%' },\r\n { type: ShimmerElementType.line, height: 22 },\r\n { type: ShimmerElementType.gap, width: '10%' },\r\n { type: ShimmerElementType.line, height: 22 },\r\n];\r\nconst shimmerWithElement5thRow = [\r\n { type: ShimmerElementType.line, height: 16 },\r\n];\r\nconst shimmerWithElement6thRow = [\r\n { type: ShimmerElementType.line, height: 155, width: 360 },\r\n { type: ShimmerElementType.gap, width: 20 },\r\n { type: ShimmerElementType.line, height: 155, width: 360 },\r\n];\r\n\r\nexport const DiagnosticCardShimmer = ({ responsiveSize }) => (\r\n <>\r\n
\r\n \r\n \r\n \r\n {\r\n responsiveSize !== 's' ? (\r\n \r\n ) : (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n )\r\n }\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n \r\n);\r\n\r\nDiagnosticCardShimmer.propTypes = {\r\n responsiveSize: PropTypes.string.isRequired,\r\n};\r\n","import _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport React, { useEffect } from 'react';\r\n\r\nimport { DiagnosticCard } from '@bingads-webui-campaign-react/diagnostic-card';\r\nimport { PerfMarkerFactory } from '@bingads-webui/performance-marker';\r\n\r\nimport { useData } from './use-data';\r\nimport { DiagnosticCardShimmer } from './shimmer';\r\n\r\nlet perfMarker = null;\r\n\r\nexport function OverviewDiagnosticCard(props) {\r\n const {\r\n serverContext,\r\n i18n,\r\n sesId, // This prop is used for force refreshing card data\r\n perfMarkerUtils,\r\n responsiveSize,\r\n campaignType,\r\n } = props;\r\n\r\n if (_.isEmpty(perfMarker)) {\r\n perfMarker = PerfMarkerFactory.createMarker('Overview_DiagnosticCard');\r\n }\r\n useEffect(() => perfMarker.willInit(), []);\r\n\r\n const {\r\n details,\r\n campaignStatusTitle,\r\n campaignStatusMsg,\r\n isDataFetchDone,\r\n } = useData({\r\n serverContext,\r\n i18n,\r\n perfMarker,\r\n sesId,\r\n campaignType,\r\n });\r\n\r\n if (!isDataFetchDone) {\r\n return ;\r\n }\r\n\r\n perfMarkerUtils.done();\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nOverviewDiagnosticCard.propTypes = {\r\n serverContext: PropTypes.shape({\r\n Urls: PropTypes.shape({\r\n ClientCenterBaseUrl: PropTypes.string.isRequired,\r\n }).isRequired,\r\n }).isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n sesId: PropTypes.number,\r\n perfMarkerUtils: PropTypes.shape({\r\n done: PropTypes.func.isRequired,\r\n }).isRequired,\r\n responsiveSize: PropTypes.string.isRequired,\r\n campaignType: PropTypes.string.isRequired,\r\n};\r\n\r\nOverviewDiagnosticCard.defaultProps = {\r\n sesId: -1,\r\n};\r\n","import _ from 'underscore';\r\nimport React, { useCallback, useContext, useMemo, useState, useEffect, useRef } from 'react';\r\nimport {\r\n TopChangesFilterOption,\r\n getComparisonDateRange,\r\n} from '@bingads-webui-campaign/overview-cards-common';\r\nimport { PermissionsContext } from '@bingads-webui-react/hoc-with-permissions';\r\nimport cacheManager from '@bingads-webui-campaign-legacy/cache-manager/index';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { OverviewTopChanges } from '@bingads-webui-campaign-react/overview-top-changes';\r\nimport * as metricFormatter from '@bingads-webui-campaign-legacy/performance-metric-formatter/index';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\nimport { useHeaderStateContext } from '@bingads-webui-campaign-react/overview-card';\r\nimport { getTopChangesAllMetrics } from '@bingads-webui-campaign/fluent-page-data';\r\n\r\nimport { useTopChangesData } from './use-top-changes-data';\r\nimport { useFluctuationPopup } from './use-fluctuation-popup';\r\n\r\nconst entityName = {\r\n customer: 'Account',\r\n account: 'Campaign',\r\n campaign: 'AdGroup',\r\n};\r\n\r\ntype TopChangesCardProps = {\r\n i18n: {\r\n getString: (key: string, params?: any) => string;\r\n };\r\n dateRange: { start: Date; end: Date; };\r\n legacyI18n: any;\r\n filter: any,\r\n jsdata: object;\r\n dateUtil: any;\r\n cardTypeId: string;\r\n constructOptions: Function;\r\n navigationLevel: string;\r\n perfMarkerUtils: {\r\n willFetchData: Function;\r\n willRender: Function;\r\n done: Function;\r\n };\r\n getCardsConfig: Function;\r\n preferenceFromServer: string;\r\n patchPreference: Function;\r\n campaignType: number | string;\r\n};\r\n\r\nexport const TopChangesCard: React.FC = ({\r\n i18n,\r\n legacyI18n,\r\n dateRange,\r\n filter,\r\n jsdata,\r\n dateUtil,\r\n cardTypeId,\r\n constructOptions,\r\n navigationLevel,\r\n perfMarkerUtils,\r\n getCardsConfig,\r\n preferenceFromServer,\r\n patchPreference,\r\n campaignType,\r\n}) => {\r\n const permissions = useContext(PermissionsContext);\r\n const { scope } = useContext(ScopeContext) as any;\r\n const {\r\n aid, cid, uid, campaignId,\r\n } = scope?.values;\r\n const comparisonDateRange = getComparisonDateRange(dateRange);\r\n const headerState = useHeaderStateContext();\r\n const selectedMenuItem = headerState?.selectedItemValue || TopChangesFilterOption.AllChanges;\r\n const [dismissLastFluctuation, setDismissLastFluctuation] = useState(false);\r\n const fetchSingleTile = useRef(false);\r\n\r\n const [selectedMetric, setSelectedMetric] = useState(preferenceFromServer);\r\n const onMetricSelect = useCallback((selection) => {\r\n patchPreference({ metric: selection });\r\n setSelectedMetric(selection);\r\n fetchSingleTile.current = true;\r\n }, [patchPreference]);\r\n\r\n useEffect(() => {\r\n fetchSingleTile.current = true;\r\n }, [selectedMenuItem]);\r\n\r\n useEffect(() => {\r\n fetchSingleTile.current = false;\r\n }, [dateRange]);\r\n\r\n const onFooterButtonClick = useCallback(() => {\r\n if (navigationLevel === 'account') {\r\n scope.save(getRoutePathById(allSiteMap, 'campaigns'));\r\n } else if (navigationLevel === 'customer') {\r\n scope.save(getRoutePathById(allSiteMap, 'performance'));\r\n } else if (navigationLevel === 'campaign') {\r\n scope.save(getRoutePathById(allSiteMap, 'adgroups'));\r\n }\r\n }, [navigationLevel, scope]);\r\n\r\n const footerButtonConfigs = useMemo(() => {\r\n switch (navigationLevel) {\r\n case 'account':\r\n return [\r\n {\r\n text: i18n.getString(_TL_('View all campaigns')),\r\n onClick: onFooterButtonClick,\r\n },\r\n ];\r\n case 'customer':\r\n return [\r\n {\r\n text: i18n.getString(_TL_('View all accounts')),\r\n onClick: onFooterButtonClick,\r\n },\r\n ];\r\n\r\n case 'campaign':\r\n return [\r\n {\r\n text: i18n.getString(_TL_('View all ad groups')),\r\n onClick: onFooterButtonClick,\r\n },\r\n ];\r\n default:\r\n return [];\r\n }\r\n }, [navigationLevel, i18n, onFooterButtonClick]);\r\n\r\n const getHref = useCallback((entityId, campaignType) => {\r\n if (navigationLevel === 'account' && campaignType === 'Smart') {\r\n return `/campaign/smart?cid=${cid}&uid=${uid}&aid=${aid}#/campaign/${entityId}`;\r\n }\r\n\r\n let route = getRoutePathById(allSiteMap, 'overview');\r\n let search = '';\r\n switch (navigationLevel) {\r\n case 'account':\r\n search = `cid=${cid}&uid=${uid}&aid=${aid}&campaignId=${entityId}`;\r\n break;\r\n case 'customer':\r\n search = `cid=${cid}&uid=${uid}&aid=${entityId}`;\r\n break;\r\n case 'campaign':\r\n route = getRoutePathById(allSiteMap, 'keywords');\r\n search = `cid=${cid}&uid=${uid}&aid=${aid}&campaignId=${campaignId}&adGroupId=${entityId}`;\r\n break;\r\n default:\r\n }\r\n\r\n return `${route}?${search}`;\r\n }, [navigationLevel, cid, uid, aid, campaignId]);\r\n\r\n\r\n const { isLoading, data, error } = useTopChangesData({\r\n dateRange,\r\n filter,\r\n comparisonDateRange,\r\n selectedMenuItem,\r\n metric: selectedMetric,\r\n jsdata,\r\n dateUtil,\r\n permissions,\r\n cardTypeId,\r\n constructOptions,\r\n dismissLastFluctuation,\r\n cacheManager,\r\n fetchSingleTile: fetchSingleTile.current,\r\n perfMarkerUtils,\r\n i18n,\r\n getCardsConfig,\r\n campaignType,\r\n });\r\n\r\n useEffect(() => {\r\n if (!isLoading) {\r\n perfMarkerUtils?.done();\r\n }\r\n }, [perfMarkerUtils, isLoading]);\r\n\r\n const allMetrics = useMemo(() => getTopChangesAllMetrics(i18n), [i18n]);\r\n\r\n const renderFluctuationPopup = useFluctuationPopup({\r\n legacyI18n, dateRange, setDismissLastFluctuation, navigationLevel,\r\n });\r\n\r\n return ();\r\n};\r\n","import _ from 'underscore';\r\nimport { useCallback, useContext, useMemo } from 'react';\r\nimport useSwr from 'swr';\r\nimport { AccountUtils } from '@bingads-webui-clientcenter/entity-utils';\r\nimport { InstrumentationContext } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport {\r\n TopChangesFilterOption,\r\n fetchTopChanges,\r\n isInsightsMetric,\r\n} from '@bingads-webui-campaign/overview-cards-common';\r\n\r\n\r\nconst accountsMode = 1; // 1 for expert mode, we don't expect to have smart mode account anymore\r\n\r\nexport function useTopChangesData({\r\n dateRange,\r\n filter,\r\n comparisonDateRange,\r\n selectedMenuItem,\r\n metric,\r\n jsdata,\r\n dateUtil,\r\n permissions,\r\n cardTypeId,\r\n constructOptions,\r\n dismissLastFluctuation,\r\n cacheManager,\r\n fetchSingleTile,\r\n perfMarkerUtils,\r\n getCardsConfig,\r\n campaignType,\r\n i18n,\r\n}) {\r\n const {\r\n entitySet,\r\n } = constructOptions();\r\n\r\n\r\n const instrumentation = useContext(InstrumentationContext) as any;\r\n const uiActivity = useMemo(() => {\r\n if (instrumentation) {\r\n const scenario = instrumentation.createScenarioAndActivity({\r\n scenarioName: 'Fluent2OverviewPage',\r\n activityName: 'TopChanges',\r\n });\r\n if (scenario?.activity?.trace && scenario?.activity?.error) {\r\n return scenario.activity;\r\n }\r\n }\r\n\r\n return { trace: _.noop, error: _.noop };\r\n }, [instrumentation]);\r\n\r\n const fetch = useCallback(({\r\n dateRange, filter, selectedMenuItem, cardTypeId, metric,\r\n }) => {\r\n perfMarkerUtils?.willFetchData();\r\n return fetchTopChanges({\r\n entitySet,\r\n dateRange,\r\n filter,\r\n comparisonDateRange,\r\n selectedMenuItem,\r\n metric,\r\n jsdata,\r\n dateUtil,\r\n fetchSingleTile,\r\n isDevice: true,\r\n permissions,\r\n disableCache: dismissLastFluctuation,\r\n cacheManager,\r\n accountsMode,\r\n dfmCacheKey: cardTypeId,\r\n getCardsConfig,\r\n campaignType,\r\n }).then((data) => {\r\n perfMarkerUtils?.willRender();\r\n\r\n if (!data || (data.status !== null && data.status !== undefined)) {\r\n // If we have error status. Those are already logged in ajax stub.\r\n // Add a trace log.\r\n uiActivity.trace(`top-changes-card failed to load data - data:${JSON.stringify(data)}`);\r\n if (data?.readyState === 0) {\r\n uiActivity.error('top-changes-card failed to load data - readyState=0');\r\n }\r\n throw new Error(i18n.getString(_TL_('Failed to load data')));\r\n }\r\n\r\n let dataError = false;\r\n\r\n let gridData = _.map(data, (entity) => {\r\n if (!entity || !entity.PerformanceMetricsChange) {\r\n dataError = true;\r\n }\r\n if (entity.AvailableInsightTypeIds && entity.AvailableInsightTypeIds.length) {\r\n const fromScenario = entity.CampaignType ? 'CampaignsOverview' : 'AccountsOverView';\r\n uiActivity.trace(`top-changes-card Fluctuations Rendered. FromScenario: ${fromScenario}, FilterOption: ${selectedMenuItem}, Metric: ${metric}, TypeIds: ${entity.AvailableInsightTypeIds.toString()}, id: ${entity.Id}}.`);\r\n }\r\n if (entity?.AccountInactiveReasons) {\r\n return { ...entity, Status: AccountUtils.activityStatus(entity) };\r\n }\r\n return entity;\r\n });\r\n\r\n if (dataError) {\r\n uiActivity.error(`top-changes-card data error - data:${JSON.stringify(data)}`);\r\n if (data?.readyState === 0) {\r\n uiActivity.error('top-changes-card data error - readyState=0');\r\n }\r\n throw new Error(i18n.getString(_TL_('Failed to load data')));\r\n }\r\n\r\n if (selectedMenuItem === TopChangesFilterOption.TopDecliners) {\r\n gridData = _.filter(gridData, entity => entity.PerformanceMetricsChange[metric] < 0);\r\n } else if (selectedMenuItem === TopChangesFilterOption.TopGainers) {\r\n gridData = _.filter(gridData, entity => entity.PerformanceMetricsChange[metric] > 0);\r\n } else if (selectedMenuItem === TopChangesFilterOption.Insights) {\r\n gridData = isInsightsMetric(metric) ? _.filter(\r\n gridData,\r\n entity => !_.isEmpty(entity.AvailableInsightTypeIds)\r\n ) : [];\r\n }\r\n\r\n return gridData;\r\n }).catch((response) => {\r\n uiActivity.error(`top-changes-card catch error - response:${JSON.stringify(response)}`);\r\n if (response?.readyState === 0) {\r\n uiActivity.error('top-changes-card catch error - readyState=0');\r\n }\r\n throw new Error(i18n.getString(_TL_('Failed to load data')));\r\n });\r\n }, [perfMarkerUtils, entitySet, comparisonDateRange, jsdata, dateUtil, fetchSingleTile, permissions, dismissLastFluctuation, cacheManager, getCardsConfig, campaignType, uiActivity, i18n]);\r\n\r\n\r\n return useSwr({\r\n dateRange, filter, selectedMenuItem, cardTypeId, metric,\r\n }, fetch, {\r\n revalidateOnFocus: false,\r\n });\r\n}\r\n","import React, { useContext, useCallback } from 'react';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { InstrumentationContext } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport appConfig from '@bingads-webui-component-legacy/config';\r\nimport { FluctuationPopup } from '@bingads-webui-campaign-react/fluctuation-popup';\r\nimport { PerformanceMarkerContext } from '@bingads-webui-campaign-react/performance-marker-provider';\r\n\r\ninterface useFluctuationPopupProps {\r\n legacyI18n: any;\r\n dateRange: { start?: Date; end?: Date; };\r\n setDismissLastFluctuation: Function;\r\n navigationLevel: string;\r\n}\r\n\r\nexport function useFluctuationPopup({\r\n legacyI18n, dateRange, setDismissLastFluctuation, navigationLevel,\r\n}: useFluctuationPopupProps) {\r\n const serverContext = useContext(ServerContext) as any;\r\n const { scope } = useContext(ScopeContext) as any;\r\n const instrumentation = useContext(InstrumentationContext) as any;\r\n const perfMarker = useContext(PerformanceMarkerContext);\r\n\r\n return useCallback(({\r\n fluctuationTypeIds, isOpen, setIsOpen, entity, metric,\r\n }) => {\r\n const onFlucDismiss = ({ isLastFluc }) => {\r\n if (isLastFluc) {\r\n setDismissLastFluctuation(true);\r\n setIsOpen(false);\r\n }\r\n };\r\n\r\n const context = {\r\n ...serverContext,\r\n scope,\r\n CurrentCampaign: {\r\n Id: entity ? entity.Id : '',\r\n },\r\n isFluctuationsExperiementEnabled: serverContext?.Permissions?.IsFluctuationExperimentEnabled,\r\n };\r\n\r\n if (navigationLevel === 'customer') {\r\n context.CurrentCampaign = undefined;\r\n context.CurrentAccount = { Id: entity ? entity.Id : '' };\r\n }\r\n\r\n return (\r\n setIsOpen(false)}\r\n onFlucDismiss={onFlucDismiss}\r\n canViewAllInsights\r\n asyncLoadFluctuationConfig={{ dateRange: { startDate: dateRange?.start, endDate: dateRange?.end }, fluctuationTypeIds }}\r\n perfMarker={perfMarker}\r\n withPopoverAdapter={false}\r\n />\r\n );\r\n }, [serverContext, instrumentation, legacyI18n, scope, navigationLevel, dateRange?.start, dateRange?.end, perfMarker, setDismissLastFluctuation]);\r\n}\r\n","import _ from 'underscore';\r\nimport { useState, useCallback } from 'react';\r\n\r\nconst dashboardPreferencesName = 'dashboard/preferences';\r\n\r\nexport const useDashboardPreferences = ({ preference, navigationLevel }) => {\r\n const dashboardPreferences = preference.findByNameAtAccountLevel(dashboardPreferencesName);\r\n const dashboardId = `default-${navigationLevel}`;\r\n const [options, setOptions] = useState(_.get(dashboardPreferences, ['Data', dashboardId, 'options'], {}));\r\n const saveDashBoardOptions = useCallback((newOptions) => {\r\n preference.setAtAccountLevel({\r\n Name: dashboardPreferencesName,\r\n Data: {\r\n ...dashboardPreferences?.Data,\r\n [dashboardId]: {\r\n cards: _.get(dashboardPreferences, ['Data', dashboardId, 'cards']),\r\n options: _.extend({}, options, newOptions),\r\n },\r\n },\r\n });\r\n setOptions(newOptions);\r\n }, [dashboardId, dashboardPreferences, options, preference]);\r\n\r\n return {\r\n options,\r\n saveDashBoardOptions,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport { useCallback, useContext, useMemo } from 'react';\r\nimport useSwr from 'swr';\r\nimport getClientCenterAlerts from '@bingads-webui-campaign-legacy/alert/model/client-center';\r\nimport * as scopes from '@bingads-webui-campaign-legacy/alert/model/scopes';\r\nimport { PreferenceContext } from '@bingads-webui-react/preference-context';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { InstrumentationContext } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport getCouponStatus from '@bingads-webui-campaign-legacy/dashboard-cards/welcome-tips-card/coupon-status';\r\nimport { TIP_ID } from '@bingads-webui-campaign-react/overview-welcome-tips';\r\n\r\nimport { useDashboardPreferences } from './use-dashboard-preferences';\r\n\r\nconst logApi = 'tips-card/index';\r\nconst couponStatusUpfrontSpending = 249;\r\nconst couponStatusActiveCoupon = 250;\r\n\r\nexport function useWelcomeTipPages({\r\n createdCampaign,\r\n skippedBothAtAccountCreation,\r\n skippedNoneAtAccountCreation,\r\n navigationLevel,\r\n perfMarkerUtils,\r\n}) {\r\n const instrumentation = useContext(InstrumentationContext) as any;\r\n const { activity } = useMemo(() => instrumentation.createScenarioAndActivity({\r\n scenarioName: 'WelcomeTipsCard',\r\n activityName: 'WelcomeTipPages',\r\n }), [instrumentation]);\r\n\r\n const preference = useContext(PreferenceContext);\r\n const { scope } = useContext(ScopeContext) as any;\r\n const { aid: accountId, uid: userId, cid: customerId } = scope?.values || {};\r\n const { saveDashBoardOptions } = useDashboardPreferences({ preference, navigationLevel });\r\n const fetch = useCallback(() => {\r\n perfMarkerUtils?.willFetchData();\r\n return getClientCenterAlerts(scopes.$root)\r\n .then((alerts) => {\r\n const paymentAlert = _.filter(alerts, alert => alert.id && alert.id.indexOf('AddPaymentInstrument') !== -1);\r\n let hasValidPaymentMethod = false;\r\n let skippedNoneInFirstLoad = skippedNoneAtAccountCreation;\r\n\r\n if (_.isEmpty(paymentAlert)) {\r\n hasValidPaymentMethod = true;\r\n }\r\n\r\n let hasPaymentPermission = true;\r\n\r\n if (!hasValidPaymentMethod) {\r\n hasPaymentPermission = paymentAlert[0].id.indexOf('NoPermission') === -1;\r\n }\r\n\r\n const newOptions = {};\r\n if (hasValidPaymentMethod && createdCampaign) {\r\n // Skipped none payment and campaign creation.\r\n // Store it in preference so that we show different tips if user added them later\r\n if (skippedNoneAtAccountCreation === undefined) {\r\n newOptions[skippedNoneAtAccountCreation] = true;\r\n skippedNoneInFirstLoad = true;\r\n }\r\n } else if (skippedNoneAtAccountCreation === undefined) {\r\n newOptions[skippedNoneAtAccountCreation] = false;\r\n }\r\n\r\n if (!hasValidPaymentMethod && !createdCampaign) {\r\n // Skipped both payment and campaign creation.\r\n // Store it in preference so that we show different tips when user adds campaign\r\n if (skippedBothAtAccountCreation === undefined) {\r\n newOptions[skippedBothAtAccountCreation] = true;\r\n }\r\n } else if (skippedBothAtAccountCreation === undefined) {\r\n newOptions[skippedBothAtAccountCreation] = false;\r\n }\r\n saveDashBoardOptions(newOptions);\r\n\r\n let hasCoupon = false;\r\n const showWelcomeMsg = hasValidPaymentMethod ? skippedNoneInFirstLoad : !skippedBothAtAccountCreation;\r\n\r\n return getCouponStatus()\r\n .then((coupon) => {\r\n if (hasValidPaymentMethod && coupon && coupon.Redemptions) {\r\n const redeemedCoupons = _.filter(coupon.Redemptions, redeemed => redeemed.StatusId === couponStatusUpfrontSpending || redeemed.StatusId === couponStatusActiveCoupon);\r\n\r\n hasCoupon = !_.isEmpty(redeemedCoupons);\r\n } else if (coupon && coupon.AssociatedCoupon) {\r\n const rex = /\\/Date\\((\\d+)\\)\\//;\r\n const matchResult = rex.exec(coupon.AssociatedCoupon.ExpiryDateFromAssociation);\r\n\r\n if (matchResult && matchResult[1]) {\r\n const expirationDate = parseInt(matchResult[1], 10);\r\n\r\n if (!_.isNaN(expirationDate) && new Date() < new Date(expirationDate)) {\r\n hasCoupon = true;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n showWelcomeMsg,\r\n createdCampaign,\r\n hasPaymentPermission,\r\n hasValidPaymentMethod,\r\n hasCoupon,\r\n };\r\n }).catch((response) => {\r\n // no need to log ajax error here.\r\n if (response.status === undefined) {\r\n activity.error(`${logApi} ${response.stack}`);\r\n }\r\n\r\n return {\r\n showWelcomeMsg,\r\n hasPaymentPermission,\r\n hasCoupon,\r\n createdCampaign,\r\n hasValidPaymentMethod,\r\n };\r\n });\r\n }).catch((response) => {\r\n // no need to log ajax error here.\r\n if (response.status === undefined) {\r\n activity.error(`${logApi} ${response.stack}`);\r\n }\r\n\r\n return {\r\n showWelcomeMsg: true,\r\n hasPaymentPermission: false,\r\n hasCoupon: false,\r\n createdCampaign,\r\n hasValidPaymentMethod: true,\r\n };\r\n });\r\n }, [accountId, activity, createdCampaign, customerId, perfMarkerUtils, saveDashBoardOptions, skippedBothAtAccountCreation, skippedNoneAtAccountCreation, userId]);\r\n\r\n const { isLoading, data, error } = useSwr({}, fetch);\r\n\r\n return useMemo(() => {\r\n const {\r\n showWelcomeMsg,\r\n hasPaymentPermission,\r\n hasCoupon,\r\n createdCampaign,\r\n hasValidPaymentMethod,\r\n } = data || {};\r\n const pages = [];\r\n if (hasValidPaymentMethod && createdCampaign && hasCoupon) {\r\n pages.push(TIP_ID.PROMO);\r\n }\r\n if (!createdCampaign) {\r\n pages.push(TIP_ID.CREATE_CAMPAIGN);\r\n }\r\n if (!hasValidPaymentMethod) {\r\n pages.push(TIP_ID.ADD_PAYMENT);\r\n }\r\n if (hasValidPaymentMethod && createdCampaign) {\r\n pages.push(TIP_ID.COACHING);\r\n pages.push(TIP_ID.HELP);\r\n }\r\n\r\n return {\r\n isLoading,\r\n error,\r\n pages,\r\n hasPaymentPermission,\r\n showWelcomeMsg,\r\n isPaymentFirstTile: createdCampaign && !hasValidPaymentMethod,\r\n hasCoupon,\r\n };\r\n }, [isLoading, error, data]);\r\n}\r\n","import _ from 'underscore';\r\nimport React, { useEffect } from 'react';\r\nimport { OverviewWelcomeTips } from '@bingads-webui-campaign-react/overview-welcome-tips';\r\nimport { getLocalizedSupportLink } from '@bingads-webui-campaign/overview-cards-common';\r\n\r\nimport { useWelcomeTipPages } from './use-welcome-tip-pages';\r\n\r\ntype WelcomeTipsCardProps = {\r\n i18n: {\r\n getString: (key: string, params?: any) => string;\r\n };\r\n\r\n serverContext: any;\r\n perfMarkerUtils: {\r\n willFetchData: Function;\r\n willRender: Function;\r\n done: Function;\r\n };\r\n createdCampaign: boolean;\r\n skippedBothAtAccountCreation: boolean;\r\n skippedNoneAtAccountCreation: boolean;\r\n navigationLevel: string;\r\n};\r\n\r\nexport const WelcomeTipsCard: React.FC = ({\r\n i18n,\r\n serverContext,\r\n perfMarkerUtils,\r\n createdCampaign,\r\n skippedBothAtAccountCreation,\r\n skippedNoneAtAccountCreation,\r\n navigationLevel,\r\n}) => {\r\n const {\r\n isLoading, error, pages, hasPaymentPermission, showWelcomeMsg, isPaymentFirstTile, hasCoupon,\r\n } = useWelcomeTipPages({\r\n createdCampaign,\r\n skippedBothAtAccountCreation,\r\n skippedNoneAtAccountCreation,\r\n navigationLevel,\r\n perfMarkerUtils,\r\n });\r\n\r\n useEffect(() => {\r\n if (!isLoading) {\r\n perfMarkerUtils?.willRender();\r\n perfMarkerUtils?.done();\r\n }\r\n }, [perfMarkerUtils, isLoading]);\r\n\r\n return ();\r\n};\r\n","import { makeStyles } from '@fluentui/react-components';\r\n\r\nexport const useOverviewPageStyles = makeStyles({\r\n pageContainer: {\r\n maxWidth: '1600px',\r\n minWidth: '200px',\r\n },\r\n});\r\n","import { makeStyles, shorthands } from '@fluentui/react-components';\r\n\r\nexport const usePageStyles = makeStyles({\r\n main: {\r\n position: 'relative',\r\n overflow: 'auto',\r\n '&:after': {\r\n content: '\"\"',\r\n display: 'block',\r\n clear: 'both',\r\n },\r\n ...shorthands.padding('16px', '26px', '8px'),\r\n },\r\n\r\n cardSmall: {\r\n width: '33.3%',\r\n },\r\n cardMedium: {\r\n width: '50%',\r\n },\r\n cardLarge: {\r\n width: '66.6%',\r\n },\r\n cardFull: {\r\n width: '100%',\r\n },\r\n column: {\r\n height: '430px',\r\n '& .overview-card': {\r\n height: '410px',\r\n },\r\n },\r\n});\r\n","import _ from 'underscore';\r\nimport { useCallback, useEffect, useLayoutEffect, useState } from 'react';\r\n\r\nimport { CardSize } from '@bingads-webui-campaign-react/overview-card-const';\r\nimport {\r\n getResponsiveSize,\r\n} from '@bingads-webui-campaign/fluent-page-data';\r\nimport { usePageStyles } from './style/styles';\r\n\r\nconst MediumSize = 768;\r\nconst LargeSize = 1200;\r\n\r\nconst debounce = (func, delay) => {\r\n let timer;\r\n return (...args) => {\r\n clearTimeout(timer);\r\n timer = setTimeout(() => func(...args), delay);\r\n };\r\n};\r\n\r\nconst getStyleFromCardSize = (size, styles, containerWidth) => {\r\n if (size === CardSize.FullScreen) {\r\n return [styles.cardFull];\r\n }\r\n\r\n let styleClass = null;\r\n\r\n if (containerWidth > LargeSize) {\r\n styleClass = size === CardSize.Large ? styles.cardLarge : styles.cardSmall;\r\n } else if (containerWidth > MediumSize) {\r\n styleClass = size === CardSize.Large ? styles.cardFull : styles.cardMedium;\r\n } else {\r\n styleClass = styles.cardFull;\r\n }\r\n\r\n // For card that doesn't have full size large screen, we have to add a style to limit the height\r\n // so that all the cards on the same line have the same height\r\n return [styleClass, styles.column];\r\n};\r\n\r\n// This is only used by Pmax Overview page now\r\nexport function useOverviewWindowSizeChange(cardViewState, setCardViewState) {\r\n const styles = usePageStyles();\r\n const [responsiveSize, setResponsiveSize] = useState();\r\n\r\n const onWindowResize = useCallback(_.debounce(() => {\r\n const chartContainer = document.getElementsByClassName('ba-overview-page');\r\n const chartWidth = chartContainer[0].offsetWidth;\r\n let newCarViewState = [...cardViewState];\r\n\r\n newCarViewState = _.map(cardViewState, viewState => ({\r\n ...viewState,\r\n className: [viewState.id, ...getStyleFromCardSize(viewState.size, styles, chartWidth)],\r\n }));\r\n\r\n setCardViewState(newCarViewState);\r\n\r\n const content = document.querySelector('.app-shell-content');\r\n setResponsiveSize(getResponsiveSize(content.offsetWidth));\r\n }, 50, true), [cardViewState]);\r\n\r\n useEffect(() => {\r\n window.addEventListener('resize', onWindowResize, false);\r\n\r\n return () => {\r\n window.removeEventListener('resize', onWindowResize);\r\n };\r\n }, [onWindowResize]);\r\n\r\n useLayoutEffect(() => {\r\n onWindowResize();\r\n // we call resize once when we load this component, to make sure card has correct size class\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n return responsiveSize;\r\n}\r\n\r\nexport function useOverviewPhase2WindowSizeChange() {\r\n const [responsiveSize, setResponsiveSize] = useState('');\r\n\r\n // Debounced resize handler\r\n const onShellContentResize = useCallback(\r\n debounce(() => {\r\n const content = document.querySelector('.app-shell-content');\r\n if (content) {\r\n setResponsiveSize(getResponsiveSize(content.offsetWidth));\r\n }\r\n }, 50),\r\n []\r\n );\r\n\r\n useEffect(() => {\r\n const content = document.querySelector('.app-shell-content');\r\n if (!content) {\r\n return;\r\n }\r\n\r\n const resizeObserver = new ResizeObserver(onShellContentResize);\r\n resizeObserver.observe(content);\r\n\r\n // eslint-disable-next-line consistent-return\r\n return () => {\r\n resizeObserver.disconnect();\r\n };\r\n }, [onShellContentResize]);\r\n\r\n useLayoutEffect(() => {\r\n const content = document.querySelector('.app-shell-content');\r\n if (content) {\r\n setResponsiveSize(getResponsiveSize(content.offsetWidth));\r\n }\r\n }, []);\r\n\r\n return responsiveSize;\r\n}\r\n","\r\nimport _ from 'underscore';\r\nimport { lazy } from 'react';\r\nimport { DefaultHeaderDropdown } from '@bingads-webui-campaign-react/overview-card';\r\n\r\nimport {\r\n cardWelcomeTipsId,\r\n cardPerformanceId,\r\n cardRecommendationsId,\r\n cardTopCampaignsId,\r\n cardTopAccountsId,\r\n cardTopKeywordsId,\r\n cardDeviceId,\r\n cardSearchTermsId,\r\n cardCompetitionId,\r\n cardTopAdGroupsId,\r\n cardConversionTrackingId,\r\n cardTopLocationsId,\r\n cardTopChangesAccountId,\r\n cardTopChangesCampaignId,\r\n cardTopChangesAdGroupId,\r\n cardDiagnosticId,\r\n cardAssetPerformanceId,\r\n cardNavigateToFullProductId,\r\n} from '@bingads-webui-campaign/fluent-page-consts';\r\nimport {\r\n getHeaderPropsFromPreferenceForPerformanceTable,\r\n getTablePropsFromPreferenceForPerformanceTable,\r\n getPropsFromPreferenceForPerformanceChart,\r\n getPropsFromPreferenceForTopLocations,\r\n getTablePropsFromPreferenceForDevices,\r\n getPropsFromPreferenceForConversionTracking,\r\n getHeaderPropsFromPreferenceForConversionTracking,\r\n getPropsForRecommendations,\r\n getPropsForTopChanges,\r\n getHeaderPropsFromPreferenceForTopChanges,\r\n} from '@bingads-webui-campaign/fluent-page-data';\r\n\r\nconst PerformanceCardContainer = lazy(() => import(/* webpackMode: \"eager\" */'./performance-chart-card/container').then(module => ({ default: module.PerformanceCardContainer })));\r\nconst OverviewRecommendationsCard = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/overview-recommendations-card').then(module => ({ default: module.OverviewRecommendationsCard })));\r\nconst OverviewCampaignTable = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/overview-grid-card-fluent').then(module => ({ default: module.OverviewCampaignTable })));\r\nconst OverviewAccountTable = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/overview-grid-card-fluent').then(module => ({ default: module.OverviewAccountTable })));\r\nconst OverviewKeywordTable = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/overview-grid-card-fluent').then(module => ({ default: module.OverviewKeywordTable })));\r\nconst OverviewSearchTermTable = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/overview-grid-card-fluent').then(module => ({ default: module.OverviewSearchTermTable })));\r\nconst OverviewAdGroupTable = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/overview-grid-card-fluent').then(module => ({ default: module.OverviewAdGroupTable })));\r\nconst ConversionTrackingCardFluent = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign/overview-conversion-tracking-card').then(module => ({ default: module.ConversionTrackingCardFluent })));\r\nconst DeviceCard = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign/overview-device-card-fluent').then(module => ({ default: module.DeviceCard })));\r\nconst TopLocationsCard = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/top-locations-card').then(module => ({ default: module.TopLocationsCard })));\r\nconst TopLocationViewSelector = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/top-locations-card').then(module => ({ default: module.TopLocationViewSelector })));\r\nconst CompetitionCardWithData = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/overview-competition-card').then(module => ({ default: module.CompetitionCardWithData })));\r\nconst CompetitionFilterWithData = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/overview-competition-card').then(module => ({ default: module.CompetitionFilterWithData })));\r\nconst TopChangesCard = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign/overview-top-changes-card-fluent').then(module => ({ default: module.TopChangesCard })));\r\nconst WelcomeTipsCard = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign/overview-welcome-tips-card').then(module => ({ default: module.WelcomeTipsCard })));\r\nconst AssetPerformanceCard = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/asset-performance-card').then(module => ({ default: module.AssetPerformanceCardWithAssetData })));\r\nconst AssetPerformanceCardHeader = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/asset-performance-card').then(module => ({ default: module.AssetPerformanceFilterWithAssetGroupsData })));\r\nconst DiagnosticCard = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign/overview-diagnostic-card').then(module => ({ default: module.OverviewDiagnosticCard })));\r\nconst NavigateToFullProductCard = lazy(() => import(/* webpackMode: \"eager\" */'@bingads-webui-campaign-react/sdk-campaign-overview-page').then(module => ({ default: module.NavigateToFullProductCard })));\r\n\r\nexport const getCardViewConstructor = ({\r\n config,\r\n instrumentation,\r\n constants,\r\n campaignType,\r\n}) => {\r\n switch (config.typeId) {\r\n case cardPerformanceId:\r\n return {\r\n CardView: PerformanceCardContainer,\r\n getCardViewProps: ({ cardPreference, patchPreference, permissions }) => getPropsFromPreferenceForPerformanceChart({\r\n cardPreference, patchPreference, permissions, campaignType,\r\n }),\r\n config,\r\n };\r\n case cardRecommendationsId:\r\n return {\r\n CardView: OverviewRecommendationsCard,\r\n getCardViewProps: getPropsForRecommendations,\r\n config,\r\n };\r\n case cardTopCampaignsId:\r\n return {\r\n CardView: OverviewCampaignTable,\r\n getCardViewProps: ({\r\n cardPreference, patchPreference, permissions, navigationLevel, i18n,\r\n }) =>\r\n getTablePropsFromPreferenceForPerformanceTable({\r\n cardPreference, patchPreference, permissions, navigationLevel, i18n, campaignType,\r\n }),\r\n CardHeaderContent: DefaultHeaderDropdown,\r\n getCardHeaderContentProps: getHeaderPropsFromPreferenceForPerformanceTable,\r\n config,\r\n };\r\n case cardTopKeywordsId:\r\n return {\r\n CardView: OverviewKeywordTable,\r\n getCardViewProps: getTablePropsFromPreferenceForPerformanceTable,\r\n CardHeaderContent: DefaultHeaderDropdown,\r\n getCardHeaderContentProps: getHeaderPropsFromPreferenceForPerformanceTable,\r\n config,\r\n };\r\n case cardSearchTermsId:\r\n return {\r\n CardView: OverviewSearchTermTable,\r\n getCardViewProps: getTablePropsFromPreferenceForPerformanceTable,\r\n config,\r\n };\r\n case cardTopAdGroupsId:\r\n return {\r\n CardView: OverviewAdGroupTable,\r\n getCardViewProps: getTablePropsFromPreferenceForPerformanceTable,\r\n CardHeaderContent: DefaultHeaderDropdown,\r\n getCardHeaderContentProps: getHeaderPropsFromPreferenceForPerformanceTable,\r\n config,\r\n };\r\n case cardConversionTrackingId:\r\n return {\r\n CardView: ConversionTrackingCardFluent,\r\n CardHeaderContent: DefaultHeaderDropdown,\r\n getCardViewProps: getPropsFromPreferenceForConversionTracking,\r\n getCardHeaderContentProps: getHeaderPropsFromPreferenceForConversionTracking,\r\n config,\r\n };\r\n case cardDeviceId:\r\n return {\r\n CardView: DeviceCard,\r\n getCardViewProps: getTablePropsFromPreferenceForDevices,\r\n config,\r\n };\r\n case cardTopLocationsId:\r\n return {\r\n CardView: TopLocationsCard,\r\n getCardViewProps: getPropsFromPreferenceForTopLocations,\r\n CardHeaderContent: TopLocationViewSelector,\r\n config,\r\n };\r\n case cardCompetitionId:\r\n return {\r\n CardView: CompetitionCardWithData,\r\n CardHeaderContent: CompetitionFilterWithData,\r\n config,\r\n };\r\n case cardTopChangesCampaignId:\r\n case cardTopChangesAccountId:\r\n case cardTopChangesAdGroupId:\r\n return {\r\n CardView: TopChangesCard,\r\n getCardViewProps: getPropsForTopChanges,\r\n CardHeaderContent: DefaultHeaderDropdown,\r\n getCardHeaderContentProps: getHeaderPropsFromPreferenceForTopChanges,\r\n config,\r\n };\r\n case cardWelcomeTipsId:\r\n return {\r\n CardView: WelcomeTipsCard,\r\n config,\r\n };\r\n case cardTopAccountsId:\r\n return {\r\n CardView: OverviewAccountTable,\r\n getCardViewProps: ({\r\n cardPreference, patchPreference, permissions, navigationLevel, i18n,\r\n }) =>\r\n getTablePropsFromPreferenceForPerformanceTable({\r\n cardPreference, patchPreference, permissions, navigationLevel, i18n,\r\n }),\r\n CardHeaderContent: DefaultHeaderDropdown,\r\n getCardHeaderContentProps: getHeaderPropsFromPreferenceForPerformanceTable,\r\n config,\r\n };\r\n case cardDiagnosticId:\r\n return {\r\n CardView: DiagnosticCard,\r\n getCardViewProps: ({ campaignType }) => ({ campaignType }),\r\n config,\r\n };\r\n case cardAssetPerformanceId:\r\n return {\r\n CardView: AssetPerformanceCard,\r\n CardHeaderContent: AssetPerformanceCardHeader,\r\n getCardViewProps: ({ campaignType }) => ({ campaignType }),\r\n getCardHeaderContentProps: ({ isSDK }) => ({ isSDK }),\r\n config,\r\n };\r\n case cardNavigateToFullProductId:\r\n return {\r\n CardView: NavigateToFullProductCard,\r\n config,\r\n };\r\n default:\r\n instrumentation.logMessage([constants.LOGCATEGORY.ERROR], constants.LOGLEVEL.INFO, 'dashboard/dashboard-view', `Unknown card content: ${config.contentType}`);\r\n return null;\r\n }\r\n};\r\n","import { CardSize } from '@bingads-webui-campaign-react/overview-card-const';\r\nimport {\r\n AssetPerformanceCardWithAssetData as AssetPerformanceCard,\r\n AssetPerformanceFilterWithAssetGroupsData as AssetPerformanceFilter,\r\n} from '@bingads-webui-campaign-react/asset-performance-card';\r\nimport { TopLocationsCard, TopLocationViewSelector } from '@bingads-webui-campaign-react/top-locations-card';\r\nimport { PerformanceCardContainer } from '@bingads-webui-campaign/fluent-page-view-constructor';\r\nimport { OverviewDiagnosticCard } from '@bingads-webui-campaign/overview-diagnostic-card';\r\nimport { cardTopLocationsId } from '@bingads-webui-campaign/fluent-page-consts';\r\n\r\n\r\nconst diagnosticId = 'Diagnostic';\r\nexport const assetPerfId = 'AssetPerf';\r\nexport const getDefaultCardState = (i18n) => {\r\n const defaultCardState = [{\r\n id: 'fluent-react-performance-card',\r\n name: i18n.getString(_TL_('Performance')),\r\n size: CardSize.FullScreen,\r\n isResizable: false,\r\n reactView: PerformanceCardContainer,\r\n isInViewportOnPageLoad: true,\r\n },\r\n {\r\n id: diagnosticId,\r\n name: i18n.getString(_TL_('Diagnostic')),\r\n size: CardSize.FullScreen,\r\n isResizable: false,\r\n reactView: OverviewDiagnosticCard,\r\n isInViewportOnPageLoad: true,\r\n },\r\n {\r\n id: cardTopLocationsId,\r\n name: i18n.getString(_TL_('Top locations')),\r\n size: CardSize.Small,\r\n isResizable: false,\r\n reactView: TopLocationsCard,\r\n CardHeaderContent: TopLocationViewSelector,\r\n },\r\n {\r\n id: assetPerfId,\r\n name: i18n.getString(_TL_('Asset Performance')),\r\n size: CardSize.Small,\r\n isResizable: false,\r\n reactView: AssetPerformanceCard,\r\n CardHeaderContent: AssetPerformanceFilter,\r\n },\r\n ];\r\n return defaultCardState;\r\n};\r\n","import _ from 'underscore';\r\nimport { useEffect, useState, useRef } from 'react';\r\n\r\nimport { PerfMarkerFactory } from '@bingads-webui/performance-marker';\r\nimport {\r\n getPreferenceForDashboard,\r\n getCardPreferenceOptions,\r\n setPreferenceForCard\r\n} from '@bingads-webui-campaign/fluent-page-data';\r\n\r\n\r\nconst parentPerfMarker = PerfMarkerFactory.createMarker('FluentV2Overview_LegacyBackboneView');\r\nparentPerfMarker.willInit();\r\n\r\nexport function useInitializeBackboneView({\r\n isPreferenceInitialized,\r\n preference,\r\n preferenceName,\r\n dashboardPreferenceKey,\r\n cardViewState,\r\n setCardViewState,\r\n dateRange,\r\n filter,\r\n newI18n,\r\n sesId,\r\n contentReady,\r\n}) {\r\n const sesIdRef = useRef(sesId); // This is used to force refresh backbone instances\r\n const [initialized, setInitialized] = useState(false);\r\n useEffect(() => {\r\n if ((isPreferenceInitialized && !initialized) || sesIdRef.current !== sesId) {\r\n sesIdRef.current = sesId;\r\n setInitialized(true);\r\n const boardPreference = getPreferenceForDashboard({ preference, preferenceName, dashboardPreferenceKey });\r\n\r\n const newCarViewState = _.map(cardViewState, (cardState) => {\r\n if (!cardState.backboneCreator) {\r\n return cardState;\r\n }\r\n\r\n const perfMarker = parentPerfMarker.createChild(cardState.id);\r\n perfMarker.willInit();\r\n\r\n const cardPreferenceOptions = getCardPreferenceOptions(boardPreference, cardState.id);\r\n const backboneInstance = cardState.backboneCreator({\r\n cardPreferenceOptions,\r\n cardState,\r\n perfMarker,\r\n dateRange,\r\n filter,\r\n newI18n,\r\n contentReady,\r\n });\r\n\r\n backboneInstance.on('storeCardPreference', (options) => {\r\n setPreferenceForCard({\r\n preference,\r\n preferenceName,\r\n dashboardPreferenceKey,\r\n cardId: cardState.id,\r\n cardOptions: options,\r\n });\r\n });\r\n\r\n return {\r\n ...cardState,\r\n backboneInstance,\r\n };\r\n });\r\n\r\n setCardViewState(newCarViewState);\r\n }\r\n }, [cardViewState, dashboardPreferenceKey, dateRange, filter, initialized, isPreferenceInitialized, newI18n, preference, preferenceName, setCardViewState, sesId, contentReady]);\r\n}\r\n","export const preferenceName = 'dashboard/preferences';\r\nexport const dashboardPreferenceKey = 'default-campaign-performancemax';\r\n","import _ from 'underscore';\r\nimport React, { useState, useMemo, useRef, useCallback } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\n\r\nimport { CampaignTypes } from '@bingads-webui-campaign-react/constants';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { OverviewCard } from '@bingads-webui-campaign-react/overview-card';\r\nimport { PageReady } from '@bingads-webui/page-ready';\r\nimport { WaterfallFilterStorage, WaterfallFilterType, waterfallDateFilterProcessor } from '@bingads-webui-campaign/filter-storage';\r\nimport { getFilteredCampaignTypeFromWaterfallFilter } from '@bingads-webui-campaign-react/shell-ui-common';\r\nimport preference from '@bingads-webui-component-legacy/preference/service/index';\r\nimport { BackboneInstanceWrapper } from '@bingads-webui-react/backbone-instance-wrapper';\r\nimport { CampaignStatusSummaryCards } from '@bingads-webui-campaign-react/campaign-status-summary-cards';\r\nimport { useIsPreferenceInitialized } from '@bingads-webui-campaign/fluent-page-data';\r\n\r\nimport { getDefaultStyles } from '../style/legacy/styles';\r\nimport { usePageStyles } from '../style/styles';\r\nimport { useOverviewWindowSizeChange } from '../use-overview-window-size-change';\r\nimport { getDefaultCardState } from './default-cards-state';\r\nimport { useInitializeBackboneView } from './use-initialize-backbone-view';\r\nimport { preferenceName, dashboardPreferenceKey } from '../const';\r\n\r\nconst campaignStateCard = 'CampaignStatusSummaryCards-CampaignState';\r\nconst budgetCard = 'CampaignStatusSummaryCards-Budget';\r\nconst bidStrategyCard = 'CampaignStatusSummaryCards-BidStrategy';\r\nconst campaignStatusSummaryCards = [{ id: campaignStateCard }, { id: budgetCard }, { id: bidStrategyCard }];\r\n\r\nfunction PerformanceMaxSingleCampaign(props) {\r\n const {\r\n serverContext,\r\n preferenceService,\r\n i18n,\r\n sesId,\r\n perfMarker,\r\n isSDK,\r\n } = props;\r\n const styles = usePageStyles();\r\n const isPreferenceInitialized = useIsPreferenceInitialized(preference);\r\n\r\n const [cardViewState, setCardViewState] = useState(props.defaultCardViewState || getDefaultCardState(i18n, serverContext, preferenceService));\r\n\r\n const remainingViewportCards = useRef(!isSDK ?\r\n [...campaignStatusSummaryCards, ..._.filter(cardViewState, card => card.isInViewportOnPageLoad)]\r\n : _.filter(cardViewState, card => card.isInViewportOnPageLoad));\r\n\r\n const waterfallFilterStorage = useMemo(() => new WaterfallFilterStorage({ preferenceService }), [preferenceService]);\r\n\r\n // Cannot use useMemo here as it will get stale data\r\n const dateRange = waterfallDateFilterProcessor(\r\n waterfallFilterStorage.getFilters([WaterfallFilterType.DateFilter]),\r\n serverContext\r\n );\r\n const filter = waterfallFilterStorage.getFilters([\r\n WaterfallFilterType.CampaignType,\r\n WaterfallFilterType.CampaignStatus,\r\n WaterfallFilterType.AdGroupStatus,\r\n ]);\r\n\r\n const campaignType = getFilteredCampaignTypeFromWaterfallFilter(filter);\r\n\r\n const contentReady = useCallback((id) => {\r\n if (!_.isEmpty(remainingViewportCards.current)) {\r\n remainingViewportCards.current = _.reject(remainingViewportCards.current, card => card.id === id);\r\n\r\n if (_.isEmpty(remainingViewportCards.current)) {\r\n perfMarker.done();\r\n PageReady.pageIsReady();\r\n }\r\n }\r\n }, [perfMarker]);\r\n\r\n const responsiveSize = useOverviewWindowSizeChange(cardViewState, setCardViewState);\r\n\r\n _.each(cardViewState, (cardState) => {\r\n if (cardState.backboneInstance) {\r\n _.defer(() => {\r\n cardState.backboneInstance.updateState({\r\n dateRange, campaignType, filter, responsiveSize,\r\n });\r\n });\r\n }\r\n });\r\n\r\n const campaignStatusContentReady = useCallback(() => contentReady(campaignStateCard), [contentReady]);\r\n const budgetContentReady = useCallback(() => contentReady(budgetCard), [contentReady]);\r\n const bidStrategyContentReady = useCallback(() => contentReady(bidStrategyCard), [contentReady]);\r\n\r\n useInitializeBackboneView({\r\n isPreferenceInitialized,\r\n preference,\r\n preferenceName,\r\n dashboardPreferenceKey,\r\n cardViewState,\r\n setCardViewState,\r\n dateRange,\r\n filter,\r\n newI18n: i18n,\r\n sesId,\r\n contentReady,\r\n });\r\n\r\n return (\r\n
\r\n {!isSDK &&\r\n }\r\n {cardViewState.map((item) => {\r\n if (item.backboneInstance) {\r\n item.backboneInstance.trigger('attached'); // needed for perf markers on the backbone cards to work correctly\r\n }\r\n const perfMarkerUtils = {\r\n // we don't have child perfMarker created for this page. So, we are using dummy method for now to unblock.\r\n willFetchData: _.noop,\r\n willRender: _.noop,\r\n done: () => contentReady(item.id),\r\n };\r\n\r\n return (\r\n \r\n {\r\n item.backboneInstance &&\r\n
\r\n \r\n
\r\n }\r\n {\r\n !item.backboneInstance && item.reactView &&\r\n \r\n }\r\n \r\n );\r\n })}\r\n
\r\n );\r\n}\r\n\r\nPerformanceMaxSingleCampaign.propTypes = {\r\n serverContext: PropTypes.shape({\r\n CurrentAccount: PropTypes.shape({}).isRequired,\r\n CurrentCustomer: PropTypes.shape({}).isRequired,\r\n }).isRequired,\r\n preferenceService: PropTypes.shape({}).isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n defaultCardViewState: PropTypes.arrayOf(PropTypes.shape({})),\r\n sesId: PropTypes.number,\r\n perfMarker: PropTypes.shape({\r\n done: PropTypes.func.isRequired,\r\n }).isRequired,\r\n isSDK: PropTypes.bool,\r\n};\r\n\r\nPerformanceMaxSingleCampaign.defaultProps = {\r\n defaultCardViewState: null,\r\n sesId: -1,\r\n isSDK: false,\r\n};\r\n\r\nexport const StyledPerformanceMaxSingleCampaign = withDefaultStyles(PerformanceMaxSingleCampaign, getDefaultStyles);\r\n","import { competitionCardStyle } from '@bingads-webui-campaign-react/common-styles';\r\nimport {\r\n getPerformanceCardFluentV2Style,\r\n getPerformanceGraphStyle,\r\n getTopLocationCardFluentV2Style,\r\n metricPickerFluentV2Style,\r\n} from '@bingads-webui-campaign-react/overview-card-styles';\r\n\r\nexport const getDefaultStyles = (_, { palette = {} }) => ({\r\n '@global': Object.assign(\r\n metricPickerFluentV2Style,\r\n getPerformanceCardFluentV2Style(palette),\r\n getPerformanceGraphStyle(palette),\r\n getTopLocationCardFluentV2Style(palette),\r\n competitionCardStyle\r\n ),\r\n});\r\n","import React from 'react';\r\nimport classNames from 'classnames';\r\n\r\nimport { useOverviewPageStyles } from './style/overview-page-style';\r\n// TODO: [yaoyao] when we show new overview page in multiple places, we need to dynamically decide which page to use\r\nimport { StyledPerformanceMaxSingleCampaign } from './pmax-single-campaign-page/pmax-single-campaign';\r\n\r\nexport const OverviewPage = (props) => {\r\n const styles = useOverviewPageStyles();\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n};\r\n\r\nOverviewPage.propTypes = {\r\n};\r\n\r\nOverviewPage.defaultProps = {\r\n};\r\n\r\n","/* eslint-disable import/first */\r\nimport * as metricFormatter from '@bingads-webui-campaign-legacy/performance-metric-formatter/index';\r\nimport dateUtil from '@bingads-webui-component-legacy/humanize/date';\r\nimport jsdata from '@bingads-webui-component-legacy/js-data-campaign/index';\r\nimport cacheManager from '@bingads-webui-campaign-legacy/cache-manager/index';\r\n// eslint-disable-next-line\r\nimport _bingads_webui_component_legacy_legacy_router_index from '@bingads-webui-component-legacy/legacy-router/index';\r\n// eslint-disable-next-line\r\nconst { legacyRouter } = _bingads_webui_component_legacy_legacy_router_index;\r\nimport pageContext from '@bingads-webui-static-legacy/page-context';\r\nimport instrumentation from '@bingads-webui-static-legacy/instrumentation/index';\r\nimport constants from '@bingads-webui-static-legacy/instrumentation/constants';\r\n\r\nconst s$i18n = window.globalLegacyI18n.get('$/schema-i18n!campaign');\r\nconst legacyI18n = window.globalLegacyI18n.get('@bingads-webui/i18n-amd-loader!campaignui/feature/dashboard-cards');\r\n\r\nconst deps = {\r\n legacyRouter,\r\n pageContext,\r\n instrumentation,\r\n constants,\r\n metricFormatter,\r\n i18n: legacyI18n,\r\n s$i18n,\r\n};\r\n\r\nexport const conversionTrackingDeps = {\r\n dateUtil,\r\n jsdata,\r\n cacheManager,\r\n s$i18n,\r\n legacyI18n,\r\n deps,\r\n};\r\n\r\n","import * as metricFormatter from '@bingads-webui-campaign-legacy/performance-metric-formatter/index';\r\nimport dateUtil from '@bingads-webui-component-legacy/humanize/date';\r\nimport jsdata from '@bingads-webui-component-legacy/js-data-campaign/index';\r\n\r\nexport const tableDeps = {\r\n metricFormatter,\r\n dateUtil,\r\n jsdata,\r\n};\r\n\r\n","/* eslint-disable import/first */\r\nimport legacyConfig from '@bingads-webui-component-legacy/config/index';\r\nimport jsdata from '@bingads-webui-component-legacy/js-data-campaign/index';\r\nimport featureInstrumentation from '@bingads-webui-campaign-legacy/instrumentation/index';\r\nimport instrumentationConstants from '@bingads-webui-static-legacy/instrumentation/constants';\r\nimport instrumentationLegacy from '@bingads-webui-static-legacy/instrumentation/index';\r\nimport * as i18nErrors from '@bingads-webui-component-legacy/api-errors-campaign/index';\r\nimport preferencesService from '@bingads-webui-component-legacy/preference/service/index';\r\nimport locationMap from '@bingads-webui-campaign-legacy/location-targets/view/locationMap';\r\n// eslint-disable-next-line\r\nimport _bingads_webui_component_legacy_legacy_router_index from '@bingads-webui-component-legacy/legacy-router/index';\r\n// eslint-disable-next-line\r\nconst { legacyRouter } = _bingads_webui_component_legacy_legacy_router_index;\r\nimport * as walkme from '@bingads-webui-component-legacy/walkme/directive/index';\r\nimport * as adDisplayUrlService from '@bingads-webui-campaign-legacy/crud-ad/service/displayUrl';\r\n\r\nexport const recommendationsDeps = {\r\n legacyConfig,\r\n jsdata,\r\n featureInstrumentation,\r\n instrumentationConstants,\r\n instrumentationLegacy,\r\n i18nErrors,\r\n preferencesService,\r\n // We should remove this dependency in the future as it uses backbone, we need a react version of it\r\n locationMap,\r\n legacyRouter,\r\n walkme,\r\n adDisplayUrlService,\r\n};\r\n","import * as metricFormatter from '@bingads-webui-campaign-legacy/performance-metric-formatter/index';\r\nimport dateUtil from '@bingads-webui-component-legacy/humanize/date';\r\nimport jsdata from '@bingads-webui-component-legacy/js-data-campaign/index';\r\n\r\nconst legacyI18n = window.globalLegacyI18n.get('@bingads-webui/i18n-amd-loader!campaignui/feature/campaigns-tab/campaigns');\r\n\r\nexport const topChangesLegacyDeps = {\r\n metricFormatter,\r\n dateUtil,\r\n jsdata,\r\n legacyI18n,\r\n};\r\n\r\n","import {\r\n cardRecommendationsId,\r\n\r\n cardTopCampaignsId,\r\n cardTopKeywordsId,\r\n cardSearchTermsId,\r\n cardTopAdGroupsId,\r\n cardTopAccountsId,\r\n cardConversionTrackingId,\r\n\r\n cardTopChangesAccountId,\r\n cardTopChangesCampaignId,\r\n cardTopChangesAdGroupId,\r\n} from '@bingads-webui-campaign/fluent-page-consts';\r\n\r\nimport { conversionTrackingDeps } from './conversion-tracking-imports';\r\nimport { tableDeps } from './grid-card-imports';\r\nimport { recommendationsDeps } from './recommendations-imports';\r\nimport { topChangesLegacyDeps } from './top-changes-imports';\r\n\r\nexport const legacyDeps = {\r\n [cardRecommendationsId]: recommendationsDeps,\r\n [cardTopCampaignsId]: tableDeps,\r\n [cardTopAccountsId]: tableDeps,\r\n [cardTopKeywordsId]: tableDeps,\r\n [cardSearchTermsId]: tableDeps,\r\n [cardTopAdGroupsId]: tableDeps,\r\n [cardConversionTrackingId]: conversionTrackingDeps,\r\n [cardTopChangesAccountId]: topChangesLegacyDeps,\r\n [cardTopChangesCampaignId]: topChangesLegacyDeps,\r\n [cardTopChangesAdGroupId]: topChangesLegacyDeps,\r\n};\r\n","const childPerfMarkers = {};\r\n\r\nexport function getChildPerfMarkers({\r\n perfMarker,\r\n configs,\r\n cardSize,\r\n}) {\r\n if (!configs) {\r\n return childPerfMarkers;\r\n }\r\n configs.forEach((config, index) => {\r\n if (!childPerfMarkers[config.typeId] && index < cardSize) {\r\n const childPerfMarker = perfMarker.createChild(config.typeId);\r\n childPerfMarkers[config.typeId] = childPerfMarker;\r\n childPerfMarker.willInit();\r\n } else if (!childPerfMarkers[config.typeId]) {\r\n // If we don't show cards in view port, we don't need to create perf markers for them\r\n childPerfMarkers[config.typeId] = {\r\n willFetchData: () => {},\r\n willRender: () => {},\r\n done: () => {},\r\n };\r\n }\r\n });\r\n\r\n return childPerfMarkers;\r\n}\r\n","import { useState, useEffect } from 'react';\r\nimport { isEqual } from 'underscore';\r\n\r\nexport function useStableObject(obj) {\r\n const [stableObj, setStableObject] = useState(null);\r\n\r\n useEffect(() => {\r\n if (!isEqual(obj, stableObj)) {\r\n setStableObject(obj);\r\n }\r\n }, [obj, stableObj]);\r\n return stableObj || obj;\r\n}\r\n","import _ from 'underscore';\r\nimport { useState, useEffect } from 'react';\r\nimport odata from '@bingads-webui-component-legacy/http/channel/odata';\r\nimport instrumentationSettings from '@bingads-webui-static-legacy/instrumentation/campaignSchemaAndSetting';\r\nimport { useDashboardPreferences } from '@bingads-webui-campaign/overview-welcome-tips-card';\r\n\r\nconst userWelcomePrefName = 'doneWithWelcomeTips';\r\nlet doneInitialLoad = false;\r\nfunction uri() {\r\n const api = 'Customers(:advertisercustomer_id)/Accounts(:account_id)/Default.AlertInformation';\r\n const odataParam = '$select=HasBIData,HasCampaigns,HasOtherAccounts';\r\n\r\n return `${api}?${odataParam}`;\r\n}\r\n\r\nexport const useWelcomeTips = ({\r\n preference, navigationLevel, serverContext, instrumentation, constants,\r\n}) => {\r\n const { WelcomeStatus } = serverContext;\r\n\r\n const [welcomeTipsStatus, setWelcomeTipsStatus] = useState();\r\n const { options, saveDashBoardOptions } = useDashboardPreferences({ preference, navigationLevel });\r\n\r\n const userWelcomePref = preference.findByNameAtUserLevel(userWelcomePrefName);\r\n\r\n useEffect(() => {\r\n if (welcomeTipsStatus) {\r\n return;\r\n }\r\n\r\n let cancel = false;\r\n const doNotShowWelcomeTips = navigationLevel !== 'account' || _.get(userWelcomePref, 'Data', false) === true;\r\n\r\n const welcomeStatus = new Promise((resolve) => {\r\n if (doNotShowWelcomeTips) {\r\n resolve({ showWelcomeTips: false });\r\n } else if (WelcomeStatus && !doneInitialLoad) {\r\n resolve({\r\n showWelcomeTips: WelcomeStatus.ShowWelcomeTips,\r\n createdCampaign: WelcomeStatus.HasCampaigns,\r\n skippedBothAtAccountCreation: options.skippedBothAtAccountCreation,\r\n skippedNoneAtAccountCreation: options.skippedNoneAtAccountCreation,\r\n });\r\n // If it is not first page loading scenario, we should go to else block.\r\n // we have to delay the flag update here because the hook will be called\r\n // multiple times during the page loading.\r\n setTimeout(() => {\r\n doneInitialLoad = true;\r\n }, 3000);\r\n } else {\r\n odata.get(uri()).then((data) => {\r\n if (data.HasBIData || data.HasOtherAccounts) {\r\n resolve({ showWelcomeTips: false });\r\n } else {\r\n resolve({\r\n showWelcomeTips: true,\r\n createdCampaign: data.HasCampaigns,\r\n skippedBothAtAccountCreation: options.skippedBothAtAccountCreation,\r\n skippedNoneAtAccountCreation: options.skippedNoneAtAccountCreation,\r\n });\r\n }\r\n }).catch(() => {\r\n resolve({ showWelcomeTips: false });\r\n });\r\n }\r\n });\r\n\r\n welcomeStatus.then((status) => {\r\n if (cancel) {\r\n return;\r\n }\r\n if (status.showWelcomeTips) {\r\n // for the users we show welcome tips, set overview tab as default.\r\n preference.set({\r\n Name: 'OverviewAsDefaultTab',\r\n Data: true,\r\n });\r\n } else if (!doNotShowWelcomeTips) {\r\n // status changed. We will not show welcome tips for this user anymore.\r\n // option clean up\r\n const newOptions = _.omit(options, ['skippedBothAtAccountCreation', 'doneWithWelcomeTips', 'skippedNoneAtAccountCreation']);\r\n saveDashBoardOptions(newOptions);\r\n\r\n instrumentation.startScenario(instrumentationSettings.SCENARIONAME.LoadOverviewPage);\r\n instrumentation.startActivity(instrumentationSettings.ACTIVITYNAME.LoadOverviewPage);\r\n instrumentation.logMessage([constants.LOGCATEGORY.TRACE], constants.LOGLEVEL.INFO, 'overview', 'No welcomeTips for this user anymore.');\r\n\r\n preference.setAtUserLevel({\r\n Name: userWelcomePrefName,\r\n Data: true,\r\n });\r\n }\r\n setWelcomeTipsStatus(status);\r\n\r\n // eslint-disable-next-line no-unused-expressions\r\n () => {\r\n cancel = true;\r\n };\r\n });\r\n }, [WelcomeStatus, constants, instrumentation, navigationLevel, options, preference, saveDashBoardOptions, userWelcomePref, welcomeTipsStatus]);\r\n\r\n return welcomeTipsStatus;\r\n};\r\n","import { makeStyles, shorthands } from '@fluentui/react-components';\r\n\r\nexport const useOverviewPageStyles = makeStyles({\r\n pageContainer: {\r\n maxWidth: '2200px',\r\n minWidth: '200px',\r\n position: 'relative',\r\n ...shorthands.padding('16px', '26px', '8px'),\r\n },\r\n cardsContainer: {\r\n position: 'relative',\r\n '&:after': {\r\n content: '\"\"',\r\n display: 'block',\r\n clear: 'both',\r\n },\r\n },\r\n disclaimer: {\r\n ...shorthands.margin('12px', '0px', '0px', '0px'),\r\n '& .disclaimer-banner': {\r\n ...shorthands.padding('0px', '0px', '0px', '8px'),\r\n },\r\n },\r\n cardWidth33: {\r\n width: '33.3%',\r\n },\r\n cardWidth50: {\r\n width: '50%',\r\n },\r\n cardWidth66: {\r\n width: '66.6%',\r\n },\r\n cardWidth100: {\r\n width: '100%',\r\n },\r\n cardBasic: {\r\n height: '389px',\r\n minWidth: '320px',\r\n },\r\n dynamicHeight: {\r\n minWidth: '320px',\r\n },\r\n errorContainer: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n textAlign: 'center',\r\n marginTop: '20px',\r\n },\r\n errorImage: {\r\n width: '150px',\r\n height: '150px',\r\n marginBottom: '10px',\r\n },\r\n errorMessage: {\r\n width: '450px',\r\n textAlign: 'center',\r\n margin: '0 auto',\r\n },\r\n});\r\n","import React, { useContext, useCallback } from 'react';\r\nimport { Button } from '@fluentui/react-components';\r\nimport PropTypes from 'prop-types';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\nimport { useOverviewPageStyles } from '../style/overview-page-phase-2-style';\r\nimport tooManyAccountsError from '../media/tooManyAccountsError.png';\r\n\r\nexport const TooMuchAccountsError = ({ i18n }) => {\r\n const { scope } = useContext(ScopeContext);\r\n const styles = useOverviewPageStyles();\r\n\r\n const onClick = useCallback(() => {\r\n scope.save(getRoutePathById(allSiteMap, 'overview'));\r\n }, [scope]);\r\n\r\n return (\r\n
\r\n \"Too\r\n

\r\n {i18n.getString(_TL_('The tiles cannot be loaded because there are too many accounts. Please view the accounts on the management tab.'))}\r\n

\r\n \r\n
\r\n );\r\n};\r\n\r\nTooMuchAccountsError.propTypes = {\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n};\r\n","import _ from 'underscore';\r\nimport React, { useMemo, useContext, useCallback, useEffect, useState } from 'react';\r\nimport classNames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport { OverviewCard } from '@bingads-webui-campaign-react/overview-card';\r\nimport { CardSize } from '@bingads-webui-campaign-react/overview-card-const';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { WaterfallFilterStorage, WaterfallFilterType, waterfallDateFilterProcessor } from '@bingads-webui-campaign/filter-storage';\r\nimport { getFilteredCampaignTypeFromWaterfallFilter } from '@bingads-webui-campaign-react/shell-ui-common';\r\nimport constants from '@bingads-webui-static-legacy/instrumentation/constants';\r\nimport instrumentation from '@bingads-webui-static-legacy/instrumentation/index';\r\nimport { PreferenceContext } from '@bingads-webui-react/preference-context';\r\nimport { CardSelector } from '@bingads-webui-campaign-react/card-selector';\r\nimport { PageReady } from '@bingads-webui/page-ready';\r\nimport { DisclaimerBanner } from '@bingads-webui-campaign-react/help';\r\nimport {\r\n getPreferencePatcher,\r\n getCardPreferenceKey,\r\n getNavigationLevel,\r\n useSelectedCardsWithPreference,\r\n getFluentCardsConfigs,\r\n getCardPreferenceWithDefault,\r\n getCardPreferenceOptionsForDfm,\r\n getViewPortCardsCount,\r\n} from '@bingads-webui-campaign/fluent-page-data';\r\nimport { getCardViewConstructor } from '@bingads-webui-campaign/fluent-page-view-constructor';\r\nimport { InstrumentationContext } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { CampaignStatusSummaryCards } from '@bingads-webui-campaign-react/campaign-status-summary-cards';\r\nimport { cardDiagnosticId, cardPerformanceId } from '@bingads-webui-campaign/fluent-page-consts';\r\n\r\nimport { legacyDeps } from './legacy-deps/index';\r\nimport { useOverviewPhase2WindowSizeChange } from './use-overview-window-size-change';\r\nimport { getChildPerfMarkers } from './get-child-perf-markers';\r\nimport { useStableObject } from './helper/use-stable-object';\r\nimport { useWelcomeTips } from './helper/use-welcome-tips';\r\nimport { useHasTooManyAccounts } from './too-many-accounts/use-has-too-many-accounts';\r\nimport { TooMuchAccountsError } from './too-many-accounts/too-many-accounts';\r\nimport { useOverviewPageStyles } from './style/overview-page-phase-2-style';\r\n\r\nconst campaignStateCard = 'CampaignStatusSummaryCards-CampaignState';\r\nconst budgetCard = 'CampaignStatusSummaryCards-Budget';\r\nconst bidStrategyCard = 'CampaignStatusSummaryCards-BidStrategy';\r\nconst SummaryCardsConfigs = [{ typeId: campaignStateCard }, { typeId: budgetCard }, { typeId: bidStrategyCard }];\r\n\r\nconst getCardSizeClass = (size, responsiveSize, styles) => {\r\n if (responsiveSize === 'xxl') {\r\n if (size === CardSize.Small) {\r\n return styles.cardWidth33;\r\n }\r\n return styles.cardWidth66;\r\n } else if (responsiveSize === 'xl') {\r\n if (size === CardSize.Small) {\r\n return styles.cardWidth50;\r\n }\r\n return styles.cardWidth100;\r\n }\r\n return styles.cardWidth100;\r\n};\r\n\r\nexport const OverviewPagePhase2 = (props) => {\r\n const styles = useOverviewPageStyles();\r\n const { scope } = useContext(ScopeContext);\r\n const {\r\n serverContext,\r\n permissions,\r\n preferenceService,\r\n i18n,\r\n currentCampaign,\r\n perfMarker,\r\n isSDK,\r\n } = props;\r\n const responsiveSize = useOverviewPhase2WindowSizeChange();\r\n const preference = useContext(PreferenceContext);\r\n const instrumentationContextValue = useContext(InstrumentationContext);\r\n const { activity: dfmActivity } = useMemo(() => instrumentationContextValue.createScenarioAndActivity({\r\n scenarioName: 'Fluent2OverviewPage',\r\n activityName: 'DataFetchManager',\r\n }), [instrumentationContextValue]);\r\n\r\n const { activity: overviewPageActivity } = useMemo(() => instrumentationContextValue.createScenarioAndActivity({\r\n scenarioName: 'Fluent2OverviewPage',\r\n activityName: 'OverviewPage',\r\n }), [instrumentationContextValue]);\r\n\r\n // We use this key to force the cards to reset their internal preference state when certain props change\r\n const [refreshKey, setRefreshKey] = useState(0);\r\n\r\n const waterfallFilterStorage = useMemo(() => new WaterfallFilterStorage({ preferenceService }), [preferenceService]);\r\n\r\n // Cannot use useMemo here as it will get stale data\r\n const dateRange = waterfallDateFilterProcessor(\r\n waterfallFilterStorage.getFilters([WaterfallFilterType.DateFilter]),\r\n serverContext\r\n );\r\n const filter = waterfallFilterStorage.getFilters([\r\n WaterfallFilterType.CampaignType,\r\n WaterfallFilterType.CampaignStatus,\r\n WaterfallFilterType.AdGroupStatus,\r\n ]);\r\n const stableDateRange = useStableObject(dateRange);\r\n const stableFilter = useStableObject(filter);\r\n\r\n const filterCampaignType = getFilteredCampaignTypeFromWaterfallFilter(filter);\r\n\r\n const navigationLevel = useMemo(() => getNavigationLevel(scope.values), [scope.values]);\r\n\r\n const campaignType = useMemo(() => {\r\n let result = filterCampaignType;\r\n if (currentCampaign) {\r\n result = _.chain(currentCampaign).result('CampaignType').value();\r\n }\r\n return result;\r\n }, [currentCampaign, filterCampaignType]);\r\n\r\n const isLinkedInCampaignOverview = currentCampaign && campaignType === 'LinkedIn';\r\n const isPMaxCampaignOverview = currentCampaign && campaignType === 'PerformanceMax';\r\n const isShowCampaignStatusSummaryCards = isLinkedInCampaignOverview || isPMaxCampaignOverview;\r\n const isMobileAppCampaign = useMemo(() => {\r\n const { CampaignSettings, CampaignType } = currentCampaign || {};\r\n const isAppCampaign = CampaignType && CampaignType === 'App';\r\n const getCampaignSetting = CampaignSettings && CampaignSettings.find(setting => setting['@odata.type'] === '#Model.AppSetting');\r\n\r\n return isAppCampaign ? getCampaignSetting?.AppStore === 'AppleAppStore' || getCampaignSetting?.AppStore === 'GoogleAppStore' : false;\r\n }, [currentCampaign]);\r\n\r\n const welcomeTipsConfig = useWelcomeTips({\r\n preference, navigationLevel, serverContext, instrumentation, constants,\r\n });\r\n const isLoadingWelcomeCardConfig = !welcomeTipsConfig;\r\n const showWelcomeTips = welcomeTipsConfig && welcomeTipsConfig.showWelcomeTips;\r\n\r\n const cardsConfigs = useMemo(() => getFluentCardsConfigs({\r\n permissions,\r\n showWelcomeTips,\r\n isMobileAppCampaign,\r\n }), [permissions, showWelcomeTips, isMobileAppCampaign]);\r\n\r\n const {\r\n selectedCardsConfigs,\r\n cardSelectionCards,\r\n onCardSelectionSaved,\r\n } = useSelectedCardsWithPreference({\r\n preference,\r\n cardsConfigs,\r\n navigationLevel,\r\n campaignType: navigationLevel !== 'customer' && campaignType,\r\n serverContext,\r\n isLoadingWelcomeCardConfig,\r\n isSDK,\r\n });\r\n\r\n useEffect(() => {\r\n overviewPageActivity.trace(`Overview Page Info - navigationLevel: ${navigationLevel} - campaignType: ${campaignType} - isSDK: ${isSDK} - showWelcomeTips: ${showWelcomeTips} -`);\r\n }, [navigationLevel, campaignType, isSDK, showWelcomeTips, overviewPageActivity]);\r\n\r\n const getCardsConfig = useCallback(() => selectedCardsConfigs.map(config => getCardPreferenceOptionsForDfm({\r\n config,\r\n navigationLevel,\r\n campaignType,\r\n preference,\r\n permissions,\r\n })), [campaignType, navigationLevel, permissions, preference, selectedCardsConfigs]);\r\n\r\n const pageViewPortCardSizeFallback = getViewPortCardsCount(selectedCardsConfigs);\r\n const pageViewPortSizeFromDfm = window.FluentOverviewPageDataFetchManagerCardsConfigObject\r\n && window.FluentOverviewPageDataFetchManagerCardsConfigObject.viewPortCardSize;\r\n // we don't change this card size value after initializing it with useState\r\n const [pageViewPortCardSize, setPageViewPortCardSize] = useState(pageViewPortSizeFromDfm || pageViewPortCardSizeFallback);\r\n const [viewportReady, setViewportReady] = useState(false);\r\n\r\n const tiles = ['Device'];\r\n const showTooMuchDataError = useHasTooManyAccounts({\r\n navigationLevel,\r\n dateRange,\r\n getCardsConfig,\r\n permissions,\r\n tiles,\r\n overviewPageActivity,\r\n });\r\n\r\n useEffect(() => {\r\n // On single campaign overview page, we don't have view port size from dfm\r\n // We may need to wait for webcome card config to be ready before we can get pageViewPortCardSizeFallback\r\n if ((!pageViewPortCardSize || pageViewPortCardSize < 1) && pageViewPortCardSizeFallback > 0) {\r\n setPageViewPortCardSize(pageViewPortCardSizeFallback);\r\n }\r\n }, [pageViewPortCardSize, pageViewPortCardSizeFallback]);\r\n\r\n useEffect(() => {\r\n // In case we have issues rendering cards in viewport, we always start to render cards outside of view port after 7 seconds.\r\n // 7 seconds is now about the P95 value of viewport rendering time\r\n const timeoutId = setTimeout(() => {\r\n setViewportReady(true);\r\n }, 7000);\r\n return () => clearTimeout(timeoutId);\r\n }, [dfmActivity]);\r\n\r\n const perfMarkers = useMemo(() => getChildPerfMarkers({\r\n perfMarker,\r\n configs: selectedCardsConfigs,\r\n cardSize: (window.FluentOverviewPageDataFetchManagerCardsConfigObject\r\n && window.FluentOverviewPageDataFetchManagerCardsConfigObject.viewPortCardSize)\r\n || pageViewPortCardSize,\r\n }), [pageViewPortCardSize, perfMarker, selectedCardsConfigs]);\r\n\r\n const perfMarkersWithSummaryCards = useMemo(() => {\r\n if (isShowCampaignStatusSummaryCards) {\r\n return getChildPerfMarkers({\r\n perfMarker,\r\n configs: SummaryCardsConfigs,\r\n cardSize: SummaryCardsConfigs.length,\r\n });\r\n }\r\n return {};\r\n }, [isShowCampaignStatusSummaryCards, perfMarker]);\r\n\r\n const contentReady = useCallback((id) => {\r\n if (perfMarkersWithSummaryCards[id] && perfMarkersWithSummaryCards[id].done) {\r\n perfMarkersWithSummaryCards[id].done();\r\n }\r\n }, [perfMarkersWithSummaryCards]);\r\n\r\n const campaignStatusContentReady = useCallback(() => contentReady(campaignStateCard), [contentReady]);\r\n const budgetContentReady = useCallback(() => contentReady(budgetCard), [contentReady]);\r\n const bidStrategyContentReady = useCallback(() => contentReady(bidStrategyCard), [contentReady]);\r\n\r\n useEffect(() => {\r\n if (window.FluentOverviewPageDataFetchManagerCardsConfigObject) {\r\n const config = getCardsConfig();\r\n const {\r\n config: dfmConfig,\r\n viewPortCardSize,\r\n isKeywordInViewPort,\r\n isSearchTermInViewPort,\r\n innerHeight,\r\n innerWidth,\r\n campaignType: dfmCampaignType,\r\n } = window.FluentOverviewPageDataFetchManagerCardsConfigObject;\r\n\r\n if (!_.isEmpty(config) && campaignType === dfmCampaignType) {\r\n if (!_.isEqual(dfmConfig, config)) {\r\n const strConfig = JSON.stringify(config);\r\n const strDfmConfig = JSON.stringify(dfmConfig);\r\n dfmActivity.trace(`DFM viewPortCardSize: ${viewPortCardSize} - innerHeight: ${innerHeight} - innerWidth: ${innerWidth}`);\r\n dfmActivity.trace(`CampaignType: ${campaignType} - CardsConfig changed from ${strDfmConfig} to ${strConfig}`);\r\n } else {\r\n const strConfig = JSON.stringify(config);\r\n dfmActivity.trace(`DFM card configs is consistent in new overview page: CampaignType: ${campaignType}, ${strConfig}`);\r\n dfmActivity.trace(`isKeywordInViewPort: ${isKeywordInViewPort}`);\r\n dfmActivity.trace(`isSearchTermInViewPort: ${isSearchTermInViewPort}`);\r\n dfmActivity.trace(`viewPortCardSize: ${viewPortCardSize}`);\r\n }\r\n\r\n if (viewPortCardSize !== pageViewPortCardSize) {\r\n dfmActivity.trace(`DFM viewPortCardSize: ${viewPortCardSize} - pageViewPortCardSize: ${pageViewPortCardSize}`);\r\n }\r\n\r\n delete window.FluentOverviewPageDataFetchManagerCardsConfigObject;\r\n }\r\n }\r\n }, [campaignType, dfmActivity, getCardsConfig, pageViewPortCardSize]);\r\n\r\n useEffect(() => {\r\n perfMarker.doneCallback = () => {\r\n PageReady.pageIsReady();\r\n setViewportReady(true);\r\n dfmActivity.trace('Overview Viewport Page Ready');\r\n };\r\n\r\n if (_.size(cardSelectionCards) > 0 && pageViewPortCardSize === 0) {\r\n perfMarker.doneCallback();\r\n }\r\n }, [pageViewPortCardSize, perfMarker, dfmActivity, cardSelectionCards]);\r\n\r\n const cards = useMemo(() => _.chain(selectedCardsConfigs)\r\n .first(viewportReady ? selectedCardsConfigs.length : pageViewPortCardSize)\r\n .map(cardConfig => getCardViewConstructor({\r\n config: cardConfig,\r\n instrumentation,\r\n constants,\r\n campaignType,\r\n }))\r\n .value(), [selectedCardsConfigs, viewportReady, pageViewPortCardSize, campaignType]);\r\n\r\n const campaignStatus = _.get(currentCampaign, 'Status');\r\n\r\n useEffect(() => {\r\n const { AppCampaignNewCampaignGridColumns } = permissions.dynamic || {};\r\n if (AppCampaignNewCampaignGridColumns) {\r\n setRefreshKey(_.uniqueId());\r\n }\r\n // the dependency array specifies props that, when changed, should trigger the re-calcuation of internal preference state\r\n // if this is needed, add the prop to the dependency array\r\n }, [permissions, campaignType, campaignStatus]);\r\n\r\n const renderCards = useCallback(() => (\r\n <>\r\n {_.map(cards, ({\r\n CardView,\r\n CardHeaderContent,\r\n config,\r\n getCardHeaderContentProps = _.noop,\r\n getCardViewProps = _.noop,\r\n }) => {\r\n const cardPreferenceKey = getCardPreferenceKey({\r\n cardTypeId: config.typeId,\r\n navigationLevel,\r\n campaignType,\r\n });\r\n const cardPreference = getCardPreferenceWithDefault({\r\n config,\r\n navigationLevel,\r\n campaignType,\r\n preference,\r\n permissions,\r\n });\r\n\r\n const patchPreference = getPreferencePatcher({\r\n key: cardPreferenceKey,\r\n preference,\r\n });\r\n const staticDepsProps = legacyDeps[config.typeId] || {};\r\n\r\n const perfMarkerUtils = {\r\n willFetchData: () => {\r\n if (perfMarkers[config.typeId]) {\r\n perfMarkers[config.typeId].willFetchData();\r\n }\r\n },\r\n willRender: () => {\r\n if (perfMarkers[config.typeId]) {\r\n perfMarkers[config.typeId].willRender();\r\n }\r\n },\r\n done: () => {\r\n if (perfMarkers[config.typeId]) {\r\n perfMarkers[config.typeId].done();\r\n }\r\n },\r\n };\r\n\r\n const isDiagnositcCard = config.typeId === cardDiagnosticId;\r\n const dynamicHeight = (config.dynamicHeightForNarrow && responsiveSize !== 'xl' && responsiveSize !== 'xxl') || isDiagnositcCard;\r\n const isFullWidthCard = (isPMaxCampaignOverview || isMobileAppCampaign) && (config.typeId === cardPerformanceId || isDiagnositcCard);\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n })}\r\n \r\n ), [campaignType, cards, dateRange, getCardsConfig, i18n, isPMaxCampaignOverview, navigationLevel, perfMarkers, permissions, preference, preferenceService, refreshKey, responsiveSize, serverContext, stableDateRange, stableFilter, styles, welcomeTipsConfig, isSDK]);\r\n\r\n\r\n const TimeZone = _.get(serverContext, ['CurrentAccount', 'TimeZone'], 0);\r\n const cardSelectorKey = `${navigationLevel}-${campaignType}`;\r\n const showCardSelector = !isLoadingWelcomeCardConfig && !showWelcomeTips && !isLinkedInCampaignOverview && !isPMaxCampaignOverview && !isMobileAppCampaign;\r\n\r\n return (\r\n
\r\n {showTooMuchDataError ? () :\r\n showCardSelector && }\r\n {isShowCampaignStatusSummaryCards &&\r\n \r\n }\r\n {!showTooMuchDataError &&\r\n
\r\n {renderCards()}\r\n
}\r\n {!showTooMuchDataError && !showWelcomeTips && !isSDK &&\r\n
\r\n \r\n
\r\n }\r\n
\r\n );\r\n};\r\n\r\nOverviewPagePhase2.propTypes = {\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func.isRequired,\r\n }).isRequired,\r\n currentCampaign: PropTypes.shape({\r\n CampaignType: PropTypes.string,\r\n }),\r\n perfMarker: PropTypes.shape({\r\n done: PropTypes.func.isRequired,\r\n doneCallback: PropTypes.func,\r\n }).isRequired,\r\n permissions: PropTypes.shape({\r\n dynamic: PropTypes.shape({\r\n AppCampaignNewCampaignGridColumns: PropTypes.bool,\r\n }),\r\n }).isRequired,\r\n serverContext: PropTypes.shape({\r\n CurrentAccount: PropTypes.shape({\r\n TimeZone: PropTypes.number,\r\n }),\r\n }).isRequired,\r\n preferenceService: PropTypes.shape({}).isRequired,\r\n isSDK: PropTypes.bool,\r\n};\r\n\r\nOverviewPagePhase2.defaultProps = {\r\n currentCampaign: null,\r\n isSDK: false,\r\n};\r\n\r\n","import _ from 'underscore';\r\nimport { useEffect, useState, useRef } from 'react';\r\nimport { fetchAggregatedData } from '@bingads-webui-campaign/overview-cards-common';\r\nimport edm from '@bingads-webui-component-legacy/edm-campaign/index';\r\nimport dateUtil from '@bingads-webui-component-legacy/humanize/date';\r\nimport jsdata from '@bingads-webui-component-legacy/js-data-campaign/index';\r\nimport { cardDeviceId } from '@bingads-webui-campaign/fluent-page-consts';\r\n\r\nexport const useHasTooManyAccounts = ({\r\n navigationLevel,\r\n dateRange,\r\n getCardsConfig,\r\n permissions,\r\n tiles,\r\n overviewPageActivity,\r\n}) => {\r\n const [showTooMuchDataError, setShowTooMuchDataError] = useState(false);\r\n const hasFetchedRef = useRef(false);\r\n\r\n useEffect(() => {\r\n let cancel = false;\r\n\r\n if (navigationLevel === 'customer' && !hasFetchedRef.current) {\r\n hasFetchedRef.current = true;\r\n\r\n const result = fetchAggregatedData({\r\n entitySet: edm.currentCustomer.Accounts,\r\n dateRange,\r\n jsdata,\r\n dateUtil,\r\n getCardsConfig,\r\n permissions,\r\n dfmCacheKey: cardDeviceId,\r\n });\r\n\r\n if (result && typeof result.then === 'function') {\r\n result\r\n .then((response) => {\r\n if (cancel) return;\r\n if (\r\n Array.isArray(response.errors) &&\r\n _.some(response.errors, error => error.Code === 'TooMuchDataToDownload')\r\n ) {\r\n setShowTooMuchDataError(true);\r\n }\r\n })\r\n .catch((error) => {\r\n if (cancel) return;\r\n overviewPageActivity.trace('Error in fetchMCCOverview:', error);\r\n });\r\n } else {\r\n console.error('fetchAggregatedData did not return a Promise:', result);\r\n }\r\n }\r\n\r\n return () => {\r\n cancel = true;\r\n };\r\n }, [navigationLevel, dateRange, getCardsConfig, permissions, tiles, overviewPageActivity]);\r\n\r\n return showTooMuchDataError;\r\n};\r\n","/* eslint-disable import/first */\r\nimport * as metricFormatter from '@bingads-webui-campaign-legacy/performance-metric-formatter/index';\r\nimport dateUtil from '@bingads-webui-component-legacy/humanize/date';\r\nimport eventDispatcher from '@bingads-webui-component-legacy/event-dispatcher/index';\r\nimport jsdata from '@bingads-webui-component-legacy/js-data-campaign/index';\r\n// eslint-disable-next-line\r\nimport _bingads_webui_component_legacy_legacy_router_index from '@bingads-webui-component-legacy/legacy-router/index';\r\n// eslint-disable-next-line\r\nconst { legacyRouter } = _bingads_webui_component_legacy_legacy_router_index;\r\nimport state from '@bingads-webui-component-legacy/state/index';\r\nimport config from '@bingads-webui-component-legacy/config/index';\r\nimport instrumentation from '@bingads-webui-static-legacy/instrumentation/index';\r\nimport constants from '@bingads-webui-static-legacy/instrumentation/constants';\r\nimport pageContext from '@bingads-webui-static-legacy/page-context';\r\nimport azureUrlRewrite from '@bingads-webui-static-legacy/app/component/azureUrlRewrite';\r\nimport logger from '@bingads-webui-campaign-legacy/instrumentation/index';\r\nimport cacheManager from '@bingads-webui-campaign-legacy/cache-manager/index';\r\n\r\nconst s$i18n = window.globalLegacyI18n.get('$/schema-i18n!campaign');\r\nconst i18nLegacy = window.globalLegacyI18n.get('@bingads-webui/i18n-amd-loader!campaignui/feature/dashboard-cards');\r\n\r\nexport const legacyDeps = {\r\n i18n: i18nLegacy,\r\n onMounted: null,\r\n eventDispatcher: eventDispatcher.default || eventDispatcher,\r\n state,\r\n jsdata,\r\n config,\r\n instrumentation,\r\n constants,\r\n pageContext,\r\n legacyRouter,\r\n metricFormatter,\r\n s$i18n,\r\n dateUtil,\r\n azure: azureUrlRewrite,\r\n localInstrumentation: logger,\r\n cacheManager,\r\n};\r\n","import React from 'react';\r\nimport { Shimmer, ShimmerElementType } from '@fluentui/react';\r\n\r\nconst rowElement = [\r\n { type: ShimmerElementType.line, height: 2, width: '100%' },\r\n];\r\n\r\nconst buttonElement = [\r\n { type: ShimmerElementType.line, height: 20, width: '15%' },\r\n];\r\n\r\nconst footerButtonElement = [\r\n { type: ShimmerElementType.line, height: 32, width: 25 },\r\n];\r\n\r\nexport function ShimmerCard() {\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n );\r\n}\r\n","import { makeStyles } from '@fluentui/react-components';\r\n\r\nexport const useNoDataStyles = makeStyles({\r\n noDataContainer: {\r\n height: '100%',\r\n flexGrow: 1,\r\n textAlign: 'center',\r\n alignContent: 'center',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n },\r\n textContainer: {\r\n justifyItems: 'center',\r\n },\r\n text: {\r\n display: 'block',\r\n marginTop: '1px',\r\n },\r\n});\r\n\r\n","import classNames from 'classnames';\r\nimport React from 'react';\r\nimport { Image, Caption1Stronger, Caption1 } from '@fluentui/react-components';\r\n\r\nimport noDataImage from '../../media/no-data.png';\r\nimport { useNoDataStyles } from '../styles/no-data-styles';\r\n\r\nexport function NoDataCard({ i18n }: { i18n: any }) {\r\n const styles = useNoDataStyles();\r\n\r\n return (\r\n
\r\n
\r\n {i18n.getString(_TL_('No
\r\n
\r\n {i18n.getString(_TL_('No data available. '))}
\r\n
\r\n \r\n {i18n.getString(_TL_('To update the tile, select a different date range.'))}\r\n \r\n \r\n {i18n.getString(_TL_('If the tile remains blank, your account might have no data.'))}\r\n \r\n
\r\n
\r\n );\r\n}\r\n","import { makeStyles, shorthands } from '@fluentui/react-components';\r\nimport Circle from '../../media/circle.svg';\r\nimport TriangleDown from '../../media/triangle-down.svg';\r\nimport TriangleUp from '../../media/triangle-up.svg';\r\nimport Square from '../../media/square.svg';\r\nimport Diamond from '../../media/diamond.svg';\r\n\r\nexport const useCardStyles = makeStyles({\r\n container: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'space-between',\r\n height: '100%',\r\n '& .vnext-legend-labels-container': {\r\n paddingLeft: '10px',\r\n paddingTop: '10px',\r\n\r\n '& ul': {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n listStyleType: 'none',\r\n\r\n '& li': {\r\n minWidth: '60px',\r\n '& .legend-label': {\r\n height: '20px',\r\n paddingLeft: '15PX !important',\r\n backgroundRepeat: 'no-repeat',\r\n backgroundPositionX: 'left',\r\n backgroundPositionY: 'center',\r\n backgroundSize: '12px 20px',\r\n marginRight: '5px',\r\n marginLeft: '5px',\r\n marginTop: '1px',\r\n cursor: 'pointer',\r\n textOverflow: 'ellipsis',\r\n ...shorthands.overflow('hidden'),\r\n whiteSpace: 'nowrap',\r\n },\r\n\r\n '& .legend-label.disabled': {\r\n opacity: '50%',\r\n },\r\n },\r\n '& li:nth-child(1) .legend-label': {\r\n backgroundImage: `url(\"${Circle}\")`,\r\n },\r\n '& li:nth-child(2) .legend-label': {\r\n backgroundImage: `url(\"${Diamond}\")`,\r\n },\r\n '& li:nth-child(3) .legend-label': {\r\n backgroundImage: `url(\"${TriangleDown}\")`,\r\n },\r\n '& li:nth-child(4) .legend-label': {\r\n backgroundImage: `url(\"${TriangleUp}\")`,\r\n },\r\n '& li:nth-child(5) .legend-label': {\r\n backgroundImage: `url(\"${Square}\")`,\r\n },\r\n },\r\n },\r\n '& .highcharts-container': {\r\n ...shorthands.overflow('visible !important'),\r\n\r\n '& .chart-tooltip': {\r\n fontFamily: '\"Segoe UI\", Tahoma, Geneva, Verdana, sans-serif',\r\n fontSize: '14px',\r\n position: 'absolute',\r\n whiteSpace: 'nowrap',\r\n color: 'rgb(51, 51, 51)',\r\n ...shorthands.padding('15px'),\r\n display: 'block',\r\n boxShadow: '0 3.2px 7.2px 0 rgba(0,0,0,.132), 0 0.6px 1.8px 0 rgba(0,0,0,.108)',\r\n backgroundColor: 'rgba(255, 255, 255, 0.95)',\r\n '@supports (backdrop-filter: blur(60px))': {\r\n backdropFilter: 'blur(60px)',\r\n backgroundColor: 'rgba(255, 255, 255, 0.25)',\r\n },\r\n\r\n '& .segment-wrapper': {\r\n marginBottom: '10px',\r\n },\r\n\r\n '& .tooltip-name': {\r\n maxWidth: '400px',\r\n wordWrap: 'break-word',\r\n whiteSpace: 'normal',\r\n },\r\n },\r\n },\r\n },\r\n});\r\n\r\n","import { useState, useMemo, useEffect } from 'react';\r\n\r\nimport { getAuctionInsightDataSource, clearCache } from '@bingads-webui-campaign-legacy/dashboard-cards/competition-card/data-fetch';\r\nimport { createAsyncToken } from '@bingads-webui-universal/primitive-utilities';\r\n\r\nexport function useAuctionInsightData({\r\n dateRange,\r\n}) {\r\n const [data, setData] = useState();\r\n const [isLoading, setIsLoading] = useState(true);\r\n\r\n // Competition card is handling data internally\r\n // but we need to trigger a re-fetch when the date range changes\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n const dataSource = useMemo(() => getAuctionInsightDataSource(), [dateRange]);\r\n\r\n useEffect(() => {\r\n setIsLoading(true);\r\n createAsyncToken(dataSource.query()).on({\r\n onSuccess: (chartData: any) => {\r\n setData(chartData);\r\n setIsLoading(false);\r\n clearCache();\r\n },\r\n onError: () => {\r\n setData(undefined);\r\n setIsLoading(false);\r\n clearCache();\r\n },\r\n onCancel: () => {\r\n setData(undefined);\r\n setIsLoading(false);\r\n clearCache();\r\n },\r\n });\r\n }, [dataSource]);\r\n\r\n return { data, isLoading };\r\n}\r\n","import _ from 'underscore';\r\nimport classNames from 'classnames';\r\nimport React, { useCallback, useContext } from 'react';\r\nimport { AdvisorChartWithMetrics, CHART_TYPES } from '@bingads-webui-campaign-react/advisor-chart';\r\nimport { Button } from '@fluentui/react-components';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\n\r\nimport { ShimmerCard } from './shimmer-card';\r\nimport { NoDataCard } from './no-data-card';\r\nimport { useCardStyles } from '../styles/card-styles';\r\nimport { CompetitionCardProps, IScopeContext } from '../utils/types';\r\n\r\nimport { withAuctionInsightData } from '../data/with-auction-insight-data';\r\nimport { withFilterData } from './with-filter-data';\r\n\r\nexport function CompetitionCard({\r\n data,\r\n isLoading,\r\n i18n,\r\n perfMarkerUtils,\r\n selectedMetric,\r\n competitors = null,\r\n}: CompetitionCardProps) {\r\n const styles = useCardStyles();\r\n\r\n const { scope } = useContext(ScopeContext) as IScopeContext;\r\n // @ts-ignore\r\n const legacyI18n = window.globalLegacyI18n.get('@bingads-webui/i18n-amd-loader!campaignui/feature/dashboard-cards');\r\n\r\n const onClick = useCallback(() => {\r\n scope.save('/campaign/vnext/competitionauction');\r\n }, [scope]);\r\n\r\n const {\r\n willFetchData,\r\n willRender,\r\n done,\r\n } = perfMarkerUtils;\r\n\r\n if (isLoading) {\r\n willFetchData();\r\n return ();\r\n }\r\n\r\n willRender();\r\n done();\r\n\r\n if (!data?.items?.length) {\r\n return ;\r\n }\r\n\r\n return (\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n );\r\n}\r\n\r\nexport const CompetitionCardWithData = withAuctionInsightData(withFilterData(CompetitionCard));\r\n","import React, { ComponentType } from 'react';\r\n\r\nimport { useAuctionInsightData } from './use-auction-insight-data';\r\nimport { AuctionInsightDataProps, CompetitionCardWithAuctionDataProps } from '../utils/types';\r\n\r\nexport function withAuctionInsightData

(WrappedComponent: ComponentType

) {\r\n const HoC = React.memo((props: Omit) => {\r\n const { dateRange } = props;\r\n const { data, isLoading } = useAuctionInsightData({\r\n dateRange,\r\n });\r\n\r\n return ();\r\n });\r\n\r\n return HoC;\r\n}\r\n","import React, { ComponentType } from 'react';\r\n\r\nimport { withHeaderState } from '@bingads-webui-campaign-react/overview-card';\r\n\r\nimport { State, FilterDataProps, CompetitionCardProps } from '../utils/types';\r\n\r\nexport function withFilterData

(WrappedComponent: ComponentType

) {\r\n const HoC = (props: Omit & { headerState?: State }) => {\r\n const { headerState, isLoading } = props;\r\n return ();\r\n };\r\n HoC.defaultProps = {\r\n headerState: undefined,\r\n };\r\n return withHeaderState(HoC);\r\n}\r\n","import _ from 'underscore';\r\nimport { useState, useMemo, useContext, useEffect, useCallback } from 'react';\r\nimport { PreferenceContext } from '@bingads-webui-react/preference-context';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { getGeneralInsightsPreferences, saveGeneralInsightsPreferences } from '@bingads-webui-campaign-react/competition-core';\r\nimport { CAMPAIGN_TYPES, METRIC_PREFERENCE_KEY_NAME } from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\nimport {\r\n METRICS,\r\n getLocalizedMetrics\r\n} from '@bingads-webui-campaign-react/advisor-chart';\r\nimport config from '@bingads-webui-component-legacy/config/index';\r\n\r\nimport { getCampaignType } from '../utils/get-campaign-type';\r\nimport { Metric } from '../utils/types';\r\n\r\nexport const usePreferenceMetrics = ({ onMetricSet }: { onMetricSet: Function; }): {\r\n metrics: Metric[];\r\n selectedMetric: Metric;\r\n setMetric: Function;\r\n} => {\r\n const serverContext = useContext(ServerContext) as any;\r\n const preferenceService = useContext(PreferenceContext) as any;\r\n const preferences = getGeneralInsightsPreferences(preferenceService);\r\n // @ts-ignore\r\n const legacyI18n = window.globalLegacyI18n.get('@bingads-webui/i18n-amd-loader!campaignui/feature/dashboard-cards');\r\n\r\n const campaignType = getCampaignType(serverContext, config.get('CurrentCampaign'));\r\n\r\n const metrics = useMemo(() => getLocalizedMetrics(\r\n legacyI18n,\r\n campaignType === CAMPAIGN_TYPES.Shopping,\r\n serverContext?.Permissions?.IsAvgPositionDeprecationPhase1Enabled,\r\n serverContext?.Permissions?.IsAvgPositionDeprecationPhase2Enabled\r\n ), [campaignType, legacyI18n, serverContext]);\r\n\r\n const metricPreferenceKeyName = METRIC_PREFERENCE_KEY_NAME[campaignType];\r\n const [selectedMetric, setMetricValue] = useState(_.find(metrics, (m: Metric) => m.metric === preferences[metricPreferenceKeyName])\r\n || _.find(metrics, (m: Metric) => m.metric === METRICS.ImpressionShare));\r\n\r\n const setMetric = useCallback((metricObj) => {\r\n setMetricValue(metricObj);\r\n onMetricSet(metricObj.metric);\r\n saveGeneralInsightsPreferences({\r\n [metricPreferenceKeyName]: metricObj.metric,\r\n }, preferenceService);\r\n }, [metricPreferenceKeyName, onMetricSet, preferenceService]);\r\n\r\n return {\r\n metrics,\r\n selectedMetric,\r\n setMetric,\r\n };\r\n};\r\n","import { CAMPAIGN_TYPES, CAMPAIGN_TYPES_ENUM_VALUE } from '@bingads-webui-campaign/competition-auction-insight-preferences';\r\n\r\nexport function getCampaignType(serverContext, currentCampaign) {\r\n if (!serverContext?.Permissions?.IsBAACompetitionBSCAuctionInsightsEnabled) {\r\n return CAMPAIGN_TYPES.Search;\r\n } else if (currentCampaign?.CampaignType === CAMPAIGN_TYPES_ENUM_VALUE[CAMPAIGN_TYPES.Shopping]) {\r\n // CurrentCampaign only has enum value.\r\n return CAMPAIGN_TYPES.Shopping;\r\n }\r\n // for account scope, directly use search\r\n return CAMPAIGN_TYPES.Search;\r\n}\r\n","import { makeStyles, shorthands, tokens } from '@fluentui/react-components';\r\n\r\nexport const useFilterStyles = makeStyles({\r\n container: {\r\n maxWidth: '300px',\r\n width: '50%',\r\n display: 'flex',\r\n flexGrow: '1',\r\n justifyContent: 'flex-end',\r\n },\r\n button: {\r\n paddingTop: 0,\r\n paddingLeft: '5px',\r\n paddingRight: '0px',\r\n paddingBottom: '0px',\r\n width: 'fit-content',\r\n },\r\n buttonText: {\r\n ...shorthands.overflow('hidden'),\r\n lineBreak: 'anywhere',\r\n textOverflow: 'ellipsis',\r\n whiteSpace: 'nowrap',\r\n color: tokens.colorNeutralForeground2,\r\n },\r\n listbox: {\r\n maxHeight: '300px',\r\n minWidth: '250px',\r\n },\r\n dropdown: {\r\n ...shorthands.border('none'),\r\n minWidth: '100px',\r\n },\r\n});\r\n","import _ from 'underscore';\r\nimport React, { useCallback, useEffect, useMemo } from 'react';\r\nimport classNames from 'classnames';\r\nimport {\r\n Menu,\r\n MenuButton,\r\n MenuPopover,\r\n MenuList,\r\n MenuItem,\r\n MenuTrigger,\r\n Caption1 as Text,\r\n Dropdown,\r\n DropdownProps,\r\n Option,\r\n OptionGroup,\r\n Tooltip\r\n} from '@fluentui/react-components';\r\n\r\nimport { usePreferenceMetrics } from './use-preference-metrics';\r\nimport { CompetitionFilterProps } from '../utils/types';\r\nimport { withCompetitorsData } from '../data/with-competitors-data';\r\nimport { useFilterStyles } from '../styles/filter-styles';\r\n\r\nexport function CompetitionFilter({\r\n isLoading,\r\n state,\r\n setState,\r\n competitors,\r\n i18n,\r\n}: CompetitionFilterProps) {\r\n const styles = useFilterStyles();\r\n\r\n const [selectedCompetitors, setSelectedCompetitors] = React.useState();\r\n\r\n const onMetricSet = useCallback((metric: string) => {\r\n setState(s => ({\r\n ...s,\r\n metric,\r\n }));\r\n }, [setState]);\r\n\r\n const {\r\n metrics,\r\n selectedMetric,\r\n setMetric,\r\n } = usePreferenceMetrics({ onMetricSet });\r\n\r\n useEffect(() => {\r\n if (!state && !isLoading && selectedMetric) {\r\n const initCompetitors = _.first(competitors, 4) || [];\r\n setSelectedCompetitors(initCompetitors);\r\n setState({\r\n metric: selectedMetric?.metric,\r\n competitors: initCompetitors,\r\n });\r\n }\r\n }, [selectedMetric, isLoading, state, setState, competitors]);\r\n\r\n const onSelect: DropdownProps['onOptionSelect'] = (event, data) => {\r\n setSelectedCompetitors(data.selectedOptions);\r\n setState(s => ({\r\n ...s,\r\n competitors: data.selectedOptions,\r\n }));\r\n };\r\n\r\n const dropdownButtonText = useMemo(() => {\r\n const text = selectedCompetitors?.length > 0 ?\r\n i18n.getString(_TL_('{{selected}} similar advertisers'), { selected: selectedCompetitors?.length })\r\n : i18n.getString(_TL_('Compare up to 4 similar advertisers'));\r\n return (\r\n \r\n {text}\r\n \r\n );\r\n }, [selectedCompetitors, styles, i18n]);\r\n\r\n if (!state) {\r\n return <>;\r\n }\r\n\r\n return (\r\n

\r\n
\r\n \r\n \r\n {competitors.map(option => (\r\n \r\n ))}\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n {selectedMetric.value}\r\n \r\n \r\n \r\n \r\n \r\n {\r\n _.map(metrics, metric =>\r\n setMetric(metric)} key={metric.metric}>{metric.value})\r\n }\r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n\r\nCompetitionFilter.defaultProps = {\r\n state: undefined,\r\n competitors: [],\r\n};\r\n\r\nexport const CompetitionFilterWithData = withCompetitorsData(CompetitionFilter);\r\n","import _ from 'underscore';\r\nimport React, { ComponentType } from 'react';\r\n\r\nimport { useAuctionInsightData } from './use-auction-insight-data';\r\nimport { CompetitorsDataProps, CompetitionFilterProps } from '../utils/types';\r\n\r\nexport function withCompetitorsData

(WrappedComponent: ComponentType

) {\r\n const HoC = React.memo((props: Omit) => {\r\n const { dateRange } = props;\r\n const { data, isLoading } = useAuctionInsightData({\r\n dateRange,\r\n });\r\n\r\n const competitors = _.reject(_.pluck(data?.items, 'DisplayDomain'), name => name === 'You');\r\n return ();\r\n });\r\n\r\n return HoC;\r\n}\r\n","import { Metric } from '../utils/metric-formatter';\r\n\r\nexport const metrics: Metric[] = [\r\n 'Clicks',\r\n 'Impressions',\r\n 'Spend',\r\n 'CTR',\r\n 'TopImpressionRate',\r\n 'AbsoluteTopImpressionRate',\r\n 'ConversionsCredit',\r\n 'PartialConversionRate',\r\n 'PartialConversionCPA',\r\n 'AdvertiserReportedRevenue',\r\n 'RevenueOnAdSpend',\r\n 'AverageCPC',\r\n];\r\n","type Color = `#${string}`;\r\n\r\nexport const computerColor: Color = '#637CEF';\r\nexport const tabletColor: Color = '#E3008C';\r\nexport const mobileColor: Color = '#2AA0A4';\r\nexport const connectedTVColor: Color = '#9373C0';\r\n","export interface SegmentData {\r\n Key: { StringValue: string }[];\r\n Data: {\r\n Impressions: number;\r\n Clicks: number;\r\n CTR: number;\r\n Spend: number;\r\n TopImpressionRate: number;\r\n AbsoluteTopImpressionRate: number;\r\n ConversionsCredit: number;\r\n PartialConversionRate: number;\r\n PartialConversionCPA: number;\r\n AdvertiserReportedRevenue: number;\r\n RevenueOnAdSpend: number;\r\n AverageCPC: number;\r\n };\r\n}\r\n\r\ninterface MappedSegmentData {\r\n deviceType: string;\r\n Impressions: number;\r\n Clicks: number;\r\n CTR: number;\r\n Spend: number;\r\n TopImpressionRate: number;\r\n AbsoluteTopImpressionRate: number;\r\n ConversionsCredit: number;\r\n PartialConversionRate: number;\r\n PartialConversionCPA: number;\r\n AdvertiserReportedRevenue: number;\r\n RevenueOnAdSpend: number;\r\n AverageCPC: number;\r\n}\r\n\r\nexport const mapSegmentData = (segmentedData: SegmentData[]): MappedSegmentData[] =>\r\n segmentedData.map((segment) => {\r\n const deviceType = segment.Key[0].StringValue;\r\n const {\r\n Impressions,\r\n Clicks,\r\n CTR,\r\n Spend,\r\n TopImpressionRate,\r\n AbsoluteTopImpressionRate,\r\n ConversionsCredit,\r\n PartialConversionRate,\r\n PartialConversionCPA,\r\n AdvertiserReportedRevenue,\r\n RevenueOnAdSpend,\r\n AverageCPC,\r\n } = segment.Data;\r\n return {\r\n deviceType,\r\n Impressions,\r\n Clicks,\r\n CTR,\r\n Spend,\r\n TopImpressionRate,\r\n AbsoluteTopImpressionRate,\r\n ConversionsCredit,\r\n PartialConversionRate,\r\n PartialConversionCPA,\r\n AdvertiserReportedRevenue,\r\n RevenueOnAdSpend,\r\n AverageCPC,\r\n };\r\n });\r\n","import React from 'react';\r\n\r\ninterface LegendIconProps {\r\n color: string;\r\n useGradient?: boolean;\r\n}\r\n\r\nexport const LegendIcon: React.FC = ({ color, useGradient }) => {\r\n const boxStyle: React.CSSProperties = {\r\n width: '10px',\r\n height: '10px',\r\n ...(useGradient\r\n ? { backgroundImage: `linear-gradient(90deg, ${color} 50%, white 50%)` }\r\n : { backgroundColor: color }),\r\n backgroundSize: '4px 4px',\r\n };\r\n\r\n return

;\r\n};\r\n\r\nLegendIcon.defaultProps = {\r\n useGradient: false,\r\n};\r\n","import React from 'react';\r\nimport classNames from 'classnames';\r\nimport { LegendIcon } from '../utils/callout-legend-icon';\r\nimport { DeviceCardProps } from '../utils/types';\r\n\r\nexport const renderCustomCallout = (data: any, styles: any, dateRange: DeviceCardProps['dateRange'], i18n: DeviceCardProps['i18n']) => {\r\n if (!data) {\r\n return null;\r\n }\r\n\r\n const {\r\n legend, legendColor, metricValue, total, displayName,\r\n } = data;\r\n\r\n return (\r\n
\r\n
{i18n.getString(legend)}
\r\n
{displayName}
\r\n
\r\n \r\n \r\n {dateRange.RangeStartDate} - {dateRange.RangeEndDate}\r\n \r\n
\r\n
{metricValue} ({total}{i18n.getString(_TL_('% of total'))})
\r\n
\r\n );\r\n};\r\n","export const dropdownCustomStyles = () => ({\r\n root: {\r\n width: 'auto',\r\n border: 'none',\r\n padding: 0,\r\n margin: 0,\r\n },\r\n dropdown: {\r\n border: 'none',\r\n boxShadow: 'none',\r\n outline: 'none',\r\n padding: 2,\r\n margin: 2,\r\n minWidth: '150px',\r\n selectors: {\r\n ':focus': {\r\n outline: 'none',\r\n },\r\n ':focus:after': {\r\n border: 'none',\r\n outline: 'none',\r\n },\r\n },\r\n },\r\n title: {\r\n backgroundColor: 'transparent',\r\n border: 'none',\r\n paddingTop: 0,\r\n height: 'auto',\r\n lineHeight: 'normal',\r\n display: 'flex',\r\n alignItems: 'center',\r\n margin: 0,\r\n selectors: {\r\n ':focus': {\r\n outline: 'none',\r\n border: 'none',\r\n boxShadow: 'none',\r\n },\r\n ':focus-visible': {\r\n outline: 'none',\r\n border: 'none',\r\n boxShadow: 'none',\r\n },\r\n },\r\n },\r\n caretDown: {\r\n fontSize: 12,\r\n marginLeft: 4,\r\n display: 'flex',\r\n alignItems: 'center',\r\n border: 'none',\r\n boxShadow: 'none',\r\n outline: 'none',\r\n },\r\n caretDownWrapper: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n height: '100%',\r\n },\r\n dropdownItem: {\r\n padding: '4px 8px',\r\n margin: 0,\r\n },\r\n});\r\n","const deviceDefaultCard = footerVisible => ({\r\n display: 'flex',\r\n flexDirection: 'column',\r\n height: '100%',\r\n flexGrow: 1,\r\n paddingTop: footerVisible ? '5px' : '10px',\r\n});\r\n\r\nconst dropdownDefaultCard = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n};\r\n\r\nconst multiStackedChart = footerVisible => ({\r\n paddingBottom: footerVisible ? '0px' : '13px',\r\n});\r\n\r\nconst customCallout = {\r\n padding: '15px',\r\n width: '200px',\r\n lineHeight: '1.8',\r\n};\r\n\r\nconst date = {\r\n marginLeft: '8px',\r\n};\r\n\r\nconst legendIcon = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n marginBottom: '8px',\r\n};\r\n\r\nexport const getStyles = footerVisible => ({\r\n deviceDefaultCard: deviceDefaultCard(footerVisible),\r\n dropdownDefaultCard,\r\n multiStackedChart: multiStackedChart(footerVisible),\r\n customCallout,\r\n legendIcon,\r\n date,\r\n});\r\n","import React, { useCallback, useMemo, useState } from 'react';\r\nimport classNames from 'classnames';\r\nimport { Dropdown, TooltipHost } from '@fluentui/react';\r\nimport { Glyphicon } from '@bingads-webui-react/primitive-unthemed';\r\nimport { MultiStackedBarChart } from '@fluentui/react-charting';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { formatMetric } from '@bingads-webui-campaign-legacy/performance-metric-formatter/index';\r\nimport { metrics } from '../constants/metrics-data';\r\nimport { Metric } from '../utils/metric-formatter';\r\nimport { computerColor, tabletColor, mobileColor, connectedTVColor } from '../constants/device-color';\r\nimport { mapSegmentData } from '../utils/metric-mapper';\r\nimport { DeviceCardProps } from '../utils/types';\r\nimport { renderCustomCallout } from '../helpers/default-card-custom-callout';\r\nimport { dropdownCustomStyles } from '../styles/dropdown-styles';\r\nimport { getStyles } from '../styles/devices-default-card';\r\n\r\nexport function DeviceDefaultCard({\r\n i18n, deviceData, dateRange, allMetrics, initialSelectedMetrics, patchPreference, hideCurrency, footerVisible,\r\n}: DeviceCardProps) {\r\n const chartPoints = useMemo(() => {\r\n const chartPointsTemplate = (metric, dateRange, total) => ({\r\n chartData: [\r\n {\r\n legend: _TL_('Computer'), data: 0, color: computerColor, legendColor: computerColor, metric, dateRange, total, metricValue: '0', callOutAccessibilityData: { ariaLabel: 'Computer' }, displayName: allMetrics.find(m => m.key === metric)?.displayName || metric,\r\n },\r\n {\r\n legend: _TL_('Tablet'), data: 0, color: tabletColor, legendColor: tabletColor, metric, dateRange, total, metricValue: '0', callOutAccessibilityData: { ariaLabel: 'Tablet' }, displayName: allMetrics.find(m => m.key === metric)?.displayName || metric,\r\n },\r\n {\r\n legend: _TL_('Smartphone'), data: 0, color: mobileColor, legendColor: mobileColor, metric, dateRange, total, metricValue: '0', callOutAccessibilityData: { ariaLabel: 'Smartphone' }, displayName: allMetrics.find(m => m.key === metric)?.displayName || metric,\r\n },\r\n {\r\n legend: _TL_('CTV'), data: 0, color: connectedTVColor, legendColor: connectedTVColor, metric, dateRange, total, metricValue: '0', callOutAccessibilityData: { ariaLabel: 'ConnectedTV' }, displayName: allMetrics.find(m => m.key === metric)?.displayName || metric,\r\n },\r\n ],\r\n });\r\n\r\n return metrics.reduce((metricChartPointsMap, metric) => ({\r\n ...metricChartPointsMap,\r\n [metric]: [chartPointsTemplate(metric, dateRange, 0)],\r\n }), {});\r\n }, [dateRange, allMetrics]);\r\n\r\n const data = useMemo(() => {\r\n // where deviceData is an array\r\n if (Array.isArray(deviceData)) {\r\n return deviceData.flatMap(item =>\r\n // For each device in the array, check if it has `SegmentedData` within `PerformanceMetrics`.\r\n (item.PerformanceMetrics?.SegmentedData ? mapSegmentData(item.PerformanceMetrics.SegmentedData) : []));\r\n\r\n // deviceData contains a `DeviceSegmentedPerformanceData` object with `PerformanceMetrics`.\r\n } else if (deviceData?.DeviceSegmentedPerformanceData?.PerformanceMetrics?.SegmentedData) {\r\n return mapSegmentData(deviceData.DeviceSegmentedPerformanceData.PerformanceMetrics.SegmentedData);\r\n\r\n // deviceData has `PerformanceMetrics` directly without segmented data.\r\n } else if (deviceData?.PerformanceMetrics) {\r\n return mapSegmentData(deviceData.PerformanceMetrics.SegmentedData || []);\r\n }\r\n\r\n return [];\r\n }, [deviceData]);\r\n\r\n const deviceTypeMap = useMemo(() => data.reduce((deviceMetricsMap, item) => {\r\n const deviceType = item.deviceType || '';\r\n return {\r\n ...deviceMetricsMap,\r\n [deviceType.toLowerCase()]: item,\r\n };\r\n }, {} as Record), [data]);\r\n\r\n const overallTotals = useMemo(() => {\r\n if (Array.isArray(deviceData) && deviceData.length > 0) {\r\n return deviceData[0]?.PerformanceMetrics || {};\r\n } else if (deviceData?.PerformanceMetrics) {\r\n return deviceData.PerformanceMetrics;\r\n }\r\n return deviceData?.OverallTotals?.PerformanceMetrics || {};\r\n }, [deviceData]);\r\n\r\n const updatedChartPoints = useMemo(() => {\r\n const updatedPoints = { ...chartPoints };\r\n\r\n Object.keys(updatedPoints).forEach((metric) => {\r\n const typedMetric = metric as Metric;\r\n\r\n updatedPoints[typedMetric][0].chartData = updatedPoints[typedMetric][0].chartData.map((chartData) => {\r\n const deviceMetrics = deviceTypeMap[chartData.legend.toLowerCase()];\r\n\r\n const value = deviceMetrics && deviceMetrics[typedMetric] !== null && deviceMetrics[typedMetric] !== undefined\r\n ? deviceMetrics[typedMetric]\r\n : 0;\r\n const overallValue = overallTotals[typedMetric] !== null && overallTotals[typedMetric] !== undefined\r\n ? overallTotals[typedMetric]\r\n : 1;\r\n\r\n const total = (overallValue === 0) ? 0 : ((value / overallValue) * 100).toFixed(2);\r\n\r\n return {\r\n ...chartData,\r\n data: value,\r\n total,\r\n metricValue: formatMetric(typedMetric, value),\r\n };\r\n });\r\n });\r\n\r\n return updatedPoints;\r\n }, [chartPoints, deviceTypeMap, overallTotals]);\r\n\r\n const [selectedViews, setSelectedViews] = useState(initialSelectedMetrics.map(metric => metric.key));\r\n\r\n const dropdownOptions = useMemo(\r\n () =>\r\n selectedViews.map((_, index) => {\r\n const remainingMetrics = allMetrics.filter(metric => !selectedViews.includes(metric.key) || metric.key === selectedViews[index]);\r\n return {\r\n key: selectedViews[index],\r\n text: remainingMetrics.find(m => m.key === selectedViews[index])?.displayName || '',\r\n options: remainingMetrics.map(metric => ({\r\n key: metric.key,\r\n text: metric.displayName,\r\n })),\r\n };\r\n }),\r\n [selectedViews, allMetrics]\r\n );\r\n const styles = useDefaultStyles(() => getStyles(footerVisible));\r\n\r\n const dataViews = selectedViews.map(view => updatedChartPoints[view]);\r\n\r\n const handleViewChange = useCallback(index => (event, option) => {\r\n setSelectedViews((prevSelectedViews) => {\r\n const newViews = [...prevSelectedViews];\r\n newViews[index] = option.key;\r\n patchPreference({ selectedColumns: newViews });\r\n return newViews;\r\n });\r\n }, [patchPreference]);\r\n\r\n return (\r\n
\r\n {dropdownOptions.map((option, index) => (\r\n \r\n
\r\n \r\n {hideCurrency && (selectedViews[index] === 'AverageCPC' || selectedViews[index] === 'Spend' || selectedViews[index] === 'PartialConversionCPA' || selectedViews[index] === 'AdvertiserReportedRevenue') && (\r\n \r\n \r\n \r\n )}\r\n
\r\n
\r\n renderCustomCallout(data, styles, dateRange, i18n)}\r\n />\r\n
\r\n
\r\n ))}\r\n
\r\n );\r\n}\r\n","const chartStyles = {\r\n '& [class^=\"chartTitle-\"]': {\r\n display: 'none',\r\n },\r\n '& div[class*=\"singleChartRoot\"]': {\r\n margin: '0',\r\n padding: '0',\r\n },\r\n '& .ms-StackedBarChart': {\r\n gap: '0',\r\n },\r\n};\r\n\r\nconst deviceComparisonCard = footerVisible => ({\r\n display: 'flex',\r\n flexDirection: 'column',\r\n height: '100%',\r\n flexGrow: 1,\r\n paddingTop: footerVisible ? '5px' : '10px',\r\n});\r\n\r\nconst dropdownComparisonCard = footerVisible => ({\r\n display: 'flex',\r\n alignItems: 'center',\r\n paddingTop: footerVisible ? '0px' : '10px',\r\n});\r\n\r\nconst gridContainerStyle = {\r\n display: 'grid',\r\n gridTemplateColumns: '1fr auto 1fr',\r\n gridTemplateRows: 'auto auto',\r\n gap: '5px',\r\n alignItems: 'center',\r\n};\r\n\r\nconst dataItem = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n};\r\n\r\nconst separator = {\r\n borderLeft: '1px solid #ccc',\r\n height: '135%',\r\n paddingRight: 10,\r\n};\r\n\r\nconst customCallout = {\r\n padding: '15px',\r\n width: '400px',\r\n lineHeight: '1.8',\r\n};\r\n\r\nconst multiStackedBarChart = {\r\n margin: 0,\r\n padding: 0,\r\n height: '42px',\r\n};\r\n\r\nconst comparisonCardPattern = {\r\n position: 'absolute',\r\n left: 0,\r\n top: 0,\r\n overflow: 'hidden',\r\n width: '10px',\r\n height: '10px',\r\n};\r\n\r\nconst legend = {\r\n paddingLeft: '4px',\r\n};\r\n\r\nconst leftGrid = {\r\n gridColumn: '1 / 2',\r\n};\r\n\r\nconst rightGrid = {\r\n gridColumn: '3 / 4',\r\n};\r\n\r\nexport const getStyles = footerVisible => ({\r\n deviceComparisonCard,\r\n dropdownComparisonCard: dropdownComparisonCard(footerVisible),\r\n gridContainerStyle,\r\n legend,\r\n leftGrid,\r\n rightGrid,\r\n dataItem,\r\n separator,\r\n customCallout,\r\n comparisonCardPattern,\r\n multiStackedBarChart: { ...multiStackedBarChart, ...chartStyles },\r\n});\r\n","import React from 'react';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { computerColor, tabletColor, mobileColor, connectedTVColor } from '../constants/device-color';\r\nimport { getStyles } from '../styles/devices-comparison-card';\r\n\r\nconst patterns = [\r\n { id: 'pattern1', color: computerColor, path: 'M 3 0 L 3 10' },\r\n { id: 'pattern2', color: tabletColor, path: 'M 3 0 L 3 10' },\r\n { id: 'pattern3', color: mobileColor, path: 'M 3 0 L 3 10' },\r\n { id: 'pattern4', color: connectedTVColor, path: 'M 3 0 L 3 10' },\r\n];\r\n\r\nexport const DeviceComparisonPatterns: React.FC = () => {\r\n const styles = useDefaultStyles(getStyles);\r\n\r\n return (\r\n \r\n \r\n {patterns.map(pattern => (\r\n \r\n \r\n \r\n ))}\r\n \r\n \r\n );\r\n};\r\n","export const legendKeyMap = {\r\n SmartPhone: 'Smartphone',\r\n};\r\n","import _ from 'underscore';\r\nimport { mapSegmentData } from './metric-mapper';\r\n\r\nexport const getSegmentedData = (data, keyPath) => {\r\n if (keyPath.length === 0) return [];\r\n\r\n if (Array.isArray(data)) {\r\n return _.flatten(data.map((item) => {\r\n const segmentedData = _.get(item, keyPath);\r\n return segmentedData ? mapSegmentData(segmentedData) : [];\r\n }));\r\n }\r\n\r\n let segmentedData = _.get(data, keyPath);\r\n\r\n if (!segmentedData && data?.DeviceSegmentedPerformanceData) {\r\n segmentedData = _.get(data.DeviceSegmentedPerformanceData, keyPath);\r\n }\r\n\r\n return segmentedData ? mapSegmentData(segmentedData) : [];\r\n};\r\n","export const extractNumericValue = (value) => {\r\n const symbolRegex = /[^\\d.-]/g;\r\n if (typeof value === 'string') {\r\n const sanitizedValue = value.replace(symbolRegex, '');\r\n return parseFloat(sanitizedValue);\r\n }\r\n return Number(value);\r\n};\r\n","import { extractNumericValue } from './numeric-value-extractor';\r\n\r\nexport function calculatePercentageOfTotal(metricValue: string | undefined, totalMetric: number): string {\r\n if (totalMetric > 0) {\r\n const numericValue = extractNumericValue(metricValue ?? '0');\r\n return ((numericValue / totalMetric) * 100).toFixed(2);\r\n }\r\n return '0.00';\r\n}\r\n","import React, { useCallback, useState, useMemo } from 'react';\r\nimport classNames from 'classnames';\r\nimport { MultiStackedBarChart, IChartProps } from '@fluentui/react-charting';\r\nimport { TooltipHost } from '@fluentui/react';\r\nimport { Glyphicon } from '@bingads-webui-react/primitive-unthemed';\r\nimport { Dropdown } from '@fluentui/react/lib/Dropdown';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { formatMetric, formatMetricWithSign, formatChangePercentageWithSign } from '@bingads-webui-campaign-legacy/performance-metric-formatter/index';\r\nimport { computerColor, tabletColor, mobileColor, connectedTVColor } from '../constants/device-color';\r\nimport { DeviceComparisonPatterns } from '../helpers/svg-pattern-comparison-state';\r\nimport { legendKeyMap } from '../utils/legend-key-map';\r\nimport { DeviceCardProps } from '../utils/types';\r\nimport { getSegmentedData } from '../utils/segment-data-extractor';\r\nimport { LegendIcon } from '../utils/callout-legend-icon';\r\nimport { Metric } from '../utils/metric-formatter';\r\nimport { calculatePercentageOfTotal } from '../utils/total-percentage-calculator';\r\nimport { metrics } from '../constants/metrics-data';\r\nimport { dropdownCustomStyles } from '../styles/dropdown-styles';\r\nimport { getStyles } from '../styles/devices-comparison-card';\r\n\r\nexport function DeviceComparisonCard({\r\n i18n, deviceData, dateRange, allMetrics, initialSelectedMetrics, patchPreference, hideCurrency, footerVisible,\r\n}: DeviceCardProps) {\r\n const currentComparisonData = useMemo(() => getSegmentedData(deviceData, ['PerformanceMetrics', 'SegmentedData']), [deviceData]);\r\n\r\n const previousComparisonData = useMemo(() => getSegmentedData(deviceData, ['PeriodPerformanceMetrics', 'SegmentedData']), [deviceData]);\r\n\r\n const changeData = useMemo(() => {\r\n if (!currentComparisonData.length || !previousComparisonData.length) return [];\r\n\r\n const previousDataMap = previousComparisonData.reduce((acc, item) => {\r\n const deviceIdentifier = item.deviceType || 'defaultDevice';\r\n acc[deviceIdentifier] = item;\r\n return acc;\r\n }, {});\r\n\r\n return currentComparisonData.map((current) => {\r\n const deviceIdentifier = current.deviceType || 'defaultDevice';\r\n\r\n const previous = previousDataMap[deviceIdentifier] || {};\r\n\r\n return Object.keys(current).reduce((acc, key) => {\r\n acc[key] =\r\n typeof current[key] === 'number' && typeof previous[key] === 'number'\r\n ? current[key] - previous[key]\r\n : current[key];\r\n\r\n return acc;\r\n }, { deviceIdentifier });\r\n });\r\n }, [currentComparisonData, previousComparisonData]);\r\n\r\n const changeDataPercentage = useMemo(() => getSegmentedData(deviceData, ['PerformanceMetricsChangePercentage', 'SegmentedData']), [deviceData]);\r\n const currentDateRange = dateRange ? `${dateRange.RangeStartDate} - ${dateRange.RangeEndDate}` : '';\r\n const previousDateRange = dateRange && dateRange.compared ? `${dateRange.compared.formattedStart} - ${dateRange.compared.formattedEnd}` : '';\r\n\r\n const currentPeriodTotals = deviceData?.OverallTotals?.PerformanceMetrics || deviceData?.PerformanceMetrics;\r\n const previousPeriodTotals = deviceData?.OverallTotals?.PeriodPerformanceMetrics || deviceData?.PeriodPerformanceMetrics;\r\n const styles = useDefaultStyles(() => getStyles(footerVisible));\r\n\r\n const createChartSeriesData = useCallback(\r\n (deviceMetrics, metric, dateRange, isPattern = false) => {\r\n /**\r\n * Maps device types to their respective colors or patterns.\r\n * This mapping is used to set the colors or patterns for chart bars based on current or previous date range.\r\n *\r\n * @param isPattern - A boolean indicating whether to use a pattern (true) or solid color (false).\r\n * @returns An object where each device type is associated with either a pattern URL or a solid color.\r\n */\r\n const colorMap = {\r\n Computer: isPattern ? 'url(#pattern1)' : computerColor,\r\n Tablet: isPattern ? 'url(#pattern2)' : tabletColor,\r\n SmartPhone: isPattern ? 'url(#pattern3)' : mobileColor,\r\n ConnectedTV: isPattern ? 'url(#pattern4)' : connectedTVColor,\r\n };\r\n\r\n const validDevices = ['Computer', 'Tablet', 'SmartPhone', 'ConnectedTV'];\r\n\r\n return validDevices\r\n .filter(deviceType => deviceMetrics[deviceType])\r\n .map((deviceType) => {\r\n const value = deviceMetrics[deviceType][metric];\r\n const formattedValue = formatMetric(metric, value);\r\n\r\n return {\r\n legend: deviceType,\r\n data: value,\r\n color: colorMap[deviceType],\r\n legendColor: colorMap[deviceType],\r\n metric,\r\n dateRange,\r\n metricValue: formattedValue,\r\n };\r\n });\r\n },\r\n []\r\n );\r\n\r\n const prepareDeviceData = useCallback(\r\n comparisonData => comparisonData.reduce((deviceDataAccumulator, { deviceType, ...metrics }) => ({\r\n ...deviceDataAccumulator, [deviceType]: metrics,\r\n }), {}),\r\n []\r\n );\r\n\r\n const createChartPoints = useCallback(\r\n (metric: Metric): IChartProps[] => {\r\n const currentDeviceData = prepareDeviceData(currentComparisonData);\r\n const previousDeviceData = prepareDeviceData(previousComparisonData);\r\n\r\n return [\r\n {\r\n chartTitle: '',\r\n chartData: createChartSeriesData(currentDeviceData, metric, currentDateRange),\r\n },\r\n {\r\n chartTitle: '',\r\n chartData: createChartSeriesData(previousDeviceData, metric, previousDateRange, true),\r\n },\r\n ];\r\n },\r\n [prepareDeviceData, currentComparisonData, previousComparisonData, createChartSeriesData, currentDateRange, previousDateRange]\r\n );\r\n\r\n const chartPoints: Record = useMemo(\r\n () =>\r\n metrics.reduce((accumulator, metric) => ({\r\n ...accumulator,\r\n [metric]: createChartPoints(metric),\r\n }), {} as Record),\r\n [createChartPoints]\r\n );\r\n\r\n const getCombinedDataPoints = useCallback((data) => {\r\n const combined = {};\r\n\r\n if (Array.isArray(data)) {\r\n data.forEach((entry) => {\r\n if (entry.chartData) {\r\n entry.chartData.forEach((dataPoint) => {\r\n const { legend } = dataPoint;\r\n if (!combined[legend]) {\r\n combined[legend] = [];\r\n }\r\n combined[legend].push(dataPoint);\r\n });\r\n }\r\n });\r\n }\r\n\r\n return combined;\r\n }, []);\r\n\r\n const calloutStyles = useMemo(() => ({\r\n customCallout: styles.customCallout,\r\n dataItem: styles.dataItem,\r\n gridContainerStyle: styles.gridContainerStyle,\r\n separator: styles.separator,\r\n leftGrid: styles.leftGrid,\r\n rightGrid: styles.rightGrid,\r\n legend: styles.legend,\r\n }), [styles]);\r\n\r\n const renderCustomCallout = useCallback((point, combinedData) => {\r\n if (!point || !point.legend) return null;\r\n\r\n // Map legend to its updated version if needed\r\n const mappedLegend = legendKeyMap[point.legend] || point.legend;\r\n\r\n const changeDataEntry = changeData.find(entry => entry.deviceIdentifier === point.legend);\r\n const change = changeDataEntry ? changeDataEntry[point.metric] : null;\r\n let roundedValue: number = 0;\r\n\r\n if (change !== null) {\r\n const numericChange = Number(change);\r\n if (Number.isFinite(numericChange)) {\r\n roundedValue = numericChange;\r\n }\r\n }\r\n\r\n const changeDataPercentageEntry = changeDataPercentage.find(entry => entry.deviceType === point.legend);\r\n const changePercentage = changeDataPercentageEntry?.[point.metric] ?? null;\r\n let roundedValuePercentage = '0.00%';\r\n\r\n if (changePercentage !== null) {\r\n const numericChangePercentage = Number(changePercentage);\r\n\r\n if (Number.isFinite(numericChangePercentage)) {\r\n if (numericChangePercentage === 0) {\r\n roundedValuePercentage = '0.00%';\r\n } else if (numericChangePercentage > 1e10) {\r\n roundedValuePercentage = '+∞';\r\n } else if (numericChangePercentage < -1e10) {\r\n roundedValuePercentage = '-∞';\r\n } else {\r\n roundedValuePercentage = formatChangePercentageWithSign(numericChangePercentage);\r\n }\r\n }\r\n }\r\n\r\n const legendData = Array.isArray(combinedData[point.legend])\r\n ? combinedData[point.legend]\r\n : [combinedData[point.legend]];\r\n\r\n const metricDisplayName = allMetrics.find(metric => metric.key === point.metric)?.displayName || point.metric;\r\n\r\n const metricsToHidePercentage = new Set([\r\n 'CTR',\r\n 'Top impr. rate',\r\n 'Abs. top impr. rate',\r\n 'Conv. rate',\r\n 'Return on ad spend',\r\n ]);\r\n const hidePercentageOfTotal = metricsToHidePercentage.has(metricDisplayName);\r\n\r\n const metricValue = legendData[0]?.metricValue || '0';\r\n const totalMetric = currentPeriodTotals?.[point.metric] ?? 0;\r\n\r\n const currentPercentageOfTotalMetric = calculatePercentageOfTotal(metricValue, totalMetric);\r\n\r\n const previousMetricValue = legendData[1]?.metricValue ?? '0';\r\n const previousTotalMetric = previousPeriodTotals?.[point.metric] ?? 1;\r\n\r\n const previousPercentageOfTotalMetric = calculatePercentageOfTotal(previousMetricValue, previousTotalMetric);\r\n const renderMetricValue = (metricValue, percentageMetricKey, percentageMetricValue) => (\r\n \r\n {metricValue}\r\n {!hidePercentageOfTotal &&\r\n i18n.getString(_TL_(' ({{percentage}}% of total)'), {\r\n percentage: percentageMetricValue,\r\n })\r\n }\r\n \r\n );\r\n\r\n const changeValue = formatMetricWithSign(allMetrics.find(metric => metric.key === point.metric).key, roundedValue);\r\n\r\n return (\r\n
\r\n {legendData.length > 0 && (\r\n <>\r\n
{i18n.getString(mappedLegend)}
\r\n
{metricDisplayName}
\r\n
\r\n
\r\n {legendData[0] && (\r\n <>\r\n
\r\n \r\n
\r\n
{legendData[0].dateRange}
\r\n \r\n )}\r\n
\r\n
\r\n
\r\n {legendData[1] && (\r\n <>\r\n
\r\n \r\n
\r\n
{legendData[1].dateRange}
\r\n \r\n )}\r\n
\r\n
\r\n {renderMetricValue(legendData[0]?.metricValue, 'currentPercentageOfTotalMetric', currentPercentageOfTotalMetric)}\r\n
\r\n
\r\n
\r\n {renderMetricValue(legendData[1]?.metricValue, 'previousPercentageOfTotalMetric', previousPercentageOfTotalMetric)}\r\n
\r\n
\r\n
\r\n {\r\n i18n.getString(_TL_('Change: {{changeValue}} ({{roundedValuePercentage}})'), {\r\n changeValue,\r\n roundedValuePercentage,\r\n })\r\n }\r\n
\r\n \r\n )}\r\n
\r\n );\r\n }, [changeData, changeDataPercentage, currentPeriodTotals, previousPeriodTotals, allMetrics, calloutStyles, styles.legend, i18n]);\r\n\r\n const [selectedViews, setSelectedViews] = useState(initialSelectedMetrics.map(metric => ({\r\n id: metric.key,\r\n selectedKey: metric.key,\r\n })));\r\n\r\n const dropdownOptions = useMemo(\r\n () =>\r\n selectedViews.map((view, index) => {\r\n const currentMetric = allMetrics.find(metric => metric.key === view.selectedKey);\r\n const selectedKeys = selectedViews.map(v => v.selectedKey);\r\n\r\n const options = [\r\n { key: currentMetric?.key, text: currentMetric?.displayName },\r\n ...allMetrics\r\n .filter(metric => metric.key !== view.selectedKey && !selectedKeys.includes(metric.key))\r\n .map(metric => ({\r\n key: metric.key,\r\n text: metric.displayName,\r\n })),\r\n ];\r\n return options;\r\n }),\r\n [selectedViews, allMetrics]\r\n );\r\n\r\n const handleDropdownChange = useCallback(\r\n (id, option) => {\r\n const newSelectedViews = selectedViews.map(view => (view.id === id ? { ...view, selectedKey: option.key } : view));\r\n setSelectedViews(newSelectedViews);\r\n patchPreference({ selectedColumns: newSelectedViews.map(view => view.selectedKey) });\r\n },\r\n [patchPreference, selectedViews]\r\n );\r\n\r\n return (\r\n
\r\n {selectedViews.map((view, index) => (\r\n
\r\n
\r\n handleDropdownChange(view.id, option)}\r\n selectedKey={view.selectedKey}\r\n styles={dropdownCustomStyles}\r\n aria-label={i18n.getString(_TL_('Select an option from the dropdown'))}\r\n />\r\n {hideCurrency && (view.selectedKey === 'AverageCPC' || view.selectedKey === 'Spend' || view.selectedKey === 'PartialConversionCPA' || view.selectedKey === 'AdvertiserReportedRevenue') && (\r\n \r\n \r\n \r\n )}\r\n
\r\n \r\n
\r\n
\r\n renderCustomCallout(props, getCombinedDataPoints(chartPoints[view.selectedKey]))}\r\n />\r\n
\r\n
\r\n
\r\n ))}\r\n
\r\n );\r\n}\r\n","import { ShimmerElementType } from '@fluentui/react';\r\n\r\nexport const headerElement = [\r\n { type: ShimmerElementType.line, height: 20, width: '15%' },\r\n { type: ShimmerElementType.gap, width: '85%' },\r\n];\r\n\r\nexport const buttonRowElement = [\r\n { type: ShimmerElementType.line, height: 20, width: '10%' },\r\n { type: ShimmerElementType.gap, width: '5%' },\r\n { type: ShimmerElementType.line, height: 20, width: '10%' },\r\n { type: ShimmerElementType.gap, width: '5%' },\r\n { type: ShimmerElementType.line, height: 20, width: '10%' },\r\n { type: ShimmerElementType.gap, width: '5%' },\r\n { type: ShimmerElementType.line, height: 20, width: '10%' },\r\n { type: ShimmerElementType.gap, width: '60%' },\r\n];\r\n\r\nexport const largeBlockElement = [\r\n { type: ShimmerElementType.line, height: 60, width: '100%' },\r\n];\r\n\r\nexport const footerElement = [\r\n { type: ShimmerElementType.line, height: 20, width: '10%' },\r\n { type: ShimmerElementType.gap, width: '90%' },\r\n];\r\n","const shimmerContainer = {\r\n padding: 10,\r\n};\r\n\r\nconst shimmerElement = {\r\n marginBottom: 10,\r\n};\r\n\r\nconst footerElement = {\r\n marginTop: 20,\r\n};\r\n\r\nexport const getStyles = () => ({\r\n shimmerContainer,\r\n shimmerElement,\r\n footerElement,\r\n});\r\n","import React from 'react';\r\nimport classNames from 'classnames';\r\nimport { Shimmer } from '@fluentui/react';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { headerElement, buttonRowElement, largeBlockElement, footerElement } from '../helpers/shimmer-element';\r\nimport { getStyles } from '../styles/shimmer-card';\r\n\r\n\r\nexport function ShimmerCard() {\r\n const styles = useDefaultStyles(getStyles);\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import React from 'react';\r\n\r\nexport const ComputerIcon = ({ color }) => (\r\n \r\n \r\n \r\n \r\n);\r\n","import React from 'react';\r\n\r\nexport const TabletIcon = ({ color }) => (\r\n \r\n \r\n \r\n \r\n);\r\n","import React from 'react';\r\n\r\nexport const MobileIcon = ({ color }) => (\r\n \r\n \r\n \r\n \r\n);\r\n","import React from 'react';\r\n\r\nexport const ConnectedTVIcon = ({ color }) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n","const container = {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n height: '100%',\r\n};\r\n\r\nconst chartContainer = {\r\n flexGrow: 1,\r\n minHeight: 0,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n};\r\n\r\nconst deviceLegend = {\r\n display: 'flex',\r\n flexWrap: 'wrap',\r\n flexDirection: 'row',\r\n columnGap: '20px',\r\n};\r\n\r\nconst title = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n cursor: 'pointer',\r\n};\r\n\r\nconst icon = {\r\n paddingTop: 3,\r\n};\r\n\r\nconst footer = {\r\n marginTop: 'auto',\r\n};\r\n\r\nexport const getStyles = () => ({\r\n container,\r\n chartContainer,\r\n deviceLegend,\r\n title,\r\n icon,\r\n footer,\r\n});\r\n","import React from 'react';\r\nimport classNames from 'classnames';\r\nimport { initializeIcons } from '@fluentui/react';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { computerColor, tabletColor, mobileColor, connectedTVColor } from '../constants/device-color';\r\nimport { ComputerIcon } from '../media/computer-icon-svg';\r\nimport { TabletIcon } from '../media/tablet-icon-svg';\r\nimport { MobileIcon } from '../media/mobile-icon-svg';\r\nimport { ConnectedTVIcon } from '../media/connectedTV-icon-svg';\r\nimport { getStyles } from '../styles/devices-card';\r\n\r\ninitializeIcons();\r\ninterface LegendProps {\r\n i18n: {\r\n getString: (key: string) => string;\r\n };\r\n}\r\ninterface LegendItem {\r\n title: string;\r\n color: string;\r\n icon: any;\r\n}\r\nexport const Legend: React.FC = ({ i18n }) => {\r\n const styles = useDefaultStyles(getStyles);\r\n const legends: LegendItem[] = [\r\n { title: i18n.getString(_TL_('Computer')), color: computerColor, icon: },\r\n { title: i18n.getString(_TL_('Tablet')), color: tabletColor, icon: },\r\n { title: i18n.getString(_TL_('Smartphone')), color: mobileColor, icon: },\r\n { title: i18n.getString(_TL_('CTV')), color: connectedTVColor, icon: },\r\n ];\r\n const renderLegend = () => (\r\n
\r\n {legends.map((legend, index) => (\r\n \r\n
{legend.icon}
\r\n {legend.title}\r\n
\r\n ))}\r\n
\r\n );\r\n return renderLegend();\r\n};\r\n","import React, { useCallback, useContext, useState, useEffect } from 'react';\r\nimport classNames from 'classnames';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { Button } from '@fluentui/react-components';\r\nimport { getUIMetrics } from '@bingads-webui-campaign/overview-cards-common';\r\nimport { cardDeviceId } from '@bingads-webui-campaign/fluent-page-consts';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { getNavigationLevel } from '@bingads-webui-campaign/fluent-page-data';\r\nimport { DeviceDefaultCard } from './devices-default-card';\r\nimport { DeviceComparisonCard } from './devices-comparison-card';\r\nimport { ShimmerCard } from './shimmer-card';\r\nimport { Legend } from '../utils/device-legend';\r\nimport { DeviceCardProps, IScopeContext } from '../utils/types';\r\nimport { useData } from './use-data';\r\nimport { getStyles } from '../styles/devices-card';\r\n\r\nexport function DeviceCard(props: DeviceCardProps | null | undefined) {\r\n const { scope } = useContext(ScopeContext) as IScopeContext;\r\n const {\r\n dateRange, filter, i18n, getCardsConfig, sesId, perfMarkerUtils, allMetrics, initialSelectedMetrics, patchPreference, campaignType,\r\n } = props;\r\n\r\n const [uiMetrics] = useState(getUIMetrics(allMetrics, campaignType, cardDeviceId));\r\n\r\n const { willFetchData, willRender, done } = perfMarkerUtils;\r\n const { aggregatedData, isLoading } = useData({\r\n dateRange,\r\n filter,\r\n campaignType,\r\n getCardsConfig,\r\n willRender,\r\n willFetchData,\r\n done,\r\n });\r\n const styles = useDefaultStyles(getStyles);\r\n const hideCurrency = aggregatedData.AccountsHaveDifferentCurrencies;\r\n\r\n const onClick = useCallback(() => {\r\n scope.save('/campaign/vnext/devices');\r\n }, [scope]);\r\n\r\n if (isLoading) {\r\n return ;\r\n }\r\n\r\n const isComparisonScenario = dateRange.compared;\r\n const navigationLevel = getNavigationLevel(scope);\r\n const footerVisible = navigationLevel !== 'customer';\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n {!isComparisonScenario && (\r\n \r\n )}\r\n {isComparisonScenario && (\r\n \r\n )}\r\n
\r\n {footerVisible && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n );\r\n}\r\n","import useSWR from 'swr';\r\nimport _ from 'underscore';\r\nimport { useState, useEffect, useMemo, useContext, useCallback } from 'react';\r\nimport edm from '@bingads-webui-component-legacy/edm-campaign/index';\r\nimport { availableGranularities, fetchAggregatedData } from '@bingads-webui-campaign/overview-cards-common';\r\nimport dateUtil from '@bingads-webui-component-legacy/humanize/date';\r\nimport jsdata from '@bingads-webui-component-legacy/js-data-campaign/index';\r\nimport config from '@bingads-webui-component-legacy/config/index';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { cardDeviceId } from '@bingads-webui-campaign/fluent-page-consts';\r\nimport { getNavigationLevel, NavigationLevel } from '@bingads-webui-campaign/fluent-page-data';\r\nimport { UseDataProps } from '../utils/types';\r\n\r\nexport function useData({\r\n dateRange,\r\n filter,\r\n campaignType,\r\n getCardsConfig,\r\n willFetchData,\r\n willRender,\r\n done,\r\n}: UseDataProps) {\r\n const { scope } = useContext(ScopeContext) as any;\r\n const { campaignId } = scope.values;\r\n const aid = _.get(scope, ['values', 'aid']);\r\n const isAccountIdAvailable = !!aid;\r\n\r\n const navigationLevel = useMemo(() => getNavigationLevel(scope.values), [scope.values]);\r\n const granularity = useMemo(() => availableGranularities(dateRange, dateUtil)[0], [dateRange]);\r\n const [hasError, setHasError] = useState(false);\r\n const [isLoading, setIsLoading] = useState(true);\r\n\r\n const extendedFilter = useMemo(() => {\r\n if (campaignId) {\r\n return [...filter, {\r\n filter: {\r\n key: 'CampaignId',\r\n value: {\r\n query: {\r\n Id: Number(campaignId),\r\n },\r\n },\r\n },\r\n }];\r\n }\r\n return filter;\r\n }, [campaignId, filter]);\r\n\r\n const fetchSingleTile = navigationLevel === NavigationLevel.Campaign;\r\n\r\n const entitySet = useMemo(() => {\r\n if (campaignId) {\r\n return edm.currentCampaign.AdGroups;\r\n }\r\n if (isAccountIdAvailable) {\r\n return edm.currentAccount.Campaigns;\r\n }\r\n return edm.currentCustomer.Accounts;\r\n }, [campaignId, isAccountIdAvailable]);\r\n\r\n const fetcher = useCallback(async () => {\r\n setIsLoading(true);\r\n const data = await fetchAggregatedData({\r\n entitySet,\r\n dateRange,\r\n filter: extendedFilter,\r\n campaignType,\r\n jsdata,\r\n dateUtil,\r\n navigationLevel,\r\n getCardsConfig,\r\n fetchSingleTile,\r\n isDevice: true,\r\n permissions: config.get('Permissions'),\r\n dfmCacheKey: cardDeviceId,\r\n });\r\n\r\n if (!data || (!data.raw && !data.OverallTotals)) {\r\n throw new Error('Error loading data for device card');\r\n }\r\n\r\n return data;\r\n }, [entitySet, dateRange, extendedFilter, getCardsConfig, navigationLevel, fetchSingleTile, campaignType]);\r\n\r\n const { data, error } = useSWR(\r\n [dateRange, extendedFilter, getCardsConfig, navigationLevel, fetchSingleTile],\r\n fetcher,\r\n {\r\n onSuccess: () => {\r\n setIsLoading(false);\r\n willRender();\r\n done();\r\n },\r\n onError: () => {\r\n setIsLoading(false);\r\n setHasError(true);\r\n },\r\n }\r\n );\r\n\r\n useEffect(() => {\r\n if (dateRange && filter) {\r\n willFetchData();\r\n }\r\n }, [dateRange, filter, getCardsConfig, granularity, navigationLevel, willFetchData]);\r\n\r\n const deviceData = useMemo(() => {\r\n if (campaignId) {\r\n return data?.raw?.['@ns.unfiltered.totals'] || {};\r\n }\r\n return data || {};\r\n }, [data, campaignId]);\r\n\r\n return {\r\n aggregatedData: deviceData || null,\r\n isLoading,\r\n hasError: !!error,\r\n };\r\n}\r\n","import {\r\n TMajorMetric,\r\n} from '@bingads-webui-campaign-react/overview-performance-table';\r\n\r\nimport { TDataRequestSortDirection } from './types';\r\n\r\nexport function getOrderFromGridSortForCombinedCall({\r\n sortColumn,\r\n sortDirection,\r\n dateRange,\r\n comparisonMajorMetric,\r\n}: {\r\n sortColumn: string | number;\r\n sortDirection: 'ascending' | 'descending';\r\n dateRange: any;\r\n comparisonMajorMetric: TMajorMetric;\r\n}) : {\r\n sortColumn: string;\r\n sortDirection: TDataRequestSortDirection;\r\n} {\r\n const order = sortDirection === 'ascending' ? 'ASC' : 'DESC';\r\n let orderByValue;\r\n\r\n if (dateRange.compared) {\r\n switch (comparisonMajorMetric) {\r\n case 'PerformanceMetricsChange':\r\n orderByValue = 'PoPPerformanceMetricsChange';\r\n break;\r\n case 'PerformanceMetricsChangePercentage':\r\n orderByValue = 'PoPPerformanceMetricsChangePercentage';\r\n break;\r\n case 'PerformanceMetrics':\r\n orderByValue = 'PerformanceMetrics';\r\n break;\r\n default:\r\n orderByValue = 'PerformanceMetrics';\r\n break;\r\n }\r\n } else {\r\n orderByValue = 'PerformanceMetrics';\r\n }\r\n\r\n return {\r\n sortColumn: `${orderByValue}/${sortColumn}`,\r\n sortDirection: order,\r\n };\r\n}\r\n\r\nexport function getOrderFromGridSort({\r\n sortColumn,\r\n sortDirection,\r\n dateRange,\r\n comparisonMajorMetric,\r\n}: {\r\n sortColumn: string | number;\r\n sortDirection: 'ascending' | 'descending';\r\n dateRange: any;\r\n comparisonMajorMetric: TMajorMetric;\r\n}) : {\r\n orderby: string | number;\r\n direction: number;\r\n} {\r\n const direction = sortDirection === 'ascending' ? 1 : -1;\r\n let orderByValue;\r\n\r\n if (dateRange.compared) {\r\n switch (comparisonMajorMetric) {\r\n case 'PerformanceMetricsChange':\r\n orderByValue = 'PoPPerformanceMetricsChange';\r\n break;\r\n case 'PerformanceMetricsChangePercentage':\r\n orderByValue = 'PoPPerformanceMetricsChangePercentage';\r\n break;\r\n case 'PerformanceMetrics':\r\n orderByValue = 'PerformanceMetrics';\r\n break;\r\n default:\r\n orderByValue = 'PerformanceMetrics';\r\n break;\r\n }\r\n } else {\r\n orderByValue = 'PerformanceMetrics';\r\n }\r\n\r\n return {\r\n orderby: sortColumn,\r\n direction,\r\n };\r\n}\r\n","export const defaultComparisonMetric = 'PerformanceMetrics';\r\n","import _ from 'underscore';\r\nimport React, { useState, useCallback, useMemo, useEffect } from 'react';\r\nimport {\r\n OverviewPerformanceTable,\r\n ISortState,\r\n} from '@bingads-webui-campaign-react/overview-performance-table';\r\nimport { useHeaderStateContext } from '@bingads-webui-campaign-react/overview-card';\r\nimport { getUIMetrics } from '@bingads-webui-campaign/overview-cards-common';\r\n\r\n\r\nimport { IGridDataTableProps } from './types';\r\nimport { useGridData } from './use-grid-data';\r\nimport { getOrderFromGridSort } from './order-by-helper';\r\nimport { defaultComparisonMetric } from './consts';\r\n\r\nexport function GridDataTable({\r\n metricFormatter,\r\n i18n,\r\n constructOptions,\r\n dateRange,\r\n filter,\r\n permissions,\r\n jsdata,\r\n dateUtil,\r\n allMetrics,\r\n initialSelectedMetrics,\r\n initialSortColumn,\r\n initialSortDirection,\r\n patchPreference,\r\n cardTypeId,\r\n footerButtonConfigs,\r\n entityDisPlayName,\r\n perfMarkerUtils,\r\n getHref,\r\n getPopoverContent,\r\n triggerSearchTermDrawer,\r\n entityType,\r\n navigationLevel,\r\n campaignType,\r\n}: IGridDataTableProps) {\r\n const [selectedMetrics, setSelectedMetrics] = useState(initialSelectedMetrics);\r\n const [uiMetrics] = useState(getUIMetrics(allMetrics, campaignType, cardTypeId));\r\n const [sortState, setSortState] = useState({ sortColumn: initialSortColumn, sortDirection: initialSortDirection });\r\n const headerState = useHeaderStateContext();\r\n const comparisonMajorMetric = dateRange.compared ? headerState?.selectedItemValue : defaultComparisonMetric;\r\n const [isFirstDataLoaded, setIsFirstDataLoaded] = useState(false);\r\n const {\r\n willFetchData,\r\n willRender,\r\n done,\r\n } = perfMarkerUtils;\r\n\r\n const {\r\n orderby,\r\n direction,\r\n } = useMemo(() => getOrderFromGridSort({\r\n sortColumn: sortState.sortColumn,\r\n sortDirection: sortState.sortDirection,\r\n dateRange,\r\n comparisonMajorMetric,\r\n }), [comparisonMajorMetric, dateRange, sortState]);\r\n const columns = useMemo(() => selectedMetrics.map(m => m.key), [selectedMetrics]);\r\n\r\n const {\r\n data,\r\n isLoading,\r\n } = useGridData({\r\n dateRange,\r\n filter,\r\n constructOptions,\r\n permissions,\r\n jsdata,\r\n dateUtil,\r\n orderby,\r\n direction,\r\n selectedMenuItem: comparisonMajorMetric,\r\n columns,\r\n cardTypeId,\r\n willFetchData,\r\n willRender,\r\n navigationLevel,\r\n });\r\n\r\n useEffect(() => {\r\n if (!isFirstDataLoaded && !isLoading) {\r\n setIsFirstDataLoaded(true);\r\n done();\r\n }\r\n }, [data, done, isFirstDataLoaded, isLoading, willRender]);\r\n\r\n const onChange = useCallback(({\r\n newSelectedMetrics,\r\n newSortState,\r\n }) => {\r\n if (newSelectedMetrics) {\r\n setSelectedMetrics(newSelectedMetrics);\r\n const newSelectedColumns = newSelectedMetrics.map(m => m.key);\r\n patchPreference({\r\n selectedColumns: newSelectedColumns,\r\n });\r\n }\r\n if (newSortState) {\r\n setSortState(newSortState);\r\n patchPreference(newSortState);\r\n }\r\n }, [patchPreference]);\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nGridDataTable.defaultProps = {\r\n footerButtonConfigs: null,\r\n getPopoverContent: undefined,\r\n};\r\n","import _ from 'underscore';\r\nimport { useCallback } from 'react';\r\nimport useSwr from 'swr';\r\n\r\nimport {\r\n fetchGridData,\r\n} from '@bingads-webui-campaign/overview-cards-common';\r\nimport {\r\n TMajorMetric,\r\n} from '@bingads-webui-campaign-react/overview-performance-table';\r\nimport { cardTopKeywordsId } from '@bingads-webui-campaign/fluent-page-consts';\r\n\r\nexport interface IUseGridDataProps {\r\n dateRange: {\r\n RangeStartDate: string;\r\n RangeEndDate: string;\r\n compared: object;\r\n },\r\n filter: {\r\n filter: {\r\n key: number;\r\n value: object;\r\n }\r\n }[],\r\n constructOptions: (navigationLevel?: string) => { entitySet: object };\r\n permissions: any;\r\n jsdata: any;\r\n dateUtil: any;\r\n orderby: string | number;\r\n direction: number;\r\n selectedMenuItem: TMajorMetric;\r\n columns: string[];\r\n cardTypeId: string;\r\n willFetchData: Function;\r\n willRender: Function;\r\n navigationLevel: string;\r\n}\r\n\r\nexport function useGridData({\r\n dateRange,\r\n filter,\r\n constructOptions,\r\n permissions,\r\n jsdata,\r\n dateUtil,\r\n orderby,\r\n direction,\r\n selectedMenuItem,\r\n columns,\r\n cardTypeId,\r\n willFetchData,\r\n willRender,\r\n navigationLevel,\r\n}: IUseGridDataProps) {\r\n const {\r\n entitySet,\r\n } = constructOptions(navigationLevel);\r\n\r\n const fetch = useCallback(({\r\n dateRange, filter, orderby, direction, selectedMenuItem, columns, cardTypeId,\r\n }) => {\r\n willFetchData();\r\n return fetchGridData({\r\n entitySet,\r\n dateRange,\r\n options: {\r\n orderby,\r\n direction,\r\n selectedMenuItem,\r\n columns,\r\n },\r\n filter,\r\n jsdata,\r\n dateUtil,\r\n permissions,\r\n dfmCacheKey: cardTypeId,\r\n }).then((values) => {\r\n willRender();\r\n return values.map((value) => {\r\n let keywordText;\r\n if (cardTypeId === cardTopKeywordsId) {\r\n keywordText = value.Text;\r\n if (value.MatchType === 'Phrase') {\r\n keywordText = `\"${value.Text}\"`;\r\n } else if (value.MatchType === 'Exact') {\r\n keywordText = `[${value.Text}]`;\r\n }\r\n }\r\n return {\r\n ...value,\r\n Name: keywordText || value.Text || value.Name,\r\n Id: value.Id || _.uniqueId(),\r\n };\r\n });\r\n });\r\n }, [dateUtil, entitySet, jsdata, permissions, willFetchData, willRender]);\r\n\r\n const { data, isLoading } = useSwr({\r\n dateRange, filter, orderby, direction, selectedMenuItem, columns, cardTypeId,\r\n }, fetch, {\r\n revalidateOnFocus: false,\r\n });\r\n\r\n return {\r\n data,\r\n isLoading,\r\n };\r\n}\r\n","import { makeStyles } from '@fluentui/react-components';\r\n\r\nexport const useStyles = makeStyles({\r\n gridStyle: {\r\n height: '100%',\r\n },\r\n});\r\n","import React, { useCallback, useContext } from 'react';\r\nimport classNames from 'classnames';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\n\r\nimport { IOverviewTableProps, IScopeContext } from './types';\r\nimport { GridDataTable } from './grid-data-table';\r\nimport { useStyles } from './overview-grid-card-style';\r\n\r\nexport function OverviewAdGroupTable(props: IOverviewTableProps) {\r\n const { i18n } = props;\r\n const { scope } = useContext(ScopeContext) as IScopeContext;\r\n const classes = useStyles();\r\n const {\r\n aid, cid, uid, campaignId,\r\n } = scope?.values;\r\n\r\n const onFooterButtonClick = useCallback(() => {\r\n scope.save(getRoutePathById(allSiteMap, 'adgroups'));\r\n }, [scope]);\r\n\r\n const getHref = useCallback((entityId: string) => {\r\n const route = getRoutePathById(allSiteMap, 'keywords');\r\n const search = `cid=${cid}&uid=${uid}&aid=${aid}&campaignId=${campaignId}&adGroupId=${entityId}`;\r\n return `${route}?${search}`;\r\n }, [aid, cid, uid, campaignId]);\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n}\r\n\r\n","import _ from 'underscore';\r\nimport { useMemo, useCallback } from 'react';\r\nimport { AccountUtils } from '@bingads-webui-clientcenter/entity-utils';\r\nimport useSwr from 'swr';\r\n\r\nimport {\r\n fetchEntityGridCombined,\r\n} from '@bingads-webui-campaign/overview-cards-common';\r\n\r\nimport { TDataRequestSortDirection } from './types';\r\n\r\nexport interface IUseCombinedCallDataProps {\r\n dateRange: {\r\n RangeStartDate: string;\r\n RangeEndDate: string;\r\n compared: object;\r\n },\r\n filter: {\r\n filter: {\r\n key: number;\r\n value: object;\r\n }\r\n }[],\r\n campaignType: string | number;\r\n constructOptions: () => { entitySet: object };\r\n permissions: any;\r\n jsdata: any;\r\n dateUtil: any;\r\n getCardsConfig: () => { id: string }[];\r\n sortColumn: string | number;\r\n sortDirection: TDataRequestSortDirection;\r\n willFetchData: Function;\r\n willRender: Function;\r\n}\r\n\r\nexport function useCombinedCallData({\r\n dateRange,\r\n filter,\r\n campaignType,\r\n constructOptions,\r\n permissions,\r\n jsdata,\r\n dateUtil,\r\n getCardsConfig,\r\n sortColumn,\r\n sortDirection,\r\n willFetchData,\r\n willRender,\r\n}: IUseCombinedCallDataProps) {\r\n const {\r\n entitySet,\r\n } = constructOptions();\r\n const orderByValue = useMemo(() => [[sortColumn, sortDirection]], [sortColumn, sortDirection]);\r\n\r\n const fetch = useCallback(({ dateRange, filter, orderBy }) => {\r\n willFetchData();\r\n return fetchEntityGridCombined({\r\n entitySet,\r\n dateRange,\r\n comparisonDateRange: dateRange.compared,\r\n orderBy,\r\n jsdata,\r\n dateUtil,\r\n getCardsConfig,\r\n // TODO: [yaoyao] when orderBy is ready, we need to figure out how to set value for fetchSingleTile\r\n fetchSingleTile: false,\r\n filter,\r\n permissions,\r\n // now we only have expert mode?\r\n accountsMode: 1,\r\n campaignType,\r\n }).then((data) => {\r\n willRender();\r\n\r\n if (data?.[0]?.AccountInactiveReasons) {\r\n return _.map(data, entity => ({ ...entity, Status: AccountUtils.activityStatus(entity) }));\r\n }\r\n\r\n return data;\r\n });\r\n }, [willFetchData, entitySet, jsdata, dateUtil, getCardsConfig, permissions, willRender, campaignType]);\r\n\r\n const { data, isLoading } = useSwr({ dateRange, filter, orderBy: orderByValue }, fetch, {\r\n revalidateOnFocus: false,\r\n });\r\n\r\n return {\r\n data,\r\n isLoading,\r\n };\r\n}\r\n","import React, { useState, useCallback, useMemo, useEffect, useContext } from 'react';\r\nimport classNames from 'classnames';\r\nimport {\r\n OverviewPerformanceTable,\r\n ISortState,\r\n} from '@bingads-webui-campaign-react/overview-performance-table';\r\nimport { useHeaderStateContext } from '@bingads-webui-campaign-react/overview-card';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\n\r\nimport { IOverviewTableProps, IScopeContext } from './types';\r\nimport { useCombinedCallData } from './use-combined-call-data';\r\nimport { getOrderFromGridSortForCombinedCall } from './order-by-helper';\r\nimport { defaultComparisonMetric } from './consts';\r\nimport { useStyles } from './overview-grid-card-style';\r\n\r\nexport function OverviewAccountTable({\r\n metricFormatter,\r\n i18n,\r\n constructOptions,\r\n dateRange,\r\n filter,\r\n permissions,\r\n jsdata,\r\n dateUtil,\r\n getCardsConfig,\r\n allMetrics,\r\n initialSelectedMetrics,\r\n initialSortColumn,\r\n initialSortDirection,\r\n patchPreference,\r\n perfMarkerUtils,\r\n campaignType,\r\n}: IOverviewTableProps) {\r\n const { scope } = useContext(ScopeContext) as IScopeContext;\r\n const { cid, uid } = scope?.values;\r\n const [selectedMetrics, setSelectedMetrics] = useState(initialSelectedMetrics);\r\n const [sortState, setSortState] = useState({ sortColumn: initialSortColumn, sortDirection: initialSortDirection });\r\n const headerState = useHeaderStateContext();\r\n const comparisonMajorMetric = dateRange.compared ? headerState?.selectedItemValue : defaultComparisonMetric;\r\n const [isFirstDataLoaded, setIsFirstDataLoaded] = useState(false);\r\n const classes = useStyles();\r\n const {\r\n willFetchData,\r\n willRender,\r\n done,\r\n } = perfMarkerUtils;\r\n\r\n const {\r\n sortColumn,\r\n sortDirection,\r\n } = useMemo(() => getOrderFromGridSortForCombinedCall({\r\n sortColumn: sortState.sortColumn,\r\n sortDirection: sortState.sortDirection,\r\n dateRange,\r\n comparisonMajorMetric,\r\n }), [comparisonMajorMetric, dateRange, sortState]);\r\n\r\n const {\r\n data,\r\n isLoading,\r\n } = useCombinedCallData({\r\n dateRange,\r\n filter,\r\n constructOptions,\r\n permissions,\r\n jsdata,\r\n dateUtil,\r\n getCardsConfig,\r\n sortColumn,\r\n sortDirection,\r\n willFetchData,\r\n willRender,\r\n campaignType,\r\n });\r\n\r\n useEffect(() => {\r\n if (!isFirstDataLoaded && !isLoading) {\r\n setIsFirstDataLoaded(true);\r\n done();\r\n }\r\n }, [data, done, isFirstDataLoaded, isLoading, willRender]);\r\n\r\n const onChange = useCallback(({\r\n newSelectedMetrics,\r\n newSortState,\r\n }) => {\r\n if (newSelectedMetrics) {\r\n setSelectedMetrics(newSelectedMetrics);\r\n const newSelectedColumns = newSelectedMetrics.map(m => m.key);\r\n patchPreference({\r\n selectedColumns: newSelectedColumns,\r\n });\r\n }\r\n if (newSortState) {\r\n setSortState(newSortState);\r\n patchPreference(newSortState);\r\n }\r\n }, [patchPreference]);\r\n\r\n const onFooterButtonClick = useCallback(() => {\r\n scope.save(getRoutePathById(allSiteMap, 'performance'));\r\n }, [scope]);\r\n\r\n const getHref = useCallback((entityId: string) => {\r\n const route = getRoutePathById(allSiteMap, 'overview');\r\n const search = `cid=${cid}&uid=${uid}&aid=${entityId}`;\r\n return `${route}?${search}`;\r\n }, [cid, uid]);\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n}\r\n\r\n","import React, { useState, useCallback, useMemo, useEffect, useContext } from 'react';\r\nimport classNames from 'classnames';\r\nimport {\r\n OverviewPerformanceTable,\r\n ISortState,\r\n} from '@bingads-webui-campaign-react/overview-performance-table';\r\nimport { useHeaderStateContext } from '@bingads-webui-campaign-react/overview-card';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\n\r\nimport { IOverviewTableProps, IScopeContext } from './types';\r\nimport { useCombinedCallData } from './use-combined-call-data';\r\nimport { getOrderFromGridSortForCombinedCall } from './order-by-helper';\r\nimport { defaultComparisonMetric } from './consts';\r\nimport { useStyles } from './overview-grid-card-style';\r\n\r\nexport function OverviewCampaignTable({\r\n metricFormatter,\r\n i18n,\r\n constructOptions,\r\n dateRange,\r\n filter,\r\n permissions,\r\n jsdata,\r\n dateUtil,\r\n getCardsConfig,\r\n allMetrics,\r\n initialSelectedMetrics,\r\n initialSortColumn,\r\n initialSortDirection,\r\n patchPreference,\r\n perfMarkerUtils,\r\n campaignType,\r\n}: IOverviewTableProps) {\r\n const { scope } = useContext(ScopeContext) as IScopeContext;\r\n const { aid, cid, uid } = scope?.values;\r\n const [selectedMetrics, setSelectedMetrics] = useState(initialSelectedMetrics);\r\n const [sortState, setSortState] = useState({ sortColumn: initialSortColumn, sortDirection: initialSortDirection });\r\n const headerState = useHeaderStateContext();\r\n const comparisonMajorMetric = dateRange.compared ? headerState?.selectedItemValue : defaultComparisonMetric;\r\n const [isFirstDataLoaded, setIsFirstDataLoaded] = useState(false);\r\n const classes = useStyles();\r\n const {\r\n willFetchData,\r\n willRender,\r\n done,\r\n } = perfMarkerUtils;\r\n\r\n const {\r\n sortColumn,\r\n sortDirection,\r\n } = useMemo(() => getOrderFromGridSortForCombinedCall({\r\n sortColumn: sortState.sortColumn,\r\n sortDirection: sortState.sortDirection,\r\n dateRange,\r\n comparisonMajorMetric,\r\n }), [comparisonMajorMetric, dateRange, sortState]);\r\n\r\n const {\r\n data,\r\n isLoading,\r\n } = useCombinedCallData({\r\n dateRange,\r\n filter,\r\n constructOptions,\r\n permissions,\r\n jsdata,\r\n dateUtil,\r\n getCardsConfig,\r\n sortColumn,\r\n sortDirection,\r\n willFetchData,\r\n willRender,\r\n campaignType,\r\n });\r\n\r\n useEffect(() => {\r\n if (!isFirstDataLoaded && !isLoading) {\r\n setIsFirstDataLoaded(true);\r\n done();\r\n }\r\n }, [data, done, isFirstDataLoaded, isLoading, willRender]);\r\n\r\n const onChange = useCallback(({\r\n newSelectedMetrics,\r\n newSortState,\r\n }) => {\r\n if (newSelectedMetrics) {\r\n setSelectedMetrics(newSelectedMetrics);\r\n const newSelectedColumns = newSelectedMetrics.map(m => m.key);\r\n patchPreference({\r\n selectedColumns: newSelectedColumns,\r\n });\r\n }\r\n if (newSortState) {\r\n setSortState(newSortState);\r\n patchPreference(newSortState);\r\n }\r\n }, [patchPreference]);\r\n\r\n const onFooterButtonClick = useCallback(() => {\r\n scope.save(getRoutePathById(allSiteMap, 'campaigns'));\r\n }, [scope]);\r\n\r\n const getHref = useCallback((entityId: string, campaignType?: string) => {\r\n if (campaignType === 'Smart') {\r\n return `/campaign/smart?cid=${cid}&uid=${uid}&aid=${aid}#/campaign/${entityId}`;\r\n }\r\n const route = getRoutePathById(allSiteMap, 'overview');\r\n const search = `cid=${cid}&uid=${uid}&aid=${aid}&campaignId=${entityId}`;\r\n return `${route}?${search}`;\r\n }, [aid, cid, uid]);\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n}\r\n","import React, { useCallback, useContext } from 'react';\r\nimport classNames from 'classnames';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\n\r\nimport { IOverviewTableProps, IScopeContext } from './types';\r\nimport { GridDataTable } from './grid-data-table';\r\nimport { useStyles } from './overview-grid-card-style';\r\n\r\nconst MATCH_TYPE = {\r\n Exact: _TL_('Type: Exact'),\r\n Phrase: _TL_('Type: Phrase'),\r\n Broad: _TL_('Type: Broad'),\r\n};\r\n\r\nconst getPopoverContentFunction = i18n => ({\r\n Name, MatchType, AdGroup, Campaign,\r\n}: any) => {\r\n const matchType = MATCH_TYPE[MatchType] ? i18n.getString(MATCH_TYPE[MatchType]) : null;\r\n return (\r\n <>\r\n
{Name}
\r\n
{`${Campaign?.Name} > ${AdGroup?.Name}`}
\r\n {matchType &&
{matchType}
}\r\n \r\n );\r\n};\r\n\r\nexport function OverviewKeywordTable(props: IOverviewTableProps) {\r\n const { i18n } = props;\r\n const { scope } = useContext(ScopeContext) as IScopeContext;\r\n const { aid, cid, uid } = scope?.values;\r\n const classes = useStyles();\r\n\r\n const onFooterButtonClick = useCallback(() => {\r\n scope.save(getRoutePathById(allSiteMap, 'keywords'));\r\n }, [scope]);\r\n\r\n const getHref = useCallback((entityId: string) => {\r\n const route = getRoutePathById(allSiteMap, 'keywords');\r\n const search = `cid=${cid}&uid=${uid}&aid=${aid}&campaignId=${entityId}`;\r\n return `${route}?${search}`;\r\n }, [aid, cid, uid]);\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n}\r\n","import _ from 'underscore';\r\nimport useSwr from 'swr';\r\nimport { edmCampaign } from '@bingads-webui/edm-campaign';\r\n\r\nconst pageSize = 10000;\r\n\r\nexport function getCampaignData({\r\n jsdata,\r\n isAdGroupLevel,\r\n campaignId,\r\n}) {\r\n const filter = '(CampaignType ne Enum.CampaignType\\'Smart\\')';\r\n\r\n const $select = [\r\n 'Id',\r\n 'Name',\r\n 'Status',\r\n 'CampaignType',\r\n 'CampaignSubType',\r\n 'CampaignSettings',\r\n ].join(', ');\r\n\r\n const formatQuery : {\r\n $select: string,\r\n $skip: number,\r\n $top: number,\r\n $orderby: string,\r\n $filter?: string,\r\n } = {\r\n $select,\r\n $skip: 0,\r\n $top: pageSize,\r\n $orderby: 'Name asc',\r\n };\r\n\r\n if (filter) {\r\n formatQuery.$filter = filter;\r\n }\r\n\r\n return jsdata.Campaign.findAll({\r\n query: formatQuery,\r\n }).then((data) => {\r\n const dataList = _.map(data, (item : {\r\n Id: number,\r\n Name: string,\r\n }) => ({\r\n value: item.Id.toString(),\r\n content: item.Name,\r\n allowedCheck: !isAdGroupLevel,\r\n }));\r\n\r\n if (campaignId) {\r\n return dataList.filter(item => item.value === campaignId.toString());\r\n }\r\n\r\n return dataList;\r\n }, (error) => {\r\n // TODO: handle error\r\n });\r\n}\r\n\r\nexport function getAdGroupData({\r\n query,\r\n cid,\r\n aid,\r\n jsdata,\r\n campaignId,\r\n}) {\r\n const signleQuoteTerminatedQuery = query.replace('\\'', '\\'\\'');\r\n\r\n const filter = _.compact([\r\n query && `contains(Name, '${signleQuoteTerminatedQuery}')`,\r\n ]).join(' and ');\r\n\r\n const $expand = [\r\n 'Id',\r\n 'Name',\r\n 'CampaignType',\r\n 'CampaignSubType',\r\n ];\r\n\r\n const $select = [\r\n 'Id',\r\n 'Name',\r\n 'Status',\r\n 'Language',\r\n ].join(', ');\r\n\r\n const formatQuery : {\r\n $expand: string,\r\n $select: string,\r\n $skip: number,\r\n $top: number,\r\n $orderby: string,\r\n $filter?: string,\r\n $count: boolean,\r\n } = {\r\n $expand: `Campaign($select=${$expand.join(',')})`,\r\n $select,\r\n $orderby: 'Name asc',\r\n $skip: 0,\r\n $top: pageSize,\r\n $count: true,\r\n };\r\n\r\n if (campaignId) {\r\n _.extend(formatQuery, {\r\n entitySet: edmCampaign\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid)\r\n .Campaigns\r\n .$withKey(Number(campaignId))\r\n .AdGroups\r\n .toJSON(),\r\n });\r\n }\r\n\r\n if (filter) {\r\n formatQuery.$filter = filter;\r\n }\r\n\r\n return jsdata.AdGroup.findAll({\r\n query: formatQuery,\r\n }).then(data => _.map(data, (item : {\r\n Id: number,\r\n Name: string,\r\n }) => ({\r\n value: item.Id.toString(),\r\n content: item.Name,\r\n parentValue: campaignId,\r\n allowedCheck: true,\r\n })), (error) => {\r\n // TODO: handle error\r\n });\r\n}\r\n\r\nexport function useCampaignData({\r\n jsdata,\r\n isAdGroupLevel,\r\n campaignId,\r\n}) {\r\n return useSwr({ jsdata, isAdGroupLevel, campaignId }, getCampaignData, {\r\n revalidateOnFocus: false,\r\n });\r\n}\r\n","import _ from 'underscore';\r\nimport classNames from 'classnames';\r\nimport React, { useCallback, useState, useEffect } from 'react';\r\nimport {\r\n makeStyles,\r\n tokens,\r\n shorthands,\r\n Text,\r\n Tooltip,\r\n} from '@fluentui/react-components';\r\n\r\nimport { DropdownTreeSelect } from '@bingads-webui-campaign-react/dropdown-tree-select';\r\n\r\nimport { useCampaignData, getAdGroupData } from './adgroup-selector-data';\r\n\r\ninterface ICampaignAdgroupSelectorProps {\r\n defalutSelectedCampaign?: {\r\n Id: string;\r\n Name: string;\r\n };\r\n defalutSelectedAdGroup?: {\r\n Id: string;\r\n Name: string;\r\n };\r\n showSelectedTag?: boolean;\r\n isAdGroupLevel: boolean;\r\n onSelectionChange: ({\r\n selectedCampaign,\r\n selectedAdGroup,\r\n }: {\r\n selectedCampaign: { Id: string, Name: string },\r\n selectedAdGroup?: { Id: string, Name: string },\r\n }) => void;\r\n onInitFinished: () => void;\r\n jsdata: any;\r\n cid: number,\r\n aid: number,\r\n campaignId?: number,\r\n}\r\n\r\nconst useStyles = makeStyles({\r\n selectedTag: {\r\n display: 'inline-block',\r\n maxWidth: '100%',\r\n textOverflow: 'ellipsis',\r\n whiteSpace: 'nowrap',\r\n fontWeight: 600,\r\n backgroundColor: tokens.colorNeutralBackground1Selected,\r\n ...shorthands.overflow('hidden'),\r\n ...shorthands.borderRadius('3px'),\r\n ...shorthands.gap('6px'),\r\n ...shorthands.padding('6px', '12px'),\r\n ...shorthands.margin('0px', '0px', '6px'),\r\n },\r\n});\r\n\r\nexport function CampaignAdgroupSelector({\r\n defalutSelectedCampaign,\r\n defalutSelectedAdGroup,\r\n isAdGroupLevel,\r\n showSelectedTag,\r\n onInitFinished,\r\n onSelectionChange,\r\n jsdata,\r\n cid,\r\n aid,\r\n campaignId,\r\n}: ICampaignAdgroupSelectorProps) {\r\n const classes = useStyles();\r\n const {\r\n data: items,\r\n isLoading,\r\n } = useCampaignData({ jsdata, isAdGroupLevel, campaignId });\r\n\r\n const [checkedItems, setCheckedItems] = useState([]);\r\n const [openItems, setOpenItems] = useState([]);\r\n const [selectedCampaign, setSelectedCampaign] = useState(defalutSelectedCampaign);\r\n const [selectedAdGroup, setSelectedAdGroup] = useState(defalutSelectedAdGroup);\r\n\r\n useEffect(() => {\r\n if (!isLoading) {\r\n onInitFinished();\r\n }\r\n }, [isLoading, onInitFinished]);\r\n\r\n const onChange = useCallback(([{ value, content, parentValue }]) => {\r\n setCheckedItems([value]);\r\n if (isAdGroupLevel) {\r\n const adGroup = {\r\n Id: value,\r\n Name: content,\r\n };\r\n setSelectedAdGroup(adGroup);\r\n const campaignFromItems = _.find(items, (item : {\r\n value: string,\r\n content: string,\r\n }) => item.value === parentValue);\r\n const campaign = {\r\n Id: parentValue,\r\n Name: campaignFromItems?.content,\r\n };\r\n setSelectedCampaign(campaign);\r\n onSelectionChange({\r\n selectedCampaign: campaign,\r\n selectedAdGroup: adGroup,\r\n });\r\n } else {\r\n const campaign = {\r\n Id: value,\r\n Name: content,\r\n };\r\n setSelectedCampaign(campaign);\r\n onSelectionChange({\r\n selectedCampaign: campaign,\r\n });\r\n }\r\n }, [isAdGroupLevel, items, onSelectionChange]);\r\n\r\n const onOpenChange = useCallback((allOpenItems) => {\r\n setOpenItems(allOpenItems);\r\n }, []);\r\n const lazyLoad = useCallback(parentValue => getAdGroupData({\r\n query: '',\r\n jsdata,\r\n cid,\r\n aid,\r\n campaignId: parentValue,\r\n }), [aid, cid, jsdata]);\r\n\r\n const selectedEntityName = isAdGroupLevel ? selectedAdGroup?.Name : selectedCampaign?.Name;\r\n\r\n return (\r\n
\r\n { showSelectedTag &&\r\n \r\n {selectedEntityName}\r\n \r\n }\r\n { !isLoading &&\r\n \r\n }\r\n
\r\n );\r\n}\r\n\r\nCampaignAdgroupSelector.defaultProps = {\r\n defalutSelectedCampaign: {},\r\n defalutSelectedAdGroup: {},\r\n showSelectedTag: true,\r\n campaignId: null,\r\n};\r\n","import _ from 'underscore';\r\nimport classNames from 'classnames';\r\nimport React, { useCallback, useState, useMemo, useContext } from 'react';\r\nimport {\r\n Button,\r\n Divider,\r\n Field,\r\n RadioGroup,\r\n Radio,\r\n Label,\r\n Input,\r\n Dropdown,\r\n Option,\r\n Text,\r\n makeStyles,\r\n useId,\r\n} from '@fluentui/react-components';\r\nimport {\r\n DrawerBody,\r\n DrawerHeader,\r\n DrawerHeaderTitle,\r\n DrawerFooter,\r\n Drawer,\r\n} from '@fluentui/react-drawer';\r\nimport { Dismiss24Regular } from '@fluentui/react-icons';\r\n\r\nimport { LearnMoreLink } from '@bingads-webui-campaign-react/help';\r\nimport { edmCampaign } from '@bingads-webui/edm-campaign';\r\nimport { AlertHelper } from '@bingads-webui-campaign/alert-helper';\r\nimport { InstrumentationContext } from '@bingads-webui-react/hoc-with-instrumentation';\r\n\r\nimport { CampaignAdgroupSelector } from './campaign-adgroup-selector';\r\n\r\ninterface IAddKeywordPanelProps {\r\n campaign: {\r\n Id: string;\r\n Name: string;\r\n };\r\n adGroup: {\r\n Id: string;\r\n Name: string;\r\n };\r\n keywordText: string;\r\n isNegative: boolean;\r\n onClose: (dataSaved? : boolean) => void;\r\n i18n: any;\r\n jsdata: any;\r\n cid: number,\r\n aid: number,\r\n campaignId?: number,\r\n}\r\n\r\ntype TRadioGroupValue = 'campaign' | 'adgroup';\r\n\r\nconst useStyles = makeStyles({\r\n divider: {\r\n maxHeight: '1px',\r\n },\r\n keywordText: {\r\n width: '100%',\r\n },\r\n dropdown: {\r\n width: '100%',\r\n },\r\n helpLink: {\r\n marginTop: '8px',\r\n },\r\n});\r\n\r\nexport function AddKeywordDrawer({\r\n campaign,\r\n adGroup,\r\n keywordText,\r\n isNegative,\r\n onClose,\r\n i18n,\r\n jsdata,\r\n cid,\r\n aid,\r\n campaignId,\r\n}: IAddKeywordPanelProps) {\r\n const classes = useStyles();\r\n const inputId = useId('input');\r\n const dropdownId = useId('dropdown');\r\n const campaignAdGroupSelectorId = useId('campaign-adgroup-selector');\r\n const [keywordValue, setKeywordValue] = useState(keywordText);\r\n const options = useMemo(() => (isNegative ? [{\r\n key: 'Exact',\r\n text: i18n.getString(_TL_('Exact')),\r\n }, {\r\n key: 'Phrase',\r\n text: i18n.getString(_TL_('Phrase')),\r\n }] : [{\r\n key: 'Exact',\r\n text: i18n.getString(_TL_('Exact')),\r\n }, {\r\n key: 'Phrase',\r\n text: i18n.getString(_TL_('Phrase')),\r\n }, {\r\n key: 'Broad',\r\n text: i18n.getString(_TL_('Broad')),\r\n }]), [i18n, isNegative]);\r\n const [selectedOption, setSelectedOption] = useState(options[0].key);\r\n const [selectedOptionText, setSelectedOptionText] = useState(options[0].text);\r\n const [radioGroupValue, setRadioGroupValue] = useState('adgroup');\r\n const isAdGroupLevel = radioGroupValue === 'adgroup';\r\n const [isSelectorDataLoaded, setIsSelectorDataLoaded] = useState(false);\r\n\r\n const title = isNegative ? i18n.getString(_TL_('Add as negative keyword')) : i18n.getString(_TL_('Add as keyword'));\r\n const alertHelper = useMemo(() => new AlertHelper({ i18n }), [i18n]);\r\n\r\n const instrumentation = useContext(InstrumentationContext) as any;\r\n const { activity } = useMemo(() => instrumentation.createScenarioAndActivity({\r\n scenarioName: 'Fluent2OverviewPage',\r\n activityName: 'SearchTerm',\r\n }), [instrumentation]);\r\n\r\n const [selectedCampaign, setSelectedCampaign] = useState(campaign);\r\n const [selectedAdGroup, setSelectedAdGroup] = useState(adGroup);\r\n const selectorTitle = isAdGroupLevel ? i18n.getString(_TL_('Select ad group')) : i18n.getString(_TL_('Select campaign'));\r\n\r\n const onSavedClose = useCallback(() => { onClose(true); }, [onClose]);\r\n const onCancelClose = useCallback(() => { onClose(false); }, [onClose]);\r\n\r\n const onSaveClicked = useCallback(() => {\r\n if (isNegative) {\r\n const negativeKeyword = {\r\n NegativeKeywords: [{\r\n Text: keywordValue,\r\n EntityType: isAdGroupLevel ? 'AdGroup' : 'Campaign',\r\n CampaignId: selectedCampaign.Id,\r\n AdGroupId: selectedAdGroup.Id,\r\n MatchType: selectedOption,\r\n }],\r\n };\r\n const campaignEntity = edmCampaign\r\n .Customers.$withKey(cid)\r\n .Accounts.$withKey(aid)\r\n .Campaigns.$withKey(selectedCampaign.Id);\r\n let entitySet = campaignEntity;\r\n\r\n if (isAdGroupLevel) {\r\n entitySet = campaignEntity.AdGroups.$withKey(selectedAdGroup.Id);\r\n }\r\n\r\n jsdata.NegativeKeyword.create(negativeKeyword, {\r\n entitySet: entitySet.NegativeKeywords['Default.PostNegativeKeywords'],\r\n })\r\n .then(() => {\r\n onSavedClose();\r\n alertHelper.showSuccess(i18n.getString(_TL_('Keyword added.')));\r\n })\r\n .catch((error) => {\r\n activity.error(JSON.stringify(error));\r\n alertHelper.showError(i18n.getString(_TL_('We’ve encountered an error and can’t continue. Please contact support for further assistance.')));\r\n });\r\n } else {\r\n const keywordData = {\r\n Campaign: { Id: selectedCampaign.Id },\r\n Name: selectedAdGroup.Name,\r\n Id: selectedAdGroup.Id,\r\n Keywords: [{\r\n Text: keywordValue,\r\n MatchType: selectedOption,\r\n Bid: {},\r\n AdGroup: { Id: selectedAdGroup.Id },\r\n }],\r\n };\r\n\r\n jsdata.AdGroup\r\n .update(keywordData.Id, keywordData, { adapter: 'bulk' })\r\n .then(() => {\r\n onSavedClose();\r\n alertHelper.showSuccess(i18n.getString(_TL_('Keyword added.')));\r\n })\r\n .catch((error) => {\r\n activity.error(JSON.stringify(error));\r\n alertHelper.showError(i18n.getString(_TL_('We’ve encountered an error and can’t continue. Please contact support for further assistance.')));\r\n });\r\n }\r\n }, [activity, aid, alertHelper, cid, i18n, isAdGroupLevel, isNegative,\r\n jsdata, keywordValue, onSavedClose, selectedAdGroup, selectedCampaign, selectedOption]);\r\n\r\n const onRadioGroupChange = useCallback((_, data) => {\r\n setRadioGroupValue(data.value);\r\n }, []);\r\n\r\n const onKeywordChange = useCallback((ev, data) => {\r\n setKeywordValue(data.value.trim());\r\n }, []);\r\n\r\n const onOptionSelect = useCallback((ev, data) => {\r\n setSelectedOption(data.optionValue);\r\n setSelectedOptionText(data.optionText);\r\n }, []);\r\n\r\n const onSelectorDataLoaded = useCallback(() => {\r\n setIsSelectorDataLoaded(true);\r\n }, []);\r\n\r\n const onSelectorSelectionChange = useCallback(({\r\n selectedCampaign: newSelectedCampaign,\r\n selectedAdGroup: newSelectedAdGroup,\r\n }) => {\r\n if (isAdGroupLevel) {\r\n setSelectedCampaign(newSelectedCampaign);\r\n setSelectedAdGroup(newSelectedAdGroup);\r\n } else {\r\n setSelectedCampaign(newSelectedCampaign);\r\n }\r\n }, [isAdGroupLevel]);\r\n\r\n return (\r\n \r\n \r\n }\r\n onClick={onCancelClose}\r\n />\r\n }\r\n >\r\n {title}\r\n \r\n \r\n\r\n \r\n {isNegative &&\r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n {options.map(option => (\r\n \r\n ))}\r\n \r\n
\r\n {i18n.getString(_TL_('Not sure which match type to use?'))}\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n\r\nAddKeywordDrawer.defaultProps = {\r\n campaignId: null,\r\n};\r\n","import React, { useCallback, useContext, useState } from 'react';\r\nimport classNames from 'classnames';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { getRoutePathById, allSiteMap } from '@bingads-webui-react/with-site-map';\r\nimport { Text } from '@fluentui/react-components';\r\n\r\nimport { IOverviewTableProps, IScopeContext } from './types';\r\nimport { GridDataTable } from './grid-data-table';\r\nimport { AddKeywordDrawer } from './search-term-components/add-keyword-drawer';\r\nimport { useStyles } from './overview-grid-card-style';\r\n\r\nconst getPopoverContentFunction = i18n => ({\r\n Name, Keyword,\r\n}: {\r\n Name: string;\r\n Keyword: {\r\n Text: string;\r\n };\r\n}) => (\r\n <>\r\n {Name}\r\n {\r\n Keyword?.Text && (\r\n <>\r\n {i18n.getString(_TL_('Matched keyword'))}\r\n {Keyword.Text}\r\n \r\n )\r\n }\r\n \r\n);\r\n\r\nexport function OverviewSearchTermTable(props: IOverviewTableProps) {\r\n const { i18n, jsdata } = props;\r\n const { scope } = useContext(ScopeContext) as IScopeContext;\r\n const {\r\n aid, cid, uid, campaignId,\r\n } = scope?.values;\r\n const [showDrawer, setShowDrawer] = useState(false);\r\n const [selectedCampaign, setSelectedCampaign] = useState(null);\r\n const [selectedAdGroup, setSelectedAdGroup] = useState(null);\r\n const [isNegative, setIsNegative] = useState(false);\r\n const [keywordText, setKeywordText] = useState('');\r\n const classes = useStyles();\r\n\r\n const onFooterButtonClick = useCallback(() => {\r\n scope.save(getRoutePathById(allSiteMap, 'search-terms'));\r\n }, [scope]);\r\n\r\n const getHref = useCallback(() => {\r\n const route = getRoutePathById(allSiteMap, 'search-terms');\r\n const search = `cid=${cid}&uid=${uid}&aid=${aid}`;\r\n return `${route}?${search}`;\r\n }, [aid, cid, uid]);\r\n\r\n const triggerSearchTermDrawer = useCallback(({\r\n campaign, adGroup, isNegative, keywordText,\r\n }) => {\r\n setSelectedCampaign(campaign);\r\n setSelectedAdGroup(adGroup);\r\n setKeywordText(keywordText);\r\n setIsNegative(isNegative);\r\n setShowDrawer(true);\r\n }, []);\r\n\r\n const [tableKey, setTableKey] = useState(0);\r\n const onClose = useCallback((dataSaved: boolean = false) => {\r\n setShowDrawer(false);\r\n if (dataSaved) {\r\n // if data saved, we use key update to force table to fetch new data\r\n setTableKey(tableKey + 1);\r\n }\r\n }, [tableKey]);\r\n\r\n return (\r\n <>\r\n {showDrawer && (\r\n \r\n )}\r\n
\r\n \r\n
\r\n \r\n\r\n );\r\n}\r\n","import _ from 'underscore';\r\nimport { FAC_FEATURE_ID } from '@bingads-webui-campaign/recommendation-core';\r\n\r\nexport const logApi = 'tips-card/index';\r\nexport const TipDismissalExpirationDays = 7;\r\nexport const numberOfTipsAndRecommendations = 9;\r\nexport const numberOfAccountRecommendations = 6;\r\nexport const numberOfCustomerRecommendations = 6;\r\nexport const numberOfCampaignRecommendations = 4;\r\nexport const numberOfTipsShown = 3;\r\n\r\n// mapping of FeatureId to tipIds, sorted by priority\r\nexport const FAC_FEATUREID_TIPID_PRIORITY_MAPPING = {\r\n [FAC_FEATURE_ID.GOOGLE_IMPORT]: [\r\n 1701,\r\n 101,\r\n ],\r\n [FAC_FEATURE_ID.CONVERSION_TRACKING]: [\r\n 801, // conversionTrackingVideo\r\n ],\r\n};\r\n\r\n// mapping of tipIds to FeatureId\r\nexport const FAC_TIPID_FEATUREID_MAPPING = _.reduce(\r\n FAC_FEATUREID_TIPID_PRIORITY_MAPPING,\r\n (mapping, priorities, featureId) =>\r\n _.extend(mapping, ..._.map(priorities, tipId => ({ [tipId]: featureId }))),\r\n {}\r\n);\r\n\r\nexport const instrumentationSchema = {\r\n scenario: [\r\n {\r\n name: 'loadRecommendationOverviewTile',\r\n value: 'LoadRecommendationOverviewTile',\r\n setting: {},\r\n activity: [\r\n {\r\n name: 'loadRecommendationOverviewTile',\r\n value: 'LoadRecommendationOverviewTile',\r\n },\r\n ],\r\n },\r\n ],\r\n};\r\n","import _ from 'underscore';\r\nimport {\r\n RECOMMENDATION_CATEGORIES_IDS,\r\n RECOMMENDATION_TYPES,\r\n normalize,\r\n formatCoupon,\r\n} from '@bingads-webui-campaign/recommendation-core';\r\nimport {\r\n fetchCoupons,\r\n} from '@bingads-webui-campaign/overview-cards-common';\r\nimport {\r\n getCcJsData,\r\n fetchRecommendations,\r\n clearRecommendationsCache,\r\n fetchTips,\r\n fetchMCCOverviewRecommendations,\r\n} from '@bingads-webui-campaign/fluent-page-data';\r\nimport { tipsConfig, tipNames } from '@bingads-webui-campaign/overview-recommendations-config';\r\n\r\nimport {\r\n FAC_FEATUREID_TIPID_PRIORITY_MAPPING,\r\n FAC_TIPID_FEATUREID_MAPPING,\r\n logApi,\r\n numberOfTipsAndRecommendations,\r\n numberOfAccountRecommendations,\r\n numberOfCustomerRecommendations,\r\n numberOfCampaignRecommendations,\r\n numberOfTipsShown,\r\n} from './const';\r\n\r\n// @ts-ignore\r\nconst i18n = window.globalLegacyI18n.get('@bingads-webui/i18n-amd-loader!campaignui/feature/dashboard-cards');\r\n\r\nexport function logAdInsightOppTracking({\r\n oppt,\r\n isClick,\r\n position,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n isMCC,\r\n}) {\r\n instrumentationLegacy.logMessage([instrumentationConstants.LOGCATEGORY.TRACE], instrumentationConstants.LOGLEVEL.INFO, isMCC ? 'MCCOverviewOpportunityTile' : 'OverviewOpportunityTile', {\r\n type: oppt.opportunityType || oppt.type,\r\n id: 0,\r\n campaignId,\r\n isClick,\r\n guid,\r\n position,\r\n typeId: oppt.opportunityTypeId,\r\n });\r\n}\r\n\r\n\r\nexport function logSlideDisplay({\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n reason,\r\n activeItems,\r\n currentSlide,\r\n campaignId,\r\n guid,\r\n isMCC,\r\n}) {\r\n if (activeItems.length !== 0 && activeItems[currentSlide].type && activeItems[currentSlide].type.indexOf('Opportunity') !== -1) {\r\n const opportunityType = activeItems[currentSlide].opportunityType ? activeItems[currentSlide].opportunityType : activeItems[currentSlide].type;\r\n\r\n instrumentationLegacy.logMessage(\r\n [instrumentationConstants.LOGCATEGORY.TRACE],\r\n instrumentationConstants.LOGLEVEL.INFO,\r\n logApi,\r\n `Opportunity displayed. Opportunity Id: ${opportunityType} . Reason: ${reason}.`\r\n );\r\n logAdInsightOppTracking({\r\n oppt: activeItems[currentSlide],\r\n isClick: false,\r\n position: currentSlide + 1,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n isMCC,\r\n });\r\n } else {\r\n const tipId = activeItems.length === 0 ? 0 : activeItems[currentSlide].tipId;\r\n\r\n instrumentationLegacy.logMessage(\r\n [instrumentationConstants.LOGCATEGORY.TRACE],\r\n instrumentationConstants.LOGLEVEL.INFO,\r\n logApi,\r\n `Tip displayed. Tip Id: ${tipId} . Reason: ${reason}.`\r\n );\r\n }\r\n}\r\n\r\n\r\nfunction willDisplayImportRelatedtips({\r\n tips,\r\n}: {\r\n tips: {\r\n isImportRelatedTip: boolean,\r\n }[],\r\n}) {\r\n const importRelatedTips = _.filter(tips, tip => tip.isImportRelatedTip);\r\n\r\n return importRelatedTips.length !== 0;\r\n}\r\n\r\n\r\nfunction getRecommendationCounts({\r\n tips,\r\n recommendations,\r\n}) {\r\n const tipsCount = _.size(tips);\r\n\r\n const recommendationsCount = _.size(recommendations);\r\n let recommendationsToShow = numberOfAccountRecommendations;\r\n\r\n // if we do not have enough tips, show recommendations instead.\r\n if (tipsCount < numberOfTipsShown) {\r\n recommendationsToShow += numberOfTipsShown - tipsCount;\r\n }\r\n\r\n return { recommendationsCount, recommendationsToShow };\r\n}\r\n\r\nfunction getCarouselActiveItems({\r\n navigationLevel,\r\n tips,\r\n recommendations,\r\n permissions,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n isMCC,\r\n overallOptimizationScoreBar,\r\n}: {\r\n navigationLevel: string,\r\n tips: {\r\n tipId: string,\r\n type: string,\r\n tipName: string,\r\n helpType: string,\r\n isImportRelatedTip: boolean,\r\n }[],\r\n recommendations: any,\r\n permissions: any,\r\n instrumentationLegacy: any,\r\n instrumentationConstants: any,\r\n campaignId: number,\r\n guid: string,\r\n isMCC: boolean,\r\n overallOptimizationScoreBar?: object,\r\n}) {\r\n let allItems;\r\n if (navigationLevel === 'account') {\r\n const { recommendationsCount, recommendationsToShow } = getRecommendationCounts({\r\n tips,\r\n recommendations,\r\n });\r\n\r\n if (recommendationsToShow < recommendationsCount) {\r\n allItems = [\r\n ..._.first(recommendations, recommendationsToShow),\r\n ...tips,\r\n ..._.last(recommendations, recommendationsCount - recommendationsToShow),\r\n ];\r\n } else {\r\n allItems = [..._.first(recommendations, recommendationsToShow), ...tips];\r\n }\r\n\r\n if (permissions.IsImportTipsPriorityEnabled) {\r\n const otherThanImportTips = _.filter(allItems, tip => !tip.isImportRelatedTip);\r\n\r\n const importTips = _.filter(allItems, tip => tip.isImportRelatedTip);\r\n\r\n allItems = [\r\n ...importTips,\r\n ...otherThanImportTips,\r\n ];\r\n }\r\n } else {\r\n allItems = recommendations;\r\n }\r\n const numberOfRecommendations = navigationLevel === 'customer' ? numberOfCustomerRecommendations : numberOfCampaignRecommendations;\r\n\r\n const activeItems = _.first(allItems, navigationLevel === 'account' ? numberOfTipsAndRecommendations : numberOfRecommendations);\r\n\r\n const loaded = true;\r\n const currentSlide = 0;\r\n\r\n logSlideDisplay({\r\n reason: 'initial load',\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n activeItems,\r\n currentSlide,\r\n campaignId,\r\n guid,\r\n isMCC,\r\n });\r\n\r\n return {\r\n allItems,\r\n activeItems,\r\n loaded,\r\n currentSlide,\r\n overallOptimizationScoreBar,\r\n };\r\n}\r\n\r\nfunction getCarouselActiveItemsWithCouponDataInternal({\r\n p$Coupons,\r\n serverContext,\r\n tips,\r\n navigationLevel,\r\n recommendations,\r\n permissions,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n isMCC,\r\n overallOptimizationScoreBar,\r\n}) {\r\n return p$Coupons.then((coupons) => {\r\n let newTips = tips;\r\n if (coupons.length) {\r\n const rawCoupon = coupons[0];\r\n const coupon = formatCoupon({\r\n i18n,\r\n coupon: rawCoupon,\r\n currency: serverContext.CurrentAccount.CurrencyCode,\r\n });\r\n const couponFeatureId = rawCoupon.FeatureId.toString();\r\n const tipPriorities = FAC_FEATUREID_TIPID_PRIORITY_MAPPING[couponFeatureId];\r\n\r\n // check if a coupon is valid for tips\r\n const couponEligibleTip = _.chain(tips)\r\n .filter(tip => _.contains(tipPriorities, tip.tipId))\r\n .sortBy(tip => _.indexOf(tipPriorities, tip.tipId))\r\n .first()\r\n .value();\r\n\r\n if (couponEligibleTip) {\r\n const tipWithCoupon = {\r\n ...couponEligibleTip,\r\n coupon,\r\n };\r\n // move tip with coupon to front of tips\r\n newTips = [tipWithCoupon, ..._.reject(tips, tip => tip === couponEligibleTip)];\r\n }\r\n }\r\n\r\n return getCarouselActiveItems({\r\n tips: newTips,\r\n navigationLevel,\r\n recommendations,\r\n permissions,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n isMCC,\r\n overallOptimizationScoreBar,\r\n });\r\n });\r\n}\r\n\r\n// previous handleCouponsThenSetUpCarousel function\r\nfunction getCarouselActiveItemsWithCouponData({\r\n isMCC,\r\n serverContext,\r\n tips,\r\n navigationLevel,\r\n recommendations,\r\n permissions,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n overallOptimizationScoreBar,\r\n}: {\r\n isMCC: boolean,\r\n serverContext: any,\r\n tips: {\r\n tipId: string,\r\n type: string,\r\n tipName: string,\r\n helpType: string,\r\n isImportRelatedTip: boolean,\r\n coupon?: any,\r\n }[],\r\n navigationLevel: string,\r\n recommendations: any,\r\n permissions: any,\r\n instrumentationLegacy: any,\r\n instrumentationConstants: any,\r\n campaignId: number,\r\n guid: string,\r\n overallOptimizationScoreBar?: object,\r\n}) {\r\n const ccJsData = getCcJsData({ serverContext });\r\n if (!isMCC && _.any(tips, tip => _.has(FAC_TIPID_FEATUREID_MAPPING, tip.tipId))) {\r\n const p$Coupons = fetchCoupons({\r\n ccJsData,\r\n });\r\n\r\n return getCarouselActiveItemsWithCouponDataInternal({\r\n p$Coupons,\r\n serverContext,\r\n tips,\r\n navigationLevel,\r\n recommendations,\r\n permissions,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n isMCC,\r\n overallOptimizationScoreBar,\r\n });\r\n }\r\n\r\n return getCarouselActiveItems({\r\n navigationLevel,\r\n tips,\r\n recommendations,\r\n permissions,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n isMCC,\r\n overallOptimizationScoreBar,\r\n });\r\n}\r\n\r\n// previous loadOpportunitiesData function\r\nfunction getRecommendationsFromOpportunitiesData({\r\n opportunitiesData,\r\n}) {\r\n // TODO: [yaoyao] do we need this in new overview page?\r\n // dataFetched = true;\r\n const categories = _.invert(RECOMMENDATION_CATEGORIES_IDS);\r\n\r\n let recommendations = _.map(normalize(opportunitiesData) as {\r\n category: string,\r\n type: string,\r\n }[], oppt => ({\r\n ...oppt,\r\n category: categories[oppt.category],\r\n }));\r\n\r\n recommendations = _.compact(recommendations);\r\n const accountRecommendationIdsToShow = _.chain(recommendations)\r\n .first(numberOfAccountRecommendations)\r\n // eslint-disable-next-line no-confusing-arrow\r\n .map(recommendation => recommendation.type)\r\n .value();\r\n const overallOptimizationScoreBar = opportunitiesData.OverallOptimizationScoreBar;\r\n\r\n return {\r\n recommendations,\r\n accountRecommendationIdsToShow,\r\n overallOptimizationScoreBar,\r\n };\r\n}\r\n\r\n\r\nfunction willDisplayAccountRecommendation({\r\n type,\r\n accountRecommendationIdsToShow,\r\n}) {\r\n if (_.isArray(type)) {\r\n return !_.chain(accountRecommendationIdsToShow).intersection(type).isEmpty().value();\r\n }\r\n\r\n return _.contains(accountRecommendationIdsToShow, type);\r\n}\r\n\r\n// Filter tips based on language and market and recommendations\r\n\r\nfunction shouldShowTip({\r\n tipName,\r\n helpType,\r\n permissions,\r\n serverContext,\r\n accountRecommendationIdsToShow,\r\n}) {\r\n const market = serverContext.CurrentUser.Market;\r\n const language = serverContext.CurrentUser.Language;\r\n\r\n if ((tipName === tipNames.calloutsMktg || tipName === tipNames.calloutsHelp) && market === 'CN') {\r\n return false;\r\n }\r\n\r\n if (tipName === tipNames.dsa && (market !== 'US' && market !== 'GB')) {\r\n return false;\r\n }\r\n\r\n const autoBidMarket = ['AU', 'CA', 'CH', 'DE', 'ES', 'FR', 'GB', 'IN', 'IT', 'NL', 'SE', 'US'];\r\n\r\n if ((tipName === tipNames.autoBidHelp || tipName === tipNames.autoBidMktg) && _.indexOf(autoBidMarket, market) === -1) {\r\n return false;\r\n }\r\n\r\n if ((tipName === tipNames.autoBidMktg || helpType === 'video') && language !== 'EN') {\r\n return false;\r\n }\r\n\r\n if (helpType === 'tour') {\r\n return false;\r\n }\r\n\r\n if ((tipName === tipNames.importHelp || tipName === tipNames.importVideo) &&\r\n willDisplayAccountRecommendation({ type: RECOMMENDATION_TYPES.GOOGLE_IMPORT, accountRecommendationIdsToShow }) &&\r\n !permissions.IsImportTipsPriorityEnabled) {\r\n return false;\r\n }\r\n\r\n if (tipName === tipNames.broadMatchVideo &&\r\n willDisplayAccountRecommendation({ type: RECOMMENDATION_TYPES.BROAD_MATCH_MODIFIER_KEYWORD, accountRecommendationIdsToShow })) {\r\n return false;\r\n }\r\n\r\n if ((tipName === tipNames.calloutsMktg || tipName === tipNames.calloutsHelp) &&\r\n willDisplayAccountRecommendation({ type: RECOMMENDATION_TYPES.CALLOUT, accountRecommendationIdsToShow })) {\r\n return false;\r\n }\r\n\r\n if (tipName === tipNames.dsa &&\r\n willDisplayAccountRecommendation({ type: RECOMMENDATION_TYPES.DYNAMIC_SEARCH_ADS, accountRecommendationIdsToShow })) {\r\n return false;\r\n }\r\n\r\n if ((tipName === tipNames.autoBidHelp || tipName === tipNames.autoBidMktg) &&\r\n willDisplayAccountRecommendation({\r\n type: [\r\n RECOMMENDATION_TYPES.AUTOBIDDING_ENHANCEDCPC,\r\n RECOMMENDATION_TYPES.AUTOBIDDING_MAXCLICKS,\r\n RECOMMENDATION_TYPES.AUTOBIDDING_MAXCONVERSIONS,\r\n RECOMMENDATION_TYPES.AUTOBIDDING_TARGETCPA,\r\n ],\r\n accountRecommendationIdsToShow,\r\n })) {\r\n return false;\r\n }\r\n\r\n if (tipName === tipNames.broadMatchHelp &&\r\n willDisplayAccountRecommendation({ type: RECOMMENDATION_TYPES.BROAD_MATCH_KEYWORD, accountRecommendationIdsToShow })) {\r\n return false;\r\n }\r\n\r\n if ((tipName === tipNames.sitelinksMktg || tipName === tipNames.sitelinksHelp) &&\r\n willDisplayAccountRecommendation({ type: RECOMMENDATION_TYPES.SITE_LINK, accountRecommendationIdsToShow })) {\r\n return false;\r\n }\r\n\r\n if (tipName === tipNames.ScheduledImportHelp &&\r\n willDisplayAccountRecommendation({ type: RECOMMENDATION_TYPES.GOOGLE_IMPORT_SCHEDULED, accountRecommendationIdsToShow })) {\r\n return false;\r\n }\r\n\r\n return true;\r\n}\r\n\r\n\r\nfunction loadTipsData({\r\n tipList,\r\n recommendations,\r\n permissions,\r\n serverContext,\r\n accountRecommendationIdsToShow,\r\n}): {\r\n tips: {\r\n tipId: string,\r\n type: string,\r\n tipName: string,\r\n helpType: string,\r\n isImportRelatedTip: boolean,\r\n }[],\r\n recommendations: any\r\n} {\r\n const tips = _.chain(tipList)\r\n .map((tip) => {\r\n if (tip == null) {\r\n return null;\r\n }\r\n const { TipId } = tip;\r\n const tipConfig = tipsConfig[TipId];\r\n\r\n if (tipConfig) {\r\n return _.extend(\r\n tipConfig,\r\n {\r\n tipId: TipId,\r\n type: 'Tip',\r\n }\r\n );\r\n }\r\n\r\n return null;\r\n })\r\n .compact()\r\n .filter(({ tipName, helpType }) => shouldShowTip({\r\n tipName,\r\n helpType,\r\n permissions,\r\n serverContext,\r\n accountRecommendationIdsToShow,\r\n }))\r\n .shuffle()\r\n .value();\r\n\r\n let newRecommendations = recommendations;\r\n if (permissions.IsImportTipsPriorityEnabled && willDisplayImportRelatedtips({ tips })) {\r\n // filter out import related recommendations\r\n // if we are showing import related tips.\r\n newRecommendations = _.filter(recommendations, recommendation => recommendation !== RECOMMENDATION_TYPES.GOOGLE_IMPORT);\r\n }\r\n\r\n return {\r\n tips,\r\n recommendations: newRecommendations,\r\n };\r\n}\r\n\r\n\r\n// load tips data if we have more tips else load opportunities.\r\nfunction loadTipAndOpportunities({\r\n p$Tips,\r\n opportunitiesData,\r\n permissions,\r\n serverContext,\r\n isMCC,\r\n navigationLevel,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n}) {\r\n if (p$Tips) {\r\n return p$Tips.then((tipList) => {\r\n // need to load recommendations first to filter tips based on available opportunities\r\n const {\r\n recommendations: recommendationsOriginal,\r\n accountRecommendationIdsToShow,\r\n overallOptimizationScoreBar,\r\n } = getRecommendationsFromOpportunitiesData({\r\n opportunitiesData,\r\n });\r\n const {\r\n tips,\r\n recommendations,\r\n } = loadTipsData({\r\n tipList,\r\n recommendations: recommendationsOriginal,\r\n permissions,\r\n serverContext,\r\n accountRecommendationIdsToShow,\r\n });\r\n return getCarouselActiveItemsWithCouponData({\r\n isMCC,\r\n serverContext,\r\n tips,\r\n navigationLevel,\r\n recommendations,\r\n permissions,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n overallOptimizationScoreBar,\r\n });\r\n });\r\n }\r\n const {\r\n recommendations,\r\n overallOptimizationScoreBar,\r\n } = getRecommendationsFromOpportunitiesData({\r\n opportunitiesData,\r\n });\r\n return getCarouselActiveItemsWithCouponData({\r\n isMCC,\r\n serverContext,\r\n tips: [],\r\n navigationLevel,\r\n recommendations,\r\n permissions,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n overallOptimizationScoreBar,\r\n });\r\n}\r\n\r\n\r\nfunction getRecommendationsData({\r\n entitySet,\r\n navigationLevel,\r\n featureInstrumentation,\r\n legacyConfig,\r\n campaignType,\r\n serverContext,\r\n jsdata,\r\n permissions,\r\n cid,\r\n aid,\r\n campaignId,\r\n}) {\r\n if (navigationLevel === 'customer') {\r\n return fetchMCCOverviewRecommendations({\r\n entitySet,\r\n jsdata,\r\n permissions,\r\n });\r\n }\r\n const ccJsData = getCcJsData({ serverContext });\r\n\r\n return fetchRecommendations({\r\n navigationLevel,\r\n featureInstrumentation,\r\n legacyConfig,\r\n permissions,\r\n serverContext,\r\n campaignType,\r\n ccJsData,\r\n cid,\r\n aid,\r\n campaignId,\r\n });\r\n}\r\n\r\n// previous loadOpportunities function\r\n// the return value is a promise from getCarouselActiveItems with a format:\r\n// {\r\n// allItems,\r\n// activeItems,\r\n// loaded,\r\n// currentSlide,\r\n// }\r\n// plus a new key overallOptimizationScoreBar\r\nexport function getCardData({\r\n entitySet,\r\n navigationLevel,\r\n featureInstrumentation,\r\n legacyConfig,\r\n campaignType,\r\n serverContext,\r\n jsdata,\r\n permissions,\r\n cid,\r\n aid,\r\n campaignId,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n isMCC,\r\n guid,\r\n}) {\r\n let p$Tips;\r\n\r\n if (navigationLevel === 'account') {\r\n p$Tips = fetchTips({\r\n aid,\r\n cid,\r\n });\r\n }\r\n\r\n return getRecommendationsData({\r\n entitySet,\r\n navigationLevel,\r\n featureInstrumentation,\r\n legacyConfig,\r\n campaignType,\r\n serverContext,\r\n jsdata,\r\n permissions,\r\n cid,\r\n aid,\r\n campaignId,\r\n }).then((response) => {\r\n const opportunitiesData = navigationLevel === 'customer' ? { value: response.Recommendations?.value } : response.data;\r\n\r\n return loadTipAndOpportunities({\r\n p$Tips,\r\n opportunitiesData,\r\n permissions,\r\n serverContext,\r\n isMCC,\r\n navigationLevel,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n });\r\n }).catch((response) => {\r\n // no need to log ajax error here.\r\n if (response.status === undefined) {\r\n instrumentationLegacy.logMessage([instrumentationConstants.LOGCATEGORY.ERROR], instrumentationConstants.LOGLEVEL.INFO, logApi, response.stack);\r\n }\r\n\r\n // If there are exceptions load tips\r\n return loadTipAndOpportunities({\r\n p$Tips,\r\n opportunitiesData: { values: [] },\r\n permissions,\r\n serverContext,\r\n isMCC,\r\n navigationLevel,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n });\r\n })\r\n .finally(() => clearRecommendationsCache());\r\n}\r\n","import React from 'react';\r\n\r\nexport const EmptyCarouselContent = ({ i18n, consultationLink } : {\r\n i18n: {\r\n getString: (key: string) => string;\r\n };\r\n consultationLink: string;\r\n}) => (\r\n
\r\n
\r\n
\r\n
\r\n
\r\n

{i18n.getString(_TL_('Keep up the good work!'))}

\r\n
\r\n

\r\n {i18n.getString(_TL_('At this current time, there are no more recommendations here for you to utilize. In the meantime, we’d be happy to set you up with a consultant to further optimize your campaigns.'))}\r\n

\r\n
\r\n
\r\n \r\n \r\n {i18n.getString(_TL_('Learn more'))}\r\n \r\n \r\n
\r\n
\r\n
\r\n);\r\n","import React, { useMemo } from 'react';\r\nimport { Popover, PopoverTrigger, PopoverSurface, Text } from '@fluentui/react-components';\r\n\r\nimport { ICoupon } from '../types';\r\n\r\nexport const CouponFlag = ({ coupon, i18n, rightAlign } : {\r\n coupon: ICoupon;\r\n i18n: {\r\n getString: (key: string, data?: object) => string;\r\n };\r\n rightAlign: boolean;\r\n}) => {\r\n const trigger = useMemo(() => (\r\n
\r\n \r\n \r\n \r\n \r\n {i18n.getString(_TL_('{{value}} offer'), { value: coupon.value.toString() })}\r\n \r\n \r\n \r\n
\r\n ), [coupon.value, i18n, rightAlign]);\r\n\r\n const flyout = useMemo(() => (\r\n
\r\n
\r\n \r\n {i18n.getString(_TL_('Get {{value}} when you {{tagMessage}}.'), coupon)}\r\n \r\n \r\n {i18n.getString(_TL_('This is a limited-time offer. Please act soon!'))}\r\n \r\n
\r\n
\r\n ), [coupon, i18n]);\r\n\r\n return (\r\n \r\n \r\n {trigger}\r\n \r\n \r\n {flyout}\r\n \r\n \r\n );\r\n};\r\n","import _ from 'underscore';\r\nimport React, { useCallback, useMemo, useRef } from 'react';\r\nimport classNames from 'classnames';\r\nimport Promise from 'bluebird';\r\nimport { Button } from '@fluentui/react-components';\r\n\r\nimport { CouponFlag } from './coupon-flag';\r\nimport { ITip } from '../types';\r\nimport { logApi, TipDismissalExpirationDays } from '../const';\r\n\r\nexport const TipItem = ({\r\n item, i18n, walkme, jsdata, instrumentationConstants, instrumentationLegacy, logSlideDisplay, removeTipLocally,\r\n}: {\r\n item: ITip;\r\n i18n: {\r\n getString: (key: string) => string;\r\n };\r\n walkme: any;\r\n jsdata: any;\r\n instrumentationConstants: any,\r\n instrumentationLegacy: any,\r\n logSlideDisplay: ({ reason }: { reason: string }) => void;\r\n removeTipLocally: (tipId: string) => void;\r\n}) => {\r\n const videoRef = useRef(null);\r\n const clickTip = useCallback(() => {\r\n const { tipId, helpType, helpLink } = item;\r\n\r\n if (helpType === 'tour') {\r\n if (window.WalkMeAPI && _.isFunction(window.WalkMeAPI.startWalkthruById)) {\r\n window.WalkMeAPI.startWalkthruById(helpLink);\r\n } else {\r\n walkme.whenLoaded().then(() => {\r\n window.WalkMeAPI.startWalkthruById(helpLink);\r\n });\r\n }\r\n } else if (helpType === 'video') {\r\n // Trigger video popup.\r\n // ApexVideoHandler removes all other event handler before attaching event handler for video popup. It also stops click event bubbling up.\r\n // So, we are using hidden button instead of on click button on the tip.\r\n videoRef.current.click();\r\n }\r\n\r\n instrumentationLegacy.logMessage([instrumentationConstants.LOGCATEGORY.TRACE], instrumentationConstants.LOGLEVEL.INFO, logApi, `Learn more clicked. Tip Id: ${tipId}`);\r\n\r\n jsdata.Tip.update(tipId, {\r\n TipId: tipId,\r\n Status: 'Clicked',\r\n }, {\r\n afterUpdate: () => Promise.resolve({ TipId: tipId }),\r\n });\r\n }, [instrumentationConstants.LOGCATEGORY.TRACE, instrumentationConstants.LOGLEVEL.INFO, instrumentationLegacy, item, jsdata.Tip, walkme]);\r\n\r\n const dismissTip = useCallback(() => {\r\n const { tipId, helpType, helpLink } = item;\r\n\r\n instrumentationLegacy.logMessage([instrumentationConstants.LOGCATEGORY.TRACE], instrumentationConstants.LOGLEVEL.INFO, logApi, `Dismiss clicked. Tip Id: ${tipId}`);\r\n\r\n removeTipLocally(tipId);\r\n\r\n logSlideDisplay({ reason: 'dismissed current' });\r\n\r\n const expirationTime = new Date();\r\n\r\n expirationTime.setDate(expirationTime.getDate() + TipDismissalExpirationDays);\r\n\r\n jsdata.Tip.update(tipId, {\r\n TipId: tipId,\r\n Status: 'Dismissed',\r\n DismissalExpirationDateTime: expirationTime,\r\n }, {\r\n afterUpdate: () => Promise.resolve({ TipId: tipId }),\r\n });\r\n }, [instrumentationConstants, instrumentationLegacy, item, jsdata.Tip, logSlideDisplay, removeTipLocally]);\r\n\r\n const couponFlag = useMemo(() => {\r\n if (item.coupon) {\r\n return ;\r\n }\r\n return null;\r\n }, [i18n, item]);\r\n\r\n return (\r\n <>\r\n
\r\n {couponFlag}\r\n
\r\n
\r\n
\r\n
\r\n
{item.title}
\r\n
\r\n

{item.description}

\r\n
\r\n
\r\n
\r\n
\r\n {item.helpType === 'side_pane' && (\r\n \r\n {/* @ts-ignore */}\r\n \r\n \r\n )}\r\n {item.helpType === 'new_page' && (\r\n \r\n \r\n {i18n.getString(_TL_('Learn more'))}\r\n \r\n \r\n )}\r\n {item.helpType === 'video' && (\r\n \r\n \r\n {/* @ts-ignore */}\r\n
\r\n \r\n )}\r\n {item.helpType === 'tour' && (\r\n \r\n \r\n \r\n )}\r\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\r\n \r\n {i18n.getString(_TL_('Dismiss'))}\r\n \r\n
\r\n \r\n );\r\n};\r\n","import _ from 'underscore';\r\nimport React from 'react';\r\nimport {\r\n getSummaryCardModel,\r\n} from '@bingads-webui-campaign/recommendation-core';\r\nimport { SummaryCard, SummaryFooter } from '@bingads-webui-campaign-react/recommendation-summary-view';\r\n\r\nimport { TipItem } from './tip-item';\r\nimport { isTip, ITip, TActiveItem } from '../types';\r\n\r\n// @ts-ignore\r\nconst legacyI18n = window.globalLegacyI18n.get('@bingads-webui/i18n-amd-loader!campaignui/feature/dashboard-cards');\r\n\r\nfunction combineText(textPart1, textPart2) {\r\n if (!textPart1 || !textPart2) {\r\n return '';\r\n }\r\n\r\n // If text1 does not end with any of separators [. ? !], use a period and space between text1 and text2 while stitching.\r\n // If text1 ends with one of those separators, use only a space.\r\n if ('.?!'.indexOf(textPart1.slice(-1)) > -1) {\r\n return `${textPart1} ${textPart2}`;\r\n }\r\n return `${textPart1}. ${textPart2}`;\r\n}\r\n\r\nexport const CarouselItem = ({\r\n item,\r\n i18n,\r\n i18nErrors,\r\n serverContext,\r\n permissions,\r\n scope,\r\n isMCC,\r\n currentActivity,\r\n logOpportunityEvent,\r\n preferencesService,\r\n locationMap,\r\n overallOptimizationScoreBar,\r\n viewRecommendation,\r\n legacyConfig,\r\n walkme,\r\n jsdata,\r\n instrumentationConstants,\r\n instrumentationLegacy,\r\n logSlideDisplay,\r\n adDisplayUrlService,\r\n removeTipLocally,\r\n} : {\r\n item: TActiveItem;\r\n i18n: {\r\n getString: (key: string) => string;\r\n };\r\n i18nErrors: object;\r\n serverContext: any;\r\n permissions: any;\r\n scope: {\r\n levelAt: string;\r\n };\r\n isMCC: boolean;\r\n currentActivity: any;\r\n logOpportunityEvent: any;\r\n preferencesService: any;\r\n locationMap: any;\r\n overallOptimizationScoreBar: object;\r\n viewRecommendation: Function;\r\n legacyConfig: any;\r\n walkme: any;\r\n jsdata: any;\r\n instrumentationConstants: any,\r\n instrumentationLegacy: any,\r\n logSlideDisplay: ({ reason }: { reason: string }) => void;\r\n adDisplayUrlService: any;\r\n removeTipLocally: (tipId: string) => void;\r\n}) => {\r\n if (!isTip(item)) {\r\n const summaryCardModel = getSummaryCardModel(_.extend({}, item, {\r\n i18n: legacyI18n,\r\n newI18n: i18n,\r\n errI18n: i18nErrors,\r\n currency: serverContext.CurrentAccount.CurrencyCode,\r\n scope: scope.levelAt,\r\n permissions,\r\n combineText,\r\n adDisplayUrlService,\r\n isMCC,\r\n currentActivity,\r\n }));\r\n\r\n const summaryCardOptions = _.extend({\r\n key: item.type,\r\n recommendationsCount: item.recommendationsCount,\r\n opportunityCount: item.opportunityCount,\r\n optimizationScore: item.optimizationScore,\r\n version: item.version,\r\n isInlineView: false,\r\n i18n: legacyI18n,\r\n newI18n: i18n,\r\n isMCC,\r\n permissions,\r\n preferencesService,\r\n locationMap,\r\n applyAllCallback: _.noop,\r\n scope,\r\n isOverviewPage: true,\r\n isOptimizationScoreOn: permissions.dynamic.OptimizationScore && !isMCC,\r\n overallOptimizationScoreBar,\r\n category: item.category,\r\n logOpportunityEvent,\r\n viewDetails: viewRecommendation,\r\n currentActivity,\r\n appConfig: legacyConfig,\r\n }, summaryCardModel);\r\n\r\n return (\r\n <>\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n );\r\n};\r\n","declare global {\r\n interface Window {\r\n WalkMeAPI: {\r\n startWalkthruById: (id: string) => void;\r\n };\r\n }\r\n}\r\nexport interface IOverviewRecommendationsCardProps {\r\n i18n: {\r\n getString: (key: string, params?: any) => string;\r\n };\r\n perfMarkerUtils: {\r\n willFetchData: Function;\r\n willRender: Function;\r\n done: Function;\r\n };\r\n serverContext: {\r\n CurrentLocale: string;\r\n };\r\n permissions: any;\r\n navigationLevel: string;\r\n campaignType: number;\r\n legacyConfig: any;\r\n jsdata: object;\r\n featureInstrumentation: {\r\n addScenario: (schema: object) => void;\r\n loadRecommendationOverviewTile?: {\r\n create: () => {\r\n loadRecommendationOverviewTile: {\r\n create: () => {\r\n trace: (params: object, api: string) => void;\r\n };\r\n };\r\n };\r\n };\r\n },\r\n instrumentationConstants: any,\r\n instrumentationLegacy: any,\r\n constructOptions: ({\r\n navigationLevel,\r\n campaignType,\r\n }) => {\r\n entitySet: object,\r\n navigationLevel: string,\r\n };\r\n i18nErrors: object;\r\n preferencesService: any;\r\n locationMap: any;\r\n legacyRouter: any;\r\n walkme: any;\r\n adDisplayUrlService: any;\r\n}\r\n\r\nexport interface ICoupon {\r\n rawData: {\r\n FeatureId: string,\r\n },\r\n value: number,\r\n tagMessage: string,\r\n}\r\n\r\nexport interface ITip {\r\n tipId: string,\r\n type: string,\r\n tipName: string,\r\n helpType: string,\r\n isImportRelatedTip: boolean,\r\n imgClass: string,\r\n title: string,\r\n description: string,\r\n helpLink: string,\r\n coupon?: ICoupon,\r\n}\r\n\r\nexport interface IRecommendation {\r\n category: string,\r\n type: string,\r\n recommendationsCount: number,\r\n opportunityCount: number,\r\n optimizationScore: number,\r\n version: number,\r\n helpType?: string,\r\n tipId?: string,\r\n}\r\n\r\nexport type TActiveItem = ITip | IRecommendation;\r\n\r\nexport function isTip(item: TActiveItem): item is ITip {\r\n return (item as ITip).type === 'Tip';\r\n}\r\n\r\nexport interface IScopeContext {\r\n scope: {\r\n save: Function;\r\n values: {\r\n aid: number;\r\n cid: number;\r\n uid: number;\r\n campaignId: number;\r\n }\r\n };\r\n}\r\n","import React, { useCallback } from 'react';\r\nimport classNames from 'classnames';\r\nimport { Tooltip, Button, makeStyles, shorthands } from '@fluentui/react-components';\r\nimport { ChevronLeftRegular, ChevronRightRegular } from '@fluentui/react-icons';\r\n\r\nimport { EmptyCarouselContent } from './empty-content';\r\nimport { CarouselItem } from './carousel-item';\r\nimport { TActiveItem } from '../types';\r\n\r\nexport const useStyles = makeStyles({\r\n carouselFooter: {\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n alignItems: 'center',\r\n ...shorthands.gap('5px'),\r\n },\r\n});\r\n\r\ninterface ICardContentProps {\r\n activeItems: TActiveItem[];\r\n currentSlide: number;\r\n setCurrentSlide: (slide: number) => void;\r\n i18n: {\r\n getString: (key: string, params?: any) => string;\r\n };\r\n consultationLink: string;\r\n i18nErrors: object;\r\n serverContext: any;\r\n permissions: any;\r\n scope: {\r\n levelAt: string;\r\n };\r\n isMCC: boolean;\r\n currentActivity: any;\r\n logOpportunityEvent: any;\r\n preferencesService: any;\r\n locationMap: any;\r\n overallOptimizationScoreBar: object;\r\n viewRecommendation: Function;\r\n legacyConfig: any;\r\n walkme: any;\r\n jsdata: any;\r\n instrumentationConstants: any,\r\n instrumentationLegacy: any,\r\n logSlideDisplay: ({ reason }: { reason: string }) => void;\r\n adDisplayUrlService: any;\r\n removeTipLocally: (tipId: string) => void;\r\n}\r\n\r\nexport const CardContent = ({\r\n activeItems,\r\n currentSlide,\r\n setCurrentSlide,\r\n i18n,\r\n consultationLink,\r\n i18nErrors,\r\n serverContext,\r\n permissions,\r\n scope,\r\n isMCC,\r\n currentActivity,\r\n logOpportunityEvent,\r\n preferencesService,\r\n locationMap,\r\n overallOptimizationScoreBar,\r\n viewRecommendation,\r\n legacyConfig,\r\n walkme,\r\n jsdata,\r\n instrumentationConstants,\r\n instrumentationLegacy,\r\n logSlideDisplay,\r\n adDisplayUrlService,\r\n removeTipLocally,\r\n}: ICardContentProps) => {\r\n const classes = useStyles();\r\n const haveVideo = activeItems.some(item => item.helpType === 'video');\r\n const size = activeItems?.length || 0;\r\n const goPrev = useCallback(() => setCurrentSlide(currentSlide > 0 ? currentSlide - 1 : size - 1), [currentSlide, setCurrentSlide, size]);\r\n const goNext = useCallback(() => setCurrentSlide((currentSlide + 1) % size), [currentSlide, setCurrentSlide, size]);\r\n\r\n return (\r\n
\r\n
    \r\n {activeItems?.length > 0 ? (\r\n activeItems.map((item, i) => (\r\n
  • \r\n \r\n
  • \r\n ))\r\n ) : (\r\n \r\n )}\r\n
\r\n\r\n {haveVideo && }\r\n\r\n {activeItems?.length > 1 && (\r\n
\r\n \r\n {i18n.getString(_TL_('{{itemIndex}} of {{itemCount}}'), { itemIndex: currentSlide + 1, itemCount: activeItems.length })}\r\n \r\n \r\n
\r\n )}\r\n\r\n {/* TODO: a help link for customer page, this is not in scope for now */}\r\n {/* */}\r\n
\r\n );\r\n};\r\n","import React from 'react';\r\nimport { Shimmer, ShimmerElementType } from '@fluentui/react';\r\n\r\nconst imageElement = [\r\n { type: ShimmerElementType.gap, width: '38%' },\r\n { type: ShimmerElementType.line, height: 100, width: '24%' },\r\n { type: ShimmerElementType.gap, width: '38%' },\r\n\r\n];\r\nconst rowElement = [{ type: ShimmerElementType.line, height: 30 }];\r\nconst buttonElement = [\r\n { type: ShimmerElementType.line, height: 30, width: '20%' },\r\n { type: ShimmerElementType.gap, width: '5%' },\r\n { type: ShimmerElementType.line, height: 30, width: '20%' },\r\n { type: ShimmerElementType.gap, width: '55%' },\r\n];\r\n\r\nexport function ShimmerCard() {\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n","import _ from 'underscore';\r\nimport React, { useMemo, useContext, useCallback, useState, useEffect } from 'react';\r\nimport { ScopeContext } from '@bingads-webui-react/scope-service';\r\nimport { generateGuid } from '@bingads-webui-universal/primitive-utilities';\r\nimport { getLocalizedSupportLink } from '@bingads-webui-campaign/overview-cards-common';\r\nimport { getScope } from '@bingads-webui-campaign/fluent-page-data';\r\nimport {\r\n ADINSIGHT_LOG_API_NAME,\r\n RECOMMENDATION_IDS,\r\n getChannel,\r\n} from '@bingads-webui-campaign/recommendation-core';\r\nimport { withDelayedStyles } from '@bingads-webui-campaign-react/common-utils';\r\nimport { getTipCardFluentV2Style } from '@bingads-webui-campaign-react/overview-card-styles';\r\n\r\nimport { IOverviewRecommendationsCardProps, IScopeContext } from './types';\r\nimport { useRecommendationsData } from './use-recommendations-data';\r\nimport { CardContent } from './components/card-content';\r\nimport { instrumentationSchema, logApi, numberOfTipsAndRecommendations } from './const';\r\nimport { logAdInsightOppTracking, logSlideDisplay as log } from './card-data';\r\nimport { ShimmerCard } from './components/shimmer-card';\r\n\r\nconst getDefaultStyles = (_, { palette = {} }) => ({\r\n '@global': Object.assign(getTipCardFluentV2Style(palette)),\r\n});\r\n\r\nexport function OverviewRecommendationsCardInternal({\r\n i18n,\r\n perfMarkerUtils,\r\n navigationLevel,\r\n campaignType,\r\n serverContext,\r\n permissions,\r\n legacyConfig,\r\n jsdata,\r\n featureInstrumentation,\r\n instrumentationConstants,\r\n instrumentationLegacy,\r\n constructOptions,\r\n i18nErrors,\r\n preferencesService,\r\n locationMap,\r\n legacyRouter,\r\n walkme,\r\n adDisplayUrlService,\r\n}: IOverviewRecommendationsCardProps) {\r\n const isMCC = navigationLevel === 'customer';\r\n const {\r\n entitySet,\r\n navigationLevel: navigationLevelOption,\r\n } = constructOptions({\r\n navigationLevel,\r\n campaignType,\r\n });\r\n const [activeItemsInternal, setActiveItemsInternal] = useState([]);\r\n const [allItemsInternal, setAllItemsInternal] = useState([]);\r\n const [currentSlide, setCurrentSlide] = useState(0);\r\n const { scope } = useContext(ScopeContext) as IScopeContext;\r\n const { aid, cid, campaignId } = scope?.values;\r\n const guid = useMemo(() => generateGuid(), []);\r\n\r\n // we have internal state to allow user to dismiss tips\r\n // so when we reload data due to filter change, we need to reset the state\r\n const onSuccess = useCallback(() => {\r\n setActiveItemsInternal([]);\r\n setAllItemsInternal([]);\r\n setCurrentSlide(0);\r\n }, []);\r\n const { data, isLoading } = useRecommendationsData({\r\n entitySet,\r\n navigationLevel: navigationLevelOption,\r\n featureInstrumentation,\r\n legacyConfig,\r\n campaignType,\r\n serverContext,\r\n jsdata,\r\n permissions,\r\n cid,\r\n aid,\r\n campaignId,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n isMCC,\r\n guid,\r\n willFetchData: perfMarkerUtils.willFetchData,\r\n onSuccess,\r\n });\r\n const { activeItems, allItems } = data || { activeItems: [], allItems: [] };\r\n const { consultationLink } = getLocalizedSupportLink({\r\n Culture: serverContext.CurrentLocale,\r\n });\r\n const currentActivity = useMemo(() => {\r\n featureInstrumentation.addScenario(instrumentationSchema);\r\n const currentScenario = featureInstrumentation.loadRecommendationOverviewTile.create();\r\n return currentScenario.loadRecommendationOverviewTile.create();\r\n }, [featureInstrumentation]);\r\n const recommendationScope = getScope({\r\n navigationLevel: navigationLevelOption,\r\n legacyConfig,\r\n cid,\r\n aid,\r\n campaignId,\r\n });\r\n const viewRecommendation = useCallback((opportunityType, category) => () => {\r\n if (isMCC) {\r\n legacyConfig.set('recsrc', 'bingadsweb[mccoverviewpage]');\r\n } else {\r\n legacyConfig.set('recsrc', 'Opportunities[Overview]');\r\n }\r\n\r\n instrumentationLegacy.logMessage([instrumentationConstants.LOGCATEGORY.TRACE], instrumentationConstants.LOGLEVEL.INFO, logApi, `Opportunity clicked. Opportunity Id: ${opportunityType}`);\r\n logAdInsightOppTracking({\r\n oppt: opportunityType === 'All' ? { opportunityType: 'All' } : activeItemsInternal[currentSlide],\r\n isClick: true,\r\n position: currentSlide + 1,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n campaignId,\r\n guid,\r\n isMCC,\r\n });\r\n\r\n if (navigationLevelOption === 'account') {\r\n legacyRouter.navigateToRoute('recommendation_details', _.extend({\r\n type: opportunityType,\r\n }, category ? { category } : undefined));\r\n } else if (navigationLevelOption === 'customer') {\r\n legacyRouter.navigateToRoute('mcc_recommendation_details', _.extend({\r\n type: opportunityType,\r\n }, category ? { category } : undefined));\r\n } else {\r\n legacyRouter.navigateToRoute('campaign_recommendation_details', _.extend({\r\n campaign_id: campaignId,\r\n type: opportunityType,\r\n }, category ? { category } : undefined));\r\n }\r\n }, [activeItemsInternal, campaignId, currentSlide, guid, instrumentationConstants,\r\n instrumentationLegacy, isMCC, legacyConfig, legacyRouter, navigationLevelOption]);\r\n\r\n const logOpportunityEvent = useCallback(({\r\n type = null,\r\n action,\r\n position = null,\r\n input = null,\r\n context = null,\r\n }) => {\r\n const api = ADINSIGHT_LOG_API_NAME.RECOMMENDATION;\r\n\r\n currentActivity.trace({\r\n type: type || '',\r\n typeId: RECOMMENDATION_IDS[type],\r\n action,\r\n input,\r\n campaignId: recommendationScope.campaignId,\r\n channel: getChannel(type, false, isMCC),\r\n position,\r\n guid,\r\n context: JSON.stringify(context),\r\n }, api);\r\n }, [currentActivity, guid, isMCC, recommendationScope.campaignId]);\r\n const logSlideDisplay = useCallback((reason) => {\r\n log({\r\n reason,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n activeItems: activeItemsInternal,\r\n currentSlide,\r\n campaignId,\r\n guid,\r\n isMCC,\r\n });\r\n }, [activeItemsInternal, campaignId, currentSlide, guid, instrumentationConstants, instrumentationLegacy, isMCC]);\r\n\r\n useEffect(() => {\r\n if (!isLoading && _.isEmpty(activeItemsInternal)) {\r\n perfMarkerUtils.willRender();\r\n setActiveItemsInternal(activeItems);\r\n setAllItemsInternal(allItems);\r\n perfMarkerUtils.done();\r\n }\r\n }, [activeItems, activeItemsInternal, allItems, isLoading, perfMarkerUtils]);\r\n\r\n const removeTipLocally = useCallback((tipId) => {\r\n const index = _.findIndex(allItemsInternal, tip => tip.tipId === tipId);\r\n\r\n let newAllItemsInternal = allItemsInternal;\r\n if (index >= 0 && index < allItemsInternal.length) {\r\n newAllItemsInternal = [\r\n ...allItemsInternal.slice(0, index),\r\n ...allItemsInternal.slice(index + 1),\r\n ];\r\n setAllItemsInternal(newAllItemsInternal);\r\n } else {\r\n instrumentationLegacy.logMessage(\r\n [instrumentationConstants.LOGCATEGORY.ERROR],\r\n instrumentationConstants.LOGLEVEL.INFO,\r\n logApi,\r\n `Dismiss tip not found. Tip Id: ${tipId}`\r\n );\r\n }\r\n const newActiveItemsInternal = _.first(newAllItemsInternal, numberOfTipsAndRecommendations);\r\n setActiveItemsInternal(newActiveItemsInternal);\r\n if (currentSlide >= newActiveItemsInternal.length) {\r\n setCurrentSlide(newActiveItemsInternal.length - 1);\r\n }\r\n }, [allItemsInternal, currentSlide, instrumentationConstants, instrumentationLegacy]);\r\n\r\n if (isLoading) {\r\n return ;\r\n }\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n}\r\n\r\nexport const OverviewRecommendationsCard = withDelayedStyles(OverviewRecommendationsCardInternal, getDefaultStyles);\r\n","import { useCallback, useMemo } from 'react';\r\nimport useSwr from 'swr';\r\nimport { getCardData } from './card-data';\r\n\r\nexport interface IUseRecommendationsDataProps {\r\n entitySet: object;\r\n legacyConfig: object;\r\n jsdata: object;\r\n featureInstrumentation: object;\r\n instrumentationConstants: object;\r\n instrumentationLegacy: object;\r\n navigationLevel: string;\r\n campaignType: number;\r\n serverContext: object;\r\n permissions: object;\r\n cid: number;\r\n aid: number;\r\n campaignId: number;\r\n isMCC: boolean;\r\n guid: string;\r\n willFetchData: Function;\r\n onSuccess: () => void;\r\n}\r\n\r\nexport function useRecommendationsData({\r\n entitySet,\r\n navigationLevel,\r\n featureInstrumentation,\r\n legacyConfig,\r\n campaignType,\r\n serverContext,\r\n jsdata,\r\n permissions,\r\n cid,\r\n aid,\r\n campaignId,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n isMCC,\r\n guid,\r\n willFetchData,\r\n onSuccess,\r\n}: IUseRecommendationsDataProps) {\r\n const fetch = useCallback(({\r\n navigationLevel, campaignType, cid, aid, campaignId, isMCC,\r\n }) => {\r\n willFetchData();\r\n return getCardData({\r\n entitySet,\r\n navigationLevel,\r\n featureInstrumentation,\r\n legacyConfig,\r\n campaignType,\r\n serverContext,\r\n jsdata,\r\n permissions,\r\n cid,\r\n aid,\r\n campaignId,\r\n instrumentationLegacy,\r\n instrumentationConstants,\r\n isMCC,\r\n guid,\r\n });\r\n }, [willFetchData, entitySet, featureInstrumentation, legacyConfig, serverContext,\r\n jsdata, permissions, instrumentationLegacy, instrumentationConstants, guid]);\r\n const swrKeyObject = useMemo(() => ({\r\n navigationLevel, campaignType, cid, aid, campaignId, isMCC,\r\n }), [aid, campaignId, campaignType, cid, isMCC, navigationLevel]);\r\n const {\r\n data, isLoading, mutate,\r\n } = useSwr(swrKeyObject, fetch, {\r\n revalidateOnFocus: false,\r\n onSuccess,\r\n });\r\n\r\n return {\r\n data,\r\n isLoading,\r\n };\r\n}\r\n"],"names":["permissions","config","get","validMetricIndexes","defaultSelectedMetricIndexes","availableMetricKeys","allMetrics","preferenceName","dashboardPreferenceKey","PerfMarkerFactory","createMarker","willInit","PerformanceCardContainer","props","dateRange","filter","serverContext","perfMarkerUtils","sesId","i18n","preferenceService","selectedMetricIndexes","metrics","patchPreference","getCardsConfig","responsiveSize","shellContentElement","campaignType","constructOptions","TimeZone","CurrentAccount","instrumentation","useContext","InstrumentationContext","activity","useMemo","createScenarioAndActivity","scenarioName","activityName","willFetchData","willRender","done","_useMemo2","initialSelectedMetricIndexesFromPreference","initialMetricsFromPreference","preferencePatch","_getPreference","_ref","cardId","boardPreference","getPreferenceForDashboard","preference","cardPreferenceOptions","getCardPreferenceOptions","_","metric","includes","length","index","trace","concat","JSON","stringify","defaultMetrics","set","data","setPreferenceForCard","cardOptions","getPreference","cardPerformanceId","_get","_useData","_useState","useState","_useState2","_slicedToArray","setSelectedMetricIndexes","_useState3","_useState4","visibleMetrics","setVisibleMetrics","_useState5","_useState6","performanceData","setPerformanceData","_useState7","_useState8","aggregatedMetricPickerData","setAggregatedMetricPickerData","_useState9","_useState10","hideCurrency","setHideCurrency","_useState11","_useState12","isChartLoading","setIsChartLoading","_useState13","_useState14","isMetricLoading","setIsMetricLoading","_useState15","_useState16","isFirstDataLoaded","setIsFirstDataLoaded","_useState17","_useState18","hasError","setHasError","scope","ScopeContext","navigationLevel","getNavigationLevel","values","granularity","availableGranularities","dateUtil","isPreferenceInitialized","useIsPreferenceInitialized","legacyPreference","useEffect","isLoading","dateString","filterString","entitySet","edm","currentAccount","Campaigns","campaignId","URLSearchParams","document","location","search","extendedFilter","extraFilter","_constructOptions$ext","key","value","query","Id","Number","baseFilter","item","_toConsumableArray","fetchSingleTile","NavigationLevel","Campaign","fetchPerformanceTimeSeries","movingAverage","period","accountsMode","dfmCacheKey","then","performanceTimeSeries","error","finally","catch","e","fetchAggregatedData","jsdata","raw","OverallTotals","totalMetrics","getFilteredTotalsMetrics","AccountsMode","Expert","availableTotalMetrics","AccountsHaveDifferentCurrencies","metricPickerData","Object","keys","map","total","formatMetric","displayName","getString","metricToDisplayNameMap","useData","selectedMetricIndexesFromDataHook","onMetricUpdate","useCallback","newSelectedMetricIndexes","newVisibleMetrics","Card","PerformanceCardFluent","PerformanceCard","_jsx","isComparisonEnabled","compared","defaultProps","id","querySelector","undefined","DetailCardsKey","campaign","billing","editorial","conversionTracking","bidding","assetGroup","statusAndActionReport","type","status","details","message","action","auditPointDisplayed","_ref2","auditPoint","area","getFullProductUrl","routeName","params","arguments","pathname","getRoutePathById","allSiteMap","reduce","result","param","join","BILLING_ISSUE_LIST","BANNER_ALERT","DANGER","STATUS_TEXT","Active","_TL_","Paused","UnderReview","BudgetPaused","getCampaignStatus","locale","alertHelper","name","cardDetails","_scope$values","cid","aid","onNavigateToBudgetEditSettingsPage","isSDK","url","save","cardTitle","cardMsg","onCardButtonClicked","edmCampaign","Customers","$withKey","Accounts","bulkUpdate","Status","showSuccess","showError","cardButtonText","statusLabelMsg","Warning","learnMoreLink","getCardDetails","statusIcon","Error","Pending","_objectSpread","InReview","Rejected","Approved","Limited","getEditorialStatus","_ref3","isCampaignTypeApp","window","open","assetGroupUrl","NoIssue","InappropriateTarget","getBiddingStatus","ACTION_OPERATOR_TEXT","EqualsTo","BeginsWith","Contains","RegularExpression","CATEGORY_OPERATOR_TEXT","LABEL_OPERATOR_TEXT","VALUE_OPERATOR_TEXT","LessThan","GreaterThan","NotSetUpGoal","NotSetUpGoalMaxClicks","Unverified","UnverifiedMaxClicks","RecordingConversions","NoConversions","NoConversionsMaxClicks","NoConversionGoal","NoConversionGoalMaxClicks","PendingMaxClicks","MissGoalWithRevenueValue","MissGoalWithRevenueValueMaxClicks","InactiveDueToTagUnavailable","InactiveDueToTagUnavailableMaxClicks","TagInactive","TagInactiveMaxClicks","NoRecentConversion","NoRecentConversionMaxClicks","AUDIT_POINT_STATUS_TEXT","TrackingStatusUnverified","TrackingStatusTagInactive","TrackingStatusInactiveDueToTagUnavailable","TrackingStatusUnverified_UETMismatch","TrackingStatusTagInactive_UETMismatch","TrackingStatusInactiveDueToTagUnavailable_UETMismatch","AUDIT_POINT_TITLE_TEXT","OPERATORS_TEXT","CHANGE_TO_MAIN_GOAL_TEXT","TrackingStatusNoConversions_ChangeToMainGoal","TrackingStatusUnverified_ChangeToMainGoal","TrackingStatusTagInactive_ChangeToMainGoal","TrackingStatusInactiveDueToTagUnavailable_ChangeToMainGoal","ConversionGoalPending_ChangeToMainGoal","onClickNavigateToUETTagPage","remove","onClickNavigateToOfflineConversionsPage","onClickNavigateToConversionGoalsPage","strings","CampaignTypes","Audience","GoalWithTopPriority","GoalName","FixEventGoal","_getInvalidEventStrin","_ref$fix","fix","CurrentEventCategory","CurrentEventCategoryOperator","CurrentEventAction","CurrentEventActionOperator","CurrentEventLabel","CurrentEventLabelOperator","CurrentEventValue","CurrentEventValueOperator","SuggestedEventCategory","SuggestedEventCategoryOperator","SuggestedEventAction","SuggestedEventActionOperator","SuggestedEventLabel","SuggestedEventLabelOperator","SuggestedEventValue","SuggestedEventValueOperator","currentArray","suggestedArray","push","current","suggested","getInvalidEventStrings","FixDestinationUrlGoal","CurrentDestinationUrlOperatorName","CurrentDestinationUrl","SuggestedDestinationUrlOperatorName","SuggestedDestinationUrl","UETMismatch","SuggestedTagName","DynamicPermissions","isConversionApplicable","conversionDetails","getConversionStatus","statusValue","parsed","parse","diagnosticDetails","CardStatus","title","text","some","hasWarning","isCampaignActive","campaignDetail","find","logStatusText","texts","perfMarker","setBilling","diagnosticsData","setDiagnosticsData","isDataFetchDone","setIsDataFetchDone","setError","AlertHelper","areas","getAreasForCampaignType","scopeCID","uid","Areas","Billing","getBillingStatus","ccBaseUrl","isNewConversionsEnabled","isNewApiEnabledForAudienceCampaigns","withNewApi","App","getCampaignDiagnostics","timeZoneId","adInsightBaseUrl","Token","useNewConversionDiagnostics","billingDetail","Array","isArray","notification","alertType","NotificationLevel","NotificationId","ccBaseUrlNoTrailingSlash","replace","paymentPath","getBillingDetail","diagnosticsDetail","toLowerCase","split","campaignDetails","Key","Editorial","editorialDetails","Bidding","biddingDetails","Conversion","getDiagnosticsDetail","rawDetails","acc","a","totalStatusCount","Boolean","readyState","_getCardStatusText","campaignStatusTitle","campaignStatusMsg","getCardStatusText","wrapperClass","mergeStyles","padding","overflowX","selectors","margin","titleShimmerClass","width","messageShimmerClass","shimmerWithElement1stRow","ShimmerElementType","line","height","shimmerWithElement2ndRow","shimmerWithElement3rdRow","shimmerWithElement4thRow","gap","shimmerWithElement5thRow","shimmerWithElement6thRow","DiagnosticCardShimmer","_jsxs","_Fragment","children","className","Shimmer","shimmerElements","Separator","OverviewDiagnosticCard","DiagnosticCard","entityName","customer","account","TopChangesCard","legacyI18n","cardTypeId","preferenceFromServer","PermissionsContext","comparisonDateRange","getComparisonDateRange","headerState","selectedMenuItem","selectedItemValue","TopChangesFilterOption","AllChanges","dismissLastFluctuation","setDismissLastFluctuation","useRef","selectedMetric","setSelectedMetric","onMetricSelect","selection","onFooterButtonClick","footerButtonConfigs","onClick","getHref","entityId","route","cacheManager","uiActivity","scenario","fetch","fetchTopChanges","isDevice","disableCache","dataError","gridData","entity","PerformanceMetricsChange","AvailableInsightTypeIds","fromScenario","CampaignType","toString","AccountInactiveReasons","AccountUtils","activityStatus","TopDecliners","TopGainers","Insights","isInsightsMetric","response","revalidateOnFocus","useTopChangesData","getTopChangesAllMetrics","renderFluctuationPopup","fluctuationTypeIds","isOpen","setIsOpen","context","CurrentCampaign","isFluctuationsExperiementEnabled","Permissions","IsFluctuationExperimentEnabled","FluctuationPopup","deps","token","imagePath","appConfig","onClose","onFlucDismiss","isLastFluc","canViewAllInsights","asyncLoadFluctuationConfig","startDate","start","endDate","end","withPopoverAdapter","useFluctuationPopup","metricFormatter","entityType","currentDateRange","dashboardPreferencesName","useDashboardPreferences","dashboardPreferences","findByNameAtAccountLevel","dashboardId","options","setOptions","saveDashBoardOptions","newOptions","setAtAccountLevel","Name","Data","cards","logApi","WelcomeTipsCard","createdCampaign","skippedBothAtAccountCreation","skippedNoneAtAccountCreation","pages","hasPaymentPermission","showWelcomeMsg","isPaymentFirstTile","hasCoupon","PreferenceContext","accountId","userId","customerId","scopes","alerts","paymentAlert","alert","indexOf","hasValidPaymentMethod","skippedNoneInFirstLoad","coupon","Redemptions","redeemedCoupons","redeemed","StatusId","AssociatedCoupon","matchResult","exec","ExpiryDateFromAssociation","expirationDate","parseInt","Date","stack","PROMO","CREATE_CAMPAIGN","ADD_PAYMENT","COACHING","HELP","useWelcomeTipPages","CurrentUser","FirstName","getLocalizedSupportLink","useOverviewPageStyles","makeStyles","pageContainer","maxWidth","minWidth","usePageStyles","main","position","overflow","content","display","clear","shorthands","cardSmall","cardMedium","cardLarge","cardFull","column","getStyleFromCardSize","size","styles","containerWidth","CardSize","FullScreen","Large","useOverviewPhase2WindowSizeChange","setResponsiveSize","onShellContentResize","func","delay","timer","_len","args","_key","clearTimeout","setTimeout","apply","debounce","getResponsiveSize","offsetWidth","resizeObserver","ResizeObserver","observe","disconnect","useLayoutEffect","lazy","module","default","OverviewRecommendationsCard","OverviewCampaignTable","OverviewAccountTable","OverviewKeywordTable","OverviewSearchTermTable","OverviewAdGroupTable","ConversionTrackingCardFluent","DeviceCard","TopLocationsCard","TopLocationViewSelector","CompetitionCardWithData","CompetitionFilterWithData","AssetPerformanceCard","AssetPerformanceCardWithAssetData","AssetPerformanceCardHeader","AssetPerformanceFilterWithAssetGroupsData","NavigateToFullProductCard","assetPerfId","getDefaultCardState","isResizable","reactView","isInViewportOnPageLoad","cardTopLocationsId","Small","CardHeaderContent","AssetPerformanceFilter","parentPerfMarker","campaignStateCard","budgetCard","bidStrategyCard","campaignStatusSummaryCards","PerformanceMaxSingleCampaign","defaultCardViewState","cardViewState","setCardViewState","remainingViewportCards","card","waterfallFilterStorage","WaterfallFilterStorage","waterfallDateFilterProcessor","getFilters","WaterfallFilterType","DateFilter","CampaignStatus","AdGroupStatus","getFilteredCampaignTypeFromWaterfallFilter","contentReady","PageReady","pageIsReady","onWindowResize","chartWidth","getElementsByClassName","newCarViewState","viewState","addEventListener","removeEventListener","useOverviewWindowSizeChange","cardState","backboneInstance","updateState","campaignStatusContentReady","budgetContentReady","bidStrategyContentReady","newI18n","sesIdRef","initialized","setInitialized","backboneCreator","createChild","on","useInitializeBackboneView","classNames","CampaignStatusSummaryCards","trigger","OverviewCard","currentSize","cardHeaderContentProps","CustomCardView","BackboneInstanceWrapper","managed","instance","PerformanceMax","viewProps","StyledPerformanceMaxSingleCampaign","withDefaultStyles","_ref$palette","palette","assign","metricPickerFluentV2Style","getPerformanceCardFluentV2Style","getPerformanceGraphStyle","getTopLocationCardFluentV2Style","competitionCardStyle","OverviewPage","legacyRouter","_bingads_webui_component_legacy_legacy_router_index","s$i18n","globalLegacyI18n","pageContext","constants","conversionTrackingDeps","tableDeps","recommendationsDeps","legacyConfig","featureInstrumentation","instrumentationConstants","instrumentationLegacy","i18nErrors","preferencesService","locationMap","walkme","adDisplayUrlService","topChangesLegacyDeps","legacyDeps","_defineProperty","cardRecommendationsId","cardTopCampaignsId","cardTopAccountsId","cardTopKeywordsId","cardSearchTermsId","cardTopAdGroupsId","cardConversionTrackingId","cardTopChangesAccountId","cardTopChangesCampaignId","cardTopChangesAdGroupId","childPerfMarkers","getChildPerfMarkers","configs","cardSize","forEach","typeId","childPerfMarker","useStableObject","obj","stableObj","setStableObject","isEqual","userWelcomePrefName","doneInitialLoad","cardsContainer","disclaimer","cardWidth33","cardWidth50","cardWidth66","cardWidth100","cardBasic","dynamicHeight","errorContainer","flexDirection","alignItems","textAlign","marginTop","errorImage","marginBottom","errorMessage","TooMuchAccountsError","src","tooManyAccountsError","alt","Button","appearance","SummaryCardsConfigs","getCardSizeClass","OverviewPagePhase2","currentCampaign","instrumentationContextValue","dfmActivity","overviewPageActivity","refreshKey","setRefreshKey","stableDateRange","stableFilter","filterCampaignType","isLinkedInCampaignOverview","isPMaxCampaignOverview","isShowCampaignStatusSummaryCards","isMobileAppCampaign","CampaignSettings","isAppCampaign","getCampaignSetting","setting","AppStore","welcomeTipsConfig","WelcomeStatus","welcomeTipsStatus","setWelcomeTipsStatus","_useDashboardPreferen","userWelcomePref","findByNameAtUserLevel","cancel","doNotShowWelcomeTips","Promise","resolve","showWelcomeTips","ShowWelcomeTips","HasCampaigns","odata","HasBIData","HasOtherAccounts","startScenario","instrumentationSettings","SCENARIONAME","LoadOverviewPage","startActivity","ACTIVITYNAME","logMessage","LOGCATEGORY","TRACE","LOGLEVEL","INFO","setAtUserLevel","useWelcomeTips","isLoadingWelcomeCardConfig","cardsConfigs","getFluentCardsConfigs","_useSelectedCardsWith","useSelectedCardsWithPreference","selectedCardsConfigs","cardSelectionCards","onCardSelectionSaved","getCardPreferenceOptionsForDfm","pageViewPortCardSizeFallback","getViewPortCardsCount","pageViewPortSizeFromDfm","FluentOverviewPageDataFetchManagerCardsConfigObject","viewPortCardSize","pageViewPortCardSize","setPageViewPortCardSize","viewportReady","setViewportReady","showTooMuchDataError","tiles","setShowTooMuchDataError","hasFetchedRef","currentCustomer","cardDeviceId","errors","Code","console","useHasTooManyAccounts","timeoutId","perfMarkers","perfMarkersWithSummaryCards","_window$FluentOvervie","dfmConfig","isKeywordInViewPort","isSearchTermInViewPort","innerHeight","innerWidth","dfmCampaignType","strConfig","strDfmConfig","doneCallback","first","cardConfig","CardView","getCardViewProps","cardPreference","getPropsFromPreferenceForPerformanceChart","getPropsForRecommendations","getTablePropsFromPreferenceForPerformanceTable","DefaultHeaderDropdown","getCardHeaderContentProps","getHeaderPropsFromPreferenceForPerformanceTable","getPropsFromPreferenceForConversionTracking","getHeaderPropsFromPreferenceForConversionTracking","getTablePropsFromPreferenceForDevices","getPropsFromPreferenceForTopLocations","cardCompetitionId","getPropsForTopChanges","getHeaderPropsFromPreferenceForTopChanges","cardWelcomeTipsId","_ref4","cardDiagnosticId","_ref5","cardAssetPerformanceId","_ref6","_ref7","cardNavigateToFullProductId","ERROR","contentType","getCardViewConstructor","campaignStatus","dynamic","AppCampaignNewCampaignGridColumns","renderCards","_ref3$getCardHeaderCo","_ref3$getCardViewProp","cardPreferenceKey","getCardPreferenceKey","getCardPreferenceWithDefault","getPreferencePatcher","staticDepsProps","isDiagnositcCard","dynamicHeightForNarrow","isFullWidthCard","getEntitySetOptions","cardSelectorKey","showCardSelector","CardSelector","onSave","DisclaimerBanner","timezone","onMounted","eventDispatcher","state","azure","azureUrlRewrite","localInstrumentation","logger","rowElement","buttonElement","footerButtonElement","ShimmerCard","style","paddingLeft","paddingRight","flex","useNoDataStyles","noDataContainer","flexGrow","alignContent","justifyContent","textContainer","justifyItems","NoDataCard","Image","Caption1Stronger","Caption1","useCardStyles","container","paddingTop","listStyleType","backgroundRepeat","backgroundPositionX","backgroundPositionY","backgroundSize","marginRight","marginLeft","cursor","textOverflow","whiteSpace","opacity","backgroundImage","fontFamily","fontSize","color","boxShadow","backgroundColor","backdropFilter","wordWrap","useAuctionInsightData","setData","setIsLoading","dataSource","getAuctionInsightDataSource","createAsyncToken","onSuccess","chartData","clearCache","onError","onCancel","CompetitionCard","competitors","items","domains","chartType","SmallTile","WrappedComponent","HoC","withFilterData","usePreferenceMetrics","onMetricSet","preferences","IsBAACompetitionBSCAuctionInsightsEnabled","Shopping","Search","getCampaignType","IsAvgPositionDeprecationPhase1Enabled","IsAvgPositionDeprecationPhase2Enabled","metricPreferenceKeyName","setMetricValue","m","ImpressionShare","setMetric","metricObj","useFilterStyles","button","paddingBottom","buttonText","lineBreak","tokens","colorNeutralForeground2","listbox","maxHeight","dropdown","border","CompetitionFilter","setState","selectedCompetitors","setSelectedCompetitors","s","initCompetitors","dropdownButtonText","selected","Tooltip","relationship","Dropdown","multiselect","selectedOptions","onOptionSelect","event","disabled","OptionGroup","label","option","Option","Menu","MenuTrigger","disableButtonEnhancement","MenuButton","MenuPopover","MenuList","MenuItem","withCompetitorsData","computerColor","tabletColor","mobileColor","connectedTVColor","mapSegmentData","segmentedData","segment","deviceType","StringValue","Impressions","Clicks","CTR","Spend","TopImpressionRate","AbsoluteTopImpressionRate","ConversionsCredit","PartialConversionRate","PartialConversionCPA","AdvertiserReportedRevenue","RevenueOnAdSpend","AverageCPC","LegendIcon","useGradient","boxStyle","renderCustomCallout","legend","legendColor","metricValue","customCallout","legendIcon","date","RangeStartDate","RangeEndDate","dropdownCustomStyles","root","outline","lineHeight","caretDown","caretDownWrapper","dropdownItem","deviceDefaultCard","footerVisible","dropdownDefaultCard","multiStackedChart","getStyles","DeviceDefaultCard","deviceData","initialSelectedMetrics","chartPoints","chartPointsTemplate","callOutAccessibilityData","ariaLabel","metricChartPointsMap","flatMap","PerformanceMetrics","SegmentedData","DeviceSegmentedPerformanceData","deviceTypeMap","deviceMetricsMap","overallTotals","updatedChartPoints","updatedPoints","typedMetric","deviceMetrics","overallValue","toFixed","selectedViews","setSelectedViews","dropdownOptions","remainingMetrics","useDefaultStyles","dataViews","view","handleViewChange","prevSelectedViews","newViews","selectedColumns","selectedKey","onChange","TooltipHost","Glyphicon","glyph","MultiStackedBarChart","culture","navigator","language","hideLegend","onRenderCalloutPerDataPoint","chartStyles","deviceComparisonCard","dropdownComparisonCard","gridContainerStyle","gridTemplateColumns","gridTemplateRows","dataItem","separator","borderLeft","multiStackedBarChart","comparisonCardPattern","left","top","leftGrid","gridColumn","rightGrid","patterns","path","DeviceComparisonPatterns","pattern","patternUnits","x1","y1","x2","y2","stroke","strokeWidth","legendKeyMap","SmartPhone","getSegmentedData","keyPath","extractNumericValue","symbolRegex","sanitizedValue","parseFloat","calculatePercentageOfTotal","totalMetric","DeviceComparisonCard","currentComparisonData","previousComparisonData","changeData","previousDataMap","deviceIdentifier","previous","changeDataPercentage","previousDateRange","formattedStart","formattedEnd","currentPeriodTotals","previousPeriodTotals","PeriodPerformanceMetrics","createChartSeriesData","isPattern","colorMap","Computer","Tablet","ConnectedTV","formattedValue","prepareDeviceData","comparisonData","deviceDataAccumulator","createChartPoints","currentDeviceData","previousDeviceData","chartTitle","accumulator","getCombinedDataPoints","combined","entry","dataPoint","calloutStyles","point","combinedData","mappedLegend","changeDataEntry","change","roundedValue","numericChange","isFinite","changeDataPercentageEntry","changePercentage","roundedValuePercentage","numericChangePercentage","formatChangePercentageWithSign","legendData","metricDisplayName","hidePercentageOfTotal","Set","has","currentPercentageOfTotalMetric","previousPercentageOfTotalMetric","renderMetricValue","percentageMetricKey","percentageMetricValue","percentage","changeValue","formatMetricWithSign","currentMetric","selectedKeys","v","handleDropdownChange","newSelectedViews","chartTitleHidden","headerElement","buttonRowElement","largeBlockElement","footerElement","shimmerContainer","shimmerElement","ComputerIcon","xmlns","viewBox","fill","d","TabletIcon","MobileIcon","ConnectedTVIcon","x","y","chartContainer","minHeight","deviceLegend","flexWrap","columnGap","icon","footer","Legend","legends","uiMetrics","getUIMetrics","aggregatedData","isAccountIdAvailable","AdGroups","fetcher","async","isComparisonScenario","getOrderFromGridSortForCombinedCall","sortColumn","sortDirection","comparisonMajorMetric","order","orderByValue","defaultComparisonMetric","GridDataTable","initialSortColumn","initialSortDirection","entityDisPlayName","getPopoverContent","triggerSearchTermDrawer","selectedMetrics","setSelectedMetrics","sortState","setSortState","orderby","direction","getOrderFromGridSort","columns","fetchGridData","keywordText","Text","MatchType","useGridData","newSelectedMetrics","newSortState","newSelectedColumns","useStyles","gridStyle","classes","useCombinedCallData","orderBy","fetchEntityGridCombined","MATCH_TYPE","Exact","Phrase","Broad","getPopoverContentFunction","AdGroup","matchType","pageSize","getCampaignData","isAdGroupLevel","formatQuery","$select","$skip","$top","$orderby","$filter","findAll","dataList","allowedCheck","selectedTag","fontWeight","colorNeutralBackground1Selected","borderRadius","CampaignAdgroupSelector","defalutSelectedCampaign","defalutSelectedAdGroup","showSelectedTag","onInitFinished","onSelectionChange","useCampaignData","checkedItems","setCheckedItems","openItems","setOpenItems","selectedCampaign","setSelectedCampaign","selectedAdGroup","setSelectedAdGroup","parentValue","adGroup","campaignFromItems","onOpenChange","allOpenItems","lazyLoad","signleQuoteTerminatedQuery","$expand","$count","toJSON","getAdGroupData","selectedEntityName","placeholder","isMultiSelect","divider","helpLink","AddKeywordDrawer","isNegative","inputId","useId","dropdownId","campaignAdGroupSelectorId","keywordValue","setKeywordValue","selectedOption","setSelectedOption","selectedOptionText","setSelectedOptionText","radioGroupValue","setRadioGroupValue","isSelectorDataLoaded","setIsSelectorDataLoaded","selectorTitle","onSavedClose","onCancelClose","onSaveClicked","negativeKeyword","NegativeKeywords","EntityType","CampaignId","AdGroupId","campaignEntity","NegativeKeyword","create","keywordData","Keywords","Bid","update","adapter","onRadioGroupChange","onKeywordChange","ev","trim","optionValue","optionText","onSelectorDataLoaded","onSelectorSelectionChange","newSelectedCampaign","newSelectedAdGroup","Drawer","DrawerHeader","DrawerHeaderTitle","DrawerBody","Field","RadioGroup","Radio","Label","htmlFor","required","Input","linkText","topic","Divider","DrawerFooter","Keyword","block","weight","showDrawer","setShowDrawer","setIsNegative","setKeywordText","tableKey","setTableKey","dataSaved","FAC_FEATUREID_TIPID_PRIORITY_MAPPING","GOOGLE_IMPORT","CONVERSION_TRACKING","FAC_TIPID_FEATUREID_MAPPING","mapping","priorities","featureId","tipId","instrumentationSchema","logAdInsightOppTracking","oppt","isClick","guid","isMCC","opportunityType","opportunityTypeId","reason","activeItems","currentSlide","getCarouselActiveItems","tips","recommendations","overallOptimizationScoreBar","allItems","recommendationsCount","recommendationsToShow","tipsCount","getRecommendationCounts","IsImportTipsPriorityEnabled","otherThanImportTips","tip","isImportRelatedTip","numberOfRecommendations","loaded","getCarouselActiveItemsWithCouponData","ccJsData","getCcJsData","p$Coupons","coupons","newTips","rawCoupon","currency","CurrencyCode","couponFeatureId","FeatureId","tipPriorities","couponEligibleTip","sortBy","getCarouselActiveItemsWithCouponDataInternal","fetchCoupons","getRecommendationsFromOpportunitiesData","opportunitiesData","categories","category","accountRecommendationIdsToShow","recommendation","OverallOptimizationScoreBar","willDisplayAccountRecommendation","intersection","isEmpty","loadTipsData","tipList","TipId","tipConfig","compact","tipName","helpType","market","Market","Language","calloutsMktg","calloutsHelp","dsa","autoBidHelp","autoBidMktg","importHelp","importVideo","broadMatchVideo","BROAD_MATCH_MODIFIER_KEYWORD","CALLOUT","DYNAMIC_SEARCH_ADS","AUTOBIDDING_ENHANCEDCPC","AUTOBIDDING_MAXCLICKS","AUTOBIDDING_MAXCONVERSIONS","AUTOBIDDING_TARGETCPA","broadMatchHelp","BROAD_MATCH_KEYWORD","sitelinksMktg","sitelinksHelp","SITE_LINK","ScheduledImportHelp","GOOGLE_IMPORT_SCHEDULED","shouldShowTip","shuffle","newRecommendations","willDisplayImportRelatedtips","loadTipAndOpportunities","p$Tips","recommendationsOriginal","getCardData","fetchTips","fetchMCCOverviewRecommendations","fetchRecommendations","getRecommendationsData","Recommendations","clearRecommendationsCache","EmptyCarouselContent","consultationLink","role","tabIndex","href","target","rel","CouponFlag","rightAlign","flyout","Popover","withArrow","openOnHover","PopoverTrigger","PopoverSurface","TipItem","logSlideDisplay","removeTipLocally","videoRef","clickTip","WalkMeAPI","startWalkthruById","whenLoaded","click","Tip","afterUpdate","dismissTip","expirationTime","setDate","getDate","DismissalExpirationDateTime","couponFlag","imgClass","description","ref","videoId","onKeyUp","combineText","textPart1","textPart2","slice","CarouselItem","currentActivity","logOpportunityEvent","viewRecommendation","isTip","summaryCardModel","errI18n","levelAt","summaryCardOptions","opportunityCount","optimizationScore","version","isInlineView","applyAllCallback","isOverviewPage","isOptimizationScoreOn","OptimizationScore","viewDetails","SummaryCard","SummaryFooter","carouselFooter","CardContent","setCurrentSlide","haveVideo","goPrev","goNext","i","active","itemIndex","itemCount","imageElement","navigationLevelOption","activeItemsInternal","setActiveItemsInternal","allItemsInternal","setAllItemsInternal","generateGuid","swrKeyObject","mutate","useRecommendationsData","Culture","CurrentLocale","addScenario","loadRecommendationOverviewTile","recommendationScope","getScope","navigateToRoute","campaign_id","input","api","RECOMMENDATION","channel","newAllItemsInternal","newActiveItemsInternal"],"sourceRoot":""}