     const deviceGroup = "unknown";
        let isFRE = "unknown";
        let isDHP = "unknown";
        const enableTrack = !(UrlUtility.getQueryParameterByName("enableTrack", locationHref) === "false");
        const search = new URLSearchParams(window.location.search);
        isDHP = search.get("startpage");
        isFRE = search.get("firstlaunch");
        let isMobile = "0";
        let isStaticPage = "False";
        if (headData && headData.ClientSettings) {
            const clientSettings = headData.ClientSettings;
            if (clientSettings.static_page === "true") {
                isStaticPage = "True";
            }
            if (clientSettings.browser) {
                isMobile = clientSettings.browser.ismobile === "true" ? "1" : "0";
            }
        }
        // May need to trigger generation of an ActivityId if there's a production scenario
        // that doesn't provide one from PCS/FD. Currently the empty string fallback is believed
        // to only occur in local testing. Using headData to skip reformat of activityId.
        const flightId = (appEnvironment && appEnvironment.CurrentRequestTargetScope && appEnvironment.CurrentRequestTargetScope.pageExperiments) ? appEnvironment.CurrentRequestTargetScope.pageExperiments.join(",") : undefined;
        const telemetryProperties = Object.assign({ 
            // Properties from the current environment
            activityId: activityId, autoRefresh: autoRefresh, canvas: "Browser", channel: "anaheim", dDgk: deviceGroup, department: "antp", dImd: isMobile, domainId: "340", enable: enableTrack, environment: appEnvironment.Environment, flightid: flightId, isStaticPage: isStaticPage, isSignedIn: signedIn ? "True" : "False", localeCode: appEnvironment.CurrentMarket, msnocid: isDHP === "1" ? "msedgdhp" : "msedgntp", pageConfiguration: null, pageName: isFRE === "1" ? "FRE" : "default", pageProduct: "anaheim", pageTitle: window.document.title, pageType: isDHP === "1" || isFRE === "1" ? "dhp" : "ntp", pageUrl: window.document.URL, pageVersion: "15", serverImpressionGuid: activityId, storeocid: "anaheim_ntp", tmpl: "", vertical: "homepage", 
            // TODO: Add AFD logs once PCS send back the data.
            // Following the spec: https://microsoft.sharepoint.com/:w:/t/DataandInsights/EawMe8a0XKxCkuBO19CGARIByn5roly2qWG76ZElsQq5VQ?e=4PQyuM
            afd: "", waitForPageSettingsToUpdateTrack: true }, config);
        waitForPageSettingsTrackUpdate(telemetryProperties.waitForPageSettingsToUpdateTrack);
        return telemetryProperties;
    }
    /**
     * Creates telemetry contract for page
     * @param {any} telemetryProperties
     * @param (boolean) isStaticPage
     * @param (boolean) isMobile
     * @param (number) signedInStatus
     * @param (string) locationHref - The window.location.href passed from requestContext
     */
    static getPageTelemetryContract(telemetryProperties, isStaticPage, isMobile, isMsaUser, isAadUser, locationHref) {
        const isDefaultSearchBing = currentSearchParams().get("dsp") !== "0";
        const pageTelemetryContract = {
            page: {
                name: telemetryProperties.pageName,
                config: telemetryProperties.pageConfiguration,
                product: telemetryProperties.pageProduct,
                type: telemetryProperties.pageType,
                canvas: telemetryProperties.canvas,
                has3PSearch: !isDefaultSearchBing,
                isSearchAB: false,
                isAdEnabled: false,
                isAutoRefresh: false,
                isJSEnabled: true,
                isStatic: isStaticPage,
                ocid: telemetryProperties.msnocid || telemetryProperties.storeocid,
                url: locationHref,
                content: {
                    author: "",
                    brand: "",
                    brandId: "",
                    domainId: telemetryProperties.domainId,
                    id: "",
                    parentId: "",
                    partnerName: "",
                    source: "",
                    subcategory: telemetryProperties.department,
                    title: window.document.title,
                    topic: "",
                    vertical: telemetryProperties.vertical
                },
                viewType: viewTypeForEdgeNext()
            },
            feed: {
                id: ""
            },
            flight: {
                id: appEnvironment.CurrentRequestTargetScope &&
                    appEnvironment.CurrentRequestTargetScope.pageExperiments &&
                    appEnvironment.CurrentRequestTargetScope.pageExperiments.join(","),
                tmpl: []
            },
            locale: {
                mkt: appEnvironment.CurrentMarket
            },
            browser: {
                isMobile: isMobile,
                deviceGroup: "unknown"
            },
            user: {
                isSignedIn: isMsaUser,
                isSso: false,
                aadState: isAadUser ? AadAccountType.AadAccount : AadAccountType.NonAadAccount
            }
        };
        return pageTelemetryContract;
    }
}
/**
 * This code block is used for preload scenarios
 */
let pageRevealed = false;
let trackValuesUpdated = true;
// Check and add an event listener if page has been pre-loaded but not yet revealed.
if (headData.IsPrerender && document.visibilityState !== "visible") {
    waitForReveal().then(() => {
        pageRevealed = true;
        if (trackValuesUpdated) {
            Telemetry.flush();
        }
    });
}
else {
    pageRevealed = true;
}
/** Event handler to run once track values have been updated by respective entities */
function onTrackValuesUpdated() {
    document.removeEventListener(CustomEventNames.trackValuesUpdated, onTrackValuesUpdated);
    trackValuesUpdated = true;
    if (pageRevealed) {
        Telemetry.flush();
    }
}
/** If config dictates to wait for page settings to update track values, set trackValuesUpdated to false and add an event listener for trackvaluesupdated. */
export function waitForPageSettingsTrackUpdate(waitForPageSettingsToUpdateTrack) {
    if (!waitForPageSettingsToUpdateTrack) {
        return;
    }
    trackValuesUpdated = false;
    // Add an event listener to listen for a signal indicating track values have been updated.
    document.addEventListener(CustomEventNames.trackValuesUpdated, onTrackValuesUpdated);
}
//# sourceMappingURL=EdgeNextTelemetry.js.mapA
Eo