/*! * Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved. * * NVIDIA CORPORATION and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation * and any modifications thereto. Any use, reproduction, disclosure or * distribution of this software and related documentation without an express * license agreement from NVIDIA CORPORATION is strictly prohibited. */ webpackJsonp([4], [function(e, t, n) { "use strict"; n(323); var r = n(185); n(322), n(278), n(338), r.ngMainModule.run(["appService", function(e) { e.main() }]) }, , , , , , , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ngUserProfileModule = void 0; var r = n(1), o = n(53), i = (n(4), angular.module("main.userProfile", [r.ngMainCommonModule.name, o.ngRewardsModule.name, "main.share.common", "ngResource", "ui.router", "pascalprecht.translate", "ngSanitize", "ngEventAggregator", "nvCroppieModule", "main.preferences"])); i.constant("SWEEPSTAKE_EVENTS", { TOKENS_ENTERED_CHANGED: "TOKENS_ENTERED_CHANGED" }), i.constant("SWEEPSTAKE_DIALOG_STATES", { GIVEAWAY_DETAILS: "GIVEAWAY_DETAILS", OFFICIAL_RULES: "OFFICIAL_RULES", INFO_NOT_AVAILABLE: "INFO_NOT_AVAILABLE", EDIT_STAKES: "EDIT_STAKES", REVIEW_STAKES: "REVIEW_STAKES", OVERLAY_LOADING: "OVERLAY_LOADING", OVERLAY_SUCCESS: "OVERLAY_SUCCESS", OVERLAY_ERROR: "OVERLAY_ERROR" }).constant("ANALYTICS_STATE", { ANALYTICS_PROGRESS: 0, ANALYTICS_SUCCESS: 1, ANALYTICS_EMPTY_STATE: 2, ANALYTICS_ERROR_STATE: 3 }).constant("PROFILE_EVENTS", { BADGES_UPDATED: "main.profile.badgesUpdated", MISSIONS_REFRESHED: "main.profile.missions.refreshed", ACTIVITY_LOG_REFRESHED: "main.profile.activity.log.refreshed", CURRENT_GIVEAWAY_REFRESHED: "main.profile.current.giveaway.refreshed", XP_LEVEL_REFRESHED: "main.profile.xp.level.refreshed", ALL_USER_ACHIEVEMENTS_REFRESHED: "main.profile.achievements.refreshed", GIVEAWAY_ENTRY_DETAILS_REFRESHED: "main.profile.giveaway.entry.details.refreshed" }).constant("IMAGE_UPDATE_STATE", { NOT_CHNAGED: "profile.image.not.changed", AVATAR_UPDATE_STARTED: "profile.avatar.update.started", AVATAR_UPDATE_SUCCESSFULL: "profile.avatar.update.successfull", AVATAR_UPDATE_FAILED: "profile.avatar.update.failed", AVATAR_UPDATE_STALE: "profile.avatar.stale", COVER_UPDATE_STARTED: "profile.cover.update.started", COVER_UPDATE_SUCCESSFULL: "profile.cover.update.successfull", COVER_UPDATE_FAILED: "profile.cover.update.failed", COVER_UPDATE_STALE: "profile.cover.stale" }).constant("MISSION_TYPE", { FEATURED_MISSION: "FEATURED_MISSION", REGULAR_MISSION: "REGULAR_MISSION", TOKEN_MISSION: "TOKEN_MISSION" }).constant("MISSION_CONSTANTS", { TRUE: 1, FALSE: 0 }).constant("LEVELS", { SILVER: 1, GOLD: 2, TITANIUM: 3, MAX_LEVEL: 3 }), t.ngUserProfileModule = i }, , , , , , , , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOverlay = void 0; var r = n(1), o = r.ngMainCommonModule.directive("nvOverlay", [function() { function e(e, t) { function n() { t.empty(), t.remove(), t = null } if (e.nvPosition) { var r = {}, o = e.nvPosition.split(" "); angular.forEach(o, function(e) { switch (e) { case "bottom": r.top = "auto", r.bottom = 0; break; case "right": r.left = "auto" } }), t.css(r) } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } return { restrict: "E", transclude: !0, scope: { nvPosition: "@" }, template: "", link: e } }]); t.nvOverlay = o }, , , , , , , , , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ngGalleryModule = void 0; var r = n(10), o = angular.module("main.gallery", ["main.common", r.ngUpdatesModule.name]); o.constant("GAME_FILE_TYPE", { IMAGE: "screenshot", VIDEO: "video" }).constant("SHOWCASE_ORIGIN", { YOUTUBE: "youtube" }), t.ngGalleryModule = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ngGfnModule = void 0; var r = n(23), o = angular.module("main.gfn", ["main.common", r.ngMainConstantsModule.name, "ngResource", "ngSanitize", "ngMaterial", "pascalprecht.translate", "angular-carousel", "ngEventAggregator", "ui.router"]); angular.module("main").requires.push("main.gfn"), t.ngGfnModule = o }, , , , , , , , , , , , , function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } function o(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvImageFallback = void 0; var i = n(3), a = o(i), s = n(1); n(17); var l = n(742), c = r(l), u = s.ngMainCommonModule.directive("nvImageFallback", ["$log", "$compile", "$window", "$timeout", function(e, t, n, r) { return { restrict: "A", link: function(o, i, s) { function l(e, t) { return n.getComputedStyle(e[0]).getPropertyValue(t) } function u() { b = t(c.default)(o), 0 !== y && 0 !== E && (b.css("height", y), b.css("width", E)), v ? i.addClass("common-image-fallback-hide") : b.addClass("common-image-fallback-hide"), i.after(b) } function d() { b || u(), b.removeClass("common-image-fallback-hide"), b.find("nv-overlay").addClass("common-image-fallback-hide") } function f() { v = !1, r.cancel(S), i.removeClass("common-image-fallback-hide"), b && (b.remove(), b = null) } function m() { v = !1, r.cancel(S), g.error("The fallback image " + i.attr("src") + " could not be loaded."), d(), h && (i.off("error", m), i.off("load", f), i.empty(), i.remove(), i = null) } function p() { r.cancel(S), b && (b.remove(), b = null), i && (i.off("error", m), i.off("load", f), i.empty(), i.remove(), i = null) } var g = e.getInstance("main.common/nvImageFallback"), v = !0, h = !("nvImageWillChange" in s), y = l(i, "height"); y = "auto" === y || "0px" === y ? 0 : y; var E = l(i, "width"); E = "auto" === E || "0px" === E ? 0 : E; var b, S, _ = 500; "nv-no-loading-indicator" === s.nvImageFallback ? v = !1 : "nv-we-chat-qr-code" === s.nvImageFallback ? (v = !1, s.$set("src", "QRCodeOfGFE.png")) : "nv-default-game-art" === s.nvImageFallback && (v = !1, s.$set("src", "DefaultGameArt.png")), v && (S = r(function() { b || u() }, _)), a.isUndefined(s.ngSrc) && (i.addClass("common-image-fallback-hide"), d()), i.on("error", m), i.on("load", f), o.$on("$destroy", p) } } }]); t.nvImageFallback = u }, , , , , , function(e, t, n) { e.exports = n.p + "nv-custom-icons.eot" }, function(e, t, n) { e.exports = n.p + "Game-Controller.png" }, , , , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ngRewardsModule = void 0; var r = n(1), o = n(23), i = n(24), a = angular.module("main.rewards", [r.ngMainCommonModule.name, o.ngMainConstantsModule.name, i.ngTelemetryModule.name, "ngResource", "pascalprecht.translate", "ngSanitize"]); angular.module("main.rewards").constant("REWARDS_CONSTANTS", { ERROR_ICON: "error", REWARD_ICON: "card_giftcard", OFFLINE_ICON: "cloud_off", UNIFIED_REDEMPTION_ID: "217888212124697514", REWARDS_COUPONS: { CODE_LENGTH: 29, CODE_LENGTH_NO_DASHES: 24, CODE_DASH_LOCATIONS: { FIRST: 4, SECOND: 9, THIRD: 14, FOURTH: 19, FIFTH: 24 } }, VALIDATION_ERRORS: { COUPONS: { NOT_FOUND: "coupons.not_found", REGIONAL_RESTRICTION: "coupons.region_restricted", HARDWARE_RESTRICTION: "coupons.hardware_restricted", NOT_ACTIVATED: "coupons.not_activated", NOT_ACTIVE: "coupons.not_active", EXPIRED: "coupons.expired", DISABLED: "coupons.disabled", REDEEMED: "coupons.already_redeemed", OUT_OF_STOCK: "coupons.out_of_stock", ALREADY_OWNED: "coupons.package_already_owned", PACKAGE_FETCH_FAILURE: "cms.package_fetch_failure", RESTRICTION: "coupons.restriction", AGE_RESTRICTION: "coupons.age_restricted", USER_RESTRICTION: "coupons.user_restricted" }, PACKAGES: { MAXIMUM_OWNERSHIP_GENERIC: "packages.maximum_ownership_reached", MAXIMUM_OWNERSHIP_HARDWARE: "packages.maximum_ownership_on_hardware_reached", MAXIMUM_OWNERSHIP_USER: "packages.maximum_ownership_on_user_reached", OUT_OF_STOCK: "packages.out_of_stock", RESTRICTION: "packages.restriction", REGIONAL_RESTRICTION: "packages.region_restricted", HARDWARE_RESTRICTION: "packages.hardware_restricted", CLIENT_MESSAGE_OVERRIDE_GENERIC: "packages.client_message_override", CLIENT_MESSAGE_OVERRIDE_ONE: "packages.client_message_override_one", CLIENT_MESSAGE_OVERRIDE_TWO: "packages.client_message_override_two", CLIENT_MESSAGE_OVERRIDE_THREE: "packages.client_message_override_three", AGE_RESTRICTION: "packages.age_restricted", USER_RESTRICTION: "packages.user_restricted" } }, REDEMPTION_STATES: { AVAILABLE: "AVAILABLE", LOCKED: "LOCKED", UNREDEEMED: "UNREDEEMED", UNCLAIMABLE: "UNCLAIMABLE", CLAIMABLE: "CLAIMABLE", REDEEMED: "REDEEMED", REDEEMING: "REDEEMING", EXPIRED: "EXPIRED" }, PORTAL_WINDOW_WIDTH: "1000", PORTAL_WINDOW_HEIGHT: "700", MIN_SUPPORTED_DRIVER: 417.01, LIMIT_TO_FILTER: { ITEMS_AT_ONCE: 5, INTERVAL_LENGTH: 100 }, REWARD_PACKAGE_TYPES: { BUNDLE: "BUNDLE", SWEEPSTAKE: "SWEEPSTAKE", MULTI_SELECT_BUNDLE: "MULTISELECTBUNDLE" } }), angular.module("main.rewards").constant("REWARDS_CAMPAIGN_STATUS", { SUCCESS: "SUCCESS", FAILURE: "FAILURE" }), angular.module("main.rewards").constant("REWARDS_ASSET_DIMENSIONS", { CARD: "360x154", DIALOG_IMAGE: "320x497", LARGE_NOTIFICATION: "456x253", SMALL_NOTIFICATION: "178x100" }), angular.module("main.rewards").constant("REWARDS_ENTITLEMENT_TYPES", { COUPON: "COUPON", AVAILABLE_REWARD: "AVAILABLE_REWARD", REDEEMED_REWARD: "REDEEMED_REWARD" }), angular.module("main.rewards").constant("PORTAL_EVENT_CATEGORIES", { ACCOUNT: "ACCOUNT", TERMS_AND_CONDITIONS: "TnC", PRODUCTS: "PRODUCTS", REDEEM: "REDEEM" }), angular.module("main.rewards").constant("PORTAL_EVENT_TYPES", { INITIALIZE: "INITIALIZE", PROGRESS: "PROGRESS", SUCCESS: "SUCCESS", FAILURE: "FAILURE" }), angular.module("main.rewards").constant("REWARDS_GFWSL_CAMPAIGNS", { ACHIEVEMENTS: "GFE_AFFINITY_GPU_ACHIEVEMENT", SWEEPSTAKES: "GFE_AFFINITY_GPU_SIGN" }), angular.module("main.rewards").constant("REWARDS_EVENTS", { PREPARE_EXTERNAL_PAGE_STATE: "main.rewards.dialogLoading", GET_REDEMPTION_URL_FAILED: "main.rewards.getRedemptionUrlFailed", REDEMPTION_HISTORY: { PORTAL_URL_READY: "main.rewards.redemptionHistory.portalUrlReady", HANDLE_OFFLINE_STATE: "main.rewards.redemptionHistory.handleOfflineState", HANDLE_PROVIDER_SERVICE_FAILED: "main.rewards.redemptionHistory.handleProviderServiceFailed" }, FEATURE_STATUS_UPDATED: "main.rewards.featureStatusUpdated", FEATURE_NOT_SUPPORTED: "main.rewards.featureNotSupported", NEW_REWARD_FOUND: "main.rewards.newRewardFound", REWARD_REDEEM_CLICKED: "main.rewards.rewardRedeemClicked", COUPON_INPUT: { CLEAR_CODE: "main.rewards.couponInput.clearCouponCode", INVALIDATE_CODE: "main.rewards.couponInput.invalidateCode", FOCUS: "main.rewards.couponInput.focus", BLUR: "main.rewards.couponInput.blur", SAVE_CARET: "main.rewards.couponInput.saveCaret", RESTORE_CARET: "main.rewards.couponInput.restoreCaret" }, BACKEND_REWARDS_FETCHED: "main.rewards.update", REWARDS_UPDATED: "main.rewards.onUpdated", RESET_SCROLL_POSITION: "main.rewards.resetScrollPosition", REWARD_NOTIFICATION_CLICKED: "main.rewards.rewardNotificationClicked" }).constant("REWARDS_SOCKET_EVENTS", { REWARDS_UPDATE_FROM_NODE: "/Rewards/v.1.0/refresh" }), t.ngRewardsModule = a }, , , , , , , , , , , , , , , , , , , , , , , , , , , function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, "@font-face{font-weight:400;font-style:normal;font-family:nvCustomIcons;src:url(" + n(47) + '#iefix) format("embedded-opentype"),url(' + n(47) + "),url(" + n(86) + ') format("woff"),url(' + n(85) + ") format(\"truetype\")}.nv-custom-icons{font-family:nvCustomIcons}.icon-NVcheck:before{content:'\\e930'}.icon-battery-charging:before{content:'\\e936'}.icon-account-circle:before{content:'\\e938'}.icon-alert-circle_reg:before{content:'\\e939'}.icon-alert-circle_sm:before{content:'\\e93a'}.icon-notoptimized_reg:before{content:'\\e93b'}.icon-notoptimized_sm:before{content:'\\e93c'}.icon-optimized_reg:before{content:'\\e93e'}.icon-optimized_sm:before{content:'\\e93f'}.icon-play-circle-outline:before{content:'\\e940'}.icon-play-circle:before{content:'\\e941'}.icon-profile_generic:before{content:'\\e942'}.icon-share:before{content:'\\e943'}.icon-onbattery:before{content:'\\e902'}.icon-pluggedin:before{content:'\\e934'}.icon-monitor:before{content:'\\e901'}.icon-GFE-logo_outline_update:before{content:'\\e920'}.icon-quality-high:before{content:'\\e931'}.icon-detailed_view:before{content:'\\e932'}.icon-detailed_view2:before{content:'\\e933'}.icon-guage:before{content:'\\e92f'}.icon-home:before{content:'\\e92d'}.icon-package-down:before{content:'\\e92e'}.icon-notoptimized:before{content:'\\e92c'}.icon-maximize_mode:before{content:'\\e929'}.icon-minimize_mode:before{content:'\\e92a'}.icon-window_mode:before{content:'\\e92b'}.icon-GFE-logo:before{content:'\\e91f'}.icon-folder-browsing:before{content:'\\e91e'}.icon-imgur-logo:before{content:'\\e914'}.icon-youtube-logo:before{content:'\\e90d'}.icon-alert:before{content:'\\e900'}.icon-bell:before{content:'\\e903'}.icon-chevron-down:before{content:'\\e904'}.icon-chevron-up:before{content:'\\e905'}.icon-content-paste:before{content:'\\e906'}.icon-delete:before{content:'\\e907'}.icon-download:before{content:'\\e908'}.icon-eye-off:before{content:'\\e909'}.icon-eye:before{content:'\\e90a'}.icon-file-document:before{content:'\\e90b'}.icon-folder:before{content:'\\e90c'}.icon-google-circles-communities:before{content:'\\e90e'}.icon-heart:before{content:'\\e90f'}.icon-help-circle:before{content:'\\e910'}.icon-menu-down:before{content:'\\e911'}.icon-menu-up:before{content:'\\e912'}.icon-message-text:before{content:'\\e913'}.icon-pause:before{content:'\\e915'}.icon-play:before{content:'\\e916'}.icon-settings:before{content:'\\e917'}.icon-shopping:before{content:'\\e918'}.icon-speedometer:before{content:'\\e919'}.icon-GFE_logo_outline:before{content:'\\e920'}.icon-launch:before{content:'\\e921'}.icon-close:before{content:'\\e922'}.icon-star-circle:before{content:'\\e91a'}.icon-tag:before{content:'\\e91b'}.icon-wrench:before{content:'\\e91c'}.icon-check:before{content:'\\e91d'}.icon-dots-vertical:before{content:'\\e923'}.icon-filter-variant:before{content:'\\e924'}.icon-send-feedback:before{content:'\\e925'}.icon-sort-variant:before{content:'\\e926'}.icon-star:before{content:'\\e927'}.icon-view-module:before{content:'\\e928'}.icon-batteryboost:before{content:'\\e935'}.icon-desktop:before{content:'\\e937'}.icon-gamestream:before{content:'\\e945'}.icon-arrow-left:before{content:'\\e947'}.icon-edit:before{content:'\\e949'}.icon-emptycheckbox:before{content:'\\e94a'}.icon-gpu:before{content:'\\e94d'}.icon-share_camera:before{content:'\\e94e'}.icon-freestyle:before{content:'\\e976'}.icon-memory:before{content:'\\e94f'}.icon-nvlogo:before{content:'\\e951'}.icon-ram:before{content:'\\e952'}.icon-selectcheckbox:before{content:'\\e953'}.icon-shield:before{content:'\\e95b'}.icon-shieldTV:before{content:'\\e95c'}.icon-tablet:before{content:'\\e95d'}.icon-twitch-logo:before{content:'\\e95e'}.icon-VR:before{content:'\\e963'}.icon-rewards:before{content:'\\e93d'}.icon-quiet-mode:before{content:'\\e944'}.icon-controller-generic-single:before{content:'\\e948'}.icon-highlight:before{content:'\\e95f'}.icon-alert-bang:before{content:'\\e950'}.icon-desktop-mac:before{content:'\\e954'}.icon-ethernet:before{content:'\\e955'}.icon-game-controller:before{content:'\\e956'}.icon-game-library:before{content:'\\e957'}.icon-isp:before{content:'\\e958'}.icon-server:before{content:'\\e959'}.icon-wifi:before{content:'\\e95a'}.icon-ranking-gold:before{content:'\\e961'}.icon-ranking-silver:before{content:'\\e962'}.icon-ranking-titanium:before{content:'\\e964'}.icon-ranking-token:before{content:'\\e965'}.icon-ranking-XP:before{content:'\\e966'}.icon-info:before{content:'\\e968'}.icon-level-bg:before{content:'\\e969'}", ""]) }, , , , , function(e, t, n) { e.exports = n.p + "nv-custom-icons.ttf" }, function(e, t, n) { e.exports = n.p + "nv-custom-icons.woff" }, , , , , , , , , , function(e, t, n) { e.exports = n.p + "toolbar-divider-vertical.png" }, , , , , , , , , , , , , , function(e, t, n) { var r = n(80); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, , , function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvSelectMenu = void 0; var o = n(1), i = n(754), a = r(i), s = o.ngMainCommonModule.directive("nvSelectMenu", ["$mdMenu", function(e) { return { restrict: "E", scope: { nvMdIcon: "@", nvLabel: "@", nvPositionMode: "@", nvFiltered: "=", nvCustomIcon: "@" }, transclude: !0, template: a.default, link: function(t, n, r) { function o() { e.hide() } function i() { a.off("mouseleave", o), a = null, n.empty(), n.remove(), n = null } var a = angular.element(n.find("md-menu-content")); a.on("mouseleave", o), t.$on("$destroy", i), n.on("$destroy", function() { t.$destroy() }) } } }]); t.nvSelectMenu = s }, , , , , , , function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } function o(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.rewardsService = void 0; var i = n(35), a = o(i), s = n(13), l = o(s), c = n(53), u = n(3), d = r(u); n(52), n(161), n(12), n(26), n(383), n(22), n(16), n(62), n(293), n(121); var f = n(964), m = o(f), p = n(963), g = o(p), v = c.ngRewardsModule.service("rewardsService", ["$log", "gfwslEndpoints", "$q", "REWARDS_CONSTANTS", "jarvisService", "gfeService", "eventAggregator", "COMMON_EVENTS", "signPayloadService", "hardwareService", "REWARDS_EVENTS", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "NOTIFICATION_EVENTS", "GFECLIENT_CONFIG", "socketService", "REWARDS_SOCKET_EVENTS", "$state", "GPU_HARDWARE_SIGNATURE_DEFAULTS", "localeService", "COMMON_DYNAMIC_REDIRECT", "windowSpawnService", "NOTIFICATION_CATEGORY", "$timeout", "gfeSearchService", "USER_PROFILE_TAB_NAMES", "USER_PROFILE_EVENTS", "gfeTargetService", "ACTIVE_EXPERIMENTS", "$window", "cevoService", "TELEMETRY_AFFINITY_ACTION", "TELEMETRY_SCREENS", "TELEMETRY_STATUS", "TELEMETRY_AFFINITY_ELEMENT", "REWARDS_CAMPAIGN_STATUS", "REWARDS_ASSET_DIMENSIONS", "REWARDS_ENTITLEMENT_TYPES", "REWARDS_GFWSL_CAMPAIGNS", "$filter", "TELEMETRY_API_SUB_USECASES", function(e, t, n, r, o, i, s, c, u, f, p, v, h, y, E, b, S, _, w, A, T, I, C, x, M, D, O, R, N, L, P, k, G, F, U, V, z, B, $, W, H) { function j(e) { ct = e } function Y(e) { s.trigger(p.REWARD_NOTIFICATION_CLICKED, e) } function q(e) { if (e && 0 !== e.length) { var t = [], n = new Date; d.forEach(e, function(e) { var r = e.campaign.rules.end_date ? new Date(e.campaign.rules.end_date) : new Date(864e13); if (r > n) { var o = Ge.getFormattedImageUrl(e.campaign.imageLink, z.SMALL_NOTIFICATION), i = Ge.getFormattedImageUrl(e.campaign.imageLink, z.LARGE_NOTIFICATION), a = { artWork: o, artWorkHighRes: i, callbackData: e.campaign.uuid, callbackFunction: mt, heading: { text: e.campaign.title }, description: { text: e.campaign.tagline }, firstNotificationHighResolution: !0, type: C.REWARDS }; t.push(a) } }), s.trigger(y.REMOVE_NOTIFICATION, at), at = t, s.trigger(y.NEW_NOTIFICATION, { notifications: t }) } } function K() { Pe = o.getLoggedInUser(), Ue.userId = Pe && Pe.userId } function Q(e) { e ? (K(), we()) : (Pe = void 0, ot = null, Fe.overallState = !1, Ue = { userId: "", delegateToken: "" }) } function Z(e) { We.debug("got gfwsl sys params", e), ze.cID = e.cID, ze.sM = e.sM, ze.IsB = e.IsB, ze.dIDa = e.dIDa, ze.dFma = e.dFma, ze.osC = e.osC, ze.osB = e.osB, ze.is6 = e.is6, ze.GFPV = e.GFPV, ze.IsQ = e.IsQ, ze.iLp = e.iLp, ze.isSLI = e.isSLI, ze.cSR = e.cSR, We.info("Telemetry for RDS: ", je), je.gx_telemetry.deviceId = v.deviceId, je.gx_telemetry.gpuDeviceId = e.dIDa, Ge.getRewardsSupported() ? we() : We.info("Rewards not supported due to min driver requirement") } function X(e) { We.debug("got gfwsl locale params", e), ze.lg = e.lg, ze.gLg = e.gLg, Ge.rewardsFaqUrl = T.BASE_URL + A.getCurrentLocaleWithUnderscore() + "&page=" + T.FAQ_REDEEM, ot = null, we() } function J(e) { We.debug("got gfwsl consent params", e.uCst), Ue.uCst = e.uCst, we() } function ee(e) { We.debug("got gfwsl geolocal params", e), ze.go = e.go, we() } function te() { if (Be.clientVersion && Be.driverVersion) { var e = u.formatPayloadRequest(Be); return e ? f.getSignedGpuId(e).then(function(e) { We.info("NvAPI returns device info", e.data.deviceInfo); var t = u.formatSignedPayload(e.data); return $e = { chId: t.deviceChipsetId, grId: t.deviceRevision, diCe: t.hashedEcid, eSgn: t.signedPayload, uVsn: t.ucodeVersion }, n.when($e) }).catch(function(e) { return We.error("ECID call failed, using fallback values"), $e = { chId: w.DEVICE_CHIPSET_ID, grId: w.DEVICE_REVISION, diCe: w.HASHED_ECID, eSgn: w.SIGNED_PAYLOAD, uVsn: w.UCODE_VERSION }, n.when($e) }) : (We.error("Ecid Request Object got invalid signed payload, using default ECID values"), $e = { chId: w.DEVICE_CHIPSET_ID, grId: w.DEVICE_REVISION, diCe: w.HASHED_ECID, eSgn: w.SIGNED_PAYLOAD, uVsn: w.UCODE_VERSION }, n.when($e)) } return We.error("ECID validation failed due to improper hardware information"), $e = { chId: w.DEVICE_CHIPSET_ID, grId: w.DEVICE_REVISION, diCe: w.HASHED_ECID, eSgn: w.SIGNED_PAYLOAD, uVsn: w.UCODE_VERSION }, n.when($e) } function ne(e, t) { var o = r.UNIFIED_REDEMPTION_ID; e && (o = E.jarvis.cevoClientId); var i = n.defer(); return Ze = i.promise, ie(o).then(function(e) { Be = { signAlgo: 1024, key: t.ecnon_egpk && t.ecnon_egpk.value, clientVersion: ze.gcV, driverVersion: ze.GFPV }, Be.nonce = t.ecnon_egcv.value.substring(0, 16) + e.delegateToken.substring(0, 16), te().then(function() { i.resolve() }) }).catch(function(e) { We.error("Catch block for jarvis delegate token fetch"), t.overallState = !1, i.reject(e) }), Ze } function re(e) { Fe = angular.merge({}, Fe, e) } function oe() { return Je || (We.debug("Resetting Rewards Session"), Fe.overallState = !1, ot = null, Ze = null, Qe = Ge.initGfwslSession()), Qe } function ie(e) { return K(), Ge.getDelegateToken(e) } function ae() { var e = "_egcV=" + (0, l.default)({ _egcV: ze.gcV, aiD: lt }); return t.rewards.getRewardsSession({}, e).then(function(e) { if (de(e)) return Fe.ecnon_egcv.value = e.data.html.body.sessionState.nonce.value, re(e.data.html.body.sessionState), n.when(Fe); var t = "Invalid GFWSL response for getRewardsSessionJt"; return We.error(t), n.reject(t) }) } function se() { var e = (0, l.default)({ _ecnon_GfV: Fe.ecnon_egcv.value + "~!~" + ze.gcV, aiD: lt, _theSysJson: ze }), r = xe(e, Fe), o = "_ecnon_GfV=" + encodeURIComponent(L.btoa(r)); return t.rewards.verifyRewardsSession({}, o).then(function(e) { if (de(e)) { var t = e.data.html.body.sessionState, r = t.vrfyRspPyld.value; if (Me(t, r)) return re(e.data.html.body.sessionState), re(Oe(r)), n.when(Fe); var o = "JWS verification failed for vrfyGfeWebSsnJt"; return We.error(o), n.reject(o) } var i = "Invalid GFWSL response for verifyRewardsSessionJt"; return We.error(i), n.reject(i) }).catch(function(e) { return We.error("Catch block for vrfyGfeWebSsnJt entered"), Fe.overallState = !1, n.reject(e) }) } function le() { if (Fe && Fe.overallState && Fe.gfeEtaExpire && Fe.gfeEtaExpire.value) { var e = new Date, t = new Date(Fe.gfeEtaExpire.value); return e.setSeconds(e.getSeconds() + 30), e < t } return !1 } function ce() { qe || Je || le() || oe() } function ue(e) { var t = (0, a.default)({}, e); t && t.type && t.message && (d.isEmpty(t.deltas) || d.forEach(t.deltas, function(e, n, r) { t.message += ", " + e.error }), v.push(t.type, { couponCode: t.couponCode || "", campaignName: t.campaignName || "", gpuDeviceId: ze.dIDa && ze.dIDa.toString() || "", lcid: parseInt(ze.lg, 10) || 0, errorMessage: t.message || "" })) } function de(e) { return e && e.data && e.data.html && e.data.html.body } function fe(e) { var t = de(e) && e.data.html.body.sessionState && e.data.html.body.sessionState.errorDetails && e.data.html.body.sessionState.errorDetails.message || e && e.data || ""; return (0, l.default)(t) } function me() { var e = (0, l.default)({ _vrsCmpgnStsPyldJson: { _ecnon_GfV: Fe.ecnon_egcv.value, aiD: lt, _theSysJson: ze, _thePiJson: { uID: Ue.userId, jTK: Ue.delegateToken, uCst: Ue.uCst }, _VrsHashDiceGpuAchJson: $e, _rdsPt: je } }), r = xe(e, Fe), o = "_ecnon_GfV=" + encodeURIComponent(L.btoa(r)); return t.rewards.getRedemptionHistory({}, o).then(function(e) { if (de(e)) { var t = e.data.html.body.sessionState, r = e.data.html.body.CampaignStatus; if (Me(t, r)) { re(e.data.html.body.sessionState); var o = Oe(r); return ne(!1, Fe).catch(function(e) { We.error("Single use values promise failed after Redemption History"), ue({ type: He.REWARDS_REDEMPTION_HISTORY_FETCH_FAILED_LOCAL, message: e && e.status && e.status.toString() }) }), n.when(o.vrsCampaignStatus.rewards) } var i = "JWS verification failed for Redemption History"; return We.error(i), n.reject(i) } var a = { data: "Invalid GFWSL response for Redemption History" }; return We.error(a.data), n.reject(a) }).catch(function(e) { return We.error("GFWSL Redemption History call failed"), ue({ type: He.REWARDS_REDEMPTION_HISTORY_FETCH_FAILED_GFWSL, message: fe(e) }), oe(), n.reject(e) }) } function pe(e) { return e && e.toUpperCase() || void 0 } function ge(e) { var t = { redeemed: [], available: [], locked: [], expired: [], unknown: [] }; return e.forEach(function(e) { switch (e.state = pe(e.state), e.status = pe(e.status), e.campaign.type = pe(e.campaign.type), e.status) { case r.REDEMPTION_STATES.REDEEMED: t.redeemed.push(e); break; case r.REDEMPTION_STATES.AVAILABLE: t.available.push(e); break; case r.REDEMPTION_STATES.LOCKED: t.locked.push(e); break; case r.REDEMPTION_STATES.EXPIRED: t.expired.push(e); break; default: t.unknown.push(e) } }), t } function ve(e) { We.info("rewards socket update from node:", e), "FINISHED" === e.status && (ot = null, we()) } function he(e) { M.checkSearchAvailability().then(function(t) { if (t) { var n = {}, r = "l10n.rewards", o = ["nvRewardCard", "nvRewardsCenter"], i = M.getDirectivel10nTags("nvRewardsCenter"); i.push("l10n.checkCouponRetailer"), i.push("l10n.gfeGiveaway"), n["l10n.redeem"] = { description: i }; var a = [r, "l10n.redeem", "l10n.availableTill"]; d.forEach(e.available, function(e) { n[e.campaign.title] = { description: a } }), d.forEach(e.locked, function(e) { n[e.campaign.title] = { description: a } }); var s = [r, "l10n.redeemed", "l10n.redeemedOn", "l10n.details"]; d.forEach(e.redeemed, function(e) { n[e.campaign.title] = { description: s } }), M.buildStateIndex("main.auth.rewards", n, { ignoredDirectives: o }) } }) } function ye(e, r, o) { var i = {}; switch (r) { case B.COUPON: i = { CPN: e }; break; case B.AVAILABLE_REWARD: i = { cmID: e }; break; case B.REDEEMED_REWARD: i = { rID: e } } var a = (0, l.default)({ _vrsCmpgnRdmPyldJson: { _ecnon_GfV: Fe.ecnon_egcv.value, aiD: lt, _theSysJson: ze, _thePiJson: { uID: Ue.userId, jTK: Ue.delegateToken, uCst: Ue.uCst }, _theVrsRwdJson: i, _RdmHashDiceGpuJson: $e } }), s = xe(a, Fe), c = "_ecnon_GfV=" + encodeURIComponent(L.btoa(s)); return t.rewards.redeemReward({}, c).then(function(e) { if (de(e)) { var t = e.data.html.body.sessionState, r = e.data.html.body.CampaignRedeem; if (Me(t, r)) { re(e.data.html.body.sessionState), ne(!1, Fe); var i = Oe(r).vrsCampaignRedeem[0], a = pe(i.status); return a === V.FAILURE ? (ue({ type: o.redeemFailureEvent, message: i.error.code, campaignName: i.campaign.uuid }), n.reject(i.error)) : n.when(i) } var s = "JWS verification failed for Redeem"; return We.error(s), n.reject(s) } var l = { data: "Invalid GFWSL response for Redeem" }; return We.error(l.data), n.reject(l) }) } function Ee() { if (it) return n.resolve(it); if (!Xe) { We.info("Making a new call for rewards status"); var e = n.defer(); Xe = e.promise, R.getFeature({ cvName: N.REWARDS_FEATURE_TOGGLE, gfeVersion: ze.gcV, gpuDriverVersion: ze.GFPV, telemetrySubUseCase: H.REWARDS_FEATURE_ELIGIBILITY }).then(function(t) { it = t.value.IsRewardEnabled, We.info("Rewards status has been set to: ", it), !d.isEmpty(t) && t && t.value && (it = t.value.IsRewardEnabled, We.info("Rewards status has been set to: ", it), it ? e.resolve(it) : e.reject(it)), s.trigger(p.FEATURE_STATUS_UPDATED, it) }).catch(function() { We.error("Disabling rewards"), e.reject(!1), s.trigger(p.FEATURE_STATUS_UPDATED, !1) }).finally(function() { Xe = null }) } return Xe } function be() { We.debug("Waiting on Rewards dependencies onlineState, jarvisUser, minDriverVersion, IP, Locale, Geo", i.onlineState && i.onlineState.online, !angular.isUndefined(Pe), Ge.getRewardsSupported(), ze.lg, ze.go) } function Se() { Pe && qe && !Ke && (Ke = x(function() { K(), Pe && qe && (Ye.reject("Rewards service init timed out, dependencies unmet"), be(), Ke = null) }, 3e4)) } function _e() { Ke && (x.cancel(Ke), Ke = null) } function we() { return We.info("Received event to validate rewards status and session"), Je ? void We.info("Session refresh already in progress, no action needed") : (K(), Se(), void(i.onlineState && i.onlineState.online && Pe && Ge.getRewardsSupported() && ze.lg && ze.go ? Ee().then(function(e) { le() ? (We.info("Valid GFWSL session exists"), ot ? We.info("Rewards refresh not required") : (Ue.delegateToken || (We.debug("Jarvis delegate needs update, refreshing single use values"), ne(!1, Fe)), We.info("No cached rewards available, starting fetch"), Ge.getRedemptionHistory())) : (oe(), Ge.getRedemptionHistory()), Ye.resolve() }).catch(function(e) { We.info("Rewards not supported, will not initialize session"), Ye.reject(e) }).finally(function() { qe = null, _e() }) : be())) } function Ae(e) { var r = n.defer(); return t.profile.targetGfeAchievements({ gfwslParams: { cmID: e } }).then(function(e) { if (de(e)) { var t = JSON.parse(e.data.html.body.sessionState.overallState); r.resolve(t) } else { var n = "Invalid response for GFWSL targetGfeAchievements"; We.error(n), r.reject(n) } }).catch(function(e) { r.reject(e) }), r.promise } function Te() { return Ie().then(function(e) { return Ce(e).then(function(e) { return ne(!0, e).then(function() { return Re(e) }) }) }) } function Ie() { var e = "_egcV=" + (0, l.default)({ _egcV: ze.gcV, aiD: lt }); return t.profile.getProfileSession({}, e).then(function(e) { if (de(e)) { var t = e.data.html.body.sessionState; return t.ecnon_egcv = t.nonce, n.when(t) } var r = "Invalid GFWSL response for getRewardsSessionJt"; return We.error(r), n.reject(r) }) } function Ce(e) { var r = (0, l.default)({ _ecnon_GfV: e.ecnon_egcv.value + "~!~" + ze.gcV, aiD: lt, _theSysJson: ze }), o = xe(r, e), i = "_ecnon_GfV=" + encodeURIComponent(L.btoa(o)); return t.profile.verifyProfileSession({}, i).then(function(t) { if (de(t)) { var r = t.data.html.body.sessionState, o = r.vrfyRspPyld.value, i = Me(r, o); if (i) { e = angular.merge({}, e, r); var a = Oe(o); return n.when(angular.merge({}, e, a)) } var s = "JWS verification failed for vrfyGfeWebSsnJt"; return We.error(s), n.reject(s) } var l = "Invalid GFWSL response for vrfyGfeWebSsnJt"; return We.error(l), n.reject(l) }).catch(function(e) { return We.error("Catch block for vrfyGfeWebSsnJt entered"), n.reject(e) }) } function xe(e, t) { var n = (0, l.default)({ typ: "JWT", alg: ft }), r = { _pyld: e }, o = t.ecnon_egcv.value + "." + lt; return Ge.jwsLib.sign(ft, n, r, o) } function Me(e, t) { var n = De(t), r = e.ecnon_egcv.value + "." + lt; return Ge.jwsLib.verify(n, r, [ft]) } function De(e) { return L.atob(decodeURIComponent(e)) } function Oe(e) { var t = Ge.jwsLib.parse(De(e)), n = JSON.parse(t.payloadPP); return JSON.parse(n) } function Re(e) { var r = (0, l.default)({ _tgrGpuAchPyldJson: { _ecnon_GfV: e.ecnon_egcv.value, aiD: lt, _theSysJson: ze, _thePiJson: { uID: Ue.userId, jTK: Ue.delegateToken, uCst: Ue.uCst }, _TgrHashDiceGpuAchJson: $e } }), o = xe(r, e), i = "_ecnon_GfV=" + encodeURIComponent(L.btoa(o)); return t.profile.triggerGpuAchievement({}, i).catch(function(e) { return We.error("Catch block for triggerGpuAchievementJt entered"), n.reject(e) }) } function Ne(e) { return Ae($.SWEEPSTAKES).then(function(t) { return t ? Ie().then(function(t) { return Ce(t).then(function(t) { return ne(!0, t).then(function() { return Le(t, e) }) }) }) : n.reject({ success: !1, errorMessage: W("translate")("l10n.tokensMinGpu") }) }) } function Le(e, r) { var o = (0, l.default)({ _swpPyldJson: { _ecnon_GfV: e.ecnon_egcv.value, aiD: lt, _theSysJson: ze, _thePiJson: { uID: Ue.userId, jTK: Ue.delegateToken, uCst: Ue.uCst }, _theClmSwpJson: { gID: r.id.toString(), gTi: r.title, gTn: r.deltaTokens }, _ClmHsahDiceRwdJson: $e } }), i = xe(o, e), a = "_ecnon_GfV=" + encodeURIComponent(L.btoa(i)); return t.profile.attemptSweepstakeEntry({}, a).then(function(e) { if (de(e)) { var t = e.data.html.body.sessionState, r = e.data.html.body.GfeProfileSweepsEntry; if (Me(t, r)) { var o = Oe(r), i = o.cevoGfeProfileSweepsEntry; return i.success ? n.when({ success: !0, updatedStampMicro: i.updatedStampMicro, tokens: i.tokens, tokenBalance: i.tokenBalance, giveawayTokens: i.giveawayTokens }) : n.when({ success: !1, errorMessage: i.error, errorDetails: i.errorDetails }) } var a = { data: "validation failed on GFWSL sweepstake entry endpoint" }; return We.error(a.data), n.reject({ success: !1, errorDetails: a.data }) } var s = { data: "Invalid GFWSL response for sweepstake entry endpoint" }; return We.error(s.data), n.reject({ success: !1, errorDetails: s.data }) }).catch(function(e) { var t = { data: "Invalid GFWSL response for sweepstake entry endpoint" }; return We.error("Catch block for trySweepstakeEntryJt entered"), n.reject({ success: !1, errorDetails: t.data }) }) } var Pe, ke, Ge = this, Fe = { ecnon_egcv: {} }, Ue = { userId: "", delegateToken: "", uCst: ["-1", "-1", "-1"] }, Ve = [], ze = { gcV: i.version }, Be = {}, $e = {}, We = e.getInstance("main.rewards/rewardsService"), He = h, je = { gx_telemetry: { deviceId: "", sessionId: "", gpuDeviceId: "", clientVer: ze.gcV }, rdsRlm: E.rds.portalRealm }, Ye = null, qe = null, Ke = null, Qe = null, Ze = null, Xe = null, Je = !1, et = !1, tt = null, nt = null, rt = null, ot = null, it = !1, at = [], st = E.userAgent + "/" + i.version, lt = null, ct = !1, ut = !1, dt = null, ft = "HS512"; Ge.jwsLib = m.default.jws.JWS; try { lt = g.default.sha256().update(st).digest("hex") } catch (e) { We.error("Failed to generate md5 hash for gfe user agent", e), lt = st } Ge.getFormattedImageUrl = function(e, t) { return e + "-" + t + ".png" }, Ge.getRewardsTabSelected = function() { return ut || _.is("main.auth.rewards") }, Ge.setRewardsTabSelected = function(e) { ut = e }; var mt = function(e) { ct ? s.trigger(O.VIEW_PROFILE_PAGE, { tabName: D.REWARDS_TAB, rewardsPackageId: e, callback: Y.bind(null, e) }) : "main.auth.rewards" === _.current.name ? Y(e) : _.go("main.auth.rewards", { rewardPackageId: e }) }; Ge.getRedeemRequestData = function() { return { sysInfo: ze, gfwslInfo: Ve } }, Ge.getDelegateToken = function(e) { return o.getDelegateToken(e).then(function(e) { return Ue.delegateToken = e.data.delegateToken, n.when(Ue) }) }, Ge.initGfwslSession = function() { if (!Je) { var e = n.defer(); Qe = e.promise, Je = !0, Fe && Fe.overallState ? (We.info("Rewards session exists, verifying"), se().then(function() { ne(!1, Fe).then(function() { e.resolve(), Je = !1; }).catch(function(t) { We.error("Single use values promise failed while validating session"), e.reject(t), Je = !1 }) }).catch(function(e) { We.error("current rewards session invalid, retrying with new session"), Je = !1, oe() })) : (We.info("Creating a new Session for Rewards"), ae().then(function(t) { se().then(function(t) { ne(!1, Fe).then(function() { e.resolve(), Je = !1 }).catch(function(t) { We.error("Single use values promise failed while creating new session"), e.reject(t), Je = !1 }) }).catch(function(t) { We.error("GFWSL verfySession failed for new getSession"), e.reject(t), Je = !1 }) }).catch(function(t) { We.error("GFWSL getSession failed"), e.reject(t), Je = !1 })) } return Qe }, Ge.getRedemptionHistory = function() { if (qe) return qe.then(function() { return Ge.getRedemptionHistory() }); if (et) return tt; if (ot) return n.when(ot); et = !0; var e = n.defer(), t = n.defer(); return tt = e.promise, nt = t.promise, ke = v.startLoad(h.REWARDS_REDEMPTION_HISTORY_FETCH_RESPONSE_TIME), ce(), n.all([Qe, Ze, rt, dt]).then(function() { me().then(function(n) { v.endLoad(h.REWARDS_REDEMPTION_HISTORY_FETCH_RESPONSE_TIME, ke, { couponCode: "", campaignName: "", gpuDeviceId: ze.dIDa && ze.dIDa.toString() || "", lcid: parseInt(ze.lg, 10) || 0 }), ot = ge(n), e.resolve(ot), t.resolve(), s.trigger(p.REWARDS_UPDATED, ot), q(ot.available.filter(function(e) { return !e.state || e.state !== r.REDEMPTION_STATES.CLAIMABLE })) }).catch(function(n) { We.error("Failed to get Rewards History from GFWSL"), e.reject(n), t.resolve() }).finally(function() { et = !1, tt = null, nt = null }) }).catch(function(n) { We.error("One or more promises rejected for Redemption History"), e.reject(n), t.resolve(), et = !1, tt = null, nt = null }), tt }, Ge.clearCachedRewards = function() { ot = null }, Ge.initialize = function() { return E.forceDisableFeatures && E.forceDisableFeatures.rewards ? void We.info("Rewards feature has been force disabled") : (s.on(c.LOGIN_STATUS_CHANGE, Q), s.on(c.GFWSL_SYS_PARAMS_UPDATED, Z), s.on(c.GFWSL_LOCALE_PARAMS_UPDATED, X), s.on(c.GFWSL_GEOLOCAL_PARAMS_UPDATED, ee), s.on(c.GFWSL_CONSENT_PARAMS_UPDATED, J), s.on(c.ONLINE, we), s.on(c.USER_PROFILE_STATUS_UPDATED, j), b.register(S.REWARDS_UPDATE_FROM_NODE, p.BACKEND_REWARDS_FETCHED), s.on(p.BACKEND_REWARDS_FETCHED, ve), K(), je.gx_telemetry.sessionId = v.sessionId, Ye = n.defer(), qe = Ye.promise, void s.on(p.REWARDS_UPDATED, he)) }, Ge.redeemEntitlement = function(e, t) { if (et) return tt.then(function() { return We.debug("Finished rewards check before calling redeem"), Ge.redeemEntitlement(e, t) }); var r = { responseTimeEvent: "", responseTimePayload: { couponCode: "", campaignName: "", gpuDeviceId: ze.dIDa && ze.dIDa.toString() || "", lcid: parseInt(ze.lg, 10) || 0 }, redeemFailureEvent: "", gfwslFailureEvent: "" }; return t === B.COUPON ? (r.responseTimeEvent = h.REWARDS_REDEEM_CODE_VERIFICATION_RESPONSE_TIME, r.redeemFailureEvent = h.REWARDS_REDEEM_CODE_VERIFICATION_FAILED_RDS, r.gfwslFailureEvent = h.REWARDS_REDEEM_CODE_VERIFICATION_FAILED_GFWSL, r.responseTimePayload.couponCode = e) : (r.responseTimeEvent = h.REWARDS_CLAIM_ENTITLEMENT_RESPONSE_TIME, r.redeemFailureEvent = h.REWARDS_CLAIM_ENTITLEMENT_FAILED_RDS, r.gfwslFailureEvent = h.REWARDS_CLAIM_ENTITLEMENT_FAILED_GFWSL), ce(), n.all([qe, Qe, Ze, rt, dt]).then(function() { var o = v.startLoad(r.responseTimeEvent); return ye(e, t, r).then(function(e) { return r.responseTimePayload.campaignName = e.campaign.uuid || "", v.endLoad(r.responseTimeEvent, o, r.responseTimePayload), ot = null, n.when(e) }) }).catch(function(e) { return We.error("Catch block for Redeem entered"), (!e || e && !e.type) && ue({ type: r.gfwslFailureEvent, message: fe(e), couponCode: r.responseTimePayload.couponCode }), oe(), n.reject(e) }) }, Ge.getRewardsSupported = function() { return ze.GFPV && parseFloat(ze.GFPV, 10) > r.MIN_SUPPORTED_DRIVER }, Ge.getRewardsEnabled = function() { return qe ? qe.then(function() { return Ge.getRewardsEnabled() }) : Ee() }, Ge.openLearnMoreWindow = function(e) { v.push(h.REWARDS_LEARN_MORE), e ? I.openDefaultBrowser(e) : I.openDefaultBrowser(Ge.rewardsFaqUrl) }, Ge.openRedeemUrl = function() { var e = T.BASE_URL + A.getCurrentLocaleWithUnderscore() + "&page=" + T.NVIDIA_REDEEM; I.openDefaultBrowser(e) }, Ge.triggerGpuAchievement = function() { if (rt) return rt; var e = n.defer(); rt = e.promise, ce(), n.all([qe, Qe, Ze, nt, dt]).then(function() { return Ae($.ACHIEVEMENTS).then(function(t) { t ? Te().then(function() { var t = "GPU achievement trigger success"; We.info(t, "now trigger cevo refresh"), P.refresh(), v.push(h.USER_TRIGGER_GPU_ACHIEVEMENT_SUCCESS, { action: k.UNLOCKED, useCase: U.ACHIEVEMENT, status: F.SUCCESS, currentScreen: G.SCREEN_ACHIEVEMENTS, additionalMessage: t }), oe().finally(function() { e.resolve(), rt = null }) }).catch(function(t) { var n = t && (0, l.default)(t).substr(0, 1024) || "Failed to trigger GPU Achievement"; v.push(h.USER_TRIGGER_GPU_ACHIEVEMENT_FAILURE, { action: k.UNLOCKED, useCase: U.ACHIEVEMENT, status: F.FAILURE, currentScreen: G.SCREEN_ACHIEVEMENTS, additionalMessage: n }), oe().finally(function() { e.resolve(), rt = null }) }) : e.resolve() }).catch(function() { e.resolve(), rt = null }), rt }) }, Ge.trySweepstakeEntry = function(e) { if (dt) return dt; var t = n.defer(); return dt = t.promise, n.all([qe, Qe, Ze, nt, rt]).finally(function() { var n = void 0; Ne(e).then(function(e) { n = e }).catch(function(e) { n = e }).finally(function() { t.resolve(n), dt = null, Fe.overallState = !1 }) }), dt } }]); t.rewardsService = v }, , , , , , , , , , , , function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvNoContentFallback = void 0; var o = n(1), i = n(749), a = r(i), s = o.ngMainCommonModule.component("nvNoContentFallback", { bindings: { nvTip: "@", nvImageSrc: "@" }, transclude: !0, template: a.default }); t.nvNoContentFallback = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.userGamesService = void 0; var o = n(3), i = r(o), a = n(14); n(12), n(46), n(63), n(37), n(121); var s = a.ngGamesModule.service("userGamesService", ["eventAggregator", "GAME_EVENTS", "gamesService", "$log", "dbCacheService", "DB_NAMES", "gfeSearchService", "COMMON_EVENTS", function(e, t, n, r, o, a, s, l) { function c() { return v.debug("updateUserGames"), n.getCachedGames().then(function(e) { var t = i.map(e, function(e) { return e.id.toString() }); v.info("Games count in userGamesSet and newUserGamesSet is: ", p.length, " and ", t.length); var n = i.difference(t, p); i.each(n, function(e) { m[e] = i.defaults(m[e] || {}, { id: e, gameId: parseInt(e), favorite: !1, hidden: !1 }) }), m.persist_(), p = t }).catch(function(e) { v.error("updateUserGames error") }).finally(function() { v.info("trigger usergamesupdated"), u(), g || (m.observe_(e.trigger.bind(null, t.USERGAMES_UPDATED)), g = !0) }) } function u() { s.checkSearchAvailability().then(function(e) { if (e) { var t = {}, r = f.getUserGames(); if (r && r.length) { var o = ["l10n.games"]; i.forEach(r, function(e) { var r = n.getSystemGame(e.gameId); r && r.displayName && (t[r.displayName] = { description: o, param: e.id }) }) } s.buildStateIndex("main.auth.home.gamesAndFriends.gameDetails", t, { customStopWords: [] }) } }) } var d, f = this, m = {}, p = [], g = !1, v = r.getInstance("main.games/userGamesService"); f.getUserGames = function() { return i.map(p, function(e) { return i.clone(m[e]) }) }, f.getUserGame = function(e) { var t = i.findWhere(f.getUserGames(), { id: e }); return t ? i.clone(t) : (v.error("getUserGame failed", e), {}) }, f.updateFavoriteHiddenState = function(n, r, o) { n && (m[n] = m[n] || {}, m[n].favorite = r, m[n].hidden = o, m.persist_(), e.trigger(t.USERGAME_UPDATED, m[n])) }, f.initialize = function(n) { v.info("initialize user games"), p = [], m = o.getCachedUserItem(n.userId, a.JARVIS_GFE_STORE, a.JARVIS_GAME_LIST), m.sync_().then(function() { d || (d = !0, e.on(t.GAMELIST_UPDATED, c)), c() }), e.on(l.LOCALE_CHANGED, u) }, f.getInitializedOnce = function() { return g } }]); t.userGamesService = s }, , , , , , , function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvTelemetry = void 0; var o = n(3), i = r(o), a = n(24); n(16); var s = a.ngTelemetryModule.directive("nvTelemetry", ["telemetryService", function(e) { return { restrict: "A", priority: 1, link: function(t, n, r, o, a) { function s(t) { if (!t.defaultPrevented) { var r = !0; if ("nv-inline-dropdown" === c && n[0].attributes.class.nodeValue.indexOf("open") === -1 && (r = !1, t.preventDefault()), "nv-accordion-pane" === c) { if ("a" === t.target.tagName.toLowerCase()) return; n[0].attributes.class.nodeValue.indexOf("collapsed") !== -1 && (r = !1, t.preventDefault()) } r && (e.push(d.tarconID, d.url, d.eventMetaData), "a" !== c && t.preventDefault()) } } function l() { f(), n.off("click", s), n.remove(), n = null } var c = n[0].tagName.toLowerCase(), u = i.propertyOf(r)("nvTelemetry"), d = u && "string" == typeof u && JSON.parse(u), f = r.$observe("nvTelemetry", function(e) { d = JSON.parse(e) }); n.on("click", s), t.$on("$destroy", l) } } }]); ! function(e) { angular.forEach(e, function(e) { a.ngTelemetryModule.directive(e, ["telemetryService", function(e) { return { restrict: "E", link: function(e, t, n, r, o) { if (!n.hasOwnProperty("nvTelemetry")) { var i = {}; angular.forEach(n, function(e, t) { "string" == typeof e && (i[t] = e) }) } } } }]) }) }(["a", "button", "img"]), t.nvTelemetry = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } function o(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.updatesService = void 0; var i = n(3), a = o(i), s = n(10); n(633), n(115), n(51), n(114), n(136), n(22), n(16), n(612), n(499), n(121); var l = n(192), c = r(l), u = s.ngUpdatesModule.service("updatesService", ["$log", "$filter", "TASK_STATUS", "updatesInstallerDialogService", "INSTALLER_PAGE", "eventAggregator", "INSTALLER_EVENTS", "$q", "driversEndpoints", "UPDATE_EVENTS", "UPDATE_SOCKET_EVENTS", "socketService", "UPDATE_REFRESH_STATUS", "INSTALLER_FORM_EVENT", "downloadsEndpoints", "DOWNLOAD_PROGRESS_STATUS", "DOWNLOAD_SOCKET_EVENTS", "installersEndpoints", "INSTALLER_SOCKET_EVENTS", "hardwareService", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "gfwslDriverInformationService", "INSTALLER_ERROR_CODE", "COMMON_EVENTS", "nodeService", "SOCKETIO_EVENTS", "PREFETCH_EVENTS", "$rootScope", "$compile", "cefService", "$mdDialog", "gfeSearchService", "gfwslEndpoints", "CRD_GFWSL_CAMPAIGNS", "gfeService", "DRIVERTYPE", "CRD_STATE_EVENT", function(e, t, n, r, o, i, s, l, u, d, f, m, p, g, v, h, y, E, b, S, _, w, A, T, I, C, x, M, D, O, R, N, L, P, k, G, F, U) { function V(e) { if (e) switch (e.status) { case n.TASK_PAUSED: case n.TASK_PAUSED_UNABLE_TO_REACH_SERVER: R.taskbarProgress("percentage", Math.round(e.percentComplete)), R.taskbarProgress("pause"); break; case n.TASK_RUNNING: case n.TASK_RETRY: e.percentComplete && R.taskbarProgress("percentage", Math.round(e.percentComplete)); break; case n.TASK_FAILED_UNABLE_TO_REACH_SERVER: case n.TASK_CHECK_SUM_ERROR: case n.TASK_DISK_WRITE_FAIL: case n.TASK_SIGNATURE_VERIFICATION_FAILS: case n.TASK_DOWNLOAD_ERROR: case n.TASK_COMPLETED: R.taskbarProgress("complete") } } function z() { Pe.info("onSocketConnect has been called"), Se && Se[0] && Se[0].downloadStatus && Se[0].downloadStatus.status === n.TASK_RUNNING ? (Pe.info("get download status after re-connect for Updates List"), J(Se[0])) : we && we.downloadStatus && we.downloadStatus.status === n.TASK_RUNNING && (Pe.info("get download status after re-connect for installed Driver"), J(we)) } function B() { var e; for (e in Te) Te[e]() } function $() { Ee.scanCompleted = !0, ce(), B() } function W(e) { if (e === T.NV_INSTALLER_UAC_CANCELED || e === T.NV_PACKAGE_EXTRACTION_UAC_CANCELED) r.cancel(); else { var n = { form: o.NVIFORM_INSTALL_START_FAILED, method: g.SHOW_FORM, constraintFailText: [], bullets: [], errorCode: e }; switch (e) { case T.NV_INSTALLER_ALREADY_RUNNING: n.constraintFailText[0] = t("translate")("l10n.otherInstallationRunning"); break; case T.NV_EXTRACTION_MEMORY: n.constraintFailText[0] = t("translate")("l10n.insufficientMemory"); break; case T.NV_EXTRACTION_NOT_ENOUGH_SPACE_OR_CORRUPT: n.constraintFailText[0] = t("translate")("l10n.extractionErrorHeader"), n.bullets[0] = t("translate")("l10n.extractionErrorNotEnoughSpace"), n.bullets[1] = t("translate")("l10n.extractionErrorCorrupt"); break; default: n.constraintFailText[0] = t("translate")("l10n.anErrorOccured") } r.showInstallerForm(n) } } function H() { Pe.info("query installer about last state "), E.start({}, { driverLocation: "", isCustom: !1, resumeInstall: !1, fromLastState: !0 }).then(function() { Pe.info("got response about about last state ") }).catch(function(e) { Pe.error("failed to query last installation state error code:", e.data, " status:", e.status, " params:", e.config.data, e) }) } function j() { Pe.info("installer and UI are now disconnected") } function Y() { Pe.info("Connection error during installation.") } function q() { Pe.info("unsubScribeDriverInstallationNotification() called"), i.off(s.INSTALL_FORM, pe), i.off(s.INSTALL_CANCEL, q), i.off(s.INSTALL_DONE, Q), i.off(x.CONNECT, H), i.off(x.DISCONNECT, j), i.off(x.ERROR, Y), C.setReconnectionToDefault() } function K() { Pe.info("subScribeDriverInstallationNotification() called"), i.on(s.INSTALL_FORM, pe), i.on(s.INSTALL_CANCEL, q), i.on(s.INSTALL_DONE, Q), i.on(x.CONNECT, H), i.on(x.DISCONNECT, j), i.on(x.ERROR, Y), C.setReconnectionToInfinity() } function Q() { ae(), q() } function Z(e, t, n) { K(), r.showInstallationForm(e, t, n), Ee.invokeInstallation(e, t, n) } function X(e) { return e.releaseDateTime = "", e.downloadURL = "", e.name = e.isCRD === F.CRD ? t("translate")("l10n.fallbackGeforeceCrdDriverName") : t("translate")("l10n.fallbackGeforceDriverName"), A.getDriverInformation(e.version, e.isCRD).then(function(t) { return t && t.DriverAttributes && (e.name = t.DriverAttributes.Name, e.releaseDateTime = t.DriverAttributes.ReleaseDateTime, e.downloadURL = t.DriverAttributes.DownloadURL), e }).catch(function(t) { return Pe.error("getDriverInformation failed with error: ", t + " for driver version:" + e.version), e }) } function J(e) { return v.getStatus({ version: e.version, url: e.downloadURL }).then(function(t) { return e.downloadStatus = t.data, Pe.info("download getStatus for version: ", e.version, " ", t), V(t.data), e }).catch(function(t) { return Pe.error("download getStatus failed: ", t.data, " status: ", t.status), e }) } function ee(e) { try { return JSON.parse(e) } catch (t) { return Pe.error("Json parsing exception for ", e), null } } function te() { if (xe && xe.content.gfeLoadUrl) { var e = xe.content.gfeLoadUrl; e = e.replace(/\\/g, ""); var t = e.split("{"); if (2 !== t.length) return Pe.error("Cannot request for article as gfeloadUrl is incorrect ", xe.content.gfeLoadUrl), l.reject(); t[1] = "{" + t[1]; var n = ee(t[1]); return n ? Ee.getDriverArticle(t[0], n, xe.content.driverVersion).then(function(e) { if (_.push(w.UPDATES_GRD_ARTICLE_SUCCESS), e && e.data && e.data.gfcontent) { Pe.debug("get driver article returns content"); var t = {}, n = e.data.gfcontent; return t.title = n.title, t.subTitle = n.author_date ? n.author_date.by_on_date : null, t.body = n.body, t.style = "article-content", t } return Pe.debug("get driver article returns null content"), null }).catch(function(e) { return _.push(w.UPDATES_GRD_ARTICLE_FAILURE, e && e.status && e.status.toString() || ""), l.reject(e) }) : (Pe.error("Cannot request for article as gfeloadUrl has incorrect json ", xe.content.gfeLoadUrl), l.reject()) } return Pe.error("article url empty for ", xe.content.gfeLoadUrl), l.reject("no article url") } function ne(e, t) { if (e && e.gfeLoadUrl) { var n = e.gfeLoadUrl; n = n.replace(/\\/g, ""); var r = n.split("{"); if (2 !== r.length) return Pe.error("Cannot request for article as gfeloadUrl is incorrect ", e.gfeLoadUrl), l.reject(); r[1] = "{" + r[1]; var o = ee(r[1]); o && Ee.getDriverArticle(r[0], o, t).then(function(e) { if (e.data && e.data.gfcontent) { var t, n = e.data.gfcontent.body, r = D.$new(), o = O(n)(r), a = o.find("img"), s = o.find("link"), l = [], c = []; for (t = 0; t < a.length; t++) l.push(a[t].src); for (t = 0; t < s.length; t++) "stylesheet" === s[t].rel && c.push(s[t].href); c.length > 0 && i.trigger(M.PRELOAD_STYLES, c), l.length > 0 && i.trigger(M.PREFETCH_RESOURCES, l), o.empty(), o.remove(), o = null, r.$destroy() } }) } } function re(e, t) { Ee.getDriverInformation(e, t).then(function(t) { var n, r, o = []; t && t.DriverAttributes && (n = t.DriverAttributes.highlightGfeNg, r = t.DriverAttributes.bannerGfeNg), r && r.forEach(function(e) { o.push(e.image) }), n && n.tiles && n.tiles.forEach(function(t) { o.push(t.coverImage), ne(t, e) }), o.length && i.trigger(M.PREFETCH_RESOURCES, o) }) } function oe() { return _e = S.getSystemInfo().then(function(e) { if (Pe.info("getSystemInfo() returns installedDriver version ", e.DriverVersion), a.isNull(e) || a.isEmpty(e.DriverVersion)) return l.reject("getSystemInfo() return empty installed driver version"); var t = { taskId: 0, bytesDone: 0, totalBytes: 0, status: -1, timeRemaining: 0, downloadSpeed: 0, downloadedLocation: "" }; return we = { version: e.DriverVersion, downloadStatus: t, isCRD: e.DriverType ? JSON.parse(e.DriverType) : F.GRD } }).catch(function(e) { return Pe.error("error getting installed driver version:data", e.data, " status:", e.status), l.reject(e.data) }).then(X).then(J).finally(function() { _e = void 0 }), _e.then(function(e) { re(e.version, e.isCRD) }), _e } function ie(e) { var t, n = []; return angular.forEach(e, function(e) { var r = {}, o = { taskId: 0, bytesDone: 0, totalBytes: 0, status: -1, timeRemaining: 0, downloadSpeed: 0, downloadedLocation: "", failureCount: 0 }; r.name = e.name, r.version = e.version, r.releaseDateTime = e.releaseDateTime, r.isBeta = e.isBeta, r.downloadStatus = o, r.downloadURL = e.downloadURL, r.isCRD = e.driverType, n.push(r), Se = n, t = v.getStatus({ version: e.version, url: r.downloadURL }).then(function(e) { return r.downloadStatus = e.data, V(r.downloadStatus), Se }).catch(function(e) { return Pe.error("download getStatus failed: ", e.data, " status: ", e.status), Se }) }), t } function ae() { Se = void 0, Ae = null, _e = null, Ee.driverInstalled = !0, we = null, be = null, ce() } function se(e) { Pe.info("sysinfo updated", e.DriverVersion), (we && e.DriverVersion !== we.version || !we && e.DriverVersion) && (_e = null, we = null, be = null, Se = void 0, Ae = null, ge().finally(function() { Ee.getInstalledDriver(), Ee.getUpdateDetails(), i.trigger(d.INSTALLED_DRIVER_UPDATE) })) } function le() { var e = S.getLaunchTimeSystemInfo().then(function(e) { if (Pe.info("getLaunchTimeSystemInfo() returns installedDriver version ", e.DriverVersion), a.isNull(e) || a.isEmpty(e.DriverVersion)) return l.reject("getLaunchTimeSystemInfo() return empty installed driver version"); var t = { taskId: 0, bytesDone: 0, totalBytes: 0, status: -1, timeRemaining: 0, downloadSpeed: 0, downloadedLocation: "" }; return we = { version: e.DriverVersion, downloadStatus: t, isCRD: e.DriverType ? JSON.parse(e.DriverType) : F.GRD } }).catch(function(e) { return Pe.error("error init installed driver version:data", e.data, " status:", e.status), l.reject(e.data) }).then(X).then(J); e.then(function(e) { re(e.version, e.isCRD) }) } function ce() { L.checkSearchAvailability().then(function(e) { if (e) { var t = {}, n = [], r = [], o = [], i = L.getDirectivel10nTags("nvUpdatesDriver"), s = {}, c = {}; a.forEach(L.getDirectivel10nTags("nvDriverItem"), function(e) { o.push(e) }), r.push(Ee.getUpdateDetails().then(function(e) { c[0] = !0, s[0] = e }).catch(function() { c[0] = !1 })), r.push(Ee.getInstalledDriver().then(function(e) { c[1] = !0, s[1] = e }).catch(function() { c[1] = !1 })), l.all(r).then(function(e) { if (c[0] && a.forEach(s[0], function(e) { if (e && e.version && e.name) { Pe.info("Adding docs for driver version " + e.version); var r = e.name, i = a.clone(o); i.push(e.version), t[r] = { description: i }, n.push(e) } else Pe.error("getUpdateDetails returned empty data or version") }), c[1]) { i.push("l10n.currentlyInstalled"); var r = s[1]; if (r && r.version && r.name) { Pe.info("Adding docs for driver version " + r.version); var l = r.name, u = a.clone(o); u.push(r.version), t[l] = { description: u }, n.push(r) } else Pe.error("getInstalledDriver returned empty data or version") } t["l10n.updates"] = { description: i }, ue(t, n) }) } }) } function ue(e, t) { var n = ["l10n.highlights"]; a.forEach(L.getDirectivel10nTags("nvHighlightTile"), function(e) { n.push(e) }); var r = [], o = []; a.each(t, function(e) { r.push(Ee.getDriverInformation(e.version, e.isCRD).then(function(t) { o.push({ name: e.name, data: t }) }).catch(function() { Pe.error("getDriverInformation failed on ", e.version) })) }), l.all(r).then(function(t) { var r = ["nvDriverItem", "nvHighlightTile", "nvUpdatesDriver"]; a.each(o, function(t) { var r = t.data; r && r.DriverAttributes && r.DriverAttributes.highlightGfeNg && (e[t.name].description.push(r.DriverAttributes.ReleaseNotesAbstract || ""), a.forEach(r.DriverAttributes.highlightGfeNg.tiles, function(t) { if (t && t.name) { var r = [t.description || ""]; r.push.apply(r, n), e[t.name] = { description: r } } })) }), L.buildStateIndex("main.auth.updates", e, { ignoredDirectives: r }) }) } function de() { Le = !0 } function fe() { Le = !1 } function me() { return P.hasHardwareInfo() ? l.when(!0) : S.getSystemInfo().then(function(e) { return Pe.info("update hardware info"), P.updateHardwareInfo(e), !0 }) } function pe(e) { e.method !== g.SHOW_PROGRESS && Pe.info("UpdatesService - received event from installer", e), Ee.showNextInstallerForm(e) } function ge() { return a.isNull(Me) && (Me = u.getDriverTypePreference().then(function(e) { return e && e.data ? (Pe.info("getDriverType status:", e), Me = null, Oe = e.data.driverType, i.trigger(I.DRIVER_PREFERENCE_UPDATED, Oe), e.data.driverType) : l.reject("getDriverType response is null") }).catch(function(e) { return Pe.error("failed to getDriverType", e), Me = null, l.reject(e) })), Me } function ve(e) { return e && e.data && e.data.html && e.data.html.body } function he() { if (!Re) { Re = !0; var e = {}; e.GFPV = P.getParams().GFPV || "0.00", e.isSLI = P.getParams().isSLI || "0", e.cmID = k.CRD, P.profile.targetGfeAchievements({ gfwslParams: e }).then(function(e) { var t = "", n = !1; if (ve(e) && Array.isArray(e.data.html.body.Achievements)) { var r = a.findWhere(e.data.html.body.Achievements, { ID: k.CRD }); if (r) { var o = JSON.parse(r.overallState); n = !0, Ne = o, i.trigger(U.CRD_STATE_UPDATED, Ne), Pe.info("CRD feature state ", o) } else t = "CRD id not found in Achievements" } else t = "Invalid response for GFWSL targetGfeAchievements"; n || (Pe.error(t), Ne = void 0, i.trigger(U.CRD_STATE_UPDATED, !1)) }).catch(function(e) { Ne = void 0, i.trigger(U.CRD_STATE_UPDATED, !1) }).finally(function() { Re = !1 }) } } function ye() { Pe.info("onRefreshCRDFeatureState begin", Le), Le === !0 && me().then(function(e) { P.getParams().dIDa && P.getParams().go ? (Pe.info("refresh CRD feature capability"), Re = !1, Ne = void 0, he()) : Pe.info("no dIDa or GO params found in hardware info") }) } var Ee = this; Ee.timer = void 0, Ee.scanCompleted = !0, Ee.manualCheckForUpdate = !1; var be, Se, _e, we, Ae, Te = [], Ie = null, Ce = null, xe = {}, Me = null, De = null, Oe = void 0, Re = !1, Ne = void 0, Le = !0, Pe = e.getInstance("main.updates/updatesService"); Ee.startDownload = function(e, t, n) { return Pe.info("start download for version", e, " url ", t, "downloadType", n), v.start({ version: e, url: t, downloadType: n }) }, Ee.pauseDownload = function(e) { return Pe.info("pause download for taskid", e), v.pause({ taskId: e }) }, Ee.resumeDownload = function(e) { return Pe.info("resume download for taskid", e), v.resume({ taskId: e }).then(function(e) { return V(e.data), e }) }, Ee.stopDownload = function(e) { return Pe.info("stop download for taskid", e), v.stop({ taskId: e }).then(function(e) { return R.taskbarProgress("complete"), e }) }, Ee.setUpdatesListener = function(e) { Te.push(e) }, Ee.removeUpdatesListener = function(e) { var t = Te.indexOf(e); t > -1 && Te.splice(t, 1) }, Ee.canCheckForUpdate = function() { var e = !0; return Ee.scanCompleted && Se && Se.forEach(function(t) { t.downloadStatus.status !== n.TASK_PAUSED && t.downloadStatus.status !== n.TASK_RUNNING && t.downloadStatus.status !== n.TASK_RETRY || (e = !1) }), e }, Ee.checkForUpdates = function(e) { !e || Ee.canCheckForUpdate() ? (Ee.manualCheckForUpdate = e, Pe.info("driver update scan starting.."), u.refresh().then(function() {}).catch(function(e) { Pe.error("UpdateService - start scan failed", e), i.trigger(d.SCAN_FAILED, {}) })) : Pe.info("driver download is initiated or scan is already in progress..") }, Ee.showNextInstallerForm = function(e) { if (e.method === g.SHOW_FORM) switch (e.form) { case o.NVIFORM_INSTALL_INITIAL: case o.NVIFORM_INSTALL_CHECKING: case o.NVIFORM_EULA: case o.NVIFORM_PRE_INSTALL_CHECK: case o.NVIFORM_INSTALL_CHECK_WARNINGS: r.showInstallerForm(e); break; case o.NVIFORM_INSTALL_REMOVE_PROGRESS: r.showInstallerForm(e); break; case o.NVIFORM_INSTALL_PROGRESS: r.showInstallerForm(e); break; case o.NVIFORM_INSTALL_FINISHED: case o.NVIFORM_INSTALL_FINISHED_NO_SUMMARY: _.push(w.UPDATES_INSTALL_DRIVER_SUCCEEDED), r.showInstallerForm(e); break; case o.NVIFORM_INSTALL_FAILED: r.showInstallerForm(e); break; case o.NVIFORM_INSTALL_REBOOT: r.showInstallerForm(e); break; case o.NVIFORM_INSTALL_START_FAILED: W(e.errorCode); break; case o.NVIFORM_INSTALL_CHECK_WAIT: r.showInstallerForm(e); break; case o.NVIPROP_CUSTOM_INSTALL: r.showInstallerForm(e); break; case o.NVIFORM_INSTALL_REMOVE_REBOOT: r.showInstallerForm(e); break; case o.NVIFORM_INSTALL_CHECK_FAILED: r.showInstallerForm(e); break; default: r.showInstallerForm(e) } else r.showInstallerForm(e); return !0 }, Ee.invokeInstallation = function(e, t, n) { Pe.info("start installation", e.version, e.name, t, n); var r = n ? "" : e.downloadStatus.extractedPath ? e.downloadStatus.extractedPath : e.downloadStatus.downloadedLocation; E.start({}, { driverLocation: r, isCustom: t, resumeInstall: n, isPfw: !e.downloadStatus.extractedPath, pfwLocation: e.downloadStatus.downloadedLocation }).then(function() { Pe.info("successfully start installation ", e.name) }).catch(function(e) { Pe.error("failed to start installation error code:", e.data, " status:", e.status, " params:", e.config.data, e) }) }, Ee.beginInstallation = function(e, t, n) { J(e).finally(function() { Z(e, t, n) }) }, Ee.showArticle = function(e, t) { xe = { content: e, driverVersion: t }, N.show({ controller: "ArticleInformationController", controllerAs: "vm", template: c.default, disableParentScroll: !1, locals: { getArticleCallback: te }, bindToController: !0 }) }, Ee.getUpdates = function() { return Pe.info("getUpdates called"), be = u.get().then(function(e) { return Ae = e.data, Pe.info("UpdatesService - got update response", Ae), Ae.updates ? ie(Ae.updates) : l.reject("no updates available") }).catch(function(e) { return Pe.error("error getting driver updates:data ", e.data, " status:", e.status), l.reject(e.data) }).finally(function() { be = void 0 }), be.then(function(e) { e && e.forEach(function(e) { re(e.version, e.isCRD) }) }), be }, Ee.getUpdateDetails = function() { return be ? be : Se ? l.when(Se) : Ae ? l.reject("no updates available") : (Pe.info("getUpdates called in updatedetails"), Ee.getUpdates()) }, Ee.getInstalledDriver = function() { return _e ? _e : we ? l.when(we) : (Pe.info("getInstalledDriver called"), oe()) }, Ee.initialize = function() { Pe.info("updatesService.intiialize called"), G.onlineState && (Le = G.onlineState.online), i.on(I.ONLINE, de), i.on(I.OFFLINE, fe), i.on(I.GFWSL_LOCALE_PARAMS_UPDATED, ye), i.on(I.GFWSL_GEOLOCAL_PARAMS_UPDATED, ye), i.on(I.GFWSL_SYS_PARAMS_UPDATED, ye), i.on(x.CONNECT, z), ge().finally(function() { le(), Ee.getUpdateDetails(), A.initialize(), i.on(I.SYSTEMINFO_UPDATED, se), m.register(f.UPDATESCAN_UPDATE, d.SCAN_UPDATE), m.register(y.DOWNLOAD_PROGRESS_STATUS, h.PROGRESS), m.register(b.INSTALLER_SHOW_FORM, s.INSTALL_FORM), m.register(b.INSTALLER_PROGRESS_UPDATE, s.INSTALL_FORM), i.on(I.LOCALE_CHANGED, ae), r.unsubScribeDriverInstallationNotificationRegister(q) }) }, i.on(s.INSTALL_DONE, ae), i.on(d.SCAN_UPDATE, function(e) { Pe.info("UpdatesService - got socket event SCAN_UPDATE - ", e), e === p.STARTED ? i.trigger(d.SCAN_STARTED) : e === p.FINISHED ? (i.trigger(d.SCAN_FINISHED), Ee.manualCheckForUpdate = !1) : e === p.FAILED && (i.trigger(d.SCAN_FAILED), Ee.manualCheckForUpdate = !1) }), i.on(d.SCAN_STARTED, function(e) { Pe.info("UpdatesService - SCAN_STARTED"), Ie = Date.now(), Ee.scanCompleted = !1 }), i.on(d.SCAN_FINISHED, function(e) { Ce = Date.now(), Pe.info("Time taken to scan updates(ms):", Ce - Ie), Pe.info("UpdatesService - SCAN_FINISHED"), Se = void 0, Ae = null, Ee.getUpdates(), $() }), i.on(d.SCAN_FAILED, function(e) { Pe.error("UpdatesService - SCAN_FAILED"), Ee.manualCheckForUpdate = !1, Se = void 0, Ae = null, _.push(w.UPDATES_CHECK_FOR_DRIVER_UPDATES_FAILED), Ee.getUpdates(), $() }), i.on(h.PROGRESS, function(e) { var t = !1; a.isUndefined(Se) || Se.forEach(function(n) { n.downloadStatus.taskId === e.taskId && (n.downloadStatus = e, t = !0) }), !t && we && we.downloadStatus && we.downloadStatus.taskId === e.taskId && (we.downloadStatus = e, t = !0), t && (V(e), e.status === n.TASK_RUNNING ? Pe.info("DOWNLOAD_PROGRESS_STATUS - ", e.status, "%Complete", e.percentComplete, " tmRem", e.timeRemaining, " dwndSpd", e.downloadSpeed, " taskId ", e.taskId, "byteDn", e.bytesDone) : Pe.info("DOWNLOAD_PROGRESS_STATUS - ", e), e.status === n.TASK_PAUSED_UNABLE_TO_REACH_SERVER || e.status === n.TASK_FAILED_UNABLE_TO_REACH_SERVER || e.status === n.TASK_CHECK_SUM_ERROR || e.status === n.TASK_DISK_WRITE_FAIL || e.status === n.TASK_SIGNATURE_VERIFICATION_FAILS ? (i.trigger(h.FAILED, e), e.status === n.TASK_PAUSED_UNABLE_TO_REACH_SERVER || e.status === n.TASK_FAILED_UNABLE_TO_REACH_SERVER ? _.push(w.UPDATES_DOWNLOAD_DRIVER_UNABLE_TO_REACH_SERVER) : _.push(w.UPDATES_DOWNLOAD_DRIVER_FAILED, e.version)) : e.status === n.TASK_COMPLETED && _.push(w.UPDATES_DOWNLOAD_DRIVER_SUCCESS)) }), Ee.sendResponseToInstaller = function(e) { Pe.debug("UpdateService:sendResponseToInstaller - send response to installer ", e), E.changeState({}, e).then(function() { Pe.info("UpdateService - successfully sent response to installer") }).catch(function(e) { Pe.error("UpdateService - installersEndpoints.changeStatus failed", e) }) }, Ee.setDriverTypePreference = function(e) { return a.isNull(De) || u.setDriverTypePreference.cancel(De), De = u.setDriverTypePreference({}, { driverType: e }).then(function(t) { return De = null, Pe.info("setDriverType status:", t), Oe = e, Ae = null, Se = void 0, i.trigger(I.DRIVER_PREFERENCE_UPDATED, Oe), t.status }).catch(function(e) { return De = null, Pe.error("failed to setDriverType", e), l.reject(e) }) }, Ee.getDriverTypePreference = function() { return Oe ? l.when(Oe) : Me ? Me : ge() }, Ee.isCRDFeatureSupported = function() { angular.isDefined(Ne) ? (Pe.info("isCRDFeatureSupported returned cached info", Ne), i.trigger(U.CRD_STATE_UPDATED, Ne)) : (Pe.info("isCRDFeatureSupported begin"), he()) }, Ee.getDriverInformation = function(e, t) { return A.getDriverInformation(e, t) }, Ee.getInstallationDriverData = function(e, t) { return Ee.getDriverTypePreference().then(function(n) { return Pe.info("getDriverTypePreference is", n), A.getInstallationDriverData(n, e, t) }).catch(function(n) { return Pe.error("getDriverTypePreference failed with error: ", n), A.getInstallationDriverData(F.GRD, e, t) }) }, r.setSendResponseToInstallerRegister(Ee.sendResponseToInstaller), r.setInvokeInstallationCallbackRegister(Ee.invokeInstallation), Ee.getDriverArticle = A.getArticleInformation }]); t.updatesService = u }, , function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, ".crimson md-backdrop{background-color:#0e0e0e;opacity:.8}::selection{background:#478b06}.crimson-dialog-container-tall{height:538px}.crimson-dialog{min-width:408px;max-width:528px;max-height:538px;overflow-x:hidden;border-radius:0}.crimson-dialog.honeycomb-tall{min-height:406px;max-height:538px;width:408px;background-image:url(" + n(147) + ");background-size:100%}.crimson-dialog.honeycomb-tall-max{min-height:406px;max-height:594px;width:408px;background-image:url(" + n(145) + ");background-size:100%}.crimson-dialog.honeycomb-square{height:467px;width:528px;background-image:url(" + n(146) + ");background-size:100%}.crimson-dialog.feature-error-dialog{width:480px!important;height:152px!important}.crimson-dialog.feature-error-dialog h1{font-family:Roboto;font-size:12px!important;opacity:.75}.crimson-dialog.feature-error-dialog p{font-family:Roboto-Light;font-size:11px!important;opacity:.45}.common-window .feature-error-dialog .md-primary.md-hue-2.foreground{color:#fff!important}.crimson-dialog.honeycomb-tall-max md-dialog-content{padding-top:0}.crimson-dialog.honeycomb-square md-dialog-content,.crimson-dialog.honeycomb-tall md-dialog-content{padding-top:24px}.crimson-dialog .dialog-service-dialog-contents-title{margin:24px 24px 0;font-size:20px;font-weight:300;color:rgba(255,255,255,.9)}.crimson-dialog .dialog-service-dialog-contents-subtitle h2{margin:8px 0 0 24px;font-size:10px;font-weight:400}.crimson-dialog md-dialog-content .last-dialog-child,.crimson-dialog md-dialog-content ng-form:last-child,.crimson-dialog md-dialog-content:last-child{margin-bottom:0}.crimson-dialog .dialog-service-dialog-contents-subtitle a:link{color:#76b900;text-decoration:none}.crimson-dialog .dialog-service-dialog-contents-subtitle a:hover{color:#76b900;border:1px #76b900;border-bottom-style:dotted}.crimson-dialog .dialog-service-dialog-contents-subtitle a:active{color:rgba(118,185,0,.65);border:1px rgba(118,185,0,.65);border-bottom-style:dotted}.crimson-dialog error-div{height:48px;line-height:48px;margin-top:12px;padding-left:24px;padding-right:24px;font-size:10px;font-weight:400;color:#fff;color:rgba(255,255,255,.6);background-color:#303030}.crimson-dialog error-div span{display:inline-block;vertical-align:middle;line-height:normal}.crimson-dialog md-dialog-content{font-size:12px;font-weight:400;color:#fff;color:rgba(255,255,255,.6);padding:24px;width:initial}.crimson-dialog md-dialog-content p:first-child{margin-top:0}.crimson-dialog .md-actions{padding:0}.crimson-dialog .md-actions button:first-child{margin-right:8px}.crimson-dialog waiting-overlay{position:absolute;background-color:rgba(14,14,14,.7);z-index:5}.crimson-dialog-progress-bar{height:5px;position:absolute;width:100%}.crimson-dialog .dialog-service-dialog-contents-image{width:245px;height:317px}.crimson-dialog .dialog-email-verification{position:absolute;left:0;top:0;padding:24px;height:100%;width:100%;box-sizing:border-box}.crimson-dialog .dialog-email-verification-email{margin-top:136px;margin-bottom:112px}.crimson-dialog .dialog-logo img{margin-top:104px;margin-bottom:12px}.crimson-dialog .dialog-progress md-progress-circular{margin-top:128px;margin-bottom:36px}.common-window .dialog-service-container-size a,.crimson-dialog md-dialog-content[nv-dialog-html] a{color:#76b900;opacity:1;text-decoration:none}.common-window .dialog-service-container-size a:focus::after,.common-window .dialog-service-container-size a:hover,.common-window .dialog-service-container-size a[selected],.crimson-dialog md-dialog-content[nv-dialog-html] a:focus::after,.crimson-dialog md-dialog-content[nv-dialog-html] a:hover,.crimson-dialog md-dialog-content[nv-dialog-html] a[selected]{cursor:pointer;color:#76b900;border-bottom:1px dotted;text-decoration:none}.common-window .dialog-service-container-size a:focus::after,.common-window .dialog-service-container-size a:hover::after,.common-window .dialog-service-container-size a[selected]::after,.crimson-dialog md-dialog-content[nv-dialog-html] a:focus::after,.crimson-dialog md-dialog-content[nv-dialog-html] a:hover::after,.crimson-dialog md-dialog-content[nv-dialog-html] a[selected]::after{color:#fff;opacity:.75;content:'\\e921';padding-right:3px;font-size:11px;padding-left:2px;vertical-align:middle;line-height:11px;display:inline-block;font-family:nvCustomIcons}.crimson .md-datepicker-container .md-datepicker-button,.crimson-dialog md-dialog-content[nv-dialog-html] .expandedInfo .crimson-dialog.article-content .expandedInfo,.crimson-dialog md-dialog-content[nv-dialog-html] .return-to-top,.crimson-dialog md-dialog-content[nv-dialog-html] .toc,.crimson-dialog.article-content .return-to-top,.crimson-dialog.article-content .toc{display:none}.crimson-dialog md-dialog-content[nv-dialog-html],.crimson-dialog md-dialog-content[nv-license-agreement]{margin:24px 0;padding:0 24px}.crimson-dialog.feedback-dialog .dialog-service-dialog-contents-title{font-size:12px;text-transform:uppercase}.crimson-dialog .dialog-service-dialog-contents-title .feature-error-dialog{font-size:12px!important}.common-window .feature-error-dialog md-dialog-content{overflow-y:hidden!important;margin-top:-12px!important}.crimson-dialog.article-content md-dialog-content{overflow-x:hidden;margin:0 0 5px;padding:0}.crimson-dialog.article-content{background-image:none;max-height:80vh;min-height:250px;min-width:678px;max-width:678px;transition:all;transform:translate(0,0) scale(1);animation-delay:0s;transition-delay:0s}.crimson-dialog.article-content .dialog-service-dialog-contents-sub-title{font-size:12px;margin-left:24px;margin-bottom:24px;color:rgba(255,255,255,.45);font-weight:lighter;margin-top:0}.crimson-dialog.article-content .dialog-service-dialog-contents-title{font-size:20px;margin-left:24px;color:rgba(255,255,255,.9);font-weight:300;height:100%;line-height:normal}.crimson-dialog .scroll-overlay-top-gradient{height:30px;margin-left:24px;margin-right:24px;background:linear-gradient(#1c1c1c,rgba(28,28,28,0));top:0}.crimson-dialog .scroll-overlay-bottom-gradient{height:30px;margin-left:24px;margin-right:24px;background:linear-gradient(rgba(28,28,28,0),#1c1c1c);bottom:24px;top:auto}.crimson-dialog .dialog-service-dialog-contents-close-button{float:right}.crimson-dialog .dialog-service-dialog-contents-back-button{float:left}.crimson-dialog .dialog-service-dialog-contents-back-button.md-icon-button,.crimson-dialog .dialog-service-dialog-contents-close-button.md-icon-button{margin-top:10px;margin-right:8px}.crimson-dialog .dialog-service-dialog-contents-back-button md-icon:hover,.crimson-dialog .dialog-service-dialog-contents-close-button md-icon:hover{color:rgba(255,255,255,.9)}.crimson-dialog .dialog-service-dialog-contents-footer{min-height:0}.crimson .md-label{color:#fff;color:rgba(255,255,255,.45)}.crimson md-input-container{position:relative;padding:0;transition:height .25s;min-height:initial}.crimson md-input-container .md-input,.crimson md-input-container md-select{font-size:12px;font-weight:400;text-shadow:none;margin-top:16px;margin-bottom:8px}.crimson md-input-container label{font-size:12px;font-weight:400;text-shadow:none;bottom:inherit}.crimson md-input-container.md-input-focused label:not(.md-no-float),.crimson md-input-container.md-input-has-value label:not(.md-no-float){transform:perspective(1px) translate3d(0,8px,0) scale(.9)}.crimson .md-datepicker-container [ng-message],.crimson md-input-container [data-ng-message],.crimson md-input-container [ng-message],.crimson md-input-container [x-ng-message],.crimson md-input-container data-ng-message,.crimson md-input-container ng-message,.crimsong md-input-container x-ng-message{font-size:11px;padding-top:0}.crimson md-input-container .md-errors-spacer{min-height:0}.crimson md-input-container [ng-message-exp] div,.crimson md-input-container [ng-message] div,.crimson md-input-container [ng-messages] div{color:gray;color:rbga(255,255,255,.45)}.crimson md-input-container.md-default-theme:not(.md-input-invalid).md-input-focused label:not(.md-no-float),.crimson md-input-container:not(.md-input-invalid).md-input-focused label:not(.md-no-float){color:#76b900}.crimson md-input-container.md-default-theme:not(.md-input-invalid).md-input-focused .md-input,.crimson md-input-container:not(.md-input-invalid).md-input-focused .md-input{border-color:#76b900}.crimson .md-datepicker-input-container.md-datepicker-invalid,.crimson .md-default-theme .md-datepicker-input-container.md-datepicker-invalid,.crimson md-input-container.md-input-invalid .md-input{border-color:#b5291c}.crimson md-input-container.md-input-invalid [ng-message-exp] div:not(.md-char-counter),.crimson md-input-container.md-input-invalid [ng-message] div:not(.md-char-counter),.crimson md-input-container.md-input-invalid [ng-messages] div:not(.md-char-counter){color:#b5291c}.crimson md-input-container.md-default-theme.md-input-invalid label,.crimson md-input-container.md-input-invalid label{color:gray;color:rgba(255,255,255,.45)}.crimson md-checkbox{margin-bottom:0}.crimson md-checkbox div{line-height:20px}.crimson .md-datepicker-container{min-height:initial}.crimson md-datepicker{padding-right:0;min-height:32px;margin:16px 0 0}.crimson .md-datepicker-input{font-size:12px;font-weight:400;text-shadow:none;color:#fff;color:rgba(255,255,255,.45)}.crimson .md-datepicker-container .md-datepicker-triangle-button{right:4px}.crimson .md-datepicker-input-container{margin-left:0}.crimson .md-datepicker-container [ng-message],.crimson .md-datepicker-container [ng-messages]{color:#b5291c}.crimson .md-datepicker-container .md-errors-spacer{min-height:0}.crimson-dialog md-input-container+md-input-container{margin-top:12px}.crimson .md-datepicker-container+md-checkbox,.crimson md-input-container+md-checkbox{margin-top:32px}.crimson md-checkbox+.md-datepicker-container{margin-top:20px}.crimson md-checkbox+md-checkbox{margin-top:24px}.crimson .md-button:not(.md-icon-button):not(.md-fab),.crimson md-menu-item>.md-button{font-size:12px;font-weight:500;height:36px;min-width:64px;padding-left:16px;padding-right:16px;border-radius:0}.crimson-dialog .dialog-service-dialog-contents-subtitle{margin:8px 0 0 24px}", ""]); }, , function(e, t, n) { e.exports = n.p + "dialogbox-honeycomb-max.png" }, function(e, t, n) { e.exports = n.p + "dialogbox-honeycomb-square.png" }, function(e, t, n) { e.exports = n.p + "dialogbox-honeycomb-tall.png" }, , , , , , , , , function(e, t, n) { var r = n(143); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, , , , , , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvBindHtmlCompile = void 0; var r = n(1), o = r.ngMainCommonModule.directive("nvBindHtmlCompile", ["$compile", function(e) { return { restrict: "A", link: function(t, n, r) { var o, i = angular.element(""); n.append(i), r.$observe("nvBindHtmlCompile", function(n) { n && (o = e(n)(t), i.replaceWith(o), i = o) }) } } }]); t.nvBindHtmlCompile = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFallbackSrc = void 0; var r = n(1), o = r.ngMainCommonModule.directive("nvFallbackSrc", function() { var e = { link: function(e, t, n) { function r() { n.nvFallbackSrc != angular.element(this).attr("src") && angular.element(this).attr("src", n.nvFallbackSrc) } function o() { t.off("error", r) } t.on("error", r), e.$on("$destroy", o) } }; return e }); t.nvFallbackSrc = o }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.framerateLimiterService = void 0; var o = n(3), i = r(o), a = n(1); n(11), n(176); var s = a.ngMainCommonModule.service("framerateLimiterService", ["$log", "framerateLimiterEndpoints", "$q", "jarvisService", "dbCacheService", "DB_NAMES", function(e, t, n, r, o, a) { function s(e) { return y = e.data, e.data } function l(e) { return E = e.data, e.data } function c() { if (i.isNull(g)) { y = null; var e = t.support(); return g = e.then(s).catch(function(e) { return b.error("failed to framerate Limiter support info", e), n.reject(e) }) } return g } function u() { if (i.isNull(v)) { E = null; var e = t.state(); return v = e.then(l).catch(function(e) { return b.error("failed to framerate Limiter state info", e), n.reject(e) }) } return v } function d() { return y ? n.when(y) : c() } function f() { return E ? n.when(E) : u() } function m(e, t) { var n, i; E && (!e && E.enabled && (n = r.getLoggedInUser(), n && (i = o.getCachedUserItem(n.userId, a.VIEW_STORE, a.VIEW_STATE), i.userTabSelectionList = [], i.persist_())), E.enabled = e, E.value = t) } function p(e, r) { return t.setState({}, { enabled: e, value: r }).then(function(t) { return m(e, r), t }).catch(function(e) { return b.error("failed framerate Limiter SetState info", e), n.reject(e) }) } var g = null, v = null, h = this, y = null, E = null, b = e.getInstance("main.common/framerateLimiterService"); h.getStateInfo = f, h.getSupportInfo = d, h.setStateInfo = p }]); t.framerateLimiterService = s }, , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvInputDirective = void 0; var r = n(1), o = r.ngMainCommonModule.directive("nvInput", [function() { return { restrict: "A", require: ["^^form", "ngModel"], compile: function(e) { var t = e.attr("name"); return e.attr("spellcheck", !1), function(e, n, r, o) { var i = o[0], a = o[1]; a.$options = { updateOn: "blur" }, n.bind("focus", function() { i[t].$setUntouched(), e.$digest() }) } } } }]); t.nvInputDirective = o }, , , , , , , , , , , , , , , , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ngMainModule = void 0; var r = n(23), o = n(1), i = n(9), a = n(14), s = n(10), l = n(4), c = n(53), u = n(24), d = n(188), f = n(8), m = n(134), p = angular.module("main", [r.ngMainConstantsModule.name, o.ngMainCommonModule.name, "main.common.config", i.ngOobeModule.name, a.ngGamesModule.name, s.ngUpdatesModule.name, l.ngPreferencesModule.name, c.ngRewardsModule.name, u.ngTelemetryModule.name, d.ngSearchModule.name, f.ngUserProfileModule.name, m.ngGfnCloudGamesModule.name, "ngMaterial", "ngResource", "pascalprecht.translate", "ui.router", "ui.layout", "ngAnimate", "bm.uiTour"]); t.ngMainModule = p }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.notificationsService = void 0; var o = n(227), i = n(3), a = r(i); n(52), n(22); var s = o.ngNotificationsModule.service("notificationsService", ["$log", "NOTIFICATION_EVENTS", "eventAggregator", function(e, t, n) { function r() { n.trigger(t.NEW_NOTIFICATION, { notifications: l }), l = [] } function o(e) { l.push.apply(l, e), c && r() } function i() { c = !0, a.isEmpty(l) || r() } var s = this, l = (e.getInstance("main.notifications/notificationsService"), []), c = !1; s.initialize = function() { n.on(t.REQUEST_NOTIFICATION, o), n.on(t.VIEWSTATE_INITIALIZED, i) } }]); t.notificationsService = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeGamesService = void 0; var r = n(9); n(133), n(46); var o = r.ngOobeModule.service("oobeGamesService", ["$log", "gamesService", "userGamesService", "jarvisService", "eventAggregator", "GAME_EVENTS", "OOBE_SCAN_STATE", "OOBE_EVENTS", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "oobeTelemetryService", function(e, t, n, r, o, i, a, s, l, c, u) { function d() { var e = t.getGamesCount(); T.info("scan games done", e, w), A = a.FINISHED, o.trigger(s.SCAN_FINISHED, e), y(), l.endLoad(c.OOBE_SCANGAME_DURATION, _), C && t.handleOobeAutoOptimizeSelection(w) } function f() { T.info("scan games finished"), d() } function m() { T.error("scan games failed"), t.getCachedGames().finally(d) } function p() { var e = t.getGamesCount(); T.info("game list updated ", e), o.trigger(s.GAMELIST_UPDATED, e) } function g(e) { T.info("scan progress updated ", e), o.trigger(s.SCAN_PROGRESS, e) } function v() { T.debug("register game scan events"), o.on(i.SCAN_FINISHED, f), o.on(i.SCAN_FAILED, m), o.on(i.GAMELIST_UPDATED, p), o.on(i.GAMELIST_CREATED, p), o.on(i.SCAN_PROGRESS, g) } function h() { o.on(s.OOBE_DONE, S) } function y() { T.debug("unregister game scan events"), o.off(i.SCAN_FINISHED, f), o.off(i.SCAN_FAILED, m), o.off(i.GAMELIST_UPDATED, p), o.off(i.GAMELIST_CREATED, p), o.off(i.SCAN_PROGRESS, g) } function E() { o.off(s.OOBE_DONE, S) } function b() { var e; T.info("scanGames - notify ootb started"), t.ootbStarted(), v(), h(), I = !0, t.initialize(!0).then(function() { T.info("scanGames -start local scan"), t.scanLocalGames(!0) }).catch(function() { T.info("scanGames -initialize failed"), m() }), e = r.getLoggedInUser(), n.initialize(e) } function S() { C = !0, A === a.FINISHED && t.handleOobeAutoOptimizeSelection(w), E() } var _, w, A, T = e.getInstance("main.oobe/oobeGamesService"), I = !1, C = !1, x = this; x.startScan = function(e) { _ = l.startLoad(c.OOBE_SCANGAME_DURATION), T.info("start OOBE scan", e), A = a.SCANNING, x.setAutoOptimizeGames(e), b() }, x.getScanState = function() { return A }, x.getGamesCount = function() { return t.getGamesCount() }, x.initializeGames = function(e) { I ? T.info("games already initialized") : (T.info("start initializing games"), I = !0, t.initialize(!1)), n.initialize(e) }, x.setAutoOptimizeGames = function(e) { u.changeSetting("APPLICATION_SETTING_AUTO_OPTIMIZE_NEW_GAMES", e), w = e } }]); t.oobeGamesService = o }, , , , , , , , , , , , , , , , , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvAccordionPane = t.nvAccordion = void 0; var r = n(1); n(325); var o = r.ngMainCommonModule.directive("nvAccordion", ["ACCORDION_MODES", function(e) { return { restrict: "E", transclude: !0, scope: { nvAccordionMode: "@" }, template: '
', controller: "AccordionController", link: function(t, n, r, o, i) { n.attr("layout", "column"), r.nvAccordionMode === e.ONLY_ONE ? n.addClass("common-accordion-only-one") : r.nvAccordionMode === e.ALWAYS_ONE ? n.addClass("common-accordion-always-one") : n.addClass("common-accordion-multiple"), n.addClass("common-accordion") } } }]), i = r.ngMainCommonModule.directive("nvAccordionPane", ["$compile", function(e) { return { restrict: "E", require: "^nvAccordion", transclude: !0, scope: { nvStartExpanded: "@", nvOnExpand: "&", nvOnExpandOne: "&", nvOnCollapse: "&" }, template: '
', link: function(t, n, r, o) { function i(e) { var t, n; for (t in e.path) { if (n = angular.element(e.path[t]), n.attr("ng-click")) return; if ("nv-accordion-pane-header" === n[0].localName) break } o.onClick(c) } function a() { g(), o.removePane(u), l = null, m = null, p = null, f.off("click", i), f = null, s = null, d.empty(), d.remove(), d = null, c = null, u = null } var s, l, c, u, d = n, f = n.find("nv-accordion-pane-header"), m = n.find("nv-accordion-pane-content"); u = { onExpand: function(e) { e ? (d.removeClass("collapsed"), t.nvOnExpand({ index: c })) : (d.addClass("collapsed"), t.nvOnCollapse({ index: c })) }, isExpanded: function() { return !d.hasClass("collapsed") } }, d.attr("flex", ""), d.attr("layout", "column"), s = f.wrap(""), f.on("click", i); var p = s.append(e('keyboard_arrow_down')(t)); l = m.wrap("= 300) && (o = (0, s.default)(t.data)), P.sendSdkHttpTelemetry(c > 0, l.onlineState.online, v.cevo.server, n, c, a, o, i, e) } function U(e) { if (!_.isEmpty(e) && _.isObject(e)) { var t = [], n = null; for (var o in e) try { n = e[o].file.url, t.push(n) } catch (e) { re.error("failed to extract asset url for key - " + o, e.message) } t.length && r.trigger(b.PREFETCH_RESOURCES, t) } } function V(e) { return _.isEmpty(e) ? void re.info("no notifications to show") : (re.info("showing ", e.length, " notification(s)"), void r.trigger(E.REQUEST_NOTIFICATION, e)) } function z(e, n, r, o) { if (o && !ne.getFeatureEnabled(o)) { re.info("rejecting request for", o); var i = new W(N.REQUEST_REJECTED); return t.reject(i) } if (n) return n.promise; if (r) e = null, n = null; else if (e) return t.resolve(e); return null } function B(e) { ue = k(), e ? ne.initializeSession() : (le = null, oe.token = null, oe.expires = null, ie = !1, Ae = {}, we = G(), r.off(p.LOGIN_STATUS_CHANGE, B)) } function $(e) { return e || (le || (le = c.getLoggedInUser()), e = le.userId), e } function W(e, t, n) { function r(e) { return _.isString(e) ? e : (0, s.default)(e) } this.errorType = n || N.API_ERROR, this.error = e, this.details = t || "", this.toString = function() { return this.errorType.concat(",", this.error, ",", r(this.details)) } } function H(e, t, n) { if (e instanceof W) return e; var r = ""; try { r = e.data.errors } catch (t) { re.error("got an exception while getting error", t.message, e) } return new W(t, r, n) } function j(e) { return parseInt(e) + ae + _e } function Y(e, t, n, r) { re.info("notification clicked", e), ne.gotoUserProfile(t, n, void 0, r) } function q(e) { ne.gotoUserProfile(e.tabName, e.dialogParams, e.rewardsPackageId, e.callback) } function K(e) { e && r.trigger(C.OPEN_DIALOG, e) } function Q(e) { var t = void 0; try { t = e.assets.notification.file.url } catch (e) { t = "#", re.error("failed to extract notification image - ", e.message) } return { artWork: t, artWorkHighRes: "#", callbackData: "mission-" + e.id, callbackFunction: function(t) { var n = { id: e.id, name: R.MISSION_DETAILS_DIALOG }; Y(t, O.DEFAULT_TAB, n, K.bind(null, n)) }, clickToRemove: !0, heading: { text: "l10n.missionAvailable" }, description: { text: e.name }, telemetryDescription: e.name, type: e.missionType === D.FEATURED_MISSION ? y.AFFINITY_ANNOUNCEMENT_FEATURED_MISSION : y.AFFINITY_ANNOUNCEMENT_MISSION } } function Z(e) { return e.featured === M.TRUE ? D.FEATURED_MISSION : e.tokens != M.FALSE ? D.TOKEN_MISSION : D.REGULAR_MISSION } function X(e) { var t = void 0; try { t = e.xplevel.assets.notification.file.url } catch (e) { t = "#", re.error("failed to extract notification image - ", e.message) } return [{ artWork: t, artWorkHighRes: "#", callbackData: "level-" + e.xplevel.level, callbackFunction: function(e) { Y(e, O.REWARDS_TAB) }, clickToRemove: !0, heading: { text: "l10n.leveledUpTitle", values: { levelName: e.xplevel.name } }, description: { text: "l10n.leveledUpDescription" }, telemetryDescription: e.xplevel.name, type: y.PROFILE_LEVEL_UP }] } function J(e) { var t = void 0; try { t = e[0].assets.notification.file.url } catch (e) { t = "#" } return [{ artWork: t, artWorkHighRes: "#", callbackData: "giveaway-" + e[0].id, callbackFunction: function(t) { var n = { id: e[0].id, name: R.SWEEPSTAKES_DIALOG }; Y(t, void 0, n, K.bind(null, n)) }, clickToRemove: !0, heading: { text: "l10n.newRewardAvailable" }, description: { text: "l10n.newRewardAvailableDescription", values: { rewardName: e[0].title } }, telemetryDescription: e[0].title, type: y.AFFINITY_ANNOUNCEMENT_SWEEPSTAKE }] } function ee(e) { return _.chain(e).filter(function(e) { return e.isUnlocked }).map(function(e) { var t = void 0; try { t = e.assets.notification.file.url } catch (e) { t = "#", re.error("failed to extract notification image - ", e.message) } return { artWork: t, artWorkHighRes: "#", callbackData: "badge-" + e.tag, callbackFunction: function(t) { var n = { id: e.tag, name: R.BADGES_DIALOG }; Y(t, void 0, n, K.bind(null, n)) }, clickToRemove: !0, heading: { text: "l10n.achievementUnlocked", values: { achievementName: e.title } }, description: { text: "l10n.achievementUnlockedDescription" }, telemetryDescription: e.title, type: y.PROFILE_ACHIEVEMENT_UNLOCKED } }).value() } function te(e) { var t = []; e.forEach(function(e) { var n = { artWork: e.usernotification.assets.notification.file.url, artWorkHighRes: "#", callbackData: "notification-" + e.id, callbackFunction: function() { Y(e, O.DEFAULT_TAB), ne.markNotificationRead(e) }, clickToRemove: !0, heading: { text: e.usernotification.title }, description: { text: e.usernotification.body }, telemetryDescription: "notification-" + e.id, type: y.AFFINITY_XP_FOR_SWEEPSTAKE }; t.push(n) }), V(t) } var ne = this, re = e.getInstance("main.common/cevoService"), oe = { token: null, expires: null }, ie = !1, ae = 0, se = {}, le = c.getLoggedInUser(), ce = u.default, ue = k(), de = null, fe = null, me = null, pe = null, ge = null, ve = null, he = null, ye = {}, Ee = null, be = !1, Se = !1, _e = 5e3, we = G(), Ae = {}; ne.getUserAvatar = function(e) { var n = new Date, r = t.defer(); return ne.callSessionApi(o.avatar.get, { id: e, locale: d.getCurrentLocale().code }).then(function(e) { n = new Date - n, se.avatar = e.data.data.last_modified_stampMicro, e.data.data.avatars.length > 0 ? r.resolve(e.data.data.avatars) : r.reject("NOT AVAILABLE"), F(w.GET_AVATAR, e, n) }).catch(function(e) { n = new Date - n, re.error("getUserAvatar failed with error", e), "NOT AVAILABLE" !== e && F(w.GET_AVATAR, e, n), r.reject(e) }), r.promise }, ne.saveUserAvatar = function(e, n) { var i = new Date, a = t.defer(); return r.trigger(h.AVATAR_UPDATE_STARTED), be = !0, ne.callSessionApi(o.avatar.upload, {}, { user_id: e, locale: d.getCurrentLocale().code, image: n }).then(function(e) { i = new Date - i, re.info("saveUserAvatar success!"), se.avatar = e.data.data.last_modified_stampMicro, ne.refresh(), r.trigger(h.AVATAR_UPDATE_SUCCESSFULL), a.resolve(e.data.data.avatar), F(w.UPLOAD_AVATAR, e, i) }).catch(function(e) { i = new Date - i, re.error("saveUserAvatar failed with error", e), r.trigger(h.AVATAR_UPDATE_FAILED, { error: e, userId: le.userId }), F(w.UPLOAD_AVATAR, e, i), a.reject(e) }).finally(function() { be = !1 }), a.promise }, ne.getAvatarUploadInProgress = function() { return be }, ne.saveUserAvatarUrl = function(e, n) { var r = new Date, i = t.defer(); return ne.callSessionApi(o.avatar.saveUrl, {}, { user_id: e, locale: d.getCurrentLocale().code, url: n, height: 500, width: 500 }).then(function(e) { r = new Date - r, re.info("saveUserAvatarUrl success!", e), ne.refresh(), i.resolve(e.data.data.avatar), F(w.UPLOAD_AVATAR, e, r) }).catch(function(e) { r = new Date - r, re.error("saveUserAvatarUrl failed with error", e), F(w.UPLOAD_AVATAR, e, r), i.reject(e) }), i.promise }, ne.getUserCover = function(e) { e = $(e); var n = new Date, i = t.defer(); return ne.callSessionApi(o.cover.get, { id: e, locale: d.getCurrentLocale().code }).then(function(e) { n = new Date - n, se.cover = e.data.data.last_modified_stampMicro, Ee = e.data.data.covers, e.data.data.covers.length > 0 ? (r.trigger(b.PREFETCH_RESOURCES, [e.data.data.covers[0].file.url]), i.resolve(e.data.data.covers)) : i.reject("NOT AVAILABLE"), F(w.GET_COVER, e, n) }).catch(function(e) { re.error("getUserCover failed with error", e), n = new Date - n, "NOT AVAILABLE" !== e && F(w.GET_COVER, e, n), i.reject(e) }), i.promise }, ne.saveUserCover = function(e, n) { var i = new Date, a = t.defer(); return r.trigger(h.COVER_UPDATE_STARTED), Se = !0, ne.callSessionApi(o.cover.upload, {}, { user_id: e, locale: d.getCurrentLocale().code, image: n }).then(function(e) { i = new Date - i, re.info("saveUserCover success!"), Ee = e.data.data.cover, se.cover = e.data.data.last_modified_stampMicro, ne.refresh(), r.trigger(h.COVER_UPDATE_SUCCESSFULL), a.resolve(e.data.data.cover), F(w.UPLOAD_COVER, e, i) }).catch(function(e) { i = new Date - i, re.error("saveUserCover failed with error", e), r.trigger(h.COVER_UPDATE_FAILED, { error: e, userId: le.userId }), F(w.UPLOAD_COVER, e, i), a.reject(e) }).finally(function() { Se = !1 }), a.promise }, ne.getCoverUploadInProgress = function() { return Se }, ne.deleteUserCover = function(e) { r.trigger(h.COVER_UPDATE_STARTED); var n = t.defer(); if (Ee && Ee.length) { var i = new Date; ne.callSessionApi(o.cover.remove, { locale: d.getCurrentLocale().code, id: Ee[0].id }).then(function(e) { i = new Date - i, re.info("cover delete success", e), ne.refresh(), se.cover = e.data.data.last_modified_stampMicro, Ee = [], r.trigger(h.COVER_UPDATE_SUCCESSFULL), n.resolve(e), F(w.DELETE_COVER_IMAGE, e, i) }).catch(function(e) { i = new Date - i, re.error("cover delete failed", e), r.trigger(h.COVER_UPDATE_FAILED), F(w.DELETE_COVER_IMAGE, e, i), n.reject(e) }) } else r.trigger(h.COVER_UPDATE_SUCCESSFULL), n.resolve(); return n.promise }, ne.getUserImages = function(e) { e = $(e); var n = new Date, r = t.defer(); return ne.callSessionApi(o.images.get, { id: e, locale: d.getCurrentLocale().code }).then(function(e) { n = new Date - n, e.data.data.images.length > 0 ? r.resolve(e.data.data.images) : r.reject("NOT AVAILABLE") }).catch(function(e) { re.error("getUserImages failed with error", e), n = new Date - n, r.reject(e) }), r.promise }, ne.saveUserImage = function(e, n, r) { var i = new Date, a = t.defer(); return ne.callSessionApi(o.images.upload, {}, { user_id: e, locale: d.getCurrentLocale().code, tag: r, image: n }).then(function(e) { re.info("saveUserImage success!"), i = new Date - i, a.resolve(e.data.data.image) }).catch(function(e) { re.error("saveUserImage failed with error", e), i = new Date - i, a.reject(e) }), a.promise }, ne.hasSession = function() { return !!(oe.token && oe.expires > Date.now()) }, ne.getUserData = function(e) { var n = void 0; switch (e) { case g.AVATAR: n = ne.getUserAvatar(le.userId); break; case g.COVER: n = ne.getUserCover(le.userId); break; case g.MY_RIG: n = ne.getUserImages(le.userId); break; default: return re.error("Undefined block key received."), t.reject("Undefined block key received.") } return n.then(function(e) { var t = { ts: e[0].stampMicro, url: e[0].file.url }; return t }).catch(function(e) { return {} }) }, ne.saveUserData = function(e, n) { var r = void 0, o = void 0, i = S.UPLOADED; if (0 !== n.url.indexOf("http") && 0 !== n.url.indexOf("data") && n.url != ce) return t.reject("Un-supported data format received."); switch (e) { case g.AVATAR: o = A.AVATAR_IMAGE, r = 0 === n.url.indexOf("http") ? ne.saveUserAvatarUrl(le.userId, n.url) : ne.saveUserAvatar(le.userId, n.url); break; case g.COVER: n.url === ce ? (o = A.COVER_IMAGE, i = S.USE_DEFAULT, r = ne.deleteUserCover(le.userId)) : (o = A.COVER_IMAGE, r = ne.saveUserCover(le.userId, n.url)); break; case g.MY_RIG: o = A.RIG_IMAGE, r = ne.saveUserImage(le.userId, n.url, g.MY_RIG); break; default: return re.error("Undefined block key received."), t.reject("Undefined block key received.") } return r.then(function(e) { var t = {}; return t = n.url === ce ? { ts: e ? e.data.data.last_modified_stampMicro : null, url: n.url } : { ts: e[0].stampMicro, url: e[0].file.url }, o !== A.RIG_IMAGE && f.push(T.USER_CUSTOMIZE_PROFILE, { customizedResource: o, action: i, description: t && t.url || "" }), t }) }, ne.getUserMissions = function(e) { var n = z(ue.userMissions, fe, e, "missions"); if (n) return n; fe = t.defer(); var i = new Date, a = null; return ne.callSessionApi(o.mission.userMission, { id: le.userId, locale: d.getCurrentLocale().code }).then(function(e) { i = new Date - i; var t = null, n = [], o = { featuredMissions: [], repeatableMissions: [], timelessMissions: [] }; se.missions = e.data.data.last_modified_stampMicro; try { e.data.data.missions.forEach(function(e) { e.endStampMicro && (e.endStampAdjusted = j(e.endStampMicro)), e.cta && e.cta.endStampMicro && (e.cta.endStampAdjusted = j(e.cta.endStampMicro)), e.cta && e.cta.startStampMicro && (e.cta.startStampAdjusted = j(e.cta.startStampMicro)), e.featured = +e.featured, e.tokens = +e.tokens, e.missionType = Z(e), e.missionType === D.FEATURED_MISSION ? (o.featuredMissions.push(e), t = Q(e), n.push(t)) : e.repeatable == M.TRUE ? o.repeatableMissions.push(e) : o.timelessMissions.push(e), U(e.assets) }), V(n), ue.userMissions = o, fe.resolve(ue.userMissions), r.trigger(x.MISSIONS_REFRESHED, ue.userMissions), F(w.GET_USER_MISSIONS, e, i) } catch (t) { re.error("getUserMissions exception", t.message, e), a = new W(N.MISSIONS_FAILED, t.message, N.API_EXCEPTION), fe.reject(a) } }).catch(function(e) { i = new Date - i, F(w.GET_USER_MISSIONS, e, i), a = H(e, N.MISSIONS_FAILED), fe.reject(a) }).finally(function() { fe = null }), fe.promise }, ne.getExtendedProfile = function(e) { var n = z(ue.extendedProfile, me, e); if (n) return n; me = t.defer(); var i = new Date, a = null; return le = c.getLoggedInUser(), ne.callSessionApi(o.profile.getExtended, { id: le.userId, locale: d.getCurrentLocale().code }).then(function(e) { i = new Date - i, se.extendedprofile = e.data.data.last_modified_stampMicro; try { if (_.isEmpty(e.data.data.profile)) throw { message: "Got empty response" }; var t = e.data.data.profile; if (t.xp = +t.xp, t.rewardTokens = +t.rewardTokens, t.xplevel.level = +t.xplevel.level, t.xplevel.lbound = +t.xplevel.lbound, t.xplevel.ubound = +t.xplevel.ubound, t.xplevel.level > 1) { U(t.xplevel.assets); var n = X(t); V(n) } ue.extendedProfile = t, me.resolve(t), r.trigger(C.EXTENDED_PROFILE_REFRESH, t) } catch (t) { re.error("getExtendedProfile exception", t.message, e), a = new W(N.EXTENDED_PROFILE_FAILED, t.message, N.API_EXCEPTION), me.reject(a) } F(w.GET_EXTENDED_PROFILE, e, i) }).catch(function(e) { i = new Date - i, re.error("getExtendedProfile failed with", e), F(w.GET_EXTENDED_PROFILE, e, i), a = H(e, N.EXTENDED_PROFILE_FAILED), me.reject(a) }).finally(function() { me = null }), me.promise }, ne.getActivityLog = function(e) { var n = z(ue.activityLog, pe, e, "activityLog"); if (n) return n; pe = t.defer(); var i = new Date; return ne.callSessionApi(o.profile.activityLog, { id: le.userId, locale: d.getCurrentLocale() }).then(function(e) { i = new Date - i, se.activitylog = e.data.data.last_modified_stampMicro, ue.activityLog = e, pe.resolve(e), r.trigger(x.ACTIVITY_LOG_REFRESHED, e), F(w.GET_ACTIVITY_LOG, e, i) }).catch(function(e) { i = new Date - i, F(w.GET_ACTIVITY_LOG, e, i); var t = H(e, N.ACTIVITY_LOG_FAILED); pe.reject(t) }).finally(function() { pe = null }), pe.promise }, ne.getXpLevel = function(e) { var n = z(ue.xpLevel, he, e); if (n) return n; var i = { locale: d.getCurrentLocale() }; he = t.defer(); var a = new Date; return ne.callSessionApi(o.profile.xpLevels, i).then(function(e) { a = new Date - a, se.xplevel = e.data.data.last_modified_stampMicro, ue.xpLevel = e, he.resolve(e), r.trigger(x.XP_LEVEL_REFRESHED, e), F(w.GET_XP_LEVELS, e, a) }).catch(function(e) { a = new Date - a, re.error("getXpLevelError failed with", e), F(w.GET_XP_LEVELS, e, a); var t = H(e, N.XP_LEVELS_FAILED); he.reject(t) }).finally(function() { he = null }), he.promise }, ne.getLevelDetails = function(e) { var t = null; switch (+e) { case L.SILVER: t = { name: "l10n.silver", icon: "icon-ranking-silver" }; break; case L.GOLD: t = { name: "l10n.gold", icon: "icon-ranking-gold" }; break; case L.TITANIUM: t = { name: "l10n.titanium", icon: "icon-ranking-titanium" } } return t }, ne.getCurrentGiveaway = function(e) { var n = z(ue.currentGiveaway, ge, e, "featuredReward"); if (n) return n; var i = new Date, a = null; return ge = t.defer(), ne.callSessionApi(o.giveaways.current, { locale: d.getCurrentLocale().code }).then(function(e) { i = new Date - i, se.giveawaydetails = e.data.data.last_modified_stampMicro; try { if (_.isEmpty(e.data.data.giveaways)) throw { errorType: N.CURRENT_GIVEAWAY_EXPIRED, message: "Got empty response" }; ue.currentGiveaway = e.data.data.giveaways; var t = j(ue.currentGiveaway[0].drawStampMicro), n = j(ue.currentGiveaway[0].endStampMicro); ue.currentGiveaway[0].drawStampAdjusted = t, ue.currentGiveaway[0].endStampAdjusted = n, U(ue.currentGiveaway[0].assets); var o = J(ue.currentGiveaway); V(o), ge.resolve(ue.currentGiveaway), r.trigger(x.CURRENT_GIVEAWAY_REFRESHED, ue.currentGiveaway) } catch (t) { re.error("getCurrentGiveaway exception", t.message, e); var s = t.errorType || N.API_EXCEPTION; a = new W(N.CURRENT_GIVEAWAY_FAILED, t.message, s), ge.reject(a) } F(w.GET_CURRENT_GIVE_AWAY, e, i) }).catch(function(e) { i = new Date - i, re.error("getCurrentGiveaway failed with", e), F(w.GET_CURRENT_GIVE_AWAY, e, i), a = H(e, N.CURRENT_GIVEAWAY_FAILED), ge.reject(a) }).finally(function() { ge = null }), ge.promise }, ne.getGiveawayEntryDetails = function(e, n) { var i = z(ue.giveawayEntryDetails[e], ye[e], n, "featuredReward"); if (i) return i; var a = new Date, s = null; return ye[e] = t.defer(), ne.callSessionApi(o.giveaways.get, { id: le.userId, giveaway_id: e }).then(function(t) { a = new Date - a, se.usergiveaway = t.data.data.last_modified_stampMicro; try { if (_.isEmpty(t.data.data[0])) throw { message: "Got empty response" }; t.data.data[0].tokens = +t.data.data[0].tokens, ue.giveawayEntryDetails[e] = t.data.data[0], ye[e].resolve(t.data.data[0]), r.trigger(x.GIVEAWAY_ENTRY_DETAILS_REFRESHED, t.data.data[0]) } catch (n) { re.error("getGiveawayEntryDetails exception", n.message, t), s = new W(N.GIVEAWAY_ENTRY_DETAILS_FAILED, n.message, N.API_EXCEPTION), ye[e].reject(s) } F(w.GET_GIVEAWAY_ENTRY_DETAILS, t, a) }).catch(function(t) { a = new Date - a, re.error("get giveaway entry details failure", t), F(w.GET_GIVEAWAY_ENTRY_DETAILS, t, a), s = H(t, N.GIVEAWAY_ENTRY_DETAILS_FAILED), ye[e].reject(s) }).finally(function() { ye[e] = null }) }, ne.addTokensToGiveaway = function(e, t) { var n = new Date; return ne.callSessionApi(o.giveaways.addTokens, {}, { id: le.userId, giveaway_id: e, tokens: t }).then(function(e) { return n = new Date - n, ne.refresh(), F(w.ADD_TOKENS_TO_GIVEAWAY, e, n), e }).catch(function(e) { n = new Date - n, F(w.ADD_TOKENS_TO_GIVEAWAY, e, n) }) }, ne.getCurrentGiveawayId = function() { return ue.currentGiveaway[0].id }, ne.getAllUserAchievements = function(e) { var n = z(ue.userAchievements, ve, e, "achievements"); if (n) return n; ve = t.defer(); var i = new Date; return ne.callSessionApi(o.achievements.getAllUserAchievements, { locale: d.getCurrentLocale().code }).then(function(e) { se.achievements = e.data.data.last_modified_stampMicro, i = new Date - i; try { var t = ee(e.data.data.achievements); V(t), ue.userAchievements = e.data.data.achievements, r.trigger(x.ALL_USER_ACHIEVEMENTS_REFRESHED, e.data.data.achievements), ve.resolve(e.data.data.achievements) } catch (t) { re.error("getAllUserAchievements exception", t.message, e) } F(w.GET_ALL_USER_ACHIEVEMENTS, e, i) }).catch(function(e) { i = new Date - i, F(w.GET_ALL_USER_ACHIEVEMENTS, e, i); var t = H(e, N.ACHIEVEMENTS_FAILED); ve.reject(t) }).finally(function() { ve = null }), ve.promise }, ne.setBadges = function(e) { var n = new Date; return ne.callSessionApi(o.achievements.setBadges, { locale: d.getCurrentLocale().code }, { badges: e }).then(function(e) { return n = new Date - n, ne.refresh(), F(w.SET_BADGES, e, n), e.data.data.achievements }).catch(function(e) { return n = new Date - n, F(w.SET_BADGES, e, n), t.reject(e) }) }, ne.setAchievementsTitle = function(e) { var n = new Date; return ne.callSessionApi(o.achievements.setAchievementsTitle, { locale: d.getCurrentLocale().code }, { achievement_id: e }).then(function(e) { return n = new Date - n, ne.refresh(), F(w.SET_ACHIEVEMENTS_TITLE, e, n), e.data }).catch(function(e) { return n = new Date - n, F(w.SET_ACHIEVEMENTS_TITLE, e, n), t.reject(e) }) }, ne.getUserNotifications = function() { return ne.callSessionApi(o.notification.get, { locale: d.getCurrentLocale().code }).then(function(e) { return re.info("success getting user notification count: ", e.data.data.user_notifications.length), te(e.data.data.user_notifications), e.data.data }).catch(function(e) { re.error("failed to get user notification Error: ", e) }) }, ne.markNotificationRead = function(e) { return ne.callSessionApi(o.notification.markRead, {}, { id: e.id }).then(function(t) { re.info("successfully marked notification as read", e) }).catch(function(e) { re.error("failed to mark the notification as read. Error: ", e) }) }, ne.refresh = function() { var e = new Date; ne.callSessionApi(o.refresh.get).then(function(t) { e = new Date - e; var n = t.data.data.stamps; n.avatar && se.avatar < n.avatar.stampMicro && r.trigger(h.AVATAR_UPDATE_STALE, { userId: $() }), n.cover && se.cover < n.cover.stampMicro && r.trigger(h.COVER_UPDATE_STALE, { userId: $() }), (n.missions && se.missions < n.missions.stampMicro || n.global_missions && se.missions < n.global_missions.stampMicro) && ne.getUserMissions(!0), n.extendedprofile && se.extendedprofile < n.extendedprofile.stampMicro && ne.getExtendedProfile(!0), n.activitylog && se.activitylog < n.activitylog.stampMicro && ne.getActivityLog(!0), n.global_xplevel && se.xplevel < n.global_xplevel.stampMicro && ne.getXpLevel(!0), n.global_giveawaydetails && se.giveawaydetails < n.global_giveawaydetails.stampMicro ? ne.getCurrentGiveaway(!0).then(function() { ne.getGiveawayEntryDetails(ne.getCurrentGiveawayId(), !0) }) : n.usergiveaway && se.usergiveaway < n.usergiveaway.stampMicro && ne.getGiveawayEntryDetails(ne.getCurrentGiveawayId(), !0), n.achievements && se.achievements < n.achievements.stampMicro && ne.getAllUserAchievements(!0), ne.getUserNotifications(), F(w.GET_REFRESH_INFORMATION, t, e) }).catch(function(t) { e = new Date - e, F(w.GET_REFRESH_INFORMATION, t, e) }) }, ne.getFeatureEnabled = function(e) { return e in we && we[e] }, ne.gotoUserProfile = function(e, t, o, i) { "main.auth.userProfile" !== n.current.name ? n.go("main.auth.userProfile", { startWithTab: e || O.DEFAULT_TAB, showDialog: t, rewardPackageId: o }) : r.trigger(C.SWITCH_TAB, { destination: e, callback: i }) }, ne.callSessionApi = function(e, n, r) { n = n || {}; var o = void 0; return o = ne.hasSession() || !l.onlineState.online && "GET" === e.config.method ? t.resolve() : ne.initializeSession(), o.then(function() { return angular.extend(n, { sessionToken: oe.token }), e(n, r) }) }, ne.initializeSession = function() { var e = null; if (ie === !1) return e = new W(N.SESSION_INIT_FAILED, "user profile is disabled"), t.reject(e); if (!c.hasSession()) return e = new W(N.SESSION_INIT_FAILED, "user not logged in"), t.reject(e); if (le = c.getLoggedInUser(), ne.hasSession()) return t.resolve(oe); if (_.isNull(de)) { de = t.defer(); var n = v.jarvis.cevoClientId, r = new Date, s = ""; c.getDelegateToken(n).then(function(n) { r = new Date - r, re.info("Jarvis cevo delegate token successfull"); var s = n.data; F(w.GET_JARVIS_DELEGATE_TOKEN_AFFINITY, n, r, I.JARVIS); var c = !1, u = {}; t.all([m.isAutoOptimizeEnabled(), a.getGeolocation()]).then(function(e) { c = e[0], u = { countryCode: e[1].countryCode, country: e[1].country, state: e[1].state } }).finally(function() { var t = new Date; o.session.create({ delegateToken: s.delegateToken }, { metadata: { autooptimize: c, clientversion: l.version, region: u } }).then(function(e) { re.info("cevo session initialized successfull", e); var n = (new Date).getTime(), r = e.data.data.stampMicro; return ae = n - r, ae = 1e3 * Math.round(ae / 1e3), t = new Date - t, oe.token = e.data.data.token.token, oe.expires = 1e3 * e.data.data.token.expires, F(w.CREATE_CEVO_SESSION, e, t), e.data.data.supportValue ? (we = (0, i.default)(we, e.data.data.supportValue), re.info("overriding feature toggle on session init:", e.data.data.supportValue)) : (we = (0, i.default)(we, Ae), re.info("feature toggles set to ", we)), de.resolve(oe) }).catch(function(n) { return t = new Date - t, re.error("failed to initialize cevo session", n), F(w.CREATE_CEVO_SESSION, n, t), e = H(n, N.SESSION_INIT_FAILED), de.reject(e) }).finally(function() { de = null }) }) }).catch(function(t) { r = new Date - r, re.error("failed to get cevo delegateToken", t), F(w.GET_JARVIS_DELEGATE_TOKEN_AFFINITY, t, r, I.JARVIS), s = t && t.data || "", e = new W(N.SESSION_INIT_FAILED, s), de.reject(e), de = null }) } return de.promise }, ne.initialize = function(e) { ie = !0, Ae = e, r.on(p.LOGIN_STATUS_CHANGE, B), r.on(C.VIEW_PROFILE_PAGE, q), ne.initializeSession().then(function() { ne.getUserMissions(), ne.getExtendedProfile(), ne.getActivityLog(), ne.getXpLevel(), ne.getCurrentGiveaway().then(function() { ne.getGiveawayEntryDetails(ne.getCurrentGiveawayId()) }), ne.getAllUserAchievements(), ne.getUserNotifications() }) } }]); t.cevoService = d }, , , , , function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } function o(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.gfeTargetService = void 0; var i = n(13), a = o(i), s = n(35), l = o(s), c = n(3), u = r(c), d = n(44); n(12), n(16), n(202); var f = d.ngMainUtilsModule.service("gfeTargetService", ["$log", "jarvisService", "eventAggregator", "COMMON_EVENTS", "telemetryService", "targetService", "GFECLIENT_CONFIG", "$q", "dbCacheService", "DB_NAMES", "$filter", "SERVICE_HOSTNAMES", "HTTP_STATUS_CODES", "ADOBE_TARGET_ERROR_MSGS", "TELEMETRY_ORIGINAL_SERVICE_NAME", "TELEMETRY_ADOBE_TARGET_API_URL", "EXPERIENCE_TYPE", "VARIANT_TYPE", "socketService", "AB_HUB_SOCKET_EVENTS", "AB_HUB_MESSAGE_TYPES", "abHubEndpoints", "gfeService", "gxTargetEndpoints", "httpTelemetryService", function(e, t, n, r, o, i, s, c, d, f, m, p, g, v, h, y, E, b, S, _, w, A, T, I, C) { function x() { var e = t.getLoggedInUser(); e && e.userId ? (q.userId = e.userId, z = d.getCachedUserItem(e.userId, f.JARVIS_GFE_STORE, f.USER_AB_STATE)) : z = null, $ = [], W = null, U.setMboxThirdPartyId(e && e.userId) } function M() { j = c.defer(), Y = j.promise } function D(e) { V.info("AB Context updated", e), e.messageType === w.SYNC && (K = e.experiments, o.syncExperienceControlInfo(K)) } function O(e) { V.info("Ab Hub client status", H), H = e, H && (M(), j.resolve()) } function R(e) { var t = P(K, e), n = c.defer(); if (t) n.resolve(t); else { var r = L(z, e), o = L(B, e); c.all([r, o]).then(function(r) { var o = r[0], i = r[1]; if (o) { var a = z.activeExperiments; t = P(a, e) } else if (i) { var s = B.activeExperiments; t = P(s, e) } n.resolve(t) }) } return n.promise } function N(e) { var t = (0, l.default)({}, X); t.activity.id = e, k("remove", w.DELETE, t) } function L(e, t) { var n = c.defer(); return e ? e.sync_().then(function() { var r = e.activeExperiments, o = P(r, t); n.resolve(!!o) }).catch(function() { V.error("Failed to sync db while finding experiment"), n.resolve(!1) }) : n.resolve(!1), n.promise } function P(e, t) { return u.find(e, function(e) { return e.activity.id == t }) } function k(e, t, n) { H || (V.info("AB Hub not ready, checking status"), A.status().then(function(e) { V.info("AB Hub Ready status", e), H = !0, j.resolve(H) }).catch(function(e) { V.error("AB Hub status API failed", e), j.reject(e) })), Y.then(function() { u.isEmpty(q.userId) && x(); var r = { activity: n.activity, variant: n.result }; V.info("Going to call ab hub endpoint", e, t, n), A[e]({}, { messageType: t, userId: q.userId, clientName: q.clientName, clientVer: q.clientVer, experiments: [r] }) }).catch(function(e) { V.error("Failed to call Ab hub endpoint", e) }) } function G(e, t) { C.sendSdkHttpTelemetry(t, T.onlineState.online, p.ADOBE_TARGET, e.duration, e.status, y.GET_VARIANT, e.response, h.ADOBE, e.serviceUseCase) } function F(e, t) { var n = u.find($, function(t) { return t.activity.id === e }); u.isUndefined(n) && (n = (0, l.default)({}, Z), n.activity.id = e, n.activity.name = e, n.result.data = t, n.result.name = e, $.push(n), k("add", w.ADD, n)) } var U = this, V = e.getInstance("main.utils/GfeTargetService"), z = null, B = null, $ = [], W = null, H = !1, j = null, Y = null, q = { userId: "", clientName: s.windowName, clientVer: T.version }, K = [], Q = {}, Z = { activity: { id: "", name: "", type: E.BETA }, result: { data: {}, name: "", type: b.CONTROL, status: !1 } }, X = { activity: { id: "", name: "", type: "" }, result: { data: {}, name: "", type: E.FR, status: !1 } }; U.initialize = function() { i.setExperimentMbox(s.windowName), x(), n.on(r.LOGIN_STATUS_CHANGE, x), B = d.getCachedGlobalItem(f.GLOBAL_STORE, f.GLOBAL_AB_STATE), Q = s.experienceControlQa || {}, i.setQaConfig(Q), M(), S.register(_.AB_CONTEXT_UPDATED, r.AB_CONTEXT_UPDATED), n.on(r.AB_CONTEXT_UPDATED, D), S.register(_.AB_HUB_STATUS_UPDATED, r.AB_HUB_STATUS_UPDATED), n.on(r.AB_HUB_STATUS_UPDATED, O) }, U.setMboxThirdPartyId = function(e) { var t = e ? e : o.deviceId ? o.deviceId : o.sessionId; i.setMboxThirdPartyId(t) }, U.getVariant = function(e, t) { var n = c.defer(), r = e.activityId, o = Date.now(); return i.getVariant(e).then(function(e) { var i = e.activity, s = (0, l.default)({}, e.variant); if (e.result = s, delete e.variant, i && i.id && i.name && s && s.name) { if (e.disableContext ? V.info("Telemetry context disabled for activity id: ", r) : k("add", w.ADD, e), t) { V.info("Tracking success telemetry for activity id: ", r); var c = { serviceUseCase: t, duration: Date.now() - o, response: (0, a.default)(e).slice(0, 1024), status: g.SUCCESS }; G(c, !0) } n.resolve(s.data) } else V.info("No telemetry for legacy config experiments"), n.resolve(e) }).catch(function(e) { if (e) if (e.apiFailure) { if (t) { V.info("Tracking failure telemetry for activity id: ", r); var i = { serviceUseCase: t }; e.status === v.TIMEOUT ? (i.networkErrorCode = g.TIMEOUT, G(i, !1)) : (i.response = (0, a.default)(e).slice(0, 1024), i.duration = Date.now() - o, i.status = g.SERVER_ERROR, G(i, !0)) } R(r).then(function(t) { t ? (V.info("api failure for get variant, resolving saved experiment data", e), n.resolve(t.variant.data)) : (V.info("api failure for get variant, no saved data found"), n.reject(e)) }) } else N(r), n.reject(e) }), n.promise }, U.trackConversion = i.trackConversion, U.getActiveExperiments = function() { var e = [], t = c.defer(); return e = e.concat($, K), z ? z.sync_().then(function() { e = e.concat(z.activeExperiments), B.sync_().then(function() { e = e.concat(B.activeExperiments), t.resolve(e) }).catch(function() { V.error("Failed to sync global Db for active experiments"), t.resolve(e) }) }).catch(function() { V.error("Failed to sync user Db for active experiments"), t.resolve(e) }) : B.sync_().then(function() { e = e.concat(B.activeExperiments), t.resolve(e) }).catch(function() { V.error("Failed to sync global Db for active experiments"), t.resolve(e) }), t.promise }, U.getBetaVariant = function(e) { var n = c.defer(), r = null; return r = u.isNull(W) ? t.getUserData(s.jarvis.commonClientId, f.BETA_FEATURES).then(function(e) { W = e }).catch(function() { W = {} }) : c.resolve(), r.then(function() { var t = u.findWhere(W.features, { name: e }); if (u.isUndefined(t)) { var r = (0, l.default)({}, Z); r.activity.id = e, k("remove", w.DELETE, r) } else F(e, t); n.resolve(t) }), n.promise }, U.getFeature = function(e) { var t = e.activityId, n = { clientParams: e }; if (!u.isEmpty(Q) && Q[t]) { var r = Q[t]; if (r.resolve) return V.debug("Resolving fake response for", t, r), c.resolve(r.resolve.result); if (r.reject) return V.debug("Rejecting with fake payload for", t, r), c.reject(r.reject) } return I.getFeature(n).then(function(e) { V.info("GX Target Feature", n.clientParams.cvName, e); var t = null; if (e && e.data.cloudVariables.length > 0) { t = e.data.cloudVariables[0]; var r = e.data.cloudVariables[0].metadata; if (!r || r && !r.disableContext) k("add", w.ADD, t); else { var o = e.data.cloudVariables[0].activity.id; V.info("Telemetry context disabled for activity id : ", o); var i = e.data.cloudVariables[0].name; V.info("Telemetry context disabled for cvName : ", i) } } else N(n.clientParams.cvName), V.info("No telemetry for legacy config experiments"); return t }).catch(function(e) { return V.error("failed to get feature from gx target", e), {} }) } }]); t.gfeTargetService = f }, , function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.mediaDialogService = void 0; var o = n(1), i = n(744), a = r(i); n(363), n(17), n(163), n(389); var s = o.ngMainCommonModule.service("mediaDialogService", ["$mdDialog", "$rootElement", function(e, t) { var n = this, r = {}, o = function() { function e(e) { t[e] = function(r) { return r ? (n[e] = r, t) : n[e] } } var t = this, n = {}; e("event"), e("toolbarHtml"), e("image"), e("video") }; n.show = function(r) { var o = e.show({ template: a.default, controller: "MediaDialogController", controllerAs: "mediaDialog", parent: t.find("nv-window"), targetEvent: r.event() }); return n.setDialogModel(r), o }, n.close = function(t) { e.cancel() }, n.setDialogModel = function(e) { r = e }, n.getDialogModel = function() { return r }, n.customPreset = function() { return new o } }]); t.mediaDialogService = s }, , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nodeService = void 0; var r = n(44); n(19), n(31), n(16); var o = r.ngMainUtilsModule.service("nodeService", ["$log", "cefService", "dialogService", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "eventAggregator", "SOCKETIO_EVENTS", "socketService", "GFECLIENT_CONFIG", "FATAL_ERRORS", function(e, t, n, r, o, i, a, s, l, c) { function u(e, i) { t.enableCloseButton(!0), r.push(o.GFE_NODE_FAILURE, e, { anonymize: !0 }), h.info("display oops message with error:", e); var a = i === c.socketReconnnectFail ? "l10n.errorRestartApplication" : "l10n.errorRestartPC"; n.show("nv-dialog-message", { title: "l10n.nvidiaGfeTitle", titleStyle: { "font-size": "14px" }, text: a, errorCode: i, button1: { text: "l10n.close", action: function() { t.windowClose() } } }) } function d() { s.setReconnectionAttempts(1 / 0) } function f() { s.setReconnectionAttempts(y.reconnectionAttempts) } function m(e) { h.info("Successful reconnection attempt number: ", e), s.setReconnectionAttempts(y.reconnectionAttempts) } function p(e) { h.info("socket event reconnecting attempt number: ", e) } function g() { h.info("socket event reconnect_failed"), u("socket event reconnect_failed", c.socketReconnnectFail) } function v() { h.info("registering event listeners"), i.on(a.RECONNECT, m), i.on(a.RECONNECTING, p), i.on(a.RECONNECT_FAILED, g) } var h = e.getInstance("main.utils/nodeService"), y = angular.merge({}, l.nodeService); return { initialize: v, showErrorMessage: u, setReconnectionToInfinity: d, setReconnectionToDefault: f } }]); t.nodeService = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvSelectMenuItem = void 0; var o = n(1), i = n(753), a = r(i); n(382); var s = o.ngMainCommonModule.directive("nvSelectMenuItem", [function() { return { restrict: "E", scope: { nvAction: "&", nvSelectedTest: "&", nvDisabled: "=ngDisabled", nvTelemetry: "@" }, transclude: !0, template: a.default, controller: "SelectMenuItemController", controllerAs: "selectMenuItem", link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }]); t.nvSelectMenuItem = s }, , , function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOptimizedIcon = void 0; var o = n(14), i = n(808), a = r(i); n(479); var s = o.ngGamesModule.directive("nvOptimizedIcon", function() { return { restrict: "E", scope: { nvSystemGame: "=" }, transclude: !0, template: a.default, controller: "OptimizedIconController", controllerAs: "optimizedIcon", bindToController: !0, link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvOptimizedIcon = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPlayGame = void 0; var o = n(1), i = n(809), a = r(i); n(480); var s = o.ngMainCommonModule.directive("nvPlayGame", [function() { return { restrict: "E", scope: { nvSystemGame: "&", nvTelemetry: "@", nvLocal: "@" }, template: a.default, controller: "PlayGameController", controllerAs: "vm", bindToController: !0, link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }]); t.nvPlayGame = s }, , , , , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ngNotificationsModule = void 0; var r = n(23), o = n(24), i = angular.module("main.notifications", ["main.common", r.ngMainConstantsModule.name, "ngResource", "pascalprecht.translate", "ngSanitize", o.ngTelemetryModule.name]); angular.module("main").requires.push("main.notifications"), i.constant("NOTIFICATION_TYPE", { NEW_REWARD: 0, NEW_FRIEND_REQUEST: 1 }), t.ngNotificationsModule = i }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.redeemRewardController = void 0; var o = n(53); n(120), n(16), n(17); var i = n(720), a = r(i), s = o.ngRewardsModule.controller("RedeemRewardController", ["$log", "$mdDialog", "REWARDS_CONSTANTS", "$sce", "$timeout", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "$document", "rewardsService", "$filter", "REWARDS_ASSET_DIMENSIONS", function(e, t, n, r, o, i, s, l, c, u, d) { function f(e) { y.dialogRequestInProgress = e } function m() { y.rewardPackage && y.rewardPackage.assets && y.rewardPackage.assets.information && y.rewardPackage.assets.information.more_information && (_ = y.rewardPackage.assets.information.more_information.url, E.debug("Got Learn More URL from RDS", _)) } function p(e) { y.errorMessage = e.message || u("translate")("l10n.unableToProcessRedemption"), y.codeValidationErrorIcon = S.BLOCK } function g() { y.isDialogStateCouponValidation() ? i.push(s.REDEEM_CODE_FAILED_CLOSE) : i.push(s.REWARDS_REDEMPTION_PORTAL_CLOSE, { couponCode: y.code || "" }) } function v() { var e = Math.floor(Math.random() * A.length); w = (A[e] * T[e] + I[e]) / C[e] - x[e], y.mathQuestion = u("translate")("l10n.mathQuestion", { mulA: A[e], mulB: T[e], add: I[e], div: C[e], sub: x[e] }) } function h() { y.dialogState = b.COUPON_VALIDATION, y.nvRedemptionError ? (y.dialogImage = a.default, y.dialogTitle = u("translate")("l10n.redeem"), y.rewardPackage = y.nvRedemptionError.rewardPackage, m(), p(y.nvRedemptionError)) : y.nvRedemptionPortalIframeUrl ? (y.dialogState = b.EXTERNAL_PAGE, f(!0), y.externalUrl = r.trustAsResourceUrl(y.nvRedemptionPortalIframeUrl), o(function() { l.ready(function() { f(!1) }) }, 0), E.debug("Portal rendered in-app with url", y.externalUrl)) : y.perkDetails ? (y.dialogImage = c.getFormattedImageUrl(y.perkDetails.campaign.imageLink, d.DIALOG_IMAGE), y.dialogTitle = y.perkDetails.campaign.title, y.perkLevel = y.perkDetails.campaign.rules.perkLevel, y.perkDetailsHeader = y.perkDetails.campaign.tagline, y.perkDetailsDescription = y.perkDetails.campaign.description) : y.sweepDetails ? (y.dialogImage = c.getFormattedImageUrl(y.sweepDetail.campaign.imageLink, d.DIALOG_IMAGE), y.answerInput = "", y.answerInputPlaceholder = u("translate")("l10n.answer"), y.answerInvalid = !1, v()) : E.error("Rewards Dialog initialised incorrectly") } var y = this, E = e.getInstance("main.rewards/RedeemRewardController"), b = { COUPON_VALIDATION: "VALIDATE_COUPON_CODE", EXTERNAL_PAGE: "SHOW_EXTERNAL_PAGE" }, S = { WARNING: "warning", BLOCK: "block" }, _ = c.rewardsFaqUrl, w = null, A = [228, 86, 228, 86, 31, 51, 48, 60, 15, 92, 92, 92, 84, 18], T = [21, 16, 16, 21, 15, 12, 72, 24, 12, 86, 86, 21, 17, 47], I = [10824, 124, 10824, 114, 111, 24, 36, 348, 135, 44, 56, 48, 12, 22], C = [12, 12, 12, 12, 12, 12, 12, 12, 15, 12, 24, 20, 20, 14], x = [112, 24, 24, 24, 21, 17, 189, 42, 10, 52, 131, 19, 31, 14]; y.isDialogStateCouponValidation = function() { return y.dialogState === b.COUPON_VALIDATION }, y.isDialogStateExternalPage = function() { return y.dialogState === b.EXTERNAL_PAGE }, y.onLearnMoreClicked = function() { c.openLearnMoreWindow(_) }, y.closeDialog = function() { g(), t.cancel() }, y.tryAgain = function() { g(), t.hide() }, y.validateAnswer = function() { y.answerInvalid = !1, y.answerInput = y.answerInput.replace(/\D/g, "") }, y.submitAnswer = function() { parseInt(y.answerInput) === w ? t.hide() : y.answerInvalid = !0 }, h() }]); t.redeemRewardController = s }, , , , , function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, ".search-container .search-input-container{margin:0 8px 0 0;width:420px;padding:0!important;background-color:#363636}.search-container .search-input-container.visible{visibility:visible;opacity:1;width:420px;transition:all .2s ease-in-out}.search-container .search-input-container.hidden{visibility:hidden;opacity:0;width:0;height:0}.search-container .search-input-container .search-input{margin:0!important;padding-left:50px;padding-right:16px;height:40px}.search-container .search-input-container .search-input::placeholder{color:rgba(255,255,255,.15)}.search-container .search-input-container .active-search-icon,.search-container .search-input-container .search-icon{position:absolute;left:16px}.search-container .search-input-container .active-search-icon{color:#76b900}.search-container .search-input-container .clear-icon-button{position:absolute;top:8px;right:6px;min-height:24px}.search-container .search-result-container{position:absolute;background:#363636;box-shadow:0 0 10px #020202;width:420px;padding-bottom:16px}.search-container .search-result-container.hidden{padding-bottom:0!important}.search-container .search-result-container .search-result-scroll-content{min-height:32px;max-height:496px}.search-container .search-result-container md-list-item,.search-container .search-result-container md-list-item .md-button,.search-container .search-result-container md-list-item .md-list-item-inner{min-height:74px!important;max-height:74px}.search-container .search-category-title{margin-top:24px}.search-container .search-category-title h4{margin:0 16px!important;padding:0!important}.search-container .search-result-not-found{margin:0!important}.search-container .search-result-not-found .search-error-icon{width:32px;height:32px;line-height:32px;margin:0}.search-container .search-result-not-found .search-error-header{font-size:16px;margin:24px 0;color:rgba(255,255,255,.3)}.search-container .search-result-not-found .search-error-message{font-size:12px;margin:0;color:rgba(255,255,255,.3)}.search-container .search-result-container .search-item-preview{margin-right:10px;height:24px;width:24px;display:flex;justify-content:flex-end}.search-container .search-result-container .search-item-thumbnail{height:72px;width:100px;margin-right:16px}.search-container .search-result-container .search-item-thumbnail img{width:100px;height:56px;margin-top:8px;opacity:.5}.search-container .search-result-container .search-item-icon{height:56px;width:100px;margin-right:16px;background-color:rgba(17,17,17,.5)}.search-container .search-result-container .search-item-icon md-icon{font-size:48px;color:#fff;width:auto;height:auto;opacity:.3}.search-container .search-result-container md-list-item:hover p,.selected-search-item p{color:rgba(255,255,255,.9)!important}.search-result-height{height:72px}.search-container .search-result-container md-list-item:hover,.selected-search-item{background-color:rgba(40,40,40,.8)}.search-container .search-result-container md-list-item:hover img,.selected-search-item img{opacity:1!important}.search-container .search-result-container md-list-item:hover md-icon,.selected-search-item md-icon{opacity:.45!important}.search-container .search-result-container md-list-item:hover img{opacity:1!important}.search-container .search-result-container md-list-item:hover md-icon{opacity:.45!important}.search-container .search-result-container md-list-item .md-button:hover{background-color:transparent!important}.search-container-bottom-gradient{width:420px;height:24px;margin:0 0 16px;background:linear-gradient(rgba(54,54,54,0),rgba(54,54,54,0))}.search-result-fallback{height:250px}.search-result-item .search-title{margin:0 0 8px;color:rgba(255,255,255,.3);line-height:15px}.search-result-item .search-preview{font-size:10px;color:rgba(255,255,255,.15);margin:0;line-height:15px}.recent-search-item .search-title{color:rgba(255,255,255,.3)}.search-category-divider{margin-top:8px;height:1px;background-color:#404040}.search-result-container ::-webkit-scrollbar-thumb{background:#464646!important}", ""]) }, , , function(e, t, n) { e.exports = n.p + "default-cover.jpg" }, , , function(e, t) { e.exports = '
l10n.couponRedemption
close {{redeemReward.dialogTitle}}
card_giftcard {{redeemReward.codeValidationErrorIcon}}

{{redeemReward.errorMessage}}

{{redeemReward.perkLevel}}

{{redeemReward.perkDetailsHeader}}

{{redeemReward.perkDetailsDescription}}

{{redeemReward.mathQuestion}}

close
' }, , , , , function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } t.__esModule = !0; var o = n(316), i = r(o); t.default = function(e, t, n) { return t in e ? (0, i.default)(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e } }, , , , , , , , , , , , , , , , , , , , , , , , , , , , function(e, t, n) { var r = n(233); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, , , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvBadge = void 0; var r = n(1), o = r.ngMainCommonModule.directive("nvBadge", function() { return { restrict: "A", link: function(e, t, n, r, o) { n.$observe("nvBadge", function(e) { if (e && "0" !== e) { t.removeClass("nv-hide-after"), t.addClass("nv-badge-border"); var n = parseInt(e, 10); n > 9 && n < 100 ? (t.removeClass("nv-badge-double-digits-plus"), t.addClass("nv-badge-double-digits")) : n > 99 && (t.removeClass("nv-badge-double-digits"), t.addClass("nv-badge-double-digits-plus")) } else t.addClass("nv-hide-after") }) } } }); t.nvBadge = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } function o(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvCarousel = void 0; var i = n(3), a = o(i), s = n(1); n(359), n(17), n(335); var l = n(729), c = r(l); n(332); var u = s.ngMainCommonModule.directive("nvCarousel", ["eventAggregator", "GAME_EVENTS", function(e, t) { function n(n, r, o, i) { function s(r) { if (r.name) for (var o = n.nvSlides.length, s = 0; s < o; s++) if (a.has(n.nvSlides[s], "annotation")) { var l = a.findWhere(n.nvSlides[s].annotation, { nvSettingName: r.name }); if (!a.isUndefined(l)) { i.selectedIndex = s, e.trigger(t.GAMEVOPSITEM_MATCHED, r), n.nvSlides[s].loaded ? (e.trigger(t.SETTING_ITEM_HOVER_CAROUSEL_READY, r), d = null, f = null) : (d = r, f = n.nvSlides[s].image); break } e.trigger(t.GAMEVOPSITEM_UNMATCHED, {}) } } function l(r) { var o = a.findWhere(n.nvSlides, { image: r }); a.isUndefined(o) || (o.loaded = !0, a.isNull(f) || f !== r || (e.trigger(t.SETTING_ITEM_HOVER_CAROUSEL_READY, d), d = null, f = null)) } function c(e) { var t = a.findWhere(n.nvSlides, { image: e }); a.isUndefined(t) || (t.loaded = !1) } function u() { e.off(t.SETTING_ITEM_HOVER, s), e.off(t.IMAGE_LOADED, l), e.off(t.IMAGE_UNLOADED, c), r.empty(), r.remove(), r = null } var d = null, f = null; e.on(t.SETTING_ITEM_HOVER, s), e.on(t.IMAGE_LOADED, l), e.on(t.IMAGE_UNLOADED, c), n.$on("$destroy", u), r.on("$destroy", function() { n.$destroy() }) } return { restrict: "E", scope: { nvSelectedIndex: "=", nvSlides: "=", nvEventInfo: "@", nvIsBanner: "@" }, template: c.default, controller: "CarouselController", controllerAs: "carousel", link: n } }]); t.nvCarousel = u }, , function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.countdownTimerDirective = void 0; var o = n(199), i = r(o), a = n(1); n(385); var s = a.ngMainCommonModule.directive("nvCountdownTimer", ["$log", "$filter", "systemClockService", "eventAggregator", "COMMON_EVENTS", "COUNTDOWN_TIMER_STATES", function(e, t, n, r, o, a) { return { restrict: "E", scope: { nvEndTimestamp: "@", nvCallback: "&", nvTranslate: "@", nvFormat: "@" }, template: '', link: function(s, l) { function c(e) { return s.nvTranslate ? t("translate")(s.nvTranslate, { countdown: e }) : e } function u(e) { var n = "", r = 1, o = e.days(), i = e.hours(), a = e.minutes(), s = e.seconds(); return o > 1 ? (r = o, n = t("translate")("l10n.days")) : 1 == o ? n = t("translate")("l10n.day") : i > 1 ? (r = i, n = t("translate")("l10n.hours")) : 1 == i ? n = t("translate")("l10n.hour") : a > 1 ? (r = a, n = t("translate")("l10n.minutes")) : 1 == a ? n = t("translate")("l10n.minute") : s > 1 ? (r = s, n = t("translate")("l10n.seconds")) : (r = s, n = t("translate")("l10n.second")), c(r + " " + n) } function d(e) { return c(e.days() + "d : " + e.hours() + "h : " + e.minutes() + "m : " + e.seconds() + "s") } function f(e) { b = e.getTime(), S = i.default.duration(s.nvEndTimestamp - b, "milliseconds"), s.timeLeft = _(S), S._milliseconds < 1 && (p(), S = null, s.nvCallback({ state: a.TIMER_FINISHED })) } function m() { f(new Date), n.subscribeClockUpdates(), r.on(o.SYSTEM_TIME_UPDATED, f) } function p() { n.unsubscribeClockUpdates(), r.off(o.SYSTEM_TIME_UPDATED, f) } function g(e) { var t = null; switch (e) { case "shortTime": t = u; break; default: t = d } return t } function v() { b < s.nvEndTimestamp ? m() : (E.error("End timestamp is less than current timestamp"), s.nvCallback({ state: a.INIT_FAILED })) } function h() { s.timeLeft = c(A), _ = g(s.nvFormat) } function y() { p(), l.empty(), l.remove(), l = null } var E = e.getInstance("main.common/nvCountdownTimer"), b = (new Date).getTime(), S = null, _ = angular.noop, w = 0, A = "--"; Object.defineProperty(s, "nvEndTimestamp", { get: function() { return w }, set: function(e) { w = +e, v() } }), s.$on("$destroy", y), l.on("$destroy", function() { s.$destroy() }), h() } } }]); t.countdownTimerDirective = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvDialogEditEmail = void 0; var o = n(1), i = n(731), a = r(i); n(339), n(283), n(168); var s = o.ngMainCommonModule.directive("nvDialogEditEmail", [function() { return { restrict: "A", scope: {}, bindToController: { nvDialogModel: "=" }, template: a.default, controller: "DialogEditEmailController", controllerAs: "editEmailCtrl" } }]); t.nvDialogEditEmail = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvDialogEmailVerification = void 0; var o = n(1), i = n(732), a = r(i), s = o.ngMainCommonModule.directive("nvDialogEmailVerification", [function() { return { restrict: "A", scope: {}, bindToController: { nvDialogModel: "=" }, template: a.default, controller: [function() {}], controllerAs: "emailVerificationCtrl" } }]); t.nvDialogEmailVerification = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvExtendedPattern = void 0; var o = n(1), i = n(969), a = r(i), s = o.ngMainCommonModule.directive("nvExtendedPattern", [function() { return { restrict: "A", require: "ngModel", link: function(e, t, n, r) { var o = null, i = [], s = 0; n.$observe("nvExtendedPattern", function(e) { try { var t = angular.fromJson(e); t.pattern && (o = a.default(t.pattern)), t.patternGroups && (s = t.patternGroups.required, i = [], angular.forEach(t.patternGroups.patterns, function(e) { i.push(a.default(e)) })) } catch (e) { s = 0, o = null } }), r.$validators.extendedPattern = function(e) { var t = 0; return s > 0 ? (angular.forEach(i, function(n) { n.test(e) && (t += 1) }), t >= s) : !o || o.test(e) } } } }]); t.nvExtendedPattern = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFieldsMatch = void 0; var r = n(1), o = r.ngMainCommonModule.directive("nvFieldsMatch", [function() { return { restrict: "A", require: "ngModel", scope: { nvFieldsMatch: "@" }, link: function(e, t, n, r) { r.$validators.fieldsMatch = function(t) { return t === e.nvFieldsMatch }, n.$observe("nvFieldsMatch", function(e) { r.$validate() }) } } }]); t.nvFieldsMatch = o }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvInputAutofocus = void 0; var o = n(1), i = n(3), a = r(i), s = o.ngMainCommonModule.directive("nvInputAutofocus", ["$timeout", function(e) { return { restrict: "A", link: function(t, n, r) { var o = n.find("input").eq(0); a.isEmpty(o) || e(function() { o.focus() }) } } }]); t.nvInputAutofocus = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvKeyAction = void 0; var r = n(1), o = r.ngMainCommonModule.directive("nvKeyAction", [function() { return { restrict: "A", link: function(e, t, n) { t.bind("keyup", function(t) { var r = t.which || t.keyCode; r == n.nvKeyCode && e.$apply(function() { e.$eval(n.nvKeyAction, { $event: t }) }) }) } } }]); t.nvKeyAction = o }, , function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvNewsItem = t.nvNews = void 0; var o = n(1), i = n(748), a = r(i), s = n(747), l = r(s); n(368), n(34); var c = o.ngMainCommonModule.component("nvNews", { transclude: !0, bindings: { nvShortName: "@", nvNewsSource: "@" }, template: a.default, controller: "NewsController", controllerAs: "news" }), u = o.ngMainCommonModule.component("nvNewsItem", { bindings: { nvNews: "=" }, template: l.default }); t.nvNews = c, t.nvNewsItem = u }, , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.productTourService = void 0; var r = n(1), o = r.ngMainCommonModule.service("productTourService", ["$log", "PRODUCT_TOUR_NAMES", "uiTourService", "dbCacheService", "DB_NAMES", "PRODUCT_TOUR_STATUS", "eventAggregator", "COMMON_EVENTS", "jarvisService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_STATUS", "telemetryService", "TELEMETRY_ACTIONS", "TELEMETRY_AVAILABLE_STATUS", "$document", "$filter", "$timeout", "PRODUCT_TOUR_EVENTS", function(e, t, n, r, o, i, a, s, l, c, u, d, f, m, p, g, v, h) { function y(e) { G[e]; return !(!G[e] || G[e].status !== i.PENDING) } function E() { var e = angular.element(p[0].getElementById("main-user-profile")), n = angular.element(p[0].getElementById("main-user-profile-container")), r = { element: e, stepId: "oobe-profile-enabled", order: 4, title: g("translate")("l10n.joinTheCommunity"), placement: "bottom-right" }, o = { element: n, stepId: "oobe-profile-disabled", order: 4, title: g("translate")("l10n.redeemCodesAndRewards"), placement: "bottom-right" }; b(t.OOBE, U, r, o) } function b(e, t, r, o) { var i = n.getTourByName(e); o && (o = S(i, o) || o), t && !i.hasStep(r.stepId) ? (i.createStep(r), i.removeStep(o)) : t || (i.removeStep(r), o && !i.hasStep(o.stepId) && i.createStep(o)) } function S(e, t) { var n = e._getSteps(); return n && n.find(function(e) { return e.stepId === t.stepId }) } function _(e) { return y(e) && G[e].previousStepOrder || 0 } function w(e, t) { var r = n.getTourByName(e); if (r) { var o = r._getSteps(); o.length > 0 ? (t >= o.length && (t = o.length - 1), r.startAt(t).then(function(n) { k.info("tour launched", e, "step", t), A(e, t), I(r), O(e, t) }).catch(function(n) { k.error("tour failed to launch", e, " stepOrder:", t, " error:", n, " steps count:", o.length) })) : k.error("tour steps not found to launch", e, " stepOrder:", t) } else k.error("tour not found to launch", e, " stepOrder:", t) } function A(e, t) { var r = n.getTourByName(e), o = T(r), a = i.PENDING; t === o && (a = i.COMPLETED); var s = { name: e, status: a, previousStepOrder: t }; G[s.name] = s, G.persist_() } function T(e) { var t = e._getSteps(); return t[t.length - 1].order } function I(e) { e.on("stepChanged", C), e.on("paused", M), e.on("ended", D), a.on(s.WINDOW_RESIZE, R) } function C(e) { if (x(f.NEXT), e) { var t = e.config("name"); A(t, e.order), F.stepStartTime = d.startLoad(c.PRODUCT_TOUR_PROGRESS_EVENT) } F.currentStep += 1 } function x(e) { var t = { name: F.name, step: d.getString(F.currentStep), action: e }; d.endLoad(c.PRODUCT_TOUR_PROGRESS_EVENT, F.stepStartTime, t) } function M() { k.info("Tour paused", F.name), P.sendProductTourExitTelemetry(u.PAUSED), a.off(s.WINDOW_RESIZE, R), a.trigger(h.PAUSED, F.name) } function D() { k.info("Tour ended", F.name), x(f.GOT_IT), P.sendProductTourExitTelemetry(u.SUCCESS), a.off(s.WINDOW_RESIZE, R), a.trigger(h.END, F.name) } function O(e, t) { F.isActive = !0, F.name = e, F.startStep = t, F.currentStep = t, F.isResume = 0 === t ? m.NO : m.YES, F.stepStartTime = d.startLoad(c.PRODUCT_TOUR_PROGRESS_EVENT), F.tourStartTime = d.startLoad(c.PRODUCT_TOUR_EXIT_EVENT) } function R() { var e = p[0].querySelector(".tether-target.tether-enabled"), t = p[0].querySelector(".tether-element.tether-enabled"); if (e && t) { var n = t.querySelector(".arrow"), r = n.getBoundingClientRect(), o = e.getBoundingClientRect(), i = o.x, a = o.width, s = r.x, l = r.width, c = i + .5 * a - (s + .5 * l) + "px"; t.style.left = c } } function N(e) { U = e, E() } function L(e) { e && v(function() { var n = angular.element(p[0].getElementById("main-share-icon")), r = { element: n, stepId: "oobe-share", order: 2, title: g("translate")("l10n.accessTheIgo"), placement: "bottom-right" }; n && b(t.OOBE, e, r) }) } var P = this, k = e.getInstance("main.common/productTourService"), G = null, F = { name: "", currentStep: 0, startStep: 0, isResume: m.NO, status: "", tourStartTime: 0, stepStartTime: 0, isActive: !1 }, U = !1; P.initialize = function() { G = r.getCachedGlobalItem(o.GLOBAL_STORE, o.PRODUCT_TOUR_STATES), a.on(s.LOGIN_STATUS_CHANGE, P.resumeOobeTour), a.on(s.USER_PROFILE_STATUS_UPDATED, N), a.on(s.SHARE_ICON_VIZ_UPDATED, L) }, P.resumeOobeTour = function() { var e = l.getLoggedInUser(); G.sync_().then(function() { e && y(t.OOBE) ? P.startOobeTour(!0) : n.endAllTours() }).catch(function() { k.error("Fatal: failed to sync product tour db or exception") }) }, P.showTour = function(e, t, r) { var o = 0; t && (o = _(e)), r && n.endAllTours(), w(e, o) }, P.sendProductTourExitTelemetry = function(e) { if (F.isActive) { var t = { name: F.name, startStep: d.getString(F.startStep), exitStep: d.getString(F.currentStep), isResume: F.isResume, status: e }; d.endLoad(c.PRODUCT_TOUR_EXIT_EVENT, F.tourStartTime, t), F.isActive = !1 } }, P.onStepShown = function() { R() }, P.startOobeTour = function(e) { E(), P.showTour(t.OOBE, e, !1) }, P.startDriverTour = function() { var e = G[t.DRIVER]; e && e.status !== i.PENDING || P.showTour(t.DRIVER, !0, !1) }, P.isTourRunning = function(e) { var t = F.isActive; return F.isActive && e && (t = F.name === e), t } }]); t.productTourService = o }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.stateService = void 0; var o = n(3), i = (r(o), n(1)), a = i.ngMainCommonModule.service("stateService", ["$log", "$state", "COMMON_DEFAULT_STATES", function(e, t, n) { var r = this; e.getInstance("main.common/stateService"); r.gotoDriversTab = function(e) { t.go(n.DRIVERS, e) }, r.getCurrentStateParams = function() { return t.params } }]); t.stateService = a }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvValidDisplayName = void 0; var r = n(1); n(12); var o = r.ngMainCommonModule.directive("nvValidDisplayName", ["$q", "jarvisService", function(e, t) { return { restrict: "A", require: "ngModel", link: function(n, r, o, i) { i.$asyncValidators.notAvailable = function(n) { var r = e.defer(); return t.displayNameExists(n).then(function(e) { r.reject() }).catch(function(e) { r.resolve() }), r.promise } } } }]); t.nvValidDisplayName = o }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } function o(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.weChatService = void 0; var i = n(13), a = o(i), s = n(3), l = r(s), c = n(1), u = n(711), d = o(u), f = c.ngMainCommonModule.service("weChatService", ["dbService", "DB_NAMES", "$filter", "WECHAT_EVENTS", "eventAggregator", "NOTIFICATION_EVENTS", "WECHAT_CONSTANTS", "NOTIFICATION_CATEGORY", "COMMON_EVENTS", "$q", "$log", "jarvisService", "$state", "windowSpawnService", "dbCacheService", "parllayService", "toastService", "gfeService", "PARLLAY_CONSTANTS", "GFECLIENT_CONFIG", "telemetryService", "TELEMETRY_PARLLAY_JS_SDK_API_NAME", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_WECHAT_SERVICE_API_STATE", "TELEMETRY_SCREENS", "$timeout", "gfeGeolocationService", function(e, t, n, r, o, i, s, c, u, f, m, p, g, v, h, y, E, b, S, _, w, A, T, I, C, x, M) { function D(e) { ae = l.extend(ae, e) } function O() { return b.onlineState && b.onlineState.online ? "false" : "true" } function R() { ae = { jarvisApiState: I.TO_BE_CALLED, parllayFetchQRApiState: I.TO_BE_CALLED, parllayScanQRApiState: I.TO_BE_CALLED, offlineState: "false", jarvisApiDurationMs: 0, parllayFetchQRApiDurationMs: 0, parllayScanQRApiDurationMs: 0, exitScreen: C.SCREEN_WECHAT_QRCODE_LOADING, errorMessage: "NA" } } function N() { o.trigger(r.WECHAT_NOTIFICATION_CLICKED, s.NFAN) } function L() { var e = new Date, t = [{ artWork: d.default, callbackData: s.NFAN.id, callbackFunction: N, heading: { text: "l10n.joinWeChat", values: { clubName: s.NFAN.event } }, description: { text: "l10n.scanNvidiaNewsWeChatQrCode" }, firstNotificationHighResolution: !1, type: c.WECHAT, availableTime: e }]; o.trigger(i.REQUEST_NOTIFICATION, t) } function P() { var e = new Date, t = Q.weChat.NFAN, n = t.fetchTime, r = t.expireTime, o = t.qrCodeURL; return e - n <= r - 3600 ? (Z = !1, { qrcode_url: o, success: !0, expires_in: r }) : (Z = !0, null) } function k() { te = new Date, ae.parllayScanQRApiState = I.CALLED, y.getScanResult().then(function(e) { te = new Date - te; var t = X || oe; t && (t.postMessage({ scanResult: e }, "*"), e.success ? (D({ parllayScanQRApiState: I.SUCCEEDED, parllayScanQRApiDurationMs: te, exitScreen: C.SCREEN_WECHAT_QRCODE_SCAN_SUCCEEDED }), Q.weChat.NFAN.qrCodeScanned || (o.trigger(i.REMOVE_NOTIFICATION, [{ callbackData: ne.id }]), Q.weChat.NFAN.qrCodeScanned = !0, Q.persist_()), w.push(T.PARLLAY_JS_SDK_API_SUCCESS, { apiName: A.GET_SCAN_RESULT, offlineState: O(), durationMs: te })) : (D({ parllayScanQRApiState: I.FAILED, parllayScanQRApiDurationMs: te, exitScreen: C.SCREEN_WECHAT_QRCODE_SCAN_FAILED, errorMessage: e.errors[0].message }), w.push(T.PARLLAY_JS_SDK_API_FAILURE, { apiName: A.GET_SCAN_RESULT, errorCode: (e.errors[0].code || "").toString(), errorMessage: e.errors[0].message, offlineState: O(), durationMs: te }))) }).catch(function(e) { te = new Date - te, D({ parllayScanQRApiState: I.FAILED, parllayScanQRApiDurationMs: te, errorMessage: e && e.type || "" }) }) } function G() { ee = new Date, ae.parllayFetchQRApiState = I.CALLED, y.getQrCode(P()).then(function(e) { if (ee = new Date - ee, Z && e.qrcode_url) { var t = new Date; Q.weChat.NFAN.fetchTime = t, Q.weChat.NFAN.expireTime = e.expires_in, Q.weChat.NFAN.qrCodeURL = e.qrcode_url, Q.persist_() } X && X.postMessage({ qrCodeResult: e }, "*"), e.success ? (D({ parllayFetchQRApiState: I.SUCCEEDED, parllayFetchQRApiDurationMs: ee, exitScreen: C.SCREEN_WECHAT_QRCODE_DISPLAYED }), re && (ie = { qrCodeResult: e }, re.resolve()), k(), w.push(T.PARLLAY_JS_SDK_API_SUCCESS, { apiName: A.GET_QR_CODE, offlineState: O(), durationMs: ee })) : (D({ parllayFetchQRApiState: I.FAILED, parllayFetchQRApiDurationMs: ee, exitScreen: C.SCREEN_WECHAT_QRCODE_LOAD_FAILED, errorMessage: e.errors[0].message }), w.push(T.PARLLAY_JS_SDK_API_FAILURE, { apiName: A.GET_QR_CODE, errorCode: (e.errors[0].code || "").toString(), errorMessage: e.errors[0].message, offlineState: O(), durationMs: ee })) }).catch(function(e) { ee = new Date - ee, D({ parllayFetchQRApiState: I.FAILED, parllayFetchQRApiDurationMs: ee }), "CONFIG_ERROR" === e.type && X ? (X.postMessage({ qrCodeResult: { success: !1 } }, "*"), D({ errorMessage: e && e.message && e.message.errors[0].message || "", exitScreen: C.SCREEN_WECHAT_QRCODE_LOAD_FAILED }), w.push(T.PARLLAY_JS_SDK_API_FAILURE, { apiName: A.GET_CONFIG_ERROR, errorCode: (e && e.message && e.message.errors[0].code || "-1").toString(), errorMessage: e && e.message && e.message.errors[0].message || "", offlineState: O(), durationMs: ee })) : "CANCEL_REQUEST" === e.type && (ae.errorMessage = e.type) }) } function F() { ae.jarvisApiState = I.CALLED, J = new Date, p.getDelegateToken(S.jarvis.clientId).then(function(e) { var t = new Date - J; D({ jarvisApiState: I.SUCCEEDED, jarvisApiDurationMs: t }), w.push(T.PARLLAY_JS_SDK_API_SUCCESS, { apiName: A.GET_JARVIS_DELEGATE_TOKEN, offlineState: O(), durationMs: t }); var n = _.parllayConfig; n.delegateToken = e.data.delegateToken, y.initialize(n), G() }).catch(function(e) { var t = new Date - J; D({ jarvisApiState: I.FAILED, jarvisApiDurationMs: t, errorMessage: e && e.status || "" }), w.push(T.PARLLAY_JS_SDK_API_FAILURE, { apiName: A.GET_JARVIS_DELEGATE_TOKEN, errorCode: (e && e.status || "").toString(), errorMessage: e && e.statusText || "", offlineState: O(), durationMs: t }), q.error("No jarvis delegate token received"), X && (X.postMessage({ qrCodeResult: { success: !1 } }, "*"), ae.exitScreen = C.SCREEN_WECHAT_QRCODE_LOAD_FAILED) }) } function U(e) { e.data && "qrcode_init" === e.data && (X ? F() : oe.postMessage(ie, "*")) } function V(e) { R(); var t = 452, n = 779, r = t, i = n, s = window.screenY + window.innerHeight / 2 - r / 2, l = window.screenX + window.innerWidth / 2 - i / 2, c = "toolbar=0,location=0,menubar=0,width=" + i + ",height=" + r + ",top=" + s + ",left=" + l; ne = e; var d = { joinWeChat: K("l10n.joinWeChat", { clubName: e.event }), qrCodeScan: K("l10n.qrCodeScan", { clubName: e.event }), successfullySubscribed: K("l10n.successfullySubscribed", { clubName: e.event }), qrCodeCouldNotBeLoaded: K("l10n.qrCodeCouldNotBeLoaded"), qrCodeScanningError: K("l10n.qrCodeScanningError"), fetchingQrCode: K("l10n.fetchingQrCode"), youAreOffline: K("l10n.youAreOffline"), visitSettingsPage: K("l10n.visitSettingsPage"), nFanDescription: K("l10n.nFanDescription"), close: K("l10n.close"), skip: K("l10n.skip") }, f = "external-page-loader-app.html#/qr-code/" + (0, a.default)(ne), m = v.openBorderlessPopup(f, "app_qrcode", c, d, !0, U); return o.on(u.CHILD_WINDOW_CLOSED, $), m } function z(e) { g.go("main.auth.preferences.accounts"), H.showQrCode(e) } function B() { j = p.getLoggedInUser(), j && H.isFeatureSupported().then(function(e) { Q = h.getCachedUserItem(j.userId, t.JARVIS_GFE_STORE, t.JARVIS_QRCODE_STATE), e && Q && Q.wait_().then(function() { Q.weChat.NFAN.qrCodeScanned || L() }) }) } function $() { y.cancelQrCodeRequest(), o.off(u.CHILD_WINDOW_CLOSED, $), ae.parllayFetchQRApiState === I.CALLED && (ee = new Date - ee, D({ parllayFetchQRApiDurationMs: ee, errorMessage: "User cancelled QR Code request" })), ae.parllayScanQRApiState === I.CALLED && (te = new Date - te, D({ parllayScanQRApiDurationMs: te, errorMessage: "User cancelled QR Code request" })), ae.offlineState = O(), ae.parllayFetchQRApiState === I.TO_BE_CALLED && ae.parllayScanQRApiState === I.TO_BE_CALLED && (J = new Date - J, D({ jarvisApiState: I.FAILED, jarvisApiDurationMs: J, errorMessage: "User cancelled QR Code request" })), w.push(T.QR_CODE_CLOSE, ae), X = null, re = null, oe = null } function W() { var e = X || oe; e && (y.cancelQrCodeRequest(), e.postMessage({ isOffline: !0 }, "*"), ae.exitScreen = C.SCREEN_WECHAT_GFE_CLIENT_OFFLINE, q.info("Client is offline, cancelling all pending qrcode requests")) } var H = this, j = null, Y = null, q = m.getInstance("main.common/WeChatService"), K = n("translate"), Q = null, Z = !1, X = null, J = 0, ee = 0, te = 0, ne = null, re = null, oe = null, ie = null, ae = {}, se = ["CN"]; H.isFeatureSupported = function() { return M.getGeolocation().then(function(e) { return l.contains(se, e.countryCode) }).catch(function() { var e = "US"; return q.error("Returning default CountryCode: ", e), f.resolve(!1) }) }, H.showQrCode = function(e) { return Q ? void(b.onlineState && b.onlineState.online === !1 ? E.showOffline() : X = V(e)) : void q.error("Showing QR code when expire state is returning null") }, H.initialize = function() { j = p.getLoggedInUser(), Y = e.getGlobalStore(t.GLOBAL_STORE), B(), o.on(r.WECHAT_NOTIFICATION_CLICKED, z), o.on(u.LOGIN_STATUS_CHANGE, B), o.on(u.OFFLINE, W) } }]); t.weChatService = f }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.windowSpawnService = void 0; var o = n(3), i = r(o), a = n(1); n(19); var s = a.ngMainCommonModule.service("windowSpawnService", ["$log", "$window", "$document", "cefService", "$interval", "eventAggregator", "COMMON_EVENTS", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_AVAILABLE_STATUS", "tracingService", function(e, t, n, r, o, a, s, l, c, u, d) { function f(e) { w && !w.closed ? (e && e.preventDefault(), w.focus(), r.windowFocus(w.name)) : m() } function m() { o.cancel(T), x && (t.removeEventListener("click", f), t.removeEventListener("keydown", f), a.off(s.WINDOW_FOCUS, f), A.remove(), x = !1), t.removeEventListener("message", g, !1), I = null, w && (M.info("Closing child window:", w.name), w.onload = null, w.close(), w = null), a.trigger(s.CHILD_WINDOW_CLOSED), p(!1) } function p(e, t) { i.isNull(C) || (d.closePopUpHttpSpan(C, e, t), C = null) } function g(e) { return e.data.error ? (p(!0, e.data.error), M.error("failed to load url with error ", e.data.error), void l.push(c.CEF_POPUP_STATE, { url: l.getString(e.data.error.failedUrl), isError: u.YES, errorCode: l.getString(e.data.error.errorCode), errorText: l.getString(e.data.error.errorText) })) : (p(!1), C = null, void(i.isNull(I) || I(e))) } function v() { T = o(function() { w && !w.closed || m() }, 100) } function h() { A = angular.element('
'), n.find("body").eq(0).append(A), t.addEventListener("click", f), t.addEventListener("keydown", f), a.on(s.WINDOW_FOCUS, f), x = !0 } function y(e, t, n, r, o, i) { return I = i, E("app_", e, t, n, r, o, g) } function E(e, n, r, o, l, c, u) { r && 0 !== r.indexOf(e) ? r = e + r : r || (r = e + "childWindow"); var f = { url: n, spanId: null }; return d.startHttpSpan(f, !0), C = f.spanId, w = t.open(f.url, r, o), i.isNull(w) ? M.error("unable to open child window with url ", n, "params", o, "name", r) : (w.onload = function() { a.trigger(s.CHILD_WINDOW_LOADED) }, w.sharedData = l, M.debug("Child window opened with url: ", n, "name ", r), c && h(), t.addEventListener("message", u, !1), v()), w } function b(e, t, n, r, o, i) { return I = i, E("borderless_app_", e, t, n, r, o, g) } function S(e, n) { var r = t.open(e, "_blank", n); return M.debug("New browser window should have opened with url: ", e), r } var _ = this, w = null, A = null, T = null, I = null, C = null, x = !1, M = e.getInstance("main.common/windowSpawnService"); _.openChildWindow = y, _.openDefaultBrowser = S, _.openBorderlessPopup = b, _.closeChildWindow = m }]); t.windowSpawnService = s }, , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.galleryService = void 0; var r = n(27); n(63); var o = r.ngGalleryModule.service("galleryService", ["tbdService", function(e) { var t = this; t.getGalleryItems = e.getGalleryItems, t.getGalleryShowcaseItems = e.getGalleryShowcaseItems, t.listVideos = e.listVideos }]); t.galleryService = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvMediaPreviewToolbar = void 0; var o = n(27), i = n(796), a = r(i), s = o.ngGalleryModule.directive("nvMediaPreviewToolbar", [function() { return { restrict: "E", template: a.default } }]); t.nvMediaPreviewToolbar = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGameDetails = void 0; var o = n(14); n(337), n(221), n(222), n(482), n(478), n(468), n(287), n(365), n(132); var i = n(802), a = r(i); n(469); var s = o.ngGamesModule.directive("nvGameDetails", function() { return { restrict: "E", scope: { nvSelectedGameId: "=", nvClassicViewEnabled: "@" }, template: a.default, controller: "GameDetailsController", controllerAs: "gameDetails", link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvGameDetails = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } function o(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.gameListController = void 0; var i = n(3), a = o(i), s = n(14); n(46), n(11), n(133), n(16), n(20), n(187); n(9); n(12), n(290); var l = n(48), c = r(l); n(300); var u = s.ngGamesModule.controller("GameListController", ["$scope", "eventAggregator", "GAME_EVENTS", "gamesService", "$filter", "$log", "userGamesService", "preferencesService", "$window", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "jarvisService", "COMMON_GAME_EVENTS", "GAME_SCAN_STATE", "dbCacheService", "DB_NAMES", "toastService", "$timeout", "localeService", "oobeGamesService", "OOBE_SCAN_STATE", "COMMON_DYNAMIC_REDIRECT", "INSTALLER_EVENTS", "GFECLIENT_USER_CONFIG", "PREFERENCES_EVENTS", "OOBE_STATE", "stateService", "oobeDialogService", function(e, t, n, r, o, i, s, l, u, d, f, m, p, g, v, h, y, E, b, S, _, w, A, T, I, C, x, M) { function D() { y.showProgress({ textContent: o("translate")("l10n.scanning") }), ve() } function O() { De ? Me.scanText = "l10n.scanning" : Me.scanText = "l10n.scanForGames" } function R(e) { We.info("setting scan in progress", e), De = e, O() } function N() { var e = r.getUiScanState(); We.info("games service scan in progress ", e), e === g.UI_SCAN ? (D(), R(!0)) : O() } function L() { y.showProgress({ textContent: o("translate")("l10n.optimizing") }), be() } function P() { Oe ? Me.optimizeText = "l10n.optimizing" : Me.optimizeText = "l10n.optimizeAllGames" } function k(e) { We.info("setting optimize in progress", e), Oe = e, P() } function G() { var e = r.isOptimizeInProgress(); We.info("games service optimize in progress ", e), e ? (L(), k(!0)) : P() } function F() { if (Me.listLimitTo < Me.filteredGameList.length && !Pe) { var e = 100; Pe = E(function() { Me.listLimitTo = Me.filteredGameList.length, Pe = null }, e) } else Me.listLimitTo > Me.filteredGameList.length && (Me.listLimitTo = Me.filteredGameList.length) } function U(e) { Me.selectedGame = a.findWhere(e, { id: Me.selectedGameId }) } function V() { Ae && a.size(Me.filteredGameList) > 0 && (U(Me.filteredGameList), Me.selectedGame || (Me.selectedGameId = Me.filteredGameList[0].id, t.trigger(p.SELECTED_GAME_CHANGED, Me.selectedGameId))) } function z() { a.size(Me.gameList) > 0 && (Me.filteredGameList = Me.gameList, Me.filteredGameList = o("filter")(Me.filteredGameList, Me.filter), we.gamesFilters && we.gamesFilters.optimized ? Me.filteredGameList = o("filter")(Me.filteredGameList, r.filterOptimized(we)) : Me.isAnselFeatureAvailable && we.gamesFilters.anselReady ? Me.filteredGameList = o("filter")(Me.filteredGameList, r.filterAnselReady(we)) : Me.isFreestyleFeatureAvailable && we.gamesFilters.freestyleReady && (Me.filteredGameList = o("filter")(Me.filteredGameList, r.filterFreestyleReady(we))), Me.filteredGameList = o("orderBy")(Me.filteredGameList, Me.sort)), V(), H(), F() } function B() { var e = s.getUserGames(); We.debug("refresh Games", e.length), Me.gameList = a.map(e, function(e) { var t = r.getSystemGame(e.gameId), n = {}; return a.extend(n, e), a.isUndefined(t) ? void We.error("systemGame undefined") : (n.systemGame = t, n) }), Me.gameList = a.compact(Me.gameList), We.info("After filtering gameList for defined systemGames, count is:", Me.gameList.length), z() } function $(e) { if (Me.gameList) { We.debug("refreshGameState", e.shortName); var t = a.filter(Me.gameList, function(t) { return t.systemGame.id === e.id }); t && 1 === t.length ? (t[0].systemGame = e, z()) : We.error("refreshGameState - system game not found") } else We.error("refreshGameState - game list undefined") } function W() { Me.filter = {}, angular.forEach(we.gamesFilters, function(e, t) { "favorite" === t && e === !0 ? Me.filter.favorite = !0 : "hidden" === t && (Me.filter.hidden = e) }), z() } function H() { Me.gameList && (ke = Me.gameList.length, Ge = a.size(a.filter(Me.gameList, function(e) { return e.systemGame && e.systemGame.isACorDCoptimized() })), Fe = a.size(a.filter(Me.gameList, { hidden: !0 })), Ue = a.size(a.filter(Me.gameList, { favorite: !0 })), Ve = a.size(a.filter(Me.gameList, function(e) { return e.systemGame && e.systemGame.isAnselReady })), ze = a.size(a.filter(Me.gameList, function(e) { return e.systemGame && e.systemGame.isFreestyleReady }))) } function j(e) { if (Me.gameList) { We.debug("refreshUserGame", e.id); var t = a.findIndex(Me.gameList, function(t) { return t.id === e.id }); if (t !== -1) { var n = Me.gameList[t].systemGame; Me.gameList[t] = e, Me.gameList[t].systemGame = n, z() } else We.error("refreshUserGame - user game not found"); V() } else We.error("refreshUserGame - game list undefined") } function Y() { return Me.getOptimizedGamesCount() <= 0 } function q() { return !r.hasNoGame(Me.gameList) && Me.matchFilter("optimized") && Y() } function K() { return Me.getFavoriteGamesCount() <= 0 } function Q() { return !r.hasNoGame(Me.gameList) && Me.matchFilter("favorite") && K() } function Z() { return Me.getAnselReadyGamesCount() <= 0 } function X() { return Me.getFreestyleReadyGamesCount() <= 0 } function J() { return !r.hasNoGame(Me.gameList) && Me.matchFilter("anselReady") && Z() } function ee() { return !r.hasNoGame(Me.gameList) && Me.matchFilter("freestyleReady") && X() } function te() { return !r.hasNoGame(Me.gameList) && !Q() && !q() && (!Me.isAnselFeatureAvailable || !J()) && (!Me.isFreestyleFeatureAvailable || !ee()) && r.hasHiddenGame(Me.gameList, Me.filter, we) } function ne() { return Me.getHiddenGamesCount() <= 0 } function re() { return !r.hasNoGame(Me.gameList) && Me.matchFilter("hidden") && ne() } function oe() { Me.isGameOpsSupported = r.getGameOpsSupported(), We.info("opsfeaturestatus on init ", Me.isGameOpsSupported) } function ie(e) { Me.selectedGameId = e, U(Me.gameList) } function ae() { !Me.isAnselFeatureAvailable && Me.matchFilter("anselReady") || !Me.isFreestyleFeatureAvailable && Me.matchFilter("freestyleReady") ? Me.setFilter("all") : W(), B() } function se(e) { We.info("opsfeaturestatus update", e), Me.isGameOpsSupported = e } function le() { if (We.info("initialized received"), S.getScanState() === _.SCANNING) { if (Le === !1) { var e = function e() { We.info("setting initialized to true, on scan complete"), Ne = !0, t.off(n.SCAN_FINISHED, e), t.off(n.SCAN_FAILED, e) }; We.info("oobe scan in progress, initialized to remain false"), t.on(n.SCAN_FINISHED, e), t.on(n.SCAN_FAILED, e), Le = !0 } } else Ne = !0; B() } function ce() { Me.topIndex = Ae ? Te.classicViewTopIndex : Te.topIndex, Ie = e.$watch("games.topIndex", function() { Ae ? Te.classicViewTopIndex = Me.topIndex : Te.topIndex = Me.topIndex, Te.persist_(), t.trigger(p.GAME_LIST_TOP_INDEX_CHANGED, { topIndex: Me.topIndex, gamesCount: Me.filteredGameList.length }) }) } function ue() { l.isAnselFeatureSupportedOnSystem().then(function(e) { Me.isAnselFeatureAvailable = e.isVisible }).finally(function() { we.observe_(ae) }) } function de(e) { l.isFreestyleSupported(e).then(function(e) { Me.isFreestyleFeatureAvailable = e.isSupported }).finally(function() { we.observe_(ae) }) } function fe() { Be && Be.data && Be.data.showBatteryBoostToast && r.getGameOpsSupported() && M.loadOOBEState().then(function(e) { e === C.COMPLETED_ALL ? Me.optimizeGames() : We.info("Do not optimze explicitly while in OOBE flow through BB notification") }) } function me() { We.info("initialize"), we = v.getCachedUserItem(Re.userId, h.JARVIS_GFE_STORE, h.JARVIS_VIEW_STATE), Te = v.getCachedUserItem(Re.userId, h.VIEW_STORE, h.VIEW_STATE), Ae = we.classicViewEnabled, t.on(n.USERGAMES_UPDATED, le), t.on(n.USERGAME_UPDATED, j), t.on(n.GAMESTATE_UPDATED, $), t.on(n.GAMESTATE_INITIALIZED, z), t.on(p.SELECTED_GAME_CHANGED, ie), t.on(n.OPSFEATURE_UPDATED, se), t.on(A.INSTALL_DONE, ue), t.on(I.FEATURES_UPDATED, ue), oe(), N(), De ? k(!1) : G(), ce(), ue(), de(!0), $e = E(function() { Ne = s.getInitializedOnce() }), r.isGameListCreated() ? fe() : t.on(n.GAMELIST_CREATED, fe) } function pe() { t.off(n.USERGAMES_UPDATED, le), t.off(n.USERGAME_UPDATED, j), t.off(n.GAMESTATE_UPDATED, $), t.off(n.GAMESTATE_INITIALIZED, z), t.off(n.GAMELIST_CREATED, fe), t.off(p.SELECTED_GAME_CHANGED, ie), t.off(n.OPSFEATURE_UPDATED, se), t.off(A.INSTALL_DONE, ue), t.off(I.FEATURES_UPDATED, ue), he(), Se(), Pe && (E.cancel(Pe), Pe = null), $e && (E.cancel($e), $e = null), we.unobserve_(ae), Ie() } function ge() { var e = 0; if (u.performance.getEntriesByName) { var t = u.performance.getEntriesByType("resource"); We.info("Time taken to fetch image started. Is classic view:", Ae); for (var n = 0; n < t.length; n++) "img" === t[n].initiatorType && (e += t[n].duration, We.info("Time taken to fetch image (ms):", t[n].name, t[n].duration.toFixed(2))) } return e.toFixed(2) } var ve, he, ye, Ee, be, Se, _e, we, Ae, Te, Ie, Ce, xe, Me = this, De = !1, Oe = !1, Re = m.getLoggedInUser(), Ne = !1, Le = !1, Pe = null, ke = 0, Ge = 0, Fe = 0, Ue = 0, Ve = 0, ze = 0, Be = x.getCurrentStateParams(), $e = null; Me.selectedGame = null, Me.gameList = null, Me.filteredGameList = [], Me.filter = {}, Me.sort = "systemGame.displayName", Me.selectedGameId = e.nvSelectedGameId, Me.devFeatures = v.getCachedGlobalItem(h.DEV_STORE, h.DEV_FEATURES), Me.listLimitTo = 10, Me.topIndex = 0, Me.isAnselFeatureAvailable = !1, Me.isFreestyleFeatureAvailable = !1; var We = i.getInstance("main.games/GameListController"); We.info("GameListController created"), Me.changeView = function(e) { t.trigger(p.GAME_VIEW_CHANGED, e) }, Me.setSelectedGameId = function(e) { Me.selectedGameId !== e && (Me.selectedGameId = e, t.trigger(p.SELECTED_GAME_CHANGED, e)) }, Me.isSelected = function(e) { return Me.selectedGameId === e }, Me.setFilter = function(e) { we.gamesFilters = { all: !1, optimized: !1, favorite: !1, anselReady: !1, freestyleReady: !1, hidden: !1 }, we.gamesFilters[e] = !0, we.persist_(), W() }, Me.setFallbackFilter = function() { var e = te() && !re() ? "hidden" : "all"; Me.setFilter(e) }, Me.matchFilter = function(e) { var t = !1; return t = "optimized" === e ? we.gamesFilters && we.gamesFilters.optimized : we.gamesFilters && we.gamesFilters[e] }, Me.findAWayToPlay = function() { Me.findPlayUrl = w.BASE_URL + b.getCurrentLocaleWithUnderscore() + "&page=" + w.SUPPORTED_GAMES, We.info("SupportedGames redirects to url:: " + Me.findPlayUrl), u.open(Me.findPlayUrl) }, Me.getGamesCount = function() { return ke }, Me.getOptimizedGamesCount = function() { return Ge }, Me.getFavoriteGamesCount = function() { return Ue }, Me.getAnselReadyGamesCount = function() { return Ve }, Me.getFreestyleReadyGamesCount = function() { return ze }, Me.getHiddenGamesCount = function() { return Fe }, Me.scanGames = function() { We.info("scan local games"), D(), xe = d.startLoad(f.HOME_SCANTIME_GAMES), r.scanLocalGames(!1), R(!0) }, Me.scanGamesProgressText = function(e) { var t = "l10n.scanGamesProgress"; return 0 === e ? t = "l10n.noGamesFound" : 1 === e && (t = "l10n.scanGameProgress"), t }, ve = function() { We.debug("registering game scan events"), t.on(n.SCAN_FINISHED, ye), t.on(n.SCAN_FAILED, Ee) }, he = function() { We.debug("unregistering game scan events"), R(!1), t.off(n.SCAN_FINISHED, ye), t.off(n.SCAN_FAILED, Ee) }, ye = function() { d.endLoad(f.HOME_SCANTIME_GAMES, xe); var e = a.size(Me.gameList), t = { textContent: o("translate")(Me.scanGamesProgressText(e), { numGamesScanned: e }) }; r.hasNoGame(Me.gameList) || r.allGamesFullyOptimized(Me.gameList) || r.hasHiddenGame(Me.gameList, Me.filter, we) ? y.show(t) : (We.info("game optimization required"), r.isAutoOptimizeEnabled().then(function(e) { e || angular.extend(t, { button: { text: o("translate")("l10n.optimize"), action: Me.optimizeGamesFromScan } }) }).finally(function() { y.show(t) })), he() }, Ee = function() { he(), y.showError({ textContent: o("translate")("l10n.scanningFailed") }) }, Me.optimizeGamesFromScan = function() { We.info("optimize local games after scan"), Me.optimizeGames() }, Me.optimizeGames = function() { We.info("optimize local games"), L(), Ce = d.startLoad(f.HOME_OPTIMIZETIME_GAMES), r.optimizeLocalGames(), k(!0) }, be = function() { We.debug("registering game optimize events"), t.on(n.OPTIMIZE_GAMES_UPDATE, _e) }, Se = function() { We.debug("unregistering game optimize events"), k(!1), t.off(n.OPTIMIZE_GAMES_UPDATE, _e) }, _e = function(e) { d.endLoad(f.HOME_OPTIMIZETIME_GAMES, Ce), Se(), y.show({ textContent: o("translate")("l10n.optimizeFinished") }) }, Me.fallbackButtonText = function() { return te() && !re() ? "l10n.viewHiddenGames" : "l10n.viewAllGames" }, Me.showNoGameFallbackMessage = function() { return Ne && r.hasNoGame(Me.gameList) }, Me.gameListReady = function() { return !(r.hasNoGame(Me.gameList) || Q() || te() || q() || Me.isAnselFeatureAvailable && J() || Me.isFreestyleFeatureAvailable && ee()) }, Me.showFallbackMessage = function() { return q() || Q() || te() || Me.isAnselFeatureAvailable && J() || Me.isFreestyleFeatureAvailable && ee() }, Me.fallbackMessage = function() { return q() ? "l10n.gamesAreNotOptimized" : Q() ? "l10n.noFavoriteGames" : J() ? "l10n.noAnselReadyGames" : ee() ? "l10n.noFreestyleReadyGames" : re() ? "l10n.noHiddenGames" : "l10n.gamesAreHidden" }, Me.fallbackImage = function() { return q() || J() || ee() ? "remove_circle" : Q() ? "star_border" : re() ? "visibility_off" : void 0 }, Me.buttonDisabled = function(e) { switch (e) { case "all": return r.hasNoGame(Me.gameList) || Me.getGamesCount() <= 0; case "favorite": return r.hasNoGame(Me.gameList) || Q() || K() || Me.getGamesCount() <= 0; case "optimized": return r.hasNoGame(Me.gameList) || q() || Y() || Me.getGamesCount() <= 0; case "hidden": return r.hasNoGame(Me.gameList) || re() || ne(); case "optimizeAll": return r.hasNoGame(Me.gameList) || De || Oe || r.allGamesFullyOptimized(Me.gameList) || r.hasHiddenGame(Me.gameList, Me.filter, we); case "anselReady": return r.hasNoGame(Me.gameList) || J() || Z() || Me.getGamesCount() <= 0; case "freestyleReady": return r.hasNoGame(Me.gameList) || ee() || X() || Me.getGamesCount() <= 0; case "scanGames": return De || Oe; default: return !1 } }, Me.isGameSelected = function(e) { var t = !1; return e && e.id ? t = Me.selectedGameId === e.id : We.info("Game is undefined."), t }, Me.getGameIconImage = function(e) { return e.systemGame && e.systemGame.iconImage24 ? e.systemGame.iconImage24 : c.default }, e.$on("$destroy", pe), me(), Me.onLoad = function() { T.imageLoadPerfEnabled && We.info("Time taken to fetch all images on home page (ms):", ge()) } }]); t.gameListController = u }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGameStore = void 0; var o = n(28); n(490); var i = n(814), a = r(i); n(488); var s = o.ngGfnModule.directive("nvGameStore", function() { return { restrict: "E", scope: { nvGameType: "@" }, template: a.default, controller: "GameStoreController", controllerAs: "games" } }); t.nvGameStore = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeDialogService = void 0; var o = n(9); n(524), n(521), n(187), n(302), n(26), n(12), n(11), n(179), n(22); var i = n(3), a = r(i), s = o.ngOobeModule.factory("oobeDialogService", ["$log", "$state", "gfeService", "jarvisService", "eventAggregator", "dbService", "DB_NAMES", "oobeTelemetryService", "$mdPanel", "hardwareService", "oobeGamesService", "COMMON_EVENTS", "COMMON_DEFAULT_STATES", "OOBE_STATE", "gfeTargetService", "ACTIVE_EXPERIMENTS", "OOBE_LOGIN", "$q", "gamesService", "TELEMETRY_API_SUB_USECASES", function(e, t, n, r, o, i, s, l, c, u, d, f, m, p, g, v, h, y, E, b) { function S(e) { return e === p.COMPLETED_ALL && (D.info("notify ootb completion"), E.ootbFinished()), M.setItem(s.OOBE_STATE, e) } function _(e) { D.info("sysinfo updated", e.DriverVersion), a.propertyOf(e)("DriverVersion") && (o.off(f.SYSTEMINFO_UPDATED, _), x !== p.COMPLETED_ALL && t.go(m.HOME_STATE, {}, { location: "replace" }), C.finishOobe(r.getLoggedInUser())) } function w(e) { var t; t = e.user ? "LAUNCH_STATE_VALID_SESSION" : e.initialState === p.COMPLETED_ALL ? null : "LAUNCH_STATE_LOGIN", l.startFlow(t); var n = ''; I = c.create({ template: n, controllerAs: "panelCtrl", controller: [function() {}], position: c.newPanelPosition().absolute().center(), trapFocus: !0, zIndex: 79, locals: { nvOobeParams: e }, bindToController: !0, hasBackdrop: !0, panelClass: "oobe-panel" }), I.open() } function A() { var e = ""; I = c.create({ template: e, controllerAs: "panelCtrl", controller: [function() {}], position: c.newPanelPosition().absolute().center(), trapFocus: !0, zIndex: 79, bindToController: !0, hasBackdrop: !0, panelClass: "oobe-panel" }), I.open() } function T(e) { if (e.domains.list) { D.debug("email not verified - verify if email belongs to locked domain"); var t = e.user.core.primaryEmail, n = t.substring(t.indexOf("@") + 1); if (e.domains.list.indexOf(n) > -1) return y.handleLoggedIn(e), !0 } return !1 } var I, C = {}, x = p.COMPLETED_NONE, M = i.getGlobalStore(s.GLOBAL_STORE), D = e.getInstance("main.oobe/oobeDialogService"); return C.loadOOBEState = function() { return M.getItem(s.OOBE_STATE) }, C.launch = function(e) { C.loadOOBEState().then(function(t) { x = t, D.info("Launch OOBE current state:", t), w({ initialState: t, sessionExpired: e }) }) }, C.gfeBlocked = function() { A() }, C.getState = function() { return x }, C.setState = function(e) { x = e, S(x) }, C.notifyNodeOOBEFinished = function() { D.info("function notifyNodeOOBEFinished called"), E.ootbFinished() }, C.finishOobe = function(e) { var t = !1; u.getLaunchTimeSystemInfo().then(function(e) { t = !a.propertyOf(e)("DriverVersion") }).catch(function(e) { D.error("fail to get driver info") }).finally(function() { t ? o.on(f.SYSTEMINFO_UPDATED, _) : C.loadOOBEState().then(function(t) { x = t || p.COMPLETED_NONE, D.info("Finish OOBE current state:", x), x !== p.COMPLETED_ALL ? (D.info("finish oobe scan"), w({ user: e, initialState: t })) : (D.info("finish oobe initialize games"), d.initializeGames(e), C.notifyNodeOOBEFinished()) }) }) }, C.close = function(e) { l.endFlow(e), I && I.close() }, C.waitForDriverInstall = function() { o.on(f.SYSTEMINFO_UPDATED, _), o.trigger(f.LOGIN_STATUS_CHANGE, !0), t.go("main.auth.updates", { updateState: "checkForUpdate" }, { location: "replace" }), C.close() }, C.reset = function() { D.info("Reset to Out of Box Experience state"), C.close(), S(p.COMPLETED_NONE), n.logout() }, C.skipEmailVerification = function(e, t, n) { var r = y.defer(); if (T(e)) r.resolve(!0); else if (t !== h.SOCIAL || n !== h.QQ && n !== h.WECHAT) r.resolve(!1); else { var o = !1; g.setMboxThirdPartyId(e.user && e.user.userId), g.getFeature({ cvName: v.EMAIL_VERIFICATION_QQ_WECHAT, telemetrySubUseCase: b.EMAIL_VERIFICATION_QQ_WECHAT }).then(function(e) { D.debug("Variant status: ", e), o = !(a.isEmpty(e) || !e || !e.value) && e.value.EmailVarificationQQWechat }).catch(function(e) { D.error("Error getting variant: ", e) }).finally(function() { D.debug("onEmailVerificationEvaluation"), o ? D.debug("Email verification skipped") : D.debug("Email verification is required"), r.resolve(o) }) } return r.promise }, C }]); t.oobeDialogService = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeFeatureService = void 0; var r = n(9); n(187); var o = r.ngOobeModule.service("oobeFeatureService", ["$log", "oobeTelemetryService", "oobeGamesService", "$q", "preferencesService", "eventAggregator", "OOBE_EVENTS", "oobeDialogService", "$filter", "toastService", "COMMON_HTTP_ERROR_CODES", "SHARE_CONSTANTS", function(e, t, n, r, o, i, a, s, l, c, u, d) { function f() { o.getShareRunningStatus().then(function(e) { if (e) { var t = l("translate")("l10n.sharingEnabled"); m(t, "icon-share", !0, "color-green", !1), o.showShareSlideOutNotification(d.SLIDE_OUT_NOTIFICATION).then(function(e) { p.info("showShareSlideOutNotification status: ", e) }, function(e) { p.error("showShareSlideOutNotification failed.") }) } }).catch(function(e) { if (p.error("getShareRunningStatus failed."), e.status === u.NOT_FOUND) { var t = l("translate")("l10n.shareNotReady"); m(t, "icon-share", !0, "feature-not-supported-icon-color", !0) } }) } function m(e, t, n, r, o) { c.show({ textContent: e, icon: t, isCustomIcon: n, customColor: r, alertIcon: o }) } var p = e.getInstance("main.oobe/oobeFeatureService"), g = this, v = null; g.activateDefaultFeatureSettings = function(e) { g.triggerGameScan(e), g.getAvailableFeatures().then(function(e) { e.indexOf("share") > -1 && g.enableShare() }) }, g.triggerGameScan = function(e) { t.recordAction("OOBE_SCAN"), n.startScan(e) }, g.getAvailableFeatures = function() { return v ? r.resolve(v) : o.getApplicationFeatureSet().then(function(e) { return v = e, r.resolve(v) }) }, g.enableShare = function() { o.toggleShareState(!0).then(function(e) { p.info("toggleShareState status: ", e), t.changeSetting("APPLICATION_SETTING_ENABLE_SHARE", !0) }).catch(function(e) { p.error("toggleShareState failed with error:", e), t.changeSettingFail("APPLICATION_SETTING_ENABLE_SHARE_FAILED", !0, e.data && e.data.code || e.status) }) }, g.closeOobeFeaturesDialog = function() { i.trigger(a.OOBE_DONE), s.close("SUCCESS"), t.endActionAsync("OOBE_SCAN_COMPLETE_DONE", "SUCCESS"), f() } }]); t.oobeFeatureService = o }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeTelemetryService = void 0; var o = n(9), i = n(3), a = r(i), s = o.ngOobeModule.factory("oobeTelemetryService", ["telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_SCREENS", "TELEMETRY_STATUS", "TELEMETRY_OOBE_LAUNCH_STATE", "TELEMETRY_GFE_SESSION_STATE", function(e, t, n, r, o, i) { function s(e) { return (a.isUndefined(e) || a.isNull(e)) && (e = ""), e = e.toString() } function l(e) { return e = s(e), a.has(r, e) && (e = r[e]), e } var c, u, d = {}, f = null, m = {}; return d.updateScreen = function(t) { e.setScreen(n[t]) }, d.recordAction = function(n) { var r = t[n]; e.push(t[n], { currentScreen: e.getScreen(), action: r.enumId }) }, d.startActionAsync = function(n) { var r = t[n]; m[n] = { currentScreen: e.getScreen(), startTime: e.startLoad(r) } }, d.endActionAsync = function(n, r, o) { var i, u = a.propertyOf(m)(n), d = t[n]; u && ("APP_EXIT" === r && (i = { appExit: !0 }), e.endLoad(d, m[n].startTime, { action: d.enumId, gfeSessionState: c, currentScreen: u.currentScreen, status: l(r), errorDetails: s(o) }, i), delete m[n]) }, d.startFlow = function(n) { n ? (c = i.OOBE, f = o[n], u = e.startLoad(t.OOBE_START_EXIT_SEQUENCE)) : (f = null, c = i.NON_OOBE) }, d.updateFlow = function(e) { f && (f = o[e]) }, d.endFlow = function(n) { var r; n && ("APP_EXIT" === n && (r = { appExit: !0 }), f && e.endLoad(t.OOBE_START_EXIT_SEQUENCE, u, { oobeLaunchState: f, oobeExitScreen: e.getScreen(), status: l(n) }, r), a.each(m, function(e, t) { d.endActionAsync(t, n) })) }, d.changeSetting = function(n, r) { e.changeSetting(t[n], r) }, d.changeSettingFail = function(n, r, o) { e.changeSettingFail(t[n], r, o) }, d }]); t.oobeTelemetryService = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvEditAvatar = void 0; var o = n(4), i = n(836), a = r(i); n(530), n(360); var s = o.ngPreferencesModule.directive("nvEditAvatar", [function() { return { restrict: "A", scope: {}, bindToController: { nvDialogModel: "=" }, template: a.default, controller: "EditAvatarController", controllerAs: "editAvatarCtrl" } }]); t.nvEditAvatar = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesGamesQuietMode = void 0; var o = n(4); n(17); var i = n(858), a = r(i); n(567); var s = o.ngPreferencesModule.component("nvPreferencesGamesQuietMode", { template: a.default, controller: "PreferencesGamesQuietModeController", controllerAs: "preferencesGamesQuietMode" }); t.nvPreferencesGamesQuietMode = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesGeneralQuiteMode2 = void 0; var o = n(4); n(17); var i = n(865), a = r(i); n(580); var s = o.ngPreferencesModule.component("nvPreferencesGeneralQuiteMode2", { template: a.default, controller: "PreferencesGeneralQuiteMode2Controller", controllerAs: "preferencesGeneralQuiteMode2" }); t.nvPreferencesGeneralQuiteMode2 = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvRewardsCenter = void 0; var o = n(53), i = n(875), a = r(i); n(600), n(41), n(599); var s = o.ngRewardsModule.directive("nvRewardsCenter", ["eventAggregator", "REWARDS_EVENTS", "$log", "$timeout", function(e, t, n, r) { return { restrict: "E", scope: {}, template: a.default, controller: "RewardsCenterController", controllerAs: "rewardsCenter", link: function(o, i, a) { function s() { var e = i.find("md-content"); _.size(e) > 0 ? r(function() { e[0].scrollTop = 0 }) : u.error("Could not find a scroll element to reset scroll postion") } function l() { e.on(t.RESET_SCROLL_POSITION, s) } function c() { e.off(t.RESET_SCROLL_POSITION, s), i.empty(), i.remove(), i = null } var u = n.getInstance("main.rewards/RewardsCenterDirective"); l(), o.$on("$destroy", c), i.on("$destroy", function() { o.$destroy() }) } } }]); t.nvRewardsCenter = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdateDownloadProgress = void 0; var o = n(10), i = n(883), a = r(i), s = o.ngUpdatesModule.directive("nvUpdateDownloadProgress", function() { return { restrict: "E", scope: { nvMessage: "@", nvValue: "@" }, template: a.default, link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvUpdateDownloadProgress = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvDriverItem = void 0; var o = n(10), i = n(893), a = r(i), s = o.ngUpdatesModule.directive("nvDriverItem", function() { return { restrict: "E", scope: { nvDriver: "=", nvMdIcon: "@" }, template: a.default, link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvDriverItem = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.editProfileCoverController = void 0; var o = n(8); n(274), n(118); var i = n(236), a = r(i), s = o.ngUserProfileModule.controller("EditProfileCoverController", ["$scope", "$log", "$mdDialog", "galleryService", "nvSpCapsEndpoints", "preferencesService", "eventAggregator", "COMMON_EVENTS", "GALLERY_TYPES", "CROPPIE_CONSTANTS", "$filter", "GALLERY_SUBTYPES", function(e, t, n, r, o, i, s, l, c, u, d, f) { function m(e) { return e.type === c.IMAGE && e.subtype !== f.EXR } function p() { return r.thumbSizes = T, o.getRecordingPaths().then(function(e) { return r.setRecordingPaths(e.data) }).then(function() { return r.getRecentFiles() }).then(function() { return r.checkCachedData() }).then(function() { E.recentImages = _.filter(r.populatedRecentFilesFolder, function(e) { return m(e.file) }) }) } function g() { p().then(angular.noop).catch(function(e) { w.error("could not fetch uploaded files", e) }), r.active(!0) } function v() { E.loadingDone = !1, i.getShareRunningStatus().then(function(e) { E.isShareEnabled = e, e && g(), w.info("getShareRunningStatus returned: ", E.enabledShare) }).catch(function(e) { w.error("getShareRunningStatus failed.") }).finally(function() { E.loadingDone = !0 }) } function h() { E.showRecentlyCaptured && (v(), s.on(l.SHARE_STATUS_CHANGED, v)), E.boundary && (E.croppieBoundary = E.boundary), E.viewport && (E.croppieViewport = E.viewport), s.on(l.WINDOW_FOCUS, p) } function y() { E.showRecentlyCaptured && (s.off(l.SHARE_STATUS_CHANGED, v), r.active(!1)), s.off(l.WINDOW_FOCUS, p) } var E = this, b = !1, S = !1, w = t.getInstance("main.userProfile/editProfileCoverController"), A = !1, T = { width: 208, height: 117 }, I = { w: 652, h: 204 }, C = { w: 652, h: 198 }; ({ "Image Files": u.SUPPORTED_FILE_TYPES }); E.isShareEnabled = !1, E.selectedCoverVideoUrl = null, E.recentImages = [], E.hitApply = !1, E.croppieBoundary = I, E.croppieViewport = C, E.imageError = !1, E.defaultCoverImage = a.default, E.showCroppie = function() { return S && !b }, E.showPreview = function() { return !S && !b }, E.showError = function() { return b }, E.submitDisabled = function() { return !A && (!S || b) }, E.recentlyCapturedVisible = function() { return E.recentImages.length && E.showRecentlyCaptured }, E.commitUpdate = function() { A ? (E.hitApply = !0, E.updateImageCallback(E.defaultCoverImage), n.cancel()) : (E.hitApply = !0, E.output.then(function(e) { E.updateImageCallback(e), n.cancel() })) }, E.onUpdate = function(e) { e.error ? (b = !0, E.errorMsg = d("translate")("l10n.fileSelectionError", E.outputFormat.minSize), w.error("onUpdate got error", e.error)) : e.success && (b = !1) }, E.cancelUpdate = function() { n.cancel() }, E.selectScreenshot = function(e) { E.sourceImage = e.file.name, S = !0, A = !1 }, E.selectDefaultCover = function() { E.sourceImage = null, E.image = E.defaultCoverImage, A = !0, S = !1, b = !1 }, E.onFileSelect = function(e) { E.sourceImage = e, S = !0, A = !1 }, e.$on("$destroy", y), h() }]); t.editProfileCoverController = s }, function(e, t, n) { e.exports = n.p + "bckgnd.jpg" }, function(e, t) { e.exports = "

close
" }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '

check_circle
check_circle
error

{{editProfileCover.errorMsg}}

' }, , , function(e, t, n) { e.exports = { default: n(923), __esModule: !0 } }, , , , function(e, t, n) { function r(e) { return n(o(e)) } function o(e) { return i[e] || function() { throw new Error("Cannot find module '" + e + "'.") }() } var i = { "./gold.svg": 692, "./gray.svg": 693 }; r.keys = function() { return Object.keys(i) }, r.resolve = o, e.exports = r, r.id = 321 }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.appService = void 0; var o = n(317), i = r(o), a = n(185); n(19), n(141), n(51), n(16), n(610), n(12), n(26), n(120), n(37), n(212), n(356), n(186), n(292), n(289), n(121), n(553); var s = n(820), l = r(s); n(376), n(483); var c = n(915), u = r(c); n(112); var d = a.ngMainModule.service("appService", ["$log", "$window", "$translate", "$translatePartialLoader", "$state", "$rootScope", "$interpolate", "eventAggregator", "gfeService", "cefService", "gfwslEndpoints", "gfservicesEndpoints", "oobeDialogService", "nodeService", "gfeUpdatesService", "updatesService", "socketService", "annotoriousService", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "jarvisService", "dbService", "dbCacheService", "DB_NAMES", "GFECLIENT_CONFIG", "GFECLIENT_BUILD_INFO", "COMMON_EVENTS", "COMMON_EVENTS_VALUE", "COMMON_DEFAULT_STATES", "ANNOTATION_PROPERTIES", "GAME_EVENTS", "rewardsService", "hardwareService", "COMMON_ERRORS", "preferencesService", "gfeTargetService", "notificationsService", "weChatService", "gfeSearchService", "cevoToggleService", "gfeGeolocationService", "quietModeService", "BACKEND_STATE_SOCKET_EVENTS", "BACKEND_STATE_EVENTS", "preferencesFeatureService", "productTourService", "TELEMETRY_STATUS", "piiSanityService", "gfnCloudGamesService", "performanceModeService", function(e, t, n, r, o, a, s, c, d, f, m, p, g, v, h, y, E, b, S, w, A, T, I, C, x, M, D, O, R, N, L, P, k, G, F, U, V, z, B, $, W, H, j, Y, q, K, Q, Z, X, J) { function ee(e, t, n, r, o) { return pe.debug("$stateChangeStart from state:", r.name, " to state:", t.name), "" === r.name || r.name.indexOf("main.updateHighlights") >= 0 || !(t.name.indexOf("main.auth") >= 0) || A.hasSession() ? r.name === t.name && _.isEqual(o, n) ? void e.preventDefault() : (r.nvEventNames && (S.endView(r.nvEventNames.viewTime, ve[r.nvEventNames.viewTime.enumId]), delete ve[r.nvEventNames.viewTime.enumId]), void(t.nvEventNames && (ge[t.nvEventNames.loadTime.enumId] = S.startLoad(t.nvEventNames.loadTime)))) : (pe.error("$stateChangeStart: No valid session"), void e.preventDefault()) } function te(e, t, n, r, o) { if (pe.debug("$stateChangeSuccess from state:", r.name, " to state:", t.name), "main.auth" === t.name.slice(0, 9) && "main.auth.preferences" !== t.name && t.name.indexOf(he) === -1) { he = t.name; var i = A.getLoggedInUser(), a = I.getCachedUserItem(i.userId, C.VIEW_STORE, C.VIEW_STATE); a.lastRouterToState = he, a.lastRouterToStateParams = n, a.lastRouterFromState = r.name, a.lastRouterFromStateParams = o, he.indexOf("main.auth.preferences") > -1 && (a.lastPreferencesRouterState = he), a.persist_() } t.nvEventNames && (S.endLoad(t.nvEventNames.loadTime, ge[t.nvEventNames.loadTime.enumId]), ve[t.nvEventNames.viewTime.enumId] = S.startView(t.nvEventNames.viewTime), delete ge[t.nvEventNames.loadTime.enumId]) } function ne(e, t, n, r, o, i) { pe.info("$stateChangeError from state:", r.name, " to state:", t.name), e.preventDefault(), i !== G.NODE_START_FAILED && d.logout("sessionExpired" === i) } function re(e) { ie(e) } function oe(e) { var t = e; return "en-us" !== e.toLowerCase() && (t += ", en-us"), t } function ie(e) { var t = { userAgent: x.userAgent + "/" + d.version }; e ? n(["l10n.pageCouldNotBeLoaded", "l10n.retry"]).then(function(n) { t.onLoadError = s(l.default)({ errorMessage: n["l10n.pageCouldNotBeLoaded"], retry: n["l10n.retry"] }), t.acceptLanguage = oe(e.code), f.loadStringTable(t) }).catch(function(e) { pe.error("Failed to load CEF string table") }) : f.loadStringTable(t) } function ae() { t.addEventListener("focus", function() { pe.info("Trigger window focus"), c.trigger(D.WINDOW_FOCUS) }), t.addEventListener("resize", t._.debounce(function() { pe.debug("Trigger window resize"), c.trigger(D.WINDOW_RESIZE) }, O.RESIZE_DEBOUNCE_TIME)), t.addEventListener("online", function() { pe.info("Transition to online mode"), d.setOnline(!0), c.trigger(D.ONLINE) }), t.addEventListener("offline", function() { pe.info("Transition to offline mode"), d.setOnline(!1), c.trigger(D.OFFLINE) }), t.addEventListener("unload", function() { pe.debug("Trigger unload"), g.close("APP_EXIT"), K.sendProductTourExitTelemetry(Q.APP_EXIT), E.disconnect() }), c.on(D.LOCALE_CHANGED, re), a.$on("$stateChangeStart", ee), a.$on("$stateChangeSuccess", te), a.$on("$stateChangeError", ne) } function se() { var e, t = (0, i.default)(a); e = { go: o.go.bind(o) }, o.includes && (e.includes = o.includes.bind(o)), t.$state = e } function le() { b.setProperties(N), b.addHandler("onPopupShown", function(e) { e.nvSettingName && c.trigger(L.VOPS_POPUP_SHOWN, { name: e.nvSettingName }) }), b.addHandler("onMouseOutOfAnnotation", function() { c.trigger(L.VOPS_POPUP_SHOWN, { name: null }) }) } function ce() { S.addPreShutdownWork(function() { S.endView(w.GFE_EXIT_UI, de) }) } function ue() { E.register(j.READY, Y.READY) } var de, fe = this, me = !1, pe = e.getInstance("main/appService"), ge = {}, ve = {}, he = R.HOME_STATE; fe.main = function() { pe.info("Init"), pe.info("GFE Build Info:", M), t.name = x.windowName, a.telemetryEventNames = w; var e = d.version; "local" === x.buildMode && (e = "dev-" + e), S.setEventsCommonData({ clientVersion: e }), d.setOnline(t.navigator.onLine), ie(), ae(), T.getGlobalStore(C.GLOBAL_STORE), r.addPart("l10n/main"), r.addPart("l10n/games"), r.addPart("l10n/gallery"), r.addPart("l10n/friends"), r.addPart("l10n/share"), r.addPart("l10n/updates"), r.addPart("l10n/oobe"), r.addPart("l10n/gfn"), r.addPart("l10n/settings"), r.addPart("l10n/notifications"), r.addPart("l10n/rewards"), r.addPart("l10n/preferences"), r.addPart("l10n/user-profile"), se(), le(), ce(), me = !0 }, fe.initializeUI = function(e, t, n) { pe.info("Init UI"), Z.initialize(), S.handleLaunchTimeTelemetry(), S.setGfeInitializeStartTime(), k.initialize(), de = S.startView(w.GFE_EXIT_UI), S.push(w.GFE_LAUNCH_UI), f.setWindowStyle(n), v.initialize(), E.connect(), U.initialize(), W.getGeolocation(), V.initialize(), P.initialize(), m.initialize(d.version, e, t), p.initialize(e), h.initialize(), y.initialize(), F.initialize(t), F.getNodeAddons(), q.initialize(), z.initialize(), B.initialize(e.code, u.default), $.initialize(), H.initialize(), K.initialize(), A.initialize(), X.initialize(), J.initialize(), ue() } }]); t.appService = d }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } n(324), n(19), n(11), n(12), n(358), n(300), n(611), n(64), n(51), n(46), n(16), n(133), n(37), n(22), n(167), n(343), n(216), n(527), n(207), n(162), n(387), n(375); var o = n(185); n(404), n(398), n(438), n(297), n(485), n(492), n(450), n(617), n(550), n(573), n(548), n(559), n(588), n(584), n(341), n(306), n(342), n(663); var i = n(965), a = r(i); o.ngMainModule.config(["$stateProvider", "$urlRouterProvider", "TELEMETRY_CRIMSON_EVENT_NAMES", "$httpProvider", "$provide", function(e, t, n, r, o) { o.decorator("$state", ["$delegate", "$rootScope", function(e, t) { return t.$on("$stateChangeStart", function(t, n, r) { e.next = n, e.toParams = r }), e }]), t.otherwise("/auth/home/games-and-friends"), r.interceptors.unshift("httpLoggingService"), r.interceptors.unshift("opentracingHttpInterceptor"), e.state("main", { url: "", template: '', abstract: !0, resolve: { startStateLocation: ["$log", "$state", "gfeService", function(e, t, n) { var r = e.getInstance("main/resolve/startStateLocation"); r.info("startStateLocation resolved:", t.next.name); var o = { name: t.next.name, params: t.toParams, url: t.href(t.next.name, t.toParams) }; return n.setStartState(o), o }], localNodeInfo: ["$log", "$q", "cefService", "localSdk", "nvAccountEndpoints", "ugcLib", function(e, t, n, r, o, i) { var a = e.getInstance("/main/uiRouter/main/resolve/localNodeInfo"); return a.info("Requested"), n.localNodeInfo().then(function(e) { var t = JSON.parse(e); return a.info("local nodeinfo Resolved", t.active, t.errorCode), r.updateNodeInfo(t), o.updateNodeInfo(t), i.updateNodeInfo(t), t }).catch(function(e) { return a.info("local nodeinfo Rejected error:", e), e }) }], isWindowBorderless: ["$log", "$q", "cefService", function(e, t, n) { var r = e.getInstance("/main/uiRouter/main/resolve/isWindowBorderless"); return r.info("Requested"), n.isBorderless().then(function(e) { return r.info("Resolved"), e }).catch(function() { return r.info("Rejected"), !1 }) }], hardwareInfo: ["$log", "$q", "localNodeInfo", "hardwareService", "telemetryService", "localeService", "dbService", "DB_NAMES", "TELEMETRY_ERROR_MESSAGE", "tracingService", "GFECLIENT_CONFIG", "GFECLIENT_BUILD_INFO", function(e, t, r, o, i, s, l, c, u, d, f, m) { var p = e.getInstance("/main/uiRouter/main/resolve/hardwareInfo"), g = u.SERVICE_RESOLVED_WITHOUT_DEVICE_ID; p.info("Requested"); var v = l.getGlobalStore(c.GLOBAL_STORE); return o.getLaunchTimeSystemInfo().then(function(e) { if (p.info("Resolved"), f.tracerFeature) { p.info("Initializing tracing service"); var t = new a.default.Tracer(f.tracer), r = {}; r.deviceId = e.TelemetryDeviceId, r.osName = e.OSName, r.osVersion = e.OSVersion, r.clientVersion = m.gfePackageVersion, d.init(t, r) } e.TelemetryDeviceId || i.push(n.DEVICE_ID_IS_UNDEFINED, { errorMessage: g }), i.setEventsCommonData({ deviceId: e.TelemetryDeviceId }), s.setSystemLocale(e.UserDefaultUILanguage); var o = { deviceId: e.TelemetryDeviceId }; return v.setItem(c.SYSTEM_INFO, o), e }).catch(function() { return p.info("Rejected"), g = u.SERVICE_REJECTED_GLOBAL_STORE_WITHOUT_DEVICE_ID, v.getItem(c.SYSTEM_INFO).then(function(e) { e && e.deviceId ? i.setEventsCommonData({ deviceId: e.deviceId }) : i.push(n.DEVICE_ID_IS_UNDEFINED, { errorMessage: g }) }).catch(function(e) { g = u.SERVICE_REJECTED_GLOBAL_STORE_REJECTED, i.push(n.DEVICE_ID_IS_UNDEFINED, { errorMessage: g }), p.info("Error in processing error getItem", e) }), {} }) }], language: ["$log", "$q", "localeService", "localNodeInfo", "hardwareInfo", "nodeService", "COMMON_ERRORS", "FATAL_ERRORS", function(e, t, n, r, o, i, a, s) { var l = e.getInstance("/main/uiRouter/main/resolve/language"); l.info("Requested"); var c = t.defer(); return n.setApplicationLocale().then(function(e) { return l.info("language Resolved"), r.active === !1 ? (l.error("node start fails: status", r.active), i.showErrorMessage("node start fails with error: " + r.errorCode, s.nodeStartFail), c.reject(a.NODE_START_FAILED)) : c.resolve(e) }).catch(function() { return l.info("language Rejected"), c.reject() }), c.promise }], silentInstall: ["$log", "cefService", "$q", "preferencesService", "language", "nvAccountService", "GFECLIENT_CONFIG", "telemetryService", "USER_CONSENT_LEVEL", "nodeService", "localNodeInfo", "FATAL_ERRORS", function(e, t, n, r, o, i, a, s, l, c, u, d) { var f = n.defer(), m = e.getInstance("/main/uiRouter/main/resolve/silentInstall"); return m.info("requesting functional data consent"), i.getClientTelemetryConsent(a.jarvis.clientId).then(function(e) { m.info("Received functional data consent: ", e); var n = e.consentSettings; return n.trackFunctionalData.level === l.FULL ? (m.info("consent already available"), s.setFunctionalConsentReceived(), f.resolve()) : void r.showFunctionalDataConsent().then(function() { m.info("functional data consent accepted, notifying all"), s.setFunctionalConsentReceived(), n.trackFunctionalData.level = l.FULL, m.info("setting functional data consent to full"), i.setDefaultTelemetryConsent(n, "gfe").then(function() { return m.info("functional data consent set successfully to full for GFE"), n.trackTechnicalData.level = l.FULL, i.setDefaultTelemetryConsent(n, "dd") }).then(function() { return m.info("functional and technical data consent set successfully to full for DD"), f.resolve() }).catch(function(e) { return m.error("failed to update consent in nvaccounts", e), c.showErrorMessage("failed to update consent in nvaccounts", d.consentSetFail) }) }).catch(function() { return m.info("user did not accept functional data consent, closing"), t.windowClose() }) }).catch(function(e) { return m.error("failed to recieve functional data consent", e), c.showErrorMessage("failed to receive functional data consent", d.consentGetFail) }), f.promise }], jarvisServer: ["$log", "jarvisService", function(e, t) { var n = e.getInstance("/main/uiRouter/main/resolve/jarvisServer"); return n.info("selecting fastest server"), t.selectFastestServer() }] }, onEnter: ["$log", "appService", "language", "hardwareInfo", "isWindowBorderless", "productTourService", "jarvisServer", function(e, t, n, r, o, i, a) { e.getInstance("/main/uiRouter/main/onEnter"); t.initializeUI(n, r, o), i.resumeOobeTour() }] }).state("main.loggedOut", { url: "/logged-out?sessionExpired", abstract: !1, onEnter: ["oobeDialogService", "$stateParams", "jarvisService", "telemetryService", "GFE_LAUNCH_STATE", "$log", "dbService", "DB_NAMES", "GFWSL_STATUS", "silentInstall", function(e, t, n, r, o, i, a, s, l, c) { var u = "true" === t.sessionExpired, d = (i.getInstance("main/urlRouter/main.loggedOut/onEnter"), a.getGlobalStore(s.GLOBAL_STORE)), f = l.SUCCESS; n.logout(), d.getItem(s.GFWSL_STATUS).then(function(e) { f = e }).finally(function() { f == l.BLOCKED ? e.gfeBlocked() : e.launch(u), u ? r.handleGfeInitializeTimeTelemetry(o.INVALID_SESSION) : r.handleGfeInitializeTimeTelemetry(o.NO_SESSION_TOKEN) }) }], parent: "main" }).state("main.updateHighlights", { url: "/update-highlights", abstract: !1, onEnter: ["$log", "preferencesService", "$state", "gfeService", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "$timeout", function(e, t, n, r, o, i, a) { var s = e.getInstance("main/urlRouter/main.updateHighlights/onEnter"); s.debug("main.updateHighlights onEnter called"), r.onlineState.online ? (s.debug("Release highlights shown"), o.push(i.GFE_UPDATE_LAUNCH_SHOW_HIGHLIGHTS), t.onShowReleaseHighlight(!0)) : (o.push(i.GFE_UPDATE_LAUNCH_USER_OFFLINE), s.debug("User offline. Release highlights not shown.")), a(function() { n.go("main.auth.home.gamesAndFriends") }) }], parent: "main" }).state("main.auth", { url: "/auth", abstract: !0, template: "
", onEnter: ["telemetryService", "GFE_LAUNCH_STATE", "$state", "$log", "hardwareService", "currentUser", "syncViewState", "oobeDialogService", "gfeService", "localNodeInfo", "dbService", "DB_NAMES", "previousState", "GFWSL_STATUS", "$timeout", "eventAggregator", "COMMON_EVENTS", "gfservicesEndpoints", "gfwslEndpoints", "updatesService", "preferencesService", function(e, t, n, r, o, i, a, s, l, c, u, d, f, m, p, g, v, h, y, E, b) { var S = u.getGlobalStore(d.GLOBAL_STORE), _ = m.SUCCESS, w = r.getInstance("main/urlRouter/main.auth/onEnter"); S.getItem(d.GFWSL_STATUS).then(function(e) { _ = e }).finally(function() { if (_ == m.BLOCKED) return void s.gfeBlocked(); e.handleGfeInitializeTimeTelemetry(t.VALID_SESSION), w.info("Retrieve full system Information after login"), o.getSystemInfo().then(function(e) { w.info("Retrieved System Info"), h.hasHardwareInfo() || h.updateHardwareInfo(e), y.hasHardwareInfo() || y.updateHardwareInfo(e), E.checkForUpdates() }).catch(function() { w.error("Failed to retriev System Info") }), "main.loggedOut" !== f.name && (l.syncData(i), s.finishOobe(i)); var r, a = !1; S.getItem(d.DRIVER_INSTALL_STATE).then(function(e) { r = e, w.debug("found resume driver installation entry", r) }).catch(function(e) { w.error("failed to read displayDriverInstallation key in database: ", e) }).finally(function() { r ? p(function() { n.go("main.auth.updates", { updateState: "checkForUpdate", resumeDriverInstallation: r }, { location: "replace" }) }) : o.getLaunchTimeSystemInfo().then(function(e) { !e || e.DriverVersion && "" !== e.DriverVersion || (a = !0) }).catch(function(e) { w.error("fail to get driver info") }).finally(function() { a && (w.info("redirect to driver page"), p(function() { n.go("main.auth.updates", { updateState: "checkForUpdate" }, { location: "replace" }) })) }) }) }) }], resolve: { currentUser: ["localNodeInfo", "$q", "jarvisService", "$log", "telemetryService", "eventAggregator", "COMMON_EVENTS", "oobeDialogService", "hardwareInfo", "silentInstall", function(e, t, n, r, o, i, a, s, l, c) { var u = r.getInstance("main/urlRouter/main.auth/resolve"); return u.info("main.auth resolved called"), n.hasSession() ? n.getLoggedInUser() : n.loginFromDatabase().then(function(e) { o.setEventsCommonData({ userId: e.user.userId }); var r = t.defer(); return e.user.core.primaryEmailVerified ? r.resolve() : s.skipEmailVerification(e).then(function(e) { e ? r.resolve() : r.reject() }), r.promise.then(function() { return n.startSession(e).then(function(e) { return u.info("jarvis session started on login from db"), i.trigger(a.LOGIN_STATUS_CHANGE, !0), e }) }).catch(function() { return t.reject(e) }) }).catch(function(e) { return u.error("exception in loginFromDatabase"), ("string" == typeof e || e && e.status) && u.error(e), t.reject(e && 401 === e.status ? "sessionExpired" : null) }) }], syncViewState: ["currentUser", "dbCacheService", "DB_NAMES", function(e, t, n) { return t.getCachedUserItem(e.userId, n.VIEW_STORE, n.VIEW_STATE).sync_() }], previousState: ["$state", function(e) { return { name: e.current.name, params: e.params, url: e.href(e.current.name, e.params) } }] }, parent: "main" }).state("main.auth.home", { url: "/home", template: '
', parent: "main.auth" }).state("main.auth.home.gamesAndFriends", { url: "/games-and-friends", template: "", parent: "main.auth.home", nvEventNames: { view: n.HOME_VIEW_GAMES_AND_FRIENDS, loadTime: n.HOME_LOADTIME_GAMES_AND_FRIENDS, viewTime: n.HOME_VIEWTIME_GAMES_AND_FRIENDS } }).state("main.auth.home.gamesAndFriends.batteryBoostNotification", { url: "/games-and-friends/{data:json}", template: "", parent: "main.auth.home", nvEventNames: { view: n.HOME_VIEW_GAMES_AND_FRIENDS, loadTime: n.HOME_LOADTIME_GAMES_AND_FRIENDS, viewTime: n.HOME_VIEWTIME_GAMES_AND_FRIENDS } }).state("main.auth.home.gamesAndFriends.friendDetails", { url: "/friends-details/:userId", template: "", parent: "main.auth.home" }).state("main.auth.home.gamesAndFriends.gameDetails", { url: "/game-details/:userGameId", template: "", parent: "main.auth.home", nvEventNames: { view: n.HOME_VIEW_GAME_INFO, loadTime: n.HOME_LOADTIME_GAME_INFO, viewTime: n.HOME_VIEWTIME_GAME_INFO } }).state("main.auth.gfn", { url: "/gfn/:tabId", template: "", parent: "main.auth" }).state("main.auth.gfn.genreGames", { url: "/gfn.genreGames/:id", template: "", parent: "main.auth" }).state("main.auth.gallery", { url: "/gallery", template: "", parent: "main.auth" }).state("main.auth.gameroom", { url: "/gameroom", template: 'GAMEROOM', parent: "main.auth" }).state("main.auth.updates", { url: "/updates", params: { updateState: null, resumeDriverInstallation: null, startDriverDownload: !1 }, template: "", parent: "main.auth", nvEventNames: { view: n.UPDATES_VIEW_UPDATES, loadTime: n.UPDATES_LOADTIME_UPDATES, viewTime: n.UPDATES_VIEWTIME_UPDATES } }).state("main.auth.preferences", { url: "/preferences", template: "", parent: "main.auth", nvEventNames: { view: n.PREFERENCES_VIEW_PREFERENCES, loadTime: n.PREFERENCES_LOADTIME_PREFERENCES, viewTime: n.PREFERENCES_VIEWTIME_PREFERENCES }, onEnter: ["$state", "COMMON_DEFAULT_STATES", "dbCacheService", "DB_NAMES", "syncViewState", "currentUser", "$timeout", function(e, t, n, r, o, i, a) { var s = n.getCachedUserItem(i.userId, r.VIEW_STORE, r.VIEW_STATE), l = s.lastPreferencesRouterState || t.PREFERENCES_STATE; a(function() { e.is("main.auth.preferences") && e.go(l, {}, { location: "replace" }) }) }] }).state("main.auth.preferences.general", { url: "/general", template: "", parent: "main.auth.preferences", nvEventNames: { view: n.PREFERENCES_VIEW_GENERAL, loadTime: n.PREFERENCES_LOADTIME_GENERAL, viewTime: n.PREFERENCES_VIEWTIME_GENERAL }, onEnter: ["telemetryService", function(e) { e.push(n.PREFERENCES_VIEW_GENERAL) }] }).state("main.auth.preferences.accounts", { url: "/accounts", template: "", parent: "main.auth.preferences", nvEventNames: { view: n.PREFERENCES_VIEW_ACCOUNTS, loadTime: n.PREFERENCES_LOADTIME_ACCOUNTS, viewTime: n.PREFERENCES_VIEWTIME_ACCOUNTS }, onEnter: ["telemetryService", function(e) { e.push(n.PREFERENCES_VIEW_ACCOUNTS) }] }).state("main.auth.preferences.led", { url: "/led", template: "", parent: "main.auth.preferences" }).state("main.auth.preferences.games", { url: "/games", template: "", parent: "main.auth.preferences", nvEventNames: { view: n.PREFERENCES_VIEW_GAMES, loadTime: n.PREFERENCES_LOADTIME_GAMES, viewTime: n.PREFERENCES_VIEWTIME_GAMES }, onEnter: ["telemetryService", function(e) { e.push(n.PREFERENCES_VIEW_GAMES) }] }).state("main.auth.preferences.shield", { url: "/shield", template: "", parent: "main.auth.preferences", nvEventNames: { view: n.PREFERENCES_VIEW_SHIELD, loadTime: n.PREFERENCES_LOADTIME_SHIELD, viewTime: n.PREFERENCES_VIEWTIME_SHIELD }, onEnter: ["telemetryService", function(e) { e.push(n.PREFERENCES_VIEW_SHIELD) }] }).state("main.auth.rewards", { url: "/rewards", params: { rewardPackageId: "" }, template: '', parent: "main.auth", nvEventNames: { view: n.HOME_VIEW_REWARDS, loadTime: n.HOME_LOADTIME_REWARDS, viewTime: n.HOME_VIEWTIME_REWARDS }, onEnter: ["cevoToggleService", "cevoService", "$timeout", "$log", "USER_PROFILE_TAB_NAMES", function(e, t, n, r, o) { var i = r.getInstance("main/urlRouter/main.auth.rewards/onEnter"); i.debug("onEnter Rewards"), n(function() { e.getUserProfileEnabled().then(function(e) { e && t.gotoUserProfile(o.REWARDS_TAB) }) }) }] }).state("main.auth.userProfile", { url: "/user-profile", params: { userProfile: void 0, startWithTab: void 0, showDialog: void 0, rewardPackageId: "" }, template: '', parent: "main.auth", nvEventNames: { view: n.USER_VIEW_PROFILE, loadTime: n.USER_LOADTIME_PROFILE, viewTime: n.USER_VIEWTIME_PROFILE }, onEnter: ["telemetryService", function(e) { e.push(n.USER_VIEW_PROFILE) }] }) }]) }, function(e, t, n) { "use strict"; n(60), n(71), n(72), n(75), n(73), n(74), n(131), n(61), n(204), n(203), n(129), n(959), n(956), n(69), n(320), n(130), n(958), n(955), n(961), n(957), n(960), n(966), n(67), n(66), n(936), n(939), n(938), n(125), n(941), n(942), n(937), n(940), n(943), n(68), n(156), n(318), n(947), n(948), n(110), n(949), n(950), n(951), n(272), n(952), n(953) }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.accordionController = void 0; var r = n(1), o = r.ngMainCommonModule.controller("AccordionController", ["$scope", "ACCORDION_MODES", function(e, t) { var n = this, r = [], o = 0; void 0 === e.nvAccordionMode && (e.nvAccordionMode = t.MULTIPLE_OPEN), n.addPane = function(e) { return r[o] = e, o++ }, n.getNumPanes = function() { return r.length }, n.removePane = function(e) { r = _.without(r, e), o = r.length }, n.onClick = function(n) { e.nvAccordionMode === t.ONLY_ONE ? angular.forEach(r, function(e, t) { e.onExpand(t === n && !r[n].isExpanded()) }) : e.nvAccordionMode === t.ALWAYS_ONE ? angular.forEach(r, function(e, t) { e.onExpand(t === n) }) : r[n].onExpand(!r[n].isExpanded()) } }]); t.accordionController = o }, , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.byteFilter = void 0; var r = n(1), o = r.ngMainCommonModule.filter("convertBytesToKBMBGB", ["$filter", function(e) { var t = e("translate"), n = function(e) { var n = 1; if (0 === e) return t("l10n.byte", { value: 0 }); if (isNaN(parseFloat(e)) || !isFinite(e)) return "-"; var r = ["l10n.bytes", "l10n.kb", "l10n.mb", "l10n.gb", "l10n.tb"], o = Math.floor(Math.log(e) / Math.log(1024)), i = t(r[o], { value: (e / Math.pow(1024, Math.floor(o))).toFixed(n) }); return i }; return n }]); t.byteFilter = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.callToActionController = void 0; var r = n(1); n(330); var o = r.ngMainCommonModule.controller("CallToActionController", ["callToActionService", function(e) { function t() { n.nvCtaData.startStampAdjusted && n.updateCtaState() } var n = this; n.isDisabled = !1, n.ctaCountdownState = null, n.nvCtaData = n.nvCtaData || {}, n.nvBeforeClick = n.nvBeforeClick || angular.noop, n.nvAfterClick = n.nvAfterClick || angular.noop, n.onClick = function() { return n.nvBeforeClick(), e.handleAction(n.nvCtaData).finally(n.nvAfterClick) }, n.updateCtaState = function() { var e = (new Date).getTime(); e < n.nvCtaData.startStampAdjusted ? (n.isDisabled = !0, n.ctaCountdownState = "pending") : e > n.nvCtaData.endStampAdjusted ? (n.isDisabled = !0, n.ctaCountdownState = "expired") : (n.isDisabled = !1, n.ctaCountdownState = "active") }, t() }]); t.callToActionController = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.callToActionService = void 0; var r = n(1), o = r.ngMainCommonModule.service("callToActionService", ["$log", "$injector", "$q", "$state", "$timeout", "windowSpawnService", "GFE_ACTIONS", function(e, t, n, r, o, i, a) { function s(e) { return e.replace(/(\-[a-z])/g, function(e) { return e.toUpperCase().replace("-", "") }) } function l(e, t) { var r = !1; return _.isFunction(e) ? (r = e(t), n.when(r)) : (h.error("Expected a function got", e), n.reject()) } function c(e, t) { return r.go(e, t).then(function() { return o(angular.noop) }) } function u(e, n) { var r = t.get(e); return n in r || h.error(n + " does not exist in " + e), r[n] } function d(e, t, n) { var r = u(e, t); return l(r, n) } function f(e, t) { var n = s(e), r = document.getElementsByTagName(e), o = angular.element(r).controller(n); return t in o || h.error(t + " does not exist in " + n), o[t] } function m(e, t, n) { var r = f(e, t); return l(r, n) } function p(e) { var t = i.openDefaultBrowser(e); return n.when(t) } function g(e) { var t = [], r = n.when(), o = null; return e in a ? (o = a[e], "stateName" in o && t.push(c.bind(this, o.stateName, o.stateParams)), "directiveName" in o ? t.push(m.bind(this, o.directiveName, o.funcName, o.funcArgs)) : "serviceName" in o && t.push(d.bind(this, o.serviceName, o.funcName, o.funcArgs)), t.forEach(function(e) { r = r.then(e) }), r) : (h.error("Unknown gfeAction:", e), n.reject()) } var v = this, h = e.getInstance("main.common/callToActionService"); v.handleAction = function(e) { try { var t = y[e.type]; return t(e.action) } catch (e) { return h.error("action type error", e.message), n.reject() } }; var y = { weblink: p, gfeAction: g } }]); t.callToActionService = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvCallToAction = void 0; var o = n(1); n(329); var i = n(726), a = r(i), s = o.ngMainCommonModule.directive("nvCallToAction", [function() { return { restrict: "EA", scope: { nvCtaData: "<", nvBeforeClick: "&", nvAfterClick: "&" }, bindToController: !0, template: a.default, controller: "CallToActionController", controllerAs: "ctaCtrl", link: function(e, t, n, r) { function o() { r.isElement = !("nvCallToAction" in n), r.isElement || t.on("click", r.onClick) } function i() { r.isElement || t.off("click", r.onClick) } e.$on("$destroy", i), o() } } }]); t.nvCallToAction = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } function o(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.carouselController = void 0; var i = n(3), a = o(i), s = n(1), l = n(954), c = r(l); n(214), n(62); var u = s.ngMainCommonModule.controller("CarouselController", ["$scope", "mediaDialogService", "MEDIA_FILE_TYPE", "VIDEO_TYPE", "$log", "gfeService", "toastService", "$filter", "CAROUSEL_INDICATOR_ART", "updatesService", "telemetryService", "TELEMETRY_GRD_CONTENT_TYPE", function(e, t, n, r, o, i, s, l, u, d, f, m) { function p() { a.each(g.slides, function(e) { if (a.isArray(e.settingInfo) && !a.isEmpty(e.settingInfo)) { e.annotation = []; for (var t = 0; t < e.settingInfo.length; t++) { var r = e.settingInfo[t]; if (r.regionRect.width > 0 && r.regionRect.height > 0) { var o = r.vopsSettingEnName ? r.vopsSettingEnName.toLowerCase() : ""; e.annotation[t] = { text: (0, c.default)({ title: r.name, description: r.textInfo }), geometry: { x: r.regionRect.left, y: r.regionRect.top, width: r.regionRect.width, height: r.regionRect.height }, nvSettingName: r.name, nvSettingEnName: o, nvSettingDescription: r.textInfo } } } } else if (!a.isEmpty(e.video)) { var i = e.video; e.annotation = { type: n.VIDEO, url: i.url, name: i.name } } }) } var g = this, v = o.getInstance("main.common/CarouselController"); g.selectedIndex = e.nvSelectedIndex, g.slides = e.nvSlides, g.isBanner = e.nvIsBanner; var h = e.nvEventInfo; g.telemetryEvent = h && "string" == typeof h && JSON.parse(h); var y = e.$watch("nvSlides", function(e, t) { e !== g.slides && (g.slides = e, p()) }); p(), g.centerIndicators = function() { var e = a.size(g.slides); if (e > 0) { var t = u.WIDTH * e; return { width: t + u.CONTAINER_HORIZONTAL_MARGIN + "px", margin: "auto" } } return null }, g.isIndicatorsVisible = function() { return g.slides && g.slides.length > 1 }, g.isVideoAvailable = function(e) { return e.video && !a.isEmpty(e.video) && e.video.url && !a.isEmpty(e.video.url) }, g.isArticleAvailable = function(e) { return e && !a.isEmpty(e.gfeLoadUrl) && e.gfeLoadUrl && !a.isEmpty(e.gfeLoadUrl) }, g.previewMedia = function(e, n) { if (g.isVideoAvailable(n)) { if (i.onlineState && i.onlineState.online === !0) { var o = n.video.type === r.LOCAL; v.info("video type", n.video.type, "defaultVideoControl", o); var a = t.customPreset().event(e); a = a.video({ source: n.video.url, type: n.video.type, defaultVideoControl: o }), t.show(a) } else { var c = l("translate")("l10n.unableToFetchVideo"); s.show({ textContent: c, icon: "cloud off" }) } if (g.telemetryEvent) { g.telemetryEvent.info.contentType = m.VIDEO; var u = n.video.url || ""; g.telemetryEvent.info.url = u.substring(0, 1e3) } } else if (g.isArticleAvailable(n)) { if (v.info("video is not available: ", n), d.showArticle(n, n.driverVersion), g.telemetryEvent) { g.telemetryEvent.info.contentType = m.ARTICLE; var u = n.linksTo || ""; g.telemetryEvent.info.url = u.substring(0, 1e3) } } else if (g.telemetryEvent) { g.telemetryEvent.info.contentType = m.IMAGE; var u = n.linksTo || ""; g.telemetryEvent.info.url = u.substring(0, 1e3) } g.telemetryEvent && f.push(g.telemetryEvent.eventName, g.telemetryEvent.info) }, e.$on("$destroy", function() { y() }) }]); t.carouselController = u }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvCarouselIndicator = void 0; var o = n(1), i = n(727), a = r(i), s = o.ngMainCommonModule.directive("nvCarouselIndicator", function() { return { restrict: "E", template: a.default, scope: { nvIsSelected: "&" }, link: function(e, t) { function n() { a || t.addClass("md-accent background focused") } function r() { a || t.removeClass("md-accent background focused") } function o() { t.on("mouseenter", n), t.on("mouseleave", r) } function i() { t.off("mouseenter", n), t.off("mouseleave", r), t.remove(), t = null } var a = !1; e.$watch("nvIsSelected()", function(e) { a = e, a ? t.removeClass("focused").addClass("md-accent background") : t.removeClass("md-accent background") }), e.$on("$destroy", i), t.on("$destroy", function() { e.$destroy() }), o() } } }); t.nvCarouselIndicator = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.carouselIndicatorsController = void 0; var r = n(1), o = r.ngMainCommonModule.controller("CarouselIndicatorsController", ["$scope", function(e) { var t = this; t.slides = e.nvSlides, t.isSelected = function(t) { return t === e.nvSelectedIndex }, t.setIndex = function(t) { e.nvSelectedIndex = t } }]); t.carouselIndicatorsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } function o(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvCarouselIndicators = void 0; var i = n(3), a = (o(i), n(1)); n(333); var s = n(728), l = r(s); n(334); var c = a.ngMainCommonModule.directive("nvCarouselIndicators", [function() { function e(e, t) { e.$on("$destroy", function() { t.empty(), t.remove(), t = null }), t.on("$destroy", function() { e.$destroy() }) } return { restrict: "E", scope: { nvSlides: "=", nvSelectedIndex: "=" }, template: l.default, controller: "CarouselIndicatorsController", controllerAs: "carouselIndicators", link: e } }]); t.nvCarouselIndicators = c }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvCustomDate = void 0; var o = n(199), i = r(o), a = n(1); n(369); var s = n(730), l = r(s), c = a.ngMainCommonModule.directive("nvCustomDate", function() { return { template: l.default, restrict: "E", scope: { titleString: "@", formatString: "@", localeString: "@" }, require: "ngModel", controller: ["$scope", function(e) { var t = e; t.maxYearValue = (0, i.default)().year(), t.minYearValue = 1900, t.maxDayValue = 31, t.minDayValue = 1, t.maxMonthValue = 12, t.minMonthValue = 1, t.errors = { required: !1, pattern: !1, min: !1, max: !1, invalid: !1 }, t.isDateValid = function(e) { return (0, i.default)(e, ["YYYY-MM-DD"], !0).isValid() && (0, i.default)().isAfter(e) }, t.newDate = function(e, t, n) { var r = e + "-" + t + "-" + n; return (0, i.default)(r, ["YYYY-M-D"], !0).format("YYYY-MM-DD") }, t.localeString = t.localeString || "en", i.default.locale(t.localeString), t.months = i.default.months().map(function(e, t) { var n = {}; return n.index = t + 1, n.value = e, n }) }], compile: function(e, t) { var n = e.find("md-input-container"), r = angular.element(' '), o = angular.element(' '), i = angular.element(' {{ month.value }} '), a = "MM-DD-YY"; t.formatString && t.formatString.length > 0 && (a = t.formatString); var s = a.split("-"), l = { DD: { ele: r, cls: "is-day-field" }, YY: { ele: o, cls: "is-year-field" }, MM: { ele: i, cls: "is-month-field" } }; return angular.element(n[0]).append(l[s[0]].ele).addClass(l[s[0]].cls), angular.element(n[1]).append(l[s[1]].ele).addClass(l[s[1]].cls), angular.element(n[2]).append(l[s[2]].ele).addClass(l[s[2]].cls), { post: function(e, t, n, r) { e.$watch("[month,day,year]", function() { var t = e.newDate(e.year, e.month, e.day); if (e.isDateValid(t)) e.nvCtrl.day.$invalid = !1, r.$setViewValue(t); else { e.nvCtrl.month.$invalid || e.nvCtrl.year.$invalid || (e.nvCtrl.day.$invalid = !0); var n = e.year + "-" + e.month + "-" + e.day; r.$setViewValue(n) } e.errors.required = e.nvCtrl.day.$error.required || e.nvCtrl.month.$error.required || e.nvCtrl.year.$error.required, e.errors.invalid = e.nvCtrl.day.$invalid || e.nvCtrl.year.$invalid, e.errors.pattern = e.nvCtrl.year.$error.pattern }), r.$render = function() { if (r.$viewValue) { var t = r.$viewValue.split("-"); 3 === t.length && (e.year = parseInt(t[0]), e.month = parseInt(t[1]), e.day = parseInt(t[2])) } } } } } } }); t.nvCustomDate = c }, function(e, t, n) { "use strict"; var r = n(1); r.ngMainCommonModule.value("nvTimeUtility", { calculateDelta: function(e, t) { var n; return n = t ? new Date(t) : new Date, Math.round(Math.abs(n - e) / 1e3) }, isPast: function(e, t) { var n; return n = t ? new Date(t) : new Date, n >= e }, calculate: function(e, t, n, r, o) { var i, a = 60, s = 60 * a, l = 24 * s, c = 7 * l, u = 30 * l, d = 365 * l, f = this.calculateDelta(e, o), m = n(e, "MMMM"), p = n(e, "yyyy"), g = t("l10n.monthYear", { month: m, year: p }); switch (!1) { case !(f <= 1): i = f + " " + t("l10n.second"); break; case !(f < a): i = f + " " + t("l10n.seconds"); break; case !(f < 2 * a): i = "1 " + t("l10n.minute"); break; case !(f < s): i = Math.floor(f / a) + " " + t("l10n.minutes"); break; case 1 !== Math.floor(f / s): i = "1 " + t("l10n.hour"); break; case !(f < l): i = Math.floor(f / s) + " " + t("l10n.hours"); break; case !(f < 2 * l): if (r) return t("l10n.yesterday"); i = "1 " + t("l10n.day"); break; case !(f < c): i = Math.floor(f / l) + " " + t("l10n.days"); break; case 1 !== Math.floor(f / c): i = "1 " + t("l10n.week"); break; case !(f < u): i = Math.floor(f / c) + " " + t("l10n.weeks"); break; case 1 !== Math.floor(f / u): i = "1 " + t("l10n.month"); break; case !(f < d): if (r) return g; i = Math.floor(f / u) + " " + t("l10n.months"); break; case 1 !== Math.floor(f / d): if (r) return g; i = "1 " + t("l10n.year"); break; default: if (r) return g; i = Math.floor(f / d) + " " + t("l10n.years") } var v = i.split(" "); return t("l10n.timeago", { number: v[0], timeUnit: v[1] }) } }); r.ngMainCommonModule.filter("convertSecondsToRelativeDate", ["$filter", "nvTimeUtility", function(e, t) { var n = e("translate"), r = e("date"), o = function(e, o) { if (o) { var i = new Date, a = i.getTime() - 1e3 * o, s = t.calculate(new Date(a), n, r, !1).split(" "); return n(e, { number: s[0], timeUnit: s[1] }) } return e }; return o }]), r.ngMainCommonModule.filter("convertUTCToTimeAgo", ["$filter", "nvTimeUtility", function(e, t) { var n = e("translate"), r = e("date"), o = function(e, o) { if (e) { var i = new Date(e); return t.isPast(i, o) ? t.calculate(i, n, r, !0, o) : e } }; return o }]), r.ngMainCommonModule.filter("convertToUTCDate", ["$filter", "nvTimeUtility", function(e, t) { var n = function(e) { if (e) { var t = new Date(Date.parse(e)), n = (1 + t.getUTCMonth()).toString(); n = n.length > 1 ? n : "0" + n; var r = t.getUTCDate().toString(); return r = r.length > 1 ? r : "0" + r, n + "/" + r + "/" + t.getUTCFullYear() } return e }; return n }]), r.ngMainCommonModule.filter("convertSecondsToHHMMSS", [function() { var e = function(e, t) { var n = Math.floor(e / 3600) + 10 > 20 ? Math.floor(e / 3600) : ("00" + Math.floor(e / 3600)).slice(-2), r = ("00" + Math.floor(e % 3600 / 60)).slice(-2), o = ("00" + e % 3600 % 60).slice(-2); return t || (t = "00" !== n ? "h:m:s" : "m:s"), t.replace("h", n).replace("m", r).replace("s", o) }; return e }]), r.ngMainCommonModule.filter("convertSecondsToTime", ["$filter", function(e) { var t = e("translate"), n = function(e, n) { var r = parseInt(e, 10), o = Math.floor(r / 3600), i = Math.floor((r - 3600 * o) / 60), a = r - 3600 * o - 60 * i, s = ""; if (o) { var l = 1 === o ? t("l10n.hr", { value: o }) : n && o >= 2 ? t("l10n.aboutHrs", { value: o }) : t("l10n.hrs", { value: o }); s = n && o >= 2 ? l : l + " " } if (i && !(n && o >= 2)) { var c = 1 === i ? t("l10n.min", { value: i }) : t("l10n.mins", { value: i }); s = s + c + " " } if (a && (!n || !o)) { var u = 1 === a ? t("l10n.sec", { value: a }) : t("l10n.secs", { value: a }); s += u } return s }; return n }]) }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.dbConfig = void 0; var o = n(122), i = r(o), a = n(244), s = r(a), l = n(144), c = r(l), u = n(236), d = r(u), f = n(691), m = r(f), p = angular.module("main.common.config", ["main.common"]); p.constant("DATABASE_DEFAULTS", { session: { rememberSession: !0, sessionToken: null, userToken: null }, games: { autoOptimize: !1 }, subscriptions: { ts: null }, personalization: { bio: { ts: Date.now(), value: "" } }, notificationsViewState: {}, rewardsViewState: { rewardsFilters: { all: !0 }, unRedeemedList: [], redeemedOrExpiredList: [] }, qrcodeState: { weChat: { NFAN: { fetchTime: 0, qrCodeURL: null, expireTime: 0, qrCodeScanned: !1 } } }, searchState: { recentSearches: [] }, globalAbState: { activeExperiments: [] }, productTourStates: {}, userAbState: { activeExperiments: [] }, avatar: { ts: null, url: c.default }, cover: { ts: null, url: d.default }, myRig: { ts: null, url: m.default }, viewState: { vopsImageContainerSize: "50%", selectedGameId: null, feedbackFloatOverlayEnabled: !0, feedbackFloatShowState: !1, feedbackFloatOpenOnMouseEnter: !1, targetPowerMode: null, userTabSelectionList: [], driverExpandState: {}, lastRouterFromState: "main.auth.home", lastRouterFromStateParams: {}, lastRouterToState: "main.auth.home", lastRouterToStateParams: {}, classicViewTopIndex: 0, topIndex: 0 }, synchedViewState: { gamesSortType: "alphabetical", gamesSortOrder: "ascending", gamesFilters: { all: !0, optimized: !1, favorite: !1, anselReady: !1, hidden: !1 }, classicViewEnabled: !1 } }), p.config(["dbServiceProvider", "DATABASE_DEFAULTS", "DB_NAMES", function(e, t, n) { var r, o, a, l; e.init("gfeclient").defineGlobalStore({ storeName: n.GLOBAL_STORE, storeDefault: { version: 5, db: (r = {}, (0, s.default)(r, n.SESSION, t.session), (0, s.default)(r, n.GAMES, t.games), (0, s.default)(r, n.GLOBAL_AB_STATE, t.globalAbState), (0, s.default)(r, n.PRODUCT_TOUR_STATES, t.productTourStates), r) }, description: "Stores settings that apply to all users" }).upgradeGlobalStore(n.GLOBAL_STORE, 1, function(e) { return e.setItem(n.SESSION, t.session) }).upgradeGlobalStore(n.GLOBAL_STORE, 2, function(e) { return e.setItem(n.GAMES, t.games) }).upgradeGlobalStore(n.GLOBAL_STORE, 3, function(e) { return e.getItem(n.GAMES).then(function(r) { if (void 0 === r.autoOptimize || null === r.autoOptimize) return e.setItem(n.GAMES, t.games) }) }).upgradeGlobalStore(n.GLOBAL_STORE, 4, function(e) { return e.setItem(n.GLOBAL_AB_STATE, t.globalAbState) }).upgradeGlobalStore(n.GLOBAL_STORE, 5, function(e) { return e.setItem(n.PRODUCT_TOUR_STATES, t.productTourStates) }).defineUserStore({ storeName: n.JARVIS_COMMON_STORE, storeDefault: { version: 3, db: (o = {}, (0, s.default)(o, n.SUBSCRIPTIONS, t.subscriptions), (0, s.default)(o, n.PERSONALIZATION, t.personalization), o) }, description: "Jarvis user-specific settings that apply to all clients" }, !0).upgradeUserStore(n.JARVIS_COMMON_STORE, 1, function(e) { return e.setItem(n.SUBSCRIPTIONS, t.subscriptions) }).upgradeUserStore(n.JARVIS_COMMON_STORE, 2, function(e) { return e.setItem(n.PERSONALIZATION, t.personalization) }).upgradeUserStore(n.JARVIS_COMMON_STORE, 3, function(e) { return e.getItem(n.PERSONALIZATION).then(function(r) { if (null == r.bio.ts || null == r.bio.value) return e.setItem(n.PERSONALIZATION, t.personalization) }) }).defineUserStore({ storeName: n.JARVIS_GFE_STORE, storeDefault: { version: 10, db: (a = {}, (0, s.default)(a, n.JARVIS_VIEW_STATE, { ts: null, gamesSortType: t.synchedViewState.gamesSortType, gamesSortOrder: t.synchedViewState.gamesSortOrder, gamesFilters: t.synchedViewState.gamesFilters }), (0, s.default)(a, n.JARVIS_AVATAR, t.avatar), (0, s.default)(a, n.NOTIFICATIONS_VIEW_STATE, t.notificationsViewState), (0, s.default)(a, n.REWARDS_VIEW_STATE, t.rewardsViewState), (0, s.default)(a, n.JARVIS_QRCODE_STATE, t.qrcodeState), (0, s.default)(a, n.JARVIS_SEARCH_STATE, t.searchState), (0, s.default)(a, n.USER_AB_STATE, t.userAbState), a) }, description: "Jarvis user-specific settings that apply to gfeclient" }).upgradeUserStore(n.JARVIS_GFE_STORE, 1, function(e) { return e.setItem(n.JARVIS_VIEW_STATE, { ts: null, gamesSortType: t.synchedViewState.gamesSortType, gamesSortOrder: t.synchedViewState.gamesSortOrder, gamesFilters: t.synchedViewState.gamesFilters }) }).upgradeUserStore(n.JARVIS_GFE_STORE, 2, function(e) { return e.setItem(n.JARVIS_AVATAR, t.avatar) }).upgradeUserStore(n.JARVIS_GFE_STORE, 3, function(e) { return e.getItem(n.JARVIS_VIEW_STATE).then(function(t) { var r = t.gamesFilters; if (r.hidden && (r.all || r.optimized || r.favorite)) return t.gamesFilters.hidden = !1, e.setItem(n.JARVIS_VIEW_STATE, t) }) }).upgradeUserStore(n.JARVIS_GFE_STORE, 4, function(e) { return e.setItem(n.NOTIFICATIONS_VIEW_STATE, t.notificationsViewState) }).upgradeUserStore(n.JARVIS_GFE_STORE, 5, function(e) { return e.setItem(n.REWARDS_VIEW_STATE, t.rewardsViewState) }).upgradeUserStore(n.JARVIS_GFE_STORE, 6, function(e) { return e.getItem(n.JARVIS_VIEW_STATE).then(function(t) { if (angular.isUndefined(t.gamesFilters.anselReady)) return t.gamesFilters.anselReady = !1, e.setItem(n.JARVIS_VIEW_STATE, t) }) }).upgradeUserStore(n.JARVIS_GFE_STORE, 7, function(e) { return e.setItem(n.JARVIS_QRCODE_STATE, t.qrcodeState) }).upgradeUserStore(n.JARVIS_GFE_STORE, 8, function(e) { return e.setItem(n.JARVIS_SEARCH_STATE, t.searchState) }).upgradeUserStore(n.JARVIS_GFE_STORE, 9, function(e) { return e.setItem(n.USER_AB_STATE, t.userAbState) }).upgradeUserStore(n.JARVIS_GFE_STORE, 10, function(e) { return e.getItem(n.NOTIFICATIONS_VIEW_STATE).then(function(t) { return (0, i.default)(t).forEach(function(e) { t[e] instanceof Date && (t[e] = { notificationTs: t[e], removed: !1 }) }), e.setItem(n.NOTIFICATIONS_VIEW_STATE, t) }) }).defineUserStore({ storeName: n.VIEW_STORE, storeDefault: { version: 1, db: (0, s.default)({}, n.VIEW_STATE, { vopsImageContainerSize: t.viewState.vopsImageContainerSize, selectedGameId: t.viewState.selectedGameId, targetPowerMode: t.viewState.targetPowerMode, userTabSelectionList: t.viewState.userTabSelectionList, feedbackFloatOverlayEnabled: t.viewState.feedbackFloatOverlayEnabled, feedbackFloatShowState: t.viewState.feedbackFloatShowState, feedbackFloatOpenOnMouseEnter: t.viewState.feedbackFloatOpenOnMouseEnter, driverExpandState: t.viewState.driverExpandState, classicViewTopIndex: t.viewState.classicViewTopIndex, topIndex: t.viewState.topIndex }) }, description: "Persisted view settings per user" }).upgradeUserStore(n.VIEW_STORE, 1, function(e) { return e.setItem(n.VIEW_STATE, { vopsImageContainerSize: t.viewState.vopsImageContainerSize, selectedGameId: t.viewState.selectedGameId, targetPowerMode: t.viewState.targetPowerMode, userTabSelectionList: t.viewState.userTabSelectionList, feedbackFloatOverlayEnabled: t.viewState.feedbackFloatOverlayEnabled, feedbackFloatShowState: t.viewState.feedbackFloatShowState, feedbackFloatOpenOnMouseEnter: t.viewState.feedbackFloatOpenOnMouseEnter, driverExpandState: t.viewState.driverExpandState, classicViewTopIndex: t.viewState.classicViewTopIndex, topIndex: t.viewState.topIndex }) }).defineUserStore({ storeName: n.CEVO_GFE_STORE, storeDefault: { version: 1, db: (l = {}, (0, s.default)(l, n.AVATAR, t.avatar), (0, s.default)(l, n.COVER, t.cover), (0, s.default)(l, n.MY_RIG, t.myRig), l) }, description: "Persisted profile data per user" }).upgradeUserStore(n.CEVO_GFE_STORE, 1, function(e) { return e.setItem(n.AVATAR, t.avatar).then(function() { return e.setItem(n.COVER, t.cover).then(function() { return e.setItem(n.MY_RIG, t.myRig) }) }) }) }]), p.config(["dbCacheServiceProvider", "DB_NAMES", function(e, t) { e.loadUserKey(t.VIEW_STORE, t.VIEW_STATE), e.loadUserKey(t.JARVIS_COMMON_STORE, t.SUBSCRIPTIONS), e.loadUserKey(t.JARVIS_COMMON_STORE, t.PERSONALIZATION), e.loadUserKey(t.JARVIS_GFE_STORE, t.JARVIS_AVATAR), e.loadUserKey(t.JARVIS_GFE_STORE, t.JARVIS_GAME_LIST), e.loadUserKey(t.JARVIS_GFE_STORE, t.JARVIS_VIEW_STATE), e.loadUserKey(t.JARVIS_GFE_STORE, t.NOTIFICATIONS_VIEW_STATE), e.loadUserKey(t.JARVIS_GFE_STORE, t.JARVIS_QRCODE_STATE), e.loadUserKey(t.JARVIS_GFE_STORE, t.JARVIS_SEARCH_STATE), e.loadUserKey(t.JARVIS_GFE_STORE, t.REWARDS_VIEW_STATE), e.loadUserKey(t.JARVIS_GFE_STORE, t.USER_AB_STATE), e.loadUserKey(t.CEVO_GFE_STORE, t.AVATAR), e.loadUserKey(t.CEVO_GFE_STORE, t.COVER), e.loadUserKey(t.CEVO_GFE_STORE, t.MY_RIG), e.loadGlobalKey(t.GLOBAL_STORE, t.GLOBAL_AB_STATE), e.loadGlobalKey(t.GLOBAL_STORE, t.PRODUCT_TOUR_STATES) }]), t.dbConfig = p }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.dialogEditEmailController = void 0; var r = n(1), o = r.ngMainCommonModule.controller("DialogEditEmailController", ["$log", function(e) { var t = this, n = e.getInstance("main.common/DialogEditEmailController"); t.done = function() { t.emailForm.$invalid ? (n.debug("tried to submit invalid form"), t.nvDialogModel.is2FactorAuthentication || t.emailForm.password.$setTouched(), t.emailForm.email.$setTouched(), t.emailForm.reEnterEmail.$setTouched()) : (t.nvDialogModel.error = null, t.nvDialogModel.waiting = !0, t.nvDialogModel.sessionObject.user.core.primaryEmail === t.email || t.nvDialogModel.is2FactorAuthentication ? (n.debug("Email did not change or 2 factor authentication. Resend verification"), t.nvDialogModel.actionVerifyEmail(t.email)) : (n.debug("Email has changed. Attempt to change email address"), t.nvDialogModel.password = t.password, t.nvDialogModel.actionUpdateEmail(t.nvDialogModel.sessionObject, t.email, t.password).catch(function(e) { t.nvDialogModel.waiting = !1, 401 === e.status ? (n.debug("Change Email: Invalid credentials"), t.emailForm.password.$setValidity("invalidPassword", !1), t.emailForm.password.$setTouched()) : 403 === e.status ? (n.debug("Change Email: Account has no password, must be a social-only account"), t.nvDialogModel.error = "l10n.noPassword") : 409 === e.status ? (n.debug("Change Email: Email address is already being used"), t.emailForm.email.$setValidity("notAvailable", !1), t.emailForm.email.$setTouched()) : (n.debug("Change Email: Generic server error. status:", e.status), t.nvDialogModel.error = "l10n.unableToConnect") }))) }, t.emailChanged = function() { t.emailForm.email.$setValidity("notAvailable", !0) }, t.passwordChanged = function() { t.emailForm.password.$setValidity("invalidPassword", !0) }, t.cancel = function() { n.debug("cancel pressed"), t.nvDialogModel.actionCancelUpdateEmail(t.nvDialogModel.sessionObject) }, angular.merge(t.nvDialogModel, { style: "honeycomb-square", button1: { text: t.nvDialogModel.is2FactorAuthentication ? "l10n.update" : "l10n.done", action: t.done }, button2: { text: "l10n.cancel", action: t.cancel } }) }]); t.dialogEditEmailController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvDialogHtml = void 0; var o = n(1), i = n(733), a = r(i), s = o.ngMainCommonModule.directive("nvDialogHtml", [function() { return { restrict: "A", scope: {}, bindToController: { nvDialogModel: "=" }, template: a.default, controller: [function() {}], controllerAs: "dialogHtmlCtrl" } }]); t.nvDialogHtml = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvDialogMessage = void 0; var o = n(1), i = n(734), a = r(i), s = o.ngMainCommonModule.directive("nvDialogMessage", [function() { return { restrict: "A", scope: {}, bindToController: { nvDialogModel: "=" }, template: a.default, controller: [function() {}], controllerAs: "dialogMessageCtrl" } }]); t.nvDialogMessage = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvDialogText = void 0; var o = n(1), i = n(735), a = r(i), s = o.ngMainCommonModule.directive("nvDialogText", [function() { return { restrict: "A", scope: {}, bindToController: { nvDialogModel: "=" }, template: a.default, controller: [function() {}], controllerAs: "dialogTextCtrl" } }]); t.nvDialogText = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.exceptionService = void 0; var o = n(13), i = r(o), a = n(1); n(344), n(29); var s = n(962), l = r(s), c = a.ngMainCommonModule.provider("exceptionService", function() { var e = !0; return { setEnabled: function(t) { e = t }, $get: ["$log", "$mdDialog", "$filter", "preferencesService", "GFECLIENT_CONFIG", function(t, n, r, o, a) { function s(t, s) { if (u.info("UnHandled Exception was caught"), e) { c.exception = t, c.cause = s; var d = { name: t.name, message: t.message, stackFrame: null }; try { d.stackFrame = l.default.parse(t) } catch (e) { u.error("cannot generate stack trace from error object", e), d.stackFrame = t.toString() } c.exceptionstr = (0, i.default)(d), c.properties = t.stack ? t.stack.replace(/ at /g, "
   at ").replace(/([^\/]+):(\d+):(\d+)/g, '$1: $2:$3') + "
" : "", "prod" === a.mode && o.postFeedback("FEEDBACK_AUTOMATIC_CRIMSON_UI_ERROR", c.exceptionstr).then(function() {}).catch(function(e) { u.error("post feedback was failed for FEEDBACK_AUTOMATIC_CRIMSON_UI_ERROR", e) }), "dev" === a.mode && n.show(n.alert().parent(angular.element(document.body)).clickOutsideToClose(!0).title(r("translate")("l10n.unhandledexception")).content(c.properties).ok(r("translate")("l10n.close"))) } } var c = this, u = t.getInstance("main.common/exceptionService"); return c.exception = null, c.cause = "", c.properties = "", c.exceptionstr = "", { logException: s } }] } }); t.exceptionService = c }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.exceptionConfig = void 0; var r = n(1), o = r.ngMainCommonModule.config(["$provide", function(e) { e.decorator("$exceptionHandler", ["$log", "$delegate", "$injector", function(e, t, n) { return function(e, r) { var o = n.get("exceptionService"); o.logException(e, r), t(e, r) } }]) }]); t.exceptionConfig = o }, , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.feedbackFloatController = void 0; var r = n(1); n(31), n(11), n(12), n(22); var o = r.ngMainCommonModule.controller("FeedbackFloatController", ["dialogService", "dbCacheService", "DB_NAMES", "jarvisService", "hardwareService", "$log", "COMMON_EVENTS", "eventAggregator", "$scope", "feedbackService", function(e, t, n, r, o, i, a, s, l, c) { function u(e) { v.info("onSysInfoUpdated ", e.DriverVersion), g.driverless = e && (!e.DriverVersion || "" === e.DriverVersion) } function d() { var e = r.getLoggedInUser(); e ? g.viewState = t.getCachedUserItem(r.getLoggedInUser().userId, n.VIEW_STORE, n.VIEW_STATE) : g.viewState = {} } function f() { g.viewState.feedbackFloatShowState = !1, g.viewState.feedbackFloatOpenOnMouseEnter = !1, g.viewState.persist_() } function m() { d(), s.on(a.SYSTEMINFO_UPDATED, u), s.on(a.LOGIN_STATUS_CHANGE, d), s.on(a.DIALOG_CLOSED, f) } function p() { s.off(a.SYSTEMINFO_UPDATED, u), s.off(a.LOGIN_STATUS_CHANGE, d), s.off(a.DIALOG_CLOSED, f) } var g = this; g.isDialogOpen = !1, g.driverless = !1; var v = i.getInstance("main.common/FeedbackFloatController"); o.getLaunchTimeSystemInfo().then(function(e) { g.driverless = e && (!e.DriverVersion || "" === e.DriverVersion), v.info("driverless:", g.driverless) }).catch(function(e) { v.error("failed to get systemInfo") }), g.showFeedbackButton = function() { var e = r.getLoggedInUser(); return void 0 !== e && null !== e && !g.driverless }, g.onOpenFeedbackDialog = function() { c.showFeedBack() }, g.disableFeedbackFloat = function() { g.viewState.feedbackFloatOverlayEnabled = !1, g.viewState.feedbackFloatShowState = !1, g.viewState.persist_() }, g.onMouseEnter = function() { g.viewState.feedbackFloatShowState || g.viewState.feedbackFloatOverlayEnabled || (g.viewState.feedbackFloatOpenOnMouseEnter ? (g.viewState.feedbackFloatShowState = !0, g.viewState.persist_()) : (g.viewState.feedbackFloatOpenOnMouseEnter = !0, g.viewState.persist_())) }, g.onMouseLeave = function() { g.isDialogOpen = e.isOpen(), !g.viewState.feedbackFloatShowState || g.viewState.feedbackFloatOverlayEnabled || g.isDialogOpen || (g.viewState.feedbackFloatShowState = !1, g.viewState.persist_()) }, g.showFloatStateButton = function() { return !g.viewState.feedbackFloatOverlayEnabled && !g.viewState.feedbackFloatShowState && !g.isDialogOpen }, g.showFloatStateOpen = function() { return g.viewState.feedbackFloatOverlayEnabled || (g.viewState.feedbackFloatShowState || g.isDialogOpen) && g.viewState.feedbackFloatOpenOnMouseEnter }, m(), l.$on("$destroy", p) }]); t.feedbackFloatController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFeedbackFloat = void 0; var o = n(1), i = n(736), a = r(i); n(347); var s = o.ngMainCommonModule.component("nvFeedbackFloat", { template: a.default, controller: "FeedbackFloatController", controllerAs: "feedbackFloatCtrl" }); t.nvFeedbackFloat = s }, , , , , , , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gfeGeolocationService = void 0; var r = n(44), o = r.ngMainUtilsModule.service("gfeGeolocationService", ["$log", "$q", "geolocationEndpoints", "dbService", "DB_NAMES", "eventAggregator", "COMMON_EVENTS", function(e, t, n, r, o, i, a) { function s(e) { c.getItem(o.GEO_DETAILS).then(function(n) { return n ? (e.resolve(n), void i.trigger(a.GEOLOCATION_UPDATED, n)) : (e.reject(), t.reject()) }).catch(function() { u.error("Returning default country code: ", d); var t = { countryCode: d }; e.resolve(t), i.trigger(a.GEOLOCATION_UPDATED, t) }).finally(function() { f = null }) } var l = this, c = r.getGlobalStore(o.GLOBAL_STORE), u = e.getInstance("main.utils/GfeGeolocationService"), d = "US", f = null; l.getGeolocation = function() { if (!f) { var e = t.defer(); f = e.promise, n.getGeolocation().then(function(t) { var n = t.data; c.setItem(o.GEO_DETAILS, n), u.info("Geolocation set to", n), e.resolve(n), i.trigger(a.GEOLOCATION_UPDATED, n) }).catch(function(t) { s(e) }) } return f } }]); t.gfeGeolocationService = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gfwslService = void 0; var r = n(1), o = r.ngMainCommonModule.service("gfwslService", ["$q", "$log", "gfwslEndpoints", "hardwareService", function(e, t, n, r) { function o() { return n.hasHardwareInfo() ? e.when(!0) : r.getSystemInfo().then(function(e) { return n.updateHardwareInfo(e), !0 }) } var i = this; t.getInstance("main.common/gfwslService"); i.getTermsAndConditions = function() { return o().then(function(e) { return n.staticContent.getTermsAndConditions() }) }, i.getPrivacyPolicy = function() { return o().then(function(e) { return n.staticContent.getPrivacyPolicy() }) } }]); t.gfwslService = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.httpLoggingService = void 0; var o = n(317), i = r(o), a = n(243), s = r(a), l = n(919), c = r(l), u = n(918), d = r(u), f = n(242), m = r(f), p = n(1), g = function e() { var t = this; (0, m.default)(this, e), ["request", "requestError", "response", "responseError"].forEach(function(e) { t[e] && (t[e] = t[e].bind(t)) }) }, v = function(e) { function t(e, n, r) { (0, m.default)(this, t); var o = (0, c.default)(this, (t.__proto__ || (0, i.default)(t)).call(this)); return o.GFECLIENT_CONFIG = n, o.$q = r, o.logger = e.getInstance("main.common/httpLoggingService"), o.sanitize = function(e) { var t = this; try { _.isUndefined(e.config) || (e.config.headers.X_LOCAL_SECURITY_COOKIE = "", _.isUndefined(e.config.data) || _.isUndefined(e.config.data.userInfo) || (e.config.data.userInfo = "")) } catch (e) { t.logger.error("Could not sanitize Security Cookie", e) } return e }, o.logDebugJarvisResponseHeaders = function(e) { var t = this, n = e.headers(); t.logger.debug("debug jarvis response headers: x-jarvisrequestid", n["x-jarvisrequestid"], "x-jarvisresponder", n["x-jarvisresponder"]) }, o } return (0, d.default)(t, e), (0, s.default)(t, [{ key: "request", value: function(e) { var t = this; return e.url.match(t.GFECLIENT_CONFIG.gfwsl.server) && t.logger.debug("Going to call endpoint request url ", e.url), e } }, { key: "requestError", value: function(e) { var t = this; return t.logger.error("http request FAILED for method", e.method, " url ", e.url), t.$q.reject(e) } }, { key: "response", value: function(e) { var t = this, n = t.sanitize(e); return t.logger.debug("Http response for request ", n.config.url, " returns status: ", n.status), n.config.url.match(t.GFECLIENT_CONFIG.gfwsl.server) ? t.logger.debug(" gfwsl returned successfully with response ", n) : n.config.url.match(t.GFECLIENT_CONFIG.jarvis.server) && t.logDebugJarvisResponseHeaders(n), n } }, { key: "responseError", value: function(e) { var t = this, n = t.sanitize(e); return _.isUndefined(n.config) ? t.logger.error("Http request method FAILED with response ", n) : (t.logger.error("Http request method ", n.config.method, ", url ", n.config.url, " FAILED with response ", n), n.config.url.match(t.GFECLIENT_CONFIG.jarvis.server) && t.logDebugJarvisResponseHeaders(n)), t.$q.reject(n) } }]), t }(g), h = p.ngMainCommonModule.service("httpLoggingService", ["$log", "GFECLIENT_CONFIG", "$q", v]); t.httpLoggingService = h }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } function o(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvImageAnnotation = void 0; var i = n(3), a = o(i), s = n(1); n(41); var l = n(741), c = r(l), u = s.ngMainCommonModule.directive("nvImageAnnotation", ["annotoriousService", "eventAggregator", "GAME_EVENTS", "$timeout", "$interval", "SCROLL_STEPS", "COMMON_EVENTS", "$document", function(e, t, n, r, o, i, s, l) { function u(e, t, n, r) { return n * (Math.pow(e / r - 1, 3) + 1) + t } function d(c, d) { function f() { var e = 1, t = parseInt(d[0].offsetWidth); return _.naturalWidth > t && (e = (t - 8) / _.naturalWidth), e } function m(e, t) { var n = d[0].getBoundingClientRect(), r = d[0].scrollTop, a = r + n.height, s = e.shape.geometry.y, c = l[0].getElementById(e.id); if (c) { var f = s + c.getBoundingClientRect().height; if (r >= s || a <= s || a <= f) { var m = 0, p = s - r - n.height / 2; a + p <= f && (p = f - a), b = o(function() { d[0].scrollTop = u(m, r, Math.ceil(p), i), m++, m >= i && (o.cancel(b), t()) }, 0) } else t() } } function p(t) { o.cancel(b); var n = e.getAnnotationBySettingName(_, t.name); n && m(n, function() { e.highlightAnnotation(_, t.name) }) } function g() { e.hideAnnotations(_) } function v(t) { e.makeAnnotatable(_), a.each(c.nvAnnotation, function(n) { if (n.geometry.width > 0 && n.geometry.height > 0) { var r = n.geometry.x * t - n.geometry.width / 2, o = n.geometry.y * t - n.geometry.height / 2, i = { text: n.text, shape: { type: "rect", geometry: { x: r > 0 ? r : 0, y: o > 0 ? o : 0, width: n.geometry.width, height: n.geometry.height } }, nvSettingName: n.nvSettingName, nvSettingEnName: n.nvSettingEnName, nvPopupWidth: n.nvPopupWidth, nvPopupHeight: n.nvPopupHeight }; e.addAnnotation(_, i) } }) } function h() { var t = f(); r.cancel(E), E = r(function() { e.destroy(_), v(t) }) } function y() { r.cancel(S), S = r(function() { v(f()), t.on(s.WINDOW_RESIZE, h), t.on(n.SETTING_ITEM_MOUSE_LEAVE, g), t.on(n.SETTING_ITEM_HOVER_CAROUSEL_READY, p), t.trigger(n.IMAGE_LOADED, _.getAttribute("src")) }) } var E, b, S, _ = d.find("img")[0]; a.size(c.nvAnnotation) > 0 && (angular.element(d.find("img")[0]).on("load", y), c.$on("$destroy", function() { e.destroy(_), t.trigger(n.IMAGE_UNLOADED, _.getAttribute("src")), t.off(n.SETTING_ITEM_HOVER_CAROUSEL_READY, p), t.off(n.SETTING_ITEM_MOUSE_LEAVE, g), t.off(s.WINDOW_RESIZE, h), angular.element(d.find("img")[0]).off("load", y), r.cancel(E), o.cancel(b), r.cancel(S), _ = null, E = null, b = null, S = null, d.empty(), d.remove(), d = null }), d.on("$destroy", function() { c.$destroy() })) } return { restrict: "E", scope: { nvImageSrc: "@", nvAnnotation: "=", nvImageAlt: "@" }, template: c.default, link: d } }]); t.nvImageAnnotation = u }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvImageUpload = void 0; var o = n(1), i = n(743), a = r(i), s = o.ngMainCommonModule.directive("nvImageUpload", [function() { return { bindToController: { onImageSelect: "&" }, transclude: !0, template: a.default, controller: function() {}, controllerAs: "imageUploadCtrl", link: function(e, t, n, r) { function o(e) { if (e.currentTarget) { var t = new FileReader; t.onload = function() { r.onImageSelect({ newImage: t.result }) }, t.readAsDataURL(e.currentTarget.files[0]) } } function i() { a.off("change", o), a = null, t.empty(), t.remove(), t = null } var a = angular.element(t[0].querySelector("#input-file-id")); a.on("change", o), e.$on("$destroy", i) } } }]); t.nvImageUpload = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvInlineDropdown = void 0; var r = n(1), o = r.ngMainCommonModule.directive("nvInlineDropdown", ["$timeout", function(e) { return { scope: !0, restrict: "E", bindToController: !0, controller: [function() {}], controllerAs: "nvInlineDropdownCtrl", template: function(e, t) { var n, r, o; if (2 !== e.children().length || "nv-inline-dropdown-header" !== e.children()[0].tagName.toLowerCase() || "md-list" !== e.children()[1].tagName.toLowerCase()) throw Error("Invalid HTML for nv-inline-dropdown. Expected nv-inline-dropdown-header and md-list"); e.attr("layout", "column"), e.addClass("layout"), e.addClass("layout-column"), n = angular.element(e.children()[0]), r = angular.element(e.children()[1]), n.attr("flex", ""), n.attr("layout-fill", ""), n.attr("layout", "row"), n.attr("layout-align", "start center"), n.attr("ng-click", "nvInlineDropdownCtrl.onClick()"), r.attr("ng-click", "nvInlineDropdownCtrl.onClick()"), n.append(angular.element("expand_more')), o = angular.element(" d ? (u = d, a.commonVideoDivElement.css({ width: d + "px" })) : a.commonVideoDivElement.css({ width: u + "px" }); var f = o(a.commonVideoDivElement, "height"); f = parseInt(f.substring(0, f.lastIndexOf("px"))); var m = 0, p = 0; a.dialog[0].clientWidth > u && (m = (a.dialog[0].clientWidth - u) / 2), a.dialog[0].clientHeight > f && (p = (a.dialog[0].clientHeight - f) / 2), a.commonVideoDivElement.css({ "margin-left": m + "px", "margin-top": p + "px" }), a.overlay.css({ visibility: "visible", left: m + "px", top: p + "px", width: u + "px" }) } } else { a.media[0] && a.dialog[0].clientWidth > a.media[0].clientWidth && (i = (a.dialog[0].clientWidth - a.media[0].clientWidth) / 2), a.media[0] && a.dialog[0].clientHeight > a.media[0].clientHeight && (s = (a.dialog[0].clientHeight - a.media[0].clientHeight) / 2); var g = a.media[0].clientHeight + "px"; a.model.video().defaultVideoControl && (g = "auto"), a.overlay.css({ visibility: "visible", left: i + "px", top: s + "px", width: a.media[0].clientWidth + "px", height: g }) } } } var a = this; a.model = e.getDialogModel(), a.showOverlay = !1, a.videoLoaded = !1, a.media = null, a.dialog = null, a.overlay = null, a.commonVideoDivElement = null, a.close = function() { e.close() }, a.setShowOverlay = function(e) { a.showOverlay = e }, a.setVideoLoaded = function(e) { a.videoLoaded = e, a.videoLoaded && i() }, n.ready(function() { null === a.dialog && (a.commonVideoDivElement = angular.element(n[0].querySelector(".common-video-directive")), a.dialog = angular.element(n[0].querySelector(".common-media-dialog-service-media-dialog")), a.media = a.model.image() ? a.dialog.find("img") : a.dialog.find("video"), a.overlay = a.dialog.find("nv-overlay")), a.dialog.focus(), a.model.image() && (a.media[0].complete ? i() : a.media.bind("load", function() { i() })) }), t.onresize = function() { i() } }]) }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.mediaTileController = void 0; var r = n(1); n(296), n(214), n(166); var o = r.ngMainCommonModule.controller("MediaTileController", ["MEDIA_FILE_TYPE", "mediaDialogService", "imageFormatService", function(e, t, n) { var r = this; r.mediaItem = { thumbnail: n.formatImage(r.nvMediaThumbnail, 169), alt: r.nvMediaAlt, fileType: r.nvMediaType, original: r.nvMediaOriginal }, r.previewMedia = function(n) { var o = t.customPreset().toolbarHtml("").event(n); if (r.mediaItem.fileType === e.IMAGE) o = o.image(r.mediaItem.original), t.show(o); else { if (r.mediaItem.fileType !== e.VIDEO) return !1; o = o.video({ source: r.mediaItem.original }), t.show(o) } }, r.isVideo = function() { return e.VIDEO === r.mediaItem.fileType } }]); t.mediaTileController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvMediaTile = void 0; var o = n(1), i = n(745), a = r(i); n(364), n(17), n(41); var s = o.ngMainCommonModule.component("nvMediaTile", { bindings: { nvMediaThumbnail: "@", nvMediaType: "@", nvMediaAlt: "@", nvMediaOriginal: "@" }, template: a.default, controller: "MediaTileController", controllerAs: "mediaTile" }); t.nvMediaTile = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.navigationalDialogController = void 0; var r = n(1), o = r.ngMainCommonModule.controller("NavigationalDialogController", ["$log", "navigationalDialogService", "eventAggregator", "NAVIGATIONAL_DIALOG_EVENTS", function(e, t, n, r) { function o() { a = t.getItemsList(), i.model = t.getDialogModel(), a && a.length <= 1 && (i.showButtons = !1) } var i = this, a = null, s = e.getInstance("main.common/navigationalDialogController"); i.showButtons = !0, i.close = function() { i.showButtons = !1, t.close() }, i.forward = function() { var e = _.indexOf(a, t.getCurrentItem()); return e == -1 ? void s.error("item does not exist in dialog's list") : (e = e == a.length - 1 ? 0 : e + 1, i.currentItem = a[e], t.setCurrentItem(i.currentItem), void n.trigger(r.CURRENT_ITEM_UPDATED)) }, i.backward = function() { var e = _.indexOf(a, t.getCurrentItem()); return e == -1 ? void s.error("item does not exist in dialog's list") : (e = 0 == e ? a.length - 1 : e - 1, i.currentItem = a[e], t.setCurrentItem(i.currentItem), void n.trigger(r.CURRENT_ITEM_UPDATED)) }, o() }]); t.navigationalDialogController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.navigationalDialogService = void 0; var o = n(1); n(366), n(163); var i = n(746), a = r(i), s = o.ngMainCommonModule.service("navigationalDialogService", ["$mdDialog", function(e) { function t(t, n) { e.show({ template: a.default, targetEvent: n, controller: "NavigationalDialogController", controllerAs: "dialogCtrl", bindToController: !0, parent: t }) } var n = this, r = null, o = null, i = null, s = function() { function e(e) { t[e] = function(r) { return null != r ? (n[e] = r, t) : n[e] } } var t = this, n = {}; e("html"), e("class") }; n.show = function(e, n, a) { o = n.currentItem, i = n.itemsList, r = (new s).html(e).class(n.class), t(n.parent, a) }, n.close = function(t) { e.cancel() }, n.getDialogModel = function() { return r }, n.getItemsList = function() { return i }, n.setCurrentItem = function(e) { o = e }, n.getCurrentItem = function() { return o } }]); t.navigationalDialogService = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.newsController = void 0; var r = n(1); n(63); var o = r.ngMainCommonModule.controller("NewsController", ["$log", "tbdService", function(e, t) { var n, r = this, o = e.getInstance("main.common/NewsController"); r.gameShortName = r.nvShortName, r.newsList = [], n = "gfn" === r.nvNewsSource ? t.getGfnNews(r.gameShortName) : t.getGameNews(r.gameShortName), n.then(function(e) { r.newsList = e }).catch(function(e) { o.error("getNews failed with Status: " + e.status) }) }]); t.newsController = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.numbersOnly = void 0; var r = n(1), o = r.ngMainCommonModule.directive("numbersOnly", function() { return { require: "ngModel", scope: { nvMin: "@", nvMax: "@" }, link: function(e, t, n, r) { function o(t) { if (t) { var n = t.replace(/[^0-9]/g, ""); n !== t && (r.$setViewValue(n), r.$render()); var o = parseInt(n) >= e.nvMin && parseInt(n) <= e.nvMax; return r.$setValidity("numbersOnly", o), n } } r.$parsers.push(o) } } }); t.numbersOnly = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvNotificationIndicator = void 0; var r = n(1), o = r.ngMainCommonModule.directive("nvNotificationIndicator", function() { return { restrict: "A", link: function(e, t, n, r, o) { n.$observe("nvNotificationIndicator", function(e) { "true" !== e ? t.addClass("nv-hide-after") : t.removeClass("nv-hide-after") }) } } }); t.nvNotificationIndicator = o }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } function o(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.sliderController = void 0; var i = n(13), a = o(i), s = n(3), l = (r(s), n(1)), c = l.ngMainCommonModule.controller("SliderController", ["$scope", "$log", "$timeout", "$document", "eventAggregator", "COMMON_EVENTS", function(e, t, n, r, o, i) { function s() { c(), u(), o.off(i.WINDOW_RESIZE, e.redrawTicks) } var l = this, c = (t.getInstance("main.common/SliderController"), void 0), u = void 0; l.sliderIndex = l.nvSliderIndex, l.sliderChanged = function() { l.nvSliderIndex = l.sliderIndex, n(function() { l.nvCurrentSliderChanged() }) }, c = e.$watchGroup(["sliderCtrl.nvMaxIndex", "sliderCtrl.nvMinIndex", "sliderCtrl.nvStep"], function(t, n) { (0, a.default)(t) !== (0, a.default)(n) && e.$applyAsync(function() { e.redrawTicks() }) }), u = e.$watch("sliderCtrl.nvSliderIndex", function(e, t) { e !== t && (l.sliderIndex = l.nvSliderIndex) }), r.ready(function() { o.on(i.WINDOW_RESIZE, e.redrawTicks), e.redrawTicks() }), e.$on("$destroy", s) }]); t.sliderController = c }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvSlider = void 0; var o = n(1), i = n(750), a = r(i); n(371); var s = o.ngMainCommonModule.directive("nvSlider", [function() { function e(e, t, n) { function r() { t.empty(), t.remove(), t = null } var o = null, i = null, a = null, s = null, l = {}, c = 0; o = angular.element(t[0].querySelector(".md-track-ticks")), o.find("canvas").css("display", "none"), a = angular.element("").css("position", "absolute"), o.append(a), o.css("display", "block"), o.css("z-index", "0"), i = angular.element(t[0].querySelector(".md-track-container")), e.redrawTicks = function() { if (_.isNull(s) || s.clearRect(0, 0, c, l.height), i) { l = i[0].getBoundingClientRect(), c = l.width < 384 ? 384 : l.width; var t = Math.floor((e.sliderCtrl.nvMaxIndex - e.sliderCtrl.nvMinIndex) / e.sliderCtrl.nvStep); s = a[0].getContext("2d"), a[0].width = c, a[0].height = l.height; for (var n, r = 0; r <= t; r++) n = Math.round(c * (r / t)), s.fillStyle = "#FFFFFF", s.fillRect(n - 1, 0, 2, l.height) } }, e.$on("$destroy", r), t.on("$destroy", function() { e.$destroy() }) } return { restrict: "E", scope: { nvSliderIndex: "=", nvMaxIndex: "=", nvMinIndex: "=", nvStep: "=", nvCurrentSliderChanged: "&", nvIsDisabled: "=" }, bindToController: !0, link: e, template: a.default, controller: "SliderController", controllerAs: "sliderCtrl" } }]); t.nvSlider = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.tileCarouselController = void 0; var r = n(1), o = r.ngMainCommonModule.controller("TileCarouselController", ["$log", "$element", "$scope", "eventAggregator", "COMMON_EVENTS", "TILE_CAROUSEL_EVENTS", function(e, t, n, r, o, i) { function a() { h = Math.floor(y[0].clientWidth / (w + A + E)) || 1, S.info("Carousel will be moving " + h + " tiles") } function s() { b = y[0].getElementsByClassName("nv-carousel-tile"), b.length > 0 ? w = b[0].clientWidth : (S.error('"nv-carousel-tile" class missing from top child elements of carousel container, or specify nv-tile-fixed-width attribute in directive'), f.errorState = !0) } function l() { 0 === g ? f.showLeftCarouselButton = !1 : f.showLeftCarouselButton = !0, g === m ? f.showRightCarouselButton = !1 : f.showRightCarouselButton = !0 } function c() { v += h * (w + A), g = A + E + v, g >= 0 && (g = 0, v = 0), l() } function u() { var e = h * (w + A), t = A + E; v -= e, g = v + t, g < m && (v = m, g = m), l() } function d() { r.off(o.WINDOW_RESIZE, f.carouselDimensionChanged), r.off(i.CAROUSEL_RESIZED, f.carouselDimensionChanged) } var f = this, m = 0, p = 0, g = 0, v = 0, h = 0, y = null, E = 0, b = null, S = e.getInstance("main.common/tileCarouselController"), w = n.nvFixedTileWidth, A = n.nvFixedTileMargin; f.showLeftCarouselButton = !1, f.showRightCarouselButton = !1, f.errorState = !1, f.moveLeft = c, f.moveRight = u, f.translateStyle = function() { return { transform: "translateX(" + g + "px)" } }, f.carouselDimensionChanged = function() { S.info("carousel dimension changed"), _.isUndefined(n.nvTilesToMove) && a(); var e = y[0].clientWidth - p; y[0].clientWidth >= y[0].scrollWidth && e >= 0 ? (m += e, m > 0 && (m = 0), g += e, g > 0 && (g = 0), v += e, v > 0 && (v = 0)) : (m = Math.abs(g) + (y[0].scrollWidth - y[0].clientWidth), m = -m), p = y[0].clientWidth, l() }, f.init = function() { if (y = angular.element(t[0].querySelector(".tile-carousel-container")), y.length) { m = y[0].scrollWidth - y[0].clientWidth, m = -m, p = y[0].clientWidth; var e = y[0].getElementsByClassName("carousel-button"); e.length > 0 ? E = e[0].clientWidth || 45 : (S.error('"carousel-button" class missing. Assuming carousel button width to be 45px.'), E = 45), w || s(), n.nvTilesToMove ? h = n.nvTilesToMove : a(), l() } else S.error('Class "tile-carousel-container" missing'), f.errorState = !0; r.on(o.WINDOW_RESIZE, f.carouselDimensionChanged), r.on(i.CAROUSEL_RESIZED, f.carouselDimensionChanged) }, n.$on("$destroy", d) }]); t.tileCarouselController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvTileCarousel = void 0; var o = n(1), i = n(751), a = r(i); n(373); var s = o.ngMainCommonModule.directive("nvTileCarousel", ["$timeout", function(e) { function t(t, n, r, o) { function i() { o.init() } function a() { n.empty(), n.remove(), n = null } t.$on("$destroy", a), n.on("$destroy", function() { t.$destroy() }), e(i) } return { restrict: "E", scope: { nvFixedTileWidth: "=", nvFixedTileMargin: "=", nvTilesToMove: "=" }, transclude: !0, template: a.default, controller: "TileCarouselController", controllerAs: "tileCarousel", link: t } }]); t.nvTileCarousel = s }, function(e, t, n) { "use strict"; var r = n(1); r.ngMainCommonModule.service("opentracingHttpInterceptor", ["$log", "$q", "tracingService", function(e, t, n) { var r = this, o = e.getInstance("nvTracing/opentracingHttpInterceptor"); o.info("Opentracing Http Interceptor injected"), r.request = function(e) { return n.startHttpSpan(e), e }, r.response = function(e) { return n.closeHttpSpan(e, !1), e }, r.responseError = function(e) { return n.closeHttpSpan(e, !0), t.reject(e) } }]) }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.piiSanityService = void 0; var r = n(1), o = r.ngMainCommonModule.service("piiSanityService", ["$log", "eventAggregator", "COMMON_EVENTS", "jarvisService", "loggingSanityService", function(e, t, n, r, o) { function i() { var e = r.getLoggedInUser(); if (e) { var t = r.getSession(), n = a(e, t); o.setPiiSensitiveValues(n) } } function a(e, t) { return [e.core.birthdate, e.core.displayName, t.sessionToken, t.userToken] } var s = this; e.getInstance("main.common/PiiSanityService"); s.initialize = function() { i(), t.on(n.LOGIN_STATUS_CHANGE, i) }, s.sanitize = o.sanitizeForPii }]); t.piiSanityService = o }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.quietModeService = void 0; var o = n(3), i = r(o), a = n(1); n(11), n(137), n(181); var s = a.ngMainCommonModule.service("quietModeService", ["$log", "quietModeEndpoints", "$q", "socketService", "eventAggregator", "QUIET_MODE_SOCKET_EVENTS", "QUIET_MODE_SERVICE_EVENTS", "QUIET_MODE_EVENTS", "COMMON_EVENTS", "BACKEND_STATE_EVENTS", "QUIET_MODE_2_SOCKET_EVENTS", "QUIET_MODE_2_SERVICE_EVENTS", "quietMode2Endpoints", function(e, t, n, r, o, a, s, l, c, u, d, f, m) { function p(e) { return Y.info("processSupportInfo response:", e), z = e.data, e.data } function g(e) { return Y.info("processStateInfo response:", e), B = e.data, e.data } function v() { var e = n.defer(); if (e.promise.cancel = function() { Y.info("fetchSupportInfo cancelled"), e.reject() }, i.isNull(F)) { z = null; var r = t.support(); F = r.then(p).catch(function(e) { return Y.error("failed to get quietmode support info", e), n.reject(e) }).finally(function() { F = null }) } return F.then(function(t) { return e.resolve(t) }).catch(function(t) { return e.reject(t) }), e.promise } function h() { if (i.isNull(U)) { B = null; var e = t.state(); return U = e.then(g).catch(function(e) { return Y.error("failed to get quietmode state info", e), n.reject(e) }) } return U } function y(e) { return !e && z ? n.when(z) : v() } function E() { return B ? n.when(B) : h() } function b(e) { B && (B.enabled = e) } function S(e) { return t.setState({}, { enabled: e }).then(function(t) { return b(e), o.trigger(l.CHANGED), t }).catch(function(e) { return Y.error("failed quietmode SetState info", e), n.reject(e) }) } function _(e) { Y.info("onSupportInfoUpdate data:", e), p({ data: e }) } function w(e) { Y.info("onStateInfoUpdated data:", e), g({ data: e }), o.trigger(l.STATE_UPDATE) } function A() { Y.info("onLanguageUpdated called"), F = null, B = null, v(), h(), $ = null, W = null, j = null, H = null, x(), M() } function T() { F = null, v(), U = null, h() } function I(e) { return Y.info("process quiet mode 2 SupportInfo response:", e), H = e.data, e.data } function C(e) { Y.info("processQuietMode2StateInfo response:", e); var t = !1; return (j && e && e.data && (j.enabled !== e.data.enabled || j.baseFrameRate !== e.data.baseFrameRate || j.fanVolume != e.data.fanVolume) || !j && e && e.data) && (t = !0), j = e.data, t && (Y.info("WM2 state changed"), o.trigger(l.CHANGED, e.data)), e.data } function x() { var e = n.defer(); if (e.promise.cancel = function() { Y.info("fetchQuietMode2SupportInfo cancelled"), e.reject() }, i.isNull($)) { var t = m.support(); $ = t.then(I).catch(function(e) { return Y.error("failed to get quiet mode 2 support info", e), H = null, n.reject(e) }).finally(function() { $ = null }) } return $.then(function(t) { return e.resolve(t) }).catch(function(t) { return e.reject(t) }), e.promise } function M() { if (i.isNull(W)) { var e = m.state(); W = e.then(C).catch(function(e) { return Y.error("failed to get quite Mode 2 state info", e), j = null, n.reject(e) }).finally(function() { W = null }) } return W } function D(e) { return !e && H ? (Y.info("return cache response for QuietMode2", H), n.when(H)) : (Y.info("Fetched fresh response for quietmode2"), x()) } function O() { return j ? n.when(j) : M() } function R(e) { j && (j.enabled = e.enabled, j.fanVolume = e.fanVolume, j.baseFrameRate = e.baseFrameRate) } function N(e) { return m.setState({}, { enabled: e.enabled, baseFrameRate: e.baseFrameRate, fanVolume: e.fanVolume }).then(function(t) { return R(e), o.trigger(l.CHANGED, e), t }).catch(function(e) { return Y.error("failed quiet mode 2 SettState info", e), n.reject(e) }) } function L(e) { Y.info("onQuietMode2SupportInfoUpdate data:", e), I({ data: e }), o.trigger(l.SUPPORT_UPDATE) } function P(e) { Y.info("onQuietMode2StateInfoUpdated data:", e), C({ data: e }) } function k() { Y.info("refresh quietModeState"), M() } function G() { r.register(a.STATE_UPDATE, s.STATE_UPDATE), r.register(a.SUPPORT_UPDATE, s.SUPPORT_UPDATE), o.on(s.STATE_UPDATE, w), o.on(s.SUPPORT_UPDATE, _), r.register(d.STATE_UPDATE, f.STATE_UPDATE), r.register(d.SUPPORT_UPDATE, f.SUPPORT_UPDATE), o.on(f.STATE_UPDATE, P), o.on(f.SUPPORT_UPDATE, L), o.on(c.LOCALE_CHANGED, A), o.on(u.READY, T), o.on(c.WINDOW_FOCUS, k) } var F = null, U = null, V = this, z = null, B = null, $ = null, W = null, H = null, j = null, Y = e.getInstance("main.common/quietModeService"); V.initialize = G, V.getStateInfo = E, V.getSupportInfo = y, V.setStateInfo = S, V.getQuietMode2StateInfo = O, V.getQuietMode2SupportInfo = D, V.setQuietMode2StateInfo = N }]); t.quietModeService = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.rangeSliderController = void 0; var r = n(1), o = r.ngMainCommonModule.controller("RangeSliderController", ["$scope", "$log", function(e, t) { function n() { e.lowerMax = e.maximum - e.step, e.upperMin = e.lowerValue + e.step, !e.lowerValue || e.lowerValue < e.minimum ? e.lowerValue = e.minimum : e.lowerValue *= 1, !e.upperValue || e.upperValue > e.maximum ? e.upperValue = e.maximum : e.upperValue *= 1, a() } function r() { return e.lowerValue >= e.upperValue - e.step ? void(e.lowerValue = e.upperValue - e.step) : (e.upperMin = e.lowerValue + e.step, void a()) } function o() { e.upperValue <= e.lowerValue + e.step && (e.upperValue = e.lowerValue + e.step) } function i() { l.info("Range slider isDisabled value changed :", e.nvDisabled) } function a() { e.upperWidth = (e.maximum - (e.lowerValue + e.step)) / (e.maximum - e.minimum) * 100 + "%", e.lowerValue > e.upperValue - e.minGap && e.upperValue < e.maximum && (e.upperValue = e.lowerValue + e.minGap) } var s = this, l = t.getInstance("main.common/RangeSliderController"), s = this; s.lowerValue = e.lowerValue, s.upperValue = e.upperValue, s.lowerMax = e.lowerMax, s.upperMin = e.upperMin, s.step = e.step, s.minGap = e.minGap, s.maximum = e.maximum, s.minimum = e.minimum, e.step || (e.step = 2), e.minGap || (e.minGap = e.step), e.$watchGroup(["minimum", "maximum"], n), e.$watch("lowerValue", r), e.$watch("upperValue", o), e.$watch("nvDisabled", i), s.currentSliderPositionChanged = function() { e.onSliderChange() } }]); t.rangeSliderController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvRangeSlider = void 0; var o = n(1), i = n(752), a = r(i); n(378); var s = o.ngMainCommonModule.directive("nvRangeSlider", [function() { return { restrict: "E", scope: { minimum: "=", maximum: "=", minGap: "=", step: "=", nvDisabled: "=", mdDiscrete: "=mdDiscrete", lowerValue: "=lowerValue", upperValue: "=upperValue", onSliderChange: "&" }, template: a.default, controller: "RangeSliderController", controllerAs: "rangeSliderCtrl" } }]); t.nvRangeSlider = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.rigService = void 0; var r = n(1), o = r.ngMainCommonModule.service("rigService", ["$log", "$translate", "$q", "RIG_CONSTANTS", function(e, t, n, r) { function o(e, t) { return Number(Math.round(e + "e" + t) + "e-" + t) } function i(e) { var t, n; try { return _.isString(e) ? (n = e / y / y / y, t = o(n, 2), isNaN(t) ? h : t + " GB RAM") : h } catch (e) { return p.error("failed to format memory", e), h } } function a(e) { var t, n, r; try { return _.isString(e) ? (t = e.split("@"), 2 === t.length && (n = t[0].split("x"), 2 === n.length) ? r = n[0] + " x " + n[1] + ", " + t[1] + "Hz" : h) : h } catch (e) { return p.error("failed to format resolution", e), h } } function s() { var e, t; return v = {}, g ? (v.cpuName = _.isString(g.CPUName) ? g.CPUName : h, v.driverVersion = _.isString(g.DriverVersion) ? d + g.DriverVersion : h, v.totalPhysicalMemory = i(g.TotalPhysicalMemory), v.currentResolution = a(g.CurrentResolution), e = _.isArray(g.GPU) ? g.GPU.length : 0, 0 === e ? v.gpuName = h : 1 === e ? v.gpuName = g.GPU[0].LongGPUName : (t = _.rest(g.GPU), v.gpuName = g.GPU[0].LongGPUName, v.gpuSubItems = _.pluck(t, "LongGPUName")), void p.info("createItems - systemInfo", v)) : (p.info("createItems - hardware info not available"), n.reject()) } function l() { return d ? n.when(d) : f ? f : f = t(["l10n.driverVersion"]).then(function(e) { d = e["l10n.driverVersion"] + " " }) } function c(e, t) { b[t] = e } function u() { return b = [], c({ icon: "icon-gpu", description: v.gpuName, subItems: v.gpuSubItems }, E.GPU), c({ icon: "icon-nvlogo", description: v.driverVersion }, E.DRIVER_VERSION), c({ icon: "icon-memory", description: v.cpuName }, E.CPU), c({ icon: "icon-ram", description: v.totalPhysicalMemory }, E.RAM), c({ icon: "icon-monitor", description: v.currentResolution }, E.RESOLUTION), b } var d, f, m = this, p = e.getInstance("main.common/rigService"), g = null, v = {}, h = "-", y = 1024, E = r.ITEM_POSITION, b = []; m.processSystemInfo = function(e) { return g = e, l().then(s).then(u) } }]).constant("RIG_CONSTANTS", { ITEM_POSITION: { GPU: 0, DRIVER_VERSION: 1, CPU: 2, RAM: 3, RESOLUTION: 4 } }); t.rigService = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvScrollOverlay = void 0; var r = n(1), o = r.ngMainCommonModule.directive("nvScrollOverlay", ["$timeout", function(e) { return { restrict: "A", link: function(t, n, r) { function o() { 0 === n[0].scrollTop ? a.addClass("hidden") : a.removeClass("hidden"), n[0].scrollTop + n[0].clientHeight === n[0].scrollHeight ? s.addClass("hidden") : s.removeClass("hidden") } function i() { n.unbind("scroll", o) } var a = angular.element(''), s = angular.element(''); n.addClass("scroll-overlay"), n.prepend(a), n.append(s), n.bind("scroll", o), t.$on("$destroy", i), e(o) } } }]); t.nvScrollOverlay = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.selectMenuItemController = void 0; var r = n(1); n(16); var o = r.ngMainCommonModule.controller("SelectMenuItemController", ["$scope", "telemetryService", function(e, t) { var n = this; n.action = e.nvAction, n.disabled = e.nvDisabled, n.nvTelemetry = e.nvTelemetry, e.$watch("nvSelectedTest()", function(e) { n.itemStyle = { "font-weight": e ? "bold" : "normal" } }), e.$watch("nvDisabled", function(e) { n.disabled = e }), n.handleClick = function() { if (n.action(), n.nvTelemetry) { var e = JSON.parse(n.nvTelemetry); t.push(e.tarconID, e.url) } } }]); t.selectMenuItemController = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.signPayloadService = void 0; var r = n(1), o = r.ngMainCommonModule.service("signPayloadService", ["$log", "$base64", function(e, t) { var n = (e.getInstance("main.common/signingPayloadService"), this), r = 16, o = 2 * r, i = function(e) { for (var t = new Array(e.length), n = 0; n < e.length; n++) t[n] = e.charCodeAt(n); return t }; n.getBytesFromEncodedString = function(e) { var n = decodeURIComponent(e), r = t.decode(n), o = i(r); return o }, n.convertStringToHexWithWordShift = function(e, t) { for (var n = 0, r = 0; r < t; r++) switch (e[t - 1 - r]) { case "0": n |= 0 << 4 * r; break; case "1": n |= 1 << 4 * r; break; case "2": n |= 2 << 4 * r; break; case "3": n |= 3 << 4 * r; break; case "4": n |= 4 << 4 * r; break; case "5": n |= 5 << 4 * r; break; case "6": n |= 6 << 4 * r; break; case "7": n |= 7 << 4 * r; break; case "8": n |= 8 << 4 * r; break; case "9": n |= 9 << 4 * r; break; case "a": case "A": n |= 10 << 4 * r; break; case "b": case "B": n |= 11 << 4 * r; break; case "c": case "C": n |= 12 << 4 * r; break; case "d": case "D": n |= 13 << 4 * r; break; case "e": case "E": n |= 14 << 4 * r; break; case "f": case "F": n |= 15 << 4 * r } return n }, n.base64FromByteArray = function(e) { for (var t, n, r, o, i, a = "", s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = new Uint8Array(e), c = l.byteLength, u = c % 3, d = c - u, f = 0; f < d; f += 3) i = l[f] << 16 | l[f + 1] << 8 | l[f + 2], t = (16515072 & i) >> 18, n = (258048 & i) >> 12, r = (4032 & i) >> 6, o = 63 & i, a += s[t] + s[n] + s[r] + s[o]; return 1 == u ? (i = l[d], t = (252 & i) >> 2, n = (3 & i) << 4, a += s[t] + s[n] + "==") : 2 == u && (i = l[d] << 8 | l[d + 1], t = (64512 & i) >> 10, n = (1008 & i) >> 4, r = (15 & i) << 2, a += s[t] + s[n] + s[r] + "="), a }, n.buildNonceBytes = function(e) { e.length > o && (e = e.slice(0, o)); var t = e.split(""); if (t.length === o) { for (var i, a = new ArrayBuffer(r), s = new DataView(a, 0), l = 0; l < r; l++) i = n.convertStringToHexWithWordShift(t.slice(2 * l, 2 * l + 2), 2), s.setUint8(r - l - 1, i); var c = new Uint8Array(a, 0); return n.nonce = Array.prototype.slice.call(c), n.nonce } return null }, n.getHexStringFromBytes = function(e) { for (var t = "", n = "00", r = 0; r < e.length; r++) t += (n + e[r].toString(16)).slice(-2); return t }, n.buildProgramId = function(e, t) { var n = e.split(".").join("") + t.split(".").join(""), r = "00000000", o = n.length > 8 ? n.substring(0, 8) : (r + n).slice(-8); return parseInt(o, 16) }, n.formatHashedEcid = function(e) { var t = n.getHexStringFromBytes(e).replace("-", "").toLowerCase(); return encodeURIComponent(n.base64FromByteArray(i(t))) }, n.formatSignedPaylod = function(e) { return encodeURIComponent(n.base64FromByteArray(e)) }, n.formatPayloadRequest = function(e) { if (e.key) { var t = n.getBytesFromEncodedString(e.key), r = n.buildProgramId(e.clientVersion, e.driverVersion), i = n.buildNonceBytes(e.nonce.length > o ? e.nonce.substring(0, o) : e.nonce); return { algorithm: e.signAlgo, nonce: i, programId: r, key: t, sessionId: 0 } } return null }, n.formatSignedPayload = function(e) { var t = "00000000", r = (t + e.deviceInfo.chipId.toString(16)).slice(-4), o = (t + e.deviceInfo.revisionId.toString(16)).slice(-4); return { deviceChipsetId: r, deviceRevision: o, hashedEcid: n.formatHashedEcid(e.ecidSha2Hash), signedPayload: n.formatSignedPaylod(e.data), ucodeVersion: (t + e.uCodeVersion.toString()).slice(-8) } } }]); t.signPayloadService = o }, , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.systemClockService = void 0; var r = n(1), o = r.ngMainCommonModule.service("systemClockService", ["$interval", "eventAggregator", "COMMON_EVENTS", function(e, t, n) { function r() { t.trigger(n.SYSTEM_TIME_UPDATED, new Date) } var o = this, i = 0, a = null, s = 1e3; o.subscribeClockUpdates = function() { i += 1, a || (a = e(r, s)) }, o.unsubscribeClockUpdates = function() { i -= 1, i <= 0 && (i = 0, e.cancel(a), a = null) } }]); t.systemClockService = o }, , function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.tracingService = void 0; var o = n(122), i = r(o), a = n(13), s = r(a), l = n(315), c = r(l), u = n(1), d = n(968), f = r(d), m = u.ngMainCommonModule.provider("tracingService", function() { return { $get: ["$log", "$q", "nvAngularUuidService", "TRACING_CONSTANTS", "TRACING_TAG_NAMES", "$window", function(e, t, n, r, o, a) { function l(e) { return a.btoa(a.unescape(a.encodeURIComponent(e))) } var u = {}, d = {}, m = {}, p = {}, g = this, v = void 0; e.getInstance("nvTracing/tracingService"); g.initialized = !1; var h = function(e, t) { e && f.default.initGlobalTracer(e), v = t || {}, v.sessionId = n.generateUUID(), g.initialized = !0 }, y = function(e, t) { var r = void 0, o = void 0, i = void 0; if (g.initialized && e) { i = n.generateUUID(), t && (o = u[t]), r = o ? f.default.globalTracer().startSpan(e, { childOf: o }) : f.default.globalTracer().startSpan(e), u[i] = r; for (var a in v) S(i, a, v[a]) } return i }, E = function(e, t, n) { if (g.initialized && e) { var r = u[e]; r && (r.setTag("error", n), t && (r.setTag("http.status_code", t.status), t.config && (r.setTag("http.url", t.config.url), r.setTag("http.method", t.config.method))), r.finish(), delete u[e]) } }, b = function(e) { return void 0 !== u[e] }, S = function(e, t, n) { if (g.initialized && e) { var r = u[e]; r && r.setTag(t, n) } }, w = function(e, n, r, o) { if (g.initialized && n) { var i = y(n, r); return e(i).then(function(e) { var t = A(e, o); return O(i, t), E(i, !0), e }).catch(function(e) { var n = A(e, o); return O(i, n), E(i, !1), t.reject(e) }) } return e() }, A = function(e, t) { var n = {}; if (g.initialized && e && t) { var r = e, o = !0, i = !1, a = void 0; try { for (var l, u = (0, c.default)(t); !(o = (l = u.next()).done); o = !0) { var d = l.value; if ("." === d) _.isObject(e) && (r = (0, s.default)(e)), n.data = r; else { var f = d.split("."), m = !0, p = !1, v = void 0; try { for (var h, y = (0, c.default)(f); !(m = (h = y.next()).done); m = !0) { var E = h.value; if (r = r[E], !r) break } } catch (e) { p = !0, v = e } finally { try { !m && y.return && y.return() } finally { if (p) throw v } } r && (_.isObject(r) && (r = (0, s.default)(r)), n[d] = r) } } } catch (e) { i = !0, a = e } finally { try { !o && u.return && u.return() } finally { if (i) throw a } } } return n }, T = function(e, t) { if (g.initialized && e) { var n = u[e]; if (n) { var r = {}; f.default.globalTracer().inject(n.context(), f.default.FORMAT_HTTP_HEADERS, r); var o = (0, i.default)(r), a = !0, s = !1, l = void 0; try { for (var d, m = (0, c.default)(o); !(a = (d = m.next()).done); a = !0) { var p = d.value; t[p] = r[p] } } catch (e) { s = !0, l = e } finally { try { !a && m.return && m.return() } finally { if (s) throw l } } } } }, I = function(e, t, n) { g.initialized && e && (d[e] || (t ? d[e] = t : d[e] = function() {}), n && _.isArray(n) && !m[e] && (m[e] = n)) }, C = function(e, t) { if (g.initialized && e && e.url) { var i = void 0, a = void 0, u = void 0, f = void 0, m = void 0; if (e.url.startsWith("http") && (f = new URL(e.url), m = f.searchParams), f) { var v = e.data, h = void 0; v && (a = v[r.PARENT_SPAN_IDENTIFIER], v[r.COMPONENT_NAME] && (u = v[r.COMPONENT_NAME], i = y(u, a), delete v[r.COMPONENT_NAME]), delete v[r.PARENT_SPAN_IDENTIFIER]), !i && m && (a || (a = m.get(r.PARENT_SPAN_IDENTIFIER)), m.get(r.COMPONENT_NAME) && !u && (u = m.get(r.COMPONENT_NAME), i = y(u, a), m.delete(r.COMPONENT_NAME)), m.delete(r.PARENT_SPAN_IDENTIFIER), (a || u) && (e.url = f.origin + f.pathname + "?" + m.toString())); var E = d[f.origin] || d[f.host]; if (f.origin && (E || a)) { if (!i) { var b = R(f.origin, f.pathname.split("/")); i = y(b, a) } E && D(i, E) } if (i && m) { var w = m.entries(), A = "", I = !0, C = !1, x = void 0; try { for (var M, O = (0, c.default)(w); !(I = (M = O.next()).done); I = !0) { var N = M.value; A = "params." + N[0], S(i, A, N[1]) } } catch (e) { C = !0, x = e } finally { try { !I && O.return && O.return() } finally { if (C) throw x } } e.url = f.origin + f.pathname, m.toString().length > 0 && (e.url += "?" + m.toString()) } if (i && (S(i, o.ORIGIN, f.origin), S(i, o.PATH, f.pathname)), t) { var L = []; if (i) { T(i, L), f = new URL(e.url), m = f.searchParams; var P = (0, s.default)(_.extend({}, L)); e.url = f.origin + f.pathname + "?tracer=" + l(P), m.toString().length > 0 && (e.url = e.url + "&" + m.toString()), e.spanId = i } } else i && e.headers && (e.headers[r.X_REQUEST_ID] ? h = e.headers[r.X_REQUEST_ID] : (h = n.generateUUID(), e.headers[r.X_REQUEST_ID] = h), p[h] = i, T(i, e.headers)) } } }, x = function(e, t, n) { if (g.initialized && e) { var r = u[e]; r && (r.setTag("error", t), n && (r.setTag("http.error_code", n.errorCode), r.setTag("http.error_text", n.errorText), r.setTag("http.url", n.failedUrl)), r.finish(), delete u[e]) } }, M = function(e, t) { var n = void 0; if (g.initialized && e && e.config && e.config.headers && (n = e.config.headers[r.X_REQUEST_ID])) { var o = p[n]; if (o && e.config && e.config.url) { var i = new URL(e.config.url), a = i.origin, s = m[a]; if (s) { var l = e.headers(); if (l) { var u = !0, d = !1, f = void 0; try { for (var v, h = (0, c.default)(s); !(u = (v = h.next()).done); u = !0) { var y = v.value, b = l[y]; S(o, y, b) } } catch (e) { d = !0, f = e } finally { try { !u && h.return && h.return() } finally { if (d) throw f } } } } E(o, e, t), delete p[n] } } }, D = function(e, n) { g.initialized && n && t.when(n()).then(function(t) { O(e, t) }) }, O = function(e, t) { if (g.initialized && t) for (var n in t) { var r = t[n]; S(e, n, r) } }, R = function(e, t) { var n = void 0; if (0 === t.length) n = e; else { var r = t.length; n = 1 === r ? t[r - 1] : t[r - 2] + "/" + t[r - 1] } return n }; return { init: h, startSpan: y, closeSpan: E, trackPromise: w, startHttpSpan: C, closeHttpSpan: M, closePopUpHttpSpan: x, setTag: S, setTags: O, injectSpan: T, registerUrlForTracing: I, isSpanAvailable: b } }] } }); t.tracingService = m }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.videoController = void 0; var o = n(3), i = r(o), a = n(1), s = a.ngMainCommonModule.controller("VideoController", ["$scope", "$window", "$document", "$interval", "$filter", "$sce", "VIDEO_TYPE", "YOUTUBE_PLAYER_STATE", "$mdToast", "MEDIA_NETWORK_STATE", "$log", function(e, t, n, r, o, a, s, l, c, u, d) { function f(e) { var t = /youtu\.be\/(.*)/g, n = t.exec(e); return n[1] } function m() { v.totalDuration = 0; var e = 0; v.totalDuration = o("date")(1e3 * v.media[0].duration, "mm:ss", "UTC"), r(function() { if (e !== v.sliderPosition) { var t = v.sliderPosition * v.media[0].duration / 100; return v.currentVideoTime = o("date")(1e3 * t, "mm:ss", "UTC") + " / " + v.totalDuration, v.media[0].currentTime = t, void(e = v.sliderPosition) } v.media[0].paused && v.media[0].currentTime !== v.media[0].duration || (v.currentVideoTime = o("date")(1e3 * v.media[0].currentTime, "mm:ss", "UTC") + " / " + v.totalDuration, v.sliderPosition = e = Math.floor(v.media[0].currentTime / v.media[0].duration * 100)) }, 1e3) } function p() { h = new t.YT.Player("ytPlayer", { events: { onReady: v.onYTPlayerReady() } }) } function g() { var e = n[0].getElementsByTagName("script"), t = "https://www.youtube.com/iframe_api"; if (i.find(e, function(e) { return e.getAttribute("src") === t })) p(); else { var r = n[0].createElement("script"); r.src = t; var o = n[0].getElementsByTagName("script")[0]; o.parentNode.insertBefore(r, o) } } var v = this; v.showOverlay = !1, v.currentVideoTime = "00:00 / 00:00", v.sliderPosition = 0, v.videoLoaded = !1, v.directiveElement = null, v.media = null, v.totalDuration = 0, v.nvSrc = e.nvSrc, v.nvVideoLoaded = e.nvVideoLoaded, v.nvVideoType = e.nvVideoType, v.nvVideoClose = e.nvVideoClose, v.nvDefaultVideoControl = e.nvDefaultVideoControl, v.youtubePlayer = null, v.videoWaiting = !0; var h = null, y = d.getInstance("main.common/VideoController"); v.formatVideoSource = function() { v.nvSrc ? (v.nvVideoType === s.YOUTUBE && (v.nvSrc = "https://www.youtube.com/embed/" + f(v.nvSrc) + "?wmode=transparent&controls=1&showinfo=0&autoplay=1"), v.nvSrc = a.trustAsResourceUrl(v.nvSrc)) : (y.error("Video source is null"), v.nvVideoClose && v.nvVideoClose()) }, v.formatVideoSource(), v.isVideoTypeYoutube = function() { return v.nvVideoType === s.YOUTUBE }, v.showDefaultOverlay = function() { return v.isVideoTypeYoutube() || "true" === v.nvDefaultVideoControl }, v.setShowOverlay = function(e) { v.showOverlay = e }, v.toggleMediaPlay = function() { v.nvVideoType === s.YOUTUBE ? v.youtubePlayer && (v.youtubePlayer.getPlayerState() === l.PAUSED ? v.youtubePlayer.playVideo() : v.youtubePlayer.pauseVideo()) : v.media && (v.media[0].paused ? v.media[0].play() : v.media[0].pause()) }, v.showPlaybutton = function() { return !!v.media && v.media[0].paused }, v.muted = function() { return !!v.media && v.media[0].muted }, v.muteUnmute = function() { v.media && (v.media[0].muted = !v.media[0].muted) }, v.onYTPlayerReady = function() { v.videoWaiting = !1, v.videoLoaded = !0, v.youtubePlayer = h, v.nvVideoLoaded && v.nvVideoLoaded({ value: !0 }) }, t.onYouTubeIframeAPIReady = function() { p() }, n.ready(function() { function t() { e.$apply(function() { v.videoWaiting = !1 }) } function r() { e.$apply(function() { v.videoWaiting = !0 }) } if (v.nvVideoType === s.YOUTUBE) return void g(); null === v.directiveElement && (v.directiveElement = angular.element(n[0].querySelector(".common-video-directive")), v.media = v.directiveElement.find("video"), v.media && "true" === v.nvDefaultVideoControl && v.media.attr("controls", !0)); var i = "error"; v.media.bind(i, function(e) { var t = o("translate")("l10n.mediaerror.generic"); if (e.target.error) switch (e.target.error.code) { case e.target.error.MEDIA_ERR_ABORTED: t = o("translate")("l10n.mediaerror.aborted"); break; case e.target.error.MEDIA_ERR_NETWORK: t = o("translate")("l10n.mediaerror.network"); break; case e.target.error.MEDIA_ERR_DECODE: t = o("translate")("l10n.mediaerror.decode"); break; case e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED: t = o("translate")("l10n.mediaerror.notsupported") } var n = c.simple().content(t).highlightAction(!0).hideDelay(3e3).capsule("true").position("top center"); c.show(n), v.nvVideoClose && v.nvVideoClose() }); var a = "loadedmetadata"; v.media.bind(a, function() { e.$apply(function() { v.videoLoaded = !0 }), v.nvVideoLoaded && v.nvVideoLoaded({ value: !0 }), m() }); var l = "progress"; v.media.bind(l, function(e) { e.target.networkState === u.NETWORK_LOADING && e.target.buffered.length > 0 && e.target.played.length > 0 && e.target.buffered.end(0) <= e.target.played.end(0) + .5 ? v.videoWaiting = !0 : v.videoWaiting = !1 }), v.media.bind("canplay", function() { t() }), v.media.bind("playing", function() { t() }), v.media.bind("waiting", function() { r() }), v.media.bind("stalled", function() { r() }), e.$apply() }) }]); t.videoController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvVideo = void 0; var o = n(1), i = n(756), a = r(i); n(388), n(17); var s = o.ngMainCommonModule.directive("nvVideo", function() { return { restrict: "E", transclude: !0, scope: { nvSrc: "@", nvVideoType: "@", nvVideoLoaded: "&", nvVideoClose: "&", nvDefaultVideoControl: "@" }, template: a.default, controller: "VideoController", controllerAs: "videoCtrl" } }); t.nvVideo = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.virtualGridListController = void 0; var r = n(1), o = r.ngMainCommonModule.controller("VirtualGridListController", ["$element", "$scope", "eventAggregator", "COMMON_EVENTS", function(e, t, n, r) { function o() { return e[0].offsetWidth } function i(e, t) { var n = e || 1; return Math.floor(t / n) } function a(e, t) { var n = e || 1; return Math.ceil(t / n) } function s(e, t, n) { v[e] || (v[e] = []); var r, o, i = v[e]; for (i.length = 0, r = 0; r < t; r++) { if (o = e * t + r, o >= n.getLength()) return i; i.push(n.getItemAtIndex(o)) } return i } function l(e) { var t, n; if (e > v.length) for (n = e - v.length, t = 0; t < n; t++) v.push([]); v.length = e, v[v.length - 1] = [] } function c(e, n) { var r, o, i = a(n, e.getLength()); for (l(i), t.nvVirtualGridListItems = v, r = 0; r < i; r++) o = s(r, n, e), t.nvVirtualGridListItems[r] = o } function u(e, n) { var r = a(n, e.getLength()); l(r), t.nvVirtualGridListItems = { getLength: function() { return r }, getItemAtIndex: function(t) { return s(t, n, e) } } } function d(e) { var t = !1; e.columnCount && e.columnCount !== g.columnCount && (g.columnCount = e.columnCount, t = !0), e.itemWidth && e.itemWidth !== g.itemWidth && (g.itemWidth = e.itemWidth), e.list && e.list !== g.list && (g.list = e.list, "[object Array]" === Object.prototype.toString.call(g.list) && (g.list = { getLength: function() { return e.list.length }, getItemAtIndex: function(t) { return e.list[t] } }), t = !0), g.list.getLength() != g.listLength && (g.listLength = g.list.getLength(), t = !0); var n = i(g.itemWidth, o()); n !== g.columnCount && (g.columnCount = n, t = !0), t && this.refreshFn(g.list, g.columnCount) } function f() { n.on(r.WINDOW_RESIZE, p) } function m() { n.off(r.WINDOW_RESIZE, p) } var p, g = { list: { getLength: function() { return 0 }, getItemAtIndex: angular.noop }, columnCount: 0, itemWidth: 0, listLength: 0 }, v = []; t.nvVirtualGridListItems = { getLength: function() { return 0 }, getItemAtIndex: function(e) { return null } }, this.initialize = function(e) { this.refresh = d.bind({ refreshFn: e ? u : c }) }, this.refresh = angular.noop, this.resize = function(e) { var n = i(g.itemWidth, o()); n !== g.columnCount && this.refresh({ columnCount: n }), t.$apply() }, this.getRowCount = function() { return a(g.columnCount, g.list.getLength()) }, p = this.resize.bind(this), t.$on("$destroy", m), f() }]); t.virtualGridListController = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvVirtualGridListItem = t.nvVirtualGridListRepeat = t.nvVirtualGridList = void 0; var r = n(1); n(390); var o = r.ngMainCommonModule.directive("nvVirtualGridList", function() { return { restrict: "E", template: function(e) { return e[0].innerHTML }, controller: "VirtualGridListController" } }), i = r.ngMainCommonModule.directive("nvVirtualGridListRepeat", ["$document", "_", "$compile", function(e, t, n) { function r(e) { var t, n, r, o, i; if (t = e.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/), !t) throw new Error('Expected expression in form of "_item_ in _collection_[ track by _id_]" but got {0}', e); return n = t[1], r = t[2], o = t[3], i = t[4], { key: n, collection: r, aliasAs: o, trackBy: i } } function o(t, n, o, i) { var a = r(n.attr("nv-virtual-grid-list-repeat")), c = i, u = void 0 !== n.attr("nv-on-demand"), d = parseInt(s) + parseInt(l); e.ready(function() { var e = n[0].offsetWidth, r = Math.floor(e / d); c.initialize(u), c.refresh({ list: t.$eval(a.collection), itemWidth: d, columnCount: r }), t.$watchCollection(function() { return t.$eval(a.collection) }, function(e, n) { e && c.refresh({ list: t.$eval(a.collection) }) }) }) } function i(e, t, n, r) { var o = getComputedStyle(t[0]); s = o["max-width"], l = o["margin-right"], t.removeAttr("style"), t.removeAttr("class") } function a(e) { var t, n, o = r(e.attr("nv-virtual-grid-list-repeat")), i = void 0 !== e.attr("nv-on-demand"), a = e[0].outerHTML, s = e.attr("nv-repeat-item-class"), l = "", c = e.attr("nv-top-index"), u = ""; return t = o.key + " in row", o.aliasAs && (t += " alias as " + o.aliasAs), o.trackBy && (t += " track by " + o.trackBy), i && (l = "md-on-demand"), c && (u = 'md-top-index="' + c + '"'), a = a.replace(/nv-virtual-grid-list-repeat=["'].*?['"]/g, ""), n = '
' + a + "
" } var s = null, l = null; return { restrict: "A", require: "^nvVirtualGridList", replace: !0, template: a, compile: function(e, t) { return { pre: i, post: o } } } }]), a = r.ngMainCommonModule.directive("nvVirtualGridListItem", [function() { return { restrict: "E" } }]); t.nvVirtualGridList = o, t.nvVirtualGridListRepeat = i, t.nvVirtualGridListItem = a }, , , , , , function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.homeController = void 0; var o = n(3), i = r(o); n(12), n(37), n(11); var a = angular.module("main").controller("HomeController", ["jarvisService", "dbCacheService", "DB_NAMES", "eventAggregator", "COMMON_GAME_EVENTS", "$scope", "toastService", function(e, t, n, r, o, a, s) { function l(e) { u.synchedViewState.classicViewEnabled = e === !0, u.synchedViewState.persist_() } function c(e) { u.viewState.selectedGameId = e, u.viewState.persist_() } var u = this; u.user = e.getLoggedInUser(); var d = i.debounce(l, 500, !0); r.on(o.SELECTED_GAME_CHANGED, c), r.on(o.GAME_VIEW_CHANGED, d), a.$on("$destroy", function() { s.isOpen() && s.cancel(), r.off(o.SELECTED_GAME_CHANGED, c), r.off(o.GAME_VIEW_CHANGED, d) }), u.viewState = t.getCachedUserItem(u.user.userId, n.VIEW_STORE, n.VIEW_STATE), u.synchedViewState = t.getCachedUserItem(u.user.userId, n.JARVIS_GFE_STORE, n.JARVIS_VIEW_STATE), u.unselectSelectedGame = function(e) { r.trigger(o.SELECTED_GAME_CHANGED, null), e.stopPropagation() } }]); t.homeController = a }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvHome = void 0, n(470), n(463); var o = n(760), i = r(o); n(397); var a = angular.module("main").directive("nvHome", function() { return { restrict: "E", scope: {}, template: i.default, controller: "HomeController", controllerAs: "homeCtrl", link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvHome = a }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.mainController = void 0, n(76); var o = n(311), i = r(o), a = n(312), s = r(a), l = n(967), c = r(l), u = angular.module("main").controller("MainController", ["$log", "$templateCache", "cefService", "gfeUpdatesEndpoints", "eventAggregator", "GFE_SOCK_MESSAGE", "WINDOW_STYLES", "preferencesFeatureService", "FEATURE_CRITERIA", "stateService", "COMMON_EVENTS", "jarvisService", "updatesService", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_UI_PROGRESS_NAMES", "TELEMETRY_SCREENS", "TELEMETRY_ACTIONS", "$filter", function(e, t, n, r, o, a, l, u, d, f, m, p, g, v, h, y, E, b, S) { function _() { var e = p.getLoggedInUser(); e ? g.getInstalledDriver().then(function(e) { u.getUnsupportedFeatures(d.DRIVER).then(function(e) { x.driverUpdateRequired = e.length > 0, x.driverUpdateRequired && (x.driverUpdateText = w(e)) }) }) : x.driverUpdateRequired = !1 } function w(e) { var t = e.length; e = S("orderBy")(e, function(e) { return e.id }); var n = A(c.default.toWords(t)), r = "l10n.criticalUpdateForFeatures" + n, o = {}; return e.forEach(function(e, t) { var n = "feature" + A(c.default.toWords(t + 1)); o[n] = e.header }), S("translate")(r, o) } function A(e) { return e.charAt(0).toUpperCase() + e.substr(1) } function T() { x.newVersionAvailable = !1, x.driverUpdateRequired = !1, o.on(a.NEW_VERSION_AVAIL, function(e) { x.downloadInfo = e, x.newVersionAvailable = !0 }), t.put("tour-step-popup.html", i.default), t.put("tour-step-template.html", s.default), _(), o.on(m.LOGIN_STATUS_CHANGE, _), o.on(m.UNSUPPORTED_FEATURES_UPDATED, _), o.on(m.UPDATE_DRIVER_FROM_PREFERENCES, C) } function I(e) { v.push(h.DOWNLOAD_LATEST_DRIVER_UPDATE, { name: y.LATEST_DRIVER_UPDATE, currentScreen: E.SCREEN_MAIN_TOOLBAR, action: e }) } function C() { f.gotoDriversTab({ startDriverDownload: !0 }), x.driverUpdateRequired = !1 } var x = this, M = e.getInstance("main/MainController"); x.isWindowsOS = function() { return n.getWindowStyle() === l.WINDOWS }, x.install = function() { r.startInstall("", x.downloadInfo.downloadedLocation).then(function() { n.windowClose() }).catch(function(e) { M.error("install trigger from main failed " + e) }) }, x.showTopToolbar = function() { return x.newVersionAvailable || x.driverUpdateRequired }, x.resetDriverUpdateRequired = function() { I(b.LATER), x.driverUpdateRequired = !1 }, x.onClickUpdateDriver = function() { I(b.DOWNLOAD), C() }, T() }]); t.mainController = u }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvMainTabButton = void 0; var o = n(761), i = r(o), a = angular.module("main").directive("nvMainTabButton", ["$state", function(e) { return { restrict: "E", scope: { nvMdIcon: "@", nvLabel: "@", nvState: "@", nvParam: "=", nvDisabled: "@" }, template: i.default, link: function(t, n, r) { function o() { i.addClass(s), a.addClass(s) } var i = angular.element(n.find("md-icon")), a = angular.element(n.find("span")), s = "md-accent foreground"; t.$on("$stateChangeSuccess", function(e, n, r, l, c) { n.name.indexOf(t.nvState) > -1 && "true" !== t.nvDisabled ? o() : (i.removeClass(s), a.removeClass(s)) }), e.current.name.indexOf(t.nvState) > -1 && "true" !== t.nvDisabled && o(), n.bind("click", function(n) { "true" !== t.nvDisabled && e.go(t.nvState, t.nvParam) }) } } }]); t.nvMainTabButton = a }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvMainTabIcon = void 0; var o = n(762), i = r(o); n(29); var a = angular.module("main").directive("nvMainTabIcon", ["$state", "$log", function(e, t) { t.getInstance("main/mainTabIcon"); return { restrict: "E", scope: { nvMdIcon: "@", nvState: "@", nvToolTip: "@", nvParam: "=", nvDisabled: "@", nvCustomIcon: "@", nvTabIconClicked: "&", nvChangeIconColorGreen: "@", nvShareAddonLoaded: "=" }, template: i.default, link: function(t, n, r) { function o() { i.addClass(a) } var i = angular.element(n.find("md-icon")), a = "md-accent foreground", s = { opacity: "0.9" }, l = { opacity: "0.75" }, c = { opacity: "1" }, u = { opacity: "0.4" }, d = { color: "#76b900" }, f = { color: "" }; t.$on("$stateChangeSuccess", function(e, n, r, s, l) { n.name.indexOf(t.nvState) > -1 && "true" !== t.nvDisabled ? o() : i.removeClass(a) }), e.current.name.indexOf(t.nvState) > -1 && "true" !== t.nvDisabled && o(), t.$watch("nvDisabled", function(e, n) { _.isUndefined(t.nvState) && "true" === e ? i.css(u) : _.isUndefined(t.nvState) && e !== n && "false" === e && i.css(l) }), n.bind("click", function(n) { e.current.name.indexOf(t.nvState) === -1 && "true" !== t.nvDisabled && (_.isUndefined(t.nvState) ? ("true" === t.nvShareAddonLoaded && i.css(d), i.css(c), t.nvTabIconClicked()) : e.go(t.nvState, t.nvParam)) }), n.bind("mouseenter", function(e) { _.isUndefined(t.nvState) && "true" !== t.nvDisabled && i.css(s) }), n.bind("mouseleave", function(e) { _.isUndefined(t.nvState) && "true" !== t.nvDisabled && i.css(l) }), t.$watch("nvChangeIconColorGreen", function(e, t) { "true" === e ? i.css(d) : i.css(f) }) } } }]); t.nvMainTabIcon = a }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } n(12), n(11), n(26), n(22), n(164), n(29); var o = n(239); r(o); n(228), n(120), n(186), n(55), n(207), n(290), n(121); angular.module("main").controller("MainToolbarController", ["$scope", "jarvisService", "gfeService", "CHECK_FOR_UPDATE", "eventAggregator", "COMMON_EVENTS", "dbCacheService", "DB_NAMES", "$log", "hardwareService", "preferencesService", "toastService", "$filter", "socketService", "SHARE_SOCKET_EVENTS", "$document", "$timeout", "REWARDS_EVENTS", "$state", "COMMON_HTTP_ERROR_CODES", "PREFERENCES_EVENTS", "DEFAULT_AVATAR", "rewardsService", "gfeSearchService", "cevoToggleService", "cevoService", "preferencesFeatureService", "FEATURES_NAME", "USER_PROFILE_TAB_NAMES", "productTourService", "gfeTargetService", "ACTIVE_EXPERIMENTS", "$q", "COMMON_DEFAULT_STATES", "TELEMETRY_API_SUB_USECASES", function(e, t, n, r, o, i, a, s, l, c, u, d, f, m, p, g, v, h, y, E, b, S, w, A, T, I, C, x, M, D, O, R, N, L, P) { function k() { var e = t.getLoggedInUser(); e ? (J.displayName = e.core.displayName, J.profileXP = "─ ─", J.profileTokens = "─ ─", T.getAvatarStore().then(function(t) { J.avatar = a.getCachedUserItem(e.userId, t.storeName, t.key) })) : (J.displayName = null, J.avatar = { url: S.URL }), v(function() { var e = angular.element(g[0].querySelector(".md-toolbar-tools")), t = angular.element(e[0].querySelector(".display-name")); J.showTooltip = t[0].scrollWidth > t[0].offsetWidth }) } function G() { u.isShareFeatureSupportedOnSystem().then(function(e) { J.isShareSupported = e, J.isShareSupported && (J.shareLoaded = u.shareAddonLoaded), re.info("isShareFeatureSupportedOnSystem response: ", J.isShareSupported), o.trigger(i.SHARE_ICON_VIZ_UPDATED, !!J.isShareSupported), F() }).catch(function(e) { re.error("isShareFeatureSupported failed.") }) } function F() { C.isDriverUpdateRequiredForSupport(x.SHARE).then(function(e) { ne = e, o.trigger(i.SHARE_ICON_VIZ_UPDATED, !!ne) }) } function U() { u.getShareRunningStatus().then(function(e) { J.isShareRunning = e }).catch(function(e) { J.isShareRunning = !1, J.isShareButtonDisabled = !1, re.error("getShareRunningStatus failed.") }) } function V(e) { re.info("onSysInfoUpdated ", e.DriverVersion), J.gpuDriverVersion = e.DriverVersion, J.driverless = e && (!e.DriverVersion || "" === e.DriverVersion), G() } function z() { d.showError({ textContent: f("translate")("l10n.openShareFailure") }) } function B(e) { J.isShareButtonDisabled = e, U() } function $(e) { ee = e, re.info("Setting rewards feature enabled to: ", ee) } function W(e) { J.shareLoaded = JSON.parse(e.shareAddonLoaded), re.info("Share node addon loaded event status: ", J.shareLoaded) } function H() { A.checkSearchAvailability().then(function(e) { J.searchEnabled = e }) } function j(e) { J.userProfileEnabled = e, J.userProfileEnabled && t.getLoggedInUser() ? (J.dropdownCollapseTimeout = oe, I.getExtendedProfile().then(function(e) { J.profileXP = e.xp, J.profileTokens = e.rewardTokens, J.levelIcon = I.getLevelDetails(e.xplevel.level).icon })) : J.dropdownCollapseTimeout = 0 } function Y() { o.on(b.NODE_ADDONS_FETCHED, W), o.on(i.LOGIN_STATUS_CHANGE, k), o.on(i.SYSTEMINFO_UPDATED, V), o.on(i.SHARE_STATUS_CHANGE_IN_PROGRESS, B), o.on(i.OSC_READY, K), o.on(h.FEATURE_STATUS_UPDATED, $), o.on(i.LOCALE_CHANGED, H), o.on(i.USER_PROFILE_STATUS_UPDATED, j), o.on(i.UNSUPPORTED_FEATURES_UPDATED, F), o.on(i.ONLINE, G), m.register(p.OSCREADY_UPDATE, i.OSC_READY), J.logout = n.logout, J.checkforUpdate = { updateState: r }, J.devFeatures = a.getCachedGlobalItem(s.DEV_STORE, s.DEV_FEATURES), k(), G(), U(), H() } function q() { J.isShareButtonClicked = !1, o.trigger(i.SHARE_OPEN_IN_PROGRESS, J.isShareButtonClicked), u.showOnscreenOverlay(!0).then(function(e) { re.info("showOnscreenOverlay status: ", e), d.cancel(), J.isShareButtonDisabled = !1 }).catch(function(e) { re.error("showOnscreenOverlay failed."), z(), J.isShareButtonDisabled = !1 }) } function K(e) { J.isShareButtonDisabled = !1, J.isShareRunning = !0, J.isShareButtonClicked && (re.info("socket event OSCREADY_UPDATE", e), e.ready ? q() : (re.info("OSC is not ready."), z())) } function Q(e) { d.showError({ textContent: f("translate")(e), button: { text: f("translate")("l10n.learnMore"), action: w.openLearnMoreWindow } }) } function Z() { J.userProfileEnabled ? J.displayUserProfile(M.REWARDS_TAB) : y.go(L.REWARDS) } function X() { o.off(b.NODE_ADDONS_FETCHED, W), o.off(i.LOGIN_STATUS_CHANGE, k), o.off(i.SYSTEMINFO_UPDATED, V), o.off(i.OSC_READY, K), o.off(i.SHARE_STATUS_CHANGE_IN_PROGRESS, B), o.off(h.FEATURE_STATUS_UPDATED, $), o.off(i.LOCALE_CHANGED, H), o.off(i.USER_PROFILE_STATUS_UPDATED, j), o.off(i.ONLINE, G) } var J = this, ee = !1, te = null, ne = !1; J.driverless = !1, J.isShareSupported = !0, J.isShareButtonClicked = !0, J.isShareButtonDisabled = !1, J.isShareRunning = !1, J.showTooltip = !1, J.shareLoaded = !1, J.defaultAvatarUrl = S.URL, J.userProfileEnabled = !1, J.dropdownCollapseTimeout = 0, J.gpuDriverVersion = ""; var re = l.getInstance("main/MainToolbarController"), oe = 500; c.getLaunchTimeSystemInfo().then(function(e) { J.driverless = e && (!e.DriverVersion || "" === e.DriverVersion), re.info("driverless:", J.driverless) }).catch(function(e) { re.error("failed to get systemInfo") }), J.canShowShareIcon = function() { return J.isShareSupported || ne }, J.displayUserProfile = I.gotoUserProfile, J.enableAndLaunchShare = function() { ne ? C.showDriverUpdateToast() : (J.isShareButtonClicked = !0, J.isShareButtonDisabled = !0, o.trigger(i.SHARE_OPEN_IN_PROGRESS, J.isShareButtonClicked), u.getShareRunningStatus().then(function(e) { re.info("getShareRunningStatus returned: ", e), e ? (d.show({ textContent: f("translate")("l10n.launchingShareToast"), showProgressIndicator: !0, hideDelay: 2e3 }), q()) : u.toggleShareState(!0).then(function(e) { re.info("Enabling Share, toggleShareState status: ", e), d.show({ textContent: f("translate")("l10n.launchingShareToast"), showProgressIndicator: !0, hideDelay: 2e3 }), o.trigger(i.SHARE_STATUS_CHANGED) }).catch(function(e) { re.error("toggleShareState failed."), o.trigger(i.SHARE_STATUS_CHANGED), z(), J.isShareButtonClicked = !1, o.trigger(i.SHARE_OPEN_IN_PROGRESS, J.isShareButtonClicked), J.isShareButtonDisabled = !1 }) }).catch(function(e) { re.error("getShareRunningStatus failed."), J.isShareButtonClicked = !1, o.trigger(i.SHARE_OPEN_IN_PROGRESS, J.isShareButtonClicked), J.isShareButtonDisabled = !1, J.shareLoaded || e.status !== E.NOT_FOUND || C.handleShareNotReady(), J.isShareRunning = !1 })) }, J.onClickRedeem = function(e) { if (!te && y.current.name !== L.REWARDS) { var t = N.defer(); te = t.promise, d.showProgress({ textContent: f("translate")("l10n.loading") }); var r = !0; O.getFeature({ cvName: R.REWARDS_UX, gpuDriverVersion: J.gpuDriverVersion, telemetrySubUseCase: P.REWARDS_UX }).then(function(e) { r = !(_.isEmpty(e) || !e || !e.value) && e.value.isRewardInAppUXEnabled }).finally(function() { r ? !n.onlineState || n.onlineState && !n.onlineState.online ? (d.showOffline(), t.reject(), te = null) : w.getRewardsSupported() ? ee ? (d.cancel(), Z(), t.resolve(), te = null) : w.getRewardsEnabled().then(function(e) { ee = e, d.cancel(), Z(), t.resolve() }).catch(function() { Q("l10n.redeemOffline"), t.reject() }).finally(function() { te = null }) : (Q("l10n.updateToRedeem"), t.reject(), te = null) : (d.cancel(), w.openRedeemUrl(), t.resolve(), te = null) }) } }, J.onTourStepShown = function() { D.onStepShown() }, e.$on("$stateChangeSuccess", function(e, t, n, r, o) { "main.auth.userProfile" === t.name ? J.userProfileActive = !0 : J.userProfileActive = !1 }), Y(), e.$on("$destroy", X) }]) }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvMainToolbar = void 0, n(401), n(400), n(602), n(502), n(636), n(361); var o = n(763), i = r(o); n(402); var a = angular.module("main").component("nvMainToolbar", { template: i.default, controller: "MainToolbarController", controllerAs: "mainToolbarCtrl" }); t.nvMainToolbar = a }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvMain = t.ngMainModule = void 0; var o = n(185); n(218), n(403), n(348); var i = n(764), a = r(i); n(399); var s = o.ngMainModule.component("nvMain", { bindings: {}, template: a.default, controller: "MainController", controllerAs: "main" }); t.ngMainModule = o.ngMainModule, t.nvMain = s }, , , , , , , , , , , , , , , , , , , , , , , function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.friendAboutController = void 0; var r = n(15); n(45); var o = r.ngFriendsModule.controller("FriendAboutController", ["$state", "$log", "friendsService", function(e, t, r) { var o = this, i = e.params.userId, a = r.getUserAbout(i), s = 0, l = 5, c = t.getInstance("main.friends/FriendAboutController"); o.loadRatingImage = function(e) { return n(321)("./" + e + ".svg") }, a.then(function(e) { var t = e[0] || { general: { reputation: 0 } }; o.userAboutGeneral = t.general, o.userAboutSpecification = t.specification, o.getArray = function() { o.userAboutGeneral.reputation = o.userAboutGeneral.reputation < s ? s : o.userAboutGeneral.reputation, o.userAboutGeneral.reputation = o.userAboutGeneral.reputation > l ? l : o.userAboutGeneral.reputation; for (var e = [], t = s; t < l; t++) e.push(t < o.userAboutGeneral.reputation ? "gold" : "gray"); return e } }, function(e) { c.error("fetching user about failed with status: " + e.status) }) }]); t.friendAboutController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFriendAbout = void 0; var o = n(15), i = n(774), a = r(i); n(427); var s = o.ngFriendsModule.directive("nvFriendAbout", function() { return { restrict: "E", template: a.default, controller: "FriendAboutController", controllerAs: "friendAbout" } }); t.nvFriendAbout = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.friendAchievementsController = void 0; var r = n(15); n(45); var o = r.ngFriendsModule.controller("FriendAchievementsController", ["$log", "$state", "friendsService", function(e, t, n) { var r = t.params.userId, o = n.getUserAchievements(r), i = this, a = e.getInstance("main.friends/FriendAchievementsController"), s = function(e) { return i.userAchievements = e, i }; o.then(function(e) { var t = e[0] ? e[0].achievements : []; s(t) }, function(e) { a.error("fetching user achievements failed with status: " + e.status), s([{}]) }) }]); t.friendAchievementsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFriendAchievements = void 0; var o = n(15), i = n(775), a = r(i); n(429); var s = o.ngFriendsModule.directive("nvFriendAchievements", function() { return { restrict: "E", template: a.default, controller: "FriendAchievementsController", controllerAs: "vm" } }); t.nvFriendAchievements = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.friendActivityFeedController = void 0; var r = n(15), o = r.ngFriendsModule.controller("FriendActivityFeedController", [function() {}]); t.friendActivityFeedController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFriendActivityFeed = void 0; var o = n(15), i = n(776), a = r(i); n(431); var s = o.ngFriendsModule.directive("nvFriendActivityFeed", function() { return { restrict: "E", template: a.default, controller: "FriendActivityFeedController", controllerAs: "friendActivityFeed" } }); t.nvFriendActivityFeed = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.friendBroadcastController = void 0; var o = n(3), i = r(o), a = n(15); n(45), n(231), n(37); var s = a.ngFriendsModule.controller("FriendBroadcastController", ["$state", "friendsService", "shareService", "localStorage", function(e, t, n, r) { function o() { t.getUser(e.params.userId).then(function(e) { s.selectedUser = e; var t = i.chain(e.statuses).filter(function(e) { return "broadcasting" === e.activity }).sortBy(function(e) { return e.data.portal === a ? 0 : 1 }).value(); t.length > 0 ? (s.broadcastStatus = t[0], s.view = "broadcast", s.translateInterpolation.displayName = s.broadcastStatus.data.game.displayName) : (s.broadcastStatus = null, s.view = "image") }) } var a, s = this; s.view = "image", s.translateInterpolation = {}, r.get("commonPreferredPortal").then(function(e) { a = e.commonPreferredPortal, o() }), s.watchBroadcast = function() { n.watchBroadcast(e.params.userId) } }]); t.friendBroadcastController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFriendBroadcast = void 0; var o = n(15); n(17); var i = n(777), a = r(i); n(433); var s = o.ngFriendsModule.directive("nvFriendBroadcast", function() { return { restrict: "E", template: a.default, controller: "FriendBroadcastController", controllerAs: "friendBroadcast" } }); t.nvFriendBroadcast = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.friendCompareGamesController = void 0; var r = n(15), o = r.ngFriendsModule.controller("FriendCompareGamesController", [function() {}]); t.friendCompareGamesController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFriendCompareGames = void 0; var o = n(15), i = n(778), a = r(i); n(435); var s = o.ngFriendsModule.directive("nvFriendCompareGames", function() { return { restrict: "E", template: a.default, controller: "FriendCompareGamesController", controllerAs: "friendCompareGames" } }); t.nvFriendCompareGames = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.friendDetailsController = void 0; var r = n(15); n(45); var o = r.ngFriendsModule.controller("FriendDetailsController", ["$log", "$stateParams", "friendsService", function(e, t, n) { var r = this; r.friendTitle = "friendTitle"; e.getInstance("main.friends/FriendDetailsController"); r.user = { userId: t.userId }, n.getUser(r.user.userId).then(function(e) { r.user = e }) }]); t.friendDetailsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFriendDetails = void 0; var o = n(15); n(434), n(440), n(436), n(430), n(432), n(428), n(444), n(442); var i = n(779), a = r(i); n(437); var s = o.ngFriendsModule.directive("nvFriendDetails", function() { return { restrict: "E", scope: {}, template: a.default, controller: "FriendDetailsController", controllerAs: "friendDetails" } }); t.nvFriendDetails = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.friendGameSummaryController = void 0; var o = n(933), i = r(o), a = n(934), s = r(a), l = n(3), c = r(l), u = n(15); n(45); var d = u.ngFriendsModule.controller("FriendGameSummaryController", ["$state", "$filter", "friendsService", "FRIENDS_MAX_GENRES", "FRIENDS_CHART_COLORS", function(e, t, n, r, o) { var a, l = this, u = "other"; l.rectColor = function(e) { return { "background-color": o[e] } }, l.showChart = function() { return a > 0 }, l.translateInterpolation = function() { return { numGames: a } }, n.getUserGames(e.params.userId).then(function(e) { var n, d = 1; l.data = c.chain(e).groupBy(function(e) { return e.genre && "" !== e.genre || (e.genre = u), e.genre }).map(function(e, t) { return e }).sortBy(function(e) { return -e.length }).tap(function(e) { n = e.length }).groupBy(function(e, t) { return e[0].genre === u && (d = 0), n > r && t >= r - d ? u : e[0].genre }).map(function(e, n) { var r = c.flatten(e); return { label: t("translate")("l10n.genre." + n), value: r.length, data: r } }).value(), a = e.length, s.addGraph(function() { var e = s.models.pieChart().x(function(e) { return e.label }).y(function(e) { return e.value }).color(o).showLegend(!1).showLabels(!1).donut(!0).donutRatio(.6).valueFormat(i.format(",.0d")), t = i.select("#donut-chart svg").datum(l.data).transition().duration(1200).call(e); return t.style({ "stoke-width": "9px" }), e }) }) }]); t.friendGameSummaryController = d }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFriendGameSummary = void 0; var o = n(15); n(205); var i = n(780), a = r(i); n(439); var s = o.ngFriendsModule.directive("nvFriendGameSummary", function() { return { restrict: "E", template: a.default, controller: "FriendGameSummaryController", controllerAs: "friendGameSummary" } }); t.nvFriendGameSummary = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.friendGroupListController = void 0; var r = n(15); n(45); var o = r.ngFriendsModule.controller("FriendGroupListController", ["friendsService", "$scope", function(e, t) { var n = this; n.groupList = [], t.nvUserId ? e.getUserGroups(t.nvUserId).then(function(e) { n.groupList = e }) : n.groupList = [] }]); t.friendGroupListController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFriendGroupList = void 0; var o = n(15); n(34); var i = n(782), a = r(i), s = n(781), l = r(s); n(441); var c = o.ngFriendsModule.directive("nvFriendGroupList", [function() { return { restrict: "E", scope: { nvUserId: "@" }, template: function(e, t) { return "grid" === t.nvType ? l.default : a.default }, controller: "FriendGroupListController", controllerAs: "groups" } }]); t.nvFriendGroupList = c }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.friendListController = void 0; var r = n(15); n(45), n(219), n(231), n(37); var o = r.ngFriendsModule.controller("FriendListController", ["$scope", "friendsService", "friendsUtilityService", "shareService", "localStorage", "FRIENDS_DEFAULTS", function(e, t, n, r, o, i) { function a() { t.getUserFriends(e.nvUserId).then(function(e) { d.friendList = e }) } function s(e) { return e ? e.core.displayName : "" } function l(e) { if (e.statuses.length > 0) { if ("broadcasting" === e.statuses[0].activity) return 0; if ("playing" === e.statuses[0].activity) return 1; if ("online" === e.statuses[0].activity) return 2 } return 3 } function c() { "activity" === f ? d.sort = l : d.sort = s } function u() { d.filter = function(e, t, r) { var o = !1; return angular.forEach(m[d.filterType], function(t, r) { if (n.getStatus(e).activity === t) return void(o = !0) }), o } } var d = this, f = "", m = { all: ["broadcasting", "playing", "online", "offline"], online: ["broadcasting", "online", "playing"], broadcasting: ["broadcasting"], playing: ["broadcasting", "playing"], offline: ["offline"] }; o.get({ friendsSortType: i.SORT, friendsFilterType: i.FILTER }).then(function(e) { f = e.friendsSortType, d.filterType = e.friendsFilterType, c(), u(), a() }), d.showWatchBroadcast = function(e) { return "broadcasting" === n.getStatus(e).activity }, d.showAskToPlay = function(e) { var t = n.getStatus(e).activity; return "broadcasting" === t || "playing" === t }, d.showChat = function(e) { return "offline" !== n.getStatus(e).activity }, d.watchBroadcast = function(e) { r.watchBroadcast(e) }, d.offlineClass = function(e) { return "offline" === n.getStatus(e).activity ? "darkened" : "" }, d.askToPlay = function(e) { r.askToPlay(e) }, d.setSort = function(e) { f = e, o.set({ friendsSortType: f }), c() }, d.matchSort = function(e) { return f === e }, d.setFilter = function(e) { d.filterType = e, o.set({ friendsFilterType: d.filterType }), u() }, d.matchFilter = function(e) { return d.filterType === e }, d.getActivityString = n.getActivityString, d.getActivityDynamicValues = n.getActivityDynamicValues }]); t.friendListController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFriendList = void 0; var o = n(15); n(113), n(217), n(391), n(34); var i = n(784), a = r(i), s = n(783), l = r(s); n(443); var c = o.ngFriendsModule.directive("nvFriendList", [function() { return { restrict: "E", scope: { nvUserId: "@" }, template: function(e, t) { return "grid" === t.nvType ? l.default : a.default }, controller: "FriendListController", controllerAs: "friends" } }]); t.nvFriendList = c }, , , , , function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGalleryLibrary = void 0; var o = n(27); n(454); var i = n(787), a = r(i), s = o.ngGalleryModule.directive("nvGalleryLibrary", function() { return { restrict: "E", template: a.default } }); t.nvGalleryLibrary = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGalleryMain = void 0; var o = n(27); n(452), n(457); var i = n(788), a = r(i), s = o.ngGalleryModule.directive("nvGalleryMain", function() { return { restrict: "E", template: a.default } }); t.nvGalleryMain = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.galleryMomentsController = void 0; var o = n(122), i = r(o), a = n(27); n(295); var s = a.ngGalleryModule.controller("GalleryMomentsController", ["galleryService", "$filter", "GAME_FILE_TYPE", function(e, t, n) { var r = this; r.galleryList = [], r.sortPredicate = "modifiedTime", r.sortReverse = !0, r.filterObj = {}, r.fileType = n, e.getGalleryItems().then(function(e) { r.galleryList = t("orderBy")(e, r.sortPredicate, r.sortReverse) }), r.sortGalleryList = function(e, n) { r.sortPredicate = e, r.sortReverse = n, r.galleryList = t("orderBy")(r.galleryList, e, n) }, r.isSortType = function(e) { return e === r.sortPredicate }, r.setFilterType = function(e) { r.filterObj = e }, r.isFilterType = function(e) { if ("all" === e) { if (0 === (0, i.default)(r.filterObj).length) return !0 } else if (r.filterObj.fileType === e) return !0; return !1 } }]); t.galleryMomentsController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGalleryMoments = void 0; var o = n(27); n(113), n(449), n(455), n(462); var i = n(789), a = r(i); n(451); var s = o.ngGalleryModule.directive("nvGalleryMoments", function() { return { restrict: "E", template: a.default, controller: "GalleryMomentsController", controllerAs: "galleryMoments" } }); t.nvGalleryMoments = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.galleryPanelController = void 0; var r = n(27), o = r.ngGalleryModule.controller("GalleryPanelController", ["$scope", "$filter", "eventAggregator", "COMMON_EVENTS", function(e, t, n, r) { function o() { e.$apply() } function i() { n.on(r.WINDOW_RESIZE, o) } function a() { n.off(r.WINDOW_RESIZE, o) } var s = this; s.galleryFolder = e.nvGalleryFolder, s.isExpanded = !1, s.showMediaInfo = !1, s.tileLimit = e.nvTileLimit, s.filteredObj = {}, s.filterObj = function() { angular.isDefined(s.galleryFolder) && (s.filteredObj = t("filter")(s.galleryFolder.files, e.nvFilterObject)) }, s.filterObj(), s.setMediaInfoVisible = function(e) { s.showMediaInfo = e }, s.isFolderEmpty = function() { return 0 === s.filteredObj.length }, s.tilesRemaining = function() { return s.filteredObj.length - s.tileLimit }, s.showExpandInfo = function() { return s.showMediaInfo && s.tilesRemaining() > 0 }; var l = function() { s.isExpanded ? s.limitTo = s.filteredObj.length : s.limitTo = s.tileLimit }; s.showMoreTiles = function() { s.isExpanded = !s.isExpanded, l() }, e.$watch("nvTileLimit", function() { s.tileLimit = e.nvTileLimit, l() }), e.$watch("nvFilterObject", function() { s.filterObj(), l() }), e.$on("$destroy", a), i() }]); t.galleryPanelController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGalleryPanel = void 0; var o = n(27); n(461); var i = n(790), a = r(i); n(453); var s = o.ngGalleryModule.directive("nvGalleryPanel", ["$timeout", "eventAggregator", "COMMON_EVENTS", function(e, t, n) { return { restrict: "E", scope: { nvGalleryFolder: "=", nvFilterObject: "=", nvTileLimit: "=" }, template: a.default, link: function(r, o, i) { function a() { t.on(n.WINDOW_RESIZE, d) } function s() { t.off(n.WINDOW_RESIZE, d) } var l = angular.element(o.children()[0]); o.on("mouseenter", function(e) { l.addClass("md-primary md-hue-3 focused") }), o.on("mouseleave", function(e) { l.removeClass("md-primary md-hue-3 focused") }); var c = 0, u = function() { var e = o.find("nv-gallery-tile")[0]; e && (c = e.getBoundingClientRect().width) }, d = function() { var e = o.find("div")[0].clientWidth; r.nvTileLimit = Math.floor(e / c) }; e(function() { u(), d() }), r.$on("$destroy", s), a() }, controller: "GalleryPanelController", controllerAs: "galleryPanel" } }]); t.nvGalleryPanel = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGalleryPreview = void 0; var o = n(27), i = n(791), a = r(i), s = o.ngGalleryModule.directive("nvGalleryPreview", function() { return { restrict: "E", template: a.default } }); t.nvGalleryPreview = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.galleryShowcaseController = void 0; var o = n(3), i = r(o), a = n(27); n(295), n(12); var s = a.ngGalleryModule.controller("GalleryShowcaseController", ["galleryService", "$filter", "jarvisService", "SHOWCASE_ORIGIN", "$log", function(e, t, n, r, o) { var a = this, s = n.getLoggedInUser(); a.sortPredicate = "snippet.publishedAt", a.sortReverse = !0; var l = o.getInstance("main.gallery/GalleryShowcaseController"); a.galleryShowcaseList = [], s && e.getGalleryShowcaseItems(s.userId).then(function(n) { var o, s; angular.isDefined(n) && (o = i.pluck(n.files, "originalId").join(","), s = { id: o }, e.listVideos(s).then(function(e) { i.each(e.items, function(e) { e.origin = r.YOUTUBE }), a.galleryShowcaseList = e.items, a.galleryShowcaseList = t("orderBy")(a.galleryShowcaseList, a.sortPredicate, a.sortReverse) }, function(e) { l.error("galleryService.listVideos failed: " + e) })) }, function(e) { l.error("galleryService.getGalleryShowcaseItems failed: " + e) }), a.sortShowcaseList = function(e, n) { a.sortPredicate = e, a.sortReverse = n, a.galleryShowcaseList = t("orderBy")(a.galleryShowcaseList, e, n) }, a.isSortType = function(e) { return e === a.sortPredicate } }]); t.galleryShowcaseController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGalleryShowcase = void 0; var o = n(27); n(113), n(459); var i = n(792), a = r(i); n(456); var s = o.ngGalleryModule.directive("nvGalleryShowcase", function() { return { restrict: "E", template: a.default, controller: "GalleryShowcaseController", controllerAs: "galleryShowcase" } }); t.nvGalleryShowcase = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.galleryShowcaseTileController = void 0; var r = n(27), o = r.ngGalleryModule.controller("GalleryShowcaseTileController", ["$scope", function(e) { var t = this; t.overlayVisible = !1, t.buttonsVisible = !1, t.showcaseItem = e.nvGalleryShowcaseItem, t.showOverlay = function() { return t.overlayVisible ? "" : "no-background" }, t.showButtons = function() { return t.buttonsVisible ? "" : "invisible" }, t.mouseHover = function(e) { t.overlayVisible = e, t.buttonsVisible = e } }]); t.galleryShowcaseTileController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGalleryShowcaseTile = void 0; var o = n(27); n(17), n(34); var i = n(793), a = r(i); n(458); var s = o.ngGalleryModule.directive("nvGalleryShowcaseTile", function() { return { restrict: "E", scope: { nvGalleryShowcaseItem: "=" }, template: a.default, controller: "GalleryShowcaseTileController", controllerAs: "galleryShowcaseTile" } }); t.nvGalleryShowcaseTile = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.galleryTileController = void 0; var r = n(27); n(296), n(214); var o = r.ngGalleryModule.controller("GalleryTileController", ["$scope", "GAME_FILE_TYPE", "$log", "mediaDialogService", function(e, t, n, r) { var o = this; o.galleryFile = e.nvGalleryFile, o.overlayVisible = !1, o.buttonsVisible = !1; n.getInstance("main.gallery/GalleryTileController"); o.isImage = function(e) { return e === t.IMAGE }, o.isVideo = function(e) { return e === t.VIDEO }, o.previewMedia = function(e) { var n = r.customPreset().toolbarHtml("").event(e); o.galleryFile.fileType === t.IMAGE ? n = n.image(o.galleryFile.filePath) : o.galleryFile.fileType === t.VIDEO && (n = n.video({ source: o.galleryFile.filePath })), r.show(n) }, o.showOverlay = function() { return o.overlayVisible ? "" : "no-background" }, o.showButtons = function() { return o.buttonsVisible ? "" : "invisible" }, o.mouseHover = function(e) { o.overlayVisible = e, o.buttonsVisible = e }, o.editMedia = function(e) { return e.stopPropagation(), !1 }, o.shareMedia = function() { return !1 }, o.deleteMedia = function() { return !1 }, o.mediaDetail = function() { return !1 } }]); t.galleryTileController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGalleryTile = void 0; var o = n(27); n(17), n(34); var i = n(794), a = r(i); n(460); var s = o.ngGalleryModule.directive("nvGalleryTile", function() { return { restrict: "E", scope: { nvGalleryFile: "=" }, template: a.default, controller: "GalleryTileController", controllerAs: "galleryTile" } }); t.nvGalleryTile = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGalleryTimeline = void 0; var o = n(27), i = n(795), a = r(i), s = o.ngGalleryModule.directive("nvGalleryTimeline", function() { return { restrict: "E", template: a.default } }); t.nvGalleryTimeline = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvClassicGameList = void 0; var o = n(14); n(11), n(12), n(113), n(217), n(17), n(132), n(220), n(34), n(41), n(297); var i = n(797), a = r(i); n(298); var s = o.ngGamesModule.directive("nvClassicGameList", ["eventAggregator", "COMMON_GAME_EVENTS", "$log", "$document", function(e, t, n, r) { return { restrict: "E", scope: { nvUserId: "@", nvSelectedGameId: "=" }, template: a.default, controller: "GameListController", controllerAs: "games", link: function(o, i, a, s) { function l(e) { this.removeClass(e ? "constants-display-none" : "constants-display-flex").addClass(e ? "constants-display-flex" : "constants-display-none") } function c(e) { var t = e.topIndex > 0, n = Math.ceil(f.offsetHeight / 34), r = e.topIndex + n !== e.gamesCount; l.call(m, t), l.call(p, r) } function u() { f && e.on(t.GAME_LIST_TOP_INDEX_CHANGED, c) } function d() { f && e.off(t.GAME_LIST_TOP_INDEX_CHANGED, c), f = null, m = null, p = null, i.empty(), i.remove(), i = null } var f = i[0].querySelector(".games-classic-game-list-items-container"), m = angular.element(i[0].querySelector(".classic-game-list-top-gradient")), p = angular.element(i[0].querySelector(".classic-game-list-bottom-gradient")); n.getInstance("main.gamesClassicGameListDirective"); o.$on("$destroy", d), i.on("$destroy", function() { o.$destroy() }), u(), s.showTooltip = function(e, t) { var n = angular.element(r[0].querySelector("#" + t + e)); return !(!n || !n[0]) && n[0].scrollWidth > n[0].offsetWidth } } } }]); t.nvClassicGameList = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.customFpsController = void 0; var o = n(3), i = (r(o), n(14)); n(16), n(372); var a = i.ngGamesModule.controller("CustomFpsController", ["$scope", "$log", "$document", "$window", "$mdDialog", "$filter", "SETTING_TYPE", "eventAggregator", "toastService", "COMMON_GAME_EVENTS", "COMMON_EVENTS", function(e, t, n, r, o, i, a, s, l, c, u) { function d() { S.isCurrentSettingTypeAC() ? (S.maxFpsIndex = 120, S.minFpsIndex = 30, S.nvSystemGame.getQuietModeFRLState().then(function(e) { S.optimalSliderIndex = e.data.defValue, S.currentFpsSliderIndex = e.data.value, S.showProgressIndicator = !1, S.controlDisabled = !1, p() }).catch(function(e) { I.info("Not able to retrive QuiteMode FRL state for game", S.nvSystemGame.shortName), S.showProgressIndicator = !1, S.showErrorMessage = !0 })) : (S.maxFpsIndex = 60, S.minFpsIndex = 30, S.nvSystemGame.getBatteryBoostFRLState().then(function(e) { S.optimalSliderIndex = e.data.defValue, S.currentFpsSliderIndex = e.data.value, S.showProgressIndicator = !1, S.controlDisabled = !1, p() }).catch(function(e) { I.info("Not able to retrive BatteryBoost FRL state for game", S.nvSystemGame.shortName), S.showProgressIndicator = !1, S.showErrorMessage = !0 })) } function f() { l.showError({ textContent: i("translate")("l10n.unableToUpdateGameSettings") }) } function m() { var e = angular.element(n[0].querySelector(".games-custom-fps")); T = angular.element(e[0].querySelector(".md-track-container")), _ = angular.element(e[0].querySelector(".optimal-button-container")), w = angular.element(e[0].querySelector(".optimal-value-button")), A = angular.element(e[0].querySelector(".optimal-line-indicator")); var t = angular.element(n[0].querySelector(".games-game-optimization"))[0], o = r.getComputedStyle(t).getPropertyValue("margin-left"), i = r.getComputedStyle(t).getPropertyValue("margin-top"), a = angular.element(n[0].querySelector(".common-main-toolbar"))[0].offsetHeight, s = angular.element(n[0].querySelector(".game-details-toolbar"))[0].offsetHeight, l = 0, c = 0; if (S.nvClassicViewEnabled) { var u = angular.element(n[0].querySelector(".games-classic-game-list")).find("md-toolbar")[0].offsetHeight; c = a + u + s + parseInt(i) + "px", e.css("top", c); var d = angular.element(n[0].querySelector(".games-classic-game-list-container"))[0]; l = "calc(" + t.offsetWidth / 2 + "px + " + d.offsetWidth + "px + " + o + " - " + e[0].offsetWidth / 2 + "px)", e.css("left", l) } else c = a + s + parseInt(i) + "px", e.css("top", c), l = "calc(" + t.offsetWidth / 2 + "px + " + o + " - " + e[0].offsetWidth / 2 + "px)", e.css("left", l) } function p() { if (null === S.optimalSliderIndex || 0 === S.maxFpsIndex || null === T) _.addClass("hidden"); else { var e = T[0].clientWidth / (S.maxFpsIndex - S.minFpsIndex), t = (S.optimalSliderIndex - S.minFpsIndex) * e + 33, n = w[0].offsetWidth / 2, r = t - n; r < 0 ? r = 0 : r + w[0].offsetWidth > 452 && (r = 452 - w[0].offsetWidth), w.css("left", Math.round(r) + "px"), A.css("left", Math.round(t) + "px"), _.removeClass("hidden") } } function g() { var e = angular.element(n[0].querySelector(".game-setting-list-container")), t = angular.element(n[0].querySelector(".games-classic-game-list-container")), r = angular.element(n[0].querySelector(".game-details-toolbar")), o = angular.element(n.find("nv-feedback-float")); e.addClass("constants-z-layers-modal-plus-three"), t.addClass("constants-z-layers-modal-plus-three"), r.addClass("constants-z-layers-modal-plus-three"), o.addClass("constants-z-layers-modal-plus-three") } function v() { I.info("selected game changed for game ", S.nvSystemGame.shortName), S.cancelCustomFps() } function h() { m(), p() } function y() { I.info("Initializing custom fps dialog"), s.on(u.WINDOW_RESIZE, h), s.on(c.SELECTED_GAME_CHANGED, v), S.showProgressIndicator = !0, S.isCurrentSettingTypeAC() ? S.fpsDlgHeader = "l10n.frameRateWhisperMode" : S.fpsDlgHeader = "l10n.frameRateBatteryBoost" } function E() { I.info("Destroying custom fps dialog"), s.off(u.WINDOW_RESIZE, h), s.off(c.SELECTED_GAME_CHANGED, v), b() } var b, S = this, _ = null, w = null, A = null, T = null, I = t.getInstance("main.games/CustomFpsController"); S.showProgressIndicator = !1, S.controlDisabled = !0, S.applyButtonDisabled = !0, S.sliderStep = 5, S.showErrorMessage = !0, I.info("open custom fps dialog for game ", S.nvSystemGame.shortName), S.isCurrentSettingTypeAC = function() { return S.nvCurrentSettingType === a.SETTING_AC }, S.applyCustomFps = function() { S.showProgressIndicator = !0, I.info("applying custom fps for game", S.nvSystemGame.shortName), S.isCurrentSettingTypeAC() ? S.nvSystemGame.setQuietModeFRLState(S.currentFpsSliderIndex).then(function() {}).catch(function(e) { f() }).finally(function() { S.showProgressIndicator = !1, o.hide() }) : S.nvSystemGame.setBatteryBoostFRLState(S.currentFpsSliderIndex).then(function() {}).catch(function(e) { f() }).finally(function() { S.showProgressIndicator = !1, o.hide() }) }, S.cancelCustomFps = function() { I.info("leaving custom fps dialog for game ", S.nvSystemGame.shortName), o.cancel() }, S.applyOptimalValue = function() { I.info("leaving whisper mode fps with slider index ", S.optimalSliderIndex), S.currentFpsSliderIndex = S.optimalSliderIndex, S.currentFpsSliderChanged() }, S.currentFpsSliderChanged = function() { S.applyButtonDisabled = !1 }, n.ready(function() { I.info("whisper mode fps document ready for game ", S.nvSystemGame.shortName), m(), d(), g() }), b = e.$on("$stateChangeStart", function(e, t, n, r, o) { I.info("state changed in custom fps dialog for game ", S.nvSystemGame.shortName), S.cancelCustomFps() }), e.$on("$destroy", E), y() }]); t.customFpsController = a }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.customOpsController = void 0; var o = n(3), i = r(o), a = n(14); n(16); var s = a.ngGamesModule.controller("CustomOpsController", ["$scope", "$log", "$filter", "$document", "$window", "CUSTOM_OPS_CALLBACK_ACTION", "$mdDialog", "SETTING_TYPE", "ASPECT_RATIO", "eventAggregator", "COMMON_GAME_EVENTS", "GAME_EVENTS", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "COMMON_EVENTS", "toastService", "quietModeService", "PERFORMANCE_MODES", function(e, t, n, r, o, a, s, l, c, u, d, f, m, p, g, v, h, y) { function E() { return U.nvAceSupported ? U.nvPoweMode === y.QUIET ? "l10n.customSettingsQuietMode" : U.nvPoweMode === y.MAX_P ? "l10n.customSettingsPerformanceMode" : U.nvDesktopMode ? "l10n.usingCustomSettings" : "l10n.customSettingsPluggedIn" : X ? "l10n.customSettingsQuietMode" : U.nvDesktopMode ? "l10n.usingCustomSettings" : "l10n.customSettingsPluggedIn" } function b() { v.showError({ textContent: n("translate")("l10n.unableToUpdateGameSettings") }) } function S() { var e = angular.element(r[0].querySelector(".games-custom-ops")); z = angular.element(e[0].querySelector(".optimal-button-container")), B = angular.element(e[0].querySelector(".optimal-value-button")), $ = angular.element(e[0].querySelector(".optimal-line-indicator")); var t = angular.element(r[0].querySelector(".games-game-optimization"))[0], n = o.getComputedStyle(t).getPropertyValue("margin-left"), i = o.getComputedStyle(t).getPropertyValue("margin-top"), a = angular.element(r[0].querySelector(".common-main-toolbar"))[0].offsetHeight, s = angular.element(r[0].querySelector(".game-details-toolbar"))[0].offsetHeight, l = 0, c = 0; if (U.nvClassicViewEnabled) { var u = angular.element(r[0].querySelector(".games-classic-game-list")).find("md-toolbar")[0].offsetHeight; c = a + u + s + parseInt(i) + "px", e.css("top", c); var d = angular.element(r[0].querySelector(".games-classic-game-list-container"))[0]; l = "calc(" + t.offsetWidth / 2 + "px + " + d.offsetWidth + "px + " + n + " - " + e[0].offsetWidth / 2 + "px)", e.css("left", l) } else c = a + s + parseInt(i) + "px", e.css("top", c), l = "calc(" + t.offsetWidth / 2 + "px + " + n + " - " + e[0].offsetWidth / 2 + "px)", e.css("left", l) } function _() { if (null === U.optimalSliderIndex || 0 === U.maxIndex) z.addClass("hidden"); else { var e = W[0].clientWidth / (U.maxIndex - K), t = U.optimalSliderIndex * e + 33, n = B[0].offsetWidth / 2, r = t - n; r < 0 ? r = 0 : r + B[0].offsetWidth > 452 && (r = 452 - B[0].offsetWidth), B.css("left", Math.round(r) + "px"), $.css("left", Math.round(t) + "px"), z.removeClass("hidden") } } function w() { if (i.isNull(j) || j.clearRect(0, 0, q, Y.height), W) { Y = W[0].getBoundingClientRect(), q = Y.width < 384 ? 384 : Y.width; var e = Math.floor((U.maxIndex - K) / 1); j = H[0].getContext("2d"), H[0].width = q, H[0].height = Y.height; for (var t, n = 0; n <= e; n++) t = Math.round(q * (n / e)), j.fillStyle = "#FFFFFF", j.fillRect(t - 1, 0, 2, Y.height) } } function A(t) { var n; J.info("handle settingsSpace update for game ", U.nvSystemGame.shortName), U.showErrorMessage = !1, U.customSettings = t, U.maxIndex = U.customSettings.settings.length - 1, U.optimalSliderIndex = null, n = U.nvCurrentSettingType === l.SETTING_AC ? U.customSettings.recommendationAC : U.customSettings.recommendationDC, angular.isDefined(n) && (U.optimalSliderIndex = n.recommendedIndex), _(), w(), e.$applyAsync(function() { Q ? U.currentSliderIndex > U.maxIndex ? U.currentSliderIndex = 0 : U.restoreOptimalSliderPosition && (U.optimalSliderIndex && (U.currentSliderIndex = U.optimalSliderIndex), U.restoreOptimalSliderPosition = !1) : (Q = !0, null === U.optimalSliderIndex ? U.currentSliderIndex = 0 : U.currentSliderIndex = U.optimalSliderIndex, U.OpsTweakPosition && (U.currentSliderIndex = U.OpsTweakPosition.settingsIndex)), U.currentSliderChanged(), U.showProgressIndicator = !1, U.controlDisabled = !1 }) } function T(e) { J.info("settingsSpace failed for game ", U.nvSystemGame.shortName), U.showProgressIndicator = !1, U.showErrorMessage = !0 } function I() { U.selectedDisplayMode && U.selectedResolution && (J.info("get custom settings for game ", U.nvSystemGame.shortName), U.controlDisabled = !0, Z && (Z.cancel(), Z = null), Z = U.nvSystemGame.getSettingsSpace(U.selectedResolution, U.selectedDisplayMode.name), Z.then(A).catch(T).finally(function() { Z = null })) } function C(e) { U.displayModes = U.nvGameSettingsTranslationData[e].values, U.displayModeRecommended = U.displayModes[U.displayModeRecommended], U.selectedDisplayMode = U.displayModes[U.selectedDisplayMode] } function x() { J.info("refresh custom settings for game ", U.nvSystemGame.shortName); var e = U.nvSystemGame.getSliderSettings(); if (e) { var t; t = U.nvCurrentSettingType === l.SETTING_AC ? e.AC : e.DC, U.resolutions = t.resolution.values, U.resolutionRecommended = U.resolutions[t.resolution.recommended], U.displayModes = t.displayMode.values, U.displayModeRecommended = U.displayModes[t.displayMode.recommended], U.nvCurrentSettingType === l.SETTING_AC ? U.OpsTweakPosition = U.nvSystemGame.getOpsPositionAC() : U.OpsTweakPosition = U.nvSystemGame.getOpsPositionDC(), U.OpsTweakPosition ? (U.selectedDisplayMode = U.OpsTweakPosition.tweak.displayMode, U.selectedResolution = n("filter")(U.resolutions, { value: U.OpsTweakPosition.tweak.resolution })[0]) : (U.selectedDisplayMode = U.displayModes[t.displayMode.recommended], U.selectedResolution = U.resolutions[t.resolution.recommended]), C(t.displayMode.settingName), U.groupResolutions(), I() } else J.error("getSliderSettings empty for game id " + U.nvSystemGame.id) } function M() { var e = angular.element(r[0].querySelector(".game-setting-list-container")), t = angular.element(r[0].querySelector(".games-classic-game-list-container")), n = angular.element(r[0].querySelector(".game-details-toolbar")), o = angular.element(r.find("nv-feedback-float")); e.addClass("constants-z-layers-modal-plus-three"), t.addClass("constants-z-layers-modal-plus-three"), n.addClass("constants-z-layers-modal-plus-three"), o.addClass("constants-z-layers-modal-plus-three") } function D(e, t, n, r) { var o = e / n, i = n * o, a = r * o, s = .07 * i, l = .07 * a; return e >= i - s && e <= i + s && t >= a - l && t <= a + l } function O(e, t, n, r) { if (e % n === 0) { var o = e / n; if (t % o === 0 && t / o === r) return !0 } return !1 } function R(e, t, n) { return n ? c.HYPERSAMPLE : O(e, t, 16, 10) ? c.WIDE_16_10 : O(e, t, 16, 9) ? c.WIDE_16_9 : O(e, t, 4, 3) ? c.STANDARD_4_3 : O(e, t, 5, 4) ? c.STANDARD_5_4 : D(e, t, 16, 9) ? c.WIDE_16_9 : D(e, t, 16, 10) ? c.WIDE_16_10 : c.CUSTOM } function N(e) { e.id === U.nvSystemGame.id && (J.info("state update for game ", U.nvSystemGame.shortName), x()) } function L() { J.info("selected game changed for game ", U.nvSystemGame.shortName), U.cancelCustomSettings() } function P() { w(), S(), _() } function k() { J.info("Initializing custom ops dialog"), u.on(g.WINDOW_RESIZE, P), u.on(d.SELECTED_GAME_CHANGED, L), U.showProgressIndicator = !0, h.getStateInfo().then(function(e) { X = e.supported && e.enabled }) } function G() { J.info("Destroying custom ops dialog"), u.off(g.WINDOW_RESIZE, P), u.off(d.SELECTED_GAME_CHANGED, L), u.off(f.GAMESTATE_UPDATED, N), Z && (Z.cancel(), Z = null), F() } var F, U = this, V = null, z = null, B = null, $ = null, W = null, H = null, j = null, Y = {}, q = 0, K = 0, Q = !1, Z = null, X = !1, J = t.getInstance("main.games/CustomOpsController"); U.showProgressIndicator = !1, U.controlDisabled = !0, U.customSettings = null, U.maxIndex = 0, U.applyButtonDisabled = !1, U.selectedResolution = null, U.resolutionRecommended = null, U.resolutions = [], U.selectedDisplayMode = null, U.displayModeRecommended = null, U.displayModes = [], U.currentSliderIndex = 0, U.optimalSliderIndex = null, U.OpsTweakPosition = null, U.showErrorMessage = !1, U.restoreOptimalSliderPosition = !1, J.info("open custom ops for game ", U.nvSystemGame.shortName), U.getHeading = function() { return U.nvCurrentSettingType === l.SETTING_AC ? E() : "l10n.customSettingsOnBattery" }, U.isCurrentSettingTypeAC = function() { return U.nvCurrentSettingType === l.SETTING_AC }, U.applyCustomSettings = function() { if (U.showProgressIndicator = !0, J.info("applying custom ops for game", U.nvSystemGame.shortName), u.off(f.GAMESTATE_UPDATED, N), U.nvCurrentSettingType === l.SETTING_AC) { var e = m.startView(p.GAMEOPTIMIZATIONS_OPTIMIZE_TIME_CUSTOM_OPS); U.nvSystemGame.customizeAC(U.selectedResolution.value, U.selectedDisplayMode.name, U.currentSliderIndex).then(function() { m.push(p.GAMEOPTIMIZATIONS_APPLIED_CUSTOM_OPS, U.nvSystemGame.shortName), m.endView(p.GAMEOPTIMIZATIONS_OPTIMIZE_TIME_CUSTOM_OPS, e) }).catch(function(e) { b(), m.push(p.GAMEOPTIMIZATIONS_APPLY_CUSTOM_OPS_FAILED, U.nvSystemGame.shortName) }).finally(function() { U.showProgressIndicator = !1, s.hide() }) } else { var t = m.startView(p.GAMEOPTIMIZATIONS_OPTIMIZE_TIME_CUSTOM_BOPS); U.nvSystemGame.customizeDC(U.selectedResolution.value, U.selectedDisplayMode.name, U.currentSliderIndex).then(function() { m.push(p.GAMEOPTIMIZATIONS_APPLIED_CUSTOM_BOPS, U.nvSystemGame.shortName), m.endView(p.GAMEOPTIMIZATIONS_OPTIMIZE_TIME_CUSTOM_BOPS, t) }).catch(function(e) { b(), m.push(p.GAMEOPTIMIZATIONS_APPLY_CUSTOM_BOPS_FAILED, U.nvSystemGame.shortName) }).finally(function() { U.showProgressIndicator = !1, s.hide() }) } }, U.cancelCustomSettings = function() { J.info("leaving custom ops for game ", U.nvSystemGame.shortName), s.cancel() }, U.applyOptimalValue = function() { J.info("leaving optimal ops with slider index ", U.optimalSliderIndex), U.currentSliderIndex = U.optimalSliderIndex, U.currentSliderChanged() }, U.isResolutionDisabled = function() { return U.resolutions.length <= 1 || U.controlDisabled }, U.isDisplayModeDisabled = function() { return U.displayModes.length <= 1 || U.controlDisabled }, U.getDisplayModeString = function(e) { return e.name === U.displayModeRecommended.name ? n("translate")("l10n.recommended", { string: e.translation }) : e.translation }, U.getResolutionString = function(e) { return e.value === U.resolutionRecommended.value ? n("translate")("l10n.recommended", { string: e.value }) : e.value }, U.resolutionOrDisplayModeChanged = function() { U.currentSliderIndex === U.optimalSliderIndex && (U.restoreOptimalSliderPosition = !0), I() }, U.currentSliderChanged = function() { U.nvCustomSettingsCallback && U.customSettings ? U.OpsTweakPosition && U.OpsTweakPosition.tweak.displayMode === U.selectedDisplayMode.name && U.OpsTweakPosition.tweak.resolution === U.selectedResolution.value && U.OpsTweakPosition.settingsIndex === U.currentSliderIndex ? (U.nvCustomSettingsCallback(a.APPLIED_SETTING_SELECTED), U.applyButtonDisabled = !0) : (U.nvCustomSettingsCallback(a.CUSTOM_SETTINGS_UPDATED, { settings: U.customSettings.settings[U.currentSliderIndex], atOptimalPosition: U.currentSliderIndex === U.optimalSliderIndex }), U.applyButtonDisabled = !1) : J.error("Custom ops slider cannot be changed due to unvailable custom setting for game id", U.nvSystemGame.id) }, r.ready(function() { J.info("custom ops document ready for game ", U.nvSystemGame.shortName); var e = angular.element(r[0].querySelector(".games-custom-ops")); V = angular.element(e[0].querySelector(".md-track-ticks")), V.find("canvas").css("display", "none"), H = angular.element("").css("position", "absolute"), V.append(H), V.css("display", "block"), V.css("z-index", "0"), W = angular.element(e[0].querySelector(".md-track-container")), z = angular.element(e[0].querySelector(".optimal-button-container")), S(), M(), x(), u.on(f.GAMESTATE_UPDATED, N) }), U.groupResolutions = function() { U.resolutions && (U.resolutions = n("orderBy")(U.resolutions, "width", !0), U.resolutions = n("orderBy")(U.resolutions, function(e) { return R(e.width, e.height, e.DSR) })) }, U.showResolutionHeader = function(e) { return 0 === e || R(U.resolutions[e - 1].width, U.resolutions[e - 1].height, U.resolutions[e - 1].DSR) !== R(U.resolutions[e].width, U.resolutions[e].height, U.resolutions[e].DSR) }, U.resolutionHeader = function(e) { var t = R(e.width, e.height, e.DSR); switch (t) { case c.HYPERSAMPLE: return "l10n.dynamicSuperResolutions"; case c.WIDE_16_10: return "l10n.wideScreen1610"; case c.WIDE_16_9: return "l10n.wideScreen169"; case c.STANDARD_4_3: return "l10n.standard43"; case c.STANDARD_5_4: return "l10n.standard54"; case c.CUSTOM: default: return "l10n.custom" } }, F = e.$on("$stateChangeStart", function(e, t, n, r, o) { J.info("state changed in custom ops for game ", U.nvSystemGame.shortName), U.cancelCustomSettings() }), e.$on("$destroy", G), k() }]); t.customOpsController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvDsrInfo = void 0; var o = n(14), i = n(800), a = r(i), s = o.ngGamesModule.directive("nvDsrInfo", function() { return { restrict: "E", template: a.default, link: function(e, t) { function n() { e.$destroy() } function r() { t && (t.off("$destroy", n), t.empty(), t.remove(), t = null) } e.$on("$destroy", r), t.on("$destroy", n) } } }); t.nvDsrInfo = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.gameDetailPreviewController = void 0; var o = n(14); n(37); var i = n(805), a = r(i); n(474); var s = o.ngGamesModule.controller("GameDetailPreviewController", ["$scope", "$log", "$mdDialog", "dbCacheService", "DB_NAMES", function(e, t, n, r, o) { var i = this; i.userGame = i.nvUserGame, i.isGameOpsSupported = i.nvOpsSupported, i.userGame && (i.gameTags = i.userGame.tags); var s = t.getInstance("main.games/GameDetailPreviewController"); i.toggleFavorite = function() { i.userGame.favorite = !i.userGame.favorite }, i.toggleVisibility = function() { i.userGame.hidden = !i.userGame.hidden }, i.showTagsModalDialog = function() { n.show({ controller: "GameTagsModalController", controllerAs: "tagsModal", template: a.default, disableParentScroll: !1, locals: { game: i.userGame }, bindToController: !0 }).then(function(e) { angular.copy(e, i.gameTags) }).catch(function() { s.info("cancel was clicked on game details tag dialog") }) }, i.isPlayed = function() { return !(!i.userGame || !i.userGame.lastLaunchDate) }, i.devFeatures = r.getCachedGlobalItem(o.DEV_STORE, o.DEV_FEATURES), e.$watch("nvUserGame", function(e) { e && (i.userGame = e, i.gameTags = i.userGame.tags) }) }]); t.gameDetailPreviewController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGameDetailPreview = void 0; var o = n(14); n(220), n(221), n(222), n(41); var i = n(801), a = r(i); n(467); var s = o.ngGamesModule.component("nvGameDetailPreview", { bindings: { nvUserGame: "=", nvOpsSupported: "@" }, template: a.default, controller: "GameDetailPreviewController", controllerAs: "gameDetailPreview" }); t.nvGameDetailPreview = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gameDetailsController = void 0; var r = n(14); n(46), n(133), n(11), n(12), n(62), n(29), n(31), n(288); var o = r.ngGamesModule.controller("GameDetailsController", ["$state", "gamesService", "userGamesService", "MEDIA_FILE_TYPE", "$scope", "preferencesService", "$log", "$window", "dbCacheService", "DB_NAMES", "jarvisService", "COMMON_DYNAMIC_REDIRECT", "localeService", function(e, t, n, r, o, i, a, s, l, c, u, d, f) { function m() { v.opsSupportedRequestInProgress = !0, i.getGameOpsFeature().then(function(e) { e ? v.doesSystemSupportOPS = e.overallState : (y.error("getGameOps returned null object"), v.doesSystemSupportOPS = !1) }).catch(function() { y.error("Exception getting system support for game Ops"), v.opsNotDetermined = !0 }).finally(function() { v.opsSupportedRequestInProgress = !1 }) } function p() { v.userGame = n.getUserGame(v.userGameId), v.userGame && (v.gameId = v.userGame.gameId, v.userGame.systemGame = t.getSystemGame(v.userGame.gameId), v.screenShots = v.userGame.systemGame.getScreenShots(), g = v.userGame.systemGame.shortName) } var g, v = this, h = u.getLoggedInUser(), y = a.getInstance("main.gamesGameDetailsController"); e.params.userGameId ? v.userGameId = e.params.userGameId : v.userGameId = o.nvSelectedGameId, v.mediaFileType = r, v.classicViewEnabled = o.nvClassicViewEnabled, v.doesSystemSupportOPS = !1, v.opsNotDetermined = !1, v.devFeatures = l.getCachedGlobalItem(c.DEV_STORE, c.DEV_FEATURES), v.viewState = l.getCachedUserItem(h.userId, c.VIEW_STORE, c.VIEW_STATE), m(), v.hasScreenshots = function() { return !!(angular.isArray(v.screenShots) && v.screenShots.length > 0) }, v.isPlayed = function() { return v.userGame && v.userGame.lastLaunchDate }, v.classicViewEnabled ? o.$watch("nvSelectedGameId", function(e) { e && (v.userGameId = e, p()) }) : p(), v.toggleFavorite = function(e) { v.userGame.favorite = !v.userGame.favorite, n.updateFavoriteHiddenState(v.userGame.id, v.userGame.favorite, v.userGame.hidden), e.stopPropagation() }, v.toggleVisibility = function(e) { v.userGame.hidden = !v.userGame.hidden, n.updateFavoriteHiddenState(v.userGame.id, v.userGame.favorite, v.userGame.hidden), e.stopPropagation() }, v.systemNoOpsRequirementLink = function() { s.open(d.BASE_URL + f.getCurrentLocaleWithUnderscore() + "&page=" + d.SYSTEM_REQS) }, v.showOpsNotSupported = function() { return !v.doesSystemSupportOPS && !v.opsNotDetermined && !v.opsSupportedRequestInProgress } }]); t.gameDetailsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGameList = void 0; var o = n(14); n(113), n(17), n(476), n(132); var i = n(803), a = r(i); n(298), n(11), n(12); var s = o.ngGamesModule.directive("nvGameList", ["eventAggregator", "COMMON_GAME_EVENTS", "dbCacheService", "DB_NAMES", "$log", "COMMON_EVENTS", "jarvisService", function(e, t, n, r, o, i, s) { return { restrict: "E", scope: { nvUserId: "@", nvSelectedGameId: "=" }, template: a.default, controller: "GameListController", controllerAs: "games", link: function(a, l) { function c(e) { this.removeClass(e ? "constants-display-none" : "constants-display-flex").addClass(e ? "constants-display-flex" : "constants-display-none") } function u() { var e = v.scrollTop > 0, t = v.scrollTop + v.offsetHeight < v.scrollHeight; c.call(h, e), c.call(y, t) } function d() { v = l[0].querySelector(".md-virtual-repeat-offsetter"), h = angular.element(l[0].querySelector(".game-list-top-gradient")), y = angular.element(l[0].querySelector(".game-list-bottom-gradient")), v && (v.scrollTop = g.tileViewScrollTop, v.addEventListener("scroll", u), e.on(i.WINDOW_RESIZE, u), c.call(h, !1), c.call(y, !0)) } function f() { v && (g.tileViewScrollTop = v.scrollTop, g.persist_()) } function m() { var o = s.getLoggedInUser(); g = n.getCachedUserItem(o.userId, r.VIEW_STORE, r.VIEW_STATE), e.on(t.SAVE_GAME_LIST_SCROLL_POSTION, f), e.on(t.RESTORE_GAME_LIST_SCROLL_POSITION, d) } function p() { e.off(t.SAVE_GAME_LIST_SCROLL_POSTION, f), e.off(t.RESTORE_GAME_LIST_SCROLL_POSITION, d), v && (e.off(i.WINDOW_RESIZE, u), v.removeEventListener("scroll", u)), v = null, h = null, y = null, l.empty(), l.remove(), l = null } var g, v = null, h = (o.getInstance("main.gamesGameListDirective"), null), y = null; a.$on("$destroy", p), l.on("$destroy", function() { a.$destroy() }), m() } } }]); t.nvGameList = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } function o(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.gameSettingsController = void 0; var i = n(3), a = o(i), s = n(14); n(16), n(20); var l = n(799), c = r(l); n(465); var u = n(798), d = r(u); n(464), n(112); var f = s.ngGamesModule.controller("GameSettingsController", ["$scope", "$log", "$filter", "SETTING_TYPE", "$mdDialog", "CUSTOM_OPS_CALLBACK_ACTION", "eventAggregator", "GAME_EVENTS", "$timeout", "OPS_TAB_STATE", "$document", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "toastService", "quietModeService", "framerateLimiterService", "performanceModeService", "PERFORMANCE_MODES", "$state", "$q", function(e, t, n, r, o, i, s, l, u, f, m, p, g, v, h, y, E, b, S, _) { function w(e, t) { return K.aceSupported ? e === b.QUIET ? t ? "l10n.gameIsOptimizedForQuietMode" : "l10n.gameIsNotOptimizedForQuietMode" : e === b.MAX_P ? t ? "l10n.gameIsOptimizedForPerformanceMode" : "l10n.gameIsNotOptimizedForPerformanceMode" : t ? "l10n.gameIsOptimized" : "l10n.gameIsNotOptimized" : t ? K.quietModeEnabled ? "l10n.gameIsOptimizedForQuietMode" : "l10n.gameIsOptimized" : K.quietModeEnabled ? "l10n.gameIsNotOptimizedForQuietMode" : "l10n.gameIsNotOptimized" } function A(e) { return K.aceSupported ? e === b.QUIET ? "l10n.gameIsUsingCustomSettingsForQuietMode" : e === b.MAX_P ? "l10n.gameIsUsingCustomSettingsForPerformanceMode" : "l10n.gameIsUsingCustomSettings" : K.quietModeEnabled ? "l10n.gameIsUsingCustomSettingsForQuietMode" : "l10n.gameIsUsingCustomSettings" } function T() { if (K.nvCurrentSettingType === K.settingType.SETTING_DC) switch (K.optimizationTabState) { case f.DC.OPTIMAL_NOT_AVAILABLE: case f.DC.DISABLED: return K.lastMessage = "l10n.gameCannotBeOptimized", "l10n.gameCannotBeOptimized"; case f.DC.CURRENT_NOT_AVAILABLE: return K.lastMessage = "l10n.UnableToRetrieveCurrentSettings", "l10n.UnableToRetrieveCurrentSettings"; case f.DC.OPTIMIZED: return K.lastMessage = K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : "l10n.gameIsOptimizedForBattery", K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : "l10n.gameIsOptimizedForBattery"; case f.DC.CUSTOMIZED: return K.lastMessage = K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : "l10n.gameIsUsingCustomBatterySettings", K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : "l10n.gameIsUsingCustomBatterySettings"; case f.DC.USE_PLUGGEDIN: return K.lastMessage = K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : "l10n.gameIsUsingPluggedInForBattery", K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : "l10n.gameIsUsingPluggedInForBattery"; default: return K.lastMessage } else switch (K.optimizationTabState) { case f.AC.OPTIMAL_NOT_AVAILABLE: return K.lastMessage = "l10n.gameCannotBeOptimized", "l10n.gameCannotBeOptimized"; case f.AC.CURRENT_NOT_AVAILABLE: return K.lastMessage = "l10n.UnableToRetrieveCurrentSettings", "l10n.UnableToRetrieveCurrentSettings"; case f.AC.OPTIMIZED: return K.lastMessage = K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : w(K.powerMode, !0), K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : w(K.powerMode, !0); case f.AC.CUSTOMIZED: return K.lastMessage = K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : A(K.powerMode), K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : A(K.powerMode); case f.AC.NOT_OPTIMIZED: return K.lastMessage = K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : w(K.powerMode), K.isBelowMinSpec ? "l10n.systemBelowMinspecForGame" : w(K.powerMode); default: return K.lastMessage } } function I() { if (K.nvCurrentSettingType === K.settingType.SETTING_DC) return K.isOptimized() ? "l10n.usingBatteryBoostSettings" : "l10n.usingCustomBatterySettings"; var e = void 0; return K.aceSupported ? e = K.powerMode === b.QUIET ? K.isOptimized() ? "l10n.usingOptimalSettingsForQuietMode" : "l10n.usingCustomSettingsQuietMode" : K.powerMode === b.MAX_P ? K.isOptimized() ? "l10n.usingOptimalSettingsForPerformanceMode" : "l10n.usingCustomSettingsPerformanceMode" : K.isOptimized() ? "l10n.usingOptimalSettings" : "l10n.usingCustomSettings" : K.isOptimized() ? K.quietModeEnabled ? "l10n.usingOptimalSettingsForQuietMode" : "l10n.usingOptimalSettings" : K.quietModeEnabled ? "l10n.usingCustomSettingsQuietMode" : "l10n.usingCustomSettings" } function C(e, t) { if ("-" !== e) { if (!a.isEmpty(t) && angular.isDefined(t[e])) return t[e].translation; X.error("game settings translation not found for game ", K.nvSystemGame.id, "with value ", e) } return e } function x() { a.isEmpty(Z) || a.each(K.settings, function(e) { if (angular.isDefined(Z[e.name])) { var t = Z[e.name]; e.name = t.translation, e.value = C(e.value, t.values), e.optimalValue = C(e.optimalValue, t.values) } else X.error("game settings translation not found for game ", K.nvSystemGame.id, "with setting name ", e.name) }) } function M() { K.recommendedOptimal = K.optimalSettings, K.updateOptimizationTabState(), K.optimizationTabState !== f.TRANSITION && (K.optimized = K.isOptimized() || K.isCustomized(), K.formSettingsArray()) } function D() { if (K.optimizationTabState !== f.TRANSITION) { var e = K.nvSystemGame.getOpsRequestPromise(); e ? e.finally(function() { K.requestInProgress = !1 }) : K.requestInProgress = !1 } } function O() { !a.isEmpty(Z) && a.isNull(q) && (M(), D()) } function R(e) { Q.settingName = "", Q.values = []; var t = K.nvCurrentSettingType === K.settingType.SETTING_DC ? e.DC.resolution : e.AC.resolution; Q.settingName = t.settingName, t.values.forEach(function(e) { e.DSR && Q.values.push(e.value) }) } function N() { v.showError({ textContent: n("translate")("l10n.unableToUpdateGameSettings") }) } function L() { var e = angular.element(m[0].querySelector(".game-setting-list-container")), t = angular.element(m[0].querySelector(".games-classic-game-list-container")), n = angular.element(m[0].querySelector(".game-details-toolbar")), r = angular.element(m.find("nv-feedback-float")); e.removeClass("constants-z-layers-modal-plus-three"), t.removeClass("constants-z-layers-modal-plus-three"), n.removeClass("constants-z-layers-modal-plus-three"), r.removeClass("constants-z-layers-modal-plus-three") } function P(e) { s.trigger(l.SETTING_ITEM_HOVER, { name: e }) } function k() { K.hoverSetting = null, s.trigger(l.SETTING_ITEM_MOUSE_LEAVE, {}) } function G() { K.hoverSetting = null } function F(e) { K.hoverSetting = e.name } function U(e) { e.id === K.nvSystemGame.id && (K.nvSystemGame = e, K.getGameState(), K.updateCurrentSettingHeader()) } function V(e) { e.id === K.nvSystemGame.id && (Z = e.data, O()) } function z(e) { e === K.nvSystemGame.id && (Y && (Y.cancel(), Y = null), q && (q.cancel(), q = null), M(), D()) } function B() { K.nvSystemGame.getGameSettingsTranslation() } function $() { var e = h.getQuietMode2StateInfo(), t = h.getStateInfo(); _.all([t, e]).then(function(e) { X.info("QuietMode support state", e), K.quietModeEnabled = e[1].supported === !0 && e[1].enabled === !0 || e[0].supported === !0 && e[0].enabled === !0 }) } function W() { s.on(l.GAMESTATE_UPDATED, U), s.on(l.VOPS_POPUP_SHOWN, ee), s.on(l.SETTINGS_TRANSLATION_FINISHED, V), s.on(l.SETTINGS_TRANSLATION_FAILED, z), s.on(l.GAMEVOPSITEM_UNMATCHED, G), s.on(l.GAMEVOPSITEM_MATCHED, F), s.on(l.GAMEVOPS_FINISHED, B), $(), E.isFeatureAvailableOnAB().then(function(e) { X.info("isFeatureAvailableOnAB", e), e ? E.getStateInfo().then(function(e) { e.supported && (K.aceSupported = e.supported, K.powerMode = e.performanceMode) }) : K.aceSupported = !1 }), y.getSupportInfo().then(function(e) { e.supported && y.getStateInfo().then(function(e) { K.frlEnabled = e.enabled }) }) } function H() { K.currentSettings = null, K.targetSettings = null, K.settings = [], K.hoverSetting = null, K.hoverPromise = null, K.optimalSettings = null, K.recommendedOptimal = null, K.isBelowMinSpec = !1, K.requestInProgress = !0, Z = [], Q = { settingName: "", values: [] }, K.getGameState(), K.updateCurrentSettingHeader() } function j() { s.off(l.GAMESTATE_UPDATED, U), s.off(l.VOPS_POPUP_SHOWN, ee), s.off(l.SETTINGS_TRANSLATION_FINISHED, V), s.off(l.SETTINGS_TRANSLATION_FAILED, z), s.off(l.GAMEVOPSITEM_UNMATCHED, G), s.off(l.GAMEVOPSITEM_MATCHED, F), s.off(l.GAMEVOPS_FINISHED, B), Y && (Y.cancel(), Y = null), q && (q.cancel(), q = null), u.cancel(K.hoverPromise) } var Y, q, K = this, Q = {}, Z = [], X = t.getInstance("main.games/GameSettingsController"); K.nvCustomOpsOpen = !1, K.nvCustomFpsOpen = !1, K.settingType = r, K.showBorder = !1, K.customOpsChanging = !1, K.optimizationTabState = f.UNINITIALIZED, K.currentSettingHeader = "l10n.current", K.lastMessage = "l10n.unableToRetrieveSettings", K.quietModeEnabled = !1, K.frlEnabled = !1, K.aceSupported = !1; var J = n("translate"); K.updateOptimizationTabState = function() { K.optimalSettings || K.currentSettings ? a.isUndefined(K.optimalSettings) || null == K.optimalSettings ? K.optimizationTabState = K.nvCurrentSettingType === K.settingType.SETTING_DC ? f.DC.OPTIMAL_NOT_AVAILABLE : f.AC.OPTIMAL_NOT_AVAILABLE : a.isUndefined(K.currentSettings) || null == K.currentSettings ? K.optimizationTabState = K.nvCurrentSettingType === K.settingType.SETTING_DC ? f.DC.CURRENT_NOT_AVAILABLE : f.AC.CURRENT_NOT_AVAILABLE : "REGULAR" === K.nvSystemGame.getTargetSettingsTarget() ? K.nvCurrentSettingType === K.settingType.SETTING_DC ? K.nvSystemGame.isDCDisabled() ? K.optimizationTabState = f.DC.DISABLED : K.nvSystemGame.isDCOptimized() ? K.optimizationTabState = f.DC.OPTIMIZED : K.nvSystemGame.isDCCustomized() ? K.optimizationTabState = f.DC.CUSTOMIZED : K.optimizationTabState = f.DC.USE_PLUGGEDIN : K.nvSystemGame.isACOptimized() ? K.optimizationTabState = f.AC.OPTIMIZED : K.nvSystemGame.isACCustomized() ? K.optimizationTabState = f.AC.CUSTOMIZED : K.optimizationTabState = f.AC.NOT_OPTIMIZED : K.optimizationTabState = f.TRANSITION : K.optimizationTabState = f.UNINITIALIZED }, K.unableToRetrieveSettings = function() { return K.optimizationTabState === f.AC.OPTIMAL_NOT_AVAILABLE || K.optimizationTabState === f.DC.OPTIMAL_NOT_AVAILABLE || K.optimizationTabState === f.AC.CURRENT_NOT_AVAILABLE || K.optimizationTabState === f.DC.CURRENT_NOT_AVAILABLE || K.optimizationTabState === f.UNINITIALIZED }, K.showOptimizeButton = function() { return !K.optimized && !K.unableToRetrieveSettings() }, K.showRevertButton = function() { return K.optimized && !K.unableToRetrieveSettings() }, K.hideCustomization = function() { return K.unableToRetrieveSettings() }, K.getMessage = function() { var e = T(), t = J(e, { whisperModeCustomHtml: "ng-click=gameSettings.onRedirectPreferenceGeneralPage($event)" }); return t }, K.getOptimalMessage = function() { var e = I(), t = J(e, { whisperModeCustomHtml: "ng-click=gameSettings.onRedirectPreferenceGeneralPage($event)" }); return t }, K.onRedirectPreferenceGeneralPage = function(e) { S.go("main.auth.preferences") }, K.getOptimalSettingHeader = function() { return K.customOpsChanging && !K.atOptimalIndexPosition ? "l10n.custom" : "l10n.optimal" }, K.updateCurrentSettingHeader = function() { var e = K.nvSystemGame.getTargetPowerMode(); e && (K.nvCurrentSettingType === K.settingType.SETTING_DC && "AC" === e ? K.currentSettingHeader = "l10n.whenOnBattery" : K.nvCurrentSettingType === K.settingType.SETTING_AC && "DC" === e ? K.currentSettingHeader = "l10n.whenPluggedIn" : K.currentSettingHeader = "l10n.current") }, K.isOptimized = function() { return K.nvCurrentSettingType === K.settingType.SETTING_DC ? K.nvSystemGame.isDCOptimized() : K.nvSystemGame.isACOptimized() }, K.isCustomized = function() { return K.nvCurrentSettingType === K.settingType.SETTING_DC ? K.nvSystemGame.isDCCustomized() : K.nvSystemGame.isACCustomized() }, K.showUnoptimizedIcon = function() { return !K.optimized && !K.showWarningIcon() }, K.showWarningIcon = function() { return K.isBelowMinSpec || K.nvCurrentSettingType === K.settingType.SETTING_DC && (K.optimizationTabState === f.DC.OPTIMAL_NOT_AVAILABLE || K.optimizationTabState === f.DC.DISABLED) || K.nvCurrentSettingType === K.settingType.SETTING_AC && K.optimizationTabState === f.AC.OPTIMAL_NOT_AVAILABLE }, K.showOptimizedIcon = function() { return K.optimized && !K.showWarningIcon() }, K.showOptimalSettingsInColumn = function() { return !K.optimized || K.customOpsChanging }, K.showIconInColumn = function() { return K.optimized && !K.customOpsChanging }, K.isDsrResolution = function(e, t) { return e === Q.settingName && a.indexOf(Q.values, t) !== -1 }, K.formSettingsArray = function() { if (K.settings = [], K.optimizationTabState === f.AC.CURRENT_NOT_AVAILABLE || K.optimizationTabState === f.DC.CURRENT_NOT_AVAILABLE) K.optimalSettings.forEach(function(e) { var t = { name: e.name, type: "DRIVER_ENUM" === e.type ? e.type : "ENUM", value: "-", optimalValue: e.value }; K.isDsrResolution(e.name, e.value) && (t.isOptimalDsrResolution = !0), K.settings.push(t) }); else if (K.optimizationTabState === f.AC.OPTIMAL_NOT_AVAILABLE || K.optimizationTabState === f.DC.OPTIMAL_NOT_AVAILABLE || !K.customOpsChanging && K.optimized) K.targetSettings ? K.targetSettings.forEach(function(e) { var t = { name: e.name, type: "DRIVER_ENUM" === e.type ? e.type : "ENUM", value: e.value, optimalValue: "-" }; K.isDsrResolution(e.name, e.value) && (t.isCurrentDsrResolution = !0), K.settings.push(t) }) : X.error("targetSettings not set"); else if (K.targetSettings) { var e = a.union(a.pluck(K.targetSettings, "name"), a.pluck(K.optimalSettings, "name")); e.forEach(function(e) { var t = n("filter")(K.optimalSettings, { name: e }, !0), r = n("filter")(K.targetSettings, { name: e }, !0), o = {}; r.length ? (o = { name: r[0].name, type: "DRIVER_ENUM" === r[0].type ? r[0].type : "ENUM", value: r[0].value }, t.length ? o.optimalValue = t[0].value : o.optimalValue = "-") : o = { name: t[0].name, type: "DRIVER_ENUM" === t[0].type ? t[0].type : "ENUM", value: "-", optimalValue: t[0].value }, K.isDsrResolution(o.name, o.value) && (o.isCurrentDsrResolution = !0), K.isDsrResolution(o.name, o.optimalValue) && (o.isOptimalDsrResolution = !0), K.settings.push(o) }) } x(), K.settings = n("orderBy")(K.settings, ["-type", "+name"]) }, K.isOptimalSettingDifferent = function(e, t) { return "-" !== t && e !== t }, K.getGameState = function() { Y && (Y.cancel(), Y = null), q && (q.cancel(), q = null), Y = K.nvSystemGame.getState(), Y.then(function(e) { K.currentSettings = K.nvSystemGame.getCurrentSettings(), "REGULAR" === K.nvSystemGame.getTargetSettingsTarget() && (K.nvCurrentSettingType === K.settingType.SETTING_DC ? K.targetSettings = K.nvSystemGame.getRegularTargetSettingsDC() : K.targetSettings = K.nvSystemGame.getRegularTargetSettingsAC()); var t = K.nvSystemGame.getSliderSettings(); if (t) { R(t); var n, r; K.nvCurrentSettingType === K.settingType.SETTING_DC ? (n = K.nvSystemGame.getRecommendedDCResolution(), r = K.nvSystemGame.getRecommendedDCDisplayMode()) : (n = K.nvSystemGame.getRecommendedACResolution(), r = K.nvSystemGame.getRecommendedACDisplayMode()), q = K.nvSystemGame.getSettingsSpace(n, r), q.then(function(e) { K.nvCurrentSettingType === K.settingType.SETTING_DC ? K.optimalSettings = K.nvSystemGame.getOptimalDCSettings(e) : K.optimalSettings = K.nvSystemGame.getOptimalACSettings(e), K.nvCurrentSettingType === K.settingType.SETTING_DC && (K.isOptimized() || K.isCustomized()) ? K.isBelowMinSpec = K.nvSystemGame.getRecommendedDCBelowMinspec(e) : K.isBelowMinSpec = K.nvSystemGame.getRecommendedACBelowMinspec(e) }).catch(function(e) { X.error("get settings space failed for game:", K.nvSystemGame.displayName, "with error:", e) }).finally(function() { q = null, O() }) } else X.error("slider settings not found for game:", K.nvSystemGame.displayName), M(), D() }).catch(function(e) { X.error("get State failed for game:", K.nvSystemGame.displayName, "with error:", e), M(), D() }).finally(function() { Y = null }) }, K.resetOptimization = function() { K.requestInProgress = !0, K.nvCurrentSettingType === K.settingType.SETTING_DC ? K.nvSystemGame.revertDCOptimization().catch(function(e) { X.error("unable to revert DC OPS for game ", K.nvSystemGame.id), N() }).finally(function() { K.getGameState() }) : K.nvSystemGame.revertACOptimization().catch(function(e) { X.error("unable to revert AC OPS for game ", K.nvSystemGame.id), N() }).finally(function() { K.getGameState() }) }, K.optimizeSettings = function() { if (K.requestInProgress = !0, K.nvCurrentSettingType === K.settingType.SETTING_DC) { var e = p.startView(g.GAMEOPTIMIZATIONS_OPTIMIZE_TIME_BOPS); K.nvSystemGame.optimizeDC().then(function() { p.push(g.GAMEOPTIMIZATIONS_APPLIED_BOPS, K.nvSystemGame.shortName), K.getGameState(), p.endView(g.GAMEOPTIMIZATIONS_OPTIMIZE_TIME_BOPS, e) }).catch(function(e) { X.error("unable to apply DC OPS for game ", K.nvSystemGame.id), p.push(g.GAMEOPTIMIZATIONS_APPLY_BOPS_FAILED, K.nvSystemGame.shortName), K.getGameState(), N() }) } else { var t = p.startView(g.GAMEOPTIMIZATIONS_OPTIMIZE_TIME); K.nvSystemGame.optimizeAC().then(function() { p.push(g.GAMEOPTIMIZATIONS_APPLIED_OPS, K.nvSystemGame.shortName), K.getGameState(), p.endView(g.GAMEOPTIMIZATIONS_OPTIMIZE_TIME, t) }).catch(function(e) { X.error("unable to apply AC OPS for game ", K.nvSystemGame.id), p.push(g.GAMEOPTIMIZATIONS_APPLY_OPS_FAILED, K.nvSystemGame.shortName), K.getGameState(), N() }) } }, K.optimizeGame = function() { K.optimized ? K.resetOptimization() : (K.optimizeSettings(), K.setShowBorder(!1)) }, K.showOptimalBorder = function() { return K.showBorder && !K.optimized }, K.showHeader = function(e) { return 0 === e || K.settings[e - 1].type !== K.settings[e].type }, K.headerValue = function(e) { return "ENUM" === e ? "l10n.inGame" : "DRIVER_ENUM" === e ? "l10n.nvidia" : void 0 }, K.setShowBorder = function(e) { K.showBorder = e }, K.openCustomOps = function() { K.nvCustomOpsOpen = !0; var e = o.show({ template: c.default, locals: { nvCustomSettingsCallback: K.customSettingsCallback, nvSystemGame: K.nvSystemGame, nvCurrentSettingType: K.nvCurrentSettingType, nvClassicViewEnabled: K.nvClassicViewEnabled, nvDesktopMode: K.nvDesktopMode, nvGameSettingsTranslationData: Z, nvAceSupported: K.aceSupported, nvPoweMode: K.powerMode }, clickOutsideToClose: !0, controller: "CustomOpsController", controllerAs: "opsCtrl", bindToController: !0, hasBackdrop: !1 }); e.then(function() { K.customOpsChanging = !1 }).catch(function() { K.customOpsChanging = !1, K.optimalSettings = K.recommendedOptimal, K.optimalSettings && K.formSettingsArray() }).finally(function() { K.nvCustomOpsOpen = !1, L() }) }, K.openCustomFps = function() { K.nvCustomFpsOpen = !0; var e = o.show({ template: d.default, locals: { nvSystemGame: K.nvSystemGame, nvCurrentSettingType: K.nvCurrentSettingType, nvClassicViewEnabled: K.nvClassicViewEnabled }, clickOutsideToClose: !0, controller: "CustomFpsController", controllerAs: "fpsCtrl", bindToController: !0, hasBackdrop: !1 }); e.finally(function() { K.nvCustomFpsOpen = !1, L() }) }, K.customSettingsCallback = function(e, t) { e === i.CUSTOM_SETTINGS_UPDATED ? (K.customOpsChanging = !0, K.optimalSettings = t.settings, K.atOptimalIndexPosition = t.atOptimalPosition, K.formSettingsArray()) : e === i.APPLIED_SETTING_SELECTED && (K.customOpsChanging = !1, K.formSettingsArray()) }, K.isMouseHover = function(e) { return e === K.hoverSetting }, K.mouseOver = function(e) { u.cancel(K.hoverPromise), null === e ? k() : K.hoverPromise = u(function() { P(e) }, 100) }; var ee = function(t) { K.isMouseHover(t.name) || (K.hoverSetting = t.name, e.$applyAsync()) }; K.isOptimizeOrCustomOpsButtonDisabled = function() { return K.requestInProgress || K.nvCustomOpsOpen || K.nvCustomFpsOpen }, K.showQuietModeFpsCtrl = function() { return !K.unableToRetrieveSettings() && K.nvCurrentSettingType === K.settingType.SETTING_AC && K.quietModeEnabled }, K.showBatteryBoostFpsCtrl = function() { return !K.unableToRetrieveSettings() && K.nvCurrentSettingType === K.settingType.SETTING_DC && K.frlEnabled && !K.nvSystemGame.isDCDisabled() }, W(), K.nvClassicViewEnabled ? e.$watch("gameSettings.nvSystemGame", function(e) { e && H() }) : H(), e.$on("$destroy", j) }]); t.gameSettingsController = f }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGameSettingsItem = void 0; var r = n(14), o = r.ngGamesModule.directive("nvGameSettingsItem", ["eventAggregator", "GAME_EVENTS", "$interval", "SCROLL_STEPS", "GRADIENT_HEIGHT", function(e, t, n, r, o) { function i(e, t, n, r) { return n * (Math.pow(e / r - 1, 3) + 1) + t } function a(a, l) { function c(e, t, o) { n.cancel(s); var a = 0; s = n(function() { e.scrollTop = i(a, t, o, r), a++, a > r && n.cancel(s) }, 0) } function u(e) { if (!angular.isUndefined(a.setting) && a.setting.name === e.name) { var t = l.parent()[0], n = parseFloat(l[0].offsetTop), r = parseInt(l[0].clientHeight), i = 0, s = parseFloat(t.clientHeight), u = t.scrollTop; n + r > u + s ? (i = n - u - s + r, i += o.FOR_GAME_SETTINGS_TABLE, c(t, u, i)) : n < u && (i = n - u, c(t, u, i)) } } function d() { e.off(t.VOPS_POPUP_SHOWN, u), n.cancel(s), s = null, l.off("$destroy", f), l.empty(), l.remove(), l = null } function f() { a.$destroy() } e.on(t.VOPS_POPUP_SHOWN, u), a.$on("$destroy", d), l.on("$destroy", f) } var s; return { restrict: "E", transclude: !0, template: "", link: a } }]); t.nvGameSettingsItem = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGameSettings = void 0; var o = n(14); n(472), n(466), n(17); var i = n(804), a = r(i); n(471); var s = o.ngGamesModule.directive("nvGameSettings", ["$document", "eventAggregator", "COMMON_EVENTS", function(e, t, n) { return { require: ["^nvOptimization", "nvGameSettings"], restrict: "E", scope: { nvSystemGame: "=", nvCurrentSettingType: "=", nvClassicViewEnabled: "@", nvDesktopMode: "=", nvCustomOpsOpen: "=" }, template: a.default, controller: "GameSettingsController", controllerAs: "gameSettings", bindToController: !0, link: function(r, o) { function i(e) { u.removeClass(e ? "constants-display-none" : "constants-display-flex").addClass(e ? "constants-display-flex" : "constants-display-none") } function a() { var e = c.scrollTop + c.offsetHeight < c.scrollHeight; if (e) return void i(!0); var t = d.scrollTop + d.offsetHeight < d.scrollHeight; i(t) } function s() { c && d && u && (t.on(n.WINDOW_RESIZE, a), d.addEventListener("scroll", a), i(!0)) } function l() { f(), m(), c && d && (t.off(n.WINDOW_RESIZE, a), d.removeEventListener("scroll", a)), c = null, u = null, d = null, o.empty(), o.remove(), o = null } var c = angular.element(e[0].querySelector(".games-game-optimization"))[0], u = angular.element(o[0].querySelector(".common-container-gradient")), d = o[0].querySelector(".game-settings-container"), f = r.$watchGroup(["gameSettings.requestInProgress", "$parent.optimization.selectedTab"], function(t, n) { t !== n && e.ready(function() { a() }) }), m = r.$on("ui.layout.resize", a); r.$on("$destroy", l), o.on("$destroy", function() { r.$destroy() }), s() } } }]); t.nvGameSettings = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gameTagsModalController = void 0; var r = n(14), o = r.ngGamesModule.controller("GameTagsModalController", ["$mdDialog", "$state", function(e, t) { var n = this; angular.isDefined(n.game) && angular.isDefined(n.game.tags) ? (n.gameDisplayName = n.game.displayName, n.gameTags = angular.copy(n.game.tags)) : (n.gameDisplayName = "", n.gameTags = {}), n.accept = function() { e.hide(n.gameTags) }, n.cancel = function() { e.cancel() }, n.managetags = function() { e.cancel(), t.go("main.auth.debugSettings") } }]); t.gameTagsModalController = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gameTileController = void 0; var r = n(14); n(133); var o = r.ngGamesModule.controller("GameTileController", ["$scope", "$state", "userGamesService", function(e, t, n) { var r = this; r.game = e.nvGame, r.isGameOpsSupported = e.nvOpsSupported, r.overlayVisible = !1, r.detailsButtonClickHandler = function() { t.go("main.auth.home.gamesAndFriends.gameDetails", { userGameId: r.game.id }) }, r.toggleFavorite = function(e) { r.userGame.favorite = !r.userGame.favorite, n.updateFavoriteHiddenState(r.userGame.id, r.userGame.favorite, r.userGame.hidden), e.stopPropagation() }, r.toggleVisibility = function(e) { r.userGame.hidden = !r.userGame.hidden, n.updateFavoriteHiddenState(r.userGame.id, r.userGame.favorite, r.userGame.hidden), e.stopPropagation() }, r.showOverlay = function(e) { r.overlayVisible = e }, r.userGame = n.getUserGame(r.game.id) }]); t.gameTileController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGameTile = void 0; var o = n(14); n(17), n(221), n(220), n(34), n(166); var i = n(806), a = r(i); n(475); var s = o.ngGamesModule.directive("nvGameTile", ["$timeout", function(e) { return { restrict: "E", scope: { nvGame: "=", nvGameSelected: "=", nvIndex: "=", nvOpsSupported: "<" }, template: a.default, controller: "GameTileController", controllerAs: "gameTile", link: function(t, n, r, o) { function i() { e.cancel(a), n.empty(), n.remove(), n = null } var a, s = n[0]; o.showTooltip = !1, a = e(function() { var e = angular.element(s.querySelector(".color-white-hue-1")); o.showTooltip = e[0].scrollWidth > e[0].offsetWidth }), t.$on("$destroy", i), n.on("$destroy", function() { t.$destroy() }) } } }]); t.nvGameTile = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.optimizationController = void 0; var o = n(3), i = r(o), a = n(14); n(165), n(11), n(12); var s = a.ngGamesModule.controller("OptimizationController", ["$scope", "SETTING_TYPE", "framerateLimiterService", "dbCacheService", "DB_NAMES", "OPS_TAB", "POWER_MODE", "jarvisService", function(e, t, n, r, o, a, s, l) { function c() { i.isNull(v) || (v.cancel(), v = null), v = m.systemGame.getState(), v.then(function(e) { h = !!m.systemGame.getCurrentSettings() }).finally(function() { v = null }) } function u() { var e = i.indexOf(p.userTabSelectionList, m.systemGame.id); e !== -1 ? p.targetPowerMode === s.DC ? m.selectedTab = a.PLUGGED_IN : m.selectedTab = a.ON_BATTERY : p.targetPowerMode === s.DC ? m.selectedTab = a.ON_BATTERY : m.selectedTab = a.PLUGGED_IN } function d() { var e = m.systemGame.getTargetPowerMode(); e && p.targetPowerMode !== e && (p.targetPowerMode = e, p.userTabSelectionList = [], m.customOpsOpen ? m.changeSelectedTab(m.selectedTab) : p.targetPowerMode === s.DC ? m.selectedTab = a.ON_BATTERY : m.selectedTab = a.PLUGGED_IN) } function f() { p = r.getCachedUserItem(g.userId, o.VIEW_STORE, o.VIEW_STATE), p.targetPowerMode && (d(), u()), e.$watch("optimization.systemGame.getTargetPowerMode()", d) } var m = this, p = {}, g = l.getLoggedInUser(), v = null; m.systemGame = e.nvSystemGame, m.settingType = t, m.frlSupport = !1, m.frlEnabled = !1, m.classicViewEnabled = e.nvClassicViewEnabled, m.opsTab = a, m.selectedTab = a.PLUGGED_IN, m.customOpsOpen = !1; var h = !1; c(), n.getSupportInfo().then(function(e) { e.supported && (m.frlSupport = e.supported, n.getStateInfo().then(function(e) { m.frlEnabled = e.enabled, m.frlEnabled && f() })) }), m.frlSupportAndEnabled = function() { return m.frlSupport && m.frlEnabled && !m.systemGame.isDCDisabled() && h }, m.changeSelectedTab = function(e) { m.selectedTab = e; var t = i.indexOf(p.userTabSelectionList, m.systemGame.id); p.targetPowerMode === s.AC && e === a.ON_BATTERY || p.targetPowerMode === s.DC && e === a.PLUGGED_IN ? t === -1 && p.userTabSelectionList.push(m.systemGame.id) : t !== -1 && p.userTabSelectionList.splice(t, 1) }, m.classicViewEnabled && e.$watch("nvSystemGame", function(e) { e && (m.systemGame = e, c(), u()) }), e.$on("$destroy", function() { m.frlSupport && m.frlEnabled && p.persist_(), i.isNull(v) || (v.cancel(), v = null) }) }]); t.optimizationController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOptimization = void 0; var o = n(14); n(473); var i = n(807), a = r(i); n(477); var s = o.ngGamesModule.directive("nvOptimization", function() { return { restrict: "E", scope: { nvSystemGame: "=", nvClassicViewEnabled: "@" }, template: a.default, controller: "OptimizationController", controllerAs: "optimization", link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvOptimization = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OptimizedIconController = void 0; var r = n(14), o = r.ngGamesModule.controller("OptimizedIconController", ["$scope", "$log", "eventAggregator", "GAME_EVENTS", function(e, t, n, r) { function o(e) { s.nvSystemGame && e.id === s.nvSystemGame.id && (s.optimized = s.nvSystemGame.isACorDCoptimized(), s.warning = !s.nvSystemGame.isACRecommendationAvailable() && (s.nvSystemGame.isDCDisabled() || !s.nvSystemGame.isDCRecommendationAvailable()) || s.nvSystemGame.isRecommendedACBelowMinspecFromState() && s.nvSystemGame.isRecommendedDCBelowMinspecFromState(), s.fontIconClass = s.getFontIcon()) } function i() { n.on(r.GAMESTATE_UPDATED, o), n.on(r.GAMESTATE_INITIALIZED, o), n.on(r.GAMESTATE_FAIL_INITIALIZE, o), l = e.$watch("optimizedIcon.nvSystemGame", function() { o({ id: s.nvSystemGame.id }) }), s.initIcon() } function a() { n.off(r.GAMESTATE_UPDATED, o), n.off(r.GAMESTATE_INITIALIZED, o), n.off(r.GAMESTATE_FAIL_INITIALIZE, o), l() } var s = this; s.fontIconClass = ""; var l = angular.noop; t.getInstance("main.games/OptimizedIconController"); s.getFontIcon = function() { return s.optimized || s.warning ? s.optimized && !s.warning ? "icon-optimized_sm" : "icon-alert-circle_sm" : "icon-notoptimized_sm" }, s.initIcon = function() { s.nvSystemGame && s.nvSystemGame.hasGameState() && o(s.nvSystemGame) }, i(), e.$on("$destroy", a) }]); t.OptimizedIconController = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.playGameController = void 0; var r = n(14), o = r.ngGamesModule.controller("PlayGameController", ["telemetryService", function(e) { function t(e) { e.launchCloud(), event.stopPropagation() } var n = this; n.playLocalGame = function(r) { var o = n.nvSystemGame(); if ("false" === n.nvLocal) return t(o); if (n.nvTelemetry) { var i = JSON.parse(n.nvTelemetry); e.push(i.tarconID, i.url) } o.launch(), r.stopPropagation() } }]); t.playGameController = o }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.vopsController = void 0; var o = n(3), i = r(o), a = n(14); n(11), n(12); var s = a.ngGamesModule.controller("VopsController", ["$scope", "$log", "eventAggregator", "GAME_EVENTS", "GAME_VOPS_STATUS", "dbCacheService", "DB_NAMES", "jarvisService", "localeService", "GAME_SETTINGS_TRANSLATION_STATUS", "BACKEND_STATE_EVENTS", function(e, t, n, r, o, a, s, l, c, u, d) { function f(e) { C.systemGame.shortName === e && (A = o.UNAVAILABLE) } function m(e) { C.systemGame.shortName === e && (A = o.STARTED) } function p(e) { C.systemGame.shortName === e && (A = o.PROGRESS) } function g(e) { C.systemGame.shortName === e && (A = o.FAILED) } function v(e, t, n) { angular.isDefined(t.name) && (angular.isDefined(x[t.name]) ? t.name = x[t.name].translation : M.error("vops settings translation not found for game ", C.systemGame.id, "with setting name ", t.name), t.textInfo[e] && t.textInfo[e].length > 0 ? t.textInfo = t.textInfo[e] : t.textInfo = t.textInfo[c.getDefaultLocaleWithUnderscore()], n.settingInfo.push(t)) } function h() { if (!i.isEmpty(x) && !i.isEmpty(C.gameVops) && !i.isEmpty(C.gameVops.settingInfo)) { var e = [], t = c.getCurrentLocaleWithUnderscore(); i.each(C.gameVops.settingInfo, function(n) { n.vopsSettingEnName = n.name; var r = i.find(e, { image: n.image }); angular.isUndefined(r) ? (r = {}, r.image = n.image, r.settingInfo = [], v(t, n, r), e.push(r)) : v(t, n, r) }), C.gameVops = e, A = o.FINISHED } } function y(e) { C.systemGame.shortName === e.shortName && (i.isUndefined(e.vopsData) || (C.gameVops = e.vopsData), i.isEmpty(C.gameVops) ? A = o.UNAVAILABLE : C.systemGame.getGameSettingsTranslation()) } function E(e) { e.id === C.systemGame.id && (x = e.data, T = u.FINISHED, h()) } function b(e) { e === C.systemGame.id && (T = u.FAILED) } function S() { i.isEmpty(C.gameVops) && C.systemGame.getVOPS() } function _() { n.on(r.GAMEVOPS_STARTED, m), n.on(r.GAMEVOPS_READY, p), n.on(r.GAMEVOPS_NOTREADY, p), n.on(r.GAMEVOPS_UNAVAILABLE, f), n.on(r.GAMEVOPS_FINISHED, y), n.on(r.GAMEVOPS_FAILED, g), n.on(r.SETTINGS_TRANSLATION_FINISHED, E), n.on(r.SETTINGS_TRANSLATION_FAILED, b), n.on(d.READY, S) } function w() { n.off(r.GAMEVOPS_STARTED, m), n.off(r.GAMEVOPS_READY, p), n.off(r.GAMEVOPS_NOTREADY, p), n.off(r.GAMEVOPS_UNAVAILABLE, f), n.off(r.GAMEVOPS_FINISHED, y), n.off(r.GAMEVOPS_FAILED, g), n.off(r.SETTINGS_TRANSLATION_FINISHED, E), n.off(r.SETTINGS_TRANSLATION_FAILED, b), n.off(d.READY) } var A, T, I, C = this, x = [], M = t.getInstance("main.games/VopsController"), D = l.getLoggedInUser(), O = a.getCachedUserItem(D.userId, s.VIEW_STORE, s.VIEW_STATE), R = Date.now(); C.gameVops = {}, C.systemGame = e.nvSystemGame, C.classicViewEnabled = e.nvClassicViewEnabled, e.$on("$destroy", function() { w(), I() }), _(), C.showUnavailable = function() { return A === o.UNAVAILABLE }, C.showVopsPreview = function() { return A === o.FINISHED && T === u.FINISHED }, C.showVopsFailed = function() { return !C.showUnavailable() && (A === o.FAILED || T === u.FAILED) }, C.showLoadingIndicator = function() { return Date.now() - R > 500 && !(C.showVopsPreview() || C.showUnavailable() || C.showVopsFailed()) }, I = e.$on("ui.layout.resize", function(e, t, n) { try { var r = t.size / (t.size + n.size) * 100; n.size <= n.minSize ? (t.uncollapsedSize = "auto", n.uncollapsedSize = n.size) : (t.uncollapsedSize = r + "%", n.uncollapsedSize = 100 - r + "%"), O.vopsImageContainerSize = r + "%", O.persist_() } catch (e) { M.error("ui.layout.resize event error", e) } }), C.classicViewEnabled ? e.$watch("nvSystemGame", function(e) { e && (x = [], C.gameVops = {}, R = Date.now(), C.systemGame = e, C.systemGame.getVOPS()) }) : C.systemGame.getVOPS() }]); t.vopsController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvVops = void 0; var o = n(14); n(132), n(277); var i = n(810), a = r(i); n(481); var s = o.ngGamesModule.directive("nvVops", function() { return { restrict: "E", scope: { nvSystemGame: "=", nvClassicViewEnabled: "@" }, template: a.default, controller: "VopsController", controllerAs: "vops", link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvVops = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.gfnCloudGamesService = void 0; var o = n(3), i = (r(o), n(134)); n(171), n(62); var a = i.ngGfnCloudGamesModule.service("gfnCloudGamesService", ["$log", "$q", "gfnCloudGamesEndpoints", "jarvisService", "eventAggregator", "COMMON_EVENTS", "GFECLIENT_CONFIG", function(e, t, n, r, o, i, a) { function s(e) { e ? l() : (p = !1, g = !1, v = null, o.trigger(i.GFN_CLOUD_GAMES_FEATURE_UPDATED, p)) } function l() { var e = r.getLoggedInUser(); return g || !e ? t.resolve() : v ? v : v = t.when(!1).then(function(e) { d.info("cloud games feature toggle status", e), p = e, o.trigger(i.GFN_CLOUD_GAMES_FEATURE_UPDATED, p) }).catch(function(e) { d.error("failed to get gfn cloud game variant", e) }).finally(function() { g = !0, v = null }) } function c() { return m = n.getSupportedTitles().then(function(e) { d.info("supported titles response:", e); var t = e.data; return f = {}, Array.isArray(t) && t.forEach(function(e) { f[e.gfnGameId] = e }), f }).catch(function(e) { return d.error("failed to get supported titles: ", e), t.reject() }).finally(function() { m = null }) } var u = this, d = e.getInstance("main.gfnCloudGames/gfnCloudGamesService"), f = null, m = null, p = !1, g = !1, v = null; u.initialize = function() { o.on(i.LOGIN_STATUS_CHANGE, s), l() }, u.isGameSupportedForStreaming = function(e) { return l().then(function() { return p ? u.getSupportedTitles().then(function() { return e in f }) : t.reject("feature not supported") }) }, u.getSupportedTitles = function() { return f ? t.when(f) : m ? m : c() }, u.launchGame = function(e) { var o = f[e]; if (!o) return d.error("game not supported or not present: ", e), t.reject("game not supported for streaming"); var i = o.launcher, s = o.launcherGameId; return r.getDelegateToken(a.jarvis.gfnClientId).then(function(r) { var o = r.data.delegateToken; n.startgameStream(i, s, o).then(function(t) { d.info("success launching Cloud Game: ", e) }).catch(function(n) { return d.error("failed to launch cloud game for id: " + e + "with error: " + n), t.reject(n) }) }).catch(function(e) { return d.error("failed to get delegate token: ", e), t.reject(e) }) } }]); t.gfnCloudGamesService = a }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gfnController = void 0; var r = n(28); n(63); var o = r.ngGfnModule.controller("gfnController", ["$state", "tbdService", function(e, t) { var n = this; n.pageNo = e.params.tabId, n.pageNo || (n.pageNo = "0"), t.getBannerTexts().then(function(e) { n.labels = e }) }]); t.gfnController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGfn = void 0; var o = n(28); n(487), n(299), n(496); var i = n(811), a = r(i); n(484); var s = o.ngGfnModule.directive("nvGfn", function() { return { restrict: "E", scope: {}, template: a.default, controller: "gfnController", controllerAs: "gfn" } }); t.nvGfn = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gfnFeatureController = void 0; var r = n(28); n(63); var o = r.ngGfnModule.controller("gfnFeatureController", ["tbdService", function(e) { var t = this; e.getBannerTexts().then(function(e) { t.bannerTexts = e }) }]); t.gfnFeatureController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGfnFeature = void 0; var o = n(28); n(287), n(498); var i = n(812), a = r(i); n(486); var s = o.ngGfnModule.directive("nvGfnFeature", function() { return { restrict: "E", template: a.default, controller: "gfnFeatureController", controllerAs: "gfnFeature" } }); t.nvGfnFeature = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gameStoreController = void 0; var r = n(28); n(63); var o = r.ngGfnModule.controller("GameStoreController", ["$scope", "$log", "tbdService", "$state", function(e, t, n, r) { var o = this; o.gameStoreList = [], o.gameType = e.nvGameType; var i = t.getInstance("main.gfn/GameStoreController"); "genre" === o.gameType ? n.getGfnStoreGamesByGenre(r.params.id).then(function(e) { o.gameStoreList = e }, function(e) { i.error("getGfnStoreGamesByGenre failed with latestGameList: " + e.status) }) : n.getGfnStoreGamesByType(o.gameType).then(function(e) { o.gameStoreList = e }, function(e) { i.error("getGfnStoreGamesByType failed with latestGameList: " + e.status) }) }]); t.gameStoreController = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gameStoreItemController = void 0; var r = n(28), o = r.ngGfnModule.controller("GameStoreItemController", ["$scope", function(e) { var t = this, n = e.nvGetGame(); t.nvGame = n, t.nvGameType = e.nvShowType, t.onClickedGameItem = function() {}, t.isNeedPurchase = function() { if ("undefined" == typeof t.nvGame) return !1; var e = !t.nvGame.storeInfo.isPurchased && 0 !== t.nvGame.storeInfo.price; return e } }]); t.gameStoreItemController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGameStoreItem = void 0; var o = n(28), i = n(813), a = r(i); n(489); var s = o.ngGfnModule.directive("nvGameStoreItem", function() { return { restrict: "E", scope: { nvGetGame: "&nvGame", nvShowType: "@" }, template: a.default, controller: "GameStoreItemController", controllerAs: "gameItem" } }); t.nvGameStoreItem = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gfnGenreGamesController = void 0; var r = n(28), o = r.ngGfnModule.controller("gfnGenreGamesController", ["$state", function(e) { var t = this; switch (t.pageNo = e.params.id, e.params.id) { case "action": t.goBackString = "l10n.genre.action"; break; case "adventure": t.goBackString = "l10n.genre.adventure"; break; case "arcade": t.goBackString = "l10n.genre.arcade"; break; case "family": t.goBackString = "l10n.genre.family"; break; case "fps": t.goBackString = "l10n.genre.fps"; break; case "puzzle": t.goBackString = "l10n.genre.puzzle"; break; case "racing": t.goBackString = "l10n.genre.racing"; break; case "rolePlaying": t.goBackString = "l10n.genre.rolePlaying" } }]); t.gfnGenreGamesController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGenreGames = void 0; var o = n(28); n(299); var i = n(815), a = r(i); n(491); var s = o.ngGfnModule.directive("nvGenreGames", function() { return { restrict: "E", template: a.default, controller: "gfnGenreGamesController", controllerAs: "gfnGenreGames" } }); t.nvGenreGames = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gfnGenreItemController = void 0; var r = n(28), o = r.ngGfnModule.controller("gfnGenreItemController", ["$scope", function(e) { var t = this, n = e.nvGenre(); t.id = n.genreId, t.img = n.img, t.name = n.spec }]); t.gfnGenreItemController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGenreItem = void 0; var o = n(28), i = n(816), a = r(i); n(493); var s = o.ngGfnModule.directive("nvGenreItem", function() { return { restrict: "E", scope: { nvGenre: "&nvGenre" }, template: a.default, controller: "gfnGenreItemController", controllerAs: "gfnGenreItem" } }); t.nvGenreItem = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gfnGenresController = void 0; var r = n(28), o = r.ngGfnModule.controller("gfnGenresController", function() { var e = this; e.genreList = [{ genreId: "action", img: "mocks/assets/gfn/img/genres-action.png", spec: "l10n.genre.action" }, { genreId: "adventure", img: "mocks/assets/gfn/img/genres-adventure2.png", spec: "l10n.genre.adventure" }, { genreId: "arcade", img: "mocks/assets/gfn/img/genres-arcade2.png", spec: "l10n.genre.arcade" }, { genreId: "family", img: "mocks/assets/gfn/img/genres-family2.png", spec: "l10n.genre.family" }, { genreId: "fps", img: "mocks/assets/gfn/img/genres-firstpersonshooter.png", spec: "l10n.genre.fps" }, { genreId: "puzzle", img: "mocks/assets/gfn/img/genres-puzzle.png", spec: "l10n.genre.puzzle" }, { genreId: "racing", img: "mocks/assets/gfn/img/genres-racing.png", spec: "l10n.genre.racing" }, { genreId: "rolePlaying", img: "mocks/assets/gfn/img/genres-roleplaying.png", spec: "l10n.genre.rolePlaying" }] }); t.gfnGenresController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvGfnGenres = void 0; var o = n(28); n(494); var i = n(817), a = r(i); n(495); var s = o.ngGfnModule.directive("nvGfnGenres", function() { return { restrict: "E", template: a.default, controller: "gfnGenresController", controllerAs: "gfnGenres" } }); t.nvGfnGenres = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.latestGamesController = void 0; var r = n(28); n(63); var o = r.ngGfnModule.controller("LatestGamesController", ["$log", "tbdService", function(e, t) { var n = this; n.latestGameList = []; var r = e.getInstance("main.gfn/LatestGamesController"); t.getGfnLatestGames().then(function(e) { n.latestGameList = e }, function(e) { r.error("getGfnLatestGames failed with latestGameList: " + e.status) }) }]); t.latestGamesController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvLatestGameItem = t.nvLatestGames = void 0; var o = n(28), i = n(819), a = r(i), s = n(818), l = r(s); n(497); var c = o.ngGfnModule.directive("nvLatestGames", function() { return { restrict: "E", template: a.default, controller: "LatestGamesController", controllerAs: "games" } }), u = o.ngGfnModule.directive("nvLatestGameItem", function() { return { restrict: "E", scope: { nvGame: "=" }, template: l.default } }); t.nvLatestGames = c, t.nvLatestGameItem = u }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.gfwslArticleEndpoints = void 0; var o = n(13), i = r(o), a = n(52), s = a.ngGfwslSdkModule.provider("gfwslArticleEndpoints", [function() { var e, t; return { setConfig: function(n) { e = n.server, t = n.defaultTimeout || t }, $get: ["NvEndpointFactory", "gfwslEndpoints", "gfeService", "httpTelemetryService", "TELEMETRY_ORIGINAL_SERVICE_NAME", function(n, r, o, a, s) { var l = new n; l.setDefaultTimeout(t), l.setUrlGenerator(function(e, t) { var n, o; return t = t || {}, t.gfwslParams ? (n = r.getParams(JSON.parse(t.gfwslParams)), delete t.gfwslParams) : n = r.getParams({}), o = t.articleUrl || "", delete t.articleUrl, _.isEmpty(n) || (o += (0, i.default)(n)), o }), l.setHttpFunc(function(t) { return a.endpointHttpCallback(t, o.onlineState.online, e, s.GFWSL) }); var c = l.createEndpoint({ url: ":articleUrl", method: "GET", headers: { telemetry: "GetArticle" }, params: { articleUrl: "" } }); return { getArticleUrl: l.generateFullUrl, getArticle: c } }] } }]); t.gfwslArticleEndpoints = s }, , function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.notificationsController = void 0; var o = n(227); n(186), n(16); var i = n(3), a = r(i), s = o.ngNotificationsModule.controller("NotificationsController", ["eventAggregator", "NOTIFICATION_EVENTS", "$scope", "jarvisService", "dbCacheService", "DB_NAMES", "COMMON_EVENTS", "$log", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "$document", "$filter", "$timeout", function(e, t, n, r, o, i, s, l, c, u, d, f, m) { function p() { _.notificationList.forEach(function(e) { e.readableTime = f("convertUTCToTimeAgo")(e.availableTime) }) } function g() { return T(), A ? (_.isNotificationMenuVisible = !0, void v(!1)) : void I.error("notification automatically shown when view state is null returning") } function v(e) { _.showIndicator = e, A.showIndicator = e, A.persist_() } function h(e) { if (!A) return void I.error("new notification recieved when view state is null returning"); var t = new Date, n = e.notifications, r = !1, o = [], i = !1; I.info("notifications data received", n), n.forEach(function(e) { if (!a.findWhere(_.notificationList, { callbackData: e.callbackData })) { if (A[e.callbackData]) { if (A[e.callbackData].removed) return; A[e.callbackData].notificationTs || (A[e.callbackData].notificationTs = t, i = !0), e.availableTime = A[e.callbackData].notificationTs } else r = !0, A[e.callbackData] = { notificationTs: t, removed: !1 }, e.availableTime = t, o.push(e.type); e.readableTime = f("convertUTCToTimeAgo")(e.availableTime), _.notificationList.push(e) } }), I.info("notification list data", _.notificationList), _.notificationList = a.sortBy(_.notificationList, function(e) { return e.availableTime.getTime() }).reverse(), i && !r && A.persist_(), r && (_.notificationList[0].firstNotificationHighResolution && (A.lastBigNotificationShown = _.notificationList[0].availableTime), A.showIndicator = !0, A.persist_(), a.each(a.uniq(o), function(e) { c.push(u.NOTIFICATION_IN_APP_NEW_ITEMS_AVAILABLE, { category: e, description: "" }) })), _.showIndicator = A.showIndicator && _.notificationList.length > 0 } function y(e) { for (var t = 0; t < _.notificationList.length; t++) if (_.notificationList[t].callbackData === e) { _.notificationList.splice(t, 1); break } } function E(e) { for (var t = 0; t < e.length; t++) y(e[t].callbackData) } function b() { w = r.getLoggedInUser(), w ? (I.info("fetching notification view state at user logged in"), A = o.getCachedUserItem(w.userId, i.JARVIS_GFE_STORE, i.NOTIFICATIONS_VIEW_STATE), I.info("displaying notification view state at user logged in ", A), A ? A.wait_().then(function() { e.trigger(t.VIEWSTATE_INITIALIZED) }) : I.error("Unable to fetch notifications view state in user logged in")) : (I.info("setting notification view state null at user logged out"), w = null, A = null, _.notificationList = [], _.showIndicator = !1) } function S() { I.info("initializing notfications controller"), e.on(t.NEW_NOTIFICATION, h), e.on(t.REMOVE_NOTIFICATION, E), e.on(s.LOGIN_STATUS_CHANGE, b), b() } var _ = this, w = r.getLoggedInUser(), A = null, T = null, I = l.getInstance("main.notifications/notificationController"); _.notificationList = [], _.showIndicator = !1, _.isNotificationMenuVisible = !1; var C; _.onInit = function(n) { T = n, e.on(t.OPEN_NOTIFICATION_MENU, g) }, _.getNotificationBadgeNumber = function() { return _.showIndicator && _.notificationList.length || "" }, _.onNotificationClicked = function(e) { if (!A) return void I.error("notification clicked when view state is null returning"); e.clickToRemove && (A[e.callbackData].removed = !0, m(function() { y(e.callbackData) }, 300)), v(!1), e.callbackFunction && e.callbackFunction(e.callbackData); var t = e.telemetryDescription || e.callbackData; c.push(u.NOTIFICATION_IN_APP_ITEM_CLICKED, { category: e.type, description: t || "" }) }, _.showNotifications = function(e) { if (!_.nvDisabled) { if (e.open(), !A) return void I.error("notification shown when view state is null returning"); p(), _.isNotificationMenuVisible = !0, v(!1), c.push(u.NOTIFICATION_IN_APP_ICON_CLICKED) } }, _.showBigNotification = function(e, t) { return A ? !(0 !== e || !t.firstNotificationHighResolution) && A.lastBigNotificationShown <= t.availableTime : void I.error("big notification shown when view state is null returning") }, _.showTooltip = function(e, t) { if (_.isNotificationMenuVisible) { var n = angular.element(d[0].querySelector("#" + t + e)); if (n && n[0]) return n[0].scrollWidth > n[0].offsetWidth } return !1 }, n.$on("$destroy", function() { e.off(t.NEW_NOTIFICATION, h), e.off(t.REMOVE_NOTIFICATION, E), e.off(s.LOGIN_STATUS_CHANGE, b), C() }), C = n.$on("$mdMenuClose", function() { _.isNotificationMenuVisible = !1 }), S() }]); t.notificationsController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvNotifications = void 0; var o = n(227); n(276), n(41); var i = n(821), a = r(i); n(501), n(370); var s = o.ngNotificationsModule.component("nvNotifications", { template: a.default, controller: "NotificationsController", controllerAs: "notifications", bindings: { nvDisabled: "<" } }); t.nvNotifications = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeAuthChooseController = void 0; var r = n(9); n(19), n(12), n(16); var o = r.ngOobeModule.controller("OobeAuthChooseController", ["$log", "gfeService", "jarvisService", "telemetryService", "oobeTelemetryService", "OOBE_LOGIN", "$q", "preferencesService", "cefService", "eventAggregator", "COMMON_EVENTS", "windowSpawnService", "localeService", function(e, t, n, r, o, i, a, s, l, c, u, d, f) { function m() { c.off(u.CHILD_WINDOW_LOADED, m), y.info("OAuth load completed in time(ms):", new Date - _) } function p() { S || h.onCancelOauth(), c.off(u.CHILD_WINDOW_CLOSED, p), c.off(u.CHILD_WINDOW_LOADED, m) } function g(e) { var t = new Date; y.info("user crendentials verification successfull. Attempting session create"); var o = n.getUserTokenFromCode(e).then(function(e) { return n.loginWithRegistrationToken(e.data.loginToken).then(function(e) { return y.info("session create successfull, total time(ms): ", new Date - t), r.setEventsCommonData({ userId: e.user.userId }, !0), e }).catch(function(e) { return y.error("login with registration token failed", e), a.reject(e) }) }).catch(function(e) { return y.error("get user token from code failed", e), h.message = "l10n.loginServerError", h.showLoadingIndicator = !1, a.reject(e) }); h.showLoadingIndicator = !0; var i = E[b]; return h.oobeAuthCtrl.handleLoginAttempt(o, !1, i) } function v(e) { return y.debug("Show Oauth Dialog", e), b = e, h.oobeAuthCtrl.loginType = i.SOCIAL, h.oobeAuthCtrl.provider = e, n.getOauthUrl(e).then(function(t) { h.showOauthDialog(t, w[e].width, w[e].height) }) } var h = this, y = e.getInstance("main.oobe/OobeAuthChooseController"), E = { google: "SIGN_IN_WITH_GOOGLE", facebook: "LOGIN_WITH_FACEBOOK", qq: "LOGIN_WITH_QQ", wechat: "LOGIN_WITH_WECHAT", jarvisOAuth: "LOGIN_WITH_JARVIS_OAUTH" }, b = void 0, S = !1, _ = null, w = { google: { width: 475, height: 675 }, facebook: { width: 475, height: 675 }, qq: { width: 475, height: 675 }, wechat: { width: 475, height: 675 }, jarvisOAuth: { width: 475, height: 675 } }; h.$onInit = function() { h.message = "", o.updateScreen("SCREEN_OOBE_ACCOUNT_CHOOSER"), h.messageTranslateValues = {}, h.onlineState = t.onlineState, h.showGoogleLogin = !0, h.showFacebookLogin = !0, h.showNvLogin = !0, h.showQqLogin = !0, h.showWechatLogin = !0, h.showLoadingIndicator = !1, s.onUpdateHighlightsDisplayed().then(function() { h.initLoginWithJarvisOAuth() }) }, h.showOauthDialog = function(e, t, n) { l.deleteCookies(".google.com", ""), l.deleteCookies(".facebook.com", ""); var r = n ? n : 675, o = t ? t : 475, i = window.screenY + window.innerHeight / 2 - r / 2, a = window.screenX + window.innerWidth / 2 - o / 2, s = "toolbar=0,location=0,menubar=0,width=" + o + ",height=" + r + ",top=" + i + ",left=" + a; S = !1, c.on(u.CHILD_WINDOW_CLOSED, p), _ = new Date, y.info("OAuth Load Started"), d.openChildWindow(e, "app_oauth_window_with_back_button", s, {}, !0, h.messageEventListener), c.on(u.CHILD_WINDOW_LOADED, m), y.info("New oauth child window should have opened with url: ", e), y.info("Pop-Up window loaded in time(ms):", new Date - _) }, h.hideOauthDialog = function() { S = !0, d.closeChildWindow() }, h.onClickNVIDIA = function() { h.onlineState.online && (o.recordAction("OOBE_LOGIN_WITH_NVIDIA"), h.oobeAuthCtrl.showLogin()) }, h.initLoginWithJarvisOAuth = function() { if (h.message = "", h.onlineState.online) { b = i.JARVIS_OAUTH, o.startActionAsync(E[b]); var e = n.getLoginWithOauthUrl({ locale: f.getCurrentCMSLocale() }); h.showOauthDialog(e, w[b].width, w[b].height) } }, h.onClickGoogle = function() { h.onlineState.online && (o.startActionAsync("SIGN_IN_WITH_GOOGLE"), v(i.GOOGLE)) }, h.onClickFacebook = function() { h.onlineState.online && (o.startActionAsync("LOGIN_WITH_FACEBOOK"), v(i.FACEBOOK)) }, h.onClickQq = function() { h.onlineState.online && (o.startActionAsync("LOGIN_WITH_QQ"), v(i.QQ)) }, h.onClickWeChat = function() { h.onlineState.online && (o.startActionAsync("LOGIN_WITH_WECHAT"), v(i.WECHAT)) }, h.messageEventListener = function(e) { var t = e.data.code; return y.info("Message received in time(ms) :", new Date - e.data.time), h.hideOauthDialog(), t && g(t) }, h.onCancelOauth = function() { o.endActionAsync(E[b], "CANCELLED") }, h.messageBanner = function() { return h.onlineState.online ? h.message : "l10n.mustBeOnline" }, h.toggleLoginOptions = function() { h.showGoogleLogin = !h.showGoogleLogin, h.showFacebookLogin = !h.showFacebookLogin, h.showNvLogin = !h.showNvLogin, h.showQqLogin = !h.showQqLogin, h.showWechatLogin = !h.showWechatLogin, h.showMoreLogin = !h.showMoreLogin } }]); t.oobeAuthChooseController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeAuthChoose = void 0; var o = n(9), i = n(822), a = r(i); n(503); var s = o.ngOobeModule.component("nvOobeAuthChoose", { bindings: { message: "@" }, template: a.default, controller: "OobeAuthChooseController", controllerAs: "oobeAuthChooseCtrl", require: { oobeAuthCtrl: "^^nvOobeAuth" } }); t.nvOobeAuthChoose = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeAuthController = void 0; var o = n(9); n(16), n(22), n(12), n(11), n(55), n(301); var i = n(3), a = r(i), s = o.ngOobeModule.controller("OobeAuthController", ["$log", "oobeDialogService", "telemetryService", "dbCacheService", "hardwareService", "gfeService", "nvAccountService", "cevoToggleService", "jarvisService", "oobeTelemetryService", "OOBE_STATE", "OOBE_LOGIN", "eventAggregator", "OOBE_EVENTS", function(e, t, n, r, o, i, s, l, c, u, d, f, m, p) { function g(e) { y.nvActiveAuthView = e, m.trigger(p.AUTH_VIEW_CHANGED, e) } function v(e) { var t = !1; o.getLaunchTimeSystemInfo().then(function(e) { t = !a.propertyOf(e)("DriverVersion") }).finally(function() { t ? y.oobeCtrl.onShowNoDriver() : y.oobeCtrl.onLoggedIn(e) }) } function h(e) { l.getAvatarStore().then(function(t) { var n = r.getCachedUserItem(e.userId, t.storeName, t.key); n.sync_().finally(function() { return g("sync"), i.syncData(e).then(function(t) { E.info("Sync Complete"), u.endActionAsync("SYNC", "SUCCESS"), v(e) }) }) }) } var y = this, E = e.getInstance("main.oobe/OobeAuthController"); y.$onInit = function() { y.selectView() }, y.selectView = function() { y.nvOobeParams.user ? h(y.nvOobeParams.user) : (s.deleteJarvisUserToken(), a.propertyOf(y.nvOobeParams)("sessionExpired") ? y.showAccountChooser("l10n.sessionExpired") : y.showAccountChooser()) }, y.showAccountChooser = function(e) { y.message = e, g("choose") }, y.showLogin = function(e, t) { y.loginType = f.TRADITIONAL, y.prefilledLogin = e, y.message = t, g("nvLogin") }, y.showRegister = function() { y.registerType = f.TRADITIONAL, g("nvRegister") }, y.showRegisterSocial = function(e) { y.registerType = f.SOCIAL, y.prefilledRegistration = e, g("nvRegister") }, y.showForgotPassword = function() { g("forgotPassword") }, y.showEmailVerification = function(e, t) { E.debug("showEmailVerification", t), y.sessionObject = e, y.verificationType = t, g("verification") }, y.showEditEmail = function(e) { E.debug("showEditEmail"), y.sessionObject = e, g("editEmail") }, y.showQrCodeForScan = function(e, t) { E.debug("showQrCodeScan"), y.sessionObject = e, y.emailVerification = t, E.debug("onRegister", t), "skip" === t ? (E.debug("Email verificaiton skipped"), y.handleLoggedIn(e)) : (E.debug("Email verificaiont is required"), y.showEmailVerification(e, "registered")) }, y.attemptLogin = function(e, t, r) { E.info("attempting Login."); var o = c.loginUsernamePassword(e, t).then(function(e) { return n.setEventsCommonData({ userId: e.user.userId }, !0), e }); return y.handleLoginAttempt(o, !1, r) }, y.handleLoginAttempt = function(e, n, r) { return e.then(function(e) { e.user.core.primaryEmailVerified ? (E.debug("email verified - start session"), u.endActionAsync(r, "SUCCESS"), y.handleLoggedIn(e)) : t.skipEmailVerification(e, y.loginType, y.provider).then(function(t) { t ? (u.endActionAsync(r, "EMAIL_VERIFICATION_SKIPPED"), y.handleLoggedIn(e)) : (E.debug("email not verified - show verification dialog. Address changed:", n === !0), n ? (u.endActionAsync(r, "EMAIL_NOT_VERIFIED"), y.showEmailVerification(e, "emailUpdated")) : y.attemptResendVerification(e.user.core.primaryEmail).then(function() { E.info("automatically resent verification email"), u.endActionAsync(r, "EMAIL_NOT_VERIFIED") }).catch(function(t) { E.error("Failed to re-send verification email automatically. Continue anyway."), u.endActionAsync(r, "EMAIL_NOT_VERIFIED_RESEND_FAILED"), y.showEmailVerification(e) })) }) }) }, y.handleLoggedIn = function(e) { c.startSession(e).then(function() { t.getState() !== d.COMPLETED_ALL && t.setState(d.COMPLETED_LOGIN), h(e.user) }).finally(function() { oobeAuthChooseCtrl.showLoadingIndicator = !1 }) }, y.attemptResendVerification = function(e) { return E.debug("re-send verification email pressed."), c.requestVerificationEmail(e) }, y.isLeftPaneVisible = function() { return !("choose" === y.nvActiveAuthView) }, y.handleLoggedIn({ sessionToken: "dummySessionToken", userToken: "dummyUserToken", user: { core: { displayName: "Anonymous", primaryEmailVerified: true } } }); }]); t.oobeAuthController = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeAuthEditEmailController = void 0; var r = n(9); n(12); var o = r.ngOobeModule.controller("OobeAuthEditEmailController", ["$log", "jarvisService", "oobeTelemetryService", function(e, t, n) { function r() { n.updateScreen("SCREEN_OOBE_EMAIL_EDIT") } function o(e, n, r) { return a.info("attemptChangeEmailAddress."), t.changeEmailAddressWithSessionObject(e, n, r).then(function(e) { var r = t.loginWithRegistrationToken(e.loginToken, n); return i.oobeAuthCtrl.handleLoginAttempt(r, !0, "SUBMIT") }) } var i = this, a = e.getInstance("main.oobe/OobeAuthEditEmailController"); i.emailChanged = function() { i.emailForm.email.$setValidity("notAvailable", !0) }, i.passwordChanged = function() { i.emailForm.password.$setValidity("invalidPassword", !0) }, i.onDone = function() { n.startActionAsync("SUBMIT"), i.emailForm.$invalid ? (a.debug("tried to submit invalid form"), n.endActionAsync("SUBMIT", "INVALID_FORM"), i.emailForm.password.$setTouched(), i.emailForm.email.$setTouched(), i.emailForm.reEnterEmail.$setTouched()) : (i.message = null, i.waiting = !0, i.nvSessionObject.user.core.primaryEmail === i.email ? (a.debug("Email did not change. Resend verification"), i.oobeAuthCtrl.attemptResendVerification(i.email).then(function(e) { n.endActionAsync("SUBMIT", "SUCCESS"), i.oobeAuthCtrl.showEmailVerification(i.nvSessionObject, "resent") }).catch(function(e) { n.endActionAsync("SUBMIT", "HTTP_ERROR", e.status), i.oobeAuthCtrl.showEmailVerification(i.nvSessionObject, "error") })) : (a.debug("Email has changed. Attempt to change email address"), o(i.nvSessionObject, i.email, i.password).catch(function(e) { n.endActionAsync("SUBMIT", "HTTP_ERROR", e.status), i.waiting = !1, 401 === e.status ? (a.debug("Change Email: Invalid credentials"), i.emailForm.password.$setValidity("invalidPassword", !1), i.emailForm.password.$setTouched()) : 403 === e.status ? (a.debug("Change Email: Account has no password, must be a social-only account"), i.message = "l10n.noPassword") : 409 === e.status ? (a.debug("Change Email: Email address is already being used"), i.emailForm.email.$setValidity("notAvailable", !1), i.emailForm.email.$setTouched()) : (a.debug("Change Email: Generic server error. status:", e.status), i.message = "l10n.unableToConnect") }))) }, i.onCancel = function() { a.debug("cancel pressed"), n.recordAction("OOBE_CANCEL"), i.oobeAuthCtrl.showEmailVerification(i.nvSessionObject, "default") }, r() }]); t.oobeAuthEditEmailController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeAuthEditEmail = void 0; var o = n(9), i = n(823), a = r(i); n(506); var s = o.ngOobeModule.directive("nvOobeAuthEditEmail", [function() { return { restrict: "E", scope: { nvSessionObject: "=" }, bindToController: !0, template: a.default, controller: "OobeAuthEditEmailController", controllerAs: "oobeAuthEditEmailCtrl", require: "^^nvOobeAuth", link: function(e, t, n, r) { e.oobeAuthEditEmailCtrl.oobeAuthCtrl = r } } }]); t.nvOobeAuthEditEmail = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeAuthForgotPasswordController = void 0; var r = n(9); n(12); var o = r.ngOobeModule.controller("OobeAuthForgotPasswordController", ["$log", "jarvisService", "oobeTelemetryService", function(e, t, n) { function r() { n.updateScreen("SCREEN_OOBE_FORGOT_PASSWORD"), a.sentView = !1 } function o(e) { n.endActionAsync("SUBMIT", "SUCCESS"), a.sentView = !0, a.waiting = !1 } function i(e) { s.debug("Reset: request failed with status:", e.status), n.endActionAsync("SUBMIT", "HTTP_ERROR", e.status), a.waiting = !1, a.message = "l10n.unableToSendRecovery" } var a = this, s = e.getInstance("main.oobe/OobeAuthForgotPasswordController"); a.onSubmit = function() { n.startActionAsync("SUBMIT"), a.forgotForm.$invalid ? (n.endActionAsync("SUBMIT", "INVALID_FORM"), s.debug("Submit invalid form"), a.forgotForm.email.$setTouched()) : (s.info("attemptResetPassword email"), a.waiting = !0, t.resetPassword(a.email).then(o, i)) }, a.onCancel = function() { n.recordAction("OOBE_CANCEL"), a.oobeAuthCtrl.showLogin() }, a.onDone = function() { n.recordAction("OOBE_DONE"), a.oobeAuthCtrl.showLogin() }, r() }]); t.oobeAuthForgotPasswordController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeAuthForgotPassword = void 0; var o = n(9), i = n(824), a = r(i); n(508); var s = o.ngOobeModule.directive("nvOobeAuthForgotPassword", [function() { return { restrict: "E", scope: {}, bindToController: !0, template: a.default, controller: "OobeAuthForgotPasswordController", controllerAs: "oobeAuthForgotPasswordCtrl", require: "^^nvOobeAuth", link: function(e, t, n, r) { e.oobeAuthForgotPasswordCtrl.oobeAuthCtrl = r } } }]); t.nvOobeAuthForgotPassword = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeAuthNvLoginController = void 0; var o = n(9); n(26), n(16); var i = n(3), a = r(i), s = o.ngOobeModule.controller("OobeAuthNvLoginController", ["$log", "gfeService", "oobeTelemetryService", "jarvisService", function(e, t, n, r) { function o() { n.updateScreen("SCREEN_OOBE_LOGIN_NVIDIA"), r.getFormValidationObject().then(function(e) { angular.merge(i.validationObject, e.AuthenticationData) }), i.message = null, i.messageTranslateValues = {}, i.onlineState = t.onlineState, a.extend(i, i.nvPrefilled) } var i = this, s = e.getInstance("main.oobe/OobeAuthNvLoginController"), l = 0; i.validationObject = { email: {}, password: {} }, i.onSubmit = function() { var e = 30; n.startActionAsync("SUBMIT"), i.loginForm.$invalid ? (s.debug("Submit invalid form"), n.endActionAsync("SUBMIT", "INVALID_FORM"), i.loginForm.email.$setTouched(), i.loginForm.password.$setTouched()) : (s.debug("Submit valid form, attempt login"), i.waiting = !0, i.oobeAuthCtrl.attemptLogin(i.email, i.password, "SUBMIT").catch(function(t) { if (n.endActionAsync("SUBMIT", "HTTP_ERROR", a.propertyOf(t)("status")), i.waiting = !1, 401 === t.status) l += 1, s.debug("Login: invalid credentials attempts: ", l), i.loginForm.email.$setValidity("invalidCredentials", !1), i.loginForm.password.$setValidity("invalidCredentials", !1), i.loginForm.email.$setTouched(), i.loginForm.password.$setTouched(), i.message = "l10n.invalidCredentials"; else if (403 === t.status) { s.debug("Login: account temporarily blocked"); try { e = Math.ceil(parseInt(t.headers()["retry-after"]) / 60) } catch (t) { s.error("Login: Error parsing retry-after. Defaulting to ", e, " minutes") } i.messageTranslateValues.blockedMinutes = e, i.message = "l10n.accountBlocked" } else s.debug("Login: generic server failure with status:", t.status), i.message = "l10n.loginServerError" })) }, i.onClickRegister = function() { n.recordAction("OOBE_NVIDIA_ACCOUNT_CREATE_NEW_ACCOUNT"), i.oobeAuthCtrl.showRegister() }, i.onClickForgotPassword = function() { n.recordAction("OOBE_LOGIN_FORGOT_PASSWORD"), i.oobeAuthCtrl.showForgotPassword() }, i.onClickBack = function() { n.recordAction("OOBE_BACK"), i.oobeAuthCtrl.showAccountChooser() }, i.fieldsChanged = function() { i.loginForm.email.$setValidity("invalidCredentials", !0), i.loginForm.password.$setValidity("invalidCredentials", !0) }, i.messageBanner = function() { return i.onlineState.online ? i.message : "l10n.mustBeOnline" }, o() }]); t.oobeAuthNvLoginController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeAuthNvLogin = void 0; var o = n(9), i = n(825), a = r(i); n(284), n(285), n(510); var s = o.ngOobeModule.directive("nvOobeAuthNvLogin", [function() { return { restrict: "E", scope: { message: "@", nvPrefilled: "=" }, bindToController: !0, template: a.default, controller: "OobeAuthNvLoginController", controllerAs: "oobeAuthNvLoginCtrl", require: "^^nvOobeAuth", link: function(e, t, n, r) { e.oobeAuthNvLoginCtrl.oobeAuthCtrl = r } } }]); t.nvOobeAuthNvLogin = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeAuthNvRegisterController = void 0; var r = n(9); n(12), n(16), n(357), n(31), n(26), n(11); var o = r.ngOobeModule.controller("OobeAuthNvRegisterController", ["$log", "$translate", "$scope", "$q", "jarvisService", "dbCacheService", "DB_NAMES", "oobeTelemetryService", "telemetryService", "gfwslService", "dialogService", "gfeService", "oobeOptionsService", "gfeTargetService", "OOBE_LOGIN", "localeService", "ACTIVE_EXPERIMENTS", "OOBE_VALIDATION_ELEMENTS", "OOBE_VALIDATION_ERRORS", function(e, t, n, r, o, i, a, s, l, c, u, d, f, m, p, g, v, h, y) { function E() { x.locale = g.getCurrentLocale().code, "zh-CHS" === x.locale ? x.locale = "zh-CN" : "zh-CHT" === x.locale && (x.locale = "zh-TW"), M.debug("Locale obtained:", x.locale), x.regView = "register", x.nvType === p.SOCIAL ? (s.updateScreen("SCREEN_OOBE_REGISTRATION_SOCIAL"), x.title = "l10n.almostDone") : (s.updateScreen("SCREEN_OOBE_REGISTRATION_NVIDIA"), x.title = "l10n.createAccount"), x.onlineState = d.onlineState, angular.merge(x.regModel, x.nvPrefilled), x.nvType === p.SOCIAL && x.regModel.email && x.regModel.email.length > 0 && (x.emailDisabled = !0), x.waiting = !0, f.isNewsLetterChecked().then(function(e) { x.regModel.subscribe = e }).catch(function(e) { x.regModel.subscribe = !1 }).finally(function() { x.waiting = !1 }) } function b(e) { return e && 400 === e.status && e.data && _.findWhere(e.data.details, { field: "birthdate", reason: "VALUE_OUT_OF_RANGE" }) } function S(e, t) { var n = i.getCachedUserItem(e, a.JARVIS_COMMON_STORE, a.SUBSCRIPTIONS), r = o.getSubscriptionData(n); return r.state = t, n.persist_() } function w(e) { try { M.error("status:", e.status), M.error("statusText:", e.statusText), M.error("data:", e.data) } catch (e) { M.error("no valid response provided from server", e) } } function A() { M.debug("showTermsAndConditionsDialog"), s.startActionAsync("AGREE_TO_TERMS_LINK"), c.getTermsAndConditions().then(function(e) { try { s.endActionAsync("AGREE_TO_TERMS_LINK", "SUCCESS"), u.show("nv-dialog-html", { style: "dialog-service-container-size", title: "l10n.termsAndConditions", html: e.data.gfcontent.body, closeButton: { action: u.cancel } }) } catch (t) { return M.error("parse failure showing terms and conditions"), s.endActionAsync("AGREE_TO_TERMS_LINK", "PARSE_ERROR"), r.reject(e) } }).catch(function(e) { M.error("http failure showing terms and conditions"), s.endActionAsync("AGREE_TO_TERMS_LINK", "HTTP_ERROR", _.propertyOf(e)("status")), w(e) }) } function T() { M.debug("showPrivacyPolicyDialog"), s.startActionAsync("PRIVACY_POLICY_LINK"), c.getPrivacyPolicy().then(function(e) { try { s.endActionAsync("PRIVACY_POLICY_LINK", "SUCCESS"), u.show("nv-dialog-html", { style: "dialog-service-container-size", title: "l10n.privacyPolicy", html: e.data.gfcontent.body, closeButton: { action: u.cancel } }) } catch (t) { return M.error("parse failure showing terms and conditions"), s.endActionAsync("PRIVACY_POLICY_LINK", "PARSE_ERROR"), r.reject(e) } }).catch(function(e) { M.error("http failure showing privacy policy"), s.endActionAsync("PRIVACY_POLICY_LINK", "HTTP_ERROR", _.propertyOf(e)("status")), w(e) }) } function I() { var e = "SUBMIT"; return x.nvType === p.SOCIAL && (x.regModel.provider === p.GOOGLE ? e = "REGISTER_GOOGLE" : x.regModel.provider === p.FACEBOOK ? e = "REGISTER_FACEBOOK" : x.regModel.provider === p.QQ ? e = "REGISTER_QQ" : x.regModel.provider === p.WECHAT && (e = "REGISTER_WECHAT")), e } function C(e) { var t = e.subscribe; return e = _.omit(e, "subscribe"), M.info("attemptRegistration"), o.register(e).then(function(n) { var r = n.data.loginToken; s.updateFlow("LAUNCH_STATE_REGISTRATION"), M.debug("attemptRegistration Success, now login"), o.loginWithRegistrationToken(r, e.email).then(function(e) { s.endActionAsync(I(), "SUCCESS"), l.setEventsCommonData({ userId: e.user.userId }, !0), M.debug("attemptRegistration login success, now remember newsletter preference ", t), i.syncUser(a.JARVIS_COMMON_STORE, e.user.userId).then(S(e.user.userId, t)).finally(function() { if (s.changeSetting("APPLICATION_SETTING_SUBSCRIBE_NEWSLETTER", t), x.oobeAuthCtrl.isDomainLocked(e)) x.oobeAuthCtrl.handleLoggedIn(e); else if (x.nvType !== p.SOCIAL || x.regModel.provider !== p.QQ && x.regModel.provider !== p.WECHAT) x.oobeAuthCtrl.showEmailVerification(e, "created"); else { var n = !1; m.setMboxThirdPartyId(e.user && e.user.userId), m.getFeature({ cvName: v.EMAIL_VERIFICATION_QQ_WECHAT }).then(function(e) { M.debug("Variant status: ", e), n = !(_.isEmpty(e) || !e || !e.value) && e.value.EmailVarificationQQWechat }).catch(function(e) { M.error("Error getting variant: ", e) }).finally(function() { M.debug("onEmailVerificationEvaluation"), x.regModel.provider === p.WECHAT ? x.oobeAuthCtrl.showQrCodeForScan(e, n ? "skip" : "noskip") : n ? (M.debug("Email verification skipped"), x.oobeAuthCtrl.handleLoggedIn(e)) : (M.debug("Email verification is required"), x.oobeAuthCtrl.showEmailVerification(e, "registered")) }) } }) }).catch(function(e) { M.error("Login attempt using registration token failed. Falling back to login page."), s.endActionAsync(I(), "LOGIN_FAILED", _.propertyOf(e)("status")), x.oobeAuthCtrl.showLogin() }) }) } var x = this, M = e.getInstance("main.oobe/OobeAuthNvRegisterController"); x.validationObject = { displayName: {}, email: {}, password: {} }, x.today = new Date, x.displayNameErrorWrapper = {}, x.emailDisabled = !1, x.locale = "en", t("l10n.dateOfBirth").then(function(e) { x.dateOfBirthTitle = e }), o.getFormValidationObject().then(function(e) { angular.merge(x.validationObject, e.RegistrationData) }), x.onSubmit = function() { if (void 0 !== x.regForm.$valid) { var e; if (s.startActionAsync(I()), x.regForm.displayName.$setTouched(), x.regForm.email.$setTouched(), x.regForm.password && x.regForm.password.$setTouched(), x.regForm.$invalid) { M.debug("Submit invalid form"), s.endActionAsync(I(), "INVALID_FORM"); var t = _.reduce(x.regForm.$error, function(e, t) { return e.concat(t) }) || []; x.regForm.agreeToTerms.$invalid && 1 === t.length ? x.message = "l10n.mustAgreeToTerms" : x.message = "l10n.fillOutAllFields" } else x.waiting = !0, e = _.pick(x.regModel, "email", "password", "birthdate", "displayName", "thirdPartyId", "subscribe"), e.birthdate = x.regModel.birthdate, e.thirdPartyId && (e.password = null), M.debug("Submit valid form, attempt registration"), C(e).catch(function(e) { var t = _.propertyOf(e)("status"); s.endActionAsync(I(), "HTTP_ERROR", _.propertyOf(e)("status")), x.waiting = !1, b(e) ? (M.debug("Register: Failure due to birthdate"), x.regView = "coppa") : 409 === t ? e.data && e.data.details && e.data.details[0] && e.data.details[0].field && e.data.details[0].field === h.NAME && e.data.details[0].reason && e.data.details[0].reason === y.DUPLICATE ? (M.debug("Register: Failure due to display name not available"), x.regForm.displayName.$setValidity("notAvailable", !1), x.regForm.displayName.$setTouched()) : (M.debug("Register: Failure due to email not available"), x.regForm.email.$setValidity("notAvailable", !1), x.regForm.email.$setTouched()) : (M.debug("Register: generic server failure with status:", t, e), x.message = "l10n.serverErrorRegister") }) } else { x.waiting = !0; var r = n.$watch("oobeAuthNvRegisterCtrl.regForm.$valid", function(e, t) { void 0 !== e && (r(), x.waiting = !1, x.onSubmit()) }) } }, x.emailChanged = function() { x.regForm.email.$setValidity("notAvailable", !0) }, x.regModel = { email: "", password: "", birthdate: null, displayName: "", subscribe: !1 }, x.onClickBack = function() { s.recordAction("OOBE_BACK"), x.nvType === p.SOCIAL ? x.oobeAuthCtrl.showAccountChooser() : x.oobeAuthCtrl.showLogin() }, x.onClickDone = function() { s.recordAction("OOBE_DONE"), x.oobeAuthCtrl.showAccountChooser() }, x.onClickAgreeToTerms = function(e) { M.debug("click agree to terms"), e.stopPropagation(), A() }, x.onClickPrivacyPolicy = function(e) { T() }, x.messageBanner = function() { return x.onlineState.online ? x.message : "l10n.mustBeOnline" }, n.$watch("[oobeAuthNvRegisterCtrl.regForm.displayName.$error,oobeAuthNvRegisterCtrl.regForm.displayName.$touched,oobeAuthNvRegisterCtrl.regForm.displayName.$pending]", function() { x.regForm && !x.regForm.displayName.$pending && (x.displayNameErrorWrapper = angular.copy(x.regForm.displayName.$error), x.regForm.displayName.$touched && x.regForm.displayName.$invalid || (x.displayNameErrorWrapper = { valid: !0 })) }, !0), E() }]); t.oobeAuthNvRegisterController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeAuthNvRegister = void 0; var o = n(9), i = n(826), a = r(i); n(512), n(282), n(284), n(291), n(336), n(168), n(340), n(285); var s = o.ngOobeModule.directive("nvOobeAuthNvRegister", [function() { return { restrict: "E", scope: { nvType: "@", nvPrefilled: "=" }, bindToController: !0, template: a.default, controller: "OobeAuthNvRegisterController", controllerAs: "oobeAuthNvRegisterCtrl", require: "^^nvOobeAuth", link: function(e, t, n, r) { e.oobeAuthNvRegisterCtrl.oobeAuthCtrl = r } } }]); t.nvOobeAuthNvRegister = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeAuthQrCodeController = void 0; var r = n(9), o = r.ngOobeModule.controller("OobeAuthQrCodeController", ["$log", function(e) { var t = this, n = e.getInstance("main.oobe/OobeAuthQrCodeController"); t.onContinue = function() { n.debug("onContinue", t.nvSkipEmailVerification, t.nvSessionObject), "skip" === t.nvEmailVerification ? (n.debug("Email verificaiton skipped"), t.oobeAuthCtrl.handleLoggedIn(t.nvSessionObject)) : (n.debug("Email verificaiont is required"), t.oobeAuthCtrl.showEmailVerification(t.nvSessionObject, "registered")) } }]); t.oobeAuthQrCodeController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeAuthQrCode = void 0; var o = n(9), i = n(827), a = r(i); n(514); var s = o.ngOobeModule.directive("nvOobeAuthQrCode", [function() { return { restrict: "E", scope: { nvSessionObject: "=", nvEmailVerification: "@" }, bindToController: !0, template: a.default, controller: "OobeAuthQrCodeController", controllerAs: "oobeAuthQrCodeCtrl", require: "^^nvOobeAuth", link: function(e, t, n, r) { e.oobeAuthQrCodeCtrl.oobeAuthCtrl = r } } }]); t.nvOobeAuthQrCode = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeAuthSyncController = void 0; var r = n(9); n(164), n(12), n(11), n(55); var o = r.ngOobeModule.controller("OobeAuthSyncController", ["$log", "jarvisService", "dbCacheService", "oobeTelemetryService", "cevoToggleService", "DEFAULT_AVATAR", function(e, t, n, r, o, i) { var a = this; e.getInstance("main.oobe/OobeAuthSyncController"); a.$onInit = function() { var e = t.getLoggedInUser(); a.defaultAvatarUrl = i.URL, r.updateScreen("SCREEN_OOBE_LOADING_DATA"), a.displayName = e.core.displayName, o.getAvatarStore(e.userId).then(function(t) { a.avatar = n.getCachedUserItem(e.userId, t.storeName, t.key) }), r.startActionAsync("SYNC") } }]); t.oobeAuthSyncController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeAuthSync = void 0; var o = n(9), i = n(828), a = r(i); n(516); var s = o.ngOobeModule.component("nvOobeAuthSync", { template: a.default, controller: "OobeAuthSyncController", controllerAs: "oobeAuthSyncCtrl" }); t.nvOobeAuthSync = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeAuthVerificationController = void 0; var r = n(9); n(12), n(16); var o = r.ngOobeModule.controller("OobeAuthVerificationController", ["$log", "$q", "jarvisService", "oobeTelemetryService", "$element", function(e, t, n, r, o) { function i(e) { return s.info("attemptRecheckVerification"), n.getUserProfileWithSessionObject(e).then(function(n) { return e.user = n.data, e.user.core.primaryEmailVerified ? (s.debug("attemptRecheckVerification - now verified"), r.endActionAsync("CONTINUE", "SUCCESS"), a.oobeAuthCtrl.handleLoggedIn(e), void 0) : (s.debug("attemptRecheckVerification - still unverified"), r.endActionAsync("CONTINUE", "EMAIL_NOT_VERIFIED"), t.reject(n)) }) } var a = this, s = e.getInstance("main.oobe/OobeAuthVerificationController"); a.$onInit = function() { r.updateScreen("SCREEN_OOBE_EMAIL_VERIFICATION"), "created" === a.nvType ? a.title = "l10n.accountCreated" : a.title = "l10n.emailVerificationPending", "resent" === a.nvType ? a.message = "l10n.verificationEmailResent" : "error" === a.nvType ? a.message = "l10n.unableToSendEmail" : "emailUpdated" === a.nvType && (a.message = "l10n.emailAddressUpdated"), a.translateValues = { email: a.nvSessionObject.user.core.primaryEmail } }, a.onRecheck = function() { s.debug("re-check verification pressed"), r.startActionAsync("CONTINUE"), a.waiting = !0, i(a.nvSessionObject).catch(function(e) { a.waiting = !1, 200 === e.status ? (s.debug("Recheck: endpoint request was successful, but email still not verified"), a.message = "l10n.notBeenVerified") : 401 === e.status ? (s.debug("Recheck: session is no longer valid"), a.oobeAuthCtrl.nvOobeParams = a.oobeAuthCtrl.nvOobeParams || {}, a.oobeAuthCtrl.nvOobeParams.sessionExpired = !0, a.oobeAuthCtrl.selectView(), r.endActionAsync("CONTINUE", "HTTP_ERROR", e.status)) : (s.debug("Recheck: generic server error. status:", e.status), a.message = "l10n.unableToConnect", r.endActionAsync("CONTINUE", "HTTP_ERROR", e.status)) }) }, a.onResend = function() { r.startActionAsync("RESEND"), a.waiting = !0, a.oobeAuthCtrl.attemptResendVerification(a.nvSessionObject.user.core.primaryEmail).then(function(e) { s.debug("Resend: successfully sent email"), r.endActionAsync("RESEND", "SUCCESS"), a.waiting = !1, a.message = "l10n.verificationEmailResent" }).catch(function(e) { s.debug("Resend: failed to send email."), r.endActionAsync("RESEND", "HTTP_ERROR", e.status), a.waiting = !1, a.message = "l10n.unableToSendEmail" }) }, a.isOverflowed = function(e) { var t = angular.element(o[0].querySelector("#" + e)); return !(!t || !t[0]) && t[0].scrollWidth > t[0].offsetWidth }, a.onChangeUser = function() { s.debug("change user pressed"), r.recordAction("OOBE_CHANGE_USER_PROGRESS"), a.oobeAuthCtrl.showAccountChooser() }, a.onEditEmail = function() { s.debug("edit email pressed"), r.recordAction("OOBE_EDIT_EMAIL"), a.oobeAuthCtrl.showEditEmail(a.nvSessionObject) } }]); t.oobeAuthVerificationController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeAuthVerification = void 0; var o = n(9), i = n(829), a = r(i); n(518); var s = o.ngOobeModule.component("nvOobeAuthVerification", { bindings: { nvSessionObject: "<", nvType: "@" }, template: a.default, controller: "OobeAuthVerificationController", controllerAs: "oobeAuthVerificationCtrl", require: { oobeAuthCtrl: "^^nvOobeAuth" } }); t.nvOobeAuthVerification = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeAuth = void 0; var o = n(9), i = n(830), a = r(i); n(505), n(504), n(511), n(513), n(517), n(509), n(519), n(507), n(515); var s = o.ngOobeModule.component("nvOobeAuth", { bindings: { nvActiveAuthView: "@", nvOobeParams: "<" }, template: a.default, controller: "OobeAuthController", controllerAs: "oobeAuthCtrl", require: { oobeCtrl: "^^nvOobe" } }); t.nvOobeAuth = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeBlocked = void 0; var o = n(9), i = n(831), a = r(i), s = o.ngOobeModule.component("nvOobeBlocked", { template: a.default, bindings: { additionalInfoLink: "@" }, controller: function() { var e = this; e.additionalInfoLink = "http://www.nvidia.com/object/support.html" }, controllerAs: "oobeBlockedCtrl" }); t.nvOobeBlocked = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeDialogLeftSide = void 0; var o = n(9), i = n(832), a = r(i), s = o.ngOobeModule.component("nvOobeDialogLeftSide", { template: a.default }); t.nvOobeDialogLeftSide = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeController = void 0; var r = n(9); n(187), n(26); var o = r.ngOobeModule.controller("OobeController", ["$log", "oobeDialogService", "oobeGamesService", "gfeService", "OOBE_STATE", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "eventAggregator", "OOBE_EVENTS", function(e, t, n, r, o, i, a, s, l) { function c(e) { u.nvActiveView = e } var u = this, d = e.getInstance("main.oobe/OobeController"), f = void 0; u.$onInit = function() { u.nvOobeParams.user ? u.nvOobeParams.initialState === o.COMPLETED_LOGIN ? u.showAuth() : (i.push(a.FRONTEND_PARSER_ERROR_OOBE_EXIT_SCREEN_EMPTY, { errorMessage: "Current initialState is " + u.nvOobeParams.initialState }), d.error("Unknown logged in OOBE state", u.nvOobeParams.initialState)) : u.showAuth() }, u.showAuth = function() { c("auth") }, u.onLoggedIn = function(e) { d.info("onLoggedIn"), r.login(e), t.getState() !== o.COMPLETED_ALL ? (d.info("handleloggedin - show welcome"), c("ulWelcome")) : (d.info("handleloggedin - dismiss"), n.initializeGames(e), t.notifyNodeOOBEFinished(), t.close("SUCCESS")) }, u.onShowNoDriver = function() { c("noDriver") }, u.onJarvisOAuthLogin = function() { return "auth" === u.nvActiveView && "choose" === f }, s.on(l.AUTH_VIEW_CHANGED, function(e) { f = e }) }]); t.oobeController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobe = void 0; var o = n(9), i = n(833), a = r(i); n(523), n(529), n(520), n(526); var s = o.ngOobeModule.component("nvOobe", { bindings: { nvActiveView: "@", nvOobeParams: "<" }, template: a.default, controller: "OobeController", controllerAs: "oobeCtrl" }); t.nvOobe = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeNoDriverController = void 0; var r = n(9), o = r.ngOobeModule.controller("OobeNoDriverController", ["$log", "oobeDialogService", "oobeTelemetryService", function(e, t, n) { var r = this, o = e.getInstance("main.oobe/OobeNoDriverController"); r.$onInit = function() { n.updateScreen("SCREEN_OOBE_NO_DRIVER") }, r.onClickContinue = function() { o.debug("redirect to driver page"), n.recordAction("OOBE_CONTINUE"), t.waitForDriverInstall() } }]); t.oobeNoDriverController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeNoDriver = void 0; var o = n(9), i = n(834), a = r(i); n(525); var s = o.ngOobeModule.component("nvOobeNoDriver", { template: a.default, controller: "OobeNoDriverController", controllerAs: "oobeNoDriverCtrl" }); t.nvOobeNoDriver = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeOptionsService = void 0; var o = n(9); n(302), n(11); var i = n(3), a = (r(i), o.ngOobeModule.factory("oobeOptionsService", ["$log", "dbService", "DB_NAMES", "$q", "gfeTargetService", "ACTIVE_EXPERIMENTS", function(e, t, n, r, o, i) { var a = {}, s = (t.getGlobalStore(n.GLOBAL_STORE), e.getInstance("main.oobe/oobeOptionsServices")); return a.isNewsLetterChecked = function() { return o.getVariant({ activityName: i.NEWSLETTER_DEFAULT_ENABLED }).then(function(e) { return e }).catch(function(e) { return s.error("Target response failed", e), r.reject(e) }) }, a }])); t.oobeOptionsService = a }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.oobeUlWelcomeController = void 0; var r = n(9); n(301), n(289); var o = r.ngOobeModule.controller("OobeUlWelcomeController", ["$log", "oobeTelemetryService", "oobeFeatureService", "oobeGamesService", "OOBE_SCAN_STATE", "eventAggregator", "OOBE_EVENTS", "oobeDialogService", "OOBE_STATE", "productTourService", function(e, t, n, r, o, i, a, s, l, c) { function u() { i.on(a.SCAN_FINISHED, f), i.on(a.GAMELIST_UPDATED, m) } function d() { i.off(a.SCAN_FINISHED, f), i.off(a.GAMELIST_UPDATED, m) } function f(e) { g.info("oobe scan games finished"), p.gameScanFinished = !0 } function m(e) { g.info("oobe game list updated ", e), p.translateValues.numGamesScanned = e } var p = this, g = e.getInstance("main.oobe/OobeUlWelcomeController"); p.onAutoOptimizeChanged = function() { r.setAutoOptimizeGames(p.autoOptimize) }, p.onDismissDialog = function(e) { g.info("oobe done"), s.setState(l.COMPLETED_ALL), d(), e ? (t.recordAction("OOBE_SHOW_PRODUCT_TOUR"), c.startOobeTour(!1)) : t.recordAction("OOBE_SKIP_PRODUCT_TOUR"), n.closeOobeFeaturesDialog() }, p.$onInit = function() { t.updateScreen("SCREEN_OOBE_UL_WELCOME"), p.autoOptimize = !0, n.activateDefaultFeatureSettings(p.autoOptimize), p.translateValues = { numGamesScanned: r.getGamesCount() }, r.getScanState() === o.SCANNING ? (g.info("oobe scan state scanning"), p.gameScanFinished = !1, u()) : (g.info("oobe scan state done"), p.gameScanFinished = !0) } }]); t.oobeUlWelcomeController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvOobeUlWelcome = void 0; var o = n(9), i = n(835), a = r(i); n(528), n(522); var s = o.ngOobeModule.component("nvOobeUlWelcome", { template: a.default, controller: "OobeUlWelcomeController", controllerAs: "oobeUlWelcomeCtrl" }); t.nvOobeUlWelcome = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.editAvatarController = void 0; var r = n(4); n(12), n(31), n(164), n(55), n(161); var o = r.ngPreferencesModule.controller("EditAvatarController", ["$log", "jarvisService", "dialogService", "cmsService", "toastService", "$filter", "dbCacheService", "cevoToggleService", "DEFAULT_AVATAR", "CROPPIE_CONSTANTS", "$scope", function(e, t, n, r, o, i, a, s, l, c, u) { function d() { o.showError({ textContent: i("translate")("l10n.somethingWentWrong") }) } function f() { E ? (g.hitApply = !0, g.output.then(function(e) { g.avatarObject.url = e, angular.merge(p, g.avatarObject), p.persist_() })) : (angular.merge(p, g.avatarObject), p.persist_()), h.debug("successfully updated avatar image"), n.cancel() } function m() { s.getUserProfileEnabled().then(function(e) { g.userProfileEnabled = e, g.userProfileEnabled && (b.subTitle = i("translate")("l10n.minimumRequiredSize", w)), angular.merge(g.nvDialogModel, b) }), s.getAvatarStore(v.userId).then(function(e) { p = a.getCachedUserItem(v.userId, e.storeName, e.key), g.avatarObject = _.omit(p, function(e, t) { return "_" === t.substr(t.length - 1) }) }), r.getAvatarMetaData("https://static.nvidiagrid.net/avatars/avatars.js").then(function(e) { g.avatarList = e.data }).catch(function(e) { h.debug("failed to query avatar list " + e), d() }) } var p, g = this, v = t.getLoggedInUser(), h = e.getInstance("main.preferences/EditAvatarController"), y = !1, E = !1, b = { title: "l10n.updateAvatar", button1: { text: "l10n.done", action: f, disabled: !0 }, button2: { text: "l10n.cancel", action: n.cancel } }, S = ({ "Image Files": c.SUPPORTED_FILE_TYPES }, { w: 480, h: 200 }), w = { w: 200, h: 200 }; g.avatarList = null, g.defaultAvatarUrl = l.URL, g.hitApply = !1, g.userProfileEnabled = !1, g.croppieBoundary = S, g.croppieViewport = w, g.outputFormat = { minSize: w }, g.selectAvatar = function(e) { e && (g.nvDialogModel && g.nvDialogModel.button1 && p && (g.nvDialogModel.button1.disabled = p.url === e.url), g.avatarObject.url = e.url, E = !1, y = !1) }, g.onUpdate = function(e) { e.error ? (y = !0, g.errorMsg = i("translate")("l10n.fileSelectionError", g.outputFormat.minSize), g.nvDialogModel.button1.disabled = !0, h.error("onUpdate got error", e.error)) : e.success && (y = !1, g.nvDialogModel.button1.disabled = !1) }, g.showCroppie = function() { return E && !y && g.userProfileEnabled }, g.showPreview = function() { return !E && !y }, g.showError = function() { return y }, g.onFileSelect = function(e) { g.sourceImage = e, E = !0 }, m(), u.$on("$destroy", function() { h.info("Destroying edit avatar") }) }]); t.editAvatarController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvEditEmailResultDialog = void 0; var o = n(9), i = n(837), a = r(i), s = o.ngOobeModule.directive("nvEditEmailResultDialog", [function() { return { restrict: "A", scope: {}, bindToController: { nvDialogModel: "=" }, template: a.default, controller: [function() {}], controllerAs: "emailUpdatedCtrl" } }]); t.nvEditEmailResultDialog = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.editEmailService = void 0; var r = n(4); n(31), n(12), n(531), n(280), n(281); var o = r.ngPreferencesModule.service("editEmailService", ["$log", "dialogService", "jarvisService", "$q", function(e, t, n, r) { var o = this, i = e.getInstance("main.preferences/preferencesService"), a = n.getLoggedInUser(), s = ""; o.updateEmail = function(e) { s = e, o.attemptResendVerification(e).then(function(e) { o.showEmailVerificationDialog(t.model.sessionObject, "l10n.verificationEmailResent") }).catch(function(e) { o.showEmailVerificationDialog(t.model.sessionObject, "l10n.unableToSendEmail") }) }, o.resendVerification = function() { i.info("change email: resendVerification"), i.debug("re-send verification email pressed"), t.model.waiting = !0, o.attemptResendVerification(t.model.translateValues.email).then(function(e) { i.debug("Resend: successfully sent email"), t.model.waiting = !1, t.model.error = "l10n.verificationEmailResent" }).catch(function(e) { i.debug("Resend: failed to send email."), t.model.waiting = !1, t.model.error = "l10n.unableToSendEmail" }) }, o.attemptResendVerification = function(e) { return i.info("attemptResendVerification."), r.resolve() }, o.changeEmailWithTwoFactorAuthentication = function() { t.model.waiting = !0, o.attemptChangeEmailWithTwoFactorAuthentication(t.model.sessionObject, t.model.translateValues.email).then(function(e) { i.debug("changeEmailWithTwoFactorAuthentication: successfully updated email"), t.model.waiting = !1, o.showEmailUpdatedDialog(t.model.translateValues.email) }).catch(function(e) { i.debug("changeEmailWithTwoFactorAuthentication: failed updating email."), t.model.waiting = !1 }) }, o.attemptChangeEmailWithTwoFactorAuthentication = function(e, t) { return i.info("attemptChangeEmailWithTwoFactorAuthentication."), r.resolve() }, o.showEmailUpdatedDialog = function(e) { i.info("email updated successfully."), t.show("nv-edit-email-result-dialog", { title: "l10n.emailUpdatedSuccessfully", newEmail: e, button1: { text: "l10n.continue", action: t.cancel } }) }, o.showEmailVerificationDialog = function(e, n, r) { i.debug("change email: show email verification dialog"); var l = { style: "honeycomb-square", title: n || "l10n.emailVerificationPending", error: r, translateValues: { email: s }, sessionObject: e, editMailAddress: function() { i.debug("edit email pressed on email verification dialog"), e.user = a, t.show("nv-dialog-edit-email", { title: "l10n.changeEmailAddress", sessionObject: e, is2FactorAuthentication: !0, actionVerifyEmail: o.updateEmail, actionCancelUpdateEmail: t.cancel() }) }, button1: { text: "l10n.continue", action: o.changeEmailWithTwoFactorAuthentication }, button2: { text: "l10n.cancel", action: t.cancel }, button3: { text: "l10n.resendVerification", action: o.resendVerification } }; t.show("nv-dialog-email-verification", l) } }]); t.editEmailService = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.editPasswordController = void 0; var r = n(4); n(31), n(12); var o = r.ngPreferencesModule.controller("EditPasswordController", ["$log", "dialogService", "jarvisService", "$filter", function(e, t, n, r) { function o() { if (a.debug("attempt to send change password request"), i.passwordForm.currentPassword.$setTouched(), i.passwordForm.changedPassword.$setTouched(), i.passwordForm.confirmedPassword.$setTouched(), i.passwordForm.$invalid) return a.debug("password fields are not met validation, cannot make change request"), void(i.nvDialogModel.error = "l10n.fillOutAllFields"); i.nvDialogModel.error = "", i.nvDialogModel.waiting = !0; var e = { token: "", currentPassword: i.nvDialogModel.passwordModel.currentPassword, newPassword: i.nvDialogModel.passwordModel.changedPassword }; n.changePassword(e).then(function(e) { a.debug("change password succeed"), t.cancel() }).catch(function(e) { a.error("change password failed"), i.nvDialogModel.waiting = !1, 400 === e.status ? (a.debug("failure due to bad request"), i.nvDialogModel.error = "l10n.unableToConnectToNvidia") : 401 === e.status ? (a.debug("failure due to authrization failed"), i.nvDialogModel.error = "l10n.incorrectPassword", i.passwordForm.changedPassword.$setValidity("invalidPassword", !1), i.passwordForm.changedPassword.$setTouched()) : (a.debug("generic failure with status", e.status), i.nvDialogModel.error = "l10n.unableToConnectToNvidia") }) } var i = this, a = e.getInstance("main.preferences/EditPasswordController"), s = { title: r("translate")("l10n.changePassword"), button1: { text: "l10n.done", action: o }, button2: { text: "l10n.cancel", action: t.cancel }, passwordModel: { currentPassword: "", changedPassword: "", confirmedPassword: "" } }; i.validationObject = { password: {} }, n.getFormValidationObject().then(function(e) { angular.merge(i.validationObject, e.RegistrationData) }), angular.merge(i.nvDialogModel, s) }]); t.editPasswordController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvEditPassword = void 0; var o = n(4); n(282), n(283), n(168); var i = n(838), a = r(i); n(533); var s = o.ngPreferencesModule.directive("nvEditPassword", [function() { return { restrict: "A", scope: {}, bindToController: { nvDialogModel: "=" }, template: a.default, controller: "EditPasswordController", controllerAs: "editPasswordCtrl" } }]); t.nvEditPassword = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.featureDescriptionController = void 0; var r = n(4), o = r.ngPreferencesModule.controller("FeatureDescriptionController", ["$window", "$log", "FEATURES_NAME", "localeService", "COMMON_DYNAMIC_REDIRECT", "FEATURE_CRITERIA", "preferencesFeatureService", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_UI_PROGRESS_NAMES", "TELEMETRY_SCREENS", "TELEMETRY_ACTIONS", "eventAggregator", "COMMON_EVENTS", function(e, t, n, r, o, i, a, s, l, c, u, d, f, m) { function p() { var e; switch (h.featureName) { case n.GAME_OPS: case n.SHARE: case n.ANSEL: case n.FREESTYLE: e = o.SYSTEM_REQS; break; case n.GAME_STREAM: e = o.GAME_STREAM_REQUIREMENTS; break; case n.VIRTUAL_REALITY: e = o.VR_REQUIREMENTS; break; case n.BATTERY_BOOST: e = null; break; case n.QUIET_MODE: e = null; break; case n.QUIET_MODE2: e = null } return e ? { url: o.BASE_URL + r.getCurrentLocaleWithUnderscore() + "&page=" + e, text: "l10n.viewSystemRequirements" } : null } function g() { var e; switch (h.featureName) { case n.ANSEL: case n.FREESTYLE: e = h.featureName; break; case n.GAME_STREAM: case n.VIRTUAL_REALITY: case n.BATTERY_BOOST: case n.QUIET_MODE: case n.GAME_OPS: case n.SHARE: e = null } return e ? { url: o.BASE_URL + r.getCurrentLocaleWithUnderscore() + "&page=" + o.SUPPORTED_GAMES + "#" + e.toLowerCase(), text: "l10n.viewSupportedGames" } : null } function v() { h.requirements = h.nvFeatureRequirements, h.featureName = h.nvFeatureName, h.systemRequirement = p(), h.supportedGames = g(), h.updateDriver = !1; try { h.featureState = JSON.parse(h.nvOverallState) } catch (e) { y.error("Could not parse overallState for feature", h.featureName), h.featureState = !1 } h.featureState || a.isDriverUpdateRequiredForSupport(h.featureName).then(function(e) { e && (h.updateDriver = !0) }) } var h = this, y = t.getInstance("main.preferences/FeatureDescriptionController"); h.openLink = function() { y.info("SystemRequirements redirects to url:: ", h.systemRequirement.url), e.open(h.systemRequirement.url) }, h.openSupportedGamesLink = function() { y.info("Supported Games redirects to url:: ", h.supportedGames.url), e.open(h.supportedGames.url) }, h.showDriverDownloadButton = function(e) { return (e.name === i.DRIVER || e.name === i.DRIVER_ALT) && h.updateDriver }, h.onDownloadClicked = function() { s.push(l.DOWNLOAD_LATEST_DRIVER_UPDATE, { name: c.LATEST_DRIVER_UPDATE, currentScreen: u.SCREEN_PREFERENCES_GENERAL, action: d.DOWNLOAD }), f.trigger(m.UPDATE_DRIVER_FROM_PREFERENCES) }, v() }]); t.featureDescriptionController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFeatureDescription = void 0; var o = n(4); n(34); var i = n(839), a = r(i); n(535); var s = o.ngPreferencesModule.component("nvFeatureDescription", { bindings: { nvFeatureName: "@", nvFeatureRequirements: "=", nvOverallState: "@" }, template: a.default, controller: "FeatureDescriptionController", controllerAs: "featureDescription" }); t.nvFeatureDescription = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.featureHeaderController = void 0; var o = n(4), i = n(713), a = r(i), s = n(712), l = r(s), c = o.ngPreferencesModule.controller("FeatureHeaderController", ["$scope", "FEATURES_NAME", function(e, t) { function n() { switch (o.nvFeatureTile) { case t.GAME_OPS: return "icon-guage"; case t.GAME_STREAM: return "icon-gamestream"; case t.ACE_MODES: case t.BATTERY_BOOST: return "icon-batteryboost"; case t.QUIET_MODE: return "icon-quiet-mode"; case t.SHARE: return "icon-share"; case t.VIRTUAL_REALITY: return "icon-VR"; case t.ANSEL: return "icon-share_camera"; case t.FREESTYLE: return "icon-freestyle"; case t.QUIET_MODE2: return r() } } function r() { return "true" == String(o.nvOverallState) ? a.default : "false" == String(o.nvOverallState) ? l.default : void 0 } var o = this; o.featureName = o.nvFeatureName, o.featureDescription = o.nvFeatureDescription, e.quietMode2 = t.QUIET_MODE2, o.featureThumbnail = n(), e.$watch("nvFeatureDescription", function(e) { o.featureDescription = o.nvFeatureDescription }) }]); t.featureHeaderController = c }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFeatureHeader = void 0; var o = n(4); n(34), n(17); var i = n(840), a = r(i); n(537); var s = o.ngPreferencesModule.component("nvFeatureHeader", { bindings: { nvFeatureTile: "@", nvFeatureName: "@", nvFeatureDescription: "@", nvOverallState: "@" }, template: a.default, controller: "FeatureHeaderController", controllerAs: "featureHeader" }); t.nvFeatureHeader = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.licenseAgreementController = void 0; var r = n(4); n(31), n(29); var o = r.ngPreferencesModule.controller("LicenseAgreementController", ["$log", "$q", "preferencesService", function(e, t, n) { function r() { n.getLicenseAgreement().then(function(e) { o.licenseAgreement = e.data, o.nvDialogModel.title = "l10n.licenseTitle" }).catch(function(e) { return i.error("error getting license", e), t.reject() }) } var o = this; o.licenseAgreement = ""; var i = e.getInstance("main.preferences/LicenseAgreementController"); r(), o.nvDialogModel.titleStyle = { "font-size": "1.15em" } }]); t.licenseAgreementController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvLicenseAgreement = void 0; var o = n(4), i = n(841), a = r(i); n(539); var s = o.ngPreferencesModule.directive("nvLicenseAgreement", [function() { return { restrict: "A", scope: {}, bindToController: { nvDialogModel: "=" }, template: a.default, controller: "LicenseAgreementController", controllerAs: "licenseAgreementCtrl" } }]); t.nvLicenseAgreement = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesAccountsAvatar = void 0; var o = n(4), i = n(842), a = r(i); n(140); var s = o.ngPreferencesModule.directive("nvPreferencesAccountsAvatar", function() { return { restrict: "E", template: a.default, require: "^^nvPreferencesAccounts", link: function(e, t, n, r) { e.preferencesAccounts = r } } }); t.nvPreferencesAccountsAvatar = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesAccountsController = void 0; var r = n(4); n(12), n(31), n(532), n(11), n(164), n(281), n(534), n(280), n(303), n(292), n(55); var o = r.ngPreferencesModule.controller("PreferencesAccountsController", ["$log", "jarvisService", "dialogService", "editEmailService", "dbCacheService", "DB_NAMES", "$window", "localeService", "cevoToggleService", "COMMON_DYNAMIC_REDIRECT", "DEFAULT_AVATAR", "weChatService", "WECHAT_CONSTANTS", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_SCREENS", function(e, t, n, r, o, i, a, s, l, c, u, d, f, m, p, g) { function v() { w.debug("refreshing session store status"), t.getSessionStoreStatus().then(function(e) { S.isUserRememberedOnMachine = e, w.debug("session store status set to " + S.isUserRememberedOnMachine) }).catch(function() { S.isUserRememberedOnMachine = !1, w.debug("session store status set to disabled") }) } function h() { l.getAvatarStore(_.userId).then(function(e) { S.avatar = o.getCachedUserItem(_.userId, e.storeName, e.key) }) } function y() { S.defaultAvatarUrl = u.URL, v(), h(), S.user = _, S.editUserObject = angular.merge({}, S.user.core), b = o.getCachedUserItem(_.userId, i.JARVIS_COMMON_STORE, i.SUBSCRIPTIONS), S.subscribed = t.getSubscriptionData(b), S.devFeatures = o.getCachedGlobalItem(i.DEV_STORE, i.DEV_FEATURES), E() } function E() { d.isFeatureSupported().then(function(e) { S.isWeChatSupported = e }).catch(function() { S.isWeChatSupported = !1 }) } var b, S = this, _ = t.getLoggedInUser(); S.showNewsletter = !1; var w = e.getInstance("main.preferences/preferencesAccounts"); S.toggleNewsletter = function() { b.persist_(); var e = t.getSubscriptionData(b); m.setScreen(g.SCREEN_PREFERENCES_ACCOUNT); var n = e && e.state; m.changeSetting(p.APPLICATION_SETTING_SUBSCRIBE_NEWSLETTER, n) }, S.setUserRememberedOnMachine = function() { w.debug("user selects to store remember currently logged in session :" + S.isUserRememberedOnMachine), t.setSessionStoreStatus(S.isUserRememberedOnMachine).then(v, v) }, S.isUserRememberedOnMachine = void 0, S.isEditingPersonalInfo = !1, S.removeLinkedAccounts = function(e) {}, S.linkAccounts = function() {}, S.removeAllDevices = function() {}, S.tryUpdatePersonalInformation = function(e) { var t = c.BASE_URL + s.getCurrentLocaleWithUnderscore() + "&page=" + c.ACCOUNT_MANAGEMENT; w.info("Edit personal information redirects to url:: ", t), a.open(t) }, S.tryUpdatePrivacyPreferences = function(e) { var t = c.BASE_URL + s.getCurrentLocaleWithUnderscore() + "&page=" + c.PRIVACY_PREFERENCES; w.info("Edit privacy preferences redirects to: ", t), a.open(t) }, S.updateAvatar = n.show.bind(this, "nv-edit-avatar"), S.getRealName = function() { return S.user.core.displayName }, S.getPhone = function() { return "" }, S.editEmailAddress = function(e) { w.debug("verify authentication to update password pressed"); var o = t.getSession(); o.user = S.user, n.show("nv-dialog-edit-email", { title: "l10n.changeEmailAddress", sessionObject: o, is2FactorAuthentication: !0, actionVerifyEmail: r.updateEmail, actionCancelUpdateEmail: n.cancel }) }, S.isWeChatSupported = !1, S.wechatGroups = [f.NFAN], S.onShowQrCode = function(e) { m.push(p.PREFERENCES_ACCOUNT_SHOW_QRCODE), d.showQrCode(e) }, y() }]); t.preferencesAccountsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesAccountsDevices = void 0; var o = n(4), i = n(843), a = r(i), s = o.ngPreferencesModule.directive("nvPreferencesAccountsDevices", function() { return { restrict: "E", template: a.default, require: "^^nvPreferencesAccounts", link: function(e, t, n, r) { e.preferencesAccounts = r } } }); t.nvPreferencesAccountsDevices = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesAccountsLinked = void 0; var o = n(4), i = n(844), a = r(i), s = o.ngPreferencesModule.directive("nvPreferencesAccountsLinked", function() { return { restrict: "E", template: a.default, require: "^^nvPreferencesAccounts", link: function(e, t, n, r) { e.preferencesAccounts = r } } }); t.nvPreferencesAccountsLinked = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesAccountsNewsletter = void 0; var o = n(4), i = n(845), a = r(i), s = o.ngPreferencesModule.directive("nvPreferencesAccountsNewsletter", function() { return { restrict: "E", template: a.default, require: "^^nvPreferencesAccounts", link: function(e, t, n, r) { e.preferencesAccounts = r } } }); t.nvPreferencesAccountsNewsletter = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesAccountsPersonalInfo = void 0; var o = n(4), i = n(846), a = r(i), s = o.ngPreferencesModule.directive("nvPreferencesAccountsPersonalInfo", function() { return { restrict: "E", template: a.default, require: "^^nvPreferencesAccounts", link: function(e, t, n, r) { e.preferencesAccounts = r } } }); t.nvPreferencesAccountsPersonalInfo = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesAccountsSecurity = void 0; var o = n(4), i = n(847), a = r(i), s = o.ngPreferencesModule.directive("nvPreferencesAccountsSecurity", function() { return { restrict: "E", template: a.default, require: "^^nvPreferencesAccounts", link: function(e, t, n, r) { e.preferencesAccounts = r } } }); t.nvPreferencesAccountsSecurity = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesAccounts = void 0; var o = n(4); n(291); var i = n(848), a = r(i); n(542), n(541), n(546), n(547), n(544), n(543), n(545); var s = o.ngPreferencesModule.component("nvPreferencesAccounts", { template: a.default, controller: "PreferencesAccountsController", controllerAs: "preferencesAccounts" }); t.nvPreferencesAccounts = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesController = void 0; var r = n(4); n(29), n(20); var o = r.ngPreferencesModule.controller("PreferencesController", ["preferencesService", "eventAggregator", "PREFERENCES_EVENTS", "$scope", "toastService", function(e, t, n, r, o) { function i(t) { return e.isLedFeatureSupported().then(function(e) { t.isEnabled = e }) } function a(t) { e.getGameStreamFeature().then(function(n) { t.isEnabled = JSON.parse(n.overallState), e.updateGameStreamTelemetry(n) }) } function s() { l.Preferences.forEach(function(e) { "main.auth.preferences.general" === e.route || "main.auth.preferences.accounts" === e.route || "main.auth.preferences.games" === e.route ? e.isEnabled = !0 : "main.auth.preferences.shield" === e.route ? c(e) : "main.auth.preferences.led" === e.route ? i(e) : e.isEnabled = !1 }) } var l = this; l.Preferences = [{ iconUrl: 0, name: "l10n.general", route: "main.auth.preferences.general", isEnabled: !1 }, { iconUrl: 0, name: "l10n.account", route: "main.auth.preferences.accounts", isEnabled: !1 }, { iconUrl: 0, name: "l10n.games", route: "main.auth.preferences.games", isEnabled: !1 }, { iconUrl: 0, name: "l10n.shield", route: "main.auth.preferences.shield", isEnabled: !1 }, { iconUrl: 0, name: "l10n.friendsAndGroups", route: "main.auth.preferences.friendsAndGroups", isEnabled: !1 }, { iconUrl: 0, name: "l10n.ledVisualizer", route: "main.auth.preferences.led", isEnabled: !1 }], l.selected = l.Preferences[0]; var c = function(t) { e.gameStreamAddonLoaded ? e.getGameStreamFeatureAvailibilty().then(function() { t.isEnabled = e.isGameStreamFeatureSupported }).catch(function() { a(t) }) : a(t) }, u = function() { var e = _.where(l.Preferences, { route: "main.auth.preferences.shield" }); c(e) }; s(), t.on(n.FEATURE_UPDATED_GS, u), r.$on("$destroy", function() { e.resetGameStreamFeatureAvailibilty(), t.off(n.FEATURE_UPDATED_GS, u), o.isOpen() && o.cancel() }) }]); t.preferencesController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferences = void 0; var o = (n(4), n(849)), i = r(o); n(549); var a = angular.module("main.preferences").component("nvPreferences", { template: i.default, controller: "PreferencesController", controllerAs: "preferencesController" }); t.nvPreferences = a }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesFeatureReadinessController = void 0; var r = n(4); n(29); var o = r.ngPreferencesModule.controller("PreferencesFeatureReadinessController", ["$scope", "$log", "$filter", "preferencesService", "PREFERENCES_EVENTS", "eventAggregator", "FEATURES_NAME", "INSTALLER_EVENTS", "quietModeService", "QUIET_MODE_EVENTS", "$q", function(e, t, n, r, o, i, a, s, l, c, u) { function d() { return l.getQuietMode2SupportInfo().then(function(e) { b.info("getquietmodesupport info called"); var t = { oldState: S, newState: S }; if (e && e.criteria) { S = e.criteria.overallState, t.newState = S; var n = e.criteria.states, r = n.find(function(e, t, n) { return "wm2" === e.name }); r && r.state ? y.isQuietMode2Supported = !0 : y.isQuietMode2Supported = !1 } else b.error("getQuietModeSupporteState(): Something went wrong!"); return t }).catch(function(e) { return b.error("getQuietMode2SupportInfo() support error!" + e), u.reject() }) } function f() { d().then(function(e) { b.info("states", e), e.oldState !== e.newState && r.getFeatures() }) } function m() { i.on(o.FEATURES_UPDATED, p), i.on(o.FEATURES_RELOAD, g), i.on(o.HWSYSTEMINFO_FAILED, v), i.on(o.AUTOBETA_SETTING_CHANGED, h), i.on(s.INSTALL_DONE, h), i.on(c.SUPPORT_UPDATE, f), d(), r.getFeatures() } function p(e) { y.features = e, _.each(y.features, function(e) { switch (e.featureTile === a.QUIET_MODE2 && y.isQuietMode2Supported ? e.shallowStates = e.states.filter(function(e, t, n) { return "wm2" != e.name }) : e.shallowStates = e.states, e.visibility = !0, e.featureTile) { case a.GAME_STREAM: e.newOverallState = angular.isDefined(e.overallState) && JSON.parse(e.overallState) && r.gameStreamAddonLoaded; break; case a.SHARE: e.newOverallState = angular.isDefined(e.overallState) && JSON.parse(e.overallState) && r.shareAddonLoaded; break; default: e.newOverallState = e.overallState } }), h().then(function() { y.loadingState = E.DONE }) } function g() { y.loadingState = E.LOADING, y.features = [] } function v() { y.loadingState = E.FAILED } function h() { return r.isAnselFeatureSupportedOnSystem().then(function(e) { var t = _.findIndex(y.features, { featureTile: a.ANSEL }); t > -1 && (y.features[t].visibility = e.isVisible); var r = _.findIndex(y.features, { featureTile: a.SHARE }); r > -1 && (y.features[r].message = e.isSupported ? n("translate")("l10n.shareDialogDescriptionWithAnsel") : n("translate")("l10n.shareDialogDescription")) }) } var y = this, E = { LOADING: "LOADING", FAILED: "FAILED", DONE: "DONE" }, b = t.getInstance("main.preferences/PreferencesFeatureReadinessController"); y.features = [], y.loadingState = E.LOADING, y.isQuietMode2Supported = !1; var S = !1; m(), e.$on("$destroy", function() { i.off(o.FEATURES_UPDATED, p), i.off(o.FEATURES_RELOAD, g), i.off(o.HWSYSTEMINFO_FAILED, v), i.off(o.AUTOBETA_SETTING_CHANGED, h), i.off(s.INSTALL_DONE, h) }) }]); t.preferencesFeatureReadinessController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesFeatureReadiness = void 0; var o = n(4); n(205), n(538), n(536); var i = n(850), a = r(i); n(551); var s = o.ngPreferencesModule.component("nvPreferencesFeatureReadiness", { template: a.default, controller: "PreferencesFeatureReadinessController", controllerAs: "preferencesFeatureReadiness" }); t.nvPreferencesFeatureReadiness = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesFeatureService = void 0; var o = n(3), i = r(o), a = n(4), s = a.ngPreferencesModule.service("preferencesFeatureService", ["$log", "eventAggregator", "PREFERENCES_EVENTS", "FEATURE_CRITERIA", "$q", "updatesService", "FEATURES_NAME", "toastService", "$filter", "stateService", "dialogService", "COMMON_EVENTS", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_UI_PROGRESS_NAMES", "TELEMETRY_SCREENS", "TELEMETRY_ACTIONS", "GFECLIENT_CONFIG", "gfeUpdatesEndpoints", function(e, t, n, r, o, a, s, l, c, u, d, f, m, p, g, v, h, y, E) { function b(e) { A.info(e), T = i.filter(e, function(e) { return !JSON.parse(e.overallState) }), I.resolve(), t.trigger(f.UNSUPPORTED_FEATURES_UPDATED) } function S() { x = null, w.isAnselFeatureAvailable() } function _() { d.show("nv-dialog-text", { title: "l10n.shareNotReady", style: "feature-error-dialog", text: "l10n.featureErrorMessage", button1: { text: "l10n.gotItText", action: d.cancel } }) } var w = this, A = e.getInstance("main.preferences/preferencesFeatureService"), T = [], I = null, C = null, x = null, M = null; w.initialize = function() { I = o.defer(), C = I.promise, t.on(n.FEATURES_UPDATED, b), t.on(n.AUTOBETA_SETTING_CHANGED, S) }, w.getUnsupportedFeatures = function(e) { return C.then(function() { var t = T; e && (t = i.filter(T, function(t) { var n = i.findWhere(t.states, { name: e }); if (e === r.DRIVER && (n = n || i.findWhere(t.states, { name: r.DRIVER_ALT }), n && n.message)) { var o = n.message.match(/\d*\.\d*/); t.minDriverVersion = parseFloat(o) } return !(!n || JSON.parse(n.state)) })); var n = i.findWhere(t, { featureTile: s.ANSEL }); return n ? w.isAnselFeatureAvailable().then(function(e) { return e || (t = i.filter(t, function(e) { return e.featureTile !== s.ANSEL })), t }) : t }) }, w.isAnselFeatureAvailable = function() { if (y.anselFeature) { if (null !== x) return A.info("isAnselFeatureAvailable returned cached value"), o.when(x); if (M) return A.info("isAnselFeatureAvailable returned old promise"), M; A.info("get isAnselFeatureAvailable"); var e = y.anselFeatureExperimental ? E.getBetaSetting() : o.when({ data: "1" }); return M = e.then(function(e) { return x = "1" === e.data }).finally(function() { M = null }), M.then(function(e) { return e }), M } return o.when(!1) }, w.isDriverUpdateRequiredForSupport = function(e) { var t = o.defer(); return w.getUnsupportedFeatures(r.DRIVER).then(function(n) { var r = i.findWhere(n, { featureTile: e }); r ? a.getUpdateDetails().then(function(e) { var n = 0; i.size(e) > 0 && (n = parseFloat(e[0].version)), t.resolve(n >= r.minDriverVersion) }).catch(function(e) { t.reject(e) }) : t.resolve(!1) }), t.promise }, w.onDownloadClicked = function(e) { m.push(p.DOWNLOAD_LATEST_DRIVER_UPDATE, { name: g.LATEST_DRIVER_UPDATE, currentScreen: v.SCREEN_TOAST_MESSAGE, action: h.DOWNLOAD }), u.gotoDriversTab(e) }, w.showDriverUpdateToast = function() { l.showWarning({ textContent: c("translate")("l10n.updateDriverToRunFeature"), button: { text: c("translate")("l10n.updateNow"), action: w.onDownloadClicked, actionParams: { startDriverDownload: !0 } } }) }, w.handleShareNotReady = function() { var e = !1; w.isDriverUpdateRequiredForSupport(s.SHARE).then(function(t) { e = t }).finally(function() { e ? w.showDriverUpdateToast() : _() }) } }]); t.preferencesFeatureService = s }, , , function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGamesBatteryBoostController = void 0; var o = n(3), i = r(o), a = n(4); n(165), n(20); var s = a.ngPreferencesModule.controller("PreferencesGamesBatteryBoostController", ["$scope", "$log", "$document", "framerateLimiterService", "$timeout", "eventAggregator", "COMMON_EVENTS", "toastService", "$filter", function(e, t, n, r, o, a, s, l, c) { function u() { if (i.isNull(A) || A.clearRect(0, 0, T.width, T.height), !i.isEmpty(y)) { T = y[0].getBoundingClientRect(); var e = Math.floor((b - E) / S); A = w[0].getContext("2d"), w[0].width = T.width, w[0].height = T.height; for (var t, n = 0; n <= e; n++) t = Math.round(T.width * (n / e)), A.fillStyle = "#FFFFFF", A.fillRect(t - 1, 0, 2, T.height) } } function d() { a.on(s.WINDOW_RESIZE, u) } function f() { a.off(s.WINDOW_RESIZE, u) } var m = this, p = null, g = null, v = null, h = null, y = null, E = 30, b = 60, S = 5, _ = 30, w = null, A = null, T = {}; m.currentSliderIndex = 30, m.enabledBatterySwitch = !0, m.requestInProgress = !0, m.loadingFailed = !1, m.loadingDone = !1; var I = t.getInstance("main.preferences/BatteryBoostController"); r.getStateInfo().then(function(e) { var t = e; m.currentSliderIndex = t.value, m.enabledBatterySwitch = t.enabled, o(function() { u() }), m.requestInProgress = !1, m.loadingDone = !0, I.info("Battery Boost state info", e) }).catch(function(e) { m.requestInProgress = !1, m.loadingFailed = !0, m.loadingDone = !0, I.error("getStateInfo failed with error:", e) }), m.onChangeBatteryBoostState = function(e) { m.requestInProgress = e, m.currentSliderIndex = m.currentSliderIndex < _ ? _ : m.currentSliderIndex, r.setStateInfo(m.enabledBatterySwitch, m.currentSliderIndex).then(function(e) { m.requestInProgress = !1, I.info("Battery Boost setState info", e) }).catch(function(e) { m.requestInProgress = !1, I.error("setStateInfo failed with error:", e); var t = c("translate")("l10n.unableToUpdateSettings"); l.showError({ textContent: t }) }) }, m.applyOptimalValue = function() { m.currentSliderIndex = _, m.onChangeBatteryBoostState() }, n.ready(function() { var e = angular.element(n[0].querySelector(".preferences-games-battery-boost")); p = angular.element(e[0].querySelector(".md-track-ticks")), p.css("display", "block"), p.css("z-index", "0"), p.find("canvas").css("display", "none"), w = angular.element("").css("position", "absolute"), p.append(w), y = angular.element(e[0].querySelector(".md-track-container")), g = angular.element(e[0].querySelector(".optimal-button-container")), v = angular.element(e[0].querySelector(".optimal-value-button")), h = angular.element(e[0].querySelector(".optimal-line-indicator")); var t = v[0].clientWidth; if (t / 2 < 33) { var r = 33 - Math.round(t / 2) + "px"; v.css("left", r) } u() }), e.$on("$destroy", f), d() }]); t.preferencesGamesBatteryBoostController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesGamesBatteryBoost = void 0; var o = n(4); n(17); var i = n(852), a = r(i); n(556); var s = o.ngPreferencesModule.component("nvPreferencesGamesBatteryBoost", { template: a.default, controller: "PreferencesGamesBatteryBoostController", controllerAs: "preferencesGamesBatteryBoost" }); t.nvPreferencesGamesBatteryBoost = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGamesController = void 0; var r = n(4); n(165), n(112); var o = r.ngPreferencesModule.controller("PreferencesGamesController", ["$log", "preferencesService", "performanceModeService", function(e, t, n) { function r() { t.getGameOpsFeature().then(function(e) { o.isOpsSupported = JSON.parse(e.overallState), i.info("getGameOpsFeature success: ", e.overallState) }).catch(function(e) { i.error("getGameOpsFeature failed with error:", e) }), n.isFeatureAvailableOnAB().then(function(e) { e ? n.getStateInfo().then(function(e) { i.info("Performance Mode getSupportInfo success: ", e), o.isPerfModeSupported = e.supported, o.selectedPowerMode = e.performanceMode }, function(e) { i.error("Performance Mode getSupportInfo failed with error: ", e), o.isPerfModeSupported = !1, o.loadingAceModeFailed = !0 }) : o.isPerfModeSupported = !1 }) } var o = this; o.isOpsSupported = !1, o.isPerfModeSupported = !1, o.loadingAceModeFailed = !1; var i = e.getInstance("main.preferences/PreferencesGamesController"); r(), o.showAceMode = function() { return o.isPerfModeSupported } }]); t.preferencesGamesController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesGames = void 0; var o = n(4); n(569), n(562), n(564), n(557), n(304), n(566); var i = n(853), a = r(i); n(558); var s = o.ngPreferencesModule.component("nvPreferencesGames", { template: a.default, controller: "PreferencesGamesController", controllerAs: "preferencesGames" }); t.nvPreferencesGames = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGamesLocationController = void 0; var o = n(3), i = r(o), a = n(4); n(46), n(19), n(20); var s = a.ngPreferencesModule.controller("PreferencesGamesLocationController", ["$log", "gamesService", "cefService", "$filter", "toastService", "$document", "$timeout", "$scope", function(e, t, n, r, o, a, s, l) { function c(e) { o.showError({ textContent: r("translate")(e) }) } function u() { p = s(function() { var e = angular.element(a[0].querySelector(".scan-location-section"))[0], t = angular.element(e.querySelector(".bg-green-hv-hue-1"))[0], n = t.offsetTop + t.offsetHeight - e.offsetHeight; e.scrollTop = n, p = null }) } function d() { p && (y.info("pending scroll to timeout cancelled"), s.cancel(p)), v && (y.info("cancelling pending add promise"), t.searchPathsAddCancel(v)), h && (y.info("cancelling pending remove promise"), t.searchPathsRemoveCancel(h)), g && (y.info("cancelling pending get search path promise"), t.getSearchPathsCancel(g)) } var f = this, m = null, p = null, g = null, v = null, h = null; f.addBtnDisabled = !0, f.removeBtnDisabled = !1; var y = e.getInstance("main.preferences/PreferencesGameslocationController"); f.scanGamesLocation = [], f.selectedPathChanged = function(e) { m = e }, g = t.getSearchPaths().then(function(e) { f.scanGamesLocation = e.data, f.scanGamesLocation.length > 0 && f.selectedPathChanged(f.scanGamesLocation[0]), y.info("PreferencesGamesLocationController - got getSearchPaths response", f.scanGamesLocation) }).catch(function(e) { e.cancelled || y.error("error getting getSearchPaths " + e) }).finally(function() { f.addBtnDisabled = !1, g = null }), f.add = function() { return y.info("user adding game scan location"), n.localDirectoryExplorer(!1, {}, !0).then(function(e) { i.contains(f.scanGamesLocation, e) ? (y.info("Game scan location already added ", e), f.selectedPathChanged(e), u()) : (f.addBtnDisabled = !0, v = t.searchPathsAdd(e), v.then(function(t) { f.scanGamesLocation.push(e), y.info("search path added", e), f.selectedPathChanged(e), u() }).catch(function(e) { e.cancelled || (y.error("SearchPathsAdd failed: ", e), c("l10n.addScanPathFailed")) }).finally(function() { f.addBtnDisabled = !1, v = null })) }).catch(function(e) { e.isCancelled || (y.error("cefService.localDirectoryExplorer: failed or cancelled", e), c("l10n.somethingWentWrong")) }) }, f.remove = function() { f.removeBtnDisabled = !0, y.info("user removing game scan location"), h = t.searchPathsRemove(m), h.then(function(e) { y.info("SearchPathsRemove success: ", m); var t = f.scanGamesLocation.indexOf(m); f.scanGamesLocation.splice(t, 1), f.scanGamesLocation.length > 0 ? f.selectedPathChanged(f.scanGamesLocation[0]) : m = null }).catch(function(e) { e.cancelled || (y.error("SearchPathsRemove failed: ", e), c("l10n.somethingWentWrong")) }).finally(function() { f.removeBtnDisabled = !1, h = null }) }, f.isSelected = function(e) { return m === e }, f.canRemovePath = function() { return !(m && !f.removeBtnDisabled) }, l.$on("$destroy", d) }]); t.preferencesGamesLocationController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } function o(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesGamesLocationItem = void 0; var i = n(3), a = o(i), s = n(4), l = n(854), c = r(l), u = s.ngPreferencesModule.directive("nvPreferencesGamesLocationItem", ["$log", "$timeout", function(e, t) { return { restrict: "E", bindToController: { nvLocation: "@", nvClickAction: "&" }, template: c.default, controller: [function() {}], controllerAs: "preferencesGamesLocationItem", link: function(n, r, o, i) { function s() { t(function() { i.showTooltip = a.size(c) > 0 && c[0].scrollWidth > c[0].offsetWidth }) } function l() { r.off("mouseover", s), c = null } var c = (e.getInstance("main.preferences/PreferencesGamesLocationItemDirective"), r.find("p")); i.showTooltip = !1, r.on("mouseover", s), n.$on("$destroy", l) } } }]); t.nvPreferencesGamesLocationItem = u }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferenceGamesLocation = void 0; var o = n(4), i = n(855), a = r(i); n(560), n(561); var s = o.ngPreferencesModule.component("nvPreferenceGamesLocation", { template: a.default, controller: "PreferencesGamesLocationController", controllerAs: "preferencesGameslocation" }); t.nvPreferenceGamesLocation = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGamesOpsController = void 0; var r = n(4); n(46); var o = r.ngPreferencesModule.controller("PreferencesGamesOpsController", ["$log", "gamesService", function(e, t) { function n() { t.isAutoOptimizeEnabled().then(function(e) { r.autoOptimize = e }).catch(function(e) { o.error("isAutoOptimizeEnabled failed with error:", e) }) } var r = this; r.autoOptimize = null; var o = e.getInstance("main.preferences/PreferencesGeneralGameOpsController"); r.setAutoOptimize = function() { o.info("setting autoOptimize to ", r.autoOptimize), t.setAutoOptimizeEnabled(r.autoOptimize) }, n() }]); t.preferencesGamesOpsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferenceGamesOps = void 0; var o = n(4), i = n(856), a = r(i); n(563); var s = o.ngPreferencesModule.component("nvPreferenceGamesOps", { template: a.default, controller: "PreferencesGamesOpsController", controllerAs: "preferencesGamesOps" }); t.nvPreferenceGamesOps = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGamesPerfModeController = void 0; var o = n(3), i = (r(o), n(4)); n(20), n(46), n(112); var a = i.ngPreferencesModule.controller("preferencesGamesPerfModeController", ["$log", "toastService", "$filter", "eventAggregator", "gamesService", "GAME_EVENTS", "$scope", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_SCREENS", "performanceModeService", "PERFORMANCE_MODES", function(e, t, n, r, o, i, a, s, l, c, u, d) { function f() { y.isGameOpsSupported = o.getGameOpsSupported(), _.info("opsfeaturestatus on init ", y.isGameOpsSupported) } function m() { y.aceSupported = JSON.parse(y.nvAceModeSupported), y.selectedPowerMode = JSON.parse(y.nvSelectedPowerMode), y.loadingFailed = JSON.parse(y.nvLoadingFailed) } function p() { f(), m() } function g(e) { _.info("Power Mode setState info", e), y.selectedPowerMode = e, s.setScreen(c.SCREEN_TOAST_MESSAGE), s.changeSetting(l.APPLICATION_SETTING_ENABLE_WHISPER_MODE, ""); var r = y.isGameOpsSupported && o.shouldProceedWithOptimizeAll(), i = e === d.MAX_P ? "l10n.toastPerfModeIsEnabled" : e === d.QUIET ? "l10n.toastQuietModeIsEnabled" : "l10n.toastBalanceModeIsEnabled"; y.selectedPowerMode = e, r && t.show({ textContentUseTranslate: i, isCustomIcon: !0, icon: "icon-optimized_reg", customColor: "color-green", hideDelay: 0, button: { text: n("translate")("l10n.optimize"), action: function() { y.optimizeGames(), s.push(l.TOAST_CLICKED_WHISPER_MODE_OPTIMIZE_ALL) } } }) } function v(e) { _.error("setStateInfo failed with error:", e), s.setScreen(c.SCREEN_TOAST_MESSAGE), s.changeSettingFail(l.APPLICATION_SETTING_ENABLE_WHISPER_MODE_FAILED, !0, e.status); var r = n("translate")("l10n.unableToUpdateSettings"); t.showError({ textContent: r }) } function h() { t.showProgress({ textContent: n("translate")("l10n.optimizing") }), E() } var y = this; y.loadingFailed = !1, y.powerModes = d, y.selectedPowerMode = y.powerModes.INVALID; var E, b, S, _ = e.getInstance("main.preferences/PerfModeController"); y.disablePowerModeButtons = function() { return y.requestInProgress || o.isOptimizeInProgress() }, p(), y.updatePowerMode = function(e) { y.requestInProgress = !0, _.info("setting power mode", e), u.setStateInfo(e).then(g).catch(v).finally(function() { y.requestInProgress = !1 }) }, y.optimizeGames = function() { _.info("optimize all games for quiet mode"), h(); var e = o.optimizeLocalGames(); e || S() }, E = function() { _.debug("registering game optimize events"), r.on(i.OPTIMIZE_GAMES_UPDATE, S) }, b = function() { _.debug("unregistering game optimize events"), r.off(i.OPTIMIZE_GAMES_UPDATE, S) }, S = function(e) { b(), t.show({ textContent: n("translate")("l10n.optimizeFinished") }) }, r.on(i.OPSFEATURE_UPDATED, f), a.$on("$destroy", function() { b(), r.off(i.OPSFEATURE_UPDATED, f) }) }]); t.preferencesGamesPerfModeController = a }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesGamesPerfMode = void 0; var o = n(4); n(17); var i = n(857), a = r(i); n(565); var s = o.ngPreferencesModule.component("nvPreferencesGamesPerfMode", { bindings: { nvAceModeSupported: "@", nvSelectedPowerMode: "@", nvLoadingFailed: "@" }, template: a.default, controller: "preferencesGamesPerfModeController", controllerAs: "preferencesGamesPerfMode" }); t.nvPreferencesGamesPerfMode = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGamesQuietModeController = void 0; var o = n(3), i = (r(o), n(4)); n(377), n(20), n(46); var a = i.ngPreferencesModule.controller("PreferencesGamesQuietModeController", ["$log", "quietModeService", "toastService", "eventAggregator", "gamesService", "GAME_EVENTS", "$scope", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_SCREENS", "$filter", function(e, t, n, r, o, i, a, s, l, c, u) { function d() { m.isGameOpsSupported = o.getGameOpsSupported(), h.info("opsfeaturestatus on init ", m.isGameOpsSupported) } function f() { n.showProgress({ textContent: u("translate")("l10n.optimizing") }), p() } var m = this; m.enabledQuietSwitch = !0, m.requestInProgress = !0, m.loadingFailed = !1, m.loadingDone = !1, m.isGameOpsSupported = !1; var p, g, v, h = e.getInstance("main.preferences/QuietModeController"); m.disableQuietModeSwitch = function() { return m.requestInProgress || o.isOptimizeInProgress() }, d(), t.getStateInfo().then(function(e) { var t = e; m.enabledQuietSwitch = t.enabled, m.requestInProgress = !1, m.loadingDone = !0, h.info("Quiet Mode state info", e) }).catch(function(e) { m.requestInProgress = !1, m.loadingFailed = !0, m.loadingDone = !0, h.error("getStateInfo failed with error:", e) }), m.onChangeQuietModeState = function(e) { m.requestInProgress = e, t.setStateInfo(m.enabledQuietSwitch).then(function(e) { h.info("Quiet Mode setState info", e), s.setScreen(c.SCREEN_TOAST_MESSAGE), s.changeSetting(l.APPLICATION_SETTING_ENABLE_WHISPER_MODE, m.enabledQuietSwitch); var t = m.isGameOpsSupported && o.shouldProceedWithOptimizeAll(), r = m.enabledQuietSwitch ? "l10n.toastQuietModeIsEnabled" : "l10n.toastQuietModeIsDisabled"; t ? n.show({ textContentUseTranslate: r, isCustomIcon: !0, icon: "icon-optimized_reg", customColor: "color-green", hideDelay: 0, button: { text: "l10n.optimize", action: function() { m.optimizeGames(), s.push(l.TOAST_CLICKED_WHISPER_MODE_OPTIMIZE_ALL) } } }) : m.enabledQuietSwitch === !1 && n.cancel() }).catch(function(e) { h.error("setStateInfo failed with error:", e), s.setScreen(c.SCREEN_TOAST_MESSAGE), s.changeSettingFail(l.APPLICATION_SETTING_ENABLE_WHISPER_MODE_FAILED, !0, e.status); var t = u("translate")("l10n.unableToUpdateSettings"); n.showError({ textContent: t }), m.enabledQuietSwitch = !m.enabledQuietSwitch }).finally(function() { m.requestInProgress = !1 }) }, m.optimizeGames = function() { h.info("optimize all games for quiet mode"), f(); var e = o.optimizeLocalGames(); e || v() }, p = function() { h.debug("registering game optimize events"), r.on(i.OPTIMIZE_GAMES_UPDATE, v) }, g = function() { h.debug("unregistering game optimize events"), r.off(i.OPTIMIZE_GAMES_UPDATE, v) }, v = function(e) { g(), n.show({ textContent: u("translate")("l10n.optimizeFinished") }) }, r.on(i.OPSFEATURE_UPDATED, d), a.$on("$destroy", function() { g(), r.off(i.OPSFEATURE_UPDATED, d) }) }]); t.preferencesGamesQuietModeController = a }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGamesScanController = void 0; var r = n(4); n(46), n(20); var o = r.ngPreferencesModule.controller("PreferencesGamesScanController", ["$log", "GAME_EVENTS", "gamesService", "eventAggregator", "$window", "$scope", "$filter", "toastService", "GAME_SCAN_STATE", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "localeService", "userGamesService", "jarvisService", "dbCacheService", "DB_NAMES", "COMMON_DYNAMIC_REDIRECT", function(e, t, n, r, o, i, a, s, l, c, u, d, f, m, p, g, v) { function h() { s.showProgress({ textContent: T.scanStatus }) } function y() { r.on(t.GAMELIST_UPDATED, w), r.on(t.SCAN_FINISHED, E), r.on(t.SCAN_FAILED, b), x === l.UI_SCAN ? (T.scanStatus = C("l10n.scanning"), T.scanInProgress = !0, h()) : (T.scanStatus = C("l10n.scanNow"), T.scanInProgress = !1), O(), T.totalGames = _.size(T.gameList) } var E, b, S, w, A, T = this, I = e.getInstance("main.preferences/PreferencesGamesScanController"), C = a("translate"), x = n.getUiScanState(), M = m.getLoggedInUser(), D = p.getCachedUserItem(M.userId, g.JARVIS_GFE_STORE, g.JARVIS_VIEW_STATE); T.gameList = null; var O = function() { var e = f.getUserGames(); I.debug("get all games count:", e.length), T.gameList = _.map(e, function(e) { var t = n.getSystemGame(e.gameId), r = {}; return _.extend(r, e), _.isUndefined(t) ? I.error("systemGame undefined") : r.systemGame = t, r }) }; T.scanGames = function() { c.push(u.PREFERENCES_GAMES_SCAN_NOW), T.scanStatus = C("l10n.scanning"), T.scanInProgress = !0, h(), n.scanLocalGames(!1) }; var R = function() { I.debug("registering game optimize events"), r.on(t.OPTIMIZE_GAMES_UPDATE, L) }, N = function() { I.debug("unregistering game optimize events"), r.off(t.OPTIMIZE_GAMES_UPDATE, L) }, L = function(e) { c.endLoad(u.HOME_OPTIMIZETIME_GAMES, A), N(), s.show({ textContent: a("translate")("l10n.optimizeFinished") }) }, P = function() { s.showProgress({ textContent: a("translate")("l10n.optimizing") }), R() }; T.optimizeGamesFromScan = function() { I.info("optimize local games after scan"), P(), A = c.startLoad(u.HOME_OPTIMIZETIME_GAMES), n.optimizeLocalGames() }, T.scanGamesProgressText = function(e) { var t = "l10n.scanGamesProgress"; return 0 === e ? t = "l10n.noGamesFound" : 1 === e && (t = "l10n.scanGameProgress"), t }; var E = function() { O(), T.totalGames = _.size(T.gameList), S(), T.scanStatus = C("l10n.scanNow"), T.scanInProgress = !1; var e = { textContent: a("translate")(T.scanGamesProgressText(T.totalGames), { numGamesScanned: T.totalGames }) }; n.hasNoGame(T.gameList) || n.allGamesFullyOptimized(T.gameList) || n.hasHiddenGame(T.gameList, null, D) ? s.show(e) : (I.info("game optimization required"), n.isAutoOptimizeEnabled().then(function(t) { t || angular.extend(e, { button: { text: a("translate")("l10n.optimize"), action: T.optimizeGamesFromScan } }) }).finally(function() { s.show(e) })) }, b = function() { T.scanStatus = C("l10n.scanNow"), T.scanInProgress = !1, s.showError({ textContent: a("translate")("l10n.scanningFailed") }) }; T.onLaunchUrl = function() { var e = v.BASE_URL + d.getCurrentLocaleWithUnderscore() + "&page=" + v.SUPPORTED_GAMES; I.info("SupportedGames redirects to url:: ", e), o.open(e) }, w = function() { O(), T.totalGames = _.size(T.gameList) }, y(), i.$on("$destroy", function() { r.off(t.GAMELIST_UPDATED, w), r.off(t.SCAN_FINISHED, E), r.off(t.SCAN_FAILED, b), N() }), (S = function() { n.getLastRefreshTime().then(function(e) { T.lastRereshTime = e, I.info("last gamesscanned time is", T.lastRereshTime) }).catch(function(e) { I.error("getlastRefreshTime failed with error:", e) }) })() }]); t.preferencesGamesScanController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferenceGamesScan = void 0; var o = n(4), i = n(859), a = r(i); n(568); var s = o.ngPreferencesModule.component("nvPreferenceGamesScan", { template: a.default, controller: "PreferencesGamesScanController", controllerAs: "preferencesGamesScan" }); t.nvPreferenceGamesScan = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGeneralAboutController = void 0; n(4); n(31), n(26), n(29), n(20), n(540), n(206); var o = n(192), i = (r(o), angular.module("main.preferences").controller("PreferencesGeneralAboutController", ["$log", "gfeService", "preferencesService", "toastService", "$filter", "GFE_DOWNLOAD_PROGRESS_STATUS", "GFE_UPDATE_EVENTS", "TASK_STATUS", "eventAggregator", "$scope", "cefService", "POST_PROCESSING_STATES", function(e, t, n, r, o, i, a, s, l, c, u, d) { function f() { r.showError({ textContent: o("translate")("l10n.checkInternetConnectivity") }) } function m() { var e = o("translate")("l10n.ExpFeatureUpdatesDisabled"), t = "error_outline"; 1 == T.clientBetaUpdateEnabled && (e = o("translate")("l10n.ExpFeatureUpdatesEnabled"), t = "check"), g(e, t) } function p() { T.clientBetaUpdateCheckboxEnabled = !(T.clientBetaUpdateEnabled === !0 && T.gfeBetaUpdate && T.gfeBetaUpdate.downloadStatus && !T.showDownloadButton(T.gfeBetaUpdate.downloadStatus.status)) } function g(e, t) { r.isOpen() ? r.cancel().then(function() { r.show({ textContent: e, icon: t }) }) : r.show({ textContent: e, icon: t }) } function v(e) { g(e, "error_outline") } function h() { return n.betaPostProcessingStatus === d.FINISHED } function y() { return n.betaPostProcessingStatus === d.FAILED } function E() { return n.betaPostProcessingStatus === d.STARTED } function b(e) { if (T.clientBetaUpdateCheckboxEnabled = !0, e.status === s.TASK_PAUSED_UNABLE_TO_REACH_SERVER || e.status === s.TASK_CHECK_SUM_ERROR || e.status === s.TASK_SIGNATURE_VERIFICATION_FAILS) v(C("l10n.downloadFailed")); else if (e.status === s.TASK_FAILED_UNABLE_TO_REACH_SERVER) v(C("l10n.unableToConnectToNvidia")); else if (e.status === s.TASK_DISK_WRITE_FAIL) { var t = o("convertBytesToKBMBGB")(e.totalBytes); if (e.downloadedLocation.length > 0) { var n = e.downloadedLocation.split(":")[0]; n = n.toUpperCase(); var r = C("l10n.downloadDiskSpace", { value: t, drive: n }); v(r) } } } function S() { T.GFECheckForUpdateInProgress = !0, T.clientBetaUpdateCheckboxEnabled = !1 } function w() { T.clientBetaUpdateCheckboxEnabled = !0, T.GFECheckForUpdateInProgress = !1, v(C("l10n.unableToConnectToNvidia")) } function A() { if (T.clientBetaUpdateCheckboxEnabled = !(T.gfeBetaUpdate && T.gfeBetaUpdate.downloadURL && !_.isEmpty(T.gfeBetaUpdate.downloadURL)), I.info("checkforupdate finished", T.gfeBetaUpdate), T.clientBetaUpdateCheckboxEnabled) { var e = o("translate")("l10n.noUpdatesAreAvailable"), t = "check"; g(e, t) } T.GFECheckForUpdateInProgress = !1 } var T = this, I = e.getInstance("main.preferences/PreferencesFeatureReadinessController"); T.gfeBetaUpdate = {}, T.version = t.version, T.GFECheckForUpdateInProgress = !1, T.clientBetaUpdateEnabled = !1; var C = o("translate"); T.clientBetaUpdateCheckboxEnabled = !0, T.beta = "", n.isGFEBetaBuild().then(function(e) { T.beta = e === !0 ? o("translate")("l10n.beta") : "", T.beta = T.beta.toUpperCase() }), T.setClientBetaUpdateEnabled = function() { I.info("set experimental feature flag:", T.clientBetaUpdateEnabled), m(), n.setClientBetaUpdateEnabled(T.clientBetaUpdateEnabled).then(function() { T.clientBetaUpdateCheckboxEnabled = !T.clientBetaUpdateEnabled }).catch(function(e) { I.error("setClientBetaUpdateEnabled failed: " + e), f(), T.clientBetaUpdateCheckboxEnabled = !0 }) }, n.getClientBetaUpdateEnabled().then(function(e) { T.clientBetaUpdateEnabled = "1" === e.data, p() }).catch(function(e) { I.error("getClientBetaUpdateEnabled failed: " + e), f() }), T.onShowReleaseHighlight = function(e) { n.onShowReleaseHighlight(!1) }, T.onShowLicense = function(e) { n.showEula() }, T.onLaunchFaq = function() { n.showFaq() }, T.onLaunchPrivacyPolicy = function() { n.showPrivacyPolicy() }, n.getGFEBetaUpdate().then(function(e) { T.gfeBetaUpdate = e, p() }).catch(function(e) { I.error("getGFEBetaUpdate failed: " + e) }), T.isDownloadStarted = function(e) { return e === s.TASK_RUNNING || e === s.TASK_RETRY }, T.isDownloadPaused = function(e) { return e === s.TASK_PAUSED || e === s.TASK_PAUSED_UNABLE_TO_REACH_SERVER }, T.isDownloadCompleted = function(e) { return e === s.TASK_COMPLETED }, T.showRestartGfeMessage = function(e) { return T.isDownloadCompleted(e) && (h() || y()) }, T.showDownloadButton = function(e) { var t = T.clientBetaUpdateEnabled === !0 && T.GFECheckForUpdateInProgress === !1 && (e === s.TASK_PAUSED || e === s.TASK_PAUSED_UNABLE_TO_REACH_SERVER || e === s.TASK_CHECK_SUM_ERROR || e === s.TASK_FAILED_UNABLE_TO_REACH_SERVER || e === s.TASK_SIGNATURE_VERIFICATION_FAILS || e === s.TASK_DISK_WRITE_FAIL); return t }, T.showPreparingForInstall = function(e, t) { var n = T.clientBetaUpdateEnabled === !0 && e === s.TASK_RUNNING && 100 === t || T.isDownloadCompleted(e) && E(); return n }, T.startDownload = function(e) { n.startDownload(e.version, e.downloadURL).then(function(t) { I.info("download started", t.data), e.downloadStatus = t.data, T.clientBetaUpdateCheckboxEnabled = !1 }).catch(function(e) { I.error("GFE download failed to start", e), v(C("l10n.driverDownloadFailed")) }) }, T.pauseDownload = function(e) { n.pauseDownload(e.downloadStatus.taskId).then(function(t) { e.downloadStatus = t.data, I.info("GFE download paused", e.downloadStatus) }).catch(function(e) { I.error("GFE download failed to pause with error", e) }) }, T.resumeDownload = function(e) { n.resumeDownload(e.downloadStatus.taskId).then(function(t) { e.downloadStatus = t.data, I.info("GFE download resume", e.downloadStatus) }).catch(function(e) { I.error("GFE download failed to resume with error", e) }) }, T.stopDownload = function(e) { n.stopDownload(e.downloadStatus.taskId).then(function(t) { e.downloadStatus = t.data, I.info("GFE download stoped", e.downloadStatus) }).catch(function(e) { I.error("GFE download failed to stop with error", e) }) }, T.getProgressString = function(e) { var t = ""; if (e && e.downloadStatus) { var n = o("convertBytesToKBMBGB")(e.downloadStatus.totalBytes), r = o("convertBytesToKBMBGB")(e.downloadStatus.bytesDone); t = r + "/" + n } return t }, T.restartNow = function() { u.restartApp() }, T.getDownloadStatusMessage = function(e) { var t = ""; return e === s.TASK_RUNNING ? t = C("l10n.downloading") : T.isDownloadPaused(e) ? t = C("l10n.paused") : e === s.TASK_RETRY && (t = C("l10n.retrying")), t }, T.showCheckingForUpdate = function() { var e = T.GFECheckForUpdateInProgress === !0 || !_.isEmpty(T.gfeBetaUpdate) && !_.isEmpty(T.gfeBetaUpdate.downloadURL) && T.gfeBetaUpdate.downloadStatus && T.gfeBetaUpdate.downloadStatus.status === s.TASK_NOT_STARTED; return e }, l.on(i.FAILED, b), l.on(a.SCAN_STARTED, S), l.on(a.SCAN_FAILED, w), l.on(a.SCAN_FINISHED, A), c.$on("$destroy", function() { l.off(a.SCAN_STARTED, S), l.off(a.SCAN_FAILED, w), l.off(a.SCAN_FINISHED, A), l.off(i.FAILED, b) }) }])); t.preferencesGeneralAboutController = i }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferenceGeneralAbout = void 0; var o = n(4); n(34); var i = n(860), a = r(i); n(570); var s = o.ngPreferencesModule.component("nvPreferenceGeneralAbout", { template: a.default, controller: "PreferencesGeneralAboutController", controllerAs: "preferencesGeneralAbout" }); t.nvPreferenceGeneralAbout = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.PreferencesGeneralController = void 0; var r = n(4); n(112), n(304), n(305); var o = r.ngPreferencesModule.controller("PreferencesGeneralController", ["$log", "quietModeService", "performanceModeService", "framerateLimiterService", "eventAggregator", "$scope", "QUIET_MODE_EVENTS", function(e, t, n, r, o, i, a) { function s() { t.getQuietMode2SupportInfo().then(function(e) { if (e && e.criteria) { var t = e.criteria.states, n = t.find(function(e, t, n) { return "wm2" === e.name }); f = !(!n || !n.state), d = e.criteria.overallState, m.info("WM2 capability", f, d) } else m.error("getQuietModeSupporteState(): Something went wrong!") }).catch(function(e) { f = !1, m.error("getQuietMode2SupportInfo() support error!" + e) }) } function l() { s(), t.getStateInfo().then(function(e) { u = e.supported, m.info("Quiet Mode getSupportInfo success: ", e) }, function(e) { m.error("Quiet Mode getSupportInfo failed with error: ", e) }), r.getSupportInfo().then(function(e) { c.isBatteryBoostSupported = e.supported, m.info("Framerate Limiter getSupportInfo success: ", e) }).catch(function(e) { m.error("Framerate Limiter getSupportInfo failed with error: ", e); }), n.isFeatureAvailableOnAB().then(function(e) { e ? n.getStateInfo().then(function(e) { m.info("Performance Mode getSupportInfo success: ", e), c.isPerfModeSupported = e.supported, c.selectedPowerMode = e.performanceMode }, function(e) { m.error("Performance Mode getSupportInfo failed with error: ", e), c.isPerfModeSupported = !1, c.loadingAceModeFailed = !0 }) : c.isPerfModeSupported = !1 }), o.on(a.SUPPORT_UPDATE, s) } var c = this; c.isPerfModeSupported = !1, c.loadingAceModeFailed = !1, c.isBatteryBoostSupported = !1; var u = !1, d = !1, f = !1, m = e.getInstance("main.preferences/PreferencesGeneralController"); l(), c.showQuietMode = function() { return u && !f && !c.isPerfModeSupported }, c.showQuietMode2 = function() { return d && !c.isPerfModeSupported }, i.$on("$destroy", function() { o.off(a.SUPPORT_UPDATE, s) }) }]); t.PreferencesGeneralController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesGeneral = void 0; var o = n(4); n(571), n(577), n(582), n(579), n(575), n(595), n(552); var i = n(861), a = r(i); n(572), n(305); var s = o.ngPreferencesModule.component("nvPreferencesGeneral", { template: a.default, controller: "PreferencesGeneralController", controllerAs: "preferencesGeneral" }); t.nvPreferencesGeneral = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGeneralDownloadsController = void 0; var r = n(4); n(29), n(20); var o = r.ngPreferencesModule.controller("PreferencesGeneralDownloadsController", ["$scope", "$log", "preferencesService", "eventAggregator", "PREFERENCES_EVENTS", "toastService", "$filter", function(e, t, n, r, o, i, a) { function s() { i.showError({ textContent: a("translate")("l10n.somethingWentWrong") }) } function l() { n.getAutoDownloadDriverUpdates().then(function(e) { u.autoDownloadDriverUpdates = e }).catch(function(e) { s(), d.error("getAutoDownloadDriverUpdates failed: " + e) }) } function c() { l(), r.on(o.AUTOMATIC_DRIVERDOWNLOAD, l) } var u = this; u.autoDownloadDriverUpdates = !1; var d = t.getInstance("main.preferences/PreferencesGeneralDownloadsController"); u.setAutoDownloadDriverUpdates = function() { n.setAutoDownloadDriverUpdates(u.autoDownloadDriverUpdates).catch(function(e) { s(), d.error("setAutoDownloadDriverUpdates failed: " + e) }) }, c(), e.$on("$destroy", function() { r.off(o.AUTOMATIC_DRIVERDOWNLOAD, l) }) }]); t.preferencesGeneralDownloadsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferenceGeneralDownloads = void 0; var o = n(4), i = n(862), a = r(i); n(574); var s = o.ngPreferencesModule.component("nvPreferenceGeneralDownloads", { template: a.default, controller: "PreferencesGeneralDownloadsController", controllerAs: "preferencesGeneralDownloads" }); t.nvPreferenceGeneralDownloads = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGeneralLanguageController = void 0; var r = n(4); n(11), n(62); var o = r.ngPreferencesModule.controller("PreferencesGeneralLanguageController", ["dbCacheService", "DB_NAMES", "localeService", "$log", "TELEMETRY_CRIMSON_EVENT_NAMES", "telemetryService", "TELEMETRY_SCREENS", function(e, t, n, r, o, i, a) { function s() { i.setScreen(a.SCREEN_PREFERENCES_GENERAL) } var l = this, c = r.getInstance("main.preferences/PreferencesGeneralLanguageController"); l.EditMode = !1, l.languages = n.getSupportedLanguages(); var u = n.getCurrentLocale(); l.selectedLanguage = u.name, l.changedLanguage = l.selectedLanguage, l.onCancel = function() { l.EditMode = !1, l.changedLanguage = l.selectedLanguage }, l.onApply = function() { l.EditMode = !1, l.selectedLanguage = l.changedLanguage; var e = n.getLocaleFromLocaleName(l.selectedLanguage); n.changeLocale(e).then(function() { c.info("Changed language to: ", e.code), i.changeSetting(o.APPLICATION_SETTING_LANGUAGE_SELECTION, e.code) }).catch(function(t) { c.error("Failed to change language to: ", e.code), u = n.getCurrentLocale(), l.selectedLanguage = u.name, i.changeSettingFail(o.APPLICATION_SETTING_LANGUAGE_SELECTION_FAILED, e.code, t.status) }) }, l.openChangeLocale = function() { l.EditMode = !0 }, l.devFeatures = e.getCachedGlobalItem(t.DEV_STORE, t.DEV_FEATURES), s() }]); t.preferencesGeneralLanguageController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferenceGeneralLanguage = void 0; var o = n(4), i = n(863), a = r(i); n(576); var s = o.ngPreferencesModule.component("nvPreferenceGeneralLanguage", { template: a.default, controller: "PreferencesGeneralLanguageController", controllerAs: "preferencesGeneralLanguage" }); t.nvPreferenceGeneralLanguage = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGeneralNotificationsController = void 0; var o = n(4); n(29), n(20), n(186), n(120), n(16); var i = n(3), a = r(i), s = o.ngPreferencesModule.controller("PreferencesGeneralNotificationsController", ["$log", "preferencesService", "toastService", "$filter", "rewardsService", "$q", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", function(e, t, n, r, o, i, s, l) { function c() { n.showError({ textContent: r("translate")("l10n.somethingWentWrong") }) } function u() { t.getNotifyGeforceDriverUpdate().then(function(e) { p.notifyGeforceDriverUpdate = e }).catch(function(e) { c(), g.error("getNotifyGeforceDriverUpdate failed: " + e) }) } function d() { t.getRewardsNotificationPreference().then(function(e) { a.isUndefined(e) ? (g.info("No defined preference exists for reward notification, setting as enabled"), p.notifyRewardsUpdate = !0) : p.notifyRewardsUpdate = e }).catch(function(e) { c(), g.error("getRewardsNotificationPreference failed with error:", e) }) } function f() { var e = i.defer(); return o.getRewardsEnabled().then(function(t) { t ? e.resolve() : e.reject() }).catch(function() { e.reject() }), e.promise } function m() { u(), f().then(function() { d() }) } var p = this; p.notifyGeforceDriverUpdate = !1, p.notifyRewardsUpdate = !0; var g = e.getInstance("main.preferences/PreferencesGeneralNotificationsController"); p.setNotifyGeforceDriverUpdate = function() { t.setNotifyGeforceDriverUpdate(p.notifyGeforceDriverUpdate).catch(function(e) { c(), g.error("setNotifyGeforceDriverUpdate failed: " + e) }) }, p.setNotifyRewardsUpdate = function() { s.changeSetting(l.APPLICATION_SETTING_DESKTOP_REWARDS_NOTIFICATION, p.notifyRewardsUpdate), t.setRewardsNotificationPreference(p.notifyRewardsUpdate).catch(function(e) { c(), g.error("setRewardsNotificationPreference failed with error:", e) }) }, m() }]); t.preferencesGeneralNotificationsController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferenceGeneralNotifications = void 0; var o = n(4), i = n(864), a = r(i); n(578); var s = o.ngPreferencesModule.component("nvPreferenceGeneralNotifications", { template: a.default, controller: "PreferencesGeneralNotificationsController", controllerAs: "preferencesGeneralNotifications" }); t.nvPreferenceGeneralNotifications = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } function o(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGeneralQuiteMode2Controller = void 0; var i = n(35), a = o(i), s = n(3), l = r(s), c = n(4); n(165), n(20); var u = c.ngPreferencesModule.controller("PreferencesGeneralQuiteMode2Controller", ["$scope", "$log", "$document", "quietModeService", "$timeout", "eventAggregator", "COMMON_EVENTS", "toastService", "QUITE_MODE_2_FAN_VOLUME_SLIDER", "QUITE_MODE_2_BASE_FRAME_RATE_SLIDER", "QUITE_MODE_2_FAN_VOLUME_MODES", "gamesService", "GAME_EVENTS", "QUIET_MODE_EVENTS", "TELEMETRY_CRIMSON_EVENT_NAMES", "telemetryService", "QUIET_MODE_2_SETTING_TYPE", "$filter", function(e, t, n, r, o, i, s, c, u, d, f, m, p, g, v, h, y, E) { function b() { M.isGameOpsSupported = m.getGameOpsSupported(), F.info("opsfeaturestatus on init ", M.isGameOpsSupported) } function S() { var e = 0; M.sliders.forEach(function(t) { if (t.tractContainer) { L = t.tractContainer.getBoundingClientRect(); var n = Math.floor((t.max - t.min) / t.step); N = t.tickCanvas.getContext("2d"), t.tickCanvas.width = L.width, t.tickCanvas.height = L.height, e++, l.isNull(N) || N.clearRect(0, 0, L.width, L.height); for (var r, o = 0; o <= n; o++) r = Math.round(L.width * (o / n)), N.fillStyle = "#FFFFFF", N.fillRect(r - 1, 0, 2, L.height) } }) } function _(e) { e && M.quietStateInfo && (e.enabled !== M.quietStateInfo.enabled || e.fanVolume !== M.quietStateInfo.fanVolume || e.baseFrameRate !== M.quietStateInfo.baseFrameRate) && T() } function w() { i.on(s.WINDOW_RESIZE, S), i.on(p.OPSFEATURE_UPDATED, b), i.on(g.CHANGED, _), b(), T() } function A() { i.off(s.WINDOW_RESIZE, S), i.off(g.CHANGED, _), k(), i.off(p.OPSFEATURE_UPDATED, b) } function T() { r.getQuietMode2StateInfo().then(function(e) { M.quietStateInfo = (0, a.default)({}, e), o(function() { S() }), M.requestInProgress = !1, M.loadingDone = !0, F.info("Quiet Mode2 state info", e) }).catch(function(e) { M.requestInProgress = !1, M.loadingFailed = !0, M.loadingDone = !0, F.error("get Quiet Mode2 StateInfo failed with error:", e) }) } function I() { c.showProgress({ textContent: E("translate")("l10n.optimizing") }), P() } function C(e) { return (l.isNull(e) || l.isUndefined(e)) && (e = ""), e.toString() } function x(e, t, n) { var r = 1 === M.quietStateInfo.fanVolume ? "Quieter" : 2 === M.quietStateInfo.fanVolume ? "Quiet" : "Balanced"; h.push(v.APPLICATION_SETTING_CHANGD_WHISPER_MODE_2, { enabled: M.quietStateInfo.enabled ? "true" : "false", fanVolume: r, baseFrameRate: M.quietStateInfo.baseFrameRate, status: e, errorDetails: t, changedSettingType: n }) } var M = this, D = null, O = null, R = null, N = null, L = {}; M.quietStateInfo = { baseFrameRate: 30, fanVolume: 1, enabled: !1 }, M.settingType = y, M.requestInProgress = !0, M.loadingFailed = !1, M.loadingDone = !1, M.isGameOpsSupported = !1; var P, k, G, F = t.getInstance("main.preferences/QuietMode2Controller"); M.fanVolumeStrings = ["l10n.quieter", "l10n.quiet", "l10n.balancedMode"], M.sliders = [{ min: u.MIN, max: u.MAX, step: u.STEP, tractContainer: null, tickCanvas: null }, { min: d.MIN, max: d.MAX, step: d.STEP, tractContainers: null, tickCanvas: null }], M.disableQuiteModeSwitch = function() { return M.requestInProgress || m.isOptimizeInProgress() }, M.onChangeFanSpeedState = function(e, t) { switch (M.quietStateInfo.fanVolume) { case f.QUIETER: M.quietStateInfo.baseFrameRate = 30; break; case f.QUIET: M.quietStateInfo.baseFrameRate = 40; break; case f.BALANCED: M.quietStateInfo.baseFrameRate = 60 } M.onChangeQuiteMode2State(e, t) }, M.optimizeGames = function() { F.info("optimize all games for quiet mode2"), I(); var e = m.optimizeLocalGames(); e || G() }, P = function() { F.debug("registering game optimize events"), i.on(p.OPTIMIZE_GAMES_UPDATE, G) }, k = function() { F.debug("unregistering game optimize events"), i.off(p.OPTIMIZE_GAMES_UPDATE, G) }, G = function(e) { k(), c.show({ textContent: E("translate")("l10n.optimizeFinished") }) }, M.disableQuietMode2Switch = function() { return M.requestInProgress || m.isOptimizeInProgress() }, M.onChangeQuiteMode2State = function(e, t) { F.info("settingType changed", t), M.requestInProgress = e, r.setQuietMode2StateInfo(M.quietStateInfo).then(function(n) { F.info("Quite mode 2 setState info", n), x("success", "", t); var r = e && M.isGameOpsSupported && m.shouldProceedWithOptimizeAll(), o = M.quietStateInfo.enabled ? "l10n.toastQuietModeIsEnabled" : "l10n.toastQuietModeIsDisabled"; r ? c.show({ textContentUseTranslate: o, isCustomIcon: !0, icon: "icon-optimized_reg", customColor: "color-green", hideDelay: 0, button: { text: "l10n.optimize", action: function() { M.optimizeGames(), h.push(v.TOAST_CLICKED_WHISPER_MODE_2_OPTIMIZE_ALL) } } }) : M.quietStateInfo.enabled === !1 && c.cancel() }).catch(function(e) { F.error("setQuietMode2 failed with error:", e), x("failure", C(e.status), t); var n = E("translate")("l10n.unableToUpdateSettings"); c.showError({ textContent: n }), T() }).finally(function() { M.requestInProgress = !1 }) }, n.ready(function() { var e = [".fan-control-slider", ".fps-control-slider"], t = 0; e.forEach(function(e) { var r = angular.element(n[0].querySelector(e)); r && (D = angular.element(r[0].querySelector(".md-track-ticks")), D.css("display", "block"), D.css("z-index", "0"), D.find("canvas").css("display", "none"), R = angular.element("").css("position", "absolute"), D.append(R), M.sliders[t].tickCanvas = R[0], O = angular.element(r[0].querySelector(".md-track-container")), M.sliders[t].tractContainer = O[0]), t++ }), S() }), e.$on("$destroy", A), w() }]); t.preferencesGeneralQuiteMode2Controller = u }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesGeneralShareController = void 0; var r = n(4); n(29), n(362), n(20); var o = r.ngPreferencesModule.controller("PreferencesGeneralShareController", ["$scope", "preferencesService", "$log", "toastService", "$filter", "eventAggregator", "COMMON_EVENTS", "socketService", "SHARE_SOCKET_EVENTS", "keyboardService", "SHARE_CONSTANTS", "COMMON_HTTP_ERROR_CODES", "PREFERENCES_EVENTS", "INSTALLER_EVENTS", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "$timeout", "preferencesFeatureService", function(e, t, n, r, o, i, a, s, l, c, u, d, f, m, p, g, v, h) { function y() { t.getHotkeyShortcut(u.SHARE_HOTKEY_ID).then(function(e) { P.translateValues.assignedKey = c.shortcutToStr(e.keys), P.shareHotkeyFetched = !0, k.info("Share hotkey: ", P.translateValues.assignedKey) }).catch(function(e) { P.shareHotkeyFetched = !1, k.error("Error in retrieving shortcut for OpenShare:", e) }) } function E(e) { P.toggleState = !1, P.enabledShare = e.ready, k.info("Got OSC ready event with data", e.ready), M() } function b() { r.showError({ textContent: o("translate")("l10n.tryRestartSystem") }) } function S() { r.showError({ textContent: o("translate")("l10n.openShareFailure") }) } function _() { t.getShareRunningStatus().then(function(e) { P.enabledShare = e, k.info("getShareRunningStatus returned: ", P.enabledShare), P.loadingDone = !0 }).catch(function(e) { k.error("getShareRunningStatus failed."), P.loadingDone = !0, P.enabledShare = !1 }) } function w() { _() } function A() { P.isAnselSupported ? P.shareDialogDescription = o("translate")("l10n.shareDialogDescriptionWithAnsel") : P.shareDialogDescription = o("translate")("l10n.shareDialogDescription") } function T() { P.isShareSupported && t.isAnselFeatureSupportedOnSystem().then(function(e) { P.isAnselSupported = e.isSupported, A() }) } function I() { t.isShareFeatureSupportedOnSystem().then(function(e) { P.isShareSupported = e, k.info("isShareFeatureSupportedOnSystem response: ", P.isShareSupported), T() }).catch(function(e) { k.error("isShareFeatureSupportedOnSystem failed.") }) } function C() { k.info("onSysInfoUpdated event."), I(), _() } function x(e) { P.toggleState = e, e === !0 ? D() : M() } function M() { G && (k.info("Stop OSC notification timer"), v.cancel(G), G = null) } function D() { M(), k.info("Start OSC notification timer"), G = v(function() { k.info("OSC ready notification timeout"), P.toggleState = !1, M(), _() }, u.OSC_READY_EVENT_NOTIFICATION_INTERVAL) } function O(e) { k.info("Hotkey changed notification:", e.notification, e.hotkeyId), e.notification === u.HOTKEY_CHANGED && e.hotkeyId === u.SHARE_HOTKEY_ID && y() } function R() { P.shareLoaded = t.shareAddonLoaded, P.shareLoaded || (P.enabledShare = !1) } function N() { R(), P.translateValues = { assignedKey: o("translate")("l10n.shareShortcut") }, y(), s.register(l.OSCREADY_UPDATE, a.OSC_READY), s.register(l.OSCHOTKEY_CHANGED_NOTIFICATION, a.OSC_HOTKEY_CHANGED), i.on(a.SHARE_STATUS_CHANGED, w), i.on(a.OSC_READY, E), i.on(a.SYSTEMINFO_UPDATED, C), i.on(a.SHARE_OPEN_IN_PROGRESS, x), i.on(a.OSC_HOTKEY_CHANGED, O), i.on(f.AUTOBETA_SETTING_CHANGED, T), i.on(m.INSTALL_DONE, T), i.on(a.GFWSL_LOCALE_PARAMS_UPDATED, A) } function L() { i.off(a.SHARE_STATUS_CHANGED, w), i.off(a.OSC_READY, E), i.off(a.SYSTEMINFO_UPDATED, C), i.off(a.SHARE_OPEN_IN_PROGRESS, x), i.off(a.OSC_HOTKEY_CHANGED, O), i.off(f.AUTOBETA_SETTING_CHANGED, T), i.off(m.INSTALL_DONE, T), i.off(a.GFWSL_LOCALE_PARAMS_UPDATED, A), M() } var P = this; P.enabledShare = !1, P.isShareSupported = !1, P.shareHotkeyFetched = !1, P.shareLoaded = !1, P.isAnselSupported = !1, P.shareDialogDescription = o("translate")("l10n.shareDialogDescription"); var k = n.getInstance("main.preferences/PreferencesGeneralShareController"); P.loadingDone = !1; var G; P.onChangeShareState = function() { x(!0), i.trigger(a.SHARE_STATUS_CHANGE_IN_PROGRESS, P.toggleState), t.toggleShareState(P.enabledShare).then(function(e) { k.info("toggleShareState status: ", e), P.enabledShare ? y() : (x(!1), i.trigger(a.SHARE_STATUS_CHANGE_IN_PROGRESS, P.toggleState)), p.changeSetting(g.APPLICATION_SETTING_ENABLE_SHARE, !!P.enabledShare) }).catch(function(e) { k.error("toggleShareState failed."), i.trigger(a.SHARE_STATUS_CHANGE_IN_PROGRESS, P.toggleState), P.enabledShare && !P.shareLoaded && e.status === d.NOT_FOUND ? h.handleShareNotReady() : b(), P.enabledShare = !1, x(!1), p.changeSettingFail(g.APPLICATION_SETTING_ENABLE_SHARE_FAILED, !!P.enabledShare, e.data && e.data.code || e.status) }) }, _(), I(), P.showHotkeyInfoAndIcon = function() { return P.shareHotkeyFetched && P.enabledShare && !P.toggleState }, P.openOscSettings = function() { t.openOscPreferences().then(function(e) { k.info("Opened OSC Settings page successfully. ", e) }).catch(function(e) { k.error("Error in opening OSC Settings page:", e), S() }) }, N(), e.$on("$destroy", L) }]); t.preferencesGeneralShareController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferenceGeneralShare = void 0; var o = n(4); n(17); var i = n(866), a = r(i); n(581); var s = o.ngPreferencesModule.component("nvPreferenceGeneralShare", { template: a.default, controller: "PreferencesGeneralShareController", controllerAs: "preferencesGeneralShare" }); t.nvPreferenceGeneralShare = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesLedController = void 0; var o = n(4), i = n(710), a = r(i); n(379); var s = o.ngPreferencesModule.controller("PreferencesLedController", ["$log", "preferencesService", "cefService", "LED_EFFECT", "ANIMATION", "DEVICE_TYPE", "VARIATION", "$filter", "LED_SELECTION", "ZONE_LOCATION", "LED_DEFAULTS", "$document", "$timeout", function(e, t, n, r, o, i, s, l, c, u, d, f, m) { function p() { C.showBrightnessSliderPanel = !0, C.sliderBrightness = C.selectedGpu.zone[C.selectedZoneIndex].variationParameter, C.selectedLedEffect === r.LED_ILLUMINATION_GPU_PROPERTY_LIMIT_REACHED ? (C.brightnessSliderMin = 0, C.selectedVariation === s.LED_ILLUMINATIONVARIATION_GPU_UTILIZATION ? (C.labelBrightnessSlider = D("l10n.gpuUtilization") + " (" + D("l10n.percentageSign") + ")", C.brightnessSliderMax = d.MAX_GPU_UTILIZATION) : C.selectedVariation === s.LED_ILLUMINATIONVARIATION_GPU_TEMP ? (C.labelBrightnessSlider = D("l10n.gpuTemparature") + " (" + D("l10n.centigrateSign") + ")", C.brightnessSliderMax = d.MAX_GPU_TEMP) : C.selectedVariation === s.LED_ILLUMINATIONVARIATION_GPU_CLOCK ? (C.labelBrightnessSlider = D("l10n.gpuClock") + " (" + D("l10n.hertzSign") + ")", C.brightnessSliderMax = d.MAX_GPU_CLOCK) : C.selectedVariation === s.LED_ILLUMINATIONVARIATION_GPU_FANSPEED ? (C.labelBrightnessSlider = D("l10n.gpuFanSpeed") + " (" + D("l10n.rpmSign") + ")", C.brightnessSliderMax = d.MAX_GPU_FANSPEED) : (C.labelBrightnessSlider = D("l10n.gpuVoltage") + " (" + D("l10n.volateSign") + ")", C.brightnessSliderMax = d.MAX_GPU_VOLTAGE)) : (C.selectedAnimationType === o.VARIABLE_BRIGHTNESS ? C.labelBrightnessSlider = D("l10n.maxBrightness") : C.labelBrightnessSlider = D(C.showSliderBrightness === !0 ? "l10n.brightness" : "l10n.brightnessRange"), C.brightnessSliderMin = d.MIN_BRIGHTNESS, C.brightnessSliderMax = d.MAX_BRIGHTNESS, C.selectedVariation === s.LED_ILLUMINATIONVARIATION_FIXED && C.selectedAnimationType === o.NONE && (C.brightnessSliderMin = 0)) } function g() { if (C.showAnimationSliderPanel = !0, C.selectedAnimationType === o.VARIABLE_BRIGHTNESS || C.selectedAnimationType === o.AUDIO_FLASHING) C.labelBrightnessSlider = D("l10n.maxBrightness"), C.showAnimationSliderPanel = !1; else { var e = _.findWhere(C.styleList, { animation: C.selectedAnimationType }); C.labelAnimationSpeed = e ? D(e.style) + " " + D("l10n.speed") : D("l10n.animationSpeed"), C.animationSliderMax = d.MAX_OTHER_ANIMATION_SPEED_SLIDER, C.animationSliderMin = C.selectedAnimationType === o.BREATHING ? d.MIN_BRETHING_ANIMATION_SPEED_SLIDER : d.MIN_ANIMATION_SPEED_SLIDER } C.sliderAnimation = C.animationSliderMax + C.animationSliderMin - C.selectedGpu.zone[C.selectedZoneIndex].animationSpeed } function v() { C.showLabelLedeffects = !0, C.showComboLedEffects = !0, C.ledEffects = [{ name: "l10n.ledOn", ledEffect: r.LED_ILLUMINATION_ON }, { name: "l10n.ledOff", ledEffect: r.LED_ILLUMINATION_OFF }], C.syncAll === !1 && C.selectedGpu.deviceType == i.LOGO && C.ledEffects.push({ name: "l10n.ledOngpuProperty", ledEffect: r.LED_ILLUMINATION_GPU_PROPERTY_LIMIT_REACHED }), C.sliCount > 0 && C.ledEffects.push({ name: "l10n.onSliIsEnabled", ledEffect: r.LED_ILLUMINATION_SLI_ENABLED }) } function h() { C.showComboVariation = !0, C.isEnableComboVariation = !0, C.variationList = [], C.selectedLedEffect === r.LED_ILLUMINATION_ON || C.selectedLedEffect === r.LED_ILLUMINATION_SLI_ENABLED ? C.selectedAnimationType === o.NONE ? C.variationList.push({ name: "l10n.ledFixedBrightness", variation: s.LED_ILLUMINATIONVARIATION_FIXED }) : C.syncAll === !0 ? C.variationList.push({ name: "l10n.ledStyleBased", variation: s.LED_ILLUMINATIONVARIATION_NONE }) : (C.selectedAnimationType !== o.VARIABLE_BRIGHTNESS && C.variationList.push({ name: "l10n.ledStyleBased", variation: s.LED_ILLUMINATIONVARIATION_NONE }), C.syncAll === !1 && C.selectedGpu.deviceType === i.LOGO && C.selectedAnimationType !== o.AUDIO_FLASHING && C.variationList.push({ name: "l10n.gpuTemparature", variation: s.LED_ILLUMINATIONVARIATION_GPU_TEMP }, { name: "l10n.gpuUtilization", variation: s.LED_ILLUMINATIONVARIATION_GPU_UTILIZATION }, { name: "l10n.gpuClock", variation: s.LED_ILLUMINATIONVARIATION_GPU_CLOCK }, { name: "l10n.gpuFanSpeed", variation: s.LED_ILLUMINATIONVARIATION_GPU_FANSPEED }, { name: "l10n.gpuVoltage", variation: s.LED_ILLUMINATIONVARIATION_GPU_VOLTAGE })) : C.variationList.push({ name: "l10n.gpuTemparature", variation: s.LED_ILLUMINATIONVARIATION_GPU_TEMP }, { name: "l10n.gpuUtilization", variation: s.LED_ILLUMINATIONVARIATION_GPU_UTILIZATION }, { name: "l10n.gpuClock", variation: s.LED_ILLUMINATIONVARIATION_GPU_CLOCK }, { name: "l10n.gpuFanSpeed", variation: s.LED_ILLUMINATIONVARIATION_GPU_FANSPEED }, { name: "l10n.gpuVoltage", variation: s.LED_ILLUMINATIONVARIATION_GPU_VOLTAGE }); var e = _.findWhere(C.variationList, { variation: C.selectedGpu.zone[C.selectedZoneIndex].variationType }); C.selectedVariation = _.isUndefined(e) ? C.variationList[0].variation : C.selectedGpu.zone[C.selectedZoneIndex].variationType, C.onLedVariationChange() } function y() { C.showAnimationStyle = !0, C.showComboAnimation = !0, C.styleList = [{ style: "l10n.ledBreathing", animation: o.BREATHING }, { style: "l10n.ledFlashing", animation: o.FLASHING }, { style: "l10n.ledDualFlashing", animation: o.DUAL_FLASHING }, { style: "l10n.ledRandom", animation: o.RANDOM }, { style: "l10n.multiColor", animation: o.MULTICOLOR }, { style: "l10n.colorCycle", animation: o.CYCLICCOLOR }], C.gpuCount > 1 && C.syncAll === !0 && C.styleList.push({ style: "l10n.ledAnimationElectric", animation: o.ELECTRIC }), C.sliCount > 0 && C.syncAll === !0 && (C.styleList.push({ style: "l10n.flowIn", animation: o.FLOW_IN }), C.styleList.push({ style: "l10n.flowOut", animation: o.FLOW_OUT }), C.styleList.push({ style: "l10n.reverseBreathing", animation: o.BREATHINGPUBREATHOUTSLI })), C.selectedLedEffect === r.LED_ILLUMINATION_ON && (C.styleList.push({ style: "l10n.ledNoAnimation", animation: o.NONE }), C.styleList.push({ style: "l10n.ledAudioFlashing", animation: o.AUDIO_FLASHING }), C.gpuCount > 2 && C.syncAll === !0 && C.styleList.push({ style: "l10n.wave", animation: o.WAVE }), C.gpuCount > 1 && C.syncAll === !0 && C.styleList.push({ style: "l10n.ripple", animation: o.RIPPLE }), C.syncAll === !1 && C.styleList.push({ style: "l10n.ledVariableBrighness", animation: o.VARIABLE_BRIGHTNESS })) } function E(e) { var t = _.findWhere(C.styleList, { animation: C.selectedGpu.zone[C.selectedZoneIndex].animationType }); C.selectedAnimationType = _.isUndefined(t) ? C.styleList[0].animation : e } function b(e) { var t = _.findWhere(C.ledEffects, { ledEffect: e }); C.selectedLedEffect = void 0 === t ? C.ledEffects[0].ledEffect : e } function S() { t.getLedSettings().then(function(e) { C.currentConfig = e, C.devices = e.ledConfig.devices, C.featureState = e.ledConfig.featureState, x.info("Get LED config: ", C.currentConfig), M = angular.copy(C.devices), C.gpuCount = 0, C.sliCount = 0, angular.forEach(M, function(e) { e.deviceType === i.LOGO ? C.gpuCount++ : C.sliCount++ }), C.selectedGpu = C.devices[0], C.selectedZoneIndex = 0, C.syncAll = !1, C.selectedAnimationType = C.selectedGpu.zone[C.selectedZoneIndex].animationType, C.selectedLedEffect = C.selectedGpu.zone[C.selectedZoneIndex].ledEffect, C.selectedVariation = C.selectedGpu.zone[C.selectedZoneIndex].variationType, C.selectGpu(C.devices[0]) }).catch(function(e) { x.error("getLedSettings failed: " + e) }) } function w() { var e = []; if (!angular.equals(M, C.devices)) for (var t = 0; t < C.devices.length; t++) { for (var n, r = 0; r < C.devices[t].zone.length; r++) if (!angular.equals(M[t].zone[r], C.devices[t].zone[r])) { var o = angular.copy(C.devices[t].zone[r]); o.deviceId = C.devices[t].deviceId, o.deviceType = C.devices[t].deviceType, e.push(o); var i = M[t].zone[r].ledSelection; if (n = C.devices[t].zone[r].ledSelection, i !== n && (n === c.ALL_LED || n === c.GPU_WIDE_LED)) break } if (n === c.ALL_LED) break } return e } function A(e) { var t = angular.element(f[0].querySelector(".red")); t[0].innerHTML = e.R; var n = angular.element(f[0].querySelector(".green")); n[0].innerHTML = e.G; var r = angular.element(f[0].querySelector(".blue")); if (r[0].innerHTML = e.B, C.preview) { var o = "rgb(" + e.R + ", " + e.G + ", " + e.B + ")"; C.preview.style.background = o } } function T(e) { var t = angular.element(f[0].querySelector(".red1")); t[0].innerHTML = e.R; var n = angular.element(f[0].querySelector(".green1")); n[0].innerHTML = e.G; var r = angular.element(f[0].querySelector(".blue1")); if (r[0].innerHTML = e.B, C.secondPreview) { var o = "rgb(" + e.R + ", " + e.G + ", " + e.B + ")"; C.secondPreview.style.background = o } } function I(e, t) { var n = e.getImageData(t.x, t.y, 1, 1); return n.data } var C = this, x = e.getInstance("main.preferences/PreferencesLedController"), M = void 0; C.selectedGpu = void 0, C.selectedLedEffect, C.selectedAnimationType, C.styleList, C.selectedVariation, C.variationList, C.defaultMinimumBrightness = d.MIN_BRIGHTNESS, C.defaultBrightness = d.DEFAULT_BRIGHTNESS, C.animationSliderMin = d.MIN_ANIMATION_SPEED_SLIDER, C.isSliLedSelected = !1, C.animationSliderMax = d.MAX_ANIMATION_SPEED_SLIDER, C.brightnessRangeSliderMin = d.MIN_BRIGHTNESS_RANGESLIDER, C.brightnessRangeSliderMax = d.MAX_BRIGHTNESS_RANGESLIDER; var D = l("translate"); C.currentConfig = {}, C.devices = [], C.canvas = null, C.showColorPickerControl = !0, C.selectedMultiColorAnimation = !1; var O = []; O.push({ name: "icon-gpu", zoneLocation: u.GPU_ILLUM_ZONE_LOCATION_NORTH_EDGE }), O.push({ name: "icon-home", zoneLocation: u.GPU_ILLUM_ZONE_LOCATION_OUTER_FAN_EAST }), O.push({ name: "icon-nvlogo", zoneLocation: u.GPU_ILLUM_ZONE_LOCATION_OUTER_FAN_WEST }), C.onLedEffectChange = function() { C.selectedGpu.zone[C.selectedZoneIndex].ledEffect = C.selectedLedEffect, C.selectedLedEffect === r.LED_ILLUMINATION_OFF ? (C.showComboAnimation = !1, C.showAnimationSliderPanel = !1, C.showComboVariation = !1, C.showBrightnessSliderPanel = !1) : (C.showSliderBrightness = !0, C.showSliderBrightnessRange = !1, y(), E(C.selectedGpu.zone[C.selectedZoneIndex].animationType), C.onAnimationTypeChange()) }, C.onAnimationTypeChange = function() { C.selectedGpu.zone[C.selectedZoneIndex].animationType = C.selectedAnimationType, C.showColorPickerControl = !0, C.selectedMultiColorAnimation = !1, C.isSecondPreviewControl = !1, C.selectedAnimationType === o.NONE ? (C.showAnimationSliderPanel = !1, C.showComboVariation = !0, C.showBrightnessSliderPanel = !0, C.showSliderBrightness = !0, C.showSliderBrightnessRange = !1, h()) : C.selectedAnimationType === o.AUDIO_FLASHING || C.selectedAnimationType === o.VARIABLE_BRIGHTNESS ? (C.showSliderBrightness = !0, C.showSliderBrightnessRange = !1, h(), g()) : C.selectedAnimationType === o.CYCLICCOLOR ? (C.showColorPickerControl = !1, h()) : C.selectedAnimationType === o.MULTICOLOR ? (C.selectedMultiColorAnimation = !0, h(), m(function() { C.secondPreview = f[0].querySelector(".secondPreview"), C.startRGBColor = C.selectedGpu.zone[C.selectedZoneIndex].startRGB, T(C.selectedGpu.zone[C.selectedZoneIndex].endRGB) }, 10)) : (C.selectedLedEffect !== r.LED_ILLUMINATION_GPU_PROPERTY_LIMIT_REACHED && (C.showSliderBrightness = !1, C.showSliderBrightnessRange = !0), g(), h()), C.buttonApply = !0, C.buttonCancel = !0 }, C.onLedVariationChange = function() { C.selectedGpu.zone[C.selectedZoneIndex].variationType = C.selectedVariation, x.info("onLedVariationChange", C.selectedGpu.zone), C.selectedLedEffect !== r.LED_ILLUMINATION_OFF ? p() : (C.showBrightnessSliderPanel = !1, C.showAnimationSliderPanel = !1), C.selectedLedEffect !== r.LED_ILLUMINATION_ON && C.selectedLedEffect !== r.LED_ILLUMINATION_SLI_ENABLED || (C.selectedVariation === s.LED_ILLUMINATIONVARIATION_GPU_CLOCK || C.selectedVariation === s.LED_ILLUMINATIONVARIATION_GPU_FANSPEED || C.selectedVariation === s.LED_ILLUMINATIONVARIATION_GPU_TEMP || C.selectedVariation === s.LED_ILLUMINATIONVARIATION_GPU_UTILIZATION || C.selectedVariation === s.LED_ILLUMINATIONVARIATION_GPU_VOLTAGE || C.selectedVariation === s.LED_ILLUMINATIONVARIATION_SYSTEM_VOLUME || C.selectedVariation === s.LED_ILLUMINATIONVARIATION_FIXED ? C.showAnimationSliderPanel = !1 : C.showAnimationSliderPanel = !0), C.buttonApply = !0, C.buttonCancel = !0 }, C.selectedZone = function(e) { C.selectedZoneIndex = e, C.selectedAnimationType = C.selectedGpu.zone[C.selectedZoneIndex].animationType, C.selectedVariation = C.selectedGpu.zone[C.selectedZoneIndex].variationType, v(), b(C.selectedGpu.zone[C.selectedZoneIndex].ledEffect), C.onLedEffectChange(), A(C.selectedGpu.zone[C.selectedZoneIndex].startRGB) }, C.selectGpu = function(e) { C.syncAll = e.zone[0].ledSelection === c.ALL_LED, C.syncZones = e.zone[0].ledSelection === c.ALL_LED || C.selectedGpu.zone[0].ledSelection === c.GPU_WIDE_LED, C.selectedGpu = e, C.selectedZone(0) }, C.onSyncAllChanged = function() { C.syncZones = !0, C.selectedGpu = C.devices[0], C.syncAll === !0 ? (C.selectedGpu.zone[0].ledSelection = c.ALL_LED, x.info("All led option is selected")) : (x.info("all Led option is un-selected."), C.selectedGpu.zone.length > 1 ? (C.selectedGpu.zone[0].ledSelection = c.GPU_WIDE_LED, x.info("set syncZone to true")) : (C.selectedGpu.zone[0].ledSelection = c.INDIVIDUAL_LED, C.syncZones = !1, x.info("set syncZone to false"))), C.selectedZone(0) }, C.onSyncZonesChanged = function() { C.syncZones === !0 ? (C.selectedGpu.zone[0].ledSelection = c.GPU_WIDE_LED, x.info("sync zone is is selected")) : (x.info("sync zone is un-seleced, set indivisual LED option"), C.selectedGpu.zone[0].ledSelection = c.INDIVIDUAL_LED), C.selectedZone(0) }, C.onBrightnessRangeSliderChange = function() {}, C.onBrightnessSliderChange = function() { C.selectedGpu.zone[C.selectedZoneIndex].variationParameter = C.sliderBrightness }, C.onAnimationSliderChange = function() { C.selectedGpu.zone[C.selectedZoneIndex].animationSpeed = C.animationSliderMax - C.sliderAnimation }, C.isSliDevice = function(e) { return e.deviceType === i.SLI }, C.getZoneIcon = function(e) { var t = _.findWhere(O, { zoneLocation: e }); return t.name }, C.isIndivisualLedSelected = function() { var e = C.selectedGpu.zone[0].ledSelection === c.INDIVIDUAL_LED; return e }, C.showZones = function() { return C.selectedGpu && C.selectedGpu.zone.length > 1 }, C.showAllLedOption = function() { return C.gpuCount > 1 }, C.applySettings = function() { var e = {}; if (C.featureState === !1) e = { requestType: 2, featureState: !1 }; else { var t = w(); e = 0 === t.length && C.featureState === !0 ? { requestType: 2, featureState: !0 } : { requestType: 2, ledSettings: t } } n.onJsonMessage(e, "cefExtensionNvLedApi").then(function(e) { var t = JSON.parse(e); x.info("Apply LED Settings response: ", t) }) }, C.cancelSettings = function() { C.devices = angular.copy(M), C.selectedZoneIndex = 0, C.syncAll = !1, C.selectGpu(C.devices[0]) }, C.colorPreviewClicked = function(e) { 1 === e ? C.isSecondPreviewControl = !1 : 2 === e && (C.isSecondPreviewControl = !0) }, C.showColorPicker = function() { if (C.canvas = f[0].getElementById("picker"), C.preview = f[0].querySelector(".preview"), C.secondPreview = f[0].querySelector(".secondPreview"), C.canvas) { var e = function(e, t) { var n = e.getBoundingClientRect(); return { x: t.clientX - n.left, y: t.clientY - n.top } }, t = C.canvas.getContext("2d"); C.mouseDown = !1, C.canvas.onmousedown = function() { var e = C.canvas.getContext("2d"), t = new Image, n = a.default; t.src = n, e.clearRect(0, 0, t.width, t.height), e.drawImage(t, 0, 0, t.width, t.height), C.mouseDown = !0 }, C.canvas.onmouseup = function(t) { var n = C.canvas.getContext("2d"), r = new Image, o = a.default; r.src = o, n.clearRect(0, 0, r.width, r.height), n.drawImage(r, 0, 0, r.width, r.height); var i = e(C.canvas, t), s = I(n, i), l = { R: s[0], G: s[1], B: s[2] }; C.isSecondPreviewControl ? (C.selectedGpu.zone[C.selectedZoneIndex].startRGB = C.startRGBColor, C.selectedGpu.zone[C.selectedZoneIndex].endRGB = l) : (C.selectedGpu.zone[C.selectedZoneIndex].startRGB = l, C.selectedGpu.zone[C.selectedZoneIndex].endRGB = l, C.startRGBColor = l), n.beginPath(), n.moveTo(i.x, i.y - 12), n.lineTo(i.x, i.y + 12), n.moveTo(i.x - 12, i.y), n.lineTo(i.x + 12, i.y), n.strokeStyle = "#DB14C1", n.stroke(), n.closePath(), C.mouseDown = !1 }, C.canvas.onmousemove = function(t) { if (C.mouseDown !== !1) { var n = C.canvas.getContext("2d"), r = e(C.canvas, t), o = I(n, r), i = { R: o[0], G: o[1], B: o[2] }; C.isSecondPreviewControl ? T(i) : A(i) } }; var n = new Image, r = a.default; n.src = r, n.onload = function() { t.drawImage(n, 0, 0, n.width, n.height) } } }, C.applyAllGpu = function() { C.syncAll = !0, C.onSyncAllChanged() }, C.applyEachGpu = function() { C.syncAll = !1, C.onSyncAllChanged() }, C.isSelectedGpu = function(e) { return angular.equals(e, C.selectedGpu) }, C.onfeatureStateChange = function() {}, f.ready(function() { C.showColorPicker() }), S() }]); t.preferencesLedController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesLed = void 0; var o = n(4), i = n(867), a = r(i); n(583); var s = o.ngPreferencesModule.directive("nvPreferencesLed", [function() { return { restrict: "E", template: a.default, controller: "PreferencesLedController", controllerAs: "preferencesLed" } }]); t.nvPreferencesLed = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesShieldController = void 0; var r = n(4); n(29), n(20); var o = r.ngPreferencesModule.controller("PreferencesShieldDevicesController", ["preferencesService", "$log", "toastService", "$filter", function(e, t, n, r) { var o = this, i = t.getInstance("main.preferences/PreferencesShieldDevicesController"); o.removeAllDevices = function() { e.unpairAllShieldDevices().then(function(e) { i.info("Unpaired all shield devices"), n.showError({ textContent: r("translate")("l10n.shieldDevicesRemoved") }) }).catch(function(e) { i.error("unpairAllShieldDevices failed: ", e), n.showError({ textContent: r("translate")("l10n.shieldDevicesRemoveFailed") }) }) } }]); t.preferencesShieldController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesShieldDevices = void 0; var o = n(4), i = n(868), a = r(i); n(585); var s = o.ngPreferencesModule.component("nvPreferencesShieldDevices", { template: a.default, controller: "PreferencesShieldDevicesController", controllerAs: "preferencesShieldDevices" }); t.nvPreferencesShieldDevices = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesShieldController = void 0; var r = n(4); n(29); var o = r.ngPreferencesModule.controller("preferencesShieldController", ["preferencesService", "$scope", "eventAggregator", "PREFERENCES_EVENTS", "COMMON_DYNAMIC_REDIRECT", "$window", "$log", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", function(e, t, n, r, o, i, a, s, l) { function c() { e.gameStreamAddonLoaded && e.isGameStreamFeatureSupported ? u.showContent = !0 : u.showContent = !1 } var u = this, d = a.getInstance("main.preferences/preferencesShieldController"); u.onTroubleshootLinkClick = function() { var e = o.BASE_URL + "enu&page=" + o.SHIELD_TROUBLESHOOTING; d.info("SHIELD troubleshooting redirects to url:: ", e), s.push(l.SHIELD_TROUBLESHOOTING_HELP), i.open(e) }, c(), n.on(r.FEATURE_UPDATED_GS, c), t.$on("$destroy", function() { n.off(r.FEATURE_UPDATED_GS, c) }) }]); t.preferencesShieldController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesShield = void 0; var o = n(4); n(591), n(586); var i = n(869), a = r(i); n(587); var s = o.ngPreferencesModule.component("nvPreferencesShield", { template: a.default, controller: "preferencesShieldController", controllerAs: "preferencesShield" }); t.nvPreferencesShield = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.appCollectorEditDialogController = void 0; var r = n(4), o = r.ngPreferencesModule.controller("AppcollectorEditDialogController", ["cefService", "$mdDialog", "$log", "$timeout", "$document", function(e, t, n, r, o) { function i() { var e = angular.element(o[0].querySelector(".app-target"))[0]; s.showTargetTooltip = e.scrollWidth > e.offsetWidth } function a() { var e = angular.element(o[0].querySelector(".app-startin"))[0]; s.showDirectoryTooltip = e.scrollWidth > e.offsetWidth } var s = this, l = n.getInstance("main.preferences/AppcollectorEditDialogController"); s.maxSize = 256, s.target = null, s.startIn = null, s.showTargetTooltip = !1, s.showDirectoryTooltip = !1, s.selectedApp.AppData.OriginalFilename = s.selectedApp.AppData.Name; var c = _.extend({}, s.selectedApp.AppData); s.openTargetFileDialog = function() { var t = { "Programs and shortcuts": "*.exe; *.lnk; *.bat; *.url" }; return e.localDirectoryExplorer(!0, t, !0).then(function(e) { s.selectedApp.AppData.TargetPath = e, r(i, 10) }).catch(function(e) { l.error("AppCollector:OpenTargetFileDialog failed or cancelled") }) }, s.openStartInFileDialog = function() { return e.localDirectoryExplorer(!1, {}, !0).then(function(e) { s.selectedApp.AppData.WorkingDirectory = e, r(a, 10) }).catch(function(e) { l.error("AppCollector:OpenTargetFileDialog failed or cancelled") }) }, s.openBoxArtFileDialog = function() { var t = { "All Pictures": "*.png; *.bmp; *.jpg; *.jpeg" }; return e.localDirectoryExplorer(!0, t, !0).then(function(e) { s.selectedApp.AppData.BoxArtPath = e }).catch(function(e) { l.error("AppCollector:OpenTargetFileDialog failed or cancelled") }) }, s.cancel = function() { t.cancel() }, s.done = function() { s.selectedApp.AppData.ModifiedFilename = s.selectedApp.AppData.Name; var e = s.selectedApp.AppData.BoxArtPath.indexOf("?"); e > 0 && (s.selectedApp.AppData.BoxArtPath = s.selectedApp.AppData.BoxArtPath.substring(0, e)), s.updateApplication(s.selectedApp.AppData), t.hide() }, s.remove = function() { s.removeApp(), t.hide() }, s.canSubmit = function() { return void 0 !== s.selectedApp.AppData.Name && null !== s.selectedApp.AppData.Name && "" !== s.selectedApp.AppData.Name && !_.isEqual(s.selectedApp.AppData, c) }, r(function() { i(), a() }) }]); t.appCollectorEditDialogController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesShieldGamestreamController = void 0; var o = n(4); n(29), n(168), n(34), n(17); var i = n(870), a = r(i); n(589), n(19), n(20); var s = o.ngPreferencesModule.controller("PreferencesShieldGamestreamController", ["preferencesService", "$log", "$window", "cefService", "toastService", "$filter", "$mdDialog", "$document", "$timeout", "localeService", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_SCREENS", "COMMON_DYNAMIC_REDIRECT", "dialogService", "COMMON_HTTP_ERROR_CODES", "$scope", function(e, t, n, r, o, i, s, l, c, u, d, f, m, p, g, v, h) { function y() { C.gameStreamLoaded = e.gameStreamAddonLoaded, C.gameStreamLoaded || (C.isStreamingEnabled = !1) } function E() { y(), d.setScreen(m.SCREEN_PREFERENCES_SHIELD) } function b() { o.showError({ textContent: i("translate")("l10n.tryRestartSystem") }) } function S() { D = c(function() { var e = angular.element(l[0].querySelector(".appcollector-content-height"))[0], t = angular.element(e.querySelector(".shield-tile-content-outline"))[0], n = t.offsetTop + t.offsetHeight - e.offsetHeight; e.scrollTop = n, D = null }) } function w(e) { if (e.data && e.data.NodeError) switch (e.data.NodeError) { case 7: case 2: o.showError({ textContent: i("translate")("l10n.unsupportedFileType") }); break; case 11: o.showError({ textContent: i("translate")("l10n.fileNotFound") }); break; case 8: var t = _.find(C.streamApps, function(t) { return t.AppData.TargetPath === e.config.data.Path }); x.error("duplicate app being added ", t), C.selectedAppChanged(t), S(); break; default: x.error("gameStream Add or Edit failed"), b() } else x.error("gameStream Add or Edit failed with unexpected format"), b() } function A(e) { return e = e + "?" + (new Date).getTime() } function T() { g.show("nv-dialog-text", { title: "l10n.gameStreamNotReady", style: "feature-error-dialog", text: "l10n.featureErrorMessage", button1: { text: "l10n.gotItText", action: g.cancel } }) } function I() { D && (x.info("pending scroll to timeout cancelled"), c.cancel(D)) } var C = this, x = t.getInstance("main.preferences/PreferencesShieldGamestreamController"), M = null, D = null; C.isStreamingEnabled = !1, C.isServerStatusCheckDone = !1, C.streamApps = [], C.gameStreamLoaded = !1, C.requestInProgress = !0, C.selectedAppChanged = function(e) { M = e }, e.getStreamApp().then(function(e) { x.info("Streaming Apps Found", e.data.AppsData), C.streamApps = e.data.AppsData, C.streamApps.forEach(function(e) { e.AppData.BoxArtPath = A(e.AppData.BoxArtPath) }), C.streamApps && C.streamApps.length > 0 && C.selectedAppChanged(C.streamApps[0]) }).catch(function(e) { x.error("getStreamApp failed with error: ", e), b() }).finally(function() { C.requestInProgress = !1 }), e.getGameStreamServerStatus().then(function(e) { C.isStreamingEnabled = e.data.streamingEnabled, C.isServerStatusCheckDone = !0, x.info("getGameStreamServerStatus: streamingEnabled-", e.data.streamingEnabled, ", streamingSupported-", e.data.streamingSupported) }).catch(function(e) { C.isServerStatusCheckDone = !0, x.error("getGameStreamServerStatus failed with error:"), b() }), C.onChangeServerState = function() { C.toggleState = !0, e.updateGameStreamServerStatus(C.isStreamingEnabled).then(function(e) { d.changeSetting(f.APPLICATION_SETTING_ENABLE_GAMESTREAM, C.isStreamingEnabled.toString()), x.info("updateGameStreamServerStatus status: ", e), C.toggleState = !1 }).catch(function(e) { x.error("updateGameStreamServerStatus failed with error:"), C.toggleState = !1, d.changeSettingFail(f.APPLICATION_SETTING_ENABLE_GAMESTREAM_FAILED, C.isStreamingEnabled.toString(), e.status), C.isStreamingEnabled && !C.gameStreamLoaded && e.status === v.NOT_FOUND ? T() : b(), C.isStreamingEnabled = !1 }) }, C.onLaunchUrl = function() { var e = p.BASE_URL + u.getCurrentLocaleWithUnderscore() + "&page=" + p.GAME_STREAM_REQUIREMENTS; x.info("Gamestream redirects to url:: ", e), n.open(e) }, C.add = function() { var t = { "Programs and shortcuts": "*.exe; *.lnk; *.bat; *.url" }; return x.info("User adding new game stream App"), r.localDirectoryExplorer(!0, t, !0).then(function(t) { C.requestInProgress = !0, x.info("Adding new game stream App: ", t), e.appCollectorAdd(t).then(function(e) { C.streamApps.push(e.data), x.info("new stream app added: ", e), C.selectedAppChanged(e.data), S() }).catch(function(e) { w(e) }).finally(function() { C.requestInProgress = !1 }) }).catch(function(e) { e.isCancelled || (x.error("addAppCollector app localDirectoryExplorer: failed"), b()) }) }, C.remove = function() { C.requestInProgress = !0, x.info("deleting stream app: ", M), e.appCollectorRemove(M.AppData.Name).then(function(e) { C.streamApps.splice(C.streamApps.indexOf(M), 1), M = null, C.streamApps.length > 0 && C.selectedAppChanged(C.streamApps[0]), x.info("Deleted stream app") }).catch(function(e) { x.error("gameStream Remove failed:"), b() }).finally(function() { C.requestInProgress = !1 }) }, C.canNotRemove = function() { return void 0 === M || null === M || C.requestInProgress === !0 }, C.updateApp = function(t) { x.info("AppCollector:Edit:: ", t), C.requestInProgress = !0, e.appCollectorEdit(t).then(function(e) { e.data.AppData.BoxArtPath = A(e.data.AppData.BoxArtPath), C.streamApps[C.streamApps.indexOf(M)] = e.data, M = e.data, x.info("Stream app updated") }).catch(function(e) { w(e) }).finally(function() { C.requestInProgress = !1 }) }, C.edit = function() { var e = s.show({ template: a.default, locals: { selectedApp: angular.copy(M), removeApp: C.remove, updateApplication: C.updateApp }, clickOutsideToClose: !0, controller: "AppcollectorEditDialogController", controllerAs: "vm", bindToController: !0 }); e.then(function() {}).catch(function() { x.error("AppCollector:Edit - can not open dialog winodw") }) }, C.hasAppsAndServerStatusDone = function() { return C.isServerStatusCheckDone && C.streamApps.length > 0 }, C.isSelected = function(e) { return void 0 !== M && null !== M && M.AppData.Name === e.AppData.Name }, E(), h.$on("$destroy", I) }]); t.preferencesShieldGamestreamController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesShieldGamestream = void 0; var o = n(4); n(593); var i = n(871), a = r(i); n(590); var s = o.ngPreferencesModule.component("nvPreferencesShieldGamestream", { template: a.default, controller: "PreferencesShieldGamestreamController", controllerAs: "preferencesShieldGamestream" }); t.nvPreferencesShieldGamestream = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesShieldTileController = void 0; var r = n(4), o = r.ngPreferencesModule.controller("PreferencesShieldTileController", [function() { var e = this, t = !1; e.showOverlay = function(e) { t = e }, e.isOverlayVisible = function() { return t } }]); t.preferencesShieldTileController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesShieldTile = void 0; var o = n(4); n(17), n(34); var i = n(872), a = r(i); n(592); var s = o.ngPreferencesModule.component("nvPreferencesShieldTile", { bindings: { nvApp: "=" }, template: a.default, controller: "PreferencesShieldTileController", controllerAs: "vm" }); t.nvPreferencesShieldTile = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.preferencesSystemInfoController = void 0; var o = n(3), i = r(o), a = n(4); n(22); var s = a.ngPreferencesModule.controller("PreferencesSystemInfoController", ["$log", "hardwareService", "$translate", "$q", "eventAggregator", "COMMON_EVENTS", "$scope", function(e, t, n, r, o, a, s) { function l(e, t) { return Number(Math.round(e + "e" + t) + "e-" + t) } function c(e) { var t, n; try { return i.isString(e) ? (n = e / T / T / T, t = l(n, 2), isNaN(t) ? A : t + " GB RAM") : A } catch (e) { return x.error("failed to format memory", e), A } } function u(e) { var t, n, r; try { return i.isString(e) ? (t = e.split("@"), 2 === t.length && (n = t[0].split("x"), 2 === n.length) ? r = n[0] + " x " + n[1] + ", " + t[1] + "Hz" : A) : A } catch (e) { return x.error("failed to format resolution", e), A } } function d() { var e, t; return w = {}, _ ? (w.cpuName = i.isString(_.CPUName) ? _.CPUName : A, w.driverVersion = i.isString(_.DriverVersion) ? E + _.DriverVersion : A, w.totalPhysicalMemory = c(_.TotalPhysicalMemory), w.currentResolution = u(_.CurrentResolution), e = i.isArray(_.GPU) ? _.GPU.length : 0, 0 === e ? w.gpuName = A : 1 === e ? w.gpuName = _.GPU[0].LongGPUName : (t = i.rest(_.GPU), w.gpuName = _.GPU[0].LongGPUName, w.gpuSubItems = i.pluck(t, "LongGPUName")), void x.info("createItems - systemInfo", w)) : (x.info("createItems - hardware info not available"), r.reject()) } function f() { return E ? r.when(E) : b ? b : b = n(["l10n.driverVersion"]).then(function(e) { E = e["l10n.driverVersion"] + " " }) } function m(e, t) { S.systemInfoItems[t] = e } function p() { S.systemInfoItems = [], m({ icon: "icon-gpu", description: w.gpuName, subItems: w.gpuSubItems }, I.GPU), m({ icon: "icon-nvlogo", description: w.driverVersion }, I.DRIVER_VERSION), m({ icon: "icon-memory", description: w.cpuName }, I.CPU), m({ icon: "icon-ram", description: w.totalPhysicalMemory }, I.RAM), m({ icon: "icon-monitor", description: w.currentResolution }, I.RESOLUTION) } function g(e) { return _ = e, f().then(d).then(p).then(function() { S.loadingState = C.DONE }) } function v(e) { x.info("sysinfo updated"), S.loadingState = C.LOADING, _ = null, g(e).catch(function(e) { S.loadingState = C.FAILED, x.error("failed to update system info", e) }) } function h() { x.info("Controller initialized"), o.on(a.SYSTEMINFO_UPDATED, v), o.on(a.LOCALE_CHANGED, y), s.$on("$destroy", function() { o.off(a.SYSTEMINFO_UPDATED, v), o.off(a.LOCALE_CHANGED, y) }), t.getSystemInfo().then(g).catch(function(e) { S.loadingState = C.FAILED, x.error("failed to init system info", e) }) } function y() { _ ? (x.info("System info updated on locale change"), E = null, b = null, g(_)) : x.info("No hardware information to update system information.") } var E, b, S = this, _ = null, w = {}, A = "-", T = 1024, I = { GPU: 0, DRIVER_VERSION: 1, CPU: 2, RAM: 3, RESOLUTION: 4 }, C = { LOADING: "LOADING", FAILED: "FAILED", DONE: "DONE" }, x = e.getInstance("main.games/PreferencesSystemInfoController"); S.systemInfoItems = [], S.ITEM_POSITION = I, S.LOADING_STATE = C, S.loadingState = C.LOADING, h() }]); t.preferencesSystemInfoController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvPreferencesSystemInfo = void 0; var o = n(4), i = n(873), a = r(i); n(594); var s = o.ngPreferencesModule.component("nvPreferencesSystemInfo", { template: a.default, controller: "PreferencesSystemInfoController", controllerAs: "preferencesSystemInfo" }); t.nvPreferencesSystemInfo = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.couponInputController = void 0; var r = n(53), o = r.ngRewardsModule.controller("CouponInputController", ["$log", "REWARDS_CONSTANTS", "eventAggregator", "$scope", "REWARDS_EVENTS", function(e, t, n, r, o) { function i() { l.couponCode = "", l.validateCoupon() } function a() { l.codeInvalid = !0, l.actionButtonDisabled = !0 } function s() { n.on(o.COUPON_INPUT.CLEAR_CODE, i), n.on(o.COUPON_INPUT.INVALIDATE_CODE, a), l.validateCoupon() } var l = this, c = (e.getInstance("main.rewards/CouponInputController"), ""); l.couponCode = c, l.validateCoupon = function() { if (l.codeInvalid = !1, l.couponCode) { l.couponCode = l.couponCode.replace(/\s+/g, ""); var e = new RegExp(/^[a-zA-Z0-9]*$/); if (l.codeInvalid = !e.test(l.couponCode), l.couponCode.length > t.REWARDS_COUPONS.CODE_LENGTH_NO_DASHES - 1 ? (l.couponCode = l.couponCode.slice(0, t.REWARDS_COUPONS.CODE_LENGTH_NO_DASHES), l.codeInvalid = !e.test(l.couponCode), l.actionButtonDisabled = l.codeInvalid) : l.actionButtonDisabled = !0, l.couponCode.length > c.length) { if (l.couponCode.replace(/-/g, "").length - c.replace(/-/g, "").length > 1 || 0 === l.couponCode.indexOf(c)) n.trigger(o.COUPON_INPUT.RESTORE_CARET); else for (var r = 0; r < l.couponCode.length; r++) if (l.couponCode.charAt(r) !== c.charAt(r)) { n.trigger(o.COUPON_INPUT.RESTORE_CARET, ++r); break } } else if (l.couponCode.length === c.length && l.couponCode !== c) { for (var i = 0; i < l.couponCode.length; i++) if (l.couponCode.charAt(i) !== c.charAt(i)) { n.trigger(o.COUPON_INPUT.RESTORE_CARET, ++i); break } } else if (l.couponCode === c || c.length - l.couponCode.length > 1) n.trigger(o.COUPON_INPUT.RESTORE_CARET, -1); else for (var a = 0; a < l.couponCode.length; a++) if (l.couponCode.charAt(a) !== c.charAt(a)) { n.trigger(o.COUPON_INPUT.RESTORE_CARET, a); break } c = l.couponCode } else l.actionButtonDisabled = !0, c = "" }, l.redeemCoupon = function() { l.nvButton.action(l.couponCode) }, s(), r.$on("$destroy", function() { n.off(o.COUPON_INPUT.CLEAR_CODE, i), n.off(o.COUPON_INPUT.INVALIDATE_CODE, a) }) }]); t.couponInputController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvCouponInput = void 0; var o = n(53), i = n(313), a = r(i); n(596); var s = o.ngRewardsModule.directive("nvCouponInput", ["eventAggregator", "REWARDS_EVENTS", "$log", "$timeout", "COMMON_KEYBOARD_KEYCODES", function(e, t, n, r, o) { return { restrict: "E", scope: { nvInputPlaceholder: "=", nvButton: "=", nvErrorMessage: "@" }, bindToController: !0, template: a.default, controller: "CouponInputController", controllerAs: "couponInput", link: function(i, a, s) { function l() { p[0].focus() } function c() { p[0].blur() } function u(e) { g = e } function d(e) { if (g.ctrlKey && g.which === o.V || _.isNull(e) || isNaN(e)) r(function() { p[0].value = p[0].value }); else if (e === -1) { var t = p[0].selectionStart; r(g.which === o.SPACE ? function() { p[0].setSelectionRange(t--, t--) } : function() { p[0].setSelectionRange(t, t) }) } else r(function() { p[0].setSelectionRange(e, e) }) } function f() { e.off(t.COUPON_INPUT.FOCUS, l), e.off(t.COUPON_INPUT.BLUR, c), e.off(t.COUPON_INPUT.RESTORE_CARET, d), p && p.off("keydown", u), a.empty(), a.remove(), a = null, p = null } function m() { e.on(t.COUPON_INPUT.FOCUS, l), e.on(t.COUPON_INPUT.BLUR, c), e.on(t.COUPON_INPUT.RESTORE_CARET, d), p.on("keydown", u), i.$on("$destroy", f), a.on("$destroy", function() { i.$destroy() }) } var p = (n.getInstance("main.rewards/CouponInputDirective"), angular.element(a.find("input"))), g = { which: o.DEFAULT }; m() } } }]); t.nvCouponInput = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.rewardCardController = void 0; var o = n(53), i = n(239); r(i); n(228), n(17), n(41), n(166); var a = o.ngRewardsModule.controller("RewardCardController", ["$filter", "$log", "REWARDS_CONSTANTS", "eventAggregator", "REWARDS_EVENTS", "TELEMETRY_CRIMSON_EVENT_NAMES", "telemetryService", "TELEMETRY_AFFINITY_ACTION", "TELEMETRY_AFFINITY_ELEMENT", "REWARDS_ASSET_DIMENSIONS", "rewardsService", function(e, t, n, r, o, i, a, s, l, c, u) { function d() { var t = f.nvReward.campaign.rules.end_date, n = f.nvReward.redemptionDate; t = e("date")(t, "dd MMM yyyy"), n = e("date")(n, "dd MMM yyyy"), f.cardTitle = "", f.isRewardRedeemed() ? (f.rewardImageUrl = u.getFormattedImageUrl(f.nvReward.product[0].imageLink, c.CARD), f.cardTitle = f.nvReward.product[0].title, f.showOverlay = !0, f.rewardStatusIcon = p.REDEEMED, f.rewardStatusMessage = e("translate")("l10n.redeemed"), n ? f.rewardDate = e("translate")("l10n.redeemedOn", { date: n }) : (v.error("Unexpected scenario: Got a redeemed reward with no transaction date"), f.rewardDate = null)) : (f.rewardImageUrl = u.getFormattedImageUrl(f.nvReward.campaign.imageLink, c.CARD), f.cardTitle = f.nvReward.campaign.title, f.isRewardExpired() ? (f.showOverlay = !0, f.rewardStatusIcon = p.EXPIRED, f.rewardStatusMessage = e("translate")("l10n.expired"), t ? f.rewardDate = e("translate")("l10n.expiredOn", { date: t }) : (v.error("Unexpected scenario: Got an expired reward with no expiration date"), f.rewardDate = null)) : f.isRewardLocked() ? (f.perkLevel = f.nvReward.campaign.rules.perkLevel, f.showOverlay = !0, f.rewardDate = null) : (f.showOverlay = !1, t ? f.rewardDate = e("translate")("l10n.availableTill", { date: t }) : (v.info("Reward with this uuid is set to never expire: ", m), f.rewardDate = null))) } var f = this, m = f.nvReward.campaign.uuid, p = { REDEEMED: "done", EXPIRED: "error_outline" }, g = !1, v = t.getInstance("main.rewards/RewardCardController"); f.isPushedReward = function() { return f.isRewardAvailable() && f.nvReward.state !== n.REDEMPTION_STATES.CLAIMABLE || !1 }, f.isRewardAvailable = function() { return f.nvReward.status === n.REDEMPTION_STATES.AVAILABLE }, f.isRewardRedeemedOrExpired = function() { return f.isRewardRedeemed() || f.isRewardExpired() }, f.isRewardRedeemed = function() { return f.nvReward.redemptionStatus === n.REDEMPTION_STATES.REDEEMED }, f.isRewardExpired = function() { return f.nvReward.redemptionStatus === n.REDEMPTION_STATES.EXPIRED }, f.isRewardLocked = function() { return f.nvReward.redemptionStatus === n.REDEMPTION_STATES.LOCKED }, f.onMouseEnter = function() { g = !0, f.isRewardAvailable() && (f.showOverlay = !0) }, f.onMouseLeave = function() { g = !1, f.isRewardAvailable() && (f.showOverlay = !1) }, f.isDetailsButtonVisible = function() { return f.isRewardRedeemed() && g }, f.redeemReward = function(e) { f.isRewardExpired() || (f.nvReward.redemptionStatus === n.REDEMPTION_STATES.UNREDEEMED ? a.push(i.REWARDS_REDEEM_AVAILABLE_REWARD, { campaignName: a.getString(m) }) : f.nvReward.redemptionStatus === n.REDEMPTION_STATES.LOCKED ? a.push(i.USER_AFFINITY_READ_MORE, { action: s.READ_INFO, useCase: l.PERK, description: a.getString(m) }) : f.nvReward.redemptionStatus === n.REDEMPTION_STATES.CLAIMABLE ? a.push(i.REWARDS_CLAIM_AVAILABLE_REWARD, { campaignName: a.getString(m) }) : f.nvReward.redemptionStatus === n.REDEMPTION_STATES.REDEEMED && a.push(i.REWARDS_VIEW_REDEEMED_REWARD, { campaignName: a.getString(m) }), r.trigger(o.REWARD_REDEEM_CLICKED, f.nvReward)) }, d() }]); t.rewardCardController = a }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvRewardCard = void 0; var o = n(53), i = n(874), a = r(i); n(598), n(41); var s = o.ngRewardsModule.component("nvRewardCard", { bindings: { nvReward: "=" }, template: a.default, controller: "RewardCardController", controllerAs: "rewardCard" }); t.nvRewardCard = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.rewardsCenterController = void 0; var o = n(53); n(120); var i = n(239), a = r(i); n(228); var s = n(313); r(s); n(597), n(17), n(20), n(26), n(293), n(12), n(37), n(55); var l = o.ngRewardsModule.controller("RewardsCenterController", ["rewardsService", "$filter", "$log", "REWARDS_CONSTANTS", "$mdDialog", "eventAggregator", "REWARDS_EVENTS", "COMMON_EVENTS", "toastService", "gfeService", "$scope", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "windowSpawnService", "$window", "jarvisService", "dbCacheService", "DB_NAMES", "$state", "$q", "COMMON_DEFAULT_STATES", "$interval", "$timeout", "NOTIFICATION_EVENTS", "cevoToggleService", "gfeGeolocationService", "COMMON_COUNTRY_CODES", "USER_PROFILE_EVENTS", "GFECLIENT_CONFIG", "REWARDS_ENTITLEMENT_TYPES", "PORTAL_EVENT_CATEGORIES", "PORTAL_EVENT_TYPES", function(e, t, n, r, o, i, s, l, c, u, d, f, m, p, g, v, h, y, E, b, S, w, A, T, I, C, x, M, D, O, R, N) { function L() { me.filteredUnRedeemedList = [], me.filteredRedeemedOrExpiredList = [], me.unRedeemedList = [], me.redeemedOrExpiredList = [], me.lockedPerksList = [] } function P(e) { e && c.cancel(), me.requestInProgress = e } function k(e, t, n, r, o) { u.onlineState && u.onlineState.online === !1 ? c.showOffline() : e(t, n, r, o) } function G() { ie(De) } function F() { return _.find(me.unRedeemedList, function(e) { return e.entitlementId === we }) } function U() { var e = F(); if (e) { var n = t("translate")("l10n.tryAgain"), r = "l10n.redemptionIncomplete"; se(e) && (n = t("translate")("l10n.redeem"), r = "l10n.moreItemsAvailable"), B(r, n, G) } } function V() { f.push(m.REWARDS_REDEMPTION_PORTAL_CLOSE, { couponCode: me.couponCode || "" }), me.couponCode = "", i.trigger(s.COUPON_INPUT.CLEAR_CODE), Ie ? Ie = !1 : Te ? (Te = !1, j().then(function(e) { k(U) })) : Ae ? Ae = !1 : k(U), i.off(l.CHILD_WINDOW_CLOSED, V) } function z() { Ce || xe || !e.getRewardsTabSelected() || (xe = c.showProgress({ textContent: t("translate")("l10n.updatingContent") }).finally(function() { xe = null })) } function B(n, r, o) { e.getRewardsTabSelected() && c.showError({ textContent: t("translate")(n || "l10n.unableToReachNvidia"), button: { text: r || t("translate")("l10n.learnMore"), action: o || e.openLearnMoreWindow } }) } function $(e) { return e.status + (e.state || "") + (e.entitlementId || "") + (e.redemptionId || "") + e.campaign.uuid } function W() { he && (he.unRedeemedList = me.unRedeemedList, he.redeemedOrExpiredList = me.redeemedOrExpiredList, he.lockedPerksList = me.lockedPerksList, he.persist_()) } function H() { var n = b.defer(), o = !1; return Ce = !1, Oe.info("getting Rewards"), e.getRedemptionHistory().then(function(e) { o = !0, L(), _.size(e.available) > 0 && (me.unRedeemedList = e.available, me.unRedeemedList.map(function(e) { return e.redemptionStatus = e.state || r.REDEMPTION_STATES.UNREDEEMED, e.uID = $(e), e }), me.unRedeemedList = t("orderBy")(me.unRedeemedList, "campaign.rules.end_date", !0), me.unRedeemedList = t("orderBy")(me.unRedeemedList, "entitlementDate", !0), o = !1), _.size(e.locked) > 0 && (me.lockedPerksList = e.locked, me.lockedPerksList.map(function(e) { return e.redemptionStatus = r.REDEMPTION_STATES.LOCKED, e.uID = $(e), e }), me.lockedPerksList = t("orderBy")(me.lockedPerksList, "campaign.rules.perkLevel", !1), o = !1), (_.size(e.redeemed) > 0 || _.size(e.expired) > 0) && (e.redeemed.map(function(e) { return e.redemptionStatus = r.REDEMPTION_STATES.REDEEMED, e.uID = $(e), e }), e.redeemed = t("orderBy")(e.redeemed, "redemptionDate", !0), e.expired.map(function(e) { return e.redemptionStatus = r.REDEMPTION_STATES.EXPIRED, e.uID = $(e), e }), e.expired = t("orderBy")(e.expired, "campaign.rules.end_date", !0), me.redeemedOrExpiredList = e.redeemed.concat(e.expired), o = !1), W(), me.couponBannerExpanded = o, n.resolve(e), c.cancel() }).catch(function(e) { Oe.error("Failed to get user rewards"), n.reject(e) }).finally(function() { Ce = !0, oe() }), A(z), n.promise } function j() { return ve ? (Oe.error("Building rewards already in progress"), ve) : ve = H().catch(function() { Oe.error("Build rewards failed"), B("l10n.couldNotRetrieveRedemptionHistory") }).finally(function() { ve = null }) } function Y(e, t) { var n = o.show({ template: a.default, locals: e, bindToController: !0, autoWrap: !1, clickOutsideToClose: !1, controller: "RedeemRewardController", controllerAs: "redeemReward" }); return t && n.then(function() { i.trigger(s.COUPON_INPUT.FOCUS) }).finally(function() { P(!1), me.couponCode = "", i.trigger(s.COUPON_INPUT.CLEAR_CODE) }), n } function q(e) { if (Oe.debug("VRS postMessage received", e), e.origin && e.origin === D.vrs.server && e.data) switch (e.data.type) { case N.INITIALIZE: K(e.data); break; case N.PROGRESS: Q(e.data); break; case N.SUCCESS: Z(e.data); break; case N.FAILURE: X(e.data); break; default: Oe.info("Unexpected post message received", e) } else Oe.info("Unexpected post message received", e) } function K(t) { e.getDelegateToken(r.UNIFIED_REDEMPTION_ID).then(function(t) { Me.postMessage({ user: t, sysInfo: e.getRedeemRequestData().sysInfo, reward: De }, "*") }) } function Q(e) { var t = { realm: "", campaignName: e.campaign.uuid || "", campaignType: e.campaign.type || "", redemptionId: e.entitlementId || "" }; switch (e.category) { case R.ACCOUNT: f.push(m.REWARDS_PORTAL_ACCOUNT_LINK_CONTINUE_CLICK, t); break; case R.TERMS_AND_CONDITIONS: f.push(m.REWARDS_PORTAL_VIEW_TERMS_AND_CONDITIONS, t); break; case R.PRODUCTS: f.push(m.REWARDS_PORTAL_SELECT_PRODUCTS_CONTINUE_CLICK, t) } } function Z(e) { var t = { realm: "", connector: e.campaign.publisher || "", campaignName: e.campaign.uuid || "", campaignType: e.campaign.type || "", redemptionId: e.redemptionId || "", productId: e.product.id || "" }; switch (e.category) { case R.REDEEM: f.push(m.REWARDS_PORTAL_ENTITLEMENT_RESULT_PRODUCT_SUCCESS, t); var n = F(); n && !Te && (me.unRedeemedList = _.without(me.unRedeemedList, n), n.redemptionStatus = n.status = n.state = r.REDEMPTION_STATES.REDEEMED, n.redemptionDate = new Date, me.redeemedOrExpiredList.unshift(n), Ae = !0, W(), oe()); break; case R.ACCOUNT: f.push(m.REWARDS_PORTAL_ACCOUNT_LINK_SUCCESS, t) } } function X(e) { var t = { realm: "", connector: e.campaign.publisher || "", campaignName: e.campaign.uuid || "", campaignType: e.campaign.type || "", redemptionId: e.redemptionId || "", productId: e.product.id || "", message: e.error.message || "" }; switch (e.category) { case R.REDEEM: f.push(m.REWARDS_PORTAL_ENTITLEMENT_RESULT_PRODUCT_FAILED, t); break; case R.ACCOUNT: f.push(m.REWARDS_PORTAL_ACCOUNT_LINK_FAILED, t) } } function J(e, t) { var n = r.PORTAL_WINDOW_HEIGHT, o = r.PORTAL_WINDOW_WIDTH, i = g.screenY + g.innerHeight / 2 - n / 2, a = g.screenX + g.innerWidth / 2 - o / 2, s = "toolbar=0,location=0,menubar=0,width=" + o + ",height=" + n + ",top=" + i + ",left=" + a, l = { message: t || "", urlToLoad: e }, c = "external-page-loader-app.html#/rewards-portal"; Me = p.openChildWindow(c, "app_rewards", s, l, !0, q), Oe.info("New browser window should have opened with url: ", e) } function ee(e) { me.unRedeemedList.map(function(t) { return t.entitlementId === e.entitlementId ? e : t }), i.trigger(T.REMOVE_NOTIFICATION, [{ callbackData: e.campaign.uuid }]), W(), oe() } function te(n, o) { P(!0), i.trigger(s.COUPON_INPUT.BLUR), ce(), ge.couponCode = n; var a = !1; return a = o === O.COUPON, e.redeemEntitlement(n, o).then(function(e) { if (De = e, pe = e.campaign.uuid, we = e.entitlementId, ge.campaignName = pe, Ae = !1, a) { var n = t("translate")("l10n.codeVerified"); J(e.entitlementUrl, n) } else o === O.AVAILABLE_REWARD && ee(De), J(e.entitlementUrl, ""); i.on(l.CHILD_WINDOW_CLOSED, V), P(!1), Te = !0 }).catch(function(e) { Oe.error("Redemption for " + n + " failed with error: " + e.message), P(!1), e.message && e.message === r.VALIDATION_ERRORS.COUPONS.NOT_FOUND ? i.trigger(s.COUPON_INPUT.INVALIDATE_CODE) : Y({ nvRedemptionError: e }, !0) }) } function ne(e, n) { return t("filter")(e, function(e) { return e.status === r.REDEMPTION_STATES[n] }) } function re() { me.unRedeemedListLimitTo < me.filteredUnRedeemedList.length && !be ? be = w(function() { me.unRedeemedListLimitTo += r.LIMIT_TO_FILTER.ITEMS_AT_ONCE, me.unRedeemedListLimitTo >= me.filteredUnRedeemedList.length && (me.unRedeemedListLimitTo = me.filteredUnRedeemedList.length, w.cancel(be), be = null) }, r.LIMIT_TO_FILTER.INTERVAL_LENGTH) : me.unRedeemedListLimitTo > me.filteredUnRedeemedList.length && (me.unRedeemedListLimitTo = me.filteredUnRedeemedList.length), me.redeemedOrExpiredListLimitTo < me.filteredRedeemedOrExpiredList.length && !Se ? Se = w(function() { me.redeemedOrExpiredListLimitTo += r.LIMIT_TO_FILTER.ITEMS_AT_ONCE, me.redeemedOrExpiredListLimitTo >= me.filteredRedeemedOrExpiredList.length && (me.redeemedOrExpiredListLimitTo = me.filteredRedeemedOrExpiredList.length, w.cancel(Se), Se = null) }, r.LIMIT_TO_FILTER.INTERVAL_LENGTH) : me.redeemedOrExpiredListLimitTo > me.filteredRedeemedOrExpiredList.length && (me.redeemedOrExpiredListLimitTo = me.filteredRedeemedOrExpiredList.length) } function oe() { me.filteredUnRedeemedList = me.unRedeemedList, me.filteredRedeemedOrExpiredList = me.redeemedOrExpiredList, he ? he.rewardsFilters ? he.rewardsFilters.available ? me.isFilterButtonDisabled("available") ? (Oe.info("No unredeemed items available, reverting filter to all state"), me.setFilter("all")) : me.filteredUnRedeemedList = ne(me.filteredUnRedeemedList, r.REDEMPTION_STATES.AVAILABLE) : he.rewardsFilters.expired ? me.isFilterButtonDisabled("expired") ? (Oe.info("No expired items available, reverting filter to all state"), me.setFilter("all")) : me.filteredRedeemedOrExpiredList = ne(me.filteredRedeemedOrExpiredList, r.REDEMPTION_STATES.EXPIRED) : he.rewardsFilters.redeemed ? me.isFilterButtonDisabled("redeemed") ? (Oe.info("No redeemed items available, reverting filter to all state"), me.setFilter("all")) : me.filteredRedeemedOrExpiredList = ne(me.filteredRedeemedOrExpiredList, r.REDEMPTION_STATES.REDEEMED) : Oe.info("Rewards filters set to show all, no specifics applied") : (Oe.info("Setting default filter to show all Rewards"), me.setFilter("all")) : Oe.error("Rewards view state not available to persist filters"), re() } function ie(e) { De = e, e.redemptionStatus === r.REDEMPTION_STATES.LOCKED ? Y({ perkDetails: e }, !1) : e.status === r.REDEMPTION_STATES.AVAILABLE ? e.campaign.type === r.REWARD_PACKAGE_TYPES.SWEEPSTAKE ? C.getGeolocation().then(function(t) { t.countryCode === x.CANADA ? Y({ sweepDetails: e }).then(function() { k(te, e.campaign.uuid, O.AVAILABLE_REWARD) }, !1) : k(te, e.campaign.uuid, O.AVAILABLE_REWARD) }) : e.state && e.state === r.REDEMPTION_STATES.CLAIMABLE ? k(ae, e) : k(te, e.campaign.uuid, O.AVAILABLE_REWARD) : k(le, e) } function ae(t) { ce(), pe = t.campaign.uuid, se(t) && (e.clearCachedRewards(), Te = !0), we = t.entitlementId, J(t.entitlementUrl, ""), i.on(l.CHILD_WINDOW_CLOSED, V) } function se(e) { var t = e.campaign.rules.maxselect; return !!(t && parseInt(t, 10) > 1) } function le(e) { e.redemptionStatus === r.REDEMPTION_STATES.REDEEMED && (Ie = !0), ce(), pe = e.campaign.uuid, J(e.entitlementUrl, "") } function ce() { ge = e.getRedeemRequestData() } function ue(e) { j().then(function() { k(te, e, O.AVAILABLE_REWARD) }) } function de(e) { me.userProfileEnabled = e } function fe() { L(), ye = h.getCachedUserItem(Ee.userId, y.VIEW_STORE, y.VIEW_STATE), he = h.getCachedUserItem(Ee.userId, y.JARVIS_GFE_STORE, y.REWARDS_VIEW_STATE), he && (he.dbUpdatedForVrs ? (me.redeemedOrExpiredList = he.redeemedOrExpiredList || [], me.unRedeemedList = he.unRedeemedList || [], me.lockedPerksList = he.lockedPerksList || []) : (me.redeemedOrExpiredList = [], me.unRedeemedList = [], me.lockedPerksList = [], he.dbUpdatedForVrs = !0), oe(), 0 === me.unRedeemedList.length && 0 === me.redeemedOrExpiredList.length && (me.couponBannerExpanded = !0)), i.on(s.REWARD_REDEEM_CLICKED, ie), i.on(s.REWARDS_UPDATED, j), i.on(s.REWARD_NOTIFICATION_CLICKED, ue), i.on(l.USER_PROFILE_STATUS_UPDATED, de), i.on(M.PROFILE_TAB_CHANGED, z), d.$on("$destroy", function() { i.off(l.CHILD_WINDOW_CLOSED, V), i.off(s.REWARD_REDEEM_CLICKED, ie), i.off(s.REWARDS_UPDATED, j), i.off(s.REWARD_NOTIFICATION_CLICKED, ue), i.off(l.USER_PROFILE_STATUS_UPDATED, de), i.off(M.PROFILE_TAB_CHANGED, z), be && (w.cancel(be), be = null), Se && (w.cancel(Se), Se = null) }), me.translatedInputPlaceholder = t("translate")("l10n.enterCouponCode"), me.nvCouponInputButton = { text: "l10n.redeem", action: me.redeemCoupon }, me.userProfileEnabled = !1, I.getUserProfileEnabled().then(de), ce(), _e && _e.rewardPackageId ? ue(_e.rewardPackageId) : k(j) } var me = this, pe = null, ge = null, ve = null, he = null, ye = null, Ee = v.getLoggedInUser(), be = null, Se = null, _e = E.params, we = null, Ae = !1, Te = !1, Ie = !1, Ce = !1, xe = null, Me = null, De = {}, Oe = n.getInstance("main.rewards/RewardsCenterController"); me.requestInProgress = !1, me.redeemButtonDisabled = !0, me.couponBannerExpanded = !1, me.perksSectionExpanded = !0, me.redeemedOrExpiredListLimitTo = me.unRedeemedListLimitTo = r.LIMIT_TO_FILTER.ITEMS_AT_ONCE, me.couponsLearnMoreMessages = ["l10n.checkCouponRetailer", "l10n.gfeGiveaway"], me.rewardsTrackBy = function(e) { return e.uID || $(e) }, me.redeemedOrExpiredItemsExist = function() { return me.redeemedOrExpiredList.length > 0 }, me.unRedeemedItemsExist = function() { return me.unRedeemedList.length > 0 }, me.showPerksSection = function() { return me.userProfileEnabled && me.lockedPerksList.length > 0 }, me.showAvailableCards = function() { return me.matchFilter("all") || me.matchFilter("available") }, me.showNoRedeemedItemsMessage = function() { return !me.redeemedOrExpiredItemsExist() && me.matchFilter("all") }, me.backToPreviousState = function() { ye && ye.lastRouterFromState ? E.go(ye.lastRouterFromState, ye.lastRouterFromStateParams, { location: "replace" }) : (Oe.error("Unable to go back to previous state, local view state unavailable"), E.go(S.HOME_STATE, {}, { location: "replace" })) }, me.redeemCoupon = function(e) { me.couponCode = e, f.push(m.REWARDS_REDEEM_CODE, { couponCode: me.couponCode || "" }), k(te, e, O.COUPON) }, me.isFilterButtonDisabled = function(e) { switch (e) { case "all": return 0 === me.getRewardsCount("all"); case "available": return 0 === me.getRewardsCount("available"); case "redeemed": return 0 === me.getRewardsCount("redeemed"); case "expired": return 0 === me.getRewardsCount("expired"); default: return !1 } }, me.setFilter = function(e) { he ? (he.rewardsFilters = { all: !1, available: !1, redeemed: !1, expired: !1 }, he.rewardsFilters[e] = !0, he.persist_(), "available" === e ? f.push(m.REWARDS_TOOLBAR_FILTER_AVAILABLE) : "redeemed" === e ? f.push(m.REWARDS_TOOLBAR_FILTER_REDEEMED) : "expired" === e ? f.push(m.REWARDS_TOOLBAR_FILTER_EXPIRED) : f.push(m.REWARDS_TOOLBAR_FILTER_ALL), oe(), i.trigger(s.RESET_SCROLL_POSITION)) : Oe.error("Unable to set filter, rewards view state unavailable") }, me.matchFilter = function(e) { return he && he.rewardsFilters && he.rewardsFilters[e] || !1 }, me.getRewardsCount = function(e) { switch (e) { case "all": return _.size(me.redeemedOrExpiredList) + _.size(me.unRedeemedList); case "available": return _.size(ne(me.unRedeemedList, r.REDEMPTION_STATES.AVAILABLE)); case "redeemed": return _.size(ne(me.redeemedOrExpiredList, r.REDEMPTION_STATES.REDEEMED)); case "expired": return _.size(ne(me.redeemedOrExpiredList, r.REDEMPTION_STATES.EXPIRED)); default: return 0 } }, me.toggleCouponBannerExpansionState = function() { me.couponBannerExpanded = !me.couponBannerExpanded, me.couponBannerExpanded && f.push(m.REWARDS_REDEEM_COUPON_BANNER_EXPANDED) }, me.togglePerksSectionExpansionState = function() { me.perksSectionExpanded = !me.perksSectionExpanded }, fe() }]); t.rewardsCenterController = l }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.searchController = void 0; var o = n(188), i = n(3), a = r(i), s = o.ngSearchModule.controller("SearchController", ["$scope", "$log", "$state", "$timeout", "jarvisService", "eventAggregator", "gfeSearchService", "DB_NAMES", "dbCacheService", "gamesService", "COMMON_EVENTS", "$document", "KEYBOARD_EVENT_KEYCODE", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_SCREENS", "TELEMETRY_SEARCH_TYPE", "TELEMETRY_ONOFF_STATE", function(e, t, n, r, o, i, s, l, c, u, d, f, m, p, g, v, h) { function y() { S.searchInputVisble = !1, S.query = "", T = o.getLoggedInUser(), T ? (A = c.getCachedUserItem(T.userId, l.JARVIS_GFE_STORE, l.JARVIS_SEARCH_STATE), A && A.wait_().then(function() { S.recentSearchesCache = A.recentSearches, S.recentSearchesCache.length > 0 ? S.searchResult = "recentQueries" : S.searchResult = "" })) : (T = null, A = null) } function E() { i.on(d.LOGIN_STATUS_CHANGE, y), y() } function b() { i.off(d.LOGIN_STATUS_CHANGE, y), S.categorizedResult = null, T = null, A = null, S.query = "", S.searchResult = "" } var S = this, _ = t.getInstance("main.searchsearchController"), w = null, A = null, T = null, I = 74, C = !1; S.query = "", S.searchInputVisble = !1, S.searchInputFocused = !1, S.browsingResult = !1, S.categorizedResult = null, S.recentSearchesAvailable = !1, S.searchResult = "", S.selectedSearchResultIndex = 0, S.selectedCategoryIndex = 0, S.selectedRecentSearchIndex = -1, S.currentCategory = "", S.searchCategories = { "main.auth.rewards": "l10n.rewards", "main.auth.home.gamesAndFriends.gameDetails": "l10n.games", "main.auth.updates": "l10n.drivers", "main.auth.preferences": "l10n.settings" }, S.recentSearchesCache = []; var x = { "main.auth.home.gamesAndFriends.gameDetails": g.SCREEN_GAMES, "main.auth.home.gamesAndFriends": g.SCREEN_HOME, "main.auth.updates": g.SCREEN_DRIVERS, "main.auth.rewards": g.SCREEN_REWARDS, "main.auth.preferences.general": g.SCREEN_PREFERENCES_GENERAL, "main.auth.preferences.accounts": g.SCREEN_PREFERENCES_ACCOUNT, "main.auth.preferences.games": g.SCREEN_PREFERENCES_GAMES, "main.auth.preferences.shield": g.SCREEN_PREFERENCES_SHIELD }; S.setInputElement = function(e) { w || (w = e) }, S.focusSearchInput = function() { S.searchInputVisble = !0, r(function() { w[0].focus() }, 210), s.pushTelemetry(p.SEARCH_INPUT_TOGGLE, { currentScreen: x[n.current.name], settingName: p.SEARCH_INPUT_TOGGLE.enumId, settingValue: h.ON }) }, S.neglectSearchInput = function() { S.searchInputVisble = !1, S.query = "", S.categorizedResult = null, S.searchInputFocused = !1, S.browsingResult = !1, S.searchResult = "", s.pushTelemetry(p.SEARCH_INPUT_TOGGLE, { currentScreen: x[n.current.name], settingName: p.SEARCH_INPUT_TOGGLE.enumId, settingValue: h.OFF }) }, S.toggleSearchInput = function() { S.searchInputVisble = !S.searchInputVisble, S.searchInputVisble ? S.focusSearchInput() : S.neglectSearchInput() }, S.showRecentSearches = function() { S.searchInputFocused = !0, S.categorizedResult || 0 != S.query.length || S.performSearch(S.query) }, S.resultsShouldBeVisible = function() { return !!(S.searchInputVisble && S.searchInputFocused || S.browsingResult) }, S.performSearch = function(e) { if (0 == e.length) S.recentSearchesCache.length > 0 ? S.searchResult = "recentQueries" : S.searchResult = "", S.selectedRecentSearchIndex = -1; else { var t = 0, r = {}, o = { "main.auth.rewards": { hasIcon: !0, icon: "card_giftcard" }, "main.auth.updates": { hasIcon: !0, icon: "archive" }, "main.auth.preferences": { hasIcon: !0, icon: "settings" } }, i = s.searchDoc(e); a.forEach(i, function(e, t) { var n = e; a.size(n) && (r[t] = []), a.forEach(n, function(e) { if (o[t]) a.extend(e, o[t]); else if (e.hasThumbnail = !0, e.param) { var n = parseInt(e.param); e.thumbnail = u.getSystemGame(n).tvBannerImage } e.title = e.title.charAt(0).toUpperCase() + e.title.slice(1); var i = a.clone(e); i.preview = "", a.forEach(a.first(e.preview, 3), function(e) { e.toLowerCase() !== i.title.toLowerCase() && (i.preview += e.charAt(0).toUpperCase() + e.slice(1) + ", ") }), i.preview = i.preview.slice(0, -2), r[t].push(i) }) }); var l = n.current.name; if (l.includes("main.auth.preferences") ? l = "main.auth.preferences" : l.includes("main.auth.home.gamesAndFriends") && (l = "main.auth.home.gamesAndFriends.gameDetails"), a.has(r, l)) { var c = {}; c[l] = r[l], a.forEach(r, function(e, t, n) { t !== l && (c[t] = e) }), r = c } a.forEach(r, function(e) { t += e.length }), _.info("PerformSearch"), a.keys(r).forEach(function(e) { r[e] = a.first(r[e], 5) }), t > 0 ? (S.categorizedResult = r, S.searchResult = "resultAvailable", S.initializeSearchResultListIndices(), S.initializeScroll()) : (S.categorizedResult = null, S.searchResult = "resultNotAvailable") } }, S.initializeSearchResultListIndices = function() { S.selectedCategoryIndex = 0, S.selectedSearchResultIndex = 0; var e = a.keys(S.categorizedResult); S.currentCategory = e[S.selectedCategoryIndex] }, S.addQuery = function(e) { s.pushTelemetry(p.SEARCH_RECENT_RESULT_CLICK, { searchType: v.RECENT_SEARCH_RESULT, searchQuery: "", searchPreview: "", selectedResult: e.title }), C = !0, S.redirect(e) }, S.redirect = function(e) { S.browsingResult = !1; var t = e; e.param ? n.go(e.path, { userGameId: e.param }) : n.go(e.path), C || s.pushTelemetry(p.SEARCH_NEW_RESULT_CLICK, { searchType: v.NEW_SEARCH_RESULT, searchQuery: S.query, searchPreview: e.preview, selectedResult: e.title }), C = !1, S.recentSearchesCache = a.without(S.recentSearchesCache, a.findWhere(S.recentSearchesCache, { title: t.title })), A && (S.recentSearchesCache.unshift(t), S.recentSearchesCache.length > 5 && S.recentSearchesCache.pop(), A.recentSearches = S.recentSearchesCache, A.persist_()) }, S.initializeScroll = function() { r(function() { S.searchResultListElement = angular.element(f[0].querySelector("#search-result-list")), S.searchResultListElement && S.searchResultListElement[0] && S.searchResultListElement[0].scrollHeight > S.searchResultListElement[0].offsetHeight && (S.searchResultListElement[0].scrollTop = 0) }) }, S.updateScroll = function(e) { S.searchResultListElement && S.searchResultListElement[0] && S.searchResultListElement[0].scrollHeight > S.searchResultListElement[0].offsetHeight && (S.searchResultListElement[0].scrollTop += e) }, S.isSearchItemSelected = function(e, t) { return S.selectedSearchResultIndex === e && S.currentCategory === t }, S.keydownevt = function(e) { switch (e.keyCode) { case m.KEY_DOWN: if (e.stopPropagation(), e.preventDefault(), "recentQueries" !== S.searchResult) { var t = a.keys(S.categorizedResult); S.selectedSearchResultIndex < S.categorizedResult[S.currentCategory].length - 1 ? S.selectedSearchResultIndex = S.selectedSearchResultIndex + 1 : S.selectedCategoryIndex < t.length - 1 && (S.selectedCategoryIndex = S.selectedCategoryIndex + 1, S.currentCategory = t[S.selectedCategoryIndex], S.selectedSearchResultIndex = 0), S.updateScroll(I) } else S.selectedRecentSearchIndex < S.recentSearchesCache.length - 1 && (S.selectedRecentSearchIndex = S.selectedRecentSearchIndex + 1); break; case m.KEY_UP: if (e.stopPropagation(), e.preventDefault(), "recentQueries" !== S.searchResult) { var t = a.keys(S.categorizedResult); S.selectedSearchResultIndex > 0 ? S.selectedSearchResultIndex = S.selectedSearchResultIndex - 1 : S.selectedCategoryIndex > 0 && (S.selectedCategoryIndex = S.selectedCategoryIndex - 1, S.currentCategory = t[S.selectedCategoryIndex], S.selectedSearchResultIndex = S.categorizedResult[S.currentCategory].length - 1), S.updateScroll(-I) } else S.selectedRecentSearchIndex > 0 && (S.selectedRecentSearchIndex = S.selectedRecentSearchIndex - 1); break; case m.KEY_ENTER: if ("recentQueries" !== S.searchResult) { var n = S.categorizedResult[S.currentCategory][S.selectedSearchResultIndex]; n && (S.redirect(n), w[0].blur()) } else { var n = S.recentSearchesCache[S.selectedRecentSearchIndex]; n && (S.addQuery(n), w[0].blur()) } break; case m.KEY_ESCAPE: S.neglectSearchInput() } }, e.$on("$destroy", b), E() }]); t.searchController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvSearch = void 0; var o = n(188), i = n(876), a = r(i); n(601), n(41), n(694); var s = o.ngSearchModule.directive("nvSearch", ["hotkeys", function(e) { return { restrict: "E", template: a.default, controller: "SearchController", controllerAs: "searchCtrl", link: function(t, n, r, o) { function i() { o.browsingResult = !0 } function a() { o.browsingResult = !1 } function s() { o.performSearch(o.query) } function l() { u = angular.element(n[0].querySelector(".search-input")), o.setInputElement(u), d = angular.element(n[0].querySelector(".search-result-container")), d.on("mouseenter", i), d.on("mouseleave", a), u.on("focusin", s), e.add({ combo: "ctrl+f", description: "listening to ctrl+f key press for focusing search bar", callback: function(e, t) { o.focusSearchInput(), u[0].setSelectionRange(0, o.query.length) } }), e.add({ combo: "esc", description: "listening to esc key press for neglecting search bar", callback: function(e, t) { o.neglectSearchInput() } }) } function c() { d.off("mouseenter", i), d.off("mouseleave", a), u.off("focusin", s), u = null, d = null, e.del("ctrl+f"), e.del("esc") } var u = null, d = null; o.showTooltip = function(e, t) { var r = angular.element(n[0].querySelector("#" + t + e)); return !(!r || !r[0]) && r[0].scrollWidth > r[0].offsetWidth }, l(), t.$on("$destroy", c), n.on("$destroy", function() { t.$destroy() }) } } }]); t.nvSearch = s }, , , , , , , , function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } function o(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.httpTelemetryService = void 0; var i = n(13), a = o(i), s = n(24), l = n(3), c = r(l), u = s.ngTelemetryModule.service("httpTelemetryService", ["$log", "$http", "$q", "TELEMETRY_STATUS", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_PRODUCT_COMPONENT", "cefService", "TELEMETRY_API_SUB_USECASES", "DEFAULT_DESTINATION_IPS", "TELEMETRY_ORIGINAL_SERVICE_NAME", function(e, t, n, r, o, i, s, l, u, d, f) { function m(e, t, n, r, o, i, s, l, c, u) { if (e) { var d = ""; (o < 200 || o >= 300) && s && (d = s && (0, a.default)(s) || "", d = d.substring(0, 1024)), p(t, n, r, o, i, d, l, c, u) } } function p(e, t, n, r, a, l, c, u, d) { g(e, c).then(function(e) { t = e }).finally(function() { o.push(i.GFE_HTTPSUCCESS, { sourceComponent: s.GFE_UI, originalService: c, serviceUseCase: u, serviceSubUseCase: d, url: a, httpStatus: r, durationMs: n, responseData: l, destinationIp: t }) }) } function g(e, t) { var r = E[t] || ""; if (r) return n.resolve(r); if (!e) return E.LOCAL_HOST; var o = c.first(e.replace(/^(http|https):\/\//gi, "").split("/")); return l.dnsLookup(o).then(function(e) { if (e) { var n = JSON.parse(e); r = c.has(n, "hostname") ? n.hostname : "" } else r = ""; return E[t] = r, r }) } function v(e, t, n, r, o, i, s, l, c, u) { e && (o && o > 0 ? (s = s && (0, a.default)(s) || "", p(t, n, r, o, i, s, l, c, u)) : h(t, n, "" + o, i, l, c, u)) } function h(e, t, n, r, a, l, c) { g(e, a).then(function(e) { t = e }).finally(function() { o.push(i.GFE_HTTPFAILURE, { sourceComponent: s.GFE_UI, originalService: a, serviceUseCase: l, serviceSubUseCase: c, url: r, networkErrorCode: n, destinationIp: t }) }) } var y = (e.getInstance("main.telemetry/httpTelemetryService"), this), E = {}; E[f.LOCALHOST] = d.LOCALHOST, y.endpointHttpCallback = function(e, o, i, a) { var s = e.headers.telemetry || r.OTHER, l = e.headers.telemetrySubUseCase || u.NA, c = Date.now(), d = E[a] || ""; return t(e).then(function(e) { var t = Date.now() - c, n = e.status, r = e && e.config && e.config.url ? e.config.url : ""; return m(o, i, d, t, n, r, e.data, a, s, l), e }).catch(function(e) { var t = Date.now() - c, r = e && e.config && e.config.url ? e.config.url : ""; return v(o, i, d, t, e.status, r, e.data, a, s, l), n.reject(e) }) }, y.sendSdkHttpTelemetry = function(e, t, n, o, i, a, s, l) { var c = arguments.length > 8 && void 0 !== arguments[8] ? arguments[8] : r.OTHER, d = arguments.length > 9 && void 0 !== arguments[9] ? arguments[9] : u.NA, f = c || r.OTHER, p = d || u.NA, g = E[l] || ""; e ? m(t, n, g, o, i, a, s, l, f, p) : v(t, n, g, o, i, a, s, l, f, p) } }]); t.httpTelemetryService = u }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.gfeUpdatesService = void 0; var r = n(10); n(51), n(19), n(76); var o = r.ngUpdatesModule.service("gfeUpdatesService", ["socketService", "GFE_SOCK_MESSAGE", "gfeUpdatesEndpoints", "$log", function(e, t, n, r) { var o = this, i = r.getInstance("main.updates/gfeUpdatesService"); o.initialize = function() { e.register("/autoGFEdownload/newversion", t.NEW_VERSION_AVAIL), n.forceCheckUpdate().then(function(e) {}, function(e) { i.error("GFE update check failed " + e) }) } }]); t.gfeUpdatesService = o }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.gfwslDriverInformationService = void 0; var o = n(3), i = r(o), a = n(10); n(52), n(26), n(119), n(22); var s = a.ngUpdatesModule.service("gfwslDriverInformationService", ["$log", "gfwslEndpoints", "$q", "eventAggregator", "COMMON_EVENTS", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "gfwslArticleEndpoints", "settingsEndpoints", "hardwareService", "gfeGeolocationService", function(e, t, n, r, o, a, s, l, c, u, d) { function f(e) { var t = ""; return e && e.status && (t = e.status.toString()), t } function m(e, t, n, r) { var o = {}; o.version = n, o.driverTypePreference = r, o.data = t, e.push(o) } function p() { return i.isUndefined(_) ? w ? (x.info("request for editorPreviewMode is in progress.."), w) : w = c.getEditorPreviewMode().then(function(e) { return x.info("getEditorPreviewMode status:", e), _ = e && e.data ? e.data.enabled : "0" }).catch(function(e) { return x.error("failed to getEditorPreviewMode, set it to 0", e), _ = "0" }).finally(function() { w = null }) : (x.info("Returning cached value for editorPreviewMode", _), n.when(_)) } function g() { return t.hasHardwareInfo() ? n.when(!0) : u.getSystemInfo().then(function(e) { return t.updateHardwareInfo(e), !0 }) } function v(e, t) { return C && C.DriverVersion === e && C.DriverType === t.toString() ? "1" : "0" } function h(e, r) { var o = "US", l = n.defer(); i.isUndefined(r) ? "0" : r.toString(); return d.getGeolocation().then(function(e) { o = e.countryCode }).finally(function() { x.info("call GFWSL with driver type preference", r); var n = v(e, r); t.driver.getDriverInformation({ gfwslParams: { GFPV: e, prvMd: _, go: o, isInst: n } }).then(function(e) { a.push(s.UPDATES_GRD_CONTENT_SUCCESS), l.resolve(e) }).catch(function(e) { a.push(s.UPDATES_GRD_CONTENT_FAILURE, f(e)), l.reject(e) }) }), l.promise } function y(e, r) { return g().then(function(o) { return t.getParams().dIDa ? p().then(function(t) { return x.info("getEditorPreviewMode response:", t), h(e, r) }).catch(function(e) { return x.error("failed to getEditorPreviewMode", e), n.reject(e) }) : (x.error("hardware system info provided insufficient primary gpu information"), n.reject()) }) } function E(e, t) { var r = i.find(A, function(n) { return n.version === e && n.driverTypePreference === t }); if (!r && !I.data) { var o = y(e, t), a = o.then(function(n) { return n && n.data ? (m(I, n.data, e, t), n.data) : (x.error("gfwsl driver information returned null data for driver version", e), null) }).catch(function(e) { return n.reject() }).finally(function() { var n = i.find(A, function(n) { return n.version === e && n.driverTypePreference === t }); A.splice(A.indexOf(n), 1) }); return m(A, a, e, t), a } return r.data } function b(e, r, o) { return t.getParams().dIDa ? g().then(function(e) { var i = v(o, r); return t.installer.getInstallationDriverData({ gfwslParams: { isInst: i } }).then(function(e) { return a.push(s.UPDATES_INSTALL_BB_HTML_SUCCESS), x.info("response from server to installation information ", e), e }).catch(function(e) { return a.push(s.UPDATES_INSTALL_BB_HTML_FAILURE, f(e)), x.error("request to get driver installation content failed with : ", e), n.reject("gfwslEndpoints error") }) }) : (x.error("hardware system info provided insufficient primary gpu information"), n.reject()) } function S(e) { C = e, T.resetDriverInformation() } var _, p, w, A = [], T = this, I = [], C = null, x = e.getInstance("main.updates/gfwlsDriverInformationService"); T.resetDriverInformation = function() { i.each(A, function(e) { t.driver.getDriverInformation.cancel(e.data) }), A = [], I = [], x.debug("reset driver information cache to empty") }, T.initialize = function() { u.getSystemInfo().then(function(e) { C = e }), r.on(o.SYSTEMINFO_UPDATED, S), r.on(o.LOCALE_CHANGED, T.resetDriverInformation), r.on(o.LOGIN_STATUS_CHANGE, T.resetDriverInformation) }, T.getDriverInformation = function(e, t) { var r = i.find(I, function(n) { return n.version === e && n.driverTypePreference === t }); return r ? (x.debug("Driver information from cache for driver version:", e), n.when(r.data)) : E(e, t) }, T.getInstallationDriverData = function(e, t, r) { return b(e, t, r).then(function(e) { if (e && e.data && e.data.html && e.data.html.head && e.data.html.head.response && e.data.html.head.response.url) { var t = {}; return t.billboardURL = e.data.html.head.response.url, t } return x.error("gfwsl driver installation content returned null data"), n.reject() }).catch(function(e) { return n.reject() }) }, T.getArticleInformation = function(e, r, o) { return t.getParams().dIDa ? (r.GFPV = o, r.jUid = t.getParams().jUid || "", l.getArticle({ articleUrl: e, gfwslParams: r })) : (x.error("hardware system info provided insufficient primary gpu information"), n.reject()) } }]); t.gfwslDriverInformationService = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.highlightTileController = void 0; var o = n(10); n(206), n(141); var i = n(192), a = r(i), s = o.ngUpdatesModule.controller("HighlightTileController", ["$scope", "$mdDialog", "DRIVER_TYPE", "updatesService", "$q", "$log", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "gfeService", "VIDEO_TYPE", "mediaDialogService", "toastService", "$filter", "TELEMETRY_GRD_CONTENT_TYPE", "TELEMETRY_GRD_DISPLAY_SECTION", function(e, t, n, r, o, i, s, l, c, u, d, f, m, p, g) { function v(e) { try { return JSON.parse(e) } catch (t) { return I.error("Json parsing exception for ", e), null } } function h() { if (w && w.gfeLoadUrl) { var e = w.gfeLoadUrl; e = e.replace(/\\/g, ""); var t = e.split("{"); if (2 !== t.length) return I.error("Cannot request for article as gfeloadUrl is incorrect ", w.gfeLoadUrl), o.reject(); t[1] = "{" + t[1]; var n = v(t[1]); return n ? r.getDriverArticle(t[0], n, T).then(function(e) { if (s.push(l.UPDATES_GRD_ARTICLE_SUCCESS), e && e.data && e.data.gfcontent) { I.debug("get driver article returns content"); var t = {}, n = e.data.gfcontent; return t.title = n.title, t.subTitle = n.author_date ? n.author_date.by_on_date : null, t.body = n.body, t.style = "article-content", t } return I.debug("get driver article returns null content"), null }).catch(function(e) { return s.push(l.UPDATES_GRD_ARTICLE_FAILURE, e && e.status && e.status.toString() || ""), o.reject(e) }) : (I.error("Cannot request for article as gfeloadUrl has incorrect json ", w.gfeLoadUrl), o.reject()) } return I.error("article url empty for ", w.gfeLoadUrl), o.reject("no article url") } function y(e, t) { if (c.onlineState && c.onlineState.online === !0) { var n = t.video.type !== u.YOUTUBE; I.info("video type", t.video.type, "defaultVideoControl", n); var r = d.customPreset().event(e); r = r.video({ source: t.video.url, type: t.video.type, defaultVideoControl: n }), d.show(r) } else { var o = m("translate")("l10n.unableToFetchVideo"); f.show({ textContent: o, icon: "cloud off" }) } } function E(e) { return e.indexOf("youtu.be") !== -1 ? u.YOUTUBE : e.indexOf(".mp4") !== -1 ? u.LOCAL : "" } function b() { return S.isVideoAvailable(w) ? p.VIDEO : p.ARTICLE } var S = this, w = e.nvContent, A = e.nvDriverType, T = e.nvDriverVersion, I = i.getInstance("main.updates/HighlightTileController"); S.showDetails = function(e) { S.isVideoAvailable(w) ? (w.video.type = E(w.video.url), y(e, w)) : t.show({ controller: "ArticleInformationController", controllerAs: "vm", template: a.default, disableParentScroll: !1, locals: { getArticleCallback: h }, bindToController: !0 }) }, S.isVideoAvailable = function(e) { return e.video && !_.isEmpty(e.video) && e.video.url && !_.isEmpty(e.video.url) }, S.getTelemetryEventInfo = function() { var e = { contentType: "", displaySection: "", url: "" }; return e.contentType = b(), e.displaySection = g.CONTENT, e.url = w.linksTo || "", e }, S.getTelemetryEventName = function() { var e = w.featureId || !this.isContentGame() ? l.UPDATES_VIEW_AVAILABLE_DRIVER_FEATURE : l.UPDATES_VIEW_AVAILABLE_DRIVER_GAME; return A === n.CURRENT && (e = w.featureId || !this.isContentGame() ? l.UPDATES_VIEW_CURRENT_DRIVER_FEATURE : l.UPDATES_VIEW_CURRENT_DRIVER_GAME), e }, S.isContentGame = function() { return w && "true" === w.isGfeSupportedGame } }]); t.highlightTileController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvHighlightTile = void 0; var o = n(10); n(17), n(140), n(34), n(41); var i = n(880), a = r(i); n(613); var s = o.ngUpdatesModule.directive("nvHighlightTile", function() { return { restrict: "E", scope: { nvContent: "=", nvDriverType: "=", nvDriverVersion: "@" }, template: a.default, controller: "HighlightTileController", controllerAs: "highlightTile", link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvHighlightTile = s }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } function o(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.updateDetailsController = void 0; var i = n(13), a = o(i), s = n(3), l = r(s), c = n(10); n(141); var u = c.ngUpdatesModule.controller("UpdateDetailsController", ["$scope", "updatesService", "$log", "$sce", function(e, t, n, r) { function o() { t.getDriverInformation(i.driverVersion, i.isCRD).then(function(e) { e && e.DriverAttributes ? (i.driverInformation = e.DriverAttributes, e.DriverAttributes.ReleaseNotes && (i.driverInformation.releaseNotes = r.trustAsHtml(e.DriverAttributes.ReleaseNotes))) : s.error("No content avaliable for GRD version: ", i.driverVersion) }).catch(function(e) { s.error("getDriverInformation failed with error: ", e), i.driverInformation = null }).finally(function() { i.showLoadingIndicator = !1 }) } var i = this; i.showLoadingIndicator = !0, i.driverInformation = null, i.isCRD = e.nvIsCrd; var s = n.getInstance("main.updates/UpdateDetailsController"); i.driverVersion = e.nvDriverVersion, i.driverType = e.nvDriverType; var c = e.$watchGroup(["nvDriverVersion", "nvIsCrd"], function(e, t) { (0, a.default)(e) !== (0, a.default)(t) && (i.driverVersion = e[0], i.isCRD = e[1], o()) }); o(), i.showHighLights = function() { return !(!i.driverInformation || l.isEmpty(i.driverInformation.ReleaseNotesAbstract) && (!i.driverInformation.highlightGfeNg || l.isEmpty(i.driverInformation.highlightGfeNg.tiles))) }, i.showDefaultBanner = function() { return i.showLoadingIndicator === !1 && !l.isNull(i.driverInformation) && l.isNull(i.driverInformation.bannerGfeNg) }, i.showDefaultContentImage = function() { return i.showLoadingIndicator === !1 && l.isNull(i.driverInformation) }, e.$on("$destroy", function() { c() }) }]); t.updateDetailsController = u }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdateDetails = void 0; var o = n(10); n(132), n(623), n(621); var i = n(881), a = r(i); n(615); var s = o.ngUpdatesModule.directive("nvUpdateDetails", function() { return { restrict: "E", scope: { nvDriverVersion: "@", nvDriverType: "=", nvIsCrd: "=" }, template: a.default, controller: "UpdateDetailsController", controllerAs: "updateDetails", link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvUpdateDetails = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdates = void 0; var o = n(10); n(619); var i = n(882), a = r(i), s = o.ngUpdatesModule.directive("nvUpdates", function() { return { restrict: "E", scope: {}, template: a.default, link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvUpdates = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } function o(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.updatesDriverController = void 0; var i = n(3), a = o(i), s = n(10); n(141), n(328), n(16), n(11), n(20), n(26); var l = n(311), c = r(l), u = n(312), d = r(u), f = s.ngUpdatesModule.controller("UpdatesDriverController", ["$scope", "$log", "TASK_STATUS", "$filter", "$timeout", "updatesService", "$state", "CHECK_FOR_UPDATE", "COMMON_EVENTS", "eventAggregator", "UPDATE_EVENTS", "DOWNLOAD_PROGRESS_STATUS", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "DRIVER_TYPE", "dbService", "DB_NAMES", "INSTALLER_EVENTS", "toastService", "gfeService", "dbCacheService", "jarvisService", "SOCKETIO_EVENTS", "DOWNLOAD_TYPE", "DRIVERTYPE", "$templateCache", "productTourService", "PRODUCT_TOUR_NAMES", "PRODUCT_TOUR_EVENTS", "uiTourService", "$document", "$interval", "CRD_STATE_EVENT", function(e, t, n, r, o, i, s, l, u, f, m, p, g, v, h, y, E, b, S, _, w, A, T, I, C, x, M, D, O, R, N, L, P) { function k(e, t) { var n = { state: t, version: e }; le.setItem(E.DRIVER_DOWNLOAD_STATE, n) } function G() { if (!a.isNull(ve) && !a.isUndefined(ve) && !a.isUndefined(ve.version)) { var e = r("filter")(se.driverUpdateList, { version: ve.version, isCRD: ve.isCRD }); e && e.length > 0 ? (fe.info("resume installation for recommended driver", ve.version), i.beginInstallation(e[0], ve.isCustomInstall, !0)) : (fe.info("resume installation for installed driver", ve.version), i.beginInstallation(ve, ve.isCustomInstall, !0)) } ve = null } function F() { if (fe.info("check for auto download Driver"), U()) { var e = se.driverUpdateList; if (se.driverUpdateList.length > 1 && (e = r("filter")(se.driverUpdateList, { isBeta: !1 })), e && e[0] && (se.isStatusPending(e[0].downloadStatus.status) || se.isStatusPaused(e[0].downloadStatus.status)) && e[0].downloadStatus.failureCount < 3) { fe.info("autodownloadDriver for driver updates", e); var t; le.getItem(E.DRIVER_DOWNLOAD_STATE).then(function(e) { t = e }, function(e) { fe.error("failed to read driverDownloadState key in database: ", e) }).finally(function() { var n = !0; !t || t.version !== e[0].version || "paused" !== t.state && "stop" !== t.state || (n = !1), n && se.startDownload(e[0]) }) } } } function U() { return se.driverUpdateList && (!ae && a.isNull(ve) && !ye || he) } function V() { if (ae) { if (_e === Ee.FAILED || se.driverUpdateList && se.driverUpdateList.length > 0) se.installedDriverHeaderText = de("l10n.currentlyInstalled"); else { var e = JSON.parse(se.currentlySelectedDriver) === se.driverType.GRD ? "l10n.latestGeforceUpdate" : "l10n.latestGeforceCRDUpdate"; se.installedDriverHeaderText = de(e) } se.installedDriverHeaderText = se.installedDriverHeaderText.toUpperCase() } else se.installedDriverHeaderText = "" } function z(e) { i.getUpdateDetails().then(function(e) { if (we && (!se.driverUpdateList || e && e[0] && se.driverUpdateList[0] && (se.driverUpdateList[0].isCRD !== e[0].isCRD || se.driverUpdateList[0].version !== e[0].version))) { var t = JSON.parse(se.currentlySelectedDriver) === se.driverType.GRD ? "l10n.newGRDDriverAvailable" : "l10n.newCRDDriverAvailable"; S.show({ textContent: r("translate")(t), icon: "file_download" }) } else S.isOpen() && S.cancel(); fe.debug("driver updates list is: ", e, se.driverUpdateList), se.driverUpdateList = e, F() }).catch(function(e) { if (se.installedDriver && we) { var t = JSON.parse(se.currentlySelectedDriver) === se.driverType.GRD ? "l10n.latestGeforceUpdate" : "l10n.latestGeforceCRDUpdate"; S.show({ textContent: r("translate")(t), icon: "check" }) } else S.isOpen() && S.cancel(); se.driverUpdateList = null, fe.error("getUpdates failed with error: ", e) }).finally(function() { fe.info("refreshAvailableUpdates finally IN"), G(), se.installedDriver = ae, e && (fe.info("call cb", e), e()), se.anydriverInfoOrUpdatesFound = !(!se.driverUpdateList && !se.installedDriver), V(), ue = !0, we = !1, fe.info("refreshAvailableUpdates finally OUT") }) } function B(e) { S.show({ textContent: e, icon: "error_outline" }) } function $(e) { if (e) switch (e.status) { case n.TASK_FAILED_UNABLE_TO_REACH_SERVER: case n.TASK_CHECK_SUM_ERROR: case n.TASK_DISK_WRITE_FAIL: case n.TASK_SIGNATURE_VERIFICATION_FAILS: case n.TASK_COMPLETED: case n.TASK_DOWNLOAD_ERROR: f.off(T.CONNECT, W), f.off(p.PROGRESS, $) } } function W() { fe.info("downloader update last state on reconnect"), se.refreshUI() } function H() { se.updateState === l && i.canCheckForUpdate() && a.isNull(ve) ? i.checkForUpdates() : i.scanCompleted && a.isNull(ve) ? (fe.info("scan completed, refreshing state"), z()) : i.manualCheckForUpdate && !i.scanCompleted && a.isNull(ve) && (S.showProgress({ textContent: r("translate")("l10n.checkingforUpdates") }), we = !0) } function j() { L.cancel(Ae); var e = 0; Ae = L(function() { var t = angular.element(N[0].getElementById("driver-icon")); t[0] ? (fe.info("driver tour element found"), M.startDriverTour(), L.cancel(Ae), Ae = null) : (fe.info("check for Driver product tour html element", e), e++), e >= be && (L.cancel(Ae), Ae = null, fe.info("Driver product tour id not found")) }, Se) } function Y(e) { e !== D.DRIVER && (q(), fe.info("other tour closed, show driver product tour"), j()) } function q() { f.off(O.PAUSED, Y), f.off(O.END, Y) } function K() { f.on(O.PAUSED, Y), f.on(O.END, Y) } function Q() { se.installedDriver = null, ae = null, i.getInstalledDriver().then(function(e) { ae = e, ae.isExpanded = !1, ae.reInstalledDriver = ae.downloadStatus && se.isDownloadStarted(ae.downloadStatus.status) || ae.reInstalledDriver || !1, fe.info("getInstalledDriver get called", e) }).catch(function(e) { fe.error("getInstalledDriver failed with error: ", e) }).finally(function() { se.refreshUI(), o.cancel(ge), ge = o(function() { H() }) }) } function Z() { i.isCRDFeatureSupported() } function X(e) { fe.info("crd state updated by event", e), se.CRDSupported = e, se.CRDSupported === !0 && (M.isTourRunning() ? (fe.info("register tour listener"), K()) : (fe.info("show driver tour"), j())) } function J() { ie(), Q(), i.setUpdatesListener(se.refreshUI), f.on(P.CRD_STATE_UPDATED, X), Z() } function ee() { _e = Ee.SCANNING } function te() { we = !1, B(de("l10n.unableToConnectToNvidia")), _e = Ee.FAILED } function ne() { _e = Ee.FINISHED } function re(e) { var t = se.installedDriver && se.installedDriver.downloadStatus.taskId == e.taskId; if (t && (se.installedDriver.reInstalledDriver = !1), e.status === n.TASK_PAUSED_UNABLE_TO_REACH_SERVER) B(de("l10n.downloadPausedUnableToReachNvidia")), t && (se.installedDriver.reInstalledDriver = !0); else if (e.status === n.TASK_CHECK_SUM_ERROR || e.status === n.TASK_SIGNATURE_VERIFICATION_FAILS) B(de("l10n.driverDownloadFailed")); else if (e.status === n.TASK_FAILED_UNABLE_TO_REACH_SERVER) B(de("l10n.unableToConnectToNvidia")); else if (e.status === n.TASK_DISK_WRITE_FAIL) { var o = r("convertBytesToKBMBGB")(e.totalBytes); if (e.downloadedLocation.length > 0) { var i = e.downloadedLocation.split(":")[0]; i = i.toUpperCase(); var a = de("l10n.downloadDiskSpace", { value: o, drive: i }); B(a) } } } function oe() { fe.info("got online event"), Q() } function ie() { i.getDriverTypePreference().then(function(e) { fe.info("getDriverTypePreference is", e), se.currentlySelectedDriver = e }).catch(function(e) { fe.error("getDriverTypePreference failed with error: ", e), se.currentlySelectedDriver = se.driverType.GRD }) } var ae, se = this, le = y.getGlobalStore(E.GLOBAL_STORE), ce = Date.now(), ue = !1; se.driverUpdateList = null, se.installedDriver = null, se.taskStatus = n; var de = r("translate"), fe = t.getInstance("main.updates/updatesdrivercontroller"); se.driverTypeConstant = h; var me, pe, ge, ve = null, he = !1, ye = !1; fe.info("controller created"), se.installedDriverHeaderText = ""; var Ee = { NOT_STARTED: "NOT_STARTED", FAILED: "FAILED", FINISHED: "FINISHED", SCANNING: "SCANNING" }; se.driverType = C; var be = 3, Se = 1e3; x.put("tour-step-popup.html", c.default), x.put("tour-step-template.html", d.default); var _e = Ee.NOT_STARTED; se.user = A.getLoggedInUser(), se.viewState = w.getCachedUserItem(se.user.userId, E.VIEW_STORE, E.VIEW_STATE), se.anydriverInfoOrUpdatesFound = !0; var we = !1; se.CRDSupported = !1; var Ae; se.currentlySelectedDriver = se.driverType.GRD, se.getProgressString = function(e) { var t = ""; if (e && e.downloadStatus) { var n = r("convertBytesToKBMBGB")(e.downloadStatus.totalBytes), o = r("convertBytesToKBMBGB")(e.downloadStatus.bytesDone); t = o + "/" + n } return t }, se.startDownload = function(e) { if (_.onlineState && _.onlineState.online === !1) S.showOffline(); else { var t = e.isCRD === se.driverType.CRD ? I.CRD_DRIVER_DOWNLOAD : I.GRD_DRIVER_DOWNLOAD; i.startDownload(e.version, e.downloadURL, t).then(function(t) { fe.info("download started", t.data), f.on(T.CONNECT, W), f.on(p.PROGRESS, $), k(e.version, "start"), e.downloadStatus = t.data }).catch(function(t) { fe.error("download failed to start", t), B(de("l10n.driverDownloadFailed")), se.installedDriver && se.installedDriver.version === e.version && (se.installedDriver.reInstalledDriver = !1), g.push(v.UPDATES_DOWNLOAD_DRIVER_FAILED, e.version) }) } }, se.pauseDownload = function(e) { i.pauseDownload(e.downloadStatus.taskId).then(function(t) { k(e.version, "paused"), e.downloadStatus = t.data, fe.info("download paused", e.downloadStatus) }).catch(function(e) { fe.error("download failed to pause with error", e) }) }, se.resumeDownload = function(e) { i.resumeDownload(e.downloadStatus.taskId).then(function(t) { e.downloadStatus = t.data, k(e.version, "resume"), fe.info("download resume", e.downloadStatus) }).catch(function(e) { fe.error("download failed to resume with error", e) }) }, se.stopDownload = function(e, t) { t && (se.installedDriver.reInstalledDriver = !1), i.stopDownload(e.downloadStatus.taskId).then(function(t) { f.off(T.CONNECT, W), f.off(p.PROGRESS, $), e.downloadStatus = t.data, k(e.version, "stop"), fe.info("download stoped", e.downloadStatus) }).catch(function(e) { fe.error("download failed to stop with error", e) }) }, se.startInstall = function(e, t) { i.beginInstallation(e, t, !1) }, se.isDownloadStarted = function(e) { return e === n.TASK_PAUSED || e === n.TASK_RUNNING || e === n.TASK_RETRY || e === n.TASK_PAUSED_UNABLE_TO_REACH_SERVER }, se.isExtractionStarted = function(e) { return e === n.TASK_EXTRACTING }, se.isStatusPaused = function(e) { return e === n.TASK_PAUSED || e === n.TASK_PAUSED_UNABLE_TO_REACH_SERVER }, se.isStatusCompleted = function(e) { return e === n.TASK_COMPLETED }, se.isStatusPending = function(e) { return e === n.TASK_NOT_STARTED || e === n.TASK_CHECK_SUM_ERROR || e === n.TASK_FAILED_UNABLE_TO_REACH_SERVER || e === n.TASK_SIGNATURE_VERIFICATION_FAILS || e === n.TASK_DISK_WRITE_FAIL }, se.updateDriverExpandedState = function() { var e = se.viewState.driverExpandState || {}; fe.debug("driverExpandState IN", e), ae && (angular.isDefined(e[se.installedDriver.version]) ? ae.isExpanded = e[se.installedDriver.version] : se.driverUpdateList || (se.installedDriver.isExpanded = ae.isExpanded = !0), e[se.installedDriver.version] = ae.isExpanded), se.driverUpdateList && 1 === se.driverUpdateList.length && (se.driverUpdateList[0].isExpanded = e[se.driverUpdateList[0].version] !== !1, e[se.driverUpdateList[0].version] = se.driverUpdateList[0].isExpanded), se.viewState.driverExpandState = e, se.viewState.persist_(), fe.debug("driverExpandState OUT", e) }, se.isScanCompleted = function() { return i.scanCompleted }, se.onExpand = function(e) { o.cancel(me), me = o(function() { e.isExpanded = !0, se.viewState.driverExpandState && (se.viewState.driverExpandState[e.version] = !0, se.viewState.persist_()) }) }, se.onCollapse = function(e) { o.cancel(pe), pe = o(function() { e.isExpanded = !1, se.viewState.driverExpandState && (se.viewState.driverExpandState[e.version] = !1, se.viewState.persist_()) }) }, se.refreshUI = function() { z(se.updateDriverExpandedState) }, se.updateState = s.params.updateState, ve = s.params.resumeDriverInstallation, he = s.params.startDriverDownload, ve && le.setItem(E.DRIVER_INSTALL_STATE, null), se.isCheckForUpdateDisabled = function() { return !i.canCheckForUpdate() || _e === Ee.SCANNING }, se.isInstallDisabled = function() { return we }, se.onCheckForUpdate = function() { _.onlineState && _.onlineState.online === !1 ? S.showOffline() : i.canCheckForUpdate() && (S.showProgress({ textContent: r("translate")("l10n.checkingforUpdates") }), i.checkForUpdates(!0), we = !0) }, J(), se.getDownloadStatusMessage = function(e) { var t = ""; return e === n.TASK_EXTRACTING ? t = r("translate")("l10n.preparingPackage") : e === n.TASK_RUNNING ? t = de("l10n.downloading") : se.isStatusPaused(e) ? t = de("l10n.paused") : e === n.TASK_RETRY && (t = de("l10n.retrying")), t }, se.getAvlDriverTelemetryEventName = function(t) { return t ? e.$root.telemetryEventNames.UPDATES_VIEW_AVAILABLE_BETA_DRIVER : e.$root.telemetryEventNames.UPDATES_VIEW_AVAILABLE_DRIVER }, se.getAvlDriverType = function(e) { return e ? h.AVAILABLE_BETA : h.AVAILABLE }, se.canToggleDownload = function(e, t) { var n = [], r = se.isStatusPending(e); if (r) { if (ae && ae.downloadStatus && ae.version !== t && se.isDownloadStarted(ae.downloadStatus.status)) return !1; se.driverUpdateList && (n = a.filter(se.driverUpdateList, function(e) { return !(e.version === t || !se.isDownloadStarted(e.downloadStatus.status)) })) } return 0 === n.length && r && !we }, se.reInstalledDriverMenuItemDisabled = function() { return ae && ae.downloadStatus && se.isStatusPending(ae.downloadStatus.status) && !se.canToggleDownload(ae.downloadStatus.status, ae.version) }, se.performReinstalledDriver = function() { se.installedDriver && (se.installedDriver.reInstalledDriver = !0, se.isStatusPending(ae.downloadStatus.status) && se.startDownload(ae)) }, se.showReInstallButtons = function() { return se.installedDriver.reInstalledDriver }, se.showLoadingIndicator = function() { return ue === !1 && Date.now() - ce > 500 }, se.onRecommendedDriverTypeChanged = function(e) { se.currentlySelectedDriver != e && (se.currentlySelectedDriver = e, ye = !0, fe.info("onRecommendedDriverTypeChanged ", se.currentlySelectedDriver), i.setDriverTypePreference(e).then(function() { se.onCheckForUpdate() })) }, se.onTourStepShown = function() { M.onStepShown() }, f.on(b.INSTALL_DONE, Q), f.on(p.FAILED, re), f.on(m.SCAN_STARTED, ee), f.on(m.SCAN_FAILED, te), f.on(u.ONLINE, oe), f.on(m.SCAN_FINISHED, ne), f.on(m.INSTALLED_DRIVER_UPDATE, Q), e.$on("$destroy", function() { if (Ae && (fe.info("cancle tour interval"), L.cancel(Ae)), M.isTourRunning(D.DRIVER)) { var e = R.getTourByName(D.DRIVER); e ? (fe.info("close driver tour before moving to other page"), e.end().catch(function(e) { fe.error("failed to end driver tour", e) })) : fe.error("Failed to find driver tour element") } q(), f.off(b.INSTALL_DONE, Q), f.off(m.SCAN_STARTED, ee), f.off(m.SCAN_FAILED, te), f.off(m.SCAN_FINISHED, ne), f.off(p.FAILED, re), f.off(u.ONLINE, oe), f.off(m.INSTALLED_DRIVER_UPDATE, Q), f.off(P.CRD_STATE_UPDATED, X), o.cancel(pe), o.cancel(me), o.cancel(ge), pe = null, me = null, i.removeUpdatesListener(se.refreshUI) }) }]); t.updatesDriverController = f }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdatesDriver = void 0; var o = n(10); n(308), n(307), n(205), n(140), n(616), n(113), n(217); var i = n(884), a = r(i); n(618); var s = o.ngUpdatesModule.directive("nvUpdatesDriver", [function() { return { restrict: "E", scope: {}, template: a.default, controller: "UpdatesDriverController", controllerAs: "updatesDriver", link: function(e, t, n, r) { function o() { t.empty(), t.remove(), t = null } e.$on("$destroy", o), t.on("$destroy", function() { e.$destroy() }) } } }]); t.nvUpdatesDriver = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.updatesDriverHighlightsController = void 0; var r = n(10), o = r.ngUpdatesModule.controller("UpdatesDriverHighlightsController", ["$scope", "$log", function(e, t) { var n = this; n.driverHighlights = null, n.driverOverview = null, n.driverType = e.nvDriverType, n.driverVersion = e.nvDriverVersion; var r = t.getInstance("main.updates/UpdatesDriverHighlightsController"), o = e.$watch("nvDriverHighlight", function() { e.nvDriverHighlight ? n.driverHighlights = e.nvDriverHighlight : (r.error(" driver highlights is null"), n.driverHighlights = null) }); e.$on("$destroy", function() { o() }) }]); t.updatesDriverHighlightsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdatesDriverHighlights = void 0; var o = n(10); n(614); var i = n(885), a = r(i); n(620); var s = o.ngUpdatesModule.directive("nvUpdatesDriverHighlights", function() { return { restrict: "E", scope: { nvDriverHighlight: "=", nvDriverType: "=", nvDriverVersion: "@" }, template: a.default, controller: "UpdatesDriverHighlightsController", controllerAs: "updatesDriverHighlights", link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvUpdatesDriverHighlights = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.updatesHighlightsBannerController = void 0; var r = n(10), o = r.ngUpdatesModule.controller("UpdatesHighlightsBannerController", ["$scope", "DRIVER_TYPE", "VIDEO_TYPE", "$window", "$document", "DRIVER_UPDATE", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_GRD_CONTENT_TYPE", "TELEMETRY_GRD_DISPLAY_SECTION", function(e, t, n, r, o, i, a, s, l) { function c(e, t) { return r.getComputedStyle(e[0]).getPropertyValue(t) } function u() { if (!_.isEmpty(m.bannerCarousel)) { var e = c(m.bannerCarousel, "width"), t = parseInt(e.substring(0, e.lastIndexOf("px"))), n = i.BANNER_IMAGE_HEIGHT / i.BANNER_IMAGE_WIDTH, r = t * n; m.bannerCarousel.css({ height: r + "px" }) } } function d(e) { return e.indexOf("youtu.be") !== -1 ? n.YOUTUBE : e.indexOf(".mp4") !== -1 ? n.LOCAL : "" } function f() { return p === t.CURRENT ? a.UPDATES_VIEW_CURRENT_DRIVER_BANNER_AD : a.UPDATES_VIEW_AVAILABLE_DRIVER_BANNER_AD } var m = this; m.videoBanner = null; var p = e.nvDriverType, g = e.nvDriverVersion; o.ready(function() { m.bannerCarousel = angular.element(o[0].querySelectorAll(".common-carousel")), u() }), r.addEventListener("resize", u), m.isVideoAvailable = function(e) { return e.video && !_.isEmpty(e.video) && e.video.url && !_.isEmpty(e.video.url) }; var v = e.$watch("nvDriverBanner", function() { m.videoBanner = e.nvDriverBanner, _.each(e.nvDriverBanner, function(e) { m.isVideoAvailable(e) ? e.video.type = d(e.video.url) : e.driverVersion = g }) }); m.getTelemetryEventInfo = function() { var e = { eventName: {}, info: {} }; e.eventName = f(); var t = { contentType: "", displaySection: "", url: "" }; return t.contentType = s.VIDEO, t.displaySection = l.HEADER, e.info = t, e }, e.$on("$destroy", function() { v(), r.removeEventListener("resize", u) }) }]); t.updatesHighlightsBannerController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdatesHighlightsBanner = void 0; var o = n(10); n(277); var i = n(886), a = r(i); n(622); var s = o.ngUpdatesModule.directive("nvUpdatesHighlightsBanner", function() { return { restrict: "E", scope: { nvDriverBanner: "=", nvDriverType: "=", nvDriverVersion: "@" }, template: a.default, controller: "UpdatesHighlightsBannerController", controllerAs: "updatesHighlightsBanner", link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvUpdatesHighlightsBanner = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.updatesInstallationCustomController = void 0; var r = n(10), o = r.ngUpdatesModule.controller("UpdatesInstallationCustomController", ["$filter", "updatesInstallerDialogService", function(e, t) { var n = this; n.cleanInstall = !1; var r = t.getDialogModel(), o = r.installablePackagesData(); n.showPackageSelectionUI = o[0], n.packages = o[1]; var i = !0, a = e("translate"); n.showPackageSelectionUI ? n.cleanInstall = o[2] : i = o[2], n.getStatusText = function(e) { return e && e.length ? e : a(i ? "l10n.notSelected" : "l10n.failed") }, n.getUserSelectedCustomDetailsCallback = function() { var e = []; return n.showPackageSelectionUI && (e.push(n.cleanInstall), e.push(n.packages)), e }, t.getUserSelectedCustomDetailsRegister(n.getUserSelectedCustomDetailsCallback) }]); t.updatesInstallationCustomController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdatesInstallationCustom = void 0; var o = n(10), i = n(887), a = r(i); n(624); var s = o.ngUpdatesModule.component("nvUpdatesInstallationCustom", { template: a.default, controller: "UpdatesInstallationCustomController", controllerAs: "updatesInstallationCustom" }); t.nvUpdatesInstallationCustom = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.updateInstallationProgressController = void 0; var r = n(10); n(26); var o = r.ngUpdatesModule.controller("UpdateInstallationProgressController", ["$log", "updatesService", "$sce", "updatesInstallerDialogService", function(e, t, n, r) { var o = this; o.status = "", o.progressValue = 0; var i = e.getInstance("main.updates/UpdateInstallationProgressController"); o.model = r.getDialogModel(), o.isPreparingInstall = o.model.isExpressInstall(); var a = o.model.driverType(), s = o.model.driverVersion(); o.isInstalling = !1, o.progressTitle = "", o.installationDriverData = null, t.getInstallationDriverData(a, s).then(function(e) { o.installationDriverData = e }).catch(function(e) { i.error("getInstallationDriverData failed: " + e + ". Returning static content."), o.showFallbackImage = !0 }), o.refreshInstallingCallback = function(e) { o.isPreparingInstall = e }, o.progressTitleCallback = function(e) { o.progressTitle = e }, o.progressSetTotalCallback = function(e, t) { o.progressValue = e / t * 100 }, o.updateIsInstallingCallback = function(e) { o.progressValue = 0, o.isInstalling = e }, o.getBillboardUrl = function() { var e = ""; return o.installationDriverData && (e = n.trustAsResourceUrl(o.installationDriverData.billboardURL)), e }, o.canShowUninstallProgress = function() { return !o.isPreparingInstall && !o.isInstalling }, o.canShowInstallProgress = function() { return !o.isPreparingInstall && o.isInstalling }, r.updateRefreshInstallingRegister(o.refreshInstallingCallback), r.updateProgressTitleRegister(o.progressTitleCallback), r.updateProgressSetTotalRegister(o.progressSetTotalCallback), r.updateIsInstallingRegister(o.updateIsInstallingCallback) }]); t.updateInstallationProgressController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdatesInstallationProgress = void 0; var o = n(10), i = n(888), a = r(i); n(626); var s = o.ngUpdatesModule.component("nvUpdatesInstallationProgress", { template: a.default, controller: "UpdateInstallationProgressController", controllerAs: "updateInstallationProgress" }); t.nvUpdatesInstallationProgress = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.updatesInstallationRebootController = void 0; var r = n(10), o = r.ngUpdatesModule.controller("UpdatesInstallationRebootController", ["$scope", "$interval", "updatesInstallerDialogService", function(e, t, n) { var r, o = this; o.interval = 60, r = t(function() { o.interval <= 1 ? (t.cancel(r), r = void 0, n.cancel(), n.rebootSystem()) : o.interval-- }, 1e3), e.$on("$destroy", function() { angular.isDefined(r) && (t.cancel(r), r = void 0) }) }]); t.updatesInstallationRebootController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdatesInstallationReboot = void 0; var o = n(10), i = n(889), a = r(i); n(628); var s = o.ngUpdatesModule.directive("nvUpdatesInstallationReboot", function() { return { restrict: "E", template: a.default, controller: "UpdatesInstallationRebootController", controllerAs: "updatesInstallationReboot", link: function(e, t) { function n() { e.$destroy() } function r() { t && (t.off("$destroy", n), t.empty(), t.remove(), t = null) } e.$on("$destroy", r), t.on("$destroy", n) } } }); t.nvUpdatesInstallationReboot = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdatesInstallerDialogInstallationComplete = void 0; var o = n(10), i = n(890), a = r(i), s = o.ngUpdatesModule.directive("nvUpdatesInstallerDialogInstallationComplete", [function() { return { restrict: "E", template: a.default } }]); t.nvUpdatesInstallerDialogInstallationComplete = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.ngUpdatesModule = void 0; var o = n(10), i = n(891), a = r(i); o.ngUpdatesModule.directive("nvUpdatesInstallerDialogInstallationError", [function() { return { restrict: "E", template: a.default } }]), t.ngUpdatesModule = o.ngUpdatesModule }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.updatesInstallerDialogController = void 0; var r = n(10), o = r.ngUpdatesModule.controller("UpdatesInstallerDialogController", ["updatesInstallerDialogService", "cefService", "$scope", function(e, t, n) { var r = this; r.model = e.getDialogModel(), t.enableCloseButton(!1), r.showTitleContainer = function() { return !(!r.model.title() && !r.model.subtitle()) }, r.showActionContainer = function() { return !(!r.model.button2() && !r.model.button1()) }, r.refreshDialogData = function() { r.model = e.getDialogModel() }, e.refreshDialogDataRegister(r.refreshDialogData), n.$on("$destroy", function() { t.enableCloseButton(!0) }) }]); t.updatesInstallerDialogController = o }, function(e, t, n) { "use strict"; function r(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.updatesInstallerDialogService = void 0; var o = n(3), i = r(o), a = n(10); n(11), n(630), n(631), n(625), n(629), n(627), n(634); var s = a.ngUpdatesModule.service("updatesInstallerDialogService", ["$mdDialog", "$rootElement", "INSTALLER_PAGE", "eventAggregator", "INSTALLER_EVENTS", "$log", "INSTALLER_ACTION", "INSTALLER_FORM_EVENT", "RESPONSE_TO_INSTALLER", "dbService", "DB_NAMES", "DRIVER_INSTALLATION_FAILED_CONSTRAINT", "$filter", "INSTALLER_ERROR_CODE", "DRIVERTYPE", function(e, t, n, r, o, a, s, l, c, u, d, f, m, p, g) { function v(e) { return b.preset().html('').details(_.name).isExpressInstall(e).driverType(_.isCRD).driverVersion(_.version) } function h(e) { var t; switch (e) { case s.ACTION_CANCEL: case s.ACTION_RESTART_LATER: case s.ACTION_CLOSE: t = c.ACTION_CANCEL; break; case s.ACTION_TRYAGAIN: case s.ACTION_INSTALL: case s.ACTION_RESTART_NOW: case s.ACTION_NEXT: t = c.ACTION_NEXT; break; default: t = c.ACTION_CANCEL } return t } function y(e) { var t = ""; if (e && e.constraintFailText && e.constraintFailText[0] && (t = e.constraintFailText[0], e.failedConstraintId && e.failedConstraintId[0])) { var n = i.findWhere(f, { failedConstraintId: e.failedConstraintId[0] }); if (null != n) if ("SetupNeedsDiskSpaceCheck" === e.failedConstraintId[0]) { t = e.constraintFailText[0]; var r = e.constraintFailText[0].match(/\d+/g); r = r ? r.join(".") : ""; var o = t.substring(t.lastIndexOf("(") - 1, t.lastIndexOf(")") + 1), a = m("translate"); t = a(n.constrainTextId, { value: r, drive: o }) } else t = n.constrainTextId } return t } function E(e, t, n, i) { return b.preset().title(_.name).html('').details(t).bullets(Array.isArray(i) ? i : []).showBullets(Array.isArray(i) && i.length > 0).button1({ text: e, action: function() { b.cancel(), b.sendResponseToInstaller(b.installerStatus, s.ACTION_CANCEL), r.trigger(o.INSTALL_CANCEL) } }).icon("warning").subtitle("l10n.installationCanNotContinue").showLink(n) } var b = this, S = {}; b.packages = []; var _, w = !1, A = !1, T = !1, I = a.getInstance("main.updates/updatesInstallerDialogService"), C = function() { function e(e) { t[e] = function(r) { return null != r ? (n[e] = r, t) : n[e] } } var t = this, n = {}; e("showLink"), e("html"), e("title"), e("icon"), e("subtitle"), e("details"), e("button1"), e("button2"), e("installablePackagesData"), e("isExpressInstall"), e("showBullets"), e("bullets"), e("driverType"), e("driverVersion") }; b.show = function(n) { e.show({ template: '', parent: t.find("nv-window"), escapeToClose: !1 }), b.setDialogModel(n), r.trigger(o.INSTALL_STARTED) }, b.cancel = function(t) { I.info("updates installer dialogue cancelled"), e.cancel(), w = !1, A = !1, b.unsubScribeDriverInstallationNotification() }, b.setDialogModel = function(e) { S = e, b.refreshDialogData() }, b.getDialogModel = function() { return S }, b.preset = function() { return new C }, b.rebootSystem = function() { var e = { isCustomInstall: w, version: _.version, name: _.name, downloadStatus: _.downloadStatus, isCRD: _.isCRD }; u.getGlobalStore(d.GLOBAL_STORE).setItem(d.DRIVER_INSTALL_STATE, e).then(function() { I.debug("persist driver installation entry in database", e), b.sendResponseToInstaller(b.installerStatus, s.ACTION_RESTART_NOW) }) }, b.showInstallationForm = function(e, t, n) { T = !1, w = t, A = n, _ = e, b.show(v(!0)) }; var x = null; b.sendResponseToInstaller = function(e, t) { var n = {}; n = i.extend(n, e), n.nextAction = h(t), I.debug("send response to installer", n), "function" == typeof x && x(n) }, b.showInstallerForm = function(e) { if (b.installerStatus = e, e.method === l.SHOW_FORM) { var t; switch (e.form) { case n.NVIFORM_PRE_INSTALL_CHECK: b.sendResponseToInstaller(e, s.ACTION_NEXT); break; case n.NVIFORM_INSTALL_INITIAL: case n.NVIFORM_INSTALL_CHECKING: case n.NVIFORM_EULA: case n.NVIFORM_INSTALL_CHECK_WARNINGS: case n.NVIFORM_PRE_REBOOT_INSTALL: var r = b.getDialogModel(); r && r.html && r.html().indexOf("nv-updates-installation-progress") != -1 || (I.debug("show progress dialog"), b.setDialogModel(v(!0))), b.updateRefreshInstalling(!0), b.sendResponseToInstaller(e, s.ACTION_INSTALL); break; case n.NVIFORM_INSTALL_REMOVE_PROGRESS: b.updateRefreshInstalling(!1); break; case n.NVIFORM_INSTALL_PROGRESS: b.setProgressTitle(""), b.updateRefreshInstalling(!1), b.updateIsInstalling(!0); break; case n.NVIFORM_INSTALL_FINISHED_NO_SUMMARY: b.showInstallationComplete(); break; case n.NVIFORM_INSTALL_FINISHED: b.showInstallationCompleteWithSummary(e.packages); break; case n.NVIFORM_INSTALL_CHECK_WAIT: t = !(!e.failedConstraintId || "AllowInstallCheck" !== e.failedConstraintId[0]), b.showInstallationCanNotStartWithCancelBtn(y(e), t), b.sendResponseToInstaller(e, s.ACTION_NEXT); break; case n.NVIPROP_CUSTOM_INSTALL: b.showCustomInstallSelect(e.packages, e.cleanInstall); break; case n.NVIFORM_INSTALL_REMOVE_REBOOT: b.showInstallationContinueRebootRequired(); break; case n.NVIFORM_INSTALL_FAILED: b.showInstallationFail(e.packages); break; case n.NVIFORM_INSTALL_REBOOT: b.showInstallationRebootWithSummary(e.packages); break; case n.NVIFORM_INSTALL_CHECK_FAILED: t = !(!e.failedConstraintId || "AllowInstallCheck" !== e.failedConstraintId[0]), b.showInstallationCanNotStartWithCloseBtn(y(e), t); break; case n.NVIFORM_PRE_INSTALL_CHECK_RETRY: t = !(!e.failedConstraintId || "AllowInstallCheck" !== e.failedConstraintId[0]), b.showInstallationCanNotContinueWithTryAgainBtn(y(e), !1, t); break; case n.NVIFORM_INSTALL_START_FAILED: A = (A !== !0 || p.NV_INSTALLER_RESUME_CANCLE !== e.errorCode || !_ || !_.downloadStatus) && A, b.showInstallationCanNotContinueWithTryAgainBtn(e.constraintFailText[0], !0, !1, e.bullets); break; default: I.debug("un-handled installer forms", e) } } else b.setProgressTitle(e.progressTitle), b.updateInstallProgress(e.currentProgress, e.totalProgress); return !0 }; var M = null, D = null, O = null, R = null, N = null, L = null, P = null, k = null; b.updateRefreshInstallingRegister = function(e) { M = e }, b.unsubScribeDriverInstallationNotificationRegister = function(e) { k = e }, b.updateProgressTitleRegister = function(e) { D = e }, b.updateProgressSetTotalRegister = function(e) { O = e }, b.updateIsInstallingRegister = function(e) { R = e }, b.refreshDialogDataRegister = function(e) { N = e }, b.setSendResponseToInstallerRegister = function(e) { x = e }, b.setInvokeInstallationCallbackRegister = function(e) { L = e }, b.getUserSelectedCustomDetailsRegister = function(e) { P = e }, b.updateRefreshInstalling = function(e) { "function" == typeof M && M(e) }, b.unsubScribeDriverInstallationNotification = function() { "function" == typeof k && k() }, b.setProgressTitle = function(e) { "function" == typeof D && D(e) }, b.updateInstallProgress = function(e, t) { "function" == typeof O && O(e, t) }, b.updateIsInstalling = function(e) { "function" == typeof R && R(e) }, b.refreshDialogData = function() { "function" == typeof N && N() }, b.updateUserSelectedCustomDetails = function() { if ("function" == typeof P) { var e = P(); i.isNull(e) || 2 !== e.length || (b.installerStatus.packages = e[1], b.installerStatus.cleanInstall = e[0], T = e[0]) } }, b.showInstallationComplete = function() { b.setDialogModel(b.preset().title(_.name).html('').details("l10n.installationComplete").button1({ text: "l10n.close", action: function() { b.cancel(); var e = { isCleanInstallSelected: T, isGRDInstalled: _.isCRD !== g.CRD }; I.info("Installation complete ", e), r.trigger(o.INSTALL_DONE, e), b.sendResponseToInstaller(b.installerStatus, s.ACTION_CLOSE) } })) }, b.showInstallationCanNotContinueWithTryAgainBtn = function(e, t, n, r) { b.setDialogModel(E("l10n.close", e, n, r).button2({ text: "l10n.tryAgain", action: function() { b.setDialogModel(v(!0)), t ? "function" == typeof L ? L(_, w, A) : I.error("setInvokeInstallationCallback is not a function") : b.sendResponseToInstaller(b.installerStatus, s.ACTION_TRYAGAIN) } })) }, b.showCustomInstallSelect = function(e, t) { var n = []; n.push(!0), n.push(e), n.push(t), T = t, b.setDialogModel(b.preset().title(_.name).html(' ').subtitle("l10n.installationOption").button1({ text: "l10n.install", action: function() { b.setDialogModel(v(!1)), b.updateUserSelectedCustomDetails(), b.sendResponseToInstaller(b.installerStatus, s.ACTION_INSTALL) } }).button2({ text: "l10n.cancel", action: function() { b.cancel(), b.sendResponseToInstaller(b.installerStatus, s.ACTION_CANCEL), r.trigger(o.INSTALL_CANCEL) } }).installablePackagesData(n)) }, b.showInstallationCompleteWithSummary = function(e) { var t = []; t.push(!1), t.push(e), t.push(!0), b.setDialogModel(b.preset().title(_.name).html(' ').subtitle("l10n.installationHasFinished").button1({ text: "l10n.close", action: function() { b.cancel(); var e = { isCleanInstallSelected: T, isGRDInstalled: _.isCRD !== g.CRD }; I.info("Installation complete with summary ", e), r.trigger(o.INSTALL_DONE, e), b.sendResponseToInstaller(b.installerStatus, s.ACTION_CLOSE) } }).installablePackagesData(t).icon("check")) }, b.showInstallationFail = function(e) { var t = []; t.push(!1), t.push(e), t.push(!1), b.setDialogModel(b.preset().title(_.name).icon("error").html(' ').subtitle("l10n.installationFail").button1({ text: "l10n.close", action: function() { b.cancel(), b.sendResponseToInstaller(b.installerStatus, s.ACTION_CLOSE), r.trigger(o.INSTALL_CANCEL) } }).installablePackagesData(t)) }, b.showInstallationRebootWithSummary = function(e) { var t = []; t.push(!1), t.push(e), t.push(!0), b.setDialogModel(b.preset().title(_.name).icon("warning").html(' ').subtitle("l10n.installationCompleteRestart").button1({ text: "l10n.restartNow", action: function() { b.cancel(), b.sendResponseToInstaller(b.installerStatus, s.ACTION_RESTART_NOW) } }).button2({ text: "l10n.restartLater", action: function() { b.sendResponseToInstaller(b.installerStatus, s.ACTION_CANCEL), b.cancel(), r.trigger(o.INSTALL_CANCEL) } }).installablePackagesData(t)) }, b.showInstallationContinueRebootRequired = function() { b.setDialogModel(b.preset().title(_.name).html('').button1({ text: "l10n.restartNow", action: function() { b.cancel(), b.rebootSystem() } })) }, b.showInstallationCanNotStartWithCloseBtn = function(e, t) { b.setDialogModel(E("l10n.close", e, t)) }, b.showInstallationCanNotStartWithCancelBtn = function(e, t) { b.setDialogModel(E("l10n.cancel", e, t)) } }]); t.updatesInstallerDialogService = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdatesInstallerDialog = void 0; var o = n(10); n(163); var i = n(892), a = r(i); n(632); var s = o.ngUpdatesModule.directive("nvUpdatesInstallerDialog", function() { return { restrict: "E", scope: { subview: "@" }, template: a.default, controller: "UpdatesInstallerDialogController", controllerAs: "updatesInstallerDialog", link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvUpdatesInstallerDialog = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.updatesNotificationsController = void 0; var r = n(10); n(141); var o = r.ngUpdatesModule.controller("UpdatesNotificationsController", ["$log", "$state", "updatesService", "TASK_STATUS", "CHECK_FOR_UPDATE", function(e, t, n, r, o) { function i() { n.getInstalledDriver().then(function(e) { s.installedDriver = e }).catch(function(e) { l.error("getInstalledDriver failed: " + e) }) } function a() { s.updatesList = null, s.driverUpdatesCount = 0, n.getUpdateDetails().then(function(e) { s.updatesList = e, s.driverUpdatesCount = s.updatesList ? s.updatesList.length : 0 }).catch(function(e) { l.error("getUpdates failed: " + e) }) } var s = this; s.updatesList = [], s.installedDriver = null, s.driverUpdatesCount = 0, s.taskStatus = r, s.checkForUpdate = o; var l = e.getInstance("main.updates/UpdatesNotificationsController"); s.launchUpdateTab = function(e) { t.go("main.auth.updates", { updateState: e }) }, s.isDownloadStarted = function(e) { return e === r.TASK_PAUSED || e === r.TASK_RUNNING }, s.progressBarValue = function(e) { return e.downloadStatus ? e.downloadStatus.bytesDone / e.downloadStatus.totalBytes * 100 : 0 }, s.refreshUI = function() { i(), a() }, i(), n.checkForUpdates(), n.setUpdatesListener(s.refreshUI) }]); t.updatesNotificationsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUpdatesNotification = void 0; var o = n(10); n(276), n(308), n(307); var i = n(894), a = r(i); n(635); var s = o.ngUpdatesModule.directive("nvUpdatesNotification", function() { return { restrict: "E", scope: {}, template: a.default, controller: "UpdatesNotificationsController", controllerAs: "updatesNotifications", link: function(e, t) { function n() { t.empty(), t.remove(), t = null } e.$on("$destroy", n), t.on("$destroy", function() { e.$destroy() }) } } }); t.nvUpdatesNotification = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.editBadgesController = void 0; var o = n(35), i = r(o), a = n(8); n(381); var s = a.ngUserProfileModule.controller("EditBadgesController", ["$scope", "$log", "$mdDialog", "gfeService", "telemetryService", "eventAggregator", "PROFILE_EVENTS", "TELEMETRY_AFFINITY_ACTION", "TELEMETRY_AFFINITY_ELEMENT", "TELEMETRY_CRIMSON_EVENT_NAMES", function(e, t, n, r, o, a, s, l, c, u) { function d(e) { g.groupedAchievements.title.id === e.id && (g.groupedAchievements.title.isFeatured = null, e.isFeatured = null, g.groupedAchievements.title = { id: null }) } function f(e) { E && e.id !== g.groupedAchievements.title.id && (d(g.groupedAchievements.title), e.isFeatured = !0, g.groupedAchievements.title = e) } function m(e) { var t = { shown: [], hidden: [], pending: [], locked: [], unlocked: [], all: [], title: { id: null } }; return e.forEach(function(e) { e = (0, i.default)({}, e), e.isUnlocked ? t.unlocked.push(e) : t.locked.push(e), "shown" === e.visibility ? t.shown.push(e) : "hidden" === e.visibility ? t.hidden.push(e) : t.pending.push(e), e.isFeatured && (t.title = e), t.all.push(e) }), t } function p() { g.groupedAchievements = m(g.achievements), g.groupedAchievements.shown.length > 0 ? g.showcase = g.groupedAchievements.shown : g.groupedAchievements.hidden.length > 0 ? g.showcase = [] : g.showcase = _.first(_.sortBy(g.groupedAchievements.unlocked, "earnedStampMicro"), 5), g.showcase.forEach(function(e) { return e.inShowcase = !0 }); var e = _.sortBy(g.groupedAchievements.unlocked, "title"), t = _.sortBy(g.groupedAchievements.locked, "title"); g.groupedAchievements.all = e.concat(t), null !== g.groupedAchievements.title.id && (E = !0) } var g = this, v = null, h = !1, y = !1, E = !1; t.getInstance("main.userProfile/editBadgesController"); g.showcase = [], g.groupedAchievements = {}, g.afterDragStarted = function(e) { return !!v && v.id === e.id }, g.onDragStart = function() { return function(t, n, r) { r.isDragging = !0, v = r, e.$apply() } }, g.onDragEnd = function() { return function(t, n, r) { r.isDragging = !1, v = null, e.$apply() } }, g.onDrop = function() { return function(t, n, r, o) { var i = n.data("dragData"); i.isDropping = !1; for (var a = 0; a < g.showcase.length; a++) g.showcase[a].id === v.id ? g.showcase[a] = i : g.showcase[a].id === i.id && (g.showcase[a] = v); v = null, e.$apply() } }, g.onDragLeave = function() { return function(t, n, r, o) { var i = n.data("dragData"); o.id != i.id && (i.isDropping = !1, e.$apply()) } }, g.onDragOver = function() { return function(t, n, r, o) { var i = n.data("dragData"); o.id !== i.id && (i.isDropping = !0, e.$apply()) } }, g.mouseDown = function(e) { e.isDragging = !0 }, g.mouseUp = function(e) { e.isDragging = !1 }, g.save = function() { n.hide(); var e = g.showcase.map(function(e) { return e.id }), t = g.currentShowcase.map(function(e) { return e.id }); if (g.groupedAchievements.title.inShowcase === !1 && d(g.groupedAchievements.title), h = !_.isEqual(e, t), y = g.titleBadge.id !== g.groupedAchievements.title.id, y || h) { var r = { badgesChanged: h, showcase: g.showcase, titleChanged: y, titleBadge: g.groupedAchievements.title }; a.trigger(s.BADGES_UPDATED, r) } }, g.cancel = function() { n.cancel() }, g.isOnline = function() { return r.onlineState.online }, g.selectDisabled = function(e) { return !e.inShowcase && 5 === g.showcase.length }, g.toggleTitle = function(e, t) { e.stopPropagation(), t.isFeatured ? (d(t), E = !1) : (E = !0, f(t), o.push(u.USER_CUSTOMIZE_PROFILE, { customizedResource: c.USER_TITLE, action: l.BOOKMARKED, description: t.title ? t.title : "" })) }, g.achievementSelectChanged = function(e) { e.inShowcase && g.showcase.push(e), g.showcase = g.showcase.filter(function(e) { return e.inShowcase }) }, p() }]); t.editBadgesController = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.editUserDescriptionController = void 0; var r = n(8), o = r.ngUserProfileModule.controller("EditUserDescriptionController", ["$log", "mdPanelRef", function(e, t) { var n = this; e.getInstance("main.userProfile/editUserDescriptionController"); n.isValidDescription = function() { return !!n.nvDescription && (n.nvDescription.trim().length > 0 && n.nvDescription.trim().length <= 250) }, n.commitUpdate = function() { t.close().then(function() { n.isValidDescription() && n.nvUpdateDescription(n.nvDescription.trim()), t.destroy() }) }, n.cancelUpdate = function() { t.close().then(function() { t.destroy() }) } }]); t.editUserDescriptionController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.featuredRewardController = void 0; var o = n(244), i = r(o), a = n(8), s = n(903), l = r(s); n(649); var c = a.ngUserProfileModule.controller("FeaturedRewardController", ["$scope", "$log", "$filter", "$mdDialog", "$state", "cevoService", "gfeService", "toastService", "eventAggregator", "telemetryService", "USER_PROFILE_EVENTS", "SWEEPSTAKE_EVENTS", "USER_PROFILE_DIALOG_NAMES", "PROFILE_EVENTS", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_AFFINITY_ELEMENT", "TELEMETRY_AFFINITY_ACTION", "TELEMETRY_STATUS", "TELEMETRY_SCREENS", "USER_PROFILE_ERRORS", function(e, t, n, r, o, a, s, c, u, d, f, m, p, g, v, h, y, E, b, S) { function w(e) { e && e.errorType == S.CURRENT_GIVEAWAY_EXPIRED && (G = !0) } function A(e) { e && e.name === p.SWEEPSTAKES_DIALOG && (R.openSweepstakesDialog(), e.name = null, e.id = null) } function T(e) { d.push(v.USER_AFFINITY_EMPTY_STATE, { action: y.LOAD_VIEW, useCase: h.SWEEPSTAKE, status: E.FAILURE, currentScreen: b.SCREEN_WIDGET, additionalMessage: e.toString().substring(0, 1024) }) } function I(e) { R.tokensEntered = e.tokensEntered, R.tokensAvailable = e.availableTokens, N = e.timestamp } function C(e) { R.tokensAvailable = e.rewardTokens } function x(e) { _.isEmpty(e) || (R.giveaway = k, R.giveawayEntryDetails = e, R.tokensAvailable = +e.tokenBalance, R.giveawayEntryDetails.tokens && (N = +R.giveawayEntryDetails.enteredStampMicro, R.tokensEntered = R.giveawayEntryDetails.tokens), A(o.params.showDialog)) } function M(e) { k = e[0]; try { R.previewArtwork = k.assets.preview.file.url } catch (e) { R.previewArtwork = "#", L.error("exception while getting image", e.message, k) } return a.getGiveawayEntryDetails(k.id).then(x).catch(function(e) { L.error("getGiveawayEntryDetails failed", e), T(e) }) } function D() { a.getCurrentGiveaway().then(M).catch(function(e) { L.error("getCurrentGiveaway failed", e), T(e), w(e) }).finally(function() { P = !1 }), u.on(f.OPEN_DIALOG, A), u.on(f.EXTENDED_PROFILE_REFRESH, C), u.on(m.TOKENS_ENTERED_CHANGED, I), u.on(g.CURRENT_GIVEAWAY_REFRESHED, M), u.on(g.GIVEAWAY_ENTRY_DETAILS_REFRESHED, x) } function O() { u.off(f.OPEN_DIALOG, A), u.off(f.EXTENDED_PROFILE_REFRESH, C), u.off(m.TOKENS_ENTERED_CHANGED, I), u.off(g.CURRENT_GIVEAWAY_REFRESHED, M), u.off(g.GIVEAWAY_ENTRY_DETAILS_REFRESHED, x) } var R = this, N = null, L = t.getInstance("main.userProfile/FeaturedRewardController"), P = !0, k = null, G = !1; R.tokensAvailable = null, R.tokensEntered = 0, R.giveaway = null, R.giveawayEntryDetails = null, R.STATE = { NORMAL: "normal", ERROR: "error", EXPIRED: "expired" }, R.refreshGiveaway = function(e) { L.info("Countdown ended with state-" + e + ". Refreshing..."), a.getCurrentGiveaway(!0).catch(function(e) { R.giveaway = null, R.giveawayEntryDetails = null, w(e) }) }, R.openSweepstakesDialog = function() { var e; return s.onlineState.online ? (d.push(v.USER_AFFINITY_READ_MORE, { action: y.READ_INFO, useCase: h.SWEEPSTAKE, description: R.giveaway && R.giveaway.title ? R.giveaway.title : "" }), void r.show((e = { template: l.default, controller: "SweepstakesDialogController", controllerAs: "sweepstakeCtrl", bindToController: !0, disableParentScroll: !0 }, (0, i.default)(e, "bindToController", !0), (0, i.default)(e, "locals", { giveaway: R.giveaway, tokens: { available: R.tokensAvailable || 0, entered: R.tokensEntered || 0 } }), e))) : (L.error("Offline. Ignoring sweepstake open request"), void c.showOffline()) }, R.updatedMoment = function() { return n("convertUTCToTimeAgo")(N) }, R.tokensNotEntered = function() { return !P && 0 === R.tokensEntered }, R.tokensAlreadyEntered = function() { return !P && R.tokensEntered > 0 }, R.tokensEnteredStr = function() { return 1 === R.tokensEntered ? "l10n.tokenEntered" : "l10n.tokensEntered" }, R.getCurrentState = function() { return R.giveaway && R.giveawayEntryDetails ? R.STATE.NORMAL : G ? R.STATE.EXPIRED : R.STATE.ERROR }, e.$on("$destroy", O), D() }]); t.featuredRewardController = c }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvFeaturedReward = void 0; var o = n(8); n(639); var i = n(897), a = r(i); n(279), n(41); var s = o.ngUserProfileModule.component("nvFeaturedReward", { controller: "FeaturedRewardController", controllerAs: "featuredRewardCtrl", template: a.default }); t.nvFeaturedReward = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.levelDetailsController = void 0; var r = n(8), o = r.ngUserProfileModule.controller("LevelDetailsController", ["$log", "$filter", function(e, t) { function n() { r.nvLevel.ubound = +r.nvLevel.ubound, r.nvLevel.lbound = +r.nvLevel.lbound, 0 === r.nvLevel.lbound ? r.xpRangeString = t("translate")("l10n.uptoXp", { value: r.nvLevel.ubound }) : 99999999 === r.nvLevel.ubound ? r.xpRangeString = t("translate")("l10n.xpMax", { number: r.nvLevel.lbound }) : r.xpRangeString = t("translate")("l10n.xpRange", { lower: r.nvLevel.lbound, upper: r.nvLevel.ubound }) } var r = this; e.getInstance("main.userProfile/levelDetailsController"); r.xpRangeString = "-", n() }]); t.levelDetailsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvLevelDetails = void 0; var o = n(8), i = n(898), a = r(i); n(641); var s = o.ngUserProfileModule.component("nvLevelDetails", { bindings: { nvLevel: "=", nvUserLevel: "=", nvHideProgress: "<" }, template: a.default, controller: "LevelDetailsController", controllerAs: "levelDetails" }); t.nvLevelDetails = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.levelsDialogController = void 0; var o = n(244), i = r(o), a = n(8); n(642); var s = a.ngUserProfileModule.controller("LevelsDialogController", ["$log", "$mdDialog", "LEVELS", function(e, t, n) { var r, o = this, a = (e.getInstance("main.userProfile/LevelsDialogController"), r = {}, (0, i.default)(r, n.SILVER, ["l10n.tokensPerWeekOne"]), (0, i.default)(r, n.GOLD, ["l10n.tokensPerWeekThree"]), (0, i.default)(r, n.TITANIUM, ["l10n.tokensPerWeekEight"]), r); o.maxLevel = n.MAX_LEVEL, o.nvLevels.forEach(function(e) { _.isEmpty(e.perks) && (e.perks = a[e.level]) }), 1 === o.nvUserLevel.rewardTokens ? o.tokenString = "l10n.tokenCount" : o.tokenString = "l10n.tokensCount", o.closeDialog = function() { t.cancel() } }]); t.levelsDialogController = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.missionDetailsController = void 0; var r = n(8), o = r.ngUserProfileModule.controller("MissionDetailsController", ["$mdDialog", "telemetryService", "MISSION_TYPE", "MISSION_CONSTANTS", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_AFFINITY_ACTION", "TELEMETRY_AFFINITY_ELEMENT", "TELEMETRY_STATUS", "TELEMETRY_SCREENS", function(e, t, n, r, o, i, a, s, l) { var c = this, u = 400; c.isCollapsed = !1, c.showCta = !_.isEmpty(c.mission.cta), c.missionExpires = function() { return c.mission.missionType === n.FEATURED_MISSION || c.mission.repeatable === r.TRUE }, c.closeDialog = function() { e.cancel() }, c.ctaClicked = function() { var e = a.MISSION; c.mission.missionType === n.FEATURED_MISSION && (e = a.FEATURED_MISSION), t.push(o.USER_AFFINITY_CTA_CLICKED, { action: i.CALL_TO_ACTION, useCase: e, status: s.SUCCESS, currentScreen: l.SCREEN_MISSIONS, additionalMessage: c.mission.id.toString() }), c.closeDialog() }, c.collapseToggle = _.debounce(function() { c.isCollapsed = !c.isCollapsed }, u, !0) }]); t.missionDetailsController = o }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.missionProgressController = void 0; var r = n(8), o = r.ngUserProfileModule.controller("MissionProgressController", ["MISSION_TYPE", function(e) { function t() { var e = o.nvMission.completionStatus.mission.tokensEarned, t = +o.nvMission.tokens, n = e / t; return n + "/" + i } function n() { var e = o.nvMission.completionStatus.mission.xpEarned, t = +o.nvMission.xp, n = e / t; return n + "/" + i } function r() { o.isCompleted = 1 == o.nvMission.completionStatus.mission.isComplete, o.nvMission.missionType === e.TOKEN_MISSION ? (o.icon = "icon-ranking-token", o.missionValue = o.nvMission.tokens, o.getProgress = t) : (o.icon = "icon-ranking-XP", o.missionValue = o.nvMission.xp, o.getProgress = n) } var o = this, i = +o.nvMission.repeatNumber; o.showProgress = i > 1, o.getProgress = angular.noop, r() }]); t.missionProgressController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvMissionProgress = void 0; var o = n(8), i = n(901), a = r(i); n(645); var s = o.ngUserProfileModule.component("nvMissionProgress", { bindings: { nvMission: "=" }, controller: "MissionProgressController", controllerAs: "missionProgressCtrl", template: a.default }); t.nvMissionProgress = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.missionTileController = void 0; var o = n(8); n(644); var i = n(900), a = r(i), s = o.ngUserProfileModule.controller("MissionTileController", ["$scope", "$state", "$mdDialog", "telemetryService", "eventAggregator", "MISSION_TYPE", "USER_PROFILE_EVENTS", "USER_PROFILE_DIALOG_NAMES", "TELEMETRY_AFFINITY_ACTION", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_AFFINITY_ELEMENT", function(e, t, n, r, o, i, s, l, c, u, d) { function f(e) { e && e.name === l.MISSION_DETAILS_DIALOG && e.id === g.nvMission.id && (g.showDetails(), e.name = null, e.id = null) } function m() { g.isFeatured = g.nvMission.missionType === i.FEATURED_MISSION, v = g.isFeatured ? d.FEATURED_MISSION : d.MISSION, g.isFeatured && (f(t.params.showDialog), o.on(s.OPEN_DIALOG, f)) } function p() { g.isFeatured && o.off(s.OPEN_DIALOG, f) } var g = this, v = null; g.showDetails = function(e) { n.show({ template: a.default, controller: "MissionDetailsController", controllerAs: "missionDetailsCtrl", bindToController: !0, disableParentScroll: !0, locals: { mission: g.nvMission } }), r.push(u.USER_AFFINITY_READ_MORE, { action: c.READ_INFO, useCase: v, description: g.nvMission.name }) }, e.$on("$destroy", p), m() }]); t.missionTileController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvMissionTile = void 0; var o = n(8), i = n(902), a = r(i); n(647), n(646), n(331); var s = o.ngUserProfileModule.component("nvMissionTile", { bindings: { nvMission: "=" }, controller: "MissionTileController", controllerAs: "missionTileCtrl", template: a.default }); t.nvMissionTile = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.sweepstakesDialogController = void 0; var r = n(8); n(163), n(279), n(41), n(207); var o = r.ngUserProfileModule.controller("SweepstakesDialogController", ["$scope", "$log", "$mdDialog", "$timeout", "$filter", "cevoService", "gfeService", "eventAggregator", "telemetryService", "SWEEPSTAKE_EVENTS", "SWEEPSTAKE_DIALOG_STATES", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_AFFINITY_ELEMENT", "TELEMETRY_AFFINITY_ACTION", "rewardsService", "TELEMETRY_STATUS", "TELEMETRY_SCREENS", function(e, t, n, r, o, i, a, s, l, c, u, d, f, m, p, g, v) { function h() { I.remainingTokens = I.availableTokens - (I.tokensEntered - C) } function y() { h(), I.validInput = I.tokensEntered > I.minRequiredTokens && I.remainingTokens >= 0, I.sweepstakeForm.tokens.$setValidity("required", I.validInput) } function E(e, t) { I.messageOverlayVisible = !0, I.overlayState = e, t && S() } function b() { x && (r.cancel(x), x = null) } function S() { return x || (x = r(function() { I.messageOverlayVisible = !1, b() }, L)), x } function _(e) { E(u.OVERLAY_SUCCESS, !0), M = +e.updatedStampMicro, I.tokensEntered = +e.tokens, I.availableTokens = +e.tokenBalance, I.giveaway.tokensEntered = e.giveawayTokens, I.termsAlreadyAgreed = !0, I.tokensEnteredViewState = u.REVIEW_STAKES, s.trigger(c.TOKENS_ENTERED_CHANGED, { tokensEntered: I.tokensEntered, availableTokens: I.availableTokens, timestamp: +e.enteredStampMicro }) } function w(e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : D; R.error("addTokensToGiveaway failed", e), I.errorMessage = t, E(u.OVERLAY_ERROR, !0) } function A() { i.getCurrentGiveaway().then(function(e) { I.giveaway = e[0] }).catch(function(e) { R.error("getCurrentGiveaway failed", e) }); try { I.boxArt = I.giveaway.assets.hero.file.url } catch (e) { I.boxArt = "#", R.error("exception while getting image", e.message, I.giveaway) } I.agreeToElementHtml = "" + o("translate")("l10n.agreeToRules") + "", I.availableTokens = I.tokens.available, I.tokens.entered > 0 && (I.tncAgreed = !0, I.termsAlreadyAgreed = !0, C = I.tokens.entered, I.minRequiredTokens = I.tokens.entered, I.tokensEntered = I.minRequiredTokens), h() } function T() { b() } var I = this, C = 0, x = null, M = null, D = o("translate")("l10n.errorSubmittingTokens"), O = o("translate")("l10n.errorTryAgain"), R = t.getInstance("main.userProfile/sweepstakesDialogController"), N = 3, L = 2500; I.dialogState = u.GIVEAWAY_DETAILS, I.overlayState = u.OVERLAY_LOADING, I.tokensEnteredViewState = u.EDIT_STAKES, I.tncAgreed = !1, I.boxArt = null, I.validInput = !0, I.minRequiredTokens = 0, I.tokensInputMax = Math.pow(10, N) - 1, I.tokensInputMin = 0, I.tokensEntered = 0, I.messageOverlayVisible = !1, I.termsAlreadyAgreed = !1, I.sweepstakeForm = {}, I.closeDialog = function() { return n.cancel() }, I.tokensSubmitMoment = function() { return o("convertUTCToTimeAgo")(M) }, I.goBack = function(e) { I.dialogState = u.GIVEAWAY_DETAILS }, I.showRules = function(e) { l.push(d.USER_AFFINITY_READ_MORE, { action: m.READ_OFFICIAL_RULES, useCase: f.SWEEPSTAKE, description: I.giveaway && I.giveaway.title ? I.giveaway.title : "" }), I.dialogState = u.OFFICIAL_RULES }, I.isOnline = function() { return a.onlineState.online }, I.showRemainingTokens = function() { return I.validInput }, I.showInvalidTokensError = function() { return !I.validInput }, I.increaseButtonDisabled = function() { return I.remainingTokens <= 0 }, I.decreaseButtonDisabled = function() { return I.tokensEntered <= I.minRequiredTokens }, I.submitDisabled = function() { return !I.tncAgreed || !I.validInput || !I.isOnline() || I.availableTokens <= 0 }, I.tncCheckboxDisabled = function() { return !I.isOnline() || I.availableTokens <= 0 }, I.increaseTokens = function() { I.tokensEntered += 1, y() }, I.decreaseTokens = function() { I.tokensEntered -= 1, y() }, I.tokensInputKeypress = function(e) { ["+", "-", "e", ".", "enter"].includes(e.key.toLowerCase()) ? e.preventDefault() : e.currentTarget.value.length >= N && e.preventDefault() }, I.tokensInputDisabled = function() { return I.availableTokens <= 0 }, I.tokensInputBlur = y, I.tokensRemainingStr = function() { return 0 === I.availableTokens ? "l10n.noTokensAvailable" : 1 === I.remainingTokens ? "l10n.tokenRemaining" : "l10n.tokensRemaining" }, I.tokensEnteredSuccessStr = function() { return 1 === I.tokensEntered ? "l10n.tokenEnteredSuccessfully" : "l10n.tokensEnteredSuccessfully" }, I.inputErrorStr = function() { return 0 === I.tokensEntered ? "l10n.errorOneOrMoreTokens" : I.tokensEntered > 0 && I.tokensEntered <= I.minRequiredTokens ? "l10n.errorAddMoreTokens" : I.tokensEntered > I.remainingTokens ? "l10n.errorTooManyTokens" : void 0 }, I.submitTokens = function() { y(), I.validInput && (E(u.OVERLAY_LOADING, !1), I.giveaway.deltaTokens = I.tokensEntered - C, p.trySweepstakeEntry(I.giveaway).then(function(e) { if (e.success) { var t = "GPU Sweepstake entry success"; _(e), l.push(d.USER_ENTER_SWEEPSTAKE_SUCCESS, { action: m.ENTERED, useCase: f.SWEEPSTAKE, status: g.SUCCESS, currentScreen: v.SCREEN_SWEEPSTAKE, additionalMessage: t }) } else w(e, e.errorMessage || O), l.push(d.USER_ENTER_SWEEPSTAKE_FAILURE, { action: m.ENTERED, useCase: f.SWEEPSTAKE, status: g.ENTRYRESTRICTED, currentScreen: v.SCREEN_SWEEPSTAKE, additionalMessage: e.errorMessage || e.errorDetails || "" }) })) }, I.addMoreTokens = function() { I.minRequiredTokens = I.tokensEntered, C = I.tokensEntered, h(), I.tokensEnteredViewState = u.EDIT_STAKES }, I.reviewDone = I.closeDialog, e.$on("$destroy", T), A() }]); t.sweepstakesDialogController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.userAchievementsController = void 0; var o = n(35), i = r(o), a = n(8), s = n(895), l = r(s); n(637); var c = a.ngUserProfileModule.controller("UserAchievementsController", ["$scope", "$state", "$log", "$mdDialog", "$q", "$filter", "cevoService", "eventAggregator", "telemetryService", "toastService", "PROFILE_EVENTS", "USER_PROFILE_DIALOG_NAMES", "USER_PROFILE_EVENTS", "TELEMETRY_AFFINITY_ACTION", "TELEMETRY_AFFINITY_ELEMENT", "TELEMETRY_CRIMSON_EVENT_NAMES", function(e, t, n, r, o, a, s, c, u, d, f, m, p, g, v, h) { function y(e) { e && e.name === m.BADGES_DIALOG && (I.viewAll(), e.name = null, e.id = null) } function E(e) { d.showError({ textContent: a("translate")(e) }) } function b(e, t) { return s.setAchievementsTitle(e.id).then(function(e) { C.info("successfully updated title", e) }).catch(function(e) { C.error("failed to update title", e), I.titleBadge = t, E("l10n.errorUserTitle") }) } function S(e, t, n) { var r = e.map(function(e) { return e.id }); return s.setBadges(r).then(function(e) { C.info("successfully updated badges", e), e.forEach(function(e) { return e.isUnlocked = !0 }); var t = I.achievements.filter(function(e) { return !e.isUnlocked }); I.achievements = e.concat(t) }).catch(function(e) { return C.error("failed to update badges with error", e), I.showcase = t, I.titleBadge = n, E("l10n.errorAchievements"), o.reject() }) } function w(e) { var t = I.showcase, n = I.titleBadge; return I.showcase = e.showcase, I.titleBadge = e.titleBadge, I.viewAllDisabled = !0, o.when().then(function(r) { if (e.badgesChanged) return S(e.showcase, t, n) }).then(function() { if (e.titleChanged) return b(e.titleBadge, n) }).catch(function() { C.info("subsequent request cancelled") }).finally(function() { I.viewAllDisabled = !1, t = null, n = null }) } function A(e) { var n = { shown: [], hidden: [], pending: [] }; I.achievements = e, I.unlocked = I.achievements.filter(function(e) { return e.isUnlocked }), n = (0, i.default)(n, _.groupBy(I.achievements, "visibility")), n.shown.length > 0 ? I.showcase = n.shown : n.hidden.length > 0 ? I.showcase = [] : I.showcase = _.first(_.sortBy(I.unlocked, "earnedStampMicro"), 5), I.titleBadge = _.find(I.showcase, function(e) { return e.isFeatured }) || M, y(t.params.showDialog) } function T() { s.getAllUserAchievements().then(A).catch(function(e) { C.error("get all user achievements failed", e), E("l10n.someInfoMissing") }), c.on(p.OPEN_DIALOG, y), c.on(f.BADGES_UPDATED, w), c.on(f.ALL_USER_ACHIEVEMENTS_REFRESHED, A) } var I = this, C = n.getInstance("main.userProfile/userAchievementsController"), x = 0, M = { id: null }; I.viewAllDisabled = !1, I.achievements = void 0, I.placeholderList = [1, 2, 3], I.viewAll = function() { return I.viewAllDisabled ? void C.info("information is being updated...") : (u.push(h.USER_AFFINITY_READ_MORE, { action: g.READ_INFO, useCase: v.ACHIEVEMENT, description: I.achievements && x > 0 ? "Number of achievements: " + x : "" }), void r.show({ clickOutsideToClose: !1, controller: "EditBadgesController", controllerAs: "editBadgesCtrl", template: l.default, locals: { currentShowcase: I.showcase, achievements: I.achievements, titleBadge: I.titleBadge }, bindToController: !0 })) }, I.loading = function() { return void 0 === I.achievements }, T(), e.$on("$destroy", function() { c.off(p.OPEN_DIALOG, y), c.off(f.BADGES_UPDATED, w), c.off(f.ALL_USER_ACHIEVEMENTS_REFRESHED, A) }) }]); t.userAchievementsController = c }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUserAchievements = void 0; var o = n(8), i = n(904), a = r(i); n(650); var s = o.ngUserProfileModule.component("nvUserAchievements", { controller: "UserAchievementsController", controllerAs: "userAchievements", template: a.default }); t.nvUserAchievements = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.userActivityLogController = void 0; var o = n(8), i = n(199), a = r(i), s = o.ngUserProfileModule.controller("UserActivityLogController", ["$scope", "$log", "$filter", "cevoService", "preferencesService", "eventAggregator", "telemetryService", "COMMON_EVENTS", "PROFILE_EVENTS", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_AFFINITY_ACTION", "TELEMETRY_AFFINITY_ELEMENT", "TELEMETRY_STATUS", "TELEMETRY_SCREENS", function(e, t, n, r, o, i, s, l, c, u, d, f, m, p) { function g(e) { s.push(u.USER_AFFINITY_EMPTY_STATE, { action: d.LOAD_VIEW, useCase: f.ACTIVITY_LOG, status: m.FAILURE, currentScreen: p.SCREEN_ACTIVITY_LOG, additionalMessage: e.toString().substring(0, 1024) }) } function v() { return o.getShareRunningStatus().then(function(e) { O = e }).catch(function(e) { O = !1, R.error("getShareRunningStatus failed.") }) } function h() { x = !0, o.isShareFeatureSupportedOnSystem().then(function(e) { if (D = e) return v() }).catch(function(e) { R.error("isShareFeatureSupported failed", e), g("Failed to get share supported information"), D = !1 }).finally(function() { x = !1 }) } function y(e) { return 0 === e ? n("translate")("l10n.today") : 1 === e ? n("translate")("l10n.yesterday") : (0, a.default)().subtract(e, "days").format("dddd, MMMM DD") } function E(e) { var t = (0, a.default)().startOf("day"); return _.groupBy(e, function(e) { var n = (0, a.default)(+e.stampMicro).startOf("day"), r = a.default.duration(t.diff(n)).asDays(); return C[r.toString()] = y(r), r.toString() }) } function b(e) { try { I.activityLog = E(e.data.data.activity) } catch (e) { R.error("Failed to get activities", e.message), g(e.message.substring(0, 1024)) } } function S() { M = !0, r.getActivityLog().then(b).catch(function(e) { R.error("getActivityLog failed", e), g(e.toString().substring(0, 1024)) }).finally(function() { M = !1 }) } function w() { return x || M } function A() { S(), h(), i.on(l.SHARE_STATUS_CHANGED, v), i.on(c.ACTIVITY_LOG_REFRESHED, b) } function T() { i.off(l.SHARE_STATUS_CHANGED, v), i.off(c.ACTIVITY_LOG_REFRESHED, b) } var I = this, C = {}, x = !1, M = !1, D = !1, O = !1, R = t.getInstance("main.userProfile/userActivityLogController"); I.activityItemLimitTo = 7, I.activityLog = null, I.headerDate = function(e) { return C[e] }, I.openOSCGallery = function() { s.push(u.ACTIVITY_LOG_VIEW_GALLERY), o.openOscGallery() }, I.shareDisabledFallback = function() { return !w() && !O }, I.shareReady = function() { return !w() && O }, I.shareSupported = function() { return !w() && D }, I.emptyState = function() { return !(w() || O && I.activityLog) }, I.activityMoment = function(e) { var t = new Date(+e.stampMicro); return n("convertUTCToTimeAgo")(t) }, I.showTokensEarned = function(e) { return e.tokens > 0 }, I.showXpEarned = function(e) { return e.xp > 0 }, A(), e.$on("$destroy", T) }]); t.userActivityLogController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUserActivityLog = void 0; var o = n(8), i = n(905), a = r(i); n(652), n(657); var s = o.ngUserProfileModule.component("nvUserActivityLog", { controller: "UserActivityLogController", controllerAs: "userActivityLog", template: a.default }); t.nvUserActivityLog = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.userGalleryDetailsController = void 0; var r = n(8), o = r.ngUserProfileModule.controller("UserGalleryDetailsController", ["$scope", "preferencesService", "navigationalDialogService", "eventAggregator", "NAVIGATIONAL_DIALOG_EVENTS", "GALLERY_TYPES", function(e, t, n, r, o, i) { function a() { c.mediaItem = n.getCurrentItem() } function s() { a(), r.on(o.CURRENT_ITEM_UPDATED, a) } function l() { r.off(o.CURRENT_ITEM_UPDATED, a) } var c = this; c.isVideo = function() { return c.mediaItem.file.type == i.VIDEO }, c.isImage = function() { return c.mediaItem.file.type == i.IMAGE }, c.upload = function() { t.openOscUpload(c.mediaItem) }, s(), e.$on("$destroy", l) }]); t.userGalleryDetailsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } function o(e) { if (e && e.__esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t } Object.defineProperty(t, "__esModule", { value: !0 }), t.userGalleryDetails = void 0; var i = n(3), a = (o(i), n(8)), s = n(906), l = r(s); n(654); var c = a.ngUserProfileModule.component("nvUserGalleryDetails", { template: l.default, controller: "UserGalleryDetailsController", controllerAs: "userGalleryDetails" }); t.userGalleryDetails = c }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.userGalleryController = void 0; var o = n(13), i = r(o), a = n(8); n(274), n(118); var s = a.ngUserProfileModule.controller("UserGalleryController", ["$log", "$q", "$scope", "eventAggregator", "galleryService", "gfeService", "nvSpCapsEndpoints", "COMMON_EVENTS", "TELEMETRY_AFFINITY_API_NAME", "TELEMETRY_ORIGINAL_SERVICE_NAME", "USER_PROFILE_EVENTS", "USER_PROFILE_TAB_NAMES", "GALLERY_SUBTYPES", "httpTelemetryService", function(e, t, n, r, o, a, s, l, c, u, d, f, m, p) { function g(e, t, n, r, o) { var i = u.LOCALHOST, s = n && n.config && n.config.url ? n.config.url : "", l = n && n.status ? n.status : 0; p.sendSdkHttpTelemetry(e, a.onlineState.online, "", r, l, s, o, i, t) } function v(e) { return e.subtype !== m.EXR } function h() { if (T) return T; o.thumbSizes = I; var e = new Date; return T = s.getRecordingPaths().catch(function(n) { e = new Date - e; var r = !!(n && n.status > 0); return g(r, c.GET_SHADOWPLAY_RECORDS_PATH, n, e, A), t.reject(n) }).then(function(t) { return e = new Date - e, (t.status < 200 || t.status >= 300) && t.data && (A = (0, i.default)(t.data)), g(!0, c.GET_SHADOWPLAY_RECORDS_PATH, t, e, A), o.setRecordingPaths(t.data) }).then(function() { return o.getRecentFiles() }).then(function() { return o.checkCachedData() }).then(function() { S.recentlyCaptured = o.populatedRecentFilesFolder.slice(), S.recentlyCaptured = _.filter(o.populatedRecentFilesFolder, function(e) { return v(e.file) }) }).finally(function() { T = null }) } function y(e) { e === f.ACTIVITY_TAB ? (h(), r.on(l.WINDOW_FOCUS, h)) : r.off(l.WINDOW_FOCUS, h) } function E() { S.loading = !0, h().then(angular.noop).catch(function(e) { w.error("could not fetch recent items", e) }).finally(function() { S.loading = !1 }), o.active(!0), r.on(d.PROFILE_TAB_CHANGED, y) } function b() { r.off(d.PROFILE_TAB_CHANGED, y), r.off(l.WINDOW_FOCUS, h), o.active(!1) } var S = this, w = e.getInstance("main.userProfile/userGalleryController"), A = "", T = null, I = { width: 240, height: 135 }; S.recentlyCaptured = [], S.fallbackState = function() { return !S.loading && S.recentlyCaptured && !S.recentlyCaptured.length }, n.$on("$destroy", b), E() }]); t.userGalleryController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUserGallery = void 0; var o = n(8); n(656); var i = n(907), a = r(i); n(659), n(374); var s = o.ngUserProfileModule.component("nvUserGallery", { controller: "UserGalleryController", controllerAs: "userGallery", template: a.default }); t.nvUserGallery = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.userGalleryTileController = void 0; var r = n(8); n(655), n(367); var o = r.ngUserProfileModule.controller("UserGalleryTileController", ["$log", "navigationalDialogService", "GALLERY_AUDIOTYPES", "preferencesService", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "GALLERY_TYPES", function(e, t, n, r, o, i, a) { var s = this; e.getInstance("main.userProfile/userGalleryTileController"); s.Item = s.nvFile, s.List = s.nvFileList, s.previewMedia = function(e, n) { s.nvFile.file.type === a.VIDEO && o.push(i.ACTIVITY_LOG_LAUNCH_VIDEO), t.show("", { currentItem: s.Item, itemsList: s.List, parent: angular.element(document.querySelector("#DialogContainerParent")), class: "user-gallery-details-dialog" }) }, s.upload = function(e) { o.push(i.ACTIVITY_LOG_SHARE_CAPTURE), e.stopPropagation(), r.openOscUpload(s.nvFile) }, s.isFileMultiTrackAudio = function(e) { return e === n.SEPARATE } }]); t.userGalleryTileController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUserGalleryTile = void 0; var o = n(8); n(658); var i = n(908), a = r(i), s = o.ngUserProfileModule.component("nvUserGalleryTile", { bindings: { nvFile: "=", nvFileList: "=" }, controller: "UserGalleryTileController", controllerAs: "userGalleryTile", template: a.default }); t.nvUserGalleryTile = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.userMissionsController = void 0; var r = n(8), o = r.ngUserProfileModule.controller("UserMissionsController", ["$scope", "$log", "cevoService", "telemetryService", "eventAggregator", "PROFILE_EVENTS", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_AFFINITY_ELEMENT", "TELEMETRY_AFFINITY_ACTION", "TELEMETRY_STATUS", "TELEMETRY_SCREENS", function(e, t, n, r, o, i, a, s, l, c, u) { function d(e) { var t = (new Date).getTime(), n = {}; return t < e.startStampAdjusted ? (n.header = "l10n.featuredMissionStartCountdown", n.ts = e.startStampAdjusted) : t > e.endStampAdjusted ? (n.header = "l10n.featuredMissionEnded", n.ts = null) : (n.header = "l10n.featuredMissionEndCountdown", n.ts = e.endStampAdjusted), n } function f(e) { var t = d(e); g.featuredCtaHeader = t.header, g.featuredCtaTs = t.ts } function m(e) { v.info("getUserMissions refresh"), g.featuredMissions = e.featuredMissions, g.repeatableMissions = e.repeatableMissions, g.timelessMissions = e.timelessMissions; try { var t = e.featuredMissions[0], n = t.cta; _.isEmpty(n) || !n.startStampAdjusted ? (g.isFeaturedCtaMission = !1, g.featuredMissionEndTs = t.endStampAdjusted, g.ctaMission = null) : (g.isFeaturedCtaMission = !0, g.ctaMission = g.featuredMissions[0], f(n)) } catch (e) { v.error("failed to extract featured mission timestamp information") } try { g.weeklyMissionEndTs = e.repeatableMissions[0].endStampAdjusted } catch (e) { v.error("failed to extract weekly mission timestamp information") } h = !1 } function p() { n.getUserMissions().then(m).catch(function(e) { v.error("getUserMissions failed", e), h = !0, r.push(a.USER_AFFINITY_EMPTY_STATE, { action: l.LOAD_VIEW, useCase: s.MISSION, status: c.FAILURE, currentScreen: u.SCREEN_MISSIONS, additionalMessage: e.toString().substring(0, 1024) }) }), o.on(i.MISSIONS_REFRESHED, m) } var g = this, v = t.getInstance("main.userProfile/userMissionsController"), h = void 0; g.featuredCtaHeader = "", g.featuredCtaTs = 0, g.isFeaturedCtaMission = !1, g.ctaMission = null, g.refreshMission = function(e) { v.info("Countdown ended with state-" + e + ". Refreshing..."), n.getUserMissions(!0) }, g.emptyState = function() { return h }, g.featuredCtaMissionActive = function() { return g.isFeaturedCtaMission && !!g.featuredCtaTs }, g.featuredCtaMissionEnded = function() { return g.isFeaturedCtaMission && !g.featuredCtaTs }, g.ctaStateChanged = function(e) { v.info("CTA countdown ended with state-" + e), f(g.ctaMission.cta), g.featuredCtaTs || g.refreshMission() }, p(), e.$on("$destroy", function() { o.off(i.MISSIONS_REFRESHED, m) }) }]); t.userMissionsController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUserMissions = void 0; var o = n(8), i = n(909), a = r(i); n(660), n(648); var s = o.ngUserProfileModule.component("nvUserMissions", { controller: "UserMissionsController", controllerAs: "userMissionsCtrl", template: a.default }); t.nvUserMissions = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.userProfileController = void 0; var o = n(8); n(120), n(306), n(31), n(303), n(638); var i = n(896), a = r(i); n(309); var s = n(314), l = r(s), c = o.ngUserProfileModule.controller("UserProfileController", ["$scope", "$document", "$log", "$mdDialog", "$mdPanel", "$state", "$timeout", "dbCacheService", "dialogService", "eventAggregator", "cevoService", "jarvisService", "rewardsService", "COMMON_EVENTS", "DB_NAMES", "USER_PROFILE_EVENTS", "telemetryService", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_AFFINITY_ELEMENT", "TELEMETRY_AFFINITY_ACTION", "USER_PROFILE_TAB_NAMES", "REWARDS_EVENTS", "IMAGE_UPDATE_STATE", "toastService", "$filter", function(e, t, n, r, o, i, s, c, u, d, f, m, p, g, v, h, y, E, b, S, w, A, T, I, C) { function x(e) { return F.profileTabs.findIndex(function(t) { return t.name === e }) } function M(e) { var t = -1, n = 0; return t = e.destination ? x(e.destination) : F.selectedTab, t < 0 ? void $.error("got invalid tab destination", e) : (F.selectedTab !== t && (s(function() { F.selectedTab = t }), n = W), void(_.isFunction(e.callback) && s(e.callback, n))) } function D(e) { V = e, V && p.triggerGpuAchievement() } function O(e, t, n) { if ($.error("onUpdate got error", e.error), e.error.status !== -1 && e.error.status !== -100) { var r = ""; try { r = e.error.data.errors.global[0].message } catch (e) { r = C("translate")("l10n.errorTryAgain") } I.show({ textContentUseTranslate: r, icon: "error", button: { text: C("translate")("l10n.tryAnother"), action: function() { y.push(n), t() } } }) } } function R(e) { I.cancel(), O(e, F.updateAvatar, E.TOAST_CLICKED_REUPLOAD_AVATAR) } function N(e) { I.cancel(), O(e, F.updateCover, E.TOAST_CLICKED_REUPLOAD_COVER) } function L(e) { B && (I.cancel(), B = !1, I.show({ icon: "check_circle", textContent: C("translate")("l10n.verificationSuccessfull") })) } function P(e) { z && (I.cancel(), z = !1, I.show({ icon: "check_circle", textContent: C("translate")("l10n.verificationSuccessfull") })) } function k() { p.getRewardsEnabled().then(D), F.profileDetail.avatar = c.getCachedUserItem(U.userId, v.CEVO_GFE_STORE, v.AVATAR), F.profileDetail.displayName = U.core.displayName, F.profileDetail.description = c.getCachedUserItem(U.userId, v.JARVIS_COMMON_STORE, v.PERSONALIZATION), F.profileDetail.coverImageUrl = c.getCachedUserItem(U.userId, v.CEVO_GFE_STORE, v.COVER), f.refresh(), d.on(h.SWITCH_TAB, M), d.on(g.WINDOW_FOCUS, f.refresh), d.on(A.FEATURE_STATUS_UPDATED, D), d.on(T.AVATAR_UPDATE_FAILED, R), d.on(T.COVER_UPDATE_FAILED, N), d.on(T.AVATAR_UPDATE_SUCCESSFULL, L), d.on(T.COVER_UPDATE_SUCCESSFULL, P) } function G() { d.off(h.SWITCH_TAB, M), d.off(g.WINDOW_FOCUS, f.refresh), d.off(A.FEATURE_STATUS_UPDATED, D), d.off(T.AVATAR_UPDATE_FAILED, R), d.off(T.COVER_UPDATE_FAILED, N), d.off(T.AVATAR_UPDATE_SUCCESSFULL, L), d.off(T.COVER_UPDATE_SUCCESSFULL, P), I.cancel() } var F = this, U = m.getLoggedInUser(), V = !1, z = !1, B = !1, $ = n.getInstance("main.userProfile/userProfileController"), W = 500, H = { name: w.DEFAULT_TAB, isVisible: function() { return f.getFeatureEnabled("missions") }, header: "l10n.missions", directive: "", active: i.params.startWithTab === w.DEFAULT_TAB }, j = { name: w.ACTIVITY_TAB, isVisible: function() { return f.getFeatureEnabled("activityLog") }, header: "l10n.activityFeed", directive: "", telemetryTarconId: E.VIEW_ACTIVITY_LOG, active: i.params.startWithTab === w.ACTIVITY_TAB }, Y = { name: w.REWARDS_TAB, isVisible: function() { return V }, header: "l10n.myRewards", directive: "", telemetryTarconId: E.VIEW_MY_REWARDS, active: i.params.startWithTab === w.REWARDS_TAB }, q = 7e3, K = { w: 1280, h: 400 }; F.isAvatarMouseHover = !1, F.isCoverMouseHover = !1, F.isDescriptionMouseHover = !1, F.profileDetail = {}, F.selectedTab = 0, F.profileTabs = [H, j, Y], F.updateAvatar = function() { return f.getAvatarUploadInProgress() ? (I.showProgress({ textContent: C("translate")("l10n.verificationOfUploadInProgress") }), void(B = !0)) : void u.show("nv-edit-avatar") }, F.getFeatureEnabled = f.getFeatureEnabled, F.updateCoverImage = function(e) { $.info("Saving profile cover image"), F.profileDetail.coverImageUrl.url = e, F.profileDetail.coverImageUrl.persist_(), $.info("Saving profile cover image done") }, F.isEditCoverButtonVisible = function() { return F.isCoverMouseHover && !F.isAvatarMouseHover && !F.isDescriptionMouseHover }, F.updateCover = function() { return f.getCoverUploadInProgress() ? (I.showProgress({ textContent: C("translate")("l10n.verificationOfUploadInProgress") }), void(z = !0)) : r.show({ controller: "EditProfileCoverController", controllerAs: "editProfileCover", template: l.default, bindToController: !0, locals: { title: "l10n.uploadProfileCover", subTitle: C("translate")("l10n.minimumRequiredSize", K), showRecentlyCaptured: !0, image: F.profileDetail.coverImageUrl.url, updateImageCallback: F.updateCoverImage, dialogClass: "edit-profile-cover-container", outputFormat: { maxSize: { w: 2400, h: 1200 }, minSize: K } }, escapeToClose: !0, disableParentScroll: !0 }) }, F.updateDescription = function(e) { F.profileDetail.description.bio = { value: e, ts: Date.now() }, F.profileDetail.description.persist_(), y.push(E.USER_CUSTOMIZE_PROFILE, { customizedResource: b.BIO_DESCRIPTION, action: S.UPDATED, description: e }), s(function() { f.refresh() }, q) }, F.editUserDescription = function(e) { var n = o.newPanelPosition().relativeTo(".desc-edit-button").addPanelPosition(o.xPosition.ALIGN_END, o.yPosition.BELOW); return o.open({ controller: "EditUserDescriptionController", controllerAs: "editUserDescription", locals: { nvDescription: F.profileDetail.description.bio.value, nvUpdateDescription: F.updateDescription }, template: a.default, attachTo: t[0].getElementById("panel-container"), position: n, hasBackdrop: !0, bindToController: !0 }) }, F.avatarMouseHover = function(e) { F.isAvatarMouseHover = e }, F.descriptionMouseHover = function(e) { F.isDescriptionMouseHover = e }, F.coverMouseHover = function(e) { F.isCoverMouseHover = e }, F.onTabChanged = function(e) { p.setRewardsTabSelected(e.name === w.REWARDS_TAB), d.trigger(h.PROFILE_TAB_CHANGED, e.name), e.telemetryTarconId && y.push(e.telemetryTarconId) }, F.refreshProfile = function() { f.refresh() }, e.$on("$destroy", G), k() }]); t.userProfileController = c }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUserProfile = void 0; var o = n(8); n(662); var i = n(910), a = r(i); n(667), n(665), n(640), n(669), n(653), n(661), n(651), n(671); var s = o.ngUserProfileModule.component("nvUserProfile", { controller: "UserProfileController", controllerAs: "userProfile", template: a.default }); t.nvUserProfile = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.userProfileStatusController = void 0; var o = n(35), i = r(o), a = n(8); n(643); var s = n(899), l = r(s); n(140); var c = a.ngUserProfileModule.controller("UserProfileStatusController", ["$scope", "$log", "$mdDialog", "cevoService", "eventAggregator", "telemetryService", "USER_PROFILE_EVENTS", "PROFILE_EVENTS", "SWEEPSTAKE_EVENTS", "LEVELS", "TELEMETRY_CRIMSON_EVENT_NAMES", "TELEMETRY_AFFINITY_ACTION", "TELEMETRY_AFFINITY_ELEMENT", "TELEMETRY_SCREENS", "TELEMETRY_STATUS", function(e, t, n, r, o, a, s, c, u, d, f, m, p, g, v) { function h(e, t, n) { return (e - t) / (n - t) } function y(e) { A.profileStatus.rewardTokens = e.availableTokens } function E(e) { A.profileStatus = e, A.profileStatus.progress = 100 * h(A.profileStatus.xp, A.profileStatus.xplevel.lbound, A.profileStatus.xplevel.ubound); var t = r.getLevelDetails(A.profileStatus.xplevel.level); A.profileStatus.levelIcon = t.icon, A.profileStatus.levelName = t.name, 1 == A.profileStatus.rewardTokens ? A.tokenString = "l10n.token" : A.tokenString = "l10n.tokens", T = !0 } function b(e) { try { var t = (0, i.default)({}, e.data.data.levels); A.levelsDescription = e.data.data.description, A.xpLevels = _.map(t, function(e, t) { var n = r.getLevelDetails(e.level); return (0, i.default)(e, { icon: n.icon, name: n.name, tokenValue: { value: e.tokensAwarded } }) }) } catch (t) { C.error("getXpLevel exception", t.message, e) } } function S() { r.getExtendedProfile().then(E).catch(function(e) { T = !1, a.push(f.USER_AFFINITY_EMPTY_STATE, { action: m.LOAD_VIEW, useCase: p.USER_PROFILE, status: v.FAILURE, currentScreen: g.SCREEN_WIDGET, additionalMessage: e.toString().substring(0, 1024) }) }).finally(function() { I = !1 }), r.getXpLevel().then(b).catch(function(e) { C.error("getXpLevels failed", e), a.push(f.USER_AFFINITY_EMPTY_STATE, { action: m.LOAD_VIEW, useCase: p.LEVEL, status: v.FAILURE, currentScreen: g.SCREEN_WIDGET, additionalMessage: e.toString().substring(0, 1024) }) }), o.on(u.TOKENS_ENTERED_CHANGED, y), o.on(s.EXTENDED_PROFILE_REFRESH, E), o.on(c.XP_LEVEL_REFRESHED, b) } function w() { o.off(u.TOKENS_ENTERED_CHANGED, y), o.off(s.EXTENDED_PROFILE_REFRESH, E), o.off(c.XP_LEVEL_REFRESHED, b) } var A = this, T = !1, I = !0, C = t.getInstance("main.userProfile/userProfileStatusController"); A.maxLevel = d.MAX_LEVEL, A.xpLevelProgress = 0, A.profileStatus = { xp: "─ ─", rewardTokens: "─ ─", xplevel: { name: "─ ─", lbound: "─ ─", ubound: "─ ─" } }, A.tokenString = "l10n.tokens", A.openLevelsDialog = function() { I || (a.push(f.USER_AFFINITY_READ_MORE, { action: m.READ_INFO, useCase: p.LEVEL, description: A.profileStatus.xplevel.name }), n.show({ template: l.default, locals: { nvUserLevel: A.profileStatus, nvLevels: A.xpLevels, description: A.levelsDescription }, autoWrap: !1, bindToController: !0, clickOutsideToClose: !0, controller: "LevelsDialogController", controllerAs: "levelsDialog" })) }, A.emptyState = function() { return !I && !T }, S(), e.$on("$destroy", w) }]); t.userProfileStatusController = c }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUserProfileStatus = void 0; var o = n(8); n(664); var i = n(911), a = r(i), s = o.ngUserProfileModule.component("nvUserProfileStatus", { controller: "UserProfileStatusController", controllerAs: "ctrl", template: a.default }); t.nvUserProfileStatus = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.userProfileSummaryController = void 0; var r = n(8), o = r.ngUserProfileModule.controller("UserProfileSummaryController", ["$log", "gamesService", "preferencesService", function(e, t, n) { function r() { n.getGameStreamFeature().then(function(e) { i.isGSSupported = "true" == e.overallState }) } function o() { r(), t.getCachedGames().then(function(e) { i.totalGamesCount = _.size(e), i.anselSupportedGamesCnt = "03", i.optimizedGamesCnt = t.optimizedGamesCount(e), i.gsSupportedGamesCount = _.size(_.filter(e, function(e) { return e.streamingSupported === !0 })) }).catch(function(e) { a.error("Error getting cached games!", e) }) } var i = this, a = e.getInstance("main.userProfile/userProfileSummaryController"); i.isGSSupported = !1, o() }]); t.userProfileSummaryController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUserProfileSummary = void 0; var o = n(8); n(666); var i = n(912), a = r(i), s = o.ngUserProfileModule.component("nvUserProfileSummary", { controller: "UserProfileSummaryController", controllerAs: "userProfileSummary", template: a.default }); t.nvUserProfileSummary = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.userRigController = void 0; var o = n(8); n(22), n(380), n(309); var i = n(314), a = r(i), s = o.ngUserProfileModule.controller("UserRigController", ["$scope", "$log", "$mdDialog", "hardwareService", "rigService", "dbCacheService", "jarvisService", "eventAggregator", "COMMON_EVENTS", "DB_NAMES", function(e, t, n, r, o, i, s, l, c, u) { function d(e) { return o.processSystemInfo(e).then(function(e) { y.systemInfoItems = e }) } function f(e) { E.info("sysinfo updated"), d(e).catch(function(e) { E.error("failed to update system info", e) }) } function m() { r.getSystemInfo().then(d).catch(function(e) { E.error("failed to init system info", e) }) } function p() { m(), h = s.getLoggedInUser(), v = i.getCachedUserItem(h.userId, u.CEVO_GFE_STORE, u.MY_RIG), y.rigCoverImageUrl = v.url, l.on(c.SYSTEMINFO_UPDATED, f) } function g() { l.off(c.SYSTEMINFO_UPDATED, f) } var v, h, y = this, E = t.getInstance("main.userProfile/userRigController"); y.updateRigCoverImage = function(e) { v.url = e, v.persist_(), v = i.getCachedUserItem(h.userId, u.CEVO_GFE_STORE, u.MY_RIG), y.rigCoverImageUrl = v.url }, y.updateRigCover = function() { var e = { w: 600, h: 400 }; return n.show({ controller: "EditProfileCoverController", controllerAs: "editProfileCover", template: a.default, bindToController: !0, locals: { title: "Upload Rig Cover", showRecentlyCaptured: !1, image: y.rigCoverImageUrl, updateImageCallback: y.updateRigCoverImage, dialogClass: "edit-rig-image-container", viewport: e, boundary: { w: e.w, h: e.h + 6 }, outputFormat: { maxSize: e, minSize: { w: 160, h: 160 } } }, escapeToClose: !0, disableParentScroll: !0 }) }, e.$on("$destroy", g), p() }]); t.userRigController = s }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvUserRig = void 0; var o = n(8); n(668); var i = n(913), a = r(i); n(140); var s = o.ngUserProfileModule.component("nvUserRig", { controller: "UserRigController", controllerAs: "userRig", template: a.default }); t.nvUserRig = s }, function(e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.winnersController = void 0; var r = n(8), o = r.ngUserProfileModule.controller("WinnersController", ["$log", "$window", function(e, t) { var n = this, r = e.getInstance("main.userProfile/WinnersController"), o = "https://www.nvidia.com/en-us/geforce/contests/winners/"; n.showWinners = function() { r.info("winners list url opened"), t.open(o) } }]); t.winnersController = o }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } Object.defineProperty(t, "__esModule", { value: !0 }), t.nvWinners = void 0; var o = n(8); n(670); var i = n(914), a = r(i), s = o.ngUserProfileModule.component("nvWinners", { controller: "WinnersController", controllerAs: "winnersCtrl", template: a.default }); t.nvWinners = s }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, 'input[type=range]{width:300px}ul[rn-carousel]{overflow:hidden;padding:0;white-space:nowrap;position:relative;-webkit-perspective:1000px;-ms-perspective:1000px;perspective:1000px;-ms-touch-action:pan-y;touch-action:pan-y}ul[rn-carousel]>li{color:#000;-webkit-backface-visibility:hidden;-ms-backface-visibility:hidden;backface-visibility:hidden;overflow:visible;vertical-align:top;position:absolute;left:0;right:0;white-space:normal;padding:0;margin:0;list-style-type:none;width:100%;height:100%;display:inline-block}ul[rn-carousel-buffered]>li{display:none}ul[rn-carousel-transition=hexagon]{overflow:visible}div.rn-carousel-indicator span{cursor:pointer;color:#666}div.rn-carousel-indicator span.active{color:#fff}.rn-carousel-control{-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out;font-size:2rem;position:absolute;top:40%;opacity:.75;cursor:pointer}.rn-carousel-control:hover{opacity:1}.rn-carousel-control.rn-carousel-control-prev{left:.5em}.rn-carousel-control.rn-carousel-control-prev:before{content:"<"}.rn-carousel-control.rn-carousel-control-next{right:.5em}.rn-carousel-control.rn-carousel-control-next:before{content:">"}', ""]) }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, ".croppie-container{width:100%;height:100%}.croppie-container .cr-image{z-index:-1;position:absolute;top:0;left:0;transform-origin:0 0;max-height:none;max-width:none}.croppie-container .cr-boundary{position:relative;overflow:hidden;margin:0 auto;z-index:1;width:100%;height:100%}.croppie-container .cr-viewport{position:absolute;border:2px solid #fff;margin:auto;top:0;bottom:0;right:0;left:0;box-shadow:0 0 2000px 2000px rgba(0,0,0,.5);z-index:0}.croppie-container .cr-original-image{display:none}.croppie-container .cr-vp-circle{border-radius:50%}.croppie-container .cr-overlay{z-index:1;position:absolute;cursor:move}.croppie-container .cr-slider-wrap{width:75%;margin:15px auto;text-align:center}.croppie-result{position:relative;overflow:hidden}.croppie-result img{position:absolute}.croppie-container .cr-image,.croppie-container .cr-overlay,.croppie-container .cr-viewport{-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}.cr-slider{-webkit-appearance:none;width:300px;max-width:100%}.cr-slider::-webkit-slider-runnable-track{width:100%;height:3px;background:rgba(0,0,0,.5);border:0;border-radius:3px}.cr-slider::-webkit-slider-thumb{-webkit-appearance:none;border:none;height:16px;width:16px;border-radius:50%;background:#ddd;margin-top:-6px}.cr-slider:focus{outline:0}.cr-slider::-moz-range-track{width:100%;height:3px;background:rgba(0,0,0,.5);border:0;border-radius:3px}.cr-slider::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#ddd;margin-top:-6px}.cr-slider:-moz-focusring{outline:#fff solid 1px;outline-offset:-1px}.cr-slider::-ms-track{width:100%;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}.cr-slider::-ms-fill-lower{background:rgba(0,0,0,.5);border-radius:10px}.cr-slider::-ms-fill-upper{background:rgba(0,0,0,.5);border-radius:10px}.cr-slider::-ms-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#ddd;margin-top:1px}.cr-slider:focus::-ms-fill-lower{background:rgba(0,0,0,.5)}.cr-slider:focus::-ms-fill-upper{background:rgba(0,0,0,.5)}.cr-rotate-controls{position:absolute;bottom:5px;left:5px;z-index:1}.cr-rotate-controls button{border:0;background:0 0}.cr-rotate-controls i:before{display:inline-block;font-style:normal;font-weight:900;font-size:22px}.cr-rotate-l i:before{content:'↺'}.cr-rotate-r i:before{content:'↻'}", ""]) }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, ".ui-splitbar-icon-down,.ui-splitbar-icon-up{border-left:.45em solid transparent;border-right:.45em solid transparent}.stretch{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto}.animate-row{-webkit-transition:top .8s cubic-bezier(0,1.05,0,1);-moz-transition:top .8s cubic-bezier(0,1.05,0,1);-ms-transition:top .8s cubic-bezier(0,1.05,0,1);-o-transition:top .8s cubic-bezier(0,1.05,0,1);transition:top .8s cubic-bezier(0,1.05,0,1)}.animate-column{-webkit-transition:left .8s cubic-bezier(0,1.05,0,1);-moz-transition:left .8s cubic-bezier(0,1.05,0,1);-ms-transition:left .8s cubic-bezier(0,1.05,0,1);-o-transition:left .8s cubic-bezier(0,1.05,0,1);transition:left .8s cubic-bezier(0,1.05,0,1)}.ui-splitbar{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:center;justify-content:center;background-color:#fff;right:auto;position:absolute;z-index:1}.ui-layout-row>.ui-splitbar{height:8px;width:100%;cursor:row-resize;text-align:center;justify-content:center;align-items:center;background:linear-gradient(to bottom,#fff 0,#eee 100%);overflow-y:hidden}.ui-layout-column>.ui-splitbar{width:8px;height:100%;cursor:col-resize;-webkit-flex-direction:column;flex-direction:column;background:linear-gradient(to right,#fff 0,#eee 100%);overflow-x:hidden}.ui-layout-column>.ui-splitbar>a,.ui-layout-row>.ui-splitbar>a{cursor:pointer;text-align:center;font-size:16px;color:#aaa}.ui-layout-column>.ui-splitbar>a:nth-child(2){margin-top:.35rem}.ui-layout-row>.ui-splitbar>a:nth-child(2){margin-left:.35rem}.ui-splitbar-icon{width:0;height:0;display:inline-block}.no-toggle .ui-splitbar-icon,.ui-layout-hidden{display:none}.ui-splitbar-icon-up{border-bottom:.45em solid}.ui-splitbar-icon-down{border-top:.45em solid;margin-right:.45em}.ui-splitbar-icon-left,.ui-splitbar-icon-right{border-top:.45em solid transparent;border-bottom:.45em solid transparent}.ui-splitbar-icon-right{border-left:.45em solid}.ui-splitbar-icon-left{border-right:.45em solid;margin-top:.45em}@media only screen and (max-device-width:480px){.no-mobile-toggle .ui-splitbar-icon{display:none}}@media print{.ui-splitbar{display:none}.stretch{position:relative}.stretch.ui-layout-container:last-child{position:static;overflow:visible}}", ""]) }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, "canvas{z-index:2}canvas.hidden{z-index:-1;visibility:hidden}.annotorious-annotationlayer{position:relative}.annotorious-opacity-fade{-moz-transition-property:opacity;-moz-transition-duration:.5s;-moz-transition-delay:0s;-webkit-transition-property:opacity;-webkit-transition-duration:.5s;-webkit-transition-delay:0s;-o-transition-property:opacity;-o-transition-duration:.5s;-o-transition-delay:0s;transition-property:opacity;transition-duration:.5s;transition-delay:0s}.annotorious-canvas{position:absolute;top:0;left:0}.annotorious-popup{line-height:135%;font-family:Arial,Verdana,Sans;font-size:12px;color:#000;background-color:#fff;border:1px solid #ccc;padding:9px 8px;word-wrap:break-word;width:180px;border-radius:3px;box-sizing:border-box;-moz-border-radius:3px;-webkit-border-radius:3px;-khtml-border-radius:3px;-moz-box-shadow:0 5px 15px #111;-webkit-box-shadow:0 5px 15px #111;box-shadow:0 5px 15px #111;-moz-transition-property:opacity;-moz-transition-duration:.5s;-moz-transition-delay:0s;-webkit-transition-property:opacity;-webkit-transition-duration:.5s;-webkit-transition-delay:0s;-o-transition-property:opacity;-o-transition-duration:.5s;-o-transition-delay:0s;transition-property:opacity;transition-duration:.5s;transition-delay:0s;position:absolute;z-index:1}.annotorious-popup-hide{opacity:0}.annotorious-popup-show{opacity:1}", ""]) }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, ".nv-croppie-slider{max-width:300px}.nv-croppie-slider .md-thumb:after{border-width:0}md-slider:not([md-discrete]):not([disabled]).md-active .md-slider-wrapper .md-thumb.nv-croppie-thumb{transform:scale(.8)}", ""]) }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, "", ""]) }, 677, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, ".nv-ui-tour-popup:focus{outline:0;display:block}.nv-ui-tour-popup-orphan{position:fixed;top:50%;left:50%;margin:0;transform:translateX(-50%) translateY(-50%)}.nv-ui-tour-popup.nv-popover.bottom-left>.arrow,.nv-ui-tour-popup.nv-popover.top-left>.arrow{left:25px}.nv-ui-tour-popup.nv-popover.bottom-right>.arrow,.nv-ui-tour-popup.nv-popover.top-right>.arrow{left:auto;right:25px}.nv-ui-tour-popup.nv-popover.left-top>.arrow,.nv-ui-tour-popup.nv-popover.right-top>.arrow{top:25px}.nv-ui-tour-popup.nv-popover.left-bottom>.arrow,.nv-ui-tour-popup.nv-popover.right-bottom>.arrow{top:auto;bottom:25px}.nv-popover{position:absolute;top:0;left:0;z-index:20!important;display:none;width:400px;max-width:400px;padding:1px;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#363636;-webkit-background-clip:padding-box;background-clip:padding-box;box-shadow:0 5px 10px rgba(0,0,0,.2)}.nv-popover-inner{min-width:400px;min-height:100px}.nv-popover.top{margin-top:-10px}.nv-popover.right{margin-left:10px}.nv-popover.bottom{margin-top:10px}.nv-popover.left{margin-left:-10px}.nv-popover-close-button{height:16px!important;width:16px!important;line-height:16px!important;font-size:16px!important;min-height:16px!important;min-width:16px!important}.nv-popover-content{padding:8px 16px}.nv-popover>.arrow,.nv-popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.nv-popover>.arrow{border-width:11px}.nv-popover>.arrow:after{content:'';border-width:10px}.nv-popover.bottom>.arrow:after,.nv-popover.left>.arrow:after,.nv-popover.right>.arrow:after,.nv-popover.top>.arrow:after{content:' '}.nv-popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#46505a;border-bottom-width:0}.nv-popover.top>.arrow:after{bottom:1px;margin-left:-10px;border-top-color:#46505a;border-bottom-width:0}.nv-popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#46505a;border-left-width:0}.nv-popover.right>.arrow:after{bottom:-10px;left:1px;border-right-color:#46505a;border-left-width:0}.nv-popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#46505a}.nv-popover.bottom>.arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#46505a}.nv-popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#46505a}.nv-popover.left>.arrow:after{right:1px;bottom:-10px;border-right-width:0;border-left-color:#46505a}.nv-popover-navigation{width:100%;height:52px}.nv-popover-step-indicator-container{padding:0 2px}.nv-popover-step-indicator{width:12px;height:4px}.ui-tour-backdrop{background-color:rgba(0,0,0,.5)}", ""]) }, , , , , function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, ".small-notification-height{height:100px}.small-notification-image-width{width:178px}.small-notification-details{max-width:230px}.big-notification-header,.small-notification-header{pointer-events:auto}.large-notification-height{height:361px}.large-notification-image-height{height:253px}.notification-badge-container{width:24px;height:24px;left:-2px;top:6px}.md-button.md-icon-button.notification-menu-button{width:36px;margin-right:8px;margin-left:-8px}.notifications-menu-width{width:456px}.notifications-menu-height{height:500px}.notifications-menu-left-outline-width{width:1px}.notification-color-bar-width{width:4px}.notifications-md-menu-content{max-width:456px!important;max-height:500px!important;box-shadow:3px 3px 16px 0 rgba(0,0,0,.8)}.notifications-md-menu-content .notification-direction{top:-13px}.notifications-md-menu-content .notifications-md-list md-divider{border-top-width:2px;border-top-color:#0e0e0e}.notifications-md-menu-content .notifications-md-list .notification-item:hover{background-color:rgba(255,255,255,.1)!important}.notifications-ellipsis{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;line-height:20px;max-height:40px;-webkit-line-clamp:2;-moz-box-orient:vertical;-ms-box-orient:vertical;-webkit-box-orient:vertical}", ""]) }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, "div.nv-custom-date-ctrl{padding-top:24px;padding-bottom:24px}div.nv-custom-date-ctrl h1{margin:0;padding-left:2px;font-size:12px;color:rgba(255,255,255,.45)!important}div.nv-custom-date-ctrl nv-date-field{padding-right:20px}div.nv-custom-date-ctrl nv-date-field input{border-bottom-color:#363636}div.nv-custom-date-ctrl input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;margin:0}div.nv-custom-date-ctrl nv-date-field md-select{width:auto;min-width:100px}div.nv-custom-date-ctrl .is-year-field{width:50px}div.nv-custom-date-ctrl .is-day-field{width:40px}div.nv-custom-date-ctrl nv-date-field label{text-transform:capitalize;color:rgba(255,255,255,.3)!important}div.nv-custom-date-ctrl nv-date-field md-select-value{text-transform:capitalize}div.nv-custom-date-ctrl nv-date-field .md-select-value{color:rgba(255,255,255,.45)}div.nv-custom-date-ctrl nv-date-field md-select.ng-valid .md-select-value,div.nv-custom-date-ctrl nv-date-field md-select.ng-valid.ng-pristine .md-select-value{color:#fff}div.nv-custom-date-ctrl nv-date-field md-select:not([disabled]):focus .md-select-value{border-bottom-color:#76b900!important}div.nv-custom-date-ctrl nv-date-field md-input-container.md-input-invalid .md-input:focus{border-bottom-color:#76b900}div.nv-custom-date-ctrl nv-date-field md-select.ng-invalid.ng-touched .md-select-value{border-color:#b5291c!important}div.nv-custom-date-ctrl nv-date-field md-select.ng-invalid .md-select-value,div.nv-custom-date-ctrl nv-date-field md-select.ng-invalid.ng-pristine .md-select-value{color:rgba(255,255,255,.3)!important}div.nv-custom-date-ctrl .error-message{color:#b5291c}md-option{color:#ccc!important}div.nv-custom-date-ctrl nv-date-field md-input-container{padding:0}", ""]) }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, ".oobe-dialog,.oobe-oauth-login-pane{-webkit-backface-visibility:hidden;-webkit-user-drag:none}.oobe-dialog{width:790px;height:498px;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.oobe-dialog .title{padding-top:24px;position:relative}.oobe-dialog .title h1{margin:0 24px;font-family:Roboto-Light;font-size:24px;font-weight:300;-webkit-font-smoothing:antialiased;color:#fff;color:rgba(255,255,255,.9)}.oobe-dialog .subtitle{margin:8px 0 0 24px;font-size:10px;font-weight:400}.oobe-dialog form{position:relative}.oobe-dialog waiting-overlay{position:absolute;min-width:100%;min-height:100%;background-color:rgba(14,14,14,.7);z-index:5}.oobe-oauth-blocker-overlay{position:fixed;width:100%;height:100%;top:0;left:0;z-index:1000}.oobe-link-icon{position:relative}.oobe-link-icon .md-button{height:auto}.oobe-link-icon .md-button>img{position:absolute;right:12px;width:20px;height:auto;top:42px}.oobe-link-icon md-card{background-color:transparent;box-shadow:none;margin:5px auto auto;width:54px}.oobe-link-icon md-card:hover{box-shadow:none}.oobe-link-icon p{text-align:center;font-size:10px;margin:0}.oobe-dialog-scan .text-bottom-margin{margin-bottom:0}.oobe-dialog-scan .scan-top-margin{margin-top:8px}.oobe-loading-data{padding-top:60px}.oobe-loading-data>md-progress-circular{margin-top:38px}.oobe-login-pointer{cursor:pointer}.oobe-dialog-logo-margin{margin-top:150px;margin-left:190px;margin-bottom:40px;padding-left:0}.oobe-welcome-dialog{font-family:Roboto-Light!important;-webkit-font-smoothing:antialiased}.oobe-welcome-dialog-header{height:64px}.oobe-welcome-dialog-header p{color:rgba(255,255,255,.45);margin:3px 24px 0}.oobe-welcome-dialog .md-actions{margin-bottom:2px}.oobe-welcome-card-holder{width:263px;height:329px;position:relative}.oobe-welcome-card-holder img{height:100%;width:100%}.oobe-welcome-card-holder .oobe-welcome-overlay{position:absolute;height:80px;background-image:url(" + n(702) + ");width:100%;bottom:0}.oobe-welcome-overlay .overlay-grouper{width:60%;margin-left:20%;height:100%;line-height:80px;text-align:center}.oobe-welcome-overlay .overlay-text{font-size:12px;color:rgba(255,255,255,.9);display:inline-block;vertical-align:middle;line-height:normal}.oobe-login-left-side{width:320px;height:497px;background-image:url(" + n(700) + ");bottom:0}.oobe-blocked-message,.oobe-side-text{width:100%;height:165px;color:rgba(255,255,255,.75);font-family:Roboto!important;-webkit-font-smoothing:antialiased}.oobe-side-text{font-size:16px}.oobe-side-text p{padding-left:140px;padding-right:50px}.oobe-blocked-message{font-size:18px;text-align:center}.oobe-blocked-message p{padding-left:60px;padding-right:60px}.oobe-blocked-link{color:rgba(255,255,255,.75);font-family:Roboto!important;-webkit-font-smoothing:antialiased}.oobe-dialog-left-pane{width:320px;height:497px;overflow:hidden}.oobe-dialog-left-pane img{width:100%;height:100%}.oobe-dialog-right-pane .title h1{margin-top:0}.oobe-dialog-right-pane .title .title-logo{position:absolute;top:18px;left:24px;width:48px;height:48px;font-size:48px;line-height:48px}.oobe-dialog-right-pane .title .title-logo+h1{padding-left:64px}.oobe-dialog-right-pane .title button{width:auto;padding:0;margin:0}.oobe-dialog-right-pane .title .title-close{margin:12px 24px 0 0}.oobe-dialog-right-pane .title .button-close{width:auto;height:24px;font-size:24px}.oobe-dialog-right-pane .secondary-title{font-size:12px;margin:44px 0 16px;color:#a9a9a9;color:rgba(255,255,255,.45)}.oobe-dialog-right-pane .secondary-title+.secondary-title{font-size:12px;margin:0 0 16px;color:#a9a9a9;color:rgba(255,255,255,.45)}.oobe-dialog-right-pane .title.large{min-height:96px}.oobe-dialog-right-pane .title.blank{min-height:60px}.oobe-dialog-right-pane .content{margin:24px 0 0;padding:0 24px}.oobe-dialog-right-pane .login-content{margin:0;padding:0 24px}.oobe-dialog-right-pane .message-banner{margin-top:24px;height:50px;line-height:50px;background-color:#303030;padding-left:24px;padding-right:24px;box-shadow:inset 0 8px 8px -10px #000,inset 0 -8px 8px -10px #000}.oobe-dialog-right-pane .message-banner span{display:inline-block;vertical-align:middle;line-height:normal;font-size:11px;color:#a9a9a9;color:rgba(255,255,255,.45)}.oobe-dialog-right-pane .md-actions{position:relative;padding:20px 8px 8px}.oobe-dialog-right-pane .md-actions button{margin:0}.oobe-dialog-right-pane .md-actions .button-helper{position:absolute;top:0;left:24px;font-size:11px;color:#a9a9a9;color:rgba(255,255,255,.45)}.oobe-dialog-right-pane .input-helper{font-size:11px;color:#a9a9a9;color:rgba(255,255,255,.45);padding-left:2px;padding-top:4px}.oobe-dialog-right-pane .login-button{padding:4px 4px 2px;margin-bottom:4px;position:relative}.oobe-dialog-right-pane .login-button img{width:318px;height:62px}.oobe-dialog-right-pane .login-button[disabled]{cursor:default;-webkit-filter:grayscale(100%) opacity(30%)}.oobe-dialog-right-pane .login-text{left:60px;position:absolute;font-size:18px;top:50%;width:250px;-ms-transform:translateY(-50%);-webkit-transform:translateY(-50%);transform:translateY(-50%)}.oobe-dialog-right-pane .login-button:not([disabled]):hover{background-color:rgba(55,90,162,.5)}.oobe-dialog-right-pane .login-button:not([disabled]):focus{background-color:rgba(55,90,162,.5);outline:0}.oobe-dialog-progress-bar{height:8px;position:absolute;width:100%;z-index:101;color:#363636!important;background:#363636!important}.oobe-dialog-progress-bar .md-accent.foreground{color:#76b900!important}.oobe-dialog-progress-bar .md-accent.background{background-color:#76b900!important}.oobe-dialog-done-pane-content{margin-top:152px}.oobe-dialog-done-first-text-margin{margin-top:24px;margin-bottom:16px}.oobe-dialog-done-second-text-margin{margin-top:0;margin-bottom:5px}.oobe-dialog-done-third-text-margin{margin-top:0;margin-bottom:0}.oobe-dialog-done-nogames-icon{opacity:.45}.oobe-dialog-done-scan-text-margin{margin-top:10px;margin-bottom:16px}.oobe-dialog-right-pane md-input-container.md-icon-right .md-errors-spacer+md-icon{margin-top:18px!important;color:#a9a9a9;color:rgba(255,255,255,.75)}.oobe-dialog-right-pane md-input-container+md-input-container.md-icon-right .md-errors-spacer+md-icon{margin-top:32px!important;color:#a9a9a9;color:rgba(255,255,255,.45)}.oobe-dialog-right-pane md-icon.icon-eye{line-height:20px;min-height:20px;min-width:20px}.oobe-dialog-right-pane md-checkbox.md-checked .md-icon:after{left:6.67px;top:2.22px}.oobe-dialog-right-pane md-input-container.md-input-invalid label{color:gray;color:rgba(255,255,255,.3)}.oobe-dialog-right-pane md-input-container+md-input-container{padding-top:18px}.oobe-dialog-right-pane nv-custom-date{padding-bottom:14px}.forgot-password{position:absolute;left:10px;padding-left:8px!important;padding-right:8px!important;margin-top:0!important}.oobe-dialog a.in-app-link{color:#76b900;text-decoration:none}.oobe-panel{box-shadow:0 7px 8px -4px rgba(0,0,0,.2),0 13px 19px 2px rgba(0,0,0,.14),0 5px 24px 4px rgba(0,0,0,.12)}.shadow-top{box-shadow:0 -10px 30px -5px rgba(0,0,0,.75)}.oobe-share-text-list{margin-top:0!important;padding-left:0!important}.oobe-done-qr-code{width:200px;height:320px;position:absolute;right:0;top:0;left:0;bottom:0;margin:auto}.oobe-done-qr-code-description{font-size:10px;margin-bottom:10px}.oobe-done-qr-code-scan{padding:10px;margin:0 0 12px}.oobe-oauth-login-pane{width:424px;height:608px}.oobe-oauth-login-image{background-image:url(" + n(699) + ")}.oobe-oauth-login-text{font-size:16px;height:144px;width:100%;display:flex;padding-left:144px;padding-right:48px;align-items:center;margin-top:10px;color:rgba(255,255,255,.75)}.oobe-oauth-login-top-filler{height:94px}.oobe-oauth-login-scrim{position:absolute;top:104px;height:452px;width:424px;background-color:rgba(0,0,0,.6)}.oobe-oauth-message-banner{margin:0 24px;background-color:#2e2e2e;padding:24px}", ""]); }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, ".preferences-sidebar-container button,.preferences-sidebar-container md-list-item .md-no-style.md-button{min-height:48px}#overlay,.preferences-shield-edit-dialog .image-container,.preferences-shield-edit-dialog .image-container md-icon,md-switch .md-container{cursor:pointer}.preferences-sidebar-container{width:186px}.preferences-sidebar-container .md-button-selected{background-color:#191919}.preferences-sidebar-container md-list-item .md-list-item-inner{padding-left:20px}.preferences-items-container{padding:24px 12px 0}.preferences-preference-section{padding:10px 16px 16px;margin:0 12px 24px}.preferences-share-overlay{width:calc(100% - 24px);left:12px;height:calc(100% - 24px)}.preferences-preference-section .margin-zero,.preferences-preference-section h3{margin:0}.preferences-preference-section h3.feature-title{margin:0 0 0 32px;font-weight:400}.preferences-preference-section h4{margin:0;font-weight:400;text-transform:uppercase}.preferences-preference-section h5{margin-top:11px;margin-bottom:0;font-weight:400}.preferences-preference-section .md-list-item-text p{margin:4px 0 0 32px;font-weight:400}.preferences-preference-section .scan-location-content .md-list-item-text p{margin:0}.preferences-preference-section .md-3-line p{margin-top:8px;margin-bottom:8px;margin-left:8px;font-weight:400}.preferences-preference-section .md-3-line md-icon,.preferences-preference-section .md-3-line svg{margin:8px 0 8px 48px;line-height:16px;height:16px;width:16px}.preferences-preference-section .preferences-feature-header-section{margin:24px 0 24px 32px}.preferences-preference-section .preferences-feature-description-section{padding:0 0 24px;margin:0}.preferences-preference-section .preferences-feature-description-section .preferences-feature-requirement{padding-left:64px;padding-right:16px;margin-bottom:16px}.preferences-preference-section .preferences-feature-description-section .preferences-feature-requirement .md-16{min-height:16px;min-width:16px;height:16px;width:16px;line-height:16px;font-size:16px!important}.preferences-preference-section .preferences-feature-description-section .preferences-feature-requirement .requirement-recommendation-icon-container{min-width:16px;min-height:16px}.preferences-preference-section .preferences-feature-description-section .preferences-feature-requirement .requirement-recommendation-icon-container .recommendation-circle{width:10px;height:10px;background-color:rgba(255,255,255,.45);border-radius:50%}.preferences-preference-section .preferences-feature-description-section .preferences-feature-requirement .feature-driver-update-button{min-width:120px}.preferences-preference-section .requirement-link-container{padding:8px 0 0;margin:0}.preferences-preference-section .top-margin-checkboxes{margin-bottom:16px}.preferences-preference-section .margin-mid-checkbox{margin-bottom:16px;margin-top:0}.preferences-preference-section md-switch{float:right;margin-top:-8px;margin-right:-8px;padding:0}.preferences-preference-section md-switch .md-thumb{height:16px;width:16px}.preferences-preference-section md-switch .md-bar{height:12px;width:27px;left:2px;top:4px}.preferences-preference-section md-checkbox{line-height:normal;margin:0;padding:4pt 0}.preferences-preference-section md-icon.feature-notready-overlay{margin-left:16px}.preferences-preference-section .feature-readiness-content{margin-left:-16px;margin-right:-16px}.preferences-preference-section .preferences-section-content .feature-readiness-content a{margin-left:32px}.preferences-preference-section .language-section p{line-height:36px}.preferences-preference-section .language-section md-input-container{margin-bottom:8px}.preferences-preference-section .language-section .md-select-value{flex-grow:0}.preferences-preference-section .language-section .language-section-button{display:inline-block;text-align:right}.preferences-preference-section .about-section img{width:170px;height:40px}.preferences-preference-section .about-section .gfe-version-container p{margin-left:0;margin-bottom:0}.preferences-preference-section .about-section .gfe-version-container{margin:20px 0 0}.preferences-preference-section .download-progress p{margin-left:0}.preferences-preference-section .about-section .margin-between-links{margin-top:8px}.preferences-preference-section .about-section .links-top-margin{margin-top:16px}.preferences-preference-section .about-section md-divider{border-top-color:#111}.preferences-preference-section .about-section md-divider.color-black-hue-2{border-top-color:#3a3a3a}.preferences-preference-section .about-section .title-content-top-margin{margin-top:2px}.preferences-preference-section .preferences-section-header,.preferences-preference-section .preferences-section-header-button,.preferences-preference-section .preferences-section-header-description,.preferences-preference-section .preferences-section-header-description-switch,.preferences-preference-section .preferences-section-header-switch{margin:0 0 12px}.preferences-preference-section .preferences-section-content{padding:8px 0 12px}.preferences-preference-section .preferences-about-section-content{padding:12px 0}.preferences-preference-section .preferences-section-header-description p,.preferences-preference-section .preferences-section-header-description-switch p{line-height:1.64;margin-top:8px;margin-bottom:-3.5px}.preferences-preference-section .preferences-section-header-description md-switch,.preferences-preference-section .preferences-section-header-description-switch md-switch,.preferences-preference-section .preferences-section-header-switch md-switch{margin-bottom:0}.preferences-accounts-edit-avatar .avatar-image{min-height:110px}.preferences-accounts-edit-avatar .avatar-image-error{height:150px}.preferences-accounts-edit-avatar .avatar-image-error p{width:60%;text-align:center}.preferences-accounts-edit-avatar .avatar-list-item{float:left}.preferences-system-info{padding-bottom:4px}.preferences-preference-section .preferences-system-info .margin-between-links{margin-bottom:12px}.preferences-preference-section .preferences-system-info .span-align-vertical{display:inline-block;vertical-align:middle;margin-left:5px}.preferences-preference-section .preferences-system-info .subitem-margin{margin-top:5px;margin-left:26px}.preferences-preference-section .feature-readiness-container .state-info-content-height,.preferences-preference-section .preferences-system-info .state-info-content-height{height:300px}.preferences-preference-section .language-section md-icon,.preferences-preference-section .preferences-system-info md-icon{min-height:18px;min-width:18px;height:18px;width:18px;line-height:18px;font-size:18px}.range-slider-left md-slider,.range-slider-right md-slider{min-width:0}.preferences-preference-section .preferences-section-content .games-scan-container{height:112px;margin-top:24px;margin-bottom:32px}.preferences-preference-section .preferences-section-content .games-scan-container h4:first-child{padding-top:10px}.preferences-preference-section .preferences-section-content .games-scan-container h4:nth-child(2){padding:16px 0}.preferences-preference-section .preferences-section-content .games-scan-divider{display:inline-block;width:1px;height:100%}.preferences-preference-section .preferences-section-content .scan-location-section{max-height:98px;height:98px}.preferences-preference-section .scan-location-content md-list{padding:0;height:98px}.preferences-preference-section .scan-location-content md-list-item{min-height:24px;height:24px}.preferences-preference-section .scan-location-content .scan-location-md-list-item-button .md-button{height:24px;min-height:11px;line-height:24px;text-align:left}.preferences-preference-section .scan-location-content md-list-item .md-list-item-inner{margin-right:0;min-height:24px;height:24px;padding:0}.preferences-preference-section .scan-location-content md-list-item p{padding-left:8px;padding-right:8px}.preferences-preference-section .preferences-section-content .accounts-section-button,.preferences-preference-section .preferences-section-content .language-section-button,.preferences-preference-section .preferences-section-content .scan-location-content-margin,.preferences-preference-section .preferences-section-content .shield-section-button{margin-left:-16px;margin-right:-16px;margin-top:16px;height:36px}.preferences-preference-section .share-section-button{height:36px;margin-bottom:-28px;margin-left:-16px;margin-right:-16px}.preferences-preference-section .preferences-section-content .accounts-section-button md-button,.preferences-preference-section .preferences-section-content .language-section-button .md-button,.preferences-preference-section .preferences-section-content .scan-location-content-margin .md-button,.preferences-preference-section .preferences-section-content .shield-section-button .md-button,.preferences-preference-section .share-section-button .md-button{margin:8px}.preferences-preference-section .scan-location-section button.md-no-style{background:0 0}.preferences-preference-section .scan-location-content .scan-location-md-list-item-button .md-button:hover{background-color:rgba(91,91,91,.5);box-shadow:0 4px 5px -2px rgba(0,0,0,.75)}.preferences-preference-section .preferences-md-icon .md-container{height:16px;width:16px}.preferences-preference-section .download-progress .md-container{height:3px;width:100%}.preferences-preference-section .download-details-status-container p{margin-top:6px;margin-bottom:0;margin-left:0}.preferences-preference-section .preferences-md-icon md-checkbox div{line-height:1.64}.preferences-preference-section .preferences-md-icon md-checkbox{min-height:16px;line-height:1.64;padding:0}.preferences-preference-section .preferences-md-icon .md-icon,.preferences-preference-section .preferences-md-icon md-icon,.preferences-preference-section .preferences-section-header-button md-icon{height:16px;width:16px;line-height:16px;font-size:16px}.preferences-preference-section .preferences-section-header-button .md-icon-button{min-height:16px;height:16px;width:16px;line-height:0;font-size:16px;margin-top:-4px;margin-right:-2px}.preferences-preference-section .preferences-md-icon .md-label{margin-left:22px}.preferences-preference-section .preferences-md-icon .external-link-icon{font-size:10px}.preferences-accounts-section .accounts-section-personal-info .md-errors-spacer{min-height:0}.preferences-accounts-section .accounts-section-avatar img{width:80px;height:80px;margin:0 24px 24px}.preferences-accounts-section .accounts-section-avatar img+p{padding-bottom:16px}.preferences-accounts-section .accounts-section-personalInfo p{margin-bottom:8px}.preferences-accounts-section .accounts-section-personalInfo .header{min-height:36px}.preferences-accounts-section .accounts-section-personalInfo input:disabled{background-image:none}.preferences-accounts-section .accounts-section-personalInfo .details-spacing,.preferences-accounts-section .accounts-section-personalInfo md-input-container{margin-bottom:16px}.preferences-accounts-section .accounts-section-personalInfo md-input-container .md-input{margin-bottom:0;margin-top:0;padding:0 0 8px;max-height:22px;line-height:12px}.preferences-accounts-section .accounts-section-security p{margin-bottom:8px}.preferences-accounts-section .accounts-section-security md-checkbox{margin-top:8px}.preferences-accounts-section .preferences-accounts-devices button{margin:0}.preferences-accounts-section .accounts-section-newsletter md-progress-circular{margin:0 auto}.preferences-shield-tile{margin:0 8px 8px 0}.preferences-shield-tile md-card-content:focus,.preferences-shield-tile:focus{outline:-webkit-focus-ring-color auto 5px;outline-color:transparent!important}.preferences-shield-tile .item-container .shield-tile-content-outline:focus,.preferences-shield-tile.shield-tile-content-outline md-card,.preferences-shield-tile.shield-tile-content-outline:focus md-card{outline:-webkit-focus-ring-color auto 5px;outline-color:#76b900!important}.preferences-shield-tile md-card:focus md-card-content,.preferences-shield-tile md-card:hover md-card-content{background-color:#414141!important}.preferences-shield-tile.shield-tile-content-outline md-card-content{background-color:#2d2d2d!important}.preferences-preference-section .shield-section h4{margin-bottom:8px}.preferences-preference-section .shield-section md-content{padding:1px 0 0 1px}.preferences-preference-section .shield-section .appcollector-content-height{height:357px}.preferences-preference-section .shield-section .empty-app-list{height:348px;border-style:solid;border-width:1px;border-color:#3c3c3c;margin-bottom:8px;width:100%}.preferences-preference-section .button-text-padding .md-button:not(.md-icon-button){padding-left:16px;padding-right:16px}.preferences-shield-tile .item-container{width:94px;height:170px;display:block}.preferences-shield-tile .item-container img{width:94px;height:134px;display:block}.preferences-shield-tile .item-container .shield-tile-img-border{border:1px solid transparent}.preferences-shield-tile .item-container md-card-content{width:94px;height:36px;display:block;padding:0}.preferences-shield-tile .item-container p{font-size:10px;padding:5px}.preferences-preference-section .preferences-games-battery-boost .battery-boost-content-title,.preferences-preference-section .preferences-games-quiet-mode .quiet-mode-content-title{height:16px;line-height:16px}.preferences-shield-edit-dialog{width:425px;height:270px}.preferences-shield-edit-dialog img{width:94px;min-height:134px;display:block}.preferences-shield-edit-dialog .container{margin:24px}.preferences-shield-edit-dialog md-input-container{margin:0}.preferences-shield-edit-dialog .boxart{margin-left:16px}.preferences-shield-edit-dialog .custom-label-heading{font-size:10px;font-weight:400;text-shadow:none;bottom:inherit;color:rgba(255,255,255,.7);padding-left:3px}.preferences-shield-edit-dialog .custom-label-content{font-size:12px;font-weight:400;text-shadow:none;bottom:inherit;color:#fff;padding-left:3px;margin-top:8px;margin-bottom:8px}.preferences-shield-edit-dialog md-icon:focus{outline:0;border:none}.preferences-shield-edit-dialog .image-container>img{display:block;width:94px;height:134px}.preferences-shield-edit-dialog .image-container:hover{box-shadow:0 3px 15px 1px rgba(0,0,0,.75);color:rgba(0,0,0,.75);opacity:.75}.preferences-shield-edit-dialog .image-container:hover md-icon{color:#fff!important}.preferences-shield-edit-dialog .image-container md-icon[selected],.preferences-shield-edit-dialog .image-container:active,.preferences-shield-edit-dialog .image-container:focus{outline-color:transparent!important}.preferences-preference-section .share-section p{line-height:1.64;margin-top:8px;margin-bottom:-3.5px}.preferences-preference-section .share-section md-icon{margin:0}.preferences-preference-section .share-section .share-hotkey-info{padding-top:24px;padding-bottom:24px}.preferences-preference-section .share-section .share-hotkey-info p{margin-top:3px!important;margin-bottom:0!important;margin-left:6px;font-size:10px}.preferences-share-alert-icon{margin-left:5px!important;line-height:10px!important}.preferences-col-1,.preferences-col-2{float:left;width:90%}@media only screen and (min-width:900px){.preferences-col-1,.preferences-col-2{width:50%}.preferences-sidebar-container{width:236px}}.preference-gfeCheckForUpdate-container,.preferences-preference-section .download-details-container,.preferences-preference-section .download-progress{width:100%}.preferences-preference-section .preference-gfe-check-for-update-container .md-container{width:100%;height:3px}.preferences-preference-section .preference-gfe-check-for-update-container md-progress-linear{margin-left:0}.preferences-preference-section .about-section md-checkbox{margin-bottom:12px}.shield-troubleshooting-link{margin-top:12px}.preferences-functional-data-consent-dialog{min-height:445px;width:528px}.preferences-functional-data-consent-dialog .dialog-service-dialog-contents-footer{min-height:50px!important}.preferences-licence-agreement{min-height:445px;width:528px}.preferences-led .picker{float:left;border:0}.preferences-led .controls{float:right;margin:10px}.preferences-led .controls>div{padding:5px}.preferences-led .controls label{margin-right:10px}.preferences-led .preview,.preferences-led .secondPreview{cursor:pointer;height:30px;width:50px}preferences-led .cancel-apply-container{height:52px}preferences-led .cancel-apply-container button{margin-top:8px;margin-bottom:8px}.preferences-led .preferences-preference-section .preferences-led-switch md-switch{margin-top:7px;margin-bottom:0;margin-left:8px}.preferences-led .preferences-preference-section .led-input-container-position{width:150px;height:50px;margin-top:0;margin-bottom:50px}.preferences-led .preferences-preference-section .section-divider{display:inline-block;width:1px;height:auto;margin:10px}#overlay{display:block;z-index:0;position:absolute;width:100%;height:100%;background-color:transparent;opacity:.5;filter:alpha(opacity=0)}.range-slider-container{position:relative;width:100%;height:48px}.range-slider-left{position:absolute;top:0;width:100%}.range-slider-left md-slider .md-thumb-container{z-index:10}.range-slider-left md-slider .md-track{background-color:#76b900}.range-slider-left md-slider .md-track.md-track-fill,.range-slider-right md-slider .md-track-container .md-track{background-color:#9e9e9e}.range-slider-right{position:absolute;top:0;right:0}.range-slider-right md-slider .md-thumb-container{transition:-webkit-transform 0s linear;transition:transform 0s linear}.range-slider-right md-slider .md-track-container .md-track.md-track-fill{background-color:#76b900;transition:none}md-slider .md-slider-wrapper{width:100%}.fps-control-slider md-slider .md-track-container{height:1px}.common-window .optimized-slider-container.battery-boost{margin-top:-8px}.common-window .optimized-slider-container .optimized-slider-lables{margin-top:-15px}.common-window .optimized-slider-container .optimal-button-container.battery-boost{margin-top:-23px}.performance-mode md-radio-button .md-off,.performance-mode md-radio-button .md-on{width:20px;height:20px}.performance-mode md-radio-button .md-container{top:12px;width:20px;height:20px}", ""]) }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, ".rewards-dialog.rewards-external-page-container,.rewards-dialog.rewards-redeem-reward{background-image:none;min-height:497px;max-height:497px;min-width:789px;max-width:789px;position:relative;border-radius:0}.rewards-redeem-reward .rewards-dialog-image-container,.rewards-redeem-reward img{width:320px;height:497px}.rewards-redeem-reward .coupon-redemption-header{height:78px}.rewards-redeem-reward .coupon-redemption-header .md-subheader{margin:36px 24px 24px;font-size:18px;font-weight:300}.rewards-redeem-reward .coupon-redemption-header .md-subheader-inner{padding:0}.rewards-external-page-container .iframe-top-toolbar .close-button,.rewards-redeem-reward .coupon-redemption-header .close-button{position:absolute;left:auto;right:8px;top:8px;min-height:24px;max-height:24px}.rewards-redeem-reward .coupon-redemption-block-error-container{height:367px}.rewards-redeem-reward .coupon-redemption-block-error-container .block-error-base-icon{height:32px;line-height:32px;font-size:32px;width:32px}.rewards-redeem-reward .coupon-redemption-block-error-container nv-overlay{height:16px;width:16px;top:155px;left:235px;opacity:1}.rewards-redeem-reward .coupon-redemption-block-error-container .block-error-overlay-icon{height:16px;line-height:16px;width:16px;font-size:16px;opacity:1}.rewards-redeem-reward .coupon-redemption-block-error-container .block-error-message{margin-top:18px}.rewards-redeem-reward .coupon-redemption-block-error-container a{margin-top:12px}.rewards-redeem-reward .coupon-redemption-error-actions{height:52px}.rewards-external-page-container .iframe-top-toolbar{height:48px}.rewards-external-page-container .iframe-scrollbar-spacer{height:24px}.coupon-validation-container{height:56px;margin-top:30px;margin-bottom:10px}.coupon-validation-container .coupon-code-input,.coupon-validation-container .coupon-code-input:focus{height:36px;width:400px;outline:0;border:none}.coupon-validation-container .coupon-code-input::-webkit-input-placeholder{color:rgba(255,255,255,.3)}.coupon-validation-container .coupon-input-error-message{margin-top:8px;width:400px}.rewards-reward-card{width:376px;height:230px}.reward-card:focus,.rewards-feature-card:focus,.rewards-redeem-reward .redeem-details-container .math-answer-input,.rewards-redeem-reward .redeem-details-container .math-answer-input:focus,.rewards-reward-card:focus{outline:0;border:none}.rewards-reward-card .reward-card{width:360px;height:214px;margin:0 16px 16px 0}.rewards-reward-card .reward-card .reward-card-image-container,.rewards-reward-card .reward-card .reward-card-image-container img{width:100%;height:154px}.rewards-feature-card .reward-card .reward-card-image-container,.rewards-feature-card .reward-card .reward-card-image-container img{width:100%;height:240px}.rewards-reward-card .reward-card .reward-card-image-container .reward-card-overlay .reward-status-icon{font-size:16px;line-height:16px;height:16px;width:16px}.rewards-feature-card .reward-card .reward-card-details-container .reward-date,.rewards-feature-card .reward-card .reward-card-details-container .rewards-details-left-message,.rewards-reward-card .reward-card .reward-card-details-container .reward-date,.rewards-reward-card .reward-card .reward-card-details-container .rewards-details-left-message{margin-top:6px}.rewards-reward-card .reward-card .reward-card-details-container .rewards-details-left-message+.reward-date{margin-left:30px}.rewards-reward-card .reward-card.md-accent.background-on-hover:hover .reward-card-details-container .reward-date,.rewards-reward-card .reward-card.md-accent.background-on-hover:hover .reward-card-title{color:#fff!important}.rewards-feature-card .reward-card .reward-card-details-container .rewards-details-left-message+.reward-date{margin-left:70px}.rewards-reward-card .reward-card .rewards-feature-card{width:532px;height:332px}.rewards-feature-card .reward-card{width:500px;height:300px;margin:16px 0 16px 16px;background-color:#464646}.rewards-feature-card .reward-card md-card-content,.rewards-reward-card .reward-card md-card-content{height:60px}.rewards-reward-card .reward-card .new-item-icon-wrapper{position:absolute;z-index:1;width:0;height:0;border-style:solid;border-width:36px 36px 0 0;border-color:rgba(0,0,0,.85) transparent transparent;text-align:center;line-height:30px}.rewards-reward-card .reward-card .new-item-icon-wrapper md-icon{transform:translate(-1px,-41px)}.rewards-center-items-container .rewards-center-section-title{font-weight:400;margin:24px 24px 8px 0}.rewards-center-items-container .rewards-center-top-toolbar{height:56px}.rewards-center-items-container .rewards-center-top-toolbar .back-button{min-height:24px;margin:16px 12px 16px 36px!important}.rewards-center-items-container .rewards-center-top-toolbar .rewards-center-title{margin:22px 0}.rewards-center-items-container .rewards-center-top-toolbar nv-select-menu{margin-right:36px}.rewards-center-items-container .rewards-center-top-toolbar nv-select-menu .common-green-dot{bottom:9px;right:2px}.rewards-center-items-container .featured-reward-container .reward-tag-image{width:112px;height:187px}.rewards-center-items-container .featured-reward-container .featured-reward-details-container .featured-reward-details-description{margin-top:32px}.rewards-center-items-container .rewards-center-top-banner{min-height:150px;max-height:150px}.rewards-center-items-container .rewards-center-top-banner .reward-tag-image-sm{width:56px;height:94px}.rewards-center-items-container .rewards-center-top-banner .reward-banner-details-container .reward-banner-details-description{width:70%}.rewards-center-items-container .rewards-center-coupon-code-banner{height:132px;max-height:132px;transition:height .3s,max-height .3s}.rewards-center-items-container .section-separator-horizontal,.rewards-center-items-container .section-separator-horizontal-center{height:1px}.rewards-center-items-container .section-separator-vertical{width:1px;height:100%}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-header,.rewards-center-items-container .section-separator-horizontal{width:100%}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-header,.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-header-button{height:35px}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-header-button:hover{background-color:#303030!important;opacity:1}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-header-button:active md-icon,.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-header-button:active p{color:rgba(255,255,255,.45)!important}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content{height:0;margin:0 auto;transition:height .3s}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content .reward-cards-container{height:100%;clip-path:polygon(0 0,100% 0,100% 0,0 0);transition:clip-path .3s}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content .learn-more-bullet{width:4px;height:7px}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content .learn-more-text-container{right:50%;clip-path:polygon(0 0,100% 0,100% 0,0 0);transition:clip-path .3s}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content img{top:132px;height:224px;clip-path:polygon(0 0,100% 0,100% 0,0 0);transition:clip-path .3s}.rewards-center-items-container .rewards-center-coupon-code-banner.expanded-state .learn-more-expandable-content .learn-more-text-container,.rewards-center-items-container .rewards-center-coupon-code-banner.expanded-state .learn-more-expandable-content img{clip-path:polygon(0 0,100% 0,100% 100%,0 100%)}.rewards-center-items-container .rewards-center-coupon-code-banner.expanded-state .learn-more-expandable-content .reward-cards-container{clip-path:polygon(0 0,100% 0,100% 100%,0 100%);transition:clip-path .3s}.rewards-center-items-container .rewards-center-coupon-code-banner md-icon.toggle-icon{height:16px;width:16px;min-height:16px;min-width:16px}.rewards-center-items-container .rewards-center-coupon-code-banner.expanded-state md-icon.toggle-icon{-moz-transform:rotateX(180deg);-o-transform:rotateX(180deg);-ms-transform:rotateX(180deg);-webkit-transform:rotateX(180deg);transform:rotateX(180deg)}.rewards-center-items-container .rewards-center-coupon-code-banner h2,.rewards-center-items-container .rewards-center-coupon-code-banner h2:hover{height:56px;line-height:36px;cursor:default;margin-top:48px;margin-bottom:28px}.rewards-center-items-container .reward-cards-container{margin:0 auto}.rewards-redeem-reward .redeem-details-container{height:366px}.rewards-redeem-reward .redeem-details-container .math-answer-input{height:36px;width:200px}.rewards-redeem-reward .redeem-details-container .math-incorrect-answer-placeholder{height:20px}@media (min-width:1200px){.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content,.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content img,.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-header-button,.rewards-center-items-container.user-profile-disabled .reward-cards-container{width:1128px}.rewards-center-items-container .section-separator-horizontal-center{width:1130px}.rewards-center-items-container .rewards-center-coupon-code-banner.expanded-state{height:356px;max-height:356px}.rewards-center-items-container .rewards-center-coupon-code-banner.expanded-state .learn-more-expandable-content{height:224px}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content .learn-more-text-container{top:180px;margin-right:-500px}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content .learn-more-text-container .learn-more-message{width:450px}}@media (min-width:1528px){.rewards-center-items-container .reward-cards-container{width:1128px}}@media (max-width:1199px){.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content,.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content img,.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-header-button,.rewards-center-items-container.user-profile-disabled .reward-cards-container{width:752px}.rewards-center-items-container .section-separator-horizontal-center{width:754px}.rewards-center-items-container .rewards-center-coupon-code-banner.expanded-state{height:282px;max-height:282px}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content img,.rewards-center-items-container .rewards-center-coupon-code-banner.expanded-state .learn-more-expandable-content{height:150px}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content .learn-more-text-container{top:164px;margin-right:-350px}.rewards-center-items-container .rewards-center-coupon-code-banner .learn-more-expandable-content .learn-more-text-container .learn-more-message{width:300px}}@media (max-width:1523px){.rewards-center-items-container .reward-cards-container{width:752px}}.rewards-center-items-container .filtered-list-separator{height:44px}", ""]) }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, ".updates-updates-driver nv-accordion-pane-content,.updates-updates-driver nv-accordion-pane-header-wrapper{min-width:768px}.driver-type-selection-container{width:296px}.driver-type-selection-container md-radio-button:focus{outline:0;border:0}.driver-type-selection-container md-radio-button .md-label{margin-left:39px}.driver-type-selection-container md-radio-button .md-off,.driver-type-selection-container md-radio-button .md-on{width:24px;height:24px}.driver-type-selection-container md-radio-button .md-container{top:27%;width:24px;height:24px}.driver-type-selection-container md-menu-item{height:100%}.driver-type-selection-container .driver-type-title{opacity:.9!important;color:#fff;line-height:24px}.driver-type-selection-container .driver-type-heading2{opacity:.45!important;color:#fff}.driver-type-selection-container .driver-type-heading1{opacity:.75!important;color:#fff;line-height:20px}.updates-updates-driver-item{margin:0}.updates-updates-driver md-icon{margin-right:16px}.updates-updates-driver-item md-icon{font-size:32px;line-height:32px;height:32px}.updates-updates-driver .md-button{margin:0}.updates-updates-driver-item h3{margin-bottom:6px;margin-top:0;line-height:normal;text-transform:none;text-align:left;font-weight:400}.updates-updates-driver-item p{margin:0;line-height:normal;color:#9f9f9f;text-transform:none;text-align:left}.updates-updates-driver nv-accordion-pane{margin-bottom:1px}.updates-updates-driver nv-accordion-pane-header{height:80px}.updates-reinstall-driver{min-width:184px}.updates-reinstall-driver .updates-reinstall-driver-icon{margin:auto 16px auto 0!important;width:16px!important;height:16px;line-height:16px;min-height:16px;min-width:16px}.updates-updates-notification-md-menu-content .progress-container p{margin:0;line-height:normal;font-size:10px;color:#9f9f9f}.updates-updates-notification-md-menu-content .progress-container{margin-left:10px;margin-bottom:15px;margin-right:10px;line-height:normal}.updates-updates-notification-md-menu-content .notification-header{margin:10px 0 3px 15px;font-size:9px}.updates-updates-notification-md-menu-content .md-button{margin:0;padding:0;width:100%;height:inherit}.updates-updates-notification-md-menu-content md-list-item.md-2-line button.md-button{padding:0;margin:0}.updates-updates-notification-md-menu-content{padding:0;margin-top:-8px;margin-bottom:-8px;max-height:none}.updates-updates-details .highlight-container{height:406px}.updates-updates-notification-md-menu-content .checkforupdate-container{min-height:49px}.updates-updates-notification-md-menu-content .checkforupdate-container p{text-align:center}.updates-updates-details .highlight-container md-list-item{background-color:rgba(51,51,51,.5);margin-bottom:1px;padding:0;height:80px}.updates-updates-details{margin:24px 16px 10px}.updates-updates-container h4{margin-top:24px;margin-bottom:8px;font-weight:400}.updates-updates-details md-list-item img{margin-right:10px}.updates-updates-container md-list-item.md-2-line .md-list-item-text h3{line-height:normal;margin:0}.updates-updates-details md-list-item.md-2-line .md-list-item-text{padding:0}.updates-updates-container .updates-updates-driver-container{width:100%;max-width:100%}.updates-updates-container .updates-updates-driver-container .checkforupdate-button{margin-top:14px;margin-bottom:-36px}.updates-updates-details .highlight-container md-list-item img{width:60px;height:60px}.updates-updates-details .highlight-container md-list{padding:0;margin:0}.updates-updates-details .highlight-container md-list-item{margin:10px}.updates-updates-container md-list md-list-item.md-2-line .md-list-item-text p,.updates-updates-container p,md-list md-list-item.md-3-line .md-list-item-text p{color:#9f9f9f}.download-progress md-progress-linear{margin-top:6px}.download-install-controls{margin-right:32px}.updates-updates-driver .download-install-controls .expressInstall{margin-right:10px}.updates-updates-installer-dialog{width:790px;height:442px;background-image:url(" + n(722) + ")}.updates-updates-installer-dialog md-dialog-content{padding:0;overflow:hidden}.updates-updates-intstallation-progress iframe{width:790px;height:376px;border:0}.updates-updates-intstallation-progress .updates-installlation-progress-fallbackImage{width:790px}.updates-updates-intstallation-progress .progress-status-container{margin:10px 15px 5px}.updates-updates-intstallation-progress p{margin:4px 0 0;line-height:10px}.updates-updates-intstallation-progress h4{margin:0 0 4px}.updates-updates-installer-dialog h4{line-height:17px;font-weight:400;margin-top:0}.updates-updates-installer-dialog .updates-updates-installer-dialog-title{margin-bottom:8px}.updates-installer-dialog-installation-complete md-icon{width:48px;height:48px;line-height:normal;font-size:48px;font-weight:700}.updates-installer-dialog-installation-complete div{margin-top:100px}.updates-installer-dialog-installation-error div{margin-left:20px;margin-right:20px}.updates-installer-dialog-installation-error a{margin-top:14px;margin-left:5px;text-decoration:none;height:12px}.updates-installation-custom-container .package-group-table{margin-left:4px;margin-right:4px;height:234px}.updates-installation-custom-container .package-group-header{height:28px;padding-left:20px;margin:0}.updates-installation-custom-container .md-divider{border-top-width:1px;border-bottom-width:1px;border-top-color:#000;border-bottom-color:#1e1e1e}.updates-installation-custom-container md-checkbox,.updates-installation-custom-container p{line-height:normal;margin:0}.updates-installation-custom-container md-divider+div{margin-left:24px;margin-top:16px}.updates-installation-custom-container .warning-clean-install{margin-left:30px}.updates-updates-installer-dialog .updates-installer-dialog-header{margin:24px}.updates-updates-installer-dialog md-icon{margin:0 4px 0 0}.updates-installer-dialog-header:first-child md-icon+p{margin-top:5px}.updates-installer-dialog-header:first-child p{margin:0}.updates-updates-installation-reboot h4,.updates-updates-installation-reboot p{margin:6px 0 0}.updates-updates-installation-reboot div{margin-top:100px}.updates-game-list{padding-left:20px}.updates-game-list .updates-tile-repeater{min-height:232px;max-height:232px}.updates-highlight-tile{width:360px;height:250px;margin:0 16px 16px 0}@media only screen and (min-width:1196px){.updates-highlight-tile:nth-child(3n+0){margin-right:0}}@media only screen and (max-width:1195px){.updates-highlight-tile:nth-child(2n+0){margin-right:0}}.updates-highlight-tile .image-container>img{width:360px;height:154px;display:block}.updates-highlight-tile .image-container .optimal-settings-icon-overlay{width:24px;height:24px;background-color:transparent;top:16px;left:312px}.updates-highlight-tile md-card,.updates-highlight-tile md-card-content{margin:0}.updates-highlight-tile md-card-content>p:last-child{margin-top:4px;margin-bottom:0}.updates-highlight-tile p{line-height:normal;margin:0}.updates-highlight-tile md-card-content .opsTitle{margin-top:3px}.updates-highlight-tile .common-container-gradient{margin:0 16px}.updates-highlight-tile:hover .color-black-hue-1{background-color:#76b900!important}.updates-highlight-tile:hover .color-white-hue-3,.updates-highlight-tile:hover .color-white-hue-4{color:#fff!important}.updates-highlight-tile:hover .common-container-gradient{opacity:0}.updates-updates-details-overlay{margin:0;height:56px;opacity:.45;top:auto;bottom:-10px;position:absolute;width:100%}.updates-updates-details-overlay p{margin:16px}.updates-highlight-tile md-card-content{height:72px;padding-top:12px;padding-bottom:12px}.updates-updates-driver{max-width:1196px;margin:auto;padding-left:26px;padding-right:26px}.updates-updates-details-releaseAbstract{margin-bottom:24px;color:rgba(255,255,255,.75);line-height:1.67}.updates-highlight-tile .highlight-tile-overlay .md-button.md-icon-button{width:50px;height:50px}.updates-highlight-tile .highlight-tile-overlay .md-button.md-icon-button md-icon{width:auto;height:auto;font-size:50px;line-height:50px;margin:0}", ""]); }, function(e, t, n) { t = e.exports = n(6)(), t.push([e.id, "nv-user-profile .md-dialog-container{padding:0!important}nv-user-profile .help-tooltip{width:320px;margin-left:-20px;pointer-events:auto;cursor:default}nv-user-profile .help-tooltip .tooltip-arrow-up{position:absolute;margin-left:24px;z-index:4;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #272727}nv-user-profile .help-tooltip .help-tooltip-container{position:absolute;z-index:3;top:8px;box-shadow:2px 2px 20px #0c0c0c}nv-user-profile .help-tooltip .help-tooltip-container img{width:24px;height:24px}nv-user-profile .help-tooltip .help-tooltip-container .tokens-table .tokens-table-header{margin-bottom:6px;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.2)}nv-user-profile .help-tooltip .help-tooltip-container .tokens-table .tokens-level-column span{min-width:60px}nv-user-profile .help-tooltip .help-tooltip-container .tokens-table .tokens-value-column span{padding-left:16px}nv-user-profile .material-icons.md-11{width:11px;height:11px;line-height:11px;font-size:11px}nv-user-profile .material-icons.md-36{width:36px;height:36px;line-height:36px}nv-user-profile .material-icons.md-48{width:48px;height:48px;line-height:48px}.user-profile-container{max-width:2560px;margin:0 auto}.user-profile{position:relative;z-index:1;padding:0 36px}.user-profile .user-profile-content .md-tab.md-active{color:rgba(255,255,255,.9)}.user-profile .user-profile-content md-tabs{background-color:#242424}.user-profile .user-profile-content md-tabs md-tabs-wrapper{background-color:#191919}.user-profile .link-disabled{opacity:.45;pointer-events:none}.user-profile .profile-section-header{margin-bottom:12px;padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,.2)}.level-icon-gradient.icon-ranking-silver{background:-moz-linear-gradient(top,#dce6f0 33.33%,#b8c2ce 58.33%);background:-webkit-linear-gradient(top,#dce6f0 33.33%,#b8c2ce 58.33%);background:-o-linear-gradient(top,#dce6f0 33.33%,#b8c2ce 58.33%);background:-ms-linear-gradient(top,#dce6f0 33.33%,#b8c2ce 58.33%);background:linear-gradient(to bottom,top,#dce6f0 33.33%,#b8c2ce 58.33%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;display:initial}.level-icon-gradient.icon-ranking-gold{background:-moz-linear-gradient(top,#fff5b5 33.33%,#ffc142 58.33%);background:-webkit-linear-gradient(top,#fff5b5 33.33%,#ffc142 58.33%);background:-o-linear-gradient(top,#fff5b5 33.33%,#ffc142 58.33%);background:-ms-linear-gradient(top,#fff5b5 33.33%,#ffc142 58.33%);background:linear-gradient(to bottom,#fff5b5 33.33%,#ffc142 58.33%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;display:initial}.level-icon-gradient.icon-ranking-titanium{background:-moz-linear-gradient(top,#cee6eb 33.33%,#75a7b8 58.33%);background:-webkit-linear-gradient(top,#cee6eb 33.33%,#75a7b8 58.33%);background:-o-linear-gradient(top,#cee6eb 33.33%,#75a7b8 58.33%);background:-ms-linear-gradient(top,#cee6eb 33.33%,#75a7b8 58.33%);background:linear-gradient(to bottom,#cee6eb 33.33%,#75a7b8 58.33%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;display:initial}.sweepstakes-dialog{min-height:498px;max-height:498px;min-width:790px;max-width:790px;border-radius:0}.sweepstakes-dialog .input-error-container{margin-left:78px;line-height:1em}.sweepstakes-dialog .line-height-18{line-height:18px}.sweepstakes-dialog .line-height-26{line-height:26px}.sweepstakes-dialog .md-32{width:32px;height:32px;line-height:32px}.sweepstakes-dialog .md-48{width:48px;height:48px;line-height:48px;font-size:48px}.sweepstakes-dialog .md-62{width:62px;height:62px;line-height:62px;font-size:62px}.sweepstakes-dialog .md-button.md-fab-24{padding:0!important;width:24px!important;min-width:24px!important;height:24px!important;min-height:24px!important;line-height:24px!important;border-radius:50%!important}.sweepstakes-dialog .width-100{width:100%}.sweepstakes-dialog .message-banner-container{margin-top:20px;height:40px}.sweepstakes-dialog .message-banner-container .message-banner{position:absolute;left:0;width:100%;height:40px;line-height:40px;background-color:#303030;padding-left:24px;padding-right:24px}.sweepstakes-dialog .message-banner-container .message-banner span{line-height:normal;color:rgba(255,255,255,.45)}.sweepstakes-dialog .animate-show-hide.ng-hide{opacity:0}.sweepstakes-dialog .animate-show-hide.ng-hide-add,.sweepstakes-dialog .animate-show-hide.ng-hide-remove{transition:all ease-in-out .2s}.sweepstakes-dialog .md-icon-button.close-button{position:absolute;top:12px;right:12px;z-index:3}.sweepstakes-dialog .giveaway-subview{position:relative;padding:24px 8px 12px 24px}.sweepstakes-dialog .giveaway-subview .giveaway-subview-header{min-height:24px;margin-bottom:24px}.sweepstakes-dialog .giveaway-subview .giveaway-subview-header .md-button{min-height:24px}.sweepstakes-dialog .giveaway-subview .giveaway-subview-content{padding-right:32px}.sweepstakes-dialog .giveaway-subview .giveaway-subview-content-overlay{height:48px;margin:0 24px 12px;background:linear-gradient(transparent,rgba(25,25,25,.9))}.sweepstakes-dialog .giveaway-rules-container p{margin:0}.sweepstakes-dialog .giveaway-rules-container .header{margin:12px 0}.sweepstakes-dialog .message-overlay{position:absolute;opacity:1;z-index:2;background:rgba(0,0,0,.85)}.sweepstakes-dialog .giveaway-details-container .giveaway-info-section{max-height:180px}.sweepstakes-dialog .giveaway-details-container .giveaway-details-description{margin-bottom:24px;margin-top:22px}.sweepstakes-dialog .giveaway-details-container .giveaway-tokens-section{padding:24px 0;border-top:1px solid #5e5e5e;border-bottom:1px solid #5e5e5e}.sweepstakes-dialog .giveaway-details-container .giveaway-box-art{width:352px}.sweepstakes-dialog .giveaway-details-container .giveaway-box-art img{width:100%;height:auto}.sweepstakes-dialog .giveaway-details-container .giveaway-form input[type=number]::-webkit-inner-spin-button,.sweepstakes-dialog .giveaway-details-container .giveaway-form input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.sweepstakes-dialog .giveaway-details-container .giveaway-form .tokens-input-container{width:48px}.sweepstakes-dialog .giveaway-details-container .giveaway-form .tokens-input-container input{font-size:14px!important;color:rgba(255,255,255,.45)}.mission-details-dialog{width:790px;height:501px;border-radius:0}.mission-details-dialog .close-button{position:absolute;top:12px;right:12px;z-index:2}.mission-details-dialog .slideshow-container{height:444px;width:790px;z-index:1}.mission-details-dialog .gradient-overlay{z-index:1}.mission-details-dialog .gradient-overlay .left{top:0;left:0;width:80px;height:444px;background-image:url(" + n(715) + ");background-repeat:repeat-y}.mission-details-dialog .gradient-overlay .right{top:0;right:0;width:80px;height:444px;background-image:url(" + n(716) + ");background-repeat:repeat-y}.mission-details-dialog .gradient-overlay .top{top:0;left:0;width:100%;height:36px;background-image:url(" + n(717) + ");background-repeat:repeat-x}.mission-details-dialog .details-container{bottom:0;z-index:2;width:100%}.mission-details-dialog .details-container .toggle-button{position:absolute;top:-12px;left:50%;transform:translateX(-50%);width:36px;background-color:#191919!important}.mission-details-dialog .details-container .title-container{height:176px;padding-left:24px;padding-right:34px;padding-bottom:12px;background-image:url(" + n(714) + ");background-repeat:repeat-x}.mission-details-dialog .details-container .collapsable-container{padding:20px 34px 12px 24px;background-color:#191919}.mission-details-dialog .details-container .collapsable-container .collapse-icon{transform:rotate(0)}.mission-details-dialog .details-container .collapsable-container .collapse-icon.rotate{transform:rotate(-180deg)}.mission-details-dialog .details-container .collapsable-container .subtitle{margin-bottom:8px}.mission-details-dialog .details-container .collapsable-container .content{overflow:hidden;-webkit-transition:max-height .4s;-moz-transition:max-height .4s;-ms-transition:max-height .4s;-o-transition:max-height .4s;transition:max-height .4s;max-height:501px}.mission-details-dialog .details-container .collapsable-container .content.collapsed{max-height:0}.featured-reward{min-height:440px}.featured-reward .title-container{height:38px;margin:10px 0}.featured-reward .artwork-container{height:185px;margin-bottom:20px}.featured-reward .artwork-container .drawdate-overlay{position:absolute;background:rgba(0,0,0,.75);z-index:2;padding:16px}.user-profile-cover-container{position:absolute;overflow:hidden;z-index:0;padding-bottom:31.25%;width:100%}.user-profile-cover-container .cover-gradient{position:absolute;z-index:3;background:-moz-linear-gradient(top,transparent 96px,#141414 95%);background:-webkit-linear-gradient(top,transparent 96px,#141414 95%);background:linear-gradient(to bottom,transparent 96px,#141414 95%)}.user-profile-cover-container .cover-dark-overlay{background:rgba(0,0,0,.4);z-index:2}.user-profile-cover-container img{position:absolute;top:0;left:0;width:100%;object-fit:cover;z-index:1}.croppie-dialog{max-width:705px;min-width:408px;overflow-x:hidden;border-radius:0}.croppie-dialog .md-32{width:32px;height:32px;line-height:32px}.croppie-dialog .title{font-size:20px;margin:24px 0 0 24px}.croppie-dialog .subtitle{margin:8px 0 0 24px}.croppie-dialog .gallery-tile-container{max-height:134px}.croppie-dialog .gallery-tile{float:left;padding:0 8px 8px 0}.croppie-dialog .gallery-tile img{width:208px}.croppie-dialog .cover-image-preview p{width:60%;text-align:center}.croppie-dialog.edit-profile-cover-container{max-height:620px}.croppie-dialog.edit-profile-cover-container .cover-image-preview{overflow:hidden;min-height:248px;max-height:248px}.croppie-dialog.edit-rig-image-container{max-height:615px}.croppie-dialog.edit-rig-image-container .cover-image-preview{overflow:hidden;min-height:448px;max-height:448px}.user-profile-bio-container{margin-top:-72px;z-index:2;padding-bottom:31.25%;width:100%}.user-profile-bio-container .user-profile-bio{top:0;left:0;right:0;bottom:0}.user-profile-bio-container .cover-edit-button{top:96px;z-index:2}.user-profile-bio-container .more-options{top:96px;z-index:2;right:20px}.user-profile-bio-container .user-profile-avatar-container{position:relative;width:312px;height:200px;margin-right:24px;top:48px}.user-profile-bio-container .user-profile-avatar-container .avatar-edit-button{right:0;top:0;z-index:2}.user-profile-bio-container .user-profile-avatar-container .profile-avatar-overlay{position:absolute;padding:6px 12px}.user-profile-bio-container .user-profile-avatar-container .md-avatar{height:200px;width:200px;border-radius:50%;box-shadow:2px 2px 6px rgba(25,25,25,.75)}.user-profile-bio-container .user-profile-details{max-width:70%}.user-profile-bio-container .user-profile-details .desc-edit-button{right:0;z-index:2}.edit-user-description-container{width:500px}.edit-user-description-container .buttons-container,.edit-user-description-container .description-input-container{width:100%}.user-profile-widgets-container{width:312px;margin-right:24px}.user-profile-widgets-container .profile-status-placeholder{margin-top:80px}.user-profile-widget{width:100%;margin-bottom:12px;background-color:#242424}.user-profile-widget .user-profile-widget-title{padding-bottom:10px;border-bottom:1px solid rgba(255,255,255,.2)}.user-profile-widget .winners-widget{margin:12px 24px}.user-profile-status{padding-top:62px}.user-profile-status .margin-top-7{margin-top:7px}.user-profile-status .margin-right-10{margin-right:10px}.user-profile-status .level-badge{right:64px;top:4px;z-index:2;width:56px}.user-profile-status .level-badge .icon-level-bg{z-index:1;top:0;color:#000;transform:scale(1.11)}.user-profile-status .level-badge .nv-custom-icons.level-icon-gradient{z-index:2}.user-profile-status .xp-container{max-width:160px}.user-profile-status .xp-container .current-xp{color:rgba(255,255,255,.75)}.user-profile-status .xp-container .xp-progress{width:120px;margin:5px 0!important}.user-profile-status .xp-container .xp-progress .md-container.md-mode-determinate{background-color:rgba(255,255,255,.3);height:5px}.user-profile-status .tokens-container{max-width:80px}.user-profile-status .empty-state{min-height:106px}.user-profile-giveaway p{margin:0}.user-profile-games-summary{margin-bottom:16px;padding:16px}.user-profile-games-summary .games-summary-item{margin-top:16px;margin-bottom:16px}.user-profile-games-summary .games-summary-item.first{margin-top:0!important}.user-profile-games-summary .games-summary-item.last{margin-bottom:0!important}.user-profile-games-summary .games-summary-value{font-size:24px;color:#76b900!important;margin-right:8px}.user-missions{min-height:600px}.user-missions .profile-section-header .countdown{color:rgba(255,255,255,.8)}.user-missions .mission-tile{background-color:#1a1a1a}.user-missions .mission-tile .mission-title{margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid #4d4d4d}.user-missions .mission-tile .artwork-container{width:116px;height:164px}.user-missions .mission-tile .details-container{padding-top:24px;padding-left:16px;padding-bottom:16px}.user-missions .mission-tile .mission-progress-container{padding:18px 20px}.user-missions .mission-tile-margin{margin-bottom:16px}.user-missions .mission-tile-margin:last-child{margin-bottom:0!important}.mission-progress-container .md-30{width:30px;height:30px;font-size:30px;line-height:30px}.mission-progress-container .title{color:rgba(255,255,255,.6)}.mission-progress-container .progress-capsule{width:54px;text-align:center;border:1px solid;border-radius:10px;color:rgba(255,255,255,.45)}.mission-progress-container.completed .nv-custom-icons,.mission-progress-container.completed .title{color:#76b900!important}.mission-progress-container.completed .progress-capsule{color:#76b900;border-color:#76b900}.mission-progress-container .mission-value-container{margin-bottom:6px}.activity-log-empty-state-separator{border-top:1px solid rgba(255,255,255,.2)}.activity-log-empty-state{height:360px}.activity-log-container .activity-log-group{margin-top:30px}.activity-log-container .activity-log-group:first-child{margin-top:6px}.activity-log-container .activity-log{margin-bottom:24px;background-color:#1a1a1a}.activity-log-container .activity-log .activity-log-thumbnail{width:160px;height:90px}.activity-log-container .activity-log .activity-log-details{margin:12px;height:66px}.activity-log-container .activity-log .nv-custom-icons{margin-left:6px}.activity-log-container .activity-log em{color:#fff;font-style:normal;font-weight:700}.activity-log-container .activity-log:last-child{margin-bottom:0}.user-gallery-container{min-height:200px}.user-gallery-container .gallery-carousel{width:100%}.user-gallery-tile{margin:0 12px 0 0}.user-gallery-tile .gallery-video-div{position:relative;width:240px;height:135px}.user-gallery-tile .gallery-video-div-mta{filter:grayscale(100%)}.user-gallery-tile .gallery-text-mta{color:#919191!important}.user-gallery-tile .gallery-text-footer-mta{color:#919191}.user-gallery-tile .gallery-video-duration{box-sizing:border-box;position:absolute;display:block;bottom:0;right:0;padding:0 4px;font-size:10px;margin:0;color:#fff;background-color:#000}.user-gallery-tile .gallery-video-overlay-play-button{box-sizing:border-box;position:absolute;top:0;left:0;height:100%;width:100%;display:flex;align-items:center;justify-content:center}.user-gallery-tile .gallery-video-overlay-play-button-icon{width:33px;height:33px;font-size:33px;margin:0;opacity:.95}.user-gallery-tile .gallery-card-footer{color:#fff;font-size:12px;margin:0;padding:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}nv-user-gallery-details{height:100%;width:100%}.user-gallery-details-controller .gallery-detail-image,.user-gallery-details-controller .gallery-detail-video{object-fit:contain;width:100%;height:100%}.user-rig-info-container .user-rig-image-container img{width:100%;max-width:800px}.user-rig-info-container .user-rig-info-list .user-rig-info-item{padding:12px;min-width:100px;max-width:200px;text-align:center}nv-user-achievements .achievements-container{min-height:16px}nv-user-achievements .achievements-loading-container{min-height:24px}nv-user-achievements .achievements-loading-container .loading-icon{height:12px;width:12px;border-radius:50%;background-color:rgba(255,255,255,.2)}.cevo-icons{font-family:Nvidia;width:auto!important}.edit-badges-dialog{width:720px;height:640px;background-color:#2e2e2e;border-radius:0}.edit-badges-dialog .edit-badges-container{padding:24px 24px 0}.edit-badges-dialog .width-100{width:100%}.edit-badges-dialog .md-56{width:56px;height:56px;line-height:56px;font-size:56px}.edit-badges-dialog .checkbox-16{width:16px;height:16px;min-width:16px;min-height:16px}.edit-badges-dialog .checkbox-16 .md-container{width:16px;height:16px}.edit-badges-dialog .checkbox-16 .md-icon{width:16px;height:16px;line-height:16px}.edit-badges-dialog .showcase-section{min-height:144px}.edit-badges-dialog .badge-tile-container{background-color:#212121}.edit-badges-dialog .badge-tile-container .action-elements-container{left:0;top:0;z-index:2}.edit-badges-dialog .showcase-badge-tile{width:120px;height:144px;margin-right:16px}.edit-badges-dialog .showcase-badge-tile .action-elements-container{top:4px;left:4px}.edit-badges-dialog .showcase-badge-tile .title-toggle-button{width:24px;height:24px;min-height:24px}.edit-badges-dialog .showcase-badge-tile .tile-content{padding:24px 10px 10px;background-color:#212121}.edit-badges-dialog .showcase-badge-tile:last-child{margin-right:0!important}.edit-badges-dialog .showcase-badge-tile.dragging .tile-content{background-color:#76b900}.edit-badges-dialog .showcase-badge-tile.dragging .badge-icon-container{background-color:transparent}.edit-badges-dialog .showcase-badge-tile.dropping .tile-content{box-shadow:inset 0 0 0 2px #76b900}.edit-badges-dialog .badge-tile{width:322px;height:114px;margin-right:16px;margin-top:16px}.edit-badges-dialog .badge-tile .tile-content{padding-left:16px}.edit-badges-dialog .badge-tile .badge-icon-container{min-width:80px;max-width:80px}.edit-badges-dialog .badge-tile .action-elements-container{top:8px;left:8px}.edit-badges-dialog .badge-tile:nth-child(2n){margin-right:0!important}.edit-badges-dialog .badge-tile:nth-child(-n+2){margin-top:0!important}.levels-dialog{width:827px;max-width:827px;max-height:606px;border-radius:0;background-color:#252525}.levels-dialog .font-size-18{font-size:18px}.levels-dialog .md-8{width:8px;height:8px;min-width:8px;min-height:8px;line-height:20px}.levels-dialog .md-42{width:42px;height:42px;line-height:42px;font-size:42px}.levels-dialog .md-64{width:64px;height:64px;line-height:64px;font-size:64px}.levels-dialog .margin-right-15{margin-right:15px}.levels-dialog .margin-top-6{margin-top:6px}.levels-dialog .margin-top-18{margin-top:18px}.levels-dialog .margin-top-20{margin-top:20px}.levels-dialog .line-height-20{line-height:20px}.levels-dialog .width-200{width:200px}.levels-dialog .close-button{right:16px;top:16px;z-index:2}.levels-dialog .profile-status{min-height:160px;background-color:#343434}.levels-dialog .profile-status .polygon-clip{width:260px;background-color:#1a1a1a;-webkit-clip-path:polygon(0 0,100% 0,70% 100%,0 100%);clip-path:polygon(0 0,100% 0,70% 100%,0 100%)}.levels-dialog .profile-status .progress-bar-container{margin-right:80px}.levels-dialog .profile-status .level-badge-container{width:182px}.levels-dialog .profile-status .xp-progress-container{min-width:198px}.levels-dialog .profile-status .xp-progress{width:198px;margin-top:10px;height:7px}.levels-dialog .profile-status .xp-progress .md-container{background-color:#252525;height:7px}.levels-dialog .profile-status .xp-progress .md-container .md-bar{height:7px}.levels-dialog .nv-level-details{margin-right:35px}.levels-dialog .nv-level-details:last-child{margin-right:0}.levels-dialog .nv-level-details .perk-item{margin-left:33px}", ""]) }, function(e, t, n) { e.exports = n.p + "defaultRig.jpg" }, function(e, t, n) { e.exports = n.p + "gold.svg" }, function(e, t, n) { e.exports = n.p + "gray.svg" }, function(e, t, n) { e.exports = n.p + "DefaultGameArt.png" }, , , function(e, t, n) { e.exports = n.p + "nvidia-gf-experience-logo.svg" }, function(e, t, n) { e.exports = n.p + "lineBeak.png" }, function(e, t, n) { e.exports = n.p + "GDPR_login_bkgrnd.png" }, function(e, t, n) { e.exports = n.p + "login_left_background.png" }, , function(e, t, n) { e.exports = n.p + "overlay_bg.png" }, , , , , , , , function(e, t, n) { e.exports = n.p + "color_selector.png" }, function(e, t, n) { e.exports = n.p + "wechat.png" }, function(e, t, n) { e.exports = n.p + "wm-off.svg" }, function(e, t, n) { e.exports = n.p + "wm-on.svg" }, function(e, t, n) { e.exports = n.p + "bg-gradient-bottom.png" }, function(e, t, n) { e.exports = n.p + "bg-gradient-left.png" }, function(e, t, n) { e.exports = n.p + "bg-gradient-right.png" }, function(e, t, n) { e.exports = n.p + "bg-gradient-top.png" }, function(e, t, n) { e.exports = n.p + "bullet_green_arrow.png" }, function(e, t, n) { e.exports = n.p + "coupons_expandable_banner.png" }, function(e, t, n) { e.exports = n.p + "redeem_reward_default.png" }, function(e, t, n) { e.exports = n.p + "default_banner.png" }, function(e, t, n) { e.exports = n.p + "installer-dialog-background.png" }, function(e, t, n) { e.exports = n.p + "installer_banner.png" }, function(e, t, n) { e.exports = n.p + "gfn-background.jpg" }, , function(e, t) { e.exports = '
' }, function(e, t) { e.exports = " " }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = '

{{titleString}}

' }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '
{{emailVerificationCtrl.nvDialogModel.translateValues.email}} edit

' }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = '
error
  {{dialogMessageCtrl.nvDialogModel.errorCode}}
' }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = ' ' }, , , , , function(e, t) { e.exports = "
{{::nvImageAlt}}
" }, function(e, t, n) { e.exports = '
' }, function(e, t) { e.exports = " " }, function(e, t) { e.exports = " {{galleryImagePreview.image}}
close {{'l10n.close' | translate }}
close {{'l10n.close' | translate }}
"; }, function(e, t) { e.exports = '
{{mediaTile.mediaItem.alt}}
{{\'l10n.play\' | translate}} play_circle_outline
' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = ' {{$ctrl.nvNews.title}} ' }, function(e, t) { e.exports = ' ' }, function(e, t, n) { e.exports = '
{{$ctrl.nvImageSrc}}

' }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = '
{{lowerValue}}
{{upperValue}}
' }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '
{{::nvMdIcon}} ' }, , function(e, t) { e.exports = "
play_arrow {{'l10n.play' | translate }} pause {{'l10n.pause' | translate }}    {{videoCtrl.currentVideoTime}} volume_up {{'l10n.volume' | translate }} volume_off {{'l10n.volume' | translate }} fullscreen {{'l10n.fullscreen' | translate }}
" }, , , , function(e, t) { e.exports = "
" }, function(e, t) { e.exports = ' {{::nvMdIcon}} ' }, function(e, t) { e.exports = ' {{::nvMdIcon}}
' }, function(e, t, n) { e.exports = "
{{::mainToolbarCtrl.displayName}}

{{mainToolbarCtrl.displayName}}

{{mainToolbarCtrl.displayName}}

' }, function(e, t) { e.exports = '
file_download

|

{{main.driverUpdateText}}

' }, , , , , , , , , , function(e, t) { e.exports = '
{{\'l10n.realName\' | translate}}: {{friendAbout.userAboutGeneral.realName}}
{{\'l10n.lastSeen\' | translate}}: {{friendAbout.userAboutGeneral.lastSeen}}
{{\'l10n.memberSince\' | translate}}: {{friendAbout.userAboutGeneral.memberSince}}
{{\'l10n.reputation\' | translate}}:
movie_creation {{friendAbout.userAboutSpecification.graphicsHardware}}
visibility {{friendAbout.userAboutSpecification.driverVersion}}
select_all {{friendAbout.userAboutSpecification.CPU}}
memory {{friendAbout.userAboutSpecification.RAM}}
desktop_windows {{friendAbout.userAboutSpecification.displayResolution}}
favorite {{friendAbout.userAboutSpecification.OS}}
mouse {{friendAbout.userAboutSpecification.interface.pointingDevice}}
keyboard {{friendAbout.userAboutSpecification.interface.textInput}}
gamepad {{friendAbout.userAboutSpecification.interface.gameController}}
nature_people {{friendAbout.userAboutSpecification.interface.augmentedRealityHardware}}
' }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = " " }, function(e, t, n) { e.exports = "
{{friendBroadcast.selectedUser.name}}
{{friendBroadcast.selectedUser.core.displayName}}
{{\'l10n.broadcasting\' | translate:friendBroadcast.translateInterpolation}} {{}}
{{\'l10n.watchBroadcast\' | translate}}
{{l10n.placeholderText | translate}}
' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = '

{{friendDetails.user.core.displayName}}

' }, function(e, t) { e.exports = ' {{\'l10n.gameSummary\' | translate}}
{{\'l10n.numGames\' | translate:friendGameSummary.translateInterpolation()}}
 
{{genreEntry.label | translate}}

{{gameEntry.displayName}}

' }, function(e, t) { e.exports = '
{{group.displayName}}

{{group.displayName}}

' }, function(e, t) { e.exports = ' {{\'l10n.friendGroupListTitle\' | translate}} {{group.displayName}}

{{group.displayName}}

{{(!$first ? \', \': \'\') + user.core.displayName}}

Not Spec\'d
' }, function(e, t) { e.exports = '
expand_more {{\'l10n.watchBroadcast\' | translate}} {{\'l10n.askToPlay\' | translate}} {{\'l10n.viewProfile\' | translate}} {{\'l10n.chat\' | translate}}
{{friend.core.displayName}}

{{friend.core.displayName}}

' }, function(e, t) { e.exports = "

{{'l10n.friendListTitle' | translate | uppercase}}

{{'l10n.activity' | translate}} {{'l10n.alphabetical' | translate}} {{'l10n.all' | translate}} {{'l10n.online' | translate}} {{'l10n.broadcasting' | translate}} {{'l10n.friendListTitle' | translate}}
{{'l10n.' + friends.filterType | translate}}
{{friend.displayName}}

{{friend.core.displayName}}

{{'l10n.watchBroadcast' | translate}} {{'l10n.askToPlay' | translate}} {{'l10n.viewProfile' | translate}} {{'l10n.chat' | translate}}
" }, , , function(e, t) { e.exports = '
' }, function(e, t) { e.exports = " "; }, function(e, t) { e.exports = " {{'l10n.alphabetical' | translate}} {{'l10n.recentActivity' | translate}} {{'l10n.all' | translate}} {{'l10n.recordings' | translate}} {{'l10n.screenshots' | translate}}
" }, function(e, t) { e.exports = '

{{galleryPanel.galleryFolder.folderName}}

{{ galleryPanel.tilesRemaining() }} {{\'l10n.more\' | translate | lowercase }} keyboard_arrow_down keyboard_arrow_up
' }, function(e, t) { e.exports = " " }, function(e, t) { e.exports = ' {{\'l10n.alphabetical\' | translate}} {{\'l10n.recentActivity\' | translate}} {{\'l10n.all\' | translate}} {{\'l10n.recordings\' | translate}} {{\'l10n.screenshots\' | translate}} ' }, function(e, t) { e.exports = '
{{galleryShowcaseTile.showcaseItem.snippet.title}}
{{\'l10n.share\' | translate}} share
{{\'l10n.play\' | translate}} play_circle_outline
{{galleryShowcaseTile.showcaseItem.snippet.title}}
{{\'l10n.\' + galleryShowcaseTile.showcaseItem.origin | translate}} · {{\'l10n.viewCount\' | translate:{num:galleryShowcaseTile.showcaseItem.statistics.viewCount} }} · {{galleryShowcaseTile.showcaseItem.snippet.publishedAt | date:\'shortDate\'}}
' }, function(e, t) { e.exports = '
{{galleryTile.galleryFile.fileType}}
{{\'l10n.edit\' | translate}} create {{\'l10n.moreDots\' | translate}} more_horiz
{{\'l10n.play\' | translate}} play_circle_outline
{{ galleryTile.galleryFile.videoLength | convertSecondsToHHMMSS}}
{{galleryTile.galleryFile.creationTime | date:\'MM/dd/yyyy h:mma\'}}
videocam image
' }, 791, function(e, t) { e.exports = " edit {{'l10n.edit' | translate }} share {{'l10n.share' | translate }} more_horiz {{'l10n.more' | translate }} " }, function(e, t) { e.exports = '

{{::game.systemGame.displayName}}

{{game.systemGame.displayName}}

{{game.systemGame.displayName}}
' }, function(e, t) { e.exports = '

{{ fpsCtrl.minFpsIndex }}

{{ fpsCtrl.maxFpsIndex }}

' }, function(e, t) { e.exports = '

{{opsCtrl.getResolutionString(resolution)}}

{{opsCtrl.getDisplayModeString(displayMode)}}

' }, function(e, t) { e.exports = ' info_outline ' }, function(e, t) { e.exports = "
star_rate {{'l10n.removeFavorite' | translate }}
star_border {{'l10n.favorite' | translate }}
{{'l10n.tags' | translate }} local_offer
{{'l10n.showGame' | translate }} visibility_off
{{'l10n.hideGame' | translate }} visibility
{{'l10n.moreDots' | translate }} more_horiz
{{gameDetailPreview.userGame.systemGame.displayName}} {{gameDetailPreview.userGame.systemGame.displayName}}

{{gameDetailPreview.userGame.systemGame.displayName}}

{{gameDetailPreview.userGame.systemGame.installDirectory}}
{{ gameDetailPreview.userGame.lastLaunchDate | convertUTCToTimeAgo}}
{{'l10n.totalPlayed' | convertSecondsToRelativeDate:gameDetailPreview.userGame.playedTime}}
" }, function(e, t, n) { e.exports = '
arrow_back {{gameDetails.userGame.systemGame.iconImage36}}

{{gameDetails.userGame.systemGame.displayName}}

{{gameDetails.userGame.systemGame.installDirectory}}

star_border
star_rate
visibility
visibility_off
 {{gameDetails.userGame.lastLaunchDate | convertUTCToTimeAgo}}
warning

{{\'l10n.news\' | translate | uppercase}}
{{gameDetails.userGame.systemGame.longDescription}}
'; }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '
build
{{setting.name}}
{{setting.value}}
{{setting.optimalValue}}

' }, function(e, t) { e.exports = "

{{'l10n.tags' | translate}}:{{tagsModal.gameDisplayName}}

{{'l10n.manageTags' | translate | uppercase}} {{'l10n.done' | translate | uppercase}} {{'l10n.cancel' | translate | uppercase}}
" }, function(e, t) { e.exports = '
star_border
star_rate
visibility
visibility_off
{{::nvGame.systemGame.displayName}}

{{nvGame.systemGame.displayName}}

{{nvGame.systemGame.displayName}}
' }, function(e, t) { e.exports = "
" }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = " " }, function(e, t, n) { e.exports = "
\"{{'l10n.alt.background'

{{ gfnFeature.bannerTexts.bannerPlayGame1 | uppercase}}

{{ gfnFeature.bannerTexts.bannerPlayGame2| uppercase}}

{{ gfnFeature.bannerTexts.bannerSubscribe }}

{{'l10n.news' | translate | uppercase}}

{{'l10n.latestGames' | translate | uppercase}}

" }, function(e, t) { e.exports = ' gameitem

{{gameItem.nvGame.displayName}}

{{\'l10n.purchased\' | translate}}

${{gameItem.nvGame.storeInfo.price}}

' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = ' < {{gfnGenreGames.goBackString | translate}} ' }, function(e, t) { e.exports = ' genreItem

{{gfnGenreItem.name | translate}}

' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = " gameitem

{{nvGame.displayName}}

{{'l10n.releaseDate' | translate }} {{nvGame.releaseDate}}

" }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = "

{{errorMessage}}

{{retry}}

" }, function(e, t, n) { e.exports = '
notifications
{{::notification.artWork}}
{{ notification.readableTime }}

{{::notification.artWork}}
{{ notification.readableTime }}

notifications

' }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = '

'; }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '

' }, function(e, t, n) { e.exports = '
' }, function(e, t) { e.exports = ' {{oobeAuthSyncCtrl.displayName}}

{{oobeAuthSyncCtrl.displayName}}

' }, function(e, t) { e.exports = '

{{oobeAuthVerificationCtrl.translateValues.email}}
' }, function(e, t) { e.exports = "
" }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = "
" }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '
check_circle
error

{{editAvatarCtrl.errorMsg}}

' }, function(e, t, n) { e.exports = '
email updated success image

{{emailUpdatedCtrl.nvDialogModel.newEmail}}

' }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = '
check do_not_disturb
{{requirement.message}}
' }, function(e, t) { e.exports = '

{{featureHeader.featureName}}

{{featureHeader.featureDescription}}

' }, function(e, t) { e.exports = '
{{licenseAgreementCtrl.licenseAgreement}}
' }, function(e, t) { e.exports = '

edit
{{preferencesAccounts.user.core.displayName}}

{{preferencesAccounts.user.core.displayName}}

' }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = '

edit

{{preferencesAccounts.getRealName()}}

{{preferencesAccounts.getPhone()}}

'; }, function(e, t) { e.exports = '

edit

' }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = '

{{preference.name | translate | uppercase}}

' }, function(e, t, n) { e.exports = '

{{\'l10n.features\' | translate |uppercase}}

' }, , function(e, t, n) { e.exports = '

{{ preferencesGamesBatteryBoost.currentSliderIndex }}

' }, function(e, t) { e.exports = '

{{preferencesGamesLocationItem.nvLocation}}

{{preferencesGamesLocationItem.nvLocation}}
' }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '

' }, function(e, t, n) { e.exports = '

{{preferencesGamesScan.totalGames}}

{{preferencesGamesScan.lastRereshTime | convertUTCToTimeAgo}}

{{preferencesGamesScan.scanStatus}}
' }, function(e, t, n) { e.exports = '

{{\'l10n.about\' | translate |uppercase}}

 {{preferencesGeneralAbout.version}} {{preferencesGeneralAbout.beta}}

' }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '

{{\'l10n.language\' | translate | uppercase}}

{{language.name}}
{{\'l10n.cancel\' | translate | uppercase}} {{\'l10n.done\' | translate | uppercase}}
' }, function(e, t) { e.exports = '

' }, function(e, t, n) { e.exports = '

{{preferencesGeneralQuiteMode2.quietStateInfo.baseFrameRate}}

{{preferencesGeneralQuiteMode2.sliders[1].min}}

{{preferencesGeneralQuiteMode2.sliders[1].max}}

'; }, function(e, t) { e.exports = '

{{device.gpuName | uppercase}}

{{device.gpuName | uppercase}}

{{effect.name | translate}}
{{style.style | translate}}
{{variation.name | translate}}

' }, function(e, t) { e.exports = '

' }, function(e, t, n) { e.exports = '

' }, function(e, t) { e.exports = '
{{vm.selectedApp.AppData.TargetPath}}
{{vm.selectedApp.AppData.WorkingDirectory}}

{{vm.selectedApp.AppData.Name}}
' }, function(e, t) { e.exports = '

' }, function(e, t) { e.exports = '
{{vm.nvApp.AppData.Name}}

{{::vm.nvApp.AppData.Name}}

' }, function(e, t, n) { e.exports = '

' }, function(e, t) { e.exports = '
new_releases
reward_card_image
{{::rewardCard.rewardStatusIcon}} {{::rewardCard.rewardStatusMessage}}
lock

{{::rewardCard.cardTitle}}

{{::rewardCard.rewardDate}}

{{::rewardCard.perkLevel}}

' }, function(e, t, n) { e.exports = '
arrow_back

expand_more
learn_more
learn_more_bullet

' }, function(e, t) { e.exports = '
search search clear search

{{result.icon}}

{{ searchCtrl.searchCategories[category] | translate | uppercase}}

{{result.icon}}

{{ result.preview }}
error

' }, , , , function(e, t) { e.exports = '
{{nvContent.name}}
play_circle_outline

{{nvContent.name}}

{{nvContent.description}}

{{nvContent.description}}

{{nvContent.description}}

'; }, function(e, t, n) { e.exports = '
default-banner
' }, function(e, t) { e.exports = " " }, function(e, t) { e.exports = '

{{nvMessage}}

{{nvValue | number:0}}%

' }, function(e, t, n) { e.exports = '
{{\'l10n.checkforUpdates\' | translate | uppercase}}
more_vert

{{\'l10n.available\' | translate | uppercase}}

{{updatesDriver.getProgressString(update)}}

{{update.downloadStatus.downloadSpeed | convertBytesToKBMBGB}}/Sec

{{update.downloadStatus.timeRemaining | convertSecondsToTime:true}}

pause play_arrow stop

{{updatesDriver.installedDriverHeaderText}}

file_download

{{updatesDriver.getProgressString(updatesDriver.installedDriver)}}

{{updatesDriver.installedDriver.downloadStatus.downloadSpeed | convertBytesToKBMBGB}}/Sec

{{updatesDriver.installedDriver.downloadStatus.timeRemaining | convertSecondsToTime:true}}

pause play_arrow stop

{{\'l10n.retry\' | translate | uppercase}}
' }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = " " }, function(e, t) { e.exports = '

{{\'l10n.component\' | translate | uppercase}}

{{\'l10n.newVersion\' | translate | uppercase}}

{{\'l10n.currentVersion\' | translate | uppercase}}

{{installablePackage.title}}

{{installablePackage.version}}

{{installablePackage.currentVersion}}

-

{{ \'l10n.performCleanInstallation\' | translate }}

{{\'l10n.cleanInstallMessage\' | translate}}

{{\'l10n.component\' | translate | uppercase}}

{{\'l10n.version\' | translate | uppercase}}

{{\'l10n.status\' | translate | uppercase}}

{{installablePackage.title}}

{{installablePackage.version}}

{{updatesInstallationCustom.getStatusText(installablePackage.resultText)}}

{{ \'l10n.installed\' | translate }}

' }, function(e, t, n) { e.exports = "

{{updateInstallationProgress.model.details()}}

' }, function(e, t) { e.exports = '
track_changes

{{\'l10n.restartingInSecond\' | translate:{num:updatesInstallationReboot.interval} }}

{{\'l10n.afterRestartInstallation\' | translate}}

' }, function(e, t) { e.exports = '
check

{{updatesInstallerDialog.model.details() | translate:dialog.data}}

' }, function(e, t) { e.exports = '

{{updatesInstallerDialog.model.details() | translate:dialog.data}}

  • {{bullet | translate:dialog.data}}
' }, function(e, t) { e.exports = '
{{updatesInstallerDialog.model.title() | translate}}
{{updatesInstallerDialog.model.icon()}}

{{updatesInstallerDialog.model.subtitle() | translate}}

{{updatesInstallerDialog.model.button2().text | translate | uppercase}} {{updatesInstallerDialog.model.button1().text | translate | uppercase}}
' }, function(e, t) { e.exports = '
{{nvMdIcon}}

{{nvDriver.name | translate}}

{{\'l10n.betaWithHypen\' | translate:nvDriver}}

{{\'l10n.versionColon\' | translate}} {{nvDriver.version}}    {{\'l10n.releaseDate\' | translate}} {{nvDriver.releaseDateTime | convertToUTCDate}}

' }, function(e, t) { e.exports = " {{'l10n.updates' | translate}} archive

{{'l10n.available' | translate | uppercase}}

{{'l10n.currentlyInstalled' | translate | uppercase}}

{{'l10n.checkforUpdates' | translate | uppercase}}

" }, function(e, t) { e.exports = '
cloud_off
star star_border
{{achievement.title}}
locked
{{achievement.title}} {{achievement.description}}
' }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = ' '; }, function(e, t) { e.exports = '
{{ levelDetails.nvLevel.name | translate }} {{ levelDetails.xpRangeString }}
brightness_1
' }, function(e, t) { e.exports = ' close
' }, function(e, t) { e.exports = ' close
mission-img
{{ missionDetailsCtrl.mission.name }}
{{ missionDetailsCtrl.mission.tasks[0].description }}
info
' }, function(e, t) { e.exports = '
check_circle
{{ missionProgressCtrl.missionValue }}
{{ missionProgressCtrl.getProgress() }}
' }, function(e, t) { e.exports = '
{{ missionTileCtrl.nvMission.name }}
{{ missionTileCtrl.nvMission.tasks[0].name }}
' }, function(e, t) { e.exports = ' close
close {{ sweepstakeCtrl.tokensEntered }}
error {{ sweepstakeCtrl.errorMessage }}
{{ sweepstakeCtrl.giveaway.title }}
cloud_off
 
remove add
{{ sweepstakeCtrl.tokensEntered }} {{ sweepstakeCtrl.tokensSubmitMoment() }}
arrow_back
info
' }, function(e, t) { e.exports = '{{userAchievements.titleBadge.title}}
lock
' }, function(e, t) { e.exports = '
{{ userActivityLog.headerDate(groupDate) }}
{{ userActivityLog.activityMoment(log) }}
{{ log.tokens }}
{{ log.xp }}
info
' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = '
' }, function(e, t) { e.exports = '
{{ userGalleryTile.nvFile.folder }} {{ userGalleryTile.nvFile.date }}
file_upload
' }, function(e, t) { e.exports = '
info
' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = ' '; }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = '
edit
{{item.description}}
{{subItem}}
' }, function(e, t) { e.exports = ' ' }, function(e, t) { e.exports = [{ bodyTags: ["l10n.versionColon", "l10n.releaseDate", "l10n.drivers"], title: "Driver Item", extraTags: [], rawName: "nvDriverItem", group: "main.auth.updates#Driver Item" }, { bodyTags: ["l10n.optimalSettingsAvailable", "l10n.drivers"], title: "Highlight Tile", extraTags: ["l10n.unableToFetchVideo"], rawName: "nvHighlightTile", group: "main.auth.updates#Highlight Tile" }, { bodyTags: ["l10n.checkforUpdates", "l10n.clickToChangeDriverPreference", "l10n.showDriverRecommendationFor", "l10n.gameReadyDriver", "l10n.recommendedForGameUpdates", "l10n.creatorReadyDriver", "l10n.recommendedForCreativeApp", "l10n.available", "l10n.download", "l10n.expressInstall", "l10n.customInstall", "l10n.reInstalledDriver", "l10n.downloadDriver", "l10n.drivers"], title: "Updates Driver", extraTags: ["l10n.currentlyInstalled", "l10n.latestGeforceUpdate", "l10n.latestGeforceCRDUpdate", "l10n.newGRDDriverAvailable", "l10n.newCRDDriverAvailable", "l10n.driverDownloadFailed", "l10n.checkingforUpdates", "l10n.preparingPackage", "l10n.downloading", "l10n.paused", "l10n.retrying", "l10n.unableToConnectToNvidia", "l10n.downloadPausedUnableToReachNvidia", "l10n.downloadDiskSpace"], rawName: "nvUpdatesDriver", group: "main.auth.updates#Updates Driver" }, { bodyTags: ["l10n.redeem", "l10n.filter", "l10n.allNumber", "l10n.availableNumber", "l10n.redeemedNumber", "l10n.expiredNumber", "l10n.whereToFindCoupons", "l10n.available", "l10n.readyToRedeem", "l10n.levelUpToUnlock", "l10n.redeemedAndExpired", "l10n.noRewardsRedeemedYet", "l10n.rewards"], title: "Rewards Center", extraTags: ["l10n.checkCouponRetailer", "l10n.gfeGiveaway", "l10n.tryAgain", "l10n.redemptionIncomplete", "l10n.redeem", "l10n.moreItemsAvailable", "l10n.updatingContent", "l10n.unableToReachNvidia", "l10n.learnMore", "l10n.couldNotRetrieveRedemptionHistory", "l10n.codeVerified", "l10n.enterCouponCode"], rawName: "nvRewardsCenter", group: "main.auth.rewards#Rewards Center" }] }, function(e, t, n) { e.exports = { default: n(921), __esModule: !0 } }, function(e, t, n) { e.exports = { default: n(924), __esModule: !0 } }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } t.__esModule = !0; var o = n(917), i = r(o), a = n(916), s = r(a), l = n(99), c = r(l); t.default = function(e, t) { if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + ("undefined" == typeof t ? "undefined" : (0, c.default)(t))); e.prototype = (0, s.default)(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (i.default ? (0, i.default)(e, t) : e.__proto__ = t) } }, function(e, t, n) { "use strict"; function r(e) { return e && e.__esModule ? e : { default: e } } t.__esModule = !0; var o = n(99), i = r(o); t.default = function(e, t) { if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !t || "object" !== ("undefined" == typeof t ? "undefined" : (0, i.default)(t)) && "function" != typeof t ? e : t } }, , function(e, t, n) { n(929); var r = n(18).Object; e.exports = function(e, t) { return r.create(e, t) } }, , function(e, t, n) { n(931), e.exports = n(18).Object.getPrototypeOf }, function(e, t, n) { n(932), e.exports = n(18).Object.setPrototypeOf }, , function(e, t, n) { var r = n(43), o = n(49), i = function(e, t) { if (o(e), !r(t) && null !== t) throw TypeError(t + ": can't set as prototype!") }; e.exports = { set: Object.setPrototypeOf || ("__proto__" in {} ? function(e, t, r) { try { r = n(193)(Function.call, n(194).f(Object.prototype, "__proto__").set, 2), r(e, []), t = !(e instanceof Array) } catch (e) { t = !0 } return function(e, n) { return i(e, n), t ? e.__proto__ = n : r(e, n), e } }({}, !1) : void 0), check: i } }, , , function(e, t, n) { var r = n(42); r(r.S, "Object", { create: n(124) }) }, , function(e, t, n) { var r = n(54), o = n(195); n(196)("getPrototypeOf", function() { return function(e) { return o(r(e)) } }) }, function(e, t, n) { var r = n(42); r(r.S, "Object", { setPrototypeOf: n(926).set }) }, function(e, t, n) { var r, o; ! function() { function i(e) { return e && (e.ownerDocument || e.document || e).documentElement } function a(e) { return e && (e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView) } function s(e, t) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN } function l(e) { return null === e ? NaN : +e } function c(e) { return !isNaN(e) } function u(e) { return { left: function(t, n, r, o) { for (arguments.length < 3 && (r = 0), arguments.length < 4 && (o = t.length); r < o;) { var i = r + o >>> 1; e(t[i], n) < 0 ? r = i + 1 : o = i } return r }, right: function(t, n, r, o) { for (arguments.length < 3 && (r = 0), arguments.length < 4 && (o = t.length); r < o;) { var i = r + o >>> 1; e(t[i], n) > 0 ? o = i : r = i + 1 } return r } } } function d(e) { return e.length } function f(e) { for (var t = 1; e * t % 1;) t *= 10; return t } function m(e, t) { for (var n in t) Object.defineProperty(e.prototype, n, { value: t[n], enumerable: !1 }) } function p() { this._ = Object.create(null) } function g(e) { return (e += "") === ya || e[0] === Ea ? Ea + e : e } function v(e) { return (e += "")[0] === Ea ? e.slice(1) : e } function h(e) { return g(e) in this._ } function y(e) { return (e = g(e)) in this._ && delete this._[e] } function E() { var e = []; for (var t in this._) e.push(v(t)); return e } function b() { var e = 0; for (var t in this._) ++e; return e } function S() { for (var e in this._) return !1; return !0 } function _() { this._ = Object.create(null) } function w(e) { return e } function A(e, t, n) { return function() { var r = n.apply(t, arguments); return r === t ? e : r } } function T(e, t) { if (t in e) return t; t = t.charAt(0).toUpperCase() + t.slice(1); for (var n = 0, r = ba.length; n < r; ++n) { var o = ba[n] + t; if (o in e) return o } } function I() {} function C() {} function x(e) { function t() { for (var t, r = n, o = -1, i = r.length; ++o < i;)(t = r[o].on) && t.apply(this, arguments); return e } var n = [], r = new p; return t.on = function(t, o) { var i, a = r.get(t); return arguments.length < 2 ? a && a.on : (a && (a.on = null, n = n.slice(0, i = n.indexOf(a)).concat(n.slice(i + 1)), r.remove(t)), o && n.push(r.set(t, { on: o })), e) }, t } function M() { sa.event.preventDefault() } function D() { for (var e, t = sa.event; e = t.sourceEvent;) t = e; return t } function O(e) { for (var t = new C, n = 0, r = arguments.length; ++n < r;) t[arguments[n]] = x(t); return t.of = function(n, r) { return function(o) { try { var i = o.sourceEvent = sa.event; o.target = e, sa.event = o, t[o.type].apply(n, r) } finally { sa.event = i } } }, t } function R(e) { return _a(e, Ia), e } function N(e) { return "function" == typeof e ? e : function() { return wa(e, this) } } function L(e) { return "function" == typeof e ? e : function() { return Aa(e, this) } } function P(e, t) { function n() { this.removeAttribute(e) } function r() { this.removeAttributeNS(e.space, e.local) } function o() { this.setAttribute(e, t) } function i() { this.setAttributeNS(e.space, e.local, t) } function a() { var n = t.apply(this, arguments); null == n ? this.removeAttribute(e) : this.setAttribute(e, n) } function s() { var n = t.apply(this, arguments); null == n ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n) } return e = sa.ns.qualify(e), null == t ? e.local ? r : n : "function" == typeof t ? e.local ? s : a : e.local ? i : o } function k(e) { return e.trim().replace(/\s+/g, " ") } function G(e) { return new RegExp("(?:^|\\s+)" + sa.requote(e) + "(?:\\s+|$)", "g") } function F(e) { return (e + "").trim().split(/^|\s+/) } function U(e, t) { function n() { for (var n = -1; ++n < o;) e[n](this, t) } function r() { for (var n = -1, r = t.apply(this, arguments); ++n < o;) e[n](this, r) } e = F(e).map(V); var o = e.length; return "function" == typeof t ? r : n } function V(e) { var t = G(e); return function(n, r) { if (o = n.classList) return r ? o.add(e) : o.remove(e); var o = n.getAttribute("class") || ""; r ? (t.lastIndex = 0, t.test(o) || n.setAttribute("class", k(o + " " + e))) : n.setAttribute("class", k(o.replace(t, " "))) } } function z(e, t, n) { function r() { this.style.removeProperty(e) } function o() { this.style.setProperty(e, t, n) } function i() { var r = t.apply(this, arguments); null == r ? this.style.removeProperty(e) : this.style.setProperty(e, r, n) } return null == t ? r : "function" == typeof t ? i : o } function B(e, t) { function n() { delete this[e] } function r() { this[e] = t } function o() { var n = t.apply(this, arguments); null == n ? delete this[e] : this[e] = n } return null == t ? n : "function" == typeof t ? o : r } function $(e) { function t() { var t = this.ownerDocument, n = this.namespaceURI; return n ? t.createElementNS(n, e) : t.createElement(e) } function n() { return this.ownerDocument.createElementNS(e.space, e.local) } return "function" == typeof e ? e : (e = sa.ns.qualify(e)).local ? n : t } function W() { var e = this.parentNode; e && e.removeChild(this) } function H(e) { return { __data__: e } } function j(e) { return function() { return Ta(this, e) } } function Y(e) { return arguments.length || (e = s), function(t, n) { return t && n ? e(t.__data__, n.__data__) : !t - !n } } function q(e, t) { for (var n = 0, r = e.length; n < r; n++) for (var o, i = e[n], a = 0, s = i.length; a < s; a++)(o = i[a]) && t(o, a, n); return e } function K(e) { return _a(e, xa), e } function Q(e) { var t, n; return function(r, o, i) { var a, s = e[i].update, l = s.length; for (i != n && (n = i, t = 0), o >= t && (t = o + 1); !(a = s[t]) && ++t < l;); return a } } function Z(e, t, n) { function r() { var t = this[a]; t && (this.removeEventListener(e, t, t.$), delete this[a]) } function o() { var o = l(t, ca(arguments)); r.call(this), this.addEventListener(e, this[a] = o, o.$ = n), o._ = t } function i() { var t, n = new RegExp("^__on([^.]+)" + sa.requote(e) + "$"); for (var r in this) if (t = r.match(n)) { var o = this[r]; this.removeEventListener(t[1], o, o.$), delete this[r] } } var a = "__on" + e, s = e.indexOf("."), l = X; s > 0 && (e = e.slice(0, s)); var c = Ma.get(e); return c && (e = c, l = J), s ? t ? o : r : t ? I : i } function X(e, t) { return function(n) { var r = sa.event; sa.event = n, t[0] = this.__data__; try { e.apply(this, t) } finally { sa.event = r } } } function J(e, t) { var n = X(e, t); return function(e) { var t = this, r = e.relatedTarget; r && (r === t || 8 & r.compareDocumentPosition(t)) || n.call(t, e) } } function ee(e) { var t = ".dragsuppress-" + ++Oa, n = "click" + t, r = sa.select(a(e)).on("touchmove" + t, M).on("dragstart" + t, M).on("selectstart" + t, M); if (null == Da && (Da = !("onselectstart" in e) && T(e.style, "userSelect")), Da) { var o = i(e).style, s = o[Da]; o[Da] = "none" } return function(e) { if (r.on(t, null), Da && (o[Da] = s), e) { var i = function() { r.on(n, null) }; r.on(n, function() { M(), i() }, !0), setTimeout(i, 0) } } } function te(e, t) { t.changedTouches && (t = t.changedTouches[0]); var n = e.ownerSVGElement || e; if (n.createSVGPoint) { var r = n.createSVGPoint(); if (Ra < 0) { var o = a(e); if (o.scrollX || o.scrollY) { n = sa.select("body").append("svg").style({ position: "absolute", top: 0, left: 0, margin: 0, padding: 0, border: "none" }, "important"); var i = n[0][0].getScreenCTM(); Ra = !(i.f || i.e), n.remove() } } return Ra ? (r.x = t.pageX, r.y = t.pageY) : (r.x = t.clientX, r.y = t.clientY), r = r.matrixTransform(e.getScreenCTM().inverse()), [r.x, r.y] } var s = e.getBoundingClientRect(); return [t.clientX - s.left - e.clientLeft, t.clientY - s.top - e.clientTop] } function ne() { return sa.event.changedTouches[0].identifier } function re(e) { return e > 0 ? 1 : e < 0 ? -1 : 0 } function oe(e, t, n) { return (t[0] - e[0]) * (n[1] - e[1]) - (t[1] - e[1]) * (n[0] - e[0]) } function ie(e) { return e > 1 ? 0 : e < -1 ? Pa : Math.acos(e) } function ae(e) { return e > 1 ? Fa : e < -1 ? -Fa : Math.asin(e) } function se(e) { return ((e = Math.exp(e)) - 1 / e) / 2 } function le(e) { return ((e = Math.exp(e)) + 1 / e) / 2 } function ce(e) { return ((e = Math.exp(2 * e)) - 1) / (e + 1) } function ue(e) { return (e = Math.sin(e / 2)) * e } function de() {} function fe(e, t, n) { return this instanceof fe ? (this.h = +e, this.s = +t, void(this.l = +n)) : arguments.length < 2 ? e instanceof fe ? new fe(e.h, e.s, e.l) : Ie("" + e, Ce, fe) : new fe(e, t, n) } function me(e, t, n) { function r(e) { return e > 360 ? e -= 360 : e < 0 && (e += 360), e < 60 ? i + (a - i) * e / 60 : e < 180 ? a : e < 240 ? i + (a - i) * (240 - e) / 60 : i } function o(e) { return Math.round(255 * r(e)) } var i, a; return e = isNaN(e) ? 0 : (e %= 360) < 0 ? e + 360 : e, t = isNaN(t) ? 0 : t < 0 ? 0 : t > 1 ? 1 : t, n = n < 0 ? 0 : n > 1 ? 1 : n, a = n <= .5 ? n * (1 + t) : n + t - n * t, i = 2 * n - a, new _e(o(e + 120), o(e), o(e - 120)) } function pe(e, t, n) { return this instanceof pe ? (this.h = +e, this.c = +t, void(this.l = +n)) : arguments.length < 2 ? e instanceof pe ? new pe(e.h, e.c, e.l) : e instanceof ve ? ye(e.l, e.a, e.b) : ye((e = xe((e = sa.rgb(e)).r, e.g, e.b)).l, e.a, e.b) : new pe(e, t, n) } function ge(e, t, n) { return isNaN(e) && (e = 0), isNaN(t) && (t = 0), new ve(n, Math.cos(e *= Ua) * t, Math.sin(e) * t) } function ve(e, t, n) { return this instanceof ve ? (this.l = +e, this.a = +t, void(this.b = +n)) : arguments.length < 2 ? e instanceof ve ? new ve(e.l, e.a, e.b) : e instanceof pe ? ge(e.h, e.c, e.l) : xe((e = _e(e)).r, e.g, e.b) : new ve(e, t, n) } function he(e, t, n) { var r = (e + 16) / 116, o = r + t / 500, i = r - n / 200; return o = Ee(o) * Qa, r = Ee(r) * Za, i = Ee(i) * Xa, new _e(Se(3.2404542 * o - 1.5371385 * r - .4985314 * i), Se(-.969266 * o + 1.8760108 * r + .041556 * i), Se(.0556434 * o - .2040259 * r + 1.0572252 * i)) } function ye(e, t, n) { return e > 0 ? new pe(Math.atan2(n, t) * Va, Math.sqrt(t * t + n * n), e) : new pe(NaN, NaN, e) } function Ee(e) { return e > .206893034 ? e * e * e : (e - 4 / 29) / 7.787037 } function be(e) { return e > .008856 ? Math.pow(e, 1 / 3) : 7.787037 * e + 4 / 29 } function Se(e) { return Math.round(255 * (e <= .00304 ? 12.92 * e : 1.055 * Math.pow(e, 1 / 2.4) - .055)) } function _e(e, t, n) { return this instanceof _e ? (this.r = ~~e, this.g = ~~t, void(this.b = ~~n)) : arguments.length < 2 ? e instanceof _e ? new _e(e.r, e.g, e.b) : Ie("" + e, _e, me) : new _e(e, t, n) } function we(e) { return new _e(e >> 16, e >> 8 & 255, 255 & e) } function Ae(e) { return we(e) + "" } function Te(e) { return e < 16 ? "0" + Math.max(0, e).toString(16) : Math.min(255, e).toString(16) } function Ie(e, t, n) { e = e.toLowerCase(); var r, o, i, a = 0, s = 0, l = 0; if (r = /([a-z]+)\((.*)\)/.exec(e)) switch (o = r[2].split(","), r[1]) { case "hsl": return n(parseFloat(o[0]), parseFloat(o[1]) / 100, parseFloat(o[2]) / 100); case "rgb": return t(De(o[0]), De(o[1]), De(o[2])) } return (i = ts.get(e)) ? t(i.r, i.g, i.b) : (null == e || "#" !== e.charAt(0) || isNaN(i = parseInt(e.slice(1), 16)) || (4 === e.length ? (a = (3840 & i) >> 4, a |= a >> 4, s = 240 & i, s |= s >> 4, l = 15 & i, l |= l << 4) : 7 === e.length && (a = (16711680 & i) >> 16, s = (65280 & i) >> 8, l = 255 & i)), t(a, s, l)) } function Ce(e, t, n) { var r, o, i = Math.min(e /= 255, t /= 255, n /= 255), a = Math.max(e, t, n), s = a - i, l = (a + i) / 2; return s ? (o = l < .5 ? s / (a + i) : s / (2 - a - i), r = e == a ? (t - n) / s + (t < n ? 6 : 0) : t == a ? (n - e) / s + 2 : (e - t) / s + 4, r *= 60) : (r = NaN, o = l > 0 && l < 1 ? 0 : r), new fe(r, o, l) } function xe(e, t, n) { e = Me(e), t = Me(t), n = Me(n); var r = be((.4124564 * e + .3575761 * t + .1804375 * n) / Qa), o = be((.2126729 * e + .7151522 * t + .072175 * n) / Za), i = be((.0193339 * e + .119192 * t + .9503041 * n) / Xa); return ve(116 * o - 16, 500 * (r - o), 200 * (o - i)) } function Me(e) { return (e /= 255) <= .04045 ? e / 12.92 : Math.pow((e + .055) / 1.055, 2.4) } function De(e) { var t = parseFloat(e); return "%" === e.charAt(e.length - 1) ? Math.round(2.55 * t) : t } function Oe(e) { return "function" == typeof e ? e : function() { return e } } function Re(e) { return function(t, n, r) { return 2 === arguments.length && "function" == typeof n && (r = n, n = null), Ne(t, n, e, r) } } function Ne(e, t, n, r) { function o() { var e, t = l.status; if (!t && Pe(l) || t >= 200 && t < 300 || 304 === t) { try { e = n.call(i, l) } catch (e) { return void a.error.call(i, e) } a.load.call(i, e) } else a.error.call(i, l) } var i = {}, a = sa.dispatch("beforesend", "progress", "load", "error"), s = {}, l = new XMLHttpRequest, c = null; return !this.XDomainRequest || "withCredentials" in l || !/^(http(s)?:)?\/\//.test(e) || (l = new XDomainRequest), "onload" in l ? l.onload = l.onerror = o : l.onreadystatechange = function() { l.readyState > 3 && o() }, l.onprogress = function(e) { var t = sa.event; sa.event = e; try { a.progress.call(i, l) } finally { sa.event = t } }, i.header = function(e, t) { return e = (e + "").toLowerCase(), arguments.length < 2 ? s[e] : (null == t ? delete s[e] : s[e] = t + "", i) }, i.mimeType = function(e) { return arguments.length ? (t = null == e ? null : e + "", i) : t }, i.responseType = function(e) { return arguments.length ? (c = e, i) : c }, i.response = function(e) { return n = e, i }, ["get", "post"].forEach(function(e) { i[e] = function() { return i.send.apply(i, [e].concat(ca(arguments))) } }), i.send = function(n, r, o) { if (2 === arguments.length && "function" == typeof r && (o = r, r = null), l.open(n, e, !0), null == t || "accept" in s || (s.accept = t + ",*/*"), l.setRequestHeader) for (var u in s) l.setRequestHeader(u, s[u]); return null != t && l.overrideMimeType && l.overrideMimeType(t), null != c && (l.responseType = c), null != o && i.on("error", o).on("load", function(e) { o(null, e) }), a.beforesend.call(i, l), l.send(null == r ? null : r), i }, i.abort = function() { return l.abort(), i }, sa.rebind(i, a, "on"), null == r ? i : i.get(Le(r)) } function Le(e) { return 1 === e.length ? function(t, n) { e(null == t ? n : null) } : e } function Pe(e) { var t = e.responseType; return t && "text" !== t ? e.response : e.responseText } function ke() { var e = Ge(), t = Fe() - e; t > 24 ? (isFinite(t) && (clearTimeout(is), is = setTimeout(ke, t)), os = 0) : (os = 1, ss(ke)) } function Ge() { var e = Date.now(); for (as = ns; as;) e >= as.t && (as.f = as.c(e - as.t)), as = as.n; return e } function Fe() { for (var e, t = ns, n = 1 / 0; t;) t.f ? t = e ? e.n = t.n : ns = t.n : (t.t < n && (n = t.t), t = (e = t).n); return rs = e, n } function Ue(e, t) { return t - (e ? Math.ceil(Math.log(e) / Math.LN10) : 1) } function Ve(e, t) { var n = Math.pow(10, 3 * ha(8 - t)); return { scale: t > 8 ? function(e) { return e / n } : function(e) { return e * n }, symbol: e } } function ze(e) { var t = e.decimal, n = e.thousands, r = e.grouping, o = e.currency, i = r && n ? function(e, t) { for (var o = e.length, i = [], a = 0, s = r[0], l = 0; o > 0 && s > 0 && (l + s + 1 > t && (s = Math.max(1, t - l)), i.push(e.substring(o -= s, o + s)), !((l += s + 1) > t));) s = r[a = (a + 1) % r.length]; return i.reverse().join(n) } : w; return function(e) { var n = cs.exec(e), r = n[1] || " ", a = n[2] || ">", s = n[3] || "-", l = n[4] || "", c = n[5], u = +n[6], d = n[7], f = n[8], m = n[9], p = 1, g = "", v = "", h = !1, y = !0; switch (f && (f = +f.substring(1)), (c || "0" === r && "=" === a) && (c = r = "0", a = "="), m) { case "n": d = !0, m = "g"; break; case "%": p = 100, v = "%", m = "f"; break; case "p": p = 100, v = "%", m = "r"; break; case "b": case "o": case "x": case "X": "#" === l && (g = "0" + m.toLowerCase()); case "c": y = !1; case "d": h = !0, f = 0; break; case "s": p = -1, m = "r" } "$" === l && (g = o[0], v = o[1]), "r" != m || f || (m = "g"), null != f && ("g" == m ? f = Math.max(1, Math.min(21, f)) : "e" != m && "f" != m || (f = Math.max(0, Math.min(20, f)))), m = us.get(m) || Be; var E = c && d; return function(e) { var n = v; if (h && e % 1) return ""; var o = e < 0 || 0 === e && 1 / e < 0 ? (e = -e, "-") : "-" === s ? "" : s; if (p < 0) { var l = sa.formatPrefix(e, f); e = l.scale(e), n = l.symbol + v } else e *= p; e = m(e, f); var b, S, _ = e.lastIndexOf("."); if (_ < 0) { var w = y ? e.lastIndexOf("e") : -1; w < 0 ? (b = e, S = "") : (b = e.substring(0, w), S = e.substring(w)) } else b = e.substring(0, _), S = t + e.substring(_ + 1); !c && d && (b = i(b, 1 / 0)); var A = g.length + b.length + S.length + (E ? 0 : o.length), T = A < u ? new Array(A = u - A + 1).join(r) : ""; return E && (b = i(T + b, T.length ? u - S.length : 1 / 0)), o += g, e = b + S, ("<" === a ? o + e + T : ">" === a ? T + o + e : "^" === a ? T.substring(0, A >>= 1) + o + e + T.substring(A) : o + (E ? e : T + e)) + n } } } function Be(e) { return e + "" } function $e() { this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]) } function We(e, t, n) { function r(t) { var n = e(t), r = i(n, 1); return t - n < r - t ? n : r } function o(n) { return t(n = e(new fs(n - 1)), 1), n } function i(e, n) { return t(e = new fs(+e), n), e } function a(e, r, i) { var a = o(e), s = []; if (i > 1) for (; a < r;) n(a) % i || s.push(new Date(+a)), t(a, 1); else for (; a < r;) s.push(new Date(+a)), t(a, 1); return s } function s(e, t, n) { try { fs = $e; var r = new $e; return r._ = e, a(r, t, n) } finally { fs = Date } } e.floor = e, e.round = r, e.ceil = o, e.offset = i, e.range = a; var l = e.utc = He(e); return l.floor = l, l.round = He(r), l.ceil = He(o), l.offset = He(i), l.range = s, e } function He(e) { return function(t, n) { try { fs = $e; var r = new $e; return r._ = t, e(r, n)._ } finally { fs = Date } } } function je(e) { function t(e) { function t(t) { for (var n, o, i, a = [], s = -1, l = 0; ++s < r;) 37 === e.charCodeAt(s) && (a.push(e.slice(l, s)), null != (o = ps[n = e.charAt(++s)]) && (n = e.charAt(++s)), (i = x[n]) && (n = i(t, null == o ? "e" === n ? " " : "0" : o)), a.push(n), l = s + 1); return a.push(e.slice(l, s)), a.join("") } var r = e.length; return t.parse = function(t) { var r = { y: 1900, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0, Z: null }, o = n(r, e, t, 0); if (o != t.length) return null; "p" in r && (r.H = r.H % 12 + 12 * r.p); var i = null != r.Z && fs !== $e, a = new(i ? $e : fs); return "j" in r ? a.setFullYear(r.y, 0, r.j) : "w" in r && ("W" in r || "U" in r) ? (a.setFullYear(r.y, 0, 1), a.setFullYear(r.y, 0, "W" in r ? (r.w + 6) % 7 + 7 * r.W - (a.getDay() + 5) % 7 : r.w + 7 * r.U - (a.getDay() + 6) % 7)) : a.setFullYear(r.y, r.m, r.d), a.setHours(r.H + (r.Z / 100 | 0), r.M + r.Z % 100, r.S, r.L), i ? a._ : a }, t.toString = function() { return e }, t } function n(e, t, n, r) { for (var o, i, a, s = 0, l = t.length, c = n.length; s < l;) { if (r >= c) return -1; if (o = t.charCodeAt(s++), 37 === o) { if (a = t.charAt(s++), i = M[a in ps ? t.charAt(s++) : a], !i || (r = i(e, n, r)) < 0) return -1 } else if (o != n.charCodeAt(r++)) return -1 } return r } function r(e, t, n) { _.lastIndex = 0; var r = _.exec(t.slice(n)); return r ? (e.w = w.get(r[0].toLowerCase()), n + r[0].length) : -1 } function o(e, t, n) { b.lastIndex = 0; var r = b.exec(t.slice(n)); return r ? (e.w = S.get(r[0].toLowerCase()), n + r[0].length) : -1 } function i(e, t, n) { I.lastIndex = 0; var r = I.exec(t.slice(n)); return r ? (e.m = C.get(r[0].toLowerCase()), n + r[0].length) : -1 } function a(e, t, n) { A.lastIndex = 0; var r = A.exec(t.slice(n)); return r ? (e.m = T.get(r[0].toLowerCase()), n + r[0].length) : -1 } function s(e, t, r) { return n(e, x.c.toString(), t, r) } function l(e, t, r) { return n(e, x.x.toString(), t, r) } function c(e, t, r) { return n(e, x.X.toString(), t, r) } function u(e, t, n) { var r = E.get(t.slice(n, n += 2).toLowerCase()); return null == r ? -1 : (e.p = r, n) } var d = e.dateTime, f = e.date, m = e.time, p = e.periods, g = e.days, v = e.shortDays, h = e.months, y = e.shortMonths; t.utc = function(e) { function n(e) { try { fs = $e; var t = new fs; return t._ = e, r(t) } finally { fs = Date } } var r = t(e); return n.parse = function(e) { try { fs = $e; var t = r.parse(e); return t && t._ } finally { fs = Date } }, n.toString = r.toString, n }, t.multi = t.utc.multi = ft; var E = sa.map(), b = qe(g), S = Ke(g), _ = qe(v), w = Ke(v), A = qe(h), T = Ke(h), I = qe(y), C = Ke(y); p.forEach(function(e, t) { E.set(e.toLowerCase(), t) }); var x = { a: function(e) { return v[e.getDay()] }, A: function(e) { return g[e.getDay()] }, b: function(e) { return y[e.getMonth()] }, B: function(e) { return h[e.getMonth()] }, c: t(d), d: function(e, t) { return Ye(e.getDate(), t, 2) }, e: function(e, t) { return Ye(e.getDate(), t, 2) }, H: function(e, t) { return Ye(e.getHours(), t, 2) }, I: function(e, t) { return Ye(e.getHours() % 12 || 12, t, 2) }, j: function(e, t) { return Ye(1 + ds.dayOfYear(e), t, 3) }, L: function(e, t) { return Ye(e.getMilliseconds(), t, 3) }, m: function(e, t) { return Ye(e.getMonth() + 1, t, 2) }, M: function(e, t) { return Ye(e.getMinutes(), t, 2) }, p: function(e) { return p[+(e.getHours() >= 12)] }, S: function(e, t) { return Ye(e.getSeconds(), t, 2) }, U: function(e, t) { return Ye(ds.sundayOfYear(e), t, 2) }, w: function(e) { return e.getDay() }, W: function(e, t) { return Ye(ds.mondayOfYear(e), t, 2) }, x: t(f), X: t(m), y: function(e, t) { return Ye(e.getFullYear() % 100, t, 2) }, Y: function(e, t) { return Ye(e.getFullYear() % 1e4, t, 4) }, Z: ut, "%": function() { return "%" } }, M = { a: r, A: o, b: i, B: a, c: s, d: ot, e: ot, H: at, I: at, j: it, L: ct, m: rt, M: st, p: u, S: lt, U: Ze, w: Qe, W: Xe, x: l, X: c, y: et, Y: Je, Z: tt, "%": dt }; return t } function Ye(e, t, n) { var r = e < 0 ? "-" : "", o = (r ? -e : e) + "", i = o.length; return r + (i < n ? new Array(n - i + 1).join(t) + o : o) } function qe(e) { return new RegExp("^(?:" + e.map(sa.requote).join("|") + ")", "i") } function Ke(e) { for (var t = new p, n = -1, r = e.length; ++n < r;) t.set(e[n].toLowerCase(), n); return t } function Qe(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n, n + 1)); return r ? (e.w = +r[0], n + r[0].length) : -1 } function Ze(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n)); return r ? (e.U = +r[0], n + r[0].length) : -1 } function Xe(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n)); return r ? (e.W = +r[0], n + r[0].length) : -1 } function Je(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n, n + 4)); return r ? (e.y = +r[0], n + r[0].length) : -1 } function et(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n, n + 2)); return r ? (e.y = nt(+r[0]), n + r[0].length) : -1 } function tt(e, t, n) { return /^[+-]\d{4}$/.test(t = t.slice(n, n + 5)) ? (e.Z = -t, n + 5) : -1 } function nt(e) { return e + (e > 68 ? 1900 : 2e3) } function rt(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n, n + 2)); return r ? (e.m = r[0] - 1, n + r[0].length) : -1 } function ot(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n, n + 2)); return r ? (e.d = +r[0], n + r[0].length) : -1 } function it(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n, n + 3)); return r ? (e.j = +r[0], n + r[0].length) : -1 } function at(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n, n + 2)); return r ? (e.H = +r[0], n + r[0].length) : -1 } function st(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n, n + 2)); return r ? (e.M = +r[0], n + r[0].length) : -1 } function lt(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n, n + 2)); return r ? (e.S = +r[0], n + r[0].length) : -1 } function ct(e, t, n) { gs.lastIndex = 0; var r = gs.exec(t.slice(n, n + 3)); return r ? (e.L = +r[0], n + r[0].length) : -1 } function ut(e) { var t = e.getTimezoneOffset(), n = t > 0 ? "-" : "+", r = ha(t) / 60 | 0, o = ha(t) % 60; return n + Ye(r, "0", 2) + Ye(o, "0", 2) } function dt(e, t, n) { vs.lastIndex = 0; var r = vs.exec(t.slice(n, n + 1)); return r ? n + r[0].length : -1 } function ft(e) { for (var t = e.length, n = -1; ++n < t;) e[n][0] = this(e[n][0]); return function(t) { for (var n = 0, r = e[n]; !r[1](t);) r = e[++n]; return r[0](t) } } function mt() {} function pt(e, t, n) { var r = n.s = e + t, o = r - e, i = r - o; n.t = e - i + (t - o) } function gt(e, t) { e && bs.hasOwnProperty(e.type) && bs[e.type](e, t) } function vt(e, t, n) { var r, o = -1, i = e.length - n; for (t.lineStart(); ++o < i;) r = e[o], t.point(r[0], r[1], r[2]); t.lineEnd() } function ht(e, t) { var n = -1, r = e.length; for (t.polygonStart(); ++n < r;) vt(e[n], t, 1); t.polygonEnd() } function yt() { function e(e, t) { e *= Ua, t = t * Ua / 2 + Pa / 4; var n = e - r, a = n >= 0 ? 1 : -1, s = a * n, l = Math.cos(t), c = Math.sin(t), u = i * c, d = o * l + u * Math.cos(s), f = u * a * Math.sin(s); _s.add(Math.atan2(f, d)), r = e, o = l, i = c } var t, n, r, o, i; ws.point = function(a, s) { ws.point = e, r = (t = a) * Ua, o = Math.cos(s = (n = s) * Ua / 2 + Pa / 4), i = Math.sin(s) }, ws.lineEnd = function() { e(t, n) } } function Et(e) { var t = e[0], n = e[1], r = Math.cos(n); return [r * Math.cos(t), r * Math.sin(t), Math.sin(n)] } function bt(e, t) { return e[0] * t[0] + e[1] * t[1] + e[2] * t[2] } function St(e, t) { return [e[1] * t[2] - e[2] * t[1], e[2] * t[0] - e[0] * t[2], e[0] * t[1] - e[1] * t[0]] } function _t(e, t) { e[0] += t[0], e[1] += t[1], e[2] += t[2] } function wt(e, t) { return [e[0] * t, e[1] * t, e[2] * t] } function At(e) { var t = Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2]); e[0] /= t, e[1] /= t, e[2] /= t } function Tt(e) { return [Math.atan2(e[1], e[0]), ae(e[2])] } function It(e, t) { return ha(e[0] - t[0]) < Na && ha(e[1] - t[1]) < Na } function Ct(e, t) { e *= Ua; var n = Math.cos(t *= Ua); xt(n * Math.cos(e), n * Math.sin(e), Math.sin(t)) } function xt(e, t, n) { ++As, Is += (e - Is) / As, Cs += (t - Cs) / As, xs += (n - xs) / As } function Mt() { function e(e, o) { e *= Ua; var i = Math.cos(o *= Ua), a = i * Math.cos(e), s = i * Math.sin(e), l = Math.sin(o), c = Math.atan2(Math.sqrt((c = n * l - r * s) * c + (c = r * a - t * l) * c + (c = t * s - n * a) * c), t * a + n * s + r * l); Ts += c, Ms += c * (t + (t = a)), Ds += c * (n + (n = s)), Os += c * (r + (r = l)), xt(t, n, r) } var t, n, r; Ps.point = function(o, i) { o *= Ua; var a = Math.cos(i *= Ua); t = a * Math.cos(o), n = a * Math.sin(o), r = Math.sin(i), Ps.point = e, xt(t, n, r) } } function Dt() { Ps.point = Ct } function Ot() { function e(e, t) { e *= Ua; var n = Math.cos(t *= Ua), a = n * Math.cos(e), s = n * Math.sin(e), l = Math.sin(t), c = o * l - i * s, u = i * a - r * l, d = r * s - o * a, f = Math.sqrt(c * c + u * u + d * d), m = r * a + o * s + i * l, p = f && -ie(m) / f, g = Math.atan2(f, m); Rs += p * c, Ns += p * u, Ls += p * d, Ts += g, Ms += g * (r + (r = a)), Ds += g * (o + (o = s)), Os += g * (i + (i = l)), xt(r, o, i) } var t, n, r, o, i; Ps.point = function(a, s) { t = a, n = s, Ps.point = e, a *= Ua; var l = Math.cos(s *= Ua); r = l * Math.cos(a), o = l * Math.sin(a), i = Math.sin(s), xt(r, o, i) }, Ps.lineEnd = function() { e(t, n), Ps.lineEnd = Dt, Ps.point = Ct } } function Rt(e, t) { function n(n, r) { return n = e(n, r), t(n[0], n[1]) } return e.invert && t.invert && (n.invert = function(n, r) { return n = t.invert(n, r), n && e.invert(n[0], n[1]) }), n } function Nt() { return !0 } function Lt(e, t, n, r, o) { var i = [], a = []; if (e.forEach(function(e) { if (!((t = e.length - 1) <= 0)) { var t, n = e[0], r = e[t]; if (It(n, r)) { o.lineStart(); for (var s = 0; s < t; ++s) o.point((n = e[s])[0], n[1]); return void o.lineEnd() } var l = new kt(n, e, null, !0), c = new kt(n, null, l, !1); l.o = c, i.push(l), a.push(c), l = new kt(r, e, null, !1), c = new kt(r, null, l, !0), l.o = c, i.push(l), a.push(c) } }), a.sort(t), Pt(i), Pt(a), i.length) { for (var s = 0, l = n, c = a.length; s < c; ++s) a[s].e = l = !l; for (var u, d, f = i[0];;) { for (var m = f, p = !0; m.v;) if ((m = m.n) === f) return; u = m.z, o.lineStart(); do { if (m.v = m.o.v = !0, m.e) { if (p) for (var s = 0, c = u.length; s < c; ++s) o.point((d = u[s])[0], d[1]); else r(m.x, m.n.x, 1, o); m = m.n } else { if (p) { u = m.p.z; for (var s = u.length - 1; s >= 0; --s) o.point((d = u[s])[0], d[1]) } else r(m.x, m.p.x, -1, o); m = m.p } m = m.o, u = m.z, p = !p } while (!m.v); o.lineEnd() } } } function Pt(e) { if (t = e.length) { for (var t, n, r = 0, o = e[0]; ++r < t;) o.n = n = e[r], n.p = o, o = n; o.n = n = e[0], n.p = o } } function kt(e, t, n, r) { this.x = e, this.z = t, this.o = n, this.e = r, this.v = !1, this.n = this.p = null } function Gt(e, t, n, r) { return function(o, i) { function a(t, n) { var r = o(t, n); e(t = r[0], n = r[1]) && i.point(t, n) } function s(e, t) { var n = o(e, t); v.point(n[0], n[1]) } function l() { y.point = s, v.lineStart() } function c() { y.point = a, v.lineEnd() } function u(e, t) { g.push([e, t]); var n = o(e, t); b.point(n[0], n[1]) } function d() { b.lineStart(), g = [] } function f() { u(g[0][0], g[0][1]), b.lineEnd(); var e, t = b.clean(), n = E.buffer(), r = n.length; if (g.pop(), p.push(g), g = null, r) if (1 & t) { e = n[0]; var o, r = e.length - 1, a = -1; if (r > 0) { for (S || (i.polygonStart(), S = !0), i.lineStart(); ++a < r;) i.point((o = e[a])[0], o[1]); i.lineEnd() } } else r > 1 && 2 & t && n.push(n.pop().concat(n.shift())), m.push(n.filter(Ft)) } var m, p, g, v = t(i), h = o.invert(r[0], r[1]), y = { point: a, lineStart: l, lineEnd: c, polygonStart: function() { y.point = u, y.lineStart = d, y.lineEnd = f, m = [], p = [] }, polygonEnd: function() { y.point = a, y.lineStart = l, y.lineEnd = c, m = sa.merge(m); var e = Wt(h, p); m.length ? (S || (i.polygonStart(), S = !0), Lt(m, Vt, e, n, i)) : e && (S || (i.polygonStart(), S = !0), i.lineStart(), n(null, null, 1, i), i.lineEnd()), S && (i.polygonEnd(), S = !1), m = p = null }, sphere: function() { i.polygonStart(), i.lineStart(), n(null, null, 1, i), i.lineEnd(), i.polygonEnd() } }, E = Ut(), b = t(E), S = !1; return y } } function Ft(e) { return e.length > 1 } function Ut() { var e, t = []; return { lineStart: function() { t.push(e = []) }, point: function(t, n) { e.push([t, n]) }, lineEnd: I, buffer: function() { var n = t; return t = [], e = null, n }, rejoin: function() { t.length > 1 && t.push(t.pop().concat(t.shift())) } } } function Vt(e, t) { return ((e = e.x)[0] < 0 ? e[1] - Fa - Na : Fa - e[1]) - ((t = t.x)[0] < 0 ? t[1] - Fa - Na : Fa - t[1]) } function zt(e) { var t, n = NaN, r = NaN, o = NaN; return { lineStart: function() { e.lineStart(), t = 1 }, point: function(i, a) { var s = i > 0 ? Pa : -Pa, l = ha(i - n); ha(l - Pa) < Na ? (e.point(n, r = (r + a) / 2 > 0 ? Fa : -Fa), e.point(o, r), e.lineEnd(), e.lineStart(), e.point(s, r), e.point(i, r), t = 0) : o !== s && l >= Pa && (ha(n - o) < Na && (n -= o * Na), ha(i - s) < Na && (i -= s * Na), r = Bt(n, r, i, a), e.point(o, r), e.lineEnd(), e.lineStart(), e.point(s, r), t = 0), e.point(n = i, r = a), o = s }, lineEnd: function() { e.lineEnd(), n = r = NaN }, clean: function() { return 2 - t } } } function Bt(e, t, n, r) { var o, i, a = Math.sin(e - n); return ha(a) > Na ? Math.atan((Math.sin(t) * (i = Math.cos(r)) * Math.sin(n) - Math.sin(r) * (o = Math.cos(t)) * Math.sin(e)) / (o * i * a)) : (t + r) / 2 } function $t(e, t, n, r) { var o; if (null == e) o = n * Fa, r.point(-Pa, o), r.point(0, o), r.point(Pa, o), r.point(Pa, 0), r.point(Pa, -o), r.point(0, -o), r.point(-Pa, -o), r.point(-Pa, 0), r.point(-Pa, o); else if (ha(e[0] - t[0]) > Na) { var i = e[0] < t[0] ? Pa : -Pa; o = n * i / 2, r.point(-i, o), r.point(0, o), r.point(i, o) } else r.point(t[0], t[1]) } function Wt(e, t) { var n = e[0], r = e[1], o = [Math.sin(n), -Math.cos(n), 0], i = 0, a = 0; _s.reset(); for (var s = 0, l = t.length; s < l; ++s) { var c = t[s], u = c.length; if (u) for (var d = c[0], f = d[0], m = d[1] / 2 + Pa / 4, p = Math.sin(m), g = Math.cos(m), v = 1;;) { v === u && (v = 0), e = c[v]; var h = e[0], y = e[1] / 2 + Pa / 4, E = Math.sin(y), b = Math.cos(y), S = h - f, _ = S >= 0 ? 1 : -1, w = _ * S, A = w > Pa, T = p * E; if (_s.add(Math.atan2(T * _ * Math.sin(w), g * b + T * Math.cos(w))), i += A ? S + _ * ka : S, A ^ f >= n ^ h >= n) { var I = St(Et(d), Et(e)); At(I); var C = St(o, I); At(C); var x = (A ^ S >= 0 ? -1 : 1) * ae(C[2]); (r > x || r === x && (I[0] || I[1])) && (a += A ^ S >= 0 ? 1 : -1) } if (!v++) break; f = h, p = E, g = b, d = e } } return (i < -Na || i < Na && _s < 0) ^ 1 & a } function Ht(e) { function t(e, t) { return Math.cos(e) * Math.cos(t) > i } function n(e) { var n, i, l, c, u; return { lineStart: function() { c = l = !1, u = 1 }, point: function(d, f) { var m, p = [d, f], g = t(d, f), v = a ? g ? 0 : o(d, f) : g ? o(d + (d < 0 ? Pa : -Pa), f) : 0; if (!n && (c = l = g) && e.lineStart(), g !== l && (m = r(n, p), (It(n, m) || It(p, m)) && (p[0] += Na, p[1] += Na, g = t(p[0], p[1]))), g !== l) u = 0, g ? (e.lineStart(), m = r(p, n), e.point(m[0], m[1])) : (m = r(n, p), e.point(m[0], m[1]), e.lineEnd()), n = m; else if (s && n && a ^ g) { var h; v & i || !(h = r(p, n, !0)) || (u = 0, a ? (e.lineStart(), e.point(h[0][0], h[0][1]), e.point(h[1][0], h[1][1]), e.lineEnd()) : (e.point(h[1][0], h[1][1]), e.lineEnd(), e.lineStart(), e.point(h[0][0], h[0][1]))) }!g || n && It(n, p) || e.point(p[0], p[1]), n = p, l = g, i = v }, lineEnd: function() { l && e.lineEnd(), n = null }, clean: function() { return u | (c && l) << 1 } } } function r(e, t, n) { var r = Et(e), o = Et(t), a = [1, 0, 0], s = St(r, o), l = bt(s, s), c = s[0], u = l - c * c; if (!u) return !n && e; var d = i * l / u, f = -i * c / u, m = St(a, s), p = wt(a, d), g = wt(s, f); _t(p, g); var v = m, h = bt(p, v), y = bt(v, v), E = h * h - y * (bt(p, p) - 1); if (!(E < 0)) { var b = Math.sqrt(E), S = wt(v, (-h - b) / y); if (_t(S, p), S = Tt(S), !n) return S; var _, w = e[0], A = t[0], T = e[1], I = t[1]; A < w && (_ = w, w = A, A = _); var C = A - w, x = ha(C - Pa) < Na, M = x || C < Na; if (!x && I < T && (_ = T, T = I, I = _), M ? x ? T + I > 0 ^ S[1] < (ha(S[0] - w) < Na ? T : I) : T <= S[1] && S[1] <= I : C > Pa ^ (w <= S[0] && S[0] <= A)) { var D = wt(v, (-h + b) / y); return _t(D, p), [S, Tt(D)] } } } function o(t, n) { var r = a ? e : Pa - e, o = 0; return t < -r ? o |= 1 : t > r && (o |= 2), n < -r ? o |= 4 : n > r && (o |= 8), o } var i = Math.cos(e), a = i > 0, s = ha(i) > Na, l = En(e, 6 * Ua); return Gt(t, n, l, a ? [0, -e] : [-Pa, e - Pa]) } function jt(e, t, n, r) { return function(o) { var i, a = o.a, s = o.b, l = a.x, c = a.y, u = s.x, d = s.y, f = 0, m = 1, p = u - l, g = d - c; if (i = e - l, p || !(i > 0)) { if (i /= p, p < 0) { if (i < f) return; i < m && (m = i) } else if (p > 0) { if (i > m) return; i > f && (f = i) } if (i = n - l, p || !(i < 0)) { if (i /= p, p < 0) { if (i > m) return; i > f && (f = i) } else if (p > 0) { if (i < f) return; i < m && (m = i) } if (i = t - c, g || !(i > 0)) { if (i /= g, g < 0) { if (i < f) return; i < m && (m = i) } else if (g > 0) { if (i > m) return; i > f && (f = i) } if (i = r - c, g || !(i < 0)) { if (i /= g, g < 0) { if (i > m) return; i > f && (f = i) } else if (g > 0) { if (i < f) return; i < m && (m = i) } return f > 0 && (o.a = { x: l + f * p, y: c + f * g }), m < 1 && (o.b = { x: l + m * p, y: c + m * g }), o } } } } } } function Yt(e, t, n, r) { function o(r, o) { return ha(r[0] - e) < Na ? o > 0 ? 0 : 3 : ha(r[0] - n) < Na ? o > 0 ? 2 : 1 : ha(r[1] - t) < Na ? o > 0 ? 1 : 0 : o > 0 ? 3 : 2 } function i(e, t) { return a(e.x, t.x) } function a(e, t) { var n = o(e, 1), r = o(t, 1); return n !== r ? n - r : 0 === n ? t[1] - e[1] : 1 === n ? e[0] - t[0] : 2 === n ? e[1] - t[1] : t[0] - e[0] } return function(s) { function l(e) { for (var t = 0, n = v.length, r = e[1], o = 0; o < n; ++o) for (var i, a = 1, s = v[o], l = s.length, c = s[0]; a < l; ++a) i = s[a], c[1] <= r ? i[1] > r && oe(c, i, e) > 0 && ++t : i[1] <= r && oe(c, i, e) < 0 && --t, c = i; return 0 !== t } function c(i, s, l, c) { var u = 0, d = 0; if (null == i || (u = o(i, l)) !== (d = o(s, l)) || a(i, s) < 0 ^ l > 0) { do c.point(0 === u || 3 === u ? e : n, u > 1 ? r : t); while ((u = (u + l + 4) % 4) !== d) } else c.point(s[0], s[1]) } function u(o, i) { return e <= o && o <= n && t <= i && i <= r } function d(e, t) { u(e, t) && s.point(e, t) } function f() { M.point = p, v && v.push(h = []), A = !0, w = !1, S = _ = NaN } function m() { g && (p(y, E), b && w && C.rejoin(), g.push(C.buffer())), M.point = d, w && s.lineEnd() } function p(e, t) { e = Math.max(-Gs, Math.min(Gs, e)), t = Math.max(-Gs, Math.min(Gs, t)); var n = u(e, t); if (v && h.push([e, t]), A) y = e, E = t, b = n, A = !1, n && (s.lineStart(), s.point(e, t)); else if (n && w) s.point(e, t); else { var r = { a: { x: S, y: _ }, b: { x: e, y: t } }; x(r) ? (w || (s.lineStart(), s.point(r.a.x, r.a.y)), s.point(r.b.x, r.b.y), n || s.lineEnd(), T = !1) : n && (s.lineStart(), s.point(e, t), T = !1) } S = e, _ = t, w = n } var g, v, h, y, E, b, S, _, w, A, T, I = s, C = Ut(), x = jt(e, t, n, r), M = { point: d, lineStart: f, lineEnd: m, polygonStart: function() { s = C, g = [], v = [], T = !0 }, polygonEnd: function() { s = I, g = sa.merge(g); var t = l([e, r]), n = T && t, o = g.length; (n || o) && (s.polygonStart(), n && (s.lineStart(), c(null, null, 1, s), s.lineEnd()), o && Lt(g, i, t, c, s), s.polygonEnd()), g = v = h = null } }; return M } } function qt(e) { var t = 0, n = Pa / 3, r = dn(e), o = r(t, n); return o.parallels = function(e) { return arguments.length ? r(t = e[0] * Pa / 180, n = e[1] * Pa / 180) : [t / Pa * 180, n / Pa * 180] }, o } function Kt(e, t) { function n(e, t) { var n = Math.sqrt(i - 2 * o * Math.sin(t)) / o; return [n * Math.sin(e *= o), a - n * Math.cos(e)] } var r = Math.sin(e), o = (r + Math.sin(t)) / 2, i = 1 + r * (2 * o - r), a = Math.sqrt(i) / o; return n.invert = function(e, t) { var n = a - t; return [Math.atan2(e, n) / o, ae((i - (e * e + n * n) * o * o) / (2 * o))] }, n } function Qt() { function e(e, t) { Us += o * e - r * t, r = e, o = t } var t, n, r, o; Ws.point = function(i, a) { Ws.point = e, t = r = i, n = o = a }, Ws.lineEnd = function() { e(t, n) } } function Zt(e, t) { e < Vs && (Vs = e), e > Bs && (Bs = e), t < zs && (zs = t), t > $s && ($s = t) } function Xt() { function e(e, t) { a.push("M", e, ",", t, i) } function t(e, t) { a.push("M", e, ",", t), s.point = n } function n(e, t) { a.push("L", e, ",", t) } function r() { s.point = e } function o() { a.push("Z") } var i = Jt(4.5), a = [], s = { point: e, lineStart: function() { s.point = t }, lineEnd: r, polygonStart: function() { s.lineEnd = o }, polygonEnd: function() { s.lineEnd = r, s.point = e }, pointRadius: function(e) { return i = Jt(e), s }, result: function() { if (a.length) { var e = a.join(""); return a = [], e } } }; return s } function Jt(e) { return "m0," + e + "a" + e + "," + e + " 0 1,1 0," + -2 * e + "a" + e + "," + e + " 0 1,1 0," + 2 * e + "z" } function en(e, t) { Is += e, Cs += t, ++xs } function tn() { function e(e, r) { var o = e - t, i = r - n, a = Math.sqrt(o * o + i * i); Ms += a * (t + e) / 2, Ds += a * (n + r) / 2, Os += a, en(t = e, n = r) } var t, n; js.point = function(r, o) { js.point = e, en(t = r, n = o) } } function nn() { js.point = en } function rn() { function e(e, t) { var n = e - r, i = t - o, a = Math.sqrt(n * n + i * i); Ms += a * (r + e) / 2, Ds += a * (o + t) / 2, Os += a, a = o * e - r * t, Rs += a * (r + e), Ns += a * (o + t), Ls += 3 * a, en(r = e, o = t) } var t, n, r, o; js.point = function(i, a) { js.point = e, en(t = r = i, n = o = a) }, js.lineEnd = function() { e(t, n) } } function on(e) { function t(t, n) { e.moveTo(t + a, n), e.arc(t, n, a, 0, ka) } function n(t, n) { e.moveTo(t, n), s.point = r } function r(t, n) { e.lineTo(t, n) } function o() { s.point = t } function i() { e.closePath() } var a = 4.5, s = { point: t, lineStart: function() { s.point = n }, lineEnd: o, polygonStart: function() { s.lineEnd = i }, polygonEnd: function() { s.lineEnd = o, s.point = t }, pointRadius: function(e) { return a = e, s }, result: I }; return s } function an(e) { function t(e) { return (s ? r : n)(e) } function n(t) { return cn(t, function(n, r) { n = e(n, r), t.point(n[0], n[1]) }) } function r(t) { function n(n, r) { n = e(n, r), t.point(n[0], n[1]) } function r() { E = NaN, A.point = i, t.lineStart() } function i(n, r) { var i = Et([n, r]), a = e(n, r); o(E, b, y, S, _, w, E = a[0], b = a[1], y = n, S = i[0], _ = i[1], w = i[2], s, t), t.point(E, b) } function a() { A.point = n, t.lineEnd() } function l() { r(), A.point = c, A.lineEnd = u } function c(e, t) { i(d = e, f = t), m = E, p = b, g = S, v = _, h = w, A.point = i } function u() { o(E, b, y, S, _, w, m, p, d, g, v, h, s, t), A.lineEnd = a, a() } var d, f, m, p, g, v, h, y, E, b, S, _, w, A = { point: n, lineStart: r, lineEnd: a, polygonStart: function() { t.polygonStart(), A.lineStart = l }, polygonEnd: function() { t.polygonEnd(), A.lineStart = r } }; return A } function o(t, n, r, s, l, c, u, d, f, m, p, g, v, h) { var y = u - t, E = d - n, b = y * y + E * E; if (b > 4 * i && v--) { var S = s + m, _ = l + p, w = c + g, A = Math.sqrt(S * S + _ * _ + w * w), T = Math.asin(w /= A), I = ha(ha(w) - 1) < Na || ha(r - f) < Na ? (r + f) / 2 : Math.atan2(_, S), C = e(I, T), x = C[0], M = C[1], D = x - t, O = M - n, R = E * D - y * O; (R * R / b > i || ha((y * D + E * O) / b - .5) > .3 || s * m + l * p + c * g < a) && (o(t, n, r, s, l, c, x, M, I, S /= A, _ /= A, w, v, h), h.point(x, M), o(x, M, I, S, _, w, u, d, f, m, p, g, v, h)) } } var i = .5, a = Math.cos(30 * Ua), s = 16; return t.precision = function(e) { return arguments.length ? (s = (i = e * e) > 0 && 16, t) : Math.sqrt(i) }, t } function sn(e) { var t = an(function(t, n) { return e([t * Va, n * Va]) }); return function(e) { return fn(t(e)) } } function ln(e) { this.stream = e } function cn(e, t) { return { point: t, sphere: function() { e.sphere() }, lineStart: function() { e.lineStart() }, lineEnd: function() { e.lineEnd() }, polygonStart: function() { e.polygonStart() }, polygonEnd: function() { e.polygonEnd() } } } function un(e) { return dn(function() { return e })() } function dn(e) { function t(e) { return e = s(e[0] * Ua, e[1] * Ua), [e[0] * f + l, c - e[1] * f] } function n(e) { return e = s.invert((e[0] - l) / f, (c - e[1]) / f), e && [e[0] * Va, e[1] * Va] } function r() { s = Rt(a = gn(h, y, E), i); var e = i(g, v); return l = m - e[0] * f, c = p + e[1] * f, o() } function o() { return u && (u.valid = !1, u = null), t } var i, a, s, l, c, u, d = an(function(e, t) { return e = i(e, t), [e[0] * f + l, c - e[1] * f] }), f = 150, m = 480, p = 250, g = 0, v = 0, h = 0, y = 0, E = 0, b = ks, S = w, _ = null, A = null; return t.stream = function(e) { return u && (u.valid = !1), u = fn(b(a, d(S(e)))), u.valid = !0, u }, t.clipAngle = function(e) { return arguments.length ? (b = null == e ? (_ = e, ks) : Ht((_ = +e) * Ua), o()) : _ }, t.clipExtent = function(e) { return arguments.length ? (A = e, S = e ? Yt(e[0][0], e[0][1], e[1][0], e[1][1]) : w, o()) : A }, t.scale = function(e) { return arguments.length ? (f = +e, r()) : f }, t.translate = function(e) { return arguments.length ? (m = +e[0], p = +e[1], r()) : [m, p] }, t.center = function(e) { return arguments.length ? (g = e[0] % 360 * Ua, v = e[1] % 360 * Ua, r()) : [g * Va, v * Va] }, t.rotate = function(e) { return arguments.length ? (h = e[0] % 360 * Ua, y = e[1] % 360 * Ua, E = e.length > 2 ? e[2] % 360 * Ua : 0, r()) : [h * Va, y * Va, E * Va] }, sa.rebind(t, d, "precision"), function() { return i = e.apply(this, arguments), t.invert = i.invert && n, r() } } function fn(e) { return cn(e, function(t, n) { e.point(t * Ua, n * Ua) }) } function mn(e, t) { return [e, t] } function pn(e, t) { return [e > Pa ? e - ka : e < -Pa ? e + ka : e, t] } function gn(e, t, n) { return e ? t || n ? Rt(hn(e), yn(t, n)) : hn(e) : t || n ? yn(t, n) : pn } function vn(e) { return function(t, n) { return t += e, [t > Pa ? t - ka : t < -Pa ? t + ka : t, n] } } function hn(e) { var t = vn(e); return t.invert = vn(-e), t } function yn(e, t) { function n(e, t) { var n = Math.cos(t), s = Math.cos(e) * n, l = Math.sin(e) * n, c = Math.sin(t), u = c * r + s * o; return [Math.atan2(l * i - u * a, s * r - c * o), ae(u * i + l * a)] } var r = Math.cos(e), o = Math.sin(e), i = Math.cos(t), a = Math.sin(t); return n.invert = function(e, t) { var n = Math.cos(t), s = Math.cos(e) * n, l = Math.sin(e) * n, c = Math.sin(t), u = c * i - l * a; return [Math.atan2(l * i + c * a, s * r + u * o), ae(u * r - s * o)] }, n } function En(e, t) { var n = Math.cos(e), r = Math.sin(e); return function(o, i, a, s) { var l = a * t; null != o ? (o = bn(n, o), i = bn(n, i), (a > 0 ? o < i : o > i) && (o += a * ka)) : (o = e + a * ka, i = e - .5 * l); for (var c, u = o; a > 0 ? u > i : u < i; u -= l) s.point((c = Tt([n, -r * Math.cos(u), -r * Math.sin(u)]))[0], c[1]) } } function bn(e, t) { var n = Et(t); n[0] -= e, At(n); var r = ie(-n[1]); return ((-n[2] < 0 ? -r : r) + 2 * Math.PI - Na) % (2 * Math.PI) } function Sn(e, t, n) { var r = sa.range(e, t - Na, n).concat(t); return function(e) { return r.map(function(t) { return [e, t] }) } } function _n(e, t, n) { var r = sa.range(e, t - Na, n).concat(t); return function(e) { return r.map(function(t) { return [t, e] }) } } function wn(e) { return e.source } function An(e) { return e.target } function Tn(e, t, n, r) { var o = Math.cos(t), i = Math.sin(t), a = Math.cos(r), s = Math.sin(r), l = o * Math.cos(e), c = o * Math.sin(e), u = a * Math.cos(n), d = a * Math.sin(n), f = 2 * Math.asin(Math.sqrt(ue(r - t) + o * a * ue(n - e))), m = 1 / Math.sin(f), p = f ? function(e) { var t = Math.sin(e *= f) * m, n = Math.sin(f - e) * m, r = n * l + t * u, o = n * c + t * d, a = n * i + t * s; return [Math.atan2(o, r) * Va, Math.atan2(a, Math.sqrt(r * r + o * o)) * Va] } : function() { return [e * Va, t * Va] }; return p.distance = f, p } function In() { function e(e, o) { var i = Math.sin(o *= Ua), a = Math.cos(o), s = ha((e *= Ua) - t), l = Math.cos(s); Ys += Math.atan2(Math.sqrt((s = a * Math.sin(s)) * s + (s = r * i - n * a * l) * s), n * i + r * a * l), t = e, n = i, r = a } var t, n, r; qs.point = function(o, i) { t = o * Ua, n = Math.sin(i *= Ua), r = Math.cos(i), qs.point = e }, qs.lineEnd = function() { qs.point = qs.lineEnd = I } } function Cn(e, t) { function n(t, n) { var r = Math.cos(t), o = Math.cos(n), i = e(r * o); return [i * o * Math.sin(t), i * Math.sin(n)] } return n.invert = function(e, n) { var r = Math.sqrt(e * e + n * n), o = t(r), i = Math.sin(o), a = Math.cos(o); return [Math.atan2(e * i, r * a), Math.asin(r && n * i / r)] }, n } function xn(e, t) { function n(e, t) { a > 0 ? t < -Fa + Na && (t = -Fa + Na) : t > Fa - Na && (t = Fa - Na); var n = a / Math.pow(o(t), i); return [n * Math.sin(i * e), a - n * Math.cos(i * e)] } var r = Math.cos(e), o = function(e) { return Math.tan(Pa / 4 + e / 2) }, i = e === t ? Math.sin(e) : Math.log(r / Math.cos(t)) / Math.log(o(t) / o(e)), a = r * Math.pow(o(e), i) / i; return i ? (n.invert = function(e, t) { var n = a - t, r = re(i) * Math.sqrt(e * e + n * n); return [Math.atan2(e, n) / i, 2 * Math.atan(Math.pow(a / r, 1 / i)) - Fa] }, n) : Dn } function Mn(e, t) { function n(e, t) { var n = i - t; return [n * Math.sin(o * e), i - n * Math.cos(o * e)] } var r = Math.cos(e), o = e === t ? Math.sin(e) : (r - Math.cos(t)) / (t - e), i = r / o + e; return ha(o) < Na ? mn : (n.invert = function(e, t) { var n = i - t; return [Math.atan2(e, n) / o, i - re(o) * Math.sqrt(e * e + n * n)] }, n) } function Dn(e, t) { return [e, Math.log(Math.tan(Pa / 4 + t / 2))] } function On(e) { var t, n = un(e), r = n.scale, o = n.translate, i = n.clipExtent; return n.scale = function() { var e = r.apply(n, arguments); return e === n ? t ? n.clipExtent(null) : n : e }, n.translate = function() { var e = o.apply(n, arguments); return e === n ? t ? n.clipExtent(null) : n : e }, n.clipExtent = function(e) { var a = i.apply(n, arguments); if (a === n) { if (t = null == e) { var s = Pa * r(), l = o(); i([ [l[0] - s, l[1] - s], [l[0] + s, l[1] + s] ]) } } else t && (a = null); return a }, n.clipExtent(null) } function Rn(e, t) { return [Math.log(Math.tan(Pa / 4 + t / 2)), -e] } function Nn(e) { return e[0] } function Ln(e) { return e[1] } function Pn(e) { for (var t = e.length, n = [0, 1], r = 2, o = 2; o < t; o++) { for (; r > 1 && oe(e[n[r - 2]], e[n[r - 1]], e[o]) <= 0;) --r; n[r++] = o } return n.slice(0, r) } function kn(e, t) { return e[0] - t[0] || e[1] - t[1] } function Gn(e, t, n) { return (n[0] - t[0]) * (e[1] - t[1]) < (n[1] - t[1]) * (e[0] - t[0]) } function Fn(e, t, n, r) { var o = e[0], i = n[0], a = t[0] - o, s = r[0] - i, l = e[1], c = n[1], u = t[1] - l, d = r[1] - c, f = (s * (l - c) - d * (o - i)) / (d * a - s * u); return [o + f * a, l + f * u] } function Un(e) { var t = e[0], n = e[e.length - 1]; return !(t[0] - n[0] || t[1] - n[1]) } function Vn() { sr(this), this.edge = this.site = this.circle = null } function zn(e) { var t = al.pop() || new Vn; return t.site = e, t } function Bn(e) { Xn(e), rl.remove(e), al.push(e), sr(e) } function $n(e) { var t = e.circle, n = t.x, r = t.cy, o = { x: n, y: r }, i = e.P, a = e.N, s = [e]; Bn(e); for (var l = i; l.circle && ha(n - l.circle.x) < Na && ha(r - l.circle.cy) < Na;) i = l.P, s.unshift(l), Bn(l), l = i; s.unshift(l), Xn(l); for (var c = a; c.circle && ha(n - c.circle.x) < Na && ha(r - c.circle.cy) < Na;) a = c.N, s.push(c), Bn(c), c = a; s.push(c), Xn(c); var u, d = s.length; for (u = 1; u < d; ++u) c = s[u], l = s[u - 1], or(c.edge, l.site, c.site, o); l = s[0], c = s[d - 1], c.edge = nr(l.site, c.site, null, o), Zn(l), Zn(c) } function Wn(e) { for (var t, n, r, o, i = e.x, a = e.y, s = rl._; s;) if (r = Hn(s, a) - i, r > Na) s = s.L; else { if (o = i - jn(s, a), !(o > Na)) { r > -Na ? (t = s.P, n = s) : o > -Na ? (t = s, n = s.N) : t = n = s; break } if (!s.R) { t = s; break } s = s.R } var l = zn(e); if (rl.insert(t, l), t || n) { if (t === n) return Xn(t), n = zn(t.site), rl.insert(l, n), l.edge = n.edge = nr(t.site, l.site), Zn(t), void Zn(n); if (!n) return void(l.edge = nr(t.site, l.site)); Xn(t), Xn(n); var c = t.site, u = c.x, d = c.y, f = e.x - u, m = e.y - d, p = n.site, g = p.x - u, v = p.y - d, h = 2 * (f * v - m * g), y = f * f + m * m, E = g * g + v * v, b = { x: (v * y - m * E) / h + u, y: (f * E - g * y) / h + d }; or(n.edge, c, p, b), l.edge = nr(c, e, null, b), n.edge = nr(e, p, null, b), Zn(t), Zn(n) } } function Hn(e, t) { var n = e.site, r = n.x, o = n.y, i = o - t; if (!i) return r; var a = e.P; if (!a) return -(1 / 0); n = a.site; var s = n.x, l = n.y, c = l - t; if (!c) return s; var u = s - r, d = 1 / i - 1 / c, f = u / c; return d ? (-f + Math.sqrt(f * f - 2 * d * (u * u / (-2 * c) - l + c / 2 + o - i / 2))) / d + r : (r + s) / 2 } function jn(e, t) { var n = e.N; if (n) return Hn(n, t); var r = e.site; return r.y === t ? r.x : 1 / 0 } function Yn(e) { this.site = e, this.edges = [] } function qn(e) { for (var t, n, r, o, i, a, s, l, c, u, d = e[0][0], f = e[1][0], m = e[0][1], p = e[1][1], g = nl, v = g.length; v--;) if (i = g[v], i && i.prepare()) for (s = i.edges, l = s.length, a = 0; a < l;) u = s[a].end(), r = u.x, o = u.y, c = s[++a % l].start(), t = c.x, n = c.y, (ha(r - t) > Na || ha(o - n) > Na) && (s.splice(a, 0, new ir(rr(i.site, u, ha(r - d) < Na && p - o > Na ? { x: d, y: ha(t - d) < Na ? n : p } : ha(o - p) < Na && f - r > Na ? { x: ha(n - p) < Na ? t : f, y: p } : ha(r - f) < Na && o - m > Na ? { x: f, y: ha(t - f) < Na ? n : m } : ha(o - m) < Na && r - d > Na ? { x: ha(n - m) < Na ? t : d, y: m } : null), i.site, null)), ++l) } function Kn(e, t) { return t.angle - e.angle } function Qn() { sr(this), this.x = this.y = this.arc = this.site = this.cy = null } function Zn(e) { var t = e.P, n = e.N; if (t && n) { var r = t.site, o = e.site, i = n.site; if (r !== i) { var a = o.x, s = o.y, l = r.x - a, c = r.y - s, u = i.x - a, d = i.y - s, f = 2 * (l * d - c * u); if (!(f >= -La)) { var m = l * l + c * c, p = u * u + d * d, g = (d * m - c * p) / f, v = (l * p - u * m) / f, d = v + s, h = sl.pop() || new Qn; h.arc = e, h.site = o, h.x = g + a, h.y = d + Math.sqrt(g * g + v * v), h.cy = d, e.circle = h; for (var y = null, E = il._; E;) if (h.y < E.y || h.y === E.y && h.x <= E.x) { if (!E.L) { y = E.P; break } E = E.L } else { if (!E.R) { y = E; break } E = E.R } il.insert(y, h), y || (ol = h) } } } } function Xn(e) { var t = e.circle; t && (t.P || (ol = t.N), il.remove(t), sl.push(t), sr(t), e.circle = null) } function Jn(e) { for (var t, n = tl, r = jt(e[0][0], e[0][1], e[1][0], e[1][1]), o = n.length; o--;) t = n[o], (!er(t, e) || !r(t) || ha(t.a.x - t.b.x) < Na && ha(t.a.y - t.b.y) < Na) && (t.a = t.b = null, n.splice(o, 1)) } function er(e, t) { var n = e.b; if (n) return !0; var r, o, i = e.a, a = t[0][0], s = t[1][0], l = t[0][1], c = t[1][1], u = e.l, d = e.r, f = u.x, m = u.y, p = d.x, g = d.y, v = (f + p) / 2, h = (m + g) / 2; if (g === m) { if (v < a || v >= s) return; if (f > p) { if (i) { if (i.y >= c) return } else i = { x: v, y: l }; n = { x: v, y: c } } else { if (i) { if (i.y < l) return } else i = { x: v, y: c }; n = { x: v, y: l } } } else if (r = (f - p) / (g - m), o = h - r * v, r < -1 || r > 1) if (f > p) { if (i) { if (i.y >= c) return } else i = { x: (l - o) / r, y: l }; n = { x: (c - o) / r, y: c } } else { if (i) { if (i.y < l) return } else i = { x: (c - o) / r, y: c }; n = { x: (l - o) / r, y: l } } else if (m < g) { if (i) { if (i.x >= s) return } else i = { x: a, y: r * a + o }; n = { x: s, y: r * s + o } } else { if (i) { if (i.x < a) return } else i = { x: s, y: r * s + o }; n = { x: a, y: r * a + o } } return e.a = i, e.b = n, !0 } function tr(e, t) { this.l = e, this.r = t, this.a = this.b = null } function nr(e, t, n, r) { var o = new tr(e, t); return tl.push(o), n && or(o, e, t, n), r && or(o, t, e, r), nl[e.i].edges.push(new ir(o, e, t)), nl[t.i].edges.push(new ir(o, t, e)), o } function rr(e, t, n) { var r = new tr(e, null); return r.a = t, r.b = n, tl.push(r), r } function or(e, t, n, r) { e.a || e.b ? e.l === n ? e.b = r : e.a = r : (e.a = r, e.l = t, e.r = n) } function ir(e, t, n) { var r = e.a, o = e.b; this.edge = e, this.site = t, this.angle = n ? Math.atan2(n.y - t.y, n.x - t.x) : e.l === t ? Math.atan2(o.x - r.x, r.y - o.y) : Math.atan2(r.x - o.x, o.y - r.y) } function ar() { this._ = null } function sr(e) { e.U = e.C = e.L = e.R = e.P = e.N = null } function lr(e, t) { var n = t, r = t.R, o = n.U; o ? o.L === n ? o.L = r : o.R = r : e._ = r, r.U = o, n.U = r, n.R = r.L, n.R && (n.R.U = n), r.L = n } function cr(e, t) { var n = t, r = t.L, o = n.U; o ? o.L === n ? o.L = r : o.R = r : e._ = r, r.U = o, n.U = r, n.L = r.R, n.L && (n.L.U = n), r.R = n } function ur(e) { for (; e.L;) e = e.L; return e } function dr(e, t) { var n, r, o, i = e.sort(fr).pop(); for (tl = [], nl = new Array(e.length), rl = new ar, il = new ar;;) if (o = ol, i && (!o || i.y < o.y || i.y === o.y && i.x < o.x)) i.x === n && i.y === r || (nl[i.i] = new Yn(i), Wn(i), n = i.x, r = i.y), i = e.pop(); else { if (!o) break; $n(o.arc) } t && (Jn(t), qn(t)); var a = { cells: nl, edges: tl }; return rl = il = tl = nl = null, a } function fr(e, t) { return t.y - e.y || t.x - e.x } function mr(e, t, n) { return (e.x - n.x) * (t.y - e.y) - (e.x - t.x) * (n.y - e.y) } function pr(e) { return e.x } function gr(e) { return e.y } function vr() { return { leaf: !0, nodes: [], point: null, x: null, y: null } } function hr(e, t, n, r, o, i) { if (!e(t, n, r, o, i)) { var a = .5 * (n + o), s = .5 * (r + i), l = t.nodes; l[0] && hr(e, l[0], n, r, a, s), l[1] && hr(e, l[1], a, r, o, s), l[2] && hr(e, l[2], n, s, a, i), l[3] && hr(e, l[3], a, s, o, i) } } function yr(e, t, n, r, o, i, a) { var s, l = 1 / 0; return function e(c, u, d, f, m) { if (!(u > i || d > a || f < r || m < o)) { if (p = c.point) { var p, g = t - c.x, v = n - c.y, h = g * g + v * v; if (h < l) { var y = Math.sqrt(l = h); r = t - y, o = n - y, i = t + y, a = n + y, s = p } } for (var E = c.nodes, b = .5 * (u + f), S = .5 * (d + m), _ = t >= b, w = n >= S, A = w << 1 | _, T = A + 4; A < T; ++A) if (c = E[3 & A]) switch (3 & A) { case 0: e(c, u, d, b, S); break; case 1: e(c, b, d, f, S); break; case 2: e(c, u, S, b, m); break; case 3: e(c, b, S, f, m) } } }(e, r, o, i, a), s } function Er(e, t) { e = sa.rgb(e), t = sa.rgb(t); var n = e.r, r = e.g, o = e.b, i = t.r - n, a = t.g - r, s = t.b - o; return function(e) { return "#" + Te(Math.round(n + i * e)) + Te(Math.round(r + a * e)) + Te(Math.round(o + s * e)) } } function br(e, t) { var n, r = {}, o = {}; for (n in e) n in t ? r[n] = wr(e[n], t[n]) : o[n] = e[n]; for (n in t) n in e || (o[n] = t[n]); return function(e) { for (n in r) o[n] = r[n](e); return o } } function Sr(e, t) { return e = +e, t = +t, function(n) { return e * (1 - n) + t * n } } function _r(e, t) { var n, r, o, i = cl.lastIndex = ul.lastIndex = 0, a = -1, s = [], l = []; for (e += "", t += ""; (n = cl.exec(e)) && (r = ul.exec(t));)(o = r.index) > i && (o = t.slice(i, o), s[a] ? s[a] += o : s[++a] = o), (n = n[0]) === (r = r[0]) ? s[a] ? s[a] += r : s[++a] = r : (s[++a] = null, l.push({ i: a, x: Sr(n, r) })), i = ul.lastIndex; return i < t.length && (o = t.slice(i), s[a] ? s[a] += o : s[++a] = o), s.length < 2 ? l[0] ? (t = l[0].x, function(e) { return t(e) + "" }) : function() { return t } : (t = l.length, function(e) { for (var n, r = 0; r < t; ++r) s[(n = l[r]).i] = n.x(e); return s.join("") }) } function wr(e, t) { for (var n, r = sa.interpolators.length; --r >= 0 && !(n = sa.interpolators[r](e, t));); return n } function Ar(e, t) { var n, r = [], o = [], i = e.length, a = t.length, s = Math.min(e.length, t.length); for (n = 0; n < s; ++n) r.push(wr(e[n], t[n])); for (; n < i; ++n) o[n] = e[n]; for (; n < a; ++n) o[n] = t[n]; return function(e) { for (n = 0; n < s; ++n) o[n] = r[n](e); return o } } function Tr(e) { return function(t) { return t <= 0 ? 0 : t >= 1 ? 1 : e(t) } } function Ir(e) { return function(t) { return 1 - e(1 - t) } } function Cr(e) { return function(t) { return .5 * (t < .5 ? e(2 * t) : 2 - e(2 - 2 * t)) } } function xr(e) { return e * e } function Mr(e) { return e * e * e } function Dr(e) { if (e <= 0) return 0; if (e >= 1) return 1; var t = e * e, n = t * e; return 4 * (e < .5 ? n : 3 * (e - t) + n - .75) } function Or(e) { return function(t) { return Math.pow(t, e) } } function Rr(e) { return 1 - Math.cos(e * Fa) } function Nr(e) { return Math.pow(2, 10 * (e - 1)) } function Lr(e) { return 1 - Math.sqrt(1 - e * e) } function Pr(e, t) { var n; return arguments.length < 2 && (t = .45), arguments.length ? n = t / ka * Math.asin(1 / e) : (e = 1, n = t / 4), function(r) { return 1 + e * Math.pow(2, -10 * r) * Math.sin((r - n) * ka / t) } } function kr(e) { return e || (e = 1.70158), function(t) { return t * t * ((e + 1) * t - e) } } function Gr(e) { return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375 } function Fr(e, t) { e = sa.hcl(e), t = sa.hcl(t); var n = e.h, r = e.c, o = e.l, i = t.h - n, a = t.c - r, s = t.l - o; return isNaN(a) && (a = 0, r = isNaN(r) ? t.c : r), isNaN(i) ? (i = 0, n = isNaN(n) ? t.h : n) : i > 180 ? i -= 360 : i < -180 && (i += 360), function(e) { return ge(n + i * e, r + a * e, o + s * e) + "" } } function Ur(e, t) { e = sa.hsl(e), t = sa.hsl(t); var n = e.h, r = e.s, o = e.l, i = t.h - n, a = t.s - r, s = t.l - o; return isNaN(a) && (a = 0, r = isNaN(r) ? t.s : r), isNaN(i) ? (i = 0, n = isNaN(n) ? t.h : n) : i > 180 ? i -= 360 : i < -180 && (i += 360), function(e) { return me(n + i * e, r + a * e, o + s * e) + "" } } function Vr(e, t) { e = sa.lab(e), t = sa.lab(t); var n = e.l, r = e.a, o = e.b, i = t.l - n, a = t.a - r, s = t.b - o; return function(e) { return he(n + i * e, r + a * e, o + s * e) + "" } } function zr(e, t) { return t -= e, function(n) { return Math.round(e + t * n) } } function Br(e) { var t = [e.a, e.b], n = [e.c, e.d], r = Wr(t), o = $r(t, n), i = Wr(Hr(n, t, -o)) || 0; t[0] * n[1] < n[0] * t[1] && (t[0] *= -1, t[1] *= -1, r *= -1, o *= -1), this.rotate = (r ? Math.atan2(t[1], t[0]) : Math.atan2(-n[0], n[1])) * Va, this.translate = [e.e, e.f], this.scale = [r, i], this.skew = i ? Math.atan2(o, i) * Va : 0 } function $r(e, t) { return e[0] * t[0] + e[1] * t[1] } function Wr(e) { var t = Math.sqrt($r(e, e)); return t && (e[0] /= t, e[1] /= t), t } function Hr(e, t, n) { return e[0] += n * t[0], e[1] += n * t[1], e } function jr(e, t) { var n, r = [], o = [], i = sa.transform(e), a = sa.transform(t), s = i.translate, l = a.translate, c = i.rotate, u = a.rotate, d = i.skew, f = a.skew, m = i.scale, p = a.scale; return s[0] != l[0] || s[1] != l[1] ? (r.push("translate(", null, ",", null, ")"), o.push({ i: 1, x: Sr(s[0], l[0]) }, { i: 3, x: Sr(s[1], l[1]) })) : l[0] || l[1] ? r.push("translate(" + l + ")") : r.push(""), c != u ? (c - u > 180 ? u += 360 : u - c > 180 && (c += 360), o.push({ i: r.push(r.pop() + "rotate(", null, ")") - 2, x: Sr(c, u) })) : u && r.push(r.pop() + "rotate(" + u + ")"), d != f ? o.push({ i: r.push(r.pop() + "skewX(", null, ")") - 2, x: Sr(d, f) }) : f && r.push(r.pop() + "skewX(" + f + ")"), m[0] != p[0] || m[1] != p[1] ? (n = r.push(r.pop() + "scale(", null, ",", null, ")"), o.push({ i: n - 4, x: Sr(m[0], p[0]) }, { i: n - 2, x: Sr(m[1], p[1]) })) : 1 == p[0] && 1 == p[1] || r.push(r.pop() + "scale(" + p + ")"), n = o.length, function(e) { for (var t, i = -1; ++i < n;) r[(t = o[i]).i] = t.x(e); return r.join("") } } function Yr(e, t) { return t = (t -= e = +e) || 1 / t, function(n) { return (n - e) / t } } function qr(e, t) { return t = (t -= e = +e) || 1 / t, function(n) { return Math.max(0, Math.min(1, (n - e) / t)) } } function Kr(e) { for (var t = e.source, n = e.target, r = Zr(t, n), o = [t]; t !== r;) t = t.parent, o.push(t); for (var i = o.length; n !== r;) o.splice(i, 0, n), n = n.parent; return o } function Qr(e) { for (var t = [], n = e.parent; null != n;) t.push(e), e = n, n = n.parent; return t.push(e), t } function Zr(e, t) { if (e === t) return e; for (var n = Qr(e), r = Qr(t), o = n.pop(), i = r.pop(), a = null; o === i;) a = o, o = n.pop(), i = r.pop(); return a } function Xr(e) { e.fixed |= 2 } function Jr(e) { e.fixed &= -7 } function eo(e) { e.fixed |= 4, e.px = e.x, e.py = e.y } function to(e) { e.fixed &= -5 } function no(e, t, n) { var r = 0, o = 0; if (e.charge = 0, !e.leaf) for (var i, a = e.nodes, s = a.length, l = -1; ++l < s;) i = a[l], null != i && (no(i, t, n), e.charge += i.charge, r += i.charge * i.cx, o += i.charge * i.cy); if (e.point) { e.leaf || (e.point.x += Math.random() - .5, e.point.y += Math.random() - .5); var c = t * n[e.point.index]; e.charge += e.pointCharge = c, r += c * e.point.x, o += c * e.point.y } e.cx = r / e.charge, e.cy = o / e.charge } function ro(e, t) { return sa.rebind(e, t, "sort", "children", "value"), e.nodes = e, e.links = co, e } function oo(e, t) { for (var n = [e]; null != (e = n.pop());) if (t(e), (o = e.children) && (r = o.length)) for (var r, o; --r >= 0;) n.push(o[r]) } function io(e, t) { for (var n = [e], r = []; null != (e = n.pop());) if (r.push(e), (i = e.children) && (o = i.length)) for (var o, i, a = -1; ++a < o;) n.push(i[a]); for (; null != (e = r.pop());) t(e) } function ao(e) { return e.children } function so(e) { return e.value } function lo(e, t) { return t.value - e.value } function co(e) { return sa.merge(e.map(function(e) { return (e.children || []).map(function(t) { return { source: e, target: t } }) })) } function uo(e) { return e.x } function fo(e) { return e.y } function mo(e, t, n) { e.y0 = t, e.y = n } function po(e) { return sa.range(e.length) } function go(e) { for (var t = -1, n = e[0].length, r = []; ++t < n;) r[t] = 0; return r } function vo(e) { for (var t, n = 1, r = 0, o = e[0][1], i = e.length; n < i; ++n)(t = e[n][1]) > o && (r = n, o = t); return r } function ho(e) { return e.reduce(yo, 0) } function yo(e, t) { return e + t[1] } function Eo(e, t) { return bo(e, Math.ceil(Math.log(t.length) / Math.LN2 + 1)) } function bo(e, t) { for (var n = -1, r = +e[0], o = (e[1] - r) / t, i = []; ++n <= t;) i[n] = o * n + r; return i } function So(e) { return [sa.min(e), sa.max(e)] } function _o(e, t) { return e.value - t.value } function wo(e, t) { var n = e._pack_next; e._pack_next = t, t._pack_prev = e, t._pack_next = n, n._pack_prev = t } function Ao(e, t) { e._pack_next = t, t._pack_prev = e } function To(e, t) { var n = t.x - e.x, r = t.y - e.y, o = e.r + t.r; return .999 * o * o > n * n + r * r } function Io(e) { function t(e) { u = Math.min(e.x - e.r, u), d = Math.max(e.x + e.r, d), f = Math.min(e.y - e.r, f), m = Math.max(e.y + e.r, m) } if ((n = e.children) && (c = n.length)) { var n, r, o, i, a, s, l, c, u = 1 / 0, d = -(1 / 0), f = 1 / 0, m = -(1 / 0); if (n.forEach(Co), r = n[0], r.x = -r.r, r.y = 0, t(r), c > 1 && (o = n[1], o.x = o.r, o.y = 0, t(o), c > 2)) for (i = n[2], Do(r, o, i), t(i), wo(r, i), r._pack_prev = i, wo(i, o), o = r._pack_next, a = 3; a < c; a++) { Do(r, o, i = n[a]); var p = 0, g = 1, v = 1; for (s = o._pack_next; s !== o; s = s._pack_next, g++) if (To(s, i)) { p = 1; break } if (1 == p) for (l = r._pack_prev; l !== s._pack_prev && !To(l, i); l = l._pack_prev, v++); p ? (g < v || g == v && o.r < r.r ? Ao(r, o = s) : Ao(r = l, o), a--) : (wo(r, i), o = i, t(i)) } var h = (u + d) / 2, y = (f + m) / 2, E = 0; for (a = 0; a < c; a++) i = n[a], i.x -= h, i.y -= y, E = Math.max(E, i.r + Math.sqrt(i.x * i.x + i.y * i.y)); e.r = E, n.forEach(xo) } } function Co(e) { e._pack_next = e._pack_prev = e } function xo(e) { delete e._pack_next, delete e._pack_prev } function Mo(e, t, n, r) { var o = e.children; if (e.x = t += r * e.x, e.y = n += r * e.y, e.r *= r, o) for (var i = -1, a = o.length; ++i < a;) Mo(o[i], t, n, r) } function Do(e, t, n) { var r = e.r + n.r, o = t.x - e.x, i = t.y - e.y; if (r && (o || i)) { var a = t.r + n.r, s = o * o + i * i; a *= a, r *= r; var l = .5 + (r - a) / (2 * s), c = Math.sqrt(Math.max(0, 2 * a * (r + s) - (r -= s) * r - a * a)) / (2 * s); n.x = e.x + l * o + c * i, n.y = e.y + l * i - c * o } else n.x = e.x + r, n.y = e.y } function Oo(e, t) { return e.parent == t.parent ? 1 : 2 } function Ro(e) { var t = e.children; return t.length ? t[0] : e.t } function No(e) { var t, n = e.children; return (t = n.length) ? n[t - 1] : e.t } function Lo(e, t, n) { var r = n / (t.i - e.i); t.c -= r, t.s += n, e.c += r, t.z += n, t.m += n } function Po(e) { for (var t, n = 0, r = 0, o = e.children, i = o.length; --i >= 0;) t = o[i], t.z += n, t.m += n, n += t.s + (r += t.c) } function ko(e, t, n) { return e.a.parent === t.parent ? e.a : n } function Go(e) { return 1 + sa.max(e, function(e) { return e.y }) } function Fo(e) { return e.reduce(function(e, t) { return e + t.x }, 0) / e.length } function Uo(e) { var t = e.children; return t && t.length ? Uo(t[0]) : e } function Vo(e) { var t, n = e.children; return n && (t = n.length) ? Vo(n[t - 1]) : e } function zo(e) { return { x: e.x, y: e.y, dx: e.dx, dy: e.dy } } function Bo(e, t) { var n = e.x + t[3], r = e.y + t[0], o = e.dx - t[1] - t[3], i = e.dy - t[0] - t[2]; return o < 0 && (n += o / 2, o = 0), i < 0 && (r += i / 2, i = 0), { x: n, y: r, dx: o, dy: i } } function $o(e) { var t = e[0], n = e[e.length - 1]; return t < n ? [t, n] : [n, t] } function Wo(e) { return e.rangeExtent ? e.rangeExtent() : $o(e.range()) } function Ho(e, t, n, r) { var o = n(e[0], e[1]), i = r(t[0], t[1]); return function(e) { return i(o(e)) } } function jo(e, t) { var n, r = 0, o = e.length - 1, i = e[r], a = e[o]; return a < i && (n = r, r = o, o = n, n = i, i = a, a = n), e[r] = t.floor(i), e[o] = t.ceil(a), e } function Yo(e) { return e ? { floor: function(t) { return Math.floor(t / e) * e }, ceil: function(t) { return Math.ceil(t / e) * e } } : Sl } function qo(e, t, n, r) { var o = [], i = [], a = 0, s = Math.min(e.length, t.length) - 1; for (e[s] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++a <= s;) o.push(n(e[a - 1], e[a])), i.push(r(t[a - 1], t[a])); return function(t) { var n = sa.bisect(e, t, 1, s) - 1; return i[n](o[n](t)) } } function Ko(e, t, n, r) { function o() { var o = Math.min(e.length, t.length) > 2 ? qo : Ho, l = r ? qr : Yr; return a = o(e, t, l, n), s = o(t, e, l, wr), i } function i(e) { return a(e) } var a, s; return i.invert = function(e) { return s(e) }, i.domain = function(t) { return arguments.length ? (e = t.map(Number), o()) : e }, i.range = function(e) { return arguments.length ? (t = e, o()) : t }, i.rangeRound = function(e) { return i.range(e).interpolate(zr) }, i.clamp = function(e) { return arguments.length ? (r = e, o()) : r }, i.interpolate = function(e) { return arguments.length ? (n = e, o()) : n }, i.ticks = function(t) { return Jo(e, t) }, i.tickFormat = function(t, n) { return ei(e, t, n) }, i.nice = function(t) { return Zo(e, t), o() }, i.copy = function() { return Ko(e, t, n, r) }, o() } function Qo(e, t) { return sa.rebind(e, t, "range", "rangeRound", "interpolate", "clamp") } function Zo(e, t) { return jo(e, Yo(Xo(e, t)[2])) } function Xo(e, t) { null == t && (t = 10); var n = $o(e), r = n[1] - n[0], o = Math.pow(10, Math.floor(Math.log(r / t) / Math.LN10)), i = t / r * o; return i <= .15 ? o *= 10 : i <= .35 ? o *= 5 : i <= .75 && (o *= 2), n[0] = Math.ceil(n[0] / o) * o, n[1] = Math.floor(n[1] / o) * o + .5 * o, n[2] = o, n } function Jo(e, t) { return sa.range.apply(sa, Xo(e, t)) } function ei(e, t, n) { var r = Xo(e, t); if (n) { var o = cs.exec(n); if (o.shift(), "s" === o[8]) { var i = sa.formatPrefix(Math.max(ha(r[0]), ha(r[1]))); return o[7] || (o[7] = "." + ti(i.scale(r[2]))), o[8] = "f", n = sa.format(o.join("")), function(e) { return n(i.scale(e)) + i.symbol } } o[7] || (o[7] = "." + ni(o[8], r)), n = o.join("") } else n = ",." + ti(r[2]) + "f"; return sa.format(n) } function ti(e) { return -Math.floor(Math.log(e) / Math.LN10 + .01) } function ni(e, t) { var n = ti(t[2]); return e in _l ? Math.abs(n - ti(Math.max(ha(t[0]), ha(t[1])))) + +("e" !== e) : n - 2 * ("%" === e) } function ri(e, t, n, r) { function o(e) { return (n ? Math.log(e < 0 ? 0 : e) : -Math.log(e > 0 ? 0 : -e)) / Math.log(t) } function i(e) { return n ? Math.pow(t, e) : -Math.pow(t, -e) } function a(t) { return e(o(t)) } return a.invert = function(t) { return i(e.invert(t)) }, a.domain = function(t) { return arguments.length ? (n = t[0] >= 0, e.domain((r = t.map(Number)).map(o)), a) : r }, a.base = function(n) { return arguments.length ? (t = +n, e.domain(r.map(o)), a) : t }, a.nice = function() { var t = jo(r.map(o), n ? Math : Al); return e.domain(t), r = t.map(i), a }, a.ticks = function() { var e = $o(r), a = [], s = e[0], l = e[1], c = Math.floor(o(s)), u = Math.ceil(o(l)), d = t % 1 ? 2 : t; if (isFinite(u - c)) { if (n) { for (; c < u; c++) for (var f = 1; f < d; f++) a.push(i(c) * f); a.push(i(c)) } else for (a.push(i(c)); c++ < u;) for (var f = d - 1; f > 0; f--) a.push(i(c) * f); for (c = 0; a[c] < s; c++); for (u = a.length; a[u - 1] > l; u--); a = a.slice(c, u) } return a }, a.tickFormat = function(e, t) { if (!arguments.length) return wl; arguments.length < 2 ? t = wl : "function" != typeof t && (t = sa.format(t)); var r, s = Math.max(.1, e / a.ticks().length), l = n ? (r = 1e-12, Math.ceil) : (r = -1e-12, Math.floor); return function(e) { return e / i(l(o(e) + r)) <= s ? t(e) : "" } }, a.copy = function() { return ri(e.copy(), t, n, r) }, Qo(a, e) } function oi(e, t, n) { function r(t) { return e(o(t)) } var o = ii(t), i = ii(1 / t); return r.invert = function(t) { return i(e.invert(t)) }, r.domain = function(t) { return arguments.length ? (e.domain((n = t.map(Number)).map(o)), r) : n }, r.ticks = function(e) { return Jo(n, e) }, r.tickFormat = function(e, t) { return ei(n, e, t) }, r.nice = function(e) { return r.domain(Zo(n, e)) }, r.exponent = function(a) { return arguments.length ? (o = ii(t = a), i = ii(1 / t), e.domain(n.map(o)), r) : t }, r.copy = function() { return oi(e.copy(), t, n) }, Qo(r, e) } function ii(e) { return function(t) { return t < 0 ? -Math.pow(-t, e) : Math.pow(t, e) } } function ai(e, t) { function n(n) { return i[((o.get(n) || ("range" === t.t ? o.set(n, e.push(n)) : NaN)) - 1) % i.length] } function r(t, n) { return sa.range(e.length).map(function(e) { return t + n * e }) } var o, i, a; return n.domain = function(r) { if (!arguments.length) return e; e = [], o = new p; for (var i, a = -1, s = r.length; ++a < s;) o.has(i = r[a]) || o.set(i, e.push(i)); return n[t.t].apply(n, t.a) }, n.range = function(e) { return arguments.length ? (i = e, a = 0, t = { t: "range", a: arguments }, n) : i }, n.rangePoints = function(o, s) { arguments.length < 2 && (s = 0); var l = o[0], c = o[1], u = e.length < 2 ? (l = (l + c) / 2, 0) : (c - l) / (e.length - 1 + s); return i = r(l + u * s / 2, u), a = 0, t = { t: "rangePoints", a: arguments }, n }, n.rangeRoundPoints = function(o, s) { arguments.length < 2 && (s = 0); var l = o[0], c = o[1], u = e.length < 2 ? (l = c = Math.round((l + c) / 2), 0) : (c - l) / (e.length - 1 + s) | 0; return i = r(l + Math.round(u * s / 2 + (c - l - (e.length - 1 + s) * u) / 2), u), a = 0, t = { t: "rangeRoundPoints", a: arguments }, n }, n.rangeBands = function(o, s, l) { arguments.length < 2 && (s = 0), arguments.length < 3 && (l = s); var c = o[1] < o[0], u = o[c - 0], d = o[1 - c], f = (d - u) / (e.length - s + 2 * l); return i = r(u + f * l, f), c && i.reverse(), a = f * (1 - s), t = { t: "rangeBands", a: arguments }, n }, n.rangeRoundBands = function(o, s, l) { arguments.length < 2 && (s = 0), arguments.length < 3 && (l = s); var c = o[1] < o[0], u = o[c - 0], d = o[1 - c], f = Math.floor((d - u) / (e.length - s + 2 * l)); return i = r(u + Math.round((d - u - (e.length - s) * f) / 2), f), c && i.reverse(), a = Math.round(f * (1 - s)), t = { t: "rangeRoundBands", a: arguments }, n }, n.rangeBand = function() { return a }, n.rangeExtent = function() { return $o(t.a[0]) }, n.copy = function() { return ai(e, t) }, n.domain(e) } function si(e, t) { function n() { var n = 0, i = t.length; for (o = []; ++n < i;) o[n - 1] = sa.quantile(e, n / i); return r } function r(e) { if (!isNaN(e = +e)) return t[sa.bisect(o, e)] } var o; return r.domain = function(t) { return arguments.length ? (e = t.map(l).filter(c).sort(s), n()) : e }, r.range = function(e) { return arguments.length ? (t = e, n()) : t }, r.quantiles = function() { return o }, r.invertExtent = function(n) { return n = t.indexOf(n), n < 0 ? [NaN, NaN] : [n > 0 ? o[n - 1] : e[0], n < o.length ? o[n] : e[e.length - 1]] }, r.copy = function() { return si(e, t) }, n() } function li(e, t, n) { function r(t) { return n[Math.max(0, Math.min(a, Math.floor(i * (t - e))))] } function o() { return i = n.length / (t - e), a = n.length - 1, r } var i, a; return r.domain = function(n) { return arguments.length ? (e = +n[0], t = +n[n.length - 1], o()) : [e, t] }, r.range = function(e) { return arguments.length ? (n = e, o()) : n }, r.invertExtent = function(t) { return t = n.indexOf(t), t = t < 0 ? NaN : t / i + e, [t, t + 1 / i] }, r.copy = function() { return li(e, t, n) }, o() } function ci(e, t) { function n(n) { if (n <= n) return t[sa.bisect(e, n)] } return n.domain = function(t) { return arguments.length ? (e = t, n) : e }, n.range = function(e) { return arguments.length ? (t = e, n) : t }, n.invertExtent = function(n) { return n = t.indexOf(n), [e[n - 1], e[n]] }, n.copy = function() { return ci(e, t) }, n } function ui(e) { function t(e) { return +e } return t.invert = t, t.domain = t.range = function(n) { return arguments.length ? (e = n.map(t), t) : e }, t.ticks = function(t) { return Jo(e, t) }, t.tickFormat = function(t, n) { return ei(e, t, n) }, t.copy = function() { return ui(e) }, t } function di() { return 0 } function fi(e) { return e.innerRadius } function mi(e) { return e.outerRadius } function pi(e) { return e.startAngle } function gi(e) { return e.endAngle } function vi(e) { return e && e.padAngle } function hi(e, t, n, r) { return (e - n) * t - (t - r) * e > 0 ? 0 : 1 } function yi(e, t, n, r, o) { var i = e[0] - t[0], a = e[1] - t[1], s = (o ? r : -r) / Math.sqrt(i * i + a * a), l = s * a, c = -s * i, u = e[0] + l, d = e[1] + c, f = t[0] + l, m = t[1] + c, p = (u + f) / 2, g = (d + m) / 2, v = f - u, h = m - d, y = v * v + h * h, E = n - r, b = u * m - f * d, S = (h < 0 ? -1 : 1) * Math.sqrt(E * E * y - b * b), _ = (b * h - v * S) / y, w = (-b * v - h * S) / y, A = (b * h + v * S) / y, T = (-b * v + h * S) / y, I = _ - p, C = w - g, x = A - p, M = T - g; return I * I + C * C > x * x + M * M && (_ = A, w = T), [ [_ - l, w - c], [_ * n / E, w * n / E] ] } function Ei(e) { function t(t) { function a() { c.push("M", i(e(u), s)) } for (var l, c = [], u = [], d = -1, f = t.length, m = Oe(n), p = Oe(r); ++d < f;) o.call(this, l = t[d], d) ? u.push([+m.call(this, l, d), +p.call(this, l, d)]) : u.length && (a(), u = []); return u.length && a(), c.length ? c.join("") : null } var n = Nn, r = Ln, o = Nt, i = bi, a = i.key, s = .7; return t.x = function(e) { return arguments.length ? (n = e, t) : n }, t.y = function(e) { return arguments.length ? (r = e, t) : r }, t.defined = function(e) { return arguments.length ? (o = e, t) : o }, t.interpolate = function(e) { return arguments.length ? (a = "function" == typeof e ? i = e : (i = Dl.get(e) || bi).key, t) : a }, t.tension = function(e) { return arguments.length ? (s = e, t) : s }, t } function bi(e) { return e.join("L") } function Si(e) { return bi(e) + "Z" } function _i(e) { for (var t = 0, n = e.length, r = e[0], o = [r[0], ",", r[1]]; ++t < n;) o.push("H", (r[0] + (r = e[t])[0]) / 2, "V", r[1]); return n > 1 && o.push("H", r[0]), o.join("") } function wi(e) { for (var t = 0, n = e.length, r = e[0], o = [r[0], ",", r[1]]; ++t < n;) o.push("V", (r = e[t])[1], "H", r[0]); return o.join("") } function Ai(e) { for (var t = 0, n = e.length, r = e[0], o = [r[0], ",", r[1]]; ++t < n;) o.push("H", (r = e[t])[0], "V", r[1]); return o.join("") } function Ti(e, t) { return e.length < 4 ? bi(e) : e[1] + xi(e.slice(1, -1), Mi(e, t)) } function Ii(e, t) { return e.length < 3 ? bi(e) : e[0] + xi((e.push(e[0]), e), Mi([e[e.length - 2]].concat(e, [e[1]]), t)) } function Ci(e, t) { return e.length < 3 ? bi(e) : e[0] + xi(e, Mi(e, t)) } function xi(e, t) { if (t.length < 1 || e.length != t.length && e.length != t.length + 2) return bi(e); var n = e.length != t.length, r = "", o = e[0], i = e[1], a = t[0], s = a, l = 1; if (n && (r += "Q" + (i[0] - 2 * a[0] / 3) + "," + (i[1] - 2 * a[1] / 3) + "," + i[0] + "," + i[1], o = e[1], l = 2), t.length > 1) { s = t[1], i = e[l], l++, r += "C" + (o[0] + a[0]) + "," + (o[1] + a[1]) + "," + (i[0] - s[0]) + "," + (i[1] - s[1]) + "," + i[0] + "," + i[1]; for (var c = 2; c < t.length; c++, l++) i = e[l], s = t[c], r += "S" + (i[0] - s[0]) + "," + (i[1] - s[1]) + "," + i[0] + "," + i[1] } if (n) { var u = e[l]; r += "Q" + (i[0] + 2 * s[0] / 3) + "," + (i[1] + 2 * s[1] / 3) + "," + u[0] + "," + u[1] } return r } function Mi(e, t) { for (var n, r = [], o = (1 - t) / 2, i = e[0], a = e[1], s = 1, l = e.length; ++s < l;) n = i, i = a, a = e[s], r.push([o * (a[0] - n[0]), o * (a[1] - n[1])]); return r } function Di(e) { if (e.length < 3) return bi(e); var t = 1, n = e.length, r = e[0], o = r[0], i = r[1], a = [o, o, o, (r = e[1])[0]], s = [i, i, i, r[1]], l = [o, ",", i, "L", Li(Nl, a), ",", Li(Nl, s)]; for (e.push(e[n - 1]); ++t <= n;) r = e[t], a.shift(), a.push(r[0]), s.shift(), s.push(r[1]), Pi(l, a, s); return e.pop(), l.push("L", r), l.join("") } function Oi(e) { if (e.length < 4) return bi(e); for (var t, n = [], r = -1, o = e.length, i = [0], a = [0]; ++r < 3;) t = e[r], i.push(t[0]), a.push(t[1]); for (n.push(Li(Nl, i) + "," + Li(Nl, a)), --r; ++r < o;) t = e[r], i.shift(), i.push(t[0]), a.shift(), a.push(t[1]), Pi(n, i, a); return n.join("") } function Ri(e) { for (var t, n, r = -1, o = e.length, i = o + 4, a = [], s = []; ++r < 4;) n = e[r % o], a.push(n[0]), s.push(n[1]); for (t = [Li(Nl, a), ",", Li(Nl, s)], --r; ++r < i;) n = e[r % o], a.shift(), a.push(n[0]), s.shift(), s.push(n[1]), Pi(t, a, s); return t.join("") } function Ni(e, t) { var n = e.length - 1; if (n) for (var r, o, i = e[0][0], a = e[0][1], s = e[n][0] - i, l = e[n][1] - a, c = -1; ++c <= n;) r = e[c], o = c / n, r[0] = t * r[0] + (1 - t) * (i + o * s), r[1] = t * r[1] + (1 - t) * (a + o * l); return Di(e) } function Li(e, t) { return e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3] } function Pi(e, t, n) { e.push("C", Li(Ol, t), ",", Li(Ol, n), ",", Li(Rl, t), ",", Li(Rl, n), ",", Li(Nl, t), ",", Li(Nl, n)) } function ki(e, t) { return (t[1] - e[1]) / (t[0] - e[0]) } function Gi(e) { for (var t = 0, n = e.length - 1, r = [], o = e[0], i = e[1], a = r[0] = ki(o, i); ++t < n;) r[t] = (a + (a = ki(o = i, i = e[t + 1]))) / 2; return r[t] = a, r } function Fi(e) { for (var t, n, r, o, i = [], a = Gi(e), s = -1, l = e.length - 1; ++s < l;) t = ki(e[s], e[s + 1]), ha(t) < Na ? a[s] = a[s + 1] = 0 : (n = a[s] / t, r = a[s + 1] / t, o = n * n + r * r, o > 9 && (o = 3 * t / Math.sqrt(o), a[s] = o * n, a[s + 1] = o * r)); for (s = -1; ++s <= l;) o = (e[Math.min(l, s + 1)][0] - e[Math.max(0, s - 1)][0]) / (6 * (1 + a[s] * a[s])), i.push([o || 0, a[s] * o || 0]); return i } function Ui(e) { return e.length < 3 ? bi(e) : e[0] + xi(e, Fi(e)) } function Vi(e) { for (var t, n, r, o = -1, i = e.length; ++o < i;) t = e[o], n = t[0], r = t[1] - Fa, t[0] = n * Math.cos(r), t[1] = n * Math.sin(r); return e } function zi(e) { function t(t) { function l() { g.push("M", s(e(h), d), u, c(e(v.reverse()), d), "Z") } for (var f, m, p, g = [], v = [], h = [], y = -1, E = t.length, b = Oe(n), S = Oe(o), _ = n === r ? function() { return m } : Oe(r), w = o === i ? function() { return p } : Oe(i); ++y < E;) a.call(this, f = t[y], y) ? (v.push([m = +b.call(this, f, y), p = +S.call(this, f, y)]), h.push([+_.call(this, f, y), +w.call(this, f, y)])) : v.length && (l(), v = [], h = []); return v.length && l(), g.length ? g.join("") : null } var n = Nn, r = Nn, o = 0, i = Ln, a = Nt, s = bi, l = s.key, c = s, u = "L", d = .7; return t.x = function(e) { return arguments.length ? (n = r = e, t) : r }, t.x0 = function(e) { return arguments.length ? (n = e, t) : n }, t.x1 = function(e) { return arguments.length ? (r = e, t) : r }, t.y = function(e) { return arguments.length ? (o = i = e, t) : i }, t.y0 = function(e) { return arguments.length ? (o = e, t) : o }, t.y1 = function(e) { return arguments.length ? (i = e, t) : i }, t.defined = function(e) { return arguments.length ? (a = e, t) : a }, t.interpolate = function(e) { return arguments.length ? (l = "function" == typeof e ? s = e : (s = Dl.get(e) || bi).key, c = s.reverse || s, u = s.closed ? "M" : "L", t) : l }, t.tension = function(e) { return arguments.length ? (d = e, t) : d }, t } function Bi(e) { return e.radius } function $i(e) { return [e.x, e.y] } function Wi(e) { return function() { var t = e.apply(this, arguments), n = t[0], r = t[1] - Fa; return [n * Math.cos(r), n * Math.sin(r)] } } function Hi() { return 64 } function ji() { return "circle" } function Yi(e) { var t = Math.sqrt(e / Pa); return "M0," + t + "A" + t + "," + t + " 0 1,1 0," + -t + "A" + t + "," + t + " 0 1,1 0," + t + "Z" } function qi(e) { return function() { var t, n; (t = this[e]) && (n = t[t.active]) && (--t.count ? delete t[t.active] : delete this[e], t.active += .5, n.event && n.event.interrupt.call(this, this.__data__, n.index)) } } function Ki(e, t, n) { return _a(e, Vl), e.namespace = t, e.id = n, e } function Qi(e, t, n, r) { var o = e.id, i = e.namespace; return q(e, "function" == typeof n ? function(e, a, s) { e[i][o].tween.set(t, r(n.call(e, e.__data__, a, s))) } : (n = r(n), function(e) { e[i][o].tween.set(t, n) })) } function Zi(e) { return null == e && (e = ""), function() { this.textContent = e } } function Xi(e) { return null == e ? "__transition__" : "__transition_" + e + "__" } function Ji(e, t, n, r, o) { var i = e[n] || (e[n] = { active: 0, count: 0 }), a = i[r]; if (!a) { var s = o.time; a = i[r] = { tween: new p, time: s, delay: o.delay, duration: o.duration, ease: o.ease, index: t }, o = null, ++i.count, sa.timer(function(o) { function l(n) { if (i.active > r) return u(); var o = i[i.active]; o && (--i.count, delete i[i.active], o.event && o.event.interrupt.call(e, e.__data__, o.index)), i.active = r, a.event && a.event.start.call(e, e.__data__, t), a.tween.forEach(function(n, r) { (r = r.call(e, e.__data__, t)) && g.push(r) }), f = a.ease, d = a.duration, sa.timer(function() { return p.c = c(n || 1) ? Nt : c, 1 }, 0, s) } function c(n) { if (i.active !== r) return 1; for (var o = n / d, s = f(o), l = g.length; l > 0;) g[--l].call(e, s); return o >= 1 ? (a.event && a.event.end.call(e, e.__data__, t), u()) : void 0 } function u() { return --i.count ? delete i[r] : delete e[n], 1 } var d, f, m = a.delay, p = as, g = []; return p.t = m + s, m <= o ? l(o - m) : void(p.c = l) }, 0, s) } } function ea(e, t, n) { e.attr("transform", function(e) { var r = t(e); return "translate(" + (isFinite(r) ? r : n(e)) + ",0)" }) } function ta(e, t, n) { e.attr("transform", function(e) { var r = t(e); return "translate(0," + (isFinite(r) ? r : n(e)) + ")" }) } function na(e) { return e.toISOString() } function ra(e, t, n) { function r(t) { return e(t) } function o(e, n) { var r = e[1] - e[0], o = r / n, i = sa.bisect(Kl, o); return i == Kl.length ? [t.year, Xo(e.map(function(e) { return e / 31536e6 }), n)[2]] : i ? t[o / Kl[i - 1] < Kl[i] / o ? i - 1 : i] : [Xl, Xo(e, n)[2]] } return r.invert = function(t) { return oa(e.invert(t)) }, r.domain = function(t) { return arguments.length ? (e.domain(t), r) : e.domain().map(oa) }, r.nice = function(e, t) { function n(n) { return !isNaN(n) && !e.range(n, oa(+n + 1), t).length } var i = r.domain(), a = $o(i), s = null == e ? o(a, 10) : "number" == typeof e && o(a, e); return s && (e = s[0], t = s[1]), r.domain(jo(i, t > 1 ? { floor: function(t) { for (; n(t = e.floor(t));) t = oa(t - 1); return t }, ceil: function(t) { for (; n(t = e.ceil(t));) t = oa(+t + 1); return t } } : e)) }, r.ticks = function(e, t) { var n = $o(r.domain()), i = null == e ? o(n, 10) : "number" == typeof e ? o(n, e) : !e.range && [{ range: e }, t]; return i && (e = i[0], t = i[1]), e.range(n[0], oa(+n[1] + 1), t < 1 ? 1 : t) }, r.tickFormat = function() { return n }, r.copy = function() { return ra(e.copy(), t, n) }, Qo(r, e) } function oa(e) { return new Date(e) } function ia(e) { return JSON.parse(e.responseText) } function aa(e) { var t = ua.createRange(); return t.selectNode(ua.body), t.createContextualFragment(e.responseText) } var sa = { version: "3.5.6" }, la = [].slice, ca = function(e) { return la.call(e) }, ua = this.document; if (ua) try { ca(ua.documentElement.childNodes)[0].nodeType } catch (e) { ca = function(e) { for (var t = e.length, n = new Array(t); t--;) n[t] = e[t]; return n } } if (Date.now || (Date.now = function() { return +new Date }), ua) try { ua.createElement("DIV").style.setProperty("opacity", 0, "") } catch (e) { var da = this.Element.prototype, fa = da.setAttribute, ma = da.setAttributeNS, pa = this.CSSStyleDeclaration.prototype, ga = pa.setProperty; da.setAttribute = function(e, t) { fa.call(this, e, t + "") }, da.setAttributeNS = function(e, t, n) { ma.call(this, e, t, n + "") }, pa.setProperty = function(e, t, n) { ga.call(this, e, t + "", n) } } sa.ascending = s, sa.descending = function(e, t) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN }, sa.min = function(e, t) { var n, r, o = -1, i = e.length; if (1 === arguments.length) { for (; ++o < i;) if (null != (r = e[o]) && r >= r) { n = r; break } for (; ++o < i;) null != (r = e[o]) && n > r && (n = r) } else { for (; ++o < i;) if (null != (r = t.call(e, e[o], o)) && r >= r) { n = r; break } for (; ++o < i;) null != (r = t.call(e, e[o], o)) && n > r && (n = r) } return n }, sa.max = function(e, t) { var n, r, o = -1, i = e.length; if (1 === arguments.length) { for (; ++o < i;) if (null != (r = e[o]) && r >= r) { n = r; break } for (; ++o < i;) null != (r = e[o]) && r > n && (n = r) } else { for (; ++o < i;) if (null != (r = t.call(e, e[o], o)) && r >= r) { n = r; break } for (; ++o < i;) null != (r = t.call(e, e[o], o)) && r > n && (n = r) } return n }, sa.extent = function(e, t) { var n, r, o, i = -1, a = e.length; if (1 === arguments.length) { for (; ++i < a;) if (null != (r = e[i]) && r >= r) { n = o = r; break } for (; ++i < a;) null != (r = e[i]) && (n > r && (n = r), o < r && (o = r)) } else { for (; ++i < a;) if (null != (r = t.call(e, e[i], i)) && r >= r) { n = o = r; break } for (; ++i < a;) null != (r = t.call(e, e[i], i)) && (n > r && (n = r), o < r && (o = r)) } return [n, o] }, sa.sum = function(e, t) { var n, r = 0, o = e.length, i = -1; if (1 === arguments.length) for (; ++i < o;) c(n = +e[i]) && (r += n); else for (; ++i < o;) c(n = +t.call(e, e[i], i)) && (r += n); return r }, sa.mean = function(e, t) { var n, r = 0, o = e.length, i = -1, a = o; if (1 === arguments.length) for (; ++i < o;) c(n = l(e[i])) ? r += n : --a; else for (; ++i < o;) c(n = l(t.call(e, e[i], i))) ? r += n : --a; if (a) return r / a }, sa.quantile = function(e, t) { var n = (e.length - 1) * t + 1, r = Math.floor(n), o = +e[r - 1], i = n - r; return i ? o + i * (e[r] - o) : o }, sa.median = function(e, t) { var n, r = [], o = e.length, i = -1; if (1 === arguments.length) for (; ++i < o;) c(n = l(e[i])) && r.push(n); else for (; ++i < o;) c(n = l(t.call(e, e[i], i))) && r.push(n); if (r.length) return sa.quantile(r.sort(s), .5) }, sa.variance = function(e, t) { var n, r, o = e.length, i = 0, a = 0, s = -1, u = 0; if (1 === arguments.length) for (; ++s < o;) c(n = l(e[s])) && (r = n - i, i += r / ++u, a += r * (n - i)); else for (; ++s < o;) c(n = l(t.call(e, e[s], s))) && (r = n - i, i += r / ++u, a += r * (n - i)); if (u > 1) return a / (u - 1) }, sa.deviation = function() { var e = sa.variance.apply(this, arguments); return e ? Math.sqrt(e) : e }; var va = u(s); sa.bisectLeft = va.left, sa.bisect = sa.bisectRight = va.right, sa.bisector = function(e) { return u(1 === e.length ? function(t, n) { return s(e(t), n) } : e) }, sa.shuffle = function(e, t, n) { (i = arguments.length) < 3 && (n = e.length, i < 2 && (t = 0)); for (var r, o, i = n - t; i;) o = Math.random() * i-- | 0, r = e[i + t], e[i + t] = e[o + t], e[o + t] = r; return e }, sa.permute = function(e, t) { for (var n = t.length, r = new Array(n); n--;) r[n] = e[t[n]]; return r }, sa.pairs = function(e) { for (var t, n = 0, r = e.length - 1, o = e[0], i = new Array(r < 0 ? 0 : r); n < r;) i[n] = [t = o, o = e[++n]]; return i }, sa.zip = function() { if (!(r = arguments.length)) return []; for (var e = -1, t = sa.min(arguments, d), n = new Array(t); ++e < t;) for (var r, o = -1, i = n[e] = new Array(r); ++o < r;) i[o] = arguments[o][e]; return n }, sa.transpose = function(e) { return sa.zip.apply(sa, e) }, sa.keys = function(e) { var t = []; for (var n in e) t.push(n); return t }, sa.values = function(e) { var t = []; for (var n in e) t.push(e[n]); return t }, sa.entries = function(e) { var t = []; for (var n in e) t.push({ key: n, value: e[n] }); return t }, sa.merge = function(e) { for (var t, n, r, o = e.length, i = -1, a = 0; ++i < o;) a += e[i].length; for (n = new Array(a); --o >= 0;) for (r = e[o], t = r.length; --t >= 0;) n[--a] = r[t]; return n }; var ha = Math.abs; sa.range = function(e, t, n) { if (arguments.length < 3 && (n = 1, arguments.length < 2 && (t = e, e = 0)), (t - e) / n === 1 / 0) throw new Error("infinite range"); var r, o = [], i = f(ha(n)), a = -1; if (e *= i, t *= i, n *= i, n < 0) for (; (r = e + n * ++a) > t;) o.push(r / i); else for (; (r = e + n * ++a) < t;) o.push(r / i); return o }, sa.map = function(e, t) { var n = new p; if (e instanceof p) e.forEach(function(e, t) { n.set(e, t) }); else if (Array.isArray(e)) { var r, o = -1, i = e.length; if (1 === arguments.length) for (; ++o < i;) n.set(o, e[o]); else for (; ++o < i;) n.set(t.call(e, r = e[o], o), r) } else for (var a in e) n.set(a, e[a]); return n }; var ya = "__proto__", Ea = "\0"; m(p, { has: h, get: function(e) { return this._[g(e)] }, set: function(e, t) { return this._[g(e)] = t }, remove: y, keys: E, values: function() { var e = []; for (var t in this._) e.push(this._[t]); return e }, entries: function() { var e = []; for (var t in this._) e.push({ key: v(t), value: this._[t] }); return e }, size: b, empty: S, forEach: function(e) { for (var t in this._) e.call(this, v(t), this._[t]) } }), sa.nest = function() { function e(t, a, s) { if (s >= i.length) return r ? r.call(o, a) : n ? a.sort(n) : a; for (var l, c, u, d, f = -1, m = a.length, g = i[s++], v = new p; ++f < m;)(d = v.get(l = g(c = a[f]))) ? d.push(c) : v.set(l, [c]); return t ? (c = t(), u = function(n, r) { c.set(n, e(t, r, s)) }) : (c = {}, u = function(n, r) { c[n] = e(t, r, s) }), v.forEach(u), c } function t(e, n) { if (n >= i.length) return e; var r = [], o = a[n++]; return e.forEach(function(e, o) { r.push({ key: e, values: t(o, n) }) }), o ? r.sort(function(e, t) { return o(e.key, t.key) }) : r } var n, r, o = {}, i = [], a = []; return o.map = function(t, n) { return e(n, t, 0) }, o.entries = function(n) { return t(e(sa.map, n, 0), 0) }, o.key = function(e) { return i.push(e), o }, o.sortKeys = function(e) { return a[i.length - 1] = e, o }, o.sortValues = function(e) { return n = e, o }, o.rollup = function(e) { return r = e, o }, o }, sa.set = function(e) { var t = new _; if (e) for (var n = 0, r = e.length; n < r; ++n) t.add(e[n]); return t }, m(_, { has: h, add: function(e) { return this._[g(e += "")] = !0, e }, remove: y, values: E, size: b, empty: S, forEach: function(e) { for (var t in this._) e.call(this, v(t)) } }), sa.behavior = {}, sa.rebind = function(e, t) { for (var n, r = 1, o = arguments.length; ++r < o;) e[n = arguments[r]] = A(e, t, t[n]); return e }; var ba = ["webkit", "ms", "moz", "Moz", "o", "O"]; sa.dispatch = function() { for (var e = new C, t = -1, n = arguments.length; ++t < n;) e[arguments[t]] = x(e); return e }, C.prototype.on = function(e, t) { var n = e.indexOf("."), r = ""; if (n >= 0 && (r = e.slice(n + 1), e = e.slice(0, n)), e) return arguments.length < 2 ? this[e].on(r) : this[e].on(r, t); if (2 === arguments.length) { if (null == t) for (e in this) this.hasOwnProperty(e) && this[e].on(r, null); return this } }, sa.event = null, sa.requote = function(e) { return e.replace(Sa, "\\$&") }; var Sa = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g, _a = {}.__proto__ ? function(e, t) { e.__proto__ = t } : function(e, t) { for (var n in t) e[n] = t[n] }, wa = function(e, t) { return t.querySelector(e) }, Aa = function(e, t) { return t.querySelectorAll(e) }, Ta = function(e, t) { var n = e.matches || e[T(e, "matchesSelector")]; return (Ta = function(e, t) { return n.call(e, t) })(e, t) }; "function" == typeof Sizzle && (wa = function(e, t) { return Sizzle(e, t)[0] || null }, Aa = Sizzle, Ta = Sizzle.matchesSelector), sa.selection = function() { return sa.select(ua.documentElement) }; var Ia = sa.selection.prototype = []; Ia.select = function(e) { var t, n, r, o, i = []; e = N(e); for (var a = -1, s = this.length; ++a < s;) { i.push(t = []), t.parentNode = (r = this[a]).parentNode; for (var l = -1, c = r.length; ++l < c;)(o = r[l]) ? (t.push(n = e.call(o, o.__data__, l, a)), n && "__data__" in o && (n.__data__ = o.__data__)) : t.push(null) } return R(i) }, Ia.selectAll = function(e) { var t, n, r = []; e = L(e); for (var o = -1, i = this.length; ++o < i;) for (var a = this[o], s = -1, l = a.length; ++s < l;)(n = a[s]) && (r.push(t = ca(e.call(n, n.__data__, s, o))), t.parentNode = n); return R(r) }; var Ca = { svg: "http://www.w3.org/2000/svg", xhtml: "http://www.w3.org/1999/xhtml", xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; sa.ns = { prefix: Ca, qualify: function(e) { var t = e.indexOf(":"), n = e; return t >= 0 && (n = e.slice(0, t), e = e.slice(t + 1)), Ca.hasOwnProperty(n) ? { space: Ca[n], local: e } : e } }, Ia.attr = function(e, t) { if (arguments.length < 2) { if ("string" == typeof e) { var n = this.node(); return e = sa.ns.qualify(e), e.local ? n.getAttributeNS(e.space, e.local) : n.getAttribute(e) } for (t in e) this.each(P(t, e[t])); return this } return this.each(P(e, t)) }, Ia.classed = function(e, t) { if (arguments.length < 2) { if ("string" == typeof e) { var n = this.node(), r = (e = F(e)).length, o = -1; if (t = n.classList) { for (; ++o < r;) if (!t.contains(e[o])) return !1 } else for (t = n.getAttribute("class"); ++o < r;) if (!G(e[o]).test(t)) return !1; return !0 } for (t in e) this.each(U(t, e[t])); return this } return this.each(U(e, t)) }, Ia.style = function(e, t, n) { var r = arguments.length; if (r < 3) { if ("string" != typeof e) { r < 2 && (t = ""); for (n in e) this.each(z(n, e[n], t)); return this } if (r < 2) { var o = this.node(); return a(o).getComputedStyle(o, null).getPropertyValue(e) } n = "" } return this.each(z(e, t, n)) }, Ia.property = function(e, t) { if (arguments.length < 2) { if ("string" == typeof e) return this.node()[e]; for (t in e) this.each(B(t, e[t])); return this } return this.each(B(e, t)) }, Ia.text = function(e) { return arguments.length ? this.each("function" == typeof e ? function() { var t = e.apply(this, arguments); this.textContent = null == t ? "" : t } : null == e ? function() { this.textContent = "" } : function() { this.textContent = e }) : this.node().textContent }, Ia.html = function(e) { return arguments.length ? this.each("function" == typeof e ? function() { var t = e.apply(this, arguments); this.innerHTML = null == t ? "" : t } : null == e ? function() { this.innerHTML = "" } : function() { this.innerHTML = e }) : this.node().innerHTML }, Ia.append = function(e) { return e = $(e), this.select(function() { return this.appendChild(e.apply(this, arguments)) }) }, Ia.insert = function(e, t) { return e = $(e), t = N(t), this.select(function() { return this.insertBefore(e.apply(this, arguments), t.apply(this, arguments) || null) }) }, Ia.remove = function() { return this.each(W) }, Ia.data = function(e, t) { function n(e, n) { var r, o, i, a = e.length, u = n.length, d = Math.min(a, u), f = new Array(u), m = new Array(u), g = new Array(a); if (t) { var v, h = new p, y = new Array(a); for (r = -1; ++r < a;) h.has(v = t.call(o = e[r], o.__data__, r)) ? g[r] = o : h.set(v, o), y[r] = v; for (r = -1; ++r < u;)(o = h.get(v = t.call(n, i = n[r], r))) ? o !== !0 && (f[r] = o, o.__data__ = i) : m[r] = H(i), h.set(v, !0); for (r = -1; ++r < a;) h.get(y[r]) !== !0 && (g[r] = e[r]) } else { for (r = -1; ++r < d;) o = e[r], i = n[r], o ? (o.__data__ = i, f[r] = o) : m[r] = H(i); for (; r < u; ++r) m[r] = H(n[r]); for (; r < a; ++r) g[r] = e[r] } m.update = f, m.parentNode = f.parentNode = g.parentNode = e.parentNode, s.push(m), l.push(f), c.push(g) } var r, o, i = -1, a = this.length; if (!arguments.length) { for (e = new Array(a = (r = this[0]).length); ++i < a;)(o = r[i]) && (e[i] = o.__data__); return e } var s = K([]), l = R([]), c = R([]); if ("function" == typeof e) for (; ++i < a;) n(r = this[i], e.call(r, r.parentNode.__data__, i)); else for (; ++i < a;) n(r = this[i], e); return l.enter = function() { return s }, l.exit = function() { return c }, l }, Ia.datum = function(e) { return arguments.length ? this.property("__data__", e) : this.property("__data__") }, Ia.filter = function(e) { var t, n, r, o = []; "function" != typeof e && (e = j(e)); for (var i = 0, a = this.length; i < a; i++) { o.push(t = []), t.parentNode = (n = this[i]).parentNode; for (var s = 0, l = n.length; s < l; s++)(r = n[s]) && e.call(r, r.__data__, s, i) && t.push(r) } return R(o) }, Ia.order = function() { for (var e = -1, t = this.length; ++e < t;) for (var n, r = this[e], o = r.length - 1, i = r[o]; --o >= 0;)(n = r[o]) && (i && i !== n.nextSibling && i.parentNode.insertBefore(n, i), i = n); return this }, Ia.sort = function(e) { e = Y.apply(this, arguments); for (var t = -1, n = this.length; ++t < n;) this[t].sort(e); return this.order() }, Ia.each = function(e) { return q(this, function(t, n, r) { e.call(t, t.__data__, n, r) }) }, Ia.call = function(e) { var t = ca(arguments); return e.apply(t[0] = this, t), this }, Ia.empty = function() { return !this.node() }, Ia.node = function() { for (var e = 0, t = this.length; e < t; e++) for (var n = this[e], r = 0, o = n.length; r < o; r++) { var i = n[r]; if (i) return i } return null }, Ia.size = function() { var e = 0; return q(this, function() { ++e }), e }; var xa = []; sa.selection.enter = K, sa.selection.enter.prototype = xa, xa.append = Ia.append, xa.empty = Ia.empty, xa.node = Ia.node, xa.call = Ia.call, xa.size = Ia.size, xa.select = function(e) { for (var t, n, r, o, i, a = [], s = -1, l = this.length; ++s < l;) { r = (o = this[s]).update, a.push(t = []), t.parentNode = o.parentNode; for (var c = -1, u = o.length; ++c < u;)(i = o[c]) ? (t.push(r[c] = n = e.call(o.parentNode, i.__data__, c, s)), n.__data__ = i.__data__) : t.push(null) } return R(a) }, xa.insert = function(e, t) { return arguments.length < 2 && (t = Q(this)), Ia.insert.call(this, e, t) }, sa.select = function(e) { var t; return "string" == typeof e ? (t = [wa(e, ua)], t.parentNode = ua.documentElement) : (t = [e], t.parentNode = i(e)), R([t]) }, sa.selectAll = function(e) { var t; return "string" == typeof e ? (t = ca(Aa(e, ua)), t.parentNode = ua.documentElement) : (t = e, t.parentNode = null), R([t]) }, Ia.on = function(e, t, n) { var r = arguments.length; if (r < 3) { if ("string" != typeof e) { r < 2 && (t = !1); for (n in e) this.each(Z(n, e[n], t)); return this } if (r < 2) return (r = this.node()["__on" + e]) && r._; n = !1 } return this.each(Z(e, t, n)) }; var Ma = sa.map({ mouseenter: "mouseover", mouseleave: "mouseout" }); ua && Ma.forEach(function(e) { "on" + e in ua && Ma.remove(e) }); var Da, Oa = 0; sa.mouse = function(e) { return te(e, D()) }; var Ra = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0; sa.touch = function(e, t, n) { if (arguments.length < 3 && (n = t, t = D().changedTouches), t) for (var r, o = 0, i = t.length; o < i; ++o) if ((r = t[o]).identifier === n) return te(e, r) }, sa.behavior.drag = function() { function e() { this.on("mousedown.drag", o).on("touchstart.drag", i) } function t(e, t, o, i, a) { return function() { function s() { var e, n, r = t(f, g); r && (e = r[0] - E[0], n = r[1] - E[1], p |= e | n, E = r, m({ type: "drag", x: r[0] + c[0], y: r[1] + c[1], dx: e, dy: n })) } function l() { t(f, g) && (h.on(i + v, null).on(a + v, null), y(p && sa.event.target === d), m({ type: "dragend" })) } var c, u = this, d = sa.event.target, f = u.parentNode, m = n.of(u, arguments), p = 0, g = e(), v = ".drag" + (null == g ? "" : "-" + g), h = sa.select(o(d)).on(i + v, s).on(a + v, l), y = ee(d), E = t(f, g); r ? (c = r.apply(u, arguments), c = [c.x - E[0], c.y - E[1]]) : c = [0, 0], m({ type: "dragstart" }) } } var n = O(e, "drag", "dragstart", "dragend"), r = null, o = t(I, sa.mouse, a, "mousemove", "mouseup"), i = t(ne, sa.touch, w, "touchmove", "touchend"); return e.origin = function(t) { return arguments.length ? (r = t, e) : r }, sa.rebind(e, n, "on") }, sa.touches = function(e, t) { return arguments.length < 2 && (t = D().touches), t ? ca(t).map(function(t) { var n = te(e, t); return n.identifier = t.identifier, n }) : [] }; var Na = 1e-6, La = Na * Na, Pa = Math.PI, ka = 2 * Pa, Ga = ka - Na, Fa = Pa / 2, Ua = Pa / 180, Va = 180 / Pa, za = Math.SQRT2, Ba = 2, $a = 4; sa.interpolateZoom = function(e, t) { function n(e) { var t = e * y; if (h) { var n = le(g), a = i / (Ba * f) * (n * ce(za * t + g) - se(g)); return [r + a * c, o + a * u, i * n / le(za * t + g)] } return [r + e * c, o + e * u, i * Math.exp(za * t)] } var r = e[0], o = e[1], i = e[2], a = t[0], s = t[1], l = t[2], c = a - r, u = s - o, d = c * c + u * u, f = Math.sqrt(d), m = (l * l - i * i + $a * d) / (2 * i * Ba * f), p = (l * l - i * i - $a * d) / (2 * l * Ba * f), g = Math.log(Math.sqrt(m * m + 1) - m), v = Math.log(Math.sqrt(p * p + 1) - p), h = v - g, y = (h || Math.log(l / i)) / za; return n.duration = 1e3 * y, n }, sa.behavior.zoom = function() { function e(e) { e.on(D, d).on(Ha + ".zoom", m).on("dblclick.zoom", p).on(L, f) } function t(e) { return [(e[0] - A.x) / A.k, (e[1] - A.y) / A.k] } function n(e) { return [e[0] * A.k + A.x, e[1] * A.k + A.y] } function r(e) { A.k = Math.max(I[0], Math.min(I[1], e)) } function o(e, t) { t = n(t), A.x += e[0] - t[0], A.y += e[1] - t[1] } function i(t, n, i, a) { t.__chart__ = { x: A.x, y: A.y, k: A.k }, r(Math.pow(2, a)), o(v = n, i), t = sa.select(t), C > 0 && (t = t.transition().duration(C)), t.call(e.event) } function s() { S && S.domain(b.range().map(function(e) { return (e - A.x) / A.k }).map(b.invert)), w && w.domain(_.range().map(function(e) { return (e - A.y) / A.k }).map(_.invert)) } function l(e) { x++ || e({ type: "zoomstart" }) } function c(e) { s(), e({ type: "zoom", scale: A.k, translate: [A.x, A.y] }) } function u(e) { --x || (e({ type: "zoomend" }), v = null) } function d() { function e() { d = 1, o(sa.mouse(r), m), c(s) } function n() { f.on(R, null).on(N, null), p(d && sa.event.target === i), u(s) } var r = this, i = sa.event.target, s = P.of(r, arguments), d = 0, f = sa.select(a(r)).on(R, e).on(N, n), m = t(sa.mouse(r)), p = ee(r); Ul.call(r), l(s) } function f() { function e() { var e = sa.touches(p); return m = A.k, e.forEach(function(e) { e.identifier in v && (v[e.identifier] = t(e)) }), e } function n() { var t = sa.event.target; sa.select(t).on(b, a).on(S, s), _.push(t); for (var n = sa.event.changedTouches, r = 0, o = n.length; r < o; ++r) v[n[r].identifier] = null; var l = e(), c = Date.now(); if (1 === l.length) { if (c - E < 500) { var u = l[0]; i(p, u, v[u.identifier], Math.floor(Math.log(A.k) / Math.LN2) + 1), M() } E = c } else if (l.length > 1) { var u = l[0], d = l[1], f = u[0] - d[0], m = u[1] - d[1]; h = f * f + m * m } } function a() { var e, t, n, i, a = sa.touches(p); Ul.call(p); for (var s = 0, l = a.length; s < l; ++s, i = null) if (n = a[s], i = v[n.identifier]) { if (t) break; e = n, t = i } if (i) { var u = (u = n[0] - e[0]) * u + (u = n[1] - e[1]) * u, d = h && Math.sqrt(u / h); e = [(e[0] + n[0]) / 2, (e[1] + n[1]) / 2], t = [(t[0] + i[0]) / 2, (t[1] + i[1]) / 2], r(d * m) } E = null, o(e, t), c(g) } function s() { if (sa.event.touches.length) { for (var t = sa.event.changedTouches, n = 0, r = t.length; n < r; ++n) delete v[t[n].identifier]; for (var o in v) return void e() } sa.selectAll(_).on(y, null), w.on(D, d).on(L, f), T(), u(g) } var m, p = this, g = P.of(p, arguments), v = {}, h = 0, y = ".zoom-" + sa.event.changedTouches[0].identifier, b = "touchmove" + y, S = "touchend" + y, _ = [], w = sa.select(p), T = ee(p); n(), l(g), w.on(D, null).on(L, n) } function m() { var e = P.of(this, arguments); y ? clearTimeout(y) : (Ul.call(this), g = t(v = h || sa.mouse(this)), l(e)), y = setTimeout(function() { y = null, u(e) }, 50), M(), r(Math.pow(2, .002 * Wa()) * A.k), o(v, g), c(e) } function p() { var e = sa.mouse(this), n = Math.log(A.k) / Math.LN2; i(this, e, t(e), sa.event.shiftKey ? Math.ceil(n) - 1 : Math.floor(n) + 1) } var g, v, h, y, E, b, S, _, w, A = { x: 0, y: 0, k: 1 }, T = [960, 500], I = ja, C = 250, x = 0, D = "mousedown.zoom", R = "mousemove.zoom", N = "mouseup.zoom", L = "touchstart.zoom", P = O(e, "zoomstart", "zoom", "zoomend"); return Ha || (Ha = "onwheel" in ua ? (Wa = function() { return -sa.event.deltaY * (sa.event.deltaMode ? 120 : 1) }, "wheel") : "onmousewheel" in ua ? (Wa = function() { return sa.event.wheelDelta }, "mousewheel") : (Wa = function() { return -sa.event.detail }, "MozMousePixelScroll")), e.event = function(e) { e.each(function() { var e = P.of(this, arguments), t = A; Gl ? sa.select(this).transition().each("start.zoom", function() { A = this.__chart__ || { x: 0, y: 0, k: 1 }, l(e) }).tween("zoom:zoom", function() { var n = T[0], r = T[1], o = v ? v[0] : n / 2, i = v ? v[1] : r / 2, a = sa.interpolateZoom([(o - A.x) / A.k, (i - A.y) / A.k, n / A.k], [(o - t.x) / t.k, (i - t.y) / t.k, n / t.k]); return function(t) { var r = a(t), s = n / r[2]; this.__chart__ = A = { x: o - r[0] * s, y: i - r[1] * s, k: s }, c(e) } }).each("interrupt.zoom", function() { u(e) }).each("end.zoom", function() { u(e) }) : (this.__chart__ = A, l(e), c(e), u(e)) }) }, e.translate = function(t) { return arguments.length ? (A = { x: +t[0], y: +t[1], k: A.k }, s(), e) : [A.x, A.y] }, e.scale = function(t) { return arguments.length ? (A = { x: A.x, y: A.y, k: +t }, s(), e) : A.k }, e.scaleExtent = function(t) { return arguments.length ? (I = null == t ? ja : [+t[0], +t[1]], e) : I }, e.center = function(t) { return arguments.length ? (h = t && [+t[0], +t[1]], e) : h }, e.size = function(t) { return arguments.length ? (T = t && [+t[0], +t[1]], e) : T }, e.duration = function(t) { return arguments.length ? (C = +t, e) : C }, e.x = function(t) { return arguments.length ? (S = t, b = t.copy(), A = { x: 0, y: 0, k: 1 }, e) : S }, e.y = function(t) { return arguments.length ? (w = t, _ = t.copy(), A = { x: 0, y: 0, k: 1 }, e) : w }, sa.rebind(e, P, "on") }; var Wa, Ha, ja = [0, 1 / 0]; sa.color = de, de.prototype.toString = function() { return this.rgb() + "" }, sa.hsl = fe; var Ya = fe.prototype = new de; Ya.brighter = function(e) { return e = Math.pow(.7, arguments.length ? e : 1), new fe(this.h, this.s, this.l / e) }, Ya.darker = function(e) { return e = Math.pow(.7, arguments.length ? e : 1), new fe(this.h, this.s, e * this.l) }, Ya.rgb = function() { return me(this.h, this.s, this.l) }, sa.hcl = pe; var qa = pe.prototype = new de; qa.brighter = function(e) { return new pe(this.h, this.c, Math.min(100, this.l + Ka * (arguments.length ? e : 1))) }, qa.darker = function(e) { return new pe(this.h, this.c, Math.max(0, this.l - Ka * (arguments.length ? e : 1))) }, qa.rgb = function() { return ge(this.h, this.c, this.l).rgb() }, sa.lab = ve; var Ka = 18, Qa = .95047, Za = 1, Xa = 1.08883, Ja = ve.prototype = new de; Ja.brighter = function(e) { return new ve(Math.min(100, this.l + Ka * (arguments.length ? e : 1)), this.a, this.b) }, Ja.darker = function(e) { return new ve(Math.max(0, this.l - Ka * (arguments.length ? e : 1)), this.a, this.b) }, Ja.rgb = function() { return he(this.l, this.a, this.b) }, sa.rgb = _e; var es = _e.prototype = new de; es.brighter = function(e) { e = Math.pow(.7, arguments.length ? e : 1); var t = this.r, n = this.g, r = this.b, o = 30; return t || n || r ? (t && t < o && (t = o), n && n < o && (n = o), r && r < o && (r = o), new _e(Math.min(255, t / e), Math.min(255, n / e), Math.min(255, r / e))) : new _e(o, o, o) }, es.darker = function(e) { return e = Math.pow(.7, arguments.length ? e : 1), new _e(e * this.r, e * this.g, e * this.b) }, es.hsl = function() { return Ce(this.r, this.g, this.b) }, es.toString = function() { return "#" + Te(this.r) + Te(this.g) + Te(this.b) }; var ts = sa.map({ aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 }); ts.forEach(function(e, t) { ts.set(e, we(t)) }), sa.functor = Oe, sa.xhr = Re(w), sa.dsv = function(e, t) { function n(e, n, i) { arguments.length < 3 && (i = n, n = null); var a = Ne(e, t, null == n ? r : o(n), i); return a.row = function(e) { return arguments.length ? a.response(null == (n = e) ? r : o(e)) : n }, a } function r(e) { return n.parse(e.responseText) } function o(e) { return function(t) { return n.parse(t.responseText, e) } } function i(t) { return t.map(a).join(e) } function a(e) { return s.test(e) ? '"' + e.replace(/\"/g, '""') + '"' : e } var s = new RegExp('["' + e + "\n]"), l = e.charCodeAt(0); return n.parse = function(e, t) { var r; return n.parseRows(e, function(e, n) { if (r) return r(e, n - 1); var o = new Function("d", "return {" + e.map(function(e, t) { return JSON.stringify(e) + ": d[" + t + "]" }).join(",") + "}"); r = t ? function(e, n) { return t(o(e), n) } : o }) }, n.parseRows = function(e, t) { function n() { if (u >= c) return a; if (o) return o = !1, i; var t = u; if (34 === e.charCodeAt(t)) { for (var n = t; n++ < c;) if (34 === e.charCodeAt(n)) { if (34 !== e.charCodeAt(n + 1)) break; ++n } u = n + 2; var r = e.charCodeAt(n + 1); return 13 === r ? (o = !0, 10 === e.charCodeAt(n + 2) && ++u) : 10 === r && (o = !0), e.slice(t + 1, n).replace(/""/g, '"') } for (; u < c;) { var r = e.charCodeAt(u++), s = 1; if (10 === r) o = !0; else if (13 === r) o = !0, 10 === e.charCodeAt(u) && (++u, ++s); else if (r !== l) continue; return e.slice(t, u - s) } return e.slice(t) } for (var r, o, i = {}, a = {}, s = [], c = e.length, u = 0, d = 0; (r = n()) !== a;) { for (var f = []; r !== i && r !== a;) f.push(r), r = n(); t && null == (f = t(f, d++)) || s.push(f) } return s }, n.format = function(t) { if (Array.isArray(t[0])) return n.formatRows(t); var r = new _, o = []; return t.forEach(function(e) { for (var t in e) r.has(t) || o.push(r.add(t)) }), [o.map(a).join(e)].concat(t.map(function(t) { return o.map(function(e) { return a(t[e]) }).join(e) })).join("\n") }, n.formatRows = function(e) { return e.map(i).join("\n") }, n }, sa.csv = sa.dsv(",", "text/csv"), sa.tsv = sa.dsv("\t", "text/tab-separated-values"); var ns, rs, os, is, as, ss = this[T(this, "requestAnimationFrame")] || function(e) { setTimeout(e, 17) }; sa.timer = function(e, t, n) { var r = arguments.length; r < 2 && (t = 0), r < 3 && (n = Date.now()); var o = n + t, i = { c: e, t: o, f: !1, n: null }; rs ? rs.n = i : ns = i, rs = i, os || (is = clearTimeout(is), os = 1, ss(ke)) }, sa.timer.flush = function() { Ge(), Fe() }, sa.round = function(e, t) { return t ? Math.round(e * (t = Math.pow(10, t))) / t : Math.round(e) }; var ls = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"].map(Ve); sa.formatPrefix = function(e, t) { var n = 0; return e && (e < 0 && (e *= -1), t && (e = sa.round(e, Ue(e, t))), n = 1 + Math.floor(1e-12 + Math.log(e) / Math.LN10), n = Math.max(-24, Math.min(24, 3 * Math.floor((n - 1) / 3)))), ls[8 + n / 3] }; var cs = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i, us = sa.map({ b: function(e) { return e.toString(2) }, c: function(e) { return String.fromCharCode(e) }, o: function(e) { return e.toString(8) }, x: function(e) { return e.toString(16) }, X: function(e) { return e.toString(16).toUpperCase() }, g: function(e, t) { return e.toPrecision(t) }, e: function(e, t) { return e.toExponential(t) }, f: function(e, t) { return e.toFixed(t) }, r: function(e, t) { return (e = sa.round(e, Ue(e, t))).toFixed(Math.max(0, Math.min(20, Ue(e * (1 + 1e-15), t)))) } }), ds = sa.time = {}, fs = Date; $e.prototype = { getDate: function() { return this._.getUTCDate() }, getDay: function() { return this._.getUTCDay() }, getFullYear: function() { return this._.getUTCFullYear() }, getHours: function() { return this._.getUTCHours() }, getMilliseconds: function() { return this._.getUTCMilliseconds() }, getMinutes: function() { return this._.getUTCMinutes() }, getMonth: function() { return this._.getUTCMonth() }, getSeconds: function() { return this._.getUTCSeconds() }, getTime: function() { return this._.getTime() }, getTimezoneOffset: function() { return 0 }, valueOf: function() { return this._.valueOf() }, setDate: function() { ms.setUTCDate.apply(this._, arguments) }, setDay: function() { ms.setUTCDay.apply(this._, arguments) }, setFullYear: function() { ms.setUTCFullYear.apply(this._, arguments) }, setHours: function() { ms.setUTCHours.apply(this._, arguments) }, setMilliseconds: function() { ms.setUTCMilliseconds.apply(this._, arguments) }, setMinutes: function() { ms.setUTCMinutes.apply(this._, arguments) }, setMonth: function() { ms.setUTCMonth.apply(this._, arguments) }, setSeconds: function() { ms.setUTCSeconds.apply(this._, arguments) }, setTime: function() { ms.setTime.apply(this._, arguments) } }; var ms = Date.prototype; ds.year = We(function(e) { return e = ds.day(e), e.setMonth(0, 1), e }, function(e, t) { e.setFullYear(e.getFullYear() + t) }, function(e) { return e.getFullYear() }), ds.years = ds.year.range, ds.years.utc = ds.year.utc.range, ds.day = We(function(e) { var t = new fs(2e3, 0); return t.setFullYear(e.getFullYear(), e.getMonth(), e.getDate()), t }, function(e, t) { e.setDate(e.getDate() + t) }, function(e) { return e.getDate() - 1 }), ds.days = ds.day.range, ds.days.utc = ds.day.utc.range, ds.dayOfYear = function(e) { var t = ds.year(e); return Math.floor((e - t - 6e4 * (e.getTimezoneOffset() - t.getTimezoneOffset())) / 864e5) }, ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"].forEach(function(e, t) { t = 7 - t; var n = ds[e] = We(function(e) { return (e = ds.day(e)).setDate(e.getDate() - (e.getDay() + t) % 7), e }, function(e, t) { e.setDate(e.getDate() + 7 * Math.floor(t)) }, function(e) { var n = ds.year(e).getDay(); return Math.floor((ds.dayOfYear(e) + (n + t) % 7) / 7) - (n !== t) }); ds[e + "s"] = n.range, ds[e + "s"].utc = n.utc.range, ds[e + "OfYear"] = function(e) { var n = ds.year(e).getDay(); return Math.floor((ds.dayOfYear(e) + (n + t) % 7) / 7) } }), ds.week = ds.sunday, ds.weeks = ds.sunday.range, ds.weeks.utc = ds.sunday.utc.range, ds.weekOfYear = ds.sundayOfYear; var ps = { "-": "", _: " ", 0: "0" }, gs = /^\s*\d+/, vs = /^%/; sa.locale = function(e) { return { numberFormat: ze(e), timeFormat: je(e) } }; var hs = sa.locale({ decimal: ".", thousands: ",", grouping: [3], currency: ["$", ""], dateTime: "%a %b %e %X %Y", date: "%m/%d/%Y", time: "%H:%M:%S", periods: ["AM", "PM"], days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] }); sa.format = hs.numberFormat, sa.geo = {}, mt.prototype = { s: 0, t: 0, add: function(e) { pt(e, this.t, ys), pt(ys.s, this.s, this), this.s ? this.t += ys.t : this.s = ys.t }, reset: function() { this.s = this.t = 0 }, valueOf: function() { return this.s } }; var ys = new mt; sa.geo.stream = function(e, t) { e && Es.hasOwnProperty(e.type) ? Es[e.type](e, t) : gt(e, t) }; var Es = { Feature: function(e, t) { gt(e.geometry, t) }, FeatureCollection: function(e, t) { for (var n = e.features, r = -1, o = n.length; ++r < o;) gt(n[r].geometry, t) } }, bs = { Sphere: function(e, t) { t.sphere() }, Point: function(e, t) { e = e.coordinates, t.point(e[0], e[1], e[2]) }, MultiPoint: function(e, t) { for (var n = e.coordinates, r = -1, o = n.length; ++r < o;) e = n[r], t.point(e[0], e[1], e[2]) }, LineString: function(e, t) { vt(e.coordinates, t, 0) }, MultiLineString: function(e, t) { for (var n = e.coordinates, r = -1, o = n.length; ++r < o;) vt(n[r], t, 0) }, Polygon: function(e, t) { ht(e.coordinates, t) }, MultiPolygon: function(e, t) { for (var n = e.coordinates, r = -1, o = n.length; ++r < o;) ht(n[r], t) }, GeometryCollection: function(e, t) { for (var n = e.geometries, r = -1, o = n.length; ++r < o;) gt(n[r], t) } }; sa.geo.area = function(e) { return Ss = 0, sa.geo.stream(e, ws), Ss }; var Ss, _s = new mt, ws = { sphere: function() { Ss += 4 * Pa }, point: I, lineStart: I, lineEnd: I, polygonStart: function() { _s.reset(), ws.lineStart = yt }, polygonEnd: function() { var e = 2 * _s; Ss += e < 0 ? 4 * Pa + e : e, ws.lineStart = ws.lineEnd = ws.point = I } }; sa.geo.bounds = function() { function e(e, t) { E.push(b = [u = e, f = e]), t < d && (d = t), t > m && (m = t) } function t(t, n) { var r = Et([t * Ua, n * Ua]); if (h) { var o = St(h, r), i = [o[1], -o[0], 0], a = St(i, o); At(a), a = Tt(a); var l = t - p, c = l > 0 ? 1 : -1, g = a[0] * Va * c, v = ha(l) > 180; if (v ^ (c * p < g && g < c * t)) { var y = a[1] * Va; y > m && (m = y) } else if (g = (g + 360) % 360 - 180, v ^ (c * p < g && g < c * t)) { var y = -a[1] * Va; y < d && (d = y) } else n < d && (d = n), n > m && (m = n); v ? t < p ? s(u, t) > s(u, f) && (f = t) : s(t, f) > s(u, f) && (u = t) : f >= u ? (t < u && (u = t), t > f && (f = t)) : t > p ? s(u, t) > s(u, f) && (f = t) : s(t, f) > s(u, f) && (u = t) } else e(t, n); h = r, p = t } function n() { S.point = t } function r() { b[0] = u, b[1] = f, S.point = e, h = null } function o(e, n) { if (h) { var r = e - p; y += ha(r) > 180 ? r + (r > 0 ? 360 : -360) : r } else g = e, v = n; ws.point(e, n), t(e, n) } function i() { ws.lineStart() } function a() { o(g, v), ws.lineEnd(), ha(y) > Na && (u = -(f = 180)), b[0] = u, b[1] = f, h = null } function s(e, t) { return (t -= e) < 0 ? t + 360 : t } function l(e, t) { return e[0] - t[0] } function c(e, t) { return t[0] <= t[1] ? t[0] <= e && e <= t[1] : e < t[0] || t[1] < e } var u, d, f, m, p, g, v, h, y, E, b, S = { point: e, lineStart: n, lineEnd: r, polygonStart: function() { S.point = o, S.lineStart = i, S.lineEnd = a, y = 0, ws.polygonStart() }, polygonEnd: function() { ws.polygonEnd(), S.point = e, S.lineStart = n, S.lineEnd = r, _s < 0 ? (u = -(f = 180), d = -(m = 90)) : y > Na ? m = 90 : y < -Na && (d = -90), b[0] = u, b[1] = f } }; return function(e) { m = f = -(u = d = 1 / 0), E = [], sa.geo.stream(e, S); var t = E.length; if (t) { E.sort(l); for (var n, r = 1, o = E[0], i = [o]; r < t; ++r) n = E[r], c(n[0], o) || c(n[1], o) ? (s(o[0], n[1]) > s(o[0], o[1]) && (o[1] = n[1]), s(n[0], o[1]) > s(o[0], o[1]) && (o[0] = n[0])) : i.push(o = n); for (var a, n, p = -(1 / 0), t = i.length - 1, r = 0, o = i[t]; r <= t; o = n, ++r) n = i[r], (a = s(o[1], n[0])) > p && (p = a, u = n[0], f = o[1]) } return E = b = null, u === 1 / 0 || d === 1 / 0 ? [ [NaN, NaN], [NaN, NaN] ] : [ [u, d], [f, m] ] } }(), sa.geo.centroid = function(e) { As = Ts = Is = Cs = xs = Ms = Ds = Os = Rs = Ns = Ls = 0, sa.geo.stream(e, Ps); var t = Rs, n = Ns, r = Ls, o = t * t + n * n + r * r; return o < La && (t = Ms, n = Ds, r = Os, Ts < Na && (t = Is, n = Cs, r = xs), o = t * t + n * n + r * r, o < La) ? [NaN, NaN] : [Math.atan2(n, t) * Va, ae(r / Math.sqrt(o)) * Va] }; var As, Ts, Is, Cs, xs, Ms, Ds, Os, Rs, Ns, Ls, Ps = { sphere: I, point: Ct, lineStart: Mt, lineEnd: Dt, polygonStart: function() { Ps.lineStart = Ot }, polygonEnd: function() { Ps.lineStart = Mt } }, ks = Gt(Nt, zt, $t, [-Pa, -Pa / 2]), Gs = 1e9; sa.geo.clipExtent = function() { var e, t, n, r, o, i, a = { stream: function(e) { return o && (o.valid = !1), o = i(e), o.valid = !0, o }, extent: function(s) { return arguments.length ? (i = Yt(e = +s[0][0], t = +s[0][1], n = +s[1][0], r = +s[1][1]), o && (o.valid = !1, o = null), a) : [ [e, t], [n, r] ] } }; return a.extent([ [0, 0], [960, 500] ]) }, (sa.geo.conicEqualArea = function() { return qt(Kt) }).raw = Kt, sa.geo.albers = function() { return sa.geo.conicEqualArea().rotate([96, 0]).center([-.6, 38.7]).parallels([29.5, 45.5]).scale(1070) }, sa.geo.albersUsa = function() { function e(e) { var i = e[0], a = e[1]; return t = null, n(i, a), t || (r(i, a), t) || o(i, a), t } var t, n, r, o, i = sa.geo.albers(), a = sa.geo.conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), s = sa.geo.conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), l = { point: function(e, n) { t = [e, n] } }; return e.invert = function(e) { var t = i.scale(), n = i.translate(), r = (e[0] - n[0]) / t, o = (e[1] - n[1]) / t; return (o >= .12 && o < .234 && r >= -.425 && r < -.214 ? a : o >= .166 && o < .234 && r >= -.214 && r < -.115 ? s : i).invert(e) }, e.stream = function(e) { var t = i.stream(e), n = a.stream(e), r = s.stream(e); return { point: function(e, o) { t.point(e, o), n.point(e, o), r.point(e, o) }, sphere: function() { t.sphere(), n.sphere(), r.sphere() }, lineStart: function() { t.lineStart(), n.lineStart(), r.lineStart() }, lineEnd: function() { t.lineEnd(), n.lineEnd(), r.lineEnd() }, polygonStart: function() { t.polygonStart(), n.polygonStart(), r.polygonStart() }, polygonEnd: function() { t.polygonEnd(), n.polygonEnd(), r.polygonEnd() } } }, e.precision = function(t) { return arguments.length ? (i.precision(t), a.precision(t), s.precision(t), e) : i.precision() }, e.scale = function(t) { return arguments.length ? (i.scale(t), a.scale(.35 * t), s.scale(t), e.translate(i.translate())) : i.scale() }, e.translate = function(t) { if (!arguments.length) return i.translate(); var c = i.scale(), u = +t[0], d = +t[1]; return n = i.translate(t).clipExtent([ [u - .455 * c, d - .238 * c], [u + .455 * c, d + .238 * c] ]).stream(l).point, r = a.translate([u - .307 * c, d + .201 * c]).clipExtent([ [u - .425 * c + Na, d + .12 * c + Na], [u - .214 * c - Na, d + .234 * c - Na] ]).stream(l).point, o = s.translate([u - .205 * c, d + .212 * c]).clipExtent([ [u - .214 * c + Na, d + .166 * c + Na], [u - .115 * c - Na, d + .234 * c - Na] ]).stream(l).point, e }, e.scale(1070) }; var Fs, Us, Vs, zs, Bs, $s, Ws = { point: I, lineStart: I, lineEnd: I, polygonStart: function() { Us = 0, Ws.lineStart = Qt }, polygonEnd: function() { Ws.lineStart = Ws.lineEnd = Ws.point = I, Fs += ha(Us / 2) } }, Hs = { point: Zt, lineStart: I, lineEnd: I, polygonStart: I, polygonEnd: I }, js = { point: en, lineStart: tn, lineEnd: nn, polygonStart: function() { js.lineStart = rn }, polygonEnd: function() { js.point = en, js.lineStart = tn, js.lineEnd = nn } }; sa.geo.path = function() { function e(e) { return e && ("function" == typeof s && i.pointRadius(+s.apply(this, arguments)), a && a.valid || (a = o(i)), sa.geo.stream(e, a)), i.result() } function t() { return a = null, e } var n, r, o, i, a, s = 4.5; return e.area = function(e) { return Fs = 0, sa.geo.stream(e, o(Ws)), Fs }, e.centroid = function(e) { return Is = Cs = xs = Ms = Ds = Os = Rs = Ns = Ls = 0, sa.geo.stream(e, o(js)), Ls ? [Rs / Ls, Ns / Ls] : Os ? [Ms / Os, Ds / Os] : xs ? [Is / xs, Cs / xs] : [NaN, NaN] }, e.bounds = function(e) { return Bs = $s = -(Vs = zs = 1 / 0), sa.geo.stream(e, o(Hs)), [ [Vs, zs], [Bs, $s] ] }, e.projection = function(e) { return arguments.length ? (o = (n = e) ? e.stream || sn(e) : w, t()) : n }, e.context = function(e) { return arguments.length ? (i = null == (r = e) ? new Xt : new on(e), "function" != typeof s && i.pointRadius(s), t()) : r }, e.pointRadius = function(t) { return arguments.length ? (s = "function" == typeof t ? t : (i.pointRadius(+t), +t), e) : s }, e.projection(sa.geo.albersUsa()).context(null) }, sa.geo.transform = function(e) { return { stream: function(t) { var n = new ln(t); for (var r in e) n[r] = e[r]; return n } } }, ln.prototype = { point: function(e, t) { this.stream.point(e, t) }, sphere: function() { this.stream.sphere() }, lineStart: function() { this.stream.lineStart() }, lineEnd: function() { this.stream.lineEnd() }, polygonStart: function() { this.stream.polygonStart() }, polygonEnd: function() { this.stream.polygonEnd() } }, sa.geo.projection = un, sa.geo.projectionMutator = dn, (sa.geo.equirectangular = function() { return un(mn) }).raw = mn.invert = mn, sa.geo.rotation = function(e) { function t(t) { return t = e(t[0] * Ua, t[1] * Ua), t[0] *= Va, t[1] *= Va, t } return e = gn(e[0] % 360 * Ua, e[1] * Ua, e.length > 2 ? e[2] * Ua : 0), t.invert = function(t) { return t = e.invert(t[0] * Ua, t[1] * Ua), t[0] *= Va, t[1] *= Va, t }, t }, pn.invert = mn, sa.geo.circle = function() { function e() { var e = "function" == typeof r ? r.apply(this, arguments) : r, t = gn(-e[0] * Ua, -e[1] * Ua, 0).invert, o = []; return n(null, null, 1, { point: function(e, n) { o.push(e = t(e, n)), e[0] *= Va, e[1] *= Va } }), { type: "Polygon", coordinates: [o] } } var t, n, r = [0, 0], o = 6; return e.origin = function(t) { return arguments.length ? (r = t, e) : r }, e.angle = function(r) { return arguments.length ? (n = En((t = +r) * Ua, o * Ua), e) : t }, e.precision = function(r) { return arguments.length ? (n = En(t * Ua, (o = +r) * Ua), e) : o }, e.angle(90) }, sa.geo.distance = function(e, t) { var n, r = (t[0] - e[0]) * Ua, o = e[1] * Ua, i = t[1] * Ua, a = Math.sin(r), s = Math.cos(r), l = Math.sin(o), c = Math.cos(o), u = Math.sin(i), d = Math.cos(i); return Math.atan2(Math.sqrt((n = d * a) * n + (n = c * u - l * d * s) * n), l * u + c * d * s) }, sa.geo.graticule = function() { function e() { return { type: "MultiLineString", coordinates: t() } } function t() { return sa.range(Math.ceil(i / v) * v, o, v).map(f).concat(sa.range(Math.ceil(c / h) * h, l, h).map(m)).concat(sa.range(Math.ceil(r / p) * p, n, p).filter(function(e) { return ha(e % v) > Na }).map(u)).concat(sa.range(Math.ceil(s / g) * g, a, g).filter(function(e) { return ha(e % h) > Na }).map(d)) } var n, r, o, i, a, s, l, c, u, d, f, m, p = 10, g = p, v = 90, h = 360, y = 2.5; return e.lines = function() { return t().map(function(e) { return { type: "LineString", coordinates: e } }) }, e.outline = function() { return { type: "Polygon", coordinates: [f(i).concat(m(l).slice(1), f(o).reverse().slice(1), m(c).reverse().slice(1))] } }, e.extent = function(t) { return arguments.length ? e.majorExtent(t).minorExtent(t) : e.minorExtent() }, e.majorExtent = function(t) { return arguments.length ? (i = +t[0][0], o = +t[1][0], c = +t[0][1], l = +t[1][1], i > o && (t = i, i = o, o = t), c > l && (t = c, c = l, l = t), e.precision(y)) : [ [i, c], [o, l] ] }, e.minorExtent = function(t) { return arguments.length ? (r = +t[0][0], n = +t[1][0], s = +t[0][1], a = +t[1][1], r > n && (t = r, r = n, n = t), s > a && (t = s, s = a, a = t), e.precision(y)) : [ [r, s], [n, a] ] }, e.step = function(t) { return arguments.length ? e.majorStep(t).minorStep(t) : e.minorStep() }, e.majorStep = function(t) { return arguments.length ? (v = +t[0], h = +t[1], e) : [v, h] }, e.minorStep = function(t) { return arguments.length ? (p = +t[0], g = +t[1], e) : [p, g] }, e.precision = function(t) { return arguments.length ? (y = +t, u = Sn(s, a, 90), d = _n(r, n, y), f = Sn(c, l, 90), m = _n(i, o, y), e) : y }, e.majorExtent([ [-180, -90 + Na], [180, 90 - Na] ]).minorExtent([ [-180, -80 - Na], [180, 80 + Na] ]) }, sa.geo.greatArc = function() { function e() { return { type: "LineString", coordinates: [t || r.apply(this, arguments), n || o.apply(this, arguments)] } } var t, n, r = wn, o = An; return e.distance = function() { return sa.geo.distance(t || r.apply(this, arguments), n || o.apply(this, arguments)) }, e.source = function(n) { return arguments.length ? (r = n, t = "function" == typeof n ? null : n, e) : r }, e.target = function(t) { return arguments.length ? (o = t, n = "function" == typeof t ? null : t, e) : o }, e.precision = function() { return arguments.length ? e : 0 }, e }, sa.geo.interpolate = function(e, t) { return Tn(e[0] * Ua, e[1] * Ua, t[0] * Ua, t[1] * Ua) }, sa.geo.length = function(e) { return Ys = 0, sa.geo.stream(e, qs), Ys }; var Ys, qs = { sphere: I, point: I, lineStart: In, lineEnd: I, polygonStart: I, polygonEnd: I }, Ks = Cn(function(e) { return Math.sqrt(2 / (1 + e)) }, function(e) { return 2 * Math.asin(e / 2) }); (sa.geo.azimuthalEqualArea = function() { return un(Ks) }).raw = Ks; var Qs = Cn(function(e) { var t = Math.acos(e); return t && t / Math.sin(t) }, w); (sa.geo.azimuthalEquidistant = function() { return un(Qs) }).raw = Qs, (sa.geo.conicConformal = function() { return qt(xn) }).raw = xn, (sa.geo.conicEquidistant = function() { return qt(Mn) }).raw = Mn; var Zs = Cn(function(e) { return 1 / e }, Math.atan); (sa.geo.gnomonic = function() { return un(Zs) }).raw = Zs, Dn.invert = function(e, t) { return [e, 2 * Math.atan(Math.exp(t)) - Fa] }, (sa.geo.mercator = function() { return On(Dn) }).raw = Dn; var Xs = Cn(function() { return 1 }, Math.asin); (sa.geo.orthographic = function() { return un(Xs) }).raw = Xs; var Js = Cn(function(e) { return 1 / (1 + e) }, function(e) { return 2 * Math.atan(e) }); (sa.geo.stereographic = function() { return un(Js) }).raw = Js, Rn.invert = function(e, t) { return [-t, 2 * Math.atan(Math.exp(e)) - Fa] }, (sa.geo.transverseMercator = function() { var e = On(Rn), t = e.center, n = e.rotate; return e.center = function(e) { return e ? t([-e[1], e[0]]) : (e = t(), [e[1], -e[0]]) }, e.rotate = function(e) { return e ? n([e[0], e[1], e.length > 2 ? e[2] + 90 : 90]) : (e = n(), [e[0], e[1], e[2] - 90]) }, n([0, 0, 90]) }).raw = Rn, sa.geom = {}, sa.geom.hull = function(e) { function t(e) { if (e.length < 3) return []; var t, o = Oe(n), i = Oe(r), a = e.length, s = [], l = []; for (t = 0; t < a; t++) s.push([+o.call(this, e[t], t), +i.call(this, e[t], t), t]); for (s.sort(kn), t = 0; t < a; t++) l.push([s[t][0], -s[t][1]]); var c = Pn(s), u = Pn(l), d = u[0] === c[0], f = u[u.length - 1] === c[c.length - 1], m = []; for (t = c.length - 1; t >= 0; --t) m.push(e[s[c[t]][2]]); for (t = +d; t < u.length - f; ++t) m.push(e[s[u[t]][2]]); return m } var n = Nn, r = Ln; return arguments.length ? t(e) : (t.x = function(e) { return arguments.length ? (n = e, t) : n }, t.y = function(e) { return arguments.length ? (r = e, t) : r }, t) }, sa.geom.polygon = function(e) { return _a(e, el), e }; var el = sa.geom.polygon.prototype = []; el.area = function() { for (var e, t = -1, n = this.length, r = this[n - 1], o = 0; ++t < n;) e = r, r = this[t], o += e[1] * r[0] - e[0] * r[1]; return .5 * o }, el.centroid = function(e) { var t, n, r = -1, o = this.length, i = 0, a = 0, s = this[o - 1]; for (arguments.length || (e = -1 / (6 * this.area())); ++r < o;) t = s, s = this[r], n = t[0] * s[1] - s[0] * t[1], i += (t[0] + s[0]) * n, a += (t[1] + s[1]) * n; return [i * e, a * e] }, el.clip = function(e) { for (var t, n, r, o, i, a, s = Un(e), l = -1, c = this.length - Un(this), u = this[c - 1]; ++l < c;) { for (t = e.slice(), e.length = 0, o = this[l], i = t[(r = t.length - s) - 1], n = -1; ++n < r;) a = t[n], Gn(a, u, o) ? (Gn(i, u, o) || e.push(Fn(i, a, u, o)), e.push(a)) : Gn(i, u, o) && e.push(Fn(i, a, u, o)), i = a; s && e.push(e[0]), u = o } return e }; var tl, nl, rl, ol, il, al = [], sl = []; Yn.prototype.prepare = function() { for (var e, t = this.edges, n = t.length; n--;) e = t[n].edge, e.b && e.a || t.splice(n, 1); return t.sort(Kn), t.length }, ir.prototype = { start: function() { return this.edge.l === this.site ? this.edge.a : this.edge.b }, end: function() { return this.edge.l === this.site ? this.edge.b : this.edge.a } }, ar.prototype = { insert: function(e, t) { var n, r, o; if (e) { if (t.P = e, t.N = e.N, e.N && (e.N.P = t), e.N = t, e.R) { for (e = e.R; e.L;) e = e.L; e.L = t } else e.R = t; n = e } else this._ ? (e = ur(this._), t.P = null, t.N = e, e.P = e.L = t, n = e) : (t.P = t.N = null, this._ = t, n = null); for (t.L = t.R = null, t.U = n, t.C = !0, e = t; n && n.C;) r = n.U, n === r.L ? (o = r.R, o && o.C ? (n.C = o.C = !1, r.C = !0, e = r) : (e === n.R && (lr(this, n), e = n, n = e.U), n.C = !1, r.C = !0, cr(this, r))) : (o = r.L, o && o.C ? (n.C = o.C = !1, r.C = !0, e = r) : (e === n.L && (cr(this, n), e = n, n = e.U), n.C = !1, r.C = !0, lr(this, r))), n = e.U; this._.C = !1 }, remove: function(e) { e.N && (e.N.P = e.P), e.P && (e.P.N = e.N), e.N = e.P = null; var t, n, r, o = e.U, i = e.L, a = e.R; if (n = i ? a ? ur(a) : i : a, o ? o.L === e ? o.L = n : o.R = n : this._ = n, i && a ? (r = n.C, n.C = e.C, n.L = i, i.U = n, n !== a ? (o = n.U, n.U = e.U, e = n.R, o.L = e, n.R = a, a.U = n) : (n.U = o, o = n, e = n.R)) : (r = e.C, e = n), e && (e.U = o), !r) { if (e && e.C) return void(e.C = !1); do { if (e === this._) break; if (e === o.L) { if (t = o.R, t.C && (t.C = !1, o.C = !0, lr(this, o), t = o.R), t.L && t.L.C || t.R && t.R.C) { t.R && t.R.C || (t.L.C = !1, t.C = !0, cr(this, t), t = o.R), t.C = o.C, o.C = t.R.C = !1, lr(this, o), e = this._; break } } else if (t = o.L, t.C && (t.C = !1, o.C = !0, cr(this, o), t = o.L), t.L && t.L.C || t.R && t.R.C) { t.L && t.L.C || (t.R.C = !1, t.C = !0, lr(this, t), t = o.L), t.C = o.C, o.C = t.L.C = !1, cr(this, o), e = this._; break } t.C = !0, e = o, o = o.U } while (!e.C); e && (e.C = !1) } } }, sa.geom.voronoi = function(e) { function t(e) { var t = new Array(e.length), r = s[0][0], o = s[0][1], i = s[1][0], a = s[1][1]; return dr(n(e), s).cells.forEach(function(n, s) { var l = n.edges, c = n.site, u = t[s] = l.length ? l.map(function(e) { var t = e.start(); return [t.x, t.y] }) : c.x >= r && c.x <= i && c.y >= o && c.y <= a ? [ [r, a], [i, a], [i, o], [r, o] ] : []; u.point = e[s] }), t } function n(e) { return e.map(function(e, t) { return { x: Math.round(i(e, t) / Na) * Na, y: Math.round(a(e, t) / Na) * Na, i: t } }) } var r = Nn, o = Ln, i = r, a = o, s = ll; return e ? t(e) : (t.links = function(e) { return dr(n(e)).edges.filter(function(e) { return e.l && e.r }).map(function(t) { return { source: e[t.l.i], target: e[t.r.i] } }) }, t.triangles = function(e) { var t = []; return dr(n(e)).cells.forEach(function(n, r) { for (var o, i, a = n.site, s = n.edges.sort(Kn), l = -1, c = s.length, u = s[c - 1].edge, d = u.l === a ? u.r : u.l; ++l < c;) o = u, i = d, u = s[l].edge, d = u.l === a ? u.r : u.l, r < i.i && r < d.i && mr(a, i, d) < 0 && t.push([e[r], e[i.i], e[d.i]]) }), t }, t.x = function(e) { return arguments.length ? (i = Oe(r = e), t) : r }, t.y = function(e) { return arguments.length ? (a = Oe(o = e), t) : o }, t.clipExtent = function(e) { return arguments.length ? (s = null == e ? ll : e, t) : s === ll ? null : s }, t.size = function(e) { return arguments.length ? t.clipExtent(e && [ [0, 0], e ]) : s === ll ? null : s && s[1] }, t) }; var ll = [ [-1e6, -1e6], [1e6, 1e6] ]; sa.geom.delaunay = function(e) { return sa.geom.voronoi().triangles(e) }, sa.geom.quadtree = function(e, t, n, r, o) { function i(e) { function i(e, t, n, r, o, i, a, s) { if (!isNaN(n) && !isNaN(r)) if (e.leaf) { var l = e.x, u = e.y; if (null != l) if (ha(l - n) + ha(u - r) < .01) c(e, t, n, r, o, i, a, s); else { var d = e.point; e.x = e.y = e.point = null, c(e, d, l, u, o, i, a, s), c(e, t, n, r, o, i, a, s) } else e.x = n, e.y = r, e.point = t } else c(e, t, n, r, o, i, a, s) } function c(e, t, n, r, o, a, s, l) { var c = .5 * (o + s), u = .5 * (a + l), d = n >= c, f = r >= u, m = f << 1 | d; e.leaf = !1, e = e.nodes[m] || (e.nodes[m] = vr()), d ? o = c : s = c, f ? a = u : l = u, i(e, t, n, r, o, a, s, l) } var u, d, f, m, p, g, v, h, y, E = Oe(s), b = Oe(l); if (null != t) g = t, v = n, h = r, y = o; else if (h = y = -(g = v = 1 / 0), d = [], f = [], p = e.length, a) for (m = 0; m < p; ++m) u = e[m], u.x < g && (g = u.x), u.y < v && (v = u.y), u.x > h && (h = u.x), u.y > y && (y = u.y), d.push(u.x), f.push(u.y); else for (m = 0; m < p; ++m) { var S = +E(u = e[m], m), _ = +b(u, m); S < g && (g = S), _ < v && (v = _), S > h && (h = S), _ > y && (y = _), d.push(S), f.push(_) } var w = h - g, A = y - v; w > A ? y = v + w : h = g + A; var T = vr(); if (T.add = function(e) { i(T, e, +E(e, ++m), +b(e, m), g, v, h, y) }, T.visit = function(e) { hr(e, T, g, v, h, y) }, T.find = function(e) { return yr(T, e[0], e[1], g, v, h, y) }, m = -1, null == t) { for (; ++m < p;) i(T, e[m], d[m], f[m], g, v, h, y); --m } else e.forEach(T.add); return d = f = e = u = null, T } var a, s = Nn, l = Ln; return (a = arguments.length) ? (s = pr, l = gr, 3 === a && (o = n, r = t, n = t = 0), i(e)) : (i.x = function(e) { return arguments.length ? (s = e, i) : s }, i.y = function(e) { return arguments.length ? (l = e, i) : l }, i.extent = function(e) { return arguments.length ? (null == e ? t = n = r = o = null : (t = +e[0][0], n = +e[0][1], r = +e[1][0], o = +e[1][1]), i) : null == t ? null : [ [t, n], [r, o] ] }, i.size = function(e) { return arguments.length ? (null == e ? t = n = r = o = null : (t = n = 0, r = +e[0], o = +e[1]), i) : null == t ? null : [r - t, o - n] }, i) }, sa.interpolateRgb = Er, sa.interpolateObject = br, sa.interpolateNumber = Sr, sa.interpolateString = _r; var cl = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ul = new RegExp(cl.source, "g"); sa.interpolate = wr, sa.interpolators = [function(e, t) { var n = typeof t; return ("string" === n ? ts.has(t.toLowerCase()) || /^(#|rgb\(|hsl\()/i.test(t) ? Er : _r : t instanceof de ? Er : Array.isArray(t) ? Ar : "object" === n && isNaN(t) ? br : Sr)(e, t) }], sa.interpolateArray = Ar; var dl = function() { return w }, fl = sa.map({ linear: dl, poly: Or, quad: function() { return xr }, cubic: function() { return Mr }, sin: function() { return Rr }, exp: function() { return Nr }, circle: function() { return Lr }, elastic: Pr, back: kr, bounce: function() { return Gr } }), ml = sa.map({ in: w, out: Ir, "in-out": Cr, "out-in": function(e) { return Cr(Ir(e)) } }); sa.ease = function(e) { var t = e.indexOf("-"), n = t >= 0 ? e.slice(0, t) : e, r = t >= 0 ? e.slice(t + 1) : "in"; return n = fl.get(n) || dl, r = ml.get(r) || w, Tr(r(n.apply(null, la.call(arguments, 1)))) }, sa.interpolateHcl = Fr, sa.interpolateHsl = Ur, sa.interpolateLab = Vr, sa.interpolateRound = zr, sa.transform = function(e) { var t = ua.createElementNS(sa.ns.prefix.svg, "g"); return (sa.transform = function(e) { if (null != e) { t.setAttribute("transform", e); var n = t.transform.baseVal.consolidate() } return new Br(n ? n.matrix : pl) })(e) }, Br.prototype.toString = function() { return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")" }; var pl = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 }; sa.interpolateTransform = jr, sa.layout = {}, sa.layout.bundle = function() { return function(e) { for (var t = [], n = -1, r = e.length; ++n < r;) t.push(Kr(e[n])); return t } }, sa.layout.chord = function() { function e() { var e, c, d, f, m, p = {}, g = [], v = sa.range(i), h = []; for (n = [], r = [], e = 0, f = -1; ++f < i;) { for (c = 0, m = -1; ++m < i;) c += o[f][m]; g.push(c), h.push(sa.range(i)), e += c } for (a && v.sort(function(e, t) { return a(g[e], g[t]) }), s && h.forEach(function(e, t) { e.sort(function(e, n) { return s(o[t][e], o[t][n]) }) }), e = (ka - u * i) / e, c = 0, f = -1; ++f < i;) { for (d = c, m = -1; ++m < i;) { var y = v[f], E = h[y][m], b = o[y][E], S = c, _ = c += b * e; p[y + "-" + E] = { index: y, subindex: E, startAngle: S, endAngle: _, value: b } } r[y] = { index: y, startAngle: d, endAngle: c, value: (c - d) / e }, c += u } for (f = -1; ++f < i;) for (m = f - 1; ++m < i;) { var w = p[f + "-" + m], A = p[m + "-" + f]; (w.value || A.value) && n.push(w.value < A.value ? { source: A, target: w } : { source: w, target: A }) } l && t() } function t() { n.sort(function(e, t) { return l((e.source.value + e.target.value) / 2, (t.source.value + t.target.value) / 2) }) } var n, r, o, i, a, s, l, c = {}, u = 0; return c.matrix = function(e) { return arguments.length ? (i = (o = e) && o.length, n = r = null, c) : o }, c.padding = function(e) { return arguments.length ? (u = e, n = r = null, c) : u }, c.sortGroups = function(e) { return arguments.length ? (a = e, n = r = null, c) : a }, c.sortSubgroups = function(e) { return arguments.length ? (s = e, n = null, c) : s }, c.sortChords = function(e) { return arguments.length ? (l = e, n && t(), c) : l }, c.chords = function() { return n || e(), n }, c.groups = function() { return r || e(), r }, c }, sa.layout.force = function() { function e(e) { return function(t, n, r, o) { if (t.point !== e) { var i = t.cx - e.x, a = t.cy - e.y, s = o - n, l = i * i + a * a; if (s * s / v < l) { if (l < p) { var c = t.charge / l; e.px -= i * c, e.py -= a * c } return !0 } if (t.point && l && l < p) { var c = t.pointCharge / l; e.px -= i * c, e.py -= a * c } } return !t.charge } } function t(e) { e.px = sa.event.x, e.py = sa.event.y, s.resume() } var n, r, o, i, a, s = {}, l = sa.dispatch("start", "tick", "end"), c = [1, 1], u = .9, d = gl, f = vl, m = -30, p = hl, g = .1, v = .64, h = [], y = []; return s.tick = function() { if ((r *= .99) < .005) return l.end({ type: "end", alpha: r = 0 }), !0; var t, n, s, d, f, p, v, E, b, S = h.length, _ = y.length; for (n = 0; n < _; ++n) s = y[n], d = s.source, f = s.target, E = f.x - d.x, b = f.y - d.y, (p = E * E + b * b) && (p = r * i[n] * ((p = Math.sqrt(p)) - o[n]) / p, E *= p, b *= p, f.x -= E * (v = d.weight / (f.weight + d.weight)), f.y -= b * v, d.x += E * (v = 1 - v), d.y += b * v); if ((v = r * g) && (E = c[0] / 2, b = c[1] / 2, n = -1, v)) for (; ++n < S;) s = h[n], s.x += (E - s.x) * v, s.y += (b - s.y) * v; if (m) for (no(t = sa.geom.quadtree(h), r, a), n = -1; ++n < S;)(s = h[n]).fixed || t.visit(e(s)); for (n = -1; ++n < S;) s = h[n], s.fixed ? (s.x = s.px, s.y = s.py) : (s.x -= (s.px - (s.px = s.x)) * u, s.y -= (s.py - (s.py = s.y)) * u); l.tick({ type: "tick", alpha: r }) }, s.nodes = function(e) { return arguments.length ? (h = e, s) : h }, s.links = function(e) { return arguments.length ? (y = e, s) : y }, s.size = function(e) { return arguments.length ? (c = e, s) : c }, s.linkDistance = function(e) { return arguments.length ? (d = "function" == typeof e ? e : +e, s) : d }, s.distance = s.linkDistance, s.linkStrength = function(e) { return arguments.length ? (f = "function" == typeof e ? e : +e, s) : f }, s.friction = function(e) { return arguments.length ? (u = +e, s) : u }, s.charge = function(e) { return arguments.length ? (m = "function" == typeof e ? e : +e, s) : m }, s.chargeDistance = function(e) { return arguments.length ? (p = e * e, s) : Math.sqrt(p) }, s.gravity = function(e) { return arguments.length ? (g = +e, s) : g }, s.theta = function(e) { return arguments.length ? (v = e * e, s) : Math.sqrt(v) }, s.alpha = function(e) { return arguments.length ? (e = +e, r ? r = e > 0 ? e : 0 : e > 0 && (l.start({ type: "start", alpha: r = e }), sa.timer(s.tick)), s) : r }, s.start = function() { function e(e, r) { if (!n) { for (n = new Array(l), s = 0; s < l; ++s) n[s] = []; for (s = 0; s < u; ++s) { var o = y[s]; n[o.source.index].push(o.target), n[o.target.index].push(o.source) } } for (var i, a = n[t], s = -1, c = a.length; ++s < c;) if (!isNaN(i = a[s][e])) return i; return Math.random() * r } var t, n, r, l = h.length, u = y.length, p = c[0], g = c[1]; for (t = 0; t < l; ++t)(r = h[t]).index = t, r.weight = 0; for (t = 0; t < u; ++t) r = y[t], "number" == typeof r.source && (r.source = h[r.source]), "number" == typeof r.target && (r.target = h[r.target]), ++r.source.weight, ++r.target.weight; for (t = 0; t < l; ++t) r = h[t], isNaN(r.x) && (r.x = e("x", p)), isNaN(r.y) && (r.y = e("y", g)), isNaN(r.px) && (r.px = r.x), isNaN(r.py) && (r.py = r.y); if (o = [], "function" == typeof d) for (t = 0; t < u; ++t) o[t] = +d.call(this, y[t], t); else for (t = 0; t < u; ++t) o[t] = d; if (i = [], "function" == typeof f) for (t = 0; t < u; ++t) i[t] = +f.call(this, y[t], t); else for (t = 0; t < u; ++t) i[t] = f; if (a = [], "function" == typeof m) for (t = 0; t < l; ++t) a[t] = +m.call(this, h[t], t); else for (t = 0; t < l; ++t) a[t] = m; return s.resume() }, s.resume = function() { return s.alpha(.1) }, s.stop = function() { return s.alpha(0) }, s.drag = function() { return n || (n = sa.behavior.drag().origin(w).on("dragstart.force", Xr).on("drag.force", t).on("dragend.force", Jr)), arguments.length ? void this.on("mouseover.force", eo).on("mouseout.force", to).call(n) : n }, sa.rebind(s, l, "on") }; var gl = 20, vl = 1, hl = 1 / 0; sa.layout.hierarchy = function() { function e(o) { var i, a = [o], s = []; for (o.depth = 0; null != (i = a.pop());) if (s.push(i), (c = n.call(e, i, i.depth)) && (l = c.length)) { for (var l, c, u; --l >= 0;) a.push(u = c[l]), u.parent = i, u.depth = i.depth + 1; r && (i.value = 0), i.children = c } else r && (i.value = +r.call(e, i, i.depth) || 0), delete i.children; return io(o, function(e) { var n, o; t && (n = e.children) && n.sort(t), r && (o = e.parent) && (o.value += e.value) }), s } var t = lo, n = ao, r = so; return e.sort = function(n) { return arguments.length ? (t = n, e) : t }, e.children = function(t) { return arguments.length ? (n = t, e) : n }, e.value = function(t) { return arguments.length ? (r = t, e) : r }, e.revalue = function(t) { return r && (oo(t, function(e) { e.children && (e.value = 0) }), io(t, function(t) { var n; t.children || (t.value = +r.call(e, t, t.depth) || 0), (n = t.parent) && (n.value += t.value) })), t }, e }, sa.layout.partition = function() { function e(t, n, r, o) { var i = t.children; if (t.x = n, t.y = t.depth * o, t.dx = r, t.dy = o, i && (a = i.length)) { var a, s, l, c = -1; for (r = t.value ? r / t.value : 0; ++c < a;) e(s = i[c], n, l = s.value * r, o), n += l } } function t(e) { var n = e.children, r = 0; if (n && (o = n.length)) for (var o, i = -1; ++i < o;) r = Math.max(r, t(n[i])); return 1 + r } function n(n, i) { var a = r.call(this, n, i); return e(a[0], 0, o[0], o[1] / t(a[0])), a } var r = sa.layout.hierarchy(), o = [1, 1]; return n.size = function(e) { return arguments.length ? (o = e, n) : o }, ro(n, r) }, sa.layout.pie = function() { function e(a) { var s, l = a.length, c = a.map(function(n, r) { return +t.call(e, n, r) }), u = +("function" == typeof r ? r.apply(this, arguments) : r), d = ("function" == typeof o ? o.apply(this, arguments) : o) - u, f = Math.min(Math.abs(d) / l, +("function" == typeof i ? i.apply(this, arguments) : i)), m = f * (d < 0 ? -1 : 1), p = (d - l * m) / sa.sum(c), g = sa.range(l), v = []; return null != n && g.sort(n === yl ? function(e, t) { return c[t] - c[e] } : function(e, t) { return n(a[e], a[t]) }), g.forEach(function(e) { v[e] = { data: a[e], value: s = c[e], startAngle: u, endAngle: u += s * p + m, padAngle: f } }), v } var t = Number, n = yl, r = 0, o = ka, i = 0; return e.value = function(n) { return arguments.length ? (t = n, e) : t }, e.sort = function(t) { return arguments.length ? (n = t, e) : n }, e.startAngle = function(t) { return arguments.length ? (r = t, e) : r }, e.endAngle = function(t) { return arguments.length ? (o = t, e) : o }, e.padAngle = function(t) { return arguments.length ? (i = t, e) : i }, e }; var yl = {}; sa.layout.stack = function() { function e(s, l) { if (!(f = s.length)) return s; var c = s.map(function(n, r) { return t.call(e, n, r) }), u = c.map(function(t) { return t.map(function(t, n) { return [i.call(e, t, n), a.call(e, t, n)] }) }), d = n.call(e, u, l); c = sa.permute(c, d), u = sa.permute(u, d); var f, m, p, g, v = r.call(e, u, l), h = c[0].length; for (p = 0; p < h; ++p) for (o.call(e, c[0][p], g = v[p], u[0][p][1]), m = 1; m < f; ++m) o.call(e, c[m][p], g += u[m - 1][p][1], u[m][p][1]); return s } var t = w, n = po, r = go, o = mo, i = uo, a = fo; return e.values = function(n) { return arguments.length ? (t = n, e) : t }, e.order = function(t) { return arguments.length ? (n = "function" == typeof t ? t : El.get(t) || po, e) : n }, e.offset = function(t) { return arguments.length ? (r = "function" == typeof t ? t : bl.get(t) || go, e) : r }, e.x = function(t) { return arguments.length ? (i = t, e) : i }, e.y = function(t) { return arguments.length ? (a = t, e) : a }, e.out = function(t) { return arguments.length ? (o = t, e) : o }, e }; var El = sa.map({ "inside-out": function(e) { var t, n, r = e.length, o = e.map(vo), i = e.map(ho), a = sa.range(r).sort(function(e, t) { return o[e] - o[t] }), s = 0, l = 0, c = [], u = []; for (t = 0; t < r; ++t) n = a[t], s < l ? (s += i[n], c.push(n)) : (l += i[n], u.push(n)); return u.reverse().concat(c) }, reverse: function(e) { return sa.range(e.length).reverse() }, default: po }), bl = sa.map({ silhouette: function(e) { var t, n, r, o = e.length, i = e[0].length, a = [], s = 0, l = []; for (n = 0; n < i; ++n) { for (t = 0, r = 0; t < o; t++) r += e[t][n][1]; r > s && (s = r), a.push(r) } for (n = 0; n < i; ++n) l[n] = (s - a[n]) / 2; return l }, wiggle: function(e) { var t, n, r, o, i, a, s, l, c, u = e.length, d = e[0], f = d.length, m = []; for (m[0] = l = c = 0, n = 1; n < f; ++n) { for (t = 0, o = 0; t < u; ++t) o += e[t][n][1]; for (t = 0, i = 0, s = d[n][0] - d[n - 1][0]; t < u; ++t) { for (r = 0, a = (e[t][n][1] - e[t][n - 1][1]) / (2 * s); r < t; ++r) a += (e[r][n][1] - e[r][n - 1][1]) / s; i += a * e[t][n][1] } m[n] = l -= o ? i / o * s : 0, l < c && (c = l) } for (n = 0; n < f; ++n) m[n] -= c; return m }, expand: function(e) { var t, n, r, o = e.length, i = e[0].length, a = 1 / o, s = []; for (n = 0; n < i; ++n) { for (t = 0, r = 0; t < o; t++) r += e[t][n][1]; if (r) for (t = 0; t < o; t++) e[t][n][1] /= r; else for (t = 0; t < o; t++) e[t][n][1] = a } for (n = 0; n < i; ++n) s[n] = 0; return s }, zero: go }); sa.layout.histogram = function() { function e(e, i) { for (var a, s, l = [], c = e.map(n, this), u = r.call(this, c, i), d = o.call(this, u, c, i), i = -1, f = c.length, m = d.length - 1, p = t ? 1 : 1 / f; ++i < m;) a = l[i] = [], a.dx = d[i + 1] - (a.x = d[i]), a.y = 0; if (m > 0) for (i = -1; ++i < f;) s = c[i], s >= u[0] && s <= u[1] && (a = l[sa.bisect(d, s, 1, m) - 1], a.y += p, a.push(e[i])); return l } var t = !0, n = Number, r = So, o = Eo; return e.value = function(t) { return arguments.length ? (n = t, e) : n }, e.range = function(t) { return arguments.length ? (r = Oe(t), e) : r }, e.bins = function(t) { return arguments.length ? (o = "number" == typeof t ? function(e) { return bo(e, t) } : Oe(t), e) : o }, e.frequency = function(n) { return arguments.length ? (t = !!n, e) : t }, e }, sa.layout.pack = function() { function e(e, i) { var a = n.call(this, e, i), s = a[0], l = o[0], c = o[1], u = null == t ? Math.sqrt : "function" == typeof t ? t : function() { return t }; if (s.x = s.y = 0, io(s, function(e) { e.r = +u(e.value) }), io(s, Io), r) { var d = r * (t ? 1 : Math.max(2 * s.r / l, 2 * s.r / c)) / 2; io(s, function(e) { e.r += d }), io(s, Io), io(s, function(e) { e.r -= d }) } return Mo(s, l / 2, c / 2, t ? 1 : 1 / Math.max(2 * s.r / l, 2 * s.r / c)), a } var t, n = sa.layout.hierarchy().sort(_o), r = 0, o = [1, 1]; return e.size = function(t) { return arguments.length ? (o = t, e) : o }, e.radius = function(n) { return arguments.length ? (t = null == n || "function" == typeof n ? n : +n, e) : t }, e.padding = function(t) { return arguments.length ? (r = +t, e) : r }, ro(e, n) }, sa.layout.tree = function() { function e(e, o) { var u = a.call(this, e, o), d = u[0], f = t(d); if (io(f, n), f.parent.m = -f.z, oo(f, r), c) oo(d, i); else { var m = d, p = d, g = d; oo(d, function(e) { e.x < m.x && (m = e), e.x > p.x && (p = e), e.depth > g.depth && (g = e) }); var v = s(m, p) / 2 - m.x, h = l[0] / (p.x + s(p, m) / 2 + v), y = l[1] / (g.depth || 1); oo(d, function(e) { e.x = (e.x + v) * h, e.y = e.depth * y }) } return u } function t(e) { for (var t, n = { A: null, children: [e] }, r = [n]; null != (t = r.pop());) for (var o, i = t.children, a = 0, s = i.length; a < s; ++a) r.push((i[a] = o = { _: i[a], parent: t, children: (o = i[a].children) && o.slice() || [], A: null, a: null, z: 0, m: 0, c: 0, s: 0, t: null, i: a }).a = o); return n.children[0] } function n(e) { var t = e.children, n = e.parent.children, r = e.i ? n[e.i - 1] : null; if (t.length) { Po(e); var i = (t[0].z + t[t.length - 1].z) / 2; r ? (e.z = r.z + s(e._, r._), e.m = e.z - i) : e.z = i } else r && (e.z = r.z + s(e._, r._)); e.parent.A = o(e, r, e.parent.A || n[0]) } function r(e) { e._.x = e.z + e.parent.m, e.m += e.parent.m } function o(e, t, n) { if (t) { for (var r, o = e, i = e, a = t, l = o.parent.children[0], c = o.m, u = i.m, d = a.m, f = l.m; a = No(a), o = Ro(o), a && o;) l = Ro(l), i = No(i), i.a = e, r = a.z + d - o.z - c + s(a._, o._), r > 0 && (Lo(ko(a, e, n), e, r), c += r, u += r), d += a.m, c += o.m, f += l.m, u += i.m; a && !No(i) && (i.t = a, i.m += d - u), o && !Ro(l) && (l.t = o, l.m += c - f, n = e) } return n } function i(e) { e.x *= l[0], e.y = e.depth * l[1] } var a = sa.layout.hierarchy().sort(null).value(null), s = Oo, l = [1, 1], c = null; return e.separation = function(t) { return arguments.length ? (s = t, e) : s }, e.size = function(t) { return arguments.length ? (c = null == (l = t) ? i : null, e) : c ? null : l }, e.nodeSize = function(t) { return arguments.length ? (c = null == (l = t) ? null : i, e) : c ? l : null }, ro(e, a) }, sa.layout.cluster = function() { function e(e, i) { var a, s = t.call(this, e, i), l = s[0], c = 0; io(l, function(e) { var t = e.children; t && t.length ? (e.x = Fo(t), e.y = Go(t)) : (e.x = a ? c += n(e, a) : 0, e.y = 0, a = e) }); var u = Uo(l), d = Vo(l), f = u.x - n(u, d) / 2, m = d.x + n(d, u) / 2; return io(l, o ? function(e) { e.x = (e.x - l.x) * r[0], e.y = (l.y - e.y) * r[1] } : function(e) { e.x = (e.x - f) / (m - f) * r[0], e.y = (1 - (l.y ? e.y / l.y : 1)) * r[1] }), s } var t = sa.layout.hierarchy().sort(null).value(null), n = Oo, r = [1, 1], o = !1; return e.separation = function(t) { return arguments.length ? (n = t, e) : n }, e.size = function(t) { return arguments.length ? (o = null == (r = t), e) : o ? null : r }, e.nodeSize = function(t) { return arguments.length ? (o = null != (r = t), e) : o ? r : null }, ro(e, t) }, sa.layout.treemap = function() { function e(e, t) { for (var n, r, o = -1, i = e.length; ++o < i;) r = (n = e[o]).value * (t < 0 ? 0 : t), n.area = isNaN(r) || r <= 0 ? 0 : r } function t(n) { var i = n.children; if (i && i.length) { var a, s, l, c = d(n), u = [], f = i.slice(), p = 1 / 0, g = "slice" === m ? c.dx : "dice" === m ? c.dy : "slice-dice" === m ? 1 & n.depth ? c.dy : c.dx : Math.min(c.dx, c.dy); for (e(f, c.dx * c.dy / n.value), u.area = 0; (l = f.length) > 0;) u.push(a = f[l - 1]), u.area += a.area, "squarify" !== m || (s = r(u, g)) <= p ? (f.pop(), p = s) : (u.area -= u.pop().area, o(u, g, c, !1), g = Math.min(c.dx, c.dy), u.length = u.area = 0, p = 1 / 0); u.length && (o(u, g, c, !0), u.length = u.area = 0), i.forEach(t) } } function n(t) { var r = t.children; if (r && r.length) { var i, a = d(t), s = r.slice(), l = []; for (e(s, a.dx * a.dy / t.value), l.area = 0; i = s.pop();) l.push(i), l.area += i.area, null != i.z && (o(l, i.z ? a.dx : a.dy, a, !s.length), l.length = l.area = 0); r.forEach(n) } } function r(e, t) { for (var n, r = e.area, o = 0, i = 1 / 0, a = -1, s = e.length; ++a < s;)(n = e[a].area) && (n < i && (i = n), n > o && (o = n)); return r *= r, t *= t, r ? Math.max(t * o * p / r, r / (t * i * p)) : 1 / 0 } function o(e, t, n, r) { var o, i = -1, a = e.length, s = n.x, c = n.y, u = t ? l(e.area / t) : 0; if (t == n.dx) { for ((r || u > n.dy) && (u = n.dy); ++i < a;) o = e[i], o.x = s, o.y = c, o.dy = u, s += o.dx = Math.min(n.x + n.dx - s, u ? l(o.area / u) : 0); o.z = !0, o.dx += n.x + n.dx - s, n.y += u, n.dy -= u } else { for ((r || u > n.dx) && (u = n.dx); ++i < a;) o = e[i], o.x = s, o.y = c, o.dx = u, c += o.dy = Math.min(n.y + n.dy - c, u ? l(o.area / u) : 0); o.z = !1, o.dy += n.y + n.dy - c, n.x += u, n.dx -= u } } function i(r) { var o = a || s(r), i = o[0]; return i.x = 0, i.y = 0, i.dx = c[0], i.dy = c[1], a && s.revalue(i), e([i], i.dx * i.dy / i.value), (a ? n : t)(i), f && (a = o), o } var a, s = sa.layout.hierarchy(), l = Math.round, c = [1, 1], u = null, d = zo, f = !1, m = "squarify", p = .5 * (1 + Math.sqrt(5)); return i.size = function(e) { return arguments.length ? (c = e, i) : c }, i.padding = function(e) { function t(t) { var n = e.call(i, t, t.depth); return null == n ? zo(t) : Bo(t, "number" == typeof n ? [n, n, n, n] : n) } function n(t) { return Bo(t, e) } if (!arguments.length) return u; var r; return d = null == (u = e) ? zo : "function" == (r = typeof e) ? t : "number" === r ? (e = [e, e, e, e], n) : n, i }, i.round = function(e) { return arguments.length ? (l = e ? Math.round : Number, i) : l != Number }, i.sticky = function(e) { return arguments.length ? (f = e, a = null, i) : f }, i.ratio = function(e) { return arguments.length ? (p = e, i) : p }, i.mode = function(e) { return arguments.length ? (m = e + "", i) : m }, ro(i, s) }, sa.random = { normal: function(e, t) { var n = arguments.length; return n < 2 && (t = 1), n < 1 && (e = 0), function() { var n, r, o; do n = 2 * Math.random() - 1, r = 2 * Math.random() - 1, o = n * n + r * r; while (!o || o > 1); return e + t * n * Math.sqrt(-2 * Math.log(o) / o) } }, logNormal: function() { var e = sa.random.normal.apply(sa, arguments); return function() { return Math.exp(e()) } }, bates: function(e) { var t = sa.random.irwinHall(e); return function() { return t() / e } }, irwinHall: function(e) { return function() { for (var t = 0, n = 0; n < e; n++) t += Math.random(); return t } } }, sa.scale = {}; var Sl = { floor: w, ceil: w }; sa.scale.linear = function() { return Ko([0, 1], [0, 1], wr, !1) }; var _l = { s: 1, g: 1, p: 1, r: 1, e: 1 }; sa.scale.log = function() { return ri(sa.scale.linear().domain([0, 1]), 10, !0, [1, 10]) }; var wl = sa.format(".0e"), Al = { floor: function(e) { return -Math.ceil(-e) }, ceil: function(e) { return -Math.floor(-e) } }; sa.scale.pow = function() { return oi(sa.scale.linear(), 1, [0, 1]) }, sa.scale.sqrt = function() { return sa.scale.pow().exponent(.5) }, sa.scale.ordinal = function() { return ai([], { t: "range", a: [ [] ] }) }, sa.scale.category10 = function() { return sa.scale.ordinal().range(Tl) }, sa.scale.category20 = function() { return sa.scale.ordinal().range(Il) }, sa.scale.category20b = function() { return sa.scale.ordinal().range(Cl) }, sa.scale.category20c = function() { return sa.scale.ordinal().range(xl) }; var Tl = [2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175].map(Ae), Il = [2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725].map(Ae), Cl = [3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654].map(Ae), xl = [3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081].map(Ae); sa.scale.quantile = function() { return si([], []) }, sa.scale.quantize = function() { return li(0, 1, [0, 1]) }, sa.scale.threshold = function() { return ci([.5], [0, 1]) }, sa.scale.identity = function() { return ui([0, 1]) }, sa.svg = {}, sa.svg.arc = function() { function e() { var e = Math.max(0, +n.apply(this, arguments)), c = Math.max(0, +r.apply(this, arguments)), u = a.apply(this, arguments) - Fa, d = s.apply(this, arguments) - Fa, f = Math.abs(d - u), m = u > d ? 0 : 1; if (c < e && (p = c, c = e, e = p), f >= Ga) return t(c, m) + (e ? t(e, 1 - m) : "") + "Z"; var p, g, v, h, y, E, b, S, _, w, A, T, I = 0, C = 0, x = []; if ((h = (+l.apply(this, arguments) || 0) / 2) && (v = i === Ml ? Math.sqrt(e * e + c * c) : +i.apply(this, arguments), m || (C *= -1), c && (C = ae(v / c * Math.sin(h))), e && (I = ae(v / e * Math.sin(h)))), c) { y = c * Math.cos(u + C), E = c * Math.sin(u + C), b = c * Math.cos(d - C), S = c * Math.sin(d - C); var M = Math.abs(d - u - 2 * C) <= Pa ? 0 : 1; if (C && hi(y, E, b, S) === m ^ M) { var D = (u + d) / 2; y = c * Math.cos(D), E = c * Math.sin(D), b = S = null } } else y = E = 0; if (e) { _ = e * Math.cos(d - I), w = e * Math.sin(d - I), A = e * Math.cos(u + I), T = e * Math.sin(u + I); var O = Math.abs(u - d + 2 * I) <= Pa ? 0 : 1; if (I && hi(_, w, A, T) === 1 - m ^ O) { var R = (u + d) / 2; _ = e * Math.cos(R), w = e * Math.sin(R), A = T = null } } else _ = w = 0; if ((p = Math.min(Math.abs(c - e) / 2, +o.apply(this, arguments))) > .001) { g = e < c ^ m ? 0 : 1; var N = null == A ? [_, w] : null == b ? [y, E] : Fn([y, E], [A, T], [b, S], [_, w]), L = y - N[0], P = E - N[1], k = b - N[0], G = S - N[1], F = 1 / Math.sin(Math.acos((L * k + P * G) / (Math.sqrt(L * L + P * P) * Math.sqrt(k * k + G * G))) / 2), U = Math.sqrt(N[0] * N[0] + N[1] * N[1]); if (null != b) { var V = Math.min(p, (c - U) / (F + 1)), z = yi(null == A ? [_, w] : [A, T], [y, E], c, V, m), B = yi([b, S], [_, w], c, V, m); p === V ? x.push("M", z[0], "A", V, ",", V, " 0 0,", g, " ", z[1], "A", c, ",", c, " 0 ", 1 - m ^ hi(z[1][0], z[1][1], B[1][0], B[1][1]), ",", m, " ", B[1], "A", V, ",", V, " 0 0,", g, " ", B[0]) : x.push("M", z[0], "A", V, ",", V, " 0 1,", g, " ", B[0]) } else x.push("M", y, ",", E); if (null != A) { var $ = Math.min(p, (e - U) / (F - 1)), W = yi([y, E], [A, T], e, -$, m), H = yi([_, w], null == b ? [y, E] : [b, S], e, -$, m); p === $ ? x.push("L", H[0], "A", $, ",", $, " 0 0,", g, " ", H[1], "A", e, ",", e, " 0 ", m ^ hi(H[1][0], H[1][1], W[1][0], W[1][1]), ",", 1 - m, " ", W[1], "A", $, ",", $, " 0 0,", g, " ", W[0]) : x.push("L", H[0], "A", $, ",", $, " 0 0,", g, " ", W[0]) } else x.push("L", _, ",", w) } else x.push("M", y, ",", E), null != b && x.push("A", c, ",", c, " 0 ", M, ",", m, " ", b, ",", S), x.push("L", _, ",", w), null != A && x.push("A", e, ",", e, " 0 ", O, ",", 1 - m, " ", A, ",", T); return x.push("Z"), x.join("") } function t(e, t) { return "M0," + e + "A" + e + "," + e + " 0 1," + t + " 0," + -e + "A" + e + "," + e + " 0 1," + t + " 0," + e } var n = fi, r = mi, o = di, i = Ml, a = pi, s = gi, l = vi; return e.innerRadius = function(t) { return arguments.length ? (n = Oe(t), e) : n }, e.outerRadius = function(t) { return arguments.length ? (r = Oe(t), e) : r }, e.cornerRadius = function(t) { return arguments.length ? (o = Oe(t), e) : o }, e.padRadius = function(t) { return arguments.length ? (i = t == Ml ? Ml : Oe(t), e) : i }, e.startAngle = function(t) { return arguments.length ? (a = Oe(t), e) : a }, e.endAngle = function(t) { return arguments.length ? (s = Oe(t), e) : s }, e.padAngle = function(t) { return arguments.length ? (l = Oe(t), e) : l }, e.centroid = function() { var e = (+n.apply(this, arguments) + +r.apply(this, arguments)) / 2, t = (+a.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Fa; return [Math.cos(t) * e, Math.sin(t) * e] }, e }; var Ml = "auto"; sa.svg.line = function() { return Ei(w) }; var Dl = sa.map({ linear: bi, "linear-closed": Si, step: _i, "step-before": wi, "step-after": Ai, basis: Di, "basis-open": Oi, "basis-closed": Ri, bundle: Ni, cardinal: Ci, "cardinal-open": Ti, "cardinal-closed": Ii, monotone: Ui }); Dl.forEach(function(e, t) { t.key = e, t.closed = /-closed$/.test(e) }); var Ol = [0, 2 / 3, 1 / 3, 0], Rl = [0, 1 / 3, 2 / 3, 0], Nl = [0, 1 / 6, 2 / 3, 1 / 6]; sa.svg.line.radial = function() { var e = Ei(Vi); return e.radius = e.x, delete e.x, e.angle = e.y, delete e.y, e }, wi.reverse = Ai, Ai.reverse = wi, sa.svg.area = function() { return zi(w) }, sa.svg.area.radial = function() { var e = zi(Vi); return e.radius = e.x, delete e.x, e.innerRadius = e.x0, delete e.x0, e.outerRadius = e.x1, delete e.x1, e.angle = e.y, delete e.y, e.startAngle = e.y0, delete e.y0, e.endAngle = e.y1, delete e.y1, e }, sa.svg.chord = function() { function e(e, s) { var l = t(this, i, e, s), c = t(this, a, e, s); return "M" + l.p0 + r(l.r, l.p1, l.a1 - l.a0) + (n(l, c) ? o(l.r, l.p1, l.r, l.p0) : o(l.r, l.p1, c.r, c.p0) + r(c.r, c.p1, c.a1 - c.a0) + o(c.r, c.p1, l.r, l.p0)) + "Z" } function t(e, t, n, r) { var o = t.call(e, n, r), i = s.call(e, o, r), a = l.call(e, o, r) - Fa, u = c.call(e, o, r) - Fa; return { r: i, a0: a, a1: u, p0: [i * Math.cos(a), i * Math.sin(a)], p1: [i * Math.cos(u), i * Math.sin(u)] } } function n(e, t) { return e.a0 == t.a0 && e.a1 == t.a1 } function r(e, t, n) { return "A" + e + "," + e + " 0 " + +(n > Pa) + ",1 " + t } function o(e, t, n, r) { return "Q 0,0 " + r } var i = wn, a = An, s = Bi, l = pi, c = gi; return e.radius = function(t) { return arguments.length ? (s = Oe(t), e) : s }, e.source = function(t) { return arguments.length ? (i = Oe(t), e) : i }, e.target = function(t) { return arguments.length ? (a = Oe(t), e) : a }, e.startAngle = function(t) { return arguments.length ? (l = Oe(t), e) : l }, e.endAngle = function(t) { return arguments.length ? (c = Oe(t), e) : c }, e }, sa.svg.diagonal = function() { function e(e, o) { var i = t.call(this, e, o), a = n.call(this, e, o), s = (i.y + a.y) / 2, l = [i, { x: i.x, y: s }, { x: a.x, y: s }, a]; return l = l.map(r), "M" + l[0] + "C" + l[1] + " " + l[2] + " " + l[3] } var t = wn, n = An, r = $i; return e.source = function(n) { return arguments.length ? (t = Oe(n), e) : t }, e.target = function(t) { return arguments.length ? (n = Oe(t), e) : n }, e.projection = function(t) { return arguments.length ? (r = t, e) : r }, e }, sa.svg.diagonal.radial = function() { var e = sa.svg.diagonal(), t = $i, n = e.projection; return e.projection = function(e) { return arguments.length ? n(Wi(t = e)) : t }, e }, sa.svg.symbol = function() { function e(e, r) { return (Ll.get(t.call(this, e, r)) || Yi)(n.call(this, e, r)) } var t = ji, n = Hi; return e.type = function(n) { return arguments.length ? (t = Oe(n), e) : t }, e.size = function(t) { return arguments.length ? (n = Oe(t), e) : n }, e }; var Ll = sa.map({ circle: Yi, cross: function(e) { var t = Math.sqrt(e / 5) / 2; return "M" + -3 * t + "," + -t + "H" + -t + "V" + -3 * t + "H" + t + "V" + -t + "H" + 3 * t + "V" + t + "H" + t + "V" + 3 * t + "H" + -t + "V" + t + "H" + -3 * t + "Z" }, diamond: function(e) { var t = Math.sqrt(e / (2 * kl)), n = t * kl; return "M0," + -t + "L" + n + ",0 0," + t + " " + -n + ",0Z" }, square: function(e) { var t = Math.sqrt(e) / 2; return "M" + -t + "," + -t + "L" + t + "," + -t + " " + t + "," + t + " " + -t + "," + t + "Z" }, "triangle-down": function(e) { var t = Math.sqrt(e / Pl), n = t * Pl / 2; return "M0," + n + "L" + t + "," + -n + " " + -t + "," + -n + "Z" }, "triangle-up": function(e) { var t = Math.sqrt(e / Pl), n = t * Pl / 2; return "M0," + -n + "L" + t + "," + n + " " + -t + "," + n + "Z" } }); sa.svg.symbolTypes = Ll.keys(); var Pl = Math.sqrt(3), kl = Math.tan(30 * Ua); Ia.transition = function(e) { for (var t, n, r = Gl || ++zl, o = Xi(e), i = [], a = Fl || { time: Date.now(), ease: Dr, delay: 0, duration: 250 }, s = -1, l = this.length; ++s < l;) { i.push(t = []); for (var c = this[s], u = -1, d = c.length; ++u < d;)(n = c[u]) && Ji(n, u, o, r, a), t.push(n) } return Ki(i, o, r) }, Ia.interrupt = function(e) { return this.each(null == e ? Ul : qi(Xi(e))) }; var Gl, Fl, Ul = qi(Xi()), Vl = [], zl = 0; Vl.call = Ia.call, Vl.empty = Ia.empty, Vl.node = Ia.node, Vl.size = Ia.size, sa.transition = function(e, t) { return e && e.transition ? Gl ? e.transition(t) : e : sa.selection().transition(e) }, sa.transition.prototype = Vl, Vl.select = function(e) { var t, n, r, o = this.id, i = this.namespace, a = []; e = N(e); for (var s = -1, l = this.length; ++s < l;) { a.push(t = []); for (var c = this[s], u = -1, d = c.length; ++u < d;)(r = c[u]) && (n = e.call(r, r.__data__, u, s)) ? ("__data__" in r && (n.__data__ = r.__data__), Ji(n, u, i, o, r[i][o]), t.push(n)) : t.push(null) } return Ki(a, i, o) }, Vl.selectAll = function(e) { var t, n, r, o, i, a = this.id, s = this.namespace, l = []; e = L(e); for (var c = -1, u = this.length; ++c < u;) for (var d = this[c], f = -1, m = d.length; ++f < m;) if (r = d[f]) { i = r[s][a], n = e.call(r, r.__data__, f, c), l.push(t = []); for (var p = -1, g = n.length; ++p < g;)(o = n[p]) && Ji(o, p, s, a, i), t.push(o) } return Ki(l, s, a) }, Vl.filter = function(e) { var t, n, r, o = []; "function" != typeof e && (e = j(e)); for (var i = 0, a = this.length; i < a; i++) { o.push(t = []); for (var n = this[i], s = 0, l = n.length; s < l; s++)(r = n[s]) && e.call(r, r.__data__, s, i) && t.push(r) } return Ki(o, this.namespace, this.id) }, Vl.tween = function(e, t) { var n = this.id, r = this.namespace; return arguments.length < 2 ? this.node()[r][n].tween.get(e) : q(this, null == t ? function(t) { t[r][n].tween.remove(e) } : function(o) { o[r][n].tween.set(e, t) }) }, Vl.attr = function(e, t) { function n() { this.removeAttribute(s) } function r() { this.removeAttributeNS(s.space, s.local) } function o(e) { return null == e ? n : (e += "", function() { var t, n = this.getAttribute(s); return n !== e && (t = a(n, e), function(e) { this.setAttribute(s, t(e)) }) }) } function i(e) { return null == e ? r : (e += "", function() { var t, n = this.getAttributeNS(s.space, s.local); return n !== e && (t = a(n, e), function(e) { this.setAttributeNS(s.space, s.local, t(e)) }) }) } if (arguments.length < 2) { for (t in e) this.attr(t, e[t]); return this } var a = "transform" == e ? jr : wr, s = sa.ns.qualify(e); return Qi(this, "attr." + e, t, s.local ? i : o) }, Vl.attrTween = function(e, t) { function n(e, n) { var r = t.call(this, e, n, this.getAttribute(o)); return r && function(e) { this.setAttribute(o, r(e)) } } function r(e, n) { var r = t.call(this, e, n, this.getAttributeNS(o.space, o.local)); return r && function(e) { this.setAttributeNS(o.space, o.local, r(e)) } } var o = sa.ns.qualify(e); return this.tween("attr." + e, o.local ? r : n) }, Vl.style = function(e, t, n) { function r() { this.style.removeProperty(e) } function o(t) { return null == t ? r : (t += "", function() { var r, o = a(this).getComputedStyle(this, null).getPropertyValue(e); return o !== t && (r = wr(o, t), function(t) { this.style.setProperty(e, r(t), n) }) }) } var i = arguments.length; if (i < 3) { if ("string" != typeof e) { i < 2 && (t = ""); for (n in e) this.style(n, e[n], t); return this } n = "" } return Qi(this, "style." + e, t, o) }, Vl.styleTween = function(e, t, n) { function r(r, o) { var i = t.call(this, r, o, a(this).getComputedStyle(this, null).getPropertyValue(e)); return i && function(t) { this.style.setProperty(e, i(t), n) } } return arguments.length < 3 && (n = ""), this.tween("style." + e, r) }, Vl.text = function(e) { return Qi(this, "text", e, Zi) }, Vl.remove = function() { var e = this.namespace; return this.each("end.transition", function() { var t; this[e].count < 2 && (t = this.parentNode) && t.removeChild(this) }) }, Vl.ease = function(e) { var t = this.id, n = this.namespace; return arguments.length < 1 ? this.node()[n][t].ease : ("function" != typeof e && (e = sa.ease.apply(sa, arguments)), q(this, function(r) { r[n][t].ease = e })) }, Vl.delay = function(e) { var t = this.id, n = this.namespace; return arguments.length < 1 ? this.node()[n][t].delay : q(this, "function" == typeof e ? function(r, o, i) { r[n][t].delay = +e.call(r, r.__data__, o, i) } : (e = +e, function(r) { r[n][t].delay = e })) }, Vl.duration = function(e) { var t = this.id, n = this.namespace; return arguments.length < 1 ? this.node()[n][t].duration : q(this, "function" == typeof e ? function(r, o, i) { r[n][t].duration = Math.max(1, e.call(r, r.__data__, o, i)) } : (e = Math.max(1, e), function(r) { r[n][t].duration = e })) }, Vl.each = function(e, t) { var n = this.id, r = this.namespace; if (arguments.length < 2) { var o = Fl, i = Gl; try { Gl = n, q(this, function(t, o, i) { Fl = t[r][n], e.call(t, t.__data__, o, i) }) } finally { Fl = o, Gl = i } } else q(this, function(o) { var i = o[r][n]; (i.event || (i.event = sa.dispatch("start", "end", "interrupt"))).on(e, t) }); return this }, Vl.transition = function() { for (var e, t, n, r, o = this.id, i = ++zl, a = this.namespace, s = [], l = 0, c = this.length; l < c; l++) { s.push(e = []); for (var t = this[l], u = 0, d = t.length; u < d; u++)(n = t[u]) && (r = n[a][o], Ji(n, u, a, i, { time: r.time, ease: r.ease, delay: r.delay + r.duration, duration: r.duration })), e.push(n) } return Ki(s, a, i) }, sa.svg.axis = function() { function e(e) { e.each(function() { var e, c = sa.select(this), u = this.__chart__ || n, d = this.__chart__ = n.copy(), f = null == l ? d.ticks ? d.ticks.apply(d, s) : d.domain() : l, m = null == t ? d.tickFormat ? d.tickFormat.apply(d, s) : w : t, p = c.selectAll(".tick").data(f, d), g = p.enter().insert("g", ".domain").attr("class", "tick").style("opacity", Na), v = sa.transition(p.exit()).style("opacity", Na).remove(), h = sa.transition(p.order()).style("opacity", 1), y = Math.max(o, 0) + a, E = Wo(d), b = c.selectAll(".domain").data([0]), S = (b.enter().append("path").attr("class", "domain"), sa.transition(b)); g.append("line"), g.append("text"); var _, A, T, I, C = g.select("line"), x = h.select("line"), M = p.select("text").text(m), D = g.select("text"), O = h.select("text"), R = "top" === r || "left" === r ? -1 : 1; if ("bottom" === r || "top" === r ? (e = ea, _ = "x", T = "y", A = "x2", I = "y2", M.attr("dy", R < 0 ? "0em" : ".71em").style("text-anchor", "middle"), S.attr("d", "M" + E[0] + "," + R * i + "V0H" + E[1] + "V" + R * i)) : (e = ta, _ = "y", T = "x", A = "y2", I = "x2", M.attr("dy", ".32em").style("text-anchor", R < 0 ? "end" : "start"), S.attr("d", "M" + R * i + "," + E[0] + "H0V" + E[1] + "H" + R * i)), C.attr(I, R * o), D.attr(T, R * y), x.attr(A, 0).attr(I, R * o), O.attr(_, 0).attr(T, R * y), d.rangeBand) { var N = d, L = N.rangeBand() / 2; u = d = function(e) { return N(e) + L } } else u.rangeBand ? u = d : v.call(e, d, u); g.call(e, u, d), h.call(e, d, d) }) } var t, n = sa.scale.linear(), r = Bl, o = 6, i = 6, a = 3, s = [10], l = null; return e.scale = function(t) { return arguments.length ? (n = t, e) : n }, e.orient = function(t) { return arguments.length ? (r = t in $l ? t + "" : Bl, e) : r }, e.ticks = function() { return arguments.length ? (s = arguments, e) : s }, e.tickValues = function(t) { return arguments.length ? (l = t, e) : l }, e.tickFormat = function(n) { return arguments.length ? (t = n, e) : t }, e.tickSize = function(t) { var n = arguments.length; return n ? (o = +t, i = +arguments[n - 1], e) : o }, e.innerTickSize = function(t) { return arguments.length ? (o = +t, e) : o }, e.outerTickSize = function(t) { return arguments.length ? (i = +t, e) : i }, e.tickPadding = function(t) { return arguments.length ? (a = +t, e) : a }, e.tickSubdivide = function() { return arguments.length && e }, e }; var Bl = "bottom", $l = { top: 1, right: 1, bottom: 1, left: 1 }; sa.svg.brush = function() { function e(i) { i.each(function() { var i = sa.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", o).on("touchstart.brush", o), a = i.selectAll(".background").data([0]); a.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"), i.selectAll(".extent").data([0]).enter().append("rect").attr("class", "extent").style("cursor", "move"); var s = i.selectAll(".resize").data(g, w); s.exit().remove(), s.enter().append("g").attr("class", function(e) { return "resize " + e }).style("cursor", function(e) { return Wl[e] }).append("rect").attr("x", function(e) { return /[ew]$/.test(e) ? -3 : null }).attr("y", function(e) { return /^[ns]/.test(e) ? -3 : null }).attr("width", 6).attr("height", 6).style("visibility", "hidden"), s.style("display", e.empty() ? "none" : null); var l, d = sa.transition(i), f = sa.transition(a); c && (l = Wo(c), f.attr("x", l[0]).attr("width", l[1] - l[0]), n(d)), u && (l = Wo(u), f.attr("y", l[0]).attr("height", l[1] - l[0]), r(d)), t(d) }) } function t(e) { e.selectAll(".resize").attr("transform", function(e) { return "translate(" + d[+/e$/.test(e)] + "," + f[+/^s/.test(e)] + ")" }) } function n(e) { e.select(".extent").attr("x", d[0]), e.selectAll(".extent,.n>rect,.s>rect").attr("width", d[1] - d[0]) } function r(e) { e.select(".extent").attr("y", f[0]), e.selectAll(".extent,.e>rect,.w>rect").attr("height", f[1] - f[0]) } function o() { function o() { 32 == sa.event.keyCode && (x || (E = null, O[0] -= d[1], O[1] -= f[1], x = 2), M()) } function g() { 32 == sa.event.keyCode && 2 == x && (O[0] += d[1], O[1] += f[1], x = 0, M()) } function v() { var e = sa.mouse(S), o = !1; b && (e[0] += b[0], e[1] += b[1]), x || (sa.event.altKey ? (E || (E = [(d[0] + d[1]) / 2, (f[0] + f[1]) / 2]), O[0] = d[+(e[0] < E[0])], O[1] = f[+(e[1] < E[1])]) : E = null), I && h(e, c, 0) && (n(A), o = !0), C && h(e, u, 1) && (r(A), o = !0), o && (t(A), w({ type: "brush", mode: x ? "move" : "resize" })) } function h(e, t, n) { var r, o, a = Wo(t), l = a[0], c = a[1], u = O[n], g = n ? f : d, v = g[1] - g[0]; if (x && (l -= u, c -= v + u), r = (n ? p : m) ? Math.max(l, Math.min(c, e[n])) : e[n], x ? o = (r += u) + v : (E && (u = Math.max(l, Math.min(c, 2 * E[n] - r))), u < r ? (o = r, r = u) : o = u), g[0] != r || g[1] != o) return n ? s = null : i = null, g[0] = r, g[1] = o, !0 } function y() { v(), A.style("pointer-events", "all").selectAll(".resize").style("display", e.empty() ? "none" : null), sa.select("body").style("cursor", null), R.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null), D(), w({ type: "brushend" }) } var E, b, S = this, _ = sa.select(sa.event.target), w = l.of(S, arguments), A = sa.select(S), T = _.datum(), I = !/^(n|s)$/.test(T) && c, C = !/^(e|w)$/.test(T) && u, x = _.classed("extent"), D = ee(S), O = sa.mouse(S), R = sa.select(a(S)).on("keydown.brush", o).on("keyup.brush", g); if (sa.event.changedTouches ? R.on("touchmove.brush", v).on("touchend.brush", y) : R.on("mousemove.brush", v).on("mouseup.brush", y), A.interrupt().selectAll("*").interrupt(), x) O[0] = d[0] - O[0], O[1] = f[0] - O[1]; else if (T) { var N = +/w$/.test(T), L = +/^n/.test(T); b = [d[1 - N] - O[0], f[1 - L] - O[1]], O[0] = d[N], O[1] = f[L] } else sa.event.altKey && (E = O.slice()); A.style("pointer-events", "none").selectAll(".resize").style("display", null), sa.select("body").style("cursor", _.style("cursor")), w({ type: "brushstart" }), v() } var i, s, l = O(e, "brushstart", "brush", "brushend"), c = null, u = null, d = [0, 0], f = [0, 0], m = !0, p = !0, g = Hl[0]; return e.event = function(e) { e.each(function() { var e = l.of(this, arguments), t = { x: d, y: f, i: i, j: s }, n = this.__chart__ || t; this.__chart__ = t, Gl ? sa.select(this).transition().each("start.brush", function() { i = n.i, s = n.j, d = n.x, f = n.y, e({ type: "brushstart" }) }).tween("brush:brush", function() { var n = Ar(d, t.x), r = Ar(f, t.y); return i = s = null, function(o) { d = t.x = n(o), f = t.y = r(o), e({ type: "brush", mode: "resize" }) } }).each("end.brush", function() { i = t.i, s = t.j, e({ type: "brush", mode: "resize" }), e({ type: "brushend" }) }) : (e({ type: "brushstart" }), e({ type: "brush", mode: "resize" }), e({ type: "brushend" })) }) }, e.x = function(t) { return arguments.length ? (c = t, g = Hl[!c << 1 | !u], e) : c }, e.y = function(t) { return arguments.length ? (u = t, g = Hl[!c << 1 | !u], e) : u }, e.clamp = function(t) { return arguments.length ? (c && u ? (m = !!t[0], p = !!t[1]) : c ? m = !!t : u && (p = !!t), e) : c && u ? [m, p] : c ? m : u ? p : null }, e.extent = function(t) { var n, r, o, a, l; return arguments.length ? (c && (n = t[0], r = t[1], u && (n = n[0], r = r[0]), i = [n, r], c.invert && (n = c(n), r = c(r)), r < n && (l = n, n = r, r = l), n == d[0] && r == d[1] || (d = [n, r])), u && (o = t[0], a = t[1], c && (o = o[1], a = a[1]), s = [o, a], u.invert && (o = u(o), a = u(a)), a < o && (l = o, o = a, a = l), o == f[0] && a == f[1] || (f = [o, a])), e) : (c && (i ? (n = i[0], r = i[1]) : (n = d[0], r = d[1], c.invert && (n = c.invert(n), r = c.invert(r)), r < n && (l = n, n = r, r = l))), u && (s ? (o = s[0], a = s[1]) : (o = f[0], a = f[1], u.invert && (o = u.invert(o), a = u.invert(a)), a < o && (l = o, o = a, a = l))), c && u ? [ [n, o], [r, a] ] : c ? [n, r] : u && [o, a]) }, e.clear = function() { return e.empty() || (d = [0, 0], f = [0, 0], i = s = null), e }, e.empty = function() { return !!c && d[0] == d[1] || !!u && f[0] == f[1] }, sa.rebind(e, l, "on") }; var Wl = { n: "ns-resize", e: "ew-resize", s: "ns-resize", w: "ew-resize", nw: "nwse-resize", ne: "nesw-resize", se: "nwse-resize", sw: "nesw-resize" }, Hl = [ ["n", "e", "s", "w", "nw", "ne", "se", "sw"], ["e", "w"], ["n", "s"], [] ], jl = ds.format = hs.timeFormat, Yl = jl.utc, ql = Yl("%Y-%m-%dT%H:%M:%S.%LZ"); jl.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? na : ql, na.parse = function(e) { var t = new Date(e); return isNaN(t) ? null : t }, na.toString = ql.toString, ds.second = We(function(e) { return new fs(1e3 * Math.floor(e / 1e3)) }, function(e, t) { e.setTime(e.getTime() + 1e3 * Math.floor(t)) }, function(e) { return e.getSeconds() }), ds.seconds = ds.second.range, ds.seconds.utc = ds.second.utc.range, ds.minute = We(function(e) { return new fs(6e4 * Math.floor(e / 6e4)) }, function(e, t) { e.setTime(e.getTime() + 6e4 * Math.floor(t)) }, function(e) { return e.getMinutes() }), ds.minutes = ds.minute.range, ds.minutes.utc = ds.minute.utc.range, ds.hour = We(function(e) { var t = e.getTimezoneOffset() / 60; return new fs(36e5 * (Math.floor(e / 36e5 - t) + t)) }, function(e, t) { e.setTime(e.getTime() + 36e5 * Math.floor(t)) }, function(e) { return e.getHours() }), ds.hours = ds.hour.range, ds.hours.utc = ds.hour.utc.range, ds.month = We(function(e) { return e = ds.day(e), e.setDate(1), e }, function(e, t) { e.setMonth(e.getMonth() + t) }, function(e) { return e.getMonth() }), ds.months = ds.month.range, ds.months.utc = ds.month.utc.range; var Kl = [1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6], Ql = [ [ds.second, 1], [ds.second, 5], [ds.second, 15], [ds.second, 30], [ds.minute, 1], [ds.minute, 5], [ds.minute, 15], [ds.minute, 30], [ds.hour, 1], [ds.hour, 3], [ds.hour, 6], [ds.hour, 12], [ds.day, 1], [ds.day, 2], [ds.week, 1], [ds.month, 1], [ds.month, 3], [ds.year, 1] ], Zl = jl.multi([ [".%L", function(e) { return e.getMilliseconds() }], [":%S", function(e) { return e.getSeconds() }], ["%I:%M", function(e) { return e.getMinutes() }], ["%I %p", function(e) { return e.getHours() }], ["%a %d", function(e) { return e.getDay() && 1 != e.getDate() }], ["%b %d", function(e) { return 1 != e.getDate() }], ["%B", function(e) { return e.getMonth() }], ["%Y", Nt] ]), Xl = { range: function(e, t, n) { return sa.range(Math.ceil(e / n) * n, +t, n).map(oa) }, floor: w, ceil: w }; Ql.year = ds.year, ds.scale = function() { return ra(sa.scale.linear(), Ql, Zl) }; var Jl = Ql.map(function(e) { return [e[0].utc, e[1]] }), ec = Yl.multi([ [".%L", function(e) { return e.getUTCMilliseconds() }], [":%S", function(e) { return e.getUTCSeconds() }], ["%I:%M", function(e) { return e.getUTCMinutes() }], ["%I %p", function(e) { return e.getUTCHours() }], ["%a %d", function(e) { return e.getUTCDay() && 1 != e.getUTCDate() }], ["%b %d", function(e) { return 1 != e.getUTCDate() }], ["%B", function(e) { return e.getUTCMonth() }], ["%Y", Nt] ]); Jl.year = ds.year.utc, ds.scale.utc = function() { return ra(sa.scale.linear(), Jl, ec) }, sa.text = Re(function(e) { return e.responseText }), sa.json = function(e, t) { return Ne(e, "application/json", ia, t) }, sa.html = function(e, t) { return Ne(e, "text/html", aa, t) }, sa.xml = Re(function(e) { return e.responseXML }), r = sa, o = "function" == typeof r ? r.call(t, n, t, e) : r, !(void 0 !== o && (e.exports = o)), this.d3 = sa }() }, function(e, t, n) { ! function() { var t = {}; t.dev = !1, t.tooltip = t.tooltip || {}, t.utils = t.utils || {}, t.models = t.models || {}, t.charts = {}, t.logs = {}, t.dom = {}, t.dispatch = d3.dispatch("render_start", "render_end"), Function.prototype.bind || (Function.prototype.bind = function(e) { if ("function" != typeof this) throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); var t = Array.prototype.slice.call(arguments, 1), n = this, r = function() {}, o = function() { return n.apply(this instanceof r && e ? this : e, t.concat(Array.prototype.slice.call(arguments))) }; return r.prototype = this.prototype, o.prototype = new r, o }), t.dev && (t.dispatch.on("render_start", function(e) { t.logs.startTime = +new Date }), t.dispatch.on("render_end", function(e) { t.logs.endTime = +new Date, t.logs.totalTime = t.logs.endTime - t.logs.startTime, t.log("total", t.logs.totalTime) })), t.log = function() { if (t.dev && window.console && console.log && console.log.apply) console.log.apply(console, arguments); else if (t.dev && window.console && "function" == typeof console.log && Function.prototype.bind) { var e = Function.prototype.bind.call(console.log, console); e.apply(console, arguments) } return arguments[arguments.length - 1] }, t.deprecated = function(e, t) { console && console.warn && console.warn("nvd3 warning: `" + e + "` has been deprecated. ", t || "") }, t.render = function(e) { e = e || 1, t.render.active = !0, t.dispatch.render_start(); var n = function() { for (var r, o, i = 0; i < e && (o = t.render.queue[i]); i++) r = o.generate(), typeof o.callback == typeof Function && o.callback(r); t.render.queue.splice(0, i), t.render.queue.length ? setTimeout(n) : (t.dispatch.render_end(), t.render.active = !1) }; setTimeout(n) }, t.render.active = !1, t.render.queue = [], t.addGraph = function(e) { typeof arguments[0] == typeof Function && (e = { generate: arguments[0], callback: arguments[1] }), t.render.queue.push(e), t.render.active || t.render() }, e.exports = t, "undefined" != typeof window && (window.nv = t), t.dom.write = function(e) { return void 0 !== window.fastdom ? fastdom.write(e) : e() }, t.dom.read = function(e) { return void 0 !== window.fastdom ? fastdom.read(e) : e() }, t.interactiveGuideline = function() { "use strict"; function e(d) { d.each(function(d) { function f() { var t = d3.mouse(this), r = t[0], o = t[1], l = !0, c = !1; if (u && (r = d3.event.offsetX, o = d3.event.offsetY, "svg" !== d3.event.target.tagName && (l = !1), d3.event.target.className.baseVal.match("nv-legend") && (c = !0)), l && (r -= i.left, o -= i.top), r < 0 || o < 0 || r > p || o > g || d3.event.relatedTarget && void 0 === d3.event.relatedTarget.ownerSVGElement || c) { if (u && d3.event.relatedTarget && void 0 === d3.event.relatedTarget.ownerSVGElement && (void 0 === d3.event.relatedTarget.className || d3.event.relatedTarget.className.match(n.nvPointerEventsClass))) return; return s.elementMouseout({ mouseX: r, mouseY: o }), e.renderGuideLine(null), void n.hidden(!0) } n.hidden(!1); var d = a.invert(r); s.elementMousemove({ mouseX: r, mouseY: o, pointXValue: d }), "dblclick" === d3.event.type && s.elementDblclick({ mouseX: r, mouseY: o, pointXValue: d }), "click" === d3.event.type && s.elementClick({ mouseX: r, mouseY: o, pointXValue: d }) } var m = d3.select(this), p = r || 960, g = o || 400, v = m.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([d]), h = v.enter().append("g").attr("class", " nv-wrap nv-interactiveLineLayer"); h.append("g").attr("class", "nv-interactiveGuideLine"), c && (c.on("touchmove", f).on("mousemove", f, !0).on("mouseout", f, !0).on("dblclick", f).on("click", f), e.guideLine = null, e.renderGuideLine = function(n) { l && (e.guideLine && e.guideLine.attr("x1") === n || t.dom.write(function() { var e = v.select(".nv-interactiveGuideLine").selectAll("line").data(null != n ? [t.utils.NaNtoZero(n)] : [], String); e.enter().append("line").attr("class", "nv-guideline").attr("x1", function(e) { return e }).attr("x2", function(e) { return e }).attr("y1", g).attr("y2", 0), e.exit().remove() })) }) }) } var n = t.models.tooltip(); n.duration(0).hideDelay(0)._isInteractiveLayer(!0).hidden(!1); var r = null, o = null, i = { left: 0, top: 0 }, a = d3.scale.linear(), s = d3.dispatch("elementMousemove", "elementMouseout", "elementClick", "elementDblclick"), l = !0, c = null, u = "ActiveXObject" in window; return e.dispatch = s, e.tooltip = n, e.margin = function(t) { return arguments.length ? (i.top = "undefined" != typeof t.top ? t.top : i.top, i.left = "undefined" != typeof t.left ? t.left : i.left, e) : i }, e.width = function(t) { return arguments.length ? (r = t, e) : r }, e.height = function(t) { return arguments.length ? (o = t, e) : o }, e.xScale = function(t) { return arguments.length ? (a = t, e) : a }, e.showGuideLine = function(t) { return arguments.length ? (l = t, e) : l }, e.svgContainer = function(t) { return arguments.length ? (c = t, e) : c }, e }, t.interactiveBisect = function(e, t, n) { "use strict"; if (!(e instanceof Array)) return null; var r; r = "function" != typeof n ? function(e) { return e.x } : n; var o = function(e, t) { return r(e) - t }, i = d3.bisector(o).left, a = d3.max([0, i(e, t) - 1]), s = r(e[a]); if ("undefined" == typeof s && (s = a), s === t) return a; var l = d3.min([a + 1, e.length - 1]), c = r(e[l]); return "undefined" == typeof c && (c = l), Math.abs(c - t) >= Math.abs(s - t) ? a : l }, t.nearestValueIndex = function(e, t, n) { "use strict"; var r = 1 / 0, o = null; return e.forEach(function(e, i) { var a = Math.abs(t - e); null != e && a <= r && a < n && (r = a, o = i) }), o }, function() { "use strict"; t.models.tooltip = function() { function e() { if (u) { var e = d3.select(u); "svg" !== e.node().tagName && (e = e.select("svg")); var t = e.node() ? e.attr("viewBox") : null; if (t) { t = t.split(" "); var n = parseInt(e.style("width"), 10) / t[2]; g.left = g.left * n, g.top = g.top * n } } } function n() { if (!m) { var e; e = u ? u : document.body, m = d3.select(e).append("div").attr("class", "nvtooltip " + (c ? c : "xy-tooltip")).attr("id", S), m.style("top", 0).style("left", 0), m.style("opacity", 0), m.selectAll("div, table, td, tr").classed(_, !0), m.classed(_, !0), p = m.node() } } function r() { if (h && C(o)) { e(); var i = g.left, a = null !== l ? l : g.top; return t.dom.write(function() { n(); var e = I(o); e && (p.innerHTML = e), u && b ? t.dom.read(function() { var e = u.getElementsByTagName("svg")[0], t = { left: 0, top: 0 }; if (e) { var n = e.getBoundingClientRect(), r = u.getBoundingClientRect(), o = n.top; if (o < 0) { var l = u.getBoundingClientRect(); o = Math.abs(o) > l.height ? 0 : o } t.top = Math.abs(o - r.top), t.left = Math.abs(n.left - r.left) } i += u.offsetLeft + t.left - 2 * u.scrollLeft, a += u.offsetTop + t.top - 2 * u.scrollTop, s && s > 0 && (a = Math.floor(a / s) * s), x([i, a]) }) : x([i, a]) }), r } } var o = null, i = "w", a = 25, s = 0, l = null, c = null, u = null, d = !0, f = 400, m = null, p = null, g = { left: null, top: null }, v = { left: 0, top: 0 }, h = !0, y = 100, E = !0, b = !1, S = "nvtooltip-" + Math.floor(1e5 * Math.random()), _ = "nv-pointer-events-none", w = function(e, t) { return e }, A = function(e) { return e }, T = function(e, t) { return e }, I = function(e) { if (null === e) return ""; var t = d3.select(document.createElement("table")); if (E) { var n = t.selectAll("thead").data([e]).enter().append("thead"); n.append("tr").append("td").attr("colspan", 3).append("strong").classed("x-value", !0).html(A(e.value)) } var r = t.selectAll("tbody").data([e]).enter().append("tbody"), o = r.selectAll("tr").data(function(e) { return e.series }).enter().append("tr").classed("highlight", function(e) { return e.highlight }); o.append("td").classed("legend-color-guide", !0).append("div").style("background-color", function(e) { return e.color }), o.append("td").classed("key", !0).html(function(e, t) { return T(e.key, t) }), o.append("td").classed("value", !0).html(function(e, t) { return w(e.value, t) }), o.selectAll("td").each(function(e) { if (e.highlight) { var t = d3.scale.linear().domain([0, 1]).range(["#fff", e.color]), n = .6; d3.select(this).style("border-bottom-color", t(n)).style("border-top-color", t(n)) } }); var i = t.node().outerHTML; return void 0 !== e.footer && (i += ""), i }, C = function(e) { if (e && e.series) { if (e.series instanceof Array) return !!e.series.length; if (e.series instanceof Object) return e.series = [e.series], !0 } return !1 }, x = function(e) { p && t.dom.read(function() { var n, r, o = parseInt(p.offsetHeight, 10), s = parseInt(p.offsetWidth, 10), l = t.utils.windowSize().width, c = t.utils.windowSize().height, u = window.pageYOffset, g = window.pageXOffset; c = window.innerWidth >= document.body.scrollWidth ? c : c - 16, l = window.innerHeight >= document.body.scrollHeight ? l : l - 16; var h, E, b = function(e) { var t = r; do isNaN(e.offsetTop) || (t += e.offsetTop), e = e.offsetParent; while (e); return t }, S = function(e) { var t = n; do isNaN(e.offsetLeft) || (t += e.offsetLeft), e = e.offsetParent; while (e); return t }; switch (i) { case "e": n = e[0] - s - a, r = e[1] - o / 2, h = S(p), E = b(p), h < g && (n = e[0] + a > g ? e[0] + a : g - h + n), E < u && (r = u - E + r), E + o > u + c && (r = u + c - E + r - o); break; case "w": n = e[0] + a, r = e[1] - o / 2, h = S(p), E = b(p), h + s > l && (n = e[0] - s - a), E < u && (r = u + 5), E + o > u + c && (r = u + c - E + r - o); break; case "n": n = e[0] - s / 2 - 5, r = e[1] + a, h = S(p), E = b(p), h < g && (n = g + 5), h + s > l && (n = n - s / 2 + 5), E + o > u + c && (r = u + c - E + r - o); break; case "s": n = e[0] - s / 2, r = e[1] - o - a, h = S(p), E = b(p), h < g && (n = g + 5), h + s > l && (n = n - s / 2 + 5), u > E && (r = u); break; case "none": n = e[0], r = e[1] - a, h = S(p), E = b(p) } n -= v.left, r -= v.top; var _ = p.getBoundingClientRect(), u = window.pageYOffset || document.documentElement.scrollTop, g = window.pageXOffset || document.documentElement.scrollLeft, w = "translate(" + (_.left + g) + "px, " + (_.top + u) + "px)", A = "translate(" + n + "px, " + r + "px)", T = d3.interpolateString(w, A), I = m.style("opacity") < .1; d ? m.transition().delay(f).duration(0).style("opacity", 0) : m.interrupt().transition().duration(I ? 0 : y).styleTween("transform", function(e) { return T }, "important").style("-webkit-transform", A).style("opacity", 1) }) }; return r.nvPointerEventsClass = _, r.options = t.utils.optionsFunc.bind(r), r._options = Object.create({}, { duration: { get: function() { return y }, set: function(e) { y = e } }, gravity: { get: function() { return i }, set: function(e) { i = e } }, distance: { get: function() { return a }, set: function(e) { a = e } }, snapDistance: { get: function() { return s }, set: function(e) { s = e } }, classes: { get: function() { return c }, set: function(e) { c = e } }, chartContainer: { get: function() { return u }, set: function(e) { u = e } }, fixedTop: { get: function() { return l }, set: function(e) { l = e } }, enabled: { get: function() { return h }, set: function(e) { h = e } }, hideDelay: { get: function() { return f }, set: function(e) { f = e } }, contentGenerator: { get: function() { return I }, set: function(e) { I = e } }, valueFormatter: { get: function() { return w }, set: function(e) { w = e } }, headerFormatter: { get: function() { return A }, set: function(e) { A = e } }, keyFormatter: { get: function() { return T }, set: function(e) { T = e } }, headerEnabled: { get: function() { return E }, set: function(e) { E = e } }, _isInteractiveLayer: { get: function() { return b }, set: function(e) { b = !!e } }, position: { get: function() { return g }, set: function(e) { g.left = void 0 !== e.left ? e.left : g.left, g.top = void 0 !== e.top ? e.top : g.top } }, offset: { get: function() { return v }, set: function(e) { v.left = void 0 !== e.left ? e.left : v.left, v.top = void 0 !== e.top ? e.top : v.top } }, hidden: { get: function() { return d }, set: function(e) { d != e && (d = !!e, r()) } }, data: { get: function() { return o }, set: function(e) { e.point && (e.value = e.point.x, e.series = e.series || {}, e.series.value = e.point.y, e.series.color = e.point.color || e.series.color), o = e } }, tooltipElem: { get: function() { return p }, set: function(e) {} }, id: { get: function() { return S }, set: function(e) {} } }), t.utils.initOptions(r), r } }(), t.utils.windowSize = function() { var e = { width: 640, height: 480 }; return window.innerWidth && window.innerHeight ? (e.width = window.innerWidth, e.height = window.innerHeight, e) : "CSS1Compat" == document.compatMode && document.documentElement && document.documentElement.offsetWidth ? (e.width = document.documentElement.offsetWidth, e.height = document.documentElement.offsetHeight, e) : document.body && document.body.offsetWidth ? (e.width = document.body.offsetWidth, e.height = document.body.offsetHeight, e) : e }, t.utils.windowResize = function(e) { return window.addEventListener ? window.addEventListener("resize", e) : t.log("ERROR: Failed to bind to window.resize with: ", e), { callback: e, clear: function() { window.removeEventListener("resize", e) } } }, t.utils.getColor = function(e) { if (void 0 === e) return t.utils.defaultColor(); if (Array.isArray(e)) { var n = d3.scale.ordinal().range(e); return function(e, t) { var r = void 0 === t ? e : t; return e.color || n(r) } } return e }, t.utils.defaultColor = function() { return t.utils.getColor(d3.scale.category20().range()) }, t.utils.customTheme = function(e, t, n) { t = t || function(e) { return e.key }, n = n || d3.scale.category20().range(); var r = n.length; return function(o, i) { var a = t(o); return "function" == typeof e[a] ? e[a]() : void 0 !== e[a] ? e[a] : (r || (r = n.length), r -= 1, n[r]) } }, t.utils.pjax = function(e, n) { var r = function(r) { d3.html(r, function(r) { var o = d3.select(n).node(); o.parentNode.replaceChild(d3.select(r).select(n).node(), o), t.utils.pjax(e, n) }) }; d3.selectAll(e).on("click", function() { history.pushState(this.href, this.textContent, this.href), r(this.href), d3.event.preventDefault() }), d3.select(window).on("popstate", function() { d3.event.state && r(d3.event.state) }) }, t.utils.calcApproxTextWidth = function(e) { if ("function" == typeof e.style && "function" == typeof e.text) { var t = parseInt(e.style("font-size").replace("px", ""), 10), n = e.text().length; return n * t * .5 } return 0 }, t.utils.NaNtoZero = function(e) { return "number" != typeof e || isNaN(e) || null === e || e === 1 / 0 || e === -(1 / 0) ? 0 : e }, d3.selection.prototype.watchTransition = function(e) { var t = [this].concat([].slice.call(arguments, 1)); return e.transition.apply(e, t) }, t.utils.renderWatch = function(e, n) { if (!(this instanceof t.utils.renderWatch)) return new t.utils.renderWatch(e, n); var r = void 0 !== n ? n : 250, o = [], i = this; this.models = function(e) { return e = [].slice.call(arguments, 0), e.forEach(function(e) { e.__rendered = !1, function(e) { e.dispatch.on("renderEnd", function(t) { e.__rendered = !0, i.renderEnd("model") }) }(e), o.indexOf(e) < 0 && o.push(e) }), this }, this.reset = function(e) { void 0 !== e && (r = e), o = [] }, this.transition = function(e, t, n) { if (t = arguments.length > 1 ? [].slice.call(arguments, 1) : [], n = t.length > 1 ? t.pop() : void 0 !== r ? r : 250, e.__rendered = !1, o.indexOf(e) < 0 && o.push(e), 0 === n) return e.__rendered = !0, e.delay = function() { return this }, e.duration = function() { return this }, e; 0 === e.length ? e.__rendered = !0 : e.every(function(e) { return !e.length }) ? e.__rendered = !0 : e.__rendered = !1; var a = 0; return e.transition().duration(n).each(function() { ++a }).each("end", function(n, r) { 0 === --a && (e.__rendered = !0, i.renderEnd.apply(this, t)) }) }, this.renderEnd = function() { o.every(function(e) { return e.__rendered }) && (o.forEach(function(e) { e.__rendered = !1 }), e.renderEnd.apply(this, arguments)) } }, t.utils.deepExtend = function(e) { var n = arguments.length > 1 ? [].slice.call(arguments, 1) : []; n.forEach(function(n) { for (var r in n) { var o = e[r] instanceof Array, i = "object" == typeof e[r], a = "object" == typeof n[r]; i && !o && a ? t.utils.deepExtend(e[r], n[r]) : e[r] = n[r] } }) }, t.utils.state = function() { if (!(this instanceof t.utils.state)) return new t.utils.state; var e = {}, n = function() {}, r = function() { return {} }, o = null, i = null; this.dispatch = d3.dispatch("change", "set"), this.dispatch.on("set", function(e) { n(e, !0) }), this.getter = function(e) { return r = e, this }, this.setter = function(e, t) { return t || (t = function() {}), n = function(n, r) { e(n), r && t() }, this }, this.init = function(e) { o = o || {}, t.utils.deepExtend(o, e) }; var a = function() { var t = r(); if (JSON.stringify(t) === JSON.stringify(e)) return !1; for (var n in t) void 0 === e[n] && (e[n] = {}), e[n] = t[n], i = !0; return !0 }; this.update = function() { o && (n(o, !1), o = null), a.call(this) && this.dispatch.change(e) } }, t.utils.optionsFunc = function(e) { return e && d3.map(e).forEach(function(e, t) { "function" == typeof this[e] && this[e](t) }.bind(this)), this }, t.utils.calcTicksX = function(e, n) { var r = 1, o = 0; for (o; o < n.length; o += 1) { var i = n[o] && n[o].values ? n[o].values.length : 0; r = i > r ? i : r } return t.log("Requested number of ticks: ", e), t.log("Calculated max values to be: ", r), e = e > r ? e = r - 1 : e, e = e < 1 ? 1 : e, e = Math.floor(e), t.log("Calculating tick count as: ", e), e }, t.utils.calcTicksY = function(e, n) { return t.utils.calcTicksX(e, n) }, t.utils.initOption = function(e, t) { e._calls && e._calls[t] ? e[t] = e._calls[t] : (e[t] = function(n) { return arguments.length ? (e._overrides[t] = !0, e._options[t] = n, e) : e._options[t] }, e["_" + t] = function(n) { return arguments.length ? (e._overrides[t] || (e._options[t] = n), e) : e._options[t] }) }, t.utils.initOptions = function(e) { e._overrides = e._overrides || {}; var n = Object.getOwnPropertyNames(e._options || {}), r = Object.getOwnPropertyNames(e._calls || {}); n = n.concat(r); for (var o in n) t.utils.initOption(e, n[o]) }, t.utils.inheritOptionsD3 = function(e, t, n) { e._d3options = n.concat(e._d3options || []), n.unshift(t), n.unshift(e), d3.rebind.apply(this, n) }, t.utils.arrayUnique = function(e) { return e.sort().filter(function(t, n) { return !n || t != e[n - 1] }) }, t.utils.symbolMap = d3.map(), t.utils.symbol = function() { function e(e, o) { var i = n.call(this, e, o), a = r.call(this, e, o); return d3.svg.symbolTypes.indexOf(i) !== -1 ? d3.svg.symbol().type(i).size(a)() : t.utils.symbolMap.get(i)(a) } var n, r = 64; return e.type = function(t) { return arguments.length ? (n = d3.functor(t), e) : n }, e.size = function(t) { return arguments.length ? (r = d3.functor(t), e) : r }, e }, t.utils.inheritOptions = function(e, n) { var r = Object.getOwnPropertyNames(n._options || {}), o = Object.getOwnPropertyNames(n._calls || {}), i = n._inherited || [], a = n._d3options || [], s = r.concat(o).concat(i).concat(a); s.unshift(n), s.unshift(e), d3.rebind.apply(this, s), e._inherited = t.utils.arrayUnique(r.concat(o).concat(i).concat(r).concat(e._inherited || [])), e._d3options = t.utils.arrayUnique(a.concat(e._d3options || [])) }, t.utils.initSVG = function(e) { e.classed({ "nvd3-svg": !0 }) }, t.utils.sanitizeHeight = function(e, t) { return e || parseInt(t.style("height"), 10) || 400 }, t.utils.sanitizeWidth = function(e, t) { return e || parseInt(t.style("width"), 10) || 960 }, t.utils.availableHeight = function(e, n, r) { return t.utils.sanitizeHeight(e, n) - r.top - r.bottom }, t.utils.availableWidth = function(e, n, r) { return t.utils.sanitizeWidth(e, n) - r.left - r.right }, t.utils.noData = function(e, n) { var r = e.options(), o = r.margin(), i = r.noData(), a = null == i ? ["No Data Available."] : [i], s = t.utils.availableHeight(r.height(), n, o), l = t.utils.availableWidth(r.width(), n, o), c = o.left + l / 2, u = o.top + s / 2; n.selectAll("g").remove(); var d = n.selectAll(".nv-noData").data(a); d.enter().append("text").attr("class", "nvd3 nv-noData").attr("dy", "-.7em").style("text-anchor", "middle"), d.attr("x", c).attr("y", u).text(function(e) { return e }) }, t.models.axis = function() { "use strict"; function e(a) { return y.reset(), a.each(function(e) { var a = d3.select(this); t.utils.initSVG(a); var g = a.selectAll("g.nv-wrap.nv-axis").data([e]), v = g.enter().append("g").attr("class", "nvd3 nv-wrap nv-axis"), E = (v.append("g"), g.select("g")); null !== m ? n.ticks(m) : "top" != n.orient() && "bottom" != n.orient() || n.ticks(Math.abs(r.range()[1] - r.range()[0]) / 100), E.watchTransition(y, "axis").call(n), h = h || n.scale(); var b = n.tickFormat(); null == b && (b = h.tickFormat()); var S = E.selectAll("text.nv-axislabel").data([s || null]); S.exit().remove(); var _, w, A; switch (n.orient()) { case "top": S.enter().append("text").attr("class", "nv-axislabel"), A = r.range().length < 2 ? 0 : 2 === r.range().length ? r.range()[1] : r.range()[r.range().length - 1] + (r.range()[1] - r.range()[0]), S.attr("text-anchor", "middle").attr("y", 0).attr("x", A / 2), l && (w = g.selectAll("g.nv-axisMaxMin").data(r.domain()), w.enter().append("g").attr("class", function(e, t) { return ["nv-axisMaxMin", "nv-axisMaxMin-x", 0 == t ? "nv-axisMin-x" : "nv-axisMax-x"].join(" ") }).append("text"), w.exit().remove(), w.attr("transform", function(e, n) { return "translate(" + t.utils.NaNtoZero(r(e)) + ",0)" }).select("text").attr("dy", "-0.5em").attr("y", -n.tickPadding()).attr("text-anchor", "middle").text(function(e, t) { var n = b(e); return ("" + n).match("NaN") ? "" : n }), w.watchTransition(y, "min-max top").attr("transform", function(e, n) { return "translate(" + t.utils.NaNtoZero(r.range()[n]) + ",0)" })); break; case "bottom": _ = p + 36; var T = 30, I = 0, C = E.selectAll("g").select("text"), x = ""; if (c % 360) { C.each(function(e, t) { var n = this.getBoundingClientRect(), r = n.width; I = n.height, r > T && (T = r) }), x = "rotate(" + c + " 0," + (I / 2 + n.tickPadding()) + ")"; var M = Math.abs(Math.sin(c * Math.PI / 180)); _ = (M ? M * T : T) + 30, C.attr("transform", x).style("text-anchor", c % 360 > 0 ? "start" : "end") } S.enter().append("text").attr("class", "nv-axislabel"), A = r.range().length < 2 ? 0 : 2 === r.range().length ? r.range()[1] : r.range()[r.range().length - 1] + (r.range()[1] - r.range()[0]), S.attr("text-anchor", "middle").attr("y", _).attr("x", A / 2), l && (w = g.selectAll("g.nv-axisMaxMin").data([r.domain()[0], r.domain()[r.domain().length - 1]]), w.enter().append("g").attr("class", function(e, t) { return ["nv-axisMaxMin", "nv-axisMaxMin-x", 0 == t ? "nv-axisMin-x" : "nv-axisMax-x"].join(" ") }).append("text"), w.exit().remove(), w.attr("transform", function(e, n) { return "translate(" + t.utils.NaNtoZero(r(e) + (f ? r.rangeBand() / 2 : 0)) + ",0)" }).select("text").attr("dy", ".71em").attr("y", n.tickPadding()).attr("transform", x).style("text-anchor", c ? c % 360 > 0 ? "start" : "end" : "middle").text(function(e, t) { var n = b(e); return ("" + n).match("NaN") ? "" : n }), w.watchTransition(y, "min-max bottom").attr("transform", function(e, n) { return "translate(" + t.utils.NaNtoZero(r(e) + (f ? r.rangeBand() / 2 : 0)) + ",0)" })), d && C.attr("transform", function(e, t) { return "translate(0," + (t % 2 == 0 ? "0" : "12") + ")" }); break; case "right": S.enter().append("text").attr("class", "nv-axislabel"), S.style("text-anchor", u ? "middle" : "begin").attr("transform", u ? "rotate(90)" : "").attr("y", u ? -Math.max(o.right, i) + 12 : -10).attr("x", u ? d3.max(r.range()) / 2 : n.tickPadding()), l && (w = g.selectAll("g.nv-axisMaxMin").data(r.domain()), w.enter().append("g").attr("class", function(e, t) { return ["nv-axisMaxMin", "nv-axisMaxMin-y", 0 == t ? "nv-axisMin-y" : "nv-axisMax-y"].join(" ") }).append("text").style("opacity", 0), w.exit().remove(), w.attr("transform", function(e, n) { return "translate(0," + t.utils.NaNtoZero(r(e)) + ")" }).select("text").attr("dy", ".32em").attr("y", 0).attr("x", n.tickPadding()).style("text-anchor", "start").text(function(e, t) { var n = b(e); return ("" + n).match("NaN") ? "" : n }), w.watchTransition(y, "min-max right").attr("transform", function(e, n) { return "translate(0," + t.utils.NaNtoZero(r.range()[n]) + ")" }).select("text").style("opacity", 1)); break; case "left": S.enter().append("text").attr("class", "nv-axislabel"), S.style("text-anchor", u ? "middle" : "end").attr("transform", u ? "rotate(-90)" : "").attr("y", u ? -Math.max(o.left, i) + 25 - (p || 0) : -10).attr("x", u ? -d3.max(r.range()) / 2 : -n.tickPadding()), l && (w = g.selectAll("g.nv-axisMaxMin").data(r.domain()), w.enter().append("g").attr("class", function(e, t) { return ["nv-axisMaxMin", "nv-axisMaxMin-y", 0 == t ? "nv-axisMin-y" : "nv-axisMax-y"].join(" ") }).append("text").style("opacity", 0), w.exit().remove(), w.attr("transform", function(e, n) { return "translate(0," + t.utils.NaNtoZero(h(e)) + ")" }).select("text").attr("dy", ".32em").attr("y", 0).attr("x", -n.tickPadding()).attr("text-anchor", "end").text(function(e, t) { var n = b(e); return ("" + n).match("NaN") ? "" : n }), w.watchTransition(y, "min-max right").attr("transform", function(e, n) { return "translate(0," + t.utils.NaNtoZero(r.range()[n]) + ")" }).select("text").style("opacity", 1)) } if (S.text(function(e) { return e }), !l || "left" !== n.orient() && "right" !== n.orient() || (E.selectAll("g").each(function(e, t) { d3.select(this).select("text").attr("opacity", 1), (r(e) < r.range()[1] + 10 || r(e) > r.range()[0] - 10) && ((e > 1e-10 || e < -1e-10) && d3.select(this).attr("opacity", 0), d3.select(this).select("text").attr("opacity", 0)) }), r.domain()[0] == r.domain()[1] && 0 == r.domain()[0] && g.selectAll("g.nv-axisMaxMin").style("opacity", function(e, t) { return t ? 0 : 1 })), l && ("top" === n.orient() || "bottom" === n.orient())) { var D = []; g.selectAll("g.nv-axisMaxMin").each(function(e, t) { try { t ? D.push(r(e) - this.getBoundingClientRect().width - 4) : D.push(r(e) + this.getBoundingClientRect().width + 4) } catch (n) { t ? D.push(r(e) - 4) : D.push(r(e) + 4) } }), E.selectAll("g").each(function(e, t) { (r(e) < D[0] || r(e) > D[1]) && (e > 1e-10 || e < -1e-10 ? d3.select(this).remove() : d3.select(this).select("text").remove()) }) } E.selectAll(".tick").filter(function(e) { return !parseFloat(Math.round(1e5 * e) / 1e6) && void 0 !== e }).classed("zero", !0), h = r.copy() }), y.renderEnd("axis immediate"), e } var n = d3.svg.axis(), r = d3.scale.linear(), o = { top: 0, right: 0, bottom: 0, left: 0 }, i = 75, a = 60, s = null, l = !0, c = 0, u = !0, d = !1, f = !1, m = null, p = 0, g = 250, v = d3.dispatch("renderEnd"); n.scale(r).orient("bottom").tickFormat(function(e) { return e }); var h, y = t.utils.renderWatch(v, g); return e.axis = n, e.dispatch = v, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { axisLabelDistance: { get: function() { return p }, set: function(e) { p = e } }, staggerLabels: { get: function() { return d }, set: function(e) { d = e } }, rotateLabels: { get: function() { return c }, set: function(e) { c = e } }, rotateYLabel: { get: function() { return u }, set: function(e) { u = e } }, showMaxMin: { get: function() { return l }, set: function(e) { l = e } }, axisLabel: { get: function() { return s }, set: function(e) { s = e } }, height: { get: function() { return a }, set: function(e) { a = e } }, ticks: { get: function() { return m }, set: function(e) { m = e } }, width: { get: function() { return i }, set: function(e) { i = e } }, margin: { get: function() { return o }, set: function(e) { o.top = void 0 !== e.top ? e.top : o.top, o.right = void 0 !== e.right ? e.right : o.right, o.bottom = void 0 !== e.bottom ? e.bottom : o.bottom, o.left = void 0 !== e.left ? e.left : o.left } }, duration: { get: function() { return g }, set: function(e) { g = e, y.reset(g) } }, scale: { get: function() { return r }, set: function(o) { r = o, n.scale(r), f = "function" == typeof r.rangeBands, t.utils.inheritOptionsD3(e, r, ["domain", "range", "rangeBand", "rangeBands"]) } } }), t.utils.initOptions(e), t.utils.inheritOptionsD3(e, n, ["orient", "tickValues", "tickSubdivide", "tickSize", "tickPadding", "tickFormat"]), t.utils.inheritOptionsD3(e, r, ["domain", "range", "rangeBand", "rangeBands"]), e }, t.models.boxPlot = function() { "use strict"; function e(d) { return S.reset(), d.each(function(e) { var d = c - l.left - l.right, g = u - l.top - l.bottom; h = d3.select(this), t.utils.initSVG(h), f.domain(n || e.map(function(e, t) { return p(e, t) })).rangeBands(o || [0, d], .1); var _ = []; if (!r) { var w = d3.min(e.map(function(e) { var t = []; return t.push(e.values.Q1), e.values.hasOwnProperty("whisker_low") && null !== e.values.whisker_low && t.push(e.values.whisker_low), e.values.hasOwnProperty("outliers") && null !== e.values.outliers && (t = t.concat(e.values.outliers)), d3.min(t) })), A = d3.max(e.map(function(e) { var t = []; return t.push(e.values.Q3), e.values.hasOwnProperty("whisker_high") && null !== e.values.whisker_high && t.push(e.values.whisker_high), e.values.hasOwnProperty("outliers") && null !== e.values.outliers && (t = t.concat(e.values.outliers)), d3.max(t) })); _ = [w, A] } m.domain(r || _), m.range(i || [g, 0]), a = a || f, s = s || m.copy().range([m(0), m(0)]); var T = h.selectAll("g.nv-wrap").data([e]); T.enter().append("g").attr("class", "nvd3 nv-wrap"); T.attr("transform", "translate(" + l.left + "," + l.top + ")"); var I = T.selectAll(".nv-boxplot").data(function(e) { return e }), C = I.enter().append("g").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6); I.attr("class", "nv-boxplot").attr("transform", function(e, t, n) { return "translate(" + (f(p(e, t)) + .05 * f.rangeBand()) + ", 0)" }).classed("hover", function(e) { return e.hover }), I.watchTransition(S, "nv-boxplot: boxplots").style("stroke-opacity", 1).style("fill-opacity", .75).delay(function(t, n) { return n * E / e.length }).attr("transform", function(e, t) { return "translate(" + (f(p(e, t)) + .05 * f.rangeBand()) + ", 0)" }), I.exit().remove(), C.each(function(e, t) { var n = d3.select(this); ["low", "high"].forEach(function(r) { e.values.hasOwnProperty("whisker_" + r) && null !== e.values["whisker_" + r] && (n.append("line").style("stroke", e.color ? e.color : v(e, t)).attr("class", "nv-boxplot-whisker nv-boxplot-" + r), n.append("line").style("stroke", e.color ? e.color : v(e, t)).attr("class", "nv-boxplot-tick nv-boxplot-" + r)) }) }); var x = I.selectAll(".nv-boxplot-outlier").data(function(e) { return e.values.hasOwnProperty("outliers") && null !== e.values.outliers ? e.values.outliers : [] }); x.enter().append("circle").style("fill", function(e, t, n) { return v(e, n) }).style("stroke", function(e, t, n) { return v(e, n) }).on("mouseover", function(e, t, n) { d3.select(this).classed("hover", !0), y.elementMouseover({ series: { key: e, color: v(e, n) }, e: d3.event }) }).on("mouseout", function(e, t, n) { d3.select(this).classed("hover", !1), y.elementMouseout({ series: { key: e, color: v(e, n) }, e: d3.event }) }).on("mousemove", function(e, t) { y.elementMousemove({ e: d3.event }) }), x.attr("class", "nv-boxplot-outlier"), x.watchTransition(S, "nv-boxplot: nv-boxplot-outlier").attr("cx", .45 * f.rangeBand()).attr("cy", function(e, t, n) { return m(e) }).attr("r", "3"), x.exit().remove(); var M = function() { return null === b ? .9 * f.rangeBand() : Math.min(75, .9 * f.rangeBand()) }, D = function() { return .45 * f.rangeBand() - M() / 2 }, O = function() { return .45 * f.rangeBand() + M() / 2 }; ["low", "high"].forEach(function(e) { var t = "low" === e ? "Q1" : "Q3"; I.select("line.nv-boxplot-whisker.nv-boxplot-" + e).watchTransition(S, "nv-boxplot: boxplots").attr("x1", .45 * f.rangeBand()).attr("y1", function(t, n) { return m(t.values["whisker_" + e]) }).attr("x2", .45 * f.rangeBand()).attr("y2", function(e, n) { return m(e.values[t]) }), I.select("line.nv-boxplot-tick.nv-boxplot-" + e).watchTransition(S, "nv-boxplot: boxplots").attr("x1", D).attr("y1", function(t, n) { return m(t.values["whisker_" + e]) }).attr("x2", O).attr("y2", function(t, n) { return m(t.values["whisker_" + e]) }) }), ["low", "high"].forEach(function(e) { C.selectAll(".nv-boxplot-" + e).on("mouseover", function(t, n, r) { d3.select(this).classed("hover", !0), y.elementMouseover({ series: { key: t.values["whisker_" + e], color: v(t, r) }, e: d3.event }) }).on("mouseout", function(t, n, r) { d3.select(this).classed("hover", !1), y.elementMouseout({ series: { key: t.values["whisker_" + e], color: v(t, r) }, e: d3.event }) }).on("mousemove", function(e, t) { y.elementMousemove({ e: d3.event }) }) }), C.append("rect").attr("class", "nv-boxplot-box").on("mouseover", function(e, t) { d3.select(this).classed("hover", !0), y.elementMouseover({ key: e.label, value: e.label, series: [{ key: "Q3", value: e.values.Q3, color: e.color || v(e, t) }, { key: "Q2", value: e.values.Q2, color: e.color || v(e, t) }, { key: "Q1", value: e.values.Q1, color: e.color || v(e, t) }], data: e, index: t, e: d3.event }) }).on("mouseout", function(e, t) { d3.select(this).classed("hover", !1), y.elementMouseout({ key: e.label, value: e.label, series: [{ key: "Q3", value: e.values.Q3, color: e.color || v(e, t) }, { key: "Q2", value: e.values.Q2, color: e.color || v(e, t) }, { key: "Q1", value: e.values.Q1, color: e.color || v(e, t) }], data: e, index: t, e: d3.event }) }).on("mousemove", function(e, t) { y.elementMousemove({ e: d3.event }) }), I.select("rect.nv-boxplot-box").watchTransition(S, "nv-boxplot: boxes").attr("y", function(e, t) { return m(e.values.Q3) }).attr("width", M).attr("x", D).attr("height", function(e, t) { return Math.abs(m(e.values.Q3) - m(e.values.Q1)) || 1 }).style("fill", function(e, t) { return e.color || v(e, t) }).style("stroke", function(e, t) { return e.color || v(e, t) }), C.append("line").attr("class", "nv-boxplot-median"), I.select("line.nv-boxplot-median").watchTransition(S, "nv-boxplot: boxplots line").attr("x1", D).attr("y1", function(e, t) { return m(e.values.Q2) }).attr("x2", O).attr("y2", function(e, t) { return m(e.values.Q2) }), a = f.copy(), s = m.copy() }), S.renderEnd("nv-boxplot immediate"), e } var n, r, o, i, a, s, l = { top: 0, right: 0, bottom: 0, left: 0 }, c = 960, u = 500, d = Math.floor(1e4 * Math.random()), f = d3.scale.ordinal(), m = d3.scale.linear(), p = function(e) { return e.x }, g = function(e) { return e.y }, v = t.utils.defaultColor(), h = null, y = d3.dispatch("elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"), E = 250, b = null, S = t.utils.renderWatch(y, E); return e.dispatch = y, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return c }, set: function(e) { c = e } }, height: { get: function() { return u }, set: function(e) { u = e } }, maxBoxWidth: { get: function() { return b }, set: function(e) { b = e } }, x: { get: function() { return p }, set: function(e) { p = e } }, y: { get: function() { return g }, set: function(e) { g = e } }, xScale: { get: function() { return f }, set: function(e) { f = e } }, yScale: { get: function() { return m }, set: function(e) { m = e } }, xDomain: { get: function() { return n }, set: function(e) { n = e } }, yDomain: { get: function() { return r }, set: function(e) { r = e } }, xRange: { get: function() { return o }, set: function(e) { o = e } }, yRange: { get: function() { return i }, set: function(e) { i = e } }, id: { get: function() { return d }, set: function(e) { d = e } }, margin: { get: function() { return l }, set: function(e) { l.top = void 0 !== e.top ? e.top : l.top, l.right = void 0 !== e.right ? e.right : l.right, l.bottom = void 0 !== e.bottom ? e.bottom : l.bottom, l.left = void 0 !== e.left ? e.left : l.left } }, color: { get: function() { return v }, set: function(e) { v = t.utils.getColor(e) } }, duration: { get: function() { return E }, set: function(e) { E = e, S.reset(E) } } }), t.utils.initOptions(e), e }, t.models.boxPlotChart = function() { "use strict"; function e(u) { return E.reset(), E.models(o), d && E.models(i), f && E.models(a), u.each(function(u) { var g = d3.select(this); t.utils.initSVG(g); var E = (l || parseInt(g.style("width")) || 960) - s.left - s.right, b = (c || parseInt(g.style("height")) || 400) - s.top - s.bottom; if (e.update = function() { h.beforeUpdate(), g.transition().duration(y).call(e) }, e.container = this, !(u && u.length && u.filter(function(e) { return e.values.hasOwnProperty("Q1") && e.values.hasOwnProperty("Q2") && e.values.hasOwnProperty("Q3") }).length)) { var S = g.selectAll(".nv-noData").data([v]); return S.enter().append("text").attr("class", "nvd3 nv-noData").attr("dy", "-.7em").style("text-anchor", "middle"), S.attr("x", s.left + E / 2).attr("y", s.top + b / 2).text(function(e) { return e }), e } g.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale().clamp(!0); var _ = g.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([u]), w = _.enter().append("g").attr("class", "nvd3 nv-wrap nv-boxPlotWithAxes").append("g"), A = w.append("defs"), T = _.select("g"); w.append("g").attr("class", "nv-x nv-axis"), w.append("g").attr("class", "nv-y nv-axis").append("g").attr("class", "nv-zeroLine").append("line"), w.append("g").attr("class", "nv-barsWrap"), T.attr("transform", "translate(" + s.left + "," + s.top + ")"), m && T.select(".nv-y.nv-axis").attr("transform", "translate(" + E + ",0)"), o.width(E).height(b); var I = T.select(".nv-barsWrap").datum(u.filter(function(e) { return !e.disabled })); if (I.transition().call(o), A.append("clipPath").attr("id", "nv-x-label-clip-" + o.id()).append("rect"), T.select("#nv-x-label-clip-" + o.id() + " rect").attr("width", n.rangeBand() * (p ? 2 : 1)).attr("height", 16).attr("x", -n.rangeBand() / (p ? 1 : 2)), d) { i.scale(n).ticks(t.utils.calcTicksX(E / 100, u)).tickSize(-b, 0), T.select(".nv-x.nv-axis").attr("transform", "translate(0," + r.range()[0] + ")"), T.select(".nv-x.nv-axis").call(i); var C = T.select(".nv-x.nv-axis").selectAll("g"); p && C.selectAll("text").attr("transform", function(e, t, n) { return "translate(0," + (n % 2 == 0 ? "5" : "17") + ")" }) } f && (a.scale(r).ticks(Math.floor(b / 36)).tickSize(-E, 0), T.select(".nv-y.nv-axis").call(a)), T.select(".nv-zeroLine line").attr("x1", 0).attr("x2", E).attr("y1", r(0)).attr("y2", r(0)) }), E.renderEnd("nv-boxplot chart immediate"), e } var n, r, o = t.models.boxPlot(), i = t.models.axis(), a = t.models.axis(), s = { top: 15, right: 10, bottom: 50, left: 60 }, l = null, c = null, u = t.utils.getColor(), d = !0, f = !0, m = !1, p = !1, g = t.models.tooltip(), v = "No Data Available.", h = d3.dispatch("tooltipShow", "tooltipHide", "beforeUpdate", "renderEnd"), y = 250; i.orient("bottom").showMaxMin(!1).tickFormat(function(e) { return e }), a.orient(m ? "right" : "left").tickFormat(d3.format(",.1f")), g.duration(0); var E = t.utils.renderWatch(h, y); return o.dispatch.on("elementMouseover.tooltip", function(e) { g.data(e).hidden(!1) }), o.dispatch.on("elementMouseout.tooltip", function(e) { g.data(e).hidden(!0) }), o.dispatch.on("elementMousemove.tooltip", function(e) { g.position({ top: d3.event.pageY, left: d3.event.pageX })() }), e.dispatch = h, e.boxplot = o, e.xAxis = i, e.yAxis = a, e.tooltip = g, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return l }, set: function(e) { l = e } }, height: { get: function() { return c }, set: function(e) { c = e } }, staggerLabels: { get: function() { return p }, set: function(e) { p = e } }, showXAxis: { get: function() { return d }, set: function(e) { d = e } }, showYAxis: { get: function() { return f }, set: function(e) { f = e } }, tooltips: { get: function() { return tooltips }, set: function(e) { tooltips = e } }, tooltipContent: { get: function() { return g }, set: function(e) { g = e } }, noData: { get: function() { return v }, set: function(e) { v = e } }, margin: { get: function() { return s }, set: function(e) { s.top = void 0 !== e.top ? e.top : s.top, s.right = void 0 !== e.right ? e.right : s.right, s.bottom = void 0 !== e.bottom ? e.bottom : s.bottom, s.left = void 0 !== e.left ? e.left : s.left } }, duration: { get: function() { return y }, set: function(e) { y = e, E.reset(y), o.duration(y), i.duration(y), a.duration(y) } }, color: { get: function() { return u }, set: function(e) { u = t.utils.getColor(e), o.color(u) } }, rightAlignYAxis: { get: function() { return m }, set: function(e) { m = e, a.orient(e ? "right" : "left") } } }), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e }, t.models.bullet = function() { "use strict"; function e(r) { return r.each(function(e, r) { var g = f - n.left - n.right, y = m - n.top - n.bottom; p = d3.select(this), t.utils.initSVG(p); var E = i.call(this, e, r).slice().sort(d3.descending), b = a.call(this, e, r).slice().sort(d3.descending), S = s.call(this, e, r).slice().sort(d3.descending), _ = l.call(this, e, r).slice(), w = c.call(this, e, r).slice(), A = u.call(this, e, r).slice(), T = d3.scale.linear().domain(d3.extent(d3.merge([d, E]))).range(o ? [g, 0] : [0, g]); this.__chart__ || d3.scale.linear().domain([0, 1 / 0]).range(T.range()); this.__chart__ = T; var I = d3.min(E), C = d3.max(E), x = E[1], M = p.selectAll("g.nv-wrap.nv-bullet").data([e]), D = M.enter().append("g").attr("class", "nvd3 nv-wrap nv-bullet"), O = D.append("g"), R = M.select("g"); O.append("rect").attr("class", "nv-range nv-rangeMax"), O.append("rect").attr("class", "nv-range nv-rangeAvg"), O.append("rect").attr("class", "nv-range nv-rangeMin"), O.append("rect").attr("class", "nv-measure"), M.attr("transform", "translate(" + n.left + "," + n.top + ")"); var N = function(e) { return Math.abs(T(e) - T(0)) }, L = function(e) { return T(e < 0 ? e : 0) }; R.select("rect.nv-rangeMax").attr("height", y).attr("width", N(C > 0 ? C : I)).attr("x", L(C > 0 ? C : I)).datum(C > 0 ? C : I), R.select("rect.nv-rangeAvg").attr("height", y).attr("width", N(x)).attr("x", L(x)).datum(x), R.select("rect.nv-rangeMin").attr("height", y).attr("width", N(C)).attr("x", L(C)).attr("width", N(C > 0 ? I : C)).attr("x", L(C > 0 ? I : C)).datum(C > 0 ? I : C), R.select("rect.nv-measure").style("fill", v).attr("height", y / 3).attr("y", y / 3).attr("width", S < 0 ? T(0) - T(S[0]) : T(S[0]) - T(0)).attr("x", L(S)).on("mouseover", function() { h.elementMouseover({ value: S[0], label: A[0] || "Current", color: d3.select(this).style("fill") }) }).on("mousemove", function() { h.elementMousemove({ value: S[0], label: A[0] || "Current", color: d3.select(this).style("fill") }) }).on("mouseout", function() { h.elementMouseout({ value: S[0], label: A[0] || "Current", color: d3.select(this).style("fill") }) }); var P = y / 6, k = b.map(function(e, t) { return { value: e, label: w[t] } }); O.selectAll("path.nv-markerTriangle").data(k).enter().append("path").attr("class", "nv-markerTriangle").attr("transform", function(e) { return "translate(" + T(e.value) + "," + y / 2 + ")" }).attr("d", "M0," + P + "L" + P + "," + -P + " " + -P + "," + -P + "Z").on("mouseover", function(e) { h.elementMouseover({ value: e.value, label: e.label || "Previous", color: d3.select(this).style("fill"), pos: [T(e.value), y / 2] }) }).on("mousemove", function(e) { h.elementMousemove({ value: e.value, label: e.label || "Previous", color: d3.select(this).style("fill") }) }).on("mouseout", function(e, t) { h.elementMouseout({ value: e.value, label: e.label || "Previous", color: d3.select(this).style("fill") }) }), M.selectAll(".nv-range").on("mouseover", function(e, t) { var n = _[t] || (t ? 1 == t ? "Mean" : "Minimum" : "Maximum"); h.elementMouseover({ value: e, label: n, color: d3.select(this).style("fill") }) }).on("mousemove", function() { h.elementMousemove({ value: S[0], label: A[0] || "Previous", color: d3.select(this).style("fill") }) }).on("mouseout", function(e, t) { var n = _[t] || (t ? 1 == t ? "Mean" : "Minimum" : "Maximum"); h.elementMouseout({ value: e, label: n, color: d3.select(this).style("fill") }) }) }), e } var n = { top: 0, right: 0, bottom: 0, left: 0 }, r = "left", o = !1, i = function(e) { return e.ranges }, a = function(e) { return e.markers ? e.markers : [0] }, s = function(e) { return e.measures }, l = function(e) { return e.rangeLabels ? e.rangeLabels : [] }, c = function(e) { return e.markerLabels ? e.markerLabels : [] }, u = function(e) { return e.measureLabels ? e.measureLabels : [] }, d = [0], f = 380, m = 30, p = null, g = null, v = t.utils.getColor(["#1f77b4"]), h = d3.dispatch("elementMouseover", "elementMouseout", "elementMousemove"); return e.dispatch = h, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { ranges: { get: function() { return i }, set: function(e) { i = e } }, markers: { get: function() { return a }, set: function(e) { a = e } }, measures: { get: function() { return s }, set: function(e) { s = e } }, forceX: { get: function() { return d }, set: function(e) { d = e } }, width: { get: function() { return f }, set: function(e) { f = e } }, height: { get: function() { return m }, set: function(e) { m = e } }, tickFormat: { get: function() { return g }, set: function(e) { g = e } }, margin: { get: function() { return n }, set: function(e) { n.top = void 0 !== e.top ? e.top : n.top, n.right = void 0 !== e.right ? e.right : n.right, n.bottom = void 0 !== e.bottom ? e.bottom : n.bottom, n.left = void 0 !== e.left ? e.left : n.left } }, orient: { get: function() { return r }, set: function(e) { r = e, o = "right" == r || "bottom" == r } }, color: { get: function() { return v }, set: function(e) { v = t.utils.getColor(e) } } }), t.utils.initOptions(e), e }, t.models.bulletChart = function() { "use strict"; function e(r) { return r.each(function(o, p) { var g = d3.select(this); t.utils.initSVG(g); var v = t.utils.availableWidth(u, g, a), h = d - a.top - a.bottom; if (e.update = function() { e(r) }, e.container = this, !o || !s.call(this, o, p)) return t.utils.noData(e, g), e; g.selectAll(".nv-noData").remove(); var y = s.call(this, o, p).slice().sort(d3.descending), E = l.call(this, o, p).slice().sort(d3.descending), b = c.call(this, o, p).slice().sort(d3.descending), S = g.selectAll("g.nv-wrap.nv-bulletChart").data([o]), _ = S.enter().append("g").attr("class", "nvd3 nv-wrap nv-bulletChart"), w = _.append("g"), A = S.select("g"); w.append("g").attr("class", "nv-bulletWrap"), w.append("g").attr("class", "nv-titles"), S.attr("transform", "translate(" + a.left + "," + a.top + ")"); var T = d3.scale.linear().domain([0, Math.max(y[0], E[0], b[0])]).range(i ? [v, 0] : [0, v]), I = this.__chart__ || d3.scale.linear().domain([0, 1 / 0]).range(T.range()); this.__chart__ = T; var C = w.select(".nv-titles").append("g").attr("text-anchor", "end").attr("transform", "translate(-6," + (d - a.top - a.bottom) / 2 + ")"); C.append("text").attr("class", "nv-title").text(function(e) { return e.title }), C.append("text").attr("class", "nv-subtitle").attr("dy", "1em").text(function(e) { return e.subtitle }), n.width(v).height(h); var x = A.select(".nv-bulletWrap"); d3.transition(x).call(n); var M = f || T.tickFormat(v / 100), D = A.selectAll("g.nv-tick").data(T.ticks(m ? m : v / 50), function(e) { return this.textContent || M(e) }), O = D.enter().append("g").attr("class", "nv-tick").attr("transform", function(e) { return "translate(" + I(e) + ",0)" }).style("opacity", 1e-6); O.append("line").attr("y1", h).attr("y2", 7 * h / 6), O.append("text").attr("text-anchor", "middle").attr("dy", "1em").attr("y", 7 * h / 6).text(M); var R = d3.transition(D).attr("transform", function(e) { return "translate(" + T(e) + ",0)" }).style("opacity", 1); R.select("line").attr("y1", h).attr("y2", 7 * h / 6), R.select("text").attr("y", 7 * h / 6), d3.transition(D.exit()).attr("transform", function(e) { return "translate(" + T(e) + ",0)" }).style("opacity", 1e-6).remove() }), d3.timer.flush(), e } var n = t.models.bullet(), r = t.models.tooltip(), o = "left", i = !1, a = { top: 5, right: 40, bottom: 20, left: 120 }, s = function(e) { return e.ranges }, l = function(e) { return e.markers ? e.markers : [0] }, c = function(e) { return e.measures }, u = null, d = 55, f = null, m = null, p = null, g = d3.dispatch("tooltipShow", "tooltipHide"); return r.duration(0).headerEnabled(!1), n.dispatch.on("elementMouseover.tooltip", function(e) { e.series = { key: e.label, value: e.value, color: e.color }, r.data(e).hidden(!1) }), n.dispatch.on("elementMouseout.tooltip", function(e) { r.hidden(!0) }), n.dispatch.on("elementMousemove.tooltip", function(e) { r.position({ top: d3.event.pageY, left: d3.event.pageX })() }), e.bullet = n, e.dispatch = g, e.tooltip = r, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { ranges: { get: function() { return s }, set: function(e) { s = e } }, markers: { get: function() { return l }, set: function(e) { l = e } }, measures: { get: function() { return c }, set: function(e) { c = e } }, width: { get: function() { return u }, set: function(e) { u = e } }, height: { get: function() { return d }, set: function(e) { d = e } }, tickFormat: { get: function() { return f }, set: function(e) { f = e } }, ticks: { get: function() { return m }, set: function(e) { m = e } }, noData: { get: function() { return p }, set: function(e) { p = e } }, tooltips: { get: function() { return r.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), r.enabled(!!e) } }, tooltipContent: { get: function() { return r.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), r.contentGenerator(e) } }, margin: { get: function() { return a }, set: function(e) { a.top = void 0 !== e.top ? e.top : a.top, a.right = void 0 !== e.right ? e.right : a.right, a.bottom = void 0 !== e.bottom ? e.bottom : a.bottom, a.left = void 0 !== e.left ? e.left : a.left } }, orient: { get: function() { return o }, set: function(e) { o = e, i = "right" == o || "bottom" == o } } }), t.utils.inheritOptions(e, n), t.utils.initOptions(e), e }, t.models.candlestickBar = function() { "use strict"; function e(w) { return w.each(function(e) { n = d3.select(this); var w = t.utils.availableWidth(l, n, s), A = t.utils.availableHeight(c, n, s); t.utils.initSVG(n); var I = w / e[0].values.length * .45; d.domain(r || d3.extent(e[0].values.map(m).concat(E))), S ? d.range(i || [.5 * w / e[0].values.length, w * (e[0].values.length - .5) / e[0].values.length]) : d.range(i || [5 + I / 2, w - I / 2 - 5]), f.domain(o || [d3.min(e[0].values.map(y).concat(b)), d3.max(e[0].values.map(h).concat(b))]).range(a || [A, 0]), d.domain()[0] === d.domain()[1] && (d.domain()[0] ? d.domain([d.domain()[0] - .01 * d.domain()[0], d.domain()[1] + .01 * d.domain()[1]]) : d.domain([-1, 1])), f.domain()[0] === f.domain()[1] && (f.domain()[0] ? f.domain([f.domain()[0] + .01 * f.domain()[0], f.domain()[1] - .01 * f.domain()[1]]) : f.domain([-1, 1])); var C = d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([e[0].values]), x = C.enter().append("g").attr("class", "nvd3 nv-wrap nv-candlestickBar"), M = x.append("defs"), D = x.append("g"), O = C.select("g"); D.append("g").attr("class", "nv-ticks"), C.attr("transform", "translate(" + s.left + "," + s.top + ")"), n.on("click", function(e, t) { T.chartClick({ data: e, index: t, pos: d3.event, id: u }) }), M.append("clipPath").attr("id", "nv-chart-clip-path-" + u).append("rect"), C.select("#nv-chart-clip-path-" + u + " rect").attr("width", w).attr("height", A), O.attr("clip-path", _ ? "url(#nv-chart-clip-path-" + u + ")" : ""); var R = C.select(".nv-ticks").selectAll(".nv-tick").data(function(e) { return e }); R.exit().remove(); var N = R.enter().append("g").attr("class", function(e, t, n) { return (g(e, t) > v(e, t) ? "nv-tick negative" : "nv-tick positive") + " nv-tick-" + n + "-" + t }); N.append("line").attr("class", "nv-candlestick-lines").attr("transform", function(e, t) { return "translate(" + d(m(e, t)) + ",0)" }).attr("x1", 0).attr("y1", function(e, t) { return f(h(e, t)) }).attr("x2", 0).attr("y2", function(e, t) { return f(y(e, t)) }), N.append("rect").attr("class", "nv-candlestick-rects nv-bars").attr("transform", function(e, t) { return "translate(" + (d(m(e, t)) - I / 2) + "," + (f(p(e, t)) - (g(e, t) > v(e, t) ? f(v(e, t)) - f(g(e, t)) : 0)) + ")" }).attr("x", 0).attr("y", 0).attr("width", I).attr("height", function(e, t) { var n = g(e, t), r = v(e, t); return n > r ? f(r) - f(n) : f(n) - f(r) }); n.selectAll(".nv-candlestick-lines").transition().attr("transform", function(e, t) { return "translate(" + d(m(e, t)) + ",0)" }).attr("x1", 0).attr("y1", function(e, t) { return f(h(e, t)) }).attr("x2", 0).attr("y2", function(e, t) { return f(y(e, t)) }), n.selectAll(".nv-candlestick-rects").transition().attr("transform", function(e, t) { return "translate(" + (d(m(e, t)) - I / 2) + "," + (f(p(e, t)) - (g(e, t) > v(e, t) ? f(v(e, t)) - f(g(e, t)) : 0)) + ")" }).attr("x", 0).attr("y", 0).attr("width", I).attr("height", function(e, t) { var n = g(e, t), r = v(e, t); return n > r ? f(r) - f(n) : f(n) - f(r) }) }), e } var n, r, o, i, a, s = { top: 0, right: 0, bottom: 0, left: 0 }, l = null, c = null, u = Math.floor(1e4 * Math.random()), d = d3.scale.linear(), f = d3.scale.linear(), m = function(e) { return e.x }, p = function(e) { return e.y }, g = function(e) { return e.open }, v = function(e) { return e.close }, h = function(e) { return e.high }, y = function(e) { return e.low }, E = [], b = [], S = !1, _ = !0, w = t.utils.defaultColor(), A = !1, T = d3.dispatch("tooltipShow", "tooltipHide", "stateChange", "changeState", "renderEnd", "chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove"); return e.highlightPoint = function(t, r) { e.clearHighlights(), n.select(".nv-candlestickBar .nv-tick-0-" + t).classed("hover", r) }, e.clearHighlights = function() { n.select(".nv-candlestickBar .nv-tick.hover").classed("hover", !1) }, e.dispatch = T, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return l }, set: function(e) { l = e } }, height: { get: function() { return c }, set: function(e) { c = e } }, xScale: { get: function() { return d }, set: function(e) { d = e } }, yScale: { get: function() { return f }, set: function(e) { f = e } }, xDomain: { get: function() { return r }, set: function(e) { r = e } }, yDomain: { get: function() { return o }, set: function(e) { o = e } }, xRange: { get: function() { return i }, set: function(e) { i = e } }, yRange: { get: function() { return a }, set: function(e) { a = e } }, forceX: { get: function() { return E }, set: function(e) { E = e } }, forceY: { get: function() { return b }, set: function(e) { b = e } }, padData: { get: function() { return S }, set: function(e) { S = e } }, clipEdge: { get: function() { return _ }, set: function(e) { _ = e } }, id: { get: function() { return u }, set: function(e) { u = e } }, interactive: { get: function() { return A }, set: function(e) { A = e } }, x: { get: function() { return m }, set: function(e) { m = e } }, y: { get: function() { return p }, set: function(e) { p = e } }, open: { get: function() { return g() }, set: function(e) { g = e } }, close: { get: function() { return v() }, set: function(e) { v = e } }, high: { get: function() { return h }, set: function(e) { h = e } }, low: { get: function() { return y }, set: function(e) { y = e } }, margin: { get: function() { return s }, set: function(e) { s.top = void 0 != e.top ? e.top : s.top, s.right = void 0 != e.right ? e.right : s.right, s.bottom = void 0 != e.bottom ? e.bottom : s.bottom, s.left = void 0 != e.left ? e.left : s.left } }, color: { get: function() { return w }, set: function(e) { w = t.utils.getColor(e) } } }), t.utils.initOptions(e), e }, t.models.cumulativeLineChart = function() { "use strict"; function e(d) { return N.reset(), N.models(i), h && N.models(a), y && N.models(s), d.each(function(d) { function I(t, n) { d3.select(e.container).style("cursor", "ew-resize") } function D(e, t) { R.x = d3.event.x, R.i = Math.round(O.invert(R.x)), k() } function N(t, n) { d3.select(e.container).style("cursor", "auto"), A.index = R.i, x.stateChange(A) } function k() { te.data([R]); var t = e.duration(); e.duration(0), e.update(), e.duration(t) } var G = d3.select(this); t.utils.initSVG(G), G.classed("nv-chart-" + w, !0); var F = this, U = t.utils.availableWidth(p, G, f), V = t.utils.availableHeight(g, G, f); if (e.update = function() { 0 === M ? G.call(e) : G.transition().duration(M).call(e) }, e.container = this, A.setter(P(d), e.update).getter(L(d)).update(), A.disabled = d.map(function(e) { return !!e.disabled }), !T) { var z; T = {}; for (z in A) A[z] instanceof Array ? T[z] = A[z].slice(0) : T[z] = A[z] } var B = d3.behavior.drag().on("dragstart", I).on("drag", D).on("dragend", N); if (!(d && d.length && d.filter(function(e) { return e.values.length }).length)) return t.utils.noData(e, G), e; if (G.selectAll(".nv-noData").remove(), r = i.xScale(), o = i.yScale(), _) i.yDomain(null); else { var $ = d.filter(function(e) { return !e.disabled }).map(function(e, t) { var n = d3.extent(e.values, i.y()); return n[0] < -.95 && (n[0] = -.95), [(n[0] - n[1]) / (1 + n[1]), (n[1] - n[0]) / (1 + n[0])] }), W = [d3.min($, function(e) { return e[0] }), d3.max($, function(e) { return e[1] })]; i.yDomain(W) } O.domain([0, d[0].values.length - 1]).range([0, U]).clamp(!0); var d = n(R.i, d), H = S ? "none" : "all", j = G.selectAll("g.nv-wrap.nv-cumulativeLine").data([d]), Y = j.enter().append("g").attr("class", "nvd3 nv-wrap nv-cumulativeLine").append("g"), q = j.select("g"); if (Y.append("g").attr("class", "nv-interactive"), Y.append("g").attr("class", "nv-x nv-axis").style("pointer-events", "none"), Y.append("g").attr("class", "nv-y nv-axis"), Y.append("g").attr("class", "nv-background"), Y.append("g").attr("class", "nv-linesWrap").style("pointer-events", H), Y.append("g").attr("class", "nv-avgLinesWrap").style("pointer-events", "none"), Y.append("g").attr("class", "nv-legendWrap"), Y.append("g").attr("class", "nv-controlsWrap"), v && (l.width(U), q.select(".nv-legendWrap").datum(d).call(l), f.top != l.height() && (f.top = l.height(), V = t.utils.availableHeight(g, G, f)), q.select(".nv-legendWrap").attr("transform", "translate(0," + -f.top + ")")), b) { var K = [{ key: "Re-scale y-axis", disabled: !_ }]; c.width(140).color(["#444", "#444", "#444"]).rightAlign(!1).margin({ top: 5, right: 0, bottom: 5, left: 20 }), q.select(".nv-controlsWrap").datum(K).attr("transform", "translate(0," + -f.top + ")").call(c) } j.attr("transform", "translate(" + f.left + "," + f.top + ")"), E && q.select(".nv-y.nv-axis").attr("transform", "translate(" + U + ",0)"); var Q = d.filter(function(e) { return e.tempDisabled }); j.select(".tempDisabled").remove(), Q.length && j.append("text").attr("class", "tempDisabled").attr("x", U / 2).attr("y", "-.71em").style("text-anchor", "end").text(Q.map(function(e) { return e.key }).join(", ") + " values cannot be calculated for this time period."), S && (u.width(U).height(V).margin({ left: f.left, top: f.top }).svgContainer(G).xScale(r), j.select(".nv-interactive").call(u)), Y.select(".nv-background").append("rect"), q.select(".nv-background rect").attr("width", U).attr("height", V), i.y(function(e) { return e.display.y }).width(U).height(V).color(d.map(function(e, t) { return e.color || m(e, t) }).filter(function(e, t) { return !d[t].disabled && !d[t].tempDisabled })); var Z = q.select(".nv-linesWrap").datum(d.filter(function(e) { return !e.disabled && !e.tempDisabled })); Z.call(i), d.forEach(function(e, t) { e.seriesIndex = t }); var X = d.filter(function(e) { return !e.disabled && !!C(e) }), J = q.select(".nv-avgLinesWrap").selectAll("line").data(X, function(e) { return e.key }), ee = function(e) { var t = o(C(e)); return t < 0 ? 0 : t > V ? V : t }; J.enter().append("line").style("stroke-width", 2).style("stroke-dasharray", "10,10").style("stroke", function(e, t) { return i.color()(e, e.seriesIndex) }).attr("x1", 0).attr("x2", U).attr("y1", ee).attr("y2", ee), J.style("stroke-opacity", function(e) { var t = o(C(e)); return t < 0 || t > V ? 0 : 1 }).attr("x1", 0).attr("x2", U).attr("y1", ee).attr("y2", ee), J.exit().remove(); var te = Z.selectAll(".nv-indexLine").data([R]); te.enter().append("rect").attr("class", "nv-indexLine").attr("width", 3).attr("x", -2).attr("fill", "red").attr("fill-opacity", .5).style("pointer-events", "all").call(B), te.attr("transform", function(e) { return "translate(" + O(e.i) + ",0)" }).attr("height", V), h && (a.scale(r)._ticks(t.utils.calcTicksX(U / 70, d)).tickSize(-V, 0), q.select(".nv-x.nv-axis").attr("transform", "translate(0," + o.range()[0] + ")"), q.select(".nv-x.nv-axis").call(a)), y && (s.scale(o)._ticks(t.utils.calcTicksY(V / 36, d)).tickSize(-U, 0), q.select(".nv-y.nv-axis").call(s)), q.select(".nv-background rect").on("click", function() { R.x = d3.mouse(this)[0], R.i = Math.round(O.invert(R.x)), A.index = R.i, x.stateChange(A), k() }), i.dispatch.on("elementClick", function(e) { R.i = e.pointIndex, R.x = O(R.i), A.index = R.i, x.stateChange(A), k() }), c.dispatch.on("legendClick", function(t, n) { t.disabled = !t.disabled, _ = !t.disabled, A.rescaleY = _, x.stateChange(A), e.update() }), l.dispatch.on("stateChange", function(t) { for (var n in t) A[n] = t[n]; x.stateChange(A), e.update() }), u.dispatch.on("elementMousemove", function(n) { i.clearHighlights(); var r, o, l, c = []; if (d.filter(function(e, t) { return e.seriesIndex = t, !e.disabled }).forEach(function(a, s) { o = t.interactiveBisect(a.values, n.pointXValue, e.x()), i.highlightPoint(s, o, !0); var u = a.values[o]; "undefined" != typeof u && ("undefined" == typeof r && (r = u), "undefined" == typeof l && (l = e.xScale()(e.x()(u, o))), c.push({ key: a.key, value: e.y()(u, o), color: m(a, a.seriesIndex) })) }), c.length > 2) { var p = e.yScale().invert(n.mouseY), g = Math.abs(e.yScale().domain()[0] - e.yScale().domain()[1]), v = .03 * g, h = t.nearestValueIndex(c.map(function(e) { return e.value }), p, v); null !== h && (c[h].highlight = !0) } var y = a.tickFormat()(e.x()(r, o), o); u.tooltip.position({ left: l + f.left, top: n.mouseY + f.top }).chartContainer(F.parentNode).valueFormatter(function(e, t) { return s.tickFormat()(e) }).data({ value: y, series: c })(), u.renderGuideLine(l) }), u.dispatch.on("elementMouseout", function(e) { i.clearHighlights() }), x.on("changeState", function(t) { "undefined" != typeof t.disabled && (d.forEach(function(e, n) { e.disabled = t.disabled[n] }), A.disabled = t.disabled), "undefined" != typeof t.index && (R.i = t.index, R.x = O(R.i), A.index = t.index, te.data([R])), "undefined" != typeof t.rescaleY && (_ = t.rescaleY), e.update() }) }), N.renderEnd("cumulativeLineChart immediate"), e } function n(e, t) { return k || (k = i.y()), t.map(function(t, n) { if (!t.values) return t; var r = t.values[e]; if (null == r) return t; var o = k(r, e); return o < -.95 && !D ? (t.tempDisabled = !0, t) : (t.tempDisabled = !1, t.values = t.values.map(function(e, t) { return e.display = { y: (k(e, t) - o) / (1 + o) }, e }), t) }) } var r, o, i = t.models.line(), a = t.models.axis(), s = t.models.axis(), l = t.models.legend(), c = t.models.legend(), u = t.interactiveGuideline(), d = t.models.tooltip(), f = { top: 30, right: 30, bottom: 50, left: 60 }, m = t.utils.defaultColor(), p = null, g = null, v = !0, h = !0, y = !0, E = !1, b = !0, S = !1, _ = !0, w = i.id(), A = t.utils.state(), T = null, I = null, C = function(e) { return e.average }, x = d3.dispatch("stateChange", "changeState", "renderEnd"), M = 250, D = !1; A.index = 0, A.rescaleY = _, a.orient("bottom").tickPadding(7), s.orient(E ? "right" : "left"), d.valueFormatter(function(e, t) { return s.tickFormat()(e, t) }).headerFormatter(function(e, t) { return a.tickFormat()(e, t) }), c.updateState(!1); var O = d3.scale.linear(), R = { i: 0, x: 0 }, N = t.utils.renderWatch(x, M), L = function(e) { return function() { return { active: e.map(function(e) { return !e.disabled }), index: R.i, rescaleY: _ } } }, P = function(e) { return function(t) { void 0 !== t.index && (R.i = t.index), void 0 !== t.rescaleY && (_ = t.rescaleY), void 0 !== t.active && e.forEach(function(e, n) { e.disabled = !t.active[n] }) } }; i.dispatch.on("elementMouseover.tooltip", function(t) { var n = { x: e.x()(t.point), y: e.y()(t.point), color: t.point.color }; t.point = n, d.data(t).position(t.pos).hidden(!1) }), i.dispatch.on("elementMouseout.tooltip", function(e) { d.hidden(!0) }); var k = null; return e.dispatch = x, e.lines = i, e.legend = l, e.controls = c, e.xAxis = a, e.yAxis = s, e.interactiveLayer = u, e.state = A, e.tooltip = d, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return p }, set: function(e) { p = e } }, height: { get: function() { return g }, set: function(e) { g = e } }, rescaleY: { get: function() { return _ }, set: function(e) { _ = e } }, showControls: { get: function() { return b }, set: function(e) { b = e } }, showLegend: { get: function() { return v }, set: function(e) { v = e } }, average: { get: function() { return C }, set: function(e) { C = e } }, defaultState: { get: function() { return T }, set: function(e) { T = e } }, noData: { get: function() { return I }, set: function(e) { I = e } }, showXAxis: { get: function() { return h }, set: function(e) { h = e } }, showYAxis: { get: function() { return y }, set: function(e) { y = e } }, noErrorCheck: { get: function() { return D }, set: function(e) { D = e } }, tooltips: { get: function() { return d.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), d.enabled(!!e) } }, tooltipContent: { get: function() { return d.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), d.contentGenerator(e) } }, margin: { get: function() { return f }, set: function(e) { f.top = void 0 !== e.top ? e.top : f.top, f.right = void 0 !== e.right ? e.right : f.right, f.bottom = void 0 !== e.bottom ? e.bottom : f.bottom, f.left = void 0 !== e.left ? e.left : f.left } }, color: { get: function() { return m }, set: function(e) { m = t.utils.getColor(e), l.color(m) } }, useInteractiveGuideline: { get: function() { return S }, set: function(t) { S = t, t === !0 && (e.interactive(!1), e.useVoronoi(!1)) } }, rightAlignYAxis: { get: function() { return E }, set: function(e) { E = e, s.orient(e ? "right" : "left") } }, duration: { get: function() { return M }, set: function(e) { M = e, i.duration(M), a.duration(M), s.duration(M), N.reset(M) } } }), t.utils.inheritOptions(e, i), t.utils.initOptions(e), e }, t.models.discreteBar = function() { "use strict"; function e(f) { return A.reset(), f.each(function(e) { var f = u - c.left - c.right, w = d - c.top - c.bottom; n = d3.select(this), t.utils.initSVG(n), e.forEach(function(e, t) { e.values.forEach(function(e) { e.series = t }) }); var T = r && o ? [] : e.map(function(e) { return e.values.map(function(e, t) { return { x: g(e, t), y: v(e, t), y0: e.y0 } }) }); m.domain(r || d3.merge(T).map(function(e) { return e.x })).rangeBands(i || [0, f], .1), p.domain(o || d3.extent(d3.merge(T).map(function(e) { return e.y }).concat(h))), E ? p.range(a || [w - (p.domain()[0] < 0 ? 12 : 0), p.domain()[1] > 0 ? 12 : 0]) : p.range(a || [w, 0]), s = s || m, l = l || p.copy().range([p(0), p(0)]); var I = n.selectAll("g.nv-wrap.nv-discretebar").data([e]), C = I.enter().append("g").attr("class", "nvd3 nv-wrap nv-discretebar"), x = C.append("g"); I.select("g"); x.append("g").attr("class", "nv-groups"), I.attr("transform", "translate(" + c.left + "," + c.top + ")"); var M = I.select(".nv-groups").selectAll(".nv-group").data(function(e) { return e }, function(e) { return e.key }); M.enter().append("g").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6), M.exit().watchTransition(A, "discreteBar: exit groups").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6).remove(), M.attr("class", function(e, t) { return "nv-group nv-series-" + t }).classed("hover", function(e) { return e.hover }), M.watchTransition(A, "discreteBar: groups").style("stroke-opacity", 1).style("fill-opacity", .75); var D = M.selectAll("g.nv-bar").data(function(e) { return e.values }); D.exit().remove(); var O = D.enter().append("g").attr("transform", function(e, t, n) { return "translate(" + (m(g(e, t)) + .05 * m.rangeBand()) + ", " + p(0) + ")" }).on("mouseover", function(e, t) { d3.select(this).classed("hover", !0), S.elementMouseover({ data: e, index: t, color: d3.select(this).style("fill") }) }).on("mouseout", function(e, t) { d3.select(this).classed("hover", !1), S.elementMouseout({ data: e, index: t, color: d3.select(this).style("fill") }) }).on("mousemove", function(e, t) { S.elementMousemove({ data: e, index: t, color: d3.select(this).style("fill") }) }).on("click", function(e, t) { S.elementClick({ data: e, index: t, color: d3.select(this).style("fill") }), d3.event.stopPropagation() }).on("dblclick", function(e, t) { S.elementDblClick({ data: e, index: t, color: d3.select(this).style("fill") }), d3.event.stopPropagation() }); O.append("rect").attr("height", 0).attr("width", .9 * m.rangeBand() / e.length), E ? (O.append("text").attr("text-anchor", "middle"), D.select("text").text(function(e, t) { return b(v(e, t)) }).watchTransition(A, "discreteBar: bars text").attr("x", .9 * m.rangeBand() / 2).attr("y", function(e, t) { return v(e, t) < 0 ? p(v(e, t)) - p(0) + 12 : -4 })) : D.selectAll("text").remove(), D.attr("class", function(e, t) { return v(e, t) < 0 ? "nv-bar negative" : "nv-bar positive" }).style("fill", function(e, t) { return e.color || y(e, t) }).style("stroke", function(e, t) { return e.color || y(e, t) }).select("rect").attr("class", _).watchTransition(A, "discreteBar: bars rect").attr("width", .9 * m.rangeBand() / e.length), D.watchTransition(A, "discreteBar: bars").attr("transform", function(e, t) { var n = m(g(e, t)) + .05 * m.rangeBand(), r = v(e, t) < 0 ? p(0) : p(0) - p(v(e, t)) < 1 ? p(0) - 1 : p(v(e, t)); return "translate(" + n + ", " + r + ")" }).select("rect").attr("height", function(e, t) { return Math.max(Math.abs(p(v(e, t)) - p(o && o[0] || 0)) || 1) }), s = m.copy(), l = p.copy() }), A.renderEnd("discreteBar immediate"), e } var n, r, o, i, a, s, l, c = { top: 0, right: 0, bottom: 0, left: 0 }, u = 960, d = 500, f = Math.floor(1e4 * Math.random()), m = d3.scale.ordinal(), p = d3.scale.linear(), g = function(e) { return e.x }, v = function(e) { return e.y }, h = [0], y = t.utils.defaultColor(), E = !1, b = d3.format(",.2f"), S = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"), _ = "discreteBar", w = 250, A = t.utils.renderWatch(S, w); return e.dispatch = S, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return u }, set: function(e) { u = e } }, height: { get: function() { return d }, set: function(e) { d = e } }, forceY: { get: function() { return h }, set: function(e) { h = e } }, showValues: { get: function() { return E }, set: function(e) { E = e } }, x: { get: function() { return g }, set: function(e) { g = e } }, y: { get: function() { return v }, set: function(e) { v = e } }, xScale: { get: function() { return m }, set: function(e) { m = e } }, yScale: { get: function() { return p }, set: function(e) { p = e } }, xDomain: { get: function() { return r }, set: function(e) { r = e } }, yDomain: { get: function() { return o }, set: function(e) { o = e } }, xRange: { get: function() { return i }, set: function(e) { i = e } }, yRange: { get: function() { return a }, set: function(e) { a = e } }, valueFormat: { get: function() { return b }, set: function(e) { b = e } }, id: { get: function() { return f }, set: function(e) { f = e } }, rectClass: { get: function() { return _ }, set: function(e) { _ = e } }, margin: { get: function() { return c }, set: function(e) { c.top = void 0 !== e.top ? e.top : c.top, c.right = void 0 !== e.right ? e.right : c.right, c.bottom = void 0 !== e.bottom ? e.bottom : c.bottom, c.left = void 0 !== e.left ? e.left : c.left } }, color: { get: function() { return y }, set: function(e) { y = t.utils.getColor(e) } }, duration: { get: function() { return w }, set: function(e) { w = e, A.reset(w) } } }), t.utils.initOptions(e), e }, t.models.discreteBarChart = function() { "use strict"; function e(s) { return E.reset(), E.models(o), f && E.models(i), m && E.models(a), s.each(function(s) { var d = d3.select(this); t.utils.initSVG(d); var v = t.utils.availableWidth(c, d, l), E = t.utils.availableHeight(u, d, l); if (e.update = function() { h.beforeUpdate(), d.transition().duration(y).call(e) }, e.container = this, !(s && s.length && s.filter(function(e) { return e.values.length }).length)) return t.utils.noData(e, d), e; d.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale().clamp(!0); var b = d.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([s]), S = b.enter().append("g").attr("class", "nvd3 nv-wrap nv-discreteBarWithAxes").append("g"), _ = S.append("defs"), w = b.select("g"); S.append("g").attr("class", "nv-x nv-axis"), S.append("g").attr("class", "nv-y nv-axis").append("g").attr("class", "nv-zeroLine").append("line"), S.append("g").attr("class", "nv-barsWrap"), w.attr("transform", "translate(" + l.left + "," + l.top + ")"), p && w.select(".nv-y.nv-axis").attr("transform", "translate(" + v + ",0)"), o.width(v).height(E); var A = w.select(".nv-barsWrap").datum(s.filter(function(e) { return !e.disabled })); if (A.transition().call(o), _.append("clipPath").attr("id", "nv-x-label-clip-" + o.id()).append("rect"), w.select("#nv-x-label-clip-" + o.id() + " rect").attr("width", n.rangeBand() * (g ? 2 : 1)).attr("height", 16).attr("x", -n.rangeBand() / (g ? 1 : 2)), f) { i.scale(n)._ticks(t.utils.calcTicksX(v / 100, s)).tickSize(-E, 0), w.select(".nv-x.nv-axis").attr("transform", "translate(0," + (r.range()[0] + (o.showValues() && r.domain()[0] < 0 ? 16 : 0)) + ")"), w.select(".nv-x.nv-axis").call(i); var T = w.select(".nv-x.nv-axis").selectAll("g"); g && T.selectAll("text").attr("transform", function(e, t, n) { return "translate(0," + (n % 2 == 0 ? "5" : "17") + ")" }) } m && (a.scale(r)._ticks(t.utils.calcTicksY(E / 36, s)).tickSize(-v, 0), w.select(".nv-y.nv-axis").call(a)), w.select(".nv-zeroLine line").attr("x1", 0).attr("x2", v).attr("y1", r(0)).attr("y2", r(0)) }), E.renderEnd("discreteBar chart immediate"), e } var n, r, o = t.models.discreteBar(), i = t.models.axis(), a = t.models.axis(), s = t.models.tooltip(), l = { top: 15, right: 10, bottom: 50, left: 60 }, c = null, u = null, d = t.utils.getColor(), f = !0, m = !0, p = !1, g = !1, v = null, h = d3.dispatch("beforeUpdate", "renderEnd"), y = 250; i.orient("bottom").showMaxMin(!1).tickFormat(function(e) { return e }), a.orient(p ? "right" : "left").tickFormat(d3.format(",.1f")), s.duration(0).headerEnabled(!1).valueFormatter(function(e, t) { return a.tickFormat()(e, t) }).keyFormatter(function(e, t) { return i.tickFormat()(e, t) }); var E = t.utils.renderWatch(h, y); return o.dispatch.on("elementMouseover.tooltip", function(t) { t.series = { key: e.x()(t.data), value: e.y()(t.data), color: t.color }, s.data(t).hidden(!1) }), o.dispatch.on("elementMouseout.tooltip", function(e) { s.hidden(!0) }), o.dispatch.on("elementMousemove.tooltip", function(e) { s.position({ top: d3.event.pageY, left: d3.event.pageX })() }), e.dispatch = h, e.discretebar = o, e.xAxis = i, e.yAxis = a, e.tooltip = s, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return c }, set: function(e) { c = e } }, height: { get: function() { return u }, set: function(e) { u = e } }, staggerLabels: { get: function() { return g }, set: function(e) { g = e } }, showXAxis: { get: function() { return f }, set: function(e) { f = e } }, showYAxis: { get: function() { return m }, set: function(e) { m = e } }, noData: { get: function() { return v }, set: function(e) { v = e } }, tooltips: { get: function() { return s.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), s.enabled(!!e) } }, tooltipContent: { get: function() { return s.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), s.contentGenerator(e) } }, margin: { get: function() { return l }, set: function(e) { l.top = void 0 !== e.top ? e.top : l.top, l.right = void 0 !== e.right ? e.right : l.right, l.bottom = void 0 !== e.bottom ? e.bottom : l.bottom, l.left = void 0 !== e.left ? e.left : l.left } }, duration: { get: function() { return y }, set: function(e) { y = e, E.reset(y), o.duration(y), i.duration(y), a.duration(y) } }, color: { get: function() { return d }, set: function(e) { d = t.utils.getColor(e), o.color(d) } }, rightAlignYAxis: { get: function() { return p }, set: function(e) { p = e, a.orient(e ? "right" : "left") } } }), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e }, t.models.distribution = function() { "use strict"; function e(u) { return f.reset(), u.each(function(e) { var u = (o - ("x" === a ? r.left + r.right : r.top + r.bottom), "x" == a ? "y" : "x"), d = d3.select(this); t.utils.initSVG(d), n = n || c; var m = d.selectAll("g.nv-distribution").data([e]), p = m.enter().append("g").attr("class", "nvd3 nv-distribution"), g = (p.append("g"), m.select("g")); m.attr("transform", "translate(" + r.left + "," + r.top + ")"); var v = g.selectAll("g.nv-dist").data(function(e) { return e }, function(e) { return e.key }); v.enter().append("g"), v.attr("class", function(e, t) { return "nv-dist nv-series-" + t }).style("stroke", function(e, t) { return l(e, t) }); var h = v.selectAll("line.nv-dist" + a).data(function(e) { return e.values }); h.enter().append("line").attr(a + "1", function(e, t) { return n(s(e, t)) }).attr(a + "2", function(e, t) { return n(s(e, t)) }), f.transition(v.exit().selectAll("line.nv-dist" + a), "dist exit").attr(a + "1", function(e, t) { return c(s(e, t)) }).attr(a + "2", function(e, t) { return c(s(e, t)) }).style("stroke-opacity", 0).remove(), h.attr("class", function(e, t) { return "nv-dist" + a + " nv-dist" + a + "-" + t }).attr(u + "1", 0).attr(u + "2", i), f.transition(h, "dist").attr(a + "1", function(e, t) { return c(s(e, t)) }).attr(a + "2", function(e, t) { return c(s(e, t)) }), n = c.copy() }), f.renderEnd("distribution immediate"), e } var n, r = { top: 0, right: 0, bottom: 0, left: 0 }, o = 400, i = 8, a = "x", s = function(e) { return e[a] }, l = t.utils.defaultColor(), c = d3.scale.linear(), u = 250, d = d3.dispatch("renderEnd"), f = t.utils.renderWatch(d, u); return e.options = t.utils.optionsFunc.bind(e), e.dispatch = d, e.margin = function(t) { return arguments.length ? (r.top = "undefined" != typeof t.top ? t.top : r.top, r.right = "undefined" != typeof t.right ? t.right : r.right, r.bottom = "undefined" != typeof t.bottom ? t.bottom : r.bottom, r.left = "undefined" != typeof t.left ? t.left : r.left, e) : r }, e.width = function(t) { return arguments.length ? (o = t, e) : o }, e.axis = function(t) { return arguments.length ? (a = t, e) : a }, e.size = function(t) { return arguments.length ? (i = t, e) : i }, e.getData = function(t) { return arguments.length ? (s = d3.functor(t), e) : s }, e.scale = function(t) { return arguments.length ? (c = t, e) : c }, e.color = function(n) { return arguments.length ? (l = t.utils.getColor(n), e) : l }, e.duration = function(t) { return arguments.length ? (u = t, f.reset(u), e) : u }, e }, t.models.furiousLegend = function() { "use strict"; function e(g) { function v(e, t) { return "furious" != p ? "#000" : f ? e.disengaged ? a(e, t) : "#fff" : f ? void 0 : e.disabled ? a(e, t) : "#fff" } function h(e, t) { return f && "furious" == p ? e.disengaged ? "#fff" : a(e, t) : e.disabled ? "#fff" : a(e, t) } return g.each(function(e) { var g = r - n.left - n.right, y = d3.select(this); t.utils.initSVG(y); var E = y.selectAll("g.nv-legend").data([e]), b = (E.enter().append("g").attr("class", "nvd3 nv-legend").append("g"), E.select("g")); E.attr("transform", "translate(" + n.left + "," + n.top + ")"); var S, _ = b.selectAll(".nv-series").data(function(e) { return "furious" != p ? e : e.filter(function(e) { return !!f || !e.disengaged }) }), w = _.enter().append("g").attr("class", "nv-series"); if ("classic" == p) w.append("circle").style("stroke-width", 2).attr("class", "nv-legend-symbol").attr("r", 5), S = _.select("circle"); else if ("furious" == p) { w.append("rect").style("stroke-width", 2).attr("class", "nv-legend-symbol").attr("rx", 3).attr("ry", 3), S = _.select("rect"), w.append("g").attr("class", "nv-check-box").property("innerHTML", '').attr("transform", "translate(-10,-8)scale(0.5)"); var A = _.select(".nv-check-box"); A.each(function(e, t) { d3.select(this).selectAll("path").attr("stroke", v(e, t)) }) } w.append("text").attr("text-anchor", "start").attr("class", "nv-legend-text").attr("dy", ".32em").attr("dx", "8"); var T = _.select("text.nv-legend-text"); _.on("mouseover", function(e, t) { m.legendMouseover(e, t) }).on("mouseout", function(e, t) { m.legendMouseout(e, t) }).on("click", function(e, t) { m.legendClick(e, t); var n = _.data(); if (u) { if ("classic" == p) d ? (n.forEach(function(e) { e.disabled = !0 }), e.disabled = !1) : (e.disabled = !e.disabled, n.every(function(e) { return e.disabled }) && n.forEach(function(e) { e.disabled = !1 })); else if ("furious" == p) if (f) e.disengaged = !e.disengaged, e.userDisabled = void 0 == e.userDisabled ? !!e.disabled : e.userDisabled, e.disabled = e.disengaged || e.userDisabled; else if (!f) { e.disabled = !e.disabled, e.userDisabled = e.disabled; var r = n.filter(function(e) { return !e.disengaged }); r.every(function(e) { return e.userDisabled }) && n.forEach(function(e) { e.disabled = e.userDisabled = !1 }) } m.stateChange({ disabled: n.map(function(e) { return !!e.disabled }), disengaged: n.map(function(e) { return !!e.disengaged }) }) } }).on("dblclick", function(e, t) { if (("furious" != p || !f) && (m.legendDblclick(e, t), u)) { var n = _.data(); n.forEach(function(e) { e.disabled = !0, "furious" == p && (e.userDisabled = e.disabled) }), e.disabled = !1, "furious" == p && (e.userDisabled = e.disabled), m.stateChange({ disabled: n.map(function(e) { return !!e.disabled }) }) } }), _.classed("nv-disabled", function(e) { return e.userDisabled }), _.exit().remove(), T.attr("fill", v).text(i); var I; switch (p) { case "furious": I = 23; break; case "classic": I = 20 } if (s) { var C = []; _.each(function(e, n) { var r, o = d3.select(this).select("text"); try { if (r = o.node().getComputedTextLength(), r <= 0) throw Error() } catch (e) { r = t.utils.calcApproxTextWidth(o) } C.push(r + l) }); for (var x = 0, M = 0, D = []; M < g && x < C.length;) D[x] = C[x], M += C[x++]; for (0 === x && (x = 1); M > g && x > 1;) { D = [], x--; for (var O = 0; O < C.length; O++) C[O] > (D[O % x] || 0) && (D[O % x] = C[O]); M = D.reduce(function(e, t, n, r) { return e + t }) } for (var R = [], N = 0, L = 0; N < x; N++) R[N] = L, L += D[N]; _.attr("transform", function(e, t) { return "translate(" + R[t % x] + "," + (5 + Math.floor(t / x) * I) + ")" }), c ? b.attr("transform", "translate(" + (r - n.right - M) + "," + n.top + ")") : b.attr("transform", "translate(0," + n.top + ")"), o = n.top + n.bottom + Math.ceil(C.length / x) * I } else { var P, k = 5, G = 5, F = 0; _.attr("transform", function(e, t) { var o = d3.select(this).select("text").node().getComputedTextLength() + l; return P = G, r < n.left + n.right + P + o && (G = P = 5, k += I), G += o, G > F && (F = G), "translate(" + P + "," + k + ")" }), b.attr("transform", "translate(" + (r - n.right - F) + "," + n.top + ")"), o = n.top + n.bottom + k + 15 } "furious" == p && S.attr("width", function(e, t) { return T[0][t].getComputedTextLength() + 27 }).attr("height", 18).attr("y", -9).attr("x", -15), S.style("fill", h).style("stroke", function(e, t) { return e.color || a(e, t) }) }), e } var n = { top: 5, right: 0, bottom: 5, left: 0 }, r = 400, o = 20, i = function(e) { return e.key }, a = t.utils.getColor(), s = !0, l = 28, c = !0, u = !0, d = !1, f = !1, m = d3.dispatch("legendClick", "legendDblclick", "legendMouseover", "legendMouseout", "stateChange"), p = "classic"; return e.dispatch = m, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return r }, set: function(e) { r = e } }, height: { get: function() { return o }, set: function(e) { o = e } }, key: { get: function() { return i }, set: function(e) { i = e } }, align: { get: function() { return s }, set: function(e) { s = e } }, rightAlign: { get: function() { return c }, set: function(e) { c = e } }, padding: { get: function() { return l }, set: function(e) { l = e } }, updateState: { get: function() { return u }, set: function(e) { u = e } }, radioButtonMode: { get: function() { return d }, set: function(e) { d = e } }, expanded: { get: function() { return f }, set: function(e) { f = e } }, vers: { get: function() { return p }, set: function(e) { p = e } }, margin: { get: function() { return n }, set: function(e) { n.top = void 0 !== e.top ? e.top : n.top, n.right = void 0 !== e.right ? e.right : n.right, n.bottom = void 0 !== e.bottom ? e.bottom : n.bottom, n.left = void 0 !== e.left ? e.left : n.left } }, color: { get: function() { return a }, set: function(e) { a = t.utils.getColor(e) } } }), t.utils.initOptions(e), e }, t.models.historicalBar = function() { "use strict"; function e(w) { return w.each(function(e) { _.reset(), u = d3.select(this); var w = t.utils.availableWidth(s, u, a), A = t.utils.availableHeight(l, u, a); t.utils.initSVG(u), d.domain(n || d3.extent(e[0].values.map(m).concat(g))), h ? d.range(o || [.5 * w / e[0].values.length, w * (e[0].values.length - .5) / e[0].values.length]) : d.range(o || [0, w]), f.domain(r || d3.extent(e[0].values.map(p).concat(v))).range(i || [A, 0]), d.domain()[0] === d.domain()[1] && (d.domain()[0] ? d.domain([d.domain()[0] - .01 * d.domain()[0], d.domain()[1] + .01 * d.domain()[1]]) : d.domain([-1, 1])), f.domain()[0] === f.domain()[1] && (f.domain()[0] ? f.domain([f.domain()[0] + .01 * f.domain()[0], f.domain()[1] - .01 * f.domain()[1]]) : f.domain([-1, 1])); var T = u.selectAll("g.nv-wrap.nv-historicalBar-" + c).data([e[0].values]), I = T.enter().append("g").attr("class", "nvd3 nv-wrap nv-historicalBar-" + c), C = I.append("defs"), x = I.append("g"), M = T.select("g"); x.append("g").attr("class", "nv-bars"), T.attr("transform", "translate(" + a.left + "," + a.top + ")"), u.on("click", function(e, t) { b.chartClick({ data: e, index: t, pos: d3.event, id: c }) }), C.append("clipPath").attr("id", "nv-chart-clip-path-" + c).append("rect"), T.select("#nv-chart-clip-path-" + c + " rect").attr("width", w).attr("height", A), M.attr("clip-path", y ? "url(#nv-chart-clip-path-" + c + ")" : ""); var D = T.select(".nv-bars").selectAll(".nv-bar").data(function(e) { return e }, function(e, t) { return m(e, t) }); D.exit().remove(), D.enter().append("rect").attr("x", 0).attr("y", function(e, n) { return t.utils.NaNtoZero(f(Math.max(0, p(e, n)))) }).attr("height", function(e, n) { return t.utils.NaNtoZero(Math.abs(f(p(e, n)) - f(0))) }).attr("transform", function(t, n) { return "translate(" + (d(m(t, n)) - w / e[0].values.length * .45) + ",0)" }).on("mouseover", function(e, t) { S && (d3.select(this).classed("hover", !0), b.elementMouseover({ data: e, index: t, color: d3.select(this).style("fill") })) }).on("mouseout", function(e, t) { S && (d3.select(this).classed("hover", !1), b.elementMouseout({ data: e, index: t, color: d3.select(this).style("fill") })) }).on("mousemove", function(e, t) { S && b.elementMousemove({ data: e, index: t, color: d3.select(this).style("fill") }) }).on("click", function(e, t) { S && (b.elementClick({ data: e, index: t, color: d3.select(this).style("fill") }), d3.event.stopPropagation()) }).on("dblclick", function(e, t) { S && (b.elementDblClick({ data: e, index: t, color: d3.select(this).style("fill") }), d3.event.stopPropagation()) }), D.attr("fill", function(e, t) { return E(e, t) }).attr("class", function(e, t, n) { return (p(e, t) < 0 ? "nv-bar negative" : "nv-bar positive") + " nv-bar-" + n + "-" + t }).watchTransition(_, "bars").attr("transform", function(t, n) { return "translate(" + (d(m(t, n)) - w / e[0].values.length * .45) + ",0)" }).attr("width", w / e[0].values.length * .9), D.watchTransition(_, "bars").attr("y", function(e, n) { var r = p(e, n) < 0 ? f(0) : f(0) - f(p(e, n)) < 1 ? f(0) - 1 : f(p(e, n)); return t.utils.NaNtoZero(r) }).attr("height", function(e, n) { return t.utils.NaNtoZero(Math.max(Math.abs(f(p(e, n)) - f(0)), 1)) }) }), _.renderEnd("historicalBar immediate"), e } var n, r, o, i, a = { top: 0, right: 0, bottom: 0, left: 0 }, s = null, l = null, c = Math.floor(1e4 * Math.random()), u = null, d = d3.scale.linear(), f = d3.scale.linear(), m = function(e) { return e.x }, p = function(e) { return e.y }, g = [], v = [0], h = !1, y = !0, E = t.utils.defaultColor(), b = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"), S = !0, _ = t.utils.renderWatch(b, 0); return e.highlightPoint = function(e, t) { u.select(".nv-bars .nv-bar-0-" + e).classed("hover", t) }, e.clearHighlights = function() { u.select(".nv-bars .nv-bar.hover").classed("hover", !1) }, e.dispatch = b, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return s }, set: function(e) { s = e } }, height: { get: function() { return l }, set: function(e) { l = e } }, forceX: { get: function() { return g }, set: function(e) { g = e } }, forceY: { get: function() { return v }, set: function(e) { v = e } }, padData: { get: function() { return h }, set: function(e) { h = e } }, x: { get: function() { return m }, set: function(e) { m = e } }, y: { get: function() { return p }, set: function(e) { p = e } }, xScale: { get: function() { return d }, set: function(e) { d = e } }, yScale: { get: function() { return f }, set: function(e) { f = e } }, xDomain: { get: function() { return n }, set: function(e) { n = e } }, yDomain: { get: function() { return r }, set: function(e) { r = e } }, xRange: { get: function() { return o }, set: function(e) { o = e } }, yRange: { get: function() { return i }, set: function(e) { i = e } }, clipEdge: { get: function() { return y }, set: function(e) { y = e } }, id: { get: function() { return c }, set: function(e) { c = e } }, interactive: { get: function() { return S }, set: function(e) { S = e } }, margin: { get: function() { return a }, set: function(e) { a.top = void 0 !== e.top ? e.top : a.top, a.right = void 0 !== e.right ? e.right : a.right, a.bottom = void 0 !== e.bottom ? e.bottom : a.bottom, a.left = void 0 !== e.left ? e.left : a.left } }, color: { get: function() { return E }, set: function(e) { E = t.utils.getColor(e) } } }), t.utils.initOptions(e), e }, t.models.historicalBarChart = function(e) { "use strict"; function n(e) { return e.each(function(u) { T.reset(), T.models(i), v && T.models(a), h && T.models(s); var _ = d3.select(this), I = this; t.utils.initSVG(_); var C = t.utils.availableWidth(m, _, d), x = t.utils.availableHeight(p, _, d); if (n.update = function() { _.transition().duration(A).call(n) }, n.container = this, b.disabled = u.map(function(e) { return !!e.disabled }), !S) { var M; S = {}; for (M in b) b[M] instanceof Array ? S[M] = b[M].slice(0) : S[M] = b[M] } if (!(u && u.length && u.filter(function(e) { return e.values.length }).length)) return t.utils.noData(n, _), n; _.selectAll(".nv-noData").remove(), r = i.xScale(), o = i.yScale(); var D = _.selectAll("g.nv-wrap.nv-historicalBarChart").data([u]), O = D.enter().append("g").attr("class", "nvd3 nv-wrap nv-historicalBarChart").append("g"), R = D.select("g"); O.append("g").attr("class", "nv-x nv-axis"), O.append("g").attr("class", "nv-y nv-axis"), O.append("g").attr("class", "nv-barsWrap"), O.append("g").attr("class", "nv-legendWrap"), O.append("g").attr("class", "nv-interactive"), g && (l.width(C), R.select(".nv-legendWrap").datum(u).call(l), d.top != l.height() && (d.top = l.height(), x = t.utils.availableHeight(p, _, d)), D.select(".nv-legendWrap").attr("transform", "translate(0," + -d.top + ")")), D.attr("transform", "translate(" + d.left + "," + d.top + ")"), y && R.select(".nv-y.nv-axis").attr("transform", "translate(" + C + ",0)"), E && (c.width(C).height(x).margin({ left: d.left, top: d.top }).svgContainer(_).xScale(r), D.select(".nv-interactive").call(c)), i.width(C).height(x).color(u.map(function(e, t) { return e.color || f(e, t) }).filter(function(e, t) { return !u[t].disabled })); var N = R.select(".nv-barsWrap").datum(u.filter(function(e) { return !e.disabled })); N.transition().call(i), v && (a.scale(r)._ticks(t.utils.calcTicksX(C / 100, u)).tickSize(-x, 0), R.select(".nv-x.nv-axis").attr("transform", "translate(0," + o.range()[0] + ")"), R.select(".nv-x.nv-axis").transition().call(a)), h && (s.scale(o)._ticks(t.utils.calcTicksY(x / 36, u)).tickSize(-C, 0), R.select(".nv-y.nv-axis").transition().call(s)), c.dispatch.on("elementMousemove", function(e) { i.clearHighlights(); var r, o, l, m = []; u.filter(function(e, t) { return e.seriesIndex = t, !e.disabled }).forEach(function(a, s) { o = t.interactiveBisect(a.values, e.pointXValue, n.x()), i.highlightPoint(o, !0); var c = a.values[o]; void 0 !== c && (void 0 === r && (r = c), void 0 === l && (l = n.xScale()(n.x()(c, o))), m.push({ key: a.key, value: n.y()(c, o), color: f(a, a.seriesIndex), data: a.values[o] })) }); var p = a.tickFormat()(n.x()(r, o)); c.tooltip.position({ left: l + d.left, top: e.mouseY + d.top }).chartContainer(I.parentNode).valueFormatter(function(e, t) { return s.tickFormat()(e) }).data({ value: p, index: o, series: m })(), c.renderGuideLine(l) }), c.dispatch.on("elementMouseout", function(e) { w.tooltipHide(), i.clearHighlights() }), l.dispatch.on("legendClick", function(t, r) { t.disabled = !t.disabled, u.filter(function(e) { return !e.disabled }).length || u.map(function(e) { return e.disabled = !1, D.selectAll(".nv-series").classed("disabled", !1), e }), b.disabled = u.map(function(e) { return !!e.disabled }), w.stateChange(b), e.transition().call(n) }), l.dispatch.on("legendDblclick", function(e) { u.forEach(function(e) { e.disabled = !0 }), e.disabled = !1, b.disabled = u.map(function(e) { return !!e.disabled }), w.stateChange(b), n.update() }), w.on("changeState", function(e) { "undefined" != typeof e.disabled && (u.forEach(function(t, n) { t.disabled = e.disabled[n] }), b.disabled = e.disabled), n.update() }) }), T.renderEnd("historicalBarChart immediate"), n } var r, o, i = e || t.models.historicalBar(), a = t.models.axis(), s = t.models.axis(), l = t.models.legend(), c = t.interactiveGuideline(), u = t.models.tooltip(), d = { top: 30, right: 90, bottom: 50, left: 90 }, f = t.utils.defaultColor(), m = null, p = null, g = !1, v = !0, h = !0, y = !1, E = !1, b = {}, S = null, _ = null, w = d3.dispatch("tooltipHide", "stateChange", "changeState", "renderEnd"), A = 250; a.orient("bottom").tickPadding(7), s.orient(y ? "right" : "left"), u.duration(0).headerEnabled(!1).valueFormatter(function(e, t) { return s.tickFormat()(e, t) }).headerFormatter(function(e, t) { return a.tickFormat()(e, t) }); var T = t.utils.renderWatch(w, 0); return i.dispatch.on("elementMouseover.tooltip", function(e) { e.series = { key: n.x()(e.data), value: n.y()(e.data), color: e.color }, u.data(e).hidden(!1) }), i.dispatch.on("elementMouseout.tooltip", function(e) { u.hidden(!0) }), i.dispatch.on("elementMousemove.tooltip", function(e) { u.position({ top: d3.event.pageY, left: d3.event.pageX })() }), n.dispatch = w, n.bars = i, n.legend = l, n.xAxis = a, n.yAxis = s, n.interactiveLayer = c, n.tooltip = u, n.options = t.utils.optionsFunc.bind(n), n._options = Object.create({}, { width: { get: function() { return m }, set: function(e) { m = e } }, height: { get: function() { return p }, set: function(e) { p = e } }, showLegend: { get: function() { return g }, set: function(e) { g = e } }, showXAxis: { get: function() { return v }, set: function(e) { v = e } }, showYAxis: { get: function() { return h }, set: function(e) { h = e } }, defaultState: { get: function() { return S }, set: function(e) { S = e } }, noData: { get: function() { return _ }, set: function(e) { _ = e } }, tooltips: { get: function() { return u.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), u.enabled(!!e) } }, tooltipContent: { get: function() { return u.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), u.contentGenerator(e) } }, margin: { get: function() { return d }, set: function(e) { d.top = void 0 !== e.top ? e.top : d.top, d.right = void 0 !== e.right ? e.right : d.right, d.bottom = void 0 !== e.bottom ? e.bottom : d.bottom, d.left = void 0 !== e.left ? e.left : d.left } }, color: { get: function() { return f }, set: function(e) { f = t.utils.getColor(e), l.color(f), i.color(f) } }, duration: { get: function() { return A }, set: function(e) { A = e, T.reset(A), s.duration(A), a.duration(A) } }, rightAlignYAxis: { get: function() { return y }, set: function(e) { y = e, s.orient(e ? "right" : "left") } }, useInteractiveGuideline: { get: function() { return E }, set: function(e) { E = e, e === !0 && n.interactive(!1) } } }), t.utils.inheritOptions(n, i), t.utils.initOptions(n), n }, t.models.ohlcBarChart = function() { var e = t.models.historicalBarChart(t.models.ohlcBar()); return e.useInteractiveGuideline(!0), e.interactiveLayer.tooltip.contentGenerator(function(t) { var n = t.series[0].data, r = n.open < n.close ? "2ca02c" : "d62728"; return '

' + t.value + "

open:" + e.yAxis.tickFormat()(n.open) + "
close:" + e.yAxis.tickFormat()(n.close) + "
high" + e.yAxis.tickFormat()(n.high) + "
low:" + e.yAxis.tickFormat()(n.low) + "
" }), e }, t.models.candlestickBarChart = function() { var e = t.models.historicalBarChart(t.models.candlestickBar()); return e.useInteractiveGuideline(!0), e.interactiveLayer.tooltip.contentGenerator(function(t) { var n = t.series[0].data, r = n.open < n.close ? "2ca02c" : "d62728"; return '

' + t.value + "

open:" + e.yAxis.tickFormat()(n.open) + "
close:" + e.yAxis.tickFormat()(n.close) + "
high" + e.yAxis.tickFormat()(n.high) + "
low:" + e.yAxis.tickFormat()(n.low) + "
" }), e }, t.models.legend = function() { "use strict"; function e(g) { function v(e, t) { return "furious" != p ? "#000" : f ? e.disengaged ? "#000" : "#fff" : f ? void 0 : (e.color || (e.color = a(e, t)), e.disabled ? e.color : "#fff") } function h(e, t) { return f && "furious" == p && e.disengaged ? "#eee" : e.color || a(e, t) } function y(e, t) { return f && "furious" == p ? 1 : e.disabled ? 0 : 1 } return g.each(function(e) { var a = r - n.left - n.right, g = d3.select(this); t.utils.initSVG(g); var E = g.selectAll("g.nv-legend").data([e]), b = E.enter().append("g").attr("class", "nvd3 nv-legend").append("g"), S = E.select("g"); E.attr("transform", "translate(" + n.left + "," + n.top + ")"); var _, w, A = S.selectAll(".nv-series").data(function(e) { return "furious" != p ? e : e.filter(function(e) { return !!f || !e.disengaged }) }), T = A.enter().append("g").attr("class", "nv-series"); switch (p) { case "furious": w = 23; break; case "classic": w = 20 } if ("classic" == p) T.append("circle").style("stroke-width", 2).attr("class", "nv-legend-symbol").attr("r", 5), _ = A.select("circle"); else if ("furious" == p) { T.append("rect").style("stroke-width", 2).attr("class", "nv-legend-symbol").attr("rx", 3).attr("ry", 3), _ = A.select(".nv-legend-symbol"), T.append("g").attr("class", "nv-check-box").property("innerHTML", '').attr("transform", "translate(-10,-8)scale(0.5)"); var I = A.select(".nv-check-box"); I.each(function(e, t) { d3.select(this).selectAll("path").attr("stroke", v(e, t)) }) } T.append("text").attr("text-anchor", "start").attr("class", "nv-legend-text").attr("dy", ".32em").attr("dx", "8"); var C = A.select("text.nv-legend-text"); A.on("mouseover", function(e, t) { m.legendMouseover(e, t) }).on("mouseout", function(e, t) { m.legendMouseout(e, t) }).on("click", function(e, t) { m.legendClick(e, t); var n = A.data(); if (u) { if ("classic" == p) d ? (n.forEach(function(e) { e.disabled = !0 }), e.disabled = !1) : (e.disabled = !e.disabled, n.every(function(e) { return e.disabled }) && n.forEach(function(e) { e.disabled = !1 })); else if ("furious" == p) if (f) e.disengaged = !e.disengaged, e.userDisabled = void 0 == e.userDisabled ? !!e.disabled : e.userDisabled, e.disabled = e.disengaged || e.userDisabled; else if (!f) { e.disabled = !e.disabled, e.userDisabled = e.disabled; var r = n.filter(function(e) { return !e.disengaged }); r.every(function(e) { return e.userDisabled }) && n.forEach(function(e) { e.disabled = e.userDisabled = !1 }) } m.stateChange({ disabled: n.map(function(e) { return !!e.disabled }), disengaged: n.map(function(e) { return !!e.disengaged }) }) } }).on("dblclick", function(e, t) { if (("furious" != p || !f) && (m.legendDblclick(e, t), u)) { var n = A.data(); n.forEach(function(e) { e.disabled = !0, "furious" == p && (e.userDisabled = e.disabled) }), e.disabled = !1, "furious" == p && (e.userDisabled = e.disabled), m.stateChange({ disabled: n.map(function(e) { return !!e.disabled }) }) } }), A.classed("nv-disabled", function(e) { return e.userDisabled }), A.exit().remove(), C.attr("fill", v).text(i); var x = 0; if (s) { var M = []; A.each(function(e, n) { var r, o = d3.select(this).select("text"); try { if (r = o.node().getComputedTextLength(), r <= 0) throw Error() } catch (e) { r = t.utils.calcApproxTextWidth(o) } M.push(r + l) }); var D = 0, O = []; for (x = 0; x < a && D < M.length;) O[D] = M[D], x += M[D++]; for (0 === D && (D = 1); x > a && D > 1;) { O = [], D--; for (var R = 0; R < M.length; R++) M[R] > (O[R % D] || 0) && (O[R % D] = M[R]); x = O.reduce(function(e, t, n, r) { return e + t }) } for (var N = [], L = 0, P = 0; L < D; L++) N[L] = P, P += O[L]; A.attr("transform", function(e, t) { return "translate(" + N[t % D] + "," + (5 + Math.floor(t / D) * w) + ")" }), c ? S.attr("transform", "translate(" + (r - n.right - x) + "," + n.top + ")") : S.attr("transform", "translate(0," + n.top + ")"), o = n.top + n.bottom + Math.ceil(M.length / D) * w } else { var k, G = 5, F = 5, U = 0; A.attr("transform", function(e, t) { var o = d3.select(this).select("text").node().getComputedTextLength() + l; return k = F, r < n.left + n.right + k + o && (F = k = 5, G += w), F += o, F > U && (U = F), x < k + U && (x = k + U), "translate(" + k + "," + G + ")" }), S.attr("transform", "translate(" + (r - n.right - U) + "," + n.top + ")"), o = n.top + n.bottom + G + 15 } if ("furious" == p) { _.attr("width", function(e, t) { return C[0][t].getComputedTextLength() + 27 }).attr("height", 18).attr("y", -9).attr("x", -15), b.insert("rect", ":first-child").attr("class", "nv-legend-bg").attr("fill", "#eee").attr("opacity", 0); var V = S.select(".nv-legend-bg"); V.transition().duration(300).attr("x", -w).attr("width", x + w - 12).attr("height", o + 10).attr("y", -n.top - 10).attr("opacity", f ? 1 : 0) } _.style("fill", h).style("fill-opacity", y).style("stroke", h) }), e } var n = { top: 5, right: 0, bottom: 5, left: 0 }, r = 400, o = 20, i = function(e) { return e.key }, a = t.utils.getColor(), s = !0, l = 32, c = !0, u = !0, d = !1, f = !1, m = d3.dispatch("legendClick", "legendDblclick", "legendMouseover", "legendMouseout", "stateChange"), p = "classic"; return e.dispatch = m, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return r }, set: function(e) { r = e } }, height: { get: function() { return o }, set: function(e) { o = e } }, key: { get: function() { return i }, set: function(e) { i = e } }, align: { get: function() { return s }, set: function(e) { s = e } }, rightAlign: { get: function() { return c }, set: function(e) { c = e } }, padding: { get: function() { return l }, set: function(e) { l = e } }, updateState: { get: function() { return u }, set: function(e) { u = e } }, radioButtonMode: { get: function() { return d }, set: function(e) { d = e } }, expanded: { get: function() { return f }, set: function(e) { f = e } }, vers: { get: function() { return p }, set: function(e) { p = e } }, margin: { get: function() { return n }, set: function(e) { n.top = void 0 !== e.top ? e.top : n.top, n.right = void 0 !== e.right ? e.right : n.right, n.bottom = void 0 !== e.bottom ? e.bottom : n.bottom, n.left = void 0 !== e.left ? e.left : n.left } }, color: { get: function() { return a }, set: function(e) { a = t.utils.getColor(e) } } }), t.utils.initOptions(e), e }, t.models.line = function() { "use strict"; function e(h) { return S.reset(), S.models(o), h.each(function(e) { l = d3.select(this); var h = t.utils.availableWidth(a, l, i), y = t.utils.availableHeight(s, l, i); t.utils.initSVG(l), n = o.xScale(), r = o.yScale(), E = E || n, b = b || r; var _ = l.selectAll("g.nv-wrap.nv-line").data([e]), w = _.enter().append("g").attr("class", "nvd3 nv-wrap nv-line"), A = w.append("defs"), T = w.append("g"), I = _.select("g"); T.append("g").attr("class", "nv-groups"), T.append("g").attr("class", "nv-scatterWrap"), _.attr("transform", "translate(" + i.left + "," + i.top + ")"), o.width(h).height(y); var C = _.select(".nv-scatterWrap"); C.call(o), A.append("clipPath").attr("id", "nv-edge-clip-" + o.id()).append("rect"), _.select("#nv-edge-clip-" + o.id() + " rect").attr("width", h).attr("height", y > 0 ? y : 0), I.attr("clip-path", g ? "url(#nv-edge-clip-" + o.id() + ")" : ""), C.attr("clip-path", g ? "url(#nv-edge-clip-" + o.id() + ")" : ""); var x = _.select(".nv-groups").selectAll(".nv-group").data(function(e) { return e }, function(e) { return e.key }); x.enter().append("g").style("stroke-opacity", 1e-6).style("stroke-width", function(e) { return e.strokeWidth || c }).style("fill-opacity", 1e-6), x.exit().remove(), x.attr("class", function(e, t) { return (e.classed || "") + " nv-group nv-series-" + t }).classed("hover", function(e) { return e.hover }).style("fill", function(e, t) { return u(e, t) }).style("stroke", function(e, t) { return u(e, t) }), x.watchTransition(S, "line: groups").style("stroke-opacity", 1).style("fill-opacity", function(e) { return e.fillOpacity || .5 }); var M = x.selectAll("path.nv-area").data(function(e) { return p(e) ? [e] : [] }); M.enter().append("path").attr("class", "nv-area").attr("d", function(e) { return d3.svg.area().interpolate(v).defined(m).x(function(e, n) { return t.utils.NaNtoZero(E(d(e, n))) }).y0(function(e, n) { return t.utils.NaNtoZero(b(f(e, n))) }).y1(function(e, t) { return b(r.domain()[0] <= 0 ? r.domain()[1] >= 0 ? 0 : r.domain()[1] : r.domain()[0]) }).apply(this, [e.values]) }), x.exit().selectAll("path.nv-area").remove(), M.watchTransition(S, "line: areaPaths").attr("d", function(e) { return d3.svg.area().interpolate(v).defined(m).x(function(e, r) { return t.utils.NaNtoZero(n(d(e, r))) }).y0(function(e, n) { return t.utils.NaNtoZero(r(f(e, n))) }).y1(function(e, t) { return r(r.domain()[0] <= 0 ? r.domain()[1] >= 0 ? 0 : r.domain()[1] : r.domain()[0]) }).apply(this, [e.values]) }); var D = x.selectAll("path.nv-line").data(function(e) { return [e.values] }); D.enter().append("path").attr("class", "nv-line").attr("d", d3.svg.line().interpolate(v).defined(m).x(function(e, n) { return t.utils.NaNtoZero(E(d(e, n))) }).y(function(e, n) { return t.utils.NaNtoZero(b(f(e, n))) })), D.watchTransition(S, "line: linePaths").attr("d", d3.svg.line().interpolate(v).defined(m).x(function(e, r) { return t.utils.NaNtoZero(n(d(e, r))) }).y(function(e, n) { return t.utils.NaNtoZero(r(f(e, n))) })), E = n.copy(), b = r.copy() }), S.renderEnd("line immediate"), e } var n, r, o = t.models.scatter(), i = { top: 0, right: 0, bottom: 0, left: 0 }, a = 960, s = 500, l = null, c = 1.5, u = t.utils.defaultColor(), d = function(e) { return e.x }, f = function(e) { return e.y }, m = function(e, t) { return !isNaN(f(e, t)) && null !== f(e, t) }, p = function(e) { return e.area }, g = !1, v = "linear", h = 250, y = d3.dispatch("elementClick", "elementMouseover", "elementMouseout", "renderEnd"); o.pointSize(16).pointDomain([16, 256]); var E, b, S = t.utils.renderWatch(y, h); return e.dispatch = y, e.scatter = o, o.dispatch.on("elementClick", function() { y.elementClick.apply(this, arguments) }), o.dispatch.on("elementMouseover", function() { y.elementMouseover.apply(this, arguments) }), o.dispatch.on("elementMouseout", function() { y.elementMouseout.apply(this, arguments) }), e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return a }, set: function(e) { a = e } }, height: { get: function() { return s }, set: function(e) { s = e } }, defined: { get: function() { return m }, set: function(e) { m = e } }, interpolate: { get: function() { return v }, set: function(e) { v = e } }, clipEdge: { get: function() { return g }, set: function(e) { g = e } }, margin: { get: function() { return i }, set: function(e) { i.top = void 0 !== e.top ? e.top : i.top, i.right = void 0 !== e.right ? e.right : i.right, i.bottom = void 0 !== e.bottom ? e.bottom : i.bottom, i.left = void 0 !== e.left ? e.left : i.left } }, duration: { get: function() { return h }, set: function(e) { h = e, S.reset(h), o.duration(h) } }, isArea: { get: function() { return p }, set: function(e) { p = d3.functor(e) } }, x: { get: function() { return d }, set: function(e) { d = e, o.x(e) } }, y: { get: function() { return f }, set: function(e) { f = e, o.y(e) } }, color: { get: function() { return u }, set: function(e) { u = t.utils.getColor(e), o.color(u) } } }), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e }, t.models.lineChart = function() { "use strict"; function e(c) { return A.reset(), A.models(o), g && A.models(i), v && A.models(a), c.each(function(c) { var S = d3.select(this), A = this; t.utils.initSVG(S); var C = t.utils.availableWidth(f, S, u), x = t.utils.availableHeight(m, S, u); if (e.update = function() { 0 === w ? S.call(e) : S.transition().duration(w).call(e) }, e.container = this, E.setter(I(c), e.update).getter(T(c)).update(), E.disabled = c.map(function(e) { return !!e.disabled }), !b) { var M; b = {}; for (M in E) E[M] instanceof Array ? b[M] = E[M].slice(0) : b[M] = E[M] } if (!(c && c.length && c.filter(function(e) { return e.values.length }).length)) return t.utils.noData(e, S), e; S.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale(); var D = S.selectAll("g.nv-wrap.nv-lineChart").data([c]), O = D.enter().append("g").attr("class", "nvd3 nv-wrap nv-lineChart").append("g"), R = D.select("g"); O.append("rect").style("opacity", 0), O.append("g").attr("class", "nv-x nv-axis"), O.append("g").attr("class", "nv-y nv-axis"), O.append("g").attr("class", "nv-linesWrap"), O.append("g").attr("class", "nv-legendWrap"), O.append("g").attr("class", "nv-interactive"), R.select("rect").attr("width", C).attr("height", x > 0 ? x : 0), p && (s.width(C), R.select(".nv-legendWrap").datum(c).call(s), u.top != s.height() && (u.top = s.height(), x = t.utils.availableHeight(m, S, u)), D.select(".nv-legendWrap").attr("transform", "translate(0," + -u.top + ")")), D.attr("transform", "translate(" + u.left + "," + u.top + ")"), h && R.select(".nv-y.nv-axis").attr("transform", "translate(" + C + ",0)"), y && (l.width(C).height(x).margin({ left: u.left, top: u.top }).svgContainer(S).xScale(n), D.select(".nv-interactive").call(l)), o.width(C).height(x).color(c.map(function(e, t) { return e.color || d(e, t) }).filter(function(e, t) { return !c[t].disabled })); var N = R.select(".nv-linesWrap").datum(c.filter(function(e) { return !e.disabled })); N.call(o), g && (i.scale(n)._ticks(t.utils.calcTicksX(C / 100, c)).tickSize(-x, 0), R.select(".nv-x.nv-axis").attr("transform", "translate(0," + r.range()[0] + ")"), R.select(".nv-x.nv-axis").call(i)), v && (a.scale(r)._ticks(t.utils.calcTicksY(x / 36, c)).tickSize(-C, 0), R.select(".nv-y.nv-axis").call(a)), s.dispatch.on("stateChange", function(t) { for (var n in t) E[n] = t[n]; _.stateChange(E), e.update() }), l.dispatch.on("elementMousemove", function(n) { o.clearHighlights(); var r, s, f, m = []; if (c.filter(function(e, t) { return e.seriesIndex = t, !e.disabled }).forEach(function(i, a) { s = t.interactiveBisect(i.values, n.pointXValue, e.x()); var l = i.values[s], c = e.y()(l, s); null != c && o.highlightPoint(a, s, !0), void 0 !== l && (void 0 === r && (r = l), void 0 === f && (f = e.xScale()(e.x()(l, s))), m.push({ key: i.key, value: c, color: d(i, i.seriesIndex) })) }), m.length > 2) { var p = e.yScale().invert(n.mouseY), g = Math.abs(e.yScale().domain()[0] - e.yScale().domain()[1]), v = .03 * g, h = t.nearestValueIndex(m.map(function(e) { return e.value }), p, v); null !== h && (m[h].highlight = !0) } var y = i.tickFormat()(e.x()(r, s)); l.tooltip.position({ left: n.mouseX + u.left, top: n.mouseY + u.top }).chartContainer(A.parentNode).valueFormatter(function(e, t) { return null == e ? "N/A" : a.tickFormat()(e) }).data({ value: y, index: s, series: m })(), l.renderGuideLine(f) }), l.dispatch.on("elementClick", function(n) { var r, i = []; c.filter(function(e, t) { return e.seriesIndex = t, !e.disabled }).forEach(function(o) { var a = t.interactiveBisect(o.values, n.pointXValue, e.x()), s = o.values[a]; if ("undefined" != typeof s) { "undefined" == typeof r && (r = e.xScale()(e.x()(s, a))); var l = e.yScale()(e.y()(s, a)); i.push({ point: s, pointIndex: a, pos: [r, l], seriesIndex: o.seriesIndex, series: o }) } }), o.dispatch.elementClick(i) }), l.dispatch.on("elementMouseout", function(e) { o.clearHighlights() }), _.on("changeState", function(t) { "undefined" != typeof t.disabled && c.length === t.disabled.length && (c.forEach(function(e, n) { e.disabled = t.disabled[n] }), E.disabled = t.disabled), e.update() }) }), A.renderEnd("lineChart immediate"), e } var n, r, o = t.models.line(), i = t.models.axis(), a = t.models.axis(), s = t.models.legend(), l = t.interactiveGuideline(), c = t.models.tooltip(), u = { top: 30, right: 20, bottom: 50, left: 60 }, d = t.utils.defaultColor(), f = null, m = null, p = !0, g = !0, v = !0, h = !1, y = !1, E = t.utils.state(), b = null, S = null, _ = d3.dispatch("tooltipShow", "tooltipHide", "stateChange", "changeState", "renderEnd"), w = 250; i.orient("bottom").tickPadding(7), a.orient(h ? "right" : "left"), c.valueFormatter(function(e, t) { return a.tickFormat()(e, t) }).headerFormatter(function(e, t) { return i.tickFormat()(e, t) }); var A = t.utils.renderWatch(_, w), T = function(e) { return function() { return { active: e.map(function(e) { return !e.disabled }) } } }, I = function(e) { return function(t) { void 0 !== t.active && e.forEach(function(e, n) { e.disabled = !t.active[n] }) } }; return o.dispatch.on("elementMouseover.tooltip", function(e) { c.data(e).position(e.pos).hidden(!1) }), o.dispatch.on("elementMouseout.tooltip", function(e) { c.hidden(!0) }), e.dispatch = _, e.lines = o, e.legend = s, e.xAxis = i, e.yAxis = a, e.interactiveLayer = l, e.tooltip = c, e.dispatch = _, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return f }, set: function(e) { f = e } }, height: { get: function() { return m }, set: function(e) { m = e } }, showLegend: { get: function() { return p }, set: function(e) { p = e } }, showXAxis: { get: function() { return g }, set: function(e) { g = e } }, showYAxis: { get: function() { return v }, set: function(e) { v = e } }, defaultState: { get: function() { return b }, set: function(e) { b = e } }, noData: { get: function() { return S }, set: function(e) { S = e } }, tooltips: { get: function() { return c.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), c.enabled(!!e) } }, tooltipContent: { get: function() { return c.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), c.contentGenerator(e) } }, margin: { get: function() { return u }, set: function(e) { u.top = void 0 !== e.top ? e.top : u.top, u.right = void 0 !== e.right ? e.right : u.right, u.bottom = void 0 !== e.bottom ? e.bottom : u.bottom, u.left = void 0 !== e.left ? e.left : u.left } }, duration: { get: function() { return w }, set: function(e) { w = e, A.reset(w), o.duration(w), i.duration(w), a.duration(w) } }, color: { get: function() { return d }, set: function(e) { d = t.utils.getColor(e), s.color(d), o.color(d) } }, rightAlignYAxis: { get: function() { return h }, set: function(e) { h = e, a.orient(h ? "right" : "left") } }, useInteractiveGuideline: { get: function() { return y }, set: function(e) { y = e, y && (o.interactive(!1), o.useVoronoi(!1)) } } }), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e }, t.models.linePlusBarChart = function() { "use strict"; function e(S) { return S.each(function(S) { function P(e) { var t = +("e" == e), n = t ? 1 : -1, r = K / 3; return "M" + .5 * n + "," + r + "A6,6 0 0 " + t + " " + 6.5 * n + "," + (r + 6) + "V" + (2 * r - 6) + "A6,6 0 0 " + t + " " + .5 * n + "," + 2 * r + "ZM" + 2.5 * n + "," + (r + 8) + "V" + (2 * r - 8) + "M" + 4.5 * n + "," + (r + 8) + "V" + (2 * r - 8) } function W() { b.empty() || b.extent(L), ue.data([b.empty() ? o.domain() : L]).each(function(e, t) { var n = o(e[0]) - o.range()[0], r = o.range()[1] - o(e[1]); d3.select(this).select(".left").attr("width", n < 0 ? 0 : n), d3.select(this).select(".right").attr("x", o(e[1])).attr("width", r < 0 ? 0 : r) }) } function H() { L = b.empty() ? null : b.extent(), n = b.empty() ? o.domain() : b.extent(), k.brush({ extent: n, brush: b }), W(), d.width(Y).height(q).color(S.map(function(e, t) { return e.color || x(e, t) }).filter(function(e, t) { return !S[t].disabled && S[t].bar })), c.width(Y).height(q).color(S.map(function(e, t) { return e.color || x(e, t) }).filter(function(e, t) { return !S[t].disabled && !S[t].bar })); var e = re.select(".nv-focus .nv-barsWrap").datum(Z.length ? Z.map(function(e, t) { return { key: e.key, values: e.values.filter(function(e, t) { return d.x()(e, t) >= n[0] && d.x()(e, t) <= n[1] }) } }) : [{ values: [] }]), s = re.select(".nv-focus .nv-linesWrap").datum(X[0].disabled ? [{ values: [] }] : X.map(function(e, t) { return { area: e.area, fillOpacity: e.fillOpacity, key: e.key, values: e.values.filter(function(e, t) { return c.x()(e, t) >= n[0] && c.x()(e, t) <= n[1] }) } })); r = Z.length ? d.xScale() : c.xScale(), m.scale(r)._ticks(t.utils.calcTicksX(Y / 100, S)).tickSize(-q, 0), m.domain([Math.ceil(n[0]), Math.floor(n[1])]), re.select(".nv-x.nv-axis").transition().duration(G).call(m), e.transition().duration(G).call(d), s.transition().duration(G).call(c), re.select(".nv-focus .nv-x.nv-axis").attr("transform", "translate(0," + i.range()[0] + ")"), g.scale(i)._ticks(t.utils.calcTicksY(q / 36, S)).tickSize(-Y, 0), v.scale(a)._ticks(t.utils.calcTicksY(q / 36, S)).tickSize(Z.length ? 0 : -Y, 0), re.select(".nv-focus .nv-y1.nv-axis").style("opacity", Z.length ? 1 : 0), re.select(".nv-focus .nv-y2.nv-axis").style("opacity", X.length && !X[0].disabled ? 1 : 0).attr("transform", "translate(" + r.range()[1] + ",0)"), re.select(".nv-focus .nv-y1.nv-axis").transition().duration(G).call(g), re.select(".nv-focus .nv-y2.nv-axis").transition().duration(G).call(v) } var j = d3.select(this); t.utils.initSVG(j); var Y = t.utils.availableWidth(A, j, _), q = t.utils.availableHeight(T, j, _) - (D ? N : 0), K = N - w.top - w.bottom; if (e.update = function() { j.transition().duration(G).call(e) }, e.container = this, F.setter($(S), e.update).getter(B(S)).update(), F.disabled = S.map(function(e) { return !!e.disabled }), !U) { var Q; U = {}; for (Q in F) F[Q] instanceof Array ? U[Q] = F[Q].slice(0) : U[Q] = F[Q] } if (!(S && S.length && S.filter(function(e) { return e.values.length }).length)) return t.utils.noData(e, j), e; j.selectAll(".nv-noData").remove(); var Z = S.filter(function(e) { return !e.disabled && e.bar }), X = S.filter(function(e) { return !e.bar }); r = d.xScale(), o = p.scale(), i = d.yScale(), a = c.yScale(), s = f.yScale(), l = u.yScale(); var J = S.filter(function(e) { return !e.disabled && e.bar }).map(function(e) { return e.values.map(function(e, t) { return { x: I(e, t), y: C(e, t) } }) }), ee = S.filter(function(e) { return !e.disabled && !e.bar }).map(function(e) { return e.values.map(function(e, t) { return { x: I(e, t), y: C(e, t) } }) }); r.range([0, Y]), o.domain(d3.extent(d3.merge(J.concat(ee)), function(e) { return e.x })).range([0, Y]); var te = j.selectAll("g.nv-wrap.nv-linePlusBar").data([S]), ne = te.enter().append("g").attr("class", "nvd3 nv-wrap nv-linePlusBar").append("g"), re = te.select("g"); ne.append("g").attr("class", "nv-legendWrap"); var oe = ne.append("g").attr("class", "nv-focus"); oe.append("g").attr("class", "nv-x nv-axis"), oe.append("g").attr("class", "nv-y1 nv-axis"), oe.append("g").attr("class", "nv-y2 nv-axis"), oe.append("g").attr("class", "nv-barsWrap"), oe.append("g").attr("class", "nv-linesWrap"); var ie = ne.append("g").attr("class", "nv-context"); if (ie.append("g").attr("class", "nv-x nv-axis"), ie.append("g").attr("class", "nv-y1 nv-axis"), ie.append("g").attr("class", "nv-y2 nv-axis"), ie.append("g").attr("class", "nv-barsWrap"), ie.append("g").attr("class", "nv-linesWrap"), ie.append("g").attr("class", "nv-brushBackground"), ie.append("g").attr("class", "nv-x nv-brush"), M) { var ae = E.align() ? Y / 2 : Y, se = E.align() ? ae : 0; E.width(ae), re.select(".nv-legendWrap").datum(S.map(function(e) { return e.originalKey = void 0 === e.originalKey ? e.key : e.originalKey, e.key = e.originalKey + (e.bar ? V : z), e })).call(E), _.top != E.height() && (_.top = E.height(), q = t.utils.availableHeight(T, j, _) - N), re.select(".nv-legendWrap").attr("transform", "translate(" + se + "," + -_.top + ")") } te.attr("transform", "translate(" + _.left + "," + _.top + ")"), re.select(".nv-context").style("display", D ? "initial" : "none"), f.width(Y).height(K).color(S.map(function(e, t) { return e.color || x(e, t) }).filter(function(e, t) { return !S[t].disabled && S[t].bar })), u.width(Y).height(K).color(S.map(function(e, t) { return e.color || x(e, t) }).filter(function(e, t) { return !S[t].disabled && !S[t].bar })); var le = re.select(".nv-context .nv-barsWrap").datum(Z.length ? Z : [{ values: [] }]), ce = re.select(".nv-context .nv-linesWrap").datum(X[0].disabled ? [{ values: [] }] : X); re.select(".nv-context").attr("transform", "translate(0," + (q + _.bottom + w.top) + ")"), le.transition().call(f), ce.transition().call(u), R && (p._ticks(t.utils.calcTicksX(Y / 100, S)).tickSize(-K, 0), re.select(".nv-context .nv-x.nv-axis").attr("transform", "translate(0," + s.range()[0] + ")"), re.select(".nv-context .nv-x.nv-axis").transition().call(p)), O && (h.scale(s)._ticks(K / 36).tickSize(-Y, 0), y.scale(l)._ticks(K / 36).tickSize(Z.length ? 0 : -Y, 0), re.select(".nv-context .nv-y3.nv-axis").style("opacity", Z.length ? 1 : 0).attr("transform", "translate(0," + o.range()[0] + ")"), re.select(".nv-context .nv-y2.nv-axis").style("opacity", X.length ? 1 : 0).attr("transform", "translate(" + o.range()[1] + ",0)"), re.select(".nv-context .nv-y1.nv-axis").transition().call(h), re.select(".nv-context .nv-y2.nv-axis").transition().call(y)), b.x(o).on("brush", H), L && b.extent(L); var ue = re.select(".nv-brushBackground").selectAll("g").data([L || b.extent()]), de = ue.enter().append("g"); de.append("rect").attr("class", "left").attr("x", 0).attr("y", 0).attr("height", K), de.append("rect").attr("class", "right").attr("x", 0).attr("y", 0).attr("height", K); var fe = re.select(".nv-x.nv-brush").call(b); fe.selectAll("rect").attr("height", K), fe.selectAll(".resize").append("path").attr("d", P), E.dispatch.on("stateChange", function(t) { for (var n in t) F[n] = t[n]; k.stateChange(F), e.update() }), k.on("changeState", function(t) { "undefined" != typeof t.disabled && (S.forEach(function(e, n) { e.disabled = t.disabled[n] }), F.disabled = t.disabled), e.update() }), H() }), e } var n, r, o, i, a, s, l, c = t.models.line(), u = t.models.line(), d = t.models.historicalBar(), f = t.models.historicalBar(), m = t.models.axis(), p = t.models.axis(), g = t.models.axis(), v = t.models.axis(), h = t.models.axis(), y = t.models.axis(), E = t.models.legend(), b = d3.svg.brush(), S = t.models.tooltip(), _ = { top: 30, right: 30, bottom: 30, left: 60 }, w = { top: 0, right: 30, bottom: 20, left: 60 }, A = null, T = null, I = function(e) { return e.x }, C = function(e) { return e.y }, x = t.utils.defaultColor(), M = !0, D = !0, O = !1, R = !0, N = 50, L = null, P = null, k = d3.dispatch("brush", "stateChange", "changeState"), G = 0, F = t.utils.state(), U = null, V = " (left axis)", z = " (right axis)"; c.clipEdge(!0), u.interactive(!1), m.orient("bottom").tickPadding(5), g.orient("left"), v.orient("right"), p.orient("bottom").tickPadding(5), h.orient("left"), y.orient("right"), S.headerEnabled(!0).headerFormatter(function(e, t) { return m.tickFormat()(e, t) }); var B = function(e) { return function() { return { active: e.map(function(e) { return !e.disabled }) } } }, $ = function(e) { return function(t) { void 0 !== t.active && e.forEach(function(e, n) { e.disabled = !t.active[n] }) } }; return c.dispatch.on("elementMouseover.tooltip", function(e) { S.duration(100).valueFormatter(function(e, t) { return v.tickFormat()(e, t) }).data(e).position(e.pos).hidden(!1) }), c.dispatch.on("elementMouseout.tooltip", function(e) { S.hidden(!0) }), d.dispatch.on("elementMouseover.tooltip", function(t) { t.value = e.x()(t.data), t.series = { value: e.y()(t.data), color: t.color }, S.duration(0).valueFormatter(function(e, t) { return g.tickFormat()(e, t) }).data(t).hidden(!1) }), d.dispatch.on("elementMouseout.tooltip", function(e) { S.hidden(!0) }), d.dispatch.on("elementMousemove.tooltip", function(e) { S.position({ top: d3.event.pageY, left: d3.event.pageX })() }), e.dispatch = k, e.legend = E, e.lines = c, e.lines2 = u, e.bars = d, e.bars2 = f, e.xAxis = m, e.x2Axis = p, e.y1Axis = g, e.y2Axis = v, e.y3Axis = h, e.y4Axis = y, e.tooltip = S, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return A }, set: function(e) { A = e } }, height: { get: function() { return T }, set: function(e) { T = e } }, showLegend: { get: function() { return M }, set: function(e) { M = e } }, brushExtent: { get: function() { return L }, set: function(e) { L = e } }, noData: { get: function() { return P }, set: function(e) { P = e } }, focusEnable: { get: function() { return D }, set: function(e) { D = e } }, focusHeight: { get: function() { return N }, set: function(e) { N = e } }, focusShowAxisX: { get: function() { return R }, set: function(e) { R = e } }, focusShowAxisY: { get: function() { return O }, set: function(e) { O = e } }, legendLeftAxisHint: { get: function() { return V }, set: function(e) { V = e } }, legendRightAxisHint: { get: function() { return z }, set: function(e) { z = e } }, tooltips: { get: function() { return S.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), S.enabled(!!e) } }, tooltipContent: { get: function() { return S.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), S.contentGenerator(e) } }, margin: { get: function() { return _ }, set: function(e) { _.top = void 0 !== e.top ? e.top : _.top, _.right = void 0 !== e.right ? e.right : _.right, _.bottom = void 0 !== e.bottom ? e.bottom : _.bottom, _.left = void 0 !== e.left ? e.left : _.left } }, duration: { get: function() { return G }, set: function(e) { G = e } }, color: { get: function() { return x }, set: function(e) { x = t.utils.getColor(e), E.color(x) } }, x: { get: function() { return I }, set: function(e) { I = e, c.x(e), u.x(e), d.x(e), f.x(e) } }, y: { get: function() { return C }, set: function(e) { C = e, c.y(e), u.y(e), d.y(e), f.y(e) } } }), t.utils.inheritOptions(e, c), t.utils.initOptions(e), e }, t.models.lineWithFocusChart = function() { "use strict"; function e(p) { return p.each(function(p) { function T(e) { var t = +("e" == e), n = t ? 1 : -1, r = F / 3; return "M" + .5 * n + "," + r + "A6,6 0 0 " + t + " " + 6.5 * n + "," + (r + 6) + "V" + (2 * r - 6) + "A6,6 0 0 " + t + " " + .5 * n + "," + 2 * r + "ZM" + 2.5 * n + "," + (r + 8) + "V" + (2 * r - 8) + "M" + 4.5 * n + "," + (r + 8) + "V" + (2 * r - 8) } function R() { m.empty() || m.extent(A), j.data([m.empty() ? o.domain() : A]).each(function(e, t) { var r = o(e[0]) - n.range()[0], i = k - o(e[1]); d3.select(this).select(".left").attr("width", r < 0 ? 0 : r), d3.select(this).select(".right").attr("x", o(e[1])).attr("width", i < 0 ? 0 : i) }) } function N() { A = m.empty() ? null : m.extent(); var e = m.empty() ? o.domain() : m.extent(); if (!(Math.abs(e[0] - e[1]) <= 1)) { I.brush({ extent: e, brush: m }), R(); var t = B.select(".nv-focus .nv-linesWrap").datum(p.filter(function(e) { return !e.disabled }).map(function(t, n) { return { key: t.key, area: t.area, values: t.values.filter(function(t, n) { return a.x()(t, n) >= e[0] && a.x()(t, n) <= e[1] }) } })); t.transition().duration(C).call(a), B.select(".nv-focus .nv-x.nv-axis").transition().duration(C).call(l), B.select(".nv-focus .nv-y.nv-axis").transition().duration(C).call(c) } } var L = d3.select(this), P = this; t.utils.initSVG(L); var k = t.utils.availableWidth(E, L, v), G = t.utils.availableHeight(b, L, v) - S, F = S - h.top - h.bottom; if (e.update = function() { L.transition().duration(C).call(e) }, e.container = this, x.setter(O(p), e.update).getter(D(p)).update(), x.disabled = p.map(function(e) { return !!e.disabled }), !M) { var U; M = {}; for (U in x) x[U] instanceof Array ? M[U] = x[U].slice(0) : M[U] = x[U] } if (!(p && p.length && p.filter(function(e) { return e.values.length }).length)) return t.utils.noData(e, L), e; L.selectAll(".nv-noData").remove(), n = a.xScale(), r = a.yScale(), o = s.xScale(), i = s.yScale(); var V = L.selectAll("g.nv-wrap.nv-lineWithFocusChart").data([p]), z = V.enter().append("g").attr("class", "nvd3 nv-wrap nv-lineWithFocusChart").append("g"), B = V.select("g"); z.append("g").attr("class", "nv-legendWrap"); var $ = z.append("g").attr("class", "nv-focus"); $.append("g").attr("class", "nv-x nv-axis"), $.append("g").attr("class", "nv-y nv-axis"), $.append("g").attr("class", "nv-linesWrap"), $.append("g").attr("class", "nv-interactive"); var W = z.append("g").attr("class", "nv-context"); W.append("g").attr("class", "nv-x nv-axis"), W.append("g").attr("class", "nv-y nv-axis"), W.append("g").attr("class", "nv-linesWrap"), W.append("g").attr("class", "nv-brushBackground"), W.append("g").attr("class", "nv-x nv-brush"), w && (f.width(k), B.select(".nv-legendWrap").datum(p).call(f), v.top != f.height() && (v.top = f.height(), G = t.utils.availableHeight(b, L, v) - S), B.select(".nv-legendWrap").attr("transform", "translate(0," + -v.top + ")")), V.attr("transform", "translate(" + v.left + "," + v.top + ")"), _ && (g.width(k).height(G).margin({ left: v.left, top: v.top }).svgContainer(L).xScale(n), V.select(".nv-interactive").call(g)), a.width(k).height(G).color(p.map(function(e, t) { return e.color || y(e, t) }).filter(function(e, t) { return !p[t].disabled })), s.defined(a.defined()).width(k).height(F).color(p.map(function(e, t) { return e.color || y(e, t) }).filter(function(e, t) { return !p[t].disabled })), B.select(".nv-context").attr("transform", "translate(0," + (G + v.bottom + h.top) + ")"); var H = B.select(".nv-context .nv-linesWrap").datum(p.filter(function(e) { return !e.disabled })); d3.transition(H).call(s), l.scale(n)._ticks(t.utils.calcTicksX(k / 100, p)).tickSize(-G, 0), c.scale(r)._ticks(t.utils.calcTicksY(G / 36, p)).tickSize(-k, 0), B.select(".nv-focus .nv-x.nv-axis").attr("transform", "translate(0," + G + ")"), m.x(o).on("brush", function() { N() }), A && m.extent(A); var j = B.select(".nv-brushBackground").selectAll("g").data([A || m.extent()]), Y = j.enter().append("g"); Y.append("rect").attr("class", "left").attr("x", 0).attr("y", 0).attr("height", F), Y.append("rect").attr("class", "right").attr("x", 0).attr("y", 0).attr("height", F); var q = B.select(".nv-x.nv-brush").call(m); q.selectAll("rect").attr("height", F), q.selectAll(".resize").append("path").attr("d", T), N(), u.scale(o)._ticks(t.utils.calcTicksX(k / 100, p)).tickSize(-F, 0), B.select(".nv-context .nv-x.nv-axis").attr("transform", "translate(0," + i.range()[0] + ")"), d3.transition(B.select(".nv-context .nv-x.nv-axis")).call(u), d.scale(i)._ticks(t.utils.calcTicksY(F / 36, p)).tickSize(-k, 0), d3.transition(B.select(".nv-context .nv-y.nv-axis")).call(d), B.select(".nv-context .nv-x.nv-axis").attr("transform", "translate(0," + i.range()[0] + ")"), f.dispatch.on("stateChange", function(t) { for (var n in t) x[n] = t[n]; I.stateChange(x), e.update() }), g.dispatch.on("elementMousemove", function(n) { a.clearHighlights(); var r, i, s, u = []; if (p.filter(function(e, t) { return e.seriesIndex = t, !e.disabled }).forEach(function(l, c) { var d = m.empty() ? o.domain() : m.extent(), f = l.values.filter(function(e, t) { return a.x()(e, t) >= d[0] && a.x()(e, t) <= d[1] }); i = t.interactiveBisect(f, n.pointXValue, a.x()); var p = f[i], g = e.y()(p, i); null != g && a.highlightPoint(c, i, !0), void 0 !== p && (void 0 === r && (r = p), void 0 === s && (s = e.xScale()(e.x()(p, i))), u.push({ key: l.key, value: e.y()(p, i), color: y(l, l.seriesIndex) })) }), u.length > 2) { var d = e.yScale().invert(n.mouseY), f = Math.abs(e.yScale().domain()[0] - e.yScale().domain()[1]), h = .03 * f, E = t.nearestValueIndex(u.map(function(e) { return e.value }), d, h); null !== E && (u[E].highlight = !0) } var b = l.tickFormat()(e.x()(r, i)); g.tooltip.position({ left: n.mouseX + v.left, top: n.mouseY + v.top }).chartContainer(P.parentNode).valueFormatter(function(e, t) { return null == e ? "N/A" : c.tickFormat()(e) }).data({ value: b, index: i, series: u })(), g.renderGuideLine(s) }), g.dispatch.on("elementMouseout", function(e) { a.clearHighlights() }), I.on("changeState", function(t) { "undefined" != typeof t.disabled && p.forEach(function(e, n) { e.disabled = t.disabled[n] }), e.update() }) }), e } var n, r, o, i, a = t.models.line(), s = t.models.line(), l = t.models.axis(), c = t.models.axis(), u = t.models.axis(), d = t.models.axis(), f = t.models.legend(), m = d3.svg.brush(), p = t.models.tooltip(), g = t.interactiveGuideline(), v = { top: 30, right: 30, bottom: 30, left: 60 }, h = { top: 0, right: 30, bottom: 20, left: 60 }, y = t.utils.defaultColor(), E = null, b = null, S = 50, _ = !1, w = !0, A = null, T = null, I = d3.dispatch("brush", "stateChange", "changeState"), C = 250, x = t.utils.state(), M = null; a.clipEdge(!0).duration(0), s.interactive(!1), l.orient("bottom").tickPadding(5), c.orient("left"), u.orient("bottom").tickPadding(5), d.orient("left"), p.valueFormatter(function(e, t) { return c.tickFormat()(e, t) }).headerFormatter(function(e, t) { return l.tickFormat()(e, t) }); var D = function(e) { return function() { return { active: e.map(function(e) { return !e.disabled }) } } }, O = function(e) { return function(t) { void 0 !== t.active && e.forEach(function(e, n) { e.disabled = !t.active[n] }) } }; return a.dispatch.on("elementMouseover.tooltip", function(e) { p.data(e).position(e.pos).hidden(!1) }), a.dispatch.on("elementMouseout.tooltip", function(e) { p.hidden(!0) }), e.dispatch = I, e.legend = f, e.lines = a, e.lines2 = s, e.xAxis = l, e.yAxis = c, e.x2Axis = u, e.y2Axis = d, e.interactiveLayer = g, e.tooltip = p, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return E }, set: function(e) { E = e } }, height: { get: function() { return b }, set: function(e) { b = e } }, focusHeight: { get: function() { return S }, set: function(e) { S = e } }, showLegend: { get: function() { return w }, set: function(e) { w = e } }, brushExtent: { get: function() { return A }, set: function(e) { A = e } }, defaultState: { get: function() { return M }, set: function(e) { M = e } }, noData: { get: function() { return T }, set: function(e) { T = e } }, tooltips: { get: function() { return p.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), p.enabled(!!e) } }, tooltipContent: { get: function() { return p.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), p.contentGenerator(e) } }, margin: { get: function() { return v }, set: function(e) { v.top = void 0 !== e.top ? e.top : v.top, v.right = void 0 !== e.right ? e.right : v.right, v.bottom = void 0 !== e.bottom ? e.bottom : v.bottom, v.left = void 0 !== e.left ? e.left : v.left } }, color: { get: function() { return y }, set: function(e) { y = t.utils.getColor(e), f.color(y) } }, interpolate: { get: function() { return a.interpolate() }, set: function(e) { a.interpolate(e), s.interpolate(e) } }, xTickFormat: { get: function() { return l.tickFormat() }, set: function(e) { l.tickFormat(e), u.tickFormat(e) } }, yTickFormat: { get: function() { return c.tickFormat() }, set: function(e) { c.tickFormat(e), d.tickFormat(e) } }, duration: { get: function() { return C }, set: function(e) { C = e, c.duration(C), d.duration(C), l.duration(C), u.duration(C) } }, x: { get: function() { return a.x() }, set: function(e) { a.x(e), s.x(e) } }, y: { get: function() { return a.y() }, set: function(e) { a.y(e), s.y(e) } }, useInteractiveGuideline: { get: function() { return _ }, set: function(e) { _ = e, _ && (a.interactive(!1), a.useVoronoi(!1)) } } }), t.utils.inheritOptions(e, a), t.utils.initOptions(e), e }, t.models.multiBar = function() { "use strict"; function e(D) { return x.reset(), D.each(function(e) { var D = u - c.left - c.right, O = d - c.top - c.bottom; g = d3.select(this), t.utils.initSVG(g); var R = 0; if (w && e.length && (w = [{ values: e[0].values.map(function(e) { return { x: e.x, y: 0, series: e.series, size: .01 } }) }]), b) { var N = d3.layout.stack().offset(S).values(function(e) { return e.values }).y(h)(!e.length && w ? w : e); N.forEach(function(t, n) { t.nonStackable ? (e[n].nonStackableSeries = R++, N[n] = e[n]) : n > 0 && N[n - 1].nonStackable && N[n].values.map(function(e, t) { e.y0 -= N[n - 1].values[t].y, e.y1 = e.y0 + e.y }) }), e = N } e.forEach(function(e, t) { e.values.forEach(function(n) { n.series = t, n.key = e.key }) }), b && e[0].values.map(function(t, n) { var r = 0, o = 0; e.map(function(t, i) { if (!e[i].nonStackable) { var a = t.values[n]; a.size = Math.abs(a.y), a.y < 0 ? (a.y1 = o, o -= a.size) : (a.y1 = a.size + r, r += a.size) } }) }); var L = r && o ? [] : e.map(function(e, t) { return e.values.map(function(e, n) { return { x: v(e, n), y: h(e, n), y0: e.y0, y1: e.y1, idx: t } }) }); f.domain(r || d3.merge(L).map(function(e) { return e.x })).rangeBands(i || [0, D], I), m.domain(o || d3.extent(d3.merge(L).map(function(t) { var n = t.y; return b && !e[t.idx].nonStackable && (n = t.y > 0 ? t.y1 : t.y1 + t.y), n }).concat(y))).range(a || [O, 0]), f.domain()[0] === f.domain()[1] && (f.domain()[0] ? f.domain([f.domain()[0] - .01 * f.domain()[0], f.domain()[1] + .01 * f.domain()[1]]) : f.domain([-1, 1])), m.domain()[0] === m.domain()[1] && (m.domain()[0] ? m.domain([m.domain()[0] + .01 * m.domain()[0], m.domain()[1] - .01 * m.domain()[1]]) : m.domain([-1, 1])), s = s || f, l = l || m; var P = g.selectAll("g.nv-wrap.nv-multibar").data([e]), k = P.enter().append("g").attr("class", "nvd3 nv-wrap nv-multibar"), G = k.append("defs"), F = k.append("g"), U = P.select("g"); F.append("g").attr("class", "nv-groups"), P.attr("transform", "translate(" + c.left + "," + c.top + ")"), G.append("clipPath").attr("id", "nv-edge-clip-" + p).append("rect"), P.select("#nv-edge-clip-" + p + " rect").attr("width", D).attr("height", O), U.attr("clip-path", E ? "url(#nv-edge-clip-" + p + ")" : ""); var V = P.select(".nv-groups").selectAll(".nv-group").data(function(e) { return e }, function(e, t) { return t }); V.enter().append("g").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6); var z = x.transition(V.exit().selectAll("rect.nv-bar"), "multibarExit", Math.min(100, T)).attr("y", function(t, n, r) { var o = l(0) || 0; return b && e[t.series] && !e[t.series].nonStackable && (o = l(t.y0)), o }).attr("height", 0).remove(); z.delay && z.delay(function(e, t) { var n = t * (T / (M + 1)) - t; return n }), V.attr("class", function(e, t) { return "nv-group nv-series-" + t }).classed("hover", function(e) { return e.hover }).style("fill", function(e, t) { return _(e, t) }).style("stroke", function(e, t) { return _(e, t) }), V.style("stroke-opacity", 1).style("fill-opacity", .75); var B = V.selectAll("rect.nv-bar").data(function(t) { return w && !e.length ? w.values : t.values }); B.exit().remove(); B.enter().append("rect").attr("class", function(e, t) { return h(e, t) < 0 ? "nv-bar negative" : "nv-bar positive" }).attr("x", function(t, n, r) { return b && !e[r].nonStackable ? 0 : r * f.rangeBand() / e.length }).attr("y", function(t, n, r) { return l(b && !e[r].nonStackable ? t.y0 : 0) || 0 }).attr("height", 0).attr("width", function(t, n, r) { return f.rangeBand() / (b && !e[r].nonStackable ? 1 : e.length) }).attr("transform", function(e, t) { return "translate(" + f(v(e, t)) + ",0)" }); B.style("fill", function(e, t, n) { return _(e, n, t) }).style("stroke", function(e, t, n) { return _(e, n, t) }).on("mouseover", function(e, t) { d3.select(this).classed("hover", !0), C.elementMouseover({ data: e, index: t, color: d3.select(this).style("fill") }) }).on("mouseout", function(e, t) { d3.select(this).classed("hover", !1), C.elementMouseout({ data: e, index: t, color: d3.select(this).style("fill") }) }).on("mousemove", function(e, t) { C.elementMousemove({ data: e, index: t, color: d3.select(this).style("fill") }) }).on("click", function(e, t) { C.elementClick({ data: e, index: t, color: d3.select(this).style("fill") }), d3.event.stopPropagation() }).on("dblclick", function(e, t) { C.elementDblClick({ data: e, index: t, color: d3.select(this).style("fill") }), d3.event.stopPropagation() }), B.attr("class", function(e, t) { return h(e, t) < 0 ? "nv-bar negative" : "nv-bar positive" }).attr("transform", function(e, t) { return "translate(" + f(v(e, t)) + ",0)" }), A && (n || (n = e.map(function() { return !0 })), B.style("fill", function(e, t, r) { return d3.rgb(A(e, t)).darker(n.map(function(e, t) { return t }).filter(function(e, t) { return !n[t] })[r]).toString() }).style("stroke", function(e, t, r) { return d3.rgb(A(e, t)).darker(n.map(function(e, t) { return t }).filter(function(e, t) { return !n[t] })[r]).toString() })); var $ = B.watchTransition(x, "multibar", Math.min(250, T)).delay(function(t, n) { return n * T / e[0].values.length }); b ? $.attr("y", function(t, n, r) { var o = 0; return o = e[r].nonStackable ? h(t, n) < 0 ? m(0) : m(0) - m(h(t, n)) < -1 ? m(0) - 1 : m(h(t, n)) || 0 : m(t.y1) }).attr("height", function(t, n, r) { return e[r].nonStackable ? Math.max(Math.abs(m(h(t, n)) - m(0)), 1) || 0 : Math.max(Math.abs(m(t.y + t.y0) - m(t.y0)), 1) }).attr("x", function(t, n, r) { var o = 0; return e[r].nonStackable && (o = t.series * f.rangeBand() / e.length, e.length !== R && (o = e[r].nonStackableSeries * f.rangeBand() / (2 * R))), o }).attr("width", function(t, n, r) { if (e[r].nonStackable) { var o = f.rangeBand() / R; return e.length !== R && (o = f.rangeBand() / (2 * R)), o } return f.rangeBand() }) : $.attr("x", function(t, n) { return t.series * f.rangeBand() / e.length }).attr("width", f.rangeBand() / e.length).attr("y", function(e, t) { return h(e, t) < 0 ? m(0) : m(0) - m(h(e, t)) < 1 ? m(0) - 1 : m(h(e, t)) || 0 }).attr("height", function(e, t) { return Math.max(Math.abs(m(h(e, t)) - m(0)), 1) || 0 }), s = f.copy(), l = m.copy(), e[0] && e[0].values && (M = e[0].values.length) }), x.renderEnd("multibar immediate"), e } var n, r, o, i, a, s, l, c = { top: 0, right: 0, bottom: 0, left: 0 }, u = 960, d = 500, f = d3.scale.ordinal(), m = d3.scale.linear(), p = Math.floor(1e4 * Math.random()), g = null, v = function(e) { return e.x }, h = function(e) { return e.y }, y = [0], E = !0, b = !1, S = "zero", _ = t.utils.defaultColor(), w = !1, A = null, T = 500, I = .1, C = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"), x = t.utils.renderWatch(C, T), M = 0; return e.dispatch = C, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return u }, set: function(e) { u = e } }, height: { get: function() { return d }, set: function(e) { d = e } }, x: { get: function() { return v }, set: function(e) { v = e } }, y: { get: function() { return h }, set: function(e) { h = e } }, xScale: { get: function() { return f }, set: function(e) { f = e } }, yScale: { get: function() { return m }, set: function(e) { m = e } }, xDomain: { get: function() { return r }, set: function(e) { r = e } }, yDomain: { get: function() { return o }, set: function(e) { o = e } }, xRange: { get: function() { return i }, set: function(e) { i = e } }, yRange: { get: function() { return a }, set: function(e) { a = e } }, forceY: { get: function() { return y }, set: function(e) { y = e } }, stacked: { get: function() { return b }, set: function(e) { b = e } }, stackOffset: { get: function() { return S }, set: function(e) { S = e } }, clipEdge: { get: function() { return E }, set: function(e) { E = e } }, disabled: { get: function() { return n }, set: function(e) { n = e } }, id: { get: function() { return p }, set: function(e) { p = e } }, hideable: { get: function() { return w }, set: function(e) { w = e } }, groupSpacing: { get: function() { return I }, set: function(e) { I = e } }, margin: { get: function() { return c }, set: function(e) { c.top = void 0 !== e.top ? e.top : c.top, c.right = void 0 !== e.right ? e.right : c.right, c.bottom = void 0 !== e.bottom ? e.bottom : c.bottom, c.left = void 0 !== e.left ? e.left : c.left } }, duration: { get: function() { return T }, set: function(e) { T = e, x.reset(T) } }, color: { get: function() { return _ }, set: function(e) { _ = t.utils.getColor(e) } }, barColor: { get: function() { return A }, set: function(e) { A = e ? t.utils.getColor(e) : null } } }), t.utils.initOptions(e), e }, t.models.multiBarChart = function() { "use strict"; function e(c) { return M.reset(), M.models(o), h && M.models(i), y && M.models(a), c.each(function(c) { var T = d3.select(this); t.utils.initSVG(T); var M = t.utils.availableWidth(d, T, u), N = t.utils.availableHeight(f, T, u); if (e.update = function() { 0 === x ? T.call(e) : T.transition().duration(x).call(e) }, e.container = this, w.setter(R(c), e.update).getter(O(c)).update(), w.disabled = c.map(function(e) { return !!e.disabled }), !A) { var L; A = {}; for (L in w) w[L] instanceof Array ? A[L] = w[L].slice(0) : A[L] = w[L] } if (!(c && c.length && c.filter(function(e) { return e.values.length }).length)) return t.utils.noData(e, T), e; T.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale(); var P = T.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([c]), k = P.enter().append("g").attr("class", "nvd3 nv-wrap nv-multiBarWithLegend").append("g"), G = P.select("g"); if (k.append("g").attr("class", "nv-x nv-axis"), k.append("g").attr("class", "nv-y nv-axis"), k.append("g").attr("class", "nv-barsWrap"), k.append("g").attr("class", "nv-legendWrap"), k.append("g").attr("class", "nv-controlsWrap"), v && (s.width(M - C()), G.select(".nv-legendWrap").datum(c).call(s), u.top != s.height() && (u.top = s.height(), N = t.utils.availableHeight(f, T, u)), G.select(".nv-legendWrap").attr("transform", "translate(" + C() + "," + -u.top + ")")), p) { var F = [{ key: g.grouped || "Grouped", disabled: o.stacked() }, { key: g.stacked || "Stacked", disabled: !o.stacked() }]; l.width(C()).color(["#444", "#444", "#444"]), G.select(".nv-controlsWrap").datum(F).attr("transform", "translate(0," + -u.top + ")").call(l) } P.attr("transform", "translate(" + u.left + "," + u.top + ")"), E && G.select(".nv-y.nv-axis").attr("transform", "translate(" + M + ",0)"), o.disabled(c.map(function(e) { return e.disabled })).width(M).height(N).color(c.map(function(e, t) { return e.color || m(e, t) }).filter(function(e, t) { return !c[t].disabled })); var U = G.select(".nv-barsWrap").datum(c.filter(function(e) { return !e.disabled })); if (U.call(o), h) { i.scale(n)._ticks(t.utils.calcTicksX(M / 100, c)).tickSize(-N, 0), G.select(".nv-x.nv-axis").attr("transform", "translate(0," + r.range()[0] + ")"), G.select(".nv-x.nv-axis").call(i); var V = G.select(".nv-x.nv-axis > g").selectAll("g"); if (V.selectAll("line, text").style("opacity", 1), S) { var z = function(e, t) { return "translate(" + e + "," + t + ")" }, B = 5, $ = 17; V.selectAll("text").attr("transform", function(e, t, n) { return z(0, n % 2 == 0 ? B : $) }); var W = d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length; G.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform", function(e, t) { return z(0, 0 === t || W % 2 !== 0 ? $ : B) }) } b && V.filter(function(e, t) { return t % Math.ceil(c[0].values.length / (M / 100)) !== 0 }).selectAll("text, line").style("opacity", 0), _ && V.selectAll(".tick text").attr("transform", "rotate(" + _ + " 0,0)").style("text-anchor", _ > 0 ? "start" : "end"), G.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity", 1) } y && (a.scale(r)._ticks(t.utils.calcTicksY(N / 36, c)).tickSize(-M, 0), G.select(".nv-y.nv-axis").call(a)), s.dispatch.on("stateChange", function(t) { for (var n in t) w[n] = t[n]; I.stateChange(w), e.update() }), l.dispatch.on("legendClick", function(t, n) { if (t.disabled) { switch (F = F.map(function(e) { return e.disabled = !0, e }), t.disabled = !1, t.key) { case "Grouped": case g.grouped: o.stacked(!1); break; case "Stacked": case g.stacked: o.stacked(!0) } w.stacked = o.stacked(), I.stateChange(w), e.update() } }), I.on("changeState", function(t) { "undefined" != typeof t.disabled && (c.forEach(function(e, n) { e.disabled = t.disabled[n] }), w.disabled = t.disabled), "undefined" != typeof t.stacked && (o.stacked(t.stacked), w.stacked = t.stacked, D = t.stacked), e.update() }) }), M.renderEnd("multibarchart immediate"), e } var n, r, o = t.models.multiBar(), i = t.models.axis(), a = t.models.axis(), s = t.models.legend(), l = t.models.legend(), c = t.models.tooltip(), u = { top: 30, right: 20, bottom: 50, left: 60 }, d = null, f = null, m = t.utils.defaultColor(), p = !0, g = {}, v = !0, h = !0, y = !0, E = !1, b = !0, S = !1, _ = 0, w = t.utils.state(), A = null, T = null, I = d3.dispatch("stateChange", "changeState", "renderEnd"), C = function() { return p ? 180 : 0 }, x = 250; w.stacked = !1, o.stacked(!1), i.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat(function(e) { return e }), a.orient(E ? "right" : "left").tickFormat(d3.format(",.1f")), c.duration(0).valueFormatter(function(e, t) { return a.tickFormat()(e, t) }).headerFormatter(function(e, t) { return i.tickFormat()(e, t) }), l.updateState(!1); var M = t.utils.renderWatch(I), D = !1, O = function(e) { return function() { return { active: e.map(function(e) { return !e.disabled }), stacked: D } } }, R = function(e) { return function(t) { void 0 !== t.stacked && (D = t.stacked), void 0 !== t.active && e.forEach(function(e, n) { e.disabled = !t.active[n] }) } }; return o.dispatch.on("elementMouseover.tooltip", function(t) { t.value = e.x()(t.data), t.series = { key: t.data.key, value: e.y()(t.data), color: t.color }, c.data(t).hidden(!1) }), o.dispatch.on("elementMouseout.tooltip", function(e) { c.hidden(!0) }), o.dispatch.on("elementMousemove.tooltip", function(e) { c.position({ top: d3.event.pageY, left: d3.event.pageX })() }), e.dispatch = I, e.multibar = o, e.legend = s, e.controls = l, e.xAxis = i, e.yAxis = a, e.state = w, e.tooltip = c, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return d }, set: function(e) { d = e } }, height: { get: function() { return f }, set: function(e) { f = e } }, showLegend: { get: function() { return v }, set: function(e) { v = e } }, showControls: { get: function() { return p }, set: function(e) { p = e } }, controlLabels: { get: function() { return g }, set: function(e) { g = e } }, showXAxis: { get: function() { return h }, set: function(e) { h = e } }, showYAxis: { get: function() { return y }, set: function(e) { y = e } }, defaultState: { get: function() { return A }, set: function(e) { A = e } }, noData: { get: function() { return T }, set: function(e) { T = e } }, reduceXTicks: { get: function() { return b }, set: function(e) { b = e } }, rotateLabels: { get: function() { return _ }, set: function(e) { _ = e } }, staggerLabels: { get: function() { return S }, set: function(e) { S = e } }, tooltips: { get: function() { return c.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), c.enabled(!!e) } }, tooltipContent: { get: function() { return c.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), c.contentGenerator(e) } }, margin: { get: function() { return u }, set: function(e) { u.top = void 0 !== e.top ? e.top : u.top, u.right = void 0 !== e.right ? e.right : u.right, u.bottom = void 0 !== e.bottom ? e.bottom : u.bottom, u.left = void 0 !== e.left ? e.left : u.left } }, duration: { get: function() { return x }, set: function(e) { x = e, o.duration(x), i.duration(x), a.duration(x), M.reset(x) } }, color: { get: function() { return m }, set: function(e) { m = t.utils.getColor(e), s.color(m) } }, rightAlignYAxis: { get: function() { return E }, set: function(e) { E = e, a.orient(E ? "right" : "left") } }, barColor: { get: function() { return o.barColor }, set: function(e) { o.barColor(e), s.color(function(e, t) { return d3.rgb("#ccc").darker(1.5 * t).toString() }) } } }), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e }, t.models.multiBarHorizontal = function() { "use strict"; function e(f) { return D.reset(), f.each(function(e) { var f = u - c.left - c.right, x = d - c.top - c.bottom; m = d3.select(this), t.utils.initSVG(m), _ && (e = d3.layout.stack().offset("zero").values(function(e) { return e.values }).y(h)(e)), e.forEach(function(e, t) { e.values.forEach(function(n) { n.series = t, n.key = e.key }) }), _ && e[0].values.map(function(t, n) { var r = 0, o = 0; e.map(function(e) { var t = e.values[n]; t.size = Math.abs(t.y), t.y < 0 ? (t.y1 = o - t.size, o -= t.size) : (t.y1 = r, r += t.size) }) }); var O = r && o ? [] : e.map(function(e) { return e.values.map(function(e, t) { return { x: v(e, t), y: h(e, t), y0: e.y0, y1: e.y1 } }) }); p.domain(r || d3.merge(O).map(function(e) { return e.x })).rangeBands(i || [0, x], I), g.domain(o || d3.extent(d3.merge(O).map(function(e) { return _ ? e.y > 0 ? e.y1 + e.y : e.y1 : e.y }).concat(E))), w && !_ ? g.range(a || [g.domain()[0] < 0 ? T : 0, f - (g.domain()[1] > 0 ? T : 0)]) : g.range(a || [0, f]), s = s || p, l = l || d3.scale.linear().domain(g.domain()).range([g(0), g(0)]); var R = d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([e]), N = R.enter().append("g").attr("class", "nvd3 nv-wrap nv-multibarHorizontal"), L = (N.append("defs"), N.append("g")); R.select("g"); L.append("g").attr("class", "nv-groups"), R.attr("transform", "translate(" + c.left + "," + c.top + ")"); var P = R.select(".nv-groups").selectAll(".nv-group").data(function(e) { return e }, function(e, t) { return t }); P.enter().append("g").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6), P.exit().watchTransition(D, "multibarhorizontal: exit groups").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6).remove(), P.attr("class", function(e, t) { return "nv-group nv-series-" + t }).classed("hover", function(e) { return e.hover }).style("fill", function(e, t) { return b(e, t) }).style("stroke", function(e, t) { return b(e, t) }), P.watchTransition(D, "multibarhorizontal: groups").style("stroke-opacity", 1).style("fill-opacity", .75); var k = P.selectAll("g.nv-bar").data(function(e) { return e.values }); k.exit().remove(); var G = k.enter().append("g").attr("transform", function(t, n, r) { return "translate(" + l(_ ? t.y0 : 0) + "," + (_ ? 0 : r * p.rangeBand() / e.length + p(v(t, n))) + ")" }); G.append("rect").attr("width", 0).attr("height", p.rangeBand() / (_ ? 1 : e.length)), k.on("mouseover", function(e, t) { d3.select(this).classed("hover", !0), M.elementMouseover({ data: e, index: t, color: d3.select(this).style("fill") }) }).on("mouseout", function(e, t) { d3.select(this).classed("hover", !1), M.elementMouseout({ data: e, index: t, color: d3.select(this).style("fill") }) }).on("mouseout", function(e, t) { M.elementMouseout({ data: e, index: t, color: d3.select(this).style("fill") }) }).on("mousemove", function(e, t) { M.elementMousemove({ data: e, index: t, color: d3.select(this).style("fill") }) }).on("click", function(e, t) { M.elementClick({ data: e, index: t, color: d3.select(this).style("fill") }), d3.event.stopPropagation() }).on("dblclick", function(e, t) { M.elementDblClick({ data: e, index: t, color: d3.select(this).style("fill") }), d3.event.stopPropagation() }), y(e[0], 0) && (G.append("polyline"), k.select("polyline").attr("fill", "none").attr("points", function(t, n) { var r = y(t, n), o = .8 * p.rangeBand() / (2 * (_ ? 1 : e.length)); r = r.length ? r : [-Math.abs(r), Math.abs(r)], r = r.map(function(e) { return g(e) - g(0) }); var i = [ [r[0], -o], [r[0], o], [r[0], 0], [r[1], 0], [r[1], -o], [r[1], o] ]; return i.map(function(e) { return e.join(",") }).join(" ") }).attr("transform", function(t, n) { var r = p.rangeBand() / (2 * (_ ? 1 : e.length)); return "translate(" + (h(t, n) < 0 ? 0 : g(h(t, n)) - g(0)) + ", " + r + ")" })), G.append("text"), w && !_ ? (k.select("text").attr("text-anchor", function(e, t) { return h(e, t) < 0 ? "end" : "start" }).attr("y", p.rangeBand() / (2 * e.length)).attr("dy", ".32em").text(function(e, t) { var n = C(h(e, t)), r = y(e, t); return void 0 === r ? n : r.length ? n + "+" + C(Math.abs(r[1])) + "-" + C(Math.abs(r[0])) : n + "±" + C(Math.abs(r)) }), k.watchTransition(D, "multibarhorizontal: bars").select("text").attr("x", function(e, t) { return h(e, t) < 0 ? -4 : g(h(e, t)) - g(0) + 4 })) : k.selectAll("text").text(""), A && !_ ? (G.append("text").classed("nv-bar-label", !0), k.select("text.nv-bar-label").attr("text-anchor", function(e, t) { return h(e, t) < 0 ? "start" : "end" }).attr("y", p.rangeBand() / (2 * e.length)).attr("dy", ".32em").text(function(e, t) { return v(e, t) }), k.watchTransition(D, "multibarhorizontal: bars").select("text.nv-bar-label").attr("x", function(e, t) { return h(e, t) < 0 ? g(0) - g(h(e, t)) + 4 : -4 })) : k.selectAll("text.nv-bar-label").text(""), k.attr("class", function(e, t) { return h(e, t) < 0 ? "nv-bar negative" : "nv-bar positive" }), S && (n || (n = e.map(function() { return !0 })), k.style("fill", function(e, t, r) { return d3.rgb(S(e, t)).darker(n.map(function(e, t) { return t }).filter(function(e, t) { return !n[t] })[r]).toString() }).style("stroke", function(e, t, r) { return d3.rgb(S(e, t)).darker(n.map(function(e, t) { return t }).filter(function(e, t) { return !n[t] })[r]).toString() })), _ ? k.watchTransition(D, "multibarhorizontal: bars").attr("transform", function(e, t) { return "translate(" + g(e.y1) + "," + p(v(e, t)) + ")" }).select("rect").attr("width", function(e, t) { return Math.abs(g(h(e, t) + e.y0) - g(e.y0)) }).attr("height", p.rangeBand()) : k.watchTransition(D, "multibarhorizontal: bars").attr("transform", function(t, n) { return "translate(" + g(h(t, n) < 0 ? h(t, n) : 0) + "," + (t.series * p.rangeBand() / e.length + p(v(t, n))) + ")" }).select("rect").attr("height", p.rangeBand() / e.length).attr("width", function(e, t) { return Math.max(Math.abs(g(h(e, t)) - g(0)), 1) }), s = p.copy(), l = g.copy() }), D.renderEnd("multibarHorizontal immediate"), e } var n, r, o, i, a, s, l, c = { top: 0, right: 0, bottom: 0, left: 0 }, u = 960, d = 500, f = Math.floor(1e4 * Math.random()), m = null, p = d3.scale.ordinal(), g = d3.scale.linear(), v = function(e) { return e.x }, h = function(e) { return e.y }, y = function(e) { return e.yErr }, E = [0], b = t.utils.defaultColor(), S = null, _ = !1, w = !1, A = !1, T = 60, I = .1, C = d3.format(",.2f"), x = 250, M = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"), D = t.utils.renderWatch(M, x); return e.dispatch = M, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return u }, set: function(e) { u = e } }, height: { get: function() { return d }, set: function(e) { d = e } }, x: { get: function() { return v }, set: function(e) { v = e } }, y: { get: function() { return h }, set: function(e) { h = e } }, yErr: { get: function() { return y }, set: function(e) { y = e } }, xScale: { get: function() { return p }, set: function(e) { p = e } }, yScale: { get: function() { return g }, set: function(e) { g = e } }, xDomain: { get: function() { return r }, set: function(e) { r = e } }, yDomain: { get: function() { return o }, set: function(e) { o = e } }, xRange: { get: function() { return i }, set: function(e) { i = e } }, yRange: { get: function() { return a }, set: function(e) { a = e } }, forceY: { get: function() { return E }, set: function(e) { E = e } }, stacked: { get: function() { return _ }, set: function(e) { _ = e } }, showValues: { get: function() { return w }, set: function(e) { w = e } }, disabled: { get: function() { return n }, set: function(e) { n = e } }, id: { get: function() { return f }, set: function(e) { f = e } }, valueFormat: { get: function() { return C }, set: function(e) { C = e } }, valuePadding: { get: function() { return T }, set: function(e) { T = e } }, groupSpacing: { get: function() { return I }, set: function(e) { I = e } }, margin: { get: function() { return c }, set: function(e) { c.top = void 0 !== e.top ? e.top : c.top, c.right = void 0 !== e.right ? e.right : c.right, c.bottom = void 0 !== e.bottom ? e.bottom : c.bottom, c.left = void 0 !== e.left ? e.left : c.left } }, duration: { get: function() { return x }, set: function(e) { x = e, D.reset(x) } }, color: { get: function() { return b }, set: function(e) { b = t.utils.getColor(e) } }, barColor: { get: function() { return S }, set: function(e) { S = e ? t.utils.getColor(e) : null } } }), t.utils.initOptions(e), e }, t.models.multiBarHorizontalChart = function() { "use strict"; function e(c) { return x.reset(), x.models(o), h && x.models(i), y && x.models(a), c.each(function(c) { var _ = d3.select(this); t.utils.initSVG(_); var x = t.utils.availableWidth(d, _, u), M = t.utils.availableHeight(f, _, u); if (e.update = function() { _.transition().duration(T).call(e) }, e.container = this, E = o.stacked(), b.setter(C(c), e.update).getter(I(c)).update(), b.disabled = c.map(function(e) { return !!e.disabled }), !S) { var D; S = {}; for (D in b) b[D] instanceof Array ? S[D] = b[D].slice(0) : S[D] = b[D] } if (!(c && c.length && c.filter(function(e) { return e.values.length }).length)) return t.utils.noData(e, _), e; _.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale(); var O = _.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([c]), R = O.enter().append("g").attr("class", "nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"), N = O.select("g"); if (R.append("g").attr("class", "nv-x nv-axis"), R.append("g").attr("class", "nv-y nv-axis").append("g").attr("class", "nv-zeroLine").append("line"), R.append("g").attr("class", "nv-barsWrap"), R.append("g").attr("class", "nv-legendWrap"), R.append("g").attr("class", "nv-controlsWrap"), v && (s.width(x - A()), N.select(".nv-legendWrap").datum(c).call(s), u.top != s.height() && (u.top = s.height(), M = t.utils.availableHeight(f, _, u)), N.select(".nv-legendWrap").attr("transform", "translate(" + A() + "," + -u.top + ")")), p) { var L = [{ key: g.grouped || "Grouped", disabled: o.stacked() }, { key: g.stacked || "Stacked", disabled: !o.stacked() }]; l.width(A()).color(["#444", "#444", "#444"]), N.select(".nv-controlsWrap").datum(L).attr("transform", "translate(0," + -u.top + ")").call(l) } O.attr("transform", "translate(" + u.left + "," + u.top + ")"), o.disabled(c.map(function(e) { return e.disabled })).width(x).height(M).color(c.map(function(e, t) { return e.color || m(e, t) }).filter(function(e, t) { return !c[t].disabled })); var P = N.select(".nv-barsWrap").datum(c.filter(function(e) { return !e.disabled })); if (P.transition().call(o), h) { i.scale(n)._ticks(t.utils.calcTicksY(M / 24, c)).tickSize(-x, 0), N.select(".nv-x.nv-axis").call(i); var k = N.select(".nv-x.nv-axis").selectAll("g"); k.selectAll("line, text") } y && (a.scale(r)._ticks(t.utils.calcTicksX(x / 100, c)).tickSize(-M, 0), N.select(".nv-y.nv-axis").attr("transform", "translate(0," + M + ")"), N.select(".nv-y.nv-axis").call(a)), N.select(".nv-zeroLine line").attr("x1", r(0)).attr("x2", r(0)).attr("y1", 0).attr("y2", -M), s.dispatch.on("stateChange", function(t) { for (var n in t) b[n] = t[n]; w.stateChange(b), e.update() }), l.dispatch.on("legendClick", function(t, n) { if (t.disabled) { switch (L = L.map(function(e) { return e.disabled = !0, e }), t.disabled = !1, t.key) { case "Grouped": o.stacked(!1); break; case "Stacked": o.stacked(!0) } b.stacked = o.stacked(), w.stateChange(b), E = o.stacked(), e.update() } }), w.on("changeState", function(t) { "undefined" != typeof t.disabled && (c.forEach(function(e, n) { e.disabled = t.disabled[n] }), b.disabled = t.disabled), "undefined" != typeof t.stacked && (o.stacked(t.stacked), b.stacked = t.stacked, E = t.stacked), e.update() }) }), x.renderEnd("multibar horizontal chart immediate"), e } var n, r, o = t.models.multiBarHorizontal(), i = t.models.axis(), a = t.models.axis(), s = t.models.legend().height(30), l = t.models.legend().height(30), c = t.models.tooltip(), u = { top: 30, right: 20, bottom: 50, left: 60 }, d = null, f = null, m = t.utils.defaultColor(), p = !0, g = {}, v = !0, h = !0, y = !0, E = !1, b = t.utils.state(), S = null, _ = null, w = d3.dispatch("stateChange", "changeState", "renderEnd"), A = function() { return p ? 180 : 0 }, T = 250; b.stacked = !1, o.stacked(E), i.orient("left").tickPadding(5).showMaxMin(!1).tickFormat(function(e) { return e }), a.orient("bottom").tickFormat(d3.format(",.1f")), c.duration(0).valueFormatter(function(e, t) { return a.tickFormat()(e, t) }).headerFormatter(function(e, t) { return i.tickFormat()(e, t) }), l.updateState(!1); var I = function(e) { return function() { return { active: e.map(function(e) { return !e.disabled }), stacked: E } } }, C = function(e) { return function(t) { void 0 !== t.stacked && (E = t.stacked), void 0 !== t.active && e.forEach(function(e, n) { e.disabled = !t.active[n] }) } }, x = t.utils.renderWatch(w, T); return o.dispatch.on("elementMouseover.tooltip", function(t) { t.value = e.x()(t.data), t.series = { key: t.data.key, value: e.y()(t.data), color: t.color }, c.data(t).hidden(!1) }), o.dispatch.on("elementMouseout.tooltip", function(e) { c.hidden(!0) }), o.dispatch.on("elementMousemove.tooltip", function(e) { c.position({ top: d3.event.pageY, left: d3.event.pageX })() }), e.dispatch = w, e.multibar = o, e.legend = s, e.controls = l, e.xAxis = i, e.yAxis = a, e.state = b, e.tooltip = c, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return d }, set: function(e) { d = e } }, height: { get: function() { return f }, set: function(e) { f = e } }, showLegend: { get: function() { return v }, set: function(e) { v = e } }, showControls: { get: function() { return p }, set: function(e) { p = e } }, controlLabels: { get: function() { return g }, set: function(e) { g = e } }, showXAxis: { get: function() { return h }, set: function(e) { h = e } }, showYAxis: { get: function() { return y }, set: function(e) { y = e } }, defaultState: { get: function() { return S }, set: function(e) { S = e } }, noData: { get: function() { return _ }, set: function(e) { _ = e } }, tooltips: { get: function() { return c.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), c.enabled(!!e) } }, tooltipContent: { get: function() { return c.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), c.contentGenerator(e) } }, margin: { get: function() { return u }, set: function(e) { u.top = void 0 !== e.top ? e.top : u.top, u.right = void 0 !== e.right ? e.right : u.right, u.bottom = void 0 !== e.bottom ? e.bottom : u.bottom, u.left = void 0 !== e.left ? e.left : u.left } }, duration: { get: function() { return T }, set: function(e) { T = e, x.reset(T), o.duration(T), i.duration(T), a.duration(T) } }, color: { get: function() { return m }, set: function(e) { m = t.utils.getColor(e), s.color(m) } }, barColor: { get: function() { return o.barColor }, set: function(e) { o.barColor(e), s.color(function(e, t) { return d3.rgb("#ccc").darker(1.5 * t).toString() }) } } }), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e }, t.models.multiChart = function() { "use strict"; function e(c) { return c.each(function(c) { function u(e) { var t = 2 === c[e.seriesIndex].yAxis ? T : A; e.value = e.point.x, e.series = { value: e.point.y, color: e.point.color }, C.duration(100).valueFormatter(function(e, n) { return t.tickFormat()(e, n) }).data(e).position(e.pos).hidden(!1) } function d(e) { var t = 2 === c[e.seriesIndex].yAxis ? T : A; e.point.x = S.x()(e.point), e.point.y = S.y()(e.point), C.duration(100).valueFormatter(function(e, n) { return t.tickFormat()(e, n) }).data(e).position(e.pos).hidden(!1) } function m(e) { var t = 2 === c[e.data.series].yAxis ? T : A; e.value = E.x()(e.data), e.series = { value: E.y()(e.data), color: e.color }, C.duration(0).valueFormatter(function(e, n) { return t.tickFormat()(e, n) }).data(e).hidden(!1) } var x = d3.select(this); t.utils.initSVG(x), e.update = function() { x.transition().call(e) }, e.container = this; var M = t.utils.availableWidth(a, x, o), D = t.utils.availableHeight(s, x, o), O = c.filter(function(e) { return "line" == e.type && 1 == e.yAxis }), R = c.filter(function(e) { return "line" == e.type && 2 == e.yAxis }), N = c.filter(function(e) { return "bar" == e.type && 1 == e.yAxis }), L = c.filter(function(e) { return "bar" == e.type && 2 == e.yAxis }), P = c.filter(function(e) { return "area" == e.type && 1 == e.yAxis }), k = c.filter(function(e) { return "area" == e.type && 2 == e.yAxis }); if (!(c && c.length && c.filter(function(e) { return e.values.length }).length)) return t.utils.noData(e, x), e; x.selectAll(".nv-noData").remove(); var G = c.filter(function(e) { return !e.disabled && 1 == e.yAxis }).map(function(e) { return e.values.map(function(e, t) { return { x: e.x, y: e.y } }) }), F = c.filter(function(e) { return !e.disabled && 2 == e.yAxis }).map(function(e) { return e.values.map(function(e, t) { return { x: e.x, y: e.y } }) }); p.domain(d3.extent(d3.merge(G.concat(F)), function(e) { return e.x })).range([0, M]); var U = x.selectAll("g.wrap.multiChart").data([c]), V = U.enter().append("g").attr("class", "wrap nvd3 multiChart").append("g"); V.append("g").attr("class", "nv-x nv-axis"), V.append("g").attr("class", "nv-y1 nv-axis"), V.append("g").attr("class", "nv-y2 nv-axis"), V.append("g").attr("class", "lines1Wrap"), V.append("g").attr("class", "lines2Wrap"), V.append("g").attr("class", "bars1Wrap"), V.append("g").attr("class", "bars2Wrap"), V.append("g").attr("class", "stack1Wrap"), V.append("g").attr("class", "stack2Wrap"), V.append("g").attr("class", "legendWrap"); var z = U.select("g"), B = c.map(function(e, t) { return c[t].color || i(e, t) }); if (l) { var $ = I.align() ? M / 2 : M, W = I.align() ? $ : 0; I.width($), I.color(B), z.select(".legendWrap").datum(c.map(function(e) { return e.originalKey = void 0 === e.originalKey ? e.key : e.originalKey, e.key = e.originalKey + (1 == e.yAxis ? "" : " (right axis)"), e })).call(I), o.top != I.height() && (o.top = I.height(), D = t.utils.availableHeight(s, x, o)), z.select(".legendWrap").attr("transform", "translate(" + W + "," + -o.top + ")") } h.width(M).height(D).interpolate(f).color(B.filter(function(e, t) { return !c[t].disabled && 1 == c[t].yAxis && "line" == c[t].type })), y.width(M).height(D).interpolate(f).color(B.filter(function(e, t) { return !c[t].disabled && 2 == c[t].yAxis && "line" == c[t].type })), E.width(M).height(D).color(B.filter(function(e, t) { return !c[t].disabled && 1 == c[t].yAxis && "bar" == c[t].type })), b.width(M).height(D).color(B.filter(function(e, t) { return !c[t].disabled && 2 == c[t].yAxis && "bar" == c[t].type })), S.width(M).height(D).color(B.filter(function(e, t) { return !c[t].disabled && 1 == c[t].yAxis && "area" == c[t].type })), _.width(M).height(D).color(B.filter(function(e, t) { return !c[t].disabled && 2 == c[t].yAxis && "area" == c[t].type })), z.attr("transform", "translate(" + o.left + "," + o.top + ")"); var H = z.select(".lines1Wrap").datum(O.filter(function(e) { return !e.disabled })), j = z.select(".bars1Wrap").datum(N.filter(function(e) { return !e.disabled })), Y = z.select(".stack1Wrap").datum(P.filter(function(e) { return !e.disabled })), q = z.select(".lines2Wrap").datum(R.filter(function(e) { return !e.disabled })), K = z.select(".bars2Wrap").datum(L.filter(function(e) { return !e.disabled })), Q = z.select(".stack2Wrap").datum(k.filter(function(e) { return !e.disabled })), Z = P.length ? P.map(function(e) { return e.values }).reduce(function(e, t) { return e.map(function(e, n) { return { x: e.x, y: e.y + t[n].y } }) }).concat([{ x: 0, y: 0 }]) : [], X = k.length ? k.map(function(e) { return e.values }).reduce(function(e, t) { return e.map(function(e, n) { return { x: e.x, y: e.y + t[n].y } }) }).concat([{ x: 0, y: 0 }]) : []; g.domain(n || d3.extent(d3.merge(G).concat(Z), function(e) { return e.y })).range([0, D]), v.domain(r || d3.extent(d3.merge(F).concat(X), function(e) { return e.y })).range([0, D]), h.yDomain(g.domain()), E.yDomain(g.domain()), S.yDomain(g.domain()), y.yDomain(v.domain()), b.yDomain(v.domain()), _.yDomain(v.domain()), P.length && d3.transition(Y).call(S), k.length && d3.transition(Q).call(_), N.length && d3.transition(j).call(E), L.length && d3.transition(K).call(b), O.length && d3.transition(H).call(h), R.length && d3.transition(q).call(y), w._ticks(t.utils.calcTicksX(M / 100, c)).tickSize(-D, 0), z.select(".nv-x.nv-axis").attr("transform", "translate(0," + D + ")"), d3.transition(z.select(".nv-x.nv-axis")).call(w), A._ticks(t.utils.calcTicksY(D / 36, c)).tickSize(-M, 0), d3.transition(z.select(".nv-y1.nv-axis")).call(A), T._ticks(t.utils.calcTicksY(D / 36, c)).tickSize(-M, 0), d3.transition(z.select(".nv-y2.nv-axis")).call(T), z.select(".nv-y1.nv-axis").classed("nv-disabled", !G.length).attr("transform", "translate(" + p.range()[0] + ",0)"), z.select(".nv-y2.nv-axis").classed("nv-disabled", !F.length).attr("transform", "translate(" + p.range()[1] + ",0)"), I.dispatch.on("stateChange", function(t) { e.update() }), h.dispatch.on("elementMouseover.tooltip", u), y.dispatch.on("elementMouseover.tooltip", u), h.dispatch.on("elementMouseout.tooltip", function(e) { C.hidden(!0) }), y.dispatch.on("elementMouseout.tooltip", function(e) { C.hidden(!0) }), S.dispatch.on("elementMouseover.tooltip", d), _.dispatch.on("elementMouseover.tooltip", d), S.dispatch.on("elementMouseout.tooltip", function(e) { C.hidden(!0) }), _.dispatch.on("elementMouseout.tooltip", function(e) { C.hidden(!0) }), E.dispatch.on("elementMouseover.tooltip", m), b.dispatch.on("elementMouseover.tooltip", m), E.dispatch.on("elementMouseout.tooltip", function(e) { C.hidden(!0) }), b.dispatch.on("elementMouseout.tooltip", function(e) { C.hidden(!0) }), E.dispatch.on("elementMousemove.tooltip", function(e) { C.position({ top: d3.event.pageY, left: d3.event.pageX })() }), b.dispatch.on("elementMousemove.tooltip", function(e) { C.position({ top: d3.event.pageY, left: d3.event.pageX })() }) }), e } var n, r, o = { top: 30, right: 20, bottom: 50, left: 60 }, i = t.utils.defaultColor(), a = null, s = null, l = !0, c = null, u = function(e) { return e.x }, d = function(e) { return e.y }, f = "monotone", m = !0, p = d3.scale.linear(), g = d3.scale.linear(), v = d3.scale.linear(), h = t.models.line().yScale(g), y = t.models.line().yScale(v), E = t.models.multiBar().stacked(!1).yScale(g), b = t.models.multiBar().stacked(!1).yScale(v), S = t.models.stackedArea().yScale(g), _ = t.models.stackedArea().yScale(v), w = t.models.axis().scale(p).orient("bottom").tickPadding(5), A = t.models.axis().scale(g).orient("left"), T = t.models.axis().scale(v).orient("right"), I = t.models.legend().height(30), C = t.models.tooltip(), x = d3.dispatch(); return e.dispatch = x, e.lines1 = h, e.lines2 = y, e.bars1 = E, e.bars2 = b, e.stack1 = S, e.stack2 = _, e.xAxis = w, e.yAxis1 = A, e.yAxis2 = T, e.tooltip = C, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return a }, set: function(e) { a = e } }, height: { get: function() { return s }, set: function(e) { s = e } }, showLegend: { get: function() { return l }, set: function(e) { l = e } }, yDomain1: { get: function() { return n }, set: function(e) { n = e } }, yDomain2: { get: function() { return r }, set: function(e) { r = e } }, noData: { get: function() { return c }, set: function(e) { c = e } }, interpolate: { get: function() { return f }, set: function(e) { f = e } }, tooltips: { get: function() { return C.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), C.enabled(!!e) } }, tooltipContent: { get: function() { return C.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), C.contentGenerator(e) } }, margin: { get: function() { return o }, set: function(e) { o.top = void 0 !== e.top ? e.top : o.top, o.right = void 0 !== e.right ? e.right : o.right, o.bottom = void 0 !== e.bottom ? e.bottom : o.bottom, o.left = void 0 !== e.left ? e.left : o.left } }, color: { get: function() { return i }, set: function(e) { i = t.utils.getColor(e) } }, x: { get: function() { return u }, set: function(e) { u = e, h.x(e), y.x(e), E.x(e), b.x(e), S.x(e), _.x(e) } }, y: { get: function() { return d }, set: function(e) { d = e, h.y(e), y.y(e), S.y(e), _.y(e), E.y(e), b.y(e) } }, useVoronoi: { get: function() { return m }, set: function(e) { m = e, h.useVoronoi(e), y.useVoronoi(e), S.useVoronoi(e), _.useVoronoi(e) } } }), t.utils.initOptions(e), e }, t.models.ohlcBar = function() { "use strict"; function e(A) { return A.each(function(e) { u = d3.select(this); var A = t.utils.availableWidth(s, u, a), I = t.utils.availableHeight(l, u, a); t.utils.initSVG(u); var C = A / e[0].values.length * .9; d.domain(n || d3.extent(e[0].values.map(m).concat(E))), S ? d.range(o || [.5 * A / e[0].values.length, A * (e[0].values.length - .5) / e[0].values.length]) : d.range(o || [5 + C / 2, A - C / 2 - 5]), f.domain(r || [d3.min(e[0].values.map(y).concat(b)), d3.max(e[0].values.map(h).concat(b))]).range(i || [I, 0]), d.domain()[0] === d.domain()[1] && (d.domain()[0] ? d.domain([d.domain()[0] - .01 * d.domain()[0], d.domain()[1] + .01 * d.domain()[1]]) : d.domain([-1, 1])), f.domain()[0] === f.domain()[1] && (f.domain()[0] ? f.domain([f.domain()[0] + .01 * f.domain()[0], f.domain()[1] - .01 * f.domain()[1]]) : f.domain([-1, 1])); var x = d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([e[0].values]), M = x.enter().append("g").attr("class", "nvd3 nv-wrap nv-ohlcBar"), D = M.append("defs"), O = M.append("g"), R = x.select("g"); O.append("g").attr("class", "nv-ticks"), x.attr("transform", "translate(" + a.left + "," + a.top + ")"), u.on("click", function(e, t) { T.chartClick({ data: e, index: t, pos: d3.event, id: c }) }), D.append("clipPath").attr("id", "nv-chart-clip-path-" + c).append("rect"), x.select("#nv-chart-clip-path-" + c + " rect").attr("width", A).attr("height", I), R.attr("clip-path", _ ? "url(#nv-chart-clip-path-" + c + ")" : ""); var N = x.select(".nv-ticks").selectAll(".nv-tick").data(function(e) { return e }); N.exit().remove(), N.enter().append("path").attr("class", function(e, t, n) { return (g(e, t) > v(e, t) ? "nv-tick negative" : "nv-tick positive") + " nv-tick-" + n + "-" + t }).attr("d", function(e, t) { return "m0,0l0," + (f(g(e, t)) - f(h(e, t))) + "l" + -C / 2 + ",0l" + C / 2 + ",0l0," + (f(y(e, t)) - f(g(e, t))) + "l0," + (f(v(e, t)) - f(y(e, t))) + "l" + C / 2 + ",0l" + -C / 2 + ",0z" }).attr("transform", function(e, t) { return "translate(" + d(m(e, t)) + "," + f(h(e, t)) + ")" }).attr("fill", function(e, t) { return w[0] }).attr("stroke", function(e, t) { return w[0] }).attr("x", 0).attr("y", function(e, t) { return f(Math.max(0, p(e, t))) }).attr("height", function(e, t) { return Math.abs(f(p(e, t)) - f(0)) }), N.attr("class", function(e, t, n) { return (g(e, t) > v(e, t) ? "nv-tick negative" : "nv-tick positive") + " nv-tick-" + n + "-" + t }), d3.transition(N).attr("transform", function(e, t) { return "translate(" + d(m(e, t)) + "," + f(h(e, t)) + ")" }).attr("d", function(t, n) { var r = A / e[0].values.length * .9; return "m0,0l0," + (f(g(t, n)) - f(h(t, n))) + "l" + -r / 2 + ",0l" + r / 2 + ",0l0," + (f(y(t, n)) - f(g(t, n))) + "l0," + (f(v(t, n)) - f(y(t, n))) + "l" + r / 2 + ",0l" + -r / 2 + ",0z" }) }), e } var n, r, o, i, a = { top: 0, right: 0, bottom: 0, left: 0 }, s = null, l = null, c = Math.floor(1e4 * Math.random()), u = null, d = d3.scale.linear(), f = d3.scale.linear(), m = function(e) { return e.x }, p = function(e) { return e.y }, g = function(e) { return e.open }, v = function(e) { return e.close }, h = function(e) { return e.high }, y = function(e) { return e.low }, E = [], b = [], S = !1, _ = !0, w = t.utils.defaultColor(), A = !1, T = d3.dispatch("tooltipShow", "tooltipHide", "stateChange", "changeState", "renderEnd", "chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove"); return e.highlightPoint = function(t, n) { e.clearHighlights(), u.select(".nv-ohlcBar .nv-tick-0-" + t).classed("hover", n) }, e.clearHighlights = function() { u.select(".nv-ohlcBar .nv-tick.hover").classed("hover", !1) }, e.dispatch = T, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return s }, set: function(e) { s = e } }, height: { get: function() { return l }, set: function(e) { l = e } }, xScale: { get: function() { return d }, set: function(e) { d = e } }, yScale: { get: function() { return f }, set: function(e) { f = e } }, xDomain: { get: function() { return n }, set: function(e) { n = e } }, yDomain: { get: function() { return r }, set: function(e) { r = e } }, xRange: { get: function() { return o }, set: function(e) { o = e } }, yRange: { get: function() { return i }, set: function(e) { i = e } }, forceX: { get: function() { return E }, set: function(e) { E = e } }, forceY: { get: function() { return b }, set: function(e) { b = e } }, padData: { get: function() { return S }, set: function(e) { S = e } }, clipEdge: { get: function() { return _ }, set: function(e) { _ = e } }, id: { get: function() { return c }, set: function(e) { c = e } }, interactive: { get: function() { return A }, set: function(e) { A = e } }, x: { get: function() { return m }, set: function(e) { m = e } }, y: { get: function() { return p }, set: function(e) { p = e } }, open: { get: function() { return g() }, set: function(e) { g = e } }, close: { get: function() { return v() }, set: function(e) { v = e } }, high: { get: function() { return h }, set: function(e) { h = e } }, low: { get: function() { return y }, set: function(e) { y = e } }, margin: { get: function() { return a }, set: function(e) { a.top = void 0 != e.top ? e.top : a.top, a.right = void 0 != e.right ? e.right : a.right, a.bottom = void 0 != e.bottom ? e.bottom : a.bottom, a.left = void 0 != e.left ? e.left : a.left } }, color: { get: function() { return w }, set: function(e) { w = t.utils.getColor(e) } } }), t.utils.initOptions(e), e }, t.models.parallelCoordinates = function() { "use strict"; function e(g) { return g.each(function(e) { function g(e) { return O(s.map(function(t) { if (isNaN(e[t]) || isNaN(parseFloat(e[t]))) { var n = a[t].domain(), r = a[t].range(), o = n[0] - (n[1] - n[0]) / 9; if (P.indexOf(t) < 0) { var s = d3.scale.linear().domain([o, n[1]]).range([w - 12, r[1]]); a[t].brush.y(s), P.push(t) } return [i(t), a[t](o)] } return P.length > 0 ? (M.style("display", "inline"), D.style("display", "inline")) : (M.style("display", "none"), D.style("display", "none")), [i(t), a[t](e[t])] })) } function v() { var e = s.filter(function(e) { return !a[e].brush.empty() }), t = e.map(function(e) { return a[e].brush.extent() }); u = [], e.forEach(function(e, n) { u[n] = { dimension: e, extent: t[n] } }), d = [], F.style("display", function(n) { var r = e.every(function(e, r) { return !(!isNaN(n[e]) || t[r][0] != a[e].brush.y().domain()[0]) || t[r][0] <= n[e] && n[e] <= t[r][1] }); return r && d.push(n), r ? null : "none" }), p.brush({ filters: u, active: d }) } function h(e, t) { f[e] = this.parentNode.__origin__ = i(e), G.attr("visibility", "hidden") } function y(e, t) { f[e] = Math.min(_, Math.max(0, this.parentNode.__origin__ += d3.event.x)), F.attr("d", g), s.sort(function(e, t) { return b(e) - b(t) }), i.domain(s), U.attr("transform", function(e) { return "translate(" + b(e) + ")" }) } function E(e, t) { delete this.parentNode.__origin__, delete f[e], d3.select(this.parentNode).attr("transform", "translate(" + i(e) + ")"), F.attr("d", g), G.attr("d", g).attr("visibility", null) } function b(e) { var t = f[e]; return null == t ? i(e) : t } var S = d3.select(this), _ = t.utils.availableWidth(r, S, n), w = t.utils.availableHeight(o, S, n); t.utils.initSVG(S), d = e, i.rangePoints([0, _], 1).domain(s); var A = {}; s.forEach(function(t) { var n = d3.extent(e, function(e) { return +e[t] }); return A[t] = !1, void 0 === n[0] && (A[t] = !0, n[0] = 0, n[1] = 0), n[0] === n[1] && (n[0] = n[0] - 1, n[1] = n[1] + 1), a[t] = d3.scale.linear().domain(n).range([.9 * (w - 12), 0]), a[t].brush = d3.svg.brush().y(a[t]).on("brush", v), "name" != t }); var T = S.selectAll("g.nv-wrap.nv-parallelCoordinates").data([e]), I = T.enter().append("g").attr("class", "nvd3 nv-wrap nv-parallelCoordinates"), C = I.append("g"), x = T.select("g"); C.append("g").attr("class", "nv-parallelCoordinates background"), C.append("g").attr("class", "nv-parallelCoordinates foreground"), C.append("g").attr("class", "nv-parallelCoordinates missingValuesline"), T.attr("transform", "translate(" + n.left + "," + n.top + ")"); var M, D, O = d3.svg.line().interpolate("cardinal").tension(m), R = d3.svg.axis().orient("left"), N = d3.behavior.drag().on("dragstart", h).on("drag", y).on("dragend", E), L = i.range()[1] - i.range()[0], P = [], k = [0 + L / 2, w - 12, _ - L / 2, w - 12]; M = T.select(".missingValuesline").selectAll("line").data([k]), M.enter().append("line"), M.exit().remove(), M.attr("x1", function(e) { return e[0] }).attr("y1", function(e) { return e[1] }).attr("x2", function(e) { return e[2] }).attr("y2", function(e) { return e[3] }), D = T.select(".missingValuesline").selectAll("text").data(["undefined values"]), D.append("text").data(["undefined values"]), D.enter().append("text"), D.exit().remove(), D.attr("y", w).attr("x", _ - 92 - L / 2).text(function(e) { return e }); var G = T.select(".background").selectAll("path").data(e); G.enter().append("path"), G.exit().remove(), G.attr("d", g); var F = T.select(".foreground").selectAll("path").data(e); F.enter().append("path"), F.exit().remove(), F.attr("d", g).attr("stroke", c), F.on("mouseover", function(e, t) { d3.select(this).classed("hover", !0), p.elementMouseover({ label: e.name, data: e.data, index: t, pos: [d3.mouse(this.parentNode)[0], d3.mouse(this.parentNode)[1]] }) }), F.on("mouseout", function(e, t) { d3.select(this).classed("hover", !1), p.elementMouseout({ label: e.name, data: e.data, index: t }) }); var U = x.selectAll(".dimension").data(s), V = U.enter().append("g").attr("class", "nv-parallelCoordinates dimension"); V.append("g").attr("class", "nv-parallelCoordinates nv-axis"), V.append("g").attr("class", "nv-parallelCoordinates-brush"), V.append("text").attr("class", "nv-parallelCoordinates nv-label"), U.attr("transform", function(e) { return "translate(" + i(e) + ",0)" }), U.exit().remove(), U.select(".nv-label").style("cursor", "move").attr("dy", "-1em").attr("text-anchor", "middle").text(String).on("mouseover", function(e, t) { p.elementMouseover({ dim: e, pos: [d3.mouse(this.parentNode.parentNode)[0], d3.mouse(this.parentNode.parentNode)[1]] }) }).on("mouseout", function(e, t) { p.elementMouseout({ dim: e }) }).call(N), U.select(".nv-axis").each(function(e, t) { d3.select(this).call(R.scale(a[e]).tickFormat(d3.format(l[t]))) }), U.select(".nv-parallelCoordinates-brush").each(function(e) { d3.select(this).call(a[e].brush) }).selectAll("rect").attr("x", -8).attr("width", 16) }), e } var n = { top: 30, right: 0, bottom: 10, left: 0 }, r = null, o = null, i = d3.scale.ordinal(), a = {}, s = [], l = [], c = t.utils.defaultColor(), u = [], d = [], f = [], m = 1, p = d3.dispatch("brush", "elementMouseover", "elementMouseout"); return e.dispatch = p, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return r }, set: function(e) { r = e } }, height: { get: function() { return o }, set: function(e) { o = e } }, dimensionNames: { get: function() { return s }, set: function(e) { s = e } }, dimensionFormats: { get: function() { return l }, set: function(e) { l = e } }, lineTension: { get: function() { return m }, set: function(e) { m = e } }, dimensions: { get: function() { return s }, set: function(e) { t.deprecated("dimensions", "use dimensionNames instead"), s = e } }, margin: { get: function() { return n }, set: function(e) { n.top = void 0 !== e.top ? e.top : n.top, n.right = void 0 !== e.right ? e.right : n.right, n.bottom = void 0 !== e.bottom ? e.bottom : n.bottom, n.left = void 0 !== e.left ? e.left : n.left } }, color: { get: function() { return c }, set: function(e) { c = t.utils.getColor(e) } } }), t.utils.initOptions(e), e }, t.models.pie = function() { "use strict"; function e(D) { return M.reset(), D.each(function(e) { function D(e, t) { e.endAngle = isNaN(e.endAngle) ? 0 : e.endAngle, e.startAngle = isNaN(e.startAngle) ? 0 : e.startAngle, g || (e.innerRadius = 0); var n = d3.interpolate(this._current, e); return this._current = n(0), function(e) { return C[t](n(e)) } } var O = r - n.left - n.right, R = o - n.top - n.bottom, N = Math.min(O, R) / 2, L = [], P = []; if (l = d3.select(this), 0 === T.length) for (var k = N - N / 5, G = A * N, F = 0; F < e[0].length; F++) L.push(k), P.push(G); else L = T.map(function(e) { return (e.outer - e.outer / 5) * N }), P = T.map(function(e) { return (e.inner - e.inner / 5) * N }), A = d3.min(T.map(function(e) { return e.inner - e.inner / 5 })); t.utils.initSVG(l); var U = l.selectAll(".nv-wrap.nv-pie").data(e), V = U.enter().append("g").attr("class", "nvd3 nv-wrap nv-pie nv-chart-" + s), z = V.append("g"), B = U.select("g"), $ = z.append("g").attr("class", "nv-pie"); z.append("g").attr("class", "nv-pieLabels"), U.attr("transform", "translate(" + n.left + "," + n.top + ")"), B.select(".nv-pie").attr("transform", "translate(" + O / 2 + "," + R / 2 + ")"), B.select(".nv-pieLabels").attr("transform", "translate(" + O / 2 + "," + R / 2 + ")"), l.on("click", function(e, t) { I.chartClick({ data: e, index: t, pos: d3.event, id: s }) }), C = [], x = []; for (var F = 0; F < e[0].length; F++) { var W = d3.svg.arc().outerRadius(L[F]), H = d3.svg.arc().outerRadius(L[F] + 5); b !== !1 && (W.startAngle(b), H.startAngle(b)), _ !== !1 && (W.endAngle(_), H.endAngle(_)), g && (W.innerRadius(P[F]), H.innerRadius(P[F])), W.cornerRadius && w && (W.cornerRadius(w), H.cornerRadius(w)), C.push(W), x.push(H) } var j = d3.layout.pie().sort(null).value(function(e) { return e.disabled ? 0 : a(e) }); j.padAngle && S && j.padAngle(S), g && v && ($.append("text").attr("class", "nv-pie-title"), U.select(".nv-pie-title").style("text-anchor", "middle").text(function(e) { return v }).style("font-size", Math.min(O, R) * A * 2 / (v.length + 2) + "px").attr("dy", "0.35em").attr("transform", function(e, t) { return "translate(0, " + y + ")" })); var Y = U.select(".nv-pie").selectAll(".nv-slice").data(j), q = U.select(".nv-pieLabels").selectAll(".nv-label").data(j); Y.exit().remove(), q.exit().remove(); var K = Y.enter().append("g"); K.attr("class", "nv-slice"), K.on("mouseover", function(e, t) { d3.select(this).classed("hover", !0), h && d3.select(this).select("path").transition().duration(70).attr("d", x[t]), I.elementMouseover({ data: e.data, index: t, color: d3.select(this).style("fill") }) }), K.on("mouseout", function(e, t) { d3.select(this).classed("hover", !1), h && d3.select(this).select("path").transition().duration(50).attr("d", C[t]), I.elementMouseout({ data: e.data, index: t }) }), K.on("mousemove", function(e, t) { I.elementMousemove({ data: e.data, index: t }) }), K.on("click", function(e, t) { I.elementClick({ data: e.data, index: t, color: d3.select(this).style("fill") }) }), K.on("dblclick", function(e, t) { I.elementDblClick({ data: e.data, index: t, color: d3.select(this).style("fill") }) }), Y.attr("fill", function(e, t) { return c(e.data, t) }), Y.attr("stroke", function(e, t) { return c(e.data, t) }); K.append("path").each(function(e) { this._current = e }); if (Y.select("path").transition().attr("d", function(e, t) { return C[t](e) }).attrTween("d", D), d) { for (var Q = [], F = 0; F < e[0].length; F++) Q.push(C[F]), f ? g && (Q[F] = d3.svg.arc().outerRadius(C[F].outerRadius()), b !== !1 && Q[F].startAngle(b), _ !== !1 && Q[F].endAngle(_)) : g || Q[F].innerRadius(0); q.enter().append("g").classed("nv-label", !0).each(function(e, t) { var n = d3.select(this); n.attr("transform", function(e, t) { if (E) { e.outerRadius = L[t] + 10, e.innerRadius = L[t] + 15; var n = (e.startAngle + e.endAngle) / 2 * (180 / Math.PI); return (e.startAngle + e.endAngle) / 2 < Math.PI ? n -= 90 : n += 90, "translate(" + Q[t].centroid(e) + ") rotate(" + n + ")" } return e.outerRadius = N + 10, e.innerRadius = N + 15, "translate(" + Q[t].centroid(e) + ")" }), n.append("rect").style("stroke", "#fff").style("fill", "#fff").attr("rx", 3).attr("ry", 3), n.append("text").style("text-anchor", E ? (e.startAngle + e.endAngle) / 2 < Math.PI ? "start" : "end" : "middle").style("fill", "#000") }); var Z = {}, X = 14, J = 140, ee = function(e) { return Math.floor(e[0] / J) * J + "," + Math.floor(e[1] / X) * X }; q.watchTransition(M, "pie labels").attr("transform", function(e, t) { if (E) { e.outerRadius = L[t] + 10, e.innerRadius = L[t] + 15; var n = (e.startAngle + e.endAngle) / 2 * (180 / Math.PI); return (e.startAngle + e.endAngle) / 2 < Math.PI ? n -= 90 : n += 90, "translate(" + Q[t].centroid(e) + ") rotate(" + n + ")" } e.outerRadius = N + 10, e.innerRadius = N + 15; var r = Q[t].centroid(e); if (e.value) { var o = ee(r); Z[o] && (r[1] -= X), Z[ee(r)] = !0 } return "translate(" + r + ")" }), q.select(".nv-label text").style("text-anchor", function(e, t) { return E ? (e.startAngle + e.endAngle) / 2 < Math.PI ? "start" : "end" : "middle" }).text(function(e, t) { var n = (e.endAngle - e.startAngle) / (2 * Math.PI), r = ""; if (!e.value || n < p) return ""; if ("function" == typeof m) r = m(e, t, { key: i(e.data), value: a(e.data), percent: u(n) }); else switch (m) { case "key": r = i(e.data); break; case "value": r = u(a(e.data)); break; case "percent": r = d3.format("%")(n) } return r }) } }), M.renderEnd("pie immediate"), e } var n = { top: 0, right: 0, bottom: 0, left: 0 }, r = 500, o = 500, i = function(e) { return e.x }, a = function(e) { return e.y }, s = Math.floor(1e4 * Math.random()), l = null, c = t.utils.defaultColor(), u = d3.format(",.2f"), d = !0, f = !1, m = "key", p = .02, g = !1, v = !1, h = !0, y = 0, E = !1, b = !1, S = !1, _ = !1, w = 0, A = .5, T = [], I = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "elementMousemove", "renderEnd"), C = [], x = [], M = t.utils.renderWatch(I); return e.dispatch = I, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { arcsRadius: { get: function() { return T }, set: function(e) { T = e } }, width: { get: function() { return r }, set: function(e) { r = e } }, height: { get: function() { return o }, set: function(e) { o = e } }, showLabels: { get: function() { return d }, set: function(e) { d = e } }, title: { get: function() { return v }, set: function(e) { v = e } }, titleOffset: { get: function() { return y }, set: function(e) { y = e } }, labelThreshold: { get: function() { return p }, set: function(e) { p = e } }, valueFormat: { get: function() { return u }, set: function(e) { u = e } }, x: { get: function() { return i }, set: function(e) { i = e } }, id: { get: function() { return s }, set: function(e) { s = e } }, endAngle: { get: function() { return _ }, set: function(e) { _ = e } }, startAngle: { get: function() { return b }, set: function(e) { b = e } }, padAngle: { get: function() { return S }, set: function(e) { S = e } }, cornerRadius: { get: function() { return w }, set: function(e) { w = e } }, donutRatio: { get: function() { return A }, set: function(e) { A = e } }, labelsOutside: { get: function() { return f }, set: function(e) { f = e } }, labelSunbeamLayout: { get: function() { return E }, set: function(e) { E = e } }, donut: { get: function() { return g }, set: function(e) { g = e } }, growOnHover: { get: function() { return h }, set: function(e) { h = e } }, pieLabelsOutside: { get: function() { return f }, set: function(e) { f = e, t.deprecated("pieLabelsOutside", "use labelsOutside instead") } }, donutLabelsOutside: { get: function() { return f }, set: function(e) { f = e, t.deprecated("donutLabelsOutside", "use labelsOutside instead") } }, labelFormat: { get: function() { return u }, set: function(e) { u = e, t.deprecated("labelFormat", "use valueFormat instead") } }, margin: { get: function() { return n }, set: function(e) { n.top = "undefined" != typeof e.top ? e.top : n.top, n.right = "undefined" != typeof e.right ? e.right : n.right, n.bottom = "undefined" != typeof e.bottom ? e.bottom : n.bottom, n.left = "undefined" != typeof e.left ? e.left : n.left } }, y: { get: function() { return a }, set: function(e) { a = d3.functor(e) } }, color: { get: function() { return c }, set: function(e) { c = t.utils.getColor(e) } }, labelType: { get: function() { return m }, set: function(e) { m = e || "key" } } }), t.utils.initOptions(e), e }, t.models.pieChart = function() { "use strict"; function e(o) { return v.reset(), v.models(n), o.each(function(o) { var u = d3.select(this); t.utils.initSVG(u); var m = t.utils.availableWidth(a, u, i), p = t.utils.availableHeight(s, u, i); if (e.update = function() { u.transition().call(e) }, e.container = this, d.setter(y(o), e.update).getter(h(o)).update(), d.disabled = o.map(function(e) { return !!e.disabled }), !f) { var v; f = {}; for (v in d) d[v] instanceof Array ? f[v] = d[v].slice(0) : f[v] = d[v] } if (!o || !o.length) return t.utils.noData(e, u), e; u.selectAll(".nv-noData").remove(); var E = u.selectAll("g.nv-wrap.nv-pieChart").data([o]), b = E.enter().append("g").attr("class", "nvd3 nv-wrap nv-pieChart").append("g"), S = E.select("g"); if (b.append("g").attr("class", "nv-pieWrap"), b.append("g").attr("class", "nv-legendWrap"), l) if ("top" === c) r.width(m).key(n.x()), E.select(".nv-legendWrap").datum(o).call(r), i.top != r.height() && (i.top = r.height(), p = t.utils.availableHeight(s, u, i)), E.select(".nv-legendWrap").attr("transform", "translate(0," + -i.top + ")"); else if ("right" === c) { var _ = t.models.legend().width(); m / 2 < _ && (_ = m / 2), r.height(p).key(n.x()), r.width(_), m -= r.width(), E.select(".nv-legendWrap").datum(o).call(r).attr("transform", "translate(" + m + ",0)") } E.attr("transform", "translate(" + i.left + "," + i.top + ")"), n.width(m).height(p); var w = S.select(".nv-pieWrap").datum([o]); d3.transition(w).call(n), r.dispatch.on("stateChange", function(t) { for (var n in t) d[n] = t[n]; g.stateChange(d), e.update() }), g.on("changeState", function(t) { "undefined" != typeof t.disabled && (o.forEach(function(e, n) { e.disabled = t.disabled[n] }), d.disabled = t.disabled), e.update() }) }), v.renderEnd("pieChart immediate"), e } var n = t.models.pie(), r = t.models.legend(), o = t.models.tooltip(), i = { top: 30, right: 20, bottom: 20, left: 20 }, a = null, s = null, l = !0, c = "top", u = t.utils.defaultColor(), d = t.utils.state(), f = null, m = null, p = 250, g = d3.dispatch("tooltipShow", "tooltipHide", "stateChange", "changeState", "renderEnd"); o.headerEnabled(!1).duration(0).valueFormatter(function(e, t) { return n.valueFormat()(e, t) }); var v = t.utils.renderWatch(g), h = function(e) { return function() { return { active: e.map(function(e) { return !e.disabled }) } } }, y = function(e) { return function(t) { void 0 !== t.active && e.forEach(function(e, n) { e.disabled = !t.active[n] }) } }; return n.dispatch.on("elementMouseover.tooltip", function(t) { t.series = { key: e.x()(t.data), value: e.y()(t.data), color: t.color }, o.data(t).hidden(!1) }), n.dispatch.on("elementMouseout.tooltip", function(e) { o.hidden(!0) }), n.dispatch.on("elementMousemove.tooltip", function(e) { o.position({ top: d3.event.pageY, left: d3.event.pageX })() }), e.legend = r, e.dispatch = g, e.pie = n, e.tooltip = o, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { noData: { get: function() { return m }, set: function(e) { m = e } }, showLegend: { get: function() { return l }, set: function(e) { l = e } }, legendPosition: { get: function() { return c }, set: function(e) { c = e } }, defaultState: { get: function() { return f }, set: function(e) { f = e } }, tooltips: { get: function() { return o.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), o.enabled(!!e) } }, tooltipContent: { get: function() { return o.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), o.contentGenerator(e) } }, color: { get: function() { return u }, set: function(e) { u = e, r.color(u), n.color(u) } }, duration: { get: function() { return p }, set: function(e) { p = e, v.reset(p) } }, margin: { get: function() { return i }, set: function(e) { i.top = void 0 !== e.top ? e.top : i.top, i.right = void 0 !== e.right ? e.right : i.right, i.bottom = void 0 !== e.bottom ? e.bottom : i.bottom, i.left = void 0 !== e.left ? e.left : i.left } } }), t.utils.inheritOptions(e, n), t.utils.initOptions(e), e }, t.models.scatter = function() { "use strict"; function e(U) { return z.reset(), U.each(function(e) { function U() { if (V = !1, !_) return !1; if (F === !0) { var t = d3.merge(e.map(function(e, t) { return e.values.map(function(e, n) { var r = g(e, n), o = v(e, n); return [f(r) + 1e-4 * Math.random(), m(o) + 1e-4 * Math.random(), t, n, e] }).filter(function(e, t) { return w(e[4], t) }) })); if (0 == t.length) return !1; t.length < 3 && (t.push([f.range()[0] - 20, m.range()[0] - 20, null, null]), t.push([f.range()[1] + 20, m.range()[1] + 20, null, null]), t.push([f.range()[0] - 20, m.range()[0] + 20, null, null]), t.push([f.range()[1] + 20, m.range()[1] - 20, null, null])); var n = d3.geom.polygon([ [-10, -10], [-10, l + 10], [s + 10, l + 10], [s + 10, -10] ]), r = d3.geom.voronoi(t).map(function(e, r) { return { data: n.clip(e), series: t[r][2], point: t[r][3] } }); j.select(".nv-point-paths").selectAll("path").remove(); var o = j.select(".nv-point-paths").selectAll("path").data(r), i = o.enter().append("svg:path").attr("d", function(e) { return e && e.data && 0 !== e.data.length ? "M" + e.data.join(",") + "Z" : "M 0 0" }).attr("id", function(e, t) { return "nv-path-" + t }).attr("clip-path", function(e, t) { return "url(#nv-clip-" + t + ")" }); x && i.style("fill", d3.rgb(230, 230, 230)).style("fill-opacity", .4).style("stroke-opacity", 1).style("stroke", d3.rgb(200, 200, 200)), C && (j.select(".nv-point-clips").selectAll("clipPath").remove(), j.select(".nv-point-clips").selectAll("clipPath").data(t).enter().append("svg:clipPath").attr("id", function(e, t) { return "nv-clip-" + t }).append("svg:circle").attr("cx", function(e) { return e[0] }).attr("cy", function(e) { return e[1] }).attr("r", M)); var u = function(t, n) { if (V) return 0; var r = e[t.series]; if (void 0 !== r) { var o = r.values[t.point]; o.color = c(r, t.series), o.x = g(o), o.y = v(o); var i = d.node().getBoundingClientRect(), s = window.pageYOffset || document.documentElement.scrollTop, l = window.pageXOffset || document.documentElement.scrollLeft, u = { left: f(g(o, t.point)) + i.left + l + a.left + 10, top: m(v(o, t.point)) + i.top + s + a.top + 10 }; n({ point: o, series: r, pos: u, seriesIndex: t.series, pointIndex: t.point }) } }; o.on("click", function(e) { u(e, G.elementClick) }).on("dblclick", function(e) { u(e, G.elementDblClick) }).on("mouseover", function(e) { u(e, G.elementMouseover) }).on("mouseout", function(e, t) { u(e, G.elementMouseout) }) } else j.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click", function(t, n) { if (V || !e[t.series]) return 0; var r = e[t.series], o = r.values[n]; G.elementClick({ point: o, series: r, pos: [f(g(o, n)) + a.left, m(v(o, n)) + a.top], seriesIndex: t.series, pointIndex: n }) }).on("dblclick", function(t, n) { if (V || !e[t.series]) return 0; var r = e[t.series], o = r.values[n]; G.elementDblClick({ point: o, series: r, pos: [f(g(o, n)) + a.left, m(v(o, n)) + a.top], seriesIndex: t.series, pointIndex: n }) }).on("mouseover", function(t, n) { if (V || !e[t.series]) return 0; var r = e[t.series], o = r.values[n]; G.elementMouseover({ point: o, series: r, pos: [f(g(o, n)) + a.left, m(v(o, n)) + a.top], seriesIndex: t.series, pointIndex: n, color: c(t, n) }) }).on("mouseout", function(t, n) { if (V || !e[t.series]) return 0; var r = e[t.series], o = r.values[n]; G.elementMouseout({ point: o, series: r, seriesIndex: t.series, pointIndex: n, color: c(t, n) }) }) } d = d3.select(this); var $ = t.utils.availableWidth(s, d, a), W = t.utils.availableHeight(l, d, a); t.utils.initSVG(d), e.forEach(function(e, t) { e.values.forEach(function(e) { e.series = t }) }); var H = D && O && L ? [] : d3.merge(e.map(function(e) { return e.values.map(function(e, t) { return { x: g(e, t), y: v(e, t), size: h(e, t) } }) })); f.domain(D || d3.extent(H.map(function(e) { return e.x }).concat(E))), A && e[0] ? f.range(R || [($ * T + $) / (2 * e[0].values.length), $ - $ * (1 + T) / (2 * e[0].values.length)]) : f.range(R || [0, $]), m.domain(O || d3.extent(H.map(function(e) { return e.y }).concat(b))).range(N || [W, 0]), p.domain(L || d3.extent(H.map(function(e) { return e.size }).concat(S))).range(P || B), k = f.domain()[0] === f.domain()[1] || m.domain()[0] === m.domain()[1], f.domain()[0] === f.domain()[1] && (f.domain()[0] ? f.domain([f.domain()[0] - .01 * f.domain()[0], f.domain()[1] + .01 * f.domain()[1]]) : f.domain([-1, 1])), m.domain()[0] === m.domain()[1] && (m.domain()[0] ? m.domain([m.domain()[0] - .01 * m.domain()[0], m.domain()[1] + .01 * m.domain()[1]]) : m.domain([-1, 1])), isNaN(f.domain()[0]) && f.domain([-1, 1]), isNaN(m.domain()[0]) && m.domain([-1, 1]), n = n || f, r = r || m, o = o || p; var j = d.selectAll("g.nv-wrap.nv-scatter").data([e]), Y = j.enter().append("g").attr("class", "nvd3 nv-wrap nv-scatter nv-chart-" + u), q = Y.append("defs"), K = Y.append("g"), Q = j.select("g"); j.classed("nv-single-point", k), K.append("g").attr("class", "nv-groups"), K.append("g").attr("class", "nv-point-paths"), Y.append("g").attr("class", "nv-point-clips"), j.attr("transform", "translate(" + a.left + "," + a.top + ")"), q.append("clipPath").attr("id", "nv-edge-clip-" + u).append("rect"), j.select("#nv-edge-clip-" + u + " rect").attr("width", $).attr("height", W > 0 ? W : 0), Q.attr("clip-path", I ? "url(#nv-edge-clip-" + u + ")" : ""), V = !0; var Z = j.select(".nv-groups").selectAll(".nv-group").data(function(e) { return e }, function(e) { return e.key }); Z.enter().append("g").style("stroke-opacity", 1e-6).style("fill-opacity", 1e-6), Z.exit().remove(), Z.attr("class", function(e, t) { return "nv-group nv-series-" + t }).classed("hover", function(e) { return e.hover }), Z.watchTransition(z, "scatter: groups").style("fill", function(e, t) { return c(e, t) }).style("stroke", function(e, t) { return c(e, t) }).style("stroke-opacity", 1).style("fill-opacity", .5); var X = Z.selectAll("path.nv-point").data(function(e) { return e.values.map(function(e, t) { return [e, t] }).filter(function(e, t) { return w(e[0], t) }) }); X.enter().append("path").style("fill", function(e) { return e.color }).style("stroke", function(e) { return e.color }).attr("transform", function(e) { return "translate(" + n(g(e[0], e[1])) + "," + r(v(e[0], e[1])) + ")" }).attr("d", t.utils.symbol().type(function(e) { return y(e[0]) }).size(function(e) { return p(h(e[0], e[1])) })), X.exit().remove(), Z.exit().selectAll("path.nv-point").watchTransition(z, "scatter exit").attr("transform", function(e) { return "translate(" + f(g(e[0], e[1])) + "," + m(v(e[0], e[1])) + ")" }).remove(), X.each(function(e) { d3.select(this).classed("nv-point", !0).classed("nv-point-" + e[1], !0).classed("nv-noninteractive", !_).classed("hover", !1) }), X.watchTransition(z, "scatter points").attr("transform", function(e) { return "translate(" + f(g(e[0], e[1])) + "," + m(v(e[0], e[1])) + ")" }).attr("d", t.utils.symbol().type(function(e) { return y(e[0]) }).size(function(e) { return p(h(e[0], e[1])) })), clearTimeout(i), i = setTimeout(U, 300), n = f.copy(), r = m.copy(), o = p.copy() }), z.renderEnd("scatter immediate"), e } var n, r, o, i, a = { top: 0, right: 0, bottom: 0, left: 0 }, s = null, l = null, c = t.utils.defaultColor(), u = Math.floor(1e5 * Math.random()), d = null, f = d3.scale.linear(), m = d3.scale.linear(), p = d3.scale.linear(), g = function(e) { return e.x }, v = function(e) { return e.y }, h = function(e) { return e.size || 1 }, y = function(e) { return e.shape || "circle" }, E = [], b = [], S = [], _ = !0, w = function(e) { return !e.notActive }, A = !1, T = .1, I = !1, C = !0, x = !1, M = function() { return 25 }, D = null, O = null, R = null, N = null, L = null, P = null, k = !1, G = d3.dispatch("elementClick", "elementDblClick", "elementMouseover", "elementMouseout", "renderEnd"), F = !0, U = 250, V = !1, z = t.utils.renderWatch(G, U), B = [16, 256]; return e.dispatch = G, e.options = t.utils.optionsFunc.bind(e), e._calls = new function() { this.clearHighlights = function() { return t.dom.write(function() { d.selectAll(".nv-point.hover").classed("hover", !1) }), null }, this.highlightPoint = function(e, n, r) { t.dom.write(function() { d.select(" .nv-series-" + e + " .nv-point-" + n).classed("hover", r) }) } }, G.on("elementMouseover.point", function(t) { _ && e._calls.highlightPoint(t.seriesIndex, t.pointIndex, !0) }), G.on("elementMouseout.point", function(t) { _ && e._calls.highlightPoint(t.seriesIndex, t.pointIndex, !1) }), e._options = Object.create({}, { width: { get: function() { return s }, set: function(e) { s = e } }, height: { get: function() { return l }, set: function(e) { l = e } }, xScale: { get: function() { return f }, set: function(e) { f = e } }, yScale: { get: function() { return m }, set: function(e) { m = e } }, pointScale: { get: function() { return p }, set: function(e) { p = e } }, xDomain: { get: function() { return D }, set: function(e) { D = e } }, yDomain: { get: function() { return O }, set: function(e) { O = e } }, pointDomain: { get: function() { return L }, set: function(e) { L = e } }, xRange: { get: function() { return R }, set: function(e) { R = e } }, yRange: { get: function() { return N }, set: function(e) { N = e } }, pointRange: { get: function() { return P }, set: function(e) { P = e } }, forceX: { get: function() { return E }, set: function(e) { E = e } }, forceY: { get: function() { return b }, set: function(e) { b = e } }, forcePoint: { get: function() { return S }, set: function(e) { S = e } }, interactive: { get: function() { return _ }, set: function(e) { _ = e } }, pointActive: { get: function() { return w }, set: function(e) { w = e } }, padDataOuter: { get: function() { return T }, set: function(e) { T = e } }, padData: { get: function() { return A }, set: function(e) { A = e } }, clipEdge: { get: function() { return I }, set: function(e) { I = e } }, clipVoronoi: { get: function() { return C }, set: function(e) { C = e } }, clipRadius: { get: function() { return M }, set: function(e) { M = e } }, showVoronoi: { get: function() { return x }, set: function(e) { x = e } }, id: { get: function() { return u }, set: function(e) { u = e } }, x: { get: function() { return g }, set: function(e) { g = d3.functor(e) } }, y: { get: function() { return v }, set: function(e) { v = d3.functor(e) } }, pointSize: { get: function() { return h }, set: function(e) { h = d3.functor(e) } }, pointShape: { get: function() { return y }, set: function(e) { y = d3.functor(e) } }, margin: { get: function() { return a }, set: function(e) { a.top = void 0 !== e.top ? e.top : a.top, a.right = void 0 !== e.right ? e.right : a.right, a.bottom = void 0 !== e.bottom ? e.bottom : a.bottom, a.left = void 0 !== e.left ? e.left : a.left } }, duration: { get: function() { return U }, set: function(e) { U = e, z.reset(U) } }, color: { get: function() { return c }, set: function(e) { c = t.utils.getColor(e) } }, useVoronoi: { get: function() { return F }, set: function(e) { F = e, F === !1 && (C = !1) } } }), t.utils.initOptions(e), e }, t.models.scatterChart = function() { "use strict"; function e(T) { return M.reset(), M.models(n), E && M.models(r), b && M.models(o), v && M.models(a), h && M.models(s), T.each(function(T) { f = d3.select(this), t.utils.initSVG(f); var R = t.utils.availableWidth(u, f, c), N = t.utils.availableHeight(d, f, c); if (e.update = function() { 0 === I ? f.call(e) : f.transition().duration(I).call(e) }, e.container = this, _.setter(O(T), e.update).getter(D(T)).update(), _.disabled = T.map(function(e) { return !!e.disabled }), !w) { var L; w = {}; for (L in _) _[L] instanceof Array ? w[L] = _[L].slice(0) : w[L] = _[L] } if (!(T && T.length && T.filter(function(e) { return e.values.length }).length)) return t.utils.noData(e, f), M.renderEnd("scatter immediate"), e; f.selectAll(".nv-noData").remove(), p = n.xScale(), g = n.yScale(); var P = f.selectAll("g.nv-wrap.nv-scatterChart").data([T]), k = P.enter().append("g").attr("class", "nvd3 nv-wrap nv-scatterChart nv-chart-" + n.id()), G = k.append("g"), F = P.select("g"); if (G.append("rect").attr("class", "nvd3 nv-background").style("pointer-events", "none"), G.append("g").attr("class", "nv-x nv-axis"), G.append("g").attr("class", "nv-y nv-axis"), G.append("g").attr("class", "nv-scatterWrap"), G.append("g").attr("class", "nv-regressionLinesWrap"), G.append("g").attr("class", "nv-distWrap"), G.append("g").attr("class", "nv-legendWrap"), S && F.select(".nv-y.nv-axis").attr("transform", "translate(" + R + ",0)"), y) { var U = R; i.width(U), P.select(".nv-legendWrap").datum(T).call(i), c.top != i.height() && (c.top = i.height(), N = t.utils.availableHeight(d, f, c)), P.select(".nv-legendWrap").attr("transform", "translate(0," + -c.top + ")") } P.attr("transform", "translate(" + c.left + "," + c.top + ")"), n.width(R).height(N).color(T.map(function(e, t) { return e.color = e.color || m(e, t), e.color }).filter(function(e, t) { return !T[t].disabled })), P.select(".nv-scatterWrap").datum(T.filter(function(e) { return !e.disabled })).call(n), P.select(".nv-regressionLinesWrap").attr("clip-path", "url(#nv-edge-clip-" + n.id() + ")"); var V = P.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(e) { return e }); V.enter().append("g").attr("class", "nv-regLines"); var z = V.selectAll(".nv-regLine").data(function(e) { return [e] }); z.enter().append("line").attr("class", "nv-regLine").style("stroke-opacity", 0), z.filter(function(e) { return e.intercept && e.slope }).watchTransition(M, "scatterPlusLineChart: regline").attr("x1", p.range()[0]).attr("x2", p.range()[1]).attr("y1", function(e, t) { return g(p.domain()[0] * e.slope + e.intercept) }).attr("y2", function(e, t) { return g(p.domain()[1] * e.slope + e.intercept) }).style("stroke", function(e, t, n) { return m(e, n) }).style("stroke-opacity", function(e, t) { return e.disabled || "undefined" == typeof e.slope || "undefined" == typeof e.intercept ? 0 : 1 }), E && (r.scale(p)._ticks(t.utils.calcTicksX(R / 100, T)).tickSize(-N, 0), F.select(".nv-x.nv-axis").attr("transform", "translate(0," + g.range()[0] + ")").call(r)), b && (o.scale(g)._ticks(t.utils.calcTicksY(N / 36, T)).tickSize(-R, 0), F.select(".nv-y.nv-axis").call(o)), v && (a.getData(n.x()).scale(p).width(R).color(T.map(function(e, t) { return e.color || m(e, t) }).filter(function(e, t) { return !T[t].disabled })), G.select(".nv-distWrap").append("g").attr("class", "nv-distributionX"), F.select(".nv-distributionX").attr("transform", "translate(0," + g.range()[0] + ")").datum(T.filter(function(e) { return !e.disabled })).call(a)), h && (s.getData(n.y()).scale(g).width(N).color(T.map(function(e, t) { return e.color || m(e, t) }).filter(function(e, t) { return !T[t].disabled })), G.select(".nv-distWrap").append("g").attr("class", "nv-distributionY"), F.select(".nv-distributionY").attr("transform", "translate(" + (S ? R : -s.size()) + ",0)").datum(T.filter(function(e) { return !e.disabled })).call(s)), i.dispatch.on("stateChange", function(t) { for (var n in t) _[n] = t[n]; A.stateChange(_), e.update() }), A.on("changeState", function(t) { "undefined" != typeof t.disabled && (T.forEach(function(e, n) { e.disabled = t.disabled[n] }), _.disabled = t.disabled), e.update() }), n.dispatch.on("elementMouseout.tooltip", function(e) { l.hidden(!0), f.select(".nv-chart-" + n.id() + " .nv-series-" + e.seriesIndex + " .nv-distx-" + e.pointIndex).attr("y1", 0), f.select(".nv-chart-" + n.id() + " .nv-series-" + e.seriesIndex + " .nv-disty-" + e.pointIndex).attr("x2", s.size()) }), n.dispatch.on("elementMouseover.tooltip", function(e) { f.select(".nv-series-" + e.seriesIndex + " .nv-distx-" + e.pointIndex).attr("y1", e.pos.top - N - c.top), f.select(".nv-series-" + e.seriesIndex + " .nv-disty-" + e.pointIndex).attr("x2", e.pos.left + a.size() - c.left), l.position(e.pos).data(e).hidden(!1) }), C = p.copy(), x = g.copy() }), M.renderEnd("scatter with line immediate"), e } var n = t.models.scatter(), r = t.models.axis(), o = t.models.axis(), i = t.models.legend(), a = t.models.distribution(), s = t.models.distribution(), l = t.models.tooltip(), c = { top: 30, right: 20, bottom: 50, left: 75 }, u = null, d = null, f = null, m = t.utils.defaultColor(), p = n.xScale(), g = n.yScale(), v = !1, h = !1, y = !0, E = !0, b = !0, S = !1, _ = t.utils.state(), w = null, A = d3.dispatch("stateChange", "changeState", "renderEnd"), T = null, I = 250; n.xScale(p).yScale(g), r.orient("bottom").tickPadding(10), o.orient(S ? "right" : "left").tickPadding(10), a.axis("x"), s.axis("y"), l.headerFormatter(function(e, t) { return r.tickFormat()(e, t) }).valueFormatter(function(e, t) { return o.tickFormat()(e, t) }); var C, x, M = t.utils.renderWatch(A, I), D = function(e) { return function() { return { active: e.map(function(e) { return !e.disabled }) } } }, O = function(e) { return function(t) { void 0 !== t.active && e.forEach(function(e, n) { e.disabled = !t.active[n] }) } }; return e.dispatch = A, e.scatter = n, e.legend = i, e.xAxis = r, e.yAxis = o, e.distX = a, e.distY = s, e.tooltip = l, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return u }, set: function(e) { u = e } }, height: { get: function() { return d }, set: function(e) { d = e } }, container: { get: function() { return f }, set: function(e) { f = e } }, showDistX: { get: function() { return v }, set: function(e) { v = e } }, showDistY: { get: function() { return h }, set: function(e) { h = e } }, showLegend: { get: function() { return y }, set: function(e) { y = e } }, showXAxis: { get: function() { return E }, set: function(e) { E = e } }, showYAxis: { get: function() { return b }, set: function(e) { b = e } }, defaultState: { get: function() { return w }, set: function(e) { w = e } }, noData: { get: function() { return T }, set: function(e) { T = e } }, duration: { get: function() { return I }, set: function(e) { I = e } }, tooltips: { get: function() { return l.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), l.enabled(!!e) } }, tooltipContent: { get: function() { return l.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), l.contentGenerator(e) } }, tooltipXContent: { get: function() { return l.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "This option is removed, put values into main tooltip.") } }, tooltipYContent: { get: function() { return l.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "This option is removed, put values into main tooltip.") } }, margin: { get: function() { return c }, set: function(e) { c.top = void 0 !== e.top ? e.top : c.top, c.right = void 0 !== e.right ? e.right : c.right, c.bottom = void 0 !== e.bottom ? e.bottom : c.bottom, c.left = void 0 !== e.left ? e.left : c.left } }, rightAlignYAxis: { get: function() { return S }, set: function(e) { S = e, o.orient(e ? "right" : "left") } }, color: { get: function() { return m }, set: function(e) { m = t.utils.getColor(e), i.color(m), a.color(m), s.color(m) } } }), t.utils.inheritOptions(e, n), t.utils.initOptions(e), e }, t.models.sparkline = function() { "use strict"; function e(u) { return u.each(function(e) { var u = s - a.left - a.right, v = l - a.top - a.bottom; c = d3.select(this), t.utils.initSVG(c), d.domain(n || d3.extent(e, m)).range(o || [0, u]), f.domain(r || d3.extent(e, p)).range(i || [v, 0]); var h = c.selectAll("g.nv-wrap.nv-sparkline").data([e]), y = h.enter().append("g").attr("class", "nvd3 nv-wrap nv-sparkline"); y.append("g"), h.select("g"); h.attr("transform", "translate(" + a.left + "," + a.top + ")"); var E = h.selectAll("path").data(function(e) { return [e] }); E.enter().append("path"), E.exit().remove(), E.style("stroke", function(e, t) { return e.color || g(e, t) }).attr("d", d3.svg.line().x(function(e, t) { return d(m(e, t)) }).y(function(e, t) { return f(p(e, t)) })); var b = h.selectAll("circle.nv-point").data(function(e) { function t(t) { if (t != -1) { var n = e[t]; return n.pointIndex = t, n } return null } var n = e.map(function(e, t) { return p(e, t) }), r = t(n.lastIndexOf(f.domain()[1])), o = t(n.indexOf(f.domain()[0])), i = t(n.length - 1); return [o, r, i].filter(function(e) { return null != e }) }); b.enter().append("circle"), b.exit().remove(), b.attr("cx", function(e, t) { return d(m(e, e.pointIndex)); }).attr("cy", function(e, t) { return f(p(e, e.pointIndex)) }).attr("r", 2).attr("class", function(e, t) { return m(e, e.pointIndex) == d.domain()[1] ? "nv-point nv-currentValue" : p(e, e.pointIndex) == f.domain()[0] ? "nv-point nv-minValue" : "nv-point nv-maxValue" }) }), e } var n, r, o, i, a = { top: 2, right: 0, bottom: 2, left: 0 }, s = 400, l = 32, c = null, u = !0, d = d3.scale.linear(), f = d3.scale.linear(), m = function(e) { return e.x }, p = function(e) { return e.y }, g = t.utils.getColor(["#000"]); return e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return s }, set: function(e) { s = e } }, height: { get: function() { return l }, set: function(e) { l = e } }, xDomain: { get: function() { return n }, set: function(e) { n = e } }, yDomain: { get: function() { return r }, set: function(e) { r = e } }, xRange: { get: function() { return o }, set: function(e) { o = e } }, yRange: { get: function() { return i }, set: function(e) { i = e } }, xScale: { get: function() { return d }, set: function(e) { d = e } }, yScale: { get: function() { return f }, set: function(e) { f = e } }, animate: { get: function() { return u }, set: function(e) { u = e } }, x: { get: function() { return m }, set: function(e) { m = d3.functor(e) } }, y: { get: function() { return p }, set: function(e) { p = d3.functor(e) } }, margin: { get: function() { return a }, set: function(e) { a.top = void 0 !== e.top ? e.top : a.top, a.right = void 0 !== e.right ? e.right : a.right, a.bottom = void 0 !== e.bottom ? e.bottom : a.bottom, a.left = void 0 !== e.left ? e.left : a.left } }, color: { get: function() { return g }, set: function(e) { g = t.utils.getColor(e) } } }), t.utils.initOptions(e), e }, t.models.sparklinePlus = function() { "use strict"; function e(g) { return g.each(function(g) { function v() { if (!c) { var e = T.selectAll(".nv-hoverValue").data(l), t = e.enter().append("g").attr("class", "nv-hoverValue").style("stroke-opacity", 0).style("fill-opacity", 0); e.exit().transition().duration(250).style("stroke-opacity", 0).style("fill-opacity", 0).remove(), e.attr("transform", function(e) { return "translate(" + n(o.x()(g[e], e)) + ",0)" }).transition().duration(250).style("stroke-opacity", 1).style("fill-opacity", 1), l.length && (t.append("line").attr("x1", 0).attr("y1", -i.top).attr("x2", 0).attr("y2", b), t.append("text").attr("class", "nv-xValue").attr("x", -6).attr("y", -i.top).attr("text-anchor", "end").attr("dy", ".9em"), T.select(".nv-hoverValue .nv-xValue").text(u(o.x()(g[l[0]], l[0]))), t.append("text").attr("class", "nv-yValue").attr("x", 6).attr("y", -i.top).attr("text-anchor", "start").attr("dy", ".9em"), T.select(".nv-hoverValue .nv-yValue").text(d(o.y()(g[l[0]], l[0])))) } } function h() { function e(e, t) { for (var n = Math.abs(o.x()(e[0], 0) - t), r = 0, i = 0; i < e.length; i++) Math.abs(o.x()(e[i], i) - t) < n && (n = Math.abs(o.x()(e[i], i) - t), r = i); return r } if (!c) { var t = d3.mouse(this)[0] - i.left; l = [e(g, Math.round(n.invert(t)))], v() } } var y = d3.select(this); t.utils.initSVG(y); var E = t.utils.availableWidth(a, y, i), b = t.utils.availableHeight(s, y, i); if (e.update = function() { y.call(e) }, e.container = this, !g || !g.length) return t.utils.noData(e, y), e; y.selectAll(".nv-noData").remove(); var S = o.y()(g[g.length - 1], g.length - 1); n = o.xScale(), r = o.yScale(); var _ = y.selectAll("g.nv-wrap.nv-sparklineplus").data([g]), w = _.enter().append("g").attr("class", "nvd3 nv-wrap nv-sparklineplus"), A = w.append("g"), T = _.select("g"); A.append("g").attr("class", "nv-sparklineWrap"), A.append("g").attr("class", "nv-valueWrap"), A.append("g").attr("class", "nv-hoverArea"), _.attr("transform", "translate(" + i.left + "," + i.top + ")"); var I = T.select(".nv-sparklineWrap"); if (o.width(E).height(b), I.call(o), f) { var C = T.select(".nv-valueWrap"), x = C.selectAll(".nv-currentValue").data([S]); x.enter().append("text").attr("class", "nv-currentValue").attr("dx", p ? -8 : 8).attr("dy", ".9em").style("text-anchor", p ? "end" : "start"), x.attr("x", E + (p ? i.right : 0)).attr("y", m ? function(e) { return r(e) } : 0).style("fill", o.color()(g[g.length - 1], g.length - 1)).text(d(S)) } A.select(".nv-hoverArea").append("rect").on("mousemove", h).on("click", function() { c = !c }).on("mouseout", function() { l = [], v() }), T.select(".nv-hoverArea rect").attr("transform", function(e) { return "translate(" + -i.left + "," + -i.top + ")" }).attr("width", E + i.left + i.right).attr("height", b + i.top) }), e } var n, r, o = t.models.sparkline(), i = { top: 15, right: 100, bottom: 10, left: 50 }, a = null, s = null, l = [], c = !1, u = d3.format(",r"), d = d3.format(",.2f"), f = !0, m = !0, p = !1, g = null; return e.sparkline = o, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return a }, set: function(e) { a = e } }, height: { get: function() { return s }, set: function(e) { s = e } }, xTickFormat: { get: function() { return u }, set: function(e) { u = e } }, yTickFormat: { get: function() { return d }, set: function(e) { d = e } }, showLastValue: { get: function() { return f }, set: function(e) { f = e } }, alignValue: { get: function() { return m }, set: function(e) { m = e } }, rightAlignValue: { get: function() { return p }, set: function(e) { p = e } }, noData: { get: function() { return g }, set: function(e) { g = e } }, margin: { get: function() { return i }, set: function(e) { i.top = void 0 !== e.top ? e.top : i.top, i.right = void 0 !== e.right ? e.right : i.right, i.bottom = void 0 !== e.bottom ? e.bottom : i.bottom, i.left = void 0 !== e.left ? e.left : i.left } } }), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e }, t.models.stackedArea = function() { "use strict"; function e(f) { return b.reset(), b.models(h), f.each(function(f) { var y = i - o.left - o.right, S = a - o.top - o.bottom; c = d3.select(this), t.utils.initSVG(c), n = h.xScale(), r = h.yScale(); var _ = f; f.forEach(function(e, t) { e.seriesIndex = t, e.values = e.values.map(function(e, n) { return e.index = n, e.seriesIndex = t, e }) }); var w = f.filter(function(e) { return !e.disabled }); f = d3.layout.stack().order(p).offset(m).values(function(e) { return e.values }).x(u).y(d).out(function(e, t, n) { e.display = { y: n, y0: t } })(w); var A = c.selectAll("g.nv-wrap.nv-stackedarea").data([f]), T = A.enter().append("g").attr("class", "nvd3 nv-wrap nv-stackedarea"), I = T.append("defs"), C = T.append("g"), x = A.select("g"); C.append("g").attr("class", "nv-areaWrap"), C.append("g").attr("class", "nv-scatterWrap"), A.attr("transform", "translate(" + o.left + "," + o.top + ")"), 0 == h.forceY().length && h.forceY().push(0), h.width(y).height(S).x(u).y(function(e) { return e.display.y + e.display.y0 }).forceY([0]).color(f.map(function(e, t) { return e.color || s(e, e.seriesIndex) })); var M = x.select(".nv-scatterWrap").datum(f); M.call(h), I.append("clipPath").attr("id", "nv-edge-clip-" + l).append("rect"), A.select("#nv-edge-clip-" + l + " rect").attr("width", y).attr("height", S), x.attr("clip-path", v ? "url(#nv-edge-clip-" + l + ")" : ""); var D = d3.svg.area().x(function(e, t) { return n(u(e, t)) }).y0(function(e) { return r(e.display.y0) }).y1(function(e) { return r(e.display.y + e.display.y0) }).interpolate(g), O = d3.svg.area().x(function(e, t) { return n(u(e, t)) }).y0(function(e) { return r(e.display.y0) }).y1(function(e) { return r(e.display.y0) }), R = x.select(".nv-areaWrap").selectAll("path.nv-area").data(function(e) { return e }); R.enter().append("path").attr("class", function(e, t) { return "nv-area nv-area-" + t }).attr("d", function(e, t) { return O(e.values, e.seriesIndex) }).on("mouseover", function(e, t) { d3.select(this).classed("hover", !0), E.areaMouseover({ point: e, series: e.key, pos: [d3.event.pageX, d3.event.pageY], seriesIndex: e.seriesIndex }) }).on("mouseout", function(e, t) { d3.select(this).classed("hover", !1), E.areaMouseout({ point: e, series: e.key, pos: [d3.event.pageX, d3.event.pageY], seriesIndex: e.seriesIndex }) }).on("click", function(e, t) { d3.select(this).classed("hover", !1), E.areaClick({ point: e, series: e.key, pos: [d3.event.pageX, d3.event.pageY], seriesIndex: e.seriesIndex }) }), R.exit().remove(), R.style("fill", function(e, t) { return e.color || s(e, e.seriesIndex) }).style("stroke", function(e, t) { return e.color || s(e, e.seriesIndex) }), R.watchTransition(b, "stackedArea path").attr("d", function(e, t) { return D(e.values, t) }), h.dispatch.on("elementMouseover.area", function(e) { x.select(".nv-chart-" + l + " .nv-area-" + e.seriesIndex).classed("hover", !0) }), h.dispatch.on("elementMouseout.area", function(e) { x.select(".nv-chart-" + l + " .nv-area-" + e.seriesIndex).classed("hover", !1) }), e.d3_stackedOffset_stackPercent = function(e) { var t, n, r, o = e.length, i = e[0].length, a = []; for (n = 0; n < i; ++n) { for (t = 0, r = 0; t < _.length; t++) r += d(_[t].values[n]); if (r) for (t = 0; t < o; t++) e[t][n][1] /= r; else for (t = 0; t < o; t++) e[t][n][1] = 0 } for (n = 0; n < i; ++n) a[n] = 0; return a } }), b.renderEnd("stackedArea immediate"), e } var n, r, o = { top: 0, right: 0, bottom: 0, left: 0 }, i = 960, a = 500, s = t.utils.defaultColor(), l = Math.floor(1e5 * Math.random()), c = null, u = function(e) { return e.x }, d = function(e) { return e.y }, f = "stack", m = "zero", p = "default", g = "linear", v = !1, h = t.models.scatter(), y = 250, E = d3.dispatch("areaClick", "areaMouseover", "areaMouseout", "renderEnd", "elementClick", "elementMouseover", "elementMouseout"); h.pointSize(2.2).pointDomain([2.2, 2.2]); var b = t.utils.renderWatch(E, y); return e.dispatch = E, e.scatter = h, h.dispatch.on("elementClick", function() { E.elementClick.apply(this, arguments) }), h.dispatch.on("elementMouseover", function() { E.elementMouseover.apply(this, arguments) }), h.dispatch.on("elementMouseout", function() { E.elementMouseout.apply(this, arguments) }), e.interpolate = function(t) { return arguments.length ? (g = t, e) : g }, e.duration = function(t) { return arguments.length ? (y = t, b.reset(y), h.duration(y), e) : y }, e.dispatch = E, e.scatter = h, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return i }, set: function(e) { i = e } }, height: { get: function() { return a }, set: function(e) { a = e } }, clipEdge: { get: function() { return v }, set: function(e) { v = e } }, offset: { get: function() { return m }, set: function(e) { m = e } }, order: { get: function() { return p }, set: function(e) { p = e } }, interpolate: { get: function() { return g }, set: function(e) { g = e } }, x: { get: function() { return u }, set: function(e) { u = d3.functor(e) } }, y: { get: function() { return d }, set: function(e) { d = d3.functor(e) } }, margin: { get: function() { return o }, set: function(e) { o.top = void 0 !== e.top ? e.top : o.top, o.right = void 0 !== e.right ? e.right : o.right, o.bottom = void 0 !== e.bottom ? e.bottom : o.bottom, o.left = void 0 !== e.left ? e.left : o.left } }, color: { get: function() { return s }, set: function(e) { s = t.utils.getColor(e) } }, style: { get: function() { return f }, set: function(t) { switch (f = t) { case "stack": e.offset("zero"), e.order("default"); break; case "stream": e.offset("wiggle"), e.order("inside-out"); break; case "stream-center": e.offset("silhouette"), e.order("inside-out"); break; case "expand": e.offset("expand"), e.order("default"); break; case "stack_percent": e.offset(e.d3_stackedOffset_stackPercent), e.order("default") } } }, duration: { get: function() { return y }, set: function(e) { y = e, b.reset(y), h.duration(y) } } }), t.utils.inheritOptions(e, h), t.utils.initOptions(e), e }, t.models.stackedAreaChart = function() { "use strict"; function e(u) { return O.reset(), O.models(o), h && O.models(i), y && O.models(a), u.each(function(u) { var w = d3.select(this), O = this; t.utils.initSVG(w); var k = t.utils.availableWidth(f, w, d), G = t.utils.availableHeight(m, w, d); if (e.update = function() { w.transition().duration(x).call(e) }, e.container = this, S.setter(L(u), e.update).getter(N(u)).update(), S.disabled = u.map(function(e) { return !!e.disabled }), !_) { var F; _ = {}; for (F in S) S[F] instanceof Array ? _[F] = S[F].slice(0) : _[F] = S[F] } if (!(u && u.length && u.filter(function(e) { return e.values.length }).length)) return t.utils.noData(e, w), e; w.selectAll(".nv-noData").remove(), n = o.xScale(), r = o.yScale(); var U = w.selectAll("g.nv-wrap.nv-stackedAreaChart").data([u]), V = U.enter().append("g").attr("class", "nvd3 nv-wrap nv-stackedAreaChart").append("g"), z = U.select("g"); if (V.append("rect").style("opacity", 0), V.append("g").attr("class", "nv-x nv-axis"), V.append("g").attr("class", "nv-y nv-axis"), V.append("g").attr("class", "nv-stackedWrap"), V.append("g").attr("class", "nv-legendWrap"), V.append("g").attr("class", "nv-controlsWrap"), V.append("g").attr("class", "nv-interactive"), z.select("rect").attr("width", k).attr("height", G), v) { var B = g ? k - T : k; s.width(B), z.select(".nv-legendWrap").datum(u).call(s), d.top != s.height() && (d.top = s.height(), G = t.utils.availableHeight(m, w, d)), z.select(".nv-legendWrap").attr("transform", "translate(" + (k - B) + "," + -d.top + ")") } if (g) { var $ = [{ key: C.stacked || "Stacked", metaKey: "Stacked", disabled: "stack" != o.style(), style: "stack" }, { key: C.stream || "Stream", metaKey: "Stream", disabled: "stream" != o.style(), style: "stream" }, { key: C.expanded || "Expanded", metaKey: "Expanded", disabled: "expand" != o.style(), style: "expand" }, { key: C.stack_percent || "Stack %", metaKey: "Stack_Percent", disabled: "stack_percent" != o.style(), style: "stack_percent" }]; T = I.length / 3 * 260, $ = $.filter(function(e) { return I.indexOf(e.metaKey) !== -1 }), l.width(T).color(["#444", "#444", "#444"]), z.select(".nv-controlsWrap").datum($).call(l), d.top != Math.max(l.height(), s.height()) && (d.top = Math.max(l.height(), s.height()), G = t.utils.availableHeight(m, w, d)), z.select(".nv-controlsWrap").attr("transform", "translate(0," + -d.top + ")") } U.attr("transform", "translate(" + d.left + "," + d.top + ")"), E && z.select(".nv-y.nv-axis").attr("transform", "translate(" + k + ",0)"), b && (c.width(k).height(G).margin({ left: d.left, top: d.top }).svgContainer(w).xScale(n), U.select(".nv-interactive").call(c)), o.width(k).height(G); var W = z.select(".nv-stackedWrap").datum(u); if (W.transition().call(o), h && (i.scale(n)._ticks(t.utils.calcTicksX(k / 100, u)).tickSize(-G, 0), z.select(".nv-x.nv-axis").attr("transform", "translate(0," + G + ")"), z.select(".nv-x.nv-axis").transition().duration(0).call(i)), y) { var H; if (H = "wiggle" === o.offset() ? 0 : t.utils.calcTicksY(G / 36, u), a.scale(r)._ticks(H).tickSize(-k, 0), "expand" === o.style() || "stack_percent" === o.style()) { var j = a.tickFormat(); M && j === P || (M = j), a.tickFormat(P) } else M && (a.tickFormat(M), M = null); z.select(".nv-y.nv-axis").transition().duration(0).call(a) } o.dispatch.on("areaClick.toggle", function(t) { 1 === u.filter(function(e) { return !e.disabled }).length ? u.forEach(function(e) { e.disabled = !1 }) : u.forEach(function(e, n) { e.disabled = n != t.seriesIndex }), S.disabled = u.map(function(e) { return !!e.disabled }), A.stateChange(S), e.update() }), s.dispatch.on("stateChange", function(t) { for (var n in t) S[n] = t[n]; A.stateChange(S), e.update() }), l.dispatch.on("legendClick", function(t, n) { t.disabled && ($ = $.map(function(e) { return e.disabled = !0, e }), t.disabled = !1, o.style(t.style), S.style = o.style(), A.stateChange(S), e.update()) }), c.dispatch.on("elementMousemove", function(n) { o.clearHighlights(); var r, a, s, l = []; if (u.filter(function(e, t) { return e.seriesIndex = t, !e.disabled }).forEach(function(i, c) { a = t.interactiveBisect(i.values, n.pointXValue, e.x()); var u = i.values[a], d = e.y()(u, a); if (null != d && o.highlightPoint(c, a, !0), "undefined" != typeof u) { "undefined" == typeof r && (r = u), "undefined" == typeof s && (s = e.xScale()(e.x()(u, a))); var f = "expand" == o.style() ? u.display.y : e.y()(u, a); l.push({ key: i.key, value: f, color: p(i, i.seriesIndex), stackedValue: u.display }) } }), l.reverse(), l.length > 2) { var f = e.yScale().invert(n.mouseY), m = null; l.forEach(function(e, t) { f = Math.abs(f); var n = Math.abs(e.stackedValue.y0), r = Math.abs(e.stackedValue.y); if (f >= n && f <= r + n) return void(m = t) }), null != m && (l[m].highlight = !0) } var g = i.tickFormat()(e.x()(r, a)), v = c.tooltip.valueFormatter(); "expand" === o.style() || "stack_percent" === o.style() ? (D || (D = v), v = d3.format(".1%")) : D && (v = D, D = null), c.tooltip.position({ left: s + d.left, top: n.mouseY + d.top }).chartContainer(O.parentNode).valueFormatter(v).data({ value: g, series: l })(), c.renderGuideLine(s) }), c.dispatch.on("elementMouseout", function(e) { o.clearHighlights() }), A.on("changeState", function(t) { "undefined" != typeof t.disabled && u.length === t.disabled.length && (u.forEach(function(e, n) { e.disabled = t.disabled[n] }), S.disabled = t.disabled), "undefined" != typeof t.style && (o.style(t.style), R = t.style), e.update() }) }), O.renderEnd("stacked Area chart immediate"), e } var n, r, o = t.models.stackedArea(), i = t.models.axis(), a = t.models.axis(), s = t.models.legend(), l = t.models.legend(), c = t.interactiveGuideline(), u = t.models.tooltip(), d = { top: 30, right: 25, bottom: 50, left: 60 }, f = null, m = null, p = t.utils.defaultColor(), g = !0, v = !0, h = !0, y = !0, E = !1, b = !1, S = t.utils.state(), _ = null, w = null, A = d3.dispatch("stateChange", "changeState", "renderEnd"), T = 250, I = ["Stacked", "Stream", "Expanded"], C = {}, x = 250; S.style = o.style(), i.orient("bottom").tickPadding(7), a.orient(E ? "right" : "left"), u.headerFormatter(function(e, t) { return i.tickFormat()(e, t) }).valueFormatter(function(e, t) { return a.tickFormat()(e, t) }), c.tooltip.headerFormatter(function(e, t) { return i.tickFormat()(e, t) }).valueFormatter(function(e, t) { return a.tickFormat()(e, t) }); var M = null, D = null; l.updateState(!1); var O = t.utils.renderWatch(A), R = o.style(), N = function(e) { return function() { return { active: e.map(function(e) { return !e.disabled }), style: o.style() } } }, L = function(e) { return function(t) { void 0 !== t.style && (R = t.style), void 0 !== t.active && e.forEach(function(e, n) { e.disabled = !t.active[n] }) } }, P = d3.format("%"); return o.dispatch.on("elementMouseover.tooltip", function(e) { e.point.x = o.x()(e.point), e.point.y = o.y()(e.point), u.data(e).position(e.pos).hidden(!1) }), o.dispatch.on("elementMouseout.tooltip", function(e) { u.hidden(!0) }), e.dispatch = A, e.stacked = o, e.legend = s, e.controls = l, e.xAxis = i, e.yAxis = a, e.interactiveLayer = c, e.tooltip = u, e.dispatch = A, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return f }, set: function(e) { f = e } }, height: { get: function() { return m }, set: function(e) { m = e } }, showLegend: { get: function() { return v }, set: function(e) { v = e } }, showXAxis: { get: function() { return h }, set: function(e) { h = e } }, showYAxis: { get: function() { return y }, set: function(e) { y = e } }, defaultState: { get: function() { return _ }, set: function(e) { _ = e } }, noData: { get: function() { return w }, set: function(e) { w = e } }, showControls: { get: function() { return g }, set: function(e) { g = e } }, controlLabels: { get: function() { return C }, set: function(e) { C = e } }, controlOptions: { get: function() { return I }, set: function(e) { I = e } }, tooltips: { get: function() { return u.enabled() }, set: function(e) { t.deprecated("tooltips", "use chart.tooltip.enabled() instead"), u.enabled(!!e) } }, tooltipContent: { get: function() { return u.contentGenerator() }, set: function(e) { t.deprecated("tooltipContent", "use chart.tooltip.contentGenerator() instead"), u.contentGenerator(e) } }, margin: { get: function() { return d }, set: function(e) { d.top = void 0 !== e.top ? e.top : d.top, d.right = void 0 !== e.right ? e.right : d.right, d.bottom = void 0 !== e.bottom ? e.bottom : d.bottom, d.left = void 0 !== e.left ? e.left : d.left } }, duration: { get: function() { return x }, set: function(e) { x = e, O.reset(x), o.duration(x), i.duration(x), a.duration(x) } }, color: { get: function() { return p }, set: function(e) { p = t.utils.getColor(e), s.color(p), o.color(p) } }, rightAlignYAxis: { get: function() { return E }, set: function(e) { E = e, a.orient(E ? "right" : "left") } }, useInteractiveGuideline: { get: function() { return b }, set: function(t) { b = !!t, e.interactive(!t), e.useVoronoi(!t), o.scatter.interactive(!t) } } }), t.utils.inheritOptions(e, o), t.utils.initOptions(e), e }, t.models.sunburst = function() { "use strict"; function e(b) { return E.reset(), b.each(function(e) { function E(e) { e.x0 = e.x, e.dx0 = e.dx } function b(e) { var t = d3.interpolate(g.domain(), [e.x, e.x + e.dx]), n = d3.interpolate(v.domain(), [e.y, 1]), r = d3.interpolate(v.range(), [e.y ? 20 : 0, A]); return function(e, o) { return o ? function(t) { return y(e) } : function(o) { return g.domain(t(o)), v.domain(n(o)).range(r(o)), y(e) } } } d = d3.select(this); var S, _ = t.utils.availableWidth(a, d, i), w = t.utils.availableHeight(s, d, i), A = Math.min(_, w) / 2; t.utils.initSVG(d); var T = d.selectAll(".nv-wrap.nv-sunburst").data(e), I = T.enter().append("g").attr("class", "nvd3 nv-wrap nv-sunburst nv-chart-" + u), C = I.selectAll("nv-sunburst"); T.attr("transform", "translate(" + _ / 2 + "," + w / 2 + ")"), d.on("click", function(e, t) { p.chartClick({ data: e, index: t, pos: d3.event, id: u }) }), v.range([0, A]), n = n || e, o = e[0], h.value(c[l] || c.count), S = C.data(h.nodes).enter().append("path").attr("d", y).style("fill", function(e) { return f((e.children ? e : e.parent).name) }).style("stroke", "#FFF").on("click", function(e) { r !== n && n !== e && (r = n), n = e, S.transition().duration(m).attrTween("d", b(e)) }).each(E).on("dblclick", function(e) { r.parent == e && S.transition().duration(m).attrTween("d", b(o)) }).each(E).on("mouseover", function(e, t) { d3.select(this).classed("hover", !0).style("opacity", .8), p.elementMouseover({ data: e, color: d3.select(this).style("fill") }) }).on("mouseout", function(e, t) { d3.select(this).classed("hover", !1).style("opacity", 1), p.elementMouseout({ data: e }) }).on("mousemove", function(e, t) { p.elementMousemove({ data: e }) }) }), E.renderEnd("sunburst immediate"), e } var n, r, o, i = { top: 0, right: 0, bottom: 0, left: 0 }, a = null, s = null, l = "count", c = { count: function(e) { return 1 }, size: function(e) { return e.size } }, u = Math.floor(1e4 * Math.random()), d = null, f = t.utils.defaultColor(), m = 500, p = d3.dispatch("chartClick", "elementClick", "elementDblClick", "elementMousemove", "elementMouseover", "elementMouseout", "renderEnd"), g = d3.scale.linear().range([0, 2 * Math.PI]), v = d3.scale.sqrt(), h = d3.layout.partition().sort(null).value(function(e) { return 1 }), y = d3.svg.arc().startAngle(function(e) { return Math.max(0, Math.min(2 * Math.PI, g(e.x))) }).endAngle(function(e) { return Math.max(0, Math.min(2 * Math.PI, g(e.x + e.dx))) }).innerRadius(function(e) { return Math.max(0, v(e.y)) }).outerRadius(function(e) { return Math.max(0, v(e.y + e.dy)) }), E = t.utils.renderWatch(p); return e.dispatch = p, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { width: { get: function() { return a }, set: function(e) { a = e } }, height: { get: function() { return s }, set: function(e) { s = e } }, mode: { get: function() { return l }, set: function(e) { l = e } }, id: { get: function() { return u }, set: function(e) { u = e } }, duration: { get: function() { return m }, set: function(e) { m = e } }, margin: { get: function() { return i }, set: function(e) { i.top = void 0 != e.top ? e.top : i.top, i.right = void 0 != e.right ? e.right : i.right, i.bottom = void 0 != e.bottom ? e.bottom : i.bottom, i.left = void 0 != e.left ? e.left : i.left } }, color: { get: function() { return f }, set: function(e) { f = t.utils.getColor(e) } } }), t.utils.initOptions(e), e }, t.models.sunburstChart = function() { "use strict"; function e(r) { return f.reset(), f.models(n), r.each(function(r) { var s = d3.select(this); t.utils.initSVG(s); var l = t.utils.availableWidth(i, s, o), c = t.utils.availableHeight(a, s, o); if (e.update = function() { 0 === u ? s.call(e) : s.transition().duration(u).call(e) }, e.container = this, !r || !r.length) return t.utils.noData(e, s), e; s.selectAll(".nv-noData").remove(); var d = s.selectAll("g.nv-wrap.nv-sunburstChart").data(r), f = d.enter().append("g").attr("class", "nvd3 nv-wrap nv-sunburstChart").append("g"), m = d.select("g"); f.append("g").attr("class", "nv-sunburstWrap"), d.attr("transform", "translate(" + o.left + "," + o.top + ")"), n.width(l).height(c); var p = m.select(".nv-sunburstWrap").datum(r); d3.transition(p).call(n) }), f.renderEnd("sunburstChart immediate"), e } var n = t.models.sunburst(), r = t.models.tooltip(), o = { top: 30, right: 20, bottom: 20, left: 20 }, i = null, a = null, s = t.utils.defaultColor(), l = (Math.round(1e5 * Math.random()), null), c = null, u = 250, d = d3.dispatch("tooltipShow", "tooltipHide", "stateChange", "changeState", "renderEnd"), f = t.utils.renderWatch(d); return r.headerEnabled(!1).duration(0).valueFormatter(function(e, t) { return e }), n.dispatch.on("elementMouseover.tooltip", function(e) { e.series = { key: e.data.name, value: e.data.size, color: e.color }, r.data(e).hidden(!1) }), n.dispatch.on("elementMouseout.tooltip", function(e) { r.hidden(!0) }), n.dispatch.on("elementMousemove.tooltip", function(e) { r.position({ top: d3.event.pageY, left: d3.event.pageX })() }), e.dispatch = d, e.sunburst = n, e.tooltip = r, e.options = t.utils.optionsFunc.bind(e), e._options = Object.create({}, { noData: { get: function() { return c }, set: function(e) { c = e } }, defaultState: { get: function() { return l }, set: function(e) { l = e } }, color: { get: function() { return s }, set: function(e) { s = e, n.color(s) } }, duration: { get: function() { return u }, set: function(e) { u = e, f.reset(u), n.duration(u) } }, margin: { get: function() { return o }, set: function(e) { o.top = void 0 !== e.top ? e.top : o.top, o.right = void 0 !== e.right ? e.right : o.right, o.bottom = void 0 !== e.bottom ? e.bottom : o.bottom, o.left = void 0 !== e.left ? e.left : o.left } } }), t.utils.inheritOptions(e, n), t.utils.initOptions(e), e }, t.version = "1.8.1" }() }, function(e, t, n) { var r, o; (function() { function n(e) { function t(t, n, r, o, i, a) { for (; i >= 0 && i < a; i += e) { var s = o ? o[i] : i; r = n(r, t[s], s, t) } return r } return function(n, r, o, i) { r = w(r, i, 4); var a = !D(n) && _.keys(n), s = (a || n).length, l = e > 0 ? 0 : s - 1; return arguments.length < 3 && (o = n[a ? a[l] : l], l += e), t(n, r, o, a, l, s) } } function i(e) { return function(t, n, r) { n = A(n, r); for (var o = M(t), i = e > 0 ? 0 : o - 1; i >= 0 && i < o; i += e) if (n(t[i], i, t)) return i; return -1 } } function a(e, t, n) { return function(r, o, i) { var a = 0, s = M(r); if ("number" == typeof i) e > 0 ? a = i >= 0 ? i : Math.max(i + s, a) : s = i >= 0 ? Math.min(i + 1, s) : i + s + 1; else if (n && i && s) return i = n(r, o), r[i] === o ? i : -1; if (o !== o) return i = t(p.call(r, a, s), _.isNaN), i >= 0 ? i + a : -1; for (i = e > 0 ? a : s - 1; i >= 0 && i < s; i += e) if (r[i] === o) return i; return -1 } } function s(e, t) { var n = P.length, r = e.constructor, o = _.isFunction(r) && r.prototype || d, i = "constructor"; for (_.has(e, i) && !_.contains(t, i) && t.push(i); n--;) i = P[n], i in e && e[i] !== o[i] && !_.contains(t, i) && t.push(i) } var l = this, c = l._, u = Array.prototype, d = Object.prototype, f = Function.prototype, m = u.push, p = u.slice, g = d.toString, v = d.hasOwnProperty, h = Array.isArray, y = Object.keys, E = f.bind, b = Object.create, S = function() {}, _ = function(e) { return e instanceof _ ? e : this instanceof _ ? void(this._wrapped = e) : new _(e) }; "undefined" != typeof e && e.exports && (t = e.exports = _), t._ = _, _.VERSION = "1.8.3"; var w = function(e, t, n) { if (void 0 === t) return e; switch (null == n ? 3 : n) { case 1: return function(n) { return e.call(t, n) }; case 2: return function(n, r) { return e.call(t, n, r) }; case 3: return function(n, r, o) { return e.call(t, n, r, o) }; case 4: return function(n, r, o, i) { return e.call(t, n, r, o, i) } } return function() { return e.apply(t, arguments) } }, A = function(e, t, n) { return null == e ? _.identity : _.isFunction(e) ? w(e, t, n) : _.isObject(e) ? _.matcher(e) : _.property(e) }; _.iteratee = function(e, t) { return A(e, t, 1 / 0) }; var T = function(e, t) { return function(n) { var r = arguments.length; if (r < 2 || null == n) return n; for (var o = 1; o < r; o++) for (var i = arguments[o], a = e(i), s = a.length, l = 0; l < s; l++) { var c = a[l]; t && void 0 !== n[c] || (n[c] = i[c]) } return n } }, I = function(e) { if (!_.isObject(e)) return {}; if (b) return b(e); S.prototype = e; var t = new S; return S.prototype = null, t }, C = function(e) { return function(t) { return null == t ? void 0 : t[e] } }, x = Math.pow(2, 53) - 1, M = C("length"), D = function(e) { var t = M(e); return "number" == typeof t && t >= 0 && t <= x }; _.each = _.forEach = function(e, t, n) { t = w(t, n); var r, o; if (D(e)) for (r = 0, o = e.length; r < o; r++) t(e[r], r, e); else { var i = _.keys(e); for (r = 0, o = i.length; r < o; r++) t(e[i[r]], i[r], e) } return e }, _.map = _.collect = function(e, t, n) { t = A(t, n); for (var r = !D(e) && _.keys(e), o = (r || e).length, i = Array(o), a = 0; a < o; a++) { var s = r ? r[a] : a; i[a] = t(e[s], s, e) } return i }, _.reduce = _.foldl = _.inject = n(1), _.reduceRight = _.foldr = n(-1), _.find = _.detect = function(e, t, n) { var r; if (r = D(e) ? _.findIndex(e, t, n) : _.findKey(e, t, n), void 0 !== r && r !== -1) return e[r] }, _.filter = _.select = function(e, t, n) { var r = []; return t = A(t, n), _.each(e, function(e, n, o) { t(e, n, o) && r.push(e) }), r }, _.reject = function(e, t, n) { return _.filter(e, _.negate(A(t)), n) }, _.every = _.all = function(e, t, n) { t = A(t, n); for (var r = !D(e) && _.keys(e), o = (r || e).length, i = 0; i < o; i++) { var a = r ? r[i] : i; if (!t(e[a], a, e)) return !1 } return !0 }, _.some = _.any = function(e, t, n) { t = A(t, n); for (var r = !D(e) && _.keys(e), o = (r || e).length, i = 0; i < o; i++) { var a = r ? r[i] : i; if (t(e[a], a, e)) return !0 } return !1 }, _.contains = _.includes = _.include = function(e, t, n, r) { return D(e) || (e = _.values(e)), ("number" != typeof n || r) && (n = 0), _.indexOf(e, t, n) >= 0 }, _.invoke = function(e, t) { var n = p.call(arguments, 2), r = _.isFunction(t); return _.map(e, function(e) { var o = r ? t : e[t]; return null == o ? o : o.apply(e, n) }) }, _.pluck = function(e, t) { return _.map(e, _.property(t)) }, _.where = function(e, t) { return _.filter(e, _.matcher(t)) }, _.findWhere = function(e, t) { return _.find(e, _.matcher(t)) }, _.max = function(e, t, n) { var r, o, i = -(1 / 0), a = -(1 / 0); if (null == t && null != e) { e = D(e) ? e : _.values(e); for (var s = 0, l = e.length; s < l; s++) r = e[s], r > i && (i = r) } else t = A(t, n), _.each(e, function(e, n, r) { o = t(e, n, r), (o > a || o === -(1 / 0) && i === -(1 / 0)) && (i = e, a = o) }); return i }, _.min = function(e, t, n) { var r, o, i = 1 / 0, a = 1 / 0; if (null == t && null != e) { e = D(e) ? e : _.values(e); for (var s = 0, l = e.length; s < l; s++) r = e[s], r < i && (i = r) } else t = A(t, n), _.each(e, function(e, n, r) { o = t(e, n, r), (o < a || o === 1 / 0 && i === 1 / 0) && (i = e, a = o) }); return i }, _.shuffle = function(e) { for (var t, n = D(e) ? e : _.values(e), r = n.length, o = Array(r), i = 0; i < r; i++) t = _.random(0, i), t !== i && (o[i] = o[t]), o[t] = n[i]; return o }, _.sample = function(e, t, n) { return null == t || n ? (D(e) || (e = _.values(e)), e[_.random(e.length - 1)]) : _.shuffle(e).slice(0, Math.max(0, t)) }, _.sortBy = function(e, t, n) { return t = A(t, n), _.pluck(_.map(e, function(e, n, r) { return { value: e, index: n, criteria: t(e, n, r) } }).sort(function(e, t) { var n = e.criteria, r = t.criteria; if (n !== r) { if (n > r || void 0 === n) return 1; if (n < r || void 0 === r) return -1 } return e.index - t.index }), "value") }; var O = function(e) { return function(t, n, r) { var o = {}; return n = A(n, r), _.each(t, function(r, i) { var a = n(r, i, t); e(o, r, a) }), o } }; _.groupBy = O(function(e, t, n) { _.has(e, n) ? e[n].push(t) : e[n] = [t] }), _.indexBy = O(function(e, t, n) { e[n] = t }), _.countBy = O(function(e, t, n) { _.has(e, n) ? e[n]++ : e[n] = 1 }), _.toArray = function(e) { return e ? _.isArray(e) ? p.call(e) : D(e) ? _.map(e, _.identity) : _.values(e) : [] }, _.size = function(e) { return null == e ? 0 : D(e) ? e.length : _.keys(e).length }, _.partition = function(e, t, n) { t = A(t, n); var r = [], o = []; return _.each(e, function(e, n, i) { (t(e, n, i) ? r : o).push(e) }), [r, o] }, _.first = _.head = _.take = function(e, t, n) { if (null != e) return null == t || n ? e[0] : _.initial(e, e.length - t) }, _.initial = function(e, t, n) { return p.call(e, 0, Math.max(0, e.length - (null == t || n ? 1 : t))) }, _.last = function(e, t, n) { if (null != e) return null == t || n ? e[e.length - 1] : _.rest(e, Math.max(0, e.length - t)) }, _.rest = _.tail = _.drop = function(e, t, n) { return p.call(e, null == t || n ? 1 : t) }, _.compact = function(e) { return _.filter(e, _.identity) }; var R = function(e, t, n, r) { for (var o = [], i = 0, a = r || 0, s = M(e); a < s; a++) { var l = e[a]; if (D(l) && (_.isArray(l) || _.isArguments(l))) { t || (l = R(l, t, n)); var c = 0, u = l.length; for (o.length += u; c < u;) o[i++] = l[c++] } else n || (o[i++] = l) } return o }; _.flatten = function(e, t) { return R(e, t, !1) }, _.without = function(e) { return _.difference(e, p.call(arguments, 1)) }, _.uniq = _.unique = function(e, t, n, r) { _.isBoolean(t) || (r = n, n = t, t = !1), null != n && (n = A(n, r)); for (var o = [], i = [], a = 0, s = M(e); a < s; a++) { var l = e[a], c = n ? n(l, a, e) : l; t ? (a && i === c || o.push(l), i = c) : n ? _.contains(i, c) || (i.push(c), o.push(l)) : _.contains(o, l) || o.push(l) } return o }, _.union = function() { return _.uniq(R(arguments, !0, !0)) }, _.intersection = function(e) { for (var t = [], n = arguments.length, r = 0, o = M(e); r < o; r++) { var i = e[r]; if (!_.contains(t, i)) { for (var a = 1; a < n && _.contains(arguments[a], i); a++); a === n && t.push(i) } } return t }, _.difference = function(e) { var t = R(arguments, !0, !0, 1); return _.filter(e, function(e) { return !_.contains(t, e) }) }, _.zip = function() { return _.unzip(arguments) }, _.unzip = function(e) { for (var t = e && _.max(e, M).length || 0, n = Array(t), r = 0; r < t; r++) n[r] = _.pluck(e, r); return n }, _.object = function(e, t) { for (var n = {}, r = 0, o = M(e); r < o; r++) t ? n[e[r]] = t[r] : n[e[r][0]] = e[r][1]; return n }, _.findIndex = i(1), _.findLastIndex = i(-1), _.sortedIndex = function(e, t, n, r) { n = A(n, r, 1); for (var o = n(t), i = 0, a = M(e); i < a;) { var s = Math.floor((i + a) / 2); n(e[s]) < o ? i = s + 1 : a = s } return i }, _.indexOf = a(1, _.findIndex, _.sortedIndex), _.lastIndexOf = a(-1, _.findLastIndex), _.range = function(e, t, n) { null == t && (t = e || 0, e = 0), n = n || 1; for (var r = Math.max(Math.ceil((t - e) / n), 0), o = Array(r), i = 0; i < r; i++, e += n) o[i] = e; return o }; var N = function(e, t, n, r, o) { if (!(r instanceof t)) return e.apply(n, o); var i = I(e.prototype), a = e.apply(i, o); return _.isObject(a) ? a : i }; _.bind = function(e, t) { if (E && e.bind === E) return E.apply(e, p.call(arguments, 1)); if (!_.isFunction(e)) throw new TypeError("Bind must be called on a function"); var n = p.call(arguments, 2), r = function() { return N(e, r, t, this, n.concat(p.call(arguments))) }; return r }, _.partial = function(e) { var t = p.call(arguments, 1), n = function() { for (var r = 0, o = t.length, i = Array(o), a = 0; a < o; a++) i[a] = t[a] === _ ? arguments[r++] : t[a]; for (; r < arguments.length;) i.push(arguments[r++]); return N(e, n, this, this, i) }; return n }, _.bindAll = function(e) { var t, n, r = arguments.length; if (r <= 1) throw new Error("bindAll must be passed function names"); for (t = 1; t < r; t++) n = arguments[t], e[n] = _.bind(e[n], e); return e }, _.memoize = function(e, t) { var n = function(r) { var o = n.cache, i = "" + (t ? t.apply(this, arguments) : r); return _.has(o, i) || (o[i] = e.apply(this, arguments)), o[i] }; return n.cache = {}, n }, _.delay = function(e, t) { var n = p.call(arguments, 2); return setTimeout(function() { return e.apply(null, n) }, t) }, _.defer = _.partial(_.delay, _, 1), _.throttle = function(e, t, n) { var r, o, i, a = null, s = 0; n || (n = {}); var l = function() { s = n.leading === !1 ? 0 : _.now(), a = null, i = e.apply(r, o), a || (r = o = null) }; return function() { var c = _.now(); s || n.leading !== !1 || (s = c); var u = t - (c - s); return r = this, o = arguments, u <= 0 || u > t ? (a && (clearTimeout(a), a = null), s = c, i = e.apply(r, o), a || (r = o = null)) : a || n.trailing === !1 || (a = setTimeout(l, u)), i } }, _.debounce = function(e, t, n) { var r, o, i, a, s, l = function() { var c = _.now() - a; c < t && c >= 0 ? r = setTimeout(l, t - c) : (r = null, n || (s = e.apply(i, o), r || (i = o = null))) }; return function() { i = this, o = arguments, a = _.now(); var c = n && !r; return r || (r = setTimeout(l, t)), c && (s = e.apply(i, o), i = o = null), s } }, _.wrap = function(e, t) { return _.partial(t, e) }, _.negate = function(e) { return function() { return !e.apply(this, arguments) } }, _.compose = function() { var e = arguments, t = e.length - 1; return function() { for (var n = t, r = e[t].apply(this, arguments); n--;) r = e[n].call(this, r); return r } }, _.after = function(e, t) { return function() { if (--e < 1) return t.apply(this, arguments) } }, _.before = function(e, t) { var n; return function() { return --e > 0 && (n = t.apply(this, arguments)), e <= 1 && (t = null), n } }, _.once = _.partial(_.before, 2); var L = !{ toString: null }.propertyIsEnumerable("toString"), P = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"]; _.keys = function(e) { if (!_.isObject(e)) return []; if (y) return y(e); var t = []; for (var n in e) _.has(e, n) && t.push(n); return L && s(e, t), t }, _.allKeys = function(e) { if (!_.isObject(e)) return []; var t = []; for (var n in e) t.push(n); return L && s(e, t), t }, _.values = function(e) { for (var t = _.keys(e), n = t.length, r = Array(n), o = 0; o < n; o++) r[o] = e[t[o]]; return r }, _.mapObject = function(e, t, n) { t = A(t, n); for (var r, o = _.keys(e), i = o.length, a = {}, s = 0; s < i; s++) r = o[s], a[r] = t(e[r], r, e); return a }, _.pairs = function(e) { for (var t = _.keys(e), n = t.length, r = Array(n), o = 0; o < n; o++) r[o] = [t[o], e[t[o]]]; return r }, _.invert = function(e) { for (var t = {}, n = _.keys(e), r = 0, o = n.length; r < o; r++) t[e[n[r]]] = n[r]; return t }, _.functions = _.methods = function(e) { var t = []; for (var n in e) _.isFunction(e[n]) && t.push(n); return t.sort() }, _.extend = T(_.allKeys), _.extendOwn = _.assign = T(_.keys), _.findKey = function(e, t, n) { t = A(t, n); for (var r, o = _.keys(e), i = 0, a = o.length; i < a; i++) if (r = o[i], t(e[r], r, e)) return r }, _.pick = function(e, t, n) { var r, o, i = {}, a = e; if (null == a) return i; _.isFunction(t) ? (o = _.allKeys(a), r = w(t, n)) : (o = R(arguments, !1, !1, 1), r = function(e, t, n) { return t in n }, a = Object(a)); for (var s = 0, l = o.length; s < l; s++) { var c = o[s], u = a[c]; r(u, c, a) && (i[c] = u) } return i }, _.omit = function(e, t, n) { if (_.isFunction(t)) t = _.negate(t); else { var r = _.map(R(arguments, !1, !1, 1), String); t = function(e, t) { return !_.contains(r, t) } } return _.pick(e, t, n) }, _.defaults = T(_.allKeys, !0), _.create = function(e, t) { var n = I(e); return t && _.extendOwn(n, t), n }, _.clone = function(e) { return _.isObject(e) ? _.isArray(e) ? e.slice() : _.extend({}, e) : e }, _.tap = function(e, t) { return t(e), e }, _.isMatch = function(e, t) { var n = _.keys(t), r = n.length; if (null == e) return !r; for (var o = Object(e), i = 0; i < r; i++) { var a = n[i]; if (t[a] !== o[a] || !(a in o)) return !1 } return !0 }; var k = function(e, t, n, r) { if (e === t) return 0 !== e || 1 / e === 1 / t; if (null == e || null == t) return e === t; e instanceof _ && (e = e._wrapped), t instanceof _ && (t = t._wrapped); var o = g.call(e); if (o !== g.call(t)) return !1; switch (o) { case "[object RegExp]": case "[object String]": return "" + e == "" + t; case "[object Number]": return +e !== +e ? +t !== +t : 0 === +e ? 1 / +e === 1 / t : +e === +t; case "[object Date]": case "[object Boolean]": return +e === +t } var i = "[object Array]" === o; if (!i) { if ("object" != typeof e || "object" != typeof t) return !1; var a = e.constructor, s = t.constructor; if (a !== s && !(_.isFunction(a) && a instanceof a && _.isFunction(s) && s instanceof s) && "constructor" in e && "constructor" in t) return !1 } n = n || [], r = r || []; for (var l = n.length; l--;) if (n[l] === e) return r[l] === t; if (n.push(e), r.push(t), i) { if (l = e.length, l !== t.length) return !1; for (; l--;) if (!k(e[l], t[l], n, r)) return !1 } else { var c, u = _.keys(e); if (l = u.length, _.keys(t).length !== l) return !1; for (; l--;) if (c = u[l], !_.has(t, c) || !k(e[c], t[c], n, r)) return !1 } return n.pop(), r.pop(), !0 }; _.isEqual = function(e, t) { return k(e, t) }, _.isEmpty = function(e) { return null == e || (D(e) && (_.isArray(e) || _.isString(e) || _.isArguments(e)) ? 0 === e.length : 0 === _.keys(e).length) }, _.isElement = function(e) { return !(!e || 1 !== e.nodeType) }, _.isArray = h || function(e) { return "[object Array]" === g.call(e) }, _.isObject = function(e) { var t = typeof e; return "function" === t || "object" === t && !!e }, _.each(["Arguments", "Function", "String", "Number", "Date", "RegExp", "Error"], function(e) { _["is" + e] = function(t) { return g.call(t) === "[object " + e + "]" } }), _.isArguments(arguments) || (_.isArguments = function(e) { return _.has(e, "callee") }), "function" != typeof /./ && "object" != typeof Int8Array && (_.isFunction = function(e) { return "function" == typeof e || !1 }), _.isFinite = function(e) { return isFinite(e) && !isNaN(parseFloat(e)) }, _.isNaN = function(e) { return _.isNumber(e) && e !== +e }, _.isBoolean = function(e) { return e === !0 || e === !1 || "[object Boolean]" === g.call(e) }, _.isNull = function(e) { return null === e }, _.isUndefined = function(e) { return void 0 === e }, _.has = function(e, t) { return null != e && v.call(e, t) }, _.noConflict = function() { return l._ = c, this }, _.identity = function(e) { return e }, _.constant = function(e) { return function() { return e } }, _.noop = function() {}, _.property = C, _.propertyOf = function(e) { return null == e ? function() {} : function(t) { return e[t] } }, _.matcher = _.matches = function(e) { return e = _.extendOwn({}, e), function(t) { return _.isMatch(t, e) } }, _.times = function(e, t, n) { var r = Array(Math.max(0, e)); t = w(t, n, 1); for (var o = 0; o < e; o++) r[o] = t(o); return r }, _.random = function(e, t) { return null == t && (t = e, e = 0), e + Math.floor(Math.random() * (t - e + 1)) }, _.now = Date.now || function() { return (new Date).getTime() }; var G = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`" }, F = _.invert(G), U = function(e) { var t = function(t) { return e[t] }, n = "(?:" + _.keys(e).join("|") + ")", r = RegExp(n), o = RegExp(n, "g"); return function(e) { return e = null == e ? "" : "" + e, r.test(e) ? e.replace(o, t) : e } }; _.escape = U(G), _.unescape = U(F), _.result = function(e, t, n) { var r = null == e ? void 0 : e[t]; return void 0 === r && (r = n), _.isFunction(r) ? r.call(e) : r }; var V = 0; _.uniqueId = function(e) { var t = ++V + ""; return e ? e + t : t }, _.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; var z = /(.)^/, B = { "'": "'", "\\": "\\", "\r": "r", "\n": "n", "\u2028": "u2028", "\u2029": "u2029" }, $ = /\\|'|\r|\n|\u2028|\u2029/g, W = function(e) { return "\\" + B[e] }; _.template = function(e, t, n) { !t && n && (t = n), t = _.defaults({}, t, _.templateSettings); var r = RegExp([(t.escape || z).source, (t.interpolate || z).source, (t.evaluate || z).source].join("|") + "|$", "g"), o = 0, i = "__p+='"; e.replace(r, function(t, n, r, a, s) { return i += e.slice(o, s).replace($, W), o = s + t.length, n ? i += "'+\n((__t=(" + n + "))==null?'':_.escape(__t))+\n'" : r ? i += "'+\n((__t=(" + r + "))==null?'':__t)+\n'" : a && (i += "';\n" + a + "\n__p+='"), t }), i += "';\n", t.variable || (i = "with(obj||{}){\n" + i + "}\n"), i = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + i + "return __p;\n"; try { var a = new Function(t.variable || "obj", "_", i) } catch (e) { throw e.source = i, e } var s = function(e) { return a.call(this, e, _) }, l = t.variable || "obj"; return s.source = "function(" + l + "){\n" + i + "}", s }, _.chain = function(e) { var t = _(e); return t._chain = !0, t }; var H = function(e, t) { return e._chain ? _(t).chain() : t }; _.mixin = function(e) { _.each(_.functions(e), function(t) { var n = _[t] = e[t]; _.prototype[t] = function() { var e = [this._wrapped]; return m.apply(e, arguments), H(this, n.apply(_, e)) } }) }, _.mixin(_), _.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(e) { var t = u[e]; _.prototype[e] = function() { var n = this._wrapped; return t.apply(n, arguments), "shift" !== e && "splice" !== e || 0 !== n.length || delete n[0], H(this, n) } }), _.each(["concat", "join", "slice"], function(e) { var t = u[e]; _.prototype[e] = function() { return H(this, t.apply(this._wrapped, arguments)) } }), _.prototype.value = function() { return this._wrapped }, _.prototype.valueOf = _.prototype.toJSON = _.prototype.value, _.prototype.toString = function() { return "" + this._wrapped }, r = [], o = function() { return _ }.apply(t, r), !(void 0 !== o && (e.exports = o)) }).call(this) }, function(e, t, n) { var r = n(672); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(673); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(674); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(675); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(676); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(677); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(678); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(679); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, , , , function(e, t, n) { var r = n(684); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(685); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(686); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(687); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(688); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(689); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(e, t, n) { var r = n(690); "string" == typeof r && (r = [ [e.id, r, ""] ]); n(7)(r, {}); r.locals && (e.exports = r.locals) }, function(module, exports, __webpack_require__) { var _ = __webpack_require__(935); module.exports = function(obj) { var __t, __p = "", __j = Array.prototype.join, print = function() { __p += __j.call(arguments, "") }; with(obj || {}) __p += '\r\n\r\n

' + (null == (__t = title) ? "" : __t) + '

\r\n

' + (null == (__t = description) ? "" : __t) + "

"; return __p } }, function(e, t, n) { e.exports = n(2)(210) }, function(e, t, n) { e.exports = n(2)(224) }, function(e, t, n) { e.exports = n(2)(229) }, function(e, t, n) { e.exports = n(2)(234) }, function(e, t, n) { e.exports = n(2)(267) }, function(e, t, n) { e.exports = n(2)(292) }, function(e, t, n) { e.exports = n(2)(336) }, function(e, t, n) { e.exports = n(2)(371) }, function(e, t, n) { e.exports = n(2)(376) }, function(e, t, n) { e.exports = n(2)(388) }, function(e, t, n) { e.exports = n(2)(391) }, function(e, t, n) { e.exports = n(2)(394) }, function(e, t, n) { e.exports = n(2)(397) }, function(e, t, n) { e.exports = n(2)(399) }, function(e, t, n) { e.exports = n(2)(419) }]); //# sourceMappingURL=app.js.map