| 1 |
! function() { |
| 2 |
"use strict"; |
| 3 |
|
| 4 |
function e(e, t) { |
| 5 |
let n = t.parentNode; |
| 6 |
n.lastChild === t ? n.appendChild(e) : n.insertBefore(e, t.nextSibling) |
| 7 |
} |
| 8 |
|
| 9 |
function t(e, t = document) { |
| 10 |
if (t.evaluate) return t.evaluate(e, t, null, 9, null).singleNodeValue; |
| 11 |
e = e.replace(/^\/+/, ""); |
| 12 |
let n = e.split("/"), |
| 13 |
l = t; |
| 14 |
for (let i = 0, r = n.length; i < r && l; i += 1) { |
| 15 |
let a = /([^\[\]]+)(?:\[(\d+)\])?/.exec(n[i]); |
| 16 |
if (!a) return null; |
| 17 |
let [, u, o] = a, f = o ? o - 1 : 0; |
| 18 |
l = l.getElementsByTagName(u)[f] || null |
| 19 |
} |
| 20 |
return l |
| 21 |
} |
| 22 |
|
| 23 |
function n(t) { |
| 24 |
if (!t) return; |
| 25 |
let n = document.createDocumentFragment(), |
| 26 |
l = document.createElement("span"), |
| 27 |
i = document.createElement("script"); |
| 28 |
l.insertAdjacentHTML("beforeend", "{{HTML}}"), i.text = "{{SCRIPT}}", n.appendChild(l), n.appendChild(i), e(n, t) |
| 29 |
} |
| 30 |
Array.prototype.filter || (Array.prototype.filter = function(e, t) { |
| 31 |
if ("function" != typeof e) throw TypeError(); |
| 32 |
let n = []; |
| 33 |
for (let l = 0, i = this.length >>> 0; l < i; l += 1) |
| 34 |
if (l in this) { |
| 35 |
let r = this[l]; |
| 36 |
e.call(t, r, l, this) && n.push(r) |
| 37 |
} return n |
| 38 |
}), window.insertAfter = e, window.getElementByXPath = t, window.injectWidgetByXpath = function e(l) { |
| 39 |
let i = t(l) || document.getElementById("tbdefault"); |
| 40 |
i && n(i) |
| 41 |
}, window.injectWidgetByMarker = function e(t) { |
| 42 |
let l = document.getElementById(t); |
| 43 |
l && l.parentNode && n(l.parentNode) |
| 44 |
}, window.innerInject = n |
| 45 |
}(); |