Skip to content

Instantly share code, notes, and snippets.

@hteumeuleu
Last active May 9, 2020 07:16
Show Gist options
  • Save hteumeuleu/d8748197b1783889f9fa29dfa3eb3bc5 to your computer and use it in GitHub Desktop.
Save hteumeuleu/d8748197b1783889f9fa29dfa3eb3bc5 to your computer and use it in GitHub Desktop.
com.google.android.apk Files
<!DOCTYPE html>
<!--
Arguments for this template:
1. Body HTML String
2. Signature
3. Elided text HTML String
4. Hint text String
5. Hint text color String
6. padding-top of the body in px
7. padding-bottom of the body in px
8. direction of hint. "ltr" or "rtl".
9. Whether the elided text should be expanded (e.g. when Forwarding). "true" or "false"
10. Whether the signature should be initialized. "true" or "false"
11. Wallet discoverability keyword sequences - literal JSON array of arrays of words
12. Size of font in body
13. Whether plus/at mention is enabled. "true" or "false"
14. Whether sc is enabled. "true" or "false".
15. Script tag to include dictation script.
16. Link tag to include dictation stylesheet.
17. Whether dictation is enabled. "true" or "false".
-->
<html>
<head>
<script type="text/javascript">
var SHOW_ELIDED=%9$s;
var INIT_SIGNATURE=%10$s;
var WALLET_DISCOVER_KEYWORD_HASHES=%11$s;
var MENTION_ENABLED=%13$s;
var SC_ENABLED=%14$s;
var DICTATION_ENABLED=%17$s;
</script>
%15$s
<script type="text/javascript" src="file:///android_asset/draft_editor_gmail_compiled.js"></script>
<script type="text/javascript" src="file:///android_asset/wa_discover.js"></script>
<link rel="stylesheet" type="text/css" href="file:///android_asset/compose.css">
%16$s
<style>
body {
margin: 0;
padding-top: %6$.1fpx;
padding-bottom: %7$.1fpx;
font-size: %12$s;
}
div.body:empty {
direction: %8$s;
}
div.body:empty:before {
color: %5$s;
content: attr(hint);
}
span.money[uline] {
border-bottom: dotted #4CAF50;
border-width: 2px;
}
</style>
</head>
<body><div dir="auto" class="body" contenteditable="true" spellcheck="true" hint="%4$s">%1$s</div>
<div class="signature_holder" style="display: none;">%2$s</div>
<div class="elided_text" style="display: none;">%3$s</div></body>
</html>
(function() {
/*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
var aa = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, b, c) {
a != Array.prototype && a != Object.prototype && (a[b] = c.value)
},
ba = function(a) {
a = ["object" == typeof globalThis && globalThis, "object" == typeof window && window, "object" == typeof self && self, "object" == typeof global && global, a];
for (var b = 0; b < a.length; ++b) {
var c = a[b];
if (c && c.Math == Math) return c
}
throw Error("Cannot find global object");
},
t = ba(this),
ca = function(a, b) {
if (b) {
var c = t;
a = a.split(".");
for (var d = 0; d < a.length - 1; d++) {
var e =
a[d];
e in c || (c[e] = {});
c = c[e]
}
a = a[a.length - 1];
d = c[a];
b = b(d);
b != d && null != b && aa(c, a, {
configurable: !0,
writable: !0,
value: b
})
}
};
ca("String.prototype.endsWith", function(a) {
return a ? a : function(b, c) {
if (null == this) throw new TypeError("The 'this' value for String.prototype.endsWith must not be null or undefined");
if (b instanceof RegExp) throw new TypeError("First argument to String.prototype.endsWith must not be a regular expression");
var d = this + "";
b += "";
void 0 === c && (c = d.length);
c = Math.max(0, Math.min(c | 0, d.length));
for (var e = b.length; 0 < e && 0 < c;)
if (d[--c] != b[--e]) return !1;
return 0 >= e
}
});
var da = function(a) {
var b = 0;
return function() {
return b < a.length ? {
done: !1,
value: a[b++]
} : {
done: !0
}
}
},
ea = function() {
ea = function() {};
t.Symbol || (t.Symbol = fa)
},
ha = function(a, b) {
this.a = a;
aa(this, "description", {
configurable: !0,
writable: !0,
value: b
})
};
ha.prototype.toString = function() {
return this.a
};
var fa = function() {
function a(c) {
if (this instanceof a) throw new TypeError("Symbol is not a constructor");
return new ha("jscomp_symbol_" + (c || "") + "_" + b++, c)
}
var b = 0;
return a
}(),
ja = function() {
ea();
var a = t.Symbol.iterator;
a || (a = t.Symbol.iterator = t.Symbol("Symbol.iterator"));
"function" != typeof Array.prototype[a] && aa(Array.prototype, a, {
configurable: !0,
writable: !0,
value: function() {
return ia(da(this))
}
});
ja = function() {}
},
ia = function(a) {
ja();
a = {
next: a
};
a[t.Symbol.iterator] = function() {
return this
};
return a
};
ca("Array.from", function(a) {
return a ? a : function(b, c, d) {
c = null != c ? c : function(f) {
return f
};
var e = [],
g = "undefined" != typeof Symbol && Symbol.iterator && b[Symbol.iterator];
if ("function" == typeof g) {
b = g.call(b);
for (var k = 0; !(g = b.next()).done;) e.push(c.call(d, g.value, k++))
} else
for (g = b.length, k = 0; k < g; k++) e.push(c.call(d, b[k], k));
return e
}
});
var ka = function(a) {
var b = "undefined" != typeof Symbol && Symbol.iterator && a[Symbol.iterator];
return b ? b.call(a) : {
next: da(a)
}
},
u = function(a, b) {
return Object.prototype.hasOwnProperty.call(a, b)
};
ca("WeakMap", function(a) {
function b() {}
function c(h) {
var l = typeof h;
return "object" === l && null !== h || "function" === l
}
function d(h) {
if (!u(h, g)) {
var l = new b;
aa(h, g, {
value: l
})
}
}
function e(h) {
var l = Object[h];
l && (Object[h] = function(m) {
if (m instanceof b) return m;
d(m);
return l(m)
})
}
if (function() {
if (!a || !Object.seal) return !1;
try {
var h = Object.seal({}),
l = Object.seal({}),
m = new a([
[h, 2],
[l, 3]
]);
if (2 != m.get(h) || 3 != m.get(l)) return !1;
m.delete(h);
m.set(l, 4);
return !m.has(h) && 4 == m.get(l)
} catch (r) {
return !1
}
}()) return a;
var g = "$jscomp_hidden_" + Math.random();
e("freeze");
e("preventExtensions");
e("seal");
var k = 0,
f = function(h) {
this.a = (k += Math.random() + 1).toString();
if (h) {
h = ka(h);
for (var l; !(l = h.next()).done;) l = l.value, this.set(l[0], l[1])
}
};
f.prototype.set = function(h, l) {
if (!c(h)) throw Error("Invalid WeakMap key");
d(h);
if (!u(h, g)) throw Error("WeakMap key fail: " + h);
h[g][this.a] = l;
return this
};
f.prototype.get = function(h) {
return c(h) && u(h, g) ? h[g][this.a] : void 0
};
f.prototype.has = function(h) {
return c(h) && u(h, g) && u(h[g], this.a)
};
f.prototype.delete = function(h) {
return c(h) && u(h, g) && u(h[g], this.a) ? delete h[g][this.a] : !1
};
return f
});
ca("Map", function(a) {
if (function() {
if (!a || "function" != typeof a || !a.prototype.entries || "function" != typeof Object.seal) return !1;
try {
var f = Object.seal({
x: 4
}),
h = new a(ka([
[f, "s"]
]));
if ("s" != h.get(f) || 1 != h.size || h.get({
x: 4
}) || h.set({
x: 4
}, "t") != h || 2 != h.size) return !1;
var l = h.entries(),
m = l.next();
if (m.done || m.value[0] != f || "s" != m.value[1]) return !1;
m = l.next();
return m.done || 4 != m.value[0].x || "t" != m.value[1] || !l.next().done ? !1 : !0
} catch (r) {
return !1
}
}()) return a;
ja();
var b = new WeakMap,
c = function(f) {
this.b = {};
this.a =
g();
this.size = 0;
if (f) {
f = ka(f);
for (var h; !(h = f.next()).done;) h = h.value, this.set(h[0], h[1])
}
};
c.prototype.set = function(f, h) {
f = 0 === f ? 0 : f;
var l = d(this, f);
l.list || (l.list = this.b[l.id] = []);
l.g ? l.g.value = h : (l.g = {
next: this.a,
h: this.a.h,
head: this.a,
key: f,
value: h
}, l.list.push(l.g), this.a.h.next = l.g, this.a.h = l.g, this.size++);
return this
};
c.prototype.delete = function(f) {
f = d(this, f);
return f.g && f.list ? (f.list.splice(f.index, 1), f.list.length || delete this.b[f.id], f.g.h.next = f.g.next, f.g.next.h = f.g.h, f.g.head = null,
this.size--, !0) : !1
};
c.prototype.clear = function() {
this.b = {};
this.a = this.a.h = g();
this.size = 0
};
c.prototype.has = function(f) {
return !!d(this, f).g
};
c.prototype.get = function(f) {
return (f = d(this, f).g) && f.value
};
c.prototype.entries = function() {
return e(this, function(f) {
return [f.key, f.value]
})
};
c.prototype.keys = function() {
return e(this, function(f) {
return f.key
})
};
c.prototype.values = function() {
return e(this, function(f) {
return f.value
})
};
c.prototype.forEach = function(f, h) {
for (var l = this.entries(), m; !(m = l.next()).done;) m =
m.value, f.call(h, m[1], m[0], this)
};
c.prototype[Symbol.iterator] = c.prototype.entries;
var d = function(f, h) {
var l = h && typeof h;
"object" == l || "function" == l ? b.has(h) ? l = b.get(h) : (l = "" + ++k, b.set(h, l)) : l = "p_" + h;
var m = f.b[l];
if (m && u(f.b, l))
for (f = 0; f < m.length; f++) {
var r = m[f];
if (h !== h && r.key !== r.key || h === r.key) return {
id: l,
list: m,
index: f,
g: r
}
}
return {
id: l,
list: m,
index: -1,
g: void 0
}
},
e = function(f, h) {
var l = f.a;
return ia(function() {
if (l) {
for (; l.head != f.a;) l = l.h;
for (; l.next != l.head;) return l = l.next, {
done: !1,
value: h(l)
};
l = null
}
return {
done: !0,
value: void 0
}
})
},
g = function() {
var f = {};
return f.h = f.next = f.head = f
},
k = 0;
return c
});
var w = this || self,
ma = function(a) {
var b = typeof a;
if ("object" == b)
if (a) {
if (a instanceof Array) return "array";
if (a instanceof Object) return b;
var c = Object.prototype.toString.call(a);
if ("[object Window]" == c) return "object";
if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) return "array";
if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) return "function"
} else return "null";
else if ("function" == b && "undefined" == typeof a.call) return "object";
return b
},
na = function(a, b, c) {
return a.call.apply(a.bind, arguments)
},
oa = function(a, b, c) {
if (!a) throw Error();
if (2 < arguments.length) {
var d = Array.prototype.slice.call(arguments, 2);
return function() {
var e = Array.prototype.slice.call(arguments);
Array.prototype.unshift.apply(e, d);
return a.apply(b, e)
}
}
return function() {
return a.apply(b, arguments)
}
},
pa = function(a, b, c) {
Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ?
pa = na : pa = oa;
return pa.apply(null, arguments)
},
x = function(a, b) {
var c = Array.prototype.slice.call(arguments, 1);
return function() {
var d = c.slice();
d.push.apply(d, arguments);
return a.apply(this, d)
}
},
qa = Date.now || function() {
return +new Date
},
y = function(a, b) {
a = a.split(".");
var c = w;
a[0] in c || "undefined" == typeof c.execScript || c.execScript("var " + a[0]);
for (var d; a.length && (d = a.shift());) a.length || void 0 === b ? c[d] && c[d] !== Object.prototype[d] ? c = c[d] : c = c[d] = {} : c[d] = b
},
ra = function(a, b) {
function c() {}
c.prototype = b.prototype;
a.prototype = new c;
a.prototype.constructor = a
};
var z = function(a) {
if (Error.captureStackTrace) Error.captureStackTrace(this, z);
else {
var b = Error().stack;
b && (this.stack = b)
}
a && (this.message = String(a))
};
ra(z, Error);
z.prototype.name = "CustomError";
var A = function(a, b) {
a = a.split("%s");
for (var c = "", d = a.length - 1, e = 0; e < d; e++) c += a[e] + (e < b.length ? b[e] : "%s");
z.call(this, c + a[d])
};
ra(A, z);
A.prototype.name = "AssertionError";
var sa = function() {
return null
};
var ta = Array.prototype.indexOf ? function(a, b) {
return Array.prototype.indexOf.call(a, b, void 0)
} : function(a, b) {
if ("string" === typeof a) return "string" !== typeof b || 1 != b.length ? -1 : a.indexOf(b, 0);
for (var c = 0; c < a.length; c++)
if (c in a && a[c] === b) return c;
return -1
},
B = Array.prototype.forEach ? function(a, b, c) {
Array.prototype.forEach.call(a, b, c)
} : function(a, b, c) {
for (var d = a.length, e = "string" === typeof a ? a.split("") : a, g = 0; g < d; g++) g in e && b.call(c, e[g], g, a)
},
ua = Array.prototype.filter ? function(a, b) {
return Array.prototype.filter.call(a,
b, void 0)
} : function(a, b) {
for (var c = a.length, d = [], e = 0, g = "string" === typeof a ? a.split("") : a, k = 0; k < c; k++)
if (k in g) {
var f = g[k];
b.call(void 0, f, k, a) && (d[e++] = f)
}
return d
},
va = Array.prototype.map ? function(a, b, c) {
return Array.prototype.map.call(a, b, c)
} : function(a, b, c) {
for (var d = a.length, e = Array(d), g = "string" === typeof a ? a.split("") : a, k = 0; k < d; k++) k in g && (e[k] = b.call(c, g[k], k, a));
return e
},
wa = function(a) {
return Array.prototype.concat.apply([], arguments)
},
xa = function(a) {
var b = a.length;
if (0 < b) {
for (var c = Array(b),
d = 0; d < b; d++) c[d] = a[d];
return c
}
return []
},
ya = function(a, b) {
return wa.apply([], va(a, b, void 0))
};
var za = function(a) {
var b = [],
c = 0,
d;
for (d in a) b[c++] = d;
return b
},
C = function(a) {
var b = {},
c;
for (c in a) b[c] = a[c];
return b
};
var D = function(a, b) {
this.c = a === Aa && b || "";
this.f = Ba
};
D.prototype.b = !0;
D.prototype.a = function() {
return this.c
};
var Ba = {},
Aa = {};
var E = String.prototype.trim ? function(a) {
return a.trim()
} : function(a) {
return /^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]
},
F = function(a, b) {
return -1 != a.indexOf(b)
},
Ca = function(a, b) {
return a < b ? -1 : a > b ? 1 : 0
};
var G = function(a, b) {
this.c = a === Da && b || "";
this.f = Ea
};
G.prototype.b = !0;
G.prototype.a = function() {
return this.c.toString()
};
var H = function(a) {
return a instanceof G && a.constructor === G && a.f === Ea ? a.c : "type_error:SafeUrl"
},
Fa = /^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,
Ga = function(a) {
if (a instanceof G) return a;
a = "object" == typeof a && a.b ? a.a() : String(a);
Fa.test(a) || (a = "about:invalid#zClosurez");
return new G(Da, a)
},
Ea = {},
Da = {};
var I = function() {
this.c = "";
this.f = Ha
};
I.prototype.b = !0;
var Ha = {};
I.prototype.a = function() {
return this.c
};
var Ia = function(a) {
var b = new I;
b.c = a;
return b
},
La = Ia(""),
Sa = function(a) {
if (a instanceof G) return 'url("' + H(a).replace(/</g, "%3c").replace(/[\\"]/g, "\\$&") + '")';
if (a instanceof D) a = a instanceof D && a.constructor === D && a.f === Ba ? a.c : "type_error:Const";
else {
a = String(a);
var b = a.replace(Ma, "$1").replace(Ma, "$1").replace(Na, "url");
if (Oa.test(b)) {
if (b = !Pa.test(a)) {
for (var c = b = !0, d = 0; d < a.length; d++) {
var e = a.charAt(d);
"'" == e && c ? b = !b : '"' == e && b && (c = !c)
}
b = b && c && Qa(a)
}
a = b ? Ra(a) : "zClosurez"
} else a = "zClosurez"
}
if (/[{;}]/.test(a)) throw new A("Value does not allow [{;}], got: %s.", [a]);
return a
},
Qa = function(a) {
for (var b = !0, c = /^[-_a-zA-Z0-9]$/, d = 0; d < a.length; d++) {
var e = a.charAt(d);
if ("]" == e) {
if (b) return !1;
b = !0
} else if ("[" == e) {
if (!b) return !1;
b = !1
} else if (!b && !c.test(e)) return !1
}
return b
},
Oa = /^[-,."'%_!# a-zA-Z0-9\[\]]+$/,
Na = /\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g,
Ma = /\b(calc|cubic-bezier|fit-content|hsl|hsla|linear-gradient|matrix|minmax|repeat|rgb|rgba|(rotate|scale|translate)(X|Y|Z|3d)?)\([-+*/0-9a-z.%\[\], ]+\)/g,
Pa = /\/\*/,
Ra = function(a) {
return a.replace(Na,
function(b, c, d, e) {
var g = "";
d = d.replace(/^(['"])(.*)\1$/, function(k, f, h) {
g = f;
return h
});
b = Ga(d).a();
return c + g + b + g + e
})
};
var J = function() {
this.c = "";
this.f = Ta
};
J.prototype.b = !0;
var Ta = {},
Va = function(a, b) {
if (F(a, "<")) throw Error("Selector does not allow '<', got: " + a);
var c = a.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g, "");
if (!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(c)) throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: " + a);
a: {
for (var d = {
"(": ")",
"[": "]"
}, e = [], g = 0; g < c.length; g++) {
var k = c[g];
if (d[k]) e.push(d[k]);
else {
b: {
var f = void 0;
for (f in d)
if (d[f] == k) {
f = !0;
break b
}
f = !1
}
if (f && e.pop() != k) {
c = !1;
break a
}
}
}
c = 0 == e.length
}
if (!c) throw Error("() and [] in selector must be balanced, got: " +
a);
if (!(b instanceof I)) {
c = "";
for (var h in b) {
if (!/^[-_a-zA-Z0-9]+$/.test(h)) throw Error("Name allows only [-_a-zA-Z0-9], got: " + h);
d = b[h];
null != d && (d = Array.isArray(d) ? va(d, Sa).join(" ") : Sa(d), c += h + ":" + d + ";")
}
b = c ? Ia(c) : La
}
a = a + "{" + (b instanceof I && b.constructor === I && b.f === Ha ? b.c : "type_error:SafeStyle").replace(/</g, "\\3C ") + "}";
return Ua(a)
},
Xa = function(a) {
var b = "",
c = function(d) {
Array.isArray(d) ? B(d, c) : b += Wa(d)
};
B(arguments, c);
return Ua(b)
};
J.prototype.a = function() {
return this.c
};
var Wa = function(a) {
return a instanceof J && a.constructor === J && a.f === Ta ? a.c : "type_error:SafeStyleSheet"
},
Ua = function(a) {
var b = new J;
b.c = a;
return b
},
Ya = Ua("");
var K;
a: {
var Za = w.navigator;
if (Za) {
var $a = Za.userAgent;
if ($a) {
K = $a;
break a
}
}
K = ""
};
var L = function() {
this.c = "";
this.f = ab
};
L.prototype.b = !0;
L.prototype.a = function() {
return this.c.toString()
};
var bb = function(a) {
return a instanceof L && a.constructor === L && a.f === ab ? a.c : "type_error:SafeHtml"
},
ab = {},
M = function(a) {
var b = new L;
b.c = a;
return b
};
M("<!DOCTYPE html>");
var cb = M("");
M("<br>");
var db = function(a) {
var b = !1,
c;
return function() {
b || (c = a(), b = !0);
return c
}
}(function() {
var a = document.createElement("div"),
b = document.createElement("div");
b.appendChild(document.createElement("div"));
a.appendChild(b);
b = a.firstChild.firstChild;
a.innerHTML = bb(cb);
return !b.parentElement
}),
N = function(a, b) {
if (db())
for (; a.lastChild;) a.removeChild(a.lastChild);
a.innerHTML = bb(b)
};
var fb = function(a, b) {
var c = eb;
return Object.prototype.hasOwnProperty.call(c, a) ? c[a] : c[a] = b(a)
};
var gb = F(K, "Opera"),
O = F(K, "Trident") || F(K, "MSIE"),
hb = F(K, "Edge"),
ib = F(K, "Gecko") && !(F(K.toLowerCase(), "webkit") && !F(K, "Edge")) && !(F(K, "Trident") || F(K, "MSIE")) && !F(K, "Edge"),
jb = F(K.toLowerCase(), "webkit") && !F(K, "Edge"),
kb = function() {
var a = w.document;
return a ? a.documentMode : void 0
},
lb;
a: {
var mb = "",
nb = function() {
var a = K;
if (ib) return /rv:([^\);]+)(\)|;)/.exec(a);
if (hb) return /Edge\/([\d\.]+)/.exec(a);
if (O) return /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);
if (jb) return /WebKit\/(\S+)/.exec(a);
if (gb) return /(?:Version)[ \/]?(\S+)/.exec(a)
}();nb && (mb = nb ? nb[1] : "");
if (O) {
var ob = kb();
if (null != ob && ob > parseFloat(mb)) {
lb = String(ob);
break a
}
}
lb = mb
}
var pb = lb,
eb = {},
qb = function(a) {
return fb(a, function() {
for (var b = 0, c = E(String(pb)).split("."), d = E(String(a)).split("."), e = Math.max(c.length, d.length), g = 0; 0 == b && g < e; g++) {
var k = c[g] || "",
f = d[g] || "";
do {
k = /(\d*)(\D*)(.*)/.exec(k) || ["", "", "", ""];
f = /(\d*)(\D*)(.*)/.exec(f) || ["", "", "", ""];
if (0 == k[0].length && 0 == f[0].length) break;
b = Ca(0 == k[1].length ? 0 : parseInt(k[1], 10), 0 == f[1].length ? 0 : parseInt(f[1], 10)) || Ca(0 == k[2].length, 0 == f[2].length) || Ca(k[2], f[2]);
k = k[3];
f = f[3]
} while (0 == b)
}
return 0 <= b
})
},
rb;
if (w.document && O) {
var sb = kb();
rb = sb ? sb : parseInt(pb, 10) || void 0
} else rb = void 0;
var tb = rb;
var ub = function() {
var a = document;
var b = "SPAN";
"application/xhtml+xml" === a.contentType && (b = b.toLowerCase());
return a.createElement(b)
},
vb = function(a) {
return a && a.parentNode ? a.parentNode.removeChild(a) : null
};
var wb = {
"* ARIA-CHECKED": !0,
"* ARIA-COLCOUNT": !0,
"* ARIA-COLINDEX": !0,
"* ARIA-DESCRIBEDBY": !0,
"* ARIA-DISABLED": !0,
"* ARIA-GOOG-EDITABLE": !0,
"* ARIA-LABEL": !0,
"* ARIA-LABELLEDBY": !0,
"* ARIA-MULTILINE": !0,
"* ARIA-MULTISELECTABLE": !0,
"* ARIA-ORIENTATION": !0,
"* ARIA-PLACEHOLDER": !0,
"* ARIA-READONLY": !0,
"* ARIA-REQUIRED": !0,
"* ARIA-ROLEDESCRIPTION": !0,
"* ARIA-ROWCOUNT": !0,
"* ARIA-ROWINDEX": !0,
"* ARIA-SELECTED": !0,
"* ABBR": !0,
"* ACCEPT": !0,
"* ACCESSKEY": !0,
"* ALIGN": !0,
"* ALT": !0,
"* AUTOCOMPLETE": !0,
"* AXIS": !0,
"* BGCOLOR": !0,
"* BORDER": !0,
"* CELLPADDING": !0,
"* CELLSPACING": !0,
"* CHAROFF": !0,
"* CHAR": !0,
"* CHECKED": !0,
"* CLEAR": !0,
"* COLOR": !0,
"* COLSPAN": !0,
"* COLS": !0,
"* COMPACT": !0,
"* COORDS": !0,
"* DATETIME": !0,
"* DIR": !0,
"* DISABLED": !0,
"* ENCTYPE": !0,
"* FACE": !0,
"* FRAME": !0,
"* HEIGHT": !0,
"* HREFLANG": !0,
"* HSPACE": !0,
"* ISMAP": !0,
"* LABEL": !0,
"* LANG": !0,
"* MAX": !0,
"* MAXLENGTH": !0,
"* METHOD": !0,
"* MULTIPLE": !0,
"* NOHREF": !0,
"* NOSHADE": !0,
"* NOWRAP": !0,
"* OPEN": !0,
"* READONLY": !0,
"* REQUIRED": !0,
"* REL": !0,
"* REV": !0,
"* ROLE": !0,
"* ROWSPAN": !0,
"* ROWS": !0,
"* RULES": !0,
"* SCOPE": !0,
"* SELECTED": !0,
"* SHAPE": !0,
"* SIZE": !0,
"* SPAN": !0,
"* START": !0,
"* SUMMARY": !0,
"* TABINDEX": !0,
"* TITLE": !0,
"* TYPE": !0,
"* VALIGN": !0,
"* VALUE": !0,
"* VSPACE": !0,
"* WIDTH": !0
},
xb = {
"* USEMAP": !0,
"* ACTION": !0,
"* CITE": !0,
"* HREF": !0,
"* LONGDESC": !0,
"* SRC": !0,
"LINK HREF": !0,
"* FOR": !0,
"* HEADERS": !0,
"* NAME": !0,
"A TARGET": !0,
"* CLASS": !0,
"* ID": !0,
"* STYLE": !0
};
var P = {};
function yb(a) {
if (O && !qb(9)) return [0, 0, 0, 0];
var b = P.hasOwnProperty(a) ? P[a] : null;
if (b) return b;
65536 < Object.keys(P).length && (P = {});
var c = [0, 0, 0, 0];
b = zb(a, /\\[0-9A-Fa-f]{6}\s?/g);
b = zb(b, /\\[0-9A-Fa-f]{1,5}\s/g);
b = zb(b, /\\./g);
b = b.replace(/:not\(([^\)]*)\)/g, " $1 ");
b = b.replace(/{[^]*/gm, "");
b = Q(b, c, /(\[[^\]]+\])/g, 2);
b = Q(b, c, /(#[^\#\s\+>~\.\[:]+)/g, 1);
b = Q(b, c, /(\.[^\s\+>~\.\[:]+)/g, 2);
b = Q(b, c, /(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi, 3);
b = Q(b, c, /(:[\w-]+\([^\)]*\))/gi, 2);
b = Q(b, c, /(:[^\s\+>~\.\[:]+)/g, 2);
b = b.replace(/[\*\s\+>~]/g, " ");
b = b.replace(/[#\.]/g, " ");
Q(b, c, /([^\s\+>~\.\[:]+)/g, 3);
b = c;
return P[a] = b
}
function Q(a, b, c, d) {
return a.replace(c, function(e) {
b[d] += 1;
return Array(e.length + 1).join(" ")
})
}
function zb(a, b) {
return a.replace(b, function(c) {
return Array(c.length + 1).join("A")
})
};
var Ab = {
rgb: !0,
rgba: !0,
alpha: !0,
rect: !0,
image: !0,
"linear-gradient": !0,
"radial-gradient": !0,
"repeating-linear-gradient": !0,
"repeating-radial-gradient": !0,
"cubic-bezier": !0,
matrix: !0,
perspective: !0,
rotate: !0,
rotate3d: !0,
rotatex: !0,
rotatey: !0,
steps: !0,
rotatez: !0,
scale: !0,
scale3d: !0,
scalex: !0,
scaley: !0,
scalez: !0,
skew: !0,
skewx: !0,
skewy: !0,
translate: !0,
translate3d: !0,
translatex: !0,
translatey: !0,
translatez: !0
},
Bb = /[\n\f\r"'()*<>]/g,
Cb = {
"\n": "%0a",
"\f": "%0c",
"\r": "%0d",
'"': "%22",
"'": "%27",
"(": "%28",
")": "%29",
"*": "%2a",
"<": "%3c",
">": "%3e"
};
function Db(a) {
return Cb[a]
}
var Eb = function(a, b, c) {
b = E(b);
if ("" == b) return null;
var d = String(b.substr(0, 4)).toLowerCase();
if (0 == ("url(" < d ? -1 : "url(" == d ? 0 : 1)) {
if (!b.endsWith(")") || 1 < (b ? b.split("(").length - 1 : 0) || 1 < (b ? b.split(")").length - 1 : 0) || !c) a = null;
else {
a: for (b = b.substring(4, b.length - 1), d = 0; 2 > d; d++) {
var e = "\"'".charAt(d);
if (b.charAt(0) == e && b.charAt(b.length - 1) == e) {
b = b.substring(1, b.length - 1);
break a
}
}
a = c ? (a = c(b, a)) && "about:invalid#zClosurez" != H(a) ? 'url("' + H(a).replace(Bb, Db) + '")' : null : null
}
return a
}
if (0 < b.indexOf("(")) {
if (/"|'/.test(b)) return null;
for (a = /([\-\w]+)\(/g; c = a.exec(b);)
if (!(c[1].toLowerCase() in Ab)) return null
}
return b
};
function R(a, b) {
a = w[a];
return a && a.prototype ? (b = Object.getOwnPropertyDescriptor(a.prototype, b)) && b.get || null : null
}
function S(a, b) {
return (a = w[a]) && a.prototype && a.prototype[b] || null
}
var Fb = R("Element", "attributes") || R("Node", "attributes"),
Gb = S("Element", "hasAttribute"),
Hb = S("Element", "getAttribute"),
Ib = S("Element", "setAttribute"),
Jb = S("Element", "removeAttribute"),
Kb = S("Element", "getElementsByTagName"),
Lb = S("Element", "matches") || S("Element", "msMatchesSelector"),
Mb = R("Node", "nodeName"),
Nb = R("Node", "nodeType"),
Ob = R("Node", "parentNode"),
Pb = R("HTMLElement", "style") || R("Element", "style"),
Qb = R("HTMLStyleElement", "sheet"),
Rb = S("CSSStyleDeclaration", "getPropertyValue"),
Sb = S("CSSStyleDeclaration",
"setProperty");
function T(a, b, c, d) {
if (a) return a.apply(b);
a = b[c];
if (!d(a)) throw Error("Clobbering detected");
return a
}
function U(a, b, c, d) {
if (a) return a.apply(b, d);
if (O && 10 > document.documentMode) {
if (!b[c].call) throw Error("IE Clobbering detected");
} else if ("function" != typeof b[c]) throw Error("Clobbering detected");
return b[c].apply(b, d)
}
function Tb(a) {
return T(Fb, a, "attributes", function(b) {
return b instanceof NamedNodeMap
})
}
function Ub(a, b, c) {
try {
U(Ib, a, "setAttribute", [b, c])
} catch (d) {
if (-1 == d.message.indexOf("A security problem occurred")) throw d;
}
}
function Vb(a) {
return T(Pb, a, "style", function(b) {
return b instanceof CSSStyleDeclaration
})
}
function Wb(a) {
return T(Qb, a, "sheet", function(b) {
return b instanceof CSSStyleSheet
})
}
function V(a) {
return T(Mb, a, "nodeName", function(b) {
return "string" == typeof b
})
}
function Xb(a) {
return T(Nb, a, "nodeType", function(b) {
return "number" == typeof b
})
}
function W(a) {
return T(Ob, a, "parentNode", function(b) {
return !(b && "string" == typeof b.name && b.name && "parentnode" == b.name.toLowerCase())
})
}
function Yb(a, b) {
return U(Rb, a, a.getPropertyValue ? "getPropertyValue" : "getAttribute", [b]) || ""
}
function Zb(a, b, c) {
U(Sb, a, a.setProperty ? "setProperty" : "setAttribute", [b, c])
};
var $b = O && 10 > document.documentMode ? null : /\s*([^\s'",]+[^'",]*(('([^'\r\n\f\\]|\\[^])*')|("([^"\r\n\f\\]|\\[^])*")|[^'",])*)/g,
ac = {
"-webkit-border-horizontal-spacing": !0,
"-webkit-border-vertical-spacing": !0
},
dc = function(a, b, c) {
var d = [];
a = bc(xa(a.cssRules));
B(a, function(e) {
if (b && !/[a-zA-Z][\w-:\.]*/.test(b)) throw Error("Invalid container id");
if (!(b && O && 10 == document.documentMode && /\\['"]/.test(e.selectorText))) {
var g = b ? e.selectorText.replace($b, "#" + b + " $1") : e.selectorText;
d.push(Va(g, cc(e.style, c)))
}
});
return Xa(d)
},
bc = function(a) {
return ua(a, function(b) {
return b instanceof CSSStyleRule || b.type == CSSRule.STYLE_RULE
})
},
fc = function(a, b, c) {
a = ec("<style>" + a + "</style>");
return null == a || null == a.sheet ? Ya : dc(a.sheet, void 0 != b ? b : null, c)
},
ec = function(a) {
if (O && !qb(10) || "function" != typeof w.DOMParser) return null;
a = M("<html><head></head><body>" + a + "</body></html>");
return (new DOMParser).parseFromString(bb(a), "text/html").body.children[0]
},
cc = function(a, b) {
if (!a) return La;
var c = document.createElement("div").style,
d = gc(a);
B(d, function(e) {
var g = jb && e in ac ? e : e.replace(/^-(?:apple|css|epub|khtml|moz|mso?|o|rim|wap|webkit|xv)-(?=[a-z])/i, "");
0 != g.lastIndexOf("--", 0) && 0 != g.lastIndexOf("var", 0) && (e = Yb(a, e), e = Eb(g, e, b), null != e && Zb(c, g, e))
});
return Ia(c.cssText || "")
},
ic = function(a) {
var b = Array.from(U(Kb, a, "getElementsByTagName", ["STYLE"])),
c = ya(b, function(e) {
return xa(Wb(e).cssRules)
});
c = bc(c);
c.sort(function(e, g) {
e = yb(e.selectorText);
a: {
g = yb(g.selectorText);
for (var k = Math.min(e.length, g.length), f = 0; f < k; f++) {
var h =
e[f];
var l = g[f];
h = h > l ? 1 : h < l ? -1 : 0;
if (0 != h) {
e = h;
break a
}
}
e = e.length;g = g.length;e = e > g ? 1 : e < g ? -1 : 0
}
return -e
});
a = document.createTreeWalker(a, NodeFilter.SHOW_ELEMENT, null, !1);
for (var d; d = a.nextNode();) B(c, function(e) {
U(Lb, d, d.matches ? "matches" : "msMatchesSelector", [e.selectorText]) && e.style && hc(d, e.style)
});
B(b, vb)
},
hc = function(a, b) {
var c = gc(a.style),
d = gc(b);
B(d, function(e) {
if (!(0 <= c.indexOf(e))) {
var g = Yb(b, e);
Zb(a.style, e, g)
}
})
},
gc = function(a) {
var b = ma(a);
"array" == b || "object" == b && "number" == typeof a.length ?
a = xa(a) : (a = za(a), b = ta(a, "cssText"), 0 <= b && Array.prototype.splice.call(a, b, 1));
return a
};
var jc = "undefined" != typeof WeakMap && -1 != WeakMap.toString().indexOf("[native code]"),
kc = 0,
lc = function() {
this.c = [];
this.b = [];
this.a = "data-elementweakmap-index-" + kc++
};
lc.prototype.set = function(a, b) {
if (U(Gb, a, "hasAttribute", [this.a])) {
var c = parseInt(U(Hb, a, "getAttribute", [this.a]) || null, 10);
this.b[c] = b
} else c = this.b.push(b) - 1, Ub(a, this.a, c.toString()), this.c.push(a);
return this
};
lc.prototype.get = function(a) {
if (U(Gb, a, "hasAttribute", [this.a])) return a = parseInt(U(Hb, a, "getAttribute", [this.a]) || null, 10), this.b[a]
};
lc.prototype.clear = function() {
this.c.forEach(function(a) {
U(Jb, a, "removeAttribute", [this.a])
}, this);
this.c = [];
this.b = []
};
var mc;
(mc = !O) || (mc = 10 <= Number(tb));
var nc = mc,
oc = !O || null == document.documentMode,
pc = function() {};
var qc = {
APPLET: !0,
AUDIO: !0,
BASE: !0,
BGSOUND: !0,
EMBED: !0,
FORM: !0,
IFRAME: !0,
ISINDEX: !0,
KEYGEN: !0,
LAYER: !0,
LINK: !0,
META: !0,
OBJECT: !0,
SCRIPT: !0,
SVG: !0,
STYLE: !0,
TEMPLATE: !0,
VIDEO: !0
};
var rc = {
A: !0,
ABBR: !0,
ACRONYM: !0,
ADDRESS: !0,
AREA: !0,
ARTICLE: !0,
ASIDE: !0,
B: !0,
BDI: !0,
BDO: !0,
BIG: !0,
BLOCKQUOTE: !0,
BR: !0,
BUTTON: !0,
CAPTION: !0,
CENTER: !0,
CITE: !0,
CODE: !0,
COL: !0,
COLGROUP: !0,
DATA: !0,
DATALIST: !0,
DD: !0,
DEL: !0,
DETAILS: !0,
DFN: !0,
DIALOG: !0,
DIR: !0,
DIV: !0,
DL: !0,
DT: !0,
EM: !0,
FIELDSET: !0,
FIGCAPTION: !0,
FIGURE: !0,
FONT: !0,
FOOTER: !0,
FORM: !0,
H1: !0,
H2: !0,
H3: !0,
H4: !0,
H5: !0,
H6: !0,
HEADER: !0,
HGROUP: !0,
HR: !0,
I: !0,
IMG: !0,
INPUT: !0,
INS: !0,
KBD: !0,
LABEL: !0,
LEGEND: !0,
LI: !0,
MAIN: !0,
MAP: !0,
MARK: !0,
MENU: !0,
METER: !0,
NAV: !0,
NOSCRIPT: !0,
OL: !0,
OPTGROUP: !0,
OPTION: !0,
OUTPUT: !0,
P: !0,
PRE: !0,
PROGRESS: !0,
Q: !0,
S: !0,
SAMP: !0,
SECTION: !0,
SELECT: !0,
SMALL: !0,
SOURCE: !0,
SPAN: !0,
STRIKE: !0,
STRONG: !0,
STYLE: !0,
SUB: !0,
SUMMARY: !0,
SUP: !0,
TABLE: !0,
TBODY: !0,
TD: !0,
TEXTAREA: !0,
TFOOT: !0,
TH: !0,
THEAD: !0,
TIME: !0,
TR: !0,
TT: !0,
U: !0,
UL: !0,
VAR: !0,
WBR: !0
};
var sc = {
"ANNOTATION-XML": !0,
"COLOR-PROFILE": !0,
"FONT-FACE": !0,
"FONT-FACE-SRC": !0,
"FONT-FACE-URI": !0,
"FONT-FACE-FORMAT": !0,
"FONT-FACE-NAME": !0,
"MISSING-GLYPH": !0
},
wc = function(a) {
a = a || new tc;
uc(a);
this.a = C(a.a);
this.i = C(a.w);
this.c = C(a.C);
this.m = a.u;
B(a.l, function(b) {
if (0 != b.lastIndexOf("data-", 0)) throw new A('Only "data-" attributes allowed, got: %s.', [b]);
if (0 == b.lastIndexOf("data-sanitizer-", 0)) throw new A('Attributes with "%s" prefix are not allowed, got: %s.', ["data-sanitizer-", b]);
this.a["* " +
b.toUpperCase()] = vc
}, this);
B(a.j, function(b) {
b = b.toUpperCase();
if (!F(b, "-") || sc[b]) throw new A("Only valid custom element tag names allowed, got: %s.", [b]);
this.c[b] = !0
}, this);
this.l = a.c;
this.f = a.v;
this.b = null;
this.j = a.m
};
ra(wc, pc);
var xc = function(a) {
return function(b, c) {
return (b = a(E(b), c)) && "about:invalid#zClosurez" != H(b) ? H(b) : null
}
},
tc = function() {
this.a = {};
B([wb, xb], function(a) {
B(za(a), function(b) {
this.a[b] = vc
}, this)
}, this);
this.b = {};
this.l = [];
this.j = [];
this.w = C(qc);
this.C = C(rc);
this.u = !1;
this.G = Ga;
this.F = this.i = this.D = this.c = sa;
this.v = null;
this.f = this.m = !1
},
yc = function(a, b) {
return function(c, d, e, g) {
c = a(c, d, e, g);
return null == c ? null : b(c, d, e, g)
}
},
X = function(a, b, c, d) {
a[c] && !b[c] && (a[c] = yc(a[c], d))
},
zc = function() {
var a = new tc;
return new wc(a)
},
uc = function(a) {
if (a.f) throw Error("HtmlSanitizer.Builder.build() can only be used once.");
X(a.a, a.b, "* USEMAP", Ac);
var b = xc(a.G);
B(["* ACTION", "* CITE", "* HREF"], function(d) {
X(this.a, this.b, d, b)
}, a);
var c = xc(a.c);
B(["* LONGDESC", "* SRC", "LINK HREF"], function(d) {
X(this.a, this.b, d, c)
}, a);
B(["* FOR", "* HEADERS", "* NAME"], function(d) {
X(this.a, this.b, d, x(Bc, this.D))
}, a);
X(a.a, a.b, "A TARGET", x(Cc, ["_blank", "_self"]));
X(a.a, a.b, "* CLASS", x(Dc, a.i));
X(a.a, a.b, "* ID", x(Ec, a.i));
X(a.a, a.b,
"* STYLE", x(a.F, c));
a.f = !0
},
Fc = function(a, b) {
a || (a = "*");
return (a + " " + b).toUpperCase()
},
vc = function(a) {
return E(a)
},
Cc = function(a, b) {
b = E(b);
return 0 <= ta(a, b.toLowerCase()) ? b : null
},
Ac = function(a) {
return (a = E(a)) && "#" == a.charAt(0) ? a : null
},
Bc = function(a, b, c) {
return a(E(b), c)
},
Dc = function(a, b, c) {
b = b.split(/(?:\s+)/);
for (var d = [], e = 0; e < b.length; e++) {
var g = a(b[e], c);
g && d.push(g)
}
return 0 == d.length ? null : d.join(" ")
},
Ec = function(a, b, c) {
return a(E(b), c)
},
Hc = function(a, b) {
var c = !("STYLE" in a.i) && "STYLE" in a.c;
c = "*" == a.f && c ? "sanitizer-" + (Math.floor(2147483648 * Math.random()).toString(36) + Math.abs(Math.floor(2147483648 * Math.random()) ^ qa()).toString(36)) : a.f;
a.b = c;
if (nc) {
c = b;
if (nc) {
b = ub();
a.b && "*" == a.f && (b.id = a.b);
a.j && (c = ec("<div>" + c + "</div>"), ic(c), c = c.innerHTML);
c = M(c);
var d = document.createElement("template");
if (oc && "content" in d) N(d, c), d = d.content;
else {
var e = document.implementation.createHTMLDocument("x");
d = e.body;
N(e.body, c)
}
c = document.createTreeWalker(d, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, null, !1);
for (d = jc ? new WeakMap : new lc; e = c.nextNode();) {
c: {
var g = a;
var k = e;
switch (Xb(k)) {
case 3:
g = Gc(g, k);
break c;
case 1:
if ("TEMPLATE" == V(k).toUpperCase()) g = null;
else {
var f = V(k).toUpperCase();
if (f in g.i) var h = null;
else g.c[f] ? h = document.createElement(f) : (h = ub(), g.m && Ub(h, "data-sanitizer-original-tag", f.toLowerCase()));
if (h) {
var l = h,
m = Tb(k);
if (null != m)
for (var r = 0; f = m[r]; r++)
if (f.specified) {
var n = g;
var p = k,
q = f,
v = q.name;
if (0 == v.lastIndexOf("data-sanitizer-", 0)) n = null;
else {
var la = V(p);
q = q.value;
var Ja = {
tagName: E(la).toLowerCase(),
attributeName: E(v).toLowerCase()
},
Ka = {
o: void 0
};
"style" == Ja.attributeName && (Ka.o = Vb(p));
p = Fc(la, v);
p in n.a ? (n = n.a[p], n = n(q, Ja, Ka)) : (v = Fc(null, v), v in n.a ? (n = n.a[v], n = n(q, Ja, Ka)) : n = null)
}
null !== n && Ub(l, f.name, n)
}
g = h
} else g = null
}
break c;
default:
g = null
}
}
if (g) {
if (1 == Xb(g) && d.set(e, g), e = W(e), k = !1, e) f = Xb(e), h = V(e).toLowerCase(), l = W(e), 11 != f || l ? "body" == h && l && (f = W(l)) && !W(f) && (k = !0) : k = !0, f = null, k || !e ? f = b : 1 == Xb(e) && (f = d.get(e)), f.content && (f = f.content), f.appendChild(g)
} else
for (g = e; e = g.firstChild;) g.removeChild(e)
}
d.clear &&
d.clear();
a = b
} else a = ub();
0 < Tb(a).length && (b = ub(), b.appendChild(a), a = b);
a = (new XMLSerializer).serializeToString(a);
a = a.slice(a.indexOf(">") + 1, a.lastIndexOf("</"))
} else a = "";
return M(a)
},
Gc = function(a, b) {
var c = b.data;
(b = W(b)) && "style" == V(b).toLowerCase() && !("STYLE" in a.i) && "STYLE" in a.c && (c = Wa(fc(c, a.b, pa(function(d, e) {
return this.l(d, {
H: e
})
}, a))));
return document.createTextNode(c)
};
var Ic = [],
Jc = 0,
Kc = new Map;
function Lc(a) {
for (var b = {
left: 0,
top: 0
}; a;) b.left += a.offsetLeft, b.top += a.offsetTop, a = a.offsetParent;
return b
}
function Mc(a, b) {
for (; a && (!a.classList || !a.classList.contains(b));) a = a.parentNode;
return a || null
}
function Nc(a) {
Oc(a.target, !1);
Y(!1)
}
function Pc(a) {
Oc(a.target, !0);
Y(!1)
}
function Oc(a, b) {
var c = a.nextSibling,
d = "none" == getComputedStyle(c).display;
b = b ? d ? MSG_HIDE_ELIDED : MSG_SHOW_ELIDED : d ? MSG_HIDE_ORIGINAL : MSG_SHOW_ORIGINAL;
b = Hc(zc(), b);
N(a, b);
c.style.display = d ? "block" : "none";
d && Qc([c])
}
function Rc(a) {
a = a.getElementsByClassName("mail-message-toggle");
for (var b = 0, c; c = a[b]; b++) {
var d = Hc(zc(), MSG_SHOW_ORIGINAL);
N(c, d);
c.onclick = Nc
}
}
function Sc(a, b) {
a = a.getElementsByClassName("elided-text");
for (var c, d = 0, e; e = a[d]; d++) {
c = document.createElement("div");
c.className = "mail-elided-text";
var g = Hc(zc(), MSG_SHOW_ELIDED);
N(c, g);
c.setAttribute("dir", "auto");
c.onclick = Pc;
e.style.display = "none";
e.parentNode.insertBefore(c, e);
b && Oc(c, !0)
}
}
function Qc(a) {
var b, c;
var d = document.body.offsetWidth;
for (b = 0; b < a.length; b++) {
var e = a[b];
if (c = e.style.zoom) e.style.zoom = 1;
if (!Tc(e, d, e.scrollWidth) && NORMALIZE_MESSAGE_WIDTHS) {
c = e.scrollWidth;
c = c > d ? d / c : 1;
var g = e.classList.contains("mail-message-content") ? 1 : (g = Mc(e, "mail-message-content")) ? g.style.zoom : 1;
e.style.zoom = c / g
}
}
}
function Tc(a, b, c) {
var d = c;
var e = [],
g = [],
k = !1,
f = [];
if (c <= b) return !0;
var h = Date.now();
if (a.parentElement.classList.contains("mail-message")) var l = a.parentElement.id;
d = !1;
d = ENABLE_MUNGE_TABLES ? a.querySelectorAll("div[style], textarea[style]") : [];
if (d = Uc(d, b, e)) d = a.scrollWidth, console.log("ran div-width munger on el=" + a + " oldW=" + c + " newW=" + d + " docW=" + b), d <= b && (k = !0);
!k && (d = ENABLE_MUNGE_IMAGES ? a.querySelectorAll("img") : [], d = Vc(d, b, e)) && (d = a.scrollWidth, console.log("ran img munger on el=" + a + " oldW=" + c +
" newW=" + d + " docW=" + b), d <= b && (k = !0));
!k && (d = ENABLE_MUNGE_TABLES ? a.querySelectorAll("table") : [], d = Wc(d, Xc, g)) && (d = a.scrollWidth, console.log("ran table munger on el=" + a + " oldW=" + c + " newW=" + d + " docW=" + b), d <= b && (k = !0));
!k && (d = ENABLE_MUNGE_TABLES ? a.querySelectorAll("td") : [], d = Wc(d, null, g)) && (d = a.scrollWidth, console.log("ran td munger on el=" + a + " oldW=" + c + " newW=" + d + " docW=" + b), d <= b ? k = !0 : (console.log("Revert table and td munger because it didn't help"), Yc(g)));
!k && NORMALIZE_MESSAGE_WIDTHS && (f = Zc(b, e), 0 <
f.length && (f.forEach(function(m) {
m.node.style.display = "none"
}), d = a.scrollWidth, console.log("ran table zoom on el=" + a + " oldW=" + c + " newW=" + d + " docW=" + b), d <= b && (k = !0), f.forEach(function(m) {
m.node.style.display = m.s
})));
if (k) {
if (l) ConversationView.onMessageTransform(JS_TOKEN, l);
console.log("munger(s) succeeded, elapsed time=" + (Date.now() - h));
return !0
}
Yc(e);
0 < e.length && console.log("all mungers failed, changes reversed. elapsed time=" + (Date.now() - h));
return !1
}
function Yc(a) {
for (var b = 0, c; c = a[b]; b++) c[0].apply(c[1], c[2])
}
function Wc(a, b, c) {
var d, e = !1;
var g = 0;
for (d = a.length; g < d; g++) {
var k = a[g];
b && !b(k) || k.classList.contains("munged") || (k.classList.add("munged"), e = !0, c.push([k.classList.remove, k.classList, ["munged"]]))
}
return e
}
function Uc(a, b, c) {
var d, e, g = !1;
var k = 0;
for (d = a.length; k < d; k++) {
var f = a[k];
var h = (e = f.style.width || f.style.minWidth) ? e.indexOf("px") : -1;
0 <= h && e.slice(0, h) > b && (Z(f, "width", c), Z(f, "minWidth", c), Z(f, "maxWidth", c), f.style.width = "100%", f.style.minWidth = "", f.style.maxWidth = e, g = !0)
}
return g
}
function Vc(a, b, c) {
var d, e, g, k = !1,
f = [];
var h = 0;
for (d = a.length; h < d; h++) {
for (g = e = a[h]; g && (!g.tagName || "table" !== g.tagName.toLowerCase());) g = g.parentNode;
if (!g) {
g = e.offsetWidth;
var l = e.offsetHeight;
var m = e.getAttribute("blocked-src");
var r = e.style.marginLeft;
var n = e.style.marginRight;
var p = 0 <= (r ? r.indexOf("px") : -1) ? parseInt(r, 10) : 0;
p += 0 <= (n ? n.indexOf("px") : -1) ? parseInt(n, 10) : 0;
console.log("nodeOffsetWidth is " + e.offsetWidth + ", marginL is " + r + ", marginR is " + n + ", total margin is " + p);
n = m ? 2 : 0;
g + p > b && (m ?
(Z(e, "maxWidth", f), Z(e, "width", f), Kc.set(e, f)) : (Z(e, "maxWidth", c), Z(e, "width", c), Z(e, "height", c)), e.style.maxWidth = b - p - n + "px", e.style.width = "100%", null == m && (e.style.height = 5 > l ? l : "auto"), k = !0)
}
}
return k
}
function Zc(a, b) {
var c = document.querySelectorAll("table"),
d = [];
c = [].slice.call(c);
c.forEach(function(e) {
e.classList.remove("zoom-out");
e.style.zoom = 1
});
c.forEach(function(e) {
if (!Mc(e, "zoom-out")) {
var g = a / e.scrollWidth;
1 > g && (Z(e, "zoom", b), b.push([e.classList.remove, e.classList, ["zoom-out"]]), e.style.zoom = g, e.classList.add("zoom-out"), console.log("zoomed out the table"), d.push({
node: e,
s: e.style.display
}))
}
});
return d
}
function Z(a, b, c) {
var d = "data-" + b;
a.setAttribute(d, a.style[b]);
c.push([$c, null, [a, b, d]])
}
function $c(a, b, c) {
a.style[b] = c ? a.getAttribute(c) : ""
}
function Xc(a) {
return a.hasAttribute("width") || a.style.width
}
function ad(a) {
var b, c, d = 0,
e = [],
g = [];
var k = 0;
for (b = a.length; k < b; k++) {
var f = a[k];
var h = f.classList.contains("mail-show-images");
var l = f.classList.contains(REWRITE_IMAGE_URL_CLASS_NAME);
var m = f.getElementsByTagName("img");
Jc = m.length;
var r = 0;
for (c = m.length; r < c; r++) {
var n = m[r];
var p = n;
var q = l,
v = p.getAttribute("blocked-src");
q = q && v ? v : p.src;
p.src = q;
0 == q.indexOf(DOC_BASE_URI) && DOC_BASE_URI != CONVERSATION_BASE_URI ? (q = CONVERSATION_BASE_URI + q.substring(DOC_BASE_URI.length), p = p.src = q) : p = SAPI_INLINE_IMAGE_URL_PATTERN &&
q.match(SAPI_INLINE_IMAGE_URL_PATTERN) ? q : SAPI_IMAP_INLINE_IMAGE_URL_PATTERN && q.match(SAPI_IMAP_INLINE_IMAGE_URL_PATTERN) ? bd(q) : "cid:" == q.substring(0, 4) ? q : null;
q = !1;
if (p) {
e[d] = p;
if (0 == p.indexOf("https://mail.google.com") || 0 == p.indexOf("https://" + IMAP_INLINE_ATTACHMENT_AUTHORITY)) cd(n), q = !0;
g[d] = f.parentNode.id;
d++
}
v = n;
var la = v.src;
v.src = "";
v.onload = dd;
v.src = la;
q || h && (!p || "cid:" != p.substring(0, 4)) || cd(n)
}
}
ConversationView.onInlineAttachmentsParsed(JS_TOKEN, e, g);
if (0 < e.length) ConversationView.onImageLoadRequestsCreated(JS_TOKEN,
e.length)
}
function dd(a) {
Jc--;
if (0 === Jc) {
for (var b = document.getElementsByClassName("gmail-ads-delayed-elements"), c = 0; c < b.length; c++) b[c].style.visibility = "visible";
ConversationView.onAllContentLoaded(JS_TOKEN)
}
if (a && a.target && void 0 !== a.target.src) ConversationView.onImageLoadFinished(JS_TOKEN, a.target.src);
if (a = Mc(a.target, "elided-text") || Mc(a.target, "mail-message-content")) 0 == Ic.length && window.setTimeout(ed, 0), -1 == Ic.indexOf(a) && Ic.push(a)
}
function ed() {
Qc(Ic);
Y(!1);
ConversationView.onAllImagesLoadFinished(JS_TOKEN);
Ic = []
}
function cd(a) {
var b = a.src;
0 == b.indexOf("http://") || 0 == b.indexOf("https://") || 0 == b.indexOf("content://") || 0 == b.indexOf("cid:") ? (a.setAttribute("blocked-src", b), a.src = "blocked") : 0 == b.indexOf("btdimap://attachment") && (a.setAttribute("blocked-src", bd(b)), a.src = "blocked")
}
function Y(a) {
var b, c = 0,
d = document.querySelectorAll(".expanded > .mail-message-content");
var e = Array(d.length + 1);
var g = Array(d.length + 1);
var k = 0;
for (b = d.length; k < b; k++) {
var f = d[k];
var h = f.previousElementSibling;
e[k] = c;
g[k] = Lc(h).top + h.offsetHeight;
c = Lc(f.nextElementSibling).top
}
e[k] = c;
g[k] = document.documentElement.scrollHeight;
a && console.log("overlayTops: " + e.toString() + "; overlayBottoms: " + g.toString());
ConversationView.onWebContentGeometryChange(JS_TOKEN, e, g)
}
function fd(a, b) {
var c;
if (c = a.getAttribute("blocked-src")) {
var d = !1;
if (0 == c.indexOf("https://mail.google.com") || 0 == c.indexOf("https://" + IMAP_INLINE_ATTACHMENT_AUTHORITY)) d = ConversationView.downloadInlineAttachment(JS_TOKEN, c, b);
d || (a.src = c, a.removeAttribute("blocked-src"), gd(a))
}
}
function gd(a) {
var b = Kc.get(a);
b && (Yc(b), Kc.delete(a))
}
function hd(a, b) {
a = document.querySelector("#" + id(a) + " > .mail-message-header");
jd(a, b)
}
function jd(a, b) {
a ? (a.style.height = b + "px", Y(!1)) : console.log("can't set spacer height")
}
function kd(a) {
Rc(a);
Sc(a, !0);
ad([a]);
ld(a);
Mc(a, "mail-message").classList.contains("expanded") && Qc([a])
}
function md() {
var a = document.getElementsByTagName("FORM"),
b, c;
for (b = 0; b < a.length; ++b)
if ("POST" === a[b].method.toUpperCase()) {
a[b].onsubmit = function() {
alert(MSG_FORMS_ARE_DISABLED);
return !1
};
var d = a[b].elements;
for (c = 0; c < d.length; ++c) "submit" != d[c].type && (d[c].disabled = !0)
}
}
function ld(a) {
a = a.getElementsByTagName("A");
for (var b = 0; b < a.length; ++b) {
var c = a[b],
d = c.getAttribute("href");
d && "#" != d[0] && c.addEventListener("click", nd, !0)
}
}
function nd(a) {
var b = a.currentTarget,
c;
for (c = b;
(c = c.parentElement) && !c.classList.contains("mail-message"););
var d = b.getAttribute("href");
if (d) {
var e = b.getAttribute("data-saferedirecturl") || "";
b = b.getAttribute("data-saferedirectreason") || "";
d = "gmail-link://?url=" + encodeURIComponent(d);
e && (d += "&safeRedirectUrl=" + encodeURIComponent(e));
b && (d += "&safeRedirectReason=" + encodeURIComponent(b));
null != c && (d += "&msgId=" + encodeURIComponent(c.id));
e = d
} else e = null;
e && (window.location = e);
a.preventDefault();
ConversationView.recordLinkClickForDynamicMailHoldbackGroup(JS_TOKEN,
c.id)
}
function id(a) {
a = a.replace(/#/g, "\\#");
a = a.replace(/:/g, "\\:");
return a = a.replace(/=/g, "\\=")
}
function bd(a) {
return 0 == !a.indexOf("btdimap://attachment") ? null : "https://" + IMAP_INLINE_ATTACHMENT_AUTHORITY + "/" + a.substring(20)
}
y("setConversationPromotionSpacerHeight", function(a) {
var b = document.getElementById("conversation-promotion");
b ? (b.style.height = a + "px", Y(!1)) : console.log("can't set spacer for conversation promotion")
});
y("setConversationFooterSpacerHeight", function(a) {
var b = document.getElementById("conversation-footer");
b ? (b.style.height = a + "px", Y(!1)) : console.log("can't set spacer for conversation footer")
});
y("setMessageHeaderSpacerHeight", hd);
y("setMessageFooterSpacerHeight", function(a, b) {
a = document.querySelector("#" + id(a) + " > .mail-message-footer");
jd(a, b)
});
y("setMessageBodyVisible", function(a, b, c, d) {
var e, g = c ? "block" : "none";
var k = id(a);
var f = document.querySelector("#" + k),
h = document.querySelectorAll("#" + k + " > .collapsible");
if (f && 0 != h.length) {
f.classList.toggle("expanded");
k = 0;
for (e = h.length; k < e; k++) {
var l = h[k];
b ? c ? (l.style.display = "block", l.style.position = "", l.style.visibility = "", l.style.top = "", l.style.bottom = "", l.style.zIndex = "", l.style.left = "") : (l.style.position = "absolute", l.style.visibility = "hidden", l.style.top = "0", l.style.bottom = "0", l.style.zIndex =
"-999999999", l.style.left = "-99999px") : l.style.display = g
}
c && Qc(f.getElementsByClassName("mail-message-content"));
hd(a, d)
} else console.log("can't set body visibility for message with id: " + a)
});
y("unblockImages", function(a) {
for (var b, c, d = c = 0, e; e = a[d]; d++)
if (b = document.getElementById(e)) {
var g = b.getElementsByClassName("mail-message-content")[0];
g && g.classList.add("mail-show-images");
b = b.getElementsByTagName("img");
c += b.length;
g = 0;
for (var k; k = b[g]; g++) fd(k, e)
} else console.log("can't unblock, no matching message for id: " + e);
if (0 < c) ConversationView.onImageLoadRequestsCreated(JS_TOKEN, c)
});
y("replaceSuperCollapsedBlock", function(a) {
var b;
if (b = document.querySelector(".mail-super-collapsed-block[index='" + a + "']")) {
a = b.parentNode;
var c = M(ConversationView.getSuperCollapseBlockHtml(JS_TOKEN));
N(b, c);
Rc(b);
Sc(b, !1);
ad(b.getElementsByClassName("mail-message-content"));
ld(b);
for (c = b.firstChild; c;) a.insertBefore(c, b), c = b.firstChild;
a.removeChild(b);
md();
Y(!1)
} else console.log("can't expand super collapsed block at index: " + a)
});
y("measurePositions", Y);
y("setConversationHeaderSpacerHeight", function(a) {
var b = document.getElementById("conversation-header");
b ? (b.style.height = a + "px", Y(!1)) : console.log("can't set spacer for conversation header")
});
y("setSmartMailCardSpacerHeight", function(a, b) {
(a = document.getElementById(a)) ? (a.style.height = b + "px", Y(!1)) : console.log("can't set spacer for smartmail card")
});
y("unblockAllTemporarilyHiddenImages", function() {
var a, b;
var c = document.getElementsByClassName("mail-message-content");
var d = 0;
for (a = c.length; d < a; d++) {
var e = c[d];
if (b = e.classList.contains("mail-show-images")) {
var g = e.getElementsByTagName("img");
e = 0;
for (b = g.length; e < b; e++) fd(g[e], "")
}
}
});
y("replaceMessageBodies", function(a) {
for (var b, c = 0, d; d = a[c]; c++)(b = document.querySelector("#" + id(d) + " > .mail-message-content")) ? (d = M(ConversationView.getMessageBody(JS_TOKEN, d)), N(b, d), kd(b)) : console.log("Mail message content for msg " + d + " to replace not found.");
md();
Y(!1)
});
y("appendMessageHtml", function() {
var a = document.createElement("div"),
b = M(ConversationView.getNewMessageHtml(JS_TOKEN));
N(a, b);
a = a.children[0];
document.body.insertBefore(a, document.getElementById("conversation-footer"));
kd(a.querySelector(".mail-message-content"));
md();
Y(!1)
});
y("refreshInlineAttachment", function(a) {
for (var b = document.getElementsByTagName("img"), c = 0; c < b.length; ++c) {
var d = b[c],
e = d.getAttribute("blocked-src");
e && e == a && (d.removeAttribute("blocked-src"), d.src = "" !== ATTACHMENT_DOWNLOAD_FINISH_POSTFIX ? e + "/" + ATTACHMENT_DOWNLOAD_FINISH_POSTFIX : e, gd(d))
}
});
y("reloadImage", function(a) {
a = document.querySelectorAll('img[src="' + a + '"]');
for (var b = 0; b < a.length; b++) a[b].src = a[b].src
});
document.addEventListener("DOMContentLoaded", function() {
ConversationView.createTracingInstant(JS_TOKEN, "DOMContentLoaded");
console.log("Measure positions upon DOMContentLoaded");
Y(!0);
if (ENABLE_CONTENT_READY) {
var a = ConversationView.getScrollYPercent(JS_TOKEN);
a && document.body.offsetHeight > window.innerHeight && (document.body.scrollTop = Math.floor(a * document.body.offsetHeight));
ConversationView.onContentReady(JS_TOKEN)
}
});
for (var od = document.getElementsByClassName("gmail-ads-delayed-elements"), pd = 0; pd < od.length; pd++) od[pd].style.visibility = "hidden";
Rc(document.documentElement);
Sc(document.documentElement, !1);
ad(document.getElementsByClassName("mail-message-content"));
var qd, rd, sd, td;
qd = document.querySelectorAll(".expanded > .mail-message-content");
a: {
var ud, vd, wd, xd;ud = 0;
for (vd = qd.length; ud < vd; ud++)
if (wd = qd[ud], xd = wd.textContent || wd.innerText, 0 < xd.trim().length) {
td = !1;
break a
}
td = !0
}
Qc(qd);
rd = document.getElementById("meta-viewport");
sd = [rd.getAttribute("content")];
td ? sd.push(rd.getAttribute("data-zoom-off")) : sd.push(rd.getAttribute("data-zoom-on"));
rd.setAttribute("content", sd.join(","));
md();
console.log("Measure positions in script.js");
Y(!0);
ld(document.documentElement);
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment