Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "object" != typeof JSON && (JSON = {}),
- function() {
- "use strict";
- function f(e) {
- return 10 > e ? "0" + e : e
- }
- function this_value() {
- return this.valueOf()
- }
- function quote(e) {
- return rx_escapable.lastIndex = 0, rx_escapable.test(e) ? '"' + e.replace(rx_escapable, function(e) {
- var t = meta[e];
- return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
- }) + '"' : '"' + e + '"'
- }
- function str(e, t) {
- var n, o, a, i, r, s = gap,
- d = t[e];
- switch (d && "object" == typeof d && "function" == typeof d.toJSON && (d = d.toJSON(e)), "function" == typeof rep && (d = rep.call(t, e, d)), typeof d) {
- case "string":
- return quote(d);
- case "number":
- return isFinite(d) ? String(d) : "null";
- case "boolean":
- case "null":
- return String(d);
- case "object":
- if (!d) return "null";
- if (gap += indent, r = [], "[object Array]" === Object.prototype.toString.apply(d)) {
- for (i = d.length, n = 0; i > n; n += 1) r[n] = str(n, d) || "null";
- return a = 0 === r.length ? "[]" : gap ? "[\n" + gap + r.join(",\n" + gap) + "\n" + s + "]" : "[" + r.join(",") + "]", gap = s, a
- }
- if (rep && "object" == typeof rep)
- for (i = rep.length, n = 0; i > n; n += 1) "string" == typeof rep[n] && (o = rep[n], a = str(o, d), a && r.push(quote(o) + (gap ? ": " : ":") + a));
- else
- for (o in d) Object.prototype.hasOwnProperty.call(d, o) && (a = str(o, d), a && r.push(quote(o) + (gap ? ": " : ":") + a));
- return a = 0 === r.length ? "{}" : gap ? "{\n" + gap + r.join(",\n" + gap) + "\n" + s + "}" : "{" + r.join(",") + "}", gap = s, a
- }
- }
- var rx_one = /^[\],:{}\s]*$/,
- rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
- rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
- rx_four = /(?:^|:|,)(?:\s*\[)+/g,
- rx_escapable = /[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
- "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
- return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
- }, Boolean.prototype.toJSON = this_value, Number.prototype.toJSON = this_value, String.prototype.toJSON = this_value);
- var gap, indent, meta, rep;
- "function" != typeof JSON.stringify && (meta = {
- "\b": "\\b",
- " ": "\\t",
- "\n": "\\n",
- "\f": "\\f",
- "\r": "\\r",
- '"': '\\"',
- "\\": "\\\\"
- }, JSON.stringify = function(e, t, n) {
- var o;
- if (gap = "", indent = "", "number" == typeof n)
- for (o = 0; n > o; o += 1) indent += " ";
- else "string" == typeof n && (indent = n);
- if (rep = t, t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length)) throw new Error("JSON.stringify");
- return str("", {
- "": e
- })
- }), "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
- function walk(e, t) {
- var n, o, a = e[t];
- if (a && "object" == typeof a)
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (o = walk(a, n), void 0 !== o ? a[n] = o : delete a[n]);
- return reviver.call(e, t, a)
- }
- var j;
- if (text = String(text), rx_dangerous.lastIndex = 0, rx_dangerous.test(text) && (text = text.replace(rx_dangerous, function(e) {
- return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
- })), rx_one.test(text.replace(rx_two, "@").replace(rx_three, "]").replace(rx_four, ""))) return j = eval("(" + text + ")"), "function" == typeof reviver ? walk({
- "": j
- }, "") : j;
- throw new SyntaxError("JSON.parse")
- })
- }(),
- function() {
- var e = window,
- t = e.$Debug = e.$Debug || {},
- n = e.$Config || {};
- t.options = {
- tracePagePath: !1
- }, t.fail = function(t) {
- var n = new Error(t + " "),
- o = e.$WebWatson;
- throw o && o.submitFromException(n, void 0, 33), n
- }, t.assert = function(o, a) {
- o || (a = "Assert failed: " + a, n.uxDebug && e.confirm(a + "\r\n\r\nBreak into debugger?") && t.fail(a))
- }, t.failIf = function(e, n) {
- e || t.fail(n)
- }, t.trace = function(n, o) {
- if (n || (n = ""), console && console.log) {
- if (t.options.tracePagePath) {
- var a = e.location.pathname;
- o = o ? a + ": " + o : a
- }
- o && (n = o + ": " + n), t.appendLog(n), console.log(n)
- }
- }
- }(),
- function() {
- var e = window,
- t = e.$Debug,
- n = e.Array.prototype;
- n.addRange || (n.addRange = function(e) {
- return e && this.push.apply(this, e), this
- }), n.exists || (n.exists = function(e) {
- return this.indexOf(e) >= 0
- }), n.contains || (n.contains = n.exists), n.clone || (n.clone = function() {
- return [].addRange(this)
- }), n.indexOf || (n.indexOf = function(e, t) {
- var n = this.length;
- for ((t = t || 0) < 0 && (t = Math.max(0, n + t)); n > t;)
- if (this[t++] === e) return t - 1;
- return -1
- }), n.forEach || (n.forEach = function(e, n) {
- t && t.assert(e, "fnCb must be provided");
- for (var o = this.length, a = 0; o > a; a++) e.call(n, this[a], a, this);
- t && t.assert(o == this.length, "Do not modify array during forEach")
- }), n.insert || (n.insert = function(e, t) {
- this.splice(e, 0, t)
- }), n.remove || (n.remove = function(e) {
- var t = this.indexOf(e);
- return t >= 0 && this.splice(t, 1), t >= 0
- })
- }(),
- function() {
- function e(e, t, o) {
- var a = o.s === t;
- if (!a) {
- t = t || 0;
- var i, r, s = e.charCodeAt(t);
- o.s = -1, 55296 > s || s > 57343 ? o.c = s : 56319 >= s ? (i = s, r = e.charCodeAt(t + 1), n && n.assert(!isNaN(r), "High surrogate not followed by low surrogate in fixedCharCodeAt()"), o.c = 1024 * (i - 55296) + (r - 56320) + 65536, o.s = t + 1) : (o.c = -1, a = !0)
- }
- return !a
- }
- var t = window,
- n = t.$Debug,
- o = t.String.prototype;
- o.endsWith = function(e) {
- return n && n.assert(e, "must provide suffix"), this.substr(this.length - e.length) == e
- }, o.startsWith = function(e) {
- return n && n.assert(e, "must provide prefix"), this.substr(0, e.length) == e
- }, o.lTrim = function() {
- return this.replace(/^\s*/, "")
- }, o.rTrim = function() {
- return this.replace(/\s*$/, "")
- }, o.trim = function() {
- return this.replace(/^\s+|\s+$/g, "")
- };
- var a = /\{\d+\}/g,
- i = /[\{\}]/g;
- o.format = function() {
- function e(e) {
- var o = t[e.replace(i, "")];
- return n && n.assert("undefined" != typeof o, "String Format- Provide argument at index " + e.replace(i, "")), null === o && (o = ""), o
- }
- var t = arguments;
- return this.replace(a, e)
- };
- var r = /[^\w.,-]/g;
- o.encodeXmlAttribute = o.encodeHtmlAttribute = function() {
- return this.replace(r, function(e) {
- return ["&#", e.charCodeAt(0), ";"].join("")
- })
- };
- var s = /[^\w .,-]/g;
- o.encodeXml = o.encodeHtml = function() {
- var t = {
- c: 0,
- s: -1
- };
- return this.replace(s, function(n, o, a) {
- return e(a, o, t) ? ["&#", t.c, ";"].join("") : ""
- })
- };
- var d = /[^\w.%-]/g;
- o.encodeURIComponent = o.encodeUrl = function() {
- return encodeURIComponent(this).replace(d, function(e) {
- var t = e.charCodeAt(0).toString(16);
- return "%" + (1 == t.length ? "0" + t : t).toUpperCase()
- })
- };
- var _ = /[^\w .,-]/g;
- o.encodeJson = function() {
- return this.replace(_, function(e) {
- var t = e.charCodeAt(0).toString(16),
- n = new Array(4 - t.length + 1).join("0");
- return "\\u" + n + t.toUpperCase()
- })
- }, o.decodeURIComponent = o.decodeUrl = function() {
- return decodeURIComponent(this)
- };
- var c = /([\\\.\{\}\(\)\[\]\/\+\*\?\|\^\$])/gi;
- o.escapeRegex = function(e) {
- return (0 === arguments.length ? this : e).replace(c, "\\$1")
- }, o.areEqualIgnoreCase = function(e) {
- var t = this;
- return t.toLowerCase() === e.toLowerCase() ? !0 : !1
- }, o.qs = function(e, t) {
- var n = new RegExp("([?&])" + e + "=([^&#]*)", "i");
- if (void 0 !== t && null !== t) return this.match(n) ? this.replace(n, "$1" + e + "=" + t) : this.indexOf("?") > 0 ? this + "&" + e + "=" + t : this + "?" + e + "=" + t;
- var o = n.exec(this);
- return null === o ? "" : o[2]
- }, o.upsertQueryStringParam = function(e, t) {
- return void 0 === t ? this : this.qs(e, t)
- }, o.removeQueryStringParam = function(e, t) {
- var n = new RegExp("([?&])" + t + "=.*?(&|$)", "i");
- return this.match(n) ? this.replace(n, "$1") : this
- }, o.getQueryStringParam = function(e) {
- if (!e) return "";
- var t = new RegExp("([?&])" + e + "=([^&#]*)", "i"),
- n = this.match(t);
- return n ? n[2] : ""
- }, o.getCookie = function(e) {
- for (var n, o, a = this.split(";"), i = 0; i < a.length; i++)
- if (n = a[i].substr(0, a[i].indexOf("=")).replace(/^\s+|\s+$/g, ""), o = a[i].substr(a[i].indexOf("=") + 1), n === e) return t.unescape(o)
- }, o.htmlEncode = function() {
- return $("<span/>").text(this).html()
- }, o.htmlDecode = function() {
- return $("<span/>").html(this).text()
- }
- }(),
- function() {
- var e = window.Object;
- "Object" != e.__typeName && (e.isString = function(e) {
- return "string" == typeof e || e && e.constructor === String
- }, e.isArray = function(e) {
- return e instanceof Array
- }, e.isFunction = function(e) {
- return "function" == typeof e
- }, e.isObject = function(e) {
- return e && "object" == typeof e
- }, e.isBoolean = function(e) {
- return "boolean" == typeof e || e && e.constructor === Boolean
- }, e.isNumber = function(e) {
- return "number" == typeof e || e && e.constructor === Number
- }, e.resolve = function(e) {
- try {
- "string" == typeof e ? e = Function.parse(e) : "object" == typeof e ? e = e.constructor : "function" != typeof e && (e = null)
- } catch (t) {
- return null
- }
- return e
- }, e.compare = function(e, t) {
- var n = this.resolve(e);
- return n && n == this.resolve(t)
- }, e.getType = function(t) {
- var n = t.constructor;
- return n && "function" == typeof n && n.__typeName && "Object" != n.__typeName ? n : e
- }, e.isNull = function(e) {
- return null === e || void 0 === e
- }, e.getTypeName = function(t) {
- return e.getType(t).__typeName
- }, e.__typeName = "Object")
- }(), $Do.when("jQuery", function() {
- function e(e, t, n, o, a) {
- var i = {
- canary: d.apiCanary,
- hpgid: d.hpgid || 0,
- hpgact: d.hpgact || 0,
- Accept: C
- };
- d.correlationId && (i[p] = d.correlationId);
- var s = t;
- return t && !r(t) && (s = JSON.stringify(t)), s && (s = s.replace(/\?/g, "\\u003F")), c && c.appendLog && c.appendLog("$Api.Json(" + e + ")"), jQuery.ajax({
- url: e,
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- data: s,
- processData: !1,
- type: "POST",
- headers: i,
- timeout: a || l,
- success: n,
- error: o
- })
- }
- function t(e) {
- return e ? "<span style='font-weight: bold;'>" + e.toString().encodeHtml() + ":</span> " : ""
- }
- function n(e, n) {
- return n ? "<div>" + t(e) + n.toString().encodeHtml() + "</div>" : ""
- }
- function o(e) {
- var t = [];
- if (e)
- for (var n = (e || "").split("\n"), o = 0; o < n.length; o++)
- for (var a = n[o], i = (a || "").split("\\r\\n"), r = 0; r < i.length; r++) {
- var s = (i[r] || "").replace("\\u000a", "").replace("\\u0028", "(").replace("\\u0029", ")").replace("\\u003a", ":").replace("\\u003c", "<").replace("\\u003d", "=").replace("\\u003e", ">").replace("\\u005c", "\\");
- t.push(s)
- }
- return t
- }
- function a(e) {
- var t = "";
- if (e)
- for (var n = 0; n < e.length; n++) t += e[n] + "\n";
- return t
- }
- function i(e, t) {
- if (S && e && e.error && (e.error.stackTrace || e.error.debugMessage)) {
- var i = o(e.error.stackTrace),
- r = null;
- if (e.error.isFatal || e.error.showError) r = a(i), _ && _.showError(e.error.code, "ApiRequest Error: " + (e.error.message || ""), t || "<none>", null, null, null, r, e.error.debugMessage, e.error.data, e.error.isFatal ? "#FFC0C0" : "#C0FFFF", !0);
- else if (window.$Debug && c.scriptConsole) {
- var s = c.scriptConsole;
- r = a(i), s.errorHtml(n("Url", t) + n("Error Code", e.error.code) + (e.error.message ? n("Message", e.error.message) : "") + (e.error.isFatal ? n("Is Fatal", e.error.isFatal) : "") + (e.error.debugMessage ? n("Debug", e.error.debugMessage) : ""), {
- url: t,
- code: e.error.code,
- data: e.error.data,
- stackTrace: i,
- rsp: e
- })
- }
- }
- }
- function r(e) {
- return "string" === jQuery.type(e)
- }
- var s = window,
- d = s.$Config || {},
- _ = s.$WebWatson,
- c = s.$Debug || {},
- l = 3e4,
- u = 8e3,
- g = 8001,
- m = 8002,
- h = 100,
- p = "client-request-id",
- C = "application/json",
- f = s.$Api = {},
- E = f.Errors = [];
- f.ApiErrorCodes = {
- GeneralError: "6000",
- AuthFailure: "6001",
- InvalidArgs: "6002",
- Generic: u,
- Timeout: g,
- Aborted: m
- };
- var S = null;
- f.Json = function(t, n, o, a, r, s) {
- function c(e, t) {
- var n = {};
- if (500 == e.status) try {
- n = JSON.parse(e.responseText) || {}
- } catch (o) {}
- if (!n.error) {
- var a = !1,
- i = u,
- r = "Request Failed -- No Response from Server";
- switch (t) {
- case "timeout":
- i = g, r = "Timeout Error", a = !0;
- break;
- case "abort":
- i = m, r = "Aborted";
- break;
- case "error":
- e.status >= 400 && (a = !0);
- break;
- case "parsererror":
- r = "Unable to parse response", a = !0
- }
- n.error = {
- code: i,
- message: r,
- debugMessage: "(xhr status " + e.status + ") xhr.responseText: " + e.responseText,
- stackTrace: "",
- isFatal: a
- }
- }
- return n
- }
- function l(e) {
- e = e || {};
- var n, r = e.error || null;
- if (e.apiCanary && (d.apiCanary = e.apiCanary, delete e.apiCanary), r) {
- n = r.stackTrace, n = n && n.encodeJson ? n.encodeJson() : "";
- var _ = '{"code": "' + r.code + '", "message": "' + r.message + '", "debug": "' + r.debugMessage + '", "stacktrace": "' + n + '", "requestUrl": "' + t + '"}';
- E.push(_), E.length > h && E.shift(), r.code != m && (i(e, t), a && a(e, s))
- } else o && o(e, s)
- }
- function p() {
- return setTimeout(function() {
- var e = {
- error: {
- code: m,
- message: "Request Failed!",
- isFatal: !0
- }
- };
- l(e)
- }, 0), null
- }
- var C = o || a ? !0 : !1;
- return d.apiCanary ? (null === S && (S = !1, _ && d.isOneBox && (S = !0)), e(t, n, function(e) {
- C && l(e)
- }, function(e, t, n) {
- C && l(c(e, t, n))
- }, r)) : p()
- }, s.$Do && s.$Do.register("$Api")
- });
- var MSLogin = {},
- proxy = proxy || {};
- MSLogin.ErrorCodes = {
- IDP_ERROR: 2147776681,
- IDP_ERROR2: 2147776682,
- NAMESPACE_ERROR: 2147778860,
- PARSE_ERROR: 2147762276
- };
- var ErrorCodes = MSLogin.ErrorCodes;
- MSLogin.Constants = {
- REDIRECT_COUNTDOWN_DEFAULT: 3,
- FEDERATION_QUERY_PARAMETERS: "",
- CDN_IMAGE_PATH: "images/",
- LATENCY_THRESHOLD: 2e3,
- PREFETCH_URL: "",
- LATENCY_SENSITIVITY_DEFAULT: 1,
- OTHER_ACCOUNT_TEXT: "",
- MAX_TILE_TEXT_LENGTH: 25,
- MEMBER_NAME: "",
- REDIRECT_MESSAGES: {},
- METRICS_MODE: 1,
- SUBMIT_METRICS_ON_REDIRECT: !1,
- SUBMIT_METRICS_ON_POST: !1,
- INSTRUMENT_PLT: !1,
- MOBILE_WIDTH_THRESHOLD: 600,
- MOBILE_HEIGHT_THRESHOLD: 600,
- PARTNER_NAME: "",
- SAVED_USER_COOKIE: "MSSavedUser",
- PREFILL_USER_COOKIE: "MSPPre",
- SAVED_USER_COOKIE_INFO_DELIMITER: "$",
- SAVED_USER_COOKIE_USER_DELIMITER: "|",
- MAX_USER_TILES: 1,
- DIR: "ltr",
- TWOFA_POLLING_INTERVAL: null,
- TWOFA_MAX_POLLS: null,
- TWOFA_MAXMETHODS: 20,
- TWOFA_OTP_MAX_LEN: 6,
- TWOFA_TIMEOUT: 1e4,
- TWOFA_ANIMATION_INTERVAL: 3e3,
- TWOFA_AUTH_TIMEOUT: 12e4,
- TWOFA_REMEMBER_DEVICE_ENABLED: !1,
- SSPR_TIMEOUT: 1e4,
- EMAIL_DISCOVERY_SERVICE_TIMEOUT: 3e3,
- EMAIL_DISCOVERY_SERVICE_URI: "/GetUserRealmExtended.srf",
- EMAIL_DISCOVERY_DEFAULT_TILES: null,
- MSA_AUTH_URL: null,
- TENANT_BRANDING: null,
- LCID: null,
- MSA_ACCOUNT_IMG_ALT_TEXT: "",
- AAD_ACCOUNT_IMG_ALT_TEXT: "",
- MSA_ACCOUNT_TILE_ALT_TEXT: "",
- AAD_ACCOUNT_TILE_ALT_TEXT: "",
- HIP_IMAGE_ALT_TEXT: null,
- DEFAULT_ILLUSTRATION: "",
- DEFAULT_ILLUSTRATION_ALT: "",
- DEFAULT_LOGO: "",
- DEFAULT_LOGO_ALT: "",
- DEFAULT_BACKGROUND_COLOR: "#333333",
- GENERIC_ERROR_CODES: [ErrorCodes.IDP_ERROR, ErrorCodes.IDP_ERROR2, ErrorCodes.NAMESPACE_ERROR, ErrorCodes.PARSE_ERROR],
- REALM_RESOLVER_URL: "/GetUserRealm.srf",
- DYNAMIC_BRANDING_CTA_ENABLED: !0,
- USERNAME_HINT_TEXT: "someone@example.com",
- REGEX_PHONE: /^[\+]{0,1}([\(\)\- \*\.#/\[\]]*\d[\(\)\- \*\.#/\[\]]*){4,20}$/,
- REGEX_EMAIL: /^([\w-\.\'!#]+@([\w-]+\.)+[\w-]{2,46})?$/,
- USER_DOMAIN_HINT_CHANGED_EVENT_NAME: "MSLogin-User-UserDomainHintChanged"
- }, MSLogin.Constants.State = {
- NONE: 0,
- FEDERATED: 1,
- MANAGED: 2,
- INVALID: 3,
- PENDING: 4
- }, MSLogin.Constants.MSAccount = {
- EXISTS: 0,
- NOT_EXIST: 1,
- THROTTLED: 2
- }, MSLogin.Constants.TokenizedStringMsgs = {
- GENERIC_ERROR: "",
- UPN_DISAMBIGUATE_MESSAGE: ""
- }, MSLogin.Constants.NameSpaceType = {
- UNKNOWN: "Unknown",
- FEDERATED: "Federated",
- MANAGED: "Managed",
- CLOUDFEDERATED: "CloudFederated"
- }, MSLogin.Constants.FederationProtocol = {
- Saml20: "SAML20"
- }, MSLogin.Constants.EmailDiscoveryAccountState = {
- AAD_UNKNOWN_AND_MSA_NOT_EXIST: 0,
- AAD_UNKNOWN_AND_MSA_EXISTS: 1,
- AAD_UNKNOWN_AND_MSA_THROTTLED: 2,
- AAD_UNKNOWN_AND_MSA_TIMED_OUT: 3,
- AAD_FEDERATED_AND_MSA_NOT_EXIST: 4,
- AAD_FEDERATED_AND_MSA_EXISTS: 5,
- AAD_FEDERATED_AND_MSA_THROTTLED: 6,
- AAD_FEDERATED_AND_MSA_TIMED_OUT: 7,
- AAD_MANAGED_AND_MSA_NOT_EXIST: 8,
- AAD_MANAGED_AND_MSA_EXISTS: 9,
- AAD_MANAGED_AND_MSA_THROTTLED: 10,
- AAD_MANAGED_AND_MSA_TIMED_OUT: 11,
- AAD_TIMED_OUT_AND_MSA_NOT_EXIST: 12,
- AAD_TIMED_OUT_AND_MSA_EXISTS: 13,
- AAD_TIMED_OUT_AND_MSA_THROTTLED: 14,
- AAD_TIMED_OUT_AND_MSA_TIMED_OUT: 15,
- ERROR: 16,
- AAD_CLOUDFEDERATED_AND_MSA_NOT_EXIST: 17,
- AAD_CLOUDFEDERATED_AND_MSA_EXISTS: 18,
- AAD_CLOUDFEDERATED_AND_MSA_THROTTLED: 19,
- AAD_CLOUDFEDERATED_AND_MSA_TIMED_OUT: 20
- }, MSLogin.Constants.CancelAction = {
- FROM_REDIRECT_TO_LOGIN: 0,
- FROM_SHOW_USER_TO_TILES: 1,
- FROM_MANY_TO_EMAILDISCOVERY_INIT: 2,
- FROM_EMAILDISCOVERY_START_TO_TILES: 3,
- FROM_EMAILDISCOVERY_SPLITTER_TO_EMAILDISCOVERY_START: 4,
- FROM_EMAILDISCOVERY_AAD_LOGIN_TO_EMAILDISCOVERY_START: 5,
- FROM_EMAILDISCOVERY_AAD_LOGIN_TO_EMAILDISCOVERY_SPLITTER: 6,
- FROM_EMAILDISCOVERY_LOOKING_FOR_ACCOUNT_TO_EMAILDISCOVERY_START: 7,
- FROM_EMAILDISCOVERY_REDIRECT_TO_EMAILDISCOVERY_START: 8,
- FROM_EMAILDISCOVERY_REDIRECT_TO_EMAILDISCOVERY_SPLITTER: 9,
- FROM_EMAILDISCOVERY_SPLITTER_FALLBACK_TO_TILES: 10,
- FROM_DISAMBIGUATION_SCREEN_TO_LOGIN: 11,
- FROM_LOGIN_TO_DISAMBIGUATION_SCREEN: 12,
- FROM_REDIRECT_TO_DISAMBIGUATION_SCREEN: 13
- }, MSLogin.Constants.AuthNForwardType = {
- NORMAL: 0,
- MULTIAUTH_ADFS: 1,
- NON_MULTIAUTH_ADFS: 2,
- WIAORMULTIAUTHN_ADFS: 3
- }, MSLogin.BackActionStack = function() {
- this.BackActionStack = []
- }, MSLogin.BackActionStack.prototype.AddAction = function(e) {
- this.BackActionStack.push(e)
- }, MSLogin.BackActionStack.prototype.TriggerCancelAction = function() {
- Context.post_from_tile = !1;
- var e = this.BackActionStack.pop();
- switch (e) {
- case Constants.CancelAction.FROM_REDIRECT_TO_LOGIN:
- case Constants.CancelAction.FROM_SHOW_USER_TO_TILES:
- TenantBranding.RestoreDefaultPageBranding(), Tiles.CancelTileRedirect();
- break;
- case Constants.CancelAction.FROM_MANY_TO_EMAILDISCOVERY_INIT:
- EmailDiscovery.Init();
- break;
- case Constants.CancelAction.FROM_EMAILDISCOVERY_START_TO_TILES:
- EmailDiscovery.BackToUserTiles();
- break;
- case Constants.CancelAction.FROM_EMAILDISCOVERY_SPLITTER_TO_EMAILDISCOVERY_START:
- Context.username_state.last_checked_email = "", EmailDiscovery.HideSplitter(), EmailDiscovery.ShowEmailDiscovery();
- break;
- case Constants.CancelAction.FROM_EMAILDISCOVERY_AAD_LOGIN_TO_EMAILDISCOVERY_START:
- Context.username_state.last_checked_email = "", EmailDiscovery.HideAADLoginLayout(), EmailDiscovery.ShowEmailDiscovery();
- break;
- case Constants.CancelAction.FROM_EMAILDISCOVERY_AAD_LOGIN_TO_EMAILDISCOVERY_SPLITTER:
- EmailDiscovery.HideAADLoginLayout(), Context.email_discovery_use_msa_api ? this.TriggerCancelAction() : EmailDiscovery.ShowSplitter();
- break;
- case Constants.CancelAction.FROM_EMAILDISCOVERY_LOOKING_FOR_ACCOUNT_TO_EMAILDISCOVERY_START:
- Context.username_state.last_checked_email = "", EmailDiscovery.CancelLookingForAccount();
- break;
- case Constants.CancelAction.FROM_EMAILDISCOVERY_REDIRECT_TO_EMAILDISCOVERY_START:
- Context.username_state.last_checked_email = "", EmailDiscovery.CancelRedirect(), EmailDiscovery.ShowEmailDiscovery();
- break;
- case Constants.CancelAction.FROM_EMAILDISCOVERY_REDIRECT_TO_EMAILDISCOVERY_SPLITTER:
- EmailDiscovery.CancelRedirect(), Context.email_discovery_use_msa_api ? this.TriggerCancelAction() : EmailDiscovery.ShowSplitter();
- break;
- case Constants.CancelAction.FROM_EMAILDISCOVERY_SPLITTER_FALLBACK_TO_TILES:
- EmailDiscovery.HideSplitter(), this.TriggerCancelAction();
- break;
- case Constants.CancelAction.FROM_DISAMBIGUATION_SCREEN_TO_LOGIN:
- Context.username_state.last_checked_email = "", Tiles.hideDisambiguationScreen(), Tiles.showUserLoginPage();
- break;
- case Constants.CancelAction.FROM_LOGIN_TO_DISAMBIGUATION_SCREEN:
- MSLogin.SplitterControl.Render();
- break;
- case Constants.CancelAction.FROM_REDIRECT_TO_DISAMBIGUATION_SCREEN:
- User.CancelRedirect(), MSLogin.SplitterControl.Render()
- }
- }, MSLogin.Store = function() {
- this.Map = {}
- }, MSLogin.Store.prototype.Get = function(e) {
- var t = $.trim(e).toLowerCase();
- return this.Map[t]
- }, MSLogin.Store.prototype.Add = function(e, t) {
- var n = $.trim(e).toLowerCase();
- this.Map[n] = t
- }, MSLogin.BackActionStack.prototype.RemoveLastCancelAction = function() {
- this.BackActionStack.pop()
- }, MSLogin.BackActionStack.prototype.DoesCancelActionExist = function() {
- return this.BackActionStack.length > 0
- }, MSLogin.BackActionStack.prototype.ClearCancelActions = function() {
- this.BackActionStack = []
- };
- var Constants = MSLogin.Constants;
- MSLogin.Context = {
- whr: "",
- query_search_params: document.location.search,
- federated_domain: "",
- redirect_countdown: Constants.REDIRECT_COUNTDOWN_DEFAULT,
- redirect_auth_url: "",
- animationTid: null,
- redirectTid: null,
- metrics_on_redirect_submitted: !1,
- cobranding_image_visible: !1,
- prefetch_initiated: !1,
- user_tiles: null,
- email_discovery_lookup_xhr: null,
- email_discovery_mode: !1,
- email_discovery_tiles_mode: !1,
- email_discovery_response: null,
- email_discovery_timeout_occurred: !1,
- email_discovery_splitter_shown: !1,
- email_discovery_workflow_state: 0,
- email_discovery_easi_user: !1,
- email_discovery_use_msa_api: !0,
- cred_height: -1,
- has_forced_cred_block_height: !1,
- original_orientation: window.orientation,
- back_action_stack: new MSLogin.BackActionStack,
- tenant_branding_tid: null,
- tenant_branding_retry_count: 2e3,
- tenant_branding_polling_interval: 20,
- tenant_branding_ts: 0,
- authn_forward_state: 0,
- post_from_tile: !1,
- on_load_image_background_loaded: !1,
- password_reset_link_url: "",
- getuserrealmresult: null,
- nationalCloudFederated: !1
- }, MSLogin.Context.username_state = {
- is_empty: !0,
- is_partial: !1,
- is_timeout: !1,
- home_realm_state: 0,
- disable_password: !0,
- enable_guests: !0,
- enable_redirect: !1,
- enable_progress_bar: !1,
- last_checked_email: ""
- }, MSLogin.Context.TenantBranding = {
- key: null,
- user: null,
- prev_key: null,
- prev_obj: null,
- prev_user: null,
- prev_boiler_plate_height: 0,
- default_page: !1,
- whr_key: null,
- applied: !1,
- info: null,
- info_context: null,
- enabled: !1,
- has_logo: !1,
- has_background_img: !1,
- background_color: Constants.DEFAULT_BACKGROUND_COLOR,
- footer_height: 0,
- footer_height_saved: !1,
- cred_height: 0,
- cred_height_saved: !1,
- workload_branding_saved: !1,
- workload_branding_illustration: null,
- workload_branding_illustration_alt: null,
- workload_branding_logo: null,
- workload_branding_logo_alt: null,
- workload_branding_footer_height: 0,
- workload_branding_footer_height_saved: !1,
- workload_branding_color: null,
- workload_branding_height: 0,
- workload_branding_enabled: !1,
- workload_branding_login_cta_text: "",
- store: new MSLogin.Store,
- username_hint_changed: !1
- };
- var Context = MSLogin.Context;
- MSLogin.Background = {
- delayed_background_fetch_url: "",
- background_image_ratio: 0,
- background_image_loaded: !1,
- background_image_wait: null,
- winW: -1,
- winH: 460,
- viewport_height: 460,
- alt_image_path: "",
- alt_background_path: "",
- background_resized: !1
- };
- var Background = MSLogin.Background;
- MSLogin.Logo = {
- logo_image_loaded: !1,
- logo_image_wait: null,
- winW: -1,
- winH: 159,
- alt_image_path: "",
- alt_logo_path: ""
- };
- var Logo = MSLogin.Logo;
- MSLogin.Instrument = {
- latency_sensitivity: Constants.LATENCY_SENSITIVITY_DEFAULT,
- home_realm_start: null,
- home_realm_load_time: 0,
- prefetch_done: !1,
- prefetch_start: null,
- prefetch_load_time: 0,
- background_image_loaded: !1,
- background_image_start: null,
- background_image_load_time: 0,
- background_image_error: !1,
- logo_image_loaded: !1,
- logo_image_start: null,
- logo_image_load_time: 0,
- logo_image_error: null,
- email_discovery_ui_code: 0,
- email_discovery_splitter_choice: 0,
- possible_easi_user: 0,
- tenant_branding_start_time: (new Date).getTime(),
- tenant_branding_process_end_time: 0,
- tenant_branding_json_end_time: 0,
- tenant_branding_load_error: !1,
- has_tenant_branding: !1,
- has_dynamic_tenant_branding: !1,
- tenant_branding_total_time: 0,
- tenant_branding_number_of_switches: 0,
- tenant_branding_right_side_time: 0,
- logo_image_end_time: 0,
- background_image_end_time: 0,
- document_ready_end_time: 0,
- document_load_end_time: 0
- };
- var Instrument = MSLogin.Instrument;
- MSLogin.User = {
- UpdateUsernameState: function() {
- var e = $("input#cred_userid_inputtext"),
- t = $.trim(e.val());
- if (e.val(t), Context.username_state.is_empty = !1, Context.username_state.is_partial = !1, t != Context.username_state.last_checked_email && (Context.username_state.home_realm_state = Constants.State.NONE), "" == t && (Context.username_state.is_empty = !0, Context.username_state.is_partial = !0, Context.username_state.is_timeout = !1, Context.username_state.disable_password = !0, Context.username_state.enable_redirect = !1, Context.username_state.home_realm_state = Constants.State.NONE), Support.is_placeholder_supported() || User.togglePlaceHolder(e, Context.username_state.is_empty), !Support.validateUsernameCredInput(t))
- if (Constants.IS_MSA_PHONE_USERNAME_SUPPORTED && Constants.REGEX_PHONE.test(t)) Context.username_state.is_empty = !1, Context.username_state.is_partial = !1, Context.username_state.home_realm_state = Constants.State.NONE;
- else if (Context.username_state.is_empty = !1, Context.username_state.is_partial = !0, Context.username_state.home_realm_state = Constants.State.NONE, !Constants.IS_NAME_COEXISTENCE_ACCOUNT) {
- var n = 30064;
- null != t && t.indexOf("\\") > -1 && (n = 30066), Support.showClientError(n)
- }
- switch (Context.username_state.is_timeout && (Context.username_state.is_timeout = !0, Context.username_state.disable_password = !1, Context.username_state.enable_redirect = !1), Context.username_state.home_realm_state) {
- case Constants.State.FEDERATED:
- Context.username_state.is_timeout = !1, Context.username_state.disable_password = !0, Context.username_state.enable_redirect = !0;
- break;
- case Constants.State.MANAGED:
- Context.username_state.is_timeout = !1, Context.username_state.disable_password = !1, Context.username_state.enable_redirect = !1;
- break;
- case Constants.State.INVALID:
- Context.username_state.is_timeout = !1, Context.username_state.disable_password = !0, Context.username_state.enable_redirect = !1;
- break;
- default:
- Context.username_state.is_timeout = !1, Context.username_state.disable_password = !0, Context.username_state.enable_redirect = !1
- }
- $("#home_realm_discovery").val(Context.username_state.home_realm_state)
- },
- IsGuestUser: function() {
- var e = window.location.href;
- return null != e && (Context.query_search_params.indexOf("guests=1") > -1 || Context.query_search_params.indexOf("guest=1") > -1) ? !0 : !1
- },
- UsernameOnChangeHandler: function() {
- User.UpdateUsernameState(), $("#recover_container").removeClass("hidden"), $("#recover_container").css("opacity", 1), Context.username_state.enable_redirect ? ($("#cred_password_container").css("opacity", 0), $("#cred_password_container").addClass("hidden"), $("#redirect_message_container").removeClass("no_display"), $("#redirect_message_container").css("opacity", 1), $("#redirect_message_container").removeClass("hidden"), $(".login_guest_container").css("opacity", 0), $("#cred_sign_in_button").css("opacity", 0), $("#cred_sign_in_button").addClass("hidden")) : ($("#cred_password_container").removeClass("hidden"), $("#cred_password_container").css("opacity", 1), $("#redirect_message_container").css("opacity", 0), $("#redirect_message_container").addClass("hidden"), $("#redirect_message_container").addClass("no_display"), $(".login_guest_container").css("opacity", 1), $("#cred_sign_in_button").css("opacity", 1), $("#cred_sign_in_button").removeClass("hidden")), Context.username_state.enable_guests && User.IsGuestUser() ? ($("#guest_hint_text").show(), $("#alternative-identity-providers").hide(), $(".guest_redirect_container").show()) : ($("#guest_hint_text").hide(), $(".guest_redirect_container").hide()), Context.username_state.enable_progress_bar || (clearInterval(Context.animationTid), $("div.progress").css("visibility", "hidden"))
- },
- setupPrefetching: function() {
- Context.prefetch_initiated || Support.is_prefetch_supported() && "" != Constants.PREFETCH_URL && User.latencySensitivity() >= -1 && (Instrument.prefetch_start = Util.now(), Util.PrefetchContent(Constants.PREFETCH_URL), Context.prefetch_initiated = !0)
- },
- onLoadImage: function() {
- var e = $("#background_background_image");
- Background.background_image_ratio = Support.isDefined(e) && Support.isDefined(e[0]) && Support.isDefined(e[0].naturalWidth) && Support.isDefined(e[0].naturalHeight) && 0 != e[0].naturalHeight ? e[0].naturalWidth / e[0].naturalHeight : e.width() / e.height(), Background.background_image_loaded = !0, Util.debug_console("OnLoadImage: Called"), Background.background_resized && !Context.on_load_image_background_loaded && User.IsImageLoaded(e) && (Context.on_load_image_background_loaded = !0, TenantBranding.IsShowingDynamicBranding() ? Logo.logo_image_loaded && TenantBranding.onLoadImageHelper() : User.onLoadImageHelper())
- },
- onLoadImageHelper: function() {
- var e = $("#background_background_image");
- e.hide(), $("#background_background_image_old").remove(), $("#background_page_overlay").css("visibility", "visible"), e.show();
- var t = $("html").css("background-color");
- $("#background_page_overlay").css("background-color", t), $("#background_page_overlay").show(), $("#background_page_overlay").fadeOut(500, "linear"), Util.debug_console("OnLoadImage: Background was resized.")
- },
- updateGuestLink: function() {
- var e = $("#guest_redirect_link").attr("href");
- "" != e && void 0 != e && (e = User.addFederatedRedirectQSParameters(e), $("#guest_redirect_link").attr("href", e))
- },
- forceOrientationResize: function() {
- Context.original_orientation = -1, User.resize_bg(Context.original_orientation)
- },
- togglePlaceHolder: function(e, t) {
- e.css("background", t ? "transparent" : "#FFFFFF"), e.siblings(".placeholder").css("filter", "alpha(opacity={0})".format(t ? "100" : "0")), e.siblings(".placeholder").css("visibility", t ? "visible" : "hidden")
- },
- setupCredFieldsWithPlaceHolder: function() {
- var e = $("input#cred_userid_inputtext"),
- t = $("input#cred_password_inputtext");
- Constants.IS_HOLOGRAPHIC ? (e.keypress(function(e) {
- User.KeyPressEnter(e, Util.OnNext, 13)
- }), t.keypress(function(e) {
- User.KeyPressEnter(e, Util.OnNext, 13)
- })) : (e.focus(function() {
- Context.username_state.enable_redirect && User.CancelRedirect()
- }), /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) && e.blur(function() {
- User.forceOrientationResize()
- }), e.change(function() {
- User.RefreshDomainState(), User.UsernameOnChangeHandler()
- }), e.keydown(function(e) {
- User.KeyPressEnter(e, User.RefreshDomainState, 13), Context.email_discovery_workflow_state != EmailDiscovery.WorkflowStates.INIT && User.KeyPressEnter(e, User.RefreshDomainState, 9)
- }), t.keypress(function(e) {
- User.KeyPressEnter(e, Post.SubmitCreds, 13)
- }), $("input#cred_keep_me_signed_in_checkbox").keypress(function(e) {
- User.KeyPressEnter(e, Post.SubmitCreds, 13)
- }), $("input#cred_keep_me_signed_in_checkbox").change(function() {
- User.updateGuestLink()
- }), t.click(function() {
- User.UsernameOnChangeHandler(), Context.username_state.is_empty || Context.username_state.is_partial || User.RefreshDomainState()
- }), t.blur(function() {
- User.forceOrientationResize()
- }), Util.debug_console("placeholder supported: " + Support.is_placeholder_supported()), Support.is_placeholder_supported() || ($("input[placeholder]").each(function() {
- var e = $(this).attr("placeholder"),
- t = $(this).attr("id"),
- n = "";
- t && (n = 'id="' + t + '_placeholder_span"');
- var o = $('<span class="placeholder" ' + n + ">" + e + "</span>").appendTo($(this).parent());
- $(this).before(o), o.css("position", "absolute"), o.css("display", "block"), o.addClass("normaltext"), o.click(function() {
- $(this).siblings("input").focus()
- }), $(this).attr("placeholder", " "), User.togglePlaceHolder($(this), "" == $(this).val())
- }), $("input[placeholder]").focus(function() {
- User.togglePlaceHolder($(this), "" == $(this).val())
- }), $("input[placeholder]").keydown(function() {
- User.togglePlaceHolder($(this), !1)
- }), $("input[placeholder]").bind("paste", function() {
- User.togglePlaceHolder($(this), !1)
- }), $("input[placeholder]").keyup(function() {
- User.togglePlaceHolder($(this), "" == $(this).val())
- }), $("input[placeholder]").blur(function() {
- User.togglePlaceHolder($(this), "" == $(this).val())
- }), t.parent().click(function() {
- User.UsernameOnChangeHandler(), Context.username_state.is_empty || Context.username_state.is_partial || User.RefreshDomainState()
- })));
- var n = decodeURIComponent(Util.ExtractQSParam("username")),
- o = $("#cred_userid_inputtext").val();
- if ("" != n) {
- var a = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,46})?$/;
- a.test(n) && "" == o && $("#cred_userid_inputtext").val(n)
- }
- $("#redirect_cta_text").hide()
- },
- setupCallToActionMessages: function() {
- $.each(Constants.GENERIC_ERROR_CODES, function(e, t) {
- $("#cta_client_error_text").append($("<div/>").addClass("client_error_msg").addClass(t.toString()).html(Constants.TokenizedStringMsgs.GENERIC_ERROR.replace("#~#ErrorCode#~#", t)))
- })
- },
- resize_bg: function(e) {
- void 0 != e && (Context.original_orientation = e), document.body && document.body.offsetWidth && (Background.winW = document.body.offsetWidth, Background.winH = document.body.offsetHeight), "CSS1Compat" == document.compatMode && document.documentElement && document.documentElement.offsetWidth && (Background.winW = document.documentElement.offsetWidth, Background.winH = document.documentElement.offsetHeight), window.innerWidth && window.innerHeight && (Background.winW = window.innerWidth, Background.winH = window.innerHeight);
- var t = document.documentMode;
- if (Support.isDefined(document.documentElement) && Support.isDefined(document.documentElement.clientHeight) && (Background.viewport_height = document.documentElement.clientHeight), $.browser.msie && t >= 10 && (navigator.userAgent.match(/IEMobile/) && Background.viewport_height > 10 ? $("td#login_panel_center").css("height", Background.viewport_height - 10) : $("td#login_panel_center").css("height", Background.winH - 10)), !(!Background.background_image_loaded && null == Background.delayed_background_fetch_url || Background.background_resized && "undefined" != typeof window.orientation && Context.original_orientation == window.orientation || (Context.original_orientation = window.orientation, "1" == Util.ExtractQSParam("popupui")))) {
- Support.showIllustration() && null != Background.delayed_background_fetch_url && ($("#background_background_image").error(function() {
- Instrument.tenant_branding_load_error = !0
- }), User.UpdateBackground(Background.delayed_background_fetch_url, $("html").css("background-color"))), Util.debug_console("resize_bg Background: " + Background.winW + " x " + Background.winH);
- var n = Support.getViewport();
- if (Util.debug_console("resize_bg Viewport: " + n[0] + " x " + n[1]), Util.debug_console("resize_bg JQuery: " + $("body").width() + " x " + $("body").height()), $("img#background_background_image").error(function() {
- $(this).hide()
- }), !Background.background_image_loaded || 0 == Background.background_image_ratio) return void Util.debug_console("Background image not yet loaded.");
- var o = $(document).width() - 400,
- a = $(document).height(),
- i = o,
- r = Math.round(i / Background.background_image_ratio);
- $("#background_background_image").width(i), $("#background_background_image").height(r), a > r && (r = a, i = Math.round(r * Background.background_image_ratio), $("#background_background_image").width(i), $("#background_background_image").height(r)), Background.background_image_loaded && !Background.background_resized && (Util.debug_console("Background image loaded!"), Background.background_resized = !0, User.onLoadImage()), Util.debug_console("bg_image: " + i + " x " + r)
- }
- },
- getElementHeightSpacing: function(e, t) {
- var n = 0;
- return n += $(e).height(), t && (n += parseInt($(e).css("padding-top"), 10), n += parseInt($(e).css("padding-bottom"), 10)), n
- },
- getElementHeightMargin: function(e) {
- var t = 0;
- return t += parseInt($(e).css("margin-top"), 10), t += parseInt($(e).css("margin-bottom"), 10)
- },
- doesElementExist: function(e) {
- return null != $(e).height()
- },
- moveFooterToBottom: function() {},
- latencySensitivity: function() {
- var e = Constants.LATENCY_SENSITIVITY_DEFAULT,
- t = Util.ExtractQSParam("bandwidth");
- switch (t) {
- case "low":
- e = -1;
- break;
- case "high":
- e = 1;
- break;
- case "critical":
- e = -2
- }
- return Instrument.latency_sensitivity = e, e
- },
- updateClientMetricsMode: function() {
- switch (Constants.METRICS_MODE) {
- case 0:
- Constants.SUBMIT_METRICS_ON_REDIRECT = !1, Constants.SUBMIT_METRICS_ON_POST = !1, Constants.INSTRUMENT_PLT = !1;
- break;
- case 1:
- Constants.SUBMIT_METRICS_ON_REDIRECT = !1, Constants.SUBMIT_METRICS_ON_POST = !0, Constants.INSTRUMENT_PLT = !1;
- break;
- case 2:
- Constants.SUBMIT_METRICS_ON_REDIRECT = !0, Constants.SUBMIT_METRICS_ON_POST = !1, Constants.INSTRUMENT_PLT = !1;
- break;
- case 3:
- Constants.SUBMIT_METRICS_ON_REDIRECT = !0, Constants.SUBMIT_METRICS_ON_POST = !0, Constants.INSTRUMENT_PLT = !1;
- break;
- case 4:
- Constants.SUBMIT_METRICS_ON_REDIRECT = !1, Constants.SUBMIT_METRICS_ON_POST = !1, Constants.INSTRUMENT_PLT = !0;
- break;
- case 5:
- Constants.SUBMIT_METRICS_ON_REDIRECT = !1, Constants.SUBMIT_METRICS_ON_POST = !0, Constants.INSTRUMENT_PLT = !0;
- break;
- case 6:
- Constants.SUBMIT_METRICS_ON_REDIRECT = !0, Constants.SUBMIT_METRICS_ON_POST = !1, Constants.INSTRUMENT_PLT = !0;
- break;
- case 7:
- Constants.SUBMIT_METRICS_ON_REDIRECT = !0, Constants.SUBMIT_METRICS_ON_POST = !0, Constants.INSTRUMENT_PLT = !0;
- break;
- default:
- Constants.SUBMIT_METRICS_ON_REDIRECT = !1, Constants.SUBMIT_METRICS_ON_POST = !1
- }
- },
- instrumentPlt: function() {
- var e = window.$Config,
- t = {
- pn: e.pgid || "",
- sc: e.scid || 0,
- hpg: e.hpgid || 0,
- country: e.country,
- requestCountry: e.country,
- plt: window.performance.timing.loadEventEnd - window.performance.timing.fetchStart,
- hostBuildNumber: e.serverDetails.ver.v.join("."),
- serverExecutionTime: e.serverDetails.et
- },
- n = User.getPerformanceData();
- n && (t.performanceData = n), window.$Api.Json(e.urls.instr.pageload, t)
- },
- getPerformanceData: function() {
- var e = window.performance,
- t = {};
- if (!e) return null;
- if (e.navigation && (t.navigation = User.getPerformanceObjectData(e.navigation)), e.timing && (t.timing = User.getPerformanceObjectData(e.timing)), e.getEntries) {
- var n = e.getEntries();
- if (n) {
- t.entries = [];
- for (var o = 0, a = n.length; a > o; ++o) t.entries.push(User.getPerformanceObjectData(n[o]))
- }
- }
- return t
- },
- getPerformanceObjectData: function(e) {
- var t = {};
- if (e.toJSON) return e.toJSON();
- for (var n in e) t[n] = e[n];
- return t
- },
- GetHashedImagePath: function(e) {
- return e
- },
- UpdateBackground: function(e, t) {
- if ((null == t || "" == t || Constants.IS_CXH_REQUEST) && (t = $("html").css("background-color")), TenantBranding.IsShowingDynamicBranding() ? Context.TenantBranding.background_color = t : ($("#background_page_overlay").css("background-color", t), $("#background_background_image").css("background-color", t), $("#background_branding_container").css("background-color", t), $("html").css("background-color", t)), Background.winW < Constants.MOBILE_WIDTH_THRESHOLD) return Util.debug_console("Screen size too small to fetch background."), void(Background.delayed_background_fetch_url = e);
- if ($("#background_background_image").error(function() {
- $(this).show(), Context.TenantBranding.has_background_img = !1, TenantBranding.IsShowingDynamicBranding() && Logo.logo_image_loaded && TenantBranding.onLoadImageHelper()
- }), User.onLoadImage(), Background.delayed_background_fetch_url = null, !Support.showIllustration() || "" == e || User.latencySensitivity() < 0) Util.debug_console("Image load was cancelled."), $("#background_background_image").css("visibility", "hidden"), $("#background_company_name_text").css("opacity", 0), Context.on_load_image_background_loaded = !0, Background.background_resized = !1, TenantBranding.IsShowingDynamicBranding() && Logo.logo_image_loaded && TenantBranding.onLoadImageHelper(), setTimeout(function() {
- User.setupPrefetching()
- }, 1e3);
- else {
- var n = User.GetHashedImagePath(e);
- Context.on_load_image_background_loaded = !1, Background.background_resized = !1, Context.TenantBranding.has_background_img = !0, $("img#background_background_image").attr("src", n), $("img#background_background_image").css("visibility", "visible"), $("img#background_background_image").attr("alt", Constants.PARTNER_NAME), $("#background_company_name_text").css("opacity", 0), $("#background_company_name_text").attr("aria-hidden", "true"), Util.debug_console("Set background image: " + e), Instrument.background_image_start = Util.now()
- }
- Background.background_image_ratio = 0, Util.debug_console("Fetched background image.")
- },
- UpdateLogo: function(e, t) {
- "" == e && $(".login_workload_logo_container").empty(), Logo.logo_image_loaded = !1, $(".workload_img").remove();
- var n = User.GetHashedImagePath(e);
- if ("" == e) Constants.IS_CXH_REQUEST || $(".login_workload_logo_container").append($("<h1/>").attr("id", "login_workload_logo_text").css("visibility", "visible").addClass("workload_img_text").addClass("gianttext").text(Util.htmlDecode(t))), Context.TenantBranding.has_logo = !1, TenantBranding.IsShowingDynamicBranding() ? TenantBranding.onLoadLogoHelper() : TenantBranding.setUserIdHintAndKmsi(), Util.debug_console("Set logo image failover.");
- else if (Constants.IS_HOLOGRAPHIC) {
- $("header.body-header img.img-brand").remove(), TenantBranding.IsShowingDynamicBranding() && (Context.TenantBranding.has_logo = !0), Instrument.logo_image_start = Util.now();
- var o = $("<img/>").hide().addClass("img-brand").error(TenantBranding.onLoadErrorLogo).attr("id", "login_workload_logo_image").attr("alt", Constants.PARTNER_NAME);
- $("header.body-header").append(o), o.load(function() {
- Instrument.logo_image_end_time = Util.now(), o.show()
- }).attr("src", n)
- } else {
- var a = $("<img/>");
- Instrument.logo_image_start = Util.now(), TenantBranding.IsShowingDynamicBranding() ? (Context.TenantBranding.has_logo = !0, a.load(function() {
- TenantBranding.onLoadLogo()
- }), a.hide()) : (a.css("visibility", "visible"), a.load(function() {
- Instrument.logo_image_end_time = Util.now()
- }), TenantBranding.setUserIdHintAndKmsi()), a.error(function() {
- TenantBranding.onLoadErrorLogo()
- }), a.attr("id", "login_workload_logo_image").addClass("workload_img").attr("alt", Constants.PARTNER_NAME), Constants.IS_INCLUSIVEOOBE && a.addClass("microsoft-logo"), $(".login_workload_logo_container").append(a), a = $(".workload_img"), a.attr("src", n), $("#login_workload_logo_text").remove(), Util.debug_console("Set logo image: " + e)
- }
- },
- RefreshDomainState: function() {
- var e = !1,
- t = $.trim($("#cred_userid_inputtext").val());
- return User.UpdateUsernameState(), Support.UpdatePasswordResetLink(), "strongauthcheck.2.0" === $("meta[name=PageID]").attr("content") || "proofup.2.0" === $("meta[name=PageID]").attr("content") || "i5028.2.0" === $("meta[name=PageID]").attr("content") ? !1 : (Context.username_state.is_empty || Context.username_state.is_partial ? e = !1 : (t !== Context.username_state.last_checked_email || Constants.IS_HOLOGRAPHIC) && (e = !0), e ? User.CheckUser() : TenantBranding.RefreshDomainState(t), e)
- },
- CheckUser: function() {
- Constants.IS_NAME_COEXISTENCE_ACCOUNT || (EmailDiscovery.ShouldPerformDiscovery() ? EmailDiscovery.PerformEmailBasedDiscovery() : User.PerformHomeRealmDiscovery())
- },
- PerformHomeRealmDiscovery: function() {
- if (Context.username_state.home_realm_state != Constants.State.PENDING) {
- var e = $.trim($("input#cred_userid_inputtext").val());
- Constants.REGEX_PHONE.test(e) && (e = e.replace(/\D/g, "")), $("div.progress").css("visibility", "visible"), User.startAnimation(), Context.animationTid = setInterval(User.startAnimation, 3500), Context.username_state.enable_progress_bar = !0;
- var t = Constants.Use_Client_Check_Msa_Flag ? Constants.IS_MSA_FED_SUPPORTED : !0;
- Util.SetRoutingCookie(e), $.ajax({
- headers: {
- Accept: "application/json"
- },
- url: Constants.REALM_RESOLVER_URL.upsertQueryStringParam("user", encodeURIComponent(e)),
- dataType: "json",
- data: {
- "api-version": "2.1",
- stsRequest: Constants.CONTEXT,
- checkForMicrosoftAccount: t
- },
- beforeSend: function() {
- Instrument.home_realm_start = Util.now()
- },
- success: User.ReceiveTenantInfo,
- error: User.ReceivedHomeRealmError
- }), Context.username_state.home_realm_state = Constants.State.PENDING, Context.username_state.last_checked_email = e, User.resize_bg()
- }
- },
- showGenericError: function(e) {
- Support.hideClientErrorMessages(), Support.hideClientMessages(), Support.showClientError(e)
- },
- ReceivedHomeRealmError: function(e, t) {
- $("div.progress").css("visibility", "hidden"), $("input#cred_password_inputtext").focus(), Util.debug_console("Received home realm error"), Context.username_state.home_realm_state = Constants.State.NONE, clearInterval(Context.animationTid), Context.username_state.home_realm_state = Constants.State.NONE, User.UsernameOnChangeHandler(), "parsererror" == t && User.showGenericError(ErrorCodes.PARSE_ERROR)
- },
- ReceiveTenantCustom: function(e) {
- tenant_info.background_color = e.BackgroundColor, tenant_info.background_url = e.BackgroundPath, tenant_info.logo_url = e.LogoPath, tenant_info.boilerplate1 = e.BoilerPlate1, tenant_info.boilerplate2 = e.BoilerPlate2, tenant_info.cta1 = e.CTA1, tenant_info.cta2 = e.CTA2, Util.debug_console(e.LogoPath), clearInterval(Context.animationTid), Context.username_state.home_realm_state = Constants.State.MANAGED, User.UsernameOnChangeHandler(), $("#cred_userid_inputtext").blur(), Constants.IS_HOLOGRAPHIC || $("#cred_password_inputtext").focus(), setTimeout(User.resize_bg, 300)
- },
- KeyPressEnter: function(e, t, n, o) {
- var a;
- if (e && e.which ? a = e.which : window.event && (e = window.event, a = e.keyCode), a === n) {
- if (o && o > 0) {
- MSLogin.User.KeyPressEnterHandleOnceDelayTable = MSLogin.User.KeyPressEnterHandleOnceDelayTable || {};
- var i = e.timeStamp;
- if (MSLogin.User.KeyPressEnterHandleOnceDelayTable[n]) {
- var r = MSLogin.User.KeyPressEnterHandleOnceDelayTable[n];
- if (o > i - r) return n;
- MSLogin.User.KeyPressEnterHandleOnceDelayTable[n] = i
- } else MSLogin.User.KeyPressEnterHandleOnceDelayTable[n] = i
- }
- t()
- }
- return a
- },
- StartRedirection: function(e) {
- return Context.redirect_countdown = Constants.REDIRECT_COUNTDOWN_DEFAULT, e && "none" === $("#cred_userid_container").css("display") || void 0 == $("#cred_userid_container").css("display") ? void 0 : (Util.EnableEmailDiscoveryIfEBD(), $("#cred_cancel_button").hide(), Context.username_state.enable_progress_bar = !0, Context.username_state.enable_redirect = !0, Context.username_state.enable_guests = !1, $("#cred_password_container").css("opacity", 0), User.UsernameOnChangeHandler(), Context.redirectTid = setTimeout(function() {
- User.ShowRedirect(), $("a#redirect_cancel_link").focus()
- }, 100), Constants.IS_CXH_REQUEST || Constants.IS_ADAL_REQUEST || $("#cred_sign_in_button").hide(), Context.redirectTid)
- },
- ReceiveTenantInfo: function(e) {
- $(".30065,.30068").is(":visible") && (Support.hideClientError(30065), Support.hideClientError(30068));
- var t = !0,
- n = !1;
- if (Instrument.home_realm_load_time = Util.now() - Instrument.home_realm_start, Context.username_state.enable_progress_bar = !1, Context.username_state.disable_password = !1, Context.username_state.last_checked_email = e.Login, 1 == Constants.IS_MSA_FED_SUPPORTED && Constants.HAS_ERROR !== !0)
- if (0 === e.MicrosoftAccount && e.DomainName !== Context.whr) {
- if (e.NameSpaceType == Constants.NameSpaceType.MANAGED || e.NameSpaceType == Constants.NameSpaceType.CLOUDFEDERATED || e.NameSpaceType == Constants.NameSpaceType.FEDERATED && !Util.isMSA(e.AuthURL)) return Context.getuserrealmresult = e, Context.back_action_stack.AddAction(Constants.CancelAction.FROM_DISAMBIGUATION_SCREEN_TO_LOGIN), void MSLogin.SplitterControl.Render();
- e.NameSpaceType == Constants.NameSpaceType.UNKNOWN && MSLogin.SplitterControl.LoginMSA()
- } else if (void 0 === e.MicrosoftAccount || 2 === e.MicrosoftAccount) return Context.getuserrealmresult = e, Context.back_action_stack.AddAction(Constants.CancelAction.FROM_DISAMBIGUATION_SCREEN_TO_LOGIN), void MSLogin.SplitterControl.Render();
- e.NameSpaceType == Constants.NameSpaceType.FEDERATED || e.NameSpaceType == Constants.NameSpaceType.CLOUDFEDERATED ? e.federation_protocol == Constants.FederationProtocol.Saml20 && null != e.federation_saml_request ? t = MSLogin.User.PostToSamlIdp(e) : 0 !== e.MicrosoftAccount && Util.isMSA(e.AuthURL) ? (clearInterval(Context.animationTid), $("div.progress").css("visibility", "hidden"), t = Support.showUsernameOrDomainError(Util.htmlEncode(e.Login)), n = !0, Context.username_state.home_realm_state = Constants.State.INVALID) : (Context.back_action_stack.AddAction(MSLogin.Constants.CancelAction.FROM_REDIRECT_TO_LOGIN), t = MSLogin.User.ReceiveFederatedDomain(e)) : e.NameSpaceType == Constants.NameSpaceType.MANAGED ? t = MSLogin.User.ReceiveManagedDomain(e) : e.NameSpaceType == Constants.NameSpaceType.UNKNOWN && 0 !== e.MicrosoftAccount ? (clearInterval(Context.animationTid), $("div.progress").css("visibility", "hidden"), t = Support.showUsernameOrDomainError(Util.htmlEncode(e.Login)), n = !0, Context.username_state.home_realm_state = Constants.State.INVALID) : t = MSLogin.User.ReceiveUnknownDomain(e), Constants.IS_HOLOGRAPHIC ? (!t || n) && Util.OnBack() : t && ($("#cred_userid_inputtext").blur(), $("#cred_password_inputtext").focus())
- },
- ReceiveUnknownDomain: function(e) {
- if (1 == e.State && !e.FederationGlobalVersion) return Context.username_state.home_realm_state = Constants.State.INVALID, User.UsernameOnChangeHandler(), Util.debug_console("federationGlobalVersion bad"), $("#cred_password_inputtext").blur(), $("#cred_userid_inputtext").focus(), !1;
- var t = !Support.showUsernameOrDomainError(Util.htmlEncode(e.Login));
- return Context.username_state.home_realm_state = Constants.State.INVALID, clearInterval(Context.animationTid), Constants.IS_HOLOGRAPHIC || User.UsernameOnChangeHandler(), Util.debug_console("Unknown home realm reply"), $("input#cred_password_inputtext").focus(), t
- },
- ReceiveFederatedDomain: function(e) {
- var t = e.NameSpaceType == Constants.NameSpaceType.CLOUDFEDERATED;
- return Context.username_state.home_realm_state = Constants.State.FEDERATED, tenant_info.company_name = "", tenant_info.domain = e.DomainName, Context.authn_forward_state = e.AuthNForwardType, e.DomainName.areEqualIgnoreCase(Constants.MSA_DOMAIN) && !Constants.IS_MSA_FED_SUPPORTED ? ($(".pip").stop(!0, !0), $(".pip").hide(), clearInterval(Context.animationTid), Context.username_state.enable_redirect = !1, Context.username_state.home_realm_state = Constants.State.INVALID, Context.back_action_stack.RemoveLastCancelAction(), Support.showClientError(30065), !1) : e.DomainName != Context.whr || User.IsGuestUser() ? (Context.federated_domain = e.DomainName, Context.nationalCloudFederated = t, Context.redirect_auth_url = t ? e.CrossCloudAuthUrl : e.AuthURL, e.TenantBrandingInfo && e.TenantBrandingInfo.length && (TenantBranding.StoreBrandingInfo(e.DomainName, e.TenantBrandingInfo), TenantBranding.getTenantBrandingContext(e.TenantBrandingInfo, Constants.LCID).KeepMeSignedInDisabled && ($("#cred_kmsi_container").hide(), $("#cred_keep_me_signed_in_checkbox").attr("checked", !1))), $("#cred_keep_me_signed_in_checkbox").is(":visible") && e.CheckKmsiByDefault && $("#cred_keep_me_signed_in_checkbox").attr("checked", "checked"), Util.updateRedirectionMessage(Context.redirect_auth_url, t), e.federation_protocol == Constants.FederationProtocol.Saml20 && null != e.federation_saml_request ? (MSLogin.User.PostToSamlIdp(e), !1) : (1 == e.FederationGlobalVersion && User.Redirect(User.addFederatedRedirectQSParameters(e.AuthURL)), User.StartRedirection(!1), !1)) : (Context.username_state.home_realm_state = Constants.State.MANAGED, Util.debug_console("whr set already"), User.UsernameOnChangeHandler(), $("#cred_userid_inputtext").blur(), $("#cred_password_inputtext").focus(), Context.back_action_stack.RemoveLastCancelAction(), !1)
- },
- ReceiveManagedDomain: function(e) {
- return Context.whr = void 0 != e.DomainName ? e.DomainName : e.Login.split("@@")[1], null != e.TenantBrandingInfo && TenantBranding.StoreBrandingInfo(e.DomainName, e.TenantBrandingInfo), TenantBranding.PerformDynamicBranding(e.DomainName), Context.TenantBranding.user = e.Login, Context.username_state.home_realm_state = Constants.State.MANAGED, tenant_info.company_name = e.FederationBrandName, tenant_info.domain = e.DomainName, tenant_info.BackgroundColor = $("#background_branding_container").css("background"), tenant_info.BackgroundPath = $("#background_background_image").attr("src"), tenant_info.LogoPath = $("#login_workload_logo_image").attr("src"), tenant_info.BoilerPlate1 = "", tenant_info.BoilerPlate2 = "", tenant_info.CTA1 = $("#login_cta_text").text(), tenant_info.CTA2 = "", tenant_info.HadBoilerPlate = !1, Context.username_state.disable_password = !1, Context.username_state.enable_progress_bar = !1, Context.username_state.enable_redirect = !1, User.UsernameOnChangeHandler(), User.TriggerUserDomainHintChanged(e), $("#cred_keep_me_signed_in_checkbox").is(":visible") && e.CheckKmsiByDefault && $("#cred_keep_me_signed_in_checkbox").attr("checked", "checked"), !0
- },
- PostToSamlIdp: function(e) {
- if (Context.federated_domain = e.DomainName, Context.redirect_auth_url = e.AuthURL, $("#samlform").attr("action", e.AuthURL), $("#samlrequest").val(decodeURIComponent(e.federation_saml_request)), null != e.federation_saml_request) $("#samlrelaystate").val(decodeURIComponent(e.federation_saml_relay_state));
- else {
- var t = Constants.FEDERATION_QUERY_PARAMETERS.qs("wctx");
- $("#samlrelaystate").val(decodeURIComponent(t))
- }
- $("#samlform").submit()
- },
- Redirect: function(e) {
- window.location.assign(e)
- },
- GetRedirectAction: function(e, t, n, o) {
- var a;
- return Constants.IS_MSA_REDIR_SUPPORTED ? (o && ("FormPost" === Constants.responseMode ? n.username = o : t = Util.appendQueryString(t, "username=" + encodeURIComponent(o))), a = User.GetRedirectWithOAuthResponseMode(Constants.responseMode, t, n)) : (o && (e = Util.appendQueryString(e, "username=" + encodeURIComponent(o))), a = function() {
- window.location.assign(e)
- }), a
- },
- GetRedirectWithOAuthResponseMode: function(e, t, n) {
- var o;
- return o = "FormPost" === e ? function() {
- var e = $("<form />", {
- method: "post",
- action: t
- });
- e.append($.map(n, function(e, t) {
- return $("<input>", {
- type: "hidden",
- name: t,
- value: e
- })
- })), $("body").append(e), e.submit()
- } : function() {
- window.location.assign(t)
- }
- },
- ShowRedirect: function() {
- $("#signin_legend,#boilerplate_container,#body_header,#page_footer,#footer_content").hide(), $(".control-page").addClass("page_centered");
- var e;
- if (e = Constants.IS_MSA_REDIR_SUPPORTED && Util.isMSA(Context.redirect_auth_url) ? User.GetRedirectAction(null, Constants.appRedirectUrl, Constants.msaRedirErrorParams, User.getUsernameFromPage()) : Context.nationalCloudFederated ? Context.redirect_auth_url : User.addFederatedRedirectQSParameters(Context.redirect_auth_url), Constants.SUBMIT_METRICS_ON_REDIRECT && !Context.metrics_on_redirect_submitted && (Post.SubmitInstrumentation(), Context.metrics_on_redirect_submitted = !0), Context.username_state.enable_guests = !1, User.UsernameOnChangeHandler(), 0 == Context.redirect_countdown) return MSLogin.Util.LogCxhTelemetry("AADLoginPageFederationRedirect"), Constants.FLOW_TOKEN.length > 0 && Util.setCookieWithExpiration(Constants.FLOW_TOKEN_COOKIE_NAME, Constants.FLOW_TOKEN), void("function" == typeof e ? e() : User.Redirect(e));
- 1 == Context.redirect_countdown && $("#background_page_overlay").css("z-index", 0), $("#cred_userid_container,#cred_password_container,.login_cta_container,#recover_container,input#cred_password_inputtext").hide(), $("#redirect_cta_text").show(), $("#redirect_company_name_text").empty();
- var t = $("#redirect_message_container");
- if (t.length > 0) {
- var n = t.show().css("visibility", "visible").css("opacity", 1)[0];
- n && n.removeAttribute("aria-hidden")
- }
- $("#windows_redirect_message_container").show(), $("#progress_text").focus(), Context.redirect_countdown = Context.redirect_countdown - 1, Context.redirectTid = setTimeout(function() {
- User.ShowRedirect()
- }, 1e3), Util.debug_console("Redirecting in " + Context.redirect_countdown)
- },
- CancelRedirect: function() {
- clearTimeout(Context.redirectTid), User.tryShowCancelButton(), $("#cred_kmsi_container").show(), $("#cred_userid_container").show(), $("#cred_password_container").show(), $(".login_cta_container").show(), $("#credentials .login_cta_container").hide(), $("#recover_container").show(), $("#redirect_cta_text").hide(), $("#cred_password_container").css("opacity", 1), $("input#cred_password_inputtext").css("display", "inline-block"), $("#redirect_message_container").hide(), $("input#cred_password_inputtext").blur(), $("#redirect_company_name_text").empty(), Context.username_state.home_realm_state == Constants.State.FEDERATED && (Context.username_state.home_realm_state = Constants.State.NONE), Context.email_discovery_workflow_state = EmailDiscovery.WorkflowStates.NONE, Context.username_state.disable_password = !0, Context.username_state.enable_progress_bar = !1, Context.username_state.enable_redirect = !1, Context.username_state.enable_guests = !0, User.UsernameOnChangeHandler(), $("input#cred_userid_inputtext").focus()
- },
- startAnimation: function(e) {
- var t = 100,
- n = $(".login_footer_container").outerWidth();
- e && (n = e.outerWidth()), $(".pip").stop(!0, !0), $(".pip").each(function() {
- User.animatePip($(this), t, n), t += 100
- })
- },
- animatePip: function(e, t, n) {
- var o = n / 3,
- a = n - 3;
- "ltr" == Constants.DIR ? e.css("left", 0).hide().delay(t).show().animate({
- left: o
- }, {
- duration: 1e3,
- easing: "easeOutSine"
- }).animate({
- left: a
- }, {
- duration: 999,
- easing: "easeInSine"
- }) : e.css("right", 0).hide().delay(t).show().animate({
- right: o
- }, {
- duration: 1e3,
- easing: "easeOutSine"
- }).animate({
- right: a
- }, {
- duration: 999,
- easing: "easeInSine"
- })
- },
- addFederatedRedirectQSParameters: function(e) {
- var t = e;
- if (Util.isMSA(e)) {
- e = Constants.MSA_AUTH_URL;
- var n = decodeURIComponent(Util.ExtractQSParam("pcexp")),
- o = decodeURIComponent(Util.ExtractQSParam("display"));
- o.areEqualIgnoreCase("popup") && (n = !1), Background.winW < Constants.MOBILE_WIDTH_THRESHOLD && (n = !1), e.indexOf("pcexp") < 0 ? e += "&pcexp=" + encodeURIComponent(n) : Constants.IS_CXH_REQUEST || (e = e.replace(/pcexp=[^&]*/i, "pcexp=" + encodeURIComponent(n)));
- var a = decodeURIComponent(Util.ExtractQSParam("vv"));
- a && (e.indexOf("vv") < 0 ? e += "&vv=" + encodeURIComponent(a) : e = e.replace(/vv=[^&]*/i, "vv=" + encodeURIComponent(a))), e.indexOf("username") < 0 && (e = User.addUsernameQsParam(e))
- }
- User.resize_bg();
- var i = decodeURIComponent(Util.ExtractQSParam("popupui"));
- (Constants.IS_ADAL_REQUEST || Background.winW < Constants.MOBILE_WIDTH_THRESHOLD) && (i = 1), e.indexOf("popupui") < 0 ? e += "&popupui=" + encodeURIComponent(i) : e = e.replace(/popupui=[^&]*/i, "popupui=" + encodeURIComponent(i)), e = e.replace(/guests%3D1/i, "");
- var r = t.qs("LoginOptions");
- if ("" == r && (r = $("#cred_keep_me_signed_in_checkbox").attr("checked") ? "1" : ""), "" !== r) {
- var s = e.qs("wreply");
- "" != s ? (s += (s.indexOf("%3f") >= 0 ? "%26" : "%3f") + "LoginOptions%3d" + r, e = e.qs("wreply", s)) : (s = e.qs("wctx"), "" != s && (s += "%26LoginOptions%3d" + r, e = e.qs("wctx", s))), e = e.qs("LoginOptions", r)
- }
- return e
- },
- RegisterOnLoadImage: function() {
- $("#background_background_image").load(function() {
- void 0 != this.width && (Background.background_image_loaded = !0), User.onLoadImage(), 0 == Instrument.background_image_end_time && (Instrument.background_image_end_time = Util.now()), Instrument.background_image_load_time = Util.now() - Instrument.background_image_start, Instrument.background_image_loaded = !0, setTimeout(function() {
- User.setupPrefetching()
- }, 1e3), User.resize_bg()
- }).error(function() {
- $("#background_background_image").hide(), Instrument.background_image_loaded = !1, Instrument.background_image_load_time = Util.now() - Instrument.background_image_start, Instrument.background_image_error = !0, 0 == Instrument.background_image_end_time && (Instrument.background_image_end_time = Util.now())
- })
- },
- IsImageLoaded: function(e) {
- if (void 0 == e || null == e || void 0 == e[0] || null == e[0] || void 0 == e[0].complete || null == e[0].complete) return !1;
- var t = e[0],
- n = document.documentMode;
- return t.complete || $.browser.msie && 8 >= n ? "undefined" != typeof t.naturalWidth && 0 == t.naturalWidth ? !1 : "undefined" != typeof t.naturalHeight && 0 == t.naturalHeight ? !1 : !0 : !1
- },
- isChxOrAdalOverride: function() {
- return Constants.IS_CXH_REQUEST || Constants.IS_ADAL_REQUEST && Constants.ADAL_UX_OVERRIDE
- },
- getUsernameFromPage: function() {
- var e = decodeURIComponent(Util.ExtractQSParam("username")),
- t = $("#cred_userid_inputtext").val();
- return t ? t : e ? e : ""
- },
- addUsernameQsParam: function(e) {
- var t = User.getUsernameFromPage();
- return t && (e = Util.appendQueryString(e, "username=" + encodeURIComponent(t))), e
- },
- shouldShowCancelButton: function() {
- var e = ("FRX" === Constants.CxhFlow || "MOSET" === Constants.CxhFlow) && !Constants.IS_HOLOGRAPHIC,
- t = Constants.IS_ADAL_REQUEST && !Constants.ADAL_UX_OVERRIDE,
- n = Context.back_action_stack.DoesCancelActionExist(),
- o = Tiles.users && Tiles.users.length && "other" !== Tiles.users[0].link && Constants.IS_USE_OTHER_ACCOUNT_VISIBLE;
- return e || t || n || o
- },
- tryShowCancelButton: function() {
- User.shouldShowCancelButton() ? $("#cred_cancel_button").show() : $("#cred_cancel_button").hide()
- },
- RegisterOnUserDomainHintChanged: function(e) {
- $(document).on(Constants.USER_DOMAIN_HINT_CHANGED_EVENT_NAME, e)
- },
- TriggerUserDomainHintChanged: function(e) {
- $(document).trigger(Constants.USER_DOMAIN_HINT_CHANGED_EVENT_NAME, [e])
- }
- };
- var User = MSLogin.User;
- $Do && $Do.when("jQuery", function() {
- $Do.register("User", 0, !0)
- }), MSLogin.SplitterControl = {
- Template: '<a id="{1}_link" href="#" onclick="{0}(); return false;" tabindex="1" class="tile_link tooltip"> <table id="{1}" class="user_tile"> <tbody> <tr class="{1}" style="cursor: pointer"> <td> <img class="ad_glyph {1}" src="{2}" alt="{3}"> </td> <td class="tile_name"> <div class="bigtext tile_primary_name windows_tile_text wrap {1}" style="cursor: pointer">{3}</div> <div class="smallertext tile_secondary_name windows_tile_text text-caption2 {1}" style="cursor: pointer">{4}</div> <div class="smallertext tile_third_name windows_tile_text text-caption2 {1}" style="cursor: pointer">{5}</div> </td> </tr> </tbody> </table></a>',
- Render: function() {
- if (Constants.MEMBER_NAME === Context.username_state.last_checked_email && $(".view-error-details-container:visible").length) return $("div.progress").css("visibility", "hidden"), Context.username_state.home_realm_state == Constants.State.PENDING && (Context.username_state.home_realm_state = Constants.State.MANAGED), void $("#cred_password_inputtext").focus();
- if ($(".login_cred_field_container").hide(), $(".login_cred_container .windows_cred_block").hide(), $(".login_cred_options_container").hide(), $(".login_user_chooser").hide(), $("#cta_error_message_text").hide(), User.tryShowCancelButton(), $(".login_cred_options_container").show(), $("#cred_sign_in_button").hide(), $("#recover_container").hide(), $("#alternative-identity-providers").hide(), $("#cred_kmsi_container").hide(), 0 != Context.getuserrealmresult.MicrosoftAccount || Context.getuserrealmresult.NameSpaceType != Constants.NameSpaceType.MANAGED && Context.getuserrealmresult.NameSpaceType != Constants.NameSpaceType.CLOUDFEDERATED && (Context.getuserrealmresult.NameSpaceType != Constants.NameSpaceType.FEDERATED || Util.isMSA(Context.getuserrealmresult.AuthURL))) Support.showClientMessage(30140);
- else {
- var e = $("input#cred_userid_inputtext").val().toLowerCase();
- e = $.trim(e);
- var t = Constants.TokenizedStringMsgs.UPN_DISAMBIGUATE_MESSAGE.replace("{0}", e);
- $("#upn_needs_disambiguation_text").text(t), Support.showClientMessage(30139)
- }
- $("#splitter-tiles-container").empty(), $.each(Constants.SplitterControlData, function(e, t) {
- var n = MSLogin.SplitterControl.Template.format(t.link, t.id, t.image, t.name, t.login, MSLogin.Util.htmlEncode(Context.username_state.last_checked_email));
- $("#splitter-tiles-container").append(n)
- }), $("#login-splitter-control").show(), $("#disambig-container").show()
- },
- LoginAAD: function() {
- Context.username_state.home_realm_state = Constants.State.MANAGED, $(".login_cred_options_container").show(), $("#cred_sign_in_button").show(), User.tryShowCancelButton(), $("#recover_container").show(), $("#alternative-identity-providers").show(), $("#cred_kmsi_container").show(), $("#login-splitter-control").hide(), $("#disambig-container").hide(), $(".login_cred_field_container").show(), $(".login_cred_options_container").show(), $(".login_cred_container .windows_cred_block").show(), Support.hideClientErrorMessages(), Support.hideClientMessages();
- var e = Context.getuserrealmresult;
- null != e && (e.NameSpaceType == Constants.NameSpaceType.FEDERATED || e.NameSpaceType == Constants.NameSpaceType.CLOUDFEDERATED ? (Context.back_action_stack.AddAction(MSLogin.Constants.CancelAction.FROM_REDIRECT_TO_DISAMBIGUATION_SCREEN), User.ReceiveFederatedDomain(e)) : (Context.back_action_stack.AddAction(MSLogin.Constants.CancelAction.FROM_LOGIN_TO_DISAMBIGUATION_SCREEN), User.ReceiveManagedDomain(e))), Support.showClientMessage(1), $("#cred_userid_container").show(), $("div.progress").css("visibility", "hidden"), $("#cred_password_inputtext").focus()
- },
- LoginMSA: function() {
- Context.username_state.home_realm_state = Constants.State.FEDERATED, $("#login-splitter-control").hide(), $("#disambig-container").hide(), $(".login_cred_field_container").show(), $(".login_cred_options_container").show(), Support.hideClientErrorMessages(), Support.hideClientMessages();
- var e = {
- DomainName: Constants.MSA_DOMAIN,
- AuthURL: Constants.MSA_AUTH_URL
- };
- Context.back_action_stack.AddAction(MSLogin.Constants.CancelAction.FROM_REDIRECT_TO_DISAMBIGUATION_SCREEN), User.ReceiveFederatedDomain(e)
- }
- };
- var tenant_info = {
- company_name: "",
- cta1: "",
- cta2: "",
- boilerplate1: "",
- boilerplate2: "",
- background_url: "",
- background_color: "",
- logo_url: "",
- domain: "",
- lang: ""
- };
- $Do.when(["doc.ready", "User"], function() {
- if ($(".no_display").each(function(e, t) {
- t.setAttribute("aria-hidden", "true")
- }), $(".hidden").each(function(e, t) {
- t.setAttribute("aria-hidden", "true")
- }), $(".login_inner_container.no_display").removeClass("no_display"), $("#background_background_image").css("width", "auto"), $("#background_background_image").css("height", "auto"), User.RegisterOnLoadImage(), $.browser.msie && "8" == $.browser.version.slice(0, 1) ? document.body.onresize = function() {
- User.resize_bg()
- } : $(window).resize(function() {
- User.resize_bg()
- }), void 0 != $("#cred_userid_inputtext").val() && User.setupCredFieldsWithPlaceHolder(), Context.whr = decodeURIComponent(Util.ExtractQSParam("whr")), User.updateGuestLink(), $("#redirect_cancel_link").on("click", function(e) {
- e.preventDefault(), Context.back_action_stack.TriggerCancelAction()
- }), $("#login_panel").show(), $("#login_no_script_panel").hide(), $(".login_cred_container").append($("<input/>").attr("id", "home_realm_discovery").attr("type", "hidden").val(Context.username_state.home_realm_state)), Constants.IS_HOLOGRAPHIC) $("div.progress").css("visibility", "hidden");
- else {
- var e = $("#cred_sign_in_button"),
- t = $("#cred_cancel_button");
- if (e.click(Post.SubmitCreds), e.keydown(function(e) {
- User.KeyPressEnter(e, Post.SubmitCreds, 13)
- }), $(".refresh_domain_state").click(function() {
- User.RefreshDomainState()
- }), $("input[type=checkbox]").click(function() {
- User.RefreshDomainState()
- }), Constants.IS_INCLUSIVEOOBE && Util.SetCxhOnBackAction(Util.CancelCxhFlow), t.click(function() {
- Context.back_action_stack.DoesCancelActionExist() ? Context.back_action_stack.TriggerCancelAction() : Constants.IS_CXH_REQUEST ? Util.CancelCxhFlow() : Constants.IS_ADAL_REQUEST && User.GetRedirectWithOAuthResponseMode(Constants.responseMode, Constants.CANCEL_REDIRECT_URL, Constants.cancelErrorParams)()
- }), "i5030.2.0" === $("meta[name=PageID]").attr("content") && Constants.showOptInBanner) {
- var n = $("#optInUserBanner");
- $("#uxOptInLink").on("click", function(e) {
- e.preventDefault(), $.ajax({
- url: Constants.uxPreviewOptInUrl,
- type: "GET",
- timeout: 1e4,
- cache: !1
- }).done(function() {
- document.location.replace(Constants.refreshUrl)
- })
- }), $("#bannerCloseLink").on("click", function(e) {
- e.preventDefault(), n.css("visibility", "hidden")
- }), n.css("visibility", "visible")
- }
- if ("KmsiInterrupt.2.0" === $("meta[name=PageID]").attr("content")) {
- var o = $("#accept_kmsi"),
- a = $("#decline_kmsi"),
- i = document.getElementById("kmsi_fields");
- o.focus();
- var r = function() {
- var e = document.getElementById("loginOptions");
- e.value = 1, i.submit()
- },
- s = function() {
- i.submit()
- };
- o.click(r), a.click(s)
- }
- }
- $("#background_company_name_text").text(Constants.PARTNER_NAME), Constants.FEDERATION_QUERY_PARAMETERS = Constants.FEDERATION_QUERY_PARAMETERS.replace(/&username(=[^&]*)?|^username(=[^&]*)?&?/, ""), Support.renderBrowserSpecific(), Support.UpdatePasswordResetLink(), Constants.isChinaDC || ($("#footer_link_terms").click(function(e) {
- MSLogin.Support.LegalActionLink(e, "tou")
- }), $("#footer_link_privacy").click(function(e) {
- MSLogin.Support.LegalActionLink(e, "privacy")
- }), $("#legal-back-btn").click(function() {
- $("#legal-section").hide(), $(".login_panel_layout").show()
- })), Constants.IS_CXH_REQUEST && ($.ajax({
- url: Constants.footerPrivacyUrl,
- data: {
- IsAjax: !0
- },
- success: function(e) {
- $("#windows-privacy-content, #holo-privacy-content").text(e)
- }
- }), Constants.IS_HOLOGRAPHIC || $("#footer_link_privacy_windows").click(function(e) {
- e.preventDefault();
- var t = $("#footer_link_privacy_windows")[0],
- n = $("#flyoutPrivacyStatement")[0];
- if (n) {
- var o = $(".body-container")[0].getBoundingClientRect().top + (window.pageYOffset || document.documentElement.scrollTop || 0);
- n.style.marginTop = o + "px", n.winControl.show(t, "top", "left")
- }
- }));
- var d = User.GetRedirectAction(Constants.msaSignupUrl, Constants.msaSignupUrl, Constants.msaRedirSignupErrorParams);
- $("#idp-signup-link, #create_msa_account_link, #user-not-found-link-ebd").click(function(e) {
- e.preventDefault(), d()
- }), Constants.IS_ADAL_REQUEST && $("#account_not_found_title_text p").toggleClass("no_display"), Constants.desktopSsoConfig && $Do.when("Proxy.DesktopSso", function() {
- proxy.DesktopSso.Initialize(Constants.desktopSsoConfig)
- }), Instrument.document_ready_end_time = Util.now()
- }), $Do.when("doc.load", function() {
- if (Support.renderBrowserSpecific(), User.updateClientMetricsMode(), $("#cred_keep_me_signed_in_checkbox").removeAttr("checked"), !Constants.IS_HOLOGRAPHIC && !Constants.SSPR && !Constants.StrongAuth) {
- var e = $("input#cred_userid_inputtext");
- e.length && -1 !== e.val().indexOf("@") ? EmailDiscovery.ShouldPerformDiscovery() ? ($("#cred_continue_button").focus(), $("#redirect_message_container").hide(), $("#alternative-identity-providers").hide()) : (Context.username_state.home_realm_state = Constants.State.MANAGED, User.UsernameOnChangeHandler(), Util.debug_console("startup"), (Constants.IS_CXH_REQUEST && !Constants.IS_MOBILE || !Constants.IS_CXH_REQUEST) && e.focus()) : (User.UsernameOnChangeHandler(), (Constants.IS_CXH_REQUEST && !Constants.IS_MOBILE || !Constants.IS_CXH_REQUEST) && e.focus()), Constants.userRealmInfo && Constants.userRealmInfo.IsMicrosoftAccountSet && 1 !== Constants.userRealmInfo.MicrosoftAccount && (Context.getuserrealmresult = Constants.userRealmInfo, Context.back_action_stack.AddAction(Constants.CancelAction.FROM_DISAMBIGUATION_SCREEN_TO_LOGIN), Context.username_state.last_checked_email = Constants.MEMBER_NAME, MSLogin.SplitterControl.Render())
- }
- if (Util.EnableEmailDiscoveryIfEBD(), "1" == Util.ExtractQSParam("popupui")) {
- try {
- var t = $("meta[name=viewport]");
- t.attr("content", "width=300, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, height=device-height")
- } catch (n) {}
- $("html").css("background-color", "#FFFFFF"), $("body").css("background-color", "#FFFFFF"), $("#background_branding_container").css("background-color", "#FFFFFF")
- }
- window.performance && window.performance.timing && Constants.INSTRUMENT_PLT && setTimeout(User.instrumentPlt, 0), Constants.onPremPasswordValidationConfig && Constants.onPremPasswordValidationConfig.isPollingRequired ? $Do.when("Proxy.MSOnPremPasswordValidation", window.proxy.MSOnPremPasswordValidation.startPolling) : Constants.onPremPasswordValidationConfig && Constants.onPremPasswordValidationConfig.isUserRealmPrecheckEnabled && $Do.when("Proxy.MSOnPremPasswordValidation", window.proxy.MSOnPremPasswordValidation.registerUserRealmDiscoveryListeners), Instrument.document_load_end_time = Util.now()
- }), $Do.when("jQuery", function() {
- $Do.register("MSLogin", 0, !0)
- }),
- function() {
- var e = window,
- t = e.MSLogin,
- n = e.EmailDiscovery = t.EmailDiscovery = {
- Strings: {},
- WorkflowStates: {
- NONE: 0,
- INIT: 1,
- LOOKING: 2,
- SPLITTER: 3,
- MSA: 4,
- AAD: 5
- },
- is_enabled_workflow: !1,
- IsDiscoveryPage: function() {
- return n.is_enabled_workflow
- },
- ShouldPerformDiscovery: function() {
- return Context.email_discovery_mode
- },
- IsTilesModeActivated: function() {
- return Context.email_discovery_tiles_mode
- },
- Init: function() {
- Context.email_discovery_mode = !0, n.ShouldPerformDiscovery() && (n.is_enabled_workflow = !0), $("#cred_sign_in_button").hide(), $("#cred_cancel_button").hide(), $("#cred_kmsi_container").hide(), $("#recover_container").hide(), $("#cred_password_container").hide(), $("#login_cta_text").hide(), $("#login_user_chooser").hide(), $("#forget_tile_container").hide(), $("#guest_hint_text").hide(), $(".guest_redirect_container").hide(), $(".login_cta_container").show(), $(".login_cred_options_container").addClass("email_discovery"), $("#cred_keep_me_signed_in_checkbox").removeAttr("checked"), $("#looking_container").hide(), $("div.progress").css("visibility", "hidden"), Context.username_state.last_checked_email = Context.username_state.last_checked_email || "", Context.username_state.home_realm_state = Constants.State.NONE, Context.email_discovery_workflow_state = n.WorkflowStates.NONE;
- var e = decodeURIComponent(Util.ExtractQSParam("username")),
- t = $("#cred_userid_inputtext").val();
- n.IsTilesModeActivated() && e !== t && ($("input#cred_userid_inputtext").val(""), $("input#cred_userid_inputtext").focus()), n.HideSplitter(), n.ShowEmailDiscovery()
- },
- Initialize: function() {
- $("input#cred_userid_inputtext").keydown(function(e) {
- n.ShouldPerformDiscovery() && User.KeyPressEnter(e, function() {
- e.preventDefault(), n.ValidateUserInput()
- }, 13)
- }), $("#cred_continue_button").keydown(function(e) {
- n.ShouldPerformDiscovery() && User.KeyPressEnter(e, function() {
- e.preventDefault(), n.ValidateUserInput(), User.RefreshDomainState()
- }, 13)
- }), $("#cred_try_again_button").keydown(function(e) {
- n.ShouldPerformDiscovery() && User.KeyPressEnter(e, function() {
- e.preventDefault(), n.ValidateUserInput(), User.RefreshDomainState()
- }, 13)
- }), $("#iDisambigRenameLink").click(function(t) {
- t.preventDefault(), e.open(Constants.DisambigHelpUrl, "_blank")
- }), $("a#looking_cancel_link").click(function(e) {
- e.preventDefault(), Context.back_action_stack.TriggerCancelAction()
- })
- },
- SetupTilesForSplitter: function() {
- e.users != Constants.EMAIL_DISCOVERY_DEFAULT_TILES && (Context.email_discovery_splitter_shown = !0, Context.user_tiles = Tiles.users, Tiles.users = Constants.EMAIL_DISCOVERY_DEFAULT_TILES, e.users = Tiles.users, $.each(e.users, function(e, t) {
- t.ignore_length = !0
- }))
- },
- RevertUserTiles: function() {
- e.users == Constants.EMAIL_DISCOVERY_DEFAULT_TILES && (Context.email_discovery_splitter_shown = !1, Tiles.users = Context.user_tiles, e.users = Tiles.users)
- },
- ShowPostErrorMessage: function() {
- Context.email_discovery_mode = !1, n.is_enabled_workflow = !0, Context.email_discovery_splitter_shown = !1, -1 == $("meta[name=PageID]").attr("content").indexOf("EmailBasedDiscoveryTiles") && Context.back_action_stack.AddAction(Constants.CancelAction.FROM_MANY_TO_EMAILDISCOVERY_INIT), $("#cred_cancel_button").show()
- },
- ValidateUserInput: function() {
- User.UpdateUsernameState(), Context.username_state.is_empty ? (Context.email_discovery_workflow_state = n.WorkflowStates.NONE, n.ShowEmailDiscovery(30127)) : Context.username_state.is_partial && (Context.email_discovery_workflow_state = n.WorkflowStates.NONE, n.ShowEmailDiscovery(30145))
- },
- PerformEmailBasedDiscovery: function() {
- var e = $("input#cred_userid_inputtext").val().toLowerCase();
- if (e = $.trim(e), Context.email_discovery_timeout_occurred = !1, Context.email_discovery_error_message = null, !Support.validateUsernameCredInput(e)) return Context.email_discovery_workflow_state = n.WorkflowStates.NONE, void n.ShowEmailDiscovery(30064);
- var o = Constants.Use_Client_Check_Msa_Flag ? Constants.IS_MSA_FED_SUPPORTED : !0;
- Util.SetRoutingCookie(e), Context.email_discovery_lookup_xhr = $.ajax({
- headers: {
- Accept: "application/json"
- },
- url: Constants.EMAIL_DISCOVERY_SERVICE_URI.replace("{0}", encodeURIComponent(e)),
- dataType: "json",
- data: {
- stsRequest: Constants.CONTEXT,
- checkForMicrosoftAccount: o
- },
- success: n.ReceiveHomeRealmInfo,
- error: n.ReceiveHomeRealmError,
- timeout: Constants.EMAIL_DISCOVERY_SERVICE_TIMEOUT
- }), Context.username_state.last_checked_email = e, Context.username_state.home_realm_state = Constants.State.PENDING, t.EmailDiscovery.HideEmailDiscovery(), t.EmailDiscovery.ShowLookingForAccountLayout()
- },
- ReceiveHomeRealmInfo: function(e) {
- Context.email_discovery_response = {
- AAD: e
- }, n.HideLookingForAccountLayout(), Context.back_action_stack.RemoveLastCancelAction();
- var t = n.GetAccountStateFromResponse({
- AAD: e
- });
- n.PerformUIAction(t)
- },
- GetAccountStateFromResponse: function(e) {
- var t = Constants.EmailDiscoveryAccountState;
- if (null === e || null === e.AAD) return Context.username_state.home_realm_state = Constants.State.INVALID, t.ERROR;
- var o = e.AAD.MicrosoftAccount,
- a = e.AAD,
- i = "",
- r = "";
- if (null === o) i = "TIMED_OUT";
- else if (i = n.GetEnumKeyName(Constants.MSAccount, o), null === i) return t.ERROR;
- if ("timeout" === a) r = "TIMED_OUT", Context.username_state.home_realm_state = Constants.State.INVALID;
- else {
- r = n.GetEnumKeyName(Constants.NameSpaceType, a.NameSpaceType);
- var s = a.NameSpaceType === Constants.NameSpaceType.FEDERATED && !a.AuthURL || a.NameSpaceType === Constants.NameSpaceType.CLOUDFEDERATED && !a.CrossCloudAuthUrl;
- if (null === r || s) return Context.username_state.home_realm_state = Constants.State.INVALID, t.ERROR;
- Context.username_state.home_realm_state = a.NameSpaceType === Constants.NameSpaceType.CLOUDFEDERATED ? Constants.State.FEDERATED : Constants.State[r]
- }
- var d = "AAD_" + r + "_AND_MSA_" + i,
- _ = t[d];
- return void 0 === _ ? t.Error : _
- },
- PerformUIAction: function(t) {
- var o = Constants.EmailDiscoveryAccountState,
- a = Context.email_discovery_response;
- switch (Context.email_discovery_easi_user = !1, Context.email_discovery_splitter_shown = !1, Instrument.email_discovery_ui_code = t, t) {
- case o.AAD_UNKNOWN_AND_MSA_NOT_EXIST:
- Constants.SHOULD_HIDE_SIGNUP || $("#create_msa_account_container").show(), n.ShowEmailDiscovery(30146);
- break;
- case o.AAD_UNKNOWN_AND_MSA_EXISTS:
- Context.email_discovery_easi_user = !0, n.LoginMSOAccount();
- break;
- case o.AAD_CLOUDFEDERATED_AND_MSA_NOT_EXIST:
- case o.AAD_FEDERATED_AND_MSA_NOT_EXIST:
- if (Util.isMSA(a.AAD.AuthURL)) {
- Constants.SHOULD_HIDE_SIGNUP || $("#create_msa_account_container").show(), n.ShowEmailDiscovery(30146);
- break
- }
- case o.AAD_MANAGED_AND_MSA_NOT_EXIST:
- n.LoginAADAccount();
- break;
- case o.AAD_CLOUDFEDERATED_AND_MSA_EXISTS:
- case o.AAD_FEDERATED_AND_MSA_EXISTS:
- if (Util.isMSA(a.AAD.AuthURL)) {
- n.LoginMSOAccount();
- break
- }
- n.SetupTilesForSplitter(), Context.redirect_auth_url = t === o.AAD_CLOUDFEDERATED_AND_MSA_EXISTS ? a.AAD.CrossCloudAuthUrl : a.AAD.AuthURL, Context.federated_domain = a.AAD.DomainName, e.users[0].authUrl = Context.redirect_auth_url;
- case o.AAD_MANAGED_AND_MSA_EXISTS:
- Context.back_action_stack.AddAction(Constants.CancelAction.FROM_EMAILDISCOVERY_SPLITTER_TO_EMAILDISCOVERY_START), $("#cred_cancel_button").show(), n.ShowSplitter();
- break;
- case o.AAD_CLOUDFEDERATED_AND_MSA_THROTTLED:
- case o.AAD_CLOUDFEDERATED_AND_MSA_TIMED_OUT:
- case o.AAD_FEDERATED_AND_MSA_THROTTLED:
- case o.AAD_FEDERATED_AND_MSA_TIMED_OUT:
- n.SetupTilesForSplitter(), Context.redirect_auth_url = t === o.AAD_CLOUDFEDERATED_AND_MSA_EXISTS ? a.AAD.CrossCloudAuthUrl : a.AAD.AuthURL, Context.federated_domain = a.AAD.DomainName, e.users[0].authUrl = Context.redirect_auth_url, Context.email_discovery_timeout_occurred = !0, Context.back_action_stack.AddAction(Constants.CancelAction.FROM_EMAILDISCOVERY_SPLITTER_TO_EMAILDISCOVERY_START), n.ShowSplitter();
- break;
- case o.AAD_MANAGED_AND_MSA_THROTTLED:
- case o.AAD_MANAGED_AND_MSA_TIMED_OUT:
- Context.email_discovery_timeout_occurred = !0, Context.back_action_stack.AddAction(Constants.CancelAction.FROM_EMAILDISCOVERY_SPLITTER_TO_EMAILDISCOVERY_START), n.ShowSplitter();
- break;
- case o.AAD_TIMED_OUT_AND_MSA_THROTTLED:
- case o.AAD_TIMED_OUT_AND_MSA_TIMED_OUT:
- case o.AAD_UNKNOWN_AND_MSA_THROTTLED:
- case o.AAD_UNKNOWN_AND_MSA_TIMED_OUT:
- case o.AAD_TIMED_OUT_AND_MSA_NOT_EXIST:
- case o.ERROR:
- Constants.SHOULD_HIDE_SIGNUP || $("#create_msa_account_container").show();
- case o.AAD_TIMED_OUT_AND_MSA_EXISTS:
- default:
- Context.email_discovery_timeout_occurred = !0, Context.email_discovery_use_msa_api ? Context.back_action_stack.AddAction(Constants.CancelAction.FROM_EMAILDISCOVERY_SPLITTER_TO_EMAILDISCOVERY_START) : n.IsTilesModeActivated() && Context.back_action_stack.AddAction(Constants.CancelAction.FROM_EMAILDISCOVERY_SPLITTER_FALLBACK_TO_TILES), n.ShowSplitter()
- }
- Context.email_discovery_easi_user && (Instrument.possible_easi_user = 1)
- },
- ReceiveHomeRealmError: function(e, t) {
- "abort" == t ? (n.HideLookingForAccountLayout(), n.ShowEmailDiscovery()) : (Context.back_action_stack.RemoveLastCancelAction(), n.HandleTimeoutHomeRealmInfo())
- },
- HandleTimeoutHomeRealmInfo: function() {
- Context.email_discovery_response = null, Context.email_discovery_timeout_occurred = !0, Context.username_state.home_realm_state = Constants.State.INVALID, n.HideLookingForAccountLayout(), n.PerformUIAction(Constants.EmailDiscoveryAccountState.ERROR)
- },
- ShowEmailDiscovery: function(e) {
- if (Context.email_discovery_workflow_state !== n.WorkflowStates.INIT) {
- if (Context.email_discovery_workflow_state = n.WorkflowStates.INIT, !Context.email_discovery_use_msa_api) return n.HideEmailDiscovery(), n.HandleTimeoutHomeRealmInfo(), void n.ShowSplitter();
- var t = !1;
- Support.hideClientErrorMessages(), Support.hideClientMessages(), Context.username_state.home_realm_state = Constants.State.NONE, Context.username_state.last_checked_email = Context.username_state.last_checked_email || "", void 0 === e ? Support.showClientMessage(30136) : (Support.showClientError(e), 30146 === e && (t = !0)), Constants.IS_HOLOGRAPHIC && $("#cred_userid_container ." + e).length > 0 && Util.OnBack(), $("#forget_tile_container").hide(), $("#cred_userid_container").show(), $("#cred_userid_inputtext").show(), $(".login_cred_field_container").show(), $(".login_cred_options_container").show(), $(".login_cred_options_container").addClass("email_discovery"), $("#cred_userid_inputtext").focus(), t ? ($("#cred_try_again_button").show(), $("#cred_continue_button").hide()) : ($("#cred_continue_button").show(), $("#cred_try_again_button").hide()), $("#cred_password_container").hide(), $("#recover_container").hide(), $("#cred_kmsi_container").hide(), $("#switch_user_container").hide(), $("#alternative-identity-providers").hide()
- }
- },
- HideEmailDiscovery: function() {
- $("#cred_userid_container").hide(), $("#cred_continue_button").hide(), $("#cred_cancel_button").hide(), $("#cred_try_again_button").hide(), $("#create_msa_account_container").hide(), Support.hideClientErrorMessages(), Support.hideClientMessages(), Context.username_state.enable_redirect = !1, Context.username_state.enable_guests = !1, User.UsernameOnChangeHandler()
- },
- BackToUserTiles: function() {
- n.HideEmailDiscovery(), Context.email_discovery_mode = !1, n.RevertUserTiles(), Tiles.drawUsers(), $("#tiles_cta_text").show(), $(".login_cred_options_container").removeClass("email_discovery"), $("#create_msa_account_container").hide(), Context.username_state.home_realm_state = Constants.State.NONE, Tiles.CancelTileRedirect()
- },
- ShowLookingForAccountLayout: function() {
- Context.email_discovery_workflow_state != n.WorkflowStates.LOOKING && (Context.email_discovery_workflow_state = n.WorkflowStates.LOOKING, Context.back_action_stack.AddAction(Constants.CancelAction.FROM_EMAILDISCOVERY_LOOKING_FOR_ACCOUNT_TO_EMAILDISCOVERY_START), $("#looking_container").show(), $("a#looking_cancel_link").focus(), $("div.progress").css("visibility", "visible"), User.startAnimation(), Context.animationTid = setInterval(User.startAnimation, 3500))
- },
- HideLookingForAccountLayout: function() {
- $("#looking_container").hide(), $("div.progress").css("visibility", "hidden"), clearInterval(Context.animationTid)
- },
- CancelLookingForAccount: function() {
- Context.email_discovery_lookup_xhr.abort()
- },
- ShowSplitter: function() {
- if (Context.email_discovery_workflow_state !== n.WorkflowStates.SPLITTER)
- if (Context.email_discovery_workflow_state = n.WorkflowStates.SPLITTER, Context.email_discovery_splitter_shown = !0, n.SetupTilesForSplitter(), $(".login_cta_container").show(), $("#login_user_chooser").show(), Tiles.drawUsers(), $("#disambig-container").show(), Context.back_action_stack.DoesCancelActionExist() && $("#cred_cancel_button").show(), Context.email_discovery_use_msa_api)
- if ($(".login_cred_options_container").css("display", "block"), Context.email_discovery_timeout_occurred) Support.showClientMessage(30140);
- else {
- var e = $("input#cred_userid_inputtext").val().toLowerCase();
- e = $.trim(e);
- var t = Constants.TokenizedStringMsgs.UPN_DISAMBIGUATE_MESSAGE.replace("{0}", e);
- $("#upn_needs_disambiguation_text").text(t), Support.showClientMessage(30139)
- }
- else n.IsTilesModeActivated() || $(".login_cred_options_container").removeClass("email_discovery"), $(".login_cred_options_container").css("display", "block"), $("#create_msa_account_container").show(), Support.showClientMessage(30173)
- },
- HideSplitter: function() {
- $("#cred_cancel_button").hide(), $("#login_user_chooser").empty(), $(".login_user_chooser").hide(), $("#login_user_chooser").hide(), $("#disambig-container").hide(), $("#create_msa_account_container").hide(), Support.hideClientErrorMessages(), Support.hideClientMessages()
- },
- BackSplitter: function() {
- n.HideSplitter(), n.ShowEmailDiscovery()
- },
- LoginMSOAccount: function() {
- if (Context.email_discovery_workflow_state != n.WorkflowStates.MSA) {
- Context.email_discovery_workflow_state = n.WorkflowStates.MSA;
- var e = {
- DomainName: Constants.MSA_DOMAIN,
- AuthURL: Constants.MSA_AUTH_URL
- };
- n.HideSplitter(), n.InitRedirect(), User.ReceiveFederatedDomain(e)
- }
- },
- LoginAADAccount: function() {
- Context.email_discovery_workflow_state != n.WorkflowStates.AAD && (Context.email_discovery_workflow_state = n.WorkflowStates.AAD, n.HideSplitter(), !Context.email_discovery_use_msa_api || (Context.email_discovery_timeout_occurred || null === Context.email_discovery_response) && Context.username_state.home_realm_state == Constants.State.INVALID ? (n.ShowAADLoginLayout(), Context.username_state.home_realm_state = Constants.State.NONE, $("#cred_userid_inputtext").focus()) : Context.username_state.home_realm_state == Constants.State.FEDERATED ? (Context.email_discovery_timeout_occurred && !Util.isMSA(Context.email_discovery_response.AAD.AuthURL) && (Context.email_discovery_easi_user = !1), n.InitRedirect(), User.ReceiveFederatedDomain(Context.email_discovery_response.AAD)) : (n.ShowAADLoginLayout(), User.ReceiveManagedDomain(Context.email_discovery_response.AAD), $("#cred_password_inputtext").focus()))
- },
- InitRedirect: function() {
- $("input#cred_userid_inputtext").hide(), $("#cred_userid_container").show(), $(".login_cred_field_container").show(), $(".login_cred_options_container").show(), $("#cred_kmsi_container").show(), Context.back_action_stack.AddAction(Context.email_discovery_splitter_shown ? Constants.CancelAction.FROM_EMAILDISCOVERY_REDIRECT_TO_EMAILDISCOVERY_SPLITTER : Constants.CancelAction.FROM_EMAILDISCOVERY_REDIRECT_TO_EMAILDISCOVERY_START), $("div.progress").css("visibility", "visible"), $(".login_cred_options_container").removeClass("email_discovery"), User.startAnimation(), Context.animationTid = setInterval(User.startAnimation, 3500)
- },
- ShowAADLoginLayout: function() {
- Context.email_discovery_mode = !1, Context.back_action_stack.AddAction(Context.email_discovery_splitter_shown ? Constants.CancelAction.FROM_EMAILDISCOVERY_AAD_LOGIN_TO_EMAILDISCOVERY_SPLITTER : Constants.CancelAction.FROM_EMAILDISCOVERY_AAD_LOGIN_TO_EMAILDISCOVERY_START), $(".login_cred_field_container").show(), $(".login_cred_options_container").show(), $(".login_cred_options_container").removeClass("email_discovery"), $("#cred_userid_inputtext").show(), $("#cred_password_inputtext").show(), $("#cred_userid_container").show(), $("#cred_sign_in_button").show(), $("#cred_kmsi_container").show(), $("#recover_container").show(), $("#cred_password_container").show(), $("#login_cta_text").show(), $("#cred_cancel_button").show(), TenantBranding.setUserIdHintAndKmsi()
- },
- HideAADLoginLayout: function() {
- Context.email_discovery_mode = !0, TenantBranding.RemoveTenantBrandingAndApplyWorkload(), $(".login_cred_options_container").addClass("email_discovery"), $("#cred_password_inputtext").val(""), $("#cred_sign_in_button").hide(), $("#cred_kmsi_container").hide(), $("#recover_container").hide(), $("#cred_password_container").hide(), $("#login_cta_text").hide(), $("#cred_cancel_button").hide()
- },
- CancelRedirect: function() {
- clearTimeout(Context.redirectTid), Context.username_state.home_realm_state = Constants.State.NONE, $("div.progress").css("visibility", "hidden"), clearInterval(Context.animationTid), $("#redirect_message_container").hide(), $("#cred_sign_in_button").hide(), $("#redirect_cta_text").hide(), $("#redirect_company_name_text").empty(), $("#cred_kmsi_container").hide(), $(".login_cred_options_container").addClass("email_discovery"), $("#redirect_message_container").css("opacity", 0), $("#redirect_message_container").addClass("hidden"), $("#redirect_message_container").addClass("no_display"), Context.email_discovery_mode = !0
- },
- GetEnumKeyName: function(e, t) {
- for (var n in e)
- if (e[n] == t) return n;
- return null
- }
- };
- $Do.when("doc.ready", function() {
- n.Initialize(), $Do.register("EmailDiscovery", 0, !0)
- })
- }(), $Do.when("jQuery.ready", function() {
- var e = jQuery.fn.hide;
- jQuery.fn.hide = function(t, n) {
- if (t) {
- var o = this;
- e.apply(this, [t, function() {
- o.each(function(e, t) {
- t.setAttribute("aria-hidden", "true")
- }), n && n.call(o)
- }])
- } else e.apply(this, arguments), this.each(function(e, t) {
- t.setAttribute("aria-hidden", "true")
- });
- return this
- };
- var t = jQuery.fn.show;
- jQuery.fn.show = function(e, n) {
- if (e) {
- var o = this;
- t.apply(this, [e, function() {
- o.each(function(e, t) {
- t.removeAttribute("aria-hidden")
- }), n && n.call(o)
- }])
- } else t.apply(this, arguments), this.each(function(e, t) {
- t.removeAttribute("aria-hidden")
- });
- return this
- };
- var n = jQuery.fn.addClass;
- jQuery.fn.addClass = function(e) {
- return ("no_display" === e || "hidden" === e) && this.each(function(e, t) {
- t.setAttribute("aria-hidden", "true")
- }), n.apply(this, arguments), this
- };
- var o = jQuery.fn.removeClass;
- jQuery.fn.removeClass = function(e) {
- return ("no_display" === e || "hidden" === e) && this.each(function(e, t) {
- t.removeAttribute("aria-hidden")
- }), o.apply(this, arguments), this
- }, jQuery.support.placeholder = function() {
- return window.Support.is_placeholder_supported()
- }()
- }),
- function() {
- var e = window,
- t = e.MSLogin,
- n = e.Support = t.Support = {
- clientErrorStrings: {},
- is_placeholder_supported: function() {
- if ($.browser.msie) {
- var e = document.documentMode;
- if (12 > e) return !1
- }
- if (navigator.userAgent.indexOf("rv:11.0") >= 0) return !1;
- var t = document.createElement("input");
- return "placeholder" in t
- },
- is_prefetch_supported: function() {
- return navigator.userAgent.match(/iPad/) ? !1 : !0
- },
- showClientError: function(e) {
- var o = !1,
- a = [];
- if (0 == e) $("#cta_error_message_text").hide(), $("#accessibleError").hide(), $("#login_cta_text").hide(), $("#cta_client_error_text").hide(), $("#login_cta_text").show(), $("#create_msa_account_container").removeClass("no-display"), Constants.IS_HOLOGRAPHIC && ($(".footer_inner_container").show(), $("#cred_user_error_messages div.client_error_msg").hide());
- else {
- if (Constants.IS_CXH_REQUEST && t.Util.LogCxhTelemetry("AADLoginPageClientError", e), $(".client_error_msg").each(function() {
- $(this).hide(), $("#" + $(this).data("elementid")).removeClass("inputState_error")
- }), $("#cta_error_message_text").hide(), $("#login_cta_text").hide(), Constants.IS_HOLOGRAPHIC && $(".footer_inner_container").hide(), $("#cta_client_error_text").show(), arguments.length > 1) {
- a = new Array(arguments.length - 1);
- for (var i = 0; i < a.length; i++) a[i] = arguments[i + 1]
- }
- $(".client_error_msg." + e).each(function() {
- a.length >= 1 && (n.clientErrorStrings[e] || (n.clientErrorStrings[e] = $(this).html()), $(this).html(n.clientErrorStrings[e].format(a))), $(this).show(), $("#accessibleError").text($(this).text()), $("#accessibleError").show();
- var t = $("#" + $(this).data("elementid"));
- t.addClass("inputState_error"), t.length > 0 && (t[t.length - 1].focus(), o = !0)
- })
- }
- return o
- },
- hideClientError: function(e) {
- $(".client_error_msg." + e).hide(), $("#accessibleError").hide(), $("#login_cta_text").show(), $("#create_msa_account_container").removeClass("no-display")
- },
- hideClientErrorMessages: function() {
- $("#cta_error_message_text").hide(), $("#accessibleError").hide(), $("#login_cta_text").hide(), $("#cta_client_error_text").hide(), $(".client_error_msg").hide(), $("#cta_error_message_text").hide(), $("#login_cta_text").show(), $("#create_msa_account_container").removeClass("no-display")
- },
- showClientMessage: function(e) {
- $(".cta_message_text").hide(), $("#cta_client_message_text").show(), $(".cta_message_text." + e).show()
- },
- hideClientMessages: function() {
- $(".cta_message_text").hide(), $("#cta_client_message_text").hide()
- },
- showUsernameOrDomainError: function(e) {
- var t;
- if (Constants.IS_MSA_FED_SUPPORTED) {
- $("#user-not-found-link").off("click"), t = n.showClientError(30065, e);
- var o = User.GetRedirectAction(Constants.msaSignupUrl, Constants.msaSignupUrl, Constants.msaRedirSignupErrorParams, e);
- $("#user-not-found-link").click(function(e) {
- e.preventDefault(), o()
- })
- } else t = n.showClientError(30068, e.substring(e.lastIndexOf("@") + 1));
- return t
- },
- validateUsernameCredInput: function(e) {
- var n = t.Constants;
- return Constants.IS_MSA_PHONE_USERNAME_SUPPORTED && n && n.REGEX_EMAIL && n.REGEX_PHONE ? n.REGEX_EMAIL.test(e) || n.REGEX_PHONE.test(e) : n.REGEX_EMAIL.test(e)
- },
- validateCredInputs: function() {
- var e = n.validateUsernameInput();
- 0 === e && (e = n.validatePassword());
- var t = !1;
- if (Constants.IS_HOLOGRAPHIC || (t = n.showClientError(e)), e) {
- if (!Constants.IS_HOLOGRAPHIC && !t) {
- var o = $("input#cred_userid_inputtext"),
- a = $("input#cred_password_inputtext"),
- i = o.val().trim(),
- r = a.val().trim();
- o.is(":visible") ? "" === i ? o.focus() : "" === r ? a.focus() : o.focus() : a.focus()
- }
- return !1
- }
- return !0
- },
- validatePassword: function() {
- var e = $("input#cred_password_inputtext").val(),
- t = 0;
- return "" == e && (t = 30111, Constants.IS_HOLOGRAPHIC || $("input#cred_password_inputtext").focus()), Constants.IS_HOLOGRAPHIC && n.showClientError(t), t
- },
- validateUsernameInput: function() {
- var e = $("input#cred_userid_inputtext").val(),
- t = 30067;
- return e = e.toLowerCase(), "" == e ? t = 30127 : Constants.IS_NAME_COEXISTENCE_ACCOUNT || n.validateUsernameCredInput(e) ? t = 0 : (t = 30064, null != e && -1 != e.indexOf("\\") && (t = 30066)), Constants.IS_HOLOGRAPHIC && n.showClientError(t), t
- },
- forceCredBlockHeight: function() {},
- renderBrowserSpecificForNarrowWidth: function(e) {
- User.resize_bg(), Background.winW < Constants.MOBILE_WIDTH_THRESHOLD && ($.browser.msie && e >= 8 && $(".push").css("height", "2em"), $.browser.msie && 6 >= e && $(".login_panel").css("padding-left", "50px"))
- },
- renderBrowserSpecificForNarrowHeight: function() {
- if (User.resize_bg(), Background.winH < Constants.MOBILE_HEIGHT_THRESHOLD || "1" == Util.ExtractQSParam("popupui")) {
- var e = !0;
- navigator.userAgent.match(/IEMobile/) && (e = !1), navigator.userAgent.match(/Android/) && (e = !1), navigator.userAgent.match(/iPhone/) && (e = !1), navigator.userAgent.match(/iPad/) && (e = !1), e ? $("#footer_links_container").addClass("sticky_footer") : $("#footer_links_container").removeClass("sticky_footer")
- }
- },
- renderBrowserSpecific: function() {
- var e = document.documentMode;
- if ($.browser.msie && e >= 8 && ($(".push").css("display", "inline-block"), $(".push").css("height", "6em")), (navigator.userAgent.match(/iPad/) || navigator.userAgent.match(/iPhone/)) && (n.forceCredBlockHeight(), $(".cred").css("margin-bottom", "-3em"), $(".login_guest_container").css("margin-bottom", "0px")), $.browser.msie && e > 8 && $(".show_other").css("margin-left", "-5px"), $.browser.msie && 7 >= e && ($(".ie_legacy").css("display", "none"), $("body").css("background-color", $("html").css("background-color")), $("a.tile_link").css("margin-left", "0px"), $("table.user_tile").css("margin-left", "0px"), $("table.user_tile").css("margin-bottom", "10px"), $(".show_other").css("margin-left", "0px")), $.browser.msie && 6 >= e && $("body").css("overflow-y", "hidden"), $.browser.mozilla && $(".input_border").addClass("high_contrast_border"), navigator.userAgent.match(/IEMobile/), navigator.userAgent.match(/Android 2\.3/) && ("optin.2.0" != $("meta[name=PageID]").attr("content") && $("body").css("font-size", "0.5em"), $(".login_footer_container").css("margin-top", "-12em"), $(".login_guest_container").css("padding-top", "0px"), $(".cred").css("padding-bottom", "10em"), n.forceCredBlockHeight()), navigator.userAgent.match(/Android/) && $("body").css("height", "100vh"), $.browser.msie && 10 == e) {
- $(".cred").css("padding-bottom", "100px");
- var t = $(window).height() - $(".login_footer_container").height() + 30;
- $("#login_panel_center").css("height", t + "px"), document.body.onresize = function() {
- var e = $(window).height() - $(".login_footer_container").height() + 30;
- $("#login_panel_center").css("height", e + "px")
- }
- }
- var o = window.$B,
- a = o && o.Edge;
- if (!a && $.browser.webkit && $("form :input").blur(function() {
- User.resize_bg()
- }), n.renderBrowserSpecificForNarrowWidth(e), n.renderBrowserSpecificForNarrowHeight(e), $.browser.msie && document.documentMode < 11) {
- $(".cred").css("padding-bottom", "0px");
- var i = function() {
- var e = $(window).height() - $("#true_inner").height() - $(".push").height() - 60;
- $("#login_panel_center").css("height", e > 0 ? $(window).height() - 15 : "")
- };
- document.body.onresize = i, i()
- }
- },
- getViewport: function() {
- var e, t;
- return "undefined" != typeof window.innerWidth ? (e = window.innerWidth, t = window.innerHeight) : "undefined" != typeof document.documentElement && "undefined" != typeof document.documentElement.clientWidth && 0 != document.documentElement.clientWidth ? (e = document.documentElement.clientWidth, t = document.documentElement.clientHeight) : (e = document.getElementsByTagName("body")[0].clientWidth, t = document.getElementsByTagName("body")[0].clientHeight), [e, t]
- },
- showIllustration: function() {
- var e = n.getViewport(),
- t = !0;
- return Background.winW < Constants.MOBILE_WIDTH_THRESHOLD ? t = !1 : e[0] < Constants.MOBILE_WIDTH_THRESHOLD ? t = !1 : navigator.userAgent.match(/IEMobile/) ? t = !1 : navigator.userAgent.match(/Android 2\.3/) ? t = !1 : "1" == Util.ExtractQSParam("popupui") && (t = !1), t
- },
- showTileTooltips: function() {
- var e = !0;
- return navigator.userAgent.match(/iPad/) ? e = !1 : navigator.userAgent.match(/iPhone/) && (e = !1), e
- },
- isDefined: function(e) {
- return null != e && void 0 != e && (e.length > 0 || "object" == typeof e || "boolean" == typeof e || "number" == typeof e)
- },
- getDomain: function(e) {
- var t = $.trim(e),
- o = function(e) {
- return -1 != e.indexOf("@") && e.indexOf("@") < e.length
- },
- a = function(e) {
- return n.isDefined(e) && o(e)
- };
- if (a(t)) {
- var i = e.substring(t.indexOf("@") + 1);
- if (i.length > 0) return i
- }
- return null
- },
- checkIfDomainsMatch: function(e, t) {
- var o = n.getDomain(e),
- a = n.getDomain(t);
- return null != o && null != a ? o.toLowerCase() == a.toLowerCase() : !1
- },
- GetOriginalPasswordResetLinkUrl: function() {
- var e = Context.password_reset_link_url;
- if (!n.isDefined(e)) {
- var t = $("a#cred_forgot_password_link");
- n.isDefined(t) && n.isDefined(t.attr("href")) && (e = t.attr("href")), n.isDefined(e) ? Context.password_reset_link_url = e : e = null
- }
- return e
- },
- UpdatePasswordResetLink: function() {
- var e = $("a#cred_forgot_password_link"),
- t = n.GetOriginalPasswordResetLinkUrl();
- if (n.isDefined(e) && n.isDefined(t)) {
- var o = decodeURIComponent(Util.ExtractQSParam("whr")),
- a = $("input#cred_userid_inputtext").val(); - 1 == t.indexOf("?") && (t += "?"), n.isDefined(o) && (t += "&whr=" + encodeURIComponent(o)), n.isDefined(a) && (t += "&username=" + encodeURIComponent(a)), e.attr("href", t)
- }
- },
- IsBrowserVersionGreaterOrEqual: function(e, t) {
- if ("*" == t) return !0;
- if (!n.isDefined(e) || !n.isDefined(t)) return !1;
- for (var o = e.split("."), a = t.split("."), i = !1, r = 0; r < a.length; r++) {
- var s = parseInt(o[r], 10),
- d = parseInt(a[r], 10);
- if (isNaN(s) || isNaN(d)) return !1;
- if (d > s) return !1;
- if (s > d) return !0;
- i = !0
- }
- return i
- },
- ViewErrorDetails: function() {
- $(".view-error-details-title").toggleClass("no_display"), $(".view-error-details-content").toggleClass("no_display")
- },
- IForgotMyPassword: function() {
- $(".i-forgot-my-password-content").toggleClass("no_display")
- },
- LegalActionLink: function(e, t) {
- e.preventDefault();
- var n = "tou" === t ? Constants.footerTermsUrl : Constants.footerPrivacyUrl;
- Constants.IS_ADAL_REQUEST ? $.ajax({
- url: n,
- data: {
- IsAjax: !0
- },
- success: function(e) {
- $(".login_panel_layout").hide(), $("#legal-content").text(e).show(), $("#legal-section").show().scrollTop(0)
- }
- }) : window.open(n, "_blank")
- }
- }
- }();
- var MSLogout = {
- logoutstate: null,
- success: [],
- error: [],
- noOfIncompleteSites: 0,
- thirdPartyCookieEnabled: -1,
- showSignOutInfo: function() {
- MSLogout.checkThirdPartyCookies(), $.each(MSLogout.logoutstate.sites, function(e, t) {
- MSLogout.checkSiteCookies(t)
- })
- },
- checkThirdPartyCookies: function() {
- void 0 !== MSLogout.logoutstate.thirdPartyCookieURL && $("<img/>").attr("src", MSLogout.logoutstate.thirdPartyCookieURL).load(function() {
- MSLogout.thirdPartyCookieEnabled = ThirdPartyCookieStates.ENABLED
- }).error(function() {
- MSLogout.thirdPartyCookieEnabled = ThirdPartyCookieStates.DISABLED
- }()).addClass("hidden")
- },
- checkSiteCookies: function(e) {
- var t = e;
- MSLogout.noOfIncompleteSites++;
- var n = $("<img/>").attr("src", t.url).load(function() {
- var e = t;
- return function() {
- MSLogout.noOfIncompleteSites--, MSLogout.success.push(e)
- }
- }()).error(function() {
- var e = t;
- return function() {
- MSLogout.noOfIncompleteSites--, MSLogout.error.push(e)
- }
- }()).addClass("hidden");
- $("body").append(n)
- },
- displaySiteList: function() {
- if (MSLogout.thirdPartyCookieEnabled != ThirdPartyCookieStates.NOT_LOADED && 0 == MSLogout.noOfIncompleteSites) {
- $(".signed_out_sites").show(), $("#more_info_text").hide();
- var e = "#success_signed_out_sites";
- MSLogout.thirdPartyCookieEnabled == ThirdPartyCookieStates.DISABLED && (e = "#error_signed_out_sites"), $.each(MSLogout.success, function(t, n) {
- $(e).append($("<div/>").attr("id", "site_" + n.id).text(n.name + " (" + n.id + ")"))
- }), $.each(MSLogout.error, function(e, t) {
- $("#error_signed_out_sites").append($("<div/>").attr("id", "site_" + t.id).text(t.name + " (" + t.id + ")"))
- }), MSLogout.displaySAMLList()
- }
- },
- displaySAMLList: function() {
- var e, t = MSLogout.logoutstate.samlNamespace;
- if (void 0 != t) {
- e = t.status ? "#success_signed_out_sites" : "#error_signed_out_sites";
- var n = $("<div/>").html(t.name).text();
- $(e).append($("<div/>").attr("id", "site_saml").text(n + " (" + t.domain + ")"))
- }
- }
- };
- MSLogout.ThirdPartyCookieStates = {
- NOT_LOADED: -1,
- DISABLED: 0,
- ENABLED: 1
- };
- var ThirdPartyCookieStates = MSLogout.ThirdPartyCookieStates,
- PostType = {
- INVALID: "0",
- PASSWORD: "11",
- FEDERATION: "13",
- SHA1_PASSWORD: "15",
- SHA1HASH_PASSWORD: "16"
- },
- LoginOption = {
- EMPTY: "0",
- REMEMBER_PASSWORD: "1",
- REMEMBER_USER_TILE: "2",
- NOTHING_CHECKED: "3"
- };
- ! function() {
- var e = window,
- t = e.MSLogin,
- n = e.Post = t.Post = {
- isSubmitting: !1,
- DetermineBrowser: function() {
- return $.browser.msie ? "MSIE" : $.browser.chrome ? "Chrome" : $.browser.webkit ? "Webkit" : $.browser.safari ? "Safari" : $.browser.mozilla ? "Firefox" : $.browser.opera ? "Opera" : "Unknown"
- },
- IsSubmitReady: function() {
- switch (Context.username_state.home_realm_state) {
- case Constants.State.FEDERATED:
- return !1;
- case Constants.State.MANAGED:
- break;
- case Constants.State.INVALID:
- break;
- case Constants.State.NONE:
- var t = e.User;
- if (t.UpdateUsernameState(), !Context.username_state.is_empty && !Context.username_state.is_partial && !Constants.IS_NAME_COEXISTENCE_ACCOUNT) return t.RefreshDomainState(), !1;
- break;
- default:
- return !1
- }
- return e.Support.validateCredInputs() ? n.isSubmitting ? !1 : (n.isSubmitting = !0, !0) : !1
- },
- GetCredParameters: function(t) {
- var o = e.Background,
- a = e.Instrument,
- i = e.Tiles,
- r = [];
- if (t) try {
- var s = new Date,
- d = s.getTime() - s.getMilliseconds() - 12e4,
- _ = e.performance.timing;
- r.push({
- name: "n1",
- value: _.navigationStart - d
- }), r.push({
- name: "n2",
- value: _.redirectStart - d
- }), r.push({
- name: "n3",
- value: _.redirectEnd - d
- }), r.push({
- name: "n4",
- value: _.fetchStart - d
- }), r.push({
- name: "n5",
- value: _.domainLookupStart - d
- }), r.push({
- name: "n6",
- value: _.domainLookupEnd - d
- }), r.push({
- name: "n7",
- value: _.connectStart - d
- }), r.push({
- name: "n8",
- value: _.secureConnectionStart - d
- }), r.push({
- name: "n9",
- value: _.connectEnd - d
- }), r.push({
- name: "n10",
- value: _.requestStart - d
- }), r.push({
- name: "n11",
- value: _.responseStart - d
- }), r.push({
- name: "n12",
- value: _.responseEnd - d
- }), r.push({
- name: "n13",
- value: _.domLoading - d
- }), r.push({
- name: "n14",
- value: _.domInteractive - d
- }), r.push({
- name: "n15",
- value: _.domContentLoadedEventEnd - _.domContentLoadedEventStart
- }), r.push({
- name: "n16",
- value: _.domComplete - d
- }), r.push({
- name: "n17",
- value: _.loadEventStart - d
- }), r.push({
- name: "n18",
- value: _.loadEventEnd - d
- }), r.push({
- name: "n19",
- value: a.home_realm_load_time
- }), r.push({
- name: "n20",
- value: a.latency_sensitivity
- }), r.push({
- name: "n21",
- value: a.prefetch_done ? 1 : 0
- }), r.push({
- name: "n22",
- value: a.prefetch_load_time
- }), r.push({
- name: "n23",
- value: a.background_image_loaded ? 1 : 0
- }), r.push({
- name: "n24",
- value: a.background_image_load_time
- }), r.push({
- name: "n25",
- value: null !== i.users ? i.users.length - 1 : 0
- }), r.push({
- name: "n26",
- value: a.email_discovery_ui_code
- }), r.push({
- name: "n27",
- value: a.email_discovery_splitter_choice
- }), r.push({
- name: "n28",
- value: a.possible_easi_user
- }), r.push({
- name: "n29",
- value: a.tenant_branding_process_end_time - a.tenant_branding_start_time
- }), r.push({
- name: "n30",
- value: a.tenant_branding_json_end_time - a.tenant_branding_start_time
- }), r.push({
- name: "n31",
- value: a.tenant_branding_load_error ? 1 : 0
- }), r.push({
- name: "n32",
- value: a.has_tenant_branding ? 1 : 0
- }), r.push({
- name: "n33",
- value: a.has_dynamic_tenant_branding ? 1 : 0
- }), r.push({
- name: "n34",
- value: a.logo_image_load_time
- }), r.push({
- name: "n35",
- value: a.background_image_error ? 1 : 0
- }), r.push({
- name: "n36",
- value: a.logo_image_error ? 1 : 0
- }), r.push({
- name: "n37",
- value: a.tenant_branding_total_time
- }), r.push({
- name: "n38",
- value: a.tenant_branding_number_of_switches
- }), r.push({
- name: "n39",
- value: a.tenant_branding_right_side_time
- }), r.push({
- name: "n40",
- value: a.logo_image_end_time
- }), r.push({
- name: "n41",
- value: a.background_image_end_time
- }), r.push({
- name: "n42",
- value: a.document_ready_end_time
- }), r.push({
- name: "n43",
- value: a.document_load_end_time
- })
- } catch (c) {}
- r.push({
- name: "type",
- value: PostType.PASSWORD
- }), r.push($("#cred_keep_me_signed_in_checkbox").attr("checked") ? {
- name: "LoginOptions",
- value: LoginOption.REMEMBER_PASSWORD
- } : e.EmailDiscovery.IsDiscoveryPage() || Context.post_from_tile ? {
- name: "LoginOptions",
- value: LoginOption.REMEMBER_USER_TILE
- } : {
- name: "LoginOptions",
- value: LoginOption.NOTHING_CHECKED
- }), r.push({
- name: "NewUser",
- value: 1
- }), r.push({
- name: "idsbho",
- value: 1
- }), r.push({
- name: "PwdPad",
- value: ""
- }), r.push({
- name: "sso",
- value: ""
- });
- var l = decodeURIComponent(e.Util.ExtractQSParam("vv"));
- return r.push({
- name: "vv",
- value: l
- }), r.push({
- name: "uiver",
- value: 1
- }), r.push({
- name: "i12",
- value: "https:" == e.location.protocol ? 1 : 0
- }), r.push({
- name: "i13",
- value: n.DetermineBrowser()
- }), r.push({
- name: "i14",
- value: $.browser.version
- }), r.push({
- name: "i15",
- value: o.winW
- }), r.push({
- name: "i16",
- value: o.winH
- }), r.push(Constants.IS_CXH_REQUEST ? {
- name: "i20",
- value: Constants.IS_CXH_REQUEST
- } : {
- name: "i20",
- value: ""
- }), r
- },
- SubmitCreds: function() {
- if (n.IsSubmitReady()) {
- $("#cred_password_inputtext").focus();
- var e = [];
- if (e = n.GetCredParameters(Constants.SUBMIT_METRICS_ON_POST), Constants.IS_CXH_REQUEST && Constants.CxhFlow && Constants.CxhFlow.toUpperCase().startsWith("FRX") && "undefined" != typeof CloudExperienceHost && "undefined" != typeof CloudExperienceHost.Bridge) try {
- var t = new CloudExperienceHost.Bridge;
- t.invoke("CloudExperienceHost.Storage.SharableData.addValue", "oobe-username", $("input#cred_userid_inputtext").val()), t.invoke("CloudExperienceHost.MSA.encryptUserData", $("input#cred_password_inputtext").val()).done(function(e) {
- t.invoke("CloudExperienceHost.Storage.PrivateData.addItem", "oobe-password", e)
- }, function() {
- t.invoke("CloudExperienceHost.Storage.SharableData.addValue", "oobe-password", $("input#cred_password_inputtext").val())
- }), e.push({
- name: "i21",
- value: ""
- })
- } catch (o) {
- e.push({
- name: "i21",
- value: o.message
- })
- }
- var a = [];
- $.each(e, function(e, t) {
- -1 === $.inArray(t.name, a) && void 0 !== t.value && ($("<input />").attr("type", "hidden").attr("name", t.name).attr("value", t.value).appendTo("#credentials"), a.push(t.name))
- }), $("form#credentials").submit()
- }
- },
- SubmitInstrumentation: function() {
- var e = [];
- e = n.GetCredParameters(Constants.SUBMIT_METRICS_ON_REDIRECT), e.login = "federated", e.passwd = "", e.LoginOptions = LoginOption.NOTHING_CHECKED;
- var t = {};
- $.each(e, function(e, n) {
- void 0 !== n.value && (t[n.name] = n.value)
- }), $.ajax({
- headers: {
- Accept: "application/json"
- },
- url: $("#credentials").attr("action") + "&clientMetrics&federatedDomain=" + Context.federated_domain,
- type: "POST",
- dataType: "json",
- data: t,
- async: !0,
- timeout: 200
- })
- }
- };
- $Do.register("Post", 0, !0)
- }(),
- /**
- * @preserve Copyright 2016 (C) Microsoft Corporation. All rights reserved.
- */
- function() {
- function e() {
- function e() {
- $("#redirect_dots_animation").show(), $("#redirect_dots_animation").css("visibility", "visible"), User.setupCredFieldsWithPlaceHolder(), setTimeout(User.startAnimation, 0), I = setInterval(User.startAnimation, Constants.TWOFA_ANIMATION_INTERVAL), R = !0, u(Constants.StrongAuth.Context)
- }
- function a(e) {
- L = e, M = e.AuthMethodId, R = !0, 0 === e.AuthMethodId.toUpperCase().indexOf("TWOWAYVOICE") ? ($(".tfa_results_text.30050").show(), $("#tfa_button_container").hide(), $("button#tfa_signin_button").prop("disabled", !0)) : 0 === e.AuthMethodId.toUpperCase().indexOf("TWOWAYSMS") ? ($(".tfa_results_text.30049").show(), Constants.IS_HOLOGRAPHIC && $("button#tfa_signin_button").prop("disabled", !0)) : 0 === e.AuthMethodId.toUpperCase().indexOf("PHONEAPPNOTIFICATION") && $(".tfa_results_text.30051").show(), "none" != e.MethodDisplayString ? ($("#tfa_phone_text").text(e.MethodDisplayString), $("#tfa_phone_text").show(), $(".tile_secondary_name").show(), $(".tile_secondary_name").text(e.MethodDisplayString)) : ($("#tfa_phone_text").hide(), $(".tile_secondary_name").hide()), $("#tfa_options_link_container").show();
- var t = {
- Method: "BeginAuth",
- flowToken: Constants.StrongAuth.FlowToken,
- ctx: Constants.StrongAuth.Ctx,
- AuthMethodId: e.AuthMethodId
- };
- E(), i(JSON.stringify(t))
- }
- function i(e) {
- D = (new Date).getTime(), U = Constants.TWOFA_POLLING_INTERVAL, Constants.TWOFA_AUTH_METHOD_POLLING_INTERVAL[M] && (U = 1e3 * Constants.TWOFA_AUTH_METHOD_POLLING_INTERVAL[M]), B = $.ajax({
- headers: {
- Accept: "application/json"
- },
- url: Constants.StrongAuth.SASControllerBeginAuthUrl,
- timeout: Constants.TWOFA_TIMEOUT,
- data: e,
- dataType: "json",
- type: "POST",
- contentType: "application/json",
- success: g,
- error: l
- })
- }
- function r(e) {
- if (O)
- if (x++, Constants.TWOFA_MAX_POLLS >= x) {
- var t = {
- Method: "EndAuth",
- SessionId: e.SessionId,
- FlowToken: e.FlowToken,
- Ctx: e.Ctx,
- AuthMethodId: e.AuthMethodId,
- PollCount: x + 1,
- LastPollStart: D,
- LastPollEnd: k
- };
- s(JSON.stringify(t))
- } else c(e)
- }
- function s(e) {
- var t = U,
- n = t;
- 0 !== D && (n = D + t - (new Date).getTime(), 0 > n && (n = 0)), U *= Constants.TWOFA_POLLING_INTERVAL_BACKOFF, b = setTimeout(function() {
- d(e)
- }, n)
- }
- function d(e) {
- D = (new Date).getTime(), B = $.ajax({
- headers: {
- Accept: "application/json"
- },
- url: Constants.StrongAuth.SASControllerEndAuthUrl,
- timeout: Constants.TWOFA_TIMEOUT,
- data: e,
- dataType: "json",
- type: "POST",
- contentType: "application/json",
- success: m,
- error: l
- })
- }
- function _(e) {
- if (R) {
- $("#cred_remember_mfa_container").hide();
- var t = "30062";
- switch (e.ResultValue) {
- case "UserVoiceAuthFailedCallWentToVoicemail":
- t = "30106";
- break;
- case "UserVoiceAuthFailedInvalidPhoneInput":
- case "UserVoiceAuthFailedPhoneHungUp":
- t = "30107";
- break;
- case "UserVoiceAuthFailedInvalidPhoneNumber":
- case "UserVoiceAuthFailedInvalidExtension":
- case "InvalidFormat":
- t = "30109";
- break;
- case "UserAuthFailedDuplicateRequest":
- case "UserVoiceAuthFailedPhoneUnreachable":
- case "UserVoiceAuthFailedProviderCouldntSendCall":
- t = "30108";
- break;
- case "User2WaySMSAuthFailedProviderCouldntSendSMS":
- case "SMSAuthFailedProviderCouldntSendSMS":
- t = "30434";
- break;
- case "User2WaySMSAuthFailedNoResponseTimeout":
- t = "30435";
- break;
- case "SMSAuthFailedNoResponseTimeout":
- case "SMSAuthFailedWrongCodeEntered":
- case "OathCodeIncorrect":
- case "OathCodeDuplicate":
- case "OathCodeOld":
- t = "30436";
- break;
- case "PhoneAppNoResponse":
- t = "30437";
- break;
- case "User2WaySMSAuthFailedWrongCodeEntered":
- t = "30438";
- break;
- case "PhoneAppInvalidResult":
- t = "30439";
- break;
- case "PhoneAppDenied":
- t = "30440";
- break;
- case "PhoneAppTokenChanged":
- t = "30441";
- break;
- case "SMSAuthFailedMaxAllowedCodeRetryReached":
- t = "30443"
- }
- null === L ? $(".tfa_results_text").hide() : 0 === L.AuthMethodId.toUpperCase().indexOf("ONEWAYSMS") ? $(".tfa_results_text.30167").show() : 0 === L.AuthMethodId.toUpperCase().indexOf("PHONEAPPOTP") ? $(".tfa_results_text.30166").show() : $(".tfa_results_text").hide(), $("#redirect_dots_animation").hide(), $(".tfa_error_text." + t).show(), f(e), clearInterval(I), D = 0, k = 0, U = Constants.TWOFA_POLLING_INTERVAL
- }
- }
- function c(e) {
- R && (null === L ? $(".tfa_results_text").hide() : 0 === L.AuthMethodId.toUpperCase().indexOf("ONEWAYSMS") ? $(".tfa_results_text.30167").show() : 0 === L.AuthMethodId.toUpperCase().indexOf("PHONEAPPOTP") ? $(".tfa_results_text.30166").show() : $(".tfa_results_text").hide(), $("#redirect_dots_animation").hide(), $(".tfa_error_text.30442").show(), f(e), clearInterval(I), y = !1)
- }
- function l(e, t) {
- if (R) {
- if (null === L ? $(".tfa_results_text").hide() : 0 === L.AuthMethodId.toUpperCase().indexOf("ONEWAYSMS") ? $(".tfa_results_text.30167").show() : 0 === L.AuthMethodId.toUpperCase().indexOf("PHONEAPPOTP") ? $(".tfa_results_text.30166").show() : $(".tfa_results_text").hide(), $("#redirect_dots_animation").hide(), "timeout" == t ? $(".tfa_error_text.30442").show() : $(".tfa_error_text.30062").show(), clearInterval(I), y = !1, D = 0, k = 0, U = Constants.TWOFA_POLLING_INTERVAL, L && L.SessionId) {
- var n = w.errTemplate.format(L.SessionId ? Util.htmlEncode(L.SessionId) : "", L.CorrelationId ? Util.htmlEncode(L.CorrelationId) : "", (new Date).toISOString());
- $("#tfa_error_text").html(n).show()
- }
- E()
- }
- }
- function u(e) {
- if ("true" == e.Result) {
- if (N = e, null === e.DefaultMethod) return void $(".tfa_error_text.30126").show();
- a(e.DefaultMethod)
- }
- }
- function g(e) {
- if (k = (new Date).getTime(), "true" == e.Result) {
- P = e.FlowToken, F = e.Ctx, L.SessionId = e.SessionId, L.CorrelationId = e.CorrelationId;
- var t, n = !1;
- if (0 === e.AuthMethodId.toUpperCase().indexOf("ONEWAYSMS") && M && 0 === M.toUpperCase().indexOf("ONEWAYSMS") ? (t = "30167", n = !0) : 0 === e.AuthMethodId.toUpperCase().indexOf("PHONEAPPOTP") && M && 0 === M.toUpperCase().indexOf("PHONEAPPOTP") && (t = "30166", n = !0), n) clearInterval(I), Constants.IS_HOLOGRAPHIC && ("options" !== Util.HoloNavigationStack[Util.HoloNavigationStack.length - 1].name && Util.HoloNavigationStack.push({
- name: "options",
- show: T
- }), Util.HoloNavigationStack.push({
- name: "verifyCode",
- show: null
- })), $("#tfa_signin_button").show(), $("button#tfa_signin_button").prop("disabled", !1), $("input#tfa_code_inputtext").val(""), $("#redirect_dots_animation").hide(), $(".tfa_results_text").hide(), $(".tfa_results_text." + t).show(), $("#tfa_code_container").show(), $("#tfa_pin_container").length && ($("input#tfa_pin_inputtext").val(""), $("#tfa_pin_container").show(), $("input#tfa_pin_inputtext").keypress(function(e) {
- User.KeyPressEnter(e, w.submitCode, 13)
- })), $("#tfa_code_inputtext").focus(), $("#tfa_button_container").show(), $("input#tfa_code_inputtext").keypress(function(e) {
- User.KeyPressEnter(e, w.submitCode, 13)
- }), $("#tfa_signin_button").keypress(function(e) {
- User.KeyPressEnter(e, w.submitCode, 13)
- }), setTimeout(function() {
- var t = e.SessionId;
- if (L.SessionId === t && R && 0 === $("input#tfa_code_inputtext").val().length) {
- $(".tfa_error_text.30442").show();
- var n = w.errTemplate.format(L.SessionId ? Util.htmlEncode(L.SessionId) : "", L.CorrelationId ? Util.htmlEncode(L.CorrelationId) : "", (new Date).toISOString());
- $("#tfa_error_text").html(n).show(), E()
- }
- }, Constants.TWOFA_AUTH_TIMEOUT), E();
- else {
- x = 0;
- var o = {
- Method: "EndAuth",
- SessionId: e.SessionId,
- FlowToken: e.FlowToken,
- Ctx: e.Ctx,
- AuthMethodId: e.AuthMethodId,
- PollCount: x + 1,
- LastPollStart: D,
- LastPollEnd: k
- };
- E(), s(JSON.stringify(o))
- }
- } else _(e)
- }
- function m(e) {
- return k = (new Date).getTime(), L.SessionId != e.SessionId ? (_(e), void(y = !1)) : void("true" == e.Result ? p(e) : "true" == e.Retry ? r(e) : (_(e), "SMSAuthFailedMaxAllowedCodeRetryReached" === e.ResultValue && h(), y = !1))
- }
- function h() {
- $("#tfa_code_container").hide(), $("#tfa_results_container").hide(), $("#tfa_pin_results_container").hide(), $("#tfa_pin_container").hide(), $("#tfa_remember_my_device_container").hide(), $("#tfa_signin_button").hide()
- }
- function p(e) {
- if (O) {
- var t = n.createElement("form");
- t.setAttribute("method", "post"), t.setAttribute("action", Constants.StrongAuth.SASControllerProcessAuthUrl);
- var a = n.createElement("input");
- a.setAttribute("type", "hidden"), a.setAttribute("name", "request"), a.setAttribute("value", e.Ctx), t.appendChild(a);
- var i = n.createElement("input");
- if (i.setAttribute("type", "hidden"), i.setAttribute("name", "flowToken"), i.setAttribute("value", e.FlowToken), t.appendChild(i), o && o.canary) {
- var r = n.createElement("input");
- r.setAttribute("type", "hidden"), r.setAttribute("name", "canary"), r.setAttribute("value", o.canary), t.appendChild(r)
- }
- var s = n.createElement("input");
- s.setAttribute("type", "hidden"), s.setAttribute("name", "mfaAuthMethod"), s.setAttribute("value", e.AuthMethodId), t.appendChild(s);
- var d = $("#cred_remember_mfa_checkbox").attr("checked") ? !0 : !1,
- _ = n.createElement("input");
- _.setAttribute("type", "hidden"), _.setAttribute("name", "rememberMFA"), _.setAttribute("value", d), t.appendChild(_);
- var c = n.createElement("input");
- c.setAttribute("type", "hidden"), c.setAttribute("name", "mfaLastPollStart"), c.setAttribute("value", D), t.appendChild(c);
- var l = n.createElement("input");
- l.setAttribute("type", "hidden"), l.setAttribute("name", "mfaLastPollEnd"), l.setAttribute("value", k), t.appendChild(l), n.body.appendChild(t), t.submit()
- }
- }
- function C(e, t) {
- if (e.length !== Constants.TWOFA_OTP_MAX_LEN || Math.ceil(e) !== Math.floor(e) || $("#tfa_pin_container").length && (0 === t.length || Math.ceil(t) !== Math.floor(t))) {
- $("#tfa_client_side_error_text").show();
- var n = w.errTemplate.format(L.SessionId ? Util.htmlEncode(L.SessionId) : "", L.CorrelationId ? Util.htmlEncode(L.CorrelationId) : "", (new Date).toISOString());
- return $("#tfa_error_text").html(n).show(), E(), !1
- }
- return !0
- }
- function f(e) {
- var t = w.errTemplateWithErrorCode.format(0 | e.ErrCode, e.SessionId ? Util.htmlEncode(e.SessionId) : "", e.CorrelationId ? Util.htmlEncode(e.CorrelationId) : "", (new Date).toISOString());
- $("#tfa_error_text").html(t).show(), E()
- }
- function E() {
- var e = $("#tfa_outer_list_container").height();
- $(".cred").css("min-height", e)
- }
- function S() {
- setTimeout(User.startAnimation, 0), I = setInterval(User.startAnimation, Constants.TWOFA_ANIMATION_INTERVAL), e()
- }
- function T() {
- if (B && B.abort(), clearInterval(b), clearInterval(I), O = !1, R = !1, M = "", $("#tfa_remember_my_device_container").hide(), $("#redirect_dots_animation").hide(), $(".tfa_results_text").hide(), $("#tfa_phone_text").hide(), $("#tfa_title_text").hide(), $(".tfa_error_text").hide(), $("#tfa_options_link_container").hide(), $("#tfa_code_container").hide(), $("#tfa_pin_container").hide(), $("#tfa_button_container").hide(), $("#header_text").text(Constants.TWOFA_HEADER_TEXT_SELECTMETHOD), $("#tfa_client_side_error_text").hide(), $("#tfa_options_title_text").show(), Constants.IS_HOLOGRAPHIC) {
- $("#tfa_back_button").addClass("no_display").parent().addClass("buttonGroup_fullWidth"), Util.HoloNavigationStack.push({
- name: "options",
- show: T
- });
- var e = $("#tfa_options_list").empty();
- $.each(N.Methods, function(t, n) {
- n.AuthMethodDeviceId && t < Constants.TWOFA_MAXMETHODS && e.append($("<option></option>").text(n.MethodDisplayString).val(t))
- }), e.parent().removeClass("no_display")
- } else $("#tfa_options_list").show(), $("button#tfa_signin_button").prop("disabled", !0), $.each(N.Methods, function(e, t) {
- if (t.AuthMethodDeviceId && e < Constants.TWOFA_MAXMETHODS) {
- var n = $("#link" + e);
- n.text(t.MethodDisplayString), n.attr("href", "#"), n.off("click").on("click", function() {
- w.beginAltAuth(e)
- }), $("#listItem" + e).show();
- var o = $("#link_icon" + e).removeClass("voice sms device");
- o.addClass(t.AuthMethodId && -1 !== t.AuthMethodId.indexOf("Voice") ? "voice" : t.AuthMethodId && -1 !== t.AuthMethodId.indexOf("SMS") ? "sms" : "device")
- }
- })
- }
- function v() {
- $("#compromised_landing_container").hide(), $("#compromised_landing_action").hide(), Constants.StrongAuth && S(), $("#tfa_signin_button").show(), $("#tfa_outer_list_container").show()
- }
- function A() {
- var e = $("#fmProofup").attr("action"),
- t = -1 == e.indexOf("?") ? "?" : "&";
- $("#login_workload_logo_image").length > 0 && ($("#login_workload_logo_image").attr("src").toLowerCase().indexOf("office365") >= 0 ? $("#fmProofup").attr("action", e + t + "BrandContextID=O365") : $("#login_workload_logo_image").attr("src").toLowerCase().indexOf("/azure/logo.png") >= 0 && $("#fmProofup").attr("action", e + t + "BrandContextID=Azure")), n.fmProofup.submit()
- }
- var w = this,
- I = 0,
- b = 0,
- x = 0,
- D = 0,
- k = 0,
- O = !0,
- U = Constants.TWOFA_POLLING_INTERVAL,
- R = !1,
- y = !1,
- L = null,
- M = "",
- N = null,
- B = null,
- P = null,
- F = null;
- w.beginAltAuth = function(e) {
- $("#redirect_dots_animation").show(), $("#tfa_phone_text").show(), $("#tfa_title_text").show(), $(".tfa_error_text").show(), $("#tfa_options_link_container").show(), $(".tfa_error_text").hide(), $("#tfa_options_title_text").hide(), $("#tfa_remember_my_device_container").show(), $("#header_text").text(Constants.TWOFA_HEADER_TEXT_PROTECTACCOUNT);
- var t = N.Methods[e].AuthMethodId.toUpperCase();
- (0 === t.indexOf("ONEWAYSMS") || 0 === t.indexOf("PHONEAPPOTP")) && ($("#tfa_code_container").show(), $("#tfa_results_container").show(), $("#tfa_pin_results_container").show(), $("#tfa_pin_container").show()), Constants.IS_HOLOGRAPHIC ? ($("#tfa_options_list").parent().addClass("no_display"), $("#tfa_back_button").removeClass("no_display").parent().removeClass("buttonGroup_fullWidth")) : $("#tfa_options_list").hide(), O = !0, y = !1, User.startAnimation(), I = setInterval(User.startAnimation, Constants.TWOFA_ANIMATION_INTERVAL), a(N.Methods[e])
- }, w.submitCode = function() {
- if ($(".tfa_error_text").hide(), !y) {
- var e = $("input#tfa_code_inputtext").val();
- e = $.trim(e);
- var t = "";
- if ($("#tfa_pin_container").length && (t = $("input#tfa_pin_inputtext").val(), t = $.trim(t)), C(e, t)) {
- e += t, y = !0, $("#tfa_client_side_error_text").hide(), x = 0;
- var n = {
- Method: "EndAuth",
- FlowToken: P,
- SessionId: L.SessionId,
- Ctx: F,
- AuthMethodId: L.AuthMethodId,
- AdditionalAuthData: e,
- LastPollStart: D,
- LastPollEnd: k
- };
- $("#redirect_dots_animation").show(), setTimeout(User.startAnimation, 0), I = setInterval(User.startAnimation, Constants.TWOFA_ANIMATION_INTERVAL), d(JSON.stringify(n))
- }
- }
- }, w.init = function() {
- var e = $("meta[name=PageID]").attr("content"),
- n = "strongauthcheck.2.0" === e,
- o = "proofup.2.0" === e;
- if (n || o) {
- if ($("#switch_user_link").length) {
- var a = $("#switch_user_link").attr("href"),
- i = /^\d+$/,
- r = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
- a = Util.AddQSParamIfNotExists(a, "id", i), a = Util.AddQSParamIfNotExists(a, "lc", i), a = Util.AddQSParamIfNotExists(a, "username", r), a = Util.AddQSParamIfNotExists(a, "ru"), a = Util.AddQSParamIfNotExists(a, "whr"), a = Util.AddQSParamIfNotExists(a, "wreply"), a = Util.AddQSParamIfNotExists(a, "wauth"), $("#switch_user_link").attr("href", a)
- }
- $("#show-options").on("click", function(e) {
- e.preventDefault(), T()
- }), $("#compromised_landing_action").on("click", function(e) {
- e.preventDefault(), v()
- }), Constants.IS_CXH_REQUEST && o ? ($("#tfa_signin_button").text(t.GetString("Mfa.SetItUpNow")), $("button#tfa_signin_button").prop("disabled", !1), $("#tfa_signin_button").on("click", A)) : (Constants.IS_HOLOGRAPHIC ? ($("#tfa_back_button").on("click", Util.OnBack), $("#tfa_signin_button").on("click", Util.OnNext), Util.HoloNavigationStack.push({
- name: "finalBack",
- show: Util.CancelCxhFlow
- })) : ($("#tfa_setupnow_button").on("click", A), $("#tfa_signin_button").on("click", w.submitCode)), n && ($("#redirect_dots_animation").show(), $("#redirect_dots_animation").css("visibility", "visible"), User.setupCredFieldsWithPlaceHolder(), Constants.HAS_LANDING_PAGE || S()))
- }
- }
- }
- var t = window,
- n = t.document,
- o = t.$Config;
- t.StrongAuthCheck = new e, $Do.when("doc.load", t.StrongAuthCheck.init)
- }(), MSLogin.TenantBranding = {
- IsDynamicBrandingEnabled: function() {
- return $.browser.chrome && Support.IsBrowserVersionGreaterOrEqual($.browser.version, "42") || $.browser.webkit && Support.IsBrowserVersionGreaterOrEqual($.browser.version, "537.4") || $.browser.mozilla && Support.IsBrowserVersionGreaterOrEqual($.browser.version, "5.0") || $.browser.msie && Support.IsBrowserVersionGreaterOrEqual($.browser.version, "8.0") || $.browser.msie && window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf("Trident") > 0 ? !0 : !1
- },
- IsShowingDynamicBranding: function() {
- return TenantBranding.IsDynamicBrandingEnabled() && Context.TenantBranding.enabled
- },
- IsShowingDynamicWorkloadBranding: function() {
- return TenantBranding.IsShowingDynamicBranding() && Context.TenantBranding.workload_branding_enabled
- },
- IsShowingDynamicWhrBranding: function() {
- return TenantBranding.IsShowingDynamicBranding() && Support.isDefined(Context.TenantBranding.whr_key) && Context.TenantBranding.whr_key == Context.TenantBranding.key
- },
- HideAndRemoveSlideAnimation: function(e) {
- e.hide(), e.removeClass("slide")
- },
- RefreshDomainState: function(e) {
- TenantBranding.IsDynamicBrandingEnabled() && Support.checkIfDomainsMatch(e, Context.TenantBranding.prev_user) && Support.isDefined(Context.TenantBranding.key) && TenantBranding.PerformDynamicBranding(TenantBranding.IsShowingDynamicWhrBranding() ? Context.TenantBranding.prev_key : Context.TenantBranding.key)
- },
- RemoveAllOldElements: function() {
- var e = $(".workload_text_old");
- e.remove();
- var t = $(".workload_img_old");
- t.hide(), t.remove(), $("#boiler_plate_old").remove(), void 0 != Constants.DEFAULT_BOILERPLATE_TEXT && Constants.DEFAULT_BOILERPLATE_TEXT.length > 0 && ($("#boiler_plate_header").remove(), $("#boiler_plate").remove(), TenantBranding.AddBoilerPlateText(Constants.DEFAULT_BOILERPLATE_TEXT, Constants.DEFAULT_BOILERPLATE_HEADER))
- },
- ConfigureElementsForDelayedRemoval: function() {
- var e = $("#background_background_image").clone();
- e.attr("id", "background_background_image_old").removeClass("slide"), $("#background_branding_container").prepend(e), $("#background_background_image").hide(), $(".workload_img").addClass("workload_img_old").removeClass("workload_img"), $(".workload_img_text").addClass("workload_text_old").removeClass("workload_text")
- },
- ResetOnLoadContext: function() {
- Background.background_resized = !1, Context.TenantBranding.has_logo = !1, Context.TenantBranding.has_background_img = !1, Context.on_load_image_background_loaded = !1, Logo.logo_image_loaded = !1
- },
- ResetDynamicBrandingContext: function() {
- "undefined" != typeof window.LoginTenantBranding && (Context.TenantBranding.prev_obj = window.LoginTenantBranding, window.LoginTenantBranding = null), Context.TenantBranding.prev_key = Context.TenantBranding.key, Context.TenantBranding.prev_user = Context.TenantBranding.user, Context.TenantBranding.applied = !1, Context.TenantBranding.has_logo = !1, Context.TenantBranding.has_background_img = !1
- },
- BackupWorkloadBranding: function() {
- if (!Context.TenantBranding.workload_branding_saved && !Context.TenantBranding.default_page) {
- Context.TenantBranding.workload_branding_saved = !0, Context.TenantBranding.workload_branding_illustration = $("#background_background_image").clone(), Context.TenantBranding.workload_branding_illustration_alt = $("#background_background_image").attr("alt"), Context.TenantBranding.workload_branding_logo = $("#login_workload_logo_image").clone(), Context.TenantBranding.workload_branding_logo_text = $("#login_workload_logo_text").clone(), Context.TenantBranding.workload_branding_logo_alt = $("#login_workload_logo_image").attr("alt"), Context.TenantBranding.workload_branding_color = $("html").css("background-color"), Context.TenantBranding.workload_branding_footer_height = $("#footer_links_container").height(), TenantBranding.BackupElementHeights();
- var e = Context.TenantBranding.cred_height;
- Context.TenantBranding.workload_branding_height = e
- }
- },
- ShouldShowWhrBranding: function() {
- return TenantBranding.IsShowingDynamicBranding() && Support.isDefined(Context.TenantBranding.whr_key) ? Context.TenantBranding.whr_key != Context.TenantBranding.key || TenantBranding.IsShowingDynamicWorkloadBranding() : !1
- },
- RemoveTenantBrandingAndApplyWorkload: function() {
- TenantBranding.IsDynamicBrandingEnabled() && (Support.hideClientMessages(), Context.TenantBranding.enabled = !0, Support.isDefined(Context.TenantBranding.whr_key) ? TenantBranding.ShouldShowWhrBranding() && TenantBranding.PerformDynamicBranding(Context.TenantBranding.whr_key) : TenantBranding.IsShowingDynamicWorkloadBranding() || TenantBranding.ApplyWorkloadBranding())
- },
- RemoveWorkloadBranding: function() {
- TenantBranding.BackupWorkloadBranding(), TenantBranding.ConfigureElementsForDelayedRemoval(), TenantBranding.ResetOnLoadContext()
- },
- PerformDynamicBranding: function(e) {
- if (TenantBranding.IsDynamicBrandingEnabled() && !Constants.FORCED_SIGN_IN) {
- if (void 0 == Context.TenantBranding.store.Get(e) && (e = null), TenantBranding.IsShowingDynamicBranding() && null != Context.TenantBranding.key && Context.TenantBranding.key == e && !TenantBranding.IsShowingDynamicWorkloadBranding()) return;
- Instrument.tenant_branding_getuserrealm_time = Instrument.home_realm_load_time, void 0 == e || null == e || null != Context.TenantBranding.key && !TenantBranding.IsShowingDynamicWorkloadBranding() ? void 0 != e && null != e && null != Context.TenantBranding.key && e != Context.TenantBranding.key ? (Instrument.has_dynamic_tenant_branding = !0, Instrument.tenant_branding_number_of_switches++, Context.TenantBranding.default_page = !1, Context.TenantBranding.enabled = !0, TenantBranding.ReplaceTenantBranding(e)) : null == Context.TenantBranding.key || void 0 != e && null != e && "" != e || (Instrument.has_dynamic_tenant_branding = !0, Instrument.tenant_branding_number_of_switches++, Context.TenantBranding.default_page = !1, Context.TenantBranding.enabled = !0, TenantBranding.ApplyWorkloadBranding()) : (Context.TenantBranding.default_page = !1, Context.TenantBranding.enabled = !0, Instrument.has_dynamic_tenant_branding = !0, Instrument.tenant_branding_number_of_switches++, Util.debug_console("workload branding -> tenant branding"), TenantBranding.RemoveWorkloadBranding(), TenantBranding.GetBrandingInfo(e))
- }
- },
- getTenantBrandingContext: function(e, t) {
- var n = {},
- o = [
- ["BannerLogo", !0, Constants.DEFAULT_LOGO],
- ["TileLogo", !0, ""],
- ["TileDarkLogo", !0, ""],
- ["Illustration", !0, Constants.DEFAULT_ILLUSTRATION],
- ["BackgroundColor", !1, Constants.DEFAULT_BACKGROUND_COLOR],
- ["CompanyName", !1, ""],
- ["UserIdLabel", !1, Constants.USERNAME_HINT_TEXT],
- ["BoilerPlateText", !1, ""],
- ["KeepMeSignedInDisabled", !1, !1]
- ];
- return $.each(o, function(o, a) {
- var i = a[0],
- r = a[1];
- n[i] = e[t] && e[t][i] ? e[t][i] : e[0] && e[0][i] ? e[0][i] : a[2], "string" == typeof n[i] && r && (n[i] = n[i].toLowerCase())
- }), n
- },
- formatTenantBrandingData: function(e) {
- var t = {};
- return $.each(e, function(e, n) {
- var o = n.Locale;
- o >= 0 && (t[o] = n)
- }), t
- },
- processTenantBranding: function(e) {
- null != e && (Instrument.has_tenant_branding = !0, e = TenantBranding.formatTenantBrandingData(e), Context.TenantBranding.info = e, Context.TenantBranding.info_context = TenantBranding.getTenantBrandingContext(e, Constants.LCID), TenantBranding.IsShowingDynamicBranding() || (TenantBranding.ShowBrandedBoilerPlate(), TenantBranding.UpdateLoginCtaText()), TenantBranding.ShowBrandedLogo(), TenantBranding.ShowBrandedIllustration(), Instrument.tenant_branding_process_end_time = Util.now())
- },
- BackupElementHeights: function() {
- Context.TenantBranding.footer_height_saved || (Context.TenantBranding.footer_height_saved = !0, Context.TenantBranding.footer_height = $("#footer_links_container").height()), Context.TenantBranding.cred_height_saved || (Context.TenantBranding.cred_height_saved = !0, Context.TenantBranding.cred_height = $(".cred").height())
- },
- AddBoilerPlateText: function(e, t) {
- var n, o;
- Constants.IS_HOLOGRAPHIC ? (n = $("<label/>").attr("id", "boiler_plate").text(Util.htmlDecode(e)), $(".footer_inner_container").html(n)) : Constants.IS_INCLUSIVEOOBE ? (o = $("<p/>").attr("id", "boiler_plate_header").addClass("secondary-text").text(Util.htmlDecode(t)), n = $("<p/>").attr("id", "boiler_plate").addClass("secondary-text").text(Util.htmlDecode(e)), $(".boilerplate_header_location").append(o).append(n)) : (o = $("<p/>").attr("id", "boiler_plate_header").attr("tabindex", "-1").addClass("boilerplate_header").text(Util.htmlDecode(t)), $(".boilerplate_header_location").before(o), n = $("<p/>").attr("id", "boiler_plate").attr("tabindex", "-1").addClass("tinytext").text(Util.htmlDecode(e)), $(".footer_inner_container").before(n))
- },
- ShowBrandedBoilerPlate: function() {
- $("#boiler_plate").remove(), TenantBranding.BackupElementHeights(), $("#boiler_plate_header").remove();
- var e = Context.TenantBranding.info_context;
- TenantBranding.AddBoilerPlateText(e.BoilerPlateText || Constants.DEFAULT_BOILERPLATE_TEXT, null != e.BoilerPlateText ? Constants.BOILERPLATE_HEADER : Constants.DEFAULT_BOILERPLATE_HEADER), $("#boiler_plate").show(), TenantBranding.ShouldFadeInTenantBranding() && ($("#boiler_plate").removeClass("slide"), $("#boiler_plate").addClass("slide"));
- var t = 50 + $("#boiler_plate").height() + 40;
- $(".login_inner_container").css("margin-bottom", "-" + t + "px"), $(".login_footer_container").height(t), $(".push").height(t)
- },
- ShowBrandedLogo: function() {
- var e = Context.TenantBranding.info_context,
- t = Constants.IS_CXH_REQUEST ? Constants.USE_DARK_TILE_LOGO ? e.TileDarkLogo || e.TileLogo : e.TileLogo : e.BannerLogo;
- void 0 != t && "" != t && (t += "?ts=" + Context.tenant_branding_ts), User.UpdateLogo(t, Constants.DEFAULT_LOGO_ALT), $("#login_workload_logo_text").hide()
- },
- ShowBrandedIllustration: function() {
- var e = Context.TenantBranding.info_context,
- t = e.Illustration;
- void 0 != t && "" != t && (t += "?ts=" + Context.tenant_branding_ts), User.UpdateBackground(t, e.BackgroundColor)
- },
- StoreBrandingInfo: function(e, t) {
- Context.TenantBranding.store.Add(e, t)
- },
- GetBrandingInfo: function(e) {
- Instrument.tenant_branding_start_time = Util.now(), Context.tenant_branding_ts = "", Context.TenantBranding.key = e, Context.TenantBranding.default_page && (Context.TenantBranding.default_key = e), Context.TenantBranding.applied = !0, Context.TenantBranding.workload_branding_enabled = !1;
- var t = Context.TenantBranding.store.Get(e);
- void 0 != t && (window.LoginTenantBranding = t, TenantBranding.ApplyTenantBranding())
- },
- ApplyTenantBranding: function() {
- "undefined" != typeof window.LoginTenantBranding && (Instrument.tenant_branding_json_end_time = Util.now(), Context.TenantBranding.store.Add(Context.TenantBranding.key, window.LoginTenantBranding), Constants.TENANT_BRANDING = window.LoginTenantBranding), null != Constants.TENANT_BRANDING && "" != Constants.TENANT_BRANDING && (clearInterval(Context.tenant_branding_tid), Context.tenant_branding_tid = null, TenantBranding.processTenantBranding(Constants.TENANT_BRANDING))
- },
- ReplaceTenantBranding: function(e) {
- TenantBranding.RemoveTenantBrandingDelayed(), TenantBranding.GetBrandingInfo(e)
- },
- RemoveTenantBrandingDelayed: function() {
- var e = $("#tenantbrandingscript");
- void 0 != e && null != e && e.remove(), t = $(".workload_img_old"), void 0 != t && null != t && t.remove();
- var t = $(".workload_img");
- void 0 != t && null != t && t.addClass("workload_img_old").removeClass("workload_img");
- var n = $(".workload_text");
- void 0 != n && null != n && n.addClass("workload_text").removeClass("workload_text_old");
- var o = $("#boiler_plate");
- void 0 != o && null != o && o.attr("id", "boiler_plate_old");
- var a = $("#background_background_image").clone();
- a.removeClass("slide"), a.attr("id", "background_background_image_old"), $("#background_branding_container").prepend(a), $("#background_background_image").hide(), TenantBranding.ResetDynamicBrandingContext(), TenantBranding.ResetOnLoadContext(), TenantBranding.showKmsi(), TenantBranding.replaceUsernameHint()
- },
- RemoveTenantBranding: function() {
- var e = $("#tenantbrandingscript");
- void 0 != e && null != e && e.remove(), t = $(".workload_img_old"), void 0 != t && null != t && t.remove();
- var t = $(".workload_img");
- void 0 != t && null != t && t.remove();
- var n = $(".workload_img_text");
- void 0 != n && null != n && n.remove();
- var o = $("#boiler_plate");
- void 0 != o && null != o && (Constants.DEFAULT_BOILERPLATE_TEXT.length > 0 ? ($("#boiler_plate_header").text(Constants.DEFAULT_BOILERPLATE_HEADER), o.text(Constants.DEFAULT_BOILERPLATE_TEXT)) : o.remove(), $(".login_inner_container").css("margin-bottom", "-50px"), $(".push").height(50)), $("#background_background_image").remove(), TenantBranding.ResetDynamicBrandingContext(), TenantBranding.ResetOnLoadContext(), TenantBranding.showKmsi(), TenantBranding.replaceUsernameHint()
- },
- ApplyWorkloadBranding: function() {
- if (Context.TenantBranding.workload_branding_enabled = !0, !Context.TenantBranding.workload_branding_saved || Context.TenantBranding.default_page) TenantBranding.RemoveTenantBrandingDelayed(), User.UpdateLogo(Constants.DEFAULT_LOGO, Constants.DEFAULT_LOGO_ALT), User.UpdateBackground(Constants.DEFAULT_ILLUSTRATION, Constants.DEFAULT_BACKGROUND_COLOR), $("#background_background_image").show(), Background.background_resized = !1, Context.on_load_image_background_loaded = !1, Logo.logo_image_loaded = !1;
- else {
- TenantBranding.RemoveTenantBranding(), Support.isDefined(Context.TenantBranding.workload_branding_illustration) && $("#background_branding_container").prepend(Context.TenantBranding.workload_branding_illustration.clone()), Support.isDefined(Context.TenantBranding.workload_branding_logo) && $(".login_workload_logo_container").append(Context.TenantBranding.workload_branding_logo.clone()), Support.isDefined(Context.TenantBranding.workload_branding_logo_text) && $(".login_workload_logo_container").append(Context.TenantBranding.workload_branding_logo_text.clone()), User.RegisterOnLoadImage();
- var e = Context.TenantBranding.footer_height;
- e > 0 && ($("#footer_links_container").css("height", e + "px"), $("#footer_links_container").css("margin-top", "-" + e + "px")), $("#background_page_overlay").css("background-color", Constants.DEFAULT_BACKGROUND_COLOR), $("#background_background_image").css("background-color", Constants.DEFAULT_BACKGROUND_COLOR), $("#background_branding_container").css("background-color", Constants.DEFAULT_BACKGROUND_COLOR), $("html").css("background-color", Constants.DEFAULT_BACKGROUND_COLOR), $("#background_background_image").removeClass("slide"), $(".workload_img").removeClass("slide"), $(".workload_img_text").removeClass("slide"), $("#background_background_image").hide(), $("#background_background_image").show(), $("#background_page_overlay").hide(), $(".workload_img").show(), $(".workload_img_text").show(), $("#background_background_image").addClass("slide"), $(".workload_img").addClass("slide"), $(".workload_img_text").addClass("slide"), Background.background_resized = !0, Context.on_load_image_background_loaded = !0, Logo.logo_image_loaded = !0
- }
- Context.TenantBranding.cred_height && $(".cred").css("min-height", Context.TenantBranding.cred_height), Support.isDefined(Context.TenantBranding.workload_branding_login_cta_text) && $("#login_cta_text").text(Context.TenantBranding.workload_branding_login_cta_text)
- },
- ShouldFadeInTenantBranding: function() {
- return TenantBranding.IsDynamicBrandingEnabled() && (null != Context.TenantBranding.key || Context.TenantBranding.workload_branding_saved) && !Context.TenantBranding.default_page
- },
- UpdateLoginCtaText: function() {
- if ("i5030.2.0" == $("meta[name=PageID]").attr("content")) {
- ("" == Context.TenantBranding.workload_branding_login_cta_text || null == Context.TenantBranding.workload_branding_login_cta_text) && (Context.TenantBranding.workload_branding_login_cta_text = $("#login_cta_text").text());
- var e = $(".workload_img"),
- t = !1;
- if (Support.isDefined(e)) {
- var n = null;
- n = e.attr("src"), Support.isDefined(n) && Support.isDefined(Constants.DEFAULT_LOGO) && (t = n.toLowerCase().indexOf(Constants.DEFAULT_LOGO.toLowerCase()) > -1)
- }
- Constants.DYNAMIC_BRANDING_CTA_ENABLED && !t && $("#login_cta_text").text(Constants.PARTNER_NAME)
- }
- },
- onLoadLogoHelper: function() {
- Logo.logo_image_loaded = !0;
- var e = $(".workload_img");
- TenantBranding.HideAndRemoveSlideAnimation(e);
- var t = $(".workload_text");
- if (TenantBranding.HideAndRemoveSlideAnimation(t), Context.TenantBranding.has_logo ? (e.show(), Instrument.logo_image_loaded = !0) : (t.show(), Instrument.logo_image_loaded = !1), Instrument.logo_image_load_time = Util.now() - Instrument.logo_image_start, Instrument.tenant_branding_right_side_time = Util.now() - Instrument.tenant_branding_start_time, TenantBranding.RemoveAllOldElements(), TenantBranding.IsShowingDynamicWorkloadBranding() || TenantBranding.ShowBrandedBoilerPlate(), TenantBranding.UpdateLoginCtaText(), TenantBranding.ShouldFadeInTenantBranding() && (e.addClass("slide"), t.addClass("slide")), Context.on_load_image_background_loaded) TenantBranding.onLoadImageHelper();
- else {
- $("#background_background_image_old").hide().remove();
- var n = Context.TenantBranding.background_color;
- $("#background_page_overlay").css("background-color", n), $("#background_branding_container").css("background-color", n), $("html").css("background-color", n), $("#background_background_image").css("background-color", n), $("#background_background_image").hide()
- }
- TenantBranding.setUserIdHintAndKmsi(), Util.debug_console("onLoadLogo: Logo successfully loaded.")
- },
- setUserIdHintAndKmsi: function() {
- null != Context.TenantBranding.info_context && (Context.TenantBranding.info_context.KeepMeSignedInDisabled && !TenantBranding.IsShowingDynamicWorkloadBranding() ? ($("#cred_kmsi_container").hide(), $("#cred_keep_me_signed_in_checkbox").attr("checked", !1)) : TenantBranding.showKmsi(), null == Context.TenantBranding.info_context.UserIdLabel || 0 == Context.TenantBranding.info_context.UserIdLabel.length || TenantBranding.IsShowingDynamicWorkloadBranding() ? TenantBranding.replaceUsernameHint() : (TenantBranding.setUsernameHint(Context.TenantBranding.info_context.UserIdLabel), Context.TenantBranding.username_hint_changed = !0))
- },
- showKmsi: function() {
- $("#cred_kmsi_container").show()
- },
- replaceUsernameHint: function() {
- Context.TenantBranding.username_hint_changed && (TenantBranding.setUsernameHint(Constants.USERNAME_HINT_TEXT), Context.TenantBranding.username_hint_changed = !1)
- },
- setUsernameHint: function(e) {
- var t = Util.htmlDecode(e);
- Support.is_placeholder_supported() ? $("#cred_userid_inputtext").attr("placeholder", t) : $("#cred_userid_inputtext_placeholder_span").text(t), $("#cred_userid_inputtext").attr("alt", t)
- },
- onLoadImageHelper: function() {
- if (Logo.logo_image_loaded) {
- Instrument.tenant_branding_total_time = Util.now() - Instrument.tenant_branding_start_time;
- var e = $("#background_background_image"),
- t = $("#background_page_overlay");
- TenantBranding.HideAndRemoveSlideAnimation(e), $("#background_background_image_old").remove(), t.css("visibility", "visible");
- var n = $("html").css("background-color");
- n = Context.TenantBranding.background_color, t.css("background-color", n), $("#background_branding_container").css("background-color", n), $("html").css("background-color", n), Context.TenantBranding.has_background_img && (e.show(), TenantBranding.ShouldFadeInTenantBranding() && e.addClass("slide"), e.css("background-color", n), t.css("z-index", "-1"), t.hide()), Util.debug_console("TenantBranding OnLoadImage: Background was resized.")
- }
- },
- onLoadImageError: function() {
- TenantBranding.IsShowingDynamicBranding() && (Context.TenantBranding.has_background_img = !1)
- },
- onLoadLogo: function() {
- var e = $("#login_workload_logo_image");
- Util.debug_console("onLoadLogo: Called"), !Logo.logo_image_loaded && User.IsImageLoaded(e) && TenantBranding.onLoadLogoHelper()
- },
- onLoadErrorLogo: function() {
- if (!Logo.logo_image_loaded) {
- User.UpdateLogo("", Constants.DEFAULT_LOGO_ALT);
- var e = $(".workload_img_old");
- e.hide(), e.remove(), Logo.logo_image_loaded = !0, Instrument.logo_image_error = !0
- }
- },
- RestoreDefaultPageBranding: function() {
- "undefined" != typeof Constants.DEFAULT_BRANDING ? Context.TenantBranding.applied && Context.TenantBranding.key == Constants.DEFAULT_BRANDING || TenantBranding.GetBrandingInfo(Constants.DEFAULT_BRANDING) : TenantBranding.RemoveTenantBrandingAndApplyWorkload()
- }
- };
- var TenantBranding = MSLogin.TenantBranding;
- $Do.register("TenantBranding", 0, !0);
- var users = null;
- MSLogin.Tiles = {
- tile_showing_user_cred: !0,
- users: null,
- cred_length_resized: !1,
- showUser: function(e, t, n, o) {
- Tiles.tile_showing_user_cred || ($("#login_user_chooser table").hide(), $(".login_cta_container").css("visibility", "visible"), $("#login_cta_text").show(), $("#tiles_cta_text").hide(), Tiles.updateFirstUserTile(e, t, n), $("#login_user_chooser table:first").show(), $.each(users, function(a, i) {
- i.login.toLowerCase() != e.toLowerCase() || i.isLive !== t && i.domainHint !== n || ("" != i.authUrl || "" != i.domainHint && "undefined" != typeof i.domainHint ? Tiles.showFederatedTileUser(i) : Tiles.showManagedTileUser(i, o))
- }), Context.back_action_stack.AddAction(Constants.CancelAction.FROM_SHOW_USER_TO_TILES), Tiles.tile_showing_user_cred = !0)
- },
- hideDisambiguationScreen: function() {
- $("#cred_kmsi_container").show(), $("#cred_sign_in_button").show(), User.tryShowCancelButton(), $("#recover_container").show(), $("#alternative-identity-providers").show(), $("#disambig-container").hide(), $("#login-splitter-control").hide(), $("#login_user_chooser").empty(), $(".login_user_chooser").hide(), $("#login_user_chooser").hide(), $("#create_msa_account_container").hide()
- },
- showUserLoginPage: function() {
- $(".login_user_chooser").show(), $("#cta_error_message_text").show(), $("div.progress").css("visibility", "hidden"), clearInterval(Context.animationTid), Support.hideClientErrorMessages(), Support.hideClientMessages(), Context.username_state.home_realm_state = Constants.State.NONE, Context.username_state.last_checked_email = Context.username_state.last_checked_email || "", $(".cta_message_text").show(), $("#cred_userid_container").show(), $("#cred_userid_inputtext").show(), $(".login_cred_field_container").show(), $(".login_cred_options_container").show(), $("#cred_userid_inputtext").focus()
- },
- showManagedTileUser: function(e, t) {
- Tiles.disableActiveTile(), Context.post_from_tile = !0, $(".login_cred_container").show(), $(".login_cred_field_container").show(), $(".login_cred_container li").show(), $("#disambig-container").hide(), $("#signin_legend").hide(), $("#cred_userid_inputtext").val(Util.htmlDecode(e.login)), $("#cred_password_container").show(), $(".login_cred_options_container").show(), Context.username_state.enable_guests = !1, $("#guest_hint_text").hide(), $(".guest_redirect_container").hide(), User.tryShowCancelButton(), Util.EnableEmailDiscoveryIfEBD(), $("#cred_sign_in_button").show(), $("#cred_password_inputtext").focus(), t || User.RefreshDomainState()
- },
- showFederatedTileUser: function(e) {
- Context.username_state.home_realm_state = Constants.State.FEDERATED, Context.post_from_tile = !0, Tiles.disableActiveTile(), $("#cred_userid_inputtext").val(Util.htmlDecode(e.login)), $(".login_cred_field_container").show(), $(".login_cred_options_container").show(), $(".login_cred_options_container div.subtext").hide(), $("#cred_sign_in_button").hide(), $("#forget_tile_container").show(), $("#cred_password_container").hide(), $(".login_cta_container").hide(), $("#recover_container").hide(), $("#redirect_cta_text").show(), $("input#cred_password_inputtext").hide(), $("#redirect_company_name_text").empty(), $("#cred_kmsi_container").show(), $("#alternative-identity-providers").hide(), $("div.progress").css("visibility", "visible"), User.startAnimation(), Context.animationTid = setInterval(User.startAnimation, 3500), Context.username_state.enable_progress_bar = !0, Context.username_state.enable_redirect = !0, Context.username_state.enable_guests = !1, Util.EnableEmailDiscoveryIfEBD(), Util.updateRedirectionMessage(e.authUrl), Context.redirect_auth_url = e.authUrl, User.UsernameOnChangeHandler(), User.StartRedirection(!1)
- },
- disableActiveTile: function() {
- $("#login_user_chooser .tile_link:first .user_tile").addClass("disabled_tile"), $("#login_user_chooser .tile_link:first").addClass("disabled_tile"), $("#login_user_chooser .tile_link:first").attr("tabindex", "-1"), $("#login_user_chooser .tile_link:first tr").css("cursor", "default"), $("#login_user_chooser .tile_link:first td.dots > div").hide(), $("#login_user_chooser .tile_link:first td.dots > div").attr("tabindex", "-1"), $(".tile_primary_name").css("cursor", "default"), $(".tile_secondary_name").css("cursor", "default")
- },
- enableActiveTile: function() {
- $("#login_user_chooser .tile_link:first .user_tile").removeClass("disabled_tile"), $("#login_user_chooser .tile_link:first").removeClass("disabled_tile"), $("#login_user_chooser .tile_link:first").attr("tabindex", "1"), $("#login_user_chooser .tile_link:first tr").css("cursor", "pointer"), $("#login_user_chooser .tile_link:first td.dots > div").show(), $("#login_user_chooser .tile_link:first td.dots > div").attr("tabindex", "2"), $(".tile_primary_name").css("cursor", "pointer"), $(".tile_secondary_name").css("cursor", "pointer")
- },
- showOtherOption: function() {
- if (!Tiles.tile_showing_user_cred) {
- if ($("#alternative-identity-providers").show(), EmailDiscovery.IsTilesModeActivated() || EmailDiscovery.ShouldPerformDiscovery()) return Tiles.tile_showing_user_cred = !0, Context.back_action_stack.AddAction(Constants.CancelAction.FROM_EMAILDISCOVERY_START_TO_TILES), EmailDiscovery.Init(), void $("#cred_userid_inputtext").val("");
- Context.back_action_stack.AddAction(Constants.CancelAction.FROM_SHOW_USER_TO_TILES), Context.username_state.enable_progress_bar = !0, User.UsernameOnChangeHandler(), $(".login_cred_container").show(), $(".login_cred_container .windows_cred_block").show(), $(".login_cred_field_container").addClass("show_other"), $(".login_cred_field_container").show(), $("#cred_userid_container").show(), $("#login_user_chooser").hide(), $(".login_cred_options_container").show(), $(".login_cta_container").css("visibility", "visible"), $("#login_cta_text").show(), $("#tiles_cta_text").hide(), $("#forget_tile_container").hide(), $("#cred_sign_in_button").show(), User.tryShowCancelButton(), $("#cred_keep_me_signed_in_checkbox").removeAttr("checked"), $("#cred_userid_inputtext").val(""), $("#cred_userid_inputtext").focus(), Context.username_state.enable_guests = !0, Tiles.tile_showing_user_cred = !0, Support.renderBrowserSpecific()
- }
- },
- CancelTileRedirect: function() {
- $("#cred_password_inputtext").val(""), Context.username_state.last_checked_email = "", Tiles.enableActiveTile(), $("#cred_password_inputtext").val(""), $("#cta_error_message_text").remove(), $(".login_cred_field_container").removeClass("show_other"), $(".login_cred_field_container").hide(), $(".login_cred_options_container").hide(), $(".login_userid_container").hide(), $(".login_cred_options_container div.subtext").show(), $("#create_msa_account_container").hide(), $("#cred_sign_in_button").show(), $("#cred_kmsi_container").show(), $("#forget_tile_container").show(), User.tryShowCancelButton(), Tiles.tile_showing_user_cred = !1, Support.hideClientErrorMessages(), User.CancelRedirect(), $("#login_user_chooser").empty(), Tiles.drawUsers()
- },
- getStringTileID: function(e, t) {
- var n;
- return void 0 == e.id ? (n = Util.htmlDecode(e.login), n = n.replace(/[@\. '#!]/g, "_"), (e.isLive || "msa" === e.domainHint) && (n += "-live"), t && (n = "use_another_account"), n = n.toLowerCase()) : n = e.id, n
- },
- drawTile: function(e, t, n) {
- var o = e.name,
- a = e.login,
- i = e.name,
- r = e.login,
- s = null,
- d = null,
- _ = e.sessionID ? e.sessionID : "";
- "" === o && "" !== a && (o = a, i = r, a = r = ""), o.toLowerCase() == a.toLowerCase() && (a = r = ""), e.isLive ? (s = Constants.MSA_ACCOUNT_TILE_ALT_TEXT.replace("{0}", o), d = Constants.MSA_ACCOUNT_IMG_ALT_TEXT) : (s = Constants.AAD_ACCOUNT_TILE_ALT_TEXT.replace("{0}", o), d = e.domainHint ? e.domainHint : Constants.AAD_ACCOUNT_IMG_ALT_TEXT);
- var c = void 0 == e.ignore_length || 0 == e.ignore_length;
- (!c || Util.htmlDecode(o).length < Constants.MAX_TILE_TEXT_LENGTH) && (i = ""), (!c || Util.htmlDecode(a).length < 1.6 * Constants.MAX_TILE_TEXT_LENGTH) && (r = "");
- var l = !1,
- u = "",
- g = "",
- m = null;
- $("meta[name=PageID]").attr("content").indexOf("reauth") >= 0 ? (l = !0, u = "<div/>", g = "alt") : e.isWindows ? (u = "<a />", g = "href", m = e.sessionID && e.isSigned ? function() {
- Util.SetRoutingCookie(Util.htmlDecode(e.login));
- var t = Constants.BASE_URL + $.param({
- sessionId: e.sessionID,
- ctx: Constants.CONTEXT
- });
- User.Redirect(t)
- } : function() {
- Util.SetRoutingCookie(Util.htmlDecode(e.login)), window.WindowsBrowserSso.LoginWindowsUser(e.link, Tiles.getStringTileID(e, !1))
- }) : Context.email_discovery_mode ? (u = "<a/>", g = "href", m = e.isLive ? function() {
- Context.email_discovery_easi_user = !0, Instrument.email_discovery_splitter_choice = EmailDiscovery.WorkflowStates.MSA, EmailDiscovery.LoginMSOAccount()
- } : function() {
- Instrument.email_discovery_splitter_choice = EmailDiscovery.WorkflowStates.AAD, EmailDiscovery.LoginAADAccount()
- }, s = e.name, d = e.name) : "other" == e.link ? (u = "<a/>", g = "href", m = Tiles.showOtherOption, s = e.name, d = e.name) : e.isSigned ? (u = "<a />", g = "href", m = Constants.IS_MSA_FED_SUPPORTED && e.isLive && !Constants.IS_LOGOUT_REQUEST ? User.GetRedirectAction(Constants.MSA_AUTH_URL, Constants.appRedirectUrl, Constants.msaRedirErrorParams, Util.htmlDecode(e.login)) : function() {
- Util.SetRoutingCookie(Util.htmlDecode(e.login));
- var t = Constants.BASE_URL + $.param({
- sessionId: e.sessionID,
- ctx: Constants.CONTEXT
- });
- User.Redirect(t)
- }) : "" != e.link ? (u = "<a/>", g = "href", m = function() {
- Tiles.showUser(e.link, e.isLive, e.domainHint)
- }) : (u = "<div/>", g = "alt");
- var h = "other" == e.link || Context.email_discovery_mode || l || n || !1,
- p = Tiles.getStringTileID(e, h),
- C = this.generateUserTileHtml(Util.htmlEncode(p), _, t, d, o, i, a, r, h ? null : e.isSigned ? e.isWindows ? Constants.CONNECTEDTOWINDOWS : Constants.SIGNEDIN : Constants.CLICKTOSIGNIN, h || e.isWindows || Constants.IS_LOGOUT_REQUEST ? null : e.isSigned ? "signedin" : "signedout", e.isWindows, e.login);
- return $("#login_user_chooser").append($(u).attr("id", p + "_link").attr("data-session-id", _).attr(g, "#").addClass("tile_link").addClass("tooltip").click(m).append(C)), $("#" + p + "_link").each(function(e, t) {
- t.setAttribute("aria-label", Util.htmlDecode(s))
- }), $("#" + p + "_menulink").keydown(function(e) {
- var t = $(this).attr("data-ref"),
- n = $("#" + t + "-dropdown");
- switch (e.which) {
- case 32:
- case 13:
- $(this).click(), e.preventDefault();
- break;
- case 27:
- n.hide()
- }
- }).click(function(e) {
- e.preventDefault(), e.stopPropagation();
- var t = $(this).attr("data-ref"),
- n = $(this).attr("data-session-id"),
- o = $("#" + t + "-dropdown"),
- a = $(".dropdownPanel");
- if (o.is(":visible")) a.hide();
- else {
- var i = $(this).position();
- i && (a.hide(), o.removeClass("hidden").removeAttr("aria-hidden").css({
- left: i.left - o.width() + 20 + "px",
- top: i.top + 15 + "px"
- }).show(), o.find("li").removeAttr("aria-hidden").attr("data-session-id", n).attr("tabindex", "3").show(), $("#login_panel").one("click", function() {
- a.hide()
- }))
- }
- }), p + "_link"
- },
- drawUsers: function() {
- Tiles.users || (Tiles.users = users = []), Tiles.users.length > 1 || 1 === Tiles.users.length && "other" != Tiles.users[0].link ? ($(".login_cta_container").css("visibility", "visible"), $("#login_cta_text").hide(), $("#tiles_cta_text").show(), $(".login_cred_container li").hide(), $(".login_cred_container .windows_cred_block").hide(), $("#login_user_chooser").show(), $("#cred_userid_container").hide(), $("#switch_user_container").hide(), Tiles.drawUserTiles()) : Tiles.showOtherOption()
- },
- drawUserTiles: function() {
- Tiles.cred_length_resized = !0;
- var e = "";
- if ($.each(users, function(t, n) {
- e = Tiles.getUserImage(n);
- var o = "";
- if ("other" == n.link || t < Constants.MAX_USER_TILES || Context.email_discovery_mode) {
- var a = !Constants.IS_MSA_FED_SUPPORTED && n.isLive;
- o = Tiles.drawTile(n, e, a)
- }
- "" != o && 0 == t && $("#" + o).focus()
- }), Tiles.tile_showing_user_cred = !1, Context.username_state.enable_guests = !0, !Tiles.cred_length_resized) {
- var t = $(".cred").height();
- t += $(".login_user_chooser").height(), $(".cred").css("min-height", t), Tiles.cred_length_resized = !0
- }
- Support.renderBrowserSpecific(), Context.TenantBranding.cred_height ? $(".cred").css("min-height", Context.TenantBranding.cred_height) : $(".cred").css("min-height", "")
- },
- forgetAccount: function() {
- Tiles.tile_showing_user_cred = !1, $("#forget_tile_container").hide(), $("#cred_keep_me_signed_in_checkbox").removeAttr("checked"), $(".login_cta_container").css("visibility", "visible"), $("#login_cta_text").show(), $("#tiles_cta_text").hide(), Util.eraseCookie("MSPPre"), Tiles.CancelTileRedirect(), Tiles.showOtherOption(), User.tryShowCancelButton()
- },
- forceSignIn: function(e) {
- Tiles.disableActiveTile(), Tiles.tile_showing_user_cred = !1, $("#login_cta_text").show(), $("#tiles_cta_text").hide(), $("#login_user_chooser table").hide(), $("#login_user_chooser table:first").show(), $("#switch_user_container").show();
- var t = null;
- $.each(users, function(n, o) {
- o.login.toLowerCase() != e.toLowerCase() || o.isLive || "undefined" != typeof o.domainHint && "" != o.domainHint || (Tiles.showManagedTileUser(o), t = o)
- }), User.tryShowCancelButton(), $("#forget_tile_container").hide();
- var n = !1;
- null != t && null != t.isLive && Tiles.ApplyToEachSavedUsers(function(o) {
- 0 != o[0].length && o[0].toLowerCase() == e.toLowerCase() && o[1] == (t.isLive ? "1" : "0") && (n = !1)
- }), n ? $("#cred_keep_me_signed_in_checkbox").attr("checked", "checked") : $("#cred_keep_me_signed_in_checkbox").removeAttr("checked"), $(".login_cta_container").show()
- },
- hasUserNameQS: function() {
- var e = Util.ExtractQSParam("username") + Util.ExtractQSParam("login_hint");
- return "" != e
- },
- showUserName: function() {
- var e = Util.ExtractQSParam("username");
- "" == e && (e = Util.ExtractQSParam("login_hint")), e = decodeURIComponent(e);
- var t = null,
- n = !1;
- $.each(Tiles.users, function(o, a) {
- Util.htmlDecode(a.login).toLowerCase() != e.toLowerCase() || n || (n = !0, t = a)
- }), n ? (Tiles.showUser(t.login, t.isLive, t.domainHint), $("#cred_password_inputtext").focus()) : (Tiles.showOtherOption(), $("#cred_userid_inputtext").val(e), $("#cred_userid_inputtext").focus())
- },
- showIsNotMe: function(e, t, n) {
- Tiles.drawUsers(), Tiles.showUser(e, t, n), $(".login_cred_container li").hide(), $("#login_user_chooser").show("slow"), $(".login_cta_container").show(), $(".login_cta_container").css("visibility", "visible"), $(".login_cred_options_container").show(), $(".login_cred_options_container div.subtext").hide(), $("#submit_button").hide(), $("#continue_as_user_container").show(), $("#continue_as_user_link").focus(), $("#switch_user_container").show()
- },
- updateContinueAsUserUrl: function(e) {
- var t = $("#continue_as_user_link").attr("href");
- t = t.replace("post.srf", "secure.srf"), t = t.replace(new RegExp("username=[^\\&]*", "gm"), ""), t.indexOf("msoptin-newui") < 0 && (t += "&msoptin-newui"), $("#continue_as_user_link").attr("href", t), t = Util.ExtractQSParam("ru"), "" != t && (t = e, $("#continue_as_user_link").attr("href", t))
- },
- ApplyToEachSavedUsers: function(e) {
- var t = Util.getCookie(Constants.SAVED_USER_COOKIE),
- n = Constants.SAVED_USER_COOKIE_USER_DELIMITER,
- o = Constants.SAVED_USER_COOKIE_INFO_DELIMITER;
- void 0 != t && null != t && "" != t && $.each(t.split(n), function(t, n) {
- if (void 0 != n && null != n && "" != n) {
- var a = n.split(o);
- 3 == a.length && 0 != a[0].length && e(a)
- }
- })
- },
- getUser: function(e, t, n) {
- e = e.toLowerCase();
- var o = null;
- return $.each(Tiles.users, function(a, i) {
- (i.login.toLowerCase() == e && (i.isLive === t || i.domainHint === n) || i.sessionID == e) && (o = i)
- }), o
- },
- forgetRememberedUser: function(e) {
- var t = $(this).parent().attr("data-session-id");
- Util.SetRoutingCookie($(this).parent().attr("data-upn")), Support.isDefined(t) ? $.ajax({
- headers: {
- Accept: "application/json"
- },
- url: Constants.forgetUrl,
- dataType: "json",
- data: {
- sessionId: encodeURI(t)
- },
- success: function(e) {
- Tiles.UpdateUsers(e)
- },
- error: function(e, t, n) {
- Support.showClientError(n)
- },
- timeout: 2e3
- }) : Util.debug_console("sessionId is not defined"), e.preventDefault()
- },
- indexOfPropValue: function(e, t, n) {
- for (var o = "string" == typeof n ? n.toLowerCase() : n, a = 0; a < e.length; a++) {
- var i = "string" == typeof e[a][t] ? e[a][t].toLowerCase() : e[a][t];
- if (i == o) return a
- }
- return -1
- },
- mergeUsers: function(e, t) {
- e = e.slice(0), t = t.slice(0);
- for (var n = 0; n < e.length; n++) {
- var o = e[n],
- a = Tiles.indexOfPropValue(t, "login", Util.htmlDecode(o.login));
- if (a > -1 && (o.isSigned || (e[n] = t[a]), t.splice(a, 1), 0 == t.length)) break
- }
- return e.concat(t)
- },
- UpdateUsers: function(e) {
- Tiles.sso_users && (e = Tiles.mergeUsers(e, Tiles.sso_users)), Constants.IS_USE_OTHER_ACCOUNT_VISIBLE && e.push(Tiles.otherJSON), Tiles.users = users = e, $("#login_user_chooser").empty(), Tiles.drawUsers()
- },
- signoutAndForgetUser: function(e) {
- e.preventDefault();
- var t = $(this).parent().attr("data-session-id");
- if (Support.isDefined(t)) {
- var n = document.createElement("iframe");
- n.name = "logoutFrame", n.style.display = "none";
- var o = Constants.uxLogoutUrl;
- o = o.upsertQueryStringParam("sessionId", encodeURIComponent(t)), o = o.upsertQueryStringParam("shouldForgetUser", encodeURIComponent(e.data.shouldForgetUser)), n.src = o, Util.SetRoutingCookie($(this).parent().attr("data-upn")), $("#title3_" + t).text(Constants.SIGNINGOUT), $(this).append(n)
- } else Util.debug_console("seesionId is not defined")
- },
- updateFirstUserTile: function(e, t, n) {
- $("input#cred_userid_inputtext").val(Util.htmlDecode(e)), $("#login_user_chooser").empty();
- var o = Tiles.getUser(e, t, n),
- a = Tiles.getUserImage(o),
- i = Tiles.drawTile(o, a, !0);
- $("#" + i).focus()
- },
- getUserImage: function(e) {
- var t = "work_account.png";
- return t = e.domainHint && !Constants.IS_CXH_REQUEST ? -1 != $.inArray(e.domainHint, ["amazon", "facebook", "google", "instagram", "linkedin", "qq", "renren", "twitter", "weibo", "yahoo"]) ? e.domainHint + "_80.png" : "msa" === e.domainHint ? "personal_account.png" : "use_another_account.png" : "other" === e.link ? "use_another_account.png" : e.isLive ? "personal_account.png" : "work_account.png", Constants.CDN_IMAGE_PATH + t
- },
- generateUserTileHtml: function(e, t, n, o, a, i, r, s, d, _, c, l) {
- var u = "";
- null != d ? u = ' <div class="smallertext tile_third_name windows_tile_text text-caption2 {0}" style="cursor: pointer" id="title3_{1}"> {2} </div>'.format(e, t, d) : Context.username_state.last_checked_email && (u = ' <div class="smallertext tile_third_name windows_tile_text text-caption2 {0}" style="cursor: pointer"> {1} </div>'.format(e, Context.username_state.last_checked_email));
- var g = "";
- null != _ && (g = (' <td class="dots" rowspan="2"> <div id="{0}_menulink" tabindex="0" data-ref="{2}" data-session-id="{1}" data-upn="{3}" title="' + Constants.CLICKFORMORE + '" aria-label="' + Constants.CLICKFORMORE + '"> ••• </div> </td>').format(e, t, _, l));
- var m = "";
- c && (m = ' <div class="progress"> <div class="pip"></div> <div class="pip"></div> <div class="pip"></div> <div class="pip"></div> <div class="pip"></div> </div>');
- var h = ('<table id="{0}" data-session-id="{1}" class="user_tile"> <tr> <td> <table> <tr> <td colspan="2">' + m + " </td>" + g + ' </tr> <tr class="{0} {1}" style="cursor: pointer"> <td> <img class="ad_glyph {0}" src="{2}" alt="{3}" /> </td> <td class="tile_name tile_name_padding"> <div class="bigtext tile_primary_name windows_tile_text wrap {0}" style="cursor: pointer" {5}> {4} </div> <div class="smallertext tile_secondary_name windows_tile_text text-caption2 {0}" style="cursor: pointer" {7}> {6} </div>' + u + " </td> </tr> </table> </td> </tr></table>").format(e, t, n, o, a, i ? 'title="' + i + '"' : "", r, s ? 'title="' + s + '"' : "");
- return h
- }
- };
- var Tiles = MSLogin.Tiles;
- ! function() {
- var e = window,
- t = e.$Config,
- n = e.MSLogin || {};
- n.Util = {
- HoloNavigationStack: [],
- PrefetchContent: function(e) {
- $("#login_prefetch_container").append($("<iframe/>").attr("src", e).attr("seamless", "seamless").attr("scrolling", "no").attr("id", "login_prefetch_iframe").load(function() {
- Instrument.prefetch_load_time = new Date - Instrument.prefetch_start, Instrument.prefetch_done = !0
- }))
- },
- CookieSafeRegex: /^[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]+$/,
- IsCookieSafeValue: function(e) {
- return Util.CookieSafeRegex.test(e)
- },
- SetRoutingCookie: function(e) {
- Constants.USER_ROUTING_COOKIE && Util.IsCookieSafeValue(e) && (document.cookie = Constants.USER_ROUTING_COOKIE + "=" + e + ";path=" + (Constants.USER_ROUTING_COOKIE_PATH || "/") + ";domain=" + document.location.hostname + ("undefined" != typeof Constants.SET_COOKIE_SUFFIX ? Constants.SET_COOKIE_SUFFIX : ";secure"))
- },
- getCookie: function(e, t) {
- var n, o, a, i = document.cookie.split(";");
- for (n = 0; n < i.length; n++)
- if (o = i[n].substr(0, i[n].indexOf("=")), a = i[n].substr(i[n].indexOf("=") + 1), o = o.replace(/^\s+|\s+$/g, ""), o == e) return (t || window.unescape)(a)
- },
- setCookieWithExpiration: function(e, t, n, o) {
- var a = ";secure";
- "undefined" != typeof Constants && "undefined" != typeof Constants.SET_COOKIE_SUFFIX && (a = Constants.SET_COOKIE_SUFFIX);
- var i = t + (o ? ";domain=" + o : "") + ";path=/" + (n ? ";expires=" + n.toUTCString() : "") + a;
- document.cookie = e + "=" + i
- },
- setCookie: function(e, t, n) {
- var o = new Date;
- o.setDate(o.getDate() + n);
- var a = document.location.hostname.split("."),
- i = a.length,
- r = "." + a[i - 2] + "." + a[i - 1];
- Util.setCookieWithExpiration(e, t, o, r)
- },
- eraseCookie: function(e) {
- var t = document.location.hostname.split("."),
- n = t.length,
- o = e + "= ;domain=." + t[n - 2] + "." + t[n - 1] + ";path=/;expires=Thu, 30-Oct-1980 00:00:01 GMT;";
- Util.debug_console(o), document.cookie = o, o = e + "= ;domain=." + document.location.hostname + ";path=/;expires=Thu, 30-Oct-1980 00:00:01 GMT;", Util.debug_console(o), document.cookie = o
- },
- exists: function(e) {
- return e ? !0 : 0 == e || 0 == e || "" == e
- },
- valOrDefault: function(e, t) {
- return Util.exists(e) ? e : t
- },
- debug_console: function() {},
- ExtractToken: function(e, t, n, o, a) {
- n = Util.valOrDefault(n, "&"), o = Util.valOrDefault(o, "=");
- var i = Util.valOrDefault(a, null);
- if (!e) return i;
- var r = e.indexOf(t + o);
- if (0 == r ? r += t.length + 1 : r > 0 && (r = e.indexOf(n + t + o), r > 0 && (r += n.length + t.length + 1)), -1 != r) {
- var s = e.indexOf(n, r); - 1 == s && (s = e.length), i = e.substring(r, s)
- }
- return i
- },
- ExtractQSParam: function(e) {
- var t = Context.query_search_params.toLowerCase();
- return t && (t = t.substr(1)), Util.ExtractToken(t, e.toLowerCase(), "&", "=", "")
- },
- AddQSParamIfNotExists: function(e, t, n) {
- var o = "[?&]" + t + "=([^&]+?)($|&)",
- a = new RegExp(o, "i"),
- i = e.match(a);
- if (!i) {
- var r = "([?&])" + t + "=?(&|$)",
- s = new RegExp(r, "i");
- e = e.replace(s, "$1");
- var d = Util.ExtractQSParam(t);
- !d || n && !n.test(d) || (-1 == e.indexOf("?") ? e += "?" : e.indexOf("?") < e.length - 1 && (e += "&"), e += t + "=" + d)
- }
- return e
- },
- appendQueryString: function(e, t) {
- var n = -1 === e.indexOf("?") ? "?" : "&";
- return e + n + t
- },
- isMSA: function(e) {
- return !e || -1 == e.indexOf("login.live.com") && -1 == e.indexOf("login.live-int.com") && -1 == e.indexOf("login.microsoft.com") && -1 == e.indexOf("/MockLiveINT/") ? !1 : !0
- },
- supportCookies: function() {
- var e = null;
- switch (t.isCorpnet && (e = Util.ExtractQSParam("testcookie")), e) {
- case "0":
- return !1;
- case "1":
- return !0;
- default:
- return document.cookie = "testcookie=testcookie", -1 != document.cookie.indexOf("testcookie=testcookie") ? !0 : !1
- }
- },
- updateRedirectionMessage: function(e, t) {
- var n;
- t ? (n = Constants.REDIRECT_MESSAGES.CLOUDFEDERATED, $("#alternative-identity-providers").hide()) : Util.isMSA(e) ? n = Constants.REDIRECT_MESSAGES.MSA : (n = Constants.REDIRECT_MESSAGES.AAD, $("#alternative-identity-providers").hide()), $("#redirect_message_text").text(n)
- },
- htmlEncode: function(e) {
- return $("<span/>").text(e).html()
- },
- htmlDecode: function(e) {
- return $("<span/>").html(e).text()
- },
- now: function() {
- var e = window.performance || {};
- return e.now = function() {
- return e.now || e.webkitNow || e.msNow || e.oNow || e.mozNow || function() {
- return (new Date).getTime()
- }
- }(), e.now()
- },
- StartLocalAccountCxhFlow: function() {
- try {
- var e = new CloudExperienceHost.Bridge;
- return e.fireEvent(CloudExperienceHost.Events.loadIdentityProvider, CloudExperienceHost.SignInIdentityProviders.Local), !1
- } catch (t) {}
- return !0
- },
- CancelCxhFlow: function() {
- try {
- var e = new CloudExperienceHost.Bridge;
- return e.fireEvent(CloudExperienceHost.Events.done, CloudExperienceHost.AppResult.cancel), !1
- } catch (t) {}
- return !0
- },
- SetCxhOnBackAction: function(e) {
- try {
- var t = new CloudExperienceHost.Bridge;
- t.addEventListener("CloudExperienceHost.backButtonClicked", e), t.invoke("CloudExperienceHost.setShowBackButton", !0)
- } catch (n) {}
- },
- OnBack: function() {
- var e = Util.HoloNavigationStack;
- return e.pop(), e[e.length - 1].show && e[e.length - 1].show(), !1
- },
- NavigateCxh: function(e) {
- try {
- var t = new CloudExperienceHost.Bridge;
- return t.fireEvent(CloudExperienceHost.Events.navigate, e), !1
- } catch (n) {}
- return !0
- },
- LogCxhTelemetry: function(e, t) {
- try {
- var n = new CloudExperienceHost.Bridge;
- void 0 == t ? n.invoke("CloudExperienceHost.Telemetry.logEvent", e) : n.invoke("CloudExperienceHost.Telemetry.logEvent", e, t)
- } catch (o) {}
- },
- EnableEmailDiscoveryIfEBD: function() {
- ("EmailBasedDiscovery.2.0" == $("meta[name=PageID]").attr("content") || "EmailBasedDiscoveryTiles.2.0" == $("meta[name=PageID]").attr("content")) && ($("#cred_keep_me_signed_in_checkbox").removeAttr("checked"), EmailDiscovery.is_enabled_workflow = !0)
- }
- }, e.Util = n.Util, $Do.register("MSLogin.Util", 0, !0)
- }(),
- function() {
- MSLogin.BrowserCore = {
- BrowserCoreProvider: function(e) {
- this.extensionId = e
- },
- Error: function(e, t, n) {
- this.code = e, this.description = t, this.ext = n
- },
- CreateProviderAsync: function(e, t) {
- var n = document.createElement("div");
- n.id = this._channelElementId, n.style = "display:none", document.body.appendChild(n), window.postMessage({
- channel: this._channel,
- responseId: this._resp(e, t),
- body: {
- method: "CreateProviderAsync"
- }
- }, "*")
- },
- _resp: function(e, t) {
- return this._msgid++, this._respMap[this._msgid] = {
- success: e,
- fail: t
- }, this._msgid
- },
- _resolveResponse: function(e) {
- var t = this._respMap[e];
- return delete this._respMap[e], t
- },
- _onChannelMessage: function(e) {
- try {
- var t = this,
- n = e.body.method;
- "CreateProviderAsync" === n ? setTimeout(function() {
- t._onCreateProviderAsync(e)
- }, 0) : "Response" === n && t._onExtensionResponse(e)
- } catch (o) {
- throw console.log("Page: Exception in the channel: " + o.toString()), o
- }
- },
- _onExtensionResponse: function(e) {
- var t = this._resolveResponse(e.responseId);
- if (t) try {
- var n = e.body.response;
- "Success" === n.status ? t.success(n.result) : t.fail(new MSLogin.BrowserCore.Error(n.code, n.description, n.ext))
- } catch (o) {
- throw console.log("Page: Fail to deliver response: " + o.toString()), o
- }
- },
- _onCreateProviderAsync: function(e) {
- var t = this._resolveResponse(e.responseId);
- if (t) try {
- var n = this._channelElementId,
- o = document.getElementById(n);
- if (null !== o) {
- var a = o.firstChild,
- i = a ? a.id : null;
- o.remove(), i && "" !== i ? t.success(new MSLogin.BrowserCore.BrowserCoreProvider(i)) : t.fail(new MSLogin.BrowserCore.Error("NoExtension", "Extension is not installed.", null))
- } else t.fail(new MSLogin.BrowserCore.Error("PageException", "Need element with id " + n, null))
- } catch (r) {
- throw console.log("Page: Fail to deliver response: " + r.toString()), r
- }
- },
- _channel: "53ee284d-920a-4b59-9d30-a60315b26836",
- _channelElementId: "ch-53ee284d-920a-4b59-9d30-a60315b26836",
- _respMap: {},
- _msgid: 0
- }, MSLogin.BrowserCore.BrowserCoreProvider.prototype.GetCookieAsync = function(e, t, n) {
- window.postMessage({
- channel: MSLogin.BrowserCore._channel,
- extensionId: this.extensionId,
- responseId: MSLogin.BrowserCore._resp(t, n),
- body: {
- method: "GetCookie",
- uri: e
- }
- }, "*")
- }, MSLogin.BrowserCore.Error.prototype.toString = function() {
- return this.code + ": " + this.description
- }, MSLogin.BrowserCore.Error.Codes = {
- NoExtension: "NoExtension",
- NoSupport: "NoSupport",
- OSError: "OSError",
- PageException: "PageException",
- ContentError: "ContentError"
- }, window.addEventListener && window.addEventListener("message", function(e) {
- e.source == window && e.data.channel && e.data.channel === MSLogin.BrowserCore._channel && MSLogin.BrowserCore._onChannelMessage(e.data)
- }, !1)
- }(), window.WindowsBrowserSso = function(e) {
- function t(e) {
- var t = {
- nonce: e.nonce
- };
- return e.type && (t.type = e.type), t
- }
- function n(e, t) {
- return e && e.reportStates && -1 != e.reportStates.indexOf(t) ? !0 : !1
- }
- function o(e, t) {
- return e && e.redirectEndStates && -1 != e.redirectEndStates.indexOf(t) ? !0 : !1
- }
- function a(a) {
- if (a.message && C(a.message), n(I.telemetry, a.state)) {
- E("result", a.state);
- try {
- $.ajax({
- url: I.telemetry.url.upsertQueryStringParam("client-request-id", S.correlationId),
- data: JSON.stringify(b),
- type: "POST",
- timeout: 500,
- async: !1
- })
- } catch (i) {}
- b = t(I.telemetry)
- }
- if (a.tileId) {
- var r = e.User,
- s = e.Context;
- if (a.state == w.START) {
- var d = $("#" + a.tileId + " .progress");
- d.css("visibility", "visible"), r.startAnimation(d), s.animationTid = setInterval(function() {
- r.startAnimation(d)
- }, 3500)
- } else(a.state == w.END || a.state == w.END_SSO) && (clearInterval(s.animationTid), $("#" + a.tileId + " .progress").css("visibility", "hidden"))
- }
- I.failureRedirectUrl && o(I, a.state) && (O ? m("redirect", function() {
- C("Redirecting from State [" + a.state + "]"), e.location.replace(I.failureRedirectUrl)
- }, 5e3) : (C("Redirecting from State [" + a.state + "]"), setTimeout(function() {
- e.location.replace(I.failureRedirectUrl)
- }, 0)))
- }
- function i() {
- var n = e.Util;
- b = t(T.telemetry), I = T || {
- forceTiles: !1,
- overallTimeoutMs: 4e3
- }, I.initiatePullTimeoutMs = I.initiatePullTimeoutMs || I.overallTimeoutMs, I.initiatePullTimeoutAction = I.initiatePullTimeoutAction || "abort";
- var o = n.ExtractQSParam("bsso").toLowerCase();
- if (o)
- for (var a = e.decodeURIComponent(o).split(";"), i = 0; i < a.length; i++) switch (a[i]) {
- case "debug":
- x = !0;
- break;
- case "test":
- D = !0;
- break;
- case "disable":
- k = !0;
- break;
- case "redirect":
- O = !0
- }
- R = !0
- }
- function r(t, n) {
- if (!e.navigator || !$.isFunction(e.navigator.msLaunchUri) || k) return f(w.START, null, n), E("BSSO.info", k ? "disabled" : "not-supported"), void f(w.END, k ? "Browser SSO is disabled" : "window.navigator.msLaunchUri is not available for LoginWindowsUser", n);
- var o, a = e.Util;
- $.when($.Deferred(function(e) {
- o = g(t, e, "Windows user login", n)
- })).then(function() {
- var e, t = setInterval(function() {
- if (a.getCookie(U.winSso)) {
- clearInterval(t), clearTimeout(e);
- var i = (new Date).getTime() - o;
- E("ESTSSSO.cookie.ms", i), h(n)
- }
- }, 100);
- e = setTimeout(function() {
- clearInterval(t);
- var e = (new Date).getTime() - o;
- E("TB.response.timeout.ms", e), f(w.END, "Windows user login timed out.", n)
- }, I.overallTimeoutMs)
- })
- }
- function s() {
- if (!e.navigator || !$.isFunction(e.navigator.msLaunchUri) || k) return f(w.START, null), E("BSSO.info", k ? "disabled" : "not-supported"), void f(w.END, k ? "Browser SSO is disabled" : "window.navigator.msLaunchUri is not available for pullBrowserSsoCookie");
- var t = e.Util,
- n = t.getCookie(U.ssoTiles) || I.forceTiles;
- if (!n && t.getCookie(U.ssoPulled)) return f(w.START, null), E("BSSO.info", "throttled"), void f(w.END, "Cookie pull throttled");
- var o, a = "tbauth://login.windows.net?context=" + encodeURIComponent(e.location.href.split("/", 3).join("/")) + (I.nonce ? "&request_nonce=" + encodeURIComponent(I.nonce) : "") + (I.rid ? "&rid=" + encodeURIComponent(I.rid) : "");
- $.when($.Deferred(function(e) {
- var i = a;
- n && (i = t.appendQueryString(i, "user_id=*"), t.eraseCookie(U.ssoTiles)), o = g(i, e, "cookie pull")
- })).then(function() {
- var e, n = setInterval(function() {
- var i, r = t.getCookie(U.userList, decodeURIComponent);
- r ? (clearInterval(n), clearTimeout(e), i = (new Date).getTime() - o, E("ESTSUSERLIST.cookie.ms", i), f(w.INPROGRESS, "Users list cookie detected"), t.eraseCookie(U.userList), p(r.replace(/\+/g, " "), a)) : t.getCookie(U.winSso) && (clearInterval(n), clearTimeout(e), i = (new Date).getTime() - o, E("ESTSSSO.cookie.ms", i), h())
- }, 250);
- e = setTimeout(function() {
- clearInterval(n);
- var e = (new Date).getTime() - o;
- E("TB.response.timeout.ms", e), f(w.END, "Pull cookie timed out.")
- }, I.overallTimeoutMs)
- })
- }
- function d() {
- if (k) return f(w.START, null), E("BSSO.info", "disabled"), void f(w.END, "Browser SSO is disabled");
- var t = e.Util;
- return t.getCookie(U.ssoPulled) ? (f(w.START, null), E("BSSO.info", "throttled"), void f(w.END, "Cookie pull throttled")) : void c().then(l).then(u).fail(function(e) {
- var t = e.toString();
- e.ext && (t += " (ext: " + JSON.stringify(e.ext) + ")"), f(w.END, "Error: " + t)
- })
- }
- function _() {
- T.enabled && R && ("windows" == A ? s() : "chrome" == A && d())
- }
- function c() {
- var t = $.Deferred();
- return f(w.INPROGRESS, "Creating provider"), e.MSLogin.BrowserCore.CreateProviderAsync(function(e) {
- t.resolve(e)
- }, function(e) {
- t.reject(e)
- }), t.promise()
- }
- function l(t) {
- var n = $.Deferred();
- return E("extension.id", t.extensionId), f(w.INPROGRESS, "Pulling SSO cookies"), t.GetCookieAsync(e.location.href.upsertQueryStringParam("sso_nonce", I.nonce), function(e) {
- n.resolve(e)
- }, function(e) {
- n.reject(e)
- }), n.promise()
- }
- function u(t) {
- var n = $.Deferred(),
- o = null,
- a = null,
- i = e.Constants;
- if (t && t.response && t.response.length) {
- for (var r = 0, s = t.response.length; s > r; ++r) o = t.response[r].name, a = t.response[r].data, o && a && (a = a.replace("; httponly", ""), "undefined" != typeof i.SET_COOKIE_SUFFIX && -1 === i.SET_COOKIE_SUFFIX.indexOf("secure") && (a = a.replace("; secure", "")), document.cookie = o + "=" + a);
- h(), n.resolve()
- } else {
- var d = e.MSLogin;
- n.reject(new d.BrowserCore.Error(d.BrowserCore.Error.Codes.PageException, "Extension returned no cookies"))
- }
- return n.promise()
- }
- function g(t, n, o, a) {
- f(w.START, "Initiating " + o, a);
- var i, r = (new Date).getTime();
- return e.navigator.msLaunchUri(t, function() {
- clearTimeout(i);
- var e = (new Date).getTime() - r;
- n.resolve(), E("msLaunchUri.success.ms", e), f(w.INPROGRESS, o + " initiated successfully (took " + e + " ms)", a)
- }, function() {
- clearTimeout(i);
- var e = (new Date).getTime() - r,
- t = "pending" === n.state();
- n.reject(), E("msLaunchUri.failure.ms", e), f(t ? w.END : w.INPROGRESS, o + " was NOT initiated successfully (took " + e + " ms)", a)
- }), i = setTimeout(function() {
- clearTimeout(i), "pending" === n.state() && ("abort" == I.initiatePullTimeoutAction ? (n.reject(), E("msLaunchUri.response", "timeout"), f(w.END, "Initiating " + o + " timed out.", a)) : (n.resolve(), E("msLaunchUri.response", "timeout-continue"), f(w.INPROGRESS, "Initiating " + o + " timed out but starting polling anyway in case cookie was pulled.", a)))
- }, I.initiatePullTimeoutMs), r
- }
- function m(e, t, n) {
- var o = y[e];
- o || (o = [], y[e] = o);
- var a = {
- timeoutId: null,
- trigger: function() {
- var n = this,
- a = !1,
- i = !1;
- n.timeoutId && (clearTimeout(n.timeoutId), n.timeoutId = null, a = !0);
- for (var r = 0; r < o.length; r++)
- if (o[r] == n) {
- o.splice(r, 1), i = !0;
- break
- }
- C("Triggering [" + e + "] callback. Timeout Cleared:" + a + ", Removed: " + i), t()
- }
- };
- !D && n ? (a.timeoutId = setTimeout(a.trigger, 5e3), C("Test callback added [" + e + "] with 5 sec timeout")) : C("Test callback added [" + e + "]"), o.push(a)
- }
- function h(t) {
- var n = e.Util,
- o = new Date;
- o.setSeconds(o.getSeconds() + 60), x ? (f(w.END_SSO, "SSO cookie detected. Refreshing page in 5 seconds (due to debug mode).", t), m("reload", function() {
- n.setCookieWithExpiration(U.ssoPulled, "1", o), -1 == e.location.href.toLowerCase().indexOf("prompt=select_account") ? e.location.reload(!0) : e.location.replace(e.location.href.replace(/prompt=[^&]*/i, ""))
- }, 5e3)) : (f(w.END_SSO, "SSO cookie detected. Refreshing page.", t), n.setCookieWithExpiration(U.ssoPulled, "1", o), -1 == e.location.href.toLowerCase().indexOf("prompt=select_account") ? setTimeout(function() {
- e.location.reload(!0)
- }, 0) : setTimeout(function() {
- e.location.replace(e.location.href.replace(/prompt=[^&]*/i, ""))
- }, 0))
- }
- function p(t, n) {
- var o = e.Tiles,
- a = e.Constants,
- i = e.Context;
- try {
- if (o.users || (o.users = []), o.sso_users = [], $.each($.parseJSON(t).users, function(e, t) {
- var a = {
- name: t.display_name || "",
- login: t.upn,
- imageAAD: "work_account.png",
- imageMSA: "personal_account.png",
- isLive: !1,
- isWindows: !0,
- isSigned: !0,
- link: n,
- authUrl: "",
- sessionID: "",
- domainHint: ""
- };
- o.sso_users.push(a)
- }), o.sso_users.length > 0) {
- var r = i.email_discovery_mode;
- i.email_discovery_mode = !1, a.IS_USE_OTHER_ACCOUNT_VISIBLE && o.users.splice(o.users.length - 1, 1), o.UpdateUsers(o.users), i.email_discovery_mode = r, f(w.END_USERS, "User list processed.")
- } else f(w.END, "User list is empty.")
- } catch (s) {
- E("BSSO.exception", "processUsersList"), f(w.END, "processUsersList: exception: " + s)
- }
- }
- function C(e) {
- L.push(e), e && (b.traces = b.traces || [], b.traces.push(e))
- }
- function f(e, t, n) {
- try {
- a({
- state: e,
- message: t,
- tileId: n
- })
- } catch (o) {
- E("BSSO.exception", "updateStatus")
- }
- }
- function E(e, t) {
- b && (b.data = (b.data || "") + e + "=" + t + ";")
- }
- var S = e.$Config || {},
- T = S.bsso || {},
- v = e.$Do,
- A = T.type,
- w = T.states || {},
- I = null,
- b = null,
- x = !1,
- D = !1,
- k = !1,
- O = !1,
- U = T.cookieNames,
- R = !1,
- y = {};
- if (!T.enabled) return null;
- var L = [];
- v.when("doc.ready", function() {
- i(T), _()
- });
- var M = {
- LoginWindowsUser: function(e, t) {
- r(e, t)
- },
- PullBrowserSsoCookie: function() {
- _()
- },
- getLog: function() {
- return L
- },
- isEnabled: function() {
- return T.enabled && R || !1
- }
- };
- return S.isOneBox && (M.triggerTestHook = function(e) {
- var t = y[e];
- return t && t.length > 0 ? (C("Manually triggering [" + e + "] callback"), t[0].trigger(), !0) : !1
- }), M
- }(window);
- var proxy = function(e, t) {
- "use strict";
- function n() {
- return e.tiles
- }
- function o() {
- return !n()
- }
- function a(e) {
- p++, p > S.onPremPasswordValidationConfig.maxPolls ? s({
- statusText: "timeout"
- }) : (u = e, $Do.when("$Api", function() {
- t.$Api.Json(S.onPremPasswordValidationConfig.pollUrl, e, i, r, S.onPremPasswordValidationConfig.timeout)
- }))
- }
- function i(e) {
- e ? (f = 0, C = null, e.isJobPending ? t.setTimeout(function() {
- a({
- FlowToken: e.flowToken,
- Ctx: e.ctx
- })
- }, S.onPremPasswordValidationConfig.pollingInterval) : _(e)) : r()
- }
- function r(e) {
- C || (C = e), f++, f > S.onPremPasswordValidationConfig.maxPollsOnError || p > S.onPremPasswordValidationConfig.maxPolls ? s(C) : a(u)
- }
- function s(e) {
- o() && ($("#redirect_cta_text").hide(), $("#redirect_dots_animation").hide(), $("#redirect_dots_animation").css("visibility", "hidden"), clearInterval(E), c(!0)), p = 0, d(e)
- }
- function d(o) {
- var a;
- a = t.GetString(o && "timeout" === o.statusText ? "OnPremPasswordValidation.TimeoutErrorMessage" : "OnPremPasswordValidation.GenericErrorMessage"), n() ? e.tiles.switchToLoginViewOnError(a) : $("#cta_client_error_text").text(a).show()
- }
- function _(e) {
- $('#endonpremvalidation input[name="flowtoken"]').val(e.flowToken), $('#endonpremvalidation input[name="ctx"]').val(e.ctx), $("#endonpremvalidation").submit()
- }
- function c(e) {
- e ? (g.show(), m && $("#cred_cancel_button").show()) : (g.hide(), m && $("#cred_cancel_button").hide(), $("#cred_continue_button").hide())
- }
- function l(e, t) {
- var n = $('#credentials input[name="lrt"]'),
- o = t && (t.is_lrt || t.result && t.result.is_lrt);
- o && 0 === n.length && (n = $('<input type="hidden" name="lrt" value="true" />').appendTo("#credentials")), n.val(o ? "true" : "false")
- }
- var u, g, m, h = e.MSOnPremPasswordValidation = e.MSOnPremPasswordValidation || {},
- p = 0,
- C = null,
- f = 0,
- E = null,
- S = t.$Config.constants || t.Constants;
- return h.registerUserRealmDiscoveryListeners = function() {
- o() ? t.User.RegisterOnUserDomainHintChanged(l) : $(e).on("BrandedUserLoaded", l)
- }, h.startPolling = function() {
- o() ? (g = $("#cred_userid_container,#cred_password_container,.login_cta_container,#recover_container,input#cred_password_inputtext,#cred_sign_in_button,#cred_kmsi_container"), m = $("#cred_cancel_button").is(":visible"), c(!1), $("#redirect_cta_text").text(t.GetString("OnPremPasswordValidation.AuthenticatingMessage")), $("#redirect_cta_text").show(), $("#redirect_dots_animation").show(), $("#redirect_dots_animation").css("visibility", "visible"), t.User.startAnimation(), E = setInterval(t.User.startAnimation, 3500)) : $("#redirect-message-text-pta").text(t.GetString("OnPremPasswordValidation.AuthenticatingMessage"));
- var e = {
- flowToken: S.onPremPasswordValidationConfig.flowToken,
- ctx: S.CONTEXT
- };
- a(e)
- }, $Do.register("Proxy.MSOnPremPasswordValidation", 0, !0), e
- }(proxy || {}, window);
- /**
- * @preserve Copyright 2016 (C) Microsoft Corporation. All rights reserved.
- */
- $Do.when("jQuery", function() {
- var e = window;
- e.proxy = function(t, n, o) {
- "use strict";
- function a(n) {
- M.push(n), t.utilities && t.utilities.logToConsole ? t.utilities.logToConsole(n) : e.Util && e.Util.debug_console && e.Util.debug_console(n)
- }
- function i(t) {
- var n = {
- resultCode: t,
- ssoDelay: N,
- log: ""
- };
- 0 !== t && (n.log = M.join("\n")), e.$Api.Json(o.urls.instr.dssostatus, n)
- }
- function r(e) {
- return k.iwaEndpointUrlFormat.format(e)
- }
- function s(e, t) {
- return -1 !== e.indexOf("?") ? e + "&" + t : e + "?" + t
- }
- function d(e) {
- var t = document.createElement("a");
- return t.href = e, t.protocol + "//" + t.host
- }
- function _(e) {
- a("Submitting DesktopSSO auth token..."), P = !1, i(0), n("#dssoToken").val(e), n("#credentials").submit()
- }
- function c(e) {
- a("Integrated Windows Authentication failed."), i(e), n("#dssoToken").val(""), l()
- }
- function l() {
- P && (x() ? (n("#redirect_cta_text").hide(), n("#redirect_dots_animation").hide(), clearInterval(L), $(!0)) : t.tiles.switchToLoginView(), P = !1)
- }
- function u(e) {
- a("IFrame listener called.");
- var t = d(y);
- if (-1 !== t.indexOf(":443") && (t = t.replace(":443", "")), t.toLowerCase() !== e.originalEvent.origin) return a("FrameListener: event origin not valid."), void i(5);
- var n = {};
- try {
- n = JSON.parse(e.originalEvent.data)
- } catch (o) {
- return a("FrameListener: invalid response: " + o), void c(6)
- }
- if (n.messageType === B || (a("FrameListener: messageType was not of the expected value."), void 0 !== n.ssoDelay && void 0 !== n.resultCode && void 0 !== n.message)) {
- var r = parseInt(n.ssoDelay, 10);
- isNaN(r) || (N = n.ssoDelay), 100 == n.resultCode ? _(n.message) : (a("FrameListener: Frame returned code " + n.resultCode + " with message " + n.message), c(n.resultCode))
- }
- }
- function g() {
- var e = (new Date).getTime();
- n.ajax({
- url: y,
- type: "GET",
- dataType: "text",
- cache: !1,
- xhrFields: {
- withCredentials: !0
- },
- timeout: k.iwaRequestTimeoutInMs
- }).done(function(t, n, o) {
- N = (new Date).getTime() - e, 200 === o.status ? _(t) : (a("attemptSsoLoginDirect finished with non-success status " + o.status), c(3))
- }).fail(function(t) {
- N = (new Date).getTime() - e, a("attemptSsoLoginDirect failed with status " + t.status), c(4)
- })
- }
- function m() {
- return o.browser.Chrome ? (a("Detected Browser: Chrome"), !0) : !1
- }
- function h() {
- return o.browser._WinPh ? (a("Detected Browser: WindowsPhone"), !1) : o.browser.IE && null !== o.browser.b && o.browser.b.major >= 10 ? (a("Detected Browser: IE10+"), !0) : !1
- }
- function p() {
- return o.browser.Firefox ? (a("Detected Browser: Firefox"), !0) : !1
- }
- function C() {
- return o.browser.PhantomJS ? (a("Detected Browser: PhantomJS"), !0) : !1
- }
- function f() {
- return o.browser.Edge ? (a("Detected Browser: Edge"), !0) : !1
- }
- function E() {
- return o.browser.Safari ? (a("Detected Browser: Safari"), !0) : !1
- }
- function S() {
- a("Attempting to perform Integrated Windows Authentication..."), n(e).on("message", u);
- var t = document.createElement("iframe");
- t.id = "dsso_iframe", t.style.display = "none", t.src = s(y, "iframe=1"), t.onload = function() {
- a("SSO IFrame loaded");
- var e = d(y);
- a("targetDomain is " + e);
- var n = k.iwaRequestTimeoutInMs + "|" + y;
- t.contentWindow.postMessage(n, e)
- }, document.body.appendChild(t)
- }
- function T() {
- var e = document.createElement("img");
- e.setAttribute("height", "1"), e.setAttribute("width", "1"), e.onload = function() {
- g()
- }, e.onerror = function() {
- c(2)
- };
- var t = s(y, "probe=1&_=" + (new Date).getTime());
- a("Attempting probe with url " + t), e.setAttribute("src", t)
- }
- function v(e) {
- y = r(e), y = s(y, "client-request-id=" + o.correlationId), a("IWA url is " + y), m() ? T() : h() || p() || C() || f() && k.isEdgeAllowed || E() && k.isSafariAllowed ? S() : (a("User agent is not supported."), c(1))
- }
- function A(e) {
- return k.lastUsernameTried !== e
- }
- function w(e, t) {
- var n = t.result;
- n && n.is_dsso_enabled && n.DomainName && A(n.Login) && v(n.DomainName)
- }
- function I(e, t) {
- t && t.is_dsso_enabled && t.DomainName && A(t.Login) && v(t.DomainName)
- }
- function b() {
- e.User ? e.User.RegisterOnUserDomainHintChanged(I) : n(t).on("BrandedUserLoaded", w)
- }
- function x() {
- return !t.tiles
- }
- function $(e) {
- e ? (O.show(), U && n("#cred_cancel_button").show()) : (O.hide(), U && n("#cred_cancel_button").hide(), n("#cred_continue_button").hide())
- }
- function D() {
- k.startDesktopSsoOnPageLoad && k.hintedDomainName && (P = !0, x() && (O = n("#cred_userid_container,#cred_password_container,.login_cta_container,#recover_container,input#cred_password_inputtext,#cred_sign_in_button,#cred_kmsi_container"), U = n("#cred_cancel_button").is(":visible"), $(!1), n("#redirect_cta_text").text(e.GetString("DesktopSso.AuthenticatingMessage")), n("#redirect_cta_text").show(), n("#redirect_dots_animation").show(), n("#redirect_dots_animation").css("visibility", "visible"), e.User.startAnimation(), L = setInterval(e.User.startAnimation, 3500)), setTimeout(l, k.progressAnimationTimeout), v(k.hintedDomainName))
- }
- var k, O, U, R = t.DesktopSso = t.DesktopSso || {},
- y = "",
- L = 0,
- M = [],
- N = 0,
- B = "dssoResult",
- P = !1;
- return R.Initialize = function(e) {
- k = e, b(), D(), a("Successfully initialized DesktopSSO.")
- }, t
- }(e.proxy || {}, jQuery, e.$Config), $Do.register("Proxy.DesktopSso", 0, !0)
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement