URL | 12.28.142.50/ |
IP | ![]() |
ASN | #7018 ATT-INTERNET4 |
UserAgent | Mozilla/5.0 (X11; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0 |
Referer | |
Report completed | 2022-11-30 00:29:03 UTC |
Status | Loading report.. |
IDS alerts | 0 |
Blocklist alert | 62 |
urlquery alerts | No alerts detected |
Tags | None |
Fully Qualifying Domain Name | Rank | First Seen | Last Seen | IP | Comment |
---|---|---|---|---|---|
contile.services.mozilla.com (1) | 1114 | 2021-05-27 18:32:35 UTC | 2022-11-29 17:10:57 UTC | ![]() |
|
push.services.mozilla.com (1) | 2140 | 2014-10-24 08:27:06 UTC | 2020-05-03 10:09:39 UTC | ![]() |
|
img-getpocket.cdn.mozilla.net (6) | 1631 | 2018-06-21 23:36:00 UTC | 2020-02-19 04:43:25 UTC | ![]() |
|
12.28.142.50 (34) | 0 | No data | No data | ![]() |
Unknown ranking |
r3.o.lencr.org (5) | 344 | No data | No data | ![]() |
|
ocsp.digicert.com (2) | 86 | 2012-05-21 07:02:23 UTC | 2020-05-02 20:58:10 UTC | ![]() |
|
content-signature-2.cdn.mozilla.net (1) | 1152 | No data | No data | ![]() |
|
firefox.settings.services.mozilla.com (2) | 867 | 2020-06-04 20:08:41 UTC | 2022-11-29 17:14:13 UTC | ![]() |
Scan Date | Severity | Indicator | Comment |
---|---|---|---|
2022-11-30 | 2 | 12.28.142.50/ | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/page/login.asp?_1669768131123 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/seajs/seajs/sea.min.js | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/ui/css/login.css?version=Wed%20Nov%2030%202022%2000:28:51% (...) | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/ui/css/ui.css?version=1669768131343 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/seajs/config/sea-config.js?version=1669768132276 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/seajs/nocache/nocache.js | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/jsPlugin/polyfill2.js | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/jquery/jquery/jquery.min.js | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/common.js?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/jquery/cookie/jquery.cookie.js?version=V4.0.51b (...) | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/json2.js?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/jquery/layout/jquery.layout.js?version=V4.0.51b (...) | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/utils.js?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/base64.js?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/dialog.js?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/encryption/cryptico.min.js?version=V4.0.51build (...) | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/isapi/webAuth.js?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/encryption/crypto.min.js?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/ip/ip6.js?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/encryption/AES.js?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/ip/ipaddr.js?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/isapi/websdk.js?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/jsPlugin/jsVideoPlugin-1.0.0.min.js?version=V4. (...) | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/script/lib/jsPlugin/jsVideoPlugin-1.0.0.min.js | Malware |
2022-11-30 | 2 | 12.28.142.50/SDK/language | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/i18n/Languages.json?version=V4.0.51build210111 | Malware |
2022-11-30 | 2 | 12.28.142.50/doc/i18n/en/Common.json?version=V4.0.51build210111 | Malware |
Scan Date | Severity | Indicator | Comment |
---|---|---|---|
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
2022-11-30 | 2 | 12.28.142.50 | Sinkholed |
Date | UQ / IDS / BL | URL | IP |
---|---|---|---|
0 - 0 - 62 | 12.28.142.50/ | ![]() |
Date | UQ / IDS / BL | URL | IP |
---|---|---|---|
0 - 0 - 0 | 75.33.169.122 | ![]() |
|
0 - 1 - 0 | courtstuff.com/cgi-bin/as_web.exe?c05_03.ask+ (...) | ![]() |
|
0 - 1 - 0 | 108.89.0.7/ | ![]() |
|
0 - 0 - 1 | 108.225.9.92/CMSPluginInstaller64.msi | ![]() |
|
0 - 0 - 1 | 108.225.9.92/CMSPluginInstaller32.msi | ![]() |
Date | UQ / IDS / BL | URL | IP |
---|---|---|---|
0 - 0 - 62 | 12.28.142.50/ | ![]() |
Date | UQ / IDS / BL | URL | IP |
---|---|---|---|
0 - 0 - 0 | www.pllcfiles.com/alertcdn/images/edlv/transp (...) | ![]() |
|
0 - 0 - 2 | trieutin.com/loader/uploads/new-one_Eptbkolf.jpg | ![]() |
|
0 - 0 - 3 | trieutin.com/loader/uploads/Rahde_Bymoxstj.bmp | ![]() |
|
0 - 0 - 3 | trieutin.com/loader/uploads/Rahde_Bymoxstj.bmp | ![]() |
|
0 - 0 - 2 | trieutin.com/loader/uploads/Lzsyekr_Tkhbeypy.jpg | ![]() |
(function webpackUniversalModuleDefinition(e, t) {
if (typeof exports === "object" && typeof module === "object") module.exports = t();
else if (typeof define === "function" && define.amd) define([], t);
else {
var n = t();
for (var i in n)(typeof exports === "object" ? exports : e)[i] = n[i]
}
})(window, function() {
return function(n) {
var i = {};
function r(e) {
if (i[e]) {
return i[e].exports
}
var t = i[e] = {
i: e,
l: false,
exports: {}
};
n[e].call(t.exports, t, t.exports, r);
t.l = true;
return t.exports
}
r.m = n;
r.c = i;
r.d = function(e, t, n) {
if (!r.o(e, t)) {
Object.defineProperty(e, t, {
enumerable: true,
get: n
})
}
};
r.r = function(e) {
if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
Object.defineProperty(e, Symbol.toStringTag, {
value: "Module"
})
}
Object.defineProperty(e, "__esModule", {
value: true
})
};
r.t = function(t, e) {
if (e & 1) t = r(t);
if (e & 8) return t;
if (e & 4 && typeof t === "object" && t && t.__esModule) return t;
var n = Object.create(null);
r.r(n);
Object.defineProperty(n, "default", {
enumerable: true,
value: t
});
if (e & 2 && typeof t != "string")
for (var i in t) r.d(n, i, function(e) {
return t[e]
}.bind(null, i));
return n
};
r.n = function(e) {
var t = e && e.__esModule ? function n() {
return e["default"]
} : function i() {
return e
};
r.d(t, "a", t);
return t
};
r.o = function(e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
};
r.p = "";
return r(r.s = 13)
}([function(e, t, n) {
"use strict";
var i = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined";
function r(e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}
t.assign = function(e) {
var t = Array.prototype.slice.call(arguments, 1);
while (t.length) {
var n = t.shift();
if (!n) {
continue
}
if (typeof n !== "object") {
throw new TypeError(n + "must be non-object")
}
for (var i in n) {
if (r(n, i)) {
e[i] = n[i]
}
}
}
return e
};
t.shrinkBuf = function(e, t) {
if (e.length === t) {
return e
}
if (e.subarray) {
return e.subarray(0, t)
}
e.length = t;
return e
};
var o = {
arraySet: function(e, t, n, i, r) {
if (t.subarray && e.subarray) {
e.set(t.subarray(n, n + i), r);
return
}
for (var o = 0; o < i; o++) {
e[r + o] = t[n + o]
}
},
flattenChunks: function(e) {
var t, n, i, r, o, a;
i = 0;
for (t = 0, n = e.length; t < n; t++) {
i += e[t].length
}
a = new Uint8Array(i);
r = 0;
for (t = 0, n = e.length; t < n; t++) {
o = e[t];
a.set(o, r);
r += o.length
}
return a
}
};
var a = {
arraySet: function(e, t, n, i, r) {
for (var o = 0; o < i; o++) {
e[r + o] = t[n + o]
}
},
flattenChunks: function(e) {
return [].concat.apply([], e)
}
};
t.setTyped = function(e) {
if (e) {
t.Buf8 = Uint8Array;
t.Buf16 = Uint16Array;
t.Buf32 = Int32Array;
t.assign(t, o)
} else {
t.Buf8 = Array;
t.Buf16 = Array;
t.Buf32 = Array;
t.assign(t, a)
}
};
t.setTyped(i)
}, function(e, t, n) {
var i = n(17);
var r = n(18);
var o = r;
o.v1 = i;
o.v4 = r;
e.exports = o
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var i = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
function c(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var r = function() {
function e() {
c(this, e)
}
i(e, [{
key: "browser",
value: function f() {
var e = /(edge)[/]([\w.]+)/;
var t = /(chrome)[/]([\w.]+)/;
var n = /(safari)[/]([\w.]+)/;
var i = /(opera)(?:.*version)?[/]([\w.]+)/;
var r = /(msie) ([\w.]+)/;
var o = /(trident.*rv:)([\w.]+)/;
var a = /(mozilla)(?:.*? rv:([\w.]+))?/;
var s = navigator.userAgent.toLowerCase();
var u = e.exec(s) || t.exec(s) || n.exec(s) || i.exec(s) || r.exec(s) || o.exec(s) || s.indexOf("compatible") < 0 && a.exec(s) || ["unknow", "0"];
if (u.length > 0 && u[1].indexOf("trident") > -1) {
u[1] = "msie"
}
var l = {};
l[u[1]] = true;
l.version = u[2];
return l
}
}, {
key: "getCreateWndMode",
value: function o() {
var e = navigator.userAgent;
var t = navigator.platform;
var n = "Win64" === t || "Win32" === t || "Windows" === t;
var i = this.browser();
var r = true;
if (window.top !== window) {
r = false
} else {
if (n) {
if (e.indexOf("Windows NT 10.0") > -1 && i.mozilla) {
r = false
}
if (i.edge) {
r = false
}
} else {
r = false
}
}
return r
}
}, {
key: "getWndPostion",
value: function b(e, t, n, i, r) {
var o = 0;
var a = 0;
var s = e.offset();
var u = this.getDevicePixelRatio();
var l = parseInt(e.css("border-left-width"), 10);
var f = parseInt(e.css("border-top-width"), 10);
if (t) {
if (this.browser().msie) {
var c = window.outerWidth - window.innerWidth - (window.screenLeft - window.screenX);
o = s.left + (window.screenLeft - window.screenX) + l - c;
a = s.top + (window.screenTop - window.screenY) + f
} else {
var d = 0;
var h = 0;
var v = Math.round((window.outerWidth - window.innerWidth) / 2);
if (this.browser().chrome) {
if (-8 === v || 0 === window.screen.height - window.outerHeight) {
if (-8 === v) {
d = 8;
h = 8
}
} else if (8 === v) {
d = -5
} else if (0 === v) {
h = 8
}
}
if (this.browser().mozilla) {
if (7 === v || 6 === v) {
d = -6
} else if (8 === v) {
d = -8
} else if (0 === v) {}
if (window.opener) {
d = d - 8;
h = h - 30;
if (8 === v) {
d = d + 8
}
}
}
o = s.left + v + l + d;
a = s.top + (window.outerHeight - window.innerHeight - v) + f + h
}
} else {
if (this.browser().msie) {
var p = window.outerWidth - window.innerWidth - (window.screenLeft - window.screenX);
o = s.left + (window.screenLeft - window.screenX) + l - p;
a = s.top + (window.screenTop - window.screenY) + f
} else {
var m = (window.outerWidth - window.innerWidth) / 2;
o = s.left + m + l;
a = s.top + (window.outerHeight - window.innerHeight - m) + f;
if (this.browser().chrome) {
if (0 === m) {
o += 8;
a += 8
}
}
}
}
if (this.browser().chrome) {
o = s.left + l;
a = s.top + f
}
var y = 0;
var S = 0;
if (n && $("#" + n).length) {
var g = $("#" + n).offset();
if (!this.browser().msie) {
y = window.scrollX;
S = window.scrollY
}
var _ = Math.round((g.left - y) * u);
var P = Math.round((g.top - S) * u);
o += _;
a += P
} else {
if (!this.browser().msie) {
y = window.scrollX;
S = window.scrollY
}
o = Math.round((o - y) * u);
a = Math.round((a - S) * u)
}
if (i) {
var w = parent.$("#" + r).offset();
o += w.left;
a += w.top;
y = 0;
S = 0;
if (!this.browser().msie) {
y = parent.window.scrollX;
S = parent.window.scrollY
}
o = Math.round((o - y) * u);
a = Math.round((a - S) * u)
}
return {
left: o,
top: a
}
}
}, {
key: "detectPort",
value: function v(e, t, i) {
var r = this;
var o = [];
var n = null;
if (sessionStorage) {
n = parseInt(sessionStorage.getItem("LocalServiceControlPort"), 10);
if (n !== null) {
if (e <= n && n <= t) {
n = parseInt(n, 10)
} else {
sessionStorage.removeItem("LocalServiceControlPort");
n = null
}
}
}
for (var a = e; a <= t; a++) {
if (a === n) {
continue
}
o.push(a)
}
if (n !== null) {
o.unshift(n)
}
var s = 0;
var u = function u() {
s++;
if (o.length === s && i.error) {
i.error()
}
};
var l = function l(e) {
if (sessionStorage) {
sessionStorage.setItem("LocalServiceControlPort", e)
}
if (i.success) {
i.success(e)
}
};
var f = (new Date).getTime();
var c = function c(e, n) {
setTimeout(function() {
r.createImageHttp(o[n], {
oSessionInfo: i.oSessionInfo,
timeStamp: f + n,
success: function t(e) {
l(e)
},
error: function e() {
u()
}
})
}, 100)
};
for (var d = 0, h = o.length; d < h; d++) {
c(h, d)
}
}
}, {
key: "createImageHttp",
value: function a(e, t) {
var n = new Image;
n.onload = function() {
if (t.success) {
t.success(e)
}
};
n.onerror = function() {
if (t.error) {
t.error()
}
};
n.onabort = function() {
if (t.abort) {
t.abort()
}
};
var i = "http://127.0.0.1:" + e + "/imghttp/local?update=" + t.timeStamp;
var r = t.oSessionInfo;
if (r) {
i += "&sessionID=" + r.sessionID + "&user=" + encodeURIComponent(r.user) + "&challenge=" + r.challenge + "&iterations=" + r.iterations + "&random=" + r.random;
n.src = i
}
}
}, {
key: "utf8to16",
value: function s(e) {
var t = "";
var n = 0;
var i = void 0;
var r = void 0;
var o = void 0;
var a = void 0;
i = e.length;
while (n < i) {
r = e.charCodeAt(n++);
switch (r >> 4) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
t += e.charAt(n - 1);
break;
case 12:
case 13:
o = e.charCodeAt(n++);
t += String.fromCharCode((r & 31) << 6 | o & 63);
break;
case 14:
o = e.charCodeAt(n++);
a = e.charCodeAt(n++);
t += String.fromCharCode((r & 15) << 12 | (o & 63) << 6 | (a & 63) << 0);
break;
default:
break
}
}
return t
}
}, {
key: "createEventScript",
value: function r(e, t, n) {
var i = document.createElement("script");
i.htmlFor = e;
i.event = t;
i.innerHTML = n;
document.getElementById(e).appendChild(i)
}
}, {
key: "getDevicePixelRatio",
value: function t() {
var e = window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI;
return e
}
}, {
key: "createxmlDoc",
value: function u() {
var e;
var t = ["MSXML2.DOMDocument", "MSXML2.DOMDocument.5.0", "MSXML2.DOMDocument.4.0", "MSXML2.DOMDocument.3.0", "Microsoft.XmlDom"];
for (var n = 0, i = t.length; n < i; n++) {
try {
e = new ActiveXObject(t[n]);
break
} catch (r) {
e = document.implementation.createDocument("", "", null);
break
}
}
e.async = "false";
return e
}
}, {
key: "parseXmlFromStr",
value: function l(e) {
if (null === e || "" === e) {
return null
}
e = e.replace(/&(?!lt;|amp;|gt;|apos;|quot;)/g, "&");
var t = null;
try {
if (window.navigator.userAgent.indexOf("MSIE 9.0") > 0) {
t = new ActiveXObject("Microsoft.XMLDOM");
t.async = false;
t.loadXML(e)
} else {
var n = new DOMParser;
t = n.parseFromString(e, "text/xml")
}
} catch (i) {
t = new ActiveXObject("Microsoft.XMLDOM");
t.async = false;
t.loadXML(e)
}
return t
}
}]);
return e
}();
var o = t.oUtils = new r
}, function(e, t, n) {
"use strict";
e.exports = {
2: "need dictionary",
1: "stream end",
0: "",
"-1": "file error",
"-2": "stream error",
"-3": "data error",
"-4": "insufficient memory",
"-5": "buffer error",
"-6": "incompatible version"
}
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var h = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
function v(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var i = function() {
function e() {
v(this, e);
this._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
}
h(e, [{
key: "$",
value: function $(e) {
var t = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;
var n = /^(?:\s*(<[\w\W]+>)[^>]*|.([\w-]*))$/;
if (t.test(e)) {
var i = t.exec(e);
return document.getElementById(i[2])
} else if (n.test(e)) {
var r = n.exec(e);
var o = document.getElementsByTagName("*");
var a = [];
for (var s = 0, u = o.length; s < u; s++) {
if (o[s].className.match(new RegExp("(\\s|^)" + r[2] + "(\\s|$)"))) {
a.push(o[s])
}
}
return a
}
}
}, {
key: "dateFormat",
value: function r(e, t) {
var n = {
"M+": e.getMonth() + 1,
"d+": e.getDate(),
"h+": e.getHours(),
"m+": e.getMinutes(),
"s+": e.getSeconds(),
"q+": Math.floor((e.getMonth() + 3) / 3),
S: e.getMilliseconds()
};
if (/(y+)/.test(t)) {
t = t.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length))
}
for (var i in n) {
if (new RegExp("(" + i + ")").test(t)) {
t = t.replace(RegExp.$1, RegExp.$1.length === 1 ? n[i] : ("00" + n[i]).substr(("" + n[i]).length))
}
}
return t
}
}, {
key: "downloadFile",
value: function a(e, t) {
var n = e;
if (!(e instanceof Blob || e instanceof File)) {
n = new Blob([e])
}
var i = window.URL.createObjectURL(n);
var r = window.document.createElement("a");
r.href = i;
r.download = t;
var o = document.createEvent("MouseEvents");
o.initEvent("click", true, true);
r.dispatchEvent(o)
}
}, {
key: "createxmlDoc",
value: function o() {
var e;
var t = ["MSXML2.DOMDocument", "MSXML2.DOMDocument.5.0", "MSXML2.DOMDocument.4.0", "MSXML2.DOMDocument.3.0", "Microsoft.XmlDom"];
for (var n = 0, i = t.length; n < i; n++) {
try {
e = new ActiveXObject(t[n]);
break
} catch (r) {
e = document.implementation.createDocument("", "", null);
break
}
}
e.async = "false";
return e
}
}, {
key: "parseXmlFromStr",
value: function i(e) {
if (null === e || "" === e) {
return null
}
var t = this.createxmlDoc();
if (navigator.appName === "Netscape" || navigator.appName === "Opera") {
var n = new DOMParser;
t = n.parseFromString(e, "text/xml")
} else {
t.loadXML(e)
}
return t
}
}, {
key: "encode",
value: function f(e) {
var t = "";
var n;
var i;
var r;
var o;
var a;
var s;
var u;
var l = 0;
e = this._utf8_encode(e);
while (l < e.length) {
n = e.charCodeAt(l++);
i = e.charCodeAt(l++);
r = e.charCodeAt(l++);
o = n >> 2;
a = (n & 3) << 4 | i >> 4;
s = (i & 15) << 2 | r >> 6;
u = r & 63;
if (isNaN(i)) {
s = u = 64
} else if (isNaN(r)) {
u = 64
}
t = t + this._keyStr.charAt(o) + this._keyStr.charAt(a) + this._keyStr.charAt(s) + this._keyStr.charAt(u)
}
return t
}
}, {
key: "decode",
value: function c(e) {
var t = "";
var n;
var i;
var r;
var o;
var a;
var s;
var u;
var l = 0;
e = e.replace(/[^A-Za-z0-9+/=]/g, "");
while (l < e.length) {
o = this._keyStr.indexOf(e.charAt(l++));
a = this._keyStr.indexOf(e.charAt(l++));
s = this._keyStr.indexOf(e.charAt(l++));
u = this._keyStr.indexOf(e.charAt(l++));
n = o << 2 | a >> 4;
i = (a & 15) << 4 | s >> 2;
r = (s & 3) << 6 | u;
t = t + String.fromCharCode(n);
if (s !== 64) {
t = t + String.fromCharCode(i)
}
if (u !== 64) {
t = t + String.fromCharCode(r)
}
}
t = this._utf8_decode(t);
return t
}
}, {
key: "_utf8_encode",
value: function s(e) {
e = e.replace(/\r\n/g, "\n");
var t = "";
for (var n = 0; n < e.length; n++) {
var i = e.charCodeAt(n);
if (i < 128) {
t += String.fromCharCode(i)
} else if (i > 127 && i < 2048) {
t += String.fromCharCode(i >> 6 | 192);
t += String.fromCharCode(i & 63 | 128)
} else {
t += String.fromCharCode(i >> 12 | 224);
t += String.fromCharCode(i >> 6 & 63 | 128);
t += String.fromCharCode(i & 63 | 128)
}
}
return t
}
}, {
key: "_utf8_decode",
value: function u(e) {
var t = "";
var n = 0;
var i = 0;
var r = 0;
while (n < e.length) {
i = e.charCodeAt(n);
if (i < 128) {
t += String.fromCharCode(i);
n++
} else if (i > 191 && i < 224) {
r = e.charCodeAt(n + 1);
t += String.fromCharCode((i & 31) << 6 | r & 63);
n += 2
} else {
r = e.charCodeAt(n + 1);
var o = e.charCodeAt(n + 2);
t += String.fromCharCode((i & 15) << 12 | (r & 63) << 6 | o & 63);
n += 3
}
}
return t
}
}, {
key: "isFirefox",
value: function l() {
var e = false;
var t = navigator.userAgent.toLowerCase();
var n = "";
var i = -1;
if (t.match(/firefox\/([\d.]+)/)) {
n = t.match(/firefox\/([\d.]+)/)[1];
i = parseInt(n.split(".")[0], 10);
if (i > -1) {
e = true
}
}
return e
}
}, {
key: "isSafari",
value: function d() {
var e = false;
var t = navigator.userAgent.toLowerCase();
var n = "";
var i = -1;
if (t.match(/version\/([\d.]+).safari./)) {
n = t.match(/version\/([\d.]+).safari./)[1];
i = parseInt(n.split(".")[0], 10);
if (i > -1) {
e = true
}
}
return e
}
}, {
key: "isEdge",
value: function t() {
return navigator.userAgent.toLowerCase().indexOf("edge") > -1
}
}]);
return e
}();
var r = t.oTool = new i
}, function(e, t) {
var n = typeof crypto != "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != "undefined" && typeof window.msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto);
if (n) {
var i = new Uint8Array(16);
e.exports = function o() {
n(i);
return i
}
} else {
var r = new Array(16);
e.exports = function a() {
for (var e = 0, t; e < 16; e++) {
if ((e & 3) === 0) t = Math.random() * 4294967296;
r[e] = t >>> ((e & 3) << 3) & 255
}
return r
}
}
}, function(e, t) {
var r = [];
for (var n = 0; n < 256; ++n) {
r[n] = (n + 256).toString(16).substr(1)
}
function i(e, t) {
var n = t || 0;
var i = r;
return [i[e[n++]], i[e[n++]], i[e[n++]], i[e[n++]], "-", i[e[n++]], i[e[n++]], "-", i[e[n++]], i[e[n++]], "-", i[e[n++]], i[e[n++]], "-", i[e[n++]], i[e[n++]], i[e[n++]], i[e[n++]], i[e[n++]], i[e[n++]]].join("")
}
e.exports = i
}, function(e, t, n) {
"use strict";
function i(e, t, n, i) {
var r = e & 65535 | 0,
o = e >>> 16 & 65535 | 0,
a = 0;
while (n !== 0) {
a = n > 2e3 ? 2e3 : n;
n -= a;
do {
r = r + t[i++] | 0;
o = o + r | 0
} while (--a);
r %= 65521;
o %= 65521
}
return r | o << 16 | 0
}
e.exports = i
}, function(e, t, n) {
"use strict";
function i() {
var e, t = [];
for (var n = 0; n < 256; n++) {
e = n;
for (var i = 0; i < 8; i++) {
e = e & 1 ? 3988292384 ^ e >>> 1 : e >>> 1
}
t[n] = e
}
return t
}
var s = i();
function r(e, t, n, i) {
var r = s,
o = i + n;
e ^= -1;
for (var a = i; a < o; a++) {
e = e >>> 8 ^ r[(e ^ t[a]) & 255]
}
return e ^ -1
}
e.exports = r
}, function(e, t, n) {
"use strict";
var u = n(0);
var r = true;
var o = true;
try {
String.fromCharCode.apply(null, [0])
} catch (a) {
r = false
}
try {
String.fromCharCode.apply(null, new Uint8Array(1))
} catch (a) {
o = false
}
var l = new u.Buf8(256);
for (var i = 0; i < 256; i++) {
l[i] = i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1
}
l[254] = l[254] = 1;
t.string2buf = function(e) {
var t, n, i, r, o, a = e.length,
s = 0;
for (r = 0; r < a; r++) {
n = e.charCodeAt(r);
if ((n & 64512) === 55296 && r + 1 < a) {
i = e.charCodeAt(r + 1);
if ((i & 64512) === 56320) {
n = 65536 + (n - 55296 << 10) + (i - 56320);
r++
}
}
s += n < 128 ? 1 : n < 2048 ? 2 : n < 65536 ? 3 : 4
}
t = new u.Buf8(s);
for (o = 0, r = 0; o < s; r++) {
n = e.charCodeAt(r);
if ((n & 64512) === 55296 && r + 1 < a) {
i = e.charCodeAt(r + 1);
if ((i & 64512) === 56320) {
n = 65536 + (n - 55296 << 10) + (i - 56320);
r++
}
}
if (n < 128) {
t[o++] = n
} else if (n < 2048) {
t[o++] = 192 | n >>> 6;
t[o++] = 128 | n & 63
} else if (n < 65536) {
t[o++] = 224 | n >>> 12;
t[o++] = 128 | n >>> 6 & 63;
t[o++] = 128 | n & 63
} else {
t[o++] = 240 | n >>> 18;
t[o++] = 128 | n >>> 12 & 63;
t[o++] = 128 | n >>> 6 & 63;
t[o++] = 128 | n & 63
}
}
return t
};
function f(e, t) {
if (t < 65534) {
if (e.subarray && o || !e.subarray && r) {
return String.fromCharCode.apply(null, u.shrinkBuf(e, t))
}
}
var n = "";
for (var i = 0; i < t; i++) {
n += String.fromCharCode(e[i])
}
return n
}
t.buf2binstring = function(e) {
return f(e, e.length)
};
t.binstring2buf = function(e) {
var t = new u.Buf8(e.length);
for (var n = 0, i = t.length; n < i; n++) {
t[n] = e.charCodeAt(n)
}
return t
};
t.buf2string = function(e, t) {
var n, i, r, o;
var a = t || e.length;
var s = new Array(a * 2);
for (i = 0, n = 0; n < a;) {
r = e[n++];
if (r < 128) {
s[i++] = r;
continue
}
o = l[r];
if (o > 4) {
s[i++] = 65533;
n += o - 1;
continue
}
r &= o === 2 ? 31 : o === 3 ? 15 : 7;
while (o > 1 && n < a) {
r = r << 6 | e[n++] & 63;
o--
}
if (o > 1) {
s[i++] = 65533;
continue
}
if (r < 65536) {
s[i++] = r
} else {
r -= 65536;
s[i++] = 55296 | r >> 10 & 1023;
s[i++] = 56320 | r & 1023
}
}
return f(s, i)
};
t.utf8border = function(e, t) {
var n;
t = t || e.length;
if (t > e.length) {
t = e.length
}
n = t - 1;
while (n >= 0 && (e[n] & 192) === 128) {
n--
}
if (n < 0) {
return t
}
if (n === 0) {
return t
}
return n + l[e[n]] > t ? n : t
}
}, function(e, t, n) {
"use strict";
function i() {
this.input = null;
this.next_in = 0;
this.avail_in = 0;
this.total_in = 0;
this.output = null;
this.next_out = 0;
this.avail_out = 0;
this.total_out = 0;
this.msg = "";
this.state = null;
this.data_type = 2;
this.adler = 0
}
e.exports = i
}, function(e, t, n) {
"use strict";
e.exports = {
Z_NO_FLUSH: 0,
Z_PARTIAL_FLUSH: 1,
Z_SYNC_FLUSH: 2,
Z_FULL_FLUSH: 3,
Z_FINISH: 4,
Z_BLOCK: 5,
Z_TREES: 6,
Z_OK: 0,
Z_STREAM_END: 1,
Z_NEED_DICT: 2,
Z_ERRNO: -1,
Z_STREAM_ERROR: -2,
Z_DATA_ERROR: -3,
Z_BUF_ERROR: -5,
Z_NO_COMPRESSION: 0,
Z_BEST_SPEED: 1,
Z_BEST_COMPRESSION: 9,
Z_DEFAULT_COMPRESSION: -1,
Z_FILTERED: 1,
Z_HUFFMAN_ONLY: 2,
Z_RLE: 3,
Z_FIXED: 4,
Z_DEFAULT_STRATEGY: 0,
Z_BINARY: 0,
Z_TEXT: 1,
Z_UNKNOWN: 2,
Z_DEFLATED: 8
}
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var d = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
function v(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var i = function() {
function e() {
v(this, e);
this._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
}
d(e, [{
key: "browser",
value: function h() {
var e = /(edge)[/]([\w.]+)/;
var t = /(chrome)[/]([\w.]+)/;
var n = /(safari)[/]([\w.]+)/;
var i = /(opera)(?:.*version)?[/]([\w.]+)/;
var r = /(msie) ([\w.]+)/;
var o = /(trident.*rv:)([\w.]+)/;
var a = /(mozilla)(?:.*? rv:([\w.]+))?/;
var s = navigator.userAgent.toLowerCase();
var u = e.exec(s) || t.exec(s) || n.exec(s) || i.exec(s) || r.exec(s) || o.exec(s) || s.indexOf("compatible") < 0 && a.exec(s) || ["unknow", "0"];
if (u.length > 0 && u[1].indexOf("trident") > -1) {
u[1] = "msie"
}
var l = {};
l[u[1]] = true;
l.version = Math.floor(u[2].split(".")[0]);
if (l.safari) {
var f = s.indexOf("version/") + 8;
var c = s.indexOf(" safari/");
var d = s.slice(f, c);
l.version = Math.floor(d.split(".")[0])
}
return l
}
}, {
key: "createEventScript",
value: function r(e, t, n) {
var i = document.createElement("script");
i.htmlFor = e;
i.event = t;
i.innerHTML = n;
document.getElementById(e).appendChild(i)
}
}, {
key: "createxmlDoc",
value: function o() {
var e;
var t = ["MSXML2.DOMDocument", "MSXML2.DOMDocument.5.0", "MSXML2.DOMDocument.4.0", "MSXML2.DOMDocument.3.0", "Microsoft.XmlDom"];
for (var n = 0, i = t.length; n < i; n++) {
try {
e = new ActiveXObject(t[n]);
break
} catch (r) {
e = document.implementation.createDocument("", "", null);
break
}
}
e.async = "false";
return e
}
}, {
key: "parseXmlFromStr",
value: function a(e) {
if (null === e || "" === e) {
return null
}
e = e.replace(/&(?!lt;|amp;|gt;|apos;|quot;)/g, "&");
var t = null;
try {
if (window.navigator.userAgent.indexOf("MSIE 9.0") > 0) {
t = new ActiveXObject("Microsoft.XMLDOM");
t.async = false;
t.loadXML(e)
} else {
var n = new DOMParser;
t = n.parseFromString(e, "text/xml")
}
} catch (i) {
t = new ActiveXObject("Microsoft.XMLDOM");
t.async = false;
t.loadXML(e)
}
return t
}
}, {
key: "isNotSupportNoPlugin",
value: function n() {
var e = this.browser();
var t = false;
if (e.edge && e.version < 16) {
t = true
} else if (e.safari && e.version < 11) {
t = true
} else if (e.chrome && e.version < 57) {
t = true
} else if (e.firfox && e.version < 52) {
t = true
}
return t
}
}, {
key: "encode",
value: function f(e) {
var t = "";
var n;
var i;
var r;
var o;
var a;
var s;
var u;
var l = 0;
e = this._utf8_encode(e);
while (l < e.length) {
n = e.charCodeAt(l++);
i = e.charCodeAt(l++);
r = e.charCodeAt(l++);
o = n >> 2;
a = (n & 3) << 4 | i >> 4;
s = (i & 15) << 2 | r >> 6;
u = r & 63;
if (isNaN(i)) {
s = u = 64
} else if (isNaN(r)) {
u = 64
}
t = t + this._keyStr.charAt(o) + this._keyStr.charAt(a) + this._keyStr.charAt(s) + this._keyStr.charAt(u)
}
return t
}
}, {
key: "decode",
value: function c(e) {
var t = "";
var n;
var i;
var r;
var o;
var a;
var s;
var u;
var l = 0;
e = e.replace(/[^A-Za-z0-9+/=]/g, "");
while (l < e.length) {
o = this._keyStr.indexOf(e.charAt(l++));
a = this._keyStr.indexOf(e.charAt(l++));
s = this._keyStr.indexOf(e.charAt(l++));
u = this._keyStr.indexOf(e.charAt(l++));
n = o << 2 | a >> 4;
i = (a & 15) << 4 | s >> 2;
r = (s & 3) << 6 | u;
t = t + String.fromCharCode(n);
if (s !== 64) {
t = t + String.fromCharCode(i)
}
if (u !== 64) {
t = t + String.fromCharCode(r)
}
}
t = this._utf8_decode(t);
return t
}
}, {
key: "_utf8_encode",
value: function s(e) {
e = e.replace(/\r\n/g, "\n");
var t = "";
for (var n = 0; n < e.length; n++) {
var i = e.charCodeAt(n);
if (i < 128) {
t += String.fromCharCode(i)
} else if (i > 127 && i < 2048) {
t += String.fromCharCode(i >> 6 | 192);
t += String.fromCharCode(i & 63 | 128)
} else {
t += String.fromCharCode(i >> 12 | 224);
t += String.fromCharCode(i >> 6 & 63 | 128);
t += String.fromCharCode(i & 63 | 128)
}
}
return t
}
}, {
key: "_utf8_decode",
value: function u(e) {
var t = "";
var n = 0;
var i = 0;
var r = 0;
while (n < e.length) {
i = e.charCodeAt(n);
if (i < 128) {
t += String.fromCharCode(i);
n++
} else if (i > 191 && i < 224) {
r = e.charCodeAt(n + 1);
t += String.fromCharCode((i & 31) << 6 | r & 63);
n += 2
} else {
r = e.charCodeAt(n + 1);
var o = e.charCodeAt(n + 2);
t += String.fromCharCode((i & 15) << 12 | (r & 63) << 6 | o & 63);
n += 3
}
}
return t
}
}, {
key: "colorTransfer",
value: function i(e) {
var t = parseInt(e, 10);
var n = t.toString(16);
n = "0" + n;
return n.substring(n.length - 2)
}
}, {
key: "colorRgb",
value: function l(e) {
var t = e.toLowerCase();
var n = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (t && n.test(t)) {
if (t.length === 4) {
var i = "#";
for (var r = 1; r < 4; r += 1) {
i += t.slice(r, r + 1).concat(t.slice(r, r + 1))
}
t = i
}
var o = [];
for (var a = 1; a < 7; a += 2) {
o.push(parseInt("0x" + t.slice(a, a + 2), 16))
}
return o
}
return [0, 0, 0]
}
}]);
return e
}();
var r = t.oUtils = new i
}, function(e, t, n) {
e.exports = n(14)
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.JSVideoPlugin = undefined;
var kt = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
var Ct = n(15);
var Rt = n(28);
var It = n(42);
var Tt = n(12);
function Dt(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var xt = [];
var i = function() {
var e = function() {
function n(e) {
Dt(this, n);
var t = {
szId: "playWnd",
iType: 0,
iWidth: 400,
iHeight: 300,
iMaxSplit: 4,
iCurrentSplit: 2,
szPlayMode: "normal",
szBasePath: "./dist",
onConnectSuccess: null,
onConnectError: null,
oSessionInfo: null,
bNewInstance: false,
iPluginType: -1,
iFoceInitMode: 0
};
this.oOptions = $.extend(t, e);
this.oPlugin = null;
this.iPluginMode = 0;
this._getVideoPlugin()
}
kt(n, [{
key: "initActiveX",
value: function t() {
var e = this;
e.oPlugin = new It.ActiveXControl({
szId: e.oOptions.szId,
iType: e.oOptions.iType,
iWidth: e.oOptions.iWidth,
iHeight: e.oOptions.iHeight,
iMaxSplit: e.oOptions.iMaxSplit,
iCurrentSplit: e.oOptions.iCurrentSplit,
szPlayMode: e.oOptions.szPlayMode,
szIframeId: e.oOptions.szIframeId
});
e.iPluginMode = 0;
if (e.oPlugin.oPlugin) {
setTimeout(function() {
e.oOptions.onConnectSuccess && e.oOptions.onConnectSuccess()
}, 500)
} else {
setTimeout(function() {
e.oOptions.onConnectError && e.oOptions.onConnectError()
}, 500)
}
}
}, {
key: "initJSPlugin",
value: function i() {
var e = this;
try {
e.oPlugin = new Ct.JSPlugin({
szId: e.oOptions.szId,
iType: e.oOptions.iType,
iWidth: e.oOptions.iWidth,
iHeight: e.oOptions.iHeight,
iMaxSplit: e.oOptions.iMaxSplit,
iCurrentSplit: e.oOptions.iCurrentSplit,
szBasePath: e.oOptions.szBasePath,
szPlayMode: e.oOptions.szPlayMode,
oStyle: e.oOptions.oStyle,
szIframeId: e.oOptions.szIframeId
});
e.iPluginMode = 1;
e.oOptions.onConnectSuccess && e.oOptions.onConnectSuccess()
} catch (t) {
e.oOptions.onConnectError && e.oOptions.onConnectError()
}
}
}, {
key: "initLocalService",
value: function r() {
var e = this;
e.oPlugin = new Rt.LocalServiceControl({
bNoDetectPort: e.oOptions.bNoDetectPort,
oSessionInfo: e.oOptions.oSessionInfo,
szPluginContainer: e.oOptions.szId,
szIframeId: e.oOptions.szIframeId,
bChildIframe: e.oOptions.bChildIframe,
szChildIframeId: e.oOptions.szChildIframeId,
cbConnectSuccess: function t() {
e.oPlugin.bLocalServiceRunning = true;
xt[e.oOptions.szId] = e.oPlugin;
e.iPluginMode = 2;
if (e.oOptions.iType !== 0) {
e.oPlugin.JS_CreateWnd(e.oOptions.szId, e.oOptions.iWidth, e.oOptions.iHeight).then(function() {
setTimeout(function() {
e.JS_ArrangeWindow(e.oOptions.iCurrentSplit, []).then(function() {}, function() {});
e.oOptions.onConnectSuccess && e.oOptions.onConnectSuccess()
}, 50)
}, function() {})
} else {
setTimeout(function() {
e.JS_ArrangeWindow(e.oOptions.iCurrentSplit, []).then(function() {}, function() {});
e.oOptions.onConnectSuccess && e.oOptions.onConnectSuccess()
}, 50)
}
},
cbConnectError: function n() {
e.oPlugin.bLocalServiceRunning = false;
if (!Tt.oUtils.isNotSupportNoPlugin()) {
setTimeout(function() {
e.initJSPlugin()
}, 300)
} else {
e.oOptions.onConnectError && e.oOptions.onConnectError()
}
},
cbConnectClose: function i() {
e.oPlugin.bLocalServiceRunning = false;
e.oOptions.onConnectClose && e.oOptions.onConnectClose();
e.oPlugin = null;
delete xt[e.oOptions.szId]
},
iServicePortStart: e.oOptions.iServicePortStart,
iServicePortEnd: e.oOptions.iServicePortEnd,
bUseInQT: e.oOptions.bUseInQT
})
}
}, {
key: "reInitLocalService",
value: function o() {
var e = this;
e.oPlugin = xt[e.oOptions.szId];
e.iPluginMode = 2;
if (e.oOptions.iType !== 0) {
e.oPlugin.JS_CreateWnd(e.oOptions.szId, e.oOptions.iWidth, e.oOptions.iHeight).then(function() {
setTimeout(function() {
e.JS_ArrangeWindow(e.oOptions.iCurrentSplit, []).then(function() {}, function() {});
e.oOptions.onConnectSuccess && e.oOptions.onConnectSuccess()
}, 50)
}, function() {})
} else {
setTimeout(function() {
e.JS_ArrangeWindow(e.oOptions.iCurrentSplit, []).then(function() {}, function() {});
e.oOptions.onConnectSuccess && e.oOptions.onConnectSuccess()
}, 50)
}
}
}, {
key: "_getVideoPlugin",
value: function a() {
var e = this;
if (e.oOptions.iFoceInitMode > 0) {
e.oOptions.iPluginType = e.oOptions.iFoceInitMode
}
if (e.oOptions.iPluginType > -1) {
if (e.oOptions.iPluginType === 0) {
e.initActiveX()
} else if (e.oOptions.iPluginType === 1) {
setTimeout(function() {
e.initJSPlugin()
}, 300)
} else if (e.oOptions.iPluginType === 2) {
if (window._oMultiVideoPlugin && !e.oOptions.bNewInstance) {
e.reInitLocalService()
} else {
e.initLocalService()
}
}
return
}
if (Tt.oUtils.browser().msie) {
e.initActiveX()
} else {
if (xt[e.oOptions.szId] && !e.oOptions.bNewInstance) {
e.reInitLocalService()
} else {
e.initLocalService()
}
}
}
}, {
key: "JS_GetVideoMode",
value: function e() {
return this.iPluginMode
}
}, {
key: "JS_CreateWnd",
value: function s(e, t, n) {
return this.oPlugin.JS_CreateWnd(e, t, n)
}
}, {
key: "JS_ShowWnd",
value: function u() {
return this.oPlugin.JS_ShowWnd()
}
}, {
key: "JS_HideWnd",
value: function l() {
return this.oPlugin.JS_HideWnd()
}
}, {
key: "JS_SetWndCover",
value: function f(e, t) {
return this.oPlugin.JS_SetWndCover(e, t)
}
}, {
key: "JS_CheckLocalServiceConnected",
value: function c() {
return Rt.LocalServiceControl.prototype.JS_CheckLocalServiceConnected()
}
}, {
key: "JS_SetWindowControlCallback",
value: function d(e) {
this.oPlugin.JS_SetWindowControlCallback(e)
}
}, {
key: "JS_ArrangeWindow",
value: function h(e, t) {
return this.oPlugin.JS_ArrangeWindow(e, t)
}
}, {
key: "JS_SetSecretKey",
value: function v(e, t, n) {
return this.oPlugin.JS_SetSecretKey(e, t, n)
}
}, {
key: "JS_SetOriginalString",
value: function p(e, t) {
return this.oPlugin.JS_SetOriginalString(e, t)
}
}, {
key: "JS_GetEncryptString",
value: function m(e, t, n) {
return this.oPlugin.JS_GetEncryptString(e, t, n)
}
}, {
key: "JS_GetDecryptString",
value: function y(e, t, n) {
return this.oPlugin.JS_GetDecryptString(e, t, n)
}
}, {
key: "JS_DestroyPlugin",
value: function S() {
return this.oPlugin.JS_DestroyPlugin(this.oOptions.bNewInstance)
}
}, {
key: "JS_Play",
value: function g(e, t, n, i, r, o) {
var a = false;
if (e.indexOf("transcoding") > -1) {
a = true
}
var s = e.indexOf("://") + 3;
var u = e.substring(s).indexOf("/");
var l = e.substring(0, u + s);
var f = e.substring(u + s + 1);
if (this.iPluginMode === 0 || this.iPluginMode === 2) {
if (!i && !r) {
if (this.oPlugin.iProtocolType === 0 && !o || typeof this.oPlugin.iProtocolType === "undefined") {
e = l.replace(/video/i, "http") + "/SDK/play/" + (parseInt(f, 10) - 1) + "/004"
} else {
e = l.replace(/video/i, "rtsp") + "/ISAPI/streaming/channels/" + f
}
if (f === "0") {
if (this.oPlugin.iProtocolType === 0 || typeof this.oPlugin.iProtocolType === "undefined") {
e = l.replace(/video/i, "http") + "/SDK/play/100/004/ZeroStreaming"
} else {
e = l.replace(/video/i, "rtsp") + "/ISAPI/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/101"
}
}
} else {
if (this.oPlugin.iProtocolType === 0 && !o || typeof this.oPlugin.iProtocolType === "undefined") {
e = l.replace(/video/i, "http") + "/SDK/playback/" + (parseInt(f, 10) - 1) + (a ? "/transcoding" : "");
if (t.secondAuth) {
e = e + (e.indexOf("?") >= 0 ? "&" : "?") + t.secondAuth
}
} else {
e = l.replace(/video/i, "rtsp") + "/ISAPI/streaming/tracks/" + f + "?starttime=" + i + "&endtime=" + r
}
}
var c = t.auth;
var d = Tt.oUtils.decode(c);
if (this.oPlugin.iProtocolType !== 0 && d.indexOf(":::4:") === -1) {
c = t.userInfo
}
e = e.replace(/https/g, "http");
e = e.replace(/rtsps/g, "rtsp");
return this.oPlugin.JS_Play(e, {
auth: c
}, n, i, r)
} else if (this.iPluginMode === 1) {
e = e.replace(/video/i, "ws");
var h = Tt.oUtils.decode(t.auth);
var v = {
sessionID: h.split("::")[1]
};
if (h.indexOf(":::3:") > -1) {
v = {
sessionID: h.split(":::3:")[1]
}
} else if (h.indexOf(":::4:") > -1) {
v = {
token: h.split(":::4:")[1]
}
}
t.secondAuth && (v.secondAuth = t.secondAuth);
return this.oPlugin.JS_Play(e, v, n, i, r)
}
}
}, {
key: "JS_ReversePlay",
value: function _(e, t, n, i, r) {
var o = e.indexOf("://") + 3;
var a = e.substring(o).indexOf("/");
var s = e.substring(0, a + o);
var u = e.substring(a + o + 1);
if (this.iPluginMode === 0 || this.iPluginMode === 2) {
if (this.oPlugin.iProtocolType === 0 || typeof this.oPlugin.iProtocolType === "undefined") {
e = s.replace(/video/i, "http") + "/SDK/playback/" + (parseInt(u, 10) - 1) + "/reversePlay";
if (t.secondAuth) {
e = e + (e.indexOf("?") >= 0 ? "&" : "?") + t.secondAuth
}
} else {
e = s.replace(/video/i, "rtsp") + "/ISAPI/streaming/tracks/" + u + "?starttime=" + i + "&endtime=" + r
}
var l = t.auth;
var f = Tt.oUtils.decode(l);
if (this.oPlugin.iProtocolType !== 0 && f.indexOf(":::4:") === -1) {
l = t.userInfo
}
e = e.replace(/https/g, "http");
return this.oPlugin.JS_ReversePlay(e, {
auth: l
}, n, i, r)
} else if (this.iPluginMode === 1) {
e = s.replace(/video/i, "ws");
return this.oPlugin.JS_ReversePlay(e, t, n, i, r)
}
}
}, {
key: "JS_Stop",
value: function P(e) {
return this.oPlugin.JS_Stop(e)
}
}, {
key: "JS_Seek",
value: function w(e, t, n) {
return this.oPlugin.JS_Seek(e, t, n)
}
}, {
key: "JS_StopRealPlayAll",
value: function b() {
return this.oPlugin.JS_StopRealPlayAll()
}
}, {
key: "JS_Pause",
value: function k(e) {
return this.oPlugin.JS_Pause(e)
}
}, {
key: "JS_Resume",
value: function C(e) {
return this.oPlugin.JS_Resume(e)
}
}, {
key: "JS_Slow",
value: function R(e) {
return this.oPlugin.JS_Slow(e)
}
}, {
key: "JS_Fast",
value: function I(e) {
return this.oPlugin.JS_Fast(e)
}
}, {
key: "JS_Transmission",
value: function T(e, t) {
return this.oPlugin.JS_Transmission(e, t)
}
}, {
key: "JS_FrameForward",
value: function D(e) {
return this.oPlugin.JS_FrameForward(e)
}
}, {
key: "JS_GetOSDTime",
value: function x(e) {
return this.oPlugin.JS_GetOSDTime(e)
}
}, {
key: "JS_GetPlayInfo",
value: function M(e) {
return this.oPlugin.JS_GetPlayInfo(e)
}
}, {
key: "JS_OpenSound",
value: function E(e) {
return this.oPlugin.JS_OpenSound(e)
}
}, {
key: "JS_CloseSound",
value: function z() {
return this.oPlugin.JS_CloseSound()
}
}, {
key: "JS_GetVolume",
value: function O(e) {
return this.oPlugin.JS_GetVolume(e)
}
}, {
key: "JS_SetVolume",
value: function F(e, t) {
return this.oPlugin.JS_SetVolume(e, t)
}
}, {
key: "JS_EnableZoom",
value: function q(e, t) {
return this.oPlugin.JS_EnableZoom(e, t)
}
}, {
key: "JS_DisableZoom",
value: function W(e) {
return this.oPlugin.JS_DisableZoom(e)
}
}, {
key: "JS_CapturePicture",
value: function J(e, t, n) {
return this.oPlugin.JS_CapturePicture(e, t, n)
}
}, {
key: "JS_StartSave",
value: function L(e, t) {
return this.oPlugin.JS_StartSave(e, t)
}
}, {
key: "JS_StopSave",
value: function A(e) {
return this.oPlugin.JS_StopSave(e)
}
}, {
key: "JS_StartTalk",
value: function B(e, t, n, i, r, o, a, s, u) {
return this.oPlugin.JS_StartTalk(e, t, n, i, r, o, a, s, u)
}
}, {
key: "JS_StopTalk",
value: function U() {
return this.oPlugin.JS_StopTalk()
}
}, {
key: "JS_SetPlayMode",
value: function H(e) {
return this.oPlugin.JS_SetPlayMode(e)
}
}, {
key: "JS_SetFullScreenCapability",
value: function N(e) {
return this.oPlugin.JS_SetFullScreenCapability(e)
}
}, {
key: "JS_FullScreenDisplay",
value: function G(e) {
return this.oPlugin.JS_FullScreenDisplay(e)
}
}, {
key: "JS_EnableIVS",
value: function V(e, t, n) {
return this.oPlugin.JS_EnableIVS(e, t, n)
}
}, {
key: "JS_SRInit",
value: function j(e, t) {
return this.oPlugin.JS_SRInit(e, t)
}
}, {
key: "JS_SRPTZ",
value: function X(e, t, n) {
return this.oPlugin.JS_SRPTZ(e, t, n)
}
}, {
key: "JS_SetPlaybackDrawType",
value: function Y(e, t) {
return this.oPlugin.JS_SetPlaybackDrawType(e, t)
}
}, {
key: "JS_SetPlayBackType",
value: function Z(e) {
return this.oPlugin.JS_SetPlayBackType(e)
}
}, {
key: "JS_SetTrsPlayBackParam",
value: function K(e, t) {
return this.oPlugin.JS_SetTrsPlayBackParam(e, t)
}
}, {
key: "JS_GetLocalConfig",
value: function Q() {
return this.oPlugin.JS_GetLocalConfig()
}
}, {
key: "JS_SetLocalConfig",
value: function ee(e) {
return this.oPlugin.JS_SetLocalConfig(e)
}
}, {
key: "JS_GetLastError",
value: function te() {
return this.oPlugin.JS_GetLastError()
}
}, {
key: "JS_OpenFileBrowser",
value: function ne(e, t) {
return this.oPlugin.JS_OpenFileBrowser(e, t)
}
}, {
key: "JS_OpenDirectory",
value: function ie(e) {
return this.oPlugin.JS_OpenDirectory(e)
}
}, {
key: "JS_StartAsynUpload",
value: function re(e, t, n, i) {
return this.oPlugin.JS_StartAsynUpload(e, t, n, i)
}
}, {
key: "JS_StopAsynUpload",
value: function oe() {
return this.oPlugin.JS_StopAsynUpload()
}
}, {
key: "JS_GetUploadErrorInfo",
value: function ae() {
return this.oPlugin.JS_GetUploadErrorInfo()
}
}, {
key: "JS_UploadFile",
value: function se(e, t, n, i) {
return this.oPlugin.JS_UploadFile(e, t, n, i)
}
}, {
key: "JS_GetIpcImportErrorInfo",
value: function ue() {
return this.oPlugin.JS_GetIpcImportErrorInfo()
}
}, {
key: "JS_DownloadFile",
value: function le(e, t, n, i, r, o) {
return this.oPlugin.JS_DownloadFile(e, t, n, i, r, o)
}
}, {
key: "JS_DownloadFileNoPlugin",
value: function fe(e, t, n, i, r, o) {
return this.oPlugin.JS_DownloadFileNoPlugin(e, t, n, i, r, o)
}
}, {
key: "JS_StartUpgrade",
value: function ce(e, t, n, i, r) {
return this.oPlugin.JS_StartUpgrade(e, t, n, i, r)
}
}, {
key: "JS_StopUpgrade",
value: function de() {
return this.oPlugin.JS_StopUpgrade()
}
}, {
key: "JS_GetUpgradeStatus",
value: function he() {
return this.oPlugin.JS_GetUpgradeStatus()
}
}, {
key: "JS_GetUpgradeProgress",
value: function ve() {
return this.oPlugin.JS_GetUpgradeProgress()
}
}, {
key: "JS_ExportDeviceLog",
value: function pe(e, t, n) {
var i = null;
if (this.iPluginMode !== 0) {
i = Ct.JSPlugin.prototype.JS_ExportDeviceLog(e, t, n)
} else {
i = this.oPlugin.JS_ExportDeviceLog(e, t, n)
}
return i
}
}, {
key: "JS_ExportReport",
value: function me(e, t, n) {
var i = null;
if (this.iPluginMode !== 0) {
i = Ct.JSPlugin.prototype.JS_ExportReport(e, t, n)
} else {
i = this.oPlugin.JS_ExportReport(e, t, n)
}
return i
}
}, {
key: "JS_StartAsyncDownload",
value: function ye(e, t, n, i) {
return this.oPlugin.JS_StartAsyncDownload(e, t, n, i)
}
}, {
key: "JS_StopAsyncDownload",
value: function Se(e) {
return this.oPlugin.JS_StopAsyncDownload(e)
}
}, {
key: "JS_GetDownloadStatus",
value: function ge(e) {
return this.oPlugin.JS_GetDownloadStatus(e)
}
}, {
key: "JS_GetDownloadProgress",
value: function _e(e) {
return this.oPlugin.JS_GetDownloadProgress(e)
}
}, {
key: "JS_EnablePDC",
value: function Pe(e, t) {
return this.oPlugin.JS_EnablePDC(e, t)
}
}, {
key: "JS_Resize",
value: function we(e, t) {
return this.oPlugin.JS_Resize(e, t)
}
}, {
key: "JS_SetDrawCallback",
value: function be(e, t, n, i, r, o) {
return this.oPlugin.JS_SetDrawCallback(e, t, n, i, r, o)
}
}, {
key: "JS_SetDrawStatus",
value: function ke(e, t, n) {
return this.oPlugin.JS_SetDrawStatus(e, t, n)
}
}, {
key: "JS_ClearRegion",
value: function Ce() {
return this.oPlugin.JS_ClearRegion()
}
}, {
key: "JS_SetDrawShapeInfo",
value: function Re(e, t) {
return this.oPlugin.JS_SetDrawShapeInfo(e, t)
}
}, {
key: "JS_SetGridInfo",
value: function Ie(e) {
return this.oPlugin.JS_SetGridInfo(e)
}
}, {
key: "JS_GetGridInfo",
value: function Te() {
return this.oPlugin.JS_GetGridInfo()
}
}, {
key: "JS_SetRectInfo",
value: function De(e) {
return this.oPlugin.JS_SetRectInfo(e)
}
}, {
key: "JS_GetRectInfo",
value: function xe() {
return this.oPlugin.JS_GetRectInfo()
}
}, {
key: "JS_SetPolygonInfo",
value: function Me(e) {
return this.oPlugin.JS_SetPolygonInfo(e)
}
}, {
key: "JS_GetPolygonInfo",
value: function Ee() {
return this.oPlugin.JS_GetPolygonInfo()
}
}, {
key: "JS_SetLineInfo",
value: function ze(e) {
return this.oPlugin.JS_SetLineInfo(e)
}
}, {
key: "JS_GetLineInfo",
value: function Oe() {
return this.oPlugin.JS_GetLineInfo()
}
}, {
key: "JS_SetPointInfo",
value: function Fe(e, t) {
return this.oPlugin.JS_SetPointInfo(e, t)
}
}, {
key: "JS_GetPointInfo",
value: function qe() {
return this.oPlugin.JS_GetPointInfo()
}
}, {
key: "JS_SetTextOverlay",
value: function We(e) {
return this.oPlugin.JS_SetTextOverlay(e)
}
}, {
key: "JS_GetTextOverlay",
value: function Je() {
return this.oPlugin.JS_GetTextOverlay()
}
}, {
key: "JS_ClearShapeByType",
value: function Le(e, t) {
return this.oPlugin.JS_ClearShapeByType(e, t)
}
}, {
key: "JS_ChooseShape",
value: function Ae(e, t) {
return this.oPlugin.JS_ChooseShape(e, t)
}
}, {
key: "JS_SetCorrectionType",
value: function Be(e) {
return this.oPlugin.JS_SetCorrectionType(e)
}
}, {
key: "JS_SetPlaceType",
value: function Ue(e) {
return this.oPlugin.JS_SetPlaceType(e)
}
}, {
key: "JS_StartFishListener",
value: function $e(e, t, n) {
return this.oPlugin.JS_StartFishListener(e, t, n)
}
}, {
key: "JS_StopFishListener",
value: function He() {
return this.oPlugin.JS_StopFishListener()
}
}, {
key: "JS_SetFishBoxListInfo",
value: function Ne(e) {
return this.oPlugin.JS_SetFishBoxListInfo(e)
}
}, {
key: "JS_GetFishBoxListInfo",
value: function Ge() {
return this.oPlugin.JS_GetFishBoxListInfo()
}
}, {
key: "JS_ClearAllWndFishBoxInfo",
value: function Ve() {
return this.oPlugin.JS_ClearAllWndFishBoxInfo()
}
}, {
key: "JS_SetFishWndProperty",
value: function je(e, t, n) {
return this.oPlugin.JS_SetFishWndProperty(e, t, n)
}
}, {
key: "JS_SetFishParams",
value: function Xe(e, t, n, i) {
return this.oPlugin.JS_SetFishParams(e, t, n, i)
}
}, {
key: "JS_ArrangeFECWindow",
value: function Ye(e) {
return this.oPlugin.JS_ArrangeFECWindow(e)
}
}, {
key: "JS_StartFECScan",
value: function Ze(e) {
return this.oPlugin.JS_StartFECScan(e)
}
}, {
key: "JS_StopFECScan",
value: function Ke() {
return this.oPlugin.JS_StopFECScan()
}
}, {
key: "JS_FishEyePTZ",
value: function Qe(e, t) {
return this.oPlugin.JS_FishEyePTZ(e, t)
}
}, {
key: "JS_FishEyeGetPreset",
value: function et() {
return this.oPlugin.JS_FishEyeGetPreset()
}
}, {
key: "JS_FishEyeSetPreset",
value: function tt(e) {
return this.oPlugin.JS_FishEyeSetPreset(e)
}
}, {
key: "JS_StartFECCruise",
value: function nt(e) {
return this.oPlugin.JS_StartFECCruise(e)
}
}, {
key: "JS_StopFECCruise",
value: function it() {
return this.oPlugin.JS_StopFECCruise()
}
}, {
key: "JS_SetIsHttps",
value: function rt(e) {
return this.oPlugin.JS_SetIsHttps(e)
}
}, {
key: "JS_SetReconnectInfo",
value: function ot(e, t) {
return this.oPlugin.JS_SetReconnectInfo(e, t)
}
}, {
key: "JS_CheckUpdate",
value: function at(e) {
return this.oPlugin.JS_CheckUpdate(e)
}
}, {
key: "JS_SelectShape",
value: function st(e, t) {
return this.oPlugin.JS_SelectShape(e, t)
}
}, {
key: "JS_GetPictureSize",
value: function ut(e) {
return this.oPlugin.JS_GetPictureSize(e)
}
}, {
key: "JS_SetOriginResolution",
value: function lt(e, t, n) {
return this.oPlugin.JS_SetOriginResolution(e, t, n)
}
}, {
key: "JS_SetPlayWndMode",
value: function ft(e, t, n) {
return this.oPlugin.JS_SetPlayWndMode(e, t, n)
}
}, {
key: "JS_UpdateWindowStyle",
value: function ct(e) {
return this.oPlugin.JS_UpdateWindowStyle(e)
}
}, {
key: "JS_CuttingPartWindow",
value: function dt(e, t, n, i) {
return this.oPlugin.JS_CuttingPartWindow(e, t, n, i)
}
}, {
key: "JS_RepairPartWindow",
value: function ht(e, t, n, i) {
return this.oPlugin.JS_RepairPartWindow(e, t, n, i)
}
}, {
key: "JS_ClearAllCanvas",
value: function vt() {
var e = null;
if (this.iPluginMode === 1) {
e = this.oPlugin.JS_ClearAllCanvas()
} else {
e = new Promise(function(e) {
e()
})
}
return e
}
}, {
key: "JS_PlayWithImg",
value: function pt(e, t) {
return this.oPlugin.JS_PlayWithImg(e, t)
}
}, {
key: "JS_DestroyAll",
value: function mt() {
return this.oPlugin.JS_DestroyAll()
}
}, {
key: "JS_SetPackageType",
value: function yt(e) {
return this.oPlugin.JS_SetPackageType(e)
}
}, {
key: "JS_SetZeroChanInfo",
value: function St(e, t, n) {
return this.oPlugin.JS_SetZeroChanInfo(e, t, n)
}
}, {
key: "JS_SetSnapDrawWndIndex",
value: function gt(e) {
return this.oPlugin.JS_SetSnapDrawWndIndex(e)
}
}, {
key: "JS_GetEngineSupport",
value: function _t() {
return this.oPlugin.JS_GetEngineSupport()
}
}, {
key: "JS_ExsitGetSlfPointList",
value: function Pt() {
return this.oPlugin.JS_ExistGetSlfPointList()
}
}, {
key: "JS_GetSlfPointList",
value: function wt(e, t) {
return this.oPlugin.JS_GetSlfPointList(e, t)
}
}, {
key: "JS_GetSlfVersion",
value: function bt() {
return this.oPlugin.JS_GetSlfVersion()
}
}]);
return n
}();
e.getPluginMode = function(t, n, i) {
var r = 0;
var e = new Promise(function(e) {
if (Tt.oUtils.browser().msie || Tt.oUtils.browser().safari && Tt.oUtils.browser().version < 11 || Tt.oUtils.browser().firefox && Tt.oUtils.browser().version < 52 || Tt.oUtils.browser().chrome && Tt.oUtils.browser().version < 45) {
e(r)
} else {
Rt.LocalServiceControl.prototype.JS_CheckLocalServiceConnected(t, n, i).then(function() {
r = 2;
e(r)
}, function() {
r = 1;
e(r)
})
}
});
return e
};
return e
}();
t.JSVideoPlugin = i
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.JSPlugin = undefined;
var Dt = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
var xt = n(4);
var i = n(16);
var Mt = n(25);
var Et = n(26);
var zt = n(27);
function Ot(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var r = function() {
var Ze = null;
var Ke = 0;
var Qe = 1;
var u = 40;
var l = 1024 * 1024 * 4;
var f = 1001;
var c = 1002;
var d = 1003;
var et = 2001;
var tt = 2002;
var nt = new i.StreamClient;
var it = null;
var rt = null;
var ot = Symbol("OPTIONS");
var at = Symbol("CURRENTPLAYRATE");
var st = Symbol("CURRENTSOUNDWND");
var ut = Symbol("MAXWNDNUM");
var lt = Symbol("MAXWNDNUM");
var ft = Symbol("DRAWCANVAS");
var ct = Symbol("SHAPEID");
var dt = Symbol("WINDOWFULL");
var ht = Symbol("SINGLEWINDOW");
var vt = Symbol("FILETMP");
var pt = Symbol("STATUSTMP");
var mt = Symbol("UPGRADESTATUSURL");
var yt = Symbol("CURWNDINDEX");
var St = Symbol("CALLBACKFUNCTION");
var gt = Symbol("CALLBACKFUNCTIONS");
var _t = Symbol("EVENTCALLBACK");
var Pt = Symbol("PLUGINVERSION");
var wt = Symbol("CANFULLSCREEN");
var bt = Symbol("DRAWWNDINDEX");
var h = Symbol("CURDRAWWNDINDEX");
function kt() {
document.addEventListener("visibilitychange", function() {
if (document.hidden) {
for (var e = 0; e < 16; e++) {
if (Ze[lt][e] && Ze[lt][e].bLoad) {
Ze[lt][e].oPlayCtrl.PlayM4_IsVisible(false)
}
}
} else {
for (var t = 0; t < 16; t++) {
if (Ze[lt][t] && Ze[lt][t].bLoad) {
Ze[lt][t].oPlayCtrl.PlayM4_IsVisible(true)
}
}
}
}, false)
}
function Ct(e, t) {
if (e && t) {
Ze[ot].iWidth = e;
Ze[ot].iHeight = t
}
var n = Ze[ot].iWidth % Ze[ot].iCurrentSplit;
var i = Ze[ot].iHeight % Ze[ot].iCurrentSplit;
var r = (Ze[ot].iWidth - n - Ze[ot].iCurrentSplit * 2) / Ze[ot].iCurrentSplit;
var o = (Ze[ot].iHeight - i - Ze[ot].iCurrentSplit * 2) / Ze[ot].iCurrentSplit;
var a = (Ze[ot].iWidth - n) / Ze[ot].iCurrentSplit;
var s = (Ze[ot].iHeight - i) / Ze[ot].iCurrentSplit;
var u = Ze[ot].iCurrentSplit;
if (Ze[ot].szIframeId && $("#" + Ze[ot].szIframeId).length) {
rt = $("#" + Ze[ot].szId, $("#" + Ze[ot].szIframeId)[0].contentWindow.document)
} else {
if (typeof Ze[ot].szId === "string") {
rt = $("#" + Ze[ot].szId)
} else {
rt = Ze[ot].szId
}
}
var l = '<div class="parent-wnd" style="overflow:hidden;width:100%; height:100%; position: relative;">';
for (var f = 0; f < Ze[ut]; f++) {
e = r + (f % u === u - 1 ? n : 0);
t = o + (f + u >= Math.pow(u, 2) ? i : 0);
var c = a + (f % u === u - 1 ? n : 0);
var d = s + (f + u >= Math.pow(u, 2) ? i : 0);
l += '<div style="float:left; background-color: ' + Ze[ot].oStyle.background + "; position: relative; width: " + c + "px; height: " + d + 'px;">' + '<img style="display:none;" id="playImg' + f + '" src="">' + '<canvas id="' + Ze[ot].szId + "canvas_play" + f + '" class="play-window" style="border:1px solid ' + Ze[ot].oStyle.border + ';" wid="' + f + '" width="' + e + '" height="' + t + '"></canvas>' + '<canvas id="' + Ze[ot].szId + "canvas_draw" + f + '" class="draw-window" style="position:absolute; top:0; left:0;" wid="' + f + '" width=' + c + " height=" + d + "></canvas>" + "</div>"
}
l += "</div>";
rt.html(l);
rt.find(".parent-wnd").eq(0).children().eq(0).find(".play-window").eq(0).css("border", "1px solid " + Ze[ot].oStyle.borderSelect)
}
function e() {
Ze.EventCallback = function() {
return {
loadEventHandler: function e() {
window.loadEventHandler && window.loadEventHandler()
},
zoomEventResponse: function t() {},
windowEventSelect: function n(t, e) {
if (Ze[yt] === t && !e) {
return
}
Ze[yt] = t;
if (Ze[bt] >= 0 && Ze[bt] <= Ze[ut] - 1) {
if (Ze[h] === Ze[bt]) {
return
}
t = Ze[bt]
}
Ze[h] = t;
if (0 <= t) {
Ze[St] = Ze[gt][t]
}
$(".draw-window").unbind();
Ze[ft].setDrawStatus(false);
Ze[ft] = null;
Ze[ft] = new zt.ESCanvas(Ze[ot].szId + "canvas_draw" + t);
Ze[ft].setShapeType("Rect");
Ze[ft].setDrawStyle("#ff0000", "", 0);
if (Ze[lt][t].bEZoom || Ze[lt][t].bSetDrawCallback) {
if (Ze[lt][t].bEZoom) {
Ze[ft].setDrawStatus(true, function(e) {
if (e.startPos && e.endPos) {
if (e.startPos[0] > e.endPos[0]) {
Ze[lt][t].oPlayCtrl.PlayM4_SetDisplayRegion(null, false)
} else {
Ze[lt][t].oPlayCtrl.PlayM4_SetDisplayRegion({
left: e.startPos[0],
top: e.startPos[1],
right: e.endPos[0],
bottom: e.endPos[1]
}, true)
}
}
})
} else if (Ze[lt][t].bSetDrawCallback) {
Ze[ft].setDrawStatus(true, function(e) {
Ze[St](e)
})
}
}
if (Ze[_t].onGetSelectWndInfo) {
Ze[_t].onGetSelectWndInfo(t)
}
},
pluginErrorHandler: function i(e, t, n) {
if (Ze[_t].onPluginEventHandler) {
Ze[_t].onPluginEventHandler(e, t, n)
}
},
windowEventOver: function r(e) {
if (Ze[_t].onWindowEventOver) {
Ze[_t].onWindowEventOver(e)
}
},
windowEventOut: function o(e) {
if (Ze[_t].onWindowEventOut) {
Ze[_t].onWindowEventOut(e)
}
},
windowEventUp: function a(e) {
if (Ze[_t].onWindowEventUp) {
Ze[_t].onWindowEventUp(e)
}
},
windowFullCcreenChange: function s(e) {
if (Ze[_t].onWindowFullCcreenChange) {
Ze[_t].onWindowFullCcreenChange(e)
}
},
firstFrameDisplay: function u(e) {
if (Ze[_t].onFirstFrameDisplay) {
Ze[_t].onFirstFrameDisplay(e)
}
},
performanceLack: function l() {
if (Ze[_t].onPerformanceLack) {
Ze[_t].onPerformanceLack()
}
},
mouseEvent: function f(e, t, n, i) {
if (Ze[_t].onMouseEvent) {
Ze[_t].onMouseEvent({
eventType: t,
point: [n, i],
wndIndex: e
})
}
}
}
}()
}
function Rt() {
e();
rt.find(".parent-wnd").eq(0).children().each(function(o) {
var a = this;
var i = false;
$(a).unbind().bind("mousedown", function(e) {
rt.find(".parent-wnd").eq(0).find(".play-window").css("border", "1px solid " + Ze[ot].oStyle.border);
rt.find(".parent-wnd").eq(0).children().eq(o).find(".play-window").eq(0).css("border", "1px solid " + Ze[ot].oStyle.borderSelect);
Ze.EventCallback.windowEventSelect(parseInt(rt.find(".parent-wnd").eq(0).children().eq(o).find(".play-window").eq(0).attr("wid"), 10));
i = true;
var t = e.offsetX / Ze[ft].m_iCanvasWidth;
var n = e.offsetY / Ze[ft].m_iCanvasHeight;
if (e.button === 2) {
Ze.EventCallback.mouseEvent(o, 4, t, n)
} else if (e.button === 0) {
Ze.EventCallback.mouseEvent(o, 1, t, n)
}
e.stopPropagation()
});
$(a).bind("mousemove", function(e) {
var t = e.offsetX / Ze[ft].m_iCanvasWidth;
var n = e.offsetY / Ze[ft].m_iCanvasHeight;
if (i) {
Ze.EventCallback.mouseEvent(o, 7, t, n)
} else {
Ze.EventCallback.mouseEvent(o, 6, t, n)
}
e.stopPropagation()
});
$(a).bind("mousewheel", function(e) {
var t = e.offsetX / Ze[ft].m_iCanvasWidth;
var n = e.offsetY / Ze[ft].m_iCanvasHeight;
Ze.EventCallback.mouseEvent(o, 8, t, n);
e.stopPropagation()
});
$(a).bind("mouseover", function(e) {
Ze.EventCallback.windowEventOver(o);
e.stopPropagation()
});
$(a).bind("mouseout", function(e) {
Ze.EventCallback.windowEventOut(o);
e.stopPropagation()
});
$(a).bind("mouseup", function(e) {
i = false;
Ze.EventCallback.windowEventUp(o);
var t = e.offsetX / Ze[ft].m_iCanvasWidth;
var n = e.offsetY / Ze[ft].m_iCanvasHeight;
if (e.button === 2) {
Ze.EventCallback.mouseEvent(o, 5, t, n)
} else if (e.button === 0) {
Ze.EventCallback.mouseEvent(o, 3, t, n)
}
});
$(a).bind("dblclick", function(e) {
if (!Ze[lt][Ze[yt]].bPlay) {
return
}
if (!Ze[wt]) {
return
}
var t = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || false;
var n = $(a).get(0);
if (!t) {
if (n.requestFullScreen) {
n.requestFullScreen()
} else if (n.webkitRequestFullScreen) {
n.webkitRequestFullScreen()
} else if (n.mozRequestFullScreen) {
n.mozRequestFullScreen()
}
Ze[ht] = $(a)
} else {
if (rt.find(".parent-wnd").eq(0).width() === $(window).width()) {
return
}
if (document.exitFullscreen) {
document.exitFullscreen()
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen()
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen()
}
Ze[ht] = null;
Ze[dt] = false
}
var i = e.offsetX / Ze[ft].m_iCanvasWidth;
var r = e.offsetX / Ze[ft].m_iCanvasHeight;
Ze.EventCallback.mouseEvent(o, 2, i, r);
e.stopPropagation()
})
});
if (typeof document.fullScreen !== "undefined") {
document.addEventListener("fullscreenchange", function() {
var e = document.fullscreen || false;
Ze.EventCallback.windowFullCcreenChange(e)
})
} else if (typeof document.webkitIsFullScreen !== "undefined") {
document.addEventListener("webkitfullscreenchange", function() {
var e = document.webkitIsFullScreen || false;
Ze.EventCallback.windowFullCcreenChange(e)
})
} else if (typeof document.mozFullScreen !== "undefined") {
document.addEventListener("mozfullscreenchange", function() {
var e = document.mozFullScreen || false;
Ze.EventCallback.windowFullCcreenChange(e)
})
}
}
function It(e) {
if (Ze[ot].aCustom && Ze[ot].aCustom.length > 0) {
v()
} else {
var t = rt.find(".parent-wnd").eq(0).children().length;
var n = Ze[ot].iWidth % Ze[ot].iCurrentSplit;
var i = Ze[ot].iHeight % Ze[ot].iCurrentSplit;
var r = (Ze[ot].iWidth - n - Ze[ot].iCurrentSplit * 2) / Ze[ot].iCurrentSplit;
var o = (Ze[ot].iHeight - i - Ze[ot].iCurrentSplit * 2) / Ze[ot].iCurrentSplit;
var a = (Ze[ot].iWidth - n) / Ze[ot].iCurrentSplit;
var s = (Ze[ot].iHeight - i) / Ze[ot].iCurrentSplit;
var u = Ze[ot].iCurrentSplit;
for (var l = 0; l < t; l++) {
var f = r + (l % u === u - 1 ? n : 0);
var c = o + (l + u >= Math.pow(u, 2) ? i : 0);
var d = a + (l % u === u - 1 ? n : 0);
var h = s + (l + u >= Math.pow(u, 2) ? i : 0);
rt.find(".parent-wnd").eq(0).children().eq(l).width(d);
rt.find(".parent-wnd").eq(0).children().eq(l).height(h);
rt.find(".parent-wnd").eq(0).children().eq(l).find(".draw-window").attr("width", d);
rt.find(".parent-wnd").eq(0).children().eq(l).find(".draw-window").attr("height", h);
rt.find(".parent-wnd").eq(0).children().eq(l).find(".play-window").attr("width", f);
rt.find(".parent-wnd").eq(0).children().eq(l).find(".play-window").attr("height", c)
}
if (Ze[ft] && e) {
Ze[ft].resizeCanvas()
}
rt.find(".parent-wnd").eq(Ze[yt]).find(".play-window").css("border", "1px solid " + Ze[ot].oStyle.border);
rt.find(".parent-wnd").eq(Ze[yt]).children().eq(0).find(".play-window").eq(0).css("border", "1px solid " + Ze[ot].oStyle.borderSelect)
}
}
function v() {
var e = Ze[ot].iCurrentSplit;
var t = Ze[ot].iCurrentSplit;
var n = Ze[ot].aCustom;
if (n) {
e = 1 / n[0].width;
t = 1 / n[0].height
}
var i = rt.find(".parent-wnd").eq(0).children().length;
var r = Ze[ot].iWidth % e;
var o = Ze[ot].iHeight % t;
var a = (Ze[ot].iWidth - r - e * 2) / e;
var s = (Ze[ot].iHeight - o - t * 2) / t;
var u = (Ze[ot].iWidth - r) / e;
var l = (Ze[ot].iHeight - o) / t;
for (var f = 0; f < i; f++) {
var c = a + (f % e === e - 1 ? r : 0);
var d = s + (f + t >= Math.pow(t, 2) ? o : 0);
var h = u + (f % e === e - 1 ? r : 0);
var v = l + (f + t >= Math.pow(t, 2) ? o : 0);
rt.find(".parent-wnd").eq(0).children().eq(f).width(h);
rt.find(".parent-wnd").eq(0).children().eq(f).height(v);
rt.find(".parent-wnd").eq(0).children().eq(f).find(".draw-window").attr("width", h);
rt.find(".parent-wnd").eq(0).children().eq(f).find(".draw-window").attr("height", v);
rt.find(".parent-wnd").eq(0).children().eq(f).find(".play-window").attr("width", c);
rt.find(".parent-wnd").eq(0).children().eq(f).find(".play-window").attr("height", d)
}
rt.find(".parent-wnd").eq(Ze[yt]).find(".play-window").css("border", "1px solid " + Ze[ot].oStyle.border);
rt.find(".parent-wnd").eq(Ze[yt]).children().eq(0).find(".play-window").eq(0).css("border", "1px solid " + Ze[ot].oStyle.borderSelect)
}
function Tt(e, t, o, n, i, r, a) {
if (!$("#" + Ze[lt][o].windowID).length) {
return
}
var s = false;
if (n && i) {
s = true
}
Ze[lt][o].bLoad = true;
nt.openStream(e, t, function(e) {
if (e.bHead && !Ze[lt][o].bPlay) {
Ze[lt][o].bPlay = true;
Ze[lt][o].aHead = new Uint8Array(e.buf);
Ze[lt][o].oPlayCtrl.PlayM4_OpenStream(e.buf, u, 1024 * 1024 * 2);
if (Ze[lt][o].szSecretKey !== "") {
setTimeout(function() {
Ze[lt][o].oPlayCtrl.PlayM4_SetSecretKey(1, Ze[lt][o].szSecretKey, 128);
Ze[lt][o].szSecretKey = ""
}, 100)
}
if (Ze[lt][o].aHead[8] === 4) {
Ze[lt][o].oPlayCtrl.PlayM4_SetStreamOpenMode(0)
} else {
Ze[lt][o].oPlayCtrl.PlayM4_SetStreamOpenMode(1)
}
Ze[lt][o].oPlayCtrl.PlayM4_SetInputBufSize(l);
Ze[lt][o].oPlayCtrl.PlayM4_Play(Ze[lt][o].windowID)
} else {
var t = new Uint8Array(e.buf);
var n = Ze[lt][o].oPlayCtrl.PlayM4_GetInputBufSize();
var i = Ze[lt][o].oPlayCtrl.PlayM4_GetYUVBufSize();
if (i === 2 && !Ze[lt][o].bFirstFrame) {
Ze[lt][o].bFirstFrame = true;
Ze.EventCallback.firstFrameDisplay(o)
}
var r = Ze[lt][o].oPlayCtrl.PlayM4_GetDecodeFrameType();
if (n > l * .5 && n < l * .8 && Ze[lt][o].iRate === 1) {
if (r !== Qe && !Ze[lt][o].bFrameForward) {
Ze[lt][o].oPlayCtrl.PlayM4_SetDecodeFrameType(Qe)
}
Ze.EventCallback.performanceLack()
} else if (n >= l * .8) {}
if (i > 10 && i < 15 && !Ze[lt][o].bFrameForward) {
if (r !== Qe) {
Ze[lt][o].oPlayCtrl.PlayM4_SetDecodeFrameType(Qe)
}
Ze.EventCallback.performanceLack()
} else if (i > 15) {}
if (i < 10 && n < l * .5 && Ze[lt][o].iRate === 1) {
if (r !== Ke) {
Ze[lt][o].oPlayCtrl.PlayM4_SetDecodeFrameType(Ke)
}
}
if (e.statusString) {
Ze.EventCallback.pluginErrorHandler(o, f, e)
} else if (e.type && e.type === "exception") {
Ze.EventCallback.pluginErrorHandler(o, c, e)
} else if (e.type === "videoNotSupport") {
Ze.EventCallback.pluginErrorHandler(o, et, e)
} else {
Ze[lt][o].oPlayCtrl.PlayM4_InputData(t, t.length)
}
}
if (Ze[lt][o].szStorageUUID) {
it.inputData(Ze[lt][o].szStorageUUID, e.buf)
}
e = null
}, function() {
if (Ze[lt][o].bPlay) {
Ze.EventCallback.pluginErrorHandler(o, d);
Ze[lt][o].bPlay = false;
Ze[lt][o].bFrameForward = false;
Ze[lt][o].iRate = 1;
if (Ze[lt][o].oPlayCtrl) {
Ze[lt][o].oPlayCtrl.PlayM4_Stop();
Ze[lt][o].oPlayCtrl.PlayM4_CloseStream()
}
}
}).then(function(e) {
Ze[lt][o].szStreamUUID = e;
nt.startPlay(e, n, i, t).then(function() {
if (s) {
Ze[lt][o].szPlayType = "playback";
Ze[lt][o].iRate = 1;
Ze[lt][o].oPlayCtrl.PlayM4_PlayRate(Ze[lt][o].iRate)
} else {
Ze[lt][o].szPlayType = "realplay"
}
r()
}, function(e) {
a(e)
})
}, function(e) {
a(e)
})
}
var t = function() {
function r(e) {
Ot(this, r);
Ze = this;
var t = {
szId: "playWnd",
iType: 1,
iWidth: 400,
iHeight: 300,
iMaxSplit: 4,
iCurrentSplit: 2,
szBasePath: "./"
};
this[ot] = $.extend(t, e);
var n = {
border: "#343434",
borderSelect: "#FFCC00",
background: "#4C4B4B"
};
n = $.extend(n, e.oStyle);
this[ot].oStyle = n;
if (this[ot].iCurrentSplit > this[ot].iMaxSplit) {
this[ot].iCurrentSplit = this[ot].iMaxSplit
}
this[at] = 1;
this[st] = -1;
this[ut] = this[ot].iMaxSplit * this[ot].iMaxSplit;
this[ct] = "";
this[dt] = false;
this[ht] = null;
this[vt] = null;
this[pt] = "";
this[mt] = "";
this[yt] = -1;
this[St] = null;
this[gt] = [];
this[_t] = {};
this[wt] = true;
this[Pt] = "V1.2.0 build20181011";
it = new Et.StorageManager(this[ot].szBasePath + "/transform");
if (Ze[ot].szIframeId && $("#" + Ze[ot].szIframeId).length) {
rt = $("#" + Ze[ot].szId, $("#" + Ze[ot].szIframeId)[0].contentWindow.document)
} else {
if (typeof Ze[ot].szId === "string") {
rt = $("#" + Ze[ot].szId)
} else {
rt = Ze[ot].szId
}
}
this[lt] = [];
for (var i = 0; i < this[ut]; i++) {
this[lt][i] = {};
this[lt][i].bSelect = false;
this[lt][i].bPlay = false;
this[lt][i].bPause = false;
this[lt][i].bRecord = false;
this[lt][i].oPlayCtrl = null;
this[lt][i].szPlayType = "";
this[lt][i].szStorageUUID = "";
this[lt][i].szStreamUUID = "";
this[lt][i].aHead = [];
this[lt][i].bLoad = false;
this[lt][i].windowID = Ze[ot].szId + "canvas_play" + i;
this[lt][i].drawID = Ze[ot].szId + "canvas_draw" + i;
this[lt][i].iRate = 1;
this[lt][i].bEZoom = false;
this[lt][i].bSetDrawCallback = false;
this[lt][i].szSecretKey = "";
this[lt][i].bFrameForward = false;
this[lt][i].iDecodeType = Ke;
this[lt][i].bFirstFrame = false
}
kt();
Ct();
this[ft] = new zt.ESCanvas(Ze[ot].szId + "canvas_draw0");
if (this[ot].iType === 0) {
rt.hide()
}
Rt();
Ze.EventCallback.windowEventSelect(0)
}
Dt(r, [{
key: "JS_UpdateWindowStyle",
value: function n(e) {
this[ot].oStyle = e;
It()
}
}, {
key: "JS_CreateWnd",
value: function o(e, t, n) {
var i = new Promise(function(e) {
Ct(t, n);
Ze[ft].updateCanvas(Ze[ot].szId + "canvas_draw0");
Ze[ft].clearAllShape();
if (n === 0 || t === 0) {
rt.hide()
} else {
rt.show()
}
Ze.EventCallback.windowEventSelect(0);
Rt();
Ze[vt] = null;
e()
});
return i
}
}, {
key: "JS_ShowWnd",
value: function t() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_HideWnd",
value: function i() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SetWndCover",
value: function a() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SetWindowControlCallback",
value: function s(e) {
$.extend(Ze[_t], e);
Ze[_t] && Ze[ft].setDrawEventCallback(Ze[_t].onDrawEvent)
}
}, {
key: "JS_ArrangeWindow",
value: function u(n, i) {
var e = new Promise(function(e) {
if (n < Ze[ot].iMaxSplit) {
Ze[ot].iCurrentSplit = n
} else {
Ze[ot].iCurrentSplit = Ze[ot].iMaxSplit
}
if (xt.oTool.isFirefox()) {
for (var t = 0; t < Ze[ot].iMaxSplit * Ze[ot].iMaxSplit; t++) {
if (Ze[lt][t].oPlayCtrl) {
Ze[lt][t].oPlayCtrl.PlayM4_ClearCanvas()
}
}
}
if (i) {
Ze[ot].aCustom = i
} else {
Ze[ot].aCustom = []
}
It(true);
Ze.EventCallback.windowEventSelect(0);
e()
});
return e
}
}, {
key: "JS_SetSecretKey",
value: function l(n, i) {
var e = new Promise(function(e, t) {
if (n < 0) {
t();
return
}
if (i === "" || typeof i === "undefined") {
t();
return
}
Ze[lt][n].szSecretKey = i;
e()
});
return e
}
}, {
key: "JS_SetOriginalString",
value: function f() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_GetEncryptString",
value: function c() {
var e = new Promise(function(e) {
e("")
});
return e
}
}, {
key: "JS_GetDecryptString",
value: function d() {
var e = new Promise(function(e) {
e("")
});
return e
}
}, {
key: "JS_DestroyPlugin",
value: function h() {
var e = new Promise(function(e) {
Ze[lt].forEach(function(e) {
if (e.bPlay) {
e.oPlayCtrl.PlayM4_CloseStream()
}
if (e.oPlayCtrl) {
e.oPlayCtrl.PlayM4_Destroy();
e.oPlayCtrl = null;
e.bLoad = false
}
});
Ze[ft].setShapeType("");
e()
});
return e
}
}, {
key: "JS_Play",
value: function v(i, r, o, a, s) {
var e = new Promise(function(t, n) {
if (o < 0 || o > Ze[ut] - 1) {
n();
return
}
if (Ze[lt][o].bFrameForward) {
n();
return
}
if (Ze[lt][o].bPlay) {
Ze.JS_Stop(o)
}
setTimeout(function() {
Ze[lt][o].bFirstFrame = false;
Ze[lt][o].iDecodeType = Ke;
if (Ze[lt][o].oPlayCtrl) {
Tt(i, r, o, a, s, t, n)
} else {
Ze[lt][o].oPlayCtrl = new Mt.JSPlayCtrl(Ze[ot].szBasePath + "/playctrl/", function(e) {
if (e.cmd === "loaded" && !Ze[lt][o].bLoad) {
Tt(i, r, o, a, s, t, n)
} else if (e.cmd === "OnebyOne") {
if (!e.status) {
if (!Ze[lt][o].bPause) {
nt.pause(Ze[lt][o].szStreamUUID);
Ze[lt][o].bPause = true
}
} else {
if (Ze[lt][o].bPause) {
nt.resume(Ze[lt][o].szStreamUUID);
Ze[lt][o].bPause = false
}
}
} else if (e.cmd === "GetFrameData") {
Ze.EventCallback.pluginErrorHandler(o, et)
}
}, o)
}
}, 200)
});
return e
}
}, {
key: "JS_ReversePlay",
value: function p() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SetTrsPlayBackParam",
value: function m() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_Stop",
value: function y(n) {
var e = new Promise(function(e, t) {
if (n < 0 || n > Ze[ut] - 1) {
t();
return
}
if (Ze[lt][n].szStorageUUID) {
Ze.JS_StopSave(n)
}
if (Ze[lt][n].bEZoom) {
Ze.JS_DisableZoom(n)
}
if (Ze[st] === n) {
Ze[st] = -1
}
nt.stop(Ze[lt][n].szStreamUUID).then(function() {
Ze[lt][n].bPlay = false;
Ze[lt][n].bFrameForward = false;
Ze[lt][n].iRate = 1;
if (Ze[lt][n].oPlayCtrl) {
Ze[lt][n].oPlayCtrl.PlayM4_Stop();
Ze[lt][n].oPlayCtrl.PlayM4_CloseStream()
}
setTimeout(function() {
e()
}, 500)
}, function() {
setTimeout(function() {
t()
}, 500)
})
});
return e
}
}, {
key: "JS_Seek",
value: function S(n, i, r) {
var e = new Promise(function(e, t) {
if (n < 0 || n > Ze[ut] - 1) {
t();
return
}
if (!Ze[lt][n].bPlay) {
t();
return
}
nt.seek(Ze[lt][n].szStreamUUID, i, r).then(function() {
e()
}, function(e) {
t(e)
})
});
return e
}
}, {
key: "JS_StopRealPlayAll",
value: function g() {
var e = new Promise(function(e) {
nt.stopAll();
Ze[lt].forEach(function(e, t) {
if (e.bPlay) {
if (e.szStorageUUID) {
Ze.JS_StopSave(t)
}
if (e.bEZoom) {
Ze.JS_DisableZoom(t)
}
e.oPlayCtrl.PlayM4_Stop();
e.oPlayCtrl.PlayM4_CloseStream()
}
e.bPlay = false
});
Ze[st] = -1;
e()
});
return e
}
}, {
key: "JS_Pause",
value: function _(n) {
var e = new Promise(function(e, t) {
if (n < 0 || n > Ze[ut] - 1) {
t();
return
}
if (!Ze[lt][n].bPlay) {
t();
return
}
if (Ze[lt][n].bFrameForward) {
t();
return
}
nt.pause(Ze[lt][n].szStreamUUID).then(function() {
Ze[lt][n].oPlayCtrl.PlayM4_Pause(true);
Ze[lt][n].bPause = true;
e()
}, function(e) {
t(e)
})
});
return e
}
}, {
key: "JS_Resume",
value: function P(n) {
var e = new Promise(function(e, t) {
if (n < 0 || n > Ze[ut] - 1) {
t();
return
}
if (!Ze[lt][n].bPlay) {
t();
return
}
nt.resume(Ze[lt][n].szStreamUUID).then(function() {
if (Ze[at] !== 1) {
Ze[lt][n].iRate = Ze[at];
nt.setPlayRate(Ze[lt][n].szStreamUUID, Ze[lt][n].iRate);
Ze[lt][n].oPlayCtrl.PlayM4_PlayRate(Ze[lt][n].iRate);
if (Ze[at] > 1) {
Ze[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType(Qe)
} else {
Ze[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType(Ke)
}
}
if (Ze[lt][n].bFrameForward) {
Ze[lt][n].oPlayCtrl.PlayM4_Play(Ze[lt][n].windowID);
Ze[lt][n].bFrameForward = false
} else {
Ze[lt][n].oPlayCtrl.PlayM4_Pause(false)
}
Ze[lt][n].bPause = false;
e()
}, function(e) {
t(e)
})
});
return e
}
}, {
key: "JS_Slow",
value: function w(n) {
var e = new Promise(function(e, t) {
if (n < 0 || n > Ze[ut] - 1) {
t();
return
}
if (!Ze[lt][n].bPlay) {
t();
return
}
if (Ze[lt][n].szPlayType !== "playback") {
t();
return
}
if (Ze[lt][n].iRate === -8) {
t();
return
}
if (Ze[lt][n].bFrameForward) {
t();
return
}
if (Ze[lt][n].iRate < 0 && Ze[lt][n].iRate > -8) {
Ze[lt][n].iRate *= 2
}
if (Ze[lt][n].iRate === 1) {
Ze[lt][n].iRate *= -2
}
if (Ze[lt][n].iRate > 1) {
Ze[lt][n].iRate /= 2
}
nt.setPlayRate(Ze[lt][n].szStreamUUID, Ze[lt][n].iRate).then(function() {
if (Ze[lt][n].iRate < 2) {
Ze[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType(Ke)
} else {
Ze[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType(Qe);
Ze[lt][n].oPlayCtrl.PlayM4_SetIFrameDecInterval(0)
}
Ze[lt][n].oPlayCtrl.PlayM4_PlayRate(Ze[lt][n].iRate);
e()
}, function(e) {
t(e)
})
});
return e
}
}, {
key: "JS_Fast",
value: function b(n) {
var e = new Promise(function(e, t) {
if (n < 0 || n > Ze[ut] - 1) {
t();
return
}
if (!Ze[lt][n].bPlay) {
t();
return
}
if (Ze[lt][n].szPlayType !== "playback") {
t();
return
}
if (Ze[lt][n].bFrameForward) {
t();
return
}
if (Ze[lt][n].iRate === 8) {
t();
return
}
if (Ze[lt][n].iRate === -2) {
Ze[lt][n].iRate = 1
} else if (Ze[lt][n].iRate < -2) {
Ze[lt][n].iRate /= 2
} else if (Ze[lt][n].iRate > 0 && Ze[lt][n].iRate < 8) {
Ze[lt][n].iRate *= 2
}
nt.setPlayRate(Ze[lt][n].szStreamUUID, Ze[lt][n].iRate).then(function() {
if (Ze[lt][n].iRate < 2) {
Ze[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType(Ke)
} else {
Ze[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType(Qe);
if (Ze[lt][n].iRate === 8) {
Ze[lt][n].oPlayCtrl.PlayM4_SetIFrameDecInterval(2)
} else {
Ze[lt][n].oPlayCtrl.PlayM4_SetIFrameDecInterval(0)
}
}
Ze[lt][n].oPlayCtrl.PlayM4_PlayRate(Ze[lt][n].iRate);
e()
}, function(e) {
t(e)
})
});
return e
}
}, {
key: "JS_Transmission",
value: function k(e, i) {
var t = new Promise(function(t, n) {
if (e < 0 || e > Ze[ut] - 1) {
n();
return
}
if (!Ze[lt][e].szStreamUUID) {
n();
return
}
nt.transmission(Ze[lt][e].szStreamUUID, i).then(function(e) {
t(e)
}, function(e) {
n(e)
})
});
return t
}
}, {
key: "JS_FrameForward",
value: function C(n) {
var e = new Promise(function(e, t) {
if (n < 0 || n > Ze[ut] - 1) {
t();
return
}
if (!Ze[lt][n].bPlay) {
t();
return
}
if (Ze[lt][n].iRate !== 1) {
Ze[lt][n].iRate = 1;
Ze[at] = Ze[lt][n].iRate;
nt.setPlayRate(Ze[lt][n].szStreamUUID, Ze[lt][n].iRate).then(function() {
Ze[lt][n].oPlayCtrl.PlayM4_PlayRate(Ze[lt][n].iRate);
Ze[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType(Ke);
Ze[lt][n].oPlayCtrl.PlayM4_OneByOne();
Ze[lt][n].bFrameForward = true
}, function(e) {
t(e)
})
} else {
Ze[lt][n].oPlayCtrl.PlayM4_PlayRate(Ze[lt][n].iRate);
Ze[lt][n].oPlayCtrl.PlayM4_SetDecodeFrameType(Ke);
Ze[lt][n].oPlayCtrl.PlayM4_OneByOne();
Ze[lt][n].bFrameForward = true
}
e()
});
return e
}
}, {
key: "JS_GetOSDTime",
value: function R(n) {
var e = new Promise(function(i, e) {
if (n < 0 || n > Ze[ut] - 1) {
e();
return
}
if (!Ze[lt][n].bPlay) {
e();
return
}
var t = Ze[lt][n].oPlayCtrl.PlayM4_GetOSDTime(function(e) {
var t = xt.oTool.isSafari() || xt.oTool.isEdge() ? "/" : " ";
var n = Date.parse(e.replace(/-/g, t)) / 1e3;
i(n)
});
if (t !== 1) {
e();
return
}
});
return e
}
}, {
key: "JS_OpenSound",
value: function I(n) {
var e = new Promise(function(e, t) {
if (n < 0 || n > Ze[ut] - 1) {
t();
return
}
if (!Ze[lt][n].bPlay) {
t();
return
}
if (Ze[st] === n) {
t();
return
}
if (Ze[st] !== -1) {
Ze[lt][Ze[st]].oPlayCtrl.PlayM4_StopSound()
}
if (Ze[lt][n].oPlayCtrl.PlayM4_PlaySound(n) !== 1) {
t();
return
}
Ze[st] = n;
e()
});
return e
}
}, {
key: "JS_CloseSound",
value: function T() {
var e = new Promise(function(e, t) {
var n = Ze[st];
if (n < 0 || n > Ze[ut] - 1) {
t();
return
}
if (!Ze[lt][n].bPlay) {
t();
return
}
if (Ze[lt][n].oPlayCtrl.PlayM4_StopSound() !== 1) {
t();
return
}
Ze[st] = -1;
e()
});
return e
}
}, {
key: "JS_GetVolume",
value: function D(e) {
var t = new Promise(function(t) {
Ze[lt][e].oPlayCtrl.PlayM4_GetVolume(function(e) {
t(e)
})
});
return t
}
}, {
key: "JS_SetVolume",
value: function x(n, i) {
var e = new Promise(function(e, t) {
if (Ze[lt][n].oPlayCtrl.PlayM4_SetVolume(i) !== 1) {
t();
return
}
e()
});
return e
}
}, {
key: "JS_EnableZoom",
value: function M(n) {
var e = new Promise(function(e, t) {
if (n < 0 || n > Ze[ut] - 1) {
t();
return
}
if (!Ze[lt][n].bPlay) {
t();
return
}
$(".draw-window").unbind();
Ze[ft] = new zt.ESCanvas(Ze[ot].szId + "canvas_draw" + n);
Ze[ft].setShapeType("Rect");
Ze[ft].setDrawStyle("#ff0000", "", 0);
Ze[ft].setDrawStatus(true, function(e) {
if (e.startPos && e.endPos) {
if (e.startPos[0] > e.endPos[0]) {
Ze[lt][n].oPlayCtrl.PlayM4_SetDisplayRegion(null, false)
} else {
Ze[lt][n].oPlayCtrl.PlayM4_SetDisplayRegion({
left: e.startPos[0],
top: e.startPos[1],
right: e.endPos[0],
bottom: e.endPos[1]
}, true)
}
}
});
Ze[lt][n].bEZoom = true;
e()
});
return e
}
}, {
key: "JS_DisableZoom",
value: function E(n) {
var e = new Promise(function(e, t) {
if (n < 0 || n > Ze[ut] - 1) {
t();
return
}
if (!Ze[lt][n].bPlay) {
t();
return
}
Ze[ft].setDrawStatus(false);
if (Ze[lt][n].oPlayCtrl.PlayM4_SetDisplayRegion(null, false) !== 1) {
t();
return
}
Ze[lt][n].bEZoom = false;
Ze[_t] && Ze[_t].onDrawEvent && Ze[ft].setDrawEventCallback(Ze[_t].onDrawEvent);
e()
});
return e
}
}, {
key: "JS_CapturePicture",
value: function z(r, o, a) {
var e = new Promise(function(t, n) {
if (r < 0 || r > Ze[ut] - 1) {
n();
return
}
if (!Ze[lt][r].bPlay) {
n();
return
}
if (!a) {
a = "JPEG"
}
if (a === "BMP") {
var e = Ze[lt][r].oPlayCtrl.PlayM4_GetBMP(function(e) {
if (e === 6) {
n(tt)
} else {
xt.oTool.downloadFile(e, o + ".BMP");
t()
}
});
if (e !== 1) {
n(tt)
}
} else if (a === "JPEG") {
var i = Ze[lt][r].oPlayCtrl.PlayM4_GetJPEG(function(e) {
if (e === 6) {
n(tt)
} else {
xt.oTool.downloadFile(e, o + ".jpeg");
t()
}
});
if (i !== 1) {
n(tt)
}
}
});
return e
}
}, {
key: "JS_StartSave",
value: function O(o, a) {
var e = new Promise(function(t, e) {
if (o < 0 || o > Ze[ut] - 1) {
e();
return
}
if (!Ze[lt][o].bPlay) {
e();
return
}
if (a.indexOf(".mp4") < 0) {
a = a + ".mp4"
}
var n = Ze[lt][o].aHead;
var i = 0;
if (Ze[lt][o].szPlayType === "playback") {
i = 1
}
it.startRecord(a, n, 2, i, {
cbEventHandler: function r(e) {
Ze.EventCallback.pluginErrorHandler(o, e)
}
}).then(function(e) {
Ze[lt][o].szStorageUUID = e;
t()
}, function() {
e()
})
});
return e
}
}, {
key: "JS_StopSave",
value: function F(n) {
var e = new Promise(function(e, t) {
if (!Ze[lt][n].szStorageUUID) {
t();
return
}
it.stopRecord(Ze[lt][n].szStorageUUID).then(function() {
Ze[lt][n].szStorageUUID = "";
e()
}, function(e) {
t(e)
})
});
return e
}
}, {
key: "JS_StartTalk",
value: function q() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_StopTalk",
value: function W() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SetPlayMode",
value: function J() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SetFullScreenCapability",
value: function L(t) {
var e = new Promise(function(e) {
Ze[wt] = !!t;
e()
});
return e
}
}, {
key: "JS_FullScreenDisplay",
value: function A(n) {
var e = new Promise(function(e) {
if (n) {
var t = rt.get(0);
if (t.requestFullScreen) {
t.requestFullScreen()
} else if (t.webkitRequestFullScreen) {
t.webkitRequestFullScreen()
} else if (t.mozRequestFullScreen) {
t.mozRequestFullScreen()
}
}
Ze[dt] = n;
e()
});
return e
}
}, {
key: "JS_FullScreenSingle",
value: function B(e) {
if (!Ze[lt][e].bPlay) {
return
}
var t = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || false;
var n = rt.find(".parent-wnd").eq(0).children().eq(e).get(0);
if (!t) {
if (n.requestFullScreen) {
n.requestFullScreen()
} else if (n.webkitRequestFullScreen) {
n.webkitRequestFullScreen()
} else if (n.mozRequestFullScreen) {
n.mozRequestFullScreen()
}
Ze[ht] = rt.find(".parent-wnd").eq(0).children().eq(e)
} else {
if (rt.find(".parent-wnd").eq(0).width() === $(window).width()) {
return
}
if (document.exitFullscreen) {
document.exitFullscreen()
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen()
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen()
}
Ze[ht] = null;
Ze[dt] = false
}
}
}, {
key: "JS_EnableIVS",
value: function U() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SRInit",
value: function H() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SRPTZ",
value: function N() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SetPlaybackDrawType",
value: function G() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_GetLocalConfig",
value: function V() {
var t = {
protocolType: 0,
streamType: 0,
packgeSize: 1,
playWndType: 0,
buffNumberType: 2,
recordPath: "",
capturePath: "",
playbackFilePath: "",
playbackPicPath: "",
downloadPath: "",
snapScenePicPath: "",
snapViewPicPath: "",
ivsMode: -1,
realPlayAll: 0,
captureFileFormat: 0,
osdPosInfo: 0,
osdPicInfo: 1,
showWizard: 1,
secretKey: "",
showFireBox: 0,
showFireDistance: 0,
showFireMaxTemperature: 0,
showFireMaxTemperaturePos: 0,
showTemperaturePoint: 0,
showTemperatureLine: 0,
showTemperatureBox: 0,
captureIncludeTemperatureInfo: 0
};
var e = new Promise(function(e) {
e(t)
});
return e
}
}, {
key: "JS_SetLocalConfig",
value: function j() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_GetLastError",
value: function X() {
var n = 0;
var e = new Promise(function(e, t) {
if (n < 0) {
t()
} else {
e(n)
}
});
return e
}
}, {
key: "JS_OpenFileBrowser",
value: function Y(i, r) {
var e = new Promise(function(t) {
Ze[vt] = null;
var n = window.document.createElement("input");
n.type = "file";
if (r.toLowerCase() === "bmp") {
n.accept = "image/bmp"
}
if (i === 0) {
n.setAttribute("webkitdirectory", "")
}
n.addEventListener("change", function() {
var e = "";
if (i === 1) {
Ze[vt] = n.files[0];
e = n.files[0].name
} else if (i === 0) {
Ze[vt] = n.files
}
t(e)
});
var e = document.createEvent("MouseEvents");
e.initEvent("click", true, true);
n.dispatchEvent(e)
});
return e
}
}, {
key: "JS_OpenDirectory",
value: function Z() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_StartAsynUpload",
value: function K(i) {
var e = new Promise(function(e, t) {
var n = new XMLHttpRequest;
n.onreadystatechange = function() {
if (n.readyState === 4) {
if (n.status === 200) {
Ze[pt] = n.responseText;
e()
} else {
t()
}
}
};
n.open("put", i, true);
n.send(Ze[vt])
});
return e
}
}, {
key: "JS_StopAsynUpload",
value: function Q() {
var e = new Promise(function(e) {
Ze[pt] = "";
e()
});
return e
}
}, {
key: "JS_UploadFile",
value: function ee(i, e, t, r) {
var n = new Promise(function(e, t) {
var n = new XMLHttpRequest;
n.onreadystatechange = function() {
if (n.readyState === 4) {
if (n.status !== 200) {
t({
readyState: 4,
status: n.status,
responseXML: n.responseText ? xt.oTool.parseXmlFromStr(n.responseText) : null,
errorInfo: n.responseText
})
} else {
e()
}
}
};
n.open("put", i, false);
if (r) {
n.setRequestHeader("Content-Type", r)
} else {
n.setRequestHeader("Content-Type", "oct/stream")
}
n.send(Ze[vt])
});
return n
}
}, {
key: "JS_GetUploadErrorInfo",
value: function te() {
var e = new Promise(function(e, t) {
if (typeof Ze[pt] === "string" && Ze[pt].length > 0) {
e(Ze[pt])
} else {
t()
}
});
return e
}
}, {
key: "JS_DownloadFile",
value: function ne(t) {
var e = new Promise(function(e) {
$("body").append('<a id="jsplugin_download_a" href="' + t + '"><li id="jsplugin_download_li"></li></a>');
$("#jsplugin_download_li").trigger("click");
$("#jsplugin_download_a").remove();
e()
});
return e
}
}, {
key: "JS_DownloadFileNoPlugin",
value: function ie(t) {
var e = new Promise(function(e) {
$("body").append('<a id="jsplugin_download_a" href="' + t + '"><li id="jsplugin_download_li"></li></a>');
$("#jsplugin_download_li").trigger("click");
$("#jsplugin_download_a").remove();
e()
});
return e
}
}, {
key: "JS_StartUpgrade",
value: function re(e, t) {
var n = new Promise(function(i, r) {
if (!e) {
r();
return
}
if (!t) {
r();
return
}
Ze[pt] = 0;
var o = new XMLHttpRequest;
o.onreadystatechange = function() {
if (o.readyState === 4) {
if (o.status === 200) {
Ze[pt] = 100;
i()
} else {
Ze[pt] = 1;
var e = xt.oTool.parseXmlFromStr(o.responseText);
if ($(e).find("subStatusCode").text() === "lowPrivilege") {
r(403)
} else if ($(e).find("MErrDevSelfEx").length > 0 || $(e).find("MErrCode").length > 0) {
var t = parseInt($(e).find("MErrDevSelfEx").text(), 10);
var n = parseInt($(e).find("MErrCode").text(), 10);
if (t > 0) {
r(t)
} else if (n > 0) {
r(n)
} else {
r()
}
} else {
r()
}
}
}
};
o.open("put", e, true);
o.send(Ze[vt]);
Ze[mt] = t
});
return n
}
}, {
key: "JS_StopUpgrade",
value: function oe() {
var e = new Promise(function(e) {
Ze[vt] = null;
e()
});
return e
}
}, {
key: "JS_GetUpgradeStatus",
value: function ae() {
var e = new Promise(function(e) {
if (Ze[pt] === 100) {
e(0)
}
e(Ze[pt])
});
return e
}
}, {
key: "JS_GetUpgradeProgress",
value: function se() {
var e = new Promise(function(e) {
var t = 0;
var n = new XMLHttpRequest;
n.onreadystatechange = function() {
if (n.readyState === 4) {
if (n.status === 200) {
t = parseInt($(xt.oTool.parseXmlFromStr(n.responseText)).find("percent").text(), 10)
}
}
};
n.open("get", Ze[mt], false);
n.send(null);
if (Ze[pt] === 100) {
e(100)
}
e(t)
});
return e
}
}, {
key: "JS_ExportDeviceLog",
value: function ue(v, p, m) {
var e = new Promise(function(e) {
var t = [];
var n = [];
t = t.concat($(v).find("searchMatchItem").toArray());
for (var i = 0; i < t.length; i++) {
n[i] = [];
n[i][0] = $(t[i]).find("logtime").text().replace("T", " ").replace("Z", "");
n[i][1] = $(t[i]).find("majortype").text();
n[i][2] = $(t[i]).find("minortype").text();
n[i][3] = $(t[i]).find("channelid").text();
n[i][4] = $(t[i]).find("userName").text();
n[i][5] = $(t[i]).find("remoteaddress").text()
}
var r = [];
function o(e) {
r.push(e);
var t = e.slice("");
if (/^[\u4e00-\u9fa5]/.test(e)) {
for (var n = 0; n < 30 - t.length * 2; n++) {
r.push(" ")
}
} else {
for (var i = 0; i < 30 - t.length; i++) {
r.push(" ")
}
}
}
o(" ");
o($(v).find("laLogTime").text());
o($(v).find("laLogMajorType").text());
o($(v).find("laLogMinorType").text());
o($(v).find("laLogChannel").text());
o($(v).find("laLogRemoteUser").text());
o($(v).find("laLogRemoteIP").text());
r.push("\r\n");
for (var a = 0; a < n.length; a++) {
var s = (a + 1).toString();
o(s);
for (var u = 0; u < 6; u++) {
o(n[a][u])
}
r.push("\r\n")
}
r = r.join("");
var l = "\ufeff";
var f = void 0;
if (m === 5) {
f = new Blob([l + r], {
type: "text/csv"
})
} else {
f = new Blob([r], {
type: "text/plain"
});
p = "Log.txt"
}
var c = (window.URL || window.webkitURL).createObjectURL(f);
var d = window.document.createElement("a");
d.href = c;
d.download = p;
var h = document.createEvent("MouseEvents");
h.initEvent("click", true, true);
d.dispatchEvent(h);
e()
});
return e
}
}, {
key: "outCsv",
value: function le(e, t, n, i) {
var r = "";
var o = "";
for (var a = 0; a < n.length; a++) {
o += $(e).find(n[a]).eq(0).text() + ","
}
o = o.slice(0, -1);
r += o + "\r\n";
for (var s = 0; s < i.length; s++) {
o = "";
for (var u = 0; u < n.length; u++) {
o += '"' + i[s][u] + '",'
}
o.slice(0, o.length - 1);
r += o + "\r\n"
}
if (r === "") {
return
}
var l = "";
l += t;
var f = "\ufeff";
if (window.navigator.msSaveOrOpenBlob) {
var c = f + r;
var d = new Blob([decodeURIComponent(encodeURI(c))], {
type: "data:text/csv;charset=utf-8,"
});
navigator.msSaveBlob(d, l + ".csv")
} else {
f = "data:text/csv;charset=utf-8,\ufeff";
var h = f + r;
var v = encodeURI(h).replace(/&/g, "%26").replace(/\+/g, "%2B").replace(/\s/g, "%20").replace(/#/g, "%23");
var p = document.createElement("a");
p.setAttribute("href", v);
p.setAttribute("download", l + ".csv");
document.body.appendChild(p);
p.click()
}
}
}, {
key: "JS_ExportReport",
value: function fe(m, y, S) {
var g = this;
var e = new Promise(function(e) {
var t = [];
var n = [];
var i = $(m).find("NameList").text().split(",");
t = t.concat($(m).find("tDataItem").toArray());
for (var r = 0; r < t.length; r++) {
n[r] = [];
for (var o = 0; o < i.length; o++) {
n[r][o] = $(t[r]).find(i[o]).text();
if (i[o] === "logtime") {
n[r][o] = n[r][o].replace("T", " ").replace("Z", "")
}
}
}
var a = [];
if (S === 1) {
g.outCsv(m, y, i, n)
} else {
var s = function s(e) {
a.push(e);
var t = e.slice("");
if (/^[\u4e00-\u9fa5]/.test(e)) {
for (var n = 0; n < 30 - t.length * 2; n++) {
a.push(" ")
}
} else {
for (var i = 0; i < 30 - t.length; i++) {
a.push(" ")
}
}
};
s(" ");
for (var u = 0; u < i.length; u++) {
s($(m).find(i[u]).eq(0).text())
}
a.push("\r\n");
for (var l = 0; l < n.length; l++) {
var f = (l + 1).toString();
s(f);
for (var c = 0; c < i.length; c++) {
s(n[l][c])
}
a.push("\r\n")
}
a = a.join("");
var d = void 0;
d = new Blob([a], {
type: "text/plain"
});
var h = (window.URL || window.webkitURL).createObjectURL(d);
var v = window.document.createElement("a");
v.href = h;
v.download = y;
var p = document.createEvent("MouseEvents");
p.initEvent("click", true, true);
v.dispatchEvent(p)
}
e()
});
return e
}
}, {
key: "JS_StartAsyncDownload",
value: function ce(i, e, r, o) {
var t = new Promise(function(e) {
var t = $(xt.oTool.parseXmlFromStr(o)).find("playbackURI").eq(0).text();
var n = i + (i.indexOf("?") >= 0 ? "&" : "?") + "playbackURI=" + t;
$("body").append('<a id="jsplugin_download_a" href="' + n + '" download=' + r + '><li id="jsplugin_download_li"></li></a>');
$("#jsplugin_download_li").trigger("click");
$("#jsplugin_download_a").remove();
e()
});
return t
}
}, {
key: "JS_StopAsyncDownload",
value: function de() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_GetDownloadStatus",
value: function he() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_GetDownloadProgress",
value: function ve() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_EnablePDC",
value: function pe() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_Resize",
value: function me(n, i) {
var e = new Promise(function(e) {
setTimeout(function() {
var e = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || false;
if (Ze[dt] && e) {
n = $(window).width();
i = $(window).height();
rt.find("div").eq(0).css({
width: n,
height: i
})
} else {
rt.find("div").eq(0).css({
width: n,
height: i
})
}
Ze[ot].iWidth = n;
Ze[ot].iHeight = i;
if (xt.oTool.isFirefox()) {
for (var t = 0; t < Ze[ot].iMaxSplit * Ze[ot].iMaxSplit; t++) {
if (Ze[lt][t].oPlayCtrl) {
Ze[lt][t].oPlayCtrl.PlayM4_ClearCanvas()
}
}
}
It();
if (Ze[ht] && e) {
n = $(window).width();
i = $(window).height();
Ze[ht].css({
width: n,
height: i
});
Ze[ht].find("canvas").attr("width", n - 2);
Ze[ht].find("canvas").attr("height", i - 2)
}
if (!e) {
Ze[ht] = null;
Ze[dt] = false
}
Ze[ft].resizeCanvas();
Ze[ft].canvasRedraw()
}, 80);
e()
});
return e
}
}, {
key: "JS_SetDrawCallback",
value: function ye(n, i, e, t, r) {
var o = new Promise(function(e, t) {
Ze[St] = null;
Ze[gt][n] = null;
if (!Ze[lt][n].bPlay) {
t();
return
}
if (i) {
$(".draw-window").unbind();
Ze[St] = r;
Ze[gt][n] = r;
Ze[ft] = new zt.ESCanvas(Ze[ot].szId + "canvas_draw" + n);
Ze[ft].setShapeType("Rect");
Ze[ft].setDrawStyle("#ff0000", "", 0);
Ze[ft].setDrawStatus(true, function(e) {
r(e)
});
Ze[lt][n].bSetDrawCallback = true
} else {
Ze[ft].setDrawStatus(false);
Ze[lt][n].bSetDrawCallback = false;
Ze[_t] && Ze[_t].onDrawEvent && Ze[ft].setDrawEventCallback(Ze[_t].onDrawEvent)
}
e()
});
return o
}
}, {
key: "JS_SetDrawStatus",
value: function Se(n) {
var e = new Promise(function(e, t) {
if (!Ze[ft]) {
t();
return
}
Ze[ft].setDrawStatus(n);
e()
});
return e
}
}, {
key: "JS_ClearRegion",
value: function ge() {
var e = new Promise(function(e, t) {
if (!Ze[ft]) {
t();
return
}
Ze[ft].clearAllShape();
e()
});
return e
}
}, {
key: "JS_SetDrawShapeInfo",
value: function _e(i, r) {
var e = new Promise(function(e, t) {
if (typeof i === "undefined" || i === "") {
t();
return
}
if ("" !== r.id && "Rect" === i) {
Ze[ft].deleteRepeatByIdAndType(r.id, "Rect")
}
Ze[ft].setShapeType(i);
Ze[ft].setDrawStatus(true);
Ze[ft].setDrawMutiShapeOneTime(false);
Ze[ft].setDrawStyle(r.drawColor || "", r.fillColor || r.drawColor || "", r.translucent || 0);
if (r.maxShapeSupport && r.maxShapeSupport > 0) {
if (r.id) {
var n = Ze[ft].getAllShapesInfo().length;
Ze[ft].setMaxShapeSupport(n + 1)
} else {
Ze[ft].setMaxShapeSupport(r.maxShapeSupport)
}
}
Ze[ft].setCurrentShapeInfo({
szId: r.id,
szTips: r.tips,
lineType: r.lineType,
iMinClosed: r.minPointSupport || r.minClosed || 3,
iMaxPointNum: r.maxPointSupport || r.pointNumMax || 11,
iPolygonType: 1,
szDrawColor: r.drawColor || "",
szFillColor: r.fillColor || r.drawColor || "",
iTranslucent: r.translucent || 0,
iRedrawMode: r.redrawMode || 0,
type: r.type
});
e()
});
return e
}
}, {
key: "JS_SetGridInfo",
value: function Pe(i) {
var e = new Promise(function(e, t) {
if (i === null || typeof i === "undefined") {
t();
return
}
var n = "#ff0000";
if (i.drawColor) {
n = i.drawColor
}
Ze[ft].setDrawStyle(n);
Ze[ft].setShapesInfoByType("Grid", [{
gridMap: i.gridMap,
gridColNum: i.gridColNum,
gridRowNum: i.gridRowNum
}]);
Ze[ft].setShapeType("Grid");
e()
});
return e
}
}, {
key: "JS_GetGridInfo",
value: function we() {
var e = new Promise(function(e, t) {
if (!Ze[ft]) {
t()
}
var n = Ze[ft].getShapesInfoByType("Grid")[0];
if (!n) {
t()
}
e({
gridColNum: n.gridColNum,
gridRowNum: n.gridRowNum,
gridMap: n.gridMap
})
});
return e
}
}, {
key: "JS_SetRectInfo",
value: function be(a) {
var e = new Promise(function(e, t) {
if (typeof a === "undefined" || !a.length) {
t();
return
}
if (a[0] && a[0].maxShapeSupport && a[0].maxShapeSupport > 0) {
Ze[ft].setMaxShapeSupport(a[0].maxShapeSupport)
} else {
Ze[ft].setMaxShapeSupport(25)
}
Ze[ft].setDrawMutiShapeOneTime(false);
var n = [];
if (a.length > 0) {
for (var i = 0, r = a.length; i < r; i++) {
var o = a[i].points;
if (o.length > 0) {
n.push(a[i])
}
}
}
if (n.length > 0) {
Ze[ft].setShapesInfoByType("Rect", n);
e()
} else {
t()
}
});
return e
}
}, {
key: "JS_GetRectInfo",
value: function ke() {
var e = new Promise(function(e, t) {
if (!Ze[ft]) {
t()
}
var n = [];
var i = Ze[ft].getShapesInfoByType("Rect");
for (var r = 0, o = i.length; r < o; r++) {
var a = i[r];
var s = {
id: a.id,
points: a.points,
tips: a.tips
};
n.push(s)
}
e(n)
});
return e
}
}, {
key: "JS_SetPolygonInfo",
value: function Ce(a) {
var e = new Promise(function(e, t) {
if (typeof a === "undefined" || !a.length) {
t();
return
}
Ze[ft].setMaxShapeSupport(25);
Ze[ft].setDrawMutiShapeOneTime(false);
Ze[ft].setShapeType("");
var n = [];
if (a.length > 0) {
for (var i = 0, r = a.length; i < r; i++) {
var o = a[i].points;
if (o.length > 0) {
Ze[ft].setCurrentShapeInfo({
szId: a[i].id
});
n.push(a[i])
}
}
}
if (n.length > 0) {
Ze[ft].setShapesInfoByType("Polygon", n);
e()
} else {
t()
}
});
return e
}
}, {
key: "JS_GetPolygonInfo",
value: function Re() {
var e = new Promise(function(e) {
var t = [];
var n = Ze[ft].getShapesInfoByType("Polygon");
for (var i = 0, r = n.length; i < r; i++) {
var o = n[i];
var a = {
id: o.id,
points: o.points,
closed: o.closed,
tips: o.tips,
drawColor: o.drawColor
};
t.push(a)
}
e(t)
});
return e
}
}, {
key: "JS_SetLineInfo",
value: function Ie(f) {
var e = new Promise(function(e, t) {
if (typeof f === "undefined" || !f.length) {
t();
return
}
var n = [];
Ze[ft].setMaxShapeSupport(25);
Ze[ft].setDrawMutiShapeOneTime(false);
if (f.length > 0) {
for (var i = 0, r = f.length; i < r; i++) {
var o = Ze[ft].getShapesInfoByType("Line");
for (var a = 0, s = o.length; a < s; a++) {
var u = o[a];
if (f[i].id === u.id) {
Ze[ft].deleteRepeatByIdAndType(f[i].id, "Line")
}
}
var l = f[i].points;
if (l.length > 0) {
n.push(f[i])
}
}
}
if (n.length > 0) {
Ze[ft].setShapesInfoByType("Line", n);
Ze[ft].setShapeType("");
e()
} else {
t()
}
});
return e
}
}, {
key: "JS_GetLineInfo",
value: function Te() {
var e = new Promise(function(e) {
var t = [];
var n = Ze[ft].getShapesInfoByType("Line");
for (var i = 0, r = n.length; i < r; i++) {
var o = n[i];
var a = {
id: o.id,
lineType: o.lineType,
points: o.points,
tips: o.tips,
direction: o.direction,
closed: o.closed,
pdcArrow: o.pdcArrow
};
t.push(a)
}
e(t)
});
return e
}
}, {
key: "JS_SetTextOverlay",
value: function De(p) {
var e = new Promise(function(e) {
Ze[ft] = null;
Ze[ft] = new zt.ESCanvas(Ze[ot].szId + "canvas_draw" + Ze[yt]);
Ze[ft].setMaxShapeSupport(25);
Ze[ft].clearShapeByType("RectOSD");
Ze[ft].setDrawStyle("#ff0000", "#343434", .7);
var t = "";
var n = "";
var i = 0;
var r = 0;
if (p.channelName) {
t = p.channelName.name;
n = p.channelName.enable.toString();
i = p.channelName.point[0];
r = p.channelName.point[1];
Ze[ft].addOSDShape(t, n, i, r, {
szOSDType: "overlay-ch",
szAlignment: p.channelName.alignment || "0"
})
}
if (p.date) {
var o = p.date.dateType;
var a = p.date.showWeekDay;
var s = p.date.timeFormat;
var u = "";
var l = "";
t = "";
n = p.date.enable.toString();
i = p.date.point[0];
r = p.date.point[1];
var f = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var c = new Date;
if (a) {
u = f[c.getDay()]
}
if (s === "24hour") {
l = ""
} else {
l = "AM/PM"
}
switch (o) {
case 0:
t = "YYYY-MM-DD " + u + " hh:mm:ss " + l;
break;
case 1:
t = "MM-DD-YYYY " + u + " hh:mm:ss " + l;
break;
case 2:
t = "CHR-YYYY-MM-DD " + u + " hh:mm:ss " + l;
break;
case 3:
t = "CHR-MM-DD-YYYY " + u + " hh:mm:ss " + l;
break;
case 4:
t = "DD-MM-YYYY " + u + " hh:mm:ss " + l;
break;
case 5:
t = "CHR-DD-MM-YYYY " + u + " hh:mm:ss " + l;
break;
default:
break
}
Ze[ft].addOSDShape(t, n, i, r, {
szOSDType: "overlay-date",
szDateStyle: o.toString(),
szDisplayWeek: a.toString(),
szClockType: s,
szAlignment: p.date.alignment || "0"
})
}
if (p.text) {
var d = "";
var h = p.text.length;
t = "";
n = "";
i = 0;
r = 0;
for (var v = 0; v < h; v++) {
d = p.text[v].id;
t = p.text[v].text;
n = p.text[v].enable.toString();
i = p.text[v].point[0];
r = p.text[v].point[1];
Ze[ft].addOSDShape(t, n, i, r, {
szOSDType: "overlay-text",
szId: d,
szAlignment: p.text[v].alignment || "0"
})
}
}
Ze[_t] && Ze[_t].onDrawEvent && Ze[ft].setDrawEventCallback(Ze[_t].onDrawEvent);
e()
});
return e
}
}, {
key: "JS_GetTextOverlay",
value: function xe() {
var e = new Promise(function(e) {
var t = {};
var n = [];
var i = Ze[ft].getShapesInfoByType("RectOSD");
for (var r = 0, o = i.length; r < o; r++) {
var a = i[r];
if (a.szOSDType === "overlay-ch") {
t.channelName = {
enable: a.szEnabled === "true",
name: a.szText,
alignment: a.szAlignment || "0",
point: [a.iPositionX, a.iPositionY]
}
}
if (a.szOSDType === "overlay-date") {
t.date = {
enable: a.szEnabled === "true",
alignment: a.szAlignment || "0",
dateType: parseInt(a.szDateStyle, 10),
timeFormat: a.szClockType,
showWeekDay: a.szDisplayWeek === "true",
point: [a.iPositionX, a.iPositionY]
}
}
if (a.szOSDType === "overlay-text") {
n.push({
id: a.szId,
enable: a.szEnabled === "true",
alignment: a.szAlignment || "0",
text: a.szText,
point: [a.iPositionX, a.iPositionY]
})
}
}
t.text = n;
e(t)
});
return e
}
}, {
key: "JS_SetPointInfo",
value: function Me(f) {
var e = new Promise(function(e, t) {
if (typeof f === "undefined" || !f.length) {
t();
return
}
var n = [];
Ze[ft].setMaxShapeSupport(25);
Ze[ft].setDrawMutiShapeOneTime(false);
if (f.length > 0) {
for (var i = 0, r = f.length; i < r; i++) {
var o = Ze[ft].getShapesInfoByType("Point");
for (var a = 0, s = o.length; a < s; a++) {
var u = o[a];
if (f[i].id === u.id) {
Ze[ft].deleteRepeatByIdAndType(f[i].id, "Point")
}
}
var l = f[i].points;
if (l.length > 0) {
f[i].points = [l];
n.push(f[i])
}
}
}
if (n.length > 0) {
Ze[ft].setShapesInfoByType("Point", n);
e()
} else {
t()
}
});
return e
}
}, {
key: "JS_GetPointInfo",
value: function Ee() {
var e = new Promise(function(e) {
var t = [];
var n = Ze[ft].getShapesInfoByType("Point");
for (var i = 0, r = n.length; i < r; i++) {
var o = n[i];
var a = {
id: o.id,
point: o.points,
tips: o.tips,
type: o.type,
drawColor: o.drawColor
};
t.push(a)
}
e(t)
});
return e
}
}, {
key: "JS_ClearShapeByType",
value: function ze(o, a) {
var e = new Promise(function(e, t) {
if (!Ze[ft]) {
t();
return
}
if (o === "Choosed") {
var n = Ze[ft].deleteChoosedShape();
e(n)
} else if (a && a.length > 0) {
for (var i = 0, r = a.length; i < r; i++) {
Ze[ft].deleteTargetShape(o, a[i])
}
e()
} else {
Ze[ft].clearShapeByType(o);
e()
}
});
return e
}
}, {
key: "JS_PlayWithImg",
value: function Oe(e, r) {
if (this[ot].iType === 0) {
return Promise.resolve()
}
var t = $("#" + this[ot].szId + "canvas_play" + e);
var n = t.width();
var i = t.height();
t.hide();
var o = $("#playImg" + e);
o.show();
o.css({
width: n + "px",
height: i + "px",
border: "1px solid " + this[ot].oStyle.border,
position: "absolute",
left: 0
});
return new Promise(function(e, t) {
function n() {
o.unbind("load", n);
o.unbind("error", i);
e()
}
function i() {
o.unbind("error", i);
o.unbind("load", n);
t()
}
o.bind("load", n);
o.bind("error", i);
o.attr("src", r)
})
}
}, {
key: "JS_SetIsHttps",
value: function Fe() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SetReconnectInfo",
value: function qe() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_CheckUpdate",
value: function We() {
var e = new Promise(function(e) {
e(false)
});
return e
}
}, {
key: "JS_SelectShape",
value: function Je(n, i) {
var e = new Promise(function(e, t) {
if (!n) {
t();
return
}
Ze[ft].selectShapeById(n, "" + i);
e()
});
return e
}
}, {
key: "JS_GetPictureSize",
value: function Le() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SetOriginResolution",
value: function Ae() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SetPlayWndMode",
value: function Be() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_UpdateWindowStyle",
value: function n(t) {
var e = new Promise(function(e) {
Ze[ot].oStyle = t;
It();
e()
});
return e
}
}, {
key: "JS_CuttingPartWindow",
value: function Ue() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_RepairPartWindow",
value: function $e() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_ClearAllCanvas",
value: function He() {
var e = new Promise(function(e) {
$(".draw-window").each(function() {
$(this)[0].getContext("2d").clearRect(0, 0, $(this).width(), $(this).height())
});
e()
});
return e
}
}, {
key: "JS_DestroyAll",
value: function e() {
this.JS_DestroyPlugin();
return Promise.resolve()
}
}, {
key: "JS_SetPackageType",
value: function Ne() {
return Promise.resolve()
}
}, {
key: "JS_SetSnapDrawWndIndex",
value: function Ge(e) {
Ze[bt] = e;
if (Ze[bt] < 0 || Ze[bt] > Ze[ut] - 1) {
e = Ze[yt]
}
Ze.EventCallback.windowEventSelect(e, true);
return Promise.resolve()
}
}, {
key: "JS_GetSlfPointList",
value: function Ve() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_GetSlfVersion",
value: function je() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_ExistGetSlfPointList",
value: function Xe() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_GetIpcImportErrorInfo",
value: function Ye() {
var e = new Promise(function(e) {
e()
});
return e
}
}]);
return r
}();
return t
}();
t.JSPlugin = r
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.StreamClient = undefined;
var d = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
var i = n(1);
var h = u(i);
var r = n(19);
var o = n(20);
var a = n(21);
var s = n(24);
function u(e) {
return e && e.__esModule ? e : {
"default": e
}
}
function v(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var l = function() {
var k = Symbol("WEBSOCKET");
var C = Symbol("GETINDEX");
var R = Symbol("PROTOCOLVERSION");
var I = Symbol("CIPHERSUITES");
var c = new r.DirectDeviceCustom;
var T = new o.DirectDevice;
var D = new a.LiveMedia;
var x = new s.LocalService;
var e = function() {
function e() {
v(this, e);
this[R] = "0.1";
this[I] = 0;
this[k] = [];
this.ERRORS = {};
this[C] = function(e) {
var t = -1;
for (var n = 0, i = this[k].length; n < i; n++) {
if (this[k][n].id === e) {
t = n;
break
}
}
return t
}
}
d(e, [{
key: "openStream",
value: function f(e, p, m, n) {
var t = false;
if (e.indexOf("[") > -1) {
t = true
}
var y = this;
var i = e.split("://");
var r = i[0];
var S = "";
var g = 7681;
var _ = 1;
var P = 0;
if (t) {
S = i[1].split("]:")[0] + "]";
g = Math.floor(i[1].split("]:")[1].split("/")[0]);
_ = Math.floor(i[1].split("]:")[1].split("/")[1] / 100);
P = Math.floor(i[1].split("]:")[1].split("/")[1] % 100) - 1
} else {
S = i[1].split(":")[0];
g = Math.floor(i[1].split(":")[1].split("/")[0]);
_ = Math.floor(i[1].split(":")[1].split("/")[1] / 100);
P = Math.floor(i[1].split(":")[1].split("/")[1] % 100) - 1
}
if (_ === 0) {
P = 0
}
p = p || {};
var o = "&sessionID=";
if (p.token && !p.playURL) {
o = "&token="
}
var a = "";
if (p.secondAuth) {
var s = p.secondAuth.split("&");
if (s && s.length) {
s.forEach(function(e) {
if (-1 !== e.indexOf("security=") || -1 !== e.indexOf("iv=")) {
a += "&" + e
} else {
var t = e.split("=");
if (t && 2 === t.length) {
p[t[0]] = t[1]
}
}
})
}
}
var u = p.sessionID || p.session || (p.playURL ? "" : p.token) || "";
var w = new window.WebSocket(r + "://" + S + ":" + g + (p.mode ? "/" + p.mode : "") + "?version=" + y[R] + "&cipherSuites=" + y[I] + o + u + a + (p.proxy ? "&proxy=" + p.proxy : ""));
w.binaryType = "arraybuffer";
var b = h["default"].v4();
var l = new Promise(function(h, v) {
w.onopen = function() {
if (!p.playURL && !p.sessionID && !p.deviceSerial && !p.token) {
y[k].push(c.createClientObject(w, b, _, P));
h(b)
}
};
w.onmessage = function(e) {
if (typeof e.data === "string") {
var t = JSON.parse(e.data);
var n = y[C](b);
if (t && t.version && t.cipherSuite) {
y[R] = t.version;
y[I] = parseInt(t.cipherSuite, 10);
if (t && t.PKD && t.rand) {
y[k].push(D.createClientObject(w, b, t.PKD, t.rand, p))
} else {
var i = "live://" + S + ":" + g + "/" + _ + "/" + P;
if (y[I] === -1) {
y[k].push(x.createClientObject(w, b, i, p))
} else {
y[k].push(T.createClientObject(w, b, i))
}
}
h(b);
return
}
if (t && t.sdp) {
var r = T.getMediaFromSdp(t.sdp);
var o = T.getMediaType(t.sdp);
if ("0004" === o) {
m({
type: "videoNotSupport"
})
} else {
m({
bHead: true,
buf: r
})
}
}
if (t && t.cmd) {
if (t.cmd === "end") {
m({
type: "exception",
cmd: t.cmd
})
}
}
if (t && t.statusString) {
if (t.statusString.toLowerCase() === "ok") {
if (y[k][n].resolve) {
y[k][n].resolve(t)
}
}
if (t.statusString.toLowerCase() !== "ok") {
var a = T.getError(t);
if (n > -1) {
if (y[k][n].reject) {
y[k][n].reject(a)
}
} else {
v(a)
}
}
}
} else {
var s = {};
var u = new Uint8Array(e.data);
if (u.byteLength === 64 || u.byteLength === 40) {
var l = -1;
var f = u.byteLength;
for (var c = 0; c < f; c++) {
if (u[c] === 73 && u[c + 1] === 77 && u[c + 2] === 75 && u[c + 3] === 72) {
l = c;
break
}
}
if (l !== -1) {
var d = u.slice(l, l + 40);
s = {
bHead: true,
buf: d
}
} else {
s = {
bHead: false,
buf: u
}
}
} else {
s = {
bHead: false,
buf: u
}
}
m(s);
u = null;
s = null;
e = null
}
};
w.onclose = function() {
for (var e = 0, t = y[k].length; e < t; e++) {
if (y[k][e].id === b) {
y[k][e].resolve();
y[k].splice(e, 1);
setTimeout(function() {
n()
}, 200);
break
}
}
v()
}
});
return l
}
}, {
key: "startPlay",
value: function n(e, i, r, o) {
var a = this;
var s = this[C](e);
if (i && r && a[R] === "0.1") {
i = i.replace(/-/g, "").replace(/:/g, "");
r = r.replace(/-/g, "").replace(/:/g, "")
}
var t = new Promise(function(e, t) {
if (s > -1) {
a[k][s].resolve = e;
a[k][s].reject = t;
var n = null;
if (!i || !r) {
if (a[k][s].iCurChannel === 0 && a[R] === "0.1") {
n = c.zeroPlayCmd(a[k][s].iCurChannel, a[k][s].iCurStream)
} else {
if (a[R] !== "0.1") {
if (a[I] === 0) {
n = D.playCmd(a[k][s])
} else if (a[I] === 1) {
n = T.playCmd(a[k][s].playURL)
} else if (a[I] === -1) {
n = x.playCmd(a[k][s])
}
} else {
n = c.playCmd(a[k][s].iCurChannel, a[k][s].iCurStream)
}
}
} else {
if (a[R] !== "0.1") {
if (a[I] === 0) {
n = D.playbackCmd(a[k][s], i, r)
} else if (a[I] === 1) {
n = T.playbackCmd(i, r, a[k][s].playURL, o)
} else if (a[I] === -1) {
n = x.playbackCmd(a[k][s], i, r)
}
} else {
n = c.playbackCmd(i, r, a[k][s].iCurChannel, a[k][s].iCurStream)
}
}
a[k][s].socket.send(n);
if (a[R] === "0.1") {
e()
}
} else {
if (a[R] === "0.1") {
t()
}
}
});
return t
}
}, {
key: "singleFrame",
value: function t() {}
}, {
key: "setPlayRate",
value: function i(a, s) {
var u = this;
var e = new Promise(function(e, t) {
for (var n = 0, i = u[k].length; n < i; n++) {
if (u[k][n].id === a) {
if (u[R] === "0.1") {
var r = c.playRateCmd(s);
u[k][n].socket.send(r);
e();
break
} else {
u[k][n].resolve = e;
u[k][n].reject = t;
var o = T.playRateCmd(s);
u[k][n].socket.send(o)
}
}
}
});
return e
}
}, {
key: "seek",
value: function r(o, a, s) {
var u = this;
var e = new Promise(function(e, t) {
for (var n = 0, i = u[k].length; n < i; n++) {
if (u[k][n].id === o) {
u[k][n].resolve = e;
u[k][n].reject = t;
var r = D.seekCmd(a, s);
u[k][n].socket.send(r)
}
}
});
return e
}
}, {
key: "pause",
value: function o(a) {
var s = this;
var e = new Promise(function(e, t) {
for (var n = 0, i = s[k].length; n < i; n++) {
if (s[k][n].id === a) {
if (s[R] === "0.1") {
var r = c.pauseCmd();
s[k][n].socket.send(r);
e();
break
} else {
s[k][n].resolve = e;
s[k][n].reject = t;
var o = T.pauseCmd();
s[k][n].socket.send(o)
}
}
}
});
return e
}
}, {
key: "transmission",
value: function s(r, o) {
var a = this;
var e = new Promise(function(e, t) {
for (var n = 0, i = a[k].length; n < i; n++) {
if (a[k][n].id === r) {
a[k][n].resolve = e;
a[k][n].reject = t;
a[k][n].socket.send(o)
}
}
});
return e
}
}, {
key: "resume",
value: function u(a) {
var s = this;
var e = new Promise(function(e, t) {
for (var n = 0, i = s[k].length; n < i; n++) {
if (s[k][n].id === a) {
if (s[R] === "0.1") {
var r = c.resumeCmd();
s[k][n].socket.send(r);
e();
break
} else {
s[k][n].resolve = e;
s[k][n].reject = t;
var o = T.resumeCmd();
s[k][n].socket.send(o)
}
}
}
});
return e
}
}, {
key: "stop",
value: function l(o) {
var a = this;
var e = new Promise(function(e, t) {
if (!o) {
t()
} else {
var n = -1;
for (var i = 0, r = a[k].length; i < r; i++) {
if (a[k][i].id === o) {
n = i;
a[k][i].resolve = e;
a[k][i].socket.close(1e3, "CLOSE");
break
}
}
if (n === -1) {
t()
}
}
});
return e
}
}, {
key: "stopAll",
value: function a() {
var e = this;
for (var t = 0, n = e[k].length; t < n; t++) {
e[k][t].socket.close(1e3, "CLOSE")
}
}
}]);
return e
}();
return e
}();
t.StreamClient = l
}, function(e, t, n) {
var v = n(5);
var p = n(6);
var m;
var y;
var S = 0;
var g = 0;
function i(e, t, n) {
var i = t && n || 0;
var r = t || [];
e = e || {};
var o = e.node || m;
var a = e.clockseq !== undefined ? e.clockseq : y;
if (o == null || a == null) {
var s = v();
if (o == null) {
o = m = [s[0] | 1, s[1], s[2], s[3], s[4], s[5]]
}
if (a == null) {
a = y = (s[6] << 8 | s[7]) & 16383
}
}
var u = e.msecs !== undefined ? e.msecs : (new Date).getTime();
var l = e.nsecs !== undefined ? e.nsecs : g + 1;
var f = u - S + (l - g) / 1e4;
if (f < 0 && e.clockseq === undefined) {
a = a + 1 & 16383
}
if ((f < 0 || u > S) && e.nsecs === undefined) {
l = 0
}
if (l >= 1e4) {
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")
}
S = u;
g = l;
y = a;
u += 122192928e5;
var c = ((u & 268435455) * 1e4 + l) % 4294967296;
r[i++] = c >>> 24 & 255;
r[i++] = c >>> 16 & 255;
r[i++] = c >>> 8 & 255;
r[i++] = c & 255;
var d = u / 4294967296 * 1e4 & 268435455;
r[i++] = d >>> 8 & 255;
r[i++] = d & 255;
r[i++] = d >>> 24 & 15 | 16;
r[i++] = d >>> 16 & 255;
r[i++] = a >>> 8 | 128;
r[i++] = a & 255;
for (var h = 0; h < 6; ++h) {
r[i + h] = o[h]
}
return t ? t : p(r)
}
e.exports = i
}, function(e, t, n) {
var a = n(5);
var s = n(6);
function i(e, t, n) {
var i = t && n || 0;
if (typeof e == "string") {
t = e === "binary" ? new Array(16) : null;
e = null
}
e = e || {};
var r = e.random || (e.rng || a)();
r[6] = r[6] & 15 | 64;
r[8] = r[8] & 63 | 128;
if (t) {
for (var o = 0; o < 16; ++o) {
t[i + o] = r[o]
}
}
return t || s(r)
}
e.exports = i
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var a = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
function u(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var i = function() {
var e = function() {
function e() {
u(this, e)
}
a(e, [{
key: "createClientObject",
value: function r(e, t, n, i) {
return {
socket: e,
id: t,
iCurChannel: n,
iCurStream: i,
resolve: null,
reject: null
}
}
}, {
key: "zeroPlayCmd",
value: function i(e, t) {
var n = [0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, e + 1, 0, 0, 0, t, 0, 0, 4, 0];
return new Uint8Array(n)
}
}, {
key: "playCmd",
value: function o(e, t) {
var n = [0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, t, 0, 0, 4, 0];
return new Uint8Array(n)
}
}, {
key: "playbackCmd",
value: function _(e, t, n, i) {
var r = e.split("T")[0];
var o = e.split("T")[1];
var a = "0" + parseInt(r.substring(0, 4), 10).toString(16);
var s = parseInt(r.substring(4, 6), 10);
var u = parseInt(r.substring(6), 10);
var l = parseInt(o.substring(0, 2), 10);
var f = parseInt(o.substring(2, 4), 10);
var c = parseInt(o.substring(4, 6), 10);
var d = t.split("T")[0];
var h = t.split("T")[1];
var v = "0" + parseInt(d.substring(0, 4), 10).toString(16);
var p = parseInt(d.substring(4, 6), 10);
var m = parseInt(h.substring(0, 2), 10);
var y = parseInt(h.substring(2, 4), 10);
var S = parseInt(h.substring(4, 6), 10);
var g = [0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, n, 0, 0, parseInt(a.substring(0, 2), 16), parseInt(a.substring(2, 4), 16), 0, 0, 0, s, 0, 0, 0, u, 0, 0, 0, l, 0, 0, 0, f, 0, 0, 0, c, 0, 0, parseInt(v.substring(0, 2), 16), parseInt(v.substring(2, 4), 16), 0, 0, 0, p, 0, 0, 0, u, 0, 0, 0, m, 0, 0, 0, y, 0, 0, 0, S, 0, 0, 0, 0, 0, 0, 0, 0, i, 0, 0, 0];
return new Uint8Array(g)
}
}, {
key: "playRateCmd",
value: function s(e) {
var t = (parseInt(e, 10) >>> 0).toString(16).toLocaleUpperCase().toString(16);
for (var n = t.length; n < 8; n++) {
t = "0" + t
}
var i = [0, 0, 0, 0];
for (var r = 0, o = t.length; r < o; r = r + 2) {
i[Math.floor(r / 2)] = parseInt(t.substring(r, r + 2), 16)
}
var a = [0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, i[0], i[1], i[2], i[3]];
return new Uint8Array(a)
}
}, {
key: "pauseCmd",
value: function t() {
var e = [0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
return new Uint8Array(e)
}
}, {
key: "resumeCmd",
value: function n() {
var e = [0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
return new Uint8Array(e)
}
}]);
return e
}();
return e
}();
t.DirectDeviceCustom = i
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var f = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
function c(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var d = 2203;
var h = 2206;
var v = 2207;
var p = 3001;
var m = 3002;
var y = 3003;
var S = 3004;
var g = 3005;
var _ = 3006;
var P = 3007;
var w = 7045;
var b = 7046;
var i = function() {
var e = function() {
function e() {
c(this, e)
}
f(e, [{
key: "createClientObject",
value: function i(e, t, n) {
return {
socket: e,
id: t,
playURL: n,
resolve: null,
reject: null
}
}
}, {
key: "getMediaFromSdp",
value: function a(e) {
var t = e.indexOf("MEDIAINFO=") + 10;
var n = e.slice(t, t + 80);
var i = [];
for (var r = 0, o = n.length / 2; r < o; r++) {
i[r] = parseInt(n.slice(r * 2, r * 2 + 2), 16)
}
return new Uint8Array(i)
}
}, {
key: "getMediaType",
value: function r(e) {
var t = e.indexOf("MEDIAINFO=") + 10;
var n = e.slice(t, t + 80);
n = n.slice(20, 24);
return n
}
}, {
key: "playCmd",
value: function n(e) {
var t = {
sequence: 0,
cmd: "realplay",
url: e
};
return JSON.stringify(t)
}
}, {
key: "playbackCmd",
value: function o(e, t, n, i) {
var r = {
sequence: 0,
cmd: "playback",
url: n,
startTime: e,
endTime: t
};
i && i.userName && (r.userName = i.userName);
i && i.password && (r.password = i.password);
return JSON.stringify(r)
}
}, {
key: "playRateCmd",
value: function s(e) {
var t = {
sequence: 0,
cmd: "speed",
rate: e
};
return JSON.stringify(t)
}
}, {
key: "pauseCmd",
value: function t() {
var e = {
sequence: 0,
cmd: "pause"
};
return JSON.stringify(e)
}
}, {
key: "resumeCmd",
value: function u() {
var e = {
sequence: 0,
cmd: "resume"
};
return JSON.stringify(e)
}
}, {
key: "getError",
value: function l(e) {
var t = p;
if (e) {
if (parseInt(e.MErrDevSelfEx, 10) > 0) {
t = parseInt(e.MErrDevSelfEx, 10)
} else if (parseInt(e.MErrCode, 10) > 0) {
t = parseInt(e.MErrCode, 10)
} else if (parseInt(e.statusCode, 10) === 6 && e.subStatusCode === "streamLimit") {
t = m
} else if (parseInt(e.statusCode, 10) === 4 && e.subStatusCode === "badAuthorization") {
t = y
} else if (parseInt(e.statusCode, 10) === 4 && e.subStatusCode === "lowPrivilege") {
t = S
} else if (parseInt(e.statusCode, 10) === 4 && e.subStatusCode === "notSupport") {
t = g
} else if (parseInt(e.statusCode, 10) === 6 && e.subStatusCode === "insufficientTranscodingResources") {
t = P
} else if (parseInt(e.statusCode, 10) === 6 && e.subStatusCode === "incorrentUserNameOrPassword") {
t = d
} else if (parseInt(e.statusCode, 10) === 6 && e.subStatusCode === "needDoubleVerification") {
t = h
} else if (parseInt(e.statusCode, 10) === 6 && e.subStatusCode === "noDoubleVerificationUser") {
t = v
} else if (parseInt(e.statusCode, 10) === 6 && e.subStatusCode === "achieveMaxChannelLimit") {
t = _
} else if (parseInt(e.statusCode, 10) === 4 && e.subStatusCode === "limitPreviewNumber") {
t = w
} else if (parseInt(e.statusCode, 10) === 4 && e.subStatusCode === "notEncodeOrFail") {
t = b
}
}
return t
}
}]);
return e
}();
return e
}();
t.DirectDevice = i
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.LiveMedia = undefined;
var o = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
var i = n(22);
var a = s(i);
var r = n(23);
var u = s(r);
function s(e) {
return e && e.__esModule ? e : {
"default": e
}
}
function l(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var f = function() {
var e = function() {
function e() {
l(this, e)
}
o(e, [{
key: "createClientObject",
value: function s(e, t, n, i, r) {
var o = u["default"].AES.encrypt((new Date).getTime().toString(), u["default"].enc.Hex.parse("1234567891234567123456789123456712345678912345671234567891234567"), {
mode: u["default"].mode.CBC,
iv: u["default"].enc.Hex.parse("12345678912345671234567891234567"),
padding: u["default"].pad.Pkcs7
}).ciphertext.toString();
if (o.length < 64) {
o = o + o
}
var a = u["default"].AES.encrypt((new Date).getTime().toString(), u["default"].enc.Hex.parse("12345678912345671234567891234567"), {
mode: u["default"].mode.CBC,
iv: u["default"].enc.Hex.parse("12345678912345671234567891234567"),
padding: u["default"].pad.Pkcs7
}).ciphertext.toString();
return {
socket: e,
id: t,
PKD: n,
rand: i,
playURL: r.playURL || "",
auth: r.auth || "",
token: r.token || "",
key: o,
iv: a,
resolve: null,
reject: null
}
}
}, {
key: "playCmd",
value: function n(e) {
var t = {
sequence: 0,
cmd: "realplay",
url: e.playURL,
key: a["default"].encrypt(e.iv + ":" + e.key, e.PKD).cipher.split("?")[0],
authorization: u["default"].AES.encrypt(e.rand + ":" + e.auth, u["default"].enc.Hex.parse(e.key), {
mode: u["default"].mode.CBC,
iv: u["default"].enc.Hex.parse(e.iv),
padding: u["default"].pad.Pkcs7
}).ciphertext.toString(),
token: u["default"].AES.encrypt(e.token, u["default"].enc.Hex.parse(e.key), {
mode: u["default"].mode.CBC,
iv: u["default"].enc.Hex.parse(e.iv),
padding: u["default"].pad.Pkcs7
}).ciphertext.toString()
};
return JSON.stringify(t)
}
}, {
key: "playbackCmd",
value: function r(e, t, n) {
var i = {
sequence: 0,
cmd: "playback",
url: e.playURL,
key: a["default"].encrypt(e.iv + ":" + e.key, e.PKD).cipher.split("?")[0],
authorization: u["default"].AES.encrypt(e.rand + ":" + e.auth, u["default"].enc.Hex.parse(e.key), {
mode: u["default"].mode.CBC,
iv: u["default"].enc.Hex.parse(e.iv),
padding: u["default"].pad.Pkcs7
}).ciphertext.toString(),
token: u["default"].AES.encrypt(e.token, u["default"].enc.Hex.parse(e.key), {
mode: u["default"].mode.CBC,
iv: u["default"].enc.Hex.parse(e.iv),
padding: u["default"].pad.Pkcs7
}).ciphertext.toString(),
startTime: t,
endTime: n
};
return JSON.stringify(i)
}
}, {
key: "seekCmd",
value: function i(e, t) {
var n = {
sequence: 0,
cmd: "seek",
startTime: e,
endTime: t
};
return JSON.stringify(n)
}
}]);
return e
}();
return e
}();
t.LiveMedia = f
}, function(e, t, n) {
"use strict";
var p = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(e) {
return typeof e
} : function(e) {
return e && typeof Symbol === "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
};
var r = {
appName: "Netscape",
appVersion: 40
};
var o, a = 0xdeadbeefcafe,
s = (a & 16777215) == 15715070;
function m(e, t, n) {
e != null && ("number" == typeof e ? this.fromNumber(e, t, n) : t == null && "string" != typeof e ? this.fromString(e, 256) : this.fromString(e, t))
}
function y() {
return new m(null)
}
function u(e, t, n, i, r, o) {
for (; --o >= 0;) {
var a = t * this[e++] + n[i] + r,
r = Math.floor(a / 67108864);
n[i++] = a & 67108863
}
return r
}
function l(e, t, n, i, r, o) {
var a = t & 32767;
for (t >>= 15; --o >= 0;) {
var s = this[e] & 32767,
u = this[e++] >> 15,
l = t * s + u * a,
s = a * s + ((l & 32767) << 15) + n[i] + (r & 1073741823),
r = (s >>> 30) + (l >>> 15) + t * u + (r >>> 30);
n[i++] = s & 1073741823
}
return r
}
function f(e, t, n, i, r, o) {
var a = t & 16383;
for (t >>= 14; --o >= 0;) {
var s = this[e] & 16383,
u = this[e++] >> 14,
l = t * s + u * a,
s = a * s + ((l & 16383) << 14) + n[i] + r,
r = (s >> 28) + (l >> 14) + t * u;
n[i++] = s & 268435455
}
return r
}
s && r.appName == "Microsoft Internet Explorer" ? (m.prototype.am = l, o = 30) : s && r.appName != "Netscape" ? (m.prototype.am = u, o = 26) : (m.prototype.am = f, o = 28);
m.prototype.DB = o;
m.prototype.DM = (1 << o) - 1;
m.prototype.DV = 1 << o;
var c = 52;
m.prototype.FV = Math.pow(2, c);
m.prototype.F1 = c - o;
m.prototype.F2 = 2 * o - c;
var d = "0123456789abcdefghijklmnopqrstuvwxyz",
h = [],
S, g;
S = "0".charCodeAt(0);
for (g = 0; g <= 9; ++g) {
h[S++] = g
}
S = "a".charCodeAt(0);
for (g = 10; g < 36; ++g) {
h[S++] = g
}
S = "A".charCodeAt(0);
for (g = 10; g < 36; ++g) {
h[S++] = g
}
function _(e) {
return d.charAt(e)
}
function P(e, t) {
var n = h[e.charCodeAt(t)];
return n == null ? -1 : n
}
function w(e) {
for (var t = this.t - 1; t >= 0; --t) {
e[t] = this[t]
}
e.t = this.t;
e.s = this.s
}
function b(e) {
this.t = 1;
this.s = e < 0 ? -1 : 0;
e > 0 ? this[0] = e : e < -1 ? this[0] = e + DV : this.t = 0
}
function k(e) {
var t = y();
t.fromInt(e);
return t
}
function C(e, t) {
var n;
if (t == 16) n = 4;
else if (t == 8) n = 3;
else if (t == 256) n = 8;
else if (t == 2) n = 1;
else if (t == 32) n = 5;
else if (t == 4) n = 2;
else {
this.fromRadix(e, t);
return
}
this.s = this.t = 0;
for (var i = e.length, r = !1, o = 0; --i >= 0;) {
var a = n == 8 ? e[i] & 255 : P(e, i);
a < 0 ? e.charAt(i) == "-" && (r = !0) : (r = !1, o == 0 ? this[this.t++] = a : o + n > this.DB ? (this[this.t - 1] |= (a & (1 << this.DB - o) - 1) << o, this[this.t++] = a >> this.DB - o) : this[this.t - 1] |= a << o, o += n, o >= this.DB && (o -= this.DB))
}
if (n == 8 && (e[0] & 128) != 0) this.s = -1, o > 0 && (this[this.t - 1] |= (1 << this.DB - o) - 1 << o);
this.clamp();
r && m.ZERO.subTo(this, this)
}
function R() {
for (var e = this.s & this.DM; this.t > 0 && this[this.t - 1] == e;) {
--this.t
}
}
function I(e) {
if (this.s < 0) return "-" + this.negate().toString(e);
if (e == 16) e = 4;
else if (e == 8) e = 3;
else if (e == 2) e = 1;
else if (e == 32) e = 5;
else if (e == 64) e = 6;
else if (e == 4) e = 2;
else return this.toRadix(e);
var t = (1 << e) - 1,
n, i = !1,
r = "",
o = this.t,
a = this.DB - o * this.DB % e;
if (o-- > 0) {
if (a < this.DB && (n = this[o] >> a) > 0) i = !0, r = _(n);
for (; o >= 0;) {
a < e ? (n = (this[o] & (1 << a) - 1) << e - a, n |= this[--o] >> (a += this.DB - e)) : (n = this[o] >> (a -= e) & t, a <= 0 && (a += this.DB, --o)), n > 0 && (i = !0), i && (r += _(n))
}
}
return i ? r : "0"
}
function T() {
var e = y();
m.ZERO.subTo(this, e);
return e
}
function D() {
return this.s < 0 ? this.negate() : this
}
function x(e) {
var t = this.s - e.s;
if (t != 0) return t;
var n = this.t,
t = n - e.t;
if (t != 0) return t;
for (; --n >= 0;) {
if ((t = this[n] - e[n]) != 0) return t
}
return 0
}
function M(e) {
var t = 1,
n;
if ((n = e >>> 16) != 0) e = n, t += 16;
if ((n = e >> 8) != 0) e = n, t += 8;
if ((n = e >> 4) != 0) e = n, t += 4;
if ((n = e >> 2) != 0) e = n, t += 2;
e >> 1 != 0 && (t += 1);
return t
}
function E() {
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + M(this[this.t - 1] ^ this.s & this.DM)
}
function z(e, t) {
var n;
for (n = this.t - 1; n >= 0; --n) {
t[n + e] = this[n]
}
for (n = e - 1; n >= 0; --n) {
t[n] = 0
}
t.t = this.t + e;
t.s = this.s
}
function O(e, t) {
for (var n = e; n < this.t; ++n) {
t[n - e] = this[n]
}
t.t = Math.max(this.t - e, 0);
t.s = this.s
}
function F(e, t) {
var n = e % this.DB,
i = this.DB - n,
r = (1 << i) - 1,
o = Math.floor(e / this.DB),
a = this.s << n & this.DM,
s;
for (s = this.t - 1; s >= 0; --s) {
t[s + o + 1] = this[s] >> i | a, a = (this[s] & r) << n
}
for (s = o - 1; s >= 0; --s) {
t[s] = 0
}
t[o] = a;
t.t = this.t + o + 1;
t.s = this.s;
t.clamp()
}
function q(e, t) {
t.s = this.s;
var n = Math.floor(e / this.DB);
if (n >= this.t) t.t = 0;
else {
var i = e % this.DB,
r = this.DB - i,
o = (1 << i) - 1;
t[0] = this[n] >> i;
for (var a = n + 1; a < this.t; ++a) {
t[a - n - 1] |= (this[a] & o) << r, t[a - n] = this[a] >> i
}
i > 0 && (t[this.t - n - 1] |= (this.s & o) << r);
t.t = this.t - n;
t.clamp()
}
}
function W(e, t) {
for (var n = 0, i = 0, r = Math.min(e.t, this.t); n < r;) {
i += this[n] - e[n], t[n++] = i & this.DM, i >>= this.DB
}
if (e.t < this.t) {
for (i -= e.s; n < this.t;) {
i += this[n], t[n++] = i & this.DM, i >>= this.DB
}
i += this.s
} else {
for (i += this.s; n < e.t;) {
i -= e[n], t[n++] = i & this.DM, i >>= this.DB
}
i -= e.s
}
t.s = i < 0 ? -1 : 0;
i < -1 ? t[n++] = this.DV + i : i > 0 && (t[n++] = i);
t.t = n;
t.clamp()
}
function J(e, t) {
var n = this.abs(),
i = e.abs(),
r = n.t;
for (t.t = r + i.t; --r >= 0;) {
t[r] = 0
}
for (r = 0; r < i.t; ++r) {
t[r + n.t] = n.am(0, i[r], t, r, 0, n.t)
}
t.s = 0;
t.clamp();
this.s != e.s && m.ZERO.subTo(t, t)
}
function L(e) {
for (var t = this.abs(), n = e.t = 2 * t.t; --n >= 0;) {
e[n] = 0
}
for (n = 0; n < t.t - 1; ++n) {
var i = t.am(n, t[n], e, 2 * n, 0, 1);
if ((e[n + t.t] += t.am(n + 1, 2 * t[n], e, 2 * n + 1, i, t.t - n - 1)) >= t.DV) e[n + t.t] -= t.DV, e[n + t.t + 1] = 1
}
e.t > 0 && (e[e.t - 1] += t.am(n, t[n], e, 2 * n, 0, 1));
e.s = 0;
e.clamp()
}
function A(e, t, n) {
var i = e.abs();
if (!(i.t <= 0)) {
var r = this.abs();
if (r.t < i.t) t != null && t.fromInt(0), n != null && this.copyTo(n);
else {
n == null && (n = y());
var o = y(),
a = this.s,
e = e.s,
s = this.DB - M(i[i.t - 1]);
s > 0 ? (i.lShiftTo(s, o), r.lShiftTo(s, n)) : (i.copyTo(o), r.copyTo(n));
i = o.t;
r = o[i - 1];
if (r != 0) {
var u = r * (1 << this.F1) + (i > 1 ? o[i - 2] >> this.F2 : 0),
l = this.FV / u,
u = (1 << this.F1) / u,
f = 1 << this.F2,
c = n.t,
d = c - i,
h = t == null ? y() : t;
o.dlShiftTo(d, h);
n.compareTo(h) >= 0 && (n[n.t++] = 1, n.subTo(h, n));
m.ONE.dlShiftTo(i, h);
for (h.subTo(o, o); o.t < i;) {
o[o.t++] = 0
}
for (; --d >= 0;) {
var v = n[--c] == r ? this.DM : Math.floor(n[c] * l + (n[c - 1] + f) * u);
if ((n[c] += o.am(0, v, n, d, 0, i)) < v) {
o.dlShiftTo(d, h);
for (n.subTo(h, n); n[c] < --v;) {
n.subTo(h, n)
}
}
}
t != null && (n.drShiftTo(i, t), a != e && m.ZERO.subTo(t, t));
n.t = i;
n.clamp();
s > 0 && n.rShiftTo(s, n);
a < 0 && m.ZERO.subTo(n, n)
}
}
}
}
function B(e) {
var t = y();
this.abs().divRemTo(e, null, t);
this.s < 0 && t.compareTo(m.ZERO) > 0 && e.subTo(t, t);
return t
}
function U(e) {
this.m = e
}
function $(e) {
return e.s < 0 || e.compareTo(this.m) >= 0 ? e.mod(this.m) : e
}
function H(e) {
return e
}
function N(e) {
e.divRemTo(this.m, null, e)
}
function G(e, t, n) {
e.multiplyTo(t, n);
this.reduce(n)
}
function V(e, t) {
e.squareTo(t);
this.reduce(t)
}
U.prototype.convert = $;
U.prototype.revert = H;
U.prototype.reduce = N;
U.prototype.mulTo = G;
U.prototype.sqrTo = V;
function j() {
if (this.t < 1) return 0;
var e = this[0];
if ((e & 1) == 0) return 0;
var t = e & 3,
t = t * (2 - (e & 15) * t) & 15,
t = t * (2 - (e & 255) * t) & 255,
t = t * (2 - ((e & 65535) * t & 65535)) & 65535,
t = t * (2 - e * t % this.DV) % this.DV;
return t > 0 ? this.DV - t : -t
}
function X(e) {
this.m = e;
this.mp = e.invDigit();
this.mpl = this.mp & 32767;
this.mph = this.mp >> 15;
this.um = (1 << e.DB - 15) - 1;
this.mt2 = 2 * e.t
}
function Y(e) {
var t = y();
e.abs().dlShiftTo(this.m.t, t);
t.divRemTo(this.m, null, t);
e.s < 0 && t.compareTo(m.ZERO) > 0 && this.m.subTo(t, t);
return t
}
function Z(e) {
var t = y();
e.copyTo(t);
this.reduce(t);
return t
}
function K(e) {
for (; e.t <= this.mt2;) {
e[e.t++] = 0
}
for (var t = 0; t < this.m.t; ++t) {
var n = e[t] & 32767,
i = n * this.mpl + ((n * this.mph + (e[t] >> 15) * this.mpl & this.um) << 15) & e.DM,
n = t + this.m.t;
for (e[n] += this.m.am(0, i, e, t, 0, this.m.t); e[n] >= e.DV;) {
e[n] -= e.DV, e[++n] ++
}
}
e.clamp();
e.drShiftTo(this.m.t, e);
e.compareTo(this.m) >= 0 && e.subTo(this.m, e)
}
function Q(e, t) {
e.squareTo(t);
this.reduce(t)
}
function ee(e, t, n) {
e.multiplyTo(t, n);
this.reduce(n)
}
X.prototype.convert = Y;
X.prototype.revert = Z;
X.prototype.reduce = K;
X.prototype.mulTo = ee;
X.prototype.sqrTo = Q;
function te() {
return (this.t > 0 ? this[0] & 1 : this.s) == 0
}
function ne(e, t) {
if (e > 4294967295 || e < 1) return m.ONE;
var n = y(),
i = y(),
r = t.convert(this),
o = M(e) - 1;
for (r.copyTo(n); --o >= 0;) {
if (t.sqrTo(n, i), (e & 1 << o) > 0) t.mulTo(i, r, n);
else var a = n,
n = i,
i = a
}
return t.revert(n)
}
function ie(e, t) {
var n;
n = e < 256 || t.isEven() ? new U(t) : new X(t);
return this.exp(e, n)
}
m.prototype.copyTo = w;
m.prototype.fromInt = b;
m.prototype.fromString = C;
m.prototype.clamp = R;
m.prototype.dlShiftTo = z;
m.prototype.drShiftTo = O;
m.prototype.lShiftTo = F;
m.prototype.rShiftTo = q;
m.prototype.subTo = W;
m.prototype.multiplyTo = J;
m.prototype.squareTo = L;
m.prototype.divRemTo = A;
m.prototype.invDigit = j;
m.prototype.isEven = te;
m.prototype.exp = ne;
m.prototype.toString = I;
m.prototype.negate = T;
m.prototype.abs = D;
m.prototype.compareTo = x;
m.prototype.bitLength = E;
m.prototype.mod = B;
m.prototype.modPowInt = ie;
m.ZERO = k(0);
m.ONE = k(1);
function re() {
var e = y();
this.copyTo(e);
return e
}
function oe() {
if (this.s < 0) {
if (this.t == 1) return this[0] - this.DV;
else {
if (this.t == 0) return -1
}
} else if (this.t == 1) return this[0];
else if (this.t == 0) return 0;
return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]
}
function ae() {
return this.t == 0 ? this.s : this[0] << 24 >> 24
}
function se() {
return this.t == 0 ? this.s : this[0] << 16 >> 16
}
function ue(e) {
return Math.floor(Math.LN2 * this.DB / Math.log(e))
}
function le() {
return this.s < 0 ? -1 : this.t <= 0 || this.t == 1 && this[0] <= 0 ? 0 : 1
}
function fe(e) {
e == null && (e = 10);
if (this.signum() == 0 || e < 2 || e > 36) return "0";
var t = this.chunkSize(e),
t = Math.pow(e, t),
n = k(t),
i = y(),
r = y(),
o = "";
for (this.divRemTo(n, i, r); i.signum() > 0;) {
o = (t + r.intValue()).toString(e).substr(1) + o, i.divRemTo(n, i, r)
}
return r.intValue().toString(e) + o
}
function ce(e, t) {
this.fromInt(0);
t == null && (t = 10);
for (var n = this.chunkSize(t), i = Math.pow(t, n), r = !1, o = 0, a = 0, s = 0; s < e.length; ++s) {
var u = P(e, s);
u < 0 ? e.charAt(s) == "-" && this.signum() == 0 && (r = !0) : (a = t * a + u, ++o >= n && (this.dMultiply(i), this.dAddOffset(a, 0), a = o = 0))
}
o > 0 && (this.dMultiply(Math.pow(t, o)), this.dAddOffset(a, 0));
r && m.ZERO.subTo(this, this)
}
function de(e, t, n) {
if ("number" == typeof t) {
if (e < 2) this.fromInt(1);
else {
this.fromNumber(e, n);
this.testBit(e - 1) || this.bitwiseTo(m.ONE.shiftLeft(e - 1), _e, this);
for (this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(t);) {
this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(m.ONE.shiftLeft(e - 1), this)
}
}
} else {
var n = [],
i = e & 7;
n.length = (e >> 3) + 1;
t.nextBytes(n);
i > 0 ? n[0] &= (1 << i) - 1 : n[0] = 0;
this.fromString(n, 256)
}
}
function he() {
var e = this.t,
t = [];
t[0] = this.s;
var n = this.DB - e * this.DB % 8,
i, r = 0;
if (e-- > 0) {
if (n < this.DB && (i = this[e] >> n) != (this.s & this.DM) >> n) t[r++] = i | this.s << this.DB - n;
for (; e >= 0;) {
if (n < 8 ? (i = (this[e] & (1 << n) - 1) << 8 - n, i |= this[--e] >> (n += this.DB - 8)) : (i = this[e] >> (n -= 8) & 255, n <= 0 && (n += this.DB, --e)), (i & 128) != 0 && (i |= -256), r == 0 && (this.s & 128) != (i & 128) && ++r, r > 0 || i != this.s) t[r++] = i
}
}
return t
}
function ve(e) {
return this.compareTo(e) == 0
}
function pe(e) {
return this.compareTo(e) < 0 ? this : e
}
function me(e) {
return this.compareTo(e) > 0 ? this : e
}
function ye(e, t, n) {
var i, r, o = Math.min(e.t, this.t);
for (i = 0; i < o; ++i) {
n[i] = t(this[i], e[i])
}
if (e.t < this.t) {
r = e.s & this.DM;
for (i = o; i < this.t; ++i) {
n[i] = t(this[i], r)
}
n.t = this.t
} else {
r = this.s & this.DM;
for (i = o; i < e.t; ++i) {
n[i] = t(r, e[i])
}
n.t = e.t
}
n.s = t(this.s, e.s);
n.clamp()
}
function Se(e, t) {
return e & t
}
function ge(e) {
var t = y();
this.bitwiseTo(e, Se, t);
return t
}
function _e(e, t) {
return e | t
}
function Pe(e) {
var t = y();
this.bitwiseTo(e, _e, t);
return t
}
function we(e, t) {
return e ^ t
}
function be(e) {
var t = y();
this.bitwiseTo(e, we, t);
return t
}
function ke(e, t) {
return e & ~t
}
function Ce(e) {
var t = y();
this.bitwiseTo(e, ke, t);
return t
}
function Re() {
for (var e = y(), t = 0; t < this.t; ++t) {
e[t] = this.DM & ~this[t]
}
e.t = this.t;
e.s = ~this.s;
return e
}
function Ie(e) {
var t = y();
e < 0 ? this.rShiftTo(-e, t) : this.lShiftTo(e, t);
return t
}
function Te(e) {
var t = y();
e < 0 ? this.lShiftTo(-e, t) : this.rShiftTo(e, t);
return t
}
function De(e) {
if (e == 0) return -1;
var t = 0;
(e & 65535) == 0 && (e >>= 16, t += 16);
(e & 255) == 0 && (e >>= 8, t += 8);
(e & 15) == 0 && (e >>= 4, t += 4);
(e & 3) == 0 && (e >>= 2, t += 2);
(e & 1) == 0 && ++t;
return t
}
function xe() {
for (var e = 0; e < this.t; ++e) {
if (this[e] != 0) return e * this.DB + De(this[e])
}
return this.s < 0 ? this.t * this.DB : -1
}
function Me(e) {
for (var t = 0; e != 0;) {
e &= e - 1, ++t
}
return t
}
function Ee() {
for (var e = 0, t = this.s & this.DM, n = 0; n < this.t; ++n) {
e += Me(this[n] ^ t)
}
return e
}
function ze(e) {
var t = Math.floor(e / this.DB);
return t >= this.t ? this.s != 0 : (this[t] & 1 << e % this.DB) != 0
}
function Oe(e, t) {
var n = m.ONE.shiftLeft(e);
this.bitwiseTo(n, t, n);
return n
}
function Fe(e) {
return this.changeBit(e, _e)
}
function qe(e) {
return this.changeBit(e, ke)
}
function We(e) {
return this.changeBit(e, we)
}
function Je(e, t) {
for (var n = 0, i = 0, r = Math.min(e.t, this.t); n < r;) {
i += this[n] + e[n], t[n++] = i & this.DM, i >>= this.DB
}
if (e.t < this.t) {
for (i += e.s; n < this.t;) {
i += this[n], t[n++] = i & this.DM, i >>= this.DB
}
i += this.s
} else {
for (i += this.s; n < e.t;) {
i += e[n], t[n++] = i & this.DM, i >>= this.DB
}
i += e.s
}
t.s = i < 0 ? -1 : 0;
i > 0 ? t[n++] = i : i < -1 && (t[n++] = this.DV + i);
t.t = n;
t.clamp()
}
function Le(e) {
var t = y();
this.addTo(e, t);
return t
}
function Ae(e) {
var t = y();
this.subTo(e, t);
return t
}
function Be(e) {
var t = y();
this.multiplyTo(e, t);
return t
}
function Ue() {
var e = y();
this.squareTo(e);
return e
}
function $e(e) {
var t = y();
this.divRemTo(e, t, null);
return t
}
function He(e) {
var t = y();
this.divRemTo(e, null, t);
return t
}
function Ne(e) {
var t = y(),
n = y();
this.divRemTo(e, t, n);
return [t, n]
}
function Ge(e) {
this[this.t] = this.am(0, e - 1, this, 0, 0, this.t);
++this.t;
this.clamp()
}
function Ve(e, t) {
if (e != 0) {
for (; this.t <= t;) {
this[this.t++] = 0
}
for (this[t] += e; this[t] >= this.DV;) {
this[t] -= this.DV, ++t >= this.t && (this[this.t++] = 0), ++this[t]
}
}
}
function je() {}
function Xe(e) {
return e
}
function Ye(e, t, n) {
e.multiplyTo(t, n)
}
function Ze(e, t) {
e.squareTo(t)
}
je.prototype.convert = Xe;
je.prototype.revert = Xe;
je.prototype.mulTo = Ye;
je.prototype.sqrTo = Ze;
function Ke(e) {
return this.exp(e, new je)
}
function Qe(e, t, n) {
var i = Math.min(this.t + e.t, t);
n.s = 0;
for (n.t = i; i > 0;) {
n[--i] = 0
}
var r;
for (r = n.t - this.t; i < r; ++i) {
n[i + this.t] = this.am(0, e[i], n, i, 0, this.t)
}
for (r = Math.min(e.t, t); i < r; ++i) {
this.am(0, e[i], n, i, 0, t - i)
}
n.clamp()
}
function et(e, t, n) {
--t;
var i = n.t = this.t + e.t - t;
for (n.s = 0; --i >= 0;) {
n[i] = 0
}
for (i = Math.max(t - this.t, 0); i < e.t; ++i) {
n[this.t + i - t] = this.am(t - i, e[i], n, 0, 0, this.t + i - t)
}
n.clamp();
n.drShiftTo(1, n)
}
function tt(e) {
this.r2 = y();
this.q3 = y();
m.ONE.dlShiftTo(2 * e.t, this.r2);
this.mu = this.r2.divide(e);
this.m = e
}
function nt(e) {
if (e.s < 0 || e.t > 2 * this.m.t) return e.mod(this.m);
else if (e.compareTo(this.m) < 0) return e;
else {
var t = y();
e.copyTo(t);
this.reduce(t);
return t
}
}
function it(e) {
return e
}
function rt(e) {
e.drShiftTo(this.m.t - 1, this.r2);
if (e.t > this.m.t + 1) e.t = this.m.t + 1, e.clamp();
this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3);
for (this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); e.compareTo(this.r2) < 0;) {
e.dAddOffset(1, this.m.t + 1)
}
for (e.subTo(this.r2, e); e.compareTo(this.m) >= 0;) {
e.subTo(this.m, e)
}
}
function ot(e, t) {
e.squareTo(t);
this.reduce(t)
}
function at(e, t, n) {
e.multiplyTo(t, n);
this.reduce(n)
}
tt.prototype.convert = nt;
tt.prototype.revert = it;
tt.prototype.reduce = rt;
tt.prototype.mulTo = at;
tt.prototype.sqrTo = ot;
function st(e, t) {
var n = e.bitLength(),
i, r = k(1),
o;
if (n <= 0) return r;
else i = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6;
o = n < 8 ? new U(t) : t.isEven() ? new tt(t) : new X(t);
var a = [],
s = 3,
u = i - 1,
l = (1 << i) - 1;
a[1] = o.convert(this);
if (i > 1) {
n = y();
for (o.sqrTo(a[1], n); s <= l;) {
a[s] = y(), o.mulTo(n, a[s - 2], a[s]), s += 2
}
}
for (var f = e.t - 1, c, d = !0, h = y(), n = M(e[f]) - 1; f >= 0;) {
n >= u ? c = e[f] >> n - u & l : (c = (e[f] & (1 << n + 1) - 1) << u - n, f > 0 && (c |= e[f - 1] >> this.DB + n - u));
for (s = i;
(c & 1) == 0;) {
c >>= 1, --s
}
if ((n -= s) < 0) n += this.DB, --f;
if (d) a[c].copyTo(r), d = !1;
else {
for (; s > 1;) {
o.sqrTo(r, h), o.sqrTo(h, r), s -= 2
}
s > 0 ? o.sqrTo(r, h) : (s = r, r = h, h = s);
o.mulTo(h, a[c], r)
}
for (; f >= 0 && (e[f] & 1 << n) == 0;) {
o.sqrTo(r, h), s = r, r = h, h = s, --n < 0 && (n = this.DB - 1, --f)
}
}
return o.revert(r)
}
function ut(e) {
var t = this.s < 0 ? this.negate() : this.clone(),
e = e.s < 0 ? e.negate() : e.clone();
if (t.compareTo(e) < 0) var n = t,
t = e,
e = n;
var n = t.getLowestSetBit(),
i = e.getLowestSetBit();
if (i < 0) return t;
n < i && (i = n);
i > 0 && (t.rShiftTo(i, t), e.rShiftTo(i, e));
for (; t.signum() > 0;) {
(n = t.getLowestSetBit()) > 0 && t.rShiftTo(n, t), (n = e.getLowestSetBit()) > 0 && e.rShiftTo(n, e), t.compareTo(e) >= 0 ? (t.subTo(e, t), t.rShiftTo(1, t)) : (e.subTo(t, e), e.rShiftTo(1, e))
}
i > 0 && e.lShiftTo(i, e);
return e
}
function lt(e) {
if (e <= 0) return 0;
var t = this.DV % e,
n = this.s < 0 ? e - 1 : 0;
if (this.t > 0)
if (t == 0) n = this[0] % e;
else
for (var i = this.t - 1; i >= 0; --i) {
n = (t * n + this[i]) % e
}
return n
}
function ft(e) {
var t = e.isEven();
if (this.isEven() && t || e.signum() == 0) return m.ZERO;
for (var n = e.clone(), i = this.clone(), r = k(1), o = k(0), a = k(0), s = k(1); n.signum() != 0;) {
for (; n.isEven();) {
n.rShiftTo(1, n);
if (t) {
if (!r.isEven() || !o.isEven()) r.addTo(this, r), o.subTo(e, o);
r.rShiftTo(1, r)
} else o.isEven() || o.subTo(e, o);
o.rShiftTo(1, o)
}
for (; i.isEven();) {
i.rShiftTo(1, i);
if (t) {
if (!a.isEven() || !s.isEven()) a.addTo(this, a), s.subTo(e, s);
a.rShiftTo(1, a)
} else s.isEven() || s.subTo(e, s);
s.rShiftTo(1, s)
}
n.compareTo(i) >= 0 ? (n.subTo(i, n), t && r.subTo(a, r), o.subTo(s, o)) : (i.subTo(n, i), t && a.subTo(r, a), s.subTo(o, s))
}
if (i.compareTo(m.ONE) != 0) return m.ZERO;
if (s.compareTo(e) >= 0) return s.subtract(e);
if (s.signum() < 0) s.addTo(e, s);
else return s;
return s.signum() < 0 ? s.add(e) : s
}
var ct = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997],
dt = 67108864 / ct[ct.length - 1];
function ht(e) {
var t, n = this.abs();
if (n.t == 1 && n[0] <= ct[ct.length - 1]) {
for (t = 0; t < ct.length; ++t) {
if (n[0] == ct[t]) return !0
}
return !1
}
if (n.isEven()) return !1;
for (t = 1; t < ct.length;) {
for (var i = ct[t], r = t + 1; r < ct.length && i < dt;) {
i *= ct[r++]
}
for (i = n.modInt(i); t < r;) {
if (i % ct[t++] == 0) return !1
}
}
return n.millerRabin(e)
}
function vt(e) {
var t = this.subtract(m.ONE),
n = t.getLowestSetBit();
if (n <= 0) return !1;
var i = t.shiftRight(n),
e = e + 1 >> 1;
if (e > ct.length) e = ct.length;
for (var r = y(), o = 0; o < e; ++o) {
r.fromInt(ct[Math.floor(Math.random() * ct.length)]);
var a = r.modPow(i, this);
if (a.compareTo(m.ONE) != 0 && a.compareTo(t) != 0) {
for (var s = 1; s++ < n && a.compareTo(t) != 0;) {
if (a = a.modPowInt(2, this), a.compareTo(m.ONE) == 0) return !1
}
if (a.compareTo(t) != 0) return !1
}
}
return !0
}
m.prototype.chunkSize = ue;
m.prototype.toRadix = fe;
m.prototype.fromRadix = ce;
m.prototype.fromNumber = de;
m.prototype.bitwiseTo = ye;
m.prototype.changeBit = Oe;
m.prototype.addTo = Je;
m.prototype.dMultiply = Ge;
m.prototype.dAddOffset = Ve;
m.prototype.multiplyLowerTo = Qe;
m.prototype.multiplyUpperTo = et;
m.prototype.modInt = lt;
m.prototype.millerRabin = vt;
m.prototype.clone = re;
m.prototype.intValue = oe;
m.prototype.byteValue = ae;
m.prototype.shortValue = se;
m.prototype.signum = le;
m.prototype.toByteArray = he;
m.prototype.equals = ve;
m.prototype.min = pe;
m.prototype.max = me;
m.prototype.and = ge;
m.prototype.or = Pe;
m.prototype.xor = be;
m.prototype.andNot = Ce;
m.prototype.not = Re;
m.prototype.shiftLeft = Ie;
m.prototype.shiftRight = Te;
m.prototype.getLowestSetBit = xe;
m.prototype.bitCount = Ee;
m.prototype.testBit = ze;
m.prototype.setBit = Fe;
m.prototype.clearBit = qe;
m.prototype.flipBit = We;
m.prototype.add = Le;
m.prototype.subtract = Ae;
m.prototype.multiply = Be;
m.prototype.divide = $e;
m.prototype.remainder = He;
m.prototype.divideAndRemainder = Ne;
m.prototype.modPow = st;
m.prototype.modInverse = ft;
m.prototype.pow = Ke;
m.prototype.gcd = ut;
m.prototype.isProbablePrime = ht;
m.prototype.square = Ue;
(function(r, o, u, a, s, l, f) {
function c(e) {
var t, n, s = this,
i = e.length,
r = 0,
o = s.i = s.j = s.m = 0;
s.S = [];
s.c = [];
for (i || (e = [i++]); r < u;) {
s.S[r] = r++
}
for (r = 0; r < u; r++) {
t = s.S[r], o = o + t + e[r % i] & u - 1, n = s.S[o], s.S[r] = n, s.S[o] = t
}
s.g = function(e) {
var t = s.S,
n = s.i + 1 & u - 1,
i = t[n],
r = s.j + i & u - 1,
o = t[r];
t[n] = o;
t[r] = i;
for (var a = t[i + o & u - 1]; --e;) {
n = n + 1 & u - 1, i = t[n], r = r + i & u - 1, o = t[r], t[n] = o, t[r] = i, a = a * u + t[i + o & u - 1]
}
s.i = n;
s.j = r;
return a
};
s.g(u)
}
function d(e, t, n, i, r) {
n = [];
r = typeof e === "undefined" ? "undefined" : p(e);
if (t && r == "object")
for (i in e) {
if (i.indexOf("S") < 5) try {
n.push(d(e[i], t - 1))
} catch (l) {}
}
return n.length ? n : e + (r != "string" ? "\0" : "")
}
function h(e, t, n, i) {
e += "";
for (i = n = 0; i < e.length; i++) {
var r = t,
o = i & u - 1,
a = (n ^= t[i & u - 1] * 19) + e.charCodeAt(i);
r[o] = a & u - 1
}
e = "";
for (i in t) {
e += String.fromCharCode(t[i])
}
return e
}
o.seedrandom = function(e, t) {
var n = [],
i, e = h(d(t ? [e, r] : arguments.length ? e : [(new Date).getTime(), r, window], 3), n);
i = new c(n);
h(i.S, r);
o.random = function() {
for (var e = i.g(a), t = f, n = 0; e < s;) {
e = (e + n) * u, t *= u, n = i.g(1)
}
for (; e >= l;) {
e /= 2, t /= 2, n >>>= 1
}
return (e + n) / t
};
return e
};
f = o.pow(u, a);
s = o.pow(2, s);
l = s * 2;
h(o.random(), r)
})([], Math, 256, 6, 52);
function pt() {}
function mt(e) {
var t;
for (t = 0; t < e.length; t++) {
e[t] = Math.floor(Math.random() * 256)
}
}
pt.prototype.nextBytes = mt;
function yt() {
this.j = this.i = 0;
this.S = []
}
function St(e) {
var t, n, i;
for (t = 0; t < 256; ++t) {
this.S[t] = t
}
for (t = n = 0; t < 256; ++t) {
n = n + this.S[t] + e[t % e.length] & 255, i = this.S[t], this.S[t] = this.S[n], this.S[n] = i
}
this.j = this.i = 0
}
function gt() {
var e;
this.i = this.i + 1 & 255;
this.j = this.j + this.S[this.i] & 255;
e = this.S[this.i];
this.S[this.i] = this.S[this.j];
this.S[this.j] = e;
return this.S[e + this.S[this.i] & 255]
}
yt.prototype.init = St;
yt.prototype.next = gt;
function _t() {
return new yt
}
var Pt = 256,
wt, bt, kt;
function Ct(e) {
bt[kt++] ^= e & 255;
bt[kt++] ^= e >> 8 & 255;
bt[kt++] ^= e >> 16 & 255;
bt[kt++] ^= e >> 24 & 255;
kt >= Pt && (kt -= Pt)
}
function Rt() {
Ct((new Date).getTime())
}
if (bt == null) {
bt = [];
kt = 0;
var It;
if (r.appName == "Netscape" && r.appVersion < "5" && window.crypto) {
var Tt = window.crypto.random(32);
for (It = 0; It < Tt.length; ++It) {
bt[kt++] = Tt.charCodeAt(It) & 255
}
}
for (; kt < Pt;) {
It = Math.floor(65536 * Math.random()), bt[kt++] = It >>> 8, bt[kt++] = It & 255
}
kt = 0;
Rt()
}
function Dt() {
if (wt == null) {
Rt();
wt = _t();
wt.init(bt);
for (kt = 0; kt < bt.length; ++kt) {
bt[kt] = 0
}
kt = 0
}
return wt.next()
}
function xt(e) {
var t;
for (t = 0; t < e.length; ++t) {
e[t] = Dt()
}
}
function Mt() {}
Mt.prototype.nextBytes = xt;
function Et(e) {
function y(e, t) {
var n = (e & 65535) + (t & 65535);
return (e >> 16) + (t >> 16) + (n >> 16) << 16 | n & 65535
}
function S(e, t) {
return e >>> t | e << 32 - t
}
e = function(e) {
for (var e = e.replace(/\r\n/g, "\n"), t = "", n = 0; n < e.length; n++) {
var i = e.charCodeAt(n);
i < 128 ? t += String.fromCharCode(i) : (i > 127 && i < 2048 ? t += String.fromCharCode(i >> 6 | 192) : (t += String.fromCharCode(i >> 12 | 224), t += String.fromCharCode(i >> 6 & 63 | 128)), t += String.fromCharCode(i & 63 | 128))
}
return t
}(e);
return function(e) {
for (var t = "", n = 0; n < e.length * 4; n++) {
t += "0123456789abcdef".charAt(e[n >> 2] >> (3 - n % 4) * 8 + 4 & 15) + "0123456789abcdef".charAt(e[n >> 2] >> (3 - n % 4) * 8 & 15)
}
return t
}(function(e, t) {
var n = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298],
i = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225],
r = Array(64),
o, a, s, u, l, f, c, d, h, v, p, m;
e[t >> 5] |= 128 << 24 - t % 32;
e[(t + 64 >> 9 << 4) + 15] = t;
for (h = 0; h < e.length; h += 16) {
o = i[0];
a = i[1];
s = i[2];
u = i[3];
l = i[4];
f = i[5];
c = i[6];
d = i[7];
for (v = 0; v < 64; v++) {
r[v] = v < 16 ? e[v + h] : y(y(y(S(r[v - 2], 17) ^ S(r[v - 2], 19) ^ r[v - 2] >>> 10, r[v - 7]), S(r[v - 15], 7) ^ S(r[v - 15], 18) ^ r[v - 15] >>> 3), r[v - 16]), p = y(y(y(y(d, S(l, 6) ^ S(l, 11) ^ S(l, 25)), l & f ^ ~l & c), n[v]), r[v]), m = y(S(o, 2) ^ S(o, 13) ^ S(o, 22), o & a ^ o & s ^ a & s), d = c, c = f, f = l, l = y(u, p), u = s, s = a, a = o, o = y(p, m)
}
i[0] = y(o, i[0]);
i[1] = y(a, i[1]);
i[2] = y(s, i[2]);
i[3] = y(u, i[3]);
i[4] = y(l, i[4]);
i[5] = y(f, i[5]);
i[6] = y(c, i[6]);
i[7] = y(d, i[7])
}
return i
}(function(e) {
for (var t = [], n = 0; n < e.length * 8; n += 8) {
t[n >> 5] |= (e.charCodeAt(n / 8) & 255) << 24 - n % 32
}
return t
}(e), e.length * 8))
}
var zt = {
hex: function dn(e) {
return Et(e)
}
};
function Ot(e) {
function t(e, t) {
return e << t | e >>> 32 - t
}
function n(e) {
var t = "",
n, i;
for (n = 7; n >= 0; n--) {
i = e >>> n * 4 & 15, t += i.toString(16)
}
return t
}
var i, r, o = Array(80),
a = 1732584193,
s = 4023233417,
u = 2562383102,
l = 271733878,
f = 3285377520,
c, d, h, v, p, e = function(e) {
for (var e = e.replace(/\r\n/g, "\n"), t = "", n = 0; n < e.length; n++) {
var i = e.charCodeAt(n);
i < 128 ? t += String.fromCharCode(i) : (i > 127 && i < 2048 ? t += String.fromCharCode(i >> 6 | 192) : (t += String.fromCharCode(i >> 12 | 224), t += String.fromCharCode(i >> 6 & 63 | 128)), t += String.fromCharCode(i & 63 | 128))
}
return t
}(e);
c = e.length;
var m = [];
for (i = 0; i < c - 3; i += 4) {
r = e.charCodeAt(i) << 24 | e.charCodeAt(i + 1) << 16 | e.charCodeAt(i + 2) << 8 | e.charCodeAt(i + 3), m.push(r)
}
switch (c % 4) {
case 0:
i = 2147483648;
break;
case 1:
i = e.charCodeAt(c - 1) << 24 | 8388608;
break;
case 2:
i = e.charCodeAt(c - 2) << 24 | e.charCodeAt(c - 1) << 16 | 32768;
break;
case 3:
i = e.charCodeAt(c - 3) << 24 | e.charCodeAt(c - 2) << 16 | e.charCodeAt(c - 1) << 8 | 128
}
for (m.push(i); m.length % 16 != 14;) {
m.push(0)
}
m.push(c >>> 29);
m.push(c << 3 & 4294967295);
for (e = 0; e < m.length; e += 16) {
for (i = 0; i < 16; i++) {
o[i] = m[e + i]
}
for (i = 16; i <= 79; i++) {
o[i] = t(o[i - 3] ^ o[i - 8] ^ o[i - 14] ^ o[i - 16], 1)
}
r = a;
c = s;
d = u;
h = l;
v = f;
for (i = 0; i <= 19; i++) {
p = t(r, 5) + (c & d | ~c & h) + v + o[i] + 1518500249 & 4294967295, v = h, h = d, d = t(c, 30), c = r, r = p
}
for (i = 20; i <= 39; i++) {
p = t(r, 5) + (c ^ d ^ h) + v + o[i] + 1859775393 & 4294967295, v = h, h = d, d = t(c, 30), c = r, r = p
}
for (i = 40; i <= 59; i++) {
p = t(r, 5) + (c & d | c & h | d & h) + v + o[i] + 2400959708 & 4294967295, v = h, h = d, d = t(c, 30), c = r, r = p
}
for (i = 60; i <= 79; i++) {
p = t(r, 5) + (c ^ d ^ h) + v + o[i] + 3395469782 & 4294967295, v = h, h = d, d = t(c, 30), c = r, r = p
}
a = a + r & 4294967295;
s = s + c & 4294967295;
u = u + d & 4294967295;
l = l + h & 4294967295;
f = f + v & 4294967295
}
p = n(a) + n(s) + n(u) + n(l) + n(f);
return p.toLowerCase()
}
var Ft = {
hex: function dn(e) {
return Ot(e)
}
},
qt = function qt(e) {
function s(e, t) {
var n, i, r, o, a;
r = e & 2147483648;
o = t & 2147483648;
n = e & 1073741824;
i = t & 1073741824;
a = (e & 1073741823) + (t & 1073741823);
return n & i ? a ^ 2147483648 ^ r ^ o : n | i ? a & 1073741824 ? a ^ 3221225472 ^ r ^ o : a ^ 1073741824 ^ r ^ o : a ^ r ^ o
}
function t(e, t, n, i, r, o, a) {
e = s(e, s(s(t & n | ~t & i, r), a));
return s(e << o | e >>> 32 - o, t)
}
function n(e, t, n, i, r, o, a) {
e = s(e, s(s(t & i | n & ~i, r), a));
return s(e << o | e >>> 32 - o, t)
}
function i(e, t, n, i, r, o, a) {
e = s(e, s(s(t ^ n ^ i, r), a));
return s(e << o | e >>> 32 - o, t)
}
function r(e, t, n, i, r, o, a) {
e = s(e, s(s(n ^ (t | ~i), r), a));
return s(e << o | e >>> 32 - o, t)
}
function o(e) {
var t = "",
n = "",
i;
for (i = 0; i <= 3; i++) {
n = e >>> i * 8 & 255, n = "0" + n.toString(16), t += n.substr(n.length - 2, 2)
}
return t
}
var a = [],
u, l, f, c, d, h, v, p, e = function(e) {
for (var e = e.replace(/\r\n/g, "\n"), t = "", n = 0; n < e.length; n++) {
var i = e.charCodeAt(n);
i < 128 ? t += String.fromCharCode(i) : (i > 127 && i < 2048 ? t += String.fromCharCode(i >> 6 | 192) : (t += String.fromCharCode(i >> 12 | 224), t += String.fromCharCode(i >> 6 & 63 | 128)), t += String.fromCharCode(i & 63 | 128))
}
return t
}(e),
a = function(e) {
var t, n = e.length;
t = n + 8;
for (var i = ((t - t % 64) / 64 + 1) * 16, r = Array(i - 1), o = 0, a = 0; a < n;) {
t = (a - a % 4) / 4, o = a % 4 * 8, r[t] |= e.charCodeAt(a) << o, a++
}
r[(a - a % 4) / 4] |= 128 << a % 4 * 8;
r[i - 2] = n << 3;
r[i - 1] = n >>> 29;
return r
}(e);
d = 1732584193;
h = 4023233417;
v = 2562383102;
p = 271733878;
for (e = 0; e < a.length; e += 16) {
u = d, l = h, f = v, c = p, d = t(d, h, v, p, a[e + 0], 7, 3614090360), p = t(p, d, h, v, a[e + 1], 12, 3905402710), v = t(v, p, d, h, a[e + 2], 17, 606105819), h = t(h, v, p, d, a[e + 3], 22, 3250441966), d = t(d, h, v, p, a[e + 4], 7, 4118548399), p = t(p, d, h, v, a[e + 5], 12, 1200080426), v = t(v, p, d, h, a[e + 6], 17, 2821735955), h = t(h, v, p, d, a[e + 7], 22, 4249261313), d = t(d, h, v, p, a[e + 8], 7, 1770035416), p = t(p, d, h, v, a[e + 9], 12, 2336552879), v = t(v, p, d, h, a[e + 10], 17, 4294925233), h = t(h, v, p, d, a[e + 11], 22, 2304563134), d = t(d, h, v, p, a[e + 12], 7, 1804603682), p = t(p, d, h, v, a[e + 13], 12, 4254626195), v = t(v, p, d, h, a[e + 14], 17, 2792965006), h = t(h, v, p, d, a[e + 15], 22, 1236535329), d = n(d, h, v, p, a[e + 1], 5, 4129170786), p = n(p, d, h, v, a[e + 6], 9, 3225465664), v = n(v, p, d, h, a[e + 11], 14, 643717713), h = n(h, v, p, d, a[e + 0], 20, 3921069994), d = n(d, h, v, p, a[e + 5], 5, 3593408605), p = n(p, d, h, v, a[e + 10], 9, 38016083), v = n(v, p, d, h, a[e + 15], 14, 3634488961), h = n(h, v, p, d, a[e + 4], 20, 3889429448), d = n(d, h, v, p, a[e + 9], 5, 568446438), p = n(p, d, h, v, a[e + 14], 9, 3275163606), v = n(v, p, d, h, a[e + 3], 14, 4107603335), h = n(h, v, p, d, a[e + 8], 20, 1163531501), d = n(d, h, v, p, a[e + 13], 5, 2850285829), p = n(p, d, h, v, a[e + 2], 9, 4243563512), v = n(v, p, d, h, a[e + 7], 14, 1735328473), h = n(h, v, p, d, a[e + 12], 20, 2368359562), d = i(d, h, v, p, a[e + 5], 4, 4294588738), p = i(p, d, h, v, a[e + 8], 11, 2272392833), v = i(v, p, d, h, a[e + 11], 16, 1839030562), h = i(h, v, p, d, a[e + 14], 23, 4259657740), d = i(d, h, v, p, a[e + 1], 4, 2763975236), p = i(p, d, h, v, a[e + 4], 11, 1272893353), v = i(v, p, d, h, a[e + 7], 16, 4139469664), h = i(h, v, p, d, a[e + 10], 23, 3200236656), d = i(d, h, v, p, a[e + 13], 4, 681279174), p = i(p, d, h, v, a[e + 0], 11, 3936430074), v = i(v, p, d, h, a[e + 3], 16, 3572445317), h = i(h, v, p, d, a[e + 6], 23, 76029189), d = i(d, h, v, p, a[e + 9], 4, 3654602809), p = i(p, d, h, v, a[e + 12], 11, 3873151461), v = i(v, p, d, h, a[e + 15], 16, 530742520), h = i(h, v, p, d, a[e + 2], 23, 3299628645), d = r(d, h, v, p, a[e + 0], 6, 4096336452), p = r(p, d, h, v, a[e + 7], 10, 1126891415), v = r(v, p, d, h, a[e + 14], 15, 2878612391), h = r(h, v, p, d, a[e + 5], 21, 4237533241), d = r(d, h, v, p, a[e + 12], 6, 1700485571), p = r(p, d, h, v, a[e + 3], 10, 2399980690), v = r(v, p, d, h, a[e + 10], 15, 4293915773), h = r(h, v, p, d, a[e + 1], 21, 2240044497), d = r(d, h, v, p, a[e + 8], 6, 1873313359), p = r(p, d, h, v, a[e + 15], 10, 4264355552), v = r(v, p, d, h, a[e + 6], 15, 2734768916), h = r(h, v, p, d, a[e + 13], 21, 1309151649), d = r(d, h, v, p, a[e + 4], 6, 4149444226), p = r(p, d, h, v, a[e + 11], 10, 3174756917), v = r(v, p, d, h, a[e + 2], 15, 718787259), h = r(h, v, p, d, a[e + 9], 21, 3951481745), d = s(d, u), h = s(h, l), v = s(v, f), p = s(p, c)
}
return (o(d) + o(h) + o(v) + o(p)).toLowerCase()
};
function Wt(e, t) {
return new m(e, t)
}
function Jt(e, t) {
for (var n = "", i = 0; i + t < e.length;) {
n += e.substring(i, i + t) + "\n", i += t
}
return n + e.substring(i, e.length)
}
function Lt(e) {
return e < 16 ? "0" + e.toString(16) : e.toString(16)
}
function At(e, t) {
if (t < e.length + 11) throw "Message too long for RSA (n=" + t + ", l=" + e.length + ")";
for (var n = [], i = e.length - 1; i >= 0 && t > 0;) {
var r = e.charCodeAt(i--);
r < 128 ? n[--t] = r : r > 127 && r < 2048 ? (n[--t] = r & 63 | 128, n[--t] = r >> 6 | 192) : (n[--t] = r & 63 | 128, n[--t] = r >> 6 & 63 | 128, n[--t] = r >> 12 | 224)
}
n[--t] = 0;
i = new Mt;
for (r = []; t > 2;) {
for (r[0] = 0; r[0] == 0;) {
i.nextBytes(r)
}
n[--t] = r[0]
}
n[--t] = 2;
n[--t] = 0;
return new m(n)
}
function Bt() {
this.n = null;
this.e = 0;
this.coeff = this.dmq1 = this.dmp1 = this.q = this.p = this.d = null
}
function Ut(e, t) {
e != null && t != null && e.length > 0 && t.length > 0 ? (this.n = Wt(e, 16), this.e = parseInt(t, 16)) : alert("Invalid RSA public key")
}
function $t(e) {
return e.modPowInt(this.e, this.n)
}
function Ht(e) {
e = At(e, this.n.bitLength() + 7 >> 3);
if (e == null) return null;
e = this.doPublic(e);
if (e == null) return null;
e = e.toString(16);
return (e.length & 1) == 0 ? e : "0" + e
}
Bt.prototype.doPublic = $t;
Bt.prototype.setPublic = Ut;
Bt.prototype.encrypt = Ht;
function Nt(e, t) {
for (var n = e.toByteArray(), i = 0; i < n.length && n[i] == 0;) {
++i
}
if (n.length - i != t - 1 || n[i] != 2) return null;
for (++i; n[i] != 0;) {
if (++i >= n.length) return null
}
for (var r = ""; ++i < n.length;) {
var o = n[i] & 255;
o < 128 ? r += String.fromCharCode(o) : o > 191 && o < 224 ? (r += String.fromCharCode((o & 31) << 6 | n[i + 1] & 63), ++i) : (r += String.fromCharCode((o & 15) << 12 | (n[i + 1] & 63) << 6 | n[i + 2] & 63), i += 2)
}
return r
}
function Gt(e, t, n) {
e != null && t != null && e.length > 0 && t.length > 0 ? (this.n = Wt(e, 16), this.e = parseInt(t, 16), this.d = Wt(n, 16)) : alert("Invalid RSA private key")
}
function Vt(e, t, n, i, r, o, a, s) {
e != null && t != null && e.length > 0 && t.length > 0 ? (this.n = Wt(e, 16), this.e = parseInt(t, 16), this.d = Wt(n, 16), this.p = Wt(i, 16), this.q = Wt(r, 16), this.dmp1 = Wt(o, 16), this.dmq1 = Wt(a, 16), this.coeff = Wt(s, 16)) : alert("Invalid RSA private key")
}
function jt(e, t) {
var n = new pt,
i = e >> 1;
this.e = parseInt(t, 16);
for (var r = new m(t, 16);;) {
for (;;) {
if (this.p = new m(e - i, 1, n), this.p.subtract(m.ONE).gcd(r).compareTo(m.ONE) == 0 && this.p.isProbablePrime(10)) break
}
for (;;) {
if (this.q = new m(i, 1, n), this.q.subtract(m.ONE).gcd(r).compareTo(m.ONE) == 0 && this.q.isProbablePrime(10)) break
}
if (this.p.compareTo(this.q) <= 0) {
var o = this.p;
this.p = this.q;
this.q = o
}
var o = this.p.subtract(m.ONE),
a = this.q.subtract(m.ONE),
s = o.multiply(a);
if (s.gcd(r).compareTo(m.ONE) == 0) {
this.n = this.p.multiply(this.q);
this.d = r.modInverse(s);
this.dmp1 = this.d.mod(o);
this.dmq1 = this.d.mod(a);
this.coeff = this.q.modInverse(this.p);
break
}
}
}
function Xt(e) {
if (this.p == null || this.q == null) return e.modPow(this.d, this.n);
for (var t = e.mod(this.p).modPow(this.dmp1, this.p), e = e.mod(this.q).modPow(this.dmq1, this.q); t.compareTo(e) < 0;) {
t = t.add(this.p)
}
return t.subtract(e).multiply(this.coeff).mod(this.p).multiply(this.q).add(e)
}
function Yt(e) {
e = this.doPrivate(Wt(e, 16));
return e == null ? null : Nt(e, this.n.bitLength() + 7 >> 3)
}
Bt.prototype.doPrivate = Xt;
Bt.prototype.setPrivate = Gt;
Bt.prototype.setPrivateEx = Vt;
Bt.prototype.generate = jt;
Bt.prototype.decrypt = Yt;
var Zt = [];
Zt.sha1 = "3021300906052b0e03021a05000414";
Zt.sha256 = "3031300d060960864801650304020105000420";
var Kt = [];
Kt.sha1 = Ft.hex;
Kt.sha256 = zt.hex;
function Qt(e, t, n) {
t /= 4;
for (var e = (0, Kt[n])(e), n = "00" + Zt[n] + e, e = "", t = t - 4 - n.length, i = 0; i < t; i += 2) {
e += "ff"
}
return sPaddedMessageHex = "0001" + e + n
}
function en(e, t) {
var n = Qt(e, this.n.bitLength(), t);
return this.doPrivate(Wt(n, 16)).toString(16)
}
function tn(e) {
e = Qt(e, this.n.bitLength(), "sha1");
return this.doPrivate(Wt(e, 16)).toString(16)
}
function nn(e) {
e = Qt(e, this.n.bitLength(), "sha256");
return this.doPrivate(Wt(e, 16)).toString(16)
}
function rn(e, t, n) {
var i = new Bt;
i.setPublic(t, n);
return i.doPublic(e)
}
function on(e, t, n) {
return rn(e, t, n).toString(16).replace(/^1f+00/, "")
}
function an(e) {
for (var t in Zt) {
var n = Zt[t],
i = n.length;
if (e.substring(0, i) == n) return [t, e.substring(i)]
}
return []
}
function sn(e, t, n, i) {
t = on(t, n, i);
n = an(t);
if (n.length == 0) return !1;
t = n[1];
e = (0, Kt[n[0]])(e);
return t == e
}
function un(e, t) {
var n = Wt(e, 16);
return sn(t, n, this.n.toString(16), this.e.toString(16))
}
function ln(e, t) {
var t = t.replace(/[ \n]+/g, ""),
n = this.doPublic(Wt(t, 16)).toString(16).replace(/^1f+00/, ""),
i = an(n);
if (i.length == 0) return !1;
n = i[1];
i = (0, Kt[i[0]])(e);
return n == i
}
Bt.prototype.signString = en;
Bt.prototype.signStringWithSHA1 = tn;
Bt.prototype.signStringWithSHA256 = nn;
Bt.prototype.verifyString = ln;
Bt.prototype.verifyHexSignatureForMessage = un;
var fn = function() {
var l = {
Sbox: [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22],
ShiftRowTab: [0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11]
};
l.Init = function() {
l.Sbox_Inv = Array(256);
for (var e = 0; e < 256; e++) {
l.Sbox_Inv[l.Sbox[e]] = e
}
l.ShiftRowTab_Inv = Array(16);
for (e = 0; e < 16; e++) {
l.ShiftRowTab_Inv[l.ShiftRowTab[e]] = e
}
l.xtime = Array(256);
for (e = 0; e < 128; e++) {
l.xtime[e] = e << 1, l.xtime[128 + e] = e << 1 ^ 27
}
};
l.Done = function() {
delete l.Sbox_Inv;
delete l.ShiftRowTab_Inv;
delete l.xtime
};
l.ExpandKey = function(e) {
var t = e.length,
n, i = 1;
switch (t) {
case 16:
n = 176;
break;
case 24:
n = 208;
break;
case 32:
n = 240;
break;
default:
alert("my.ExpandKey: Only key lengths of 16, 24 or 32 bytes allowed!")
}
for (var r = t; r < n; r += 4) {
var o = e.slice(r - 4, r);
if (r % t == 0) {
if (o = [l.Sbox[o[1]] ^ i, l.Sbox[o[2]], l.Sbox[o[3]], l.Sbox[o[0]]], (i <<= 1) >= 256) i ^= 283
} else t > 24 && r % t == 16 && (o = [l.Sbox[o[0]], l.Sbox[o[1]], l.Sbox[o[2]], l.Sbox[o[3]]]);
for (var a = 0; a < 4; a++) {
e[r + a] = e[r + a - t] ^ o[a]
}
}
};
l.Encrypt = function(e, t) {
var n = t.length;
l.AddRoundKey(e, t.slice(0, 16));
for (var i = 16; i < n - 16; i += 16) {
l.SubBytes(e, l.Sbox), l.ShiftRows(e, l.ShiftRowTab), l.MixColumns(e), l.AddRoundKey(e, t.slice(i, i + 16))
}
l.SubBytes(e, l.Sbox);
l.ShiftRows(e, l.ShiftRowTab);
l.AddRoundKey(e, t.slice(i, n))
};
l.Decrypt = function(e, t) {
var n = t.length;
l.AddRoundKey(e, t.slice(n - 16, n));
l.ShiftRows(e, l.ShiftRowTab_Inv);
l.SubBytes(e, l.Sbox_Inv);
for (n -= 32; n >= 16; n -= 16) {
l.AddRoundKey(e, t.slice(n, n + 16)), l.MixColumns_Inv(e), l.ShiftRows(e, l.ShiftRowTab_Inv), l.SubBytes(e, l.Sbox_Inv)
}
l.AddRoundKey(e, t.slice(0, 16))
};
l.SubBytes = function(e, t) {
for (var n = 0; n < 16; n++) {
e[n] = t[e[n]]
}
};
l.AddRoundKey = function(e, t) {
for (var n = 0; n < 16; n++) {
e[n] ^= t[n]
}
};
l.ShiftRows = function(e, t) {
for (var n = [].concat(e), i = 0; i < 16; i++) {
e[i] = n[t[i]]
}
};
l.MixColumns = function(e) {
for (var t = 0; t < 16; t += 4) {
var n = e[t + 0],
i = e[t + 1],
r = e[t + 2],
o = e[t + 3],
a = n ^ i ^ r ^ o;
e[t + 0] ^= a ^ l.xtime[n ^ i];
e[t + 1] ^= a ^ l.xtime[i ^ r];
e[t + 2] ^= a ^ l.xtime[r ^ o];
e[t + 3] ^= a ^ l.xtime[o ^ n]
}
};
l.MixColumns_Inv = function(e) {
for (var t = 0; t < 16; t += 4) {
var n = e[t + 0],
i = e[t + 1],
r = e[t + 2],
o = e[t + 3],
a = n ^ i ^ r ^ o,
s = l.xtime[a],
u = l.xtime[l.xtime[s ^ n ^ r]] ^ a;
a ^= l.xtime[l.xtime[s ^ i ^ o]];
e[t + 0] ^= u ^ l.xtime[n ^ i];
e[t + 1] ^= a ^ l.xtime[i ^ r];
e[t + 2] ^= u ^ l.xtime[r ^ o];
e[t + 3] ^= a ^ l.xtime[o ^ n]
}
};
return l
}(),
cn = function() {
var u = {};
fn.Init();
u.b256to64 = function(e) {
var t, n, i, r = "",
o = 0,
a = 0,
s = e.length;
for (i = 0; i < s; i++) {
n = e.charCodeAt(i), a == 0 ? (r += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n >> 2 & 63), t = (n & 3) << 4) : a == 1 ? (r += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t | n >> 4 & 15), t = (n & 15) << 2) : a == 2 && (r += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t | n >> 6 & 3), o += 1, r += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n & 63)), o += 1, a += 1, a == 3 && (a = 0)
}
a > 0 && (r += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t), r += "=");
a == 1 && (r += "=");
return r
};
u.b64to256 = function(e) {
var t, n, i = "",
r = 0,
o = 0,
a = e.length;
for (n = 0; n < a; n++) {
t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(n)), t >= 0 && (r && (i += String.fromCharCode(o | t >> 6 - r & 255)), r = r + 2 & 7, o = t << r & 255)
}
return i
};
u.b16to64 = function(e) {
var t, n, i = "";
e.length % 2 == 1 && (e = "0" + e);
for (t = 0; t + 3 <= e.length; t += 3) {
n = parseInt(e.substring(t, t + 3), 16), i += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n >> 6) + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n & 63)
}
t + 1 == e.length ? (n = parseInt(e.substring(t, t + 1), 16), i += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n << 2)) : t + 2 == e.length && (n = parseInt(e.substring(t, t + 2), 16), i += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(n >> 2) + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((n & 3) << 4));
for (;
(i.length & 3) > 0;) {
i += "="
}
return i
};
u.b64to16 = function(e) {
var t = "",
n, i = 0,
r;
for (n = 0; n < e.length; ++n) {
if (e.charAt(n) == "=") break;
v = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(n));
v < 0 || (i == 0 ? (t += _(v >> 2), r = v & 3, i = 1) : i == 1 ? (t += _(r << 2 | v >> 4), r = v & 15, i = 2) : i == 2 ? (t += _(r), t += _(v >> 2), r = v & 3, i = 3) : (t += _(r << 2 | v >> 4), t += _(v & 15), i = 0))
}
i == 1 && (t += _(r << 2));
return t
};
u.string2bytes = function(e) {
for (var t = [], n = 0; n < e.length; n++) {
t.push(e.charCodeAt(n))
}
return t
};
u.bytes2string = function(e) {
for (var t = "", n = 0; n < e.length; n++) {
t += String.fromCharCode(e[n])
}
return t
};
u.blockXOR = function(e, t) {
for (var n = Array(16), i = 0; i < 16; i++) {
n[i] = e[i] ^ t[i]
}
return n
};
u.blockIV = function() {
var e = new Mt,
t = Array(16);
e.nextBytes(t);
return t
};
u.pad16 = function(e) {
var t = e.slice(0),
n = (16 - e.length % 16) % 16;
for (i = e.length; i < e.length + n; i++) {
t.push(0)
}
return t
};
u.depad = function(e) {
for (e = e.slice(0); e[e.length - 1] == 0;) {
e = e.slice(0, e.length - 1)
}
return e
};
u.encryptAESCBC = function(e, t) {
var n = t.slice(0);
fn.ExpandKey(n);
for (var i = u.string2bytes(e), i = u.pad16(i), r = u.blockIV(), o = 0; o < i.length / 16; o++) {
var a = i.slice(o * 16, o * 16 + 16),
s = r.slice(o * 16, o * 16 + 16),
a = u.blockXOR(s, a);
fn.Encrypt(a, n);
r = r.concat(a)
}
n = u.bytes2string(r);
return u.b256to64(n)
};
u.decryptAESCBC = function(e, t) {
var n = t.slice(0);
fn.ExpandKey(n);
for (var e = u.b64to256(e), i = u.string2bytes(e), r = [], o = 1; o < i.length / 16; o++) {
var a = i.slice(o * 16, o * 16 + 16),
s = i.slice((o - 1) * 16, (o - 1) * 16 + 16);
fn.Decrypt(a, n);
a = u.blockXOR(s, a);
r = r.concat(a)
}
r = u.depad(r);
return u.bytes2string(r)
};
u.wrap60 = function(e) {
for (var t = "", n = 0; n < e.length; n++) {
n % 60 == 0 && n != 0 && (t += "\n"), t += e[n]
}
return t
};
u.generateAESKey = function() {
var e = Array(16);
(new Mt).nextBytes(e);
return e
};
u.generateRSAKey = function(e, t) {
Math.seedrandom(zt.hex(e));
var n = new Bt;
n.generate(t, "10001");
return n
};
u.publicKeyString = function(e) {
return pubkey = e.n.toString(16)
};
u.publicKeyID = function(e) {
return qt(e)
};
u.publicKeyFromString = function(e) {
var e = e.split("|")[0],
t = new Bt;
t.setPublic(e, "10001");
return t
};
u.encrypt = function(e, t, n) {
var i = "";
try {
var r = u.publicKeyFromString(t);
i += r.encrypt(e) + "?"
} catch (o) {
return {
status: "Invalid public key"
}
}
return {
status: "success",
cipher: i
}
};
u.decrypt = function(e, t) {
var n = e.split("?"),
i = t.decrypt(n[0]);
return {
status: "success",
plaintext: i,
signature: "unsigned"
}
};
return u
}();
e.exports = cn
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var O = O || function(s, n) {
var e = {},
t = e.lib = {},
i = function i() {},
r = t.Base = {
extend: function h(e) {
i.prototype = this;
var t = new i;
e && t.mixIn(e);
t.hasOwnProperty("init") || (t.init = function() {
t.$super.init.apply(this, arguments)
});
t.init.prototype = t;
t.$super = this;
return t
},
create: function v() {
var e = this.extend();
e.init.apply(e, arguments);
return e
},
init: function p() {},
mixIn: function m(e) {
for (var t in e) {
e.hasOwnProperty(t) && (this[t] = e[t])
}
e.hasOwnProperty("toString") && (this.toString = e.toString)
},
clone: function y() {
return this.init.prototype.extend(this)
}
},
u = t.WordArray = r.extend({
init: function p(e, t) {
e = this.words = e || [];
this.sigBytes = t != n ? t : 4 * e.length
},
toString: function S(e) {
return (e || a).stringify(this)
},
concat: function g(e) {
var t = this.words,
n = e.words,
i = this.sigBytes;
e = e.sigBytes;
this.clamp();
if (i % 4)
for (var r = 0; r < e; r++) {
t[i + r >>> 2] |= (n[r >>> 2] >>> 24 - 8 * (r % 4) & 255) << 24 - 8 * ((i + r) % 4)
} else if (65535 < n.length)
for (r = 0; r < e; r += 4) {
t[i + r >>> 2] = n[r >>> 2]
} else t.push.apply(t, n);
this.sigBytes += e;
return this
},
clamp: function _() {
var e = this.words,
t = this.sigBytes;
e[t >>> 2] &= 4294967295 << 32 - 8 * (t % 4);
e.length = s.ceil(t / 4)
},
clone: function y() {
var e = r.clone.call(this);
e.words = this.words.slice(0);
return e
},
random: function P(e) {
for (var t = [], n = 0; n < e; n += 4) {
t.push(4294967296 * s.random() | 0)
}
return new u.init(t, e)
}
}),
o = e.enc = {},
a = o.Hex = {
stringify: function w(e) {
var t = e.words;
e = e.sigBytes;
for (var n = [], i = 0; i < e; i++) {
var r = t[i >>> 2] >>> 24 - 8 * (i % 4) & 255;
n.push((r >>> 4).toString(16));
n.push((r & 15).toString(16))
}
return n.join("")
},
parse: function b(e) {
for (var t = e.length, n = [], i = 0; i < t; i += 2) {
n[i >>> 3] |= parseInt(e.substr(i, 2), 16) << 24 - 4 * (i % 8)
}
return new u.init(n, t / 2)
}
},
l = o.Latin1 = {
stringify: function w(e) {
var t = e.words;
e = e.sigBytes;
for (var n = [], i = 0; i < e; i++) {
n.push(String.fromCharCode(t[i >>> 2] >>> 24 - 8 * (i % 4) & 255))
}
return n.join("")
},
parse: function b(e) {
for (var t = e.length, n = [], i = 0; i < t; i++) {
n[i >>> 2] |= (e.charCodeAt(i) & 255) << 24 - 8 * (i % 4)
}
return new u.init(n, t)
}
},
f = o.Utf8 = {
stringify: function w(e) {
try {
return decodeURIComponent(escape(l.stringify(e)))
} catch (t) {
throw Error("Malformed UTF-8 data")
}
},
parse: function b(e) {
return l.parse(unescape(encodeURIComponent(e)))
}
},
c = t.BufferedBlockAlgorithm = r.extend({
reset: function k() {
this._data = new u.init;
this._nDataBytes = 0
},
_append: function C(e) {
"string" == typeof e && (e = f.parse(e));
this._data.concat(e);
this._nDataBytes += e.sigBytes
},
_process: function R(e) {
var t = this._data,
n = t.words,
i = t.sigBytes,
r = this.blockSize,
o = i / (4 * r),
o = e ? s.ceil(o) : s.max((o | 0) - this._minBufferSize, 0);
e = o * r;
i = s.min(4 * e, i);
if (e) {
for (var a = 0; a < e; a += r) {
this._doProcessBlock(n, a)
}
a = n.splice(0, e);
t.sigBytes -= i
}
return new u.init(a, i)
},
clone: function y() {
var e = r.clone.call(this);
e._data = this._data.clone();
return e
},
_minBufferSize: 0
});
t.Hasher = c.extend({
cfg: r.extend(),
init: function p(e) {
this.cfg = this.cfg.extend(e);
this.reset()
},
reset: function k() {
c.reset.call(this);
this._doReset()
},
update: function I(e) {
this._append(e);
this._process();
return this
},
finalize: function T(e) {
e && this._append(e);
return this._doFinalize()
},
blockSize: 16,
_createHelper: function D(n) {
return function(e, t) {
return new n.init(t).finalize(e)
}
},
_createHmacHelper: function x(n) {
return function(e, t) {
return new d.HMAC.init(n, t).finalize(e)
}
}
});
var d = e.algo = {};
return e
}(Math);
(function() {
var e = O,
u = e.lib.WordArray;
e.enc.Base64 = {
stringify: function s(e) {
var t = e.words,
n = e.sigBytes,
i = this._map;
e.clamp();
e = [];
for (var r = 0; r < n; r += 3) {
for (var o = (t[r >>> 2] >>> 24 - 8 * (r % 4) & 255) << 16 | (t[r + 1 >>> 2] >>> 24 - 8 * ((r + 1) % 4) & 255) << 8 | t[r + 2 >>> 2] >>> 24 - 8 * ((r + 2) % 4) & 255, a = 0; 4 > a && r + .75 * a < n; a++) {
e.push(i.charAt(o >>> 6 * (3 - a) & 63))
}
}
if (t = i.charAt(64))
for (; e.length % 4;) {
e.push(t)
}
return e.join("")
},
parse: function l(e) {
var t = e.length,
n = this._map,
i = n.charAt(64);
i && (i = e.indexOf(i), -1 != i && (t = i));
for (var i = [], r = 0, o = 0; o < t; o++) {
if (o % 4) {
var a = n.indexOf(e.charAt(o - 1)) << 2 * (o % 4),
s = n.indexOf(e.charAt(o)) >>> 6 - 2 * (o % 4);
i[r >>> 2] |= (a | s) << 24 - 8 * (r % 4);
r++
}
}
return u.create(i, r)
},
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
}
})();
(function(o) {
function b(e, t, n, i, r, o, a) {
e = e + (t & n | ~t & i) + r + a;
return (e << o | e >>> 32 - o) + t
}
function k(e, t, n, i, r, o, a) {
e = e + (t & i | n & ~i) + r + a;
return (e << o | e >>> 32 - o) + t
}
function C(e, t, n, i, r, o, a) {
e = e + (t ^ n ^ i) + r + a;
return (e << o | e >>> 32 - o) + t
}
function R(e, t, n, i, r, o, a) {
e = e + (n ^ (t | ~i)) + r + a;
return (e << o | e >>> 32 - o) + t
}
for (var e = O, t = e.lib, n = t.WordArray, i = t.Hasher, t = e.algo, I = [], r = 0; 64 > r; r++) {
I[r] = 4294967296 * o.abs(o.sin(r + 1)) | 0
}
t = t.MD5 = i.extend({
_doReset: function a() {
this._hash = new n.init([1732584193, 4023233417, 2562383102, 271733878])
},
_doProcessBlock: function T(e, t) {
for (var n = 0; 16 > n; n++) {
var i = t + n,
r = e[i];
e[i] = (r << 8 | r >>> 24) & 16711935 | (r << 24 | r >>> 8) & 4278255360
}
var n = this._hash.words,
i = e[t + 0],
r = e[t + 1],
o = e[t + 2],
a = e[t + 3],
s = e[t + 4],
u = e[t + 5],
l = e[t + 6],
f = e[t + 7],
c = e[t + 8],
d = e[t + 9],
h = e[t + 10],
v = e[t + 11],
p = e[t + 12],
m = e[t + 13],
y = e[t + 14],
S = e[t + 15],
g = n[0],
_ = n[1],
P = n[2],
w = n[3],
g = b(g, _, P, w, i, 7, I[0]),
w = b(w, g, _, P, r, 12, I[1]),
P = b(P, w, g, _, o, 17, I[2]),
_ = b(_, P, w, g, a, 22, I[3]),
g = b(g, _, P, w, s, 7, I[4]),
w = b(w, g, _, P, u, 12, I[5]),
P = b(P, w, g, _, l, 17, I[6]),
_ = b(_, P, w, g, f, 22, I[7]),
g = b(g, _, P, w, c, 7, I[8]),
w = b(w, g, _, P, d, 12, I[9]),
P = b(P, w, g, _, h, 17, I[10]),
_ = b(_, P, w, g, v, 22, I[11]),
g = b(g, _, P, w, p, 7, I[12]),
w = b(w, g, _, P, m, 12, I[13]),
P = b(P, w, g, _, y, 17, I[14]),
_ = b(_, P, w, g, S, 22, I[15]),
g = k(g, _, P, w, r, 5, I[16]),
w = k(w, g, _, P, l, 9, I[17]),
P = k(P, w, g, _, v, 14, I[18]),
_ = k(_, P, w, g, i, 20, I[19]),
g = k(g, _, P, w, u, 5, I[20]),
w = k(w, g, _, P, h, 9, I[21]),
P = k(P, w, g, _, S, 14, I[22]),
_ = k(_, P, w, g, s, 20, I[23]),
g = k(g, _, P, w, d, 5, I[24]),
w = k(w, g, _, P, y, 9, I[25]),
P = k(P, w, g, _, a, 14, I[26]),
_ = k(_, P, w, g, c, 20, I[27]),
g = k(g, _, P, w, m, 5, I[28]),
w = k(w, g, _, P, o, 9, I[29]),
P = k(P, w, g, _, f, 14, I[30]),
_ = k(_, P, w, g, p, 20, I[31]),
g = C(g, _, P, w, u, 4, I[32]),
w = C(w, g, _, P, c, 11, I[33]),
P = C(P, w, g, _, v, 16, I[34]),
_ = C(_, P, w, g, y, 23, I[35]),
g = C(g, _, P, w, r, 4, I[36]),
w = C(w, g, _, P, s, 11, I[37]),
P = C(P, w, g, _, f, 16, I[38]),
_ = C(_, P, w, g, h, 23, I[39]),
g = C(g, _, P, w, m, 4, I[40]),
w = C(w, g, _, P, i, 11, I[41]),
P = C(P, w, g, _, a, 16, I[42]),
_ = C(_, P, w, g, l, 23, I[43]),
g = C(g, _, P, w, d, 4, I[44]),
w = C(w, g, _, P, p, 11, I[45]),
P = C(P, w, g, _, S, 16, I[46]),
_ = C(_, P, w, g, o, 23, I[47]),
g = R(g, _, P, w, i, 6, I[48]),
w = R(w, g, _, P, f, 10, I[49]),
P = R(P, w, g, _, y, 15, I[50]),
_ = R(_, P, w, g, u, 21, I[51]),
g = R(g, _, P, w, p, 6, I[52]),
w = R(w, g, _, P, a, 10, I[53]),
P = R(P, w, g, _, h, 15, I[54]),
_ = R(_, P, w, g, r, 21, I[55]),
g = R(g, _, P, w, c, 6, I[56]),
w = R(w, g, _, P, S, 10, I[57]),
P = R(P, w, g, _, l, 15, I[58]),
_ = R(_, P, w, g, m, 21, I[59]),
g = R(g, _, P, w, s, 6, I[60]),
w = R(w, g, _, P, v, 10, I[61]),
P = R(P, w, g, _, o, 15, I[62]),
_ = R(_, P, w, g, d, 21, I[63]);
n[0] = n[0] + g | 0;
n[1] = n[1] + _ | 0;
n[2] = n[2] + P | 0;
n[3] = n[3] + w | 0
},
_doFinalize: function s() {
var e = this._data,
t = e.words,
n = 8 * this._nDataBytes,
i = 8 * e.sigBytes;
t[i >>> 5] |= 128 << 24 - i % 32;
var r = o.floor(n / 4294967296);
t[(i + 64 >>> 9 << 4) + 15] = (r << 8 | r >>> 24) & 16711935 | (r << 24 | r >>> 8) & 4278255360;
t[(i + 64 >>> 9 << 4) + 14] = (n << 8 | n >>> 24) & 16711935 | (n << 24 | n >>> 8) & 4278255360;
e.sigBytes = 4 * (t.length + 1);
this._process();
e = this._hash;
t = e.words;
for (n = 0; 4 > n; n++) {
i = t[n], t[n] = (i << 8 | i >>> 24) & 16711935 | (i << 24 | i >>> 8) & 4278255360
}
return e
},
clone: function u() {
var e = i.clone.call(this);
e._hash = this._hash.clone();
return e
}
});
e.MD5 = i._createHelper(t);
e.HmacMD5 = i._createHmacHelper(t)
})(Math);
(function() {
var e = O,
t = e.lib,
n = t.Base,
l = t.WordArray,
t = e.algo,
i = t.EvpKDF = n.extend({
cfg: n.extend({
keySize: 4,
hasher: t.MD5,
iterations: 1
}),
init: function r(e) {
this.cfg = this.cfg.extend(e)
},
compute: function f(e, t) {
for (var n = this.cfg, i = n.hasher.create(), r = l.create(), o = r.words, a = n.keySize, n = n.iterations; o.length < a;) {
s && i.update(s);
var s = i.update(e).finalize(t);
i.reset();
for (var u = 1; u < n; u++) {
s = i.finalize(s), i.reset()
}
r.concat(s)
}
r.sigBytes = 4 * a;
return r
}
});
e.EvpKDF = function(e, t, n) {
return i.create(n).compute(e, t)
}
})();
O.lib.Cipher || function(o) {
var e = O,
t = e.lib,
n = t.Base,
a = t.WordArray,
i = t.BufferedBlockAlgorithm,
r = e.enc.Base64,
s = e.algo.EvpKDF,
u = t.Cipher = i.extend({
cfg: n.extend(),
createEncryptor: function p(e, t) {
return this.create(this._ENC_XFORM_MODE, e, t)
},
createDecryptor: function m(e, t) {
return this.create(this._DEC_XFORM_MODE, e, t)
},
init: function y(e, t, n) {
this.cfg = this.cfg.extend(n);
this._xformMode = e;
this._key = t;
this.reset()
},
reset: function S() {
i.reset.call(this);
this._doReset()
},
process: function g(e) {
this._append(e);
return this._process()
},
finalize: function _(e) {
e && this._append(e);
return this._doFinalize()
},
keySize: 4,
ivSize: 4,
_ENC_XFORM_MODE: 1,
_DEC_XFORM_MODE: 2,
_createHelper: function P(i) {
return {
encrypt: function r(e, t, n) {
return ("string" == typeof t ? v : h).encrypt(i, e, t, n)
},
decrypt: function o(e, t, n) {
return ("string" == typeof t ? v : h).decrypt(i, e, t, n)
}
}
}
});
t.StreamCipher = u.extend({
_doFinalize: function w() {
return this._process(!0)
},
blockSize: 1
});
var l = e.mode = {},
f = function f(e, t, n) {
var i = this._iv;
i ? this._iv = o : i = this._prevBlock;
for (var r = 0; r < n; r++) {
e[t + r] ^= i[r]
}
},
c = (t.BlockCipherMode = n.extend({
createEncryptor: function p(e, t) {
return this.Encryptor.create(e, t)
},
createDecryptor: function m(e, t) {
return this.Decryptor.create(e, t)
},
init: function y(e, t) {
this._cipher = e;
this._iv = t
}
})).extend();
c.Encryptor = c.extend({
processBlock: function b(e, t) {
var n = this._cipher,
i = n.blockSize;
f.call(this, e, t, i);
n.encryptBlock(e, t);
this._prevBlock = e.slice(t, t + i)
}
});
c.Decryptor = c.extend({
processBlock: function b(e, t) {
var n = this._cipher,
i = n.blockSize,
r = e.slice(t, t + i);
n.decryptBlock(e, t);
f.call(this, e, t, i);
this._prevBlock = r
}
});
l = l.CBC = c;
c = (e.pad = {}).Pkcs7 = {
pad: function k(e, t) {
for (var n = 4 * t, n = n - e.sigBytes % n, i = n << 24 | n << 16 | n << 8 | n, r = [], o = 0; o < n; o += 4) {
r.push(i)
}
n = a.create(r, n);
e.concat(n)
},
unpad: function C(e) {
e.sigBytes -= e.words[e.sigBytes - 1 >>> 2] & 255
}
};
t.BlockCipher = u.extend({
cfg: u.cfg.extend({
mode: l,
padding: c
}),
reset: function S() {
u.reset.call(this);
var e = this.cfg,
t = e.iv,
e = e.mode;
if (this._xformMode == this._ENC_XFORM_MODE) var n = e.createEncryptor;
else n = e.createDecryptor, this._minBufferSize = 1;
this._mode = n.call(e, this, t && t.words)
},
_doProcessBlock: function R(e, t) {
this._mode.processBlock(e, t)
},
_doFinalize: function w() {
var e = this.cfg.padding;
if (this._xformMode == this._ENC_XFORM_MODE) {
e.pad(this._data, this.blockSize);
var t = this._process(!0)
} else t = this._process(!0), e.unpad(t);
return t
},
blockSize: 4
});
var d = t.CipherParams = n.extend({
init: function y(e) {
this.mixIn(e)
},
toString: function I(e) {
return (e || this.formatter).stringify(this)
}
}),
l = (e.format = {}).OpenSSL = {
stringify: function T(e) {
var t = e.ciphertext;
e = e.salt;
return (e ? a.create([1398893684, 1701076831]).concat(e).concat(t) : t).toString(r)
},
parse: function D(e) {
e = r.parse(e);
var t = e.words;
if (1398893684 == t[0] && 1701076831 == t[1]) {
var n = a.create(t.slice(2, 4));
t.splice(0, 4);
e.sigBytes -= 16
}
return d.create({
ciphertext: e,
salt: n
})
}
},
h = t.SerializableCipher = n.extend({
cfg: n.extend({
format: l
}),
encrypt: function x(e, t, n, i) {
i = this.cfg.extend(i);
var r = e.createEncryptor(n, i);
t = r.finalize(t);
r = r.cfg;
return d.create({
ciphertext: t,
key: n,
iv: r.iv,
algorithm: e,
mode: r.mode,
padding: r.padding,
blockSize: e.blockSize,
formatter: i.format
})
},
decrypt: function M(e, t, n, i) {
i = this.cfg.extend(i);
t = this._parse(t, i.format);
return e.createDecryptor(n, i).finalize(t.ciphertext)
},
_parse: function E(e, t) {
return "string" == typeof e ? t.parse(e, this) : e
}
}),
e = (e.kdf = {}).OpenSSL = {
execute: function z(e, t, n, i) {
i || (i = a.random(8));
e = s.create({
keySize: t + n
}).compute(e, i);
n = a.create(e.words.slice(t), 4 * n);
e.sigBytes = 4 * t;
return d.create({
key: e,
iv: n,
salt: i
})
}
},
v = t.PasswordBasedCipher = h.extend({
cfg: h.cfg.extend({
kdf: e
}),
encrypt: function x(e, t, n, i) {
i = this.cfg.extend(i);
n = i.kdf.execute(n, e.keySize, e.ivSize);
i.iv = n.iv;
e = h.encrypt.call(this, e, t, n.key, i);
e.mixIn(n);
return e
},
decrypt: function M(e, t, n, i) {
i = this.cfg.extend(i);
t = this._parse(t, i.format);
n = i.kdf.execute(n, e.keySize, e.ivSize, t.salt);
i.iv = n.iv;
return h.decrypt.call(this, e, t, n.key, i)
}
})
}();
(function() {
for (var e = O, t = e.lib.BlockCipher, n = e.algo, a = [], i = [], r = [], o = [], s = [], u = [], l = [], f = [], c = [], d = [], h = [], v = 0; 256 > v; v++) {
h[v] = 128 > v ? v << 1 : v << 1 ^ 283
}
for (var p = 0, m = 0, v = 0; 256 > v; v++) {
var y = m ^ m << 1 ^ m << 2 ^ m << 3 ^ m << 4,
y = y >>> 8 ^ y & 255 ^ 99;
a[p] = y;
i[y] = p;
var S = h[p],
g = h[S],
_ = h[g],
P = 257 * h[y] ^ 16843008 * y;
r[p] = P << 24 | P >>> 8;
o[p] = P << 16 | P >>> 16;
s[p] = P << 8 | P >>> 24;
u[p] = P;
P = 16843009 * _ ^ 65537 * g ^ 257 * S ^ 16843008 * p;
l[y] = P << 24 | P >>> 8;
f[y] = P << 16 | P >>> 16;
c[y] = P << 8 | P >>> 24;
d[y] = P;
p ? (p = S ^ h[h[h[_ ^ S]]], m ^= h[h[m]]) : p = m = 1
}
var w = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54],
n = n.AES = t.extend({
_doReset: function b() {
for (var e = this._key, t = e.words, n = e.sigBytes / 4, e = 4 * ((this._nRounds = n + 6) + 1), i = this._keySchedule = [], r = 0; r < e; r++) {
if (r < n) i[r] = t[r];
else {
var o = i[r - 1];
r % n ? 6 < n && 4 == r % n && (o = a[o >>> 24] << 24 | a[o >>> 16 & 255] << 16 | a[o >>> 8 & 255] << 8 | a[o & 255]) : (o = o << 8 | o >>> 24, o = a[o >>> 24] << 24 | a[o >>> 16 & 255] << 16 | a[o >>> 8 & 255] << 8 | a[o & 255], o ^= w[r / n | 0] << 24);
i[r] = i[r - n] ^ o
}
}
t = this._invKeySchedule = [];
for (n = 0; n < e; n++) {
r = e - n, o = n % 4 ? i[r] : i[r - 4], t[n] = 4 > n || 4 >= r ? o : l[a[o >>> 24]] ^ f[a[o >>> 16 & 255]] ^ c[a[o >>> 8 & 255]] ^ d[a[o & 255]]
}
},
encryptBlock: function k(e, t) {
this._doCryptBlock(e, t, this._keySchedule, r, o, s, u, a)
},
decryptBlock: function C(e, t) {
var n = e[t + 1];
e[t + 1] = e[t + 3];
e[t + 3] = n;
this._doCryptBlock(e, t, this._invKeySchedule, l, f, c, d, i);
n = e[t + 1];
e[t + 1] = e[t + 3];
e[t + 3] = n
},
_doCryptBlock: function R(e, t, n, i, r, o, a, s) {
for (var u = this._nRounds, l = e[t] ^ n[0], f = e[t + 1] ^ n[1], c = e[t + 2] ^ n[2], d = e[t + 3] ^ n[3], h = 4, v = 1; v < u; v++) {
var p = i[l >>> 24] ^ r[f >>> 16 & 255] ^ o[c >>> 8 & 255] ^ a[d & 255] ^ n[h++],
m = i[f >>> 24] ^ r[c >>> 16 & 255] ^ o[d >>> 8 & 255] ^ a[l & 255] ^ n[h++],
y = i[c >>> 24] ^ r[d >>> 16 & 255] ^ o[l >>> 8 & 255] ^ a[f & 255] ^ n[h++],
d = i[d >>> 24] ^ r[l >>> 16 & 255] ^ o[f >>> 8 & 255] ^ a[c & 255] ^ n[h++],
l = p,
f = m,
c = y
}
p = (s[l >>> 24] << 24 | s[f >>> 16 & 255] << 16 | s[c >>> 8 & 255] << 8 | s[d & 255]) ^ n[h++];
m = (s[f >>> 24] << 24 | s[c >>> 16 & 255] << 16 | s[d >>> 8 & 255] << 8 | s[l & 255]) ^ n[h++];
y = (s[c >>> 24] << 24 | s[d >>> 16 & 255] << 16 | s[l >>> 8 & 255] << 8 | s[f & 255]) ^ n[h++];
d = (s[d >>> 24] << 24 | s[l >>> 16 & 255] << 16 | s[f >>> 8 & 255] << 8 | s[c & 255]) ^ n[h++];
e[t] = p;
e[t + 1] = m;
e[t + 2] = y;
e[t + 3] = d
},
keySize: 8
});
e.AES = t._createHelper(n)
})();
t["default"] = O
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var i = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
function a(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var r = function() {
var e = function() {
function e() {
a(this, e)
}
i(e, [{
key: "createClientObject",
value: function r(e, t, n, i) {
return {
socket: e,
id: t,
playURL: n,
deviceSerial: i.deviceSerial || "",
verificationCode: i.verificationCode || "",
resolve: null,
reject: null
}
}
}, {
key: "playCmd",
value: function n(e) {
var t = {
sequence: 0,
cmd: "realplay",
deviceSerial: e.deviceSerial,
verificationCode: e.verificationCode,
url: e.playURL
};
return JSON.stringify(t)
}
}, {
key: "playbackCmd",
value: function o(e, t, n) {
var i = {
sequence: 0,
cmd: "playback",
deviceSerial: e.deviceSerial,
verificationCode: e.verificationCode,
url: e.playURL,
startTime: t,
endTime: n
};
return JSON.stringify(i)
}
}]);
return e
}();
return e
}();
t.LocalService = r
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var Y = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
function Z(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var K = 0;
var Q = 1;
var ee = 2;
var i = 3;
var r = 4;
var o = 5;
var a = 6;
var s = 7;
var te = 11;
var u = 12;
var l = 13;
var f = 14;
var c = 15;
var ne = 16;
var d = 17;
var h = 18;
var v = 19;
var p = 20;
var m = 21;
var y = 22;
var S = 24;
var g = 25;
var _ = 26;
var P = 27;
var w = 28;
var b = 29;
var k = 30;
var ie = 31;
var C = 33;
var R = 34;
var I = 99;
var T = 40;
var D = 41;
var x = 42;
var M = 43;
var E = 44;
var z = 45;
var O = 46;
var F = 47;
var re = 48;
var oe = 60;
var ae = 61;
var q = 62;
var se = 63;
var ue = 71;
var W = 72;
var J = 73;
var L = 74;
var A = 75;
var B = 76;
var U = 77;
var $ = 78;
var le = 79;
var fe = 100;
var ce = 101;
var de = 1;
var H = 2;
var N = 3;
var he = 4;
var ve = 1;
var G = 2;
var V = 8;
var pe = 16;
var j = 8e3;
var X = 16e3;
var me = 24e3;
var ye = 32e3;
var Se = 48e3;
var ge = 64e3;
var _e = {
AUDIO_G711_U: 28944,
AUDIO_G711_A: 28945,
AUDIO_G722_1: 29217,
AUDIO_G726_U: 29280,
AUDIO_G726_A: 29281,
AUDIO_G726_2: 29282,
AUDIO_AACLC: 8193,
AUDIO_MPEG: 8192,
AUDIO_NULL: 0
};
var Pe = 0;
var we = 1;
var be = 1;
var ke = 256;
var Ce = 28944;
var Re = 28945;
var Ie = 0;
var Te = 1;
var De = "BMP";
var xe = "JPEG";
var Me = 0;
var Ee = 1;
var ze = 15;
var Oe = 8;
var Fe = 1;
var qe = 25;
var We = 20;
var Je = 5;
var Le = 5 * 1024 * 1024;
var Ae = 100;
var Be = 5e3;
var Ue = 500;
var $e = 100;
var He = 20;
var Ne = 100;
var Ge = 1;
var Ve = 0;
var je = {
left: 0,
top: 0,
right: 0,
bottom: 0
};
var Xe = {
width: 0,
height: 0,
frameNum: 0,
yuvData: null
};
var Ye = {
width: 0,
height: 0,
frameNum: 0,
yuvData: null
};
var Ze = {
sampleRate: 0,
channel: 0,
bitsPerSample: 0,
length: 0,
pcmData: null
};
var Ke = false;
var Qe = false;
var et = false;
var tt = {
id: null,
cmd: null,
data: null,
errorCode: 0,
status: null
};
var nt = t.JSPlayCtrl = function() {
function s(e, t, a) {
Z(this, s);
if (e != null && e !== undefined && typeof e === "string") {
this.szBasePath = e
} else {
return K
}
if (t && typeof t === "function") {
this.fnCallBack = t
} else {
return K
}
this.decodeWorker = null;
this.streamOpenMode = null;
this.bOpenStream = false;
this.iFrameNumOrTime = 0;
this.bSetPlayPositionType = Ve;
this.audioRenderer = null;
this.aAudioBuffer = [];
this.iAudioBufferSize = 0;
this.aAudioEncBuffer = [];
this.iAudioEncBufferSize = 0;
this.bWriteAudEnc = true;
this.oSuperRender = null;
this.aVideoFrameBuffer = [];
this.YUVBufferSize = Fe;
this.szOSDTime = null;
this.bWriteYUVData = false;
this.iYUV10size = 0;
this.aVideoYUVBuffer = [];
this.bWritePCMData = false;
this.iAudioBuffer500Size = 0;
this.aAudioPCMBuffer = [];
this.bWriteRawData = false;
this.iRawDataSize = 0;
this.aRawDataBuffer = [];
this.bPlaySound = false;
this.bPlay = false;
this.bPause = false;
this.bOnebyOne = false;
this.bPlayRateChange = false;
this.bAudioTypeSupport = true;
this.audioNum = 0;
this.videoNum = 0;
this.SetPlayPositionFlag = false;
this.FrameForwardLen = 1;
this.bOnlyPlaySound = false;
this.dataCallBackFun = null;
this.YUVBufSizeCBFun = null;
this.AudEncodeDataCBFun = null;
this.DecCallBackFun = null;
this.DisplayCallBackFun = null;
this.PCMCallBackFun = null;
this.DecInfoYUV = Xe;
this.DisplayInfoYUV = Ye;
this.DecInfoPCM = Ze;
this.nWidth = 0;
this.nHeight = 0;
this.nSPSCropLeft = 0;
this.nSPSCropRight = 0;
this.nSPSCropTop = 0;
this.nSPSCropBottom = 0;
this.sCanvasId = null;
this.aDisplayBuf = null;
this.bVisibility = true;
this.nDecFrameType = Me;
this.iCanvasWidth = 0;
this.iCanvasHeight = 0;
this.iZoomNum = 0;
this.iRatio_x = 1;
this.iRatio_y = 1;
this.stDisplayRect = {
top: 0,
left: 0,
right: 0,
bottom: 0
};
this.bDisRect = false;
this.stYUVRect = {
top: 0,
left: 0,
right: 0,
bottom: 0
};
this.aInputDataLens = [];
this.aInputDataBuffer = [];
this.bIsGetYUV = false;
this.bIsFirstFrame = true;
this.iInputMaxBufSize = Le;
this.bIsInput = false;
this.bIsInputBufOver = false;
this.iInputDataLen = Be;
var g = this;
this.setCallBack = function(e, t, n, i, r) {
var o = tt;
o.id = a;
o.cmd = t;
o.data = n;
o.errorCode = i;
o.status = r;
e.fnCallBack(o)
};
if (!Ke) {
Ke = true;
var n = document.createElement("script");
n.type = "text/javascript";
n.src = g.szBasePath + "AudioRenderer.js";
var i = document.getElementsByTagName("head")[0];
i.appendChild(n);
n.onload = n.onreadystatechange = function() {
if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") {
if (et) {}
}
}
}
if (!Qe) {
Qe = true;
var r = document.createElement("script");
r.type = "text/javascript";
r.src = g.szBasePath + "SuperRender_10.js";
var o = document.getElementsByTagName("head")[0];
o.appendChild(r);
r.onload = r.onreadystatechange = function() {
if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") {
if (et) {}
}
}
}
this.convertErrorCode = function(e) {
switch (e) {
case 1:
return Q;
case 98:
return K;
default:
return e
}
};
this.arrayBufferCopy = function(e) {
var t = e.byteLength;
var n = new Uint8Array(t);
var i = new Uint8Array(e);
var r = 0;
for (r = 0; r < t; r++) {
n[r] = i[r]
}
return n
};
this.inputDataFun = function() {
var e;
var t;
var n = 0;
g.bIsGetYUV = false;
if (g.bIsInputBufOver) {
if (et) {}
e = new Uint8Array(1);
t = new Uint8Array(e);
var i = {
command: "InputData",
data: t.buffer,
dataSize: 0
};
g.decodeWorker.postMessage(i, [i.data])
} else {
if (g.bPlay && (!g.bPause || g.bOnebyOne) || this.bOnlyPlaySound) {
while (g.aInputDataLens.length > 0) {
n += g.aInputDataLens.shift();
if (n > g.iInputDataLen) {
break
}
}
e = g.aInputDataBuffer.splice(0, n);
if (et) {}
t = new Uint8Array(e);
var i = {
command: "InputData",
data: t.buffer,
dataSize: n
};
g.decodeWorker.postMessage(i, [i.data])
}
}
e = null;
t = null
};
this.getPic = function(e, t) {
if (this.decodeWorker == null || this.oSuperRender == null) {
return ee
}
if (!this.bPlay) {
return ee
}
if (e && typeof e === "function") {
this.dataCallBackFun = e
} else {
return K
}
if (0 === this.iZoomNum) {
this.stYUVRect.left = 0;
this.stYUVRect.top = 0;
this.stYUVRect.right = 0;
this.stYUVRect.bottom = 0
} else {
if (0 === this.iCanvasWidth || 0 === this.iCanvasHeight) {
this.stYUVRect.left = 0;
this.stYUVRect.top = 0;
this.stYUVRect.right = 0;
this.stYUVRect.bottom = 0
} else {
var n = this.nWidth / this.iCanvasWidth;
var i = this.nHeight / this.iCanvasHeight;
this.stYUVRect.left = Math.round(this.stDisplayRect.left * n);
this.stYUVRect.top = Math.round(this.stDisplayRect.top * i);
this.stYUVRect.right = Math.round(this.stDisplayRect.right * n);
this.stYUVRect.bottom = Math.round(this.stDisplayRect.bottom * i)
}
if (this.stYUVRect.right - this.stYUVRect.left < 32 || this.stYUVRect.bottom - this.stYUVRect.top < 32) {
return K
}
}
if (this.aDisplayBuf == null) {
return ee
}
var r = this.arrayBufferCopy(this.aDisplayBuf);
var o = {
command: t,
data: r.buffer,
width: this.nWidth,
height: this.nHeight,
rect: this.stYUVRect
};
if (et) {}
this.decodeWorker.postMessage(o, [o.data]);
return Q
};
this.createWorker = function(S) {
if (window.Worker) {
if (this.decodeWorker == null) {
this.decodeWorker = new Worker(g.szBasePath + "DecodeWorker.js");
if (this.decodeWorker == null) {
return oe
}
}
this.decodeWorker.onmessage = function(e) {
var t = null;
var n = e.data;
switch (n["function"]) {
case "printLog":
break;
case "loaded":
t = "loaded";
S.setCallBack(S, "loaded", 0, 0, true);
break;
case "SetStreamOpenMode":
t = "SetStreamOpenMode";
break;
case "OpenStream":
t = "OpenStream";
if (1 === n.errorCode) {
g.bOpenStream = true;
return
}
break;
case "InputData":
t = "InputData";
if (n.errorCode === te) {
g.bIsInputBufOver = true;
g.inputDataFun();
if (et) {}
}
if (n.errorCode === ie) {
g.bIsInputBufOver = false;
if (et) {}
}
break;
case "GetFrameData":
t = "GetFrameData";
if (!g.bOnlyPlaySound) {
if (et) {}
if (n.data != null && n.frameInfo != null) {
var i = n.frameInfo.width;
var r = n.frameInfo.height
}
if (!g.bPlay) {
return
}
if (!g.bIsFirstFrame && n.errorCode === ie) {
g.bIsInputBufOver = false;
setTimeout(g.inputDataFun(), 5);
break
} else if (g.bIsInputBufOver) {
g.inputDataFun()
} else {
if (n.type === "videoType") {
if (g.aInputDataLens.length > 0 && g.bIsInput) {
g.inputDataFun();
g.bIsInput = false
} else {
g.bIsGetYUV = true
}
g.bIsFirstFrame = false
}
}
}
if (et) {}
if (g.bVisibility) {
if (Q === n.errorCode) {
switch (n.type) {
case "videoType":
if (et) {}
if (n.data == null || n.frameInfo == null) {
return K
}
if (g.DecCallBackFun != null) {
if (et) {}
g.DecInfoYUV.height = n.frameInfo.height;
g.DecInfoYUV.width = n.frameInfo.width;
g.DecInfoYUV.frameNum = n.frameInfo.frameNum;
g.DecInfoYUV.yuvData = new Uint8Array(n.data);
g.DecCallBackFun(g.DecInfoYUV)
}
g.bIsFirstFrame = false;
S.nWidth = n.frameInfo.width;
S.nHeight = n.frameInfo.height;
S.nSPSCropLeft = n.frameInfo.cropLeft;
S.nSPSCropRight = n.frameInfo.cropRight;
S.nSPSCropTop = n.frameInfo.cropTop;
S.nSPSCropBottom = n.frameInfo.cropBottom;
var o = new Object;
o.data = n.data;
o.osdTime = n.osd;
o.nWidth = n.frameInfo.width;
o.nHeight = n.frameInfo.height;
o.frameNum = n.frameInfo.frameNum;
o.timeStamp = n.frameInfo.timeStamp;
if (S.bWriteYUVData) {
var a = new Uint8Array(n.data);
var s = S.aVideoYUVBuffer.length;
for (var u = 0, l = a.length; u < l; u++) {
S.aVideoYUVBuffer[s + u] = a[u]
}
S.iYUV10size++;
a = null
}
if (S.bWriteYUVData && S.iYUV10size >= He) {
var f = new Uint8Array(S.aVideoYUVBuffer);
S.downloadFile(f, "videoYUV.data");
S.aVideoYUVBuffer.splice(0, S.aVideoYUVBuffer.length);
S.bWriteYUVData = false;
S.iYUV10size = 0;
f = null
}
if (et) {}
S.aVideoFrameBuffer.push(o);
o = null;
var c = S.aVideoFrameBuffer.length;
if (c > We) {
if (et) {}
if (!S.bOnebyOne) {
S.aVideoFrameBuffer.splice(0, Je)
}
}
if (S.SetPlayPositionFlag && S.bSetPlayPositionType === Ge && (n.frameInfo.frameNum === S.iFrameNumOrTime || n.frameInfo.timeStamp === S.iFrameNumOrTime)) {
S.setCallBack(S, "SetFrameNum", 0, 0, false);
S.bIsFirstFrame = true;
break
}
if (S.bOnebyOne) {
if (S.aVideoFrameBuffer.length >= ze) {
S.setCallBack(S, "OnebyOne", 0, 0, false);
S.bIsFirstFrame = true;
break
}
}
break;
case "audioType":
if (et) {}
if (S.bPlaySound && !S.bPlayRateChange || g.bOnlyPlaySound) {
if (et) {}
if (g.PCMCallBackFun != null) {
if (et) {}
g.DecInfoPCM.sampleRate = n.frameInfo.samplesPerSec;
g.DecInfoPCM.channel = n.frameInfo.channels;
g.DecInfoPCM.bitsPerSample = n.frameInfo.bitsPerSample;
g.DecInfoPCM.pcmData = new Uint8Array(n.data);
g.DecInfoPCM.length = g.DecInfoPCM.pcmData.length;
g.PCMCallBackFun(g.DecInfoPCM)
}
var a = new Uint8Array(n.data);
var s = S.aAudioBuffer.length;
for (var u = 0, l = a.length; u < l; u++) {
S.aAudioBuffer[s + u] = a[u]
}
S.iAudioBufferSize++;
a = null;
if (et) {}
if (S.bWritePCMData) {
var a = new Uint8Array(n.data);
var s = S.aAudioPCMBuffer.length;
for (var u = 0, l = a.length; u < l; u++) {
S.aAudioPCMBuffer[s + u] = a[u]
}
S.iAudioBuffer500Size++;
a = null
}
if (S.bWritePCMData && S.iAudioBuffer500Size >= $e) {
var d = new Uint8Array(S.aAudioPCMBuffer);
S.downloadFile(d, "audioPCM.data");
S.aAudioPCMBuffer.splice(0, S.aAudioPCMBuffer.length);
S.bWritePCMData = false;
S.iAudioBuffer500Size = 0;
d = null
}
if (S.iAudioBufferSize >= qe) {
if (et) {}
S.audioRenderer.Play(S.aAudioBuffer, S.aAudioBuffer.length, n.frameInfo);
if (et) {}
S.aAudioBuffer.splice(0, S.aAudioBuffer.length);
S.aAudioBuffer.length = 0;
S.iAudioBufferSize = 0
}
}
break;
case "privateType":
if (et) {}
break;
default:
if (et) {}
break
}
} else {
if (et) {}
}
}
break;
case "GetRawData":
t = "GetRawData";
if (S.bWriteRawData) {
var h = new Uint8Array(n.data);
var v = S.aRawDataBuffer.length;
for (var u = 0, l = h.length; u < l; u++) {
S.aRawDataBuffer[v + u] = h[u]
}
S.iRawDataSize++;
h = null
}
if (S.bWriteRawData && S.iRawDataSize >= Ne) {
var p = new Uint8Array(S.aRawDataBuffer);
S.downloadFile(p, "rawBuffer.data");
S.aRawDataBuffer.splice(0, S.aRawDataBuffer.length);
S.bWriteRawData = false;
S.iRawDataSize = 0;
p = null
}
break;
case "PlaySound":
t = "PlaySound";
break;
case "SetPlayPosition":
break;
case "GetJPEG":
t = "GetJPEG";
var m = n.data;
S.dataCallBackFun(m);
break;
case "GetBMP":
t = "GetBMP";
var y = n.data;
S.dataCallBackFun(y);
break;
case "GetAudEncodeData":
if (et) {}
t = "GetAudEncodeData";
if (Q === n.errorCode) {
if (g.AudEncodeDataCBFun != null) {
if (et) {}
g.AudEncodeDataCBFun(new Uint8Array(n.data))
}
if (this.bWriteAudEnc) {
var a = new Uint8Array(n.data);
var s = S.aAudioEncBuffer.length;
for (var u = 0, l = a.length; u < l; u++) {
S.aAudioEncBuffer[s + u] = a[u]
}
S.iAudioEncBufferSize++;
a = null
}
if (this.bWriteAudEnc && S.iAudioEncBufferSize >= Ue) {
S.downloadFile(S.aAudioEncBuffer, audioEnc.data);
this.bWriteAudEnc = false;
S.iAudioEncBufferSize = 0
}
} else {
if (et) {}
}
break;
default:
break
}
if ("GetFrameData" !== t || "GetAudEncodeData" !== t) {
S.setCallBack(S, t, 0, S.convertErrorCode(n.errorCode), true)
} else {
if (ne === n.errorCode || ce === n.errorCode || fe === n.errorCode || re === n.errorCode) {
S.setCallBack(S, t, 0, S.convertErrorCode(n.errorCode), true)
}
}
}
}
};
this.createWorker(g);
this.draw = function() {
if (g.bPlay) {
if (!g.bPause || g.bOnebyOne) {
requestAnimationFrame(g.draw);
var e = g.aVideoFrameBuffer.length;
if (g.YUVBufSizeCBFun != null) {
g.YUVBufSizeCBFun(e)
}
if (g.bOnebyOne) {
if (e <= Oe) {
g.setCallBack(g, "OnebyOne", 0, ie, true)
}
if (e <= g.FrameForwardLen + 1) {
g.setCallBack(g, "OnebyOne", 0, ie, true);
return
} else {
var t = g.FrameForwardLen;
while (t > 1) {
var n = g.aVideoFrameBuffer.shift();
t--
}
}
g.bOnebyOne = false
}
if (et) {}
if (e > g.YUVBufferSize) {
var i = g.aVideoFrameBuffer.shift();
if (g.SetPlayPositionFlag) {
if (et) {}
if (i.frameNum != g.iFrameNumOrTime) {
if (et) {}
return
}
if (g.bSetPlayPositionType === Ge) {
g.bPause = true
}
g.SetPlayPositionFlag = false
}
if (et) {}
g.aDisplayBuf = i.data;
var r = new Uint8Array(g.aDisplayBuf);
if (et) {}
g.oSuperRender.SR_DisplayFrameData(i.nWidth, i.nHeight, r, i.nWidth - g.nSPSCropLeft - g.nSPSCropRight, i.nHeight - g.nSPSCropTop - g.nSPSCropBottom);
if (g.DisplayCallBackFun != null) {
if (et) {}
g.DisplayInfoYUV.height = i.nHeight;
g.DisplayInfoYUV.width = i.nWidth;
g.DisplayInfoYUV.frameNum = i.frameNum;
g.DisplayInfoYUV.yuvData = new Uint8Array(r);
g.DisplayCallBackFun(g.DisplayInfoYUV)
}
if (et && g.bOnebyOne) {}
if (et) {}
r = null;
g.szOSDTime = i.osdTime;
i = null
} else {
g.setCallBack(g, "Play", 0, ie, true)
}
}
} else {
if (!g.bPlay) {
if (et) {}
g.aVideoFrameBuffer.splice(0, g.aVideoFrameBuffer.length);
g.aAudioBuffer.splice(0, g.aAudioBuffer.length)
}
}
};
this.checkAudioType = function(e) {
var i = function i(e, t) {
var n = e[t] & 255 | (e[t + 1] & 255) << 8 | (e[t + 2] & 255) << 16 | (e[t + 3] & 255) << 24;
return n
};
var t = [e[12], e[13], 0, 0];
var n = i(t, 0);
switch (n) {
case _e.AUDIO_G711_A:
case _e.AUDIO_G711_U:
case _e.AUDIO_G722_1:
case _e.AUDIO_G726_2:
case _e.AUDIO_G726_A:
case _e.AUDIO_G726_U:
case _e.AUDIO_AACLC:
case _e.AUDIO_MPEG:
return Q;
default:
return ne
}
}
}
Y(s, [{
key: "PlayM4_SetCurrentFrameNum",
value: function n(e, t) {
if (this.decodeWorker == null || this.oSuperRender == null) {
return ee
}
if (!this.bPlay) {
return ee
}
if (e < 0) {
return K
}
if (t !== 0 && t !== 1) {
return K
}
return this.PlayM4_SetPlayPosition(0, e, t)
}
}, {
key: "PlayM4_SetPlayPosition",
value: function i(e, t, n) {
if (this.decodeWorker == null || this.oSuperRender == null) {
return ee
}
if (!this.bPlay) {
return ee
}
if (e !== 0 && e !== 1) {
return K
}
if (t < 0) {
return K
}
if (n !== 0 && n !== 1) {
return K
}
this.SetPlayPositionFlag = true;
this.iFrameNumOrTime = t;
this.bSetPlayPositionType = n;
this.decodeWorker.postMessage({
command: "SetPlayPosition",
data: this.iFrameNumOrTime,
type: e
});
this.aAudioBuffer.splice(0, this.aAudioBuffer.length);
this.iAudioBufferSize = 0;
this.aVideoFrameBuffer.splice(0, this.aVideoFrameBuffer.length);
this.aInputDataBuffer.splice(0, this.aInputDataBuffer.length);
this.aInputDataLens.splice(0, this.aInputDataLens.length);
this.bIsFirstFrame = true;
this.bIsInputBufOver = false;
return Q
}
}, {
key: "PlayM4_OpenPlayerSDKPrintLog",
value: function t(e) {
if (e === true) {
et = true;
this.decodeWorker.postMessage({
command: "printLog",
data: e
})
} else {
et = false;
this.decodeWorker.postMessage({
command: "printLog",
data: e
})
}
return Q
}
}, {
key: "PlayM4_DownloadYUVdata",
value: function e() {
this.bWriteYUVData = true;
return Q
}
}, {
key: "PlayM4_DownloadPCMdata",
value: function r() {
this.bWritePCMData = true;
return Q
}
}, {
key: "PlayM4_SetDecCallBack",
value: function o(e) {
if (et) {}
if (e && typeof e === "function") {
this.DecCallBackFun = e;
return Q
} else {
return K
}
}
}, {
key: "PlayM4_SetDisplayCallBack",
value: function a(e) {
if (et) {}
if (e && typeof e === "function") {
this.DisplayCallBackFun = e;
return Q
} else {
return K
}
}
}, {
key: "PlayM4_SetPCMCallBack",
value: function u(e) {
if (et) {}
if (e && typeof e === "function") {
this.PCMCallBackFun = e;
return Q
} else {
return K
}
}
}, {
key: "PlayM4_SetStreamOpenMode",
value: function l(e) {
if (e == null || e === undefined) {
return K
}
if (e !== Ie && e !== Te) {
return K
}
this.streamOpenMode = e;
if (et) {}
return Q
}
}, {
key: "PlayM4_OpenStream",
value: function f(e, t, n) {
if (et) {}
if (this.decodeWorker == null) {
return ee
}
if (e == null || t <= 0 || n <= 0) {
return K
}
this.bPlay = false;
this.bPause = false;
this.bOnebyOne = false;
this.bIsFirstFrame = true;
this.bIsGetYUV = false;
this.bIsInput = false;
var i = this.checkAudioType(e);
if (Q !== i) {
this.bAudioTypeSupport = false
} else {
this.bAudioTypeSupport = true
}
this.decodeWorker.postMessage({
command: "SetStreamOpenMode",
data: this.streamOpenMode
});
if (et) {}
this.decodeWorker.postMessage({
command: "OpenStream",
data: e,
dataSize: t,
bufPoolSize: n
});
if (et) {}
this.bOpenStream = true;
return Q
}
}, {
key: "PlayM4_CloseStream",
value: function c() {
if (et) {}
if (this.decodeWorker === null || this.bOpenStream === false) {
return ee
}
this.bOnlyPlaySound = false;
this.PlayM4_Stop();
this.decodeWorker.postMessage({
command: "CloseStream"
});
if (this.oSuperRender !== null) {
this.oSuperRender.SR_Destroy();
this.oSuperRender = null
}
if (this.audioRenderer !== null) {
this.audioRenderer.Stop();
this.audioRenderer = null
}
this.aAudioBuffer.splice(0, this.aAudioBuffer.length);
this.aVideoFrameBuffer.splice(0, this.aVideoFrameBuffer.length);
this.aInputDataBuffer.splice(0, this.aInputDataBuffer.length);
this.aInputDataLens.splice(0, this.aInputDataLens.length);
this.aAudioEncBuffer.splice(0, this.aAudioEncBuffer.length);
this.aVideoYUVBuffer.splice(0, this.aVideoYUVBuffer.length);
this.aAudioPCMBuffer.splice(0, this.aAudioPCMBuffer.length);
this.aRawDataBuffer.splice(0, this.aRawDataBuffer.length);
this.bOpenStream = false;
this.iAudioBufferSize = 0;
this.szOSDTime = null;
return Q
}
}, {
key: "PlayM4_Destroy",
value: function d() {
if (et) {}
if (this.decodeWorker === null) {
return Q
}
this.PlayM4_CloseStream();
this.decodeWorker.terminate();
this.decodeWorker = null;
return Q
}
}, {
key: "PlayM4_InputData",
value: function h(e, t) {
if (this.decodeWorker === null || this.bOpenStream === false) {
return ee
}
var n = this.aInputDataBuffer.length;
if (t === 4) {
var i = new Uint8Array(e.buffer);
if (i[0] === 1 && i[1] === 2 && i[2] === 3 && i[3] === 4) {
if (et) {}
if (this.bIsFirstFrame) {
if (et) {}
this.inputDataFun()
} else {
if (this.bIsGetYUV) {
this.inputDataFun()
} else {
this.bIsInput = true
}
}
i = null;
return Q
}
}
if (n + t > this.iInputMaxBufSize) {
this.inputDataFun();
return te
}
var r = null;
var o = t;
switch (this.streamOpenMode) {
case Te:
r = new Uint8Array(e.buffer);
this.aInputDataLens.push(t);
break;
case Ie:
o = t + 4;
var a = new Uint32Array([t]);
var s = new Uint8Array(a.buffer);
r = new Uint8Array(o);
r.set(s, 0);
r.set(e, 4);
a = null;
s = null;
this.aInputDataLens.push(t + 4);
break;
default:
return ne
}
for (var u = 0; u < o; u++) {
this.aInputDataBuffer[n + u] = r[u]
}
r = null;
if (et) {}
if (this.bOnlyPlaySound) {
if (et) {}
this.inputDataFun()
} else {
if (this.bIsFirstFrame) {
if (et) {}
this.inputDataFun()
} else {
if (this.bIsGetYUV) {
if (et) {}
this.inputDataFun()
} else {
if (et) {}
this.bIsInput = true
}
}
}
return Q
}
}, {
key: "PlayM4_Play",
value: function v(e) {
if (this.decodeWorker === null) {
return ee
}
if (et) {}
if (e === null) {
this.bOnlyPlaySound = true;
this.sCanvasId = null
} else {
if (typeof e !== "string") {
return K
}
if (this.bOnebyOne) {
this.bPlayRateChange = false;
this.bOnebyOne = false;
this.bPause = false;
this.draw()
}
if (this.bPlay) {
return Q
}
if (this.oSuperRender == null) {
this.oSuperRender = new SuperRender(e, this.szBasePath);
if (this.oSuperRender == null) {
return ae
}
}
this.sCanvasId = e;
this.bPlay = true;
this.bPause = false;
this.bOnebyOne = false;
this.bPlaySound = false;
this.bPlayRateChange = false;
this.bOnlyPlaySound = false;
this.draw()
}
if (this.audioRenderer == null) {
this.audioRenderer = new AudioRenderer;
if (this.audioRenderer == null) {
return ae
}
}
return Q
}
}, {
key: "PlayM4_Stop",
value: function p() {
if (et) {}
if (this.decodeWorker == null || this.oSuperRender == null) {
return ee
}
if (!this.bPlay) {
return ee
}
if (this.bPlaySound) {
this.PlayM4_StopSound();
this.bPlaySound = true
}
this.bPlay = false;
this.bOnebyOne = false;
this.bPause = false;
this.oSuperRender.SR_SetDisplayRect(null);
this.iZoomNum = 0;
this.bDisRect = false;
this.oSuperRender.SR_DisplayFrameData(this.nWidth, this.nHeight, null);
if (et) {}
return Q
}
}, {
key: "PlayM4_PlayRate",
value: function m(e) {
if (this.decodeWorker == null) {
return ee
}
if (e === 1) {
this.bPlayRateChange = false
} else {
this.bPlayRateChange = true
}
if (e < 1) {
e = 1
}
this.iInputDataLen = e * Be;
return Q
}
}, {
key: "PlayM4_Pause",
value: function y(e) {
if (this.decodeWorker == null || this.oSuperRender == null) {
return ee
}
if (!this.bPlay) {
return ee
}
if (this.bOnebyOne) {
return ee
}
if (typeof e !== "boolean") {
return K
}
this.bPause = e;
this.bIsFirstFrame = true;
if (et) {}
if (e) {
if (this.bPlaySound) {
this.PlayM4_StopSound();
this.bPlaySound = true
}
} else {
if (this.bPlaySound) {
this.PlayM4_PlaySound()
}
this.draw()
}
return Q
}
}, {
key: "PlayM4_OneByOne",
value: function S(e) {
if (this.decodeWorker == null || this.oSuperRender == null) {
return ee
}
if (!this.bPlay) {
return ee
}
if (e > 10 || e <= 0) {
return K
}
if (!e) {
e = 1
}
this.iInputDataLen = Be;
this.FrameForwardLen = e;
this.bPause = true;
this.bOnebyOne = true;
this.bIsFirstFrame = true;
this.draw();
return Q
}
}, {
key: "PlayM4_PlaySound",
value: function g(e) {
if (this.decodeWorker === null || this.bOpenStream === false) {
return ee
}
if (!this.bAudioTypeSupport) {
return ne
}
if (e < 0 || e > 16) {
return K
}
if (this.audioRenderer == null) {
this.audioRenderer = new AudioRenderer;
if (this.audioRenderer == null) {
return ae
}
}
this.audioRenderer.SetWndNum(e);
this.bPlaySound = true;
return Q
}
}, {
key: "PlayM4_StopSound",
value: function _() {
if (this.decodeWorker == null || this.audioRenderer == null) {
return ee
}
if (!this.bPlaySound) {
return ee
}
this.bPlaySound = false;
return Q
}
}, {
key: "PlayM4_SetDisplayBuf",
value: function P(e) {
if (this.decodeWorker == null) {
return ee
}
if (e <= 0) {
return K
}
this.YUVBufferSize = e;
return Q
}
}, {
key: "PlayM4_SetSecretKey",
value: function w(e, t, n) {
if (this.decodeWorker == null || this.bOpenStream === false) {
return ee
}
if (t == null) {
return K
}
if (we === e) {
if (128 === n) {
if (t == null || t === undefined) {
return K
}
} else {
return K
}
} else if (Pe === e) {} else {
return K
}
this.decodeWorker.postMessage({
command: "SetSecretKey",
data: t,
nKeyType: e,
nKeyLen: n
});
return Q
}
}, {
key: "PlayM4_SetDecodeFrameType",
value: function b(e) {
if (this.decodeWorker == null || this.oSuperRender == null) {
return ee
}
if (e !== Me && e !== Ee) {
return K
}
if (et) {}
this.nDecFrameType = e;
this.decodeWorker.postMessage({
command: "SetDecodeFrameType",
data: e
});
return Q
}
}, {
key: "PlayM4_SetIFrameDecInterval",
value: function k(e) {
if (this.nDecFrameType !== Ee) {
return ee
}
if (e < 0) {
return K
}
this.decodeWorker.postMessage({
command: "SetIFrameDecInterval",
data: e
});
return Q
}
}, {
key: "PlayM4_SetDisplayRegion",
value: function C(e, t) {
if (et) {}
if (this.decodeWorker === null || this.bPlay === false || this.oSuperRender === null) {
return ee
}
if (this.canvasId === null) {
return ee
}
if (t === true) {
if (e === null || e === undefined) {
if (et) {}
return K
}
if (typeof e.left === "number" && typeof e.top === "number" && typeof e.right === "number" && typeof e.bottom === "number") {
if (e.right < 0 || e.left < 0 || e.top < 0 || e.bottom < 0) {
if (et) {}
return K
}
var n = e.left;
var i = e.right;
var r = e.top;
var o = e.bottom;
var a = document.getElementById(this.sCanvasId).getBoundingClientRect();
this.iCanvasWidth = a.width;
this.iCanvasHeight = a.height;
if (i - n < 16 || o - r < 16 || i - n > this.iCanvasWidth || o - r > this.iCanvasHeight) {
return K
}
if (this.iZoomNum !== 0) {
n = Math.round(n / this.iRatio_x) + this.stDisplayRect.left;
r = Math.round(r / this.iRatio_y) + this.stDisplayRect.top;
i = Math.round(i / this.iRatio_x) + this.stDisplayRect.left;
o = Math.round(o / this.iRatio_y) + this.stDisplayRect.top
}
this.stDisplayRect = {
top: r,
left: n,
right: i,
bottom: o
};
this.oSuperRender.SR_SetDisplayRect(this.stDisplayRect);
this.bDisRect = true;
var s = i - n;
var u = o - r;
this.iRatio_x = this.iCanvasWidth / s;
this.iRatio_y = this.iCanvasHeight / u;
this.iZoomNum++
} else {
return K
}
} else {
this.oSuperRender.SR_SetDisplayRect(null);
this.iZoomNum = 0;
this.bDisRect = false
}
if (this.bPause || this.bOnebyOne || this.bPlayRateChange) {
this.oSuperRender.SR_DisplayFrameData(this.nWidth, this.nHeight, new Uint8Array(this.aDisplayBuf))
}
return Q
}
}, {
key: "PlayM4_GetBMP",
value: function R(e) {
return this.getPic(e, "GetBMP")
}
}, {
key: "PlayM4_GetJPEG",
value: function I(e) {
return this.getPic(e, "GetJPEG")
}
}, {
key: "PlayM4_SetVolume",
value: function T(e) {
if (this.decodeWorker == null) {
return ee
}
if (this.audioRenderer == null) {
return ee
}
if (e < 0 || e > 100) {
return K
}
this.audioRenderer.SetVolume(e / 100);
return Q
}
}, {
key: "PlayM4_GetVolume",
value: function D(e) {
if (this.decodeWorker == null) {
return ee
}
if (this.audioRenderer == null) {
return ee
}
if (e && typeof e === "function") {
var t = this.audioRenderer.GetVolume();
if (t === null) {
return se
} else {
e(Math.round(t * 10) * 10);
return Q
}
} else {
return K
}
}
}, {
key: "PlayM4_GetOSDTime",
value: function x(e) {
if (this.decodeWorker == null) {
return ee
}
if (!this.bPlay) {
return ee
}
if (e && typeof e === "function") {
e(this.szOSDTime);
return Q
} else {
return K
}
}
}, {
key: "PlayM4_IsVisible",
value: function M(e) {
this.bVisibility = e;
if (et) {}
return Q
}
}, {
key: "PlayM4_GetSdkVersion",
value: function E() {
return "07020141"
}
}, {
key: "PlayM4_GetBuildDate",
value: function z() {
return "20200612"
}
}, {
key: "PlayM4_GetInputBufSize",
value: function O() {
return this.aInputDataBuffer.length
}
}, {
key: "PlayM4_SetInputBufSize",
value: function F(e) {
if (e > 0) {
this.iInputMaxBufSize = e;
return Q
} else {
return K
}
}
}, {
key: "PlayM4_GetYUVBufSize",
value: function q() {
return this.aVideoFrameBuffer.length
}
}, {
key: "PlayM4_GetFrameResolution",
value: function W(e) {
if (this.decodeWorker == null) {
return ee
}
if (e && typeof e === "function") {
e(this.nWidth, this.nHeight);
return Q
} else {
return K
}
}
}, {
key: "PlayM4_RegisterYUVBufSizeCB",
value: function J(e) {
if (e && typeof e === "function") {
this.YUVBufSizeCBFun = e;
return Q
} else {
return K
}
}
}, {
key: "PlayM4_UnRegisterYUVBufSizeCB",
value: function L() {
if (this.YUVBufSizeCBFun != null) {
this.YUVBufSizeCBFun = null
}
return Q
}
}, {
key: "PlayM4_ClearCanvas",
value: function A() {
if (this.oSuperRender == null) {
return ee
}
this.oSuperRender.SR_DisplayFrameData(this.nWidth, this.nHeight, null);
return Q
}
}, {
key: "PlayM4_ReleaseInputBuffer",
value: function B() {
if (this.aInputDataBuffer === null) {
return ee
}
this.aInputDataBuffer.splice(0, this.aInputDataBuffer.length);
this.aInputDataLens.splice(0, this.aInputDataLens.length);
return Q
}
}, {
key: "PlayM4_GetDecodeFrameType",
value: function U() {
return this.nDecFrameType
}
}, {
key: "PlayM4_CreateAudEncode",
value: function $(e) {
if (et) {}
if (this.decodeWorker == null) {
return le
}
if (e < de || e > he) {
return ue
}
this.decodeWorker.postMessage({
command: "CreateAudEncode",
encodertype: e
});
return Q
}
}, {
key: "PlayM4_SetAudEncodeParam",
value: function H(e, t, n, i) {
if (et) {}
if (this.decodeWorker == null) {
return le
}
if (t != ve || i != pe) {
return ue
}
this.decodeWorker.postMessage({
command: "SetAudEncodeParam",
samplerate: e,
channel: t,
bitrate: n,
bitwidth: i
});
return Q
}
}, {
key: "PlayM4_InputAudEncodeData",
value: function N(e, t) {
if (et) {}
if (this.decodeWorker == null) {
return le
}
this.decodeWorker.postMessage({
command: "InputAudEncodeData",
data: e,
dataSize: t
});
return Q
}
}, {
key: "PlayM4_DestroyAudEncode",
value: function G() {
if (et) {}
if (this.decodeWorker == null) {
return le
}
this.aAudioEncBuffer.splice(0, this.aAudioEncBuffer.length);
this.iAudioEncBufferSize = 0;
this.decodeWorker.postMessage({
command: "DestroyAudEncode"
});
return Q
}
}, {
key: "PlayM4_GetAudioEmcBuf",
value: function V() {
return this.aAudioEncBuffer
}
}, {
key: "PlayM4_RegisterAudEncodeCB",
value: function j(e) {
if (et) {}
if (e && typeof e === "function") {
this.AudEncodeDataCBFun = e;
return Q
} else {
return K
}
}
}, {
key: "downloadFile",
value: function X(e, t) {
var n = e;
if (!(e instanceof Blob || e instanceof File)) {
n = new Blob([e])
}
var i = window.URL.createObjectURL(n);
var r = window.document.createElement("a");
r.href = i;
r.download = t;
var o = document.createEvent("MouseEvents");
o.initEvent("click", true, true);
r.dispatchEvent(o)
}
}]);
return s
}()
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.StorageManager = undefined;
var l = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
var i = n(1);
var d = r(i);
var f = n(4);
function r(e) {
return e && e.__esModule ? e : {
"default": e
}
}
function h(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var c = "Web/RecordFiles/";
var v = "Web/PlaybackFiles/";
var p = 1e3;
var a = 1;
var m = 3001;
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
window.URL = window.URL || window.webkitURL;
var u = function() {
function r(e, t, n, i) {
h(this, r);
this.szUUID = e;
this.szFileName = t;
this.iStreamType = n;
this.szPath = "";
this.bStart = false;
this.aStreamList = [];
this.options = i
}
l(r, [{
key: "init",
value: function t() {
var n = this;
if (0 === this.iStreamType) {
this.szPath = c
} else if (1 === this.iStreamType) {
this.szPath = v
}
this.szPath += this.getDateDir();
var i = n.szPath.split("/");
var e = new Promise(function(t) {
window.requestFileSystem(window.TEMPORARY, n.options.iFileSize, function(e) {
n.createDir(e.root, i, function() {
t()
})
}, n.errorHandler)
});
return e
}
}, {
key: "getDateDir",
value: function e() {
return f.oTool.dateFormat(new Date, "yyyy-MM-dd")
}
}, {
key: "createDir",
value: function o(e, t, n) {
var i = this;
if (t.length) {
e.getDirectory(t[0], {
create: true
}, function(e) {
i.createDir(e, t.slice(1), n)
}, i.errorHandler)
} else {
n()
}
}
}, {
key: "errorHandler",
value: function n() {}
}, {
key: "writeFileHeader",
value: function a(n) {
var i = this;
window.requestFileSystem(window.TEMPORARY, i.options.iFileSize, function(e) {
e.root.getFile(i.szPath + "/" + i.szFileName, {
create: true
}, function(e) {
e.createWriter(function(e) {
e.onwriteend = function() {
i.bStart = true;
i.writeFile(e)
};
e.onerror = function() {};
e.seek(e.length);
var t = new Blob([n]);
e.write(t)
}, i.errorHandler)
}, i.errorHandler)
}, i.errorHandler)
}
}, {
key: "writeFileContent",
value: function i(e) {
this.aStreamList.push(e)
}
}, {
key: "writeFile",
value: function s(e) {
var t = this;
if (this.bStart) {
if (this.aStreamList.length > 0) {
var n = this.aStreamList.shift();
e.seek(e.length);
if (e.length >= this.options.iFileSize) {
if (this.options.cbEventHandler) {
this.options.cbEventHandler(m, this.szUUID)
}
return
}
var i = new Blob([n]);
e.write(i)
} else {
setTimeout(function() {
t.writeFile(e)
}, p)
}
}
}
}, {
key: "stopWriteFile",
value: function u() {
var i = this;
this.bStart = false;
this.aStreamList.length = 0;
var e = new Promise(function(t, n) {
window.requestFileSystem(window.TEMPORARY, i.options.iFileSize, function(e) {
e.root.getFile(i.szPath + "/" + i.szFileName, {
create: false
}, function(e) {
e.file(function(e) {
t();
f.oTool.downloadFile(e, e.name)
})
}, function() {
n()
})
}, function() {
n()
})
});
return e
}
}]);
return r
}();
var y = function() {
function s(e, t, n, i, r, o, a) {
h(this, s);
this.szBasePath = e;
this.szUUID = t;
this.szFileName = n;
this.aHeadBuf = new Uint8Array(i);
this.iPackType = r;
this.iStreamType = o;
this.oWorker = null;
this.oFileSystem = null;
this.options = a
}
l(s, [{
key: "init",
value: function t() {
var n = this;
var e = new Promise(function(e, t) {
n.initFileSystem().then(function() {
n.initWorker().then(function() {
e(n.szUUID)
}, function(e) {
t(e)
})
}, function(e) {
t(e)
})
});
return e
}
}, {
key: "initFileSystem",
value: function i() {
var n = this;
this.oFileSystem = new u(this.szUUID, this.szFileName, this.iStreamType, this.options);
var e = new Promise(function(e, t) {
n.oFileSystem.init().then(function() {
e()
}, function(e) {
t(e)
})
});
return e
}
}, {
key: "initWorker",
value: function n() {
var r = this;
var e = new Promise(function(i) {
r.oWorker = new Worker(r.szBasePath + "/systemTransform-worker.min.js");
r.oWorker.onmessage = function(e) {
var t = e.data;
if ("loaded" === t.type) {
r.oWorker.postMessage({
type: "create",
buf: r.aHeadBuf.buffer,
len: 40,
packType: r.iPackType
}, [r.aHeadBuf.buffer])
} else if ("created" === t.type) {
i()
} else if ("outputData" === t.type) {
var n = new Uint8Array(t.buf);
if (a === t.dType) {
r.oFileSystem.writeFileHeader(n)
} else {
r.oFileSystem.writeFileContent(n)
}
}
}
});
return e
}
}, {
key: "inputData",
value: function r(e) {
if (this.oWorker) {
var t = new Uint8Array(e);
this.oWorker.postMessage({
type: "inputData",
buf: t.buffer,
len: t.length
}, [t.buffer])
}
}
}, {
key: "stopRecord",
value: function o() {
var n = this;
var e = new Promise(function(e, t) {
if (n.oWorker) {
n.oWorker.postMessage({
type: "release"
})
} else {
t()
}
if (n.oFileSystem) {
n.oFileSystem.stopWriteFile().then(function() {
e()
}, function() {
t()
})
} else {
t()
}
});
return e
}
}]);
return s
}();
var o = function() {
var c = Symbol("STORAGELIST");
var e = function() {
function n(e, t) {
h(this, n);
this.szBasePath = e;
this[c] = {};
this.options = {
iFileSize: 1024 * 1024 * 1024
};
$.extend(this.options, t)
}
l(n, [{
key: "startRecord",
value: function f(e, t, n, i, r) {
var o = this;
var a = d["default"].v4();
var s = $.extend({}, this.options, r);
var u = new y(this.szBasePath, a, e, t, n, i, s);
var l = new Promise(function(t, n) {
u.init().then(function(e) {
o[c][e] = u;
t(e)
}, function(e) {
n(e)
})
});
return l
}
}, {
key: "inputData",
value: function i(e, t) {
var n = this[c][e];
if (n) {
n.inputData(t)
}
}
}, {
key: "stopRecord",
value: function t(i) {
var r = this;
var e = new Promise(function(e, t) {
var n = r[c][i];
if (n) {
n.stopRecord().then(function() {
delete r[c][i];
e()
}, function() {
t()
})
} else {
t()
}
});
return e
}
}]);
return n
}();
return e
}();
t.StorageManager = o
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var K = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
function d(e, t) {
if (!e) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
}
return t && (typeof t === "object" || typeof t === "function") ? t : e
}
function v(e, t) {
if (typeof t !== "function" && t !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof t)
}
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
enumerable: false,
writable: true,
configurable: true
}
});
if (t) Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t
}
function Q(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var i = function() {
var T = null;
var D = Symbol("CANVAS");
var x = Symbol("CONTEXT");
var M = Symbol("SHAPES");
var E = Symbol("DRAWSTATUS");
var z = Symbol("SHAPETYPE");
var O = Symbol("MAXSHAPENUMSUPPORT");
var F = Symbol("SHAPESTYLE");
var q = Symbol("POLYGONDRAWING");
var W = Symbol("LINEDRAWING");
var J = Symbol("CURRENTSHAPEINFO");
var L = Symbol("DRAWSHAPEMULTIONETIME");
var A = Symbol("EVENTCALLBACK");
var B = Symbol("DRAWEVENTCALLBACK");
var o = null;
function U(e) {
T[x].clearRect(0, 0, T.m_iCanvasWidth, T.m_iCanvasHeight);
if (o && e === "canvasRedraw") {
o.setPointInfo(T.resizeCanvasPoints(o.m_aPoint));
o.draw()
}
for (var t = 0, n = T[M].length; t < n; t++) {
if (e === "canvasRedraw") {
T[M][t].setPointInfo(T.resizeCanvasPoints(T[M][t].m_aPoint))
}
T[M][t].draw()
}
}
function H(e) {
var t = T[M].length;
if (t < T[O]) {
T[M].push(e);
T[J] = {};
o = null
}
}
function N() {
var s = false;
var u = 0;
var l = 0;
var f = "draw";
var c = null;
function r() {
var e = -1;
for (var t = 0, n = T[M].length; t < n; t++) {
if (T[M][t].m_bChoosed) {
e = t;
break
}
}
return e
}
T[D][0].oncontextmenu = function() {
return false
};
T[D][0].onselectstart = function() {
return false
};
T[D].unbind();
T[D].bind("mousedown", function(e) {
if (e.button === 2) {
if (T[q] && c) {
if (c.m_aPoint.length >= c.m_iMinClosed) {
c.m_bClosed = true;
T[q] = false;
c.setPointInfo(c.m_aPoint);
H(c);
U();
s = false;
if (!T[L] && 0 === c.m_iRedrawMode) {
T[E] = false
}
T[B] && T[B]({
id: +c.m_szId,
type: c.m_szType,
event: "drawEnd"
})
}
}
if (T[W] && c) {
if (c.m_aPoint.length >= c.m_iMinClosed) {
c.m_bClosed = true;
T[W] = false;
T[E] = false;
c.setPointInfo(c.m_aPoint);
H(c);
U()
}
}
} else if (e.button === 0) {
u = e.offsetX;
l = e.offsetY;
f = "draw";
if (!T[q]) {
var t = r();
if (t !== -1) {
if (T[M][t].inArc(e.offsetX, e.offsetY, 5)) {
f = "stretch"
}
}
if (f !== "stretch") {
for (var n = 0, i = T[M].length; n < i; n++) {
if (T[M][n].inShape(e.offsetX, e.offsetY) && T[M][n].m_iEditType !== 2) {
T[M][n].m_bChoosed = true;
T[M][n].getMouseDownPoints(e.offsetX, e.offsetY);
f = "drag";
T[B] && T[B]({
id: +T[M][n].m_szId,
type: T[M][n].m_szType,
event: "choosed"
})
} else {
T[M][n].m_bChoosed = false
}
}
}
if (f === "drag") {
T[D][0].style.cursor = "move"
} else {
T[D][0].style.cursor = "default"
}
if ("draw" === f && 1 === T[M].length && 1 === T[M][0].m_iRedrawMode && T[E]) {
T.deleteRepeatByIdAndType(T[M][0].m_szId, T[M][0].m_szType)
}
}
if (f === "draw") {
if (T[E]) {
if (T[O] <= T[M].length && T[z] !== "Grid" && T[z] !== "Point") {
return
}
if (T[z] === "Rect") {
c = new G;
c.m_szId = T[J].szId || "";
c.m_szTips = T[J].szTips || "";
c.m_iRedrawMode = T[J].iRedrawMode
} else if (T[z] === "Grid") {
if (T[M].length === 0) {
c = new j;
H(c)
}
} else if (T[z] === "Polygon") {
if (!T[q]) {
T[q] = true;
c = new Y;
c.m_szId = T[J].szId || "";
c.m_szTips = T[J].szTips || "";
c.m_iMinClosed = T[J].iMinClosed || 3;
c.m_iMaxPointNum = T[J].iMaxPointNum || 11;
c.m_iPolygonType = T[J].iPolygonType;
c.m_szDrawColor = T[J].szDrawColor;
c.m_szFillColor = T[J].szFillColor;
c.m_iTranslucent = T[J].iTranslucent;
c.m_iRedrawMode = T[J].iRedrawMode;
o = c
}
if (c.m_iPolygonType === 1) {
c.addPoint(u, l);
if (c.m_aPoint.length === c.m_iMaxPointNum) {
c.m_bClosed = true;
T[q] = false;
H(c);
U();
s = false;
if (!T[L] && 0 === c.m_iRedrawMode) {
T[E] = false
}
T[B] && T[B]({
id: +c.m_szId,
type: c.m_szType,
event: "drawEnd"
})
}
}
} else if (T[z] === "Point") {
T.clearShapeByType("Point");
c = new Z;
c.m_szId = T[J].szId || "";
c.m_szDrawColor = T[J].szDrawColor;
c.m_szTips = T[J].tips || "";
c.m_iEditType = T[J].editType || 0;
c.m_szPointType = T[J].type || "circle";
c.setPointInfo([
[u, l]
]);
H(c);
U()
} else if (T[z] === "Line") {
if (!T[W]) {
T[W] = true;
c = new X;
c.m_szId = T[J].szId || "";
c.m_szTips = T[J].szTips || "";
c.m_szDrawColor = T[J].szDrawColor;
c.m_iMinClosed = T[J].iMinClosed || 2;
c.m_iMaxPointNum = T[J].iMaxPointNum || 2;
c.m_iLineType = T[J].lineType || 0;
o = c
}
c.addPoint(u, l);
if (c.m_aPoint.length === c.m_iMaxPointNum) {
c.m_bClosed = true;
T[W] = false;
T[E] = false;
H(c);
U();
s = false;
T[B] && T[B]({
id: +c.m_szId,
type: c.m_szType,
event: "drawEnd"
})
}
}
}
}
s = true
}
});
T[D].bind("mousemove", function(e) {
if (!T[q] && !T[W]) {
var t = r();
if (t > -1) {
if (s) {
if (f === "drag") {
T[M][t].drag(e.offsetX, e.offsetY)
} else if (f === "stretch") {
T[M][t].stretch(e.offsetX, e.offsetY);
T[B] && T[B]({
id: +T[M][t].m_szId,
type: T[M][t].m_szType,
event: "stretch"
})
}
}
} else {
if (T[E]) {
if (s) {
if (T[z] === "Rect") {
c.move([
[u, l],
[e.offsetX, e.offsetY]
])
} else if (T[z] === "Grid") {
T[M][0].move(u, l, e.offsetX, e.offsetY)
}
}
}
}
} else if (T[q]) {
if (T[E]) {
if (s) {
if (T[z] === "Polygon" && c.m_iPolygonType === 0) {
c.m_bClosed = true
}
U();
c.move(e.offsetX, e.offsetY, u, l)
}
}
} else if (T[W]) {
if (T[E]) {
if (s) {
U();
c.move(e.offsetX, e.offsetY)
}
}
}
});
T[D].bind("mouseup", function(e) {
T[D][0].style.cursor = "default";
if (c !== null && typeof c !== "undefined" && f === "draw" && T[E]) {
if (T[z] === "Rect") {
if (Math.abs(e.offsetX - u) > 2 && Math.abs(e.offsetY - l) > 2) {
H(c);
if (!T[L] && 0 === c.m_iRedrawMode && 1 === T[O]) {
T[E] = false
}
T[B] && T[B]({
id: +c.m_szId,
type: c.m_szType,
event: "drawEnd"
})
}
if (T[A]) {
var t = {
id: +c.m_szId,
startPos: [],
endPos: [],
tips: c.m_szTips
};
if (c.m_aPoint[0] && c.m_aPoint[2]) {
try {
var n = void 0;
var i = void 0;
var r = void 0;
var o = void 0;
if (e.offsetX > u && e.offsetY > l) {
t.startPos = c.m_aPoint[0] || [e.offsetX, e.offsetY];
t.endPos = c.m_aPoint[2] || [e.offsetX, e.offsetY];
n = c.m_aPoint[0][0] / T.m_iCanvasWidth;
i = c.m_aPoint[0][1] / T.m_iCanvasHeight;
r = c.m_aPoint[2][0] / T.m_iCanvasWidth;
o = c.m_aPoint[2][1] / T.m_iCanvasHeight
} else {
t.startPos = c.m_aPoint[2] || [e.offsetX, e.offsetY];
t.endPos = c.m_aPoint[0] || [e.offsetX, e.offsetY];
n = c.m_aPoint[2][0] / T.m_iCanvasWidth;
i = c.m_aPoint[2][1] / T.m_iCanvasHeight;
r = c.m_aPoint[0][0] / T.m_iCanvasWidth;
o = c.m_aPoint[0][1] / T.m_iCanvasHeight
}
t.points = [
[n, i],
[r, i],
[r, o],
[n, o]
];
T[A] && T[A](t)
} catch (a) {}
}
T.clearAllShape()
}
c = null
} else if (T[z] === "Polygon" && c.m_iPolygonType === 0 && T[q]) {
if (Math.abs(e.offsetX - u) > 2 && Math.abs(e.offsetY - l) > 2) {
H(c);
T[q] = false;
if (!T[L] && 0 === c.m_iRedrawMode) {
T[E] = false
}
T[B] && T[B]({
id: +c.m_szId,
type: c.m_szType,
event: "drawEnd"
})
}
}
}
if (!T[q] && !T[W]) {
s = false
} else {
s = true
}
if (!T[q] || !T[W]) {
U()
}
});
T[D].bind("dblclick", function() {
if (T[E]) {
if (T[z] === "Grid") {
T[M][0].m_szGridMap = "fffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffcfffffc";
U()
}
}
if (o) {
o.m_aPoint.pop()
}
});
T[D].bind("mouseout", function() {
T[D][0].style.cursor = "default";
if (!T[q] && !T[W]) {
s = false
} else {
s = true
}
})
}
var e = function() {
function e() {
Q(this, e);
this.m_szId = "";
this.m_aPoint = [];
this.m_bChoosed = false;
this.m_szDrawColor = T[F].szDrawColor;
this.m_szFillColor = T[F].szFillColor;
this.m_iTranslucent = T[F].iTranslucent;
this.m_iIndexChoosePoint = -1;
this.m_iDriftStartX = 0;
this.m_iDriftStartY = 0;
this.m_oEdgePoints = {
top: {
x: 0,
y: 0
},
left: {
x: 0,
y: 0
},
right: {
x: 0,
y: 0
},
bottom: {
x: 0,
y: 0
}
};
this.m_szTips = "";
this.m_iEditType = 0;
this.m_iMinClosed = 3;
this.m_iMaxPointNum = 11;
this.m_bClosed = false;
this.m_iRedrawMode = 0
}
K(e, [{
key: "draw",
value: function t() {}
}, {
key: "drag",
value: function r(e, t) {
if (this.m_iEditType !== 2) {
var n = this.m_aPoint.length;
var i = 0;
for (i = 0; i < n; i++) {
if (this.m_aPoint[i][0] + e - this.m_iDriftStartX > T.m_iCanvasWidth || this.m_aPoint[i][1] + t - this.m_iDriftStartY > T.m_iCanvasHeight || this.m_aPoint[i][0] + e - this.m_iDriftStartX < 0 || this.m_aPoint[i][1] + t - this.m_iDriftStartY < 0) {
this.m_iDriftStartX = e;
this.m_iDriftStartY = t;
return
}
}
for (i = 0; i < n; i++) {
this.m_aPoint[i][0] = this.m_aPoint[i][0] + e - this.m_iDriftStartX;
this.m_aPoint[i][1] = this.m_aPoint[i][1] + t - this.m_iDriftStartY
}
this.m_iDriftStartX = e;
this.m_iDriftStartY = t;
this.setPointInfo(this.m_aPoint);
U()
}
}
}, {
key: "stretch",
value: function n(e, t) {
if (this.m_iEditType === 0) {
if (this.m_iIndexChoosePoint !== -1) {
this.m_aPoint[this.m_iIndexChoosePoint][0] = e;
this.m_aPoint[this.m_iIndexChoosePoint][1] = t
}
this.setPointInfo(this.m_aPoint);
U()
}
}
}, {
key: "inShape",
value: function a(e, t) {
var n = false;
var i = this.m_aPoint.length;
for (var r = 0, o = i - 1; r < i; o = r++) {
if (this.m_aPoint[r][1] > t !== this.m_aPoint[o][1] > t && e < (this.m_aPoint[o][0] - this.m_aPoint[r][0]) * (t - this.m_aPoint[r][1]) / (this.m_aPoint[o][1] - this.m_aPoint[r][1]) + this.m_aPoint[r][0]) {
n = !n
}
}
return n
}
}, {
key: "inArc",
value: function s(e, t, n) {
var i = false;
for (var r = 0, o = this.m_aPoint.length; r < o; r++) {
var a = Math.sqrt((e - this.m_aPoint[r][0]) * (e - this.m_aPoint[r][0]) + (t - this.m_aPoint[r][1]) * (t - this.m_aPoint[r][1]));
if (a < n) {
i = true;
this.m_iIndexChoosePoint = r;
break
}
}
return i
}
}, {
key: "getMouseDownPoints",
value: function i(e, t) {
this.m_iDriftStartX = e;
this.m_iDriftStartY = t
}
}, {
key: "getPointInfo",
value: function o() {
return this.m_aPoint
}
}, {
key: "setPointInfo",
value: function u(e) {
if (e !== null && typeof e !== "undefined" && e.length > 0) {
this.m_aPoint = e;
this.setEdgePoints(e)
}
}
}, {
key: "addPoint",
value: function l(e, t) {
if (this.m_aPoint.length < this.m_iMaxPointNum) {
this.m_aPoint.push([e, t])
}
if (this.m_aPoint.length === this.m_iMaxPointNum) {
this.setPointInfo(this.m_aPoint)
}
}
}, {
key: "setEdgePoints",
value: function f(e) {
for (var t = 0, n = e.length; t < n; t++) {
if (t === 0) {
this.m_oEdgePoints.top.x = e[t][0];
this.m_oEdgePoints.top.y = e[t][1];
this.m_oEdgePoints.left.x = e[t][0];
this.m_oEdgePoints.left.y = e[t][1];
this.m_oEdgePoints.right.x = e[t][0];
this.m_oEdgePoints.right.y = e[t][1];
this.m_oEdgePoints.bottom.x = e[t][0];
this.m_oEdgePoints.bottom.y = e[t][1]
} else {
if (e[t][1] < this.m_oEdgePoints.top.y) {
this.m_oEdgePoints.top.x = e[t][0];
this.m_oEdgePoints.top.y = e[t][1]
}
if (e[t][0] > this.m_oEdgePoints.right.x) {
this.m_oEdgePoints.right.x = e[t][0];
this.m_oEdgePoints.right.y = e[t][1]
}
if (e[t][1] > this.m_oEdgePoints.bottom.y) {
this.m_oEdgePoints.bottom.x = e[t][0];
this.m_oEdgePoints.bottom.y = e[t][1]
}
if (e[t][0] < this.m_oEdgePoints.left.x) {
this.m_oEdgePoints.left.x = e[t][0];
this.m_oEdgePoints.left.y = e[t][1]
}
}
}
}
}]);
return e
}();
var G = function(e) {
v(t, e);
function t() {
Q(this, t);
var e = d(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
e.m_szType = "Rect";
return e
}
K(t, [{
key: "setPointInfo",
value: function s(e) {
if (e !== null && typeof e !== "undefined") {
var t = e[0][0];
var n = e[0][1];
var i = e[0][0];
var r = e[0][1];
for (var o = 0, a = e.length; o < a; o++) {
if (t > e[o][0]) {
t = e[o][0]
}
if (n > e[o][1]) {
n = e[o][1]
}
if (i < e[o][0]) {
i = e[o][0]
}
if (r < e[o][1]) {
r = e[o][1]
}
}
this.m_aPoint = [
[t, n],
[i, n],
[i, r],
[t, r]
]
}
}
}, {
key: "draw",
value: function l() {
T[x].fillStyle = this.m_szFillColor;
T[x].strokeStyle = this.m_szDrawColor;
var e = this.m_aPoint[0][0];
var t = this.m_aPoint[0][1];
var n = this.m_aPoint[2][0] - e;
var i = this.m_aPoint[2][1] - t;
T[x].globalAlpha = this.m_iTranslucent;
T[x].fillRect(e, t, n, i);
T[x].globalAlpha = 1;
T[x].fillText(this.m_szTips, (e + this.m_aPoint[2][0]) / 2, (t + this.m_aPoint[2][1]) / 2);
if (this.m_bChoosed) {
var r = Math.round(n / 2);
var o = Math.round(i / 2);
if (this.m_iEditType === 0) {
var a = [e, e + r, e + n, e, e + n, e, e + r, e + n];
var s = [t, t, t, t + o, t + o, t + i, t + i, t + i];
for (var u = 0; u < 8; u++) {
T[x].beginPath();
T[x].arc(a[u], s[u], 3, 0, 360, false);
T[x].fillStyle = this.m_szDrawColor;
T[x].closePath();
T[x].fill()
}
}
}
T[x].strokeRect(e, t, n, i)
}
}, {
key: "stretch",
value: function n(e, t) {
if (this.m_iEditType === 0) {
if (this.m_iIndexChoosePoint === 0) {
if (e < this.m_aPoint[2][0] && t < this.m_aPoint[2][1]) {
this.m_aPoint[0][0] = e;
this.m_aPoint[0][1] = t;
this.m_aPoint[3][0] = e;
this.m_aPoint[1][1] = t
}
} else if (this.m_iIndexChoosePoint === 1) {
if (t < this.m_aPoint[2][1]) {
this.m_aPoint[0][1] = t;
this.m_aPoint[1][1] = t
}
} else if (this.m_iIndexChoosePoint === 2) {
if (e > this.m_aPoint[3][0] && t < this.m_aPoint[3][1]) {
this.m_aPoint[1][0] = e;
this.m_aPoint[1][1] = t;
this.m_aPoint[2][0] = e;
this.m_aPoint[0][1] = t
}
} else if (this.m_iIndexChoosePoint === 3) {
if (e < this.m_aPoint[2][0]) {
this.m_aPoint[0][0] = e;
this.m_aPoint[3][0] = e
}
} else if (this.m_iIndexChoosePoint === 4) {
if (e > this.m_aPoint[0][0]) {
this.m_aPoint[1][0] = e;
this.m_aPoint[2][0] = e
}
} else if (this.m_iIndexChoosePoint === 5) {
if (e < this.m_aPoint[1][0] && t > this.m_aPoint[1][1]) {
this.m_aPoint[3][0] = e;
this.m_aPoint[3][1] = t;
this.m_aPoint[0][0] = e;
this.m_aPoint[2][1] = t
}
} else if (this.m_iIndexChoosePoint === 6) {
if (t > this.m_aPoint[1][1]) {
this.m_aPoint[2][1] = t;
this.m_aPoint[3][1] = t
}
} else if (this.m_iIndexChoosePoint === 7) {
if (e > this.m_aPoint[0][0] && t > this.m_aPoint[0][1]) {
this.m_aPoint[2][0] = e;
this.m_aPoint[2][1] = t;
this.m_aPoint[1][0] = e;
this.m_aPoint[3][1] = t
}
}
U()
}
}
}, {
key: "move",
value: function o(e) {
U();
this.m_bChoosed = true;
var t = e[0][0];
var n = e[0][1];
var i = e[1][0];
var r = e[1][1];
this.setPointInfo([
[t, n],
[i, n],
[i, r],
[t, r]
]);
this.draw()
}
}, {
key: "inArc",
value: function h(e, t, n) {
var i = this.m_aPoint[0][0];
var r = this.m_aPoint[0][1];
var o = this.m_aPoint[2][0] - i;
var a = this.m_aPoint[2][1] - r;
var s = Math.round(o / 2);
var u = Math.round(a / 2);
var l = [i, i + s, i + o, i, i + o, i, i + s, i + o];
var f = [r, r, r, r + u, r + u, r + a, r + a, r + a];
for (var c = 0; c < 8; c++) {
var d = Math.sqrt((e - l[c]) * (e - l[c]) + (t - f[c]) * (t - f[c]));
if (d < n) {
this.m_iIndexChoosePoint = c;
return true
}
}
return false
}
}]);
return t
}(e);
var V = function(e) {
v(i, e);
function i(e, t) {
Q(this, i);
var n = d(this, (i.__proto__ || Object.getPrototypeOf(i)).call(this));
n.m_szType = "RectOSD";
n.m_szOSDType = "overlay-date";
n.m_szText = e || "";
n.m_szEnabled = t || "";
n.m_szDateStyle = "";
n.m_szClockType = "";
n.m_szDisplayWeek = "";
n.m_szId = "";
n.m_szAlignment = "0";
return n
}
K(i, [{
key: "draw",
value: function r() {
if (this.m_szEnabled === "true") {
var e = this.m_aPoint[0][0];
var t = this.m_aPoint[0][1];
var n = this.m_aPoint[2][0] - e;
var i = this.m_aPoint[2][1] - t;
T[x].beginPath();
T[x].strokeStyle = this.m_szDrawColor;
T[x].globalAlpha = 1;
T[x].rect(e, t, n, i);
T[x].font = "15px serif";
T[x].strokeText(this.m_szText, e, t + 15);
T[x].stroke()
}
}
}, {
key: "drag",
value: function o(e, t) {
var n = this.m_aPoint.length;
var i = 0;
if ("0" === this.m_szAlignment) {
for (i = 0; i < n; i++) {
if (this.m_aPoint[i][1] + t - this.m_iDriftStartY > T.m_iCanvasHeight || this.m_aPoint[i][0] + e - this.m_iDriftStartX < 0 || this.m_aPoint[i][1] + t - this.m_iDriftStartY < 0) {
this.m_iDriftStartX = e;
this.m_iDriftStartY = t;
return
}
}
for (i = 0; i < n; i++) {
this.m_aPoint[i][0] = this.m_aPoint[i][0] + e - this.m_iDriftStartX;
this.m_aPoint[i][1] = this.m_aPoint[i][1] + t - this.m_iDriftStartY
}
} else if ("1" === this.m_szAlignment || "2" === this.m_szAlignment) {
for (i = 0; i < n; i++) {
if (this.m_aPoint[i][1] + t - this.m_iDriftStartY > T.m_iCanvasHeight || this.m_aPoint[i][1] + t - this.m_iDriftStartY < 0) {
this.m_iDriftStartX = e;
this.m_iDriftStartY = t;
return
}
}
for (i = 0; i < n; i++) {
this.m_aPoint[i][1] = this.m_aPoint[i][1] + t - this.m_iDriftStartY
}
}
this.m_iDriftStartX = e;
this.m_iDriftStartY = t;
this.setEdgePoints(this.m_aPoint);
U()
}
}, {
key: "stretch",
value: function t() {}
}]);
return i
}(e);
var j = function(e) {
v(t, e);
function t() {
Q(this, t);
var e = d(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
e.m_szType = "Grid";
e.m_iGridColNum = 22;
e.m_iGridRowNum = 18;
e.m_szGridMap = "";
e.m_aAddGridMap = [];
return e
}
K(t, [{
key: "draw",
value: function l() {
var e = T.m_iCanvasWidth / this.m_iGridColNum;
var t = T.m_iCanvasHeight / this.m_iGridRowNum;
var n = "";
for (var i = 0; i < this.m_iGridRowNum; i++) {
var r = this.m_szGridMap.substring(i * 6, i * 6 + 6);
var o = parseInt("f" + r, 16).toString(2).split("").slice(4);
var a = "";
for (var s = 0; s < this.m_iGridColNum; s++) {
var u = "";
if (o[s] === "1") {
T[x].strokeStyle = this.m_szDrawColor;
T[x].globalAlpha = 1;
T[x].strokeRect(e * s, t * i, e, t);
u = "1"
} else {
u = "0"
}
if (this.m_aAddGridMap.length) {
if (this.m_aAddGridMap[i][s] === 1) {
T[x].strokeStyle = this.m_szDrawColor;
T[x].strokeRect(e * s, t * i, e, t);
u = "1"
}
}
a += u
}
n += parseInt("1111" + a + "00", 2).toString(16).substring(1)
}
this.m_szGridMap = n
}
}, {
key: "move",
value: function p(e, t, n, i) {
var r = T.m_iCanvasWidth / this.m_iGridColNum;
var o = T.m_iCanvasHeight / this.m_iGridRowNum;
var a = Math.floor(e / r);
var s = Math.floor(t / o);
var u = Math.floor(Math.abs(n - e) / r);
var l = Math.floor(Math.abs(i - t) / o);
var f = 1;
var c = 1;
if (n - e > 0) {
f = 1
} else {
f = -1
}
if (i - t > 0) {
c = 1
} else {
c = -1
}
var d = [];
for (var h = 0; h < this.m_iGridRowNum; h++) {
d[h] = [];
for (var v = 0; v < this.m_iGridColNum; v++) {
if (f === 1) {
if (c === 1) {
if (h >= s && h <= s + l && v >= a && v <= a + u) {
d[h][v] = 1
} else {
d[h][v] = 0
}
} else {
if (h <= s && h >= s - l && v >= a && v <= a + u) {
d[h][v] = 1
} else {
d[h][v] = 0
}
}
} else {
if (c === 1) {
if (h >= s && h <= s + l && v <= a && v >= a - u) {
d[h][v] = 1
} else {
d[h][v] = 0
}
} else {
if (h <= s && h >= s - l && v <= a && v >= a - u) {
d[h][v] = 1
} else {
d[h][v] = 0
}
}
}
}
}
this.m_aAddGridMap = d;
this.draw()
}
}]);
return t
}(e);
var X = function(e) {
v(t, e);
function t() {
Q(this, t);
var e = d(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
e.m_szType = "Line";
e.m_iLineType = 0;
e.m_iDirection = 0;
e.m_iArrowType = 0;
e.m_aCrossArrowPoint = [];
return e
}
K(t, [{
key: "draw",
value: function n() {
if (this.m_iLineType === 0 || this.m_iLineType === 2) {
this.drawNormalLine()
} else if (this.m_iLineType === 1) {
this.drawArrowLine()
} else if (this.m_iLineType === 3) {
this.drawCrossLine()
} else if (this.m_iLineType === 4) {
this.drawLineCount()
}
}
}, {
key: "drawNormalLine",
value: function r() {
T[x].globalAlpha = 1;
if (this.m_aPoint.length > 0) {
T[x].beginPath();
T[x].strokeStyle = this.m_szDrawColor;
T[x].lineWidth = 2;
T[x].moveTo(this.m_aPoint[0][0], this.m_aPoint[0][1]);
for (var e = 1, t = this.m_aPoint.length; e < t; e++) {
T[x].lineTo(this.m_aPoint[e][0], this.m_aPoint[e][1])
}
T[x].stroke();
if (this.m_bChoosed) {
for (var n = 0, i = this.m_aPoint.length; n < i; n++) {
T[x].beginPath();
T[x].fillStyle = this.m_szDrawColor;
T[x].arc(this.m_aPoint[n][0], this.m_aPoint[n][1], 3, 0, Math.PI * 2, true);
T[x].closePath();
T[x].fill()
}
}
if (this.m_szTips !== "") {
T[x].strokeStyle = this.m_szDrawColor;
T[x].fillStyle = this.m_szDrawColor;
T[x].fillText(this.m_szTips, this.m_aPoint[0][0] + 10, this.m_aPoint[0][1] + 4)
}
}
}
}, {
key: "drawArrowLine",
value: function y(e, t, n, i, r, o, a, s) {
o = typeof o !== "undefined" ? o : 30;
a = typeof a !== "undefined" ? a : 10;
s = typeof s !== "undefined" ? s : 1;
var u = Math.atan2(n - r, t - i) * 180 / Math.PI;
var l = (u + o) * Math.PI / 180;
var f = (u - o) * Math.PI / 180;
var c = a * Math.cos(l);
var d = a * Math.sin(l);
var h = a * Math.cos(f);
var v = a * Math.sin(f);
T[x].save();
T[x].beginPath();
var p = t - c;
var m = n - d;
T[x].moveTo(p, m);
T[x].lineTo(t, n);
p = t - h;
m = n - v;
T[x].lineTo(p, m);
T[x].moveTo(t, n);
T[x].lineTo(i, r);
if (e === 1) {
p = i + c;
m = r + d;
T[x].moveTo(p, m);
T[x].lineTo(i, r);
p = i + h;
m = r + v;
T[x].lineTo(p, m)
}
T[x].strokeStyle = this.m_szDrawColor;
T[x].lineWidth = s;
T[x].stroke();
T[x].restore()
}
}, {
key: "drawCrossLine",
value: function h() {
this.drawNormalLine();
var e = (this.m_aPoint[0][0] + this.m_aPoint[1][0]) / 2;
var t = (this.m_aPoint[0][1] + this.m_aPoint[1][1]) / 2;
var n = Math.atan2(t - this.m_aPoint[0][1], e - this.m_aPoint[0][0]) * 180 / Math.PI;
var i = (n + 90) * Math.PI / 180;
var r = (n - 90) * Math.PI / 180;
var o = 25 * Math.cos(i);
var a = 25 * Math.sin(i);
var s = 25 * Math.cos(r);
var u = 25 * Math.sin(r);
var l = 0;
var f = 0;
l = e - o;
f = t - a;
var c = 0;
var d = 0;
if (this.m_iDirection === 0) {
c = -10;
d = -15
} else if (this.m_iDirection === 1) {
c = 10;
d = 10
} else {
c = 10;
d = -15
}
if (this.m_iDirection !== 0) {
this.drawArrowLine(0, l, f, e, t)
}
T[x].strokeStyle = this.m_szDrawColor;
T[x].font = "8px";
T[x].strokeText("A", l + c, f + 4);
l = e - s;
f = t - u;
if (this.m_iDirection !== 1) {
this.drawArrowLine(0, l, f, e, t)
}
T[x].strokeStyle = this.m_szDrawColor;
T[x].font = "8px";
T[x].strokeText("B", l + d, f + 4)
}
}, {
key: "drawLineCount",
value: function c() {
this.drawNormalLine();
var e = (this.m_aPoint[0][0] + this.m_aPoint[1][0]) / 2;
var t = (this.m_aPoint[0][1] + this.m_aPoint[1][1]) / 2;
var n = Math.atan2(t - this.m_aPoint[0][1], e - this.m_aPoint[0][0]) * 180 / Math.PI;
var i = (n + 90) * Math.PI / 180;
var r = (n - 90) * Math.PI / 180;
var o = 25 * Math.cos(i);
var a = 25 * Math.sin(i);
var s = 25 * Math.cos(r);
var u = 25 * Math.sin(r);
var l = 0;
var f = 0;
l = e - o;
f = t - a;
if (this.m_iArrowType === 1) {
l = e - s;
f = t - u;
this.drawArrowLine(0, l, f, e, t)
} else if (this.m_iArrowType === 0) {
this.drawArrowLine(0, l, f, e, t)
}
this.m_aCrossArrowPoint = [
[e, t],
[l, f]
]
}
}, {
key: "inShape",
value: function u(e, t) {
var n = false;
for (var i = 0, r = this.m_aPoint.length - 1; i < r; i++) {
var o = Math.sqrt((this.m_aPoint[i + 1][0] - this.m_aPoint[i][0]) * (this.m_aPoint[i + 1][0] - this.m_aPoint[i][0]) + (this.m_aPoint[i + 1][1] - this.m_aPoint[i][1]) * (this.m_aPoint[i + 1][1] - this.m_aPoint[i][1]));
var a = Math.sqrt((e - this.m_aPoint[i][0]) * (e - this.m_aPoint[i][0]) + (t - this.m_aPoint[i][1]) * (t - this.m_aPoint[i][1]));
var s = Math.sqrt((e - this.m_aPoint[i + 1][0]) * (e - this.m_aPoint[i + 1][0]) + (t - this.m_aPoint[i + 1][1]) * (t - this.m_aPoint[i + 1][1]));
if (a + s - o < 1) {
n = true
}
}
return n
}
}, {
key: "move",
value: function o(e, t) {
if (this.m_aPoint.length < this.m_iMaxPointNum && this.m_aPoint.length > 0) {
T[x].strokeStyle = this.m_szDrawColor;
T[x].globalAlpha = 1;
var n = 0;
var i = 0;
for (n = 0, i = this.m_aPoint.length; n < i; n++) {
T[x].beginPath();
T[x].arc(this.m_aPoint[n][0], this.m_aPoint[n][1], 3, 0, 360, false);
T[x].fillStyle = this.m_szDrawColor;
T[x].closePath();
T[x].fill()
}
T[x].beginPath();
T[x].moveTo(this.m_aPoint[0][0], this.m_aPoint[0][1]);
for (n = 0, i = this.m_aPoint.length; n < i; n++) {
if (n !== 0) {
T[x].lineTo(this.m_aPoint[n][0], this.m_aPoint[n][1])
}
}
T[x].lineTo(e, t);
T[x].stroke()
}
}
}]);
return t
}(e);
var Y = function(e) {
v(t, e);
function t() {
Q(this, t);
var e = d(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
e.m_szType = "Polygon";
e.m_iPolygonType = 1;
return e
}
K(t, [{
key: "setPointInfo",
value: function s(e) {
if (e !== null && typeof e !== "undefined") {
if (this.m_iPolygonType === 0) {
var t = e[0][0];
var n = e[0][1];
var i = e[0][0];
var r = e[0][1];
for (var o = 0, a = e.length; o < a; o++) {
if (t > e[o][0]) {
t = e[o][0]
}
if (n > e[o][1]) {
n = e[o][1]
}
if (i < e[o][0]) {
i = e[o][0]
}
if (r < e[o][1]) {
r = e[o][1]
}
}
this.m_aPoint = [
[t, n],
[i, n],
[i, r],
[t, r]
]
} else if (this.m_iPolygonType === 1) {
this.m_aPoint = e
} else {
this.m_aPoint = e
}
this.setEdgePoints(e)
}
}
}, {
key: "draw",
value: function n() {
if (this.m_aPoint.length > 0) {
T[x].fillStyle = this.m_szFillColor;
T[x].strokeStyle = this.m_szDrawColor;
T[x].globalAlpha = 1;
var e = 0;
var t = 0;
if (this.m_bChoosed) {
for (e = 0, t = this.m_aPoint.length; e < t; e++) {
T[x].beginPath();
T[x].arc(this.m_aPoint[e][0], this.m_aPoint[e][1], 3, 0, 360, false);
T[x].fillStyle = this.m_szDrawColor;
T[x].closePath();
T[x].fill()
}
}
T[x].beginPath();
T[x].moveTo(this.m_aPoint[0][0], this.m_aPoint[0][1]);
for (e = 0, t = this.m_aPoint.length; e < t; e++) {
if (e !== 0) {
T[x].lineTo(this.m_aPoint[e][0], this.m_aPoint[e][1])
}
}
T[x].stroke();
if (this.m_bClosed) {
T[x].fillText(this.m_szTips, (this.m_oEdgePoints.left.x + this.m_oEdgePoints.right.x) / 2, (this.m_oEdgePoints.top.y + this.m_oEdgePoints.bottom.y) / 2);
T[x].closePath();
T[x].stroke();
T[x].globalAlpha = this.m_iTranslucent;
T[x].fill()
}
}
}
}, {
key: "move",
value: function f(e, t, n, i) {
if (this.m_iPolygonType === 1) {
if (this.m_aPoint.length < this.m_iMaxPointNum && this.m_aPoint.length > 0) {
T[x].fillStyle = this.m_szFillColor;
T[x].strokeStyle = this.m_szDrawColor;
T[x].globalAlpha = 1;
var r = 0;
var o = 0;
for (r = 0, o = this.m_aPoint.length; r < o; r++) {
T[x].beginPath();
T[x].arc(this.m_aPoint[r][0], this.m_aPoint[r][1], 3, 0, 360, false);
T[x].fillStyle = this.m_szDrawColor;
T[x].closePath();
T[x].fill()
}
T[x].beginPath();
T[x].moveTo(this.m_aPoint[0][0], this.m_aPoint[0][1]);
for (r = 0, o = this.m_aPoint.length; r < o; r++) {
if (r !== 0) {
T[x].lineTo(this.m_aPoint[r][0], this.m_aPoint[r][1])
}
}
T[x].lineTo(e, t);
T[x].closePath();
T[x].stroke()
}
} else if (this.m_iPolygonType === 0) {
this.m_bChoosed = true;
var a = n;
var s = i;
var u = e;
var l = t;
this.setPointInfo([
[a, s],
[u, s],
[u, l],
[a, l]
]);
this.draw()
}
}
}, {
key: "stretch",
value: function i(e, t) {
if (this.m_iEditType === 0) {
if (this.m_iPolygonType === 1) {
if (this.m_iIndexChoosePoint !== -1) {
this.m_aPoint[this.m_iIndexChoosePoint][0] = e;
this.m_aPoint[this.m_iIndexChoosePoint][1] = t
}
} else {
if (this.m_iIndexChoosePoint === 0) {
if (e < this.m_aPoint[2][0] && t < this.m_aPoint[2][1]) {
this.m_aPoint[0][0] = e;
this.m_aPoint[0][1] = t;
this.m_aPoint[3][0] = e;
this.m_aPoint[1][1] = t
}
} else if (this.m_iIndexChoosePoint === 1) {
if (e > this.m_aPoint[3][0] && t < this.m_aPoint[3][1]) {
this.m_aPoint[1][0] = e;
this.m_aPoint[1][1] = t;
this.m_aPoint[2][0] = e;
this.m_aPoint[0][1] = t
}
} else if (this.m_iIndexChoosePoint === 2) {
if (e > this.m_aPoint[0][0] && t > this.m_aPoint[0][1]) {
this.m_aPoint[2][0] = e;
this.m_aPoint[2][1] = t;
this.m_aPoint[1][0] = e;
this.m_aPoint[3][1] = t
}
} else if (this.m_iIndexChoosePoint === 3) {
if (e < this.m_aPoint[1][0] && t > this.m_aPoint[1][1]) {
this.m_aPoint[3][0] = e;
this.m_aPoint[3][1] = t;
this.m_aPoint[0][0] = e;
this.m_aPoint[2][1] = t
}
}
}
this.setPointInfo(this.m_aPoint);
U()
}
}
}]);
return t
}(e);
var Z = function(e) {
v(t, e);
function t() {
Q(this, t);
var e = d(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));
e.m_szType = "Point";
e.m_szId = "";
e.m_szPointType = "circle";
return e
}
K(t, [{
key: "draw",
value: function n() {
if (this.m_szPointType === "circle") {
this.drawCirclePoint()
} else if (this.m_szPointType === "cross") {
this.drawcrossPoint()
}
}
}, {
key: "drawCirclePoint",
value: function i() {
T[x].beginPath();
T[x].fillStyle = this.m_szDrawColor;
T[x].globalAlpha = 1;
T[x].arc(this.m_aPoint[0][0], this.m_aPoint[0][1], 10, 0, Math.PI * 2, true);
T[x].closePath();
T[x].fill()
}
}, {
key: "drawcrossPoint",
value: function r() {
T[x].beginPath();
T[x].strokeStyle = this.m_szDrawColor;
T[x].fillStyle = this.m_szDrawColor;
T[x].lineWidth = 2;
T[x].globalAlpha = 1;
T[x].moveTo(this.m_aPoint[0][0] - 12, this.m_aPoint[0][1]);
T[x].lineTo(this.m_aPoint[0][0] + 12, this.m_aPoint[0][1]);
T[x].moveTo(this.m_aPoint[0][0], this.m_aPoint[0][1] - 12);
T[x].lineTo(this.m_aPoint[0][0], this.m_aPoint[0][1] + 12);
T[x].fillText(this.m_szTips, this.m_aPoint[0][0] + 12, this.m_aPoint[0][1] - 12);
T[x].closePath();
T[x].stroke()
}
}, {
key: "stretch",
value: function o() {}
}, {
key: "inShape",
value: function a(e, t) {
var n = false;
if (this.m_szPointType === "cross") {
if (e <= this.m_aPoint[0][0] + 4 && e >= this.m_aPoint[0][0] - 4 && t <= this.m_aPoint[0][1] + 12 && t >= this.m_aPoint[0][1] - 12) {
n = true
} else if (t <= this.m_aPoint[0][1] + 4 && t >= this.m_aPoint[0][1] - 4 && e <= this.m_aPoint[0][0] + 12 && e >= this.m_aPoint[0][0] - 12) {
n = true
}
}
return n
}
}]);
return t
}(e);
var t = function() {
function t(e) {
Q(this, t);
T = this;
this[D] = $("#" + e);
this.szCanvasId = e;
this[x] = this[D][0].getContext("2d");
this[M] = [];
this[E] = false;
this[z] = "";
this[O] = 10;
this[L] = true;
this[J] = {};
this[A] = null;
this[F] = {
szDrawColor: "#ff0000",
szFillColor: "#343434",
iTranslucent: .7
};
this[q] = false;
this[W] = false;
this.m_iCanvasWidth = this[D].width() || document.getElementById(this.szCanvasId).width;
this.m_iCanvasHeight = this[D].height() || document.getElementById(this.szCanvasId).height;
this.m_iHorizontalResolution = 0;
this.m_iVerticalResolution = 0;
this.m_szDisplayMode = "";
this.m_szVideoFormat = "";
this.m_iHistoryCanvasWidth = this[D].width();
this.m_iHistoryCanvasHeight = this[D].height();
N();
this[M].length = 0
}
K(t, [{
key: "_getCanvasPoints",
value: function r(e) {
var t = e.length;
var n = [];
for (var i = 0; i < t; i++) {
n.push([e[i][0] * this.m_iCanvasWidth, e[i][1] * this.m_iCanvasHeight])
}
return n
}
}, {
key: "_getNormalizedPoints",
value: function o(e) {
var t = e.length;
var n = [];
for (var i = 0; i < t; i++) {
n.push([e[i][0] / this.m_iCanvasWidth, e[i][1] / this.m_iCanvasHeight])
}
return n
}
}, {
key: "resizeCanvasPoints",
value: function a(e) {
var t = e.length;
var n = [];
for (var i = 0; i < t; i++) {
e[i][0] = e[i][0] * this.m_iCanvasWidth / this.m_iHistoryCanvasWidth;
e[i][1] = e[i][1] * this.m_iCanvasHeight / this.m_iHistoryCanvasHeight;
n.push([e[i][0], e[i][1]])
}
return n
}
}, {
key: "setDrawMutiShapeOneTime",
value: function n(e) {
this[L] = e
}
}, {
key: "setMaxShapeSupport",
value: function i(e) {
this[O] = e
}
}, {
key: "getMaxShapeSupport",
value: function e() {
return this[O]
}
}, {
key: "setDrawStatus",
value: function s(e, t) {
this[E] = e;
if (t && e) {
this[A] = t
}
if (!e) {
this[A] = null
}
}
}, {
key: "setShapeType",
value: function u(e) {
this[z] = e;
U()
}
}, {
key: "setCurrentShapeInfo",
value: function l(e) {
for (var t = 0, n = this[M].length; t < n; t++) {
if (this[M][t].m_szId === e.szId) {
this[M].splice(t, 1);
break
}
}
U();
this[J] = e || {
szId: "",
szTips: "",
iMinClosed: 3,
iMaxPointNum: 11,
iPolygonType: 1,
iRedrawMode: 0
}
}
}, {
key: "getShapeType",
value: function f() {
return this[z]
}
}, {
key: "getAllShapesInfo",
value: function c() {
var e = [];
for (var t = 0, n = this[M].length; t < n; t++) {
if (this[M][t].m_szType === "Grid") {
e.push({
szType: this[M][t].m_szType,
szGridMap: this[M][t].m_szGridMap,
iGridColNum: this[M][t].m_iGridColNum,
iGridRowNum: this[M][t].m_iGridRowNum
})
} else if (this[M][t].m_szType === "RectOSD") {
e.push({
szType: this[M][t].m_szType,
szText: this[M][t].m_szText,
szEnabled: this[M][t].m_szEnabled,
szOSDType: this[M][t].m_szOSDType,
iPositionX: this[M][t].m_aPoint[0][0] / this.m_iCanvasWidth,
iPositionY: this[M][t].m_aPoint[0][1] / this.m_iCanvasHeight,
szDateStyle: this[M][t].m_szDateStyle,
szClockType: this[M][t].m_szClockType,
szDisplayWeek: this[M][t].m_szDisplayWeek,
szId: this[M][t].m_szId,
szAlignment: this[M][t].m_szAlignment
})
} else {
e.push({
szType: this[M][t].m_szType,
aPoint: this._getNormalizedPoints(this[M][t].m_aPoint),
szId: this[M][t].m_szId,
bChoosed: this[M][t].m_bChoosed
})
}
}
return e
}
}, {
key: "deleteRepeatByIdAndType",
value: function d(e, t) {
var n = this.getAllShapesInfo();
var i = n.length;
if (i > 0) {
for (var r = 0; r < i; r++) {
if (n[r].szType === t) {
if (Number(n[r].szId) === Number(e)) {
this.deleteShape(r)
}
}
}
}
}
}, {
key: "getShapesInfoByType",
value: function h(e) {
var t = [];
for (var n = 0, i = this[M].length; n < i; n++) {
if (this[M][n].m_szType === e) {
if (this[M][n].m_szType === "Grid") {
t.push({
gridMap: this[M][n].m_szGridMap,
gridColNum: this[M][n].m_iGridColNum,
gridRowNum: this[M][n].m_iGridRowNum
})
} else if (this[M][n].m_szType === "RectOSD") {
t.push({
szType: this[M][n].m_szType,
szText: this[M][n].m_szText,
szEnabled: this[M][n].m_szEnabled,
szOSDType: this[M][n].m_szOSDType,
iPositionX: this[M][n].m_aPoint[0][0] / this.m_iCanvasWidth,
iPositionY: this[M][n].m_aPoint[0][1] / this.m_iCanvasHeight,
szDateStyle: this[M][n].m_szDateStyle,
szClockType: this[M][n].m_szClockType,
szDisplayWeek: this[M][n].m_szDisplayWeek,
szId: this[M][n].m_szId,
szAlignment: this[M][n].m_szAlignment
})
} else if (e === "Polygon") {
t.push({
id: this[M][n].m_szId,
points: this._getNormalizedPoints(this[M][n].m_aPoint),
closed: this[M][n].m_bClosed,
tips: this[M][n].m_szTips,
drawColor: this[M][n].m_szDrawColor
})
} else if (e === "Line") {
var r = {
id: this[M][n].m_szId,
points: this._getNormalizedPoints(this[M][n].m_aPoint),
tips: this[M][n].m_szTips,
closed: this[M][n].m_bClosed,
lineType: this[M][n].m_iLineType,
direction: this[M][n].m_iDirection
};
if (r.lineType === 1 || r.lineType === 4) {
r.direction = this[M][n].m_iArrowType
}
if (r.lineType === 4) {
r.pdcArrow = this._getNormalizedPoints(this[M][n].m_aCrossArrowPoint)
}
t.push(r)
} else if (e === "Rect") {
t.push({
id: this[M][n].m_szId,
points: this._getNormalizedPoints(this[M][n].m_aPoint),
tips: this[M][n].m_szTips
})
} else if (e === "Point") {
t.push({
id: this[M][n].m_szId,
points: this._getNormalizedPoints(this[M][n].m_aPoint)[0],
tips: this[M][n].m_szTips,
type: this[M][n].m_szPointType,
drawColor: this[M][n].m_szDrawColor
})
} else {
t.push({
points: this._getNormalizedPoints(this[M][n].m_aPoint)
})
}
}
}
return t
}
}, {
key: "setShapesInfoByType",
value: function v(e, t) {
if (!t) {
t = []
}
var n = null;
if (e === "Rect" || e === "Polygon" || e === "Line" || e === "Point") {
for (var i = 0, r = t.length; i < r; i++) {
if (e === "Rect") {
if ("" !== t[i].id) {
this.deleteRepeatByIdAndType(t[i].id, "Rect")
}
n = new G;
n.m_szId = t[i].id;
n.m_iEditType = t[i].editType || 0;
n.m_szTips = t[i].tips;
n.m_szDrawColor = t[i].drawColor;
n.m_szFillColor = t[i].fillColor || t[i].drawColor;
n.m_iTranslucent = t[i].translucent;
n.m_iRedrawMode = t[i].redrawMode;
n.m_bClosed = t[i].closed || true
} else if (e === "Polygon") {
if ("" !== t[i].id) {
this.deleteRepeatByIdAndType(t[i].id, "Polygon")
}
n = new Y;
n.m_szTips = t[i].tips;
n.m_szId = t[i].id || "";
n.m_iMinClosed = t[i].minPointSupport || 3;
n.m_iMaxPointNum = t[i].maxPointSupport || 11;
n.m_iEditType = t[i].editType || 0;
n.m_szDrawColor = t[i].drawColor;
n.m_szFillColor = t[i].fillColor || t[i].drawColor;
n.m_iTranslucent = t[i].translucent;
n.m_iRedrawMode = t[i].redrawMode;
n.m_bClosed = t[i].closed || true
} else if (e === "Line") {
if ("" !== t[i].id) {
this.deleteRepeatByIdAndType(t[i].id, "Line")
}
n = new X;
n.m_iLineType = t[i].lineType;
n.m_szTips = t[i].tips;
n.m_szId = t[i].id;
n.m_bClosed = t[i].redrawMode || true;
n.m_iDirection = parseInt(t[i].direction, 10);
if (t[i].lineType === 1 || t[i].lineType === 4) {
n.m_iArrowType = parseInt(t[i].direction, 10)
}
n.m_szDrawColor = t[i].drawColor
} else if (e === "Point") {
if ("" !== t[i].id) {
this.deleteRepeatByIdAndType(t[i].id, "Point")
}
n = new Z;
n.m_szId = t[i].id;
n.m_szDrawColor = t[i].drawColor;
n.m_szTips = t[i].tips || "";
n.m_iEditType = t[i].editType || 0;
n.m_szPointType = t[i].type || "circle"
}
n.setPointInfo(this._getCanvasPoints(t[i].points));
if (i === 0) {
n.m_bChoosed = true
}
H(n)
}
} else if (e === "Grid") {
n = new j;
n.m_szGridMap = t[0].gridMap || "";
n.m_iGridColNum = t[0].gridColNum || 22;
n.m_iGridRowNum = t[0].gridRowNum || 18;
H(n)
}
U()
}
}, {
key: "addOSDShape",
value: function p(e, t, n, i, r) {
var o = n * this.m_iCanvasWidth;
var a = i * this.m_iCanvasHeight;
if (!o && !a) {
o = 0;
a = 0
}
if (!r) {
r = {}
}
var s = new V(e, t);
var u = e.replace(/[^x00-xff]/g, "rr").length * 10;
s.m_szOSDType = r.szOSDType || "";
s.m_szDateStyle = r.szDateStyle || "";
s.m_szClockType = r.szClockType || "";
s.m_szDisplayWeek = r.szDisplayWeek || "";
s.m_szId = r.szId || "";
s.m_szAlignment = "" + r.szAlignment || "0";
if ("0" === s.m_szAlignment) {
s.m_aPoint = [
[o, a],
[u + o, a],
[u + o, a + 20],
[o, a + 20]
]
} else if ("1" === s.m_szAlignment) {
s.m_aPoint = [
[0, a],
[u, a],
[u, a + 20],
[0, a + 20]
]
} else if ("2" === s.m_szAlignment) {
s.m_aPoint = [
[this.m_iCanvasWidth - u, a],
[this.m_iCanvasWidth, a],
[this.m_iCanvasWidth, a + 20],
[this.m_iCanvasWidth - u, a + 20]
]
} else {
s.m_aPoint = [
[o, a],
[u + o, a],
[u + o, a + 20],
[o, a + 20]
]
}
H(s);
U()
}
}, {
key: "selectShapeById",
value: function m(e, t) {
for (var n = 0, i = T[M].length; n < i; n++) {
if (e === T[M][n].m_szType) {
if (t === T[M][n].m_szId + "") {
T[M][n].m_bChoosed = true
} else {
T[M][n].m_bChoosed = false
}
}
}
U()
}
}, {
key: "setCanvasSize",
value: function y(e, t) {
if (e > 0 && t > 0) {
this.m_iCanvasWidth = e;
this.m_iCanvasHeight = t;
U()
}
}
}, {
key: "setDrawStyle",
value: function S(e, t, n) {
this[F] = {
szDrawColor: e,
szFillColor: t,
iTranslucent: n
}
}
}, {
key: "clearAllShape",
value: function g() {
this[M].length = 0;
T[q] = false;
T[W] = false;
U()
}
}, {
key: "clearShapeByType",
value: function _(e) {
var t = this[M].length;
for (var n = t; n > 0; n--) {
if (this[M][n - 1].m_szType === e) {
if (e === "Grid") {
this[M][n - 1].m_szGridMap = "";
this[M][n - 1].m_aAddGridMap = []
} else {
this[M].splice(n - 1, 1)
}
}
}
if ("Polygon" === e) {
T[q] = false
}
if ("Line" === e) {
T[W] = false
}
if (e === "All" || e === "AllWindows") {
this[M].length = 0
}
U()
}
}, {
key: "deleteChoosedShape",
value: function P() {
var e = this.getAllShapesInfo();
var t = e.length;
if (t > 0) {
for (var n = 0; n < t; n++) {
if (e[n].bChoosed) {
this.deleteShape(n);
return +e[n].szId
}
}
return -1
}
return -1
}
}, {
key: "deleteTargetShape",
value: function w(e, t) {
var n = this.getAllShapesInfo();
var i = n.length;
if (i > 0) {
for (var r = 0; r < i; r++) {
if (n[r].szType === e) {
if (n[r].szId === t) {
this.deleteShape(r);
break
}
}
}
}
}
}, {
key: "deleteShape",
value: function b(e) {
if (this[M].length > e) {
this[M].splice(e, 1)
}
U()
}
}, {
key: "updateCanvas",
value: function k(e) {
this[D] = $("#" + e);
this.szCanvasId = e;
this[x] = this[D][0].getContext("2d");
this.m_iCanvasWidth = this[D].width() || document.getElementById(this.szCanvasId).width;
this.m_iCanvasHeight = this[D].height() || document.getElementById(this.szCanvasId).height;
N()
}
}, {
key: "resizeCanvas",
value: function C() {
this.m_iHistoryCanvasWidth = this.m_iCanvasWidth;
this.m_iHistoryCanvasHeight = this.m_iCanvasHeight;
this.m_iCanvasWidth = this[D].width() || document.getElementById(this.szCanvasId).width;
this.m_iCanvasHeight = this[D].height() || document.getElementById(this.szCanvasId).height
}
}, {
key: "canvasRedraw",
value: function R() {
U("canvasRedraw")
}
}, {
key: "setDrawEventCallback",
value: function I(e) {
this[B] = e
}
}]);
return t
}();
return t
}();
t.ESCanvas = i
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.LocalServiceControl = undefined;
var ht = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
var vt = n(29);
var pt = n(2);
function mt(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var i = function() {
var e = function() {
function r(e) {
mt(this, r);
var t = this;
var n = {
szPluginContainer: "",
cbConnectSuccess: null,
cbConnectError: null,
cbConnectClose: null
};
this.oOptions = $.extend(n, e);
if (this.oOptions.szIframeId && $("#" + this.oOptions.szIframeId).length) {
this.oOptions.oPluginContainer = $("#" + this.oOptions.szPluginContainer, $("#" + this.oOptions.szIframeId)[0].contentWindow.document)
} else {
this.oOptions.oPluginContainer = $("#" + this.oOptions.szPluginContainer)
}
this.bFreeze = false;
this.bFocus = true;
this.bEmbed = pt.oUtils.getCreateWndMode();
this.szWndId = "";
this.iCreateWndTimer = -1;
this.iUpdateParentWndTimer = -1;
this.bDevTool = false;
this.iVCTimeStart = -1;
this.iVCTimeEnd = -1;
this.oWndCover = {
left: 0,
top: 0,
right: 0,
bottom: 0
};
this.bOpened = false;
this.bLocalServiceRunning = false;
this.fCurrentCallback = null;
this.afCurrentCallback = [];
this.iProtocolType = 0;
this.oPluginCallback = {};
this.iPackageType = 2;
this.iDrawWondIndex = -1;
this.fVisibilityChange = function() {
if (document.hidden) {
t.iVCTimeStart = (new Date).getTime();
t.fHideWnd()
} else {
t.iVCTimeEnd = (new Date).getTime();
var e = pt.oUtils.browser();
if (e.chrome || e.mozilla) {
if (t.iUpdateParentWndTimer > 0) {
clearTimeout(t.iUpdateParentWndTimer);
t.iUpdateParentWndTimer = -1
}
if (t.iVCTimeEnd - t.iVCTimeStart < 100) {
t.iUpdateParentWndTimer = setTimeout(function() {
t.oRequest.updateParentWnd().then(function() {
if (!t.bFreeze && !t.bDevTool) {
t.fShowWnd()
}
}, function() {})
}, 100)
} else {
if (!t.bFreeze && !t.bDevTool) {
t.fShowWnd()
}
}
} else {
if (!t.bFreeze && !t.bDevTool) {
t.fShowWnd()
}
}
}
};
this.fHideWnd = function() {
this.oRequest.hideWnd()
};
this.fShowWnd = function() {
this.oRequest.showWnd()
};
this.fUnload = function() {
$(window).off("unload", this.fUnload);
this.JS_Disconnect()
};
this.fFocus = function() {
t.bFocus = true;
setTimeout(function() {
if (!document.hidden && !t.bFreeze && !t.bDevTool) {
t.fShowWnd()
}
}, 200)
};
this.fBlur = function() {
this.bFocus = false
};
this.oRequest = new vt.Request({
szPluginContainer: this.oOptions.szPluginContainer,
cbConnectSuccess: this.oOptions.cbConnectSuccess,
cbConnectError: this.oOptions.cbConnectError,
cbConnectClose: function i(e) {
if (t.iCreateWndTimer > 0) {
clearTimeout(t.iCreateWndTimer);
t.iCreateWndTimer = -1
}
if (t.oOptions.cbConnectClose) {
t.oOptions.cbConnectClose(e)
}
},
oSessionInfo: this.oOptions.oSessionInfo,
bNoDetectPort: this.oOptions.bNoDetectPort,
bUseInQT: this.oOptions.bUseInQT,
iServicePortStart: this.oOptions.iServicePortStart,
iServicePortEnd: this.oOptions.iServicePortEnd
});
if (this.oRequest !== null) {
$(window).on("unload", this.fUnload)
}
}
ht(r, [{
key: "JS_Disconnect",
value: function e() {
this.oRequest.disconnect()
}
}, {
key: "JS_CreateWnd",
value: function n(t, s, u) {
var l = this;
this.szWndId = t;
var e = new Promise(function(n, i) {
var e = null;
if (l.oOptions.szIframeId && $("#" + l.oOptions.szIframeId).length) {
e = $("#" + t, $("#" + l.oOptions.szIframeId)[0].contentWindow.document)
} else {
e = $("#" + t)
}
if (e.length > 0) {
var r = pt.oUtils.getWndPostion(e, l.bEmbed, l.oOptions.szIframeId, l.oOptions.bChildIframe, l.oOptions.szChildIframeId);
var o = l.oOptions.szIframeId ? $("#" + l.oOptions.szIframeId)[0].contentWindow : window.top;
var a = o.document.title;
o.document.title = l.oRequest.getRequestUUID();
l.iCreateWndTimer = setTimeout(function() {
var e = "";
if (pt.oUtils.browser().msie) {
e = "IEFrame"
} else if (pt.oUtils.browser().chrome) {
e = "Chrome"
}
if (!l.bDevTool) {
var t = pt.oUtils.getDevicePixelRatio();
s = Math.round(s * t);
u = Math.round(u * t);
l.oRequest.destroyWnd().then(function() {
l.oRequest.createWnd(r.left, r.top, s, u, e, l.bEmbed).then(function() {
o.document.title = a;
n()
}, function(e) {
o.document.title = a;
if (5001 === e.errorCode) {
if (!document.hidden && !l.bFreeze && l.bFocus) {
l.fShowWnd()
}
n()
} else {
i(e)
}
})
}, function() {
l.oRequest.createWnd(r.left, r.top, s, u, e, l.bEmbed).then(function() {
o.document.title = a;
n()
}, function(e) {
o.document.title = a;
if (5001 === e.errorCode) {
if (!document.hidden && !l.bFreeze && l.bFocus) {
l.fShowWnd()
}
n()
} else {
i(e)
}
})
})
}
}, 300);
document.addEventListener("visibilitychange", l.fVisibilityChange, false);
$(window).on("focus", l.fFocus);
$(window).on("blur", l.fBlur)
} else {
i()
}
});
return e
}
}, {
key: "JS_CheckLocalServiceConnected",
value: function t(n, i, r) {
var e = new Promise(function(e, t) {
vt.Request.checkLocalServiceConnected(n, i, r).then(function() {
e()
}, function() {
t()
})
});
return e
}
}, {
key: "JS_ShowWnd",
value: function i() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.bFreeze = false;
if (!document.hidden && !n.bDevTool) {
n.fShowWnd()
}
e()
});
return e
}
}, {
key: "JS_HideWnd",
value: function o() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.bFreeze = true;
n.fHideWnd();
e()
});
return e
}
}, {
key: "JS_SetWndCover",
value: function a(i, r) {
var o = this;
var e = new Promise(function(e, t) {
if (!o.bLocalServiceRunning) {
t();
return
}
var n = pt.oUtils.getDevicePixelRatio();
if (!pt.oUtils.browser().msie) {
if ("left" === i) {
o.oWndCover.left = r
} else if ("top" === i) {
o.oWndCover.top = r
} else if ("right" === i) {
o.oWndCover.right = r
} else if ("bottom" === i) {
o.oWndCover.bottom = r
}
}
r = Math.round(r * n);
o.oRequest.setWndCover(i, r).then(function() {
e()
}, function() {
t()
})
});
return e
}
}, {
key: "JS_SetWindowControlCallback",
value: function f(e) {
var t = this;
$.extend(this.oPluginCallback, e);
var n = {
onGetSelectWndInfo: function i(e) {
if (0 <= e.wndInfo.wndIndex) {
t.fCurrentCallback = t.afCurrentCallback[e.wndInfo.wndIndex]
}
if (t.oPluginCallback.onGetSelectWndInfo) {
t.oPluginCallback.onGetSelectWndInfo(parseInt(e.wndInfo.wndIndex, 10))
}
},
onPluginEventHandler: function r(e) {
if (t.oPluginCallback.onPluginEventHandler) {
t.oPluginCallback.onPluginEventHandler(parseInt(e.wndIndex, 10), parseInt(e.eventType, 10))
}
},
onDrawCallback: function o(e) {
if (t.fCurrentCallback) {
t.fCurrentCallback(e.shapeInfo)
}
},
onDrawEvent: function a(e) {
if (t.oPluginCallback.onDrawEvent) {
t.oPluginCallback.onDrawEvent(e)
}
},
onFisheyePTZInfo: function s(e) {
if (t.oPluginCallback.onFisheyePTZInfo) {
t.oPluginCallback.onFisheyePTZInfo(e.fishEyePTZInfo)
}
},
onFullScreenChange: function u(e) {
if (t.oPluginCallback.onFullScreenChange) {
t.oPluginCallback.onFullScreenChange(e.full)
}
},
onMouseEvent: function l(e) {
if (t.oPluginCallback.onMouseEvent) {
t.oPluginCallback.onMouseEvent(e.mouseInfo)
}
}
};
this.oRequest.setWindowControlCallback(n)
}
}, {
key: "JS_ArrangeWindow",
value: function s(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.arrangeWindow(n, i).then(function() {
e()
}, function() {
t()
})
});
return e
}
}, {
key: "JS_SetSecretKey",
value: function u(e, n, i) {
var r = this;
var t = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.setSecretKey(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return t
}
}, {
key: "JS_SetOriginalString",
value: function l(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.setOriginalString(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetEncryptString",
value: function c(e, i, r) {
var o = this;
var t = new Promise(function(t, n) {
if (!o.bLocalServiceRunning) {
n();
return
}
o.oRequest.getEncryptString(e, i, r).then(function(e) {
t(e.encryptString)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_GetDecryptString",
value: function d(e, i, r) {
var o = this;
var t = new Promise(function(t, n) {
if (!o.bLocalServiceRunning) {
n();
return
}
o.oRequest.getDecryptString(e, i, r).then(function(e) {
t(e.decryptString)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_DestroyPlugin",
value: function h(n) {
var i = this;
this.oPluginCallback = {};
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.destroyWnd().then(function() {
if (n) {
i.JS_Disconnect()
}
e()
}, function() {
t()
})
});
return e
}
}, {
key: "JS_DestroyAll",
value: function v() {
this.JS_DestroyPlugin();
this.oRequest.destroy();
return Promise.resolve()
}
}, {
key: "JS_Play",
value: function p(n, i, r, o, a) {
var s = this;
var e = new Promise(function(e, t) {
if (!s.bLocalServiceRunning) {
t();
return
}
s.oRequest.startPlay(n, i, r, o, a).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_ReversePlay",
value: function m(n, i, r, o, a) {
var s = this;
var e = new Promise(function(e, t) {
if (!s.bLocalServiceRunning) {
t();
return
}
s.oRequest.reversePlay(n, i, r, o, a).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_Stop",
value: function y(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.stop(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_Seek",
value: function S() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_StopRealPlayAll",
value: function g() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.oRequest.stopAll().then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_Pause",
value: function _(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.pause(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_Resume",
value: function P(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.resume(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_Slow",
value: function w(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.slow(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_Fast",
value: function b(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.fast(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_Transmission",
value: function k() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_FrameForward",
value: function C(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.frame(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetOSDTime",
value: function R(e) {
var i = this;
var t = new Promise(function(t, n) {
if (!i.bLocalServiceRunning) {
n();
return
}
i.oRequest.getOSDTime(e).then(function(e) {
t(e.osdTime)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_GetPlayInfo",
value: function I(e) {
var i = this;
var t = new Promise(function(t, n) {
if (!i.bLocalServiceRunning) {
n();
return
}
i.oRequest.getPlayInfo(e).then(function(e) {
t(e.playInfo)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_OpenSound",
value: function T(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.openSound(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_CloseSound",
value: function D() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.oRequest.closeSound().then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetVolume",
value: function x(e) {
var i = this;
var t = new Promise(function(t, n) {
if (!i.bLocalServiceRunning) {
n();
return
}
i.oRequest.getVolume(e).then(function(e) {
t(e.volume)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_SetVolume",
value: function M(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.setVolume(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_EnableZoom",
value: function E(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.enableZoom(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_DisableZoom",
value: function z(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.disableZoom(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_CapturePicture",
value: function O(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.capture(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StartSave",
value: function F(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.startSave(n, i, r.iPackageType).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StopSave",
value: function q(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.stopSave(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StartTalk",
value: function W(n, i, r, o, a, s, u, l, f) {
var c = this;
var e = new Promise(function(e, t) {
if (!c.bLocalServiceRunning) {
t();
return
}
c.oRequest.startTalk(n, i, r, o, a, s, u, l, f).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StopTalk",
value: function J() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.oRequest.stopTalk().then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetPlayMode",
value: function L() {
var e = new Promise(function(e) {
e()
});
return e
}
}, {
key: "JS_SetFullScreenCapability",
value: function A(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setFullScreenCapability(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_FullScreenDisplay",
value: function B(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.fullScreen(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_EnableIVS",
value: function U(n, i, r) {
var o = this;
var e = new Promise(function(e, t) {
if (!o.bLocalServiceRunning) {
t();
return
}
o.oRequest.enableIVS(n, i, r).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SRInit",
value: function H(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.SRInit(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SRPTZ",
value: function N(n, i, r) {
var o = this;
var e = new Promise(function(e, t) {
if (!o.bLocalServiceRunning) {
t();
return
}
o.oRequest.SRPTZ(n, i, r).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetPlaybackDrawType",
value: function G(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.setPlaybackDrawType(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetPlayBackType",
value: function V(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setPlayBackType(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetTrsPlayBackParam",
value: function j(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.setTrsPlayBackParam(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetLocalConfig",
value: function X() {
var i = this;
var e = new Promise(function(t, n) {
if (!i.bLocalServiceRunning) {
n();
return
}
i.oRequest.getLocalConfig().then(function(e) {
t(e.localConfig);
i.iProtocolType = parseInt(e.localConfig.protocolType, 10)
}, function(e) {
n(e && e.errorCode)
})
});
return e
}
}, {
key: "JS_GetEngineSupport",
value: function Y() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getEngineSupport().then(function(e) {
t(e)
}, function(e) {
n(e && e.errorCode)
})
});
return t
}
}, {
key: "JS_SetLocalConfig",
value: function Z(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setLocalConfig(n).then(function() {
i.iProtocolType = parseInt(n.protocolType, 10);
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetLastError",
value: function K() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getLastError().then(function(e) {
t(e.lastError)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_OpenFileBrowser",
value: function Q(e, i) {
var r = this;
var t = new Promise(function(t, n) {
if (!r.bLocalServiceRunning || r.bOpened) {
n();
return
}
r.bOpened = true;
r.oRequest.browseFilePath(e, i).then(function(e) {
r.bOpened = false;
t(e.filepath)
}, function(e) {
r.bOpened = false;
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_OpenDirectory",
value: function ee(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.openDirectory(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StartAsynUpload",
value: function te(n, i, r, o) {
var a = this;
var e = new Promise(function(e, t) {
if (!a.bLocalServiceRunning) {
t();
return
}
a.oRequest.startAsynUpload(n, i, r, o).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StopAsynUpload",
value: function ne() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.oRequest.stopAsynUpload().then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetUploadErrorInfo",
value: function ie() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getUploadErrorInfo().then(function(e) {
t(e.errorInfo)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_UploadFile",
value: function re(e, i, r, o) {
var a = this;
var t = new Promise(function(t, n) {
if (!a.bLocalServiceRunning) {
n();
return
}
a.oRequest.uploadFile(e, i, r, o).then(function(e) {
t(e)
}, function(e) {
n({
readyState: 4,
status: e.errorCode,
responseXML: e.errorInfo ? pt.oUtils.parseXmlFromStr(e.errorInfo) : null,
errorInfo: e.errorInfo
})
})
});
return t
}
}, {
key: "JS_GetIpcImportErrorInfo",
value: function oe() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getIpcImportErrorInfo().then(function(e) {
t(e.errorInfo)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_DownloadFile",
value: function ae(e, i, r, o, a, s) {
var u = this;
var t = new Promise(function(t, n) {
if (!u.bLocalServiceRunning) {
n();
return
}
u.oRequest.downloadFile(e, i, r, o, a, s).then(function(e) {
if (typeof e.ret === "undefined") {
t(0)
} else {
t(e.ret)
}
}, function(e) {
n({
readyState: 4,
status: e.errorCode,
responseXML: e.errorInfo ? pt.oUtils.parseXmlFromStr(e.errorInfo) : null
})
})
});
return t
}
}, {
key: "JS_DownloadFileNoPlugin",
value: function se(t) {
var e = new Promise(function(e) {
$("body").append('<a id="jsplugin_download_a" href="' + t + '"><li id="jsplugin_download_li"></li></a>');
$("#jsplugin_download_li").trigger("click");
$("#jsplugin_download_a").remove();
e()
});
return e
}
}, {
key: "JS_StartUpgrade",
value: function ue(n, i, r, o, a) {
var s = this;
var e = new Promise(function(e, t) {
if (!s.bLocalServiceRunning) {
t();
return
}
s.oRequest.startUpgrade(n, i, r, o, a).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StopUpgrade",
value: function le() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.oRequest.stopUpgrade().then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetUpgradeStatus",
value: function fe() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getUpgradeStatus().then(function(e) {
t(e.upgradeStatus)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_GetUpgradeProgress",
value: function ce() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getUpgradeProgress().then(function(e) {
t(e.upgradeProgress)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_ExportDeviceLog",
value: function de(e, i, r) {
var o = this;
var t = new Promise(function(t, n) {
if (!o.bLocalServiceRunning) {
n();
return
}
o.oRequest.exportDeviceLog(e, i, r).then(function(e) {
if (typeof e.ret === "undefined") {
t(0)
} else {
t(e.ret)
}
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_ExportReport",
value: function he(e, i, r) {
var o = this;
var t = new Promise(function(t, n) {
if (!o.bLocalServiceRunning) {
n();
return
}
o.oRequest.exportReport(e, i, r).then(function(e) {
if (typeof e.ret === "undefined") {
t(0)
} else {
t(e.ret)
}
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_StartAsyncDownload",
value: function ve(e, i, r, o) {
var a = this;
var t = new Promise(function(t, n) {
if (!a.bLocalServiceRunning) {
n();
return
}
a.oRequest.startAsyncDownload(e, i, r, o, a.iPackageType).then(function(e) {
t(e.downloadId)
}, function(e) {
n({
readyState: 4,
status: e.errorCode,
responseXML: e.errorInfo ? pt.oUtils.parseXmlFromStr(e.errorInfo) : null
})
})
});
return t
}
}, {
key: "JS_StopAsyncDownload",
value: function pe(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.stopAsyncDownload(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetDownloadStatus",
value: function me(e) {
var i = this;
var t = new Promise(function(t, n) {
if (!i.bLocalServiceRunning) {
n();
return
}
i.oRequest.getDownloadStatus(e).then(function(e) {
t(e.downloadStatus)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_GetDownloadProgress",
value: function ye(e) {
var i = this;
var t = new Promise(function(t, n) {
if (!i.bLocalServiceRunning) {
n();
return
}
i.oRequest.getDownloadProgress(e).then(function(e) {
t(e.downloadProgress)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_EnablePDC",
value: function Se(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.enablePDC(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_Resize",
value: function ge(o, a) {
var s = this;
var e = new Promise(function(e, t) {
if (!s.bLocalServiceRunning) {
t();
return
}
var n = null;
if (s.oOptions.szIframeId && $("#" + s.oOptions.szIframeId).length) {
n = $("#" + s.szWndId, $("#" + s.oOptions.szIframeId)[0].contentWindow.document)
} else {
n = $("#" + s.szWndId)
}
if (n.length > 0) {
var i = pt.oUtils.getWndPostion(n, s.bEmbed, s.oOptions.szIframeId, s.oOptions.bChildIframe, s.oOptions.szChildIframeId);
var r = pt.oUtils.getDevicePixelRatio();
if (!pt.oUtils.browser().msie) {
if (s.oWndCover.left > 0) {
i.left = i.left + Math.round(s.oWndCover.left * r);
o = o - s.oWndCover.left
}
if (s.oWndCover.top > 0) {
i.top = i.top + Math.round(s.oWndCover.top * r);
a = a - s.oWndCover.top
}
if (s.oWndCover.right > 0) {
o = o - s.oWndCover.right
}
if (s.oWndCover.bottom > 0) {
a = a - s.oWndCover.bottom
}
}
o = Math.round(o * r);
a = Math.round(a * r);
s.oRequest.setWndGeometry(i.left, i.top, o, a).then(function() {
e()
}, function() {
t()
})
} else {
t()
}
});
return e
}
}, {
key: "JS_SetDrawCallback",
value: function _e(n, i, r, o, a, s) {
var u = this;
s = s || {};
u.fCurrentCallback = null;
u.afCurrentCallback[n] = null;
var e = new Promise(function(e, t) {
if (!u.bLocalServiceRunning) {
t();
return
}
u.oRequest.setDrawCallback(n, i, r, o, s).then(function() {
u.fCurrentCallback = a;
u.afCurrentCallback[n] = a;
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetDrawStatus",
value: function Pe(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setDrawStatus(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_ClearRegion",
value: function we() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.oRequest.clearRegion().then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetDrawShapeInfo",
value: function be(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
if (r.iDrawWondIndex !== -1) {
i.wndIndex = r.iDrawWondIndex
}
i.maxPointSupport = 10;
r.oRequest.setDrawShapeInfo(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetGridInfo",
value: function ke(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setGridInfo(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetGridInfo",
value: function Ce() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getGridInfo().then(function(e) {
t(e.gridInfo)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_SetRectInfo",
value: function Re(i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
if (r.iDrawWondIndex !== -1) {
var n = void 0;
for (n = 0; n < i.length; n++) {
i[n].wndIndex = r.iDrawWondIndex
}
}
r.oRequest.setRectInfo(i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetRectInfo",
value: function Ie() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getRectInfo(e.iDrawWondIndex).then(function(e) {
t(e.rectInfo)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_SetPolygonInfo",
value: function Te(i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
if (r.iDrawWondIndex !== -1) {
var n = void 0;
for (n = 0; n < i.length; n++) {
i[n].wndIndex = r.iDrawWondIndex
}
}
r.oRequest.setPolygonInfo(i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetPolygonInfo",
value: function De() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getPolygonInfo(e.iDrawWondIndex).then(function(e) {
t(e.polygonInfo)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_SetLineInfo",
value: function xe(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setLineInfo(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetLineInfo",
value: function Me() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getLineInfo().then(function(e) {
t(e.lineInfo)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_SetPointInfo",
value: function Ee(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setPointInfo(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetPointInfo",
value: function ze() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getPointInfo().then(function(e) {
t(e.pointInfo)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_SetTextOverlay",
value: function Oe(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setTextOverlay(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetTextOverlay",
value: function Fe() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getTextOverlay().then(function(e) {
t(e.overlayInfo)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_ClearShapeByType",
value: function qe(i, e) {
var r = this;
var t = new Promise(function(t, n) {
if (!r.bLocalServiceRunning) {
n();
return
}
r.oRequest.clearShapeByType(i, e).then(function(e) {
if ("Choosed" === i) {
t(e.clearedShapeId)
} else {
t()
}
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_ChooseShape",
value: function We(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.chooseShape(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetCorrectionType",
value: function Je(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setCorrectionType(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetPlaceType",
value: function Le(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setPlaceType(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StartFishListener",
value: function Ae(n, i, r) {
var o = this;
var e = new Promise(function(e, t) {
if (!o.bLocalServiceRunning) {
t();
return
}
o.oRequest.startFishListener(n, i, r).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StopFishListener",
value: function Be() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.oRequest.stopFishListener().then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetFishBoxListInfo",
value: function Ue(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setFishBoxListInfo(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetFishBoxListInfo",
value: function $e() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.getFishBoxListInfo().then(function(e) {
t(e.fishBoxList)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_ClearAllWndFishBoxInfo",
value: function He() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.oRequest.clearAllWndFishBoxInfo().then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetFishWndProperty",
value: function Ne(n, i, r) {
var o = this;
var e = new Promise(function(e, t) {
if (!o.bLocalServiceRunning) {
t();
return
}
o.oRequest.setFishWndProperty(n, i, r).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetFishParams",
value: function Ge(n, i, r, o) {
var a = this;
var e = new Promise(function(e, t) {
if (!a.bLocalServiceRunning) {
t();
return
}
a.oRequest.setFishParams(n, i, r, o).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_ArrangeFECWindow",
value: function Ve(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.arrangeFECWindow(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StartFECScan",
value: function je(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.startFECScan(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StopFECScan",
value: function Xe() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.oRequest.stopFECScan().then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_FishEyePTZ",
value: function Ye(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.fishEyePTZ(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_FishEyeGetPreset",
value: function Ze() {
var e = this;
var t = new Promise(function(t, n) {
if (!e.bLocalServiceRunning) {
n();
return
}
e.oRequest.fishEyeGetPreset().then(function(e) {
t(e.fishEyePreset)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_FishEyeSetPreset",
value: function Ke(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.fishEyeSetPreset(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StartFECCruise",
value: function Qe(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.startFECCruise(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_StopFECCruise",
value: function et() {
var n = this;
var e = new Promise(function(e, t) {
if (!n.bLocalServiceRunning) {
t();
return
}
n.oRequest.stopFECCruise().then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetIsHttps",
value: function tt(n) {
var i = this;
var e = new Promise(function(e, t) {
if (!i.bLocalServiceRunning) {
t();
return
}
i.oRequest.setIsHttps(n).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetReconnectInfo",
value: function nt(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.setReconnectInfo(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_CheckUpdate",
value: function it(n) {
var i = this;
var e = new Promise(function(r, e) {
if (!i.bLocalServiceRunning) {
e();
return
}
var t = pt.oUtils.parseXmlFromStr(n);
var o = $(t).find("localServiceControl").eq(0).text();
i.oRequest.getLocalServiceVersion().then(function(e) {
var t = parseInt(e.localServiceVersion.replace(/\./g, ""), 10);
var n = parseInt(o.replace(/\./g, ""), 10);
var i = n > t;
r(i)
}, function() {
e()
})
});
return e
}
}, {
key: "JS_SelectShape",
value: function rt(n, i) {
var r = this;
var e = new Promise(function(e, t) {
if (!r.bLocalServiceRunning) {
t();
return
}
r.oRequest.selectShape(n, i).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_GetPictureSize",
value: function ot(e) {
var i = this;
var t = new Promise(function(t, n) {
if (!i.bLocalServiceRunning) {
n();
return
}
i.oRequest.getPlayInfo(e).then(function(e) {
t(e.playInfo.playInfo)
}, function(e) {
n(e.errorCode)
})
});
return t
}
}, {
key: "JS_SetOriginResolution",
value: function at(n, i, r) {
var o = this;
var e = new Promise(function(e, t) {
if (!o.bLocalServiceRunning) {
t();
return
}
o.oRequest.setOriginResolution(n, i, r).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_SetPlayWndMode",
value: function st(n, i, r) {
var o = this;
var e = new Promise(function(e, t) {
if (!o.bLocalServiceRunning) {
t();
return
}
o.oRequest.setPlayWndMode(n, i, r).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_CuttingPartWindow",
value: function ut(n, i, r, o) {
var a = this;
var e = new Promise(function(e, t) {
if (!a.bLocalServiceRunning) {
t();
return
}
a.oRequest.cuttingPartWindow(n, i, r, o).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_RepairPartWindow",
value: function lt(n, i, r, o) {
var a = this;
var e = new Promise(function(e, t) {
if (!a.bLocalServiceRunning) {
t();
return
}
a.oRequest.repairPartWindow(n, i, r, o).then(function() {
e()
}, function(e) {
t(e.errorCode)
})
});
return e
}
}, {
key: "JS_PlayWithImg",
value: function ft() {
return Promise.resolve()
}
}, {
key: "JS_SetPackageType",
value: function ct(e) {
this.iPackageType = e;
return Promise.resolve()
}
}, {
key: "JS_SetSnapDrawWndIndex",
value: function dt(e) {
this.iDrawWondIndex = e;
return Promise.resolve()
}
}]);
return r
}();
return e
}();
t.LocalServiceControl = i
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.Request = undefined;
var ft = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
var ct = n(30);
var dt = n(31);
var ht = n(41);
var vt = n(2);
function pt(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var i = function() {
var e = function() {
function n(e) {
pt(this, n);
var t = {
szPluginContainer: "",
cbConnectSuccess: null,
cbConnectError: null,
cbConnectClose: null,
iServicePortStart: 33686,
iServicePortEnd: 33695
};
this.oOptions = $.extend(t, e);
this.iPort = -1;
this.oRequest = null;
this.isInit = false;
this.oCallbacks = {};
this.init(this.oOptions.oSessionInfo)
}
ft(n, [{
key: "destroy",
value: function e() {
this.disconnect();
this.oOptions = null;
this.oRequest = null;
this.oCallbacks = {}
}
}, {
key: "init",
value: function o(e) {
var i = this;
if (i.oOptions.bNoDetectPort) {
i.oRequest = new ct.WebSocketRequest({
iPort: i.oOptions.iServicePortStart,
cbConnectSuccess: i.oOptions.cbConnectSuccess,
cbConnectError: i.oOptions.cbConnectError,
cbConnectClose: i.oOptions.cbConnectClose
})
} else {
if (i.oOptions.bUseInQT) {
i.oRequest = new ht.WebChannelRequest({
iPort: i.iPort,
cbConnectSuccess: i.oOptions.cbConnectSuccess,
cbConnectError: i.oOptions.cbConnectError,
cbConnectClose: i.oOptions.cbConnectClose
})
} else {
vt.oUtils.detectPort(i.oOptions.iServicePortStart, i.oOptions.iServicePortEnd, {
oSessionInfo: e,
success: function r(e) {
i.iPort = e;
if (vt.oUtils.browser().msie) {} else {
if ("https:" === window.location.protocol) {
if (vt.oUtils.browser().chrome) {
try {
i.oRequest = new ct.WebSocketRequest({
iPort: i.iPort,
cbConnectSuccess: i.oOptions.cbConnectSuccess,
cbConnectError: i.oOptions.cbConnectError,
cbConnectClose: i.oOptions.cbConnectClose
})
} catch (n) {
i.oRequest = new dt.ImageHttpRequest({
iPort: i.iPort,
cbConnectSuccess: i.oOptions.cbConnectSuccess,
cbConnectError: i.oOptions.cbConnectError,
cbConnectClose: i.oOptions.cbConnectClose
})
}
} else {
i.oRequest = new dt.ImageHttpRequest({
iPort: i.iPort,
cbConnectSuccess: i.oOptions.cbConnectSuccess,
cbConnectError: i.oOptions.cbConnectError,
cbConnectClose: i.oOptions.cbConnectClose
})
}
} else {
if ("WebSocket" in window) {
i.oRequest = new ct.WebSocketRequest({
iPort: i.iPort,
cbConnectSuccess: i.oOptions.cbConnectSuccess,
cbConnectError: i.oOptions.cbConnectError,
cbConnectClose: i.oOptions.cbConnectClose
})
} else {}
}
}
i.isInit = true;
for (var t in i.oCallbacks) {
i.oRequest[t](i.oCallbacks[t])
}
},
error: function t() {
if (i.oOptions.cbConnectError) {
i.oOptions.cbConnectError()
}
}
})
}
}
}
}, {
key: "setWindowControlCallback",
value: function t(e) {
if (this.isInit) {
this.oRequest.setWindowControlCallback(e)
} else {
this.oCallbacks.setWindowControlCallback = e
}
}
}, {
key: "getServiceVersion",
value: function i() {
return this.oRequest.getServiceVersion()
}
}, {
key: "getRequestUUID",
value: function r() {
return this.oRequest.getRequestUUID()
}
}, {
key: "disconnect",
value: function a() {
this.oRequest.disconnect()
}
}, {
key: "createWnd",
value: function s(e, t, n, i, r, o) {
return this.oRequest.sendRequest({
cmd: "window.createWnd",
rect: {
left: e,
top: t,
width: n,
height: i
},
className: r,
embed: o
})
}
}, {
key: "showWnd",
value: function u() {
return this.oRequest && this.oRequest.sendRequest({
cmd: "window.showWnd"
})
}
}, {
key: "hideWnd",
value: function l() {
return this.oRequest && this.oRequest.sendRequest({
cmd: "window.hideWnd"
})
}
}, {
key: "destroyWnd",
value: function f() {
return this.oRequest.sendRequest({
cmd: "window.destroyWnd"
})
}
}, {
key: "setWndGeometry",
value: function c(e, t, n, i) {
return this.oRequest.sendRequest({
cmd: "window.setWndGeometry",
rect: {
left: e,
top: t,
width: n,
height: i
}
})
}
}, {
key: "setWndCover",
value: function d(e, t) {
return this.oRequest.sendRequest({
cmd: "window.setWndCover",
position: e,
size: t
})
}
}, {
key: "setWndZOrder",
value: function h(e) {
return this.oRequest.sendRequest({
cmd: "window.setWndZOrder",
flag: e
})
}
}, {
key: "updateParentWnd",
value: function v() {
return this.oRequest.sendRequest({
cmd: "window.updateParentWnd"
})
}
}, {
key: "getLocalServiceVersion",
value: function p() {
return this.oRequest.sendRequest({
cmd: "window.getLocalServiceVersion"
})
}
}, {
key: "startPlay",
value: function m(e, t, n, i, r) {
if (t === null || typeof t === "undefined") {
t = {}
}
var o = {
cmd: "video.startPlay",
url: e,
token: t.token || "",
auth: t.auth || "",
wndIndex: n,
startTime: i || "",
stopTime: r || ""
};
return this.oRequest.sendRequest(o)
}
}, {
key: "stop",
value: function y(e) {
return this.oRequest.sendRequest({
cmd: "video.stop",
wndIndex: e
})
}
}, {
key: "stopAll",
value: function S() {
return this.oRequest.sendRequest({
cmd: "video.stopAll"
})
}
}, {
key: "reversePlay",
value: function g(e, t, n, i, r) {
if (t === null || typeof t === "undefined") {
t = {}
}
var o = {
cmd: "video.reversePlay",
url: e,
token: t.token || "",
auth: t.auth || "",
wndIndex: n,
startTime: i || "",
stopTime: r || ""
};
return this.oRequest.sendRequest(o)
}
}, {
key: "startSave",
value: function _(e, t, n) {
var i = {
cmd: "video.startSave",
wndIndex: e,
fileName: t || "",
packageType: n
};
return this.oRequest.sendRequest(i)
}
}, {
key: "stopSave",
value: function P(e) {
var t = {
cmd: "video.stopSave",
wndIndex: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "getLastError",
value: function w() {
var e = {
cmd: "video.getLastError"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "openSound",
value: function b(e) {
var t = {
cmd: "video.openSound",
wndIndex: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "closeSound",
value: function k() {
var e = {
cmd: "video.closeSound"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "getVolume",
value: function C() {
var e = {
cmd: "video.getVolume"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "setVolume",
value: function R(e, t) {
var n = {
cmd: "video.setVolume",
wndIndex: e,
volume: t
};
return this.oRequest.sendRequest(n)
}
}, {
key: "pause",
value: function I(e) {
var t = {
cmd: "video.pause",
wndIndex: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "resume",
value: function T(e) {
var t = {
cmd: "video.resume",
wndIndex: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "slow",
value: function D(e) {
var t = {
cmd: "video.slow",
wndIndex: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "fast",
value: function x(e) {
var t = {
cmd: "video.fast",
wndIndex: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "frame",
value: function M(e) {
var t = {
cmd: "video.frame",
wndIndex: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "getOSDTime",
value: function E(e) {
var t = {
cmd: "video.getOSDTime",
wndIndex: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "getPlayInfo",
value: function z(e) {
var t = {
cmd: "video.getPlayInfo",
wndIndex: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "capture",
value: function O(e, t) {
var n = {
cmd: "video.capture",
wndIndex: e,
fileName: t || ""
};
return this.oRequest.sendRequest(n)
}
}, {
key: "arrangeWindow",
value: function F(e, t) {
var n = {
cmd: "video.arrangeWindow",
type: e,
custom: t || []
};
return this.oRequest.sendRequest(n)
}
}, {
key: "enableIVS",
value: function q(e, t, n) {
var i = {
cmd: "video.enableIVS",
wndIndex: e,
type: t,
enable: n
};
return this.oRequest.sendRequest(i)
}
}, {
key: "setPlaybackDrawType",
value: function W(e, t) {
var n = {
cmd: "video.setPlaybackDrawType",
wndIndex: e,
type: t
};
return this.oRequest.sendRequest(n)
}
}, {
key: "setPlayBackType",
value: function J(e) {
var t = {
cmd: "video.setPlayBackType",
type: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "setTrsPlayBackParam",
value: function L(e, t) {
var n = {
cmd: "video.setTrsPlayBackParam",
wndIndex: e,
params: t
};
return this.oRequest.sendRequest(n)
}
}, {
key: "startTalk",
value: function A(e, t, n, i, r, o, a, s, u) {
var l = {
cmd: "video.startTalk",
openUrl: e,
closeUrl: t,
dataUrl: n,
auth: i,
audioType: r,
bitRate: o,
sampleRate: a,
soundChannel: s,
deviceCastChannelNum: u
};
return this.oRequest.sendRequest(l)
}
}, {
key: "stopTalk",
value: function B() {
var e = {
cmd: "video.stopTalk"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "enableZoom",
value: function U(e, t) {
var n = {
cmd: "video.enableZoom",
wndIndex: e,
type: t
};
return this.oRequest.sendRequest(n)
}
}, {
key: "disableZoom",
value: function H(e) {
var t = {
cmd: "video.disableZoom",
wndIndex: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "setFullScreenCapability",
value: function N(e) {
var t = {
cmd: "video.setFullScreenCapability",
mode: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "fullScreen",
value: function G(e) {
var t = {
cmd: "video.fullScreen",
full: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "setSecretKey",
value: function V(e, t) {
var n = {
cmd: "video.setSecretKey",
keyType: t,
key: e
};
return this.oRequest.sendRequest(n)
}
}, {
key: "getEncryptString",
value: function j(e, t, n) {
var i = {
cmd: "video.getEncryptString",
type: e,
originalKey: t,
encrypted: n
};
return this.oRequest.sendRequest(i)
}
}, {
key: "setOriginalString",
value: function X(e, t) {
var n = {
cmd: "video.setOriginalString",
key: e,
encrypted: t
};
return this.oRequest.sendRequest(n)
}
}, {
key: "getDecryptString",
value: function Y(e, t, n) {
var i = {
cmd: "video.getDecryptString",
type: e,
encrypted: t,
key: n
};
return this.oRequest.sendRequest(i)
}
}, {
key: "getLocalConfig",
value: function Z() {
var e = {
cmd: "video.getLocalConfig"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "getEngineSupport",
value: function K() {
var e = {
cmd: "video.getEngineSupport"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "setLocalConfig",
value: function Q(e) {
var t = {
cmd: "video.setLocalConfig",
localConfig: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "setPlayMode",
value: function ee(e) {
var t = {
cmd: "video.setPlayMode",
mode: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "browseFilePath",
value: function te(e, t) {
var n = {
cmd: "video.browseFilePath",
mode: e,
fileType: t
};
return this.oRequest.sendRequest(n)
}
}, {
key: "openDirectory",
value: function ne(e) {
var t = {
cmd: "video.openDirectory",
dir: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "startAsynUpload",
value: function ie(e, t, n, i) {
var r = {
cmd: "video.startAsynUpload",
uploadUrl: e,
statusUrl: t,
auth: n,
filepath: i
};
return this.oRequest.sendRequest(r)
}
}, {
key: "stopAsynUpload",
value: function re() {
var e = {
cmd: "video.stopAsynUpload"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "getUploadErrorInfo",
value: function oe() {
var e = {
cmd: "video.getUploadErrorInfo"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "uploadFile",
value: function ae(e, t, n, i) {
var r = {
cmd: "video.uploadFile",
uploadUrl: e,
auth: t,
filepath: n,
contentType: i
};
return this.oRequest.sendRequest(r)
}
}, {
key: "getIpcImportErrorInfo",
value: function se() {
var e = {
cmd: "video.getIpcImportErrorInfo"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "downloadFile",
value: function ue(e, t, n, i, r, o) {
var a = {
cmd: "video.downloadFile",
downloadUrl: e,
auth: t,
xmlContent: n,
method: i,
fileType: r,
decode: o
};
return this.oRequest.sendRequest(a)
}
}, {
key: "startUpgrade",
value: function le(e, t, n, i, r) {
var o = {
cmd: "video.startUpgrade",
upgradeUrl: e,
statusUrl: t,
auth: n,
filepath: i,
upgradeFlag: r
};
return this.oRequest.sendRequest(o)
}
}, {
key: "stopUpgrade",
value: function fe() {
var e = {
cmd: "video.stopUpgrade"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "getUpgradeStatus",
value: function ce() {
var e = {
cmd: "video.getUpgradeStatus"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "getUpgradeProgress",
value: function de() {
var e = {
cmd: "video.getUpgradeProgress"
};
return this.oRequest.sendRequest(e)
}
}, {
key: "exportDeviceLog",
value: function he(e, t, n) {
var i = {
cmd: "video.exportDeviceLog",
logXml: e,
filename: t,
fileType: n
};
return this.oRequest.sendRequest(i)
}
}, {
key: "enablePDC",
value: function ve(e, t) {
var n = {
cmd: "video.enablePDC",
wndIndex: e,
enable: t
};
return this.oRequest.sendRequest(n)
}
}, {
key: "exportReport",
value: function pe(e, t, n) {
var i = {
cmd: "video.exportReport",
reportXml: e,
filename: t,
fileType: n
};
return this.oRequest.sendRequest(i)
}
}, {
key: "startAsyncDownload",
value: function me(e, t, n, i, r) {
var o = {
cmd: "video.startAsyncDownload",
downloadUrl: e,
auth: t,
filename: n,
downloadXml: i,
packageType: r
};
return this.oRequest.sendRequest(o)
}
}, {
key: "stopAsyncDownload",
value: function ye(e) {
var t = {
cmd: "video.stopAsyncDownload",
downloadId: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "getDownloadStatus",
value: function Se(e) {
var t = {
cmd: "video.getDownloadStatus",
downloadId: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "getDownloadProgress",
value: function ge(e) {
var t = {
cmd: "video.getDownloadProgress",
downloadId: e
};
return this.oRequest.sendRequest(t)
}
}, {
key: "SRInit",
value: function _e(e, t) {
var n = {
cmd: "video.SRInit",
wndIndex: e,
type: t
};
return this.oRequest.sendRequest(n)
}
}, {
key: "SRPTZ",
value: function Pe(e, t, n) {
var i = {
cmd: "video.SRPTZ",
wndIndex: e,
direction: t,
step: n
};
return this.oRequest.sendRequest(i)
}
}, {
key: "setDrawCallback",
value: function we(e, t, n, i, r) {
var o = {
cmd: "video.setDrawCallback",
wndIndex: e,
enable: t,
type: n,
display: i
};
$.extend(o, r);
return this.oRequest.sendRequest(o)
}
}, {
key: "setDrawStatus",
value: function be(e) {
return this.oRequest.sendRequest({
cmd: "video.setDrawStatus",
enable: e
})
}
}, {
key: "clearRegion",
value: function ke() {
return this.oRequest.sendRequest({
cmd: "video.clearRegion"
})
}
}, {
key: "setDrawShapeInfo",
value: function Ce(e, t) {
return this.oRequest.sendRequest({
cmd: "video.setDrawShapeInfo",
drawType: e,
drawInfo: t
})
}
}, {
key: "setGridInfo",
value: function Re(e) {
return this.oRequest.sendRequest({
cmd: "video.setGridInfo",
gridInfo: e
})
}
}, {
key: "getGridInfo",
value: function Ie() {
return this.oRequest.sendRequest({
cmd: "video.getGridInfo"
})
}
}, {
key: "setPolygonInfo",
value: function Te(e) {
return this.oRequest.sendRequest({
cmd: "video.setPolygonInfo",
polygonInfo: e
})
}
}, {
key: "getPolygonInfo",
value: function De(e) {
return this.oRequest.sendRequest({
cmd: "video.getPolygonInfo",
wndIndex: e
})
}
}, {
key: "setLineInfo",
value: function xe(e) {
return this.oRequest.sendRequest({
cmd: "video.setLineInfo",
lineInfo: e
})
}
}, {
key: "getLineInfo",
value: function Me() {
return this.oRequest.sendRequest({
cmd: "video.getLineInfo"
})
}
}, {
key: "setPointInfo",
value: function Ee(e) {
return this.oRequest.sendRequest({
cmd: "video.setPointInfo",
pointInfo: e
})
}
}, {
key: "getPointInfo",
value: function ze() {
return this.oRequest.sendRequest({
cmd: "video.getPointInfo"
})
}
}, {
key: "setTextOverlay",
value: function Oe(e) {
return this.oRequest.sendRequest({
cmd: "video.setTextOverlay",
overlayInfo: e
})
}
}, {
key: "getTextOverlay",
value: function Fe() {
return this.oRequest.sendRequest({
cmd: "video.getTextOverlay"
})
}
}, {
key: "setRectInfo",
value: function qe(e) {
return this.oRequest.sendRequest({
cmd: "video.setRectInfo",
rectInfo: e
})
}
}, {
key: "getRectInfo",
value: function We(e) {
return this.oRequest.sendRequest({
cmd: "video.getRectInfo",
wndIndex: e
})
}
}, {
key: "clearShapeByType",
value: function Je(e, t) {
return this.oRequest.sendRequest({
cmd: "video.clearShapeByType",
type: e,
id: t
})
}
}, {
key: "chooseShape",
value: function Le(e, t) {
return this.oRequest.sendRequest({
cmd: "video.chooseShape",
type: e,
id: t
})
}
}, {
key: "setCorrectionType",
value: function Ae(e) {
return this.oRequest.sendRequest({
cmd: "video.setCorrectionType",
type: e
})
}
}, {
key: "setPlaceType",
value: function Be(e) {
return this.oRequest.sendRequest({
cmd: "video.setPlaceType",
type: e
})
}
}, {
key: "startFishListener",
value: function Ue(e, t, n) {
return this.oRequest.sendRequest({
cmd: "video.startFishListener",
url: e,
auth: t,
extData: n
})
}
}, {
key: "stopFishListener",
value: function $e() {
return this.oRequest.sendRequest({
cmd: "video.stopFishListener"
})
}
}, {
key: "setFishBoxListInfo",
value: function He(e) {
return this.oRequest.sendRequest({
cmd: "video.setFishBoxListInfo",
fishBoxList: e
})
}
}, {
key: "getFishBoxListInfo",
value: function Ne() {
return this.oRequest.sendRequest({
cmd: "video.getFishBoxListInfo"
})
}
}, {
key: "clearAllWndFishBoxInfo",
value: function Ge() {
return this.oRequest.sendRequest({
cmd: "video.clearAllWndFishBoxInfo"
})
}
}, {
key: "setFishWndProperty",
value: function Ve(e, t, n) {
return this.oRequest.sendRequest({
cmd: "video.setFishWndProperty",
wndIndex: e,
type: t,
id: n
})
}
}, {
key: "setFishParams",
value: function je(e, t, n, i) {
return this.oRequest.sendRequest({
cmd: "video.setFishParams",
top: e,
right: t,
bottom: n,
left: i
})
}
}, {
key: "arrangeFECWindow",
value: function Xe(e) {
return this.oRequest.sendRequest({
cmd: "video.arrangeFECWindow",
type: e
})
}
}, {
key: "startFECScan",
value: function Ye(e) {
return this.oRequest.sendRequest({
cmd: "video.startFECScan",
speed: e
})
}
}, {
key: "stopFECScan",
value: function Ze() {
return this.oRequest.sendRequest({
cmd: "video.stopFECScan"
})
}
}, {
key: "fishEyePTZ",
value: function Ke(e, t) {
return this.oRequest.sendRequest({
cmd: "video.fishEyePTZ",
direction: e,
speed: t
})
}
}, {
key: "fishEyeGetPreset",
value: function Qe() {
return this.oRequest.sendRequest({
cmd: "video.fishEyeGetPreset"
})
}
}, {
key: "fishEyeSetPreset",
value: function et(e) {
return this.oRequest.sendRequest({
cmd: "video.fishEyeSetPreset",
fishEyePreset: e
})
}
}, {
key: "startFECCruise",
value: function tt(e) {
return this.oRequest.sendRequest({
cmd: "video.startFECCruise",
fishEyePresetList: e
})
}
}, {
key: "stopFECCruise",
value: function nt() {
return this.oRequest.sendRequest({
cmd: "video.stopFECCruise"
})
}
}, {
key: "setIsHttps",
value: function it(e) {
return this.oRequest.sendRequest({
cmd: "video.setIsHttps",
https: e
})
}
}, {
key: "setReconnectInfo",
value: function rt(e, t) {
return this.oRequest.sendRequest({
cmd: "video.setReconnectInfo",
wndIndex: e,
auth: t
})
}
}, {
key: "selectShape",
value: function ot(e, t) {
return this.oRequest.sendRequest({
cmd: "video.chooseShape",
type: e,
id: t
})
}
}, {
key: "getPlayInfo",
value: function z(e) {
return this.oRequest.sendRequest({
cmd: "video.getPlayInfo",
wndIndex: e
})
}
}, {
key: "setOriginResolution",
value: function at(e, t, n) {
return this.oRequest.sendRequest({
cmd: "video.setWndResolution",
wndIndex: e,
width: t,
height: n
})
}
}, {
key: "setPlayWndMode",
value: function st(e, t, n) {
return this.oRequest.sendRequest({
cmd: "video.setWndRatioMode",
wndIndex: e,
mode: t,
allWnd: n
})
}
}, {
key: "cuttingPartWindow",
value: function ut(e, t, n, i) {
return this.oRequest.sendRequest({
cmd: "window.cuttingPartWindow",
rect: {
left: e,
top: t,
width: n,
height: i
},
round: 0
})
}
}, {
key: "repairPartWindow",
value: function lt(e, t, n, i) {
return this.oRequest.sendRequest({
cmd: "window.repairPartWindow",
rect: {
left: e,
top: t,
width: n,
height: i
},
round: 0
})
}
}]);
return n
}();
e.checkLocalServiceConnected = function(r, o, a) {
if (o === null || typeof o === "undefined") {
o = 33686;
a = 33695
}
var e = new Promise(function(e, t) {
vt.oUtils.detectPort(o, a, {
oSessionInfo: r,
success: function n() {
e()
},
error: function i() {
t()
}
})
});
return e
};
return e
}();
t.Request = i
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.WebSocketRequest = undefined;
var u = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
var i = n(1);
var l = r(i);
var f = n(2);
function r(e) {
return e && e.__esModule ? e : {
"default": e
}
}
function c(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var o = function() {
var e = function() {
function n(e) {
c(this, n);
var t = {
iPort: -1,
cbConnectSuccess: null,
cbConnectError: null,
cbConnectClose: null
};
this.oOptions = $.extend(t, e);
this.oWebSocket = null;
this.szUUID = "";
this.szVersion = "";
this.oRequestList = {};
this.bNormalClose = false;
this.oWindowControlCallback = {};
this.init()
}
u(n, [{
key: "init",
value: function t() {
var r = this;
var e = function e() {
if (r.oOptions.cbConnectClose) {
r.oOptions.cbConnectClose(r.bNormalClose)
}
r.bNormalClose = false
};
r.oWebSocket = new WebSocket("ws://127.0.0.1:" + r.oOptions.iPort);
r.oWebSocket.onerror = function() {};
r.oWebSocket.onopen = function() {
var e = l["default"].v4();
var t = {
sequence: e,
cmd: "system.webconnect"
};
var n = JSON.stringify(t);
r.oWebSocket.send(n)
};
r.oWebSocket.onmessage = function(e) {
var t = e.data;
if (!t) {
return
}
var n = JSON.parse(t);
var i = n.sequence;
if (typeof i === "undefined" && typeof n.cmd === "undefined") {
r.szUUID = n.uuid;
r.szVersion = n.version;
if (r.oOptions.cbConnectSuccess) {
r.oOptions.cbConnectSuccess()
}
} else {
if (typeof n.cmd !== "undefined") {
r.parseCmd(n)
} else {
if (typeof r.oRequestList[i] !== "undefined") {
if (0 === n.errorCode) {
r.oRequestList[i].resolve(n)
} else {
r.oRequestList[i].reject(n)
}
delete r.oRequestList[i]
}
}
}
};
r.oWebSocket.onclose = function() {
r.oWebSocket = null;
if (f.oUtils.browser().mozilla) {
setTimeout(function() {
e()
}, 100)
} else {
e()
}
}
}
}, {
key: "setWindowControlCallback",
value: function i(e) {
this.oWindowControlCallback = e
}
}, {
key: "getServiceVersion",
value: function e() {
return this.szVersion
}
}, {
key: "getRequestUUID",
value: function r() {
return this.szUUID
}
}, {
key: "disconnect",
value: function o() {
this.bNormalClose = true;
if (this.oWebSocket && WebSocket.OPEN === this.oWebSocket.readyState) {
this.oWebSocket.close()
}
}
}, {
key: "sendRequest",
value: function a(r) {
var o = this;
var e = new Promise(function(e, t) {
var n = l["default"].v4();
r.sequence = n;
o.oRequestList[n] = {
resolve: e,
reject: t
};
r.uuid = o.szUUID;
r.timestamp = (new Date).getTime() + "";
var i = JSON.stringify(r);
if (o.oWebSocket && WebSocket.OPEN === o.oWebSocket.readyState) {
o.oWebSocket.send(i)
} else {
t()
}
});
return e
}
}, {
key: "parseCmd",
value: function s(e) {
var t = e.cmd;
var n = t.split(".");
var i = n[1];
if ("window" === n[0] || "video" === n[0]) {
if (this.oWindowControlCallback[i]) {
this.oWindowControlCallback[i](e)
}
}
}
}]);
return n
}();
return e
}();
t.WebSocketRequest = o
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.ImageHttpRequest = undefined;
var d = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
var i = n(1);
var v = o(i);
var r = n(32);
var p = o(r);
var m = n(2);
function o(e) {
return e && e.__esModule ? e : {
"default": e
}
}
function y(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var a = function() {
var e = function() {
function n(e) {
y(this, n);
var t = {
iPort: -1,
cbConnectSuccess: null,
cbConnectError: null,
cbConnectClose: null
};
this.oOptions = $.extend(t, e);
this.szHost = "http://127.0.0.1";
this.szUUID = "";
this.szVersion = "";
this.bNormalClose = false;
this.bConnected = false;
this.bInitConnect = true;
this.iGetErrorCount = 0;
this.oWindowControlCallback = {};
this.oUIControlCallback = {};
this.init()
}
d(n, [{
key: "init",
value: function a() {
var n = this;
var e = v["default"].v4();
var t = {
sequence: e,
cmd: "system.webconnect"
};
var i = JSON.stringify(t);
n.sendImageHttp(n.szHost + ":" + n.oOptions.iPort + "/imghttp/local", i, e, {
success: function r(e) {
if (!e) {
return
}
var t = JSON.parse(e);
n.szUUID = t.uuid;
n.szVersion = t.version;
n.bConnected = true;
n.bInitConnect = false;
setTimeout(function() {
n.imageHttpPolling()
}, 100);
if (n.oOptions.cbConnectSuccess) {
n.oOptions.cbConnectSuccess()
}
},
error: function o() {}
})
}
}, {
key: "sendImageHttp",
value: function h(i, e, t, r) {
var o = this;
var n = {
success: null,
error: null,
abort: null
};
r = $.extend(n, r);
var a = encodeURIComponent(btoa(p["default"].deflate(e)));
var s = this.splitStr(a);
var u = [];
var l = "";
for (var f = 0, c = s.length; f < c; f++) {
if (f === c - 1) {
l = "update=" + (new Date).getTime() + "&isLast=true&data=" + s[f] + "&sequence=" + t
} else {
l = "update=" + (new Date).getTime() + "&isLast=false&data=" + s[f] + "&sequence=" + t
}
u.push(l)
}
if (u.length > 0) {
var d = function d() {
o.imageHttp(i + "?" + u[0], {
success: function t(e) {
u.shift();
if (u.length > 0) {
if (o.bInitConnect || o.bConnected) {
d()
}
} else {
if (r.success) {
r.success(e)
}
}
},
error: function e() {
if (r.error) {
r.error()
}
},
abort: function n() {
if (r.abort) {
r.abort()
}
}
})
};
d()
}
}
}, {
key: "splitStr",
value: function s(e) {
var t = this.getByteLen(e);
var n = [];
var i = 1500;
for (var r = 0, o = Math.ceil(t / i); r < o; r++) {
n[r] = e.slice(i * r, i * (r + 1))
}
return n
}
}, {
key: "getByteLen",
value: function o(e) {
var t = 0;
var n = "";
for (var i = 0, r = e.length; i < r; i++) {
n = e.charAt(i);
if (/[^\x20-\xff]/.test(n)) {
t += 2
} else {
t += 1
}
}
return t
}
}, {
key: "imageHttp",
value: function i(e, f) {
var t = {
success: null,
error: null,
abort: null
};
f = $.extend(t, f);
var c = new Image;
c.onload = function() {
if (f.success) {
var e = document.createElement("canvas");
var t = e.getContext("2d");
var n = c.width;
var i = c.height;
e.width = n;
e.height = i;
try {
t.drawImage(c, 0, 0);
var r = t.getImageData(0, 0, n, i).data;
var o = "";
var a = -1;
for (var s = i - 1; s >= 0; s--) {
for (var u = 0; u < n * 4; u++) {
a = s * n * 4 + u;
if (0 === r[a]) {
break
} else if (255 === r[a]) {
continue
} else {
o += String.fromCharCode(r[a])
}
}
}
f.success(m.oUtils.utf8to16(o))
} catch (l) {
if (f.error) {
f.error()
}
}
}
};
c.onerror = function() {
if (f.error) {
f.error()
}
};
c.onabort = function() {
if (f.abort) {
f.abort()
}
};
c.crossOrigin = "anonymous";
c.src = e
}
}, {
key: "setWindowControlCallback",
value: function t(e) {
this.oWindowControlCallback = e
}
}, {
key: "getServiceVersion",
value: function e() {
return this.szVersion
}
}, {
key: "getRequestUUID",
value: function r() {
return this.szUUID
}
}, {
key: "disconnect",
value: function u() {
var e = this;
var t = v["default"].v4();
var n = {
sequence: t,
uuid: e.szUUID,
cmd: "system.disconnect"
};
var i = JSON.stringify(n);
if (e.bConnected) {
e.sendImageHttp(e.szHost + ":" + e.oOptions.iPort + "/imghttp/local", i, t, {
success: function r() {
e.bNormalClose = true;
e.bConnected = false
},
error: function o() {
e.bConnected = false
}
})
}
}
}, {
key: "imageHttpPolling",
value: function l() {
var n = this;
var e = v["default"].v4();
var t = {
sequence: e,
uuid: n.szUUID,
cmd: "system.get"
};
var i = JSON.stringify(t);
if (n.bConnected) {
n.sendImageHttp(n.szHost + ":" + n.oOptions.iPort + "/imghttp/local", i, e, {
success: function r(e) {
n.iGetErrorCount = 0;
if ("timeout" === e) {
setTimeout(function() {
n.imageHttpPolling()
}, 100)
} else if ("invalid" === e) {
n.bConnected = false;
if (n.oOptions.cbConnectError) {
n.oOptions.cbConnectError()
}
} else {
var t = JSON.parse(e);
if (typeof t.cmd !== "undefined") {
n.parseCmd(t)
} else {}
setTimeout(function() {
n.imageHttpPolling()
}, 100)
}
},
error: function o() {
if (5 === n.iGetErrorCount) {
n.bNormalClose = false;
n.bConnected = false;
if (n.oOptions.cbConnectClose) {
n.oOptions.cbConnectClose(n.bNormalClose)
}
} else {
setTimeout(function() {
n.iGetErrorCount++;
n.imageHttpPolling()
}, 100)
}
}
})
}
}
}, {
key: "sendRequest",
value: function f(u) {
var l = this;
var e = new Promise(function(n, i) {
var e = u.cmd.split(".");
var t = "";
if (e.length > 1) {
t = "laputa" === e[0] ? "laputa" : "local"
} else {
i()
}
var r = v["default"].v4();
u.sequence = r;
u.uuid = l.szUUID;
u.timestamp = (new Date).getTime() + "";
var o = JSON.stringify(u);
if (l.bConnected) {
l.sendImageHttp(l.szHost + ":" + l.oOptions.iPort + "/imghttp/" + t, o, r, {
success: function a(e) {
if (!e) {
return
}
var t = JSON.parse(e);
if (0 === t.errorCode) {
n(t)
} else {
i(t)
}
},
error: function s() {
i()
}
})
} else {
i()
}
});
return e
}
}, {
key: "parseCmd",
value: function c(e) {
var t = e.cmd;
var n = t.split(".");
var i = n[1];
if ("window" === n[0] || "video" === n[0]) {
if (this.oWindowControlCallback[i]) {
this.oWindowControlCallback[i](e)
}
}
}
}]);
return n
}();
return e
}();
t.ImageHttpRequest = a
}, function(e, t, n) {
"use strict";
var i = n(0).assign;
var r = n(33);
var o = n(36);
var a = n(11);
var s = {};
i(s, r, o, a);
e.exports = s
}, function(e, t, n) {
"use strict";
var a = n(34);
var s = n(0);
var u = n(9);
var r = n(3);
var o = n(10);
var l = Object.prototype.toString;
var f = 0;
var c = 4;
var d = 0;
var h = 1;
var v = 2;
var p = -1;
var m = 0;
var y = 8;
function S(e) {
if (!(this instanceof S)) return new S(e);
this.options = s.assign({
level: p,
method: y,
chunkSize: 16384,
windowBits: 15,
memLevel: 8,
strategy: m,
to: ""
}, e || {});
var t = this.options;
if (t.raw && t.windowBits > 0) {
t.windowBits = -t.windowBits
} else if (t.gzip && t.windowBits > 0 && t.windowBits < 16) {
t.windowBits += 16
}
this.err = 0;
this.msg = "";
this.ended = false;
this.chunks = [];
this.strm = new o;
this.strm.avail_out = 0;
var n = a.deflateInit2(this.strm, t.level, t.method, t.windowBits, t.memLevel, t.strategy);
if (n !== d) {
throw new Error(r[n])
}
if (t.header) {
a.deflateSetHeader(this.strm, t.header)
}
if (t.dictionary) {
var i;
if (typeof t.dictionary === "string") {
i = u.string2buf(t.dictionary)
} else if (l.call(t.dictionary) === "[object ArrayBuffer]") {
i = new Uint8Array(t.dictionary)
} else {
i = t.dictionary
}
n = a.deflateSetDictionary(this.strm, i);
if (n !== d) {
throw new Error(r[n])
}
this._dict_set = true
}
}
S.prototype.push = function(e, t) {
var n = this.strm;
var i = this.options.chunkSize;
var r, o;
if (this.ended) {
return false
}
o = t === ~~t ? t : t === true ? c : f;
if (typeof e === "string") {
n.input = u.string2buf(e)
} else if (l.call(e) === "[object ArrayBuffer]") {
n.input = new Uint8Array(e)
} else {
n.input = e
}
n.next_in = 0;
n.avail_in = n.input.length;
do {
if (n.avail_out === 0) {
n.output = new s.Buf8(i);
n.next_out = 0;
n.avail_out = i
}
r = a.deflate(n, o);
if (r !== h && r !== d) {
this.onEnd(r);
this.ended = true;
return false
}
if (n.avail_out === 0 || n.avail_in === 0 && (o === c || o === v)) {
if (this.options.to === "string") {
this.onData(u.buf2binstring(s.shrinkBuf(n.output, n.next_out)))
} else {
this.onData(s.shrinkBuf(n.output, n.next_out))
}
}
} while ((n.avail_in > 0 || n.avail_out === 0) && r !== h);
if (o === c) {
r = a.deflateEnd(this.strm);
this.onEnd(r);
this.ended = true;
return r === d
}
if (o === v) {
this.onEnd(d);
n.avail_out = 0;
return true
}
return true
};
S.prototype.onData = function(e) {
this.chunks.push(e)
};
S.prototype.onEnd = function(e) {
if (e === d) {
if (this.options.to === "string") {
this.result = this.chunks.join("")
} else {
this.result = s.flattenChunks(this.chunks)
}
}
this.chunks = [];
this.err = e;
this.msg = this.strm.msg
};
function i(e, t) {
var n = new S(t);
n.push(e, true);
if (n.err) {
throw n.msg || r[n.err]
}
return n.result
}
function g(e, t) {
t = t || {};
t.raw = true;
return i(e, t)
}
function _(e, t) {
t = t || {};
t.gzip = true;
return i(e, t)
}
t.Deflate = S;
t.deflate = i;
t.deflateRaw = g;
t.gzip = _
}, function(e, t, n) {
"use strict";
var c = n(0);
var l = n(35);
var d = n(7);
var f = n(8);
var i = n(3);
var h = 0;
var v = 1;
var p = 3;
var m = 4;
var y = 5;
var S = 0;
var g = 1;
var _ = -2;
var r = -3;
var P = -5;
var u = -1;
var o = 1;
var w = 2;
var b = 3;
var k = 4;
var a = 0;
var s = 2;
var C = 8;
var R = 9;
var I = 15;
var T = 8;
var D = 29;
var x = 256;
var M = x + 1 + D;
var E = 30;
var z = 19;
var O = 2 * M + 1;
var F = 15;
var q = 3;
var W = 258;
var J = W + q + 1;
var L = 32;
var A = 42;
var B = 69;
var U = 73;
var $ = 91;
var H = 103;
var N = 113;
var G = 666;
var V = 1;
var j = 2;
var X = 3;
var Y = 4;
var Z = 3;
function K(e, t) {
e.msg = i[t];
return t
}
function Q(e) {
return (e << 1) - (e > 4 ? 9 : 0)
}
function ee(e) {
var t = e.length;
while (--t >= 0) {
e[t] = 0
}
}
function te(e) {
var t = e.state;
var n = t.pending;
if (n > e.avail_out) {
n = e.avail_out
}
if (n === 0) {
return
}
c.arraySet(e.output, t.pending_buf, t.pending_out, n, e.next_out);
e.next_out += n;
t.pending_out += n;
e.total_out += n;
e.avail_out -= n;
t.pending -= n;
if (t.pending === 0) {
t.pending_out = 0
}
}
function ne(e, t) {
l._tr_flush_block(e, e.block_start >= 0 ? e.block_start : -1, e.strstart - e.block_start, t);
e.block_start = e.strstart;
te(e.strm)
}
function ie(e, t) {
e.pending_buf[e.pending++] = t
}
function re(e, t) {
e.pending_buf[e.pending++] = t >>> 8 & 255;
e.pending_buf[e.pending++] = t & 255
}
function oe(e, t, n, i) {
var r = e.avail_in;
if (r > i) {
r = i
}
if (r === 0) {
return 0
}
e.avail_in -= r;
c.arraySet(t, e.input, e.next_in, r, n);
if (e.state.wrap === 1) {
e.adler = d(e.adler, t, r, n)
} else if (e.state.wrap === 2) {
e.adler = f(e.adler, t, r, n)
}
e.next_in += r;
e.total_in += r;
return r
}
function ae(e, t) {
var n = e.max_chain_length;
var i = e.strstart;
var r;
var o;
var a = e.prev_length;
var s = e.nice_match;
var u = e.strstart > e.w_size - J ? e.strstart - (e.w_size - J) : 0;
var l = e.window;
var f = e.w_mask;
var c = e.prev;
var d = e.strstart + W;
var h = l[i + a - 1];
var v = l[i + a];
if (e.prev_length >= e.good_match) {
n >>= 2
}
if (s > e.lookahead) {
s = e.lookahead
}
do {
r = t;
if (l[r + a] !== v || l[r + a - 1] !== h || l[r] !== l[i] || l[++r] !== l[i + 1]) {
continue
}
i += 2;
r++;
do {} while (l[++i] === l[++r] && l[++i] === l[++r] && l[++i] === l[++r] && l[++i] === l[++r] && l[++i] === l[++r] && l[++i] === l[++r] && l[++i] === l[++r] && l[++i] === l[++r] && i < d);
o = W - (d - i);
i = d - W;
if (o > a) {
e.match_start = t;
a = o;
if (o >= s) {
break
}
h = l[i + a - 1];
v = l[i + a]
}
} while ((t = c[t & f]) > u && --n !== 0);
if (a <= e.lookahead) {
return a
}
return e.lookahead
}
function se(e) {
var t = e.w_size;
var n, i, r, o, a;
do {
o = e.window_size - e.lookahead - e.strstart;
if (e.strstart >= t + (t - J)) {
c.arraySet(e.window, e.window, t, t, 0);
e.match_start -= t;
e.strstart -= t;
e.block_start -= t;
i = e.hash_size;
n = i;
do {
r = e.head[--n];
e.head[n] = r >= t ? r - t : 0
} while (--i);
i = t;
n = i;
do {
r = e.prev[--n];
e.prev[n] = r >= t ? r - t : 0
}
while (--i);
o += t
}
if (e.strm.avail_in === 0) {
break
}
i = oe(e.strm, e.window, e.strstart + e.lookahead, o);
e.lookahead += i;
if (e.lookahead + e.insert >= q) {
a = e.strstart - e.insert;
e.ins_h = e.window[a];
e.ins_h = (e.ins_h << e.hash_shift ^ e.window[a + 1]) & e.hash_mask;
while (e.insert) {
e.ins_h = (e.ins_h << e.hash_shift ^ e.window[a + q - 1]) & e.hash_mask;
e.prev[a & e.w_mask] = e.head[e.ins_h];
e.head[e.ins_h] = a;
a++;
e.insert--;
if (e.lookahead + e.insert < q) {
break
}
}
}
} while (e.lookahead < J && e.strm.avail_in !== 0)
}
function ue(e, t) {
var n = 65535;
if (n > e.pending_buf_size - 5) {
n = e.pending_buf_size - 5
}
for (;;) {
if (e.lookahead <= 1) {
se(e);
if (e.lookahead === 0 && t === h) {
return V
}
if (e.lookahead === 0) {
break
}
}
e.strstart += e.lookahead;
e.lookahead = 0;
var i = e.block_start + n;
if (e.strstart === 0 || e.strstart >= i) {
e.lookahead = e.strstart - i;
e.strstart = i;
ne(e, false);
if (e.strm.avail_out === 0) {
return V
}
}
if (e.strstart - e.block_start >= e.w_size - J) {
ne(e, false);
if (e.strm.avail_out === 0) {
return V
}
}
}
e.insert = 0;
if (t === m) {
ne(e, true);
if (e.strm.avail_out === 0) {
return X
}
return Y
}
if (e.strstart > e.block_start) {
ne(e, false);
if (e.strm.avail_out === 0) {
return V
}
}
return V
}
function le(e, t) {
var n;
var i;
for (;;) {
if (e.lookahead < J) {
se(e);
if (e.lookahead < J && t === h) {
return V
}
if (e.lookahead === 0) {
break
}
}
n = 0;
if (e.lookahead >= q) {
e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + q - 1]) & e.hash_mask;
n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h];
e.head[e.ins_h] = e.strstart
}
if (n !== 0 && e.strstart - n <= e.w_size - J) {
e.match_length = ae(e, n)
}
if (e.match_length >= q) {
i = l._tr_tally(e, e.strstart - e.match_start, e.match_length - q);
e.lookahead -= e.match_length;
if (e.match_length <= e.max_lazy_match && e.lookahead >= q) {
e.match_length--;
do {
e.strstart++;
e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + q - 1]) & e.hash_mask;
n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h];
e.head[e.ins_h] = e.strstart
} while (--e.match_length !== 0);
e.strstart++
} else {
e.strstart += e.match_length;
e.match_length = 0;
e.ins_h = e.window[e.strstart];
e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + 1]) & e.hash_mask
}
} else {
i = l._tr_tally(e, 0, e.window[e.strstart]);
e.lookahead--;
e.strstart++
}
if (i) {
ne(e, false);
if (e.strm.avail_out === 0) {
return V
}
}
}
e.insert = e.strstart < q - 1 ? e.strstart : q - 1;
if (t === m) {
ne(e, true);
if (e.strm.avail_out === 0) {
return X
}
return Y
}
if (e.last_lit) {
ne(e, false);
if (e.strm.avail_out === 0) {
return V
}
}
return j
}
function fe(e, t) {
var n;
var i;
var r;
for (;;) {
if (e.lookahead < J) {
se(e);
if (e.lookahead < J && t === h) {
return V
}
if (e.lookahead === 0) {
break
}
}
n = 0;
if (e.lookahead >= q) {
e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + q - 1]) & e.hash_mask;
n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h];
e.head[e.ins_h] = e.strstart
}
e.prev_length = e.match_length;
e.prev_match = e.match_start;
e.match_length = q - 1;
if (n !== 0 && e.prev_length < e.max_lazy_match && e.strstart - n <= e.w_size - J) {
e.match_length = ae(e, n);
if (e.match_length <= 5 && (e.strategy === o || e.match_length === q && e.strstart - e.match_start > 4096)) {
e.match_length = q - 1
}
}
if (e.prev_length >= q && e.match_length <= e.prev_length) {
r = e.strstart + e.lookahead - q;
i = l._tr_tally(e, e.strstart - 1 - e.prev_match, e.prev_length - q);
e.lookahead -= e.prev_length - 1;
e.prev_length -= 2;
do {
if (++e.strstart <= r) {
e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + q - 1]) & e.hash_mask;
n = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h];
e.head[e.ins_h] = e.strstart
}
} while (--e.prev_length !== 0);
e.match_available = 0;
e.match_length = q - 1;
e.strstart++;
if (i) {
ne(e, false);
if (e.strm.avail_out === 0) {
return V
}
}
} else if (e.match_available) {
i = l._tr_tally(e, 0, e.window[e.strstart - 1]);
if (i) {
ne(e, false)
}
e.strstart++;
e.lookahead--;
if (e.strm.avail_out === 0) {
return V
}
} else {
e.match_available = 1;
e.strstart++;
e.lookahead--
}
}
if (e.match_available) {
i = l._tr_tally(e, 0, e.window[e.strstart - 1]);
e.match_available = 0
}
e.insert = e.strstart < q - 1 ? e.strstart : q - 1;
if (t === m) {
ne(e, true);
if (e.strm.avail_out === 0) {
return X
}
return Y
}
if (e.last_lit) {
ne(e, false);
if (e.strm.avail_out === 0) {
return V
}
}
return j
}
function ce(e, t) {
var n;
var i;
var r, o;
var a = e.window;
for (;;) {
if (e.lookahead <= W) {
se(e);
if (e.lookahead <= W && t === h) {
return V
}
if (e.lookahead === 0) {
break
}
}
e.match_length = 0;
if (e.lookahead >= q && e.strstart > 0) {
r = e.strstart - 1;
i = a[r];
if (i === a[++r] && i === a[++r] && i === a[++r]) {
o = e.strstart + W;
do {} while (i === a[++r] && i === a[++r] && i === a[++r] && i === a[++r] && i === a[++r] && i === a[++r] && i === a[++r] && i === a[++r] && r < o);
e.match_length = W - (o - r);
if (e.match_length > e.lookahead) {
e.match_length = e.lookahead
}
}
}
if (e.match_length >= q) {
n = l._tr_tally(e, 1, e.match_length - q);
e.lookahead -= e.match_length;
e.strstart += e.match_length;
e.match_length = 0
} else {
n = l._tr_tally(e, 0, e.window[e.strstart]);
e.lookahead--;
e.strstart++
}
if (n) {
ne(e, false);
if (e.strm.avail_out === 0) {
return V
}
}
}
e.insert = 0;
if (t === m) {
ne(e, true);
if (e.strm.avail_out === 0) {
return X
}
return Y
}
if (e.last_lit) {
ne(e, false);
if (e.strm.avail_out === 0) {
return V
}
}
return j
}
function de(e, t) {
var n;
for (;;) {
if (e.lookahead === 0) {
se(e);
if (e.lookahead === 0) {
if (t === h) {
return V
}
break
}
}
e.match_length = 0;
n = l._tr_tally(e, 0, e.window[e.strstart]);
e.lookahead--;
e.strstart++;
if (n) {
ne(e, false);
if (e.strm.avail_out === 0) {
return V
}
}
}
e.insert = 0;
if (t === m) {
ne(e, true);
if (e.strm.avail_out === 0) {
return X
}
return Y
}
if (e.last_lit) {
ne(e, false);
if (e.strm.avail_out === 0) {
return V
}
}
return j
}
function he(e, t, n, i, r) {
this.good_length = e;
this.max_lazy = t;
this.nice_length = n;
this.max_chain = i;
this.func = r
}
var ve;
ve = [new he(0, 0, 0, 0, ue), new he(4, 4, 8, 4, le), new he(4, 5, 16, 8, le), new he(4, 6, 32, 32, le), new he(4, 4, 16, 16, fe), new he(8, 16, 32, 32, fe), new he(8, 16, 128, 128, fe), new he(8, 32, 128, 256, fe), new he(32, 128, 258, 1024, fe), new he(32, 258, 258, 4096, fe)];
function pe(e) {
e.window_size = 2 * e.w_size;
ee(e.head);
e.max_lazy_match = ve[e.level].max_lazy;
e.good_match = ve[e.level].good_length;
e.nice_match = ve[e.level].nice_length;
e.max_chain_length = ve[e.level].max_chain;
e.strstart = 0;
e.block_start = 0;
e.lookahead = 0;
e.insert = 0;
e.match_length = e.prev_length = q - 1;
e.match_available = 0;
e.ins_h = 0
}
function me() {
this.strm = null;
this.status = 0;
this.pending_buf = null;
this.pending_buf_size = 0;
this.pending_out = 0;
this.pending = 0;
this.wrap = 0;
this.gzhead = null;
this.gzindex = 0;
this.method = C;
this.last_flush = -1;
this.w_size = 0;
this.w_bits = 0;
this.w_mask = 0;
this.window = null;
this.window_size = 0;
this.prev = null;
this.head = null;
this.ins_h = 0;
this.hash_size = 0;
this.hash_bits = 0;
this.hash_mask = 0;
this.hash_shift = 0;
this.block_start = 0;
this.match_length = 0;
this.prev_match = 0;
this.match_available = 0;
this.strstart = 0;
this.match_start = 0;
this.lookahead = 0;
this.prev_length = 0;
this.max_chain_length = 0;
this.max_lazy_match = 0;
this.level = 0;
this.strategy = 0;
this.good_match = 0;
this.nice_match = 0;
this.dyn_ltree = new c.Buf16(O * 2);
this.dyn_dtree = new c.Buf16((2 * E + 1) * 2);
this.bl_tree = new c.Buf16((2 * z + 1) * 2);
ee(this.dyn_ltree);
ee(this.dyn_dtree);
ee(this.bl_tree);
this.l_desc = null;
this.d_desc = null;
this.bl_desc = null;
this.bl_count = new c.Buf16(F + 1);
this.heap = new c.Buf16(2 * M + 1);
ee(this.heap);
this.heap_len = 0;
this.heap_max = 0;
this.depth = new c.Buf16(2 * M + 1);
ee(this.depth);
this.l_buf = 0;
this.lit_bufsize = 0;
this.last_lit = 0;
this.d_buf = 0;
this.opt_len = 0;
this.static_len = 0;
this.matches = 0;
this.insert = 0;
this.bi_buf = 0;
this.bi_valid = 0
}
function ye(e) {
var t;
if (!e || !e.state) {
return K(e, _)
}
e.total_in = e.total_out = 0;
e.data_type = s;
t = e.state;
t.pending = 0;
t.pending_out = 0;
if (t.wrap < 0) {
t.wrap = -t.wrap
}
t.status = t.wrap ? A : N;
e.adler = t.wrap === 2 ? 0 : 1;
t.last_flush = h;
l._tr_init(t);
return S
}
function Se(e) {
var t = ye(e);
if (t === S) {
pe(e.state)
}
return t
}
function ge(e, t) {
if (!e || !e.state) {
return _
}
if (e.state.wrap !== 2) {
return _
}
e.state.gzhead = t;
return S
}
function _e(e, t, n, i, r, o) {
if (!e) {
return _
}
var a = 1;
if (t === u) {
t = 6
}
if (i < 0) {
a = 0;
i = -i
} else if (i > 15) {
a = 2;
i -= 16
}
if (r < 1 || r > R || n !== C || i < 8 || i > 15 || t < 0 || t > 9 || o < 0 || o > k) {
return K(e, _)
}
if (i === 8) {
i = 9
}
var s = new me;
e.state = s;
s.strm = e;
s.wrap = a;
s.gzhead = null;
s.w_bits = i;
s.w_size = 1 << s.w_bits;
s.w_mask = s.w_size - 1;
s.hash_bits = r + 7;
s.hash_size = 1 << s.hash_bits;
s.hash_mask = s.hash_size - 1;
s.hash_shift = ~~((s.hash_bits + q - 1) / q);
s.window = new c.Buf8(s.w_size * 2);
s.head = new c.Buf16(s.hash_size);
s.prev = new c.Buf16(s.w_size);
s.lit_bufsize = 1 << r + 6;
s.pending_buf_size = s.lit_bufsize * 4;
s.pending_buf = new c.Buf8(s.pending_buf_size);
s.d_buf = 1 * s.lit_bufsize;
s.l_buf = (1 + 2) * s.lit_bufsize;
s.level = t;
s.strategy = o;
s.method = n;
return Se(e)
}
function Pe(e, t) {
return _e(e, t, C, I, T, a)
}
function we(e, t) {
var n, i;
var r, o;
if (!e || !e.state || t > y || t < 0) {
return e ? K(e, _) : _
}
i = e.state;
if (!e.output || !e.input && e.avail_in !== 0 || i.status === G && t !== m) {
return K(e, e.avail_out === 0 ? P : _)
}
i.strm = e;
n = i.last_flush;
i.last_flush = t;
if (i.status === A) {
if (i.wrap === 2) {
e.adler = 0;
ie(i, 31);
ie(i, 139);
ie(i, 8);
if (!i.gzhead) {
ie(i, 0);
ie(i, 0);
ie(i, 0);
ie(i, 0);
ie(i, 0);
ie(i, i.level === 9 ? 2 : i.strategy >= w || i.level < 2 ? 4 : 0);
ie(i, Z);
i.status = N
} else {
ie(i, (i.gzhead.text ? 1 : 0) + (i.gzhead.hcrc ? 2 : 0) + (!i.gzhead.extra ? 0 : 4) + (!i.gzhead.name ? 0 : 8) + (!i.gzhead.comment ? 0 : 16));
ie(i, i.gzhead.time & 255);
ie(i, i.gzhead.time >> 8 & 255);
ie(i, i.gzhead.time >> 16 & 255);
ie(i, i.gzhead.time >> 24 & 255);
ie(i, i.level === 9 ? 2 : i.strategy >= w || i.level < 2 ? 4 : 0);
ie(i, i.gzhead.os & 255);
if (i.gzhead.extra && i.gzhead.extra.length) {
ie(i, i.gzhead.extra.length & 255);
ie(i, i.gzhead.extra.length >> 8 & 255)
}
if (i.gzhead.hcrc) {
e.adler = f(e.adler, i.pending_buf, i.pending, 0)
}
i.gzindex = 0;
i.status = B
}
} else {
var a = C + (i.w_bits - 8 << 4) << 8;
var s = -1;
if (i.strategy >= w || i.level < 2) {
s = 0
} else if (i.level < 6) {
s = 1
} else if (i.level === 6) {
s = 2
} else {
s = 3
}
a |= s << 6;
if (i.strstart !== 0) {
a |= L
}
a += 31 - a % 31;
i.status = N;
re(i, a);
if (i.strstart !== 0) {
re(i, e.adler >>> 16);
re(i, e.adler & 65535)
}
e.adler = 1
}
}
if (i.status === B) {
if (i.gzhead.extra) {
r = i.pending;
while (i.gzindex < (i.gzhead.extra.length & 65535)) {
if (i.pending === i.pending_buf_size) {
if (i.gzhead.hcrc && i.pending > r) {
e.adler = f(e.adler, i.pending_buf, i.pending - r, r)
}
te(e);
r = i.pending;
if (i.pending === i.pending_buf_size) {
break
}
}
ie(i, i.gzhead.extra[i.gzindex] & 255);
i.gzindex++
}
if (i.gzhead.hcrc && i.pending > r) {
e.adler = f(e.adler, i.pending_buf, i.pending - r, r)
}
if (i.gzindex === i.gzhead.extra.length) {
i.gzindex = 0;
i.status = U
}
} else {
i.status = U
}
}
if (i.status === U) {
if (i.gzhead.name) {
r = i.pending;
do {
if (i.pending === i.pending_buf_size) {
if (i.gzhead.hcrc && i.pending > r) {
e.adler = f(e.adler, i.pending_buf, i.pending - r, r)
}
te(e);
r = i.pending;
if (i.pending === i.pending_buf_size) {
o = 1;
break
}
}
if (i.gzindex < i.gzhead.name.length) {
o = i.gzhead.name.charCodeAt(i.gzindex++) & 255
} else {
o = 0
}
ie(i, o)
} while (o !== 0);
if (i.gzhead.hcrc && i.pending > r) {
e.adler = f(e.adler, i.pending_buf, i.pending - r, r)
}
if (o === 0) {
i.gzindex = 0;
i.status = $
}
} else {
i.status = $
}
}
if (i.status === $) {
if (i.gzhead.comment) {
r = i.pending;
do {
if (i.pending === i.pending_buf_size) {
if (i.gzhead.hcrc && i.pending > r) {
e.adler = f(e.adler, i.pending_buf, i.pending - r, r)
}
te(e);
r = i.pending;
if (i.pending === i.pending_buf_size) {
o = 1;
break
}
}
if (i.gzindex < i.gzhead.comment.length) {
o = i.gzhead.comment.charCodeAt(i.gzindex++) & 255
} else {
o = 0
}
ie(i, o)
} while (o !== 0);
if (i.gzhead.hcrc && i.pending > r) {
e.adler = f(e.adler, i.pending_buf, i.pending - r, r)
}
if (o === 0) {
i.status = H
}
} else {
i.status = H
}
}
if (i.status === H) {
if (i.gzhead.hcrc) {
if (i.pending + 2 > i.pending_buf_size) {
te(e)
}
if (i.pending + 2 <= i.pending_buf_size) {
ie(i, e.adler & 255);
ie(i, e.adler >> 8 & 255);
e.adler = 0;
i.status = N
}
} else {
i.status = N
}
}
if (i.pending !== 0) {
te(e);
if (e.avail_out === 0) {
i.last_flush = -1;
return S
}
} else if (e.avail_in === 0 && Q(t) <= Q(n) && t !== m) {
return K(e, P)
}
if (i.status === G && e.avail_in !== 0) {
return K(e, P)
}
if (e.avail_in !== 0 || i.lookahead !== 0 || t !== h && i.status !== G) {
var u = i.strategy === w ? de(i, t) : i.strategy === b ? ce(i, t) : ve[i.level].func(i, t);
if (u === X || u === Y) {
i.status = G
}
if (u === V || u === X) {
if (e.avail_out === 0) {
i.last_flush = -1
}
return S
}
if (u === j) {
if (t === v) {
l._tr_align(i)
} else if (t !== y) {
l._tr_stored_block(i, 0, 0, false);
if (t === p) {
ee(i.head);
if (i.lookahead === 0) {
i.strstart = 0;
i.block_start = 0;
i.insert = 0
}
}
}
te(e);
if (e.avail_out === 0) {
i.last_flush = -1;
return S
}
}
}
if (t !== m) {
return S
}
if (i.wrap <= 0) {
return g
}
if (i.wrap === 2) {
ie(i, e.adler & 255);
ie(i, e.adler >> 8 & 255);
ie(i, e.adler >> 16 & 255);
ie(i, e.adler >> 24 & 255);
ie(i, e.total_in & 255);
ie(i, e.total_in >> 8 & 255);
ie(i, e.total_in >> 16 & 255);
ie(i, e.total_in >> 24 & 255)
} else {
re(i, e.adler >>> 16);
re(i, e.adler & 65535)
}
te(e);
if (i.wrap > 0) {
i.wrap = -i.wrap
}
return i.pending !== 0 ? S : g
}
function be(e) {
var t;
if (!e || !e.state) {
return _
}
t = e.state.status;
if (t !== A && t !== B && t !== U && t !== $ && t !== H && t !== N && t !== G) {
return K(e, _)
}
e.state = null;
return t === N ? K(e, r) : S
}
function ke(e, t) {
var n = t.length;
var i;
var r, o;
var a;
var s;
var u;
var l;
var f;
if (!e || !e.state) {
return _
}
i = e.state;
a = i.wrap;
if (a === 2 || a === 1 && i.status !== A || i.lookahead) {
return _
}
if (a === 1) {
e.adler = d(e.adler, t, n, 0)
}
i.wrap = 0;
if (n >= i.w_size) {
if (a === 0) {
ee(i.head);
i.strstart = 0;
i.block_start = 0;
i.insert = 0
}
f = new c.Buf8(i.w_size);
c.arraySet(f, t, n - i.w_size, i.w_size, 0);
t = f;
n = i.w_size
}
s = e.avail_in;
u = e.next_in;
l = e.input;
e.avail_in = n;
e.next_in = 0;
e.input = t;
se(i);
while (i.lookahead >= q) {
r = i.strstart;
o = i.lookahead - (q - 1);
do {
i.ins_h = (i.ins_h << i.hash_shift ^ i.window[r + q - 1]) & i.hash_mask;
i.prev[r & i.w_mask] = i.head[i.ins_h];
i.head[i.ins_h] = r;
r++
} while (--o);
i.strstart = r;
i.lookahead = q - 1;
se(i)
}
i.strstart += i.lookahead;
i.block_start = i.strstart;
i.insert = i.lookahead;
i.lookahead = 0;
i.match_length = i.prev_length = q - 1;
i.match_available = 0;
e.next_in = u;
e.input = l;
e.avail_in = s;
i.wrap = a;
return S
}
t.deflateInit = Pe;
t.deflateInit2 = _e;
t.deflateReset = Se;
t.deflateResetKeep = ye;
t.deflateSetHeader = ge;
t.deflate = we;
t.deflateEnd = be;
t.deflateSetDictionary = ke;
t.deflateInfo = "pako deflate (from Nodeca project)"
}, function(e, t, n) {
"use strict";
var r = n(0);
var s = 4;
var i = 0;
var o = 1;
var u = 2;
function a(e) {
var t = e.length;
while (--t >= 0) {
e[t] = 0
}
}
var l = 0;
var f = 1;
var c = 2;
var d = 3;
var h = 258;
var v = 29;
var p = 256;
var m = p + 1 + v;
var y = 30;
var S = 19;
var g = 2 * m + 1;
var _ = 15;
var P = 16;
var w = 7;
var b = 256;
var k = 16;
var C = 17;
var R = 18;
var I = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0];
var T = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
var D = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];
var x = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
var M = 512;
var E = new Array((m + 2) * 2);
a(E);
var z = new Array(y * 2);
a(z);
var O = new Array(M);
a(O);
var F = new Array(h - d + 1);
a(F);
var q = new Array(v);
a(q);
var W = new Array(y);
a(W);
function J(e, t, n, i, r) {
this.static_tree = e;
this.extra_bits = t;
this.extra_base = n;
this.elems = i;
this.max_length = r;
this.has_stree = e && e.length
}
var L;
var A;
var B;
function U(e, t) {
this.dyn_tree = e;
this.max_code = 0;
this.stat_desc = t
}
function $(e) {
return e < 256 ? O[e] : O[256 + (e >>> 7)]
}
function H(e, t) {
e.pending_buf[e.pending++] = t & 255;
e.pending_buf[e.pending++] = t >>> 8 & 255
}
function N(e, t, n) {
if (e.bi_valid > P - n) {
e.bi_buf |= t << e.bi_valid & 65535;
H(e, e.bi_buf);
e.bi_buf = t >> P - e.bi_valid;
e.bi_valid += n - P
} else {
e.bi_buf |= t << e.bi_valid & 65535;
e.bi_valid += n
}
}
function G(e, t, n) {
N(e, n[t * 2], n[t * 2 + 1])
}
function V(e, t) {
var n = 0;
do {
n |= e & 1;
e >>>= 1;
n <<= 1
} while (--t > 0);
return n >>> 1
}
function j(e) {
if (e.bi_valid === 16) {
H(e, e.bi_buf);
e.bi_buf = 0;
e.bi_valid = 0
} else if (e.bi_valid >= 8) {
e.pending_buf[e.pending++] = e.bi_buf & 255;
e.bi_buf >>= 8;
e.bi_valid -= 8
}
}
function X(e, t) {
var n = t.dyn_tree;
var i = t.max_code;
var r = t.stat_desc.static_tree;
var o = t.stat_desc.has_stree;
var a = t.stat_desc.extra_bits;
var s = t.stat_desc.extra_base;
var u = t.stat_desc.max_length;
var l;
var f, c;
var d;
var h;
var v;
var p = 0;
for (d = 0; d <= _; d++) {
e.bl_count[d] = 0
}
n[e.heap[e.heap_max] * 2 + 1] = 0;
for (l = e.heap_max + 1; l < g; l++) {
f = e.heap[l];
d = n[n[f * 2 + 1] * 2 + 1] + 1;
if (d > u) {
d = u;
p++
}
n[f * 2 + 1] = d;
if (f > i) {
continue
}
e.bl_count[d] ++;
h = 0;
if (f >= s) {
h = a[f - s]
}
v = n[f * 2];
e.opt_len += v * (d + h);
if (o) {
e.static_len += v * (r[f * 2 + 1] + h)
}
}
if (p === 0) {
return
}
do {
d = u - 1;
while (e.bl_count[d] === 0) {
d--
}
e.bl_count[d] --;
e.bl_count[d + 1] += 2;
e.bl_count[u] --;
p -= 2
} while (p > 0);
for (d = u; d !== 0; d--) {
f = e.bl_count[d];
while (f !== 0) {
c = e.heap[--l];
if (c > i) {
continue
}
if (n[c * 2 + 1] !== d) {
e.opt_len += (d - n[c * 2 + 1]) * n[c * 2];
n[c * 2 + 1] = d
}
f--
}
}
}
function Y(e, t, n) {
var i = new Array(_ + 1);
var r = 0;
var o;
var a;
for (o = 1; o <= _; o++) {
i[o] = r = r + n[o - 1] << 1
}
for (a = 0; a <= t; a++) {
var s = e[a * 2 + 1];
if (s === 0) {
continue
}
e[a * 2] = V(i[s] ++, s)
}
}
function Z() {
var e;
var t;
var n;
var i;
var r;
var o = new Array(_ + 1);
n = 0;
for (i = 0; i < v - 1; i++) {
q[i] = n;
for (e = 0; e < 1 << I[i]; e++) {
F[n++] = i
}
}
F[n - 1] = i;
r = 0;
for (i = 0; i < 16; i++) {
W[i] = r;
for (e = 0; e < 1 << T[i]; e++) {
O[r++] = i
}
}
r >>= 7;
for (; i < y; i++) {
W[i] = r << 7;
for (e = 0; e < 1 << T[i] - 7; e++) {
O[256 + r++] = i
}
}
for (t = 0; t <= _; t++) {
o[t] = 0
}
e = 0;
while (e <= 143) {
E[e * 2 + 1] = 8;
e++;
o[8] ++
}
while (e <= 255) {
E[e * 2 + 1] = 9;
e++;
o[9] ++
}
while (e <= 279) {
E[e * 2 + 1] = 7;
e++;
o[7] ++
}
while (e <= 287) {
E[e * 2 + 1] = 8;
e++;
o[8] ++
}
Y(E, m + 1, o);
for (e = 0; e < y; e++) {
z[e * 2 + 1] = 5;
z[e * 2] = V(e, 5)
}
L = new J(E, I, p + 1, m, _);
A = new J(z, T, 0, y, _);
B = new J(new Array(0), D, 0, S, w)
}
function K(e) {
var t;
for (t = 0; t < m; t++) {
e.dyn_ltree[t * 2] = 0
}
for (t = 0; t < y; t++) {
e.dyn_dtree[t * 2] = 0
}
for (t = 0; t < S; t++) {
e.bl_tree[t * 2] = 0
}
e.dyn_ltree[b * 2] = 1;
e.opt_len = e.static_len = 0;
e.last_lit = e.matches = 0
}
function Q(e) {
if (e.bi_valid > 8) {
H(e, e.bi_buf)
} else if (e.bi_valid > 0) {
e.pending_buf[e.pending++] = e.bi_buf
}
e.bi_buf = 0;
e.bi_valid = 0
}
function ee(e, t, n, i) {
Q(e);
if (i) {
H(e, n);
H(e, ~n)
}
r.arraySet(e.pending_buf, e.window, t, n, e.pending);
e.pending += n
}
function te(e, t, n, i) {
var r = t * 2;
var o = n * 2;
return e[r] < e[o] || e[r] === e[o] && i[t] <= i[n]
}
function ne(e, t, n) {
var i = e.heap[n];
var r = n << 1;
while (r <= e.heap_len) {
if (r < e.heap_len && te(t, e.heap[r + 1], e.heap[r], e.depth)) {
r++
}
if (te(t, i, e.heap[r], e.depth)) {
break
}
e.heap[n] = e.heap[r];
n = r;
r <<= 1
}
e.heap[n] = i
}
function ie(e, t, n) {
var i;
var r;
var o = 0;
var a;
var s;
if (e.last_lit !== 0) {
do {
i = e.pending_buf[e.d_buf + o * 2] << 8 | e.pending_buf[e.d_buf + o * 2 + 1];
r = e.pending_buf[e.l_buf + o];
o++;
if (i === 0) {
G(e, r, t)
} else {
a = F[r];
G(e, a + p + 1, t);
s = I[a];
if (s !== 0) {
r -= q[a];
N(e, r, s)
}
i--;
a = $(i);
G(e, a, n);
s = T[a];
if (s !== 0) {
i -= W[a];
N(e, i, s)
}
}
} while (o < e.last_lit)
}
G(e, b, t)
}
function re(e, t) {
var n = t.dyn_tree;
var i = t.stat_desc.static_tree;
var r = t.stat_desc.has_stree;
var o = t.stat_desc.elems;
var a, s;
var u = -1;
var l;
e.heap_len = 0;
e.heap_max = g;
for (a = 0; a < o; a++) {
if (n[a * 2] !== 0) {
e.heap[++e.heap_len] = u = a;
e.depth[a] = 0
} else {
n[a * 2 + 1] = 0
}
}
while (e.heap_len < 2) {
l = e.heap[++e.heap_len] = u < 2 ? ++u : 0;
n[l * 2] = 1;
e.depth[l] = 0;
e.opt_len--;
if (r) {
e.static_len -= i[l * 2 + 1]
}
}
t.max_code = u;
for (a = e.heap_len >> 1; a >= 1; a--) {
ne(e, n, a)
}
l = o;
do {
a = e.heap[1];
e.heap[1] = e.heap[e.heap_len--];
ne(e, n, 1);
s = e.heap[1];
e.heap[--e.heap_max] = a;
e.heap[--e.heap_max] = s;
n[l * 2] = n[a * 2] + n[s * 2];
e.depth[l] = (e.depth[a] >= e.depth[s] ? e.depth[a] : e.depth[s]) + 1;
n[a * 2 + 1] = n[s * 2 + 1] = l;
e.heap[1] = l++;
ne(e, n, 1)
} while (e.heap_len >= 2);
e.heap[--e.heap_max] = e.heap[1];
X(e, t);
Y(n, u, e.bl_count)
}
function oe(e, t, n) {
var i;
var r = -1;
var o;
var a = t[0 * 2 + 1];
var s = 0;
var u = 7;
var l = 4;
if (a === 0) {
u = 138;
l = 3
}
t[(n + 1) * 2 + 1] = 65535;
for (i = 0; i <= n; i++) {
o = a;
a = t[(i + 1) * 2 + 1];
if (++s < u && o === a) {
continue
} else if (s < l) {
e.bl_tree[o * 2] += s
} else if (o !== 0) {
if (o !== r) {
e.bl_tree[o * 2] ++
}
e.bl_tree[k * 2] ++
} else if (s <= 10) {
e.bl_tree[C * 2] ++
} else {
e.bl_tree[R * 2] ++
}
s = 0;
r = o;
if (a === 0) {
u = 138;
l = 3
} else if (o === a) {
u = 6;
l = 3
} else {
u = 7;
l = 4
}
}
}
function ae(e, t, n) {
var i;
var r = -1;
var o;
var a = t[0 * 2 + 1];
var s = 0;
var u = 7;
var l = 4;
if (a === 0) {
u = 138;
l = 3
}
for (i = 0; i <= n; i++) {
o = a;
a = t[(i + 1) * 2 + 1];
if (++s < u && o === a) {
continue
} else if (s < l) {
do {
G(e, o, e.bl_tree)
} while (--s !== 0)
} else if (o !== 0) {
if (o !== r) {
G(e, o, e.bl_tree);
s--
}
G(e, k, e.bl_tree);
N(e, s - 3, 2)
} else if (s <= 10) {
G(e, C, e.bl_tree);
N(e, s - 3, 3)
} else {
G(e, R, e.bl_tree);
N(e, s - 11, 7)
}
s = 0;
r = o;
if (a === 0) {
u = 138;
l = 3
} else if (o === a) {
u = 6;
l = 3
} else {
u = 7;
l = 4
}
}
}
function se(e) {
var t;
oe(e, e.dyn_ltree, e.l_desc.max_code);
oe(e, e.dyn_dtree, e.d_desc.max_code);
re(e, e.bl_desc);
for (t = S - 1; t >= 3; t--) {
if (e.bl_tree[x[t] * 2 + 1] !== 0) {
break
}
}
e.opt_len += 3 * (t + 1) + 5 + 5 + 4;
return t
}
function ue(e, t, n, i) {
var r;
N(e, t - 257, 5);
N(e, n - 1, 5);
N(e, i - 4, 4);
for (r = 0; r < i; r++) {
N(e, e.bl_tree[x[r] * 2 + 1], 3)
}
ae(e, e.dyn_ltree, t - 1);
ae(e, e.dyn_dtree, n - 1)
}
function le(e) {
var t = 4093624447;
var n;
for (n = 0; n <= 31; n++, t >>>= 1) {
if (t & 1 && e.dyn_ltree[n * 2] !== 0) {
return i
}
}
if (e.dyn_ltree[9 * 2] !== 0 || e.dyn_ltree[10 * 2] !== 0 || e.dyn_ltree[13 * 2] !== 0) {
return o
}
for (n = 32; n < p; n++) {
if (e.dyn_ltree[n * 2] !== 0) {
return o
}
}
return i
}
var fe = false;
function ce(e) {
if (!fe) {
Z();
fe = true
}
e.l_desc = new U(e.dyn_ltree, L);
e.d_desc = new U(e.dyn_dtree, A);
e.bl_desc = new U(e.bl_tree, B);
e.bi_buf = 0;
e.bi_valid = 0;
K(e)
}
function de(e, t, n, i) {
N(e, (l << 1) + (i ? 1 : 0), 3);
ee(e, t, n, true)
}
function he(e) {
N(e, f << 1, 3);
G(e, b, E);
j(e)
}
function ve(e, t, n, i) {
var r, o;
var a = 0;
if (e.level > 0) {
if (e.strm.data_type === u) {
e.strm.data_type = le(e)
}
re(e, e.l_desc);
re(e, e.d_desc);
a = se(e);
r = e.opt_len + 3 + 7 >>> 3;
o = e.static_len + 3 + 7 >>> 3;
if (o <= r) {
r = o
}
} else {
r = o = n + 5
}
if (n + 4 <= r && t !== -1) {
de(e, t, n, i)
} else if (e.strategy === s || o === r) {
N(e, (f << 1) + (i ? 1 : 0), 3);
ie(e, E, z)
} else {
N(e, (c << 1) + (i ? 1 : 0), 3);
ue(e, e.l_desc.max_code + 1, e.d_desc.max_code + 1, a + 1);
ie(e, e.dyn_ltree, e.dyn_dtree)
}
K(e);
if (i) {
Q(e)
}
}
function pe(e, t, n) {
e.pending_buf[e.d_buf + e.last_lit * 2] = t >>> 8 & 255;
e.pending_buf[e.d_buf + e.last_lit * 2 + 1] = t & 255;
e.pending_buf[e.l_buf + e.last_lit] = n & 255;
e.last_lit++;
if (t === 0) {
e.dyn_ltree[n * 2] ++
} else {
e.matches++;
t--;
e.dyn_ltree[(F[n] + p + 1) * 2] ++;
e.dyn_dtree[$(t) * 2] ++
}
return e.last_lit === e.lit_bufsize - 1
}
t._tr_init = ce;
t._tr_stored_block = de;
t._tr_flush_block = ve;
t._tr_tally = pe;
t._tr_align = he
}, function(e, t, n) {
"use strict";
var c = n(37);
var d = n(0);
var h = n(9);
var v = n(11);
var i = n(3);
var r = n(10);
var o = n(40);
var p = Object.prototype.toString;
function a(e) {
if (!(this instanceof a)) return new a(e);
this.options = d.assign({
chunkSize: 16384,
windowBits: 0,
to: ""
}, e || {});
var t = this.options;
if (t.raw && t.windowBits >= 0 && t.windowBits < 16) {
t.windowBits = -t.windowBits;
if (t.windowBits === 0) {
t.windowBits = -15
}
}
if (t.windowBits >= 0 && t.windowBits < 16 && !(e && e.windowBits)) {
t.windowBits += 32
}
if (t.windowBits > 15 && t.windowBits < 48) {
if ((t.windowBits & 15) === 0) {
t.windowBits |= 15
}
}
this.err = 0;
this.msg = "";
this.ended = false;
this.chunks = [];
this.strm = new r;
this.strm.avail_out = 0;
var n = c.inflateInit2(this.strm, t.windowBits);
if (n !== v.Z_OK) {
throw new Error(i[n])
}
this.header = new o;
c.inflateGetHeader(this.strm, this.header);
if (t.dictionary) {
if (typeof t.dictionary === "string") {
t.dictionary = h.string2buf(t.dictionary)
} else if (p.call(t.dictionary) === "[object ArrayBuffer]") {
t.dictionary = new Uint8Array(t.dictionary)
}
if (t.raw) {
n = c.inflateSetDictionary(this.strm, t.dictionary);
if (n !== v.Z_OK) {
throw new Error(i[n])
}
}
}
}
a.prototype.push = function(e, t) {
var n = this.strm;
var i = this.options.chunkSize;
var r = this.options.dictionary;
var o, a;
var s, u, l;
var f = false;
if (this.ended) {
return false
}
a = t === ~~t ? t : t === true ? v.Z_FINISH : v.Z_NO_FLUSH;
if (typeof e === "string") {
n.input = h.binstring2buf(e)
} else if (p.call(e) === "[object ArrayBuffer]") {
n.input = new Uint8Array(e)
} else {
n.input = e
}
n.next_in = 0;
n.avail_in = n.input.length;
do {
if (n.avail_out === 0) {
n.output = new d.Buf8(i);
n.next_out = 0;
n.avail_out = i
}
o = c.inflate(n, v.Z_NO_FLUSH);
if (o === v.Z_NEED_DICT && r) {
o = c.inflateSetDictionary(this.strm, r)
}
if (o === v.Z_BUF_ERROR && f === true) {
o = v.Z_OK;
f = false
}
if (o !== v.Z_STREAM_END && o !== v.Z_OK) {
this.onEnd(o);
this.ended = true;
return false
}
if (n.next_out) {
if (n.avail_out === 0 || o === v.Z_STREAM_END || n.avail_in === 0 && (a === v.Z_FINISH || a === v.Z_SYNC_FLUSH)) {
if (this.options.to === "string") {
s = h.utf8border(n.output, n.next_out);
u = n.next_out - s;
l = h.buf2string(n.output, s);
n.next_out = u;
n.avail_out = i - u;
if (u) {
d.arraySet(n.output, n.output, s, u, 0)
}
this.onData(l)
} else {
this.onData(d.shrinkBuf(n.output, n.next_out))
}
}
}
if (n.avail_in === 0 && n.avail_out === 0) {
f = true
}
} while ((n.avail_in > 0 || n.avail_out === 0) && o !== v.Z_STREAM_END);
if (o === v.Z_STREAM_END) {
a = v.Z_FINISH
}
if (a === v.Z_FINISH) {
o = c.inflateEnd(this.strm);
this.onEnd(o);
this.ended = true;
return o === v.Z_OK
}
if (a === v.Z_SYNC_FLUSH) {
this.onEnd(v.Z_OK);
n.avail_out = 0;
return true
}
return true
};
a.prototype.onData = function(e) {
this.chunks.push(e)
};
a.prototype.onEnd = function(e) {
if (e === v.Z_OK) {
if (this.options.to === "string") {
this.result = this.chunks.join("")
} else {
this.result = d.flattenChunks(this.chunks)
}
}
this.chunks = [];
this.err = e;
this.msg = this.strm.msg
};
function s(e, t) {
var n = new a(t);
n.push(e, true);
if (n.err) {
throw n.msg || i[n.err]
}
return n.result
}
function u(e, t) {
t = t || {};
t.raw = true;
return s(e, t)
}
t.Inflate = a;
t.inflate = s;
t.inflateRaw = u;
t.ungzip = s
}, function(e, t, n) {
"use strict";
var D = n(0);
var x = n(7);
var M = n(8);
var E = n(38);
var z = n(39);
var O = 0;
var F = 1;
var q = 2;
var W = 4;
var J = 5;
var L = 6;
var A = 0;
var B = 1;
var U = 2;
var $ = -2;
var H = -3;
var N = -4;
var G = -5;
var V = 8;
var j = 1;
var X = 2;
var Y = 3;
var Z = 4;
var K = 5;
var Q = 6;
var ee = 7;
var te = 8;
var ne = 9;
var ie = 10;
var re = 11;
var oe = 12;
var ae = 13;
var se = 14;
var ue = 15;
var le = 16;
var fe = 17;
var ce = 18;
var de = 19;
var he = 20;
var ve = 21;
var pe = 22;
var me = 23;
var ye = 24;
var Se = 25;
var ge = 26;
var _e = 27;
var Pe = 28;
var we = 29;
var be = 30;
var ke = 31;
var Ce = 32;
var i = 852;
var r = 592;
var o = 15;
var a = o;
function Re(e) {
return (e >>> 24 & 255) + (e >>> 8 & 65280) + ((e & 65280) << 8) + ((e & 255) << 24)
}
function s() {
this.mode = 0;
this.last = false;
this.wrap = 0;
this.havedict = false;
this.flags = 0;
this.dmax = 0;
this.check = 0;
this.total = 0;
this.head = null;
this.wbits = 0;
this.wsize = 0;
this.whave = 0;
this.wnext = 0;
this.window = null;
this.hold = 0;
this.bits = 0;
this.length = 0;
this.offset = 0;
this.extra = 0;
this.lencode = null;
this.distcode = null;
this.lenbits = 0;
this.distbits = 0;
this.ncode = 0;
this.nlen = 0;
this.ndist = 0;
this.have = 0;
this.next = null;
this.lens = new D.Buf16(320);
this.work = new D.Buf16(288);
this.lendyn = null;
this.distdyn = null;
this.sane = 0;
this.back = 0;
this.was = 0
}
function u(e) {
var t;
if (!e || !e.state) {
return $
}
t = e.state;
e.total_in = e.total_out = t.total = 0;
e.msg = "";
if (t.wrap) {
e.adler = t.wrap & 1
}
t.mode = j;
t.last = 0;
t.havedict = 0;
t.dmax = 32768;
t.head = null;
t.hold = 0;
t.bits = 0;
t.lencode = t.lendyn = new D.Buf32(i);
t.distcode = t.distdyn = new D.Buf32(r);
t.sane = 1;
t.back = -1;
return A
}
function l(e) {
var t;
if (!e || !e.state) {
return $
}
t = e.state;
t.wsize = 0;
t.whave = 0;
t.wnext = 0;
return u(e)
}
function f(e, t) {
var n;
var i;
if (!e || !e.state) {
return $
}
i = e.state;
if (t < 0) {
n = 0;
t = -t
} else {
n = (t >> 4) + 1;
if (t < 48) {
t &= 15
}
}
if (t && (t < 8 || t > 15)) {
return $
}
if (i.window !== null && i.wbits !== t) {
i.window = null
}
i.wrap = n;
i.wbits = t;
return l(e)
}
function c(e, t) {
var n;
var i;
if (!e) {
return $
}
i = new s;
e.state = i;
i.window = null;
n = f(e, t);
if (n !== A) {
e.state = null
}
return n
}
function d(e) {
return c(e, a)
}
var h = true;
var v, p;
function Ie(e) {
if (h) {
var t;
v = new D.Buf32(512);
p = new D.Buf32(32);
t = 0;
while (t < 144) {
e.lens[t++] = 8
}
while (t < 256) {
e.lens[t++] = 9
}
while (t < 280) {
e.lens[t++] = 7
}
while (t < 288) {
e.lens[t++] = 8
}
z(F, e.lens, 0, 288, v, 0, e.work, {
bits: 9
});
t = 0;
while (t < 32) {
e.lens[t++] = 5
}
z(q, e.lens, 0, 32, p, 0, e.work, {
bits: 5
});
h = false
}
e.lencode = v;
e.lenbits = 9;
e.distcode = p;
e.distbits = 5
}
function Te(e, t, n, i) {
var r;
var o = e.state;
if (o.window === null) {
o.wsize = 1 << o.wbits;
o.wnext = 0;
o.whave = 0;
o.window = new D.Buf8(o.wsize)
}
if (i >= o.wsize) {
D.arraySet(o.window, t, n - o.wsize, o.wsize, 0);
o.wnext = 0;
o.whave = o.wsize
} else {
r = o.wsize - o.wnext;
if (r > i) {
r = i
}
D.arraySet(o.window, t, n - i, r, o.wnext);
i -= r;
if (i) {
D.arraySet(o.window, t, n - i, i, 0);
o.wnext = i;
o.whave = o.wsize
} else {
o.wnext += r;
if (o.wnext === o.wsize) {
o.wnext = 0
}
if (o.whave < o.wsize) {
o.whave += r
}
}
}
return 0
}
function m(e, t) {
var n;
var i, r;
var o;
var a;
var s, u;
var l;
var f;
var c, d;
var h;
var v;
var p;
var m = 0;
var y, S, g;
var _, P, w;
var b;
var k;
var C = new D.Buf8(4);
var R;
var I;
var T = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
if (!e || !e.state || !e.output || !e.input && e.avail_in !== 0) {
return $
}
n = e.state;
if (n.mode === oe) {
n.mode = ae
}
a = e.next_out;
r = e.output;
u = e.avail_out;
o = e.next_in;
i = e.input;
s = e.avail_in;
l = n.hold;
f = n.bits;
c = s;
d = u;
k = A;
e: for (;;) {
switch (n.mode) {
case j:
if (n.wrap === 0) {
n.mode = ae;
break
}
while (f < 16) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
if (n.wrap & 2 && l === 35615) {
n.check = 0;
C[0] = l & 255;
C[1] = l >>> 8 & 255;
n.check = M(n.check, C, 2, 0);
l = 0;
f = 0;
n.mode = X;
break
}
n.flags = 0;
if (n.head) {
n.head.done = false
}
if (!(n.wrap & 1) || (((l & 255) << 8) + (l >> 8)) % 31) {
e.msg = "incorrect header check";
n.mode = be;
break
}
if ((l & 15) !== V) {
e.msg = "unknown compression method";
n.mode = be;
break
}
l >>>= 4;
f -= 4;
b = (l & 15) + 8;
if (n.wbits === 0) {
n.wbits = b
} else if (b > n.wbits) {
e.msg = "invalid window size";
n.mode = be;
break
}
n.dmax = 1 << b;
e.adler = n.check = 1;
n.mode = l & 512 ? ie : oe;
l = 0;
f = 0;
break;
case X:
while (f < 16) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
n.flags = l;
if ((n.flags & 255) !== V) {
e.msg = "unknown compression method";
n.mode = be;
break
}
if (n.flags & 57344) {
e.msg = "unknown header flags set";
n.mode = be;
break
}
if (n.head) {
n.head.text = l >> 8 & 1
}
if (n.flags & 512) {
C[0] = l & 255;
C[1] = l >>> 8 & 255;
n.check = M(n.check, C, 2, 0)
}
l = 0;
f = 0;
n.mode = Y;
case Y:
while (f < 32) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
if (n.head) {
n.head.time = l
}
if (n.flags & 512) {
C[0] = l & 255;
C[1] = l >>> 8 & 255;
C[2] = l >>> 16 & 255;
C[3] = l >>> 24 & 255;
n.check = M(n.check, C, 4, 0)
}
l = 0;
f = 0;
n.mode = Z;
case Z:
while (f < 16) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
if (n.head) {
n.head.xflags = l & 255;
n.head.os = l >> 8
}
if (n.flags & 512) {
C[0] = l & 255;
C[1] = l >>> 8 & 255;
n.check = M(n.check, C, 2, 0)
}
l = 0;
f = 0;
n.mode = K;
case K:
if (n.flags & 1024) {
while (f < 16) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
n.length = l;
if (n.head) {
n.head.extra_len = l
}
if (n.flags & 512) {
C[0] = l & 255;
C[1] = l >>> 8 & 255;
n.check = M(n.check, C, 2, 0)
}
l = 0;
f = 0
} else if (n.head) {
n.head.extra = null
}
n.mode = Q;
case Q:
if (n.flags & 1024) {
h = n.length;
if (h > s) {
h = s
}
if (h) {
if (n.head) {
b = n.head.extra_len - n.length;
if (!n.head.extra) {
n.head.extra = new Array(n.head.extra_len)
}
D.arraySet(n.head.extra, i, o, h, b)
}
if (n.flags & 512) {
n.check = M(n.check, i, h, o)
}
s -= h;
o += h;
n.length -= h
}
if (n.length) {
break e
}
}
n.length = 0;
n.mode = ee;
case ee:
if (n.flags & 2048) {
if (s === 0) {
break e
}
h = 0;
do {
b = i[o + h++];
if (n.head && b && n.length < 65536) {
n.head.name += String.fromCharCode(b)
}
} while (b && h < s);
if (n.flags & 512) {
n.check = M(n.check, i, h, o)
}
s -= h;
o += h;
if (b) {
break e
}
} else if (n.head) {
n.head.name = null
}
n.length = 0;
n.mode = te;
case te:
if (n.flags & 4096) {
if (s === 0) {
break e
}
h = 0;
do {
b = i[o + h++];
if (n.head && b && n.length < 65536) {
n.head.comment += String.fromCharCode(b)
}
} while (b && h < s);
if (n.flags & 512) {
n.check = M(n.check, i, h, o)
}
s -= h;
o += h;
if (b) {
break e
}
} else if (n.head) {
n.head.comment = null
}
n.mode = ne;
case ne:
if (n.flags & 512) {
while (f < 16) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
if (l !== (n.check & 65535)) {
e.msg = "header crc mismatch";
n.mode = be;
break
}
l = 0;
f = 0
}
if (n.head) {
n.head.hcrc = n.flags >> 9 & 1;
n.head.done = true
}
e.adler = n.check = 0;
n.mode = oe;
break;
case ie:
while (f < 32) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
e.adler = n.check = Re(l);
l = 0;
f = 0;
n.mode = re;
case re:
if (n.havedict === 0) {
e.next_out = a;
e.avail_out = u;
e.next_in = o;
e.avail_in = s;
n.hold = l;
n.bits = f;
return U
}
e.adler = n.check = 1;
n.mode = oe;
case oe:
if (t === J || t === L) {
break e
}
case ae:
if (n.last) {
l >>>= f & 7;
f -= f & 7;
n.mode = _e;
break
}
while (f < 3) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
n.last = l & 1;
l >>>= 1;
f -= 1;
switch (l & 3) {
case 0:
n.mode = se;
break;
case 1:
Ie(n);
n.mode = he;
if (t === L) {
l >>>= 2;
f -= 2;
break e
}
break;
case 2:
n.mode = fe;
break;
case 3:
e.msg = "invalid block type";
n.mode = be
}
l >>>= 2;
f -= 2;
break;
case se:
l >>>= f & 7;
f -= f & 7;
while (f < 32) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
if ((l & 65535) !== (l >>> 16 ^ 65535)) {
e.msg = "invalid stored block lengths";
n.mode = be;
break
}
n.length = l & 65535;
l = 0;
f = 0;
n.mode = ue;
if (t === L) {
break e
}
case ue:
n.mode = le;
case le:
h = n.length;
if (h) {
if (h > s) {
h = s
}
if (h > u) {
h = u
}
if (h === 0) {
break e
}
D.arraySet(r, i, o, h, a);
s -= h;
o += h;
u -= h;
a += h;
n.length -= h;
break
}
n.mode = oe;
break;
case fe:
while (f < 14) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
n.nlen = (l & 31) + 257;
l >>>= 5;
f -= 5;
n.ndist = (l & 31) + 1;
l >>>= 5;
f -= 5;
n.ncode = (l & 15) + 4;
l >>>= 4;
f -= 4;
if (n.nlen > 286 || n.ndist > 30) {
e.msg = "too many length or distance symbols";
n.mode = be;
break
}
n.have = 0;
n.mode = ce;
case ce:
while (n.have < n.ncode) {
while (f < 3) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
n.lens[T[n.have++]] = l & 7;
l >>>= 3;
f -= 3
}
while (n.have < 19) {
n.lens[T[n.have++]] = 0
}
n.lencode = n.lendyn;
n.lenbits = 7;
R = {
bits: n.lenbits
};
k = z(O, n.lens, 0, 19, n.lencode, 0, n.work, R);
n.lenbits = R.bits;
if (k) {
e.msg = "invalid code lengths set";
n.mode = be;
break
}
n.have = 0;
n.mode = de;
case de:
while (n.have < n.nlen + n.ndist) {
for (;;) {
m = n.lencode[l & (1 << n.lenbits) - 1];
y = m >>> 24;
S = m >>> 16 & 255;
g = m & 65535;
if (y <= f) {
break
}
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
if (g < 16) {
l >>>= y;
f -= y;
n.lens[n.have++] = g
} else {
if (g === 16) {
I = y + 2;
while (f < I) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
l >>>= y;
f -= y;
if (n.have === 0) {
e.msg = "invalid bit length repeat";
n.mode = be;
break
}
b = n.lens[n.have - 1];
h = 3 + (l & 3);
l >>>= 2;
f -= 2
} else if (g === 17) {
I = y + 3;
while (f < I) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
l >>>= y;
f -= y;
b = 0;
h = 3 + (l & 7);
l >>>= 3;
f -= 3
} else {
I = y + 7;
while (f < I) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
l >>>= y;
f -= y;
b = 0;
h = 11 + (l & 127);
l >>>= 7;
f -= 7
}
if (n.have + h > n.nlen + n.ndist) {
e.msg = "invalid bit length repeat";
n.mode = be;
break
}
while (h--) {
n.lens[n.have++] = b
}
}
}
if (n.mode === be) {
break
}
if (n.lens[256] === 0) {
e.msg = "invalid code -- missing end-of-block";
n.mode = be;
break
}
n.lenbits = 9;
R = {
bits: n.lenbits
};
k = z(F, n.lens, 0, n.nlen, n.lencode, 0, n.work, R);
n.lenbits = R.bits;
if (k) {
e.msg = "invalid literal/lengths set";
n.mode = be;
break
}
n.distbits = 6;
n.distcode = n.distdyn;
R = {
bits: n.distbits
};
k = z(q, n.lens, n.nlen, n.ndist, n.distcode, 0, n.work, R);
n.distbits = R.bits;
if (k) {
e.msg = "invalid distances set";
n.mode = be;
break
}
n.mode = he;
if (t === L) {
break e
}
case he:
n.mode = ve;
case ve:
if (s >= 6 && u >= 258) {
e.next_out = a;
e.avail_out = u;
e.next_in = o;
e.avail_in = s;
n.hold = l;
n.bits = f;
E(e, d);
a = e.next_out;
r = e.output;
u = e.avail_out;
o = e.next_in;
i = e.input;
s = e.avail_in;
l = n.hold;
f = n.bits;
if (n.mode === oe) {
n.back = -1
}
break
}
n.back = 0;
for (;;) {
m = n.lencode[l & (1 << n.lenbits) - 1];
y = m >>> 24;
S = m >>> 16 & 255;
g = m & 65535;
if (y <= f) {
break
}
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
if (S && (S & 240) === 0) {
_ = y;
P = S;
w = g;
for (;;) {
m = n.lencode[w + ((l & (1 << _ + P) - 1) >> _)];
y = m >>> 24;
S = m >>> 16 & 255;
g = m & 65535;
if (_ + y <= f) {
break
}
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
l >>>= _;
f -= _;
n.back += _
}
l >>>= y;
f -= y;
n.back += y;
n.length = g;
if (S === 0) {
n.mode = ge;
break
}
if (S & 32) {
n.back = -1;
n.mode = oe;
break
}
if (S & 64) {
e.msg = "invalid literal/length code";
n.mode = be;
break
}
n.extra = S & 15;
n.mode = pe;
case pe:
if (n.extra) {
I = n.extra;
while (f < I) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
n.length += l & (1 << n.extra) - 1;
l >>>= n.extra;
f -= n.extra;
n.back += n.extra
}
n.was = n.length;
n.mode = me;
case me:
for (;;) {
m = n.distcode[l & (1 << n.distbits) - 1];
y = m >>> 24;
S = m >>> 16 & 255;
g = m & 65535;
if (y <= f) {
break
}
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
if ((S & 240) === 0) {
_ = y;
P = S;
w = g;
for (;;) {
m = n.distcode[w + ((l & (1 << _ + P) - 1) >> _)];
y = m >>> 24;
S = m >>> 16 & 255;
g = m & 65535;
if (_ + y <= f) {
break
}
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
l >>>= _;
f -= _;
n.back += _
}
l >>>= y;
f -= y;
n.back += y;
if (S & 64) {
e.msg = "invalid distance code";
n.mode = be;
break
}
n.offset = g;
n.extra = S & 15;
n.mode = ye;
case ye:
if (n.extra) {
I = n.extra;
while (f < I) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
n.offset += l & (1 << n.extra) - 1;
l >>>= n.extra;
f -= n.extra;
n.back += n.extra
}
if (n.offset > n.dmax) {
e.msg = "invalid distance too far back";
n.mode = be;
break
}
n.mode = Se;
case Se:
if (u === 0) {
break e
}
h = d - u;
if (n.offset > h) {
h = n.offset - h;
if (h > n.whave) {
if (n.sane) {
e.msg = "invalid distance too far back";
n.mode = be;
break
}
}
if (h > n.wnext) {
h -= n.wnext;
v = n.wsize - h
} else {
v = n.wnext - h
}
if (h > n.length) {
h = n.length
}
p = n.window
} else {
p = r;
v = a - n.offset;
h = n.length
}
if (h > u) {
h = u
}
u -= h;
n.length -= h;
do {
r[a++] = p[v++]
} while (--h);
if (n.length === 0) {
n.mode = ve
}
break;
case ge:
if (u === 0) {
break e
}
r[a++] = n.length;
u--;
n.mode = ve;
break;
case _e:
if (n.wrap) {
while (f < 32) {
if (s === 0) {
break e
}
s--;
l |= i[o++] << f;
f += 8
}
d -= u;
e.total_out += d;
n.total += d;
if (d) {
e.adler = n.check = n.flags ? M(n.check, r, d, a - d) : x(n.check, r, d, a - d)
}
d = u;
if ((n.flags ? l : Re(l)) !== n.check) {
e.msg = "incorrect data check";
n.mode = be;
break
}
l = 0;
f = 0
}
n.mode = Pe;
case Pe:
if (n.wrap && n.flags) {
while (f < 32) {
if (s === 0) {
break e
}
s--;
l += i[o++] << f;
f += 8
}
if (l !== (n.total & 4294967295)) {
e.msg = "incorrect length check";
n.mode = be;
break
}
l = 0;
f = 0
}
n.mode = we;
case we:
k = B;
break e;
case be:
k = H;
break e;
case ke:
return N;
case Ce:
default:
return $
}
}
e.next_out = a;
e.avail_out = u;
e.next_in = o;
e.avail_in = s;
n.hold = l;
n.bits = f;
if (n.wsize || d !== e.avail_out && n.mode < be && (n.mode < _e || t !== W)) {
if (Te(e, e.output, e.next_out, d - e.avail_out)) {
n.mode = ke;
return N
}
}
c -= e.avail_in;
d -= e.avail_out;
e.total_in += c;
e.total_out += d;
n.total += d;
if (n.wrap && d) {
e.adler = n.check = n.flags ? M(n.check, r, d, e.next_out - d) : x(n.check, r, d, e.next_out - d)
}
e.data_type = n.bits + (n.last ? 64 : 0) + (n.mode === oe ? 128 : 0) + (n.mode === he || n.mode === ue ? 256 : 0);
if ((c === 0 && d === 0 || t === W) && k === A) {
k = G
}
return k
}
function y(e) {
if (!e || !e.state) {
return $
}
var t = e.state;
if (t.window) {
t.window = null
}
e.state = null;
return A
}
function S(e, t) {
var n;
if (!e || !e.state) {
return $
}
n = e.state;
if ((n.wrap & 2) === 0) {
return $
}
n.head = t;
t.done = false;
return A
}
function g(e, t) {
var n = t.length;
var i;
var r;
var o;
if (!e || !e.state) {
return $
}
i = e.state;
if (i.wrap !== 0 && i.mode !== re) {
return $
}
if (i.mode === re) {
r = 1;
r = x(r, t, n, 0);
if (r !== i.check) {
return H
}
}
o = Te(e, t, n, n);
if (o) {
i.mode = ke;
return N
}
i.havedict = 1;
return A
}
t.inflateReset = l;
t.inflateReset2 = f;
t.inflateResetKeep = u;
t.inflateInit = d;
t.inflateInit2 = c;
t.inflate = m;
t.inflateEnd = y;
t.inflateGetHeader = S;
t.inflateSetDictionary = g;
t.inflateInfo = "pako inflate (from Nodeca project)"
}, function(e, t, n) {
"use strict";
var I = 30;
var T = 12;
e.exports = function D(e, t) {
var n;
var i;
var r;
var o;
var a;
var s;
var u;
var l;
var f;
var c;
var d;
var h;
var v;
var p;
var m;
var y;
var S;
var g;
var _;
var P;
var w;
var b;
var k;
var C, R;
n = e.state;
i = e.next_in;
C = e.input;
r = i + (e.avail_in - 5);
o = e.next_out;
R = e.output;
a = o - (t - e.avail_out);
s = o + (e.avail_out - 257);
u = n.dmax;
l = n.wsize;
f = n.whave;
c = n.wnext;
d = n.window;
h = n.hold;
v = n.bits;
p = n.lencode;
m = n.distcode;
y = (1 << n.lenbits) - 1;
S = (1 << n.distbits) - 1;
e: do {
if (v < 15) {
h += C[i++] << v;
v += 8;
h += C[i++] << v;
v += 8
}
g = p[h & y];
t: for (;;) {
_ = g >>> 24;
h >>>= _;
v -= _;
_ = g >>> 16 & 255;
if (_ === 0) {
R[o++] = g & 65535
} else if (_ & 16) {
P = g & 65535;
_ &= 15;
if (_) {
if (v < _) {
h += C[i++] << v;
v += 8
}
P += h & (1 << _) - 1;
h >>>= _;
v -= _
}
if (v < 15) {
h += C[i++] << v;
v += 8;
h += C[i++] << v;
v += 8
}
g = m[h & S];
n: for (;;) {
_ = g >>> 24;
h >>>= _;
v -= _;
_ = g >>> 16 & 255;
if (_ & 16) {
w = g & 65535;
_ &= 15;
if (v < _) {
h += C[i++] << v;
v += 8;
if (v < _) {
h += C[i++] << v;
v += 8
}
}
w += h & (1 << _) - 1;
if (w > u) {
e.msg = "invalid distance too far back";
n.mode = I;
break e
}
h >>>= _;
v -= _;
_ = o - a;
if (w > _) {
_ = w - _;
if (_ > f) {
if (n.sane) {
e.msg = "invalid distance too far back";
n.mode = I;
break e
}
}
b = 0;
k = d;
if (c === 0) {
b += l - _;
if (_ < P) {
P -= _;
do {
R[o++] = d[b++]
} while (--_);
b = o - w;
k = R
}
} else if (c < _) {
b += l + c - _;
_ -= c;
if (_ < P) {
P -= _;
do {
R[o++] = d[b++]
} while (--_);
b = 0;
if (c < P) {
_ = c;
P -= _;
do {
R[o++] = d[b++]
} while (--_);
b = o - w;
k = R
}
}
} else {
b += c - _;
if (_ < P) {
P -= _;
do {
R[o++] = d[b++]
} while (--_);
b = o - w;
k = R
}
}
while (P > 2) {
R[o++] = k[b++];
R[o++] = k[b++];
R[o++] = k[b++];
P -= 3
}
if (P) {
R[o++] = k[b++];
if (P > 1) {
R[o++] = k[b++]
}
}
} else {
b = o - w;
do {
R[o++] = R[b++];
R[o++] = R[b++];
R[o++] = R[b++];
P -= 3
} while (P > 2);
if (P) {
R[o++] = R[b++];
if (P > 1) {
R[o++] = R[b++]
}
}
}
} else if ((_ & 64) === 0) {
g = m[(g & 65535) + (h & (1 << _) - 1)];
continue n
} else {
e.msg = "invalid distance code";
n.mode = I;
break e
}
break
}
} else if ((_ & 64) === 0) {
g = p[(g & 65535) + (h & (1 << _) - 1)];
continue t
} else if (_ & 32) {
n.mode = T;
break e
} else {
e.msg = "invalid literal/length code";
n.mode = I;
break e
}
break
}
} while (i < r && o < s);
P = v >> 3;
i -= P;
v -= P << 3;
h &= (1 << v) - 1;
e.next_in = i;
e.next_out = o;
e.avail_in = i < r ? 5 + (r - i) : 5 - (i - r);
e.avail_out = o < s ? 257 + (s - o) : 257 - (o - s);
n.hold = h;
n.bits = v;
return
}
}, function(e, t, n) {
"use strict";
var O = n(0);
var F = 15;
var q = 852;
var W = 592;
var J = 0;
var L = 1;
var A = 2;
var B = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0];
var U = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78];
var $ = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0];
var H = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64];
e.exports = function N(e, t, n, i, r, o, a, s) {
var u = s.bits;
var l = 0;
var f = 0;
var c = 0,
d = 0;
var h = 0;
var v = 0;
var p = 0;
var m = 0;
var y = 0;
var S = 0;
var g;
var _;
var P;
var w;
var b;
var k = null;
var C = 0;
var R;
var I = new O.Buf16(F + 1);
var T = new O.Buf16(F + 1);
var D = null;
var x = 0;
var M, E, z;
for (l = 0; l <= F; l++) {
I[l] = 0
}
for (f = 0; f < i; f++) {
I[t[n + f]] ++
}
h = u;
for (d = F; d >= 1; d--) {
if (I[d] !== 0) {
break
}
}
if (h > d) {
h = d
}
if (d === 0) {
r[o++] = 1 << 24 | 64 << 16 | 0;
r[o++] = 1 << 24 | 64 << 16 | 0;
s.bits = 1;
return 0
}
for (c = 1; c < d; c++) {
if (I[c] !== 0) {
break
}
}
if (h < c) {
h = c
}
m = 1;
for (l = 1; l <= F; l++) {
m <<= 1;
m -= I[l];
if (m < 0) {
return -1
}
}
if (m > 0 && (e === J || d !== 1)) {
return -1
}
T[1] = 0;
for (l = 1; l < F; l++) {
T[l + 1] = T[l] + I[l]
}
for (f = 0; f < i; f++) {
if (t[n + f] !== 0) {
a[T[t[n + f]] ++] = f
}
}
if (e === J) {
k = D = a;
R = 19
} else if (e === L) {
k = B;
C -= 257;
D = U;
x -= 257;
R = 256
} else {
k = $;
D = H;
R = -1
}
S = 0;
f = 0;
l = c;
b = o;
v = h;
p = 0;
P = -1;
y = 1 << h;
w = y - 1;
if (e === L && y > q || e === A && y > W) {
return 1
}
for (;;) {
M = l - p;
if (a[f] < R) {
E = 0;
z = a[f]
} else if (a[f] > R) {
E = D[x + a[f]];
z = k[C + a[f]]
} else {
E = 32 + 64;
z = 0
}
g = 1 << l - p;
_ = 1 << v;
c = _;
do {
_ -= g;
r[b + (S >> p) + _] = M << 24 | E << 16 | z | 0
} while (_ !== 0);
g = 1 << l - 1;
while (S & g) {
g >>= 1
}
if (g !== 0) {
S &= g - 1;
S += g
} else {
S = 0
}
f++;
if (--I[l] === 0) {
if (l === d) {
break
}
l = t[n + a[f]]
}
if (l > h && (S & w) !== P) {
if (p === 0) {
p = h
}
b += c;
v = l - p;
m = 1 << v;
while (v + p < d) {
m -= I[v + p];
if (m <= 0) {
break
}
v++;
m <<= 1
}
y += 1 << v;
if (e === L && y > q || e === A && y > W) {
return 1
}
P = S & w;
r[P] = h << 24 | v << 16 | b - o | 0
}
}
if (S !== 0) {
r[b + S] = l - p << 24 | 64 << 16 | 0
}
s.bits = h;
return 0
}
}, function(e, t, n) {
"use strict";
function i() {
this.text = 0;
this.time = 0;
this.xflags = 0;
this.os = 0;
this.extra = null;
this.extra_len = 0;
this.name = "";
this.comment = "";
this.hcrc = 0;
this.done = false
}
e.exports = i
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.WebChannelRequest = undefined;
var u = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
var i = n(1);
var l = r(i);
function r(e) {
return e && e.__esModule ? e : {
"default": e
}
}
function f(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var o = function() {
var e = function() {
function n(e) {
f(this, n);
var t = {
iPort: -1,
cbConnectSuccess: null,
cbConnectError: null,
cbConnectClose: null
};
this.oOptions = $.extend(t, e);
this.oWebChannel = null;
this.szUUID = "";
this.szVersion = "";
this.oRequestList = {};
this.bNormalClose = false;
this.oChannleObj = null;
this.oWindowControlCallback = {};
this.init()
}
u(n, [{
key: "init",
value: function e() {
var i = this;
this.oChannleObj = new window.QWebChannel(window.qt.webChannelTransport, function(e) {
i.oWebChannel = e.objects.document;
var n = l["default"].v4();
setTimeout(function() {
var e = {
sequence: n,
cmd: "system.webconnect"
};
var t = JSON.stringify(e);
i.oWebChannel.receiveText(t)
}, 500);
i.oWebChannel.textSent.connect(function(e) {
if (!e) {
return
}
var t = JSON.parse(e);
n = t.sequence;
if (typeof n === "undefined" && typeof t.cmd === "undefined") {
i.szUUID = t.uuid;
i.szVersion = t.version;
if (i.oOptions.cbConnectSuccess) {
i.oOptions.cbConnectSuccess()
}
} else {
if (typeof t.cmd !== "undefined") {
i.parseCmd(t)
} else {
if (typeof i.oRequestList[n] !== "undefined") {
if (0 === t.errorCode) {
i.oRequestList[n].resolve(t)
} else {
i.oRequestList[n].reject(t)
}
delete i.oRequestList[n]
}
}
}
})
})
}
}, {
key: "setWindowControlCallback",
value: function t(e) {
this.oWindowControlCallback = e
}
}, {
key: "getServiceVersion",
value: function i() {
return this.szVersion
}
}, {
key: "getRequestUUID",
value: function r() {
return this.szUUID
}
}, {
key: "disconnect",
value: function o() {}
}, {
key: "sendRequest",
value: function a(r) {
var o = this;
var e = new Promise(function(e, t) {
var n = l["default"].v4();
r.sequence = n;
o.oRequestList[n] = {
resolve: e,
reject: t
};
r.uuid = o.szUUID;
r.timestamp = (new Date).getTime() + "";
var i = JSON.stringify(r);
if (o.oWebChannel) {
o.oWebChannel.receiveText(i)
} else {
t()
}
});
return e
}
}, {
key: "parseCmd",
value: function s(e) {
var t = e.cmd;
var n = t.split(".");
var i = n[1];
if ("window" === n[0] || "video" === n[0]) {
if (this.oWindowControlCallback[i]) {
this.oWindowControlCallback[i](e)
}
}
}
}]);
return n
}();
return e
}();
t.WebChannelRequest = o
}, function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
t.ActiveXControl = undefined;
var pt = function() {
function i(e, t) {
for (var n = 0; n < t.length; n++) {
var i = t[n];
i.enumerable = i.enumerable || false;
i.configurable = true;
if ("value" in i) i.writable = true;
Object.defineProperty(e, i.key, i)
}
}
return function(e, t, n) {
if (t) i(e.prototype, t);
if (n) i(e, n);
return e
}
}();
var mt = n(12);
function yt(e, t) {
if (!(e instanceof t)) {
throw new TypeError("Cannot call a class as a function")
}
}
var i = function() {
var e = function() {
function r(e) {
yt(this, r);
var t = {
szId: "playWnd",
iType: 0,
iWidth: 400,
iHeight: 300,
iMaxSplit: 4,
iCurrentSplit: 2,
szPlayMode: "normal"
};
this.szClassId = "84BEAF29-6E6C-45a9-AC49-41AEE667BDF0";
this.oOptions = $.extend(t, e);
if (this.oOptions.szIframeId && $("#" + this.oOptions.szIframeId).length) {
this.oOptions.oId = $("#" + this.oOptions.szId, $("#" + this.oOptions.szIframeId)[0].contentWindow.document)
} else {
this.oOptions.oId = $("#" + this.oOptions.szId)
}
var n = "";
if (this.oOptions.bgColor) {
n += "plugin-background:" + this.oOptions.background + ";"
}
if (this.oOptions.borderColor) {
n += "sub-border:" + this.oOptions.borderColor + ";"
}
if (this.oOptions.wndBgColor) {
n += "sub-background:" + this.oOptions.wndBgColor + ";"
}
if (this.oOptions.selectColor) {
n += "sub-border-select:" + this.oOptions.selectColor + ";"
}
var i = "";
if (n) {
i = "<param name='colors' value='" + n + "'>"
}
this.oOptions.oId.html("<object classid='clsid:" + this.szClassId + "' codebase='' standby='Waiting...' " + "id='" + this.oOptions.szId + "_multiVideoActiveX' width='100%' height='100%' name='ocx' align='center' ><param name='wndtype' value='" + this.oOptions.iCurrentSplit + "'><param name='playmode' value='" + this.oOptions.szPlayMode + "'>" + i + "</object>");
this.oPlugin = this.oOptions.oId.find("#" + this.oOptions.szId + "_multiVideoActiveX")[0];
if (this.oPlugin === null || typeof this.oPlugin === "undefined") {
this.oPlugin = null
} else if (this.oPlugin.object === null || typeof this.oPlugin.object === "undefined") {
this.oPlugin = null
}
this.fCurrentCallback = null;
this.afCurrentCallback = [];
this.fPointCallback = null;
this.iProtocolType = 0;
this.oPluginCallback = {};
this.szPluginVersion = "V3.0.6.46"
}
pt(r, [{
key: "JS_CreateWnd",
value: function o(e, t, n) {
var i = this;
var r = $.Deferred();
setTimeout(function() {
i.oOptions.oId.html("<object classid='clsid:" + i.szClassId + "' codebase='' standby='Waiting...' " + "id='" + i.oOptions.szId + "_multiVideoActiveX' width='" + t + "' height='" + n + "' name='ocx' align='center' ><param name='wndtype' value='" + i.oOptions.iCurrentSplit + "'><param name='playmode' value='" + i.oOptions.szPlayMode + "'></object>");
i.oPlugin = i.oOptions.oId.find("#" + i.oOptions.szId + "_multiVideoActiveX")[0];
if (i.oPlugin === null || i.oPlugin.object === null) {
i.oPlugin = null
}
r.resolve()
}, 100);
return r.promise()
}
}, {
key: "JS_ShowWnd",
value: function n() {
var e = this;
var t = $.Deferred();
setTimeout(function() {
$("#" + e.oOptions.szId + "_multiVideoActiveX").show();
t.resolve()
}, 100);
return t.promise()
}
}, {
key: "JS_HideWnd",
value: function i() {
var e = this;
var t = $.Deferred();
setTimeout(function() {
$("#" + e.oOptions.szId + "_multiVideoActiveX").hide();
t.resolve()
}, 100);
return t.promise()
}
}, {
key: "JS_SetWndCover",
value: function t() {
var e = $.Deferred();
setTimeout(function() {
e.resolve()
}, 100);
return e.promise()
}
}, {
key: "JS_SetWindowControlCallback",
value: function a(e) {
var f = this;
var t = f.oOptions.szIframeId && $("#" + f.oOptions.szIframeId).length ? $("#" + f.oOptions.szIframeId)[0].contentWindow : window;
$.extend(this.oPluginCallback, e);
t.GetSelectWndInfo = function(e) {
var t = mt.oUtils.parseXmlFromStr(e);
var n = parseInt($(t).find("SelectWnd").eq(0).text(), 10);
if (0 <= n) {
f.fCurrentCallback = f.afCurrentCallback[n]
}
if (f.oPluginCallback.onGetSelectWndInfo) {
f.oPluginCallback.onGetSelectWndInfo(n)
}
};
t.PluginEventHandler = function(e, t, n) {
if (e === 69) {
var i = f.oPlugin.HWP_GetDrawLineInfo(t);
var r = mt.oUtils.parseXmlFromStr(i);
var o = [];
$(r).find("RegionCoordinates").each(function() {
var e = parseFloat($(this).find("positionX").text());
var t = 1 - parseFloat($(this).find("positionY").text());
o.push([e, t])
});
var a = "Line";
if (o.length > 3) {
a = "Polygon"
}
if (f.fCurrentCallback) {
f.fCurrentCallback({
id: 1,
type: a,
points: o
})
}
} else if (e === 14) {
f.oPluginCallback.onPluginEventHandler && f.oPluginCallback.onPluginEventHandler(e, t)
} else if (e === 67) {
f.oPluginCallback.onDrawEvent && f.oPluginCallback.onDrawEvent({
id: parseInt(t, 10),
type: "Line",
event: "choosed"
})
} else if (e === 68) {
var s = "Polygon";
if (0 === parseInt(n, 10)) {
s = "Rect"
}
f.oPluginCallback.onDrawEvent && f.oPluginCallback.onDrawEvent({
id: parseInt(t, 10),
type: s,
event: "choosed"
})
} else if (e === 70) {
var u = "Polygon";
if (0 === parseInt(n, 10)) {
u = "Rect"
}
f.oPluginCallback.onDrawEvent && f.oPluginCallback.onDrawEvent({
id: parseInt(t, 10),
type: u,
event: "drawEnd"
})
} else {
f.oPluginCallback.onPluginEventHandler && f.oPluginCallback.onPluginEventHandler(t, e)
}
};
t.ZoomInfoCallback = function(e) {
var t = mt.oUtils.parseXmlFromStr(e);
var n = [];
var i = 0;
var r = 0;
var o = 0;
var a = 0;
i = parseInt($(t).find("StartPoint").eq(0).find("positionX").eq(0).text(), 10) / 255;
r = parseInt($(t).find("StartPoint").eq(0).find("positionY").eq(0).text(), 10) / 255;
o = parseInt($(t).find("EndPoint").eq(0).find("positionX").eq(0).text(), 10) / 255;
a = parseInt($(t).find("EndPoint").eq(0).find("positionY").eq(0).text(), 10) / 255;
n = [
[i, r],
[o, r],
[o, a],
[i, a]
];
if (f.fCurrentCallback) {
f.fCurrentCallback({
id: 1,
type: "Rect",
points: n
}, e)
}
};
t.EZoomInfoCallback = function(e) {
var t = mt.oUtils.parseXmlFromStr(e);
var n = [];
var i = 0;
var r = 0;
var o = 0;
var a = 0;
i = parseInt($(t).find("StartPoint").eq(0).find("positionX").eq(0).text(), 10) / 255;
r = parseInt($(t).find("StartPoint").eq(0).find("positionY").eq(0).text(), 10) / 255;
o = parseInt($(t).find("EndPoint").eq(0).find("positionX").eq(0).text(), 10) / 255;
a = parseInt($(t).find("EndPoint").eq(0).find("positionY").eq(0).text(), 10) / 255;
n = [
[i, r],
[o, r],
[o, a],
[i, a]
];
if (f.fCurrentCallback) {
f.fCurrentCallback({
id: 1,
type: "Rect",
points: n
}, e)
}
};
t.GetFishPTZInfo = function(e) {
var t = mt.oUtils.parseXmlFromStr(e);
var n = parseInt($(t).find("infoType").eq(0).text(), 10);
var i = parseInt($(t).find("WndType").eq(0).text(), 10);
var r = $(t).find("id").eq(0).text();
var o = [parseFloat($(t).find("posX").eq(0).text()), parseFloat($(t).find("posY").eq(0).text())];
var a = [parseFloat($(t).find("pos2X").eq(0).text()), parseFloat($(t).find("pos2Y").eq(0).text())];
var s = parseInt($(t).find("pointSequence").eq(0).text(), 10);
var u = parseInt($(t).find("tracSequence").eq(0).text(), 10);
var l = {
type: n,
windowType: i,
id: r,
position: o,
originPosition: a,
pointId: s,
traceId: u
};
if (f.oPluginCallback.onFisheyePTZInfo) {
f.oPluginCallback.onFisheyePTZInfo(l)
}
};
t.KeyBoardEvent = function(e) {
var t = mt.oUtils.parseXmlFromStr(e);
var n = parseInt($(t).find("keyCode").eq(0).text(), 10);
if (n === 27) {
if (f.oPluginCallback.onFullScreenChange) {
f.oPluginCallback.onFullScreenChange(false)
}
}
};
t.MouseEvent = function(e) {
var t = mt.oUtils.parseXmlFromStr(e);
var n = parseInt($(t).find("WndIndex").eq(0).text(), 10);
var i = parseInt($(t).find("EventType").eq(0).text(), 10);
var r = parseFloat($(t).find("Position").eq(0).find("x").eq(0).text());
var o = parseFloat($(t).find("Position").eq(0).find("y").eq(0).text());
if (f.oPluginCallback.onMouseEvent) {
f.oPluginCallback.onMouseEvent({
wndIndex: n,
eventType: i,
point: [r, o]
})
}
if (f.fPointCallback && i === 1) {
f.fPointCallback({
id: 1,
eventType: i,
point: [r, o]
})
}
};
t.SetZeroChanEnlarge = function(e) {
var t = mt.oUtils.parseXmlFromStr(e);
var n = parseInt($(t).find("BeState").eq(0).text(), 10);
var i = parseInt($(t).find("MCP_x").eq(0).text(), 10);
var r = parseInt($(t).find("MCP_y").eq(0).text(), 10);
if (f.oPluginCallback.onZeroEnlargeState) {
f.oPluginCallback.onZeroEnlargeState({
state: n,
x: i,
y: r
})
}
}
}
}, {
key: "JS_ArrangeWindow",
value: function s(e, t) {
var n = $.Deferred();
if (t && t.length > 0) {
var i = '<?xml version="1.0" encoding="UTF-8"?><CustomWindowList>';
$.each(t, function(e, t) {
i += "<CustomWindow>\n <id>" + (e + 1) + "</id>\n <windowType>0</windowType>\n <EditType>" + (t.dragable ? 1 : 0) + "</EditType>\n <color><r>255</r><g>0</g><b>0</b></color>\n <StartPos><x>" + t.left + "</x><y>" + t.top + "</y></StartPos>\n <WHLength><width>" + t.width + "</width><height>" + t.height + "</height></WHLength>\n <zIndex>" + t.layer + "</zIndex>\n </CustomWindow>"
});
i += "</CustomWindowList>";
this.oPlugin.HWP_ArrangeCustomWindow(i)
} else {
this.oPlugin.HWP_ArrangeWindow(e)
}
setTimeout(function() {
n.resolve()
}, 100);
return n.promise()
}
}, {
key: "JS_SetSecretKey",
value: function u(e, t, n) {
var i = $.Deferred();
var r = this.oPlugin.HWP_SetSecretKey(n, t);
setTimeout(function() {
if (r < 0) {
i.reject()
} else {
i.resolve()
}
}, 100);
return i.promise()
}
}, {
key: "JS_GetEncryptString",
value: function l(e, t, n) {
var i = $.Deferred();
var r = 0;
r = this.oPlugin.HWP_SetOriginalString(t, n, "");
var o = this.oPlugin.HWP_GetEncryptString(e);
setTimeout(function() {
if (r < 0) {
i.reject()
} else {
i.resolve(o)
}
}, 100);
return i.promise()
}
}, {
key: "JS_GetDecryptString",
value: function e(t, n, i) {
var r = this;
var o = $.Deferred();
setTimeout(function() {
if (!i) {
o.reject();
return
}
var e = r.oPlugin.HWP_GetDecryptString(t, n, i);
o.resolve(e)
}, 100);
return o.promise()
}
}, {
key: "JS_SetOriginalString",
value: function f(e, t) {
var n = $.Deferred();
var i = this.oPlugin.HWP_SetOriginalString(e, t, "");
setTimeout(function() {
if (i < 0) {
n.reject()
} else {
n.resolve()
}
}, 100);
return n.promise()
}
}, {
key: "JS_DestroyPlugin",
value: function c() {
var e = $.Deferred();
$("#" + this.oOptions.szId + "_multiVideoActiveX").remove();
this.oPlugin = null;
this.oPluginCallback = {};
setTimeout(function() {
e.resolve()
}, 100);
return e.promise()
}
}, {
key: "JS_Play",
value: function d(e, t, n, i, r) {
var o = $.Deferred();
var a = this;
var s = this.oPlugin.HWP_Play(e, t.auth, n, i, r);
setTimeout(function() {
if (s < 0) {
s = a.oPlugin.HWP_GetLastError();
o.reject(s)
} else {
o.resolve()
}
}, 100);
return o.promise()
}
}, {
key: "JS_ReversePlay",
value: function h(e, t, n, i, r) {
var o = this;
var a = $.Deferred();
var s = o.oPlugin.HWP_ReversePlay(e, t.auth, n, i, r);
setTimeout(function() {
if (s < 0) {
s = o.oPlugin.HWP_GetLastError();
a.reject(s)
} else {
a.resolve()
}
}, 100);
return a.promise()
}
}, {
key: "JS_Stop",
value: function v(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_Stop(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_Seek",
value: function p() {
var e = $.Deferred();
setTimeout(function() {
e.resolve()
}, 100);
return e.promise()
}
}, {
key: "JS_StopRealPlayAll",
value: function m() {
var e = $.Deferred();
var t = this.oPlugin.StopRealPlayAll();
setTimeout(function() {
if (t < 0) {
e.reject()
} else {
e.resolve()
}
}, 100);
return e.promise()
}
}, {
key: "JS_Pause",
value: function y(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_Pause(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_Resume",
value: function S(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_Resume(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_Slow",
value: function g(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_Slow(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_Fast",
value: function _(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_Fast(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_Transmission",
value: function P() {
var e = $.Deferred();
setTimeout(function() {
e.resolve()
}, 100);
return e.promise()
}
}, {
key: "JS_FrameForward",
value: function w(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_FrameForward(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_GetOSDTime",
value: function b(e) {
var t = $.Deferred();
var n = -1;
n = this.oPlugin.HWP_GetOSDTime(e);
setTimeout(function() {
if (n < 0 || !n) {
t.reject()
} else {
t.resolve(n)
}
}, 100);
return t.promise()
}
}, {
key: "JS_OpenSound",
value: function k(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_OpenSound(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_CloseSound",
value: function C() {
var e = $.Deferred();
var t = this.oPlugin.HWP_CloseSound();
setTimeout(function() {
if (t < 0) {
e.reject()
} else {
e.resolve()
}
}, 100);
return e.promise()
}
}, {
key: "JS_GetVolume",
value: function R(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_GetVolume(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve(n)
}
}, 100);
return t.promise()
}
}, {
key: "JS_SetVolume",
value: function I(e, t) {
var n = $.Deferred();
var i = this.oPlugin.HWP_SetVolume(e, t);
setTimeout(function() {
if (i < 0) {
n.reject()
} else {
n.resolve()
}
}, 100);
return n.promise()
}
}, {
key: "JS_EnableZoom",
value: function T(e, t) {
var n = $.Deferred();
var i = this.oPlugin.HWP_EnableZoom(e, t);
setTimeout(function() {
if (i < 0) {
n.reject()
} else {
n.resolve()
}
}, 100);
return n.promise()
}
}, {
key: "JS_DisableZoom",
value: function D(e) {
var t = $.Deferred();
this.oPlugin.HWP_DisableZoom(e);
setTimeout(function() {
t.resolve()
}, 100);
return t.promise()
}
}, {
key: "JS_CapturePicture",
value: function x(e, t) {
var n = this;
var i = $.Deferred();
t = t.replace(/playback_/g, "");
var r = n.oPlugin.HWP_CapturePicture(e, t);
setTimeout(function() {
if (r < 0) {
r = n.oPlugin.HWP_GetLastError();
i.reject(r)
} else {
i.resolve()
}
}, 100);
return i.promise()
}
}, {
key: "JS_StartSave",
value: function M(e, t) {
var n = this;
var i = $.Deferred();
var r = n.oPlugin.HWP_StartSave(e, t);
setTimeout(function() {
if (r < 0) {
i.reject(r)
} else {
i.resolve()
}
}, 100);
return i.promise()
}
}, {
key: "JS_StopSave",
value: function E(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_StopSave(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_StartTalk",
value: function z(e, t, n, i, r, o, a, s, u) {
var l = $.Deferred();
var f = this.oPlugin.HWP_StartVoiceTalk_V20(e, t, n, i, r, o, a, s, u);
setTimeout(function() {
if (f < 0) {
l.reject()
} else {
l.resolve()
}
}, 100);
return l.promise()
}
}, {
key: "JS_StopTalk",
value: function O() {
var e = $.Deferred();
this.oPlugin.HWP_StopVoiceTalk();
setTimeout(function() {
e.resolve()
}, 100);
return e.promise()
}
}, {
key: "JS_SetPlayMode",
value: function F(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_SetPlayModeType(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_SetFullScreenCapability",
value: function q(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_SetCanFullScreen(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_FullScreenDisplay",
value: function W(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_FullScreenDisplay(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_EnableIVS",
value: function J(e, t, n) {
var i = $.Deferred();
var r = this.oPlugin.HWP_EnableIVS(e, t, n);
setTimeout(function() {
if (r < 0) {
i.reject()
} else {
i.resolve()
}
}, 100);
return i.promise()
}
}, {
key: "JS_SRInit",
value: function L(e, t) {
var n = $.Deferred();
var i = this.oPlugin.HWP_SR_Init(e, t);
setTimeout(function() {
if (i < 0) {
n.reject()
} else {
n.resolve()
}
}, 100);
return n.promise()
}
}, {
key: "JS_SRPTZ",
value: function A(e, t, n) {
var i = $.Deferred();
var r = 0;
if (t === 4 || t === 5) {
r = this.oPlugin.HWP_SR_Zoom(e, 5 - t, n)
} else {
r = this.oPlugin.HWP_SR_PTZ(e, t, n)
}
setTimeout(function() {
if (r < 0) {
i.reject()
} else {
i.resolve()
}
}, 100);
return i.promise()
}
}, {
key: "JS_SetPlaybackDrawType",
value: function B(e, t) {
var n = $.Deferred();
var i = this.oPlugin.HWP_SetPlaybackDrawType(e, t);
setTimeout(function() {
if (i < 0) {
n.reject()
} else {
n.resolve()
}
}, 100);
return n.promise()
}
}, {
key: "JS_SetPlayBackType",
value: function U(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_SetPlayBackType(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_SetTrsPlayBackParam",
value: function H(e, t) {
var n = $.Deferred();
var i = '<?xml version="1.0" encoding="utf-8"?><CompressionInfo>' + "<TransBitrate>" + t.transBitrate + "</TransBitrate>" + "<TransFrameRate>" + t.transFrameRate + "</TransFrameRate>" + "<TransResolution>" + t.transResolution + "</TransResolution></CompressionInfo>";
var r = this.oPlugin.HWP_SetTrsPlayBackParam(e, i);
setTimeout(function() {
if (r < 0) {
n.reject()
} else {
n.resolve()
}
}, 100);
return n.promise()
}
}, {
key: "JS_GetLocalConfig",
value: function N() {
var e = this;
var t = $.Deferred();
var n = this.oPlugin.HWP_GetLocalConfig();
var i = mt.oUtils.parseXmlFromStr(n);
var r = {
resumeLiveView: $(i).find("resumeLiveView").eq(0).text() || "0",
protocolType: $(i).find("ProtocolType").eq(0).text(),
streamType: $(i).find("StreamType").eq(0).text(),
packgeSize: $(i).find("PackgeSize").eq(0).text(),
playWndType: $(i).find("PlayWndType").eq(0).text(),
buffNumberType: $(i).find("BuffNumberType").eq(0).text(),
recordPath: $(i).find("RecordPath").eq(0).text(),
capturePath: $(i).find("CapturePath").eq(0).text(),
playbackFilePath: $(i).find("PlaybackFilePath").eq(0).text(),
playbackPicPath: $(i).find("PlaybackPicPath").eq(0).text(),
downloadPath: $(i).find("DownloadPath").eq(0).text(),
snapScenePicPath: $(i).find("SnapScenePicPath").eq(0).text(),
snapViewPicPath: $(i).find("SnapViewPicPath").eq(0).text(),
ivsMode: $(i).find("IVSMode").eq(0).text(),
realPlayAll: $(i).find("RealPlayAll").eq(0).text(),
captureFileFormat: $(i).find("CaptureFileFormat").eq(0).text(),
osdPosInfo: $(i).find("OSDPosInfo").eq(0).text(),
osdPicInfo: $(i).find("OSDPicInfo").eq(0).text(),
showWizard: $(i).find("ShowWizard").eq(0).text(),
secretKey: $(i).find("SecretKey").eq(0).text(),
showFireBox: $(i).find("ShowFireBox").eq(0).text(),
showFireDistance: $(i).find("ShowFireDistance").eq(0).text(),
showFireMaxTemperature: $(i).find("ShowFireMaxTemp").eq(0).text(),
showFireMaxTemperaturePos: $(i).find("ShowFireMaxTempPos").eq(0).text(),
showTemperaturePoint: $(i).find("ShowTemPoint").eq(0).text(),
showTemperatureLine: $(i).find("ShowTemLine").eq(0).text(),
showTemperatureBox: $(i).find("ShowTemBox").eq(0).text(),
captureIncludeTemperatureInfo: $(i).find("CaptureTemp").eq(0).text(),
customBuffNumber: $(i).find("CustomBuffNumber").eq(0).text(),
faceSnapPicPath: $(i).find("FaceSnapPicPath").eq(0).text(),
d3dCapture: $(i).find("D3DCapture").eq(0).text(),
HumanTrack: $(i).find("HumanTrack").eq(0).text(),
VehicleTrack: $(i).find("VehicleTrack").eq(0).text(),
shieldMask: $(i).find("ShieldMask").eq(0).text(),
wasteGasDection: $(i).find("WasteGasDection").eq(0).text()
};
e.iProtocolType = parseInt(r.protocolType, 10);
setTimeout(function() {
if (!r) {
t.reject()
} else {
t.resolve(r)
}
}, 100);
return t.promise()
}
}, {
key: "JS_SetLocalConfig",
value: function G(e) {
var t = this;
var n = $.Deferred();
var i = '<?xml version="1.0" encoding="utf-8"?><LocalConfigInfo>' + "<ResumeLiveView>" + e.protocolType + "</ResumeLiveView>" + "<ProtocolType>" + e.protocolType + "</ProtocolType><StreamType>" + e.streamType + "</StreamType>" + "<PackgeSize>" + e.packgeSize + "</PackgeSize><PlayWndType>" + e.playWndType + "</PlayWndType>" + "<BuffNumberType>" + e.buffNumberType + "</BuffNumberType><RecordPath>" + e.recordPath + "</RecordPath>" + "<CapturePath>" + e.capturePath + "</CapturePath><PlaybackFilePath>" + e.playbackFilePath + "</PlaybackFilePath>" + "<PlaybackPicPath>" + e.playbackPicPath + "</PlaybackPicPath><DownloadPath>" + e.downloadPath + "</DownloadPath>" + "<SnapScenePicPath>" + e.snapScenePicPath + "</SnapScenePicPath><SnapViewPicPath>" + e.snapViewPicPath + "</SnapViewPicPath>" + "<IVSMode>" + e.ivsMode + "</IVSMode><RealPlayAll>" + e.realPlayAll + "</RealPlayAll>" + "<CaptureFileFormat>" + e.captureFileFormat + "</CaptureFileFormat><OSDPosInfo>" + e.osdPosInfo + "</OSDPosInfo>" + "<OSDPicInfo>" + e.osdPicInfo + "</OSDPicInfo><ShowWizard>" + e.showWizard + "</ShowWizard>" + "<SecretKey>" + e.secretKey + "</SecretKey><ShowFireBox>" + e.showFireBox + "</ShowFireBox>" + "<ShowFireDistance>" + e.showFireDistance + "</ShowFireDistance><ShowFireMaxTemp>" + e.showFireMaxTemperature + "</ShowFireMaxTemp>" + "<ShowFireMaxTempPos>" + e.showFireMaxTemperaturePos + "</ShowFireMaxTempPos><ShowTemPoint>" + e.showTemperaturePoint + "</ShowTemPoint>" + "<ShowTemLine>" + e.showTemperatureLine + "</ShowTemLine><ShowTemBox>" + e.showTemperatureBox + "</ShowTemBox>" + "<CaptureTemp>" + e.captureIncludeTemperatureInfo + "</CaptureTemp>" + "<CustomBuffNumber>" + e.customBuffNumber + "</CustomBuffNumber>" + "<FaceSnapPicPath>" + e.faceSnapPicPath + "</FaceSnapPicPath>" + "<HumanTrack>" + e.HumanTrack + "</HumanTrack>" + "<VehicleTrack>" + e.VehicleTrack + "</VehicleTrack>" + "<ShieldMask>" + e.shieldMask + "</ShieldMask>" + "<WasteGasDection>" + e.wasteGasDection + "</WasteGasDection>" + "</LocalConfigInfo>";
var r = this.oPlugin.HWP_SetLocalConfig(i);
setTimeout(function() {
if (r < 0) {
n.reject()
} else {
t.iProtocolType = parseInt(e.protocolType, 10);
n.resolve()
}
}, 100);
return n.promise()
}
}, {
key: "JS_GetLastError",
value: function V() {
var e = $.Deferred();
var t = this.oPlugin.HWP_GetLastError();
setTimeout(function() {
if (t < 0) {
e.reject()
} else {
e.resolve(t)
}
}, 100);
return e.promise()
}
}, {
key: "JS_OpenFileBrowser",
value: function j(e, t) {
var n = $.Deferred();
var i = this.oPlugin.HWP_OpenFileBrowser(e, t);
setTimeout(function() {
n.resolve(i)
}, 100);
return n.promise()
}
}, {
key: "JS_OpenDirectory",
value: function X(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_OpenDirectory(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_StartAsynUpload",
value: function Y(e, t, n, i) {
var r = $.Deferred();
var o = this;
var a = this.oPlugin.HWP_StartAsynUpload(e, t, n, i, 0);
setTimeout(function() {
if (a < 0) {
a = o.oPlugin.HWP_GetLastError();
r.reject(a)
} else {
r.resolve()
}
}, 100);
return r.promise()
}
}, {
key: "JS_StopAsynUpload",
value: function Z() {
var e = $.Deferred();
var t = this.oPlugin.HWP_StopAsynUpload();
setTimeout(function() {
if (t < 0) {
e.reject()
} else {
e.resolve()
}
}, 100);
return e.promise()
}
}, {
key: "JS_GetUploadErrorInfo",
value: function K() {
var e = $.Deferred();
var t = this.oPlugin.HWP_GetUploadErrorInfo();
setTimeout(function() {
e.resolve(t)
}, 100);
return e.promise()
}
}, {
key: "JS_UploadFile",
value: function Q(e, t, n, i) {
var r = this;
var o = $.Deferred();
var a = r.oPlugin.HWP_UploadFile(e, t, n, i, 0);
setTimeout(function() {
if (a < 0) {
var e = r.oPlugin.HWP_GetHttpErrorInfo();
a = r.oPlugin.HWP_GetLastError();
o.reject({
readyState: 4,
status: a,
responseXML: e ? mt.oUtils.parseXmlFromStr(e) : null,
errorInfo: e
})
} else {
o.resolve()
}
}, 100);
return o.promise()
}
}, {
key: "JS_GetIpcImportErrorInfo",
value: function ee() {
var e = $.Deferred();
var t = this.oPlugin.HWP_GetIpcImportErrorInfo();
setTimeout(function() {
e.resolve(t)
}, 100);
return e.promise()
}
}, {
key: "JS_DownloadFile",
value: function te(e, t, n, i, r, o) {
var a = this;
var s = $.Deferred();
var u = 0;
if (i === 2) {
u = this.oPlugin.HWP_ExportFile(e, t, n, i, o)
} else {
u = this.oPlugin.HWP_ExportDeviceConfig(e, t, "", r)
}
setTimeout(function() {
if (u < 0) {
var e = a.oPlugin.HWP_GetHttpErrorInfo();
u = a.oPlugin.HWP_GetLastError();
s.reject({
readyState: 4,
status: u,
responseXML: e ? mt.oUtils.parseXmlFromStr(e) : null
})
} else {
s.resolve(u)
}
}, 100);
return s.promise()
}
}, {
key: "JS_DownloadFileNoPlugin",
value: function ne(t) {
var e = new Promise(function(e) {
$("body").append('<a id="jsplugin_download_a" href="' + t + '"><li id="jsplugin_download_li"></li></a>');
$("#jsplugin_download_li").trigger("click");
$("#jsplugin_download_a").remove();
e()
});
return e
}
}, {
key: "JS_StartUpgrade",
value: function ie(e, t, n, i, r) {
var o = this;
var a = $.Deferred();
var s = o.oPlugin.HWP_StartUpgradeEx(e, t, n, i, r, "");
if (s < 0) {
s = o.oPlugin.HWP_GetLastError();
if (s === 10) {
var u;
try {
u = o.oPlugin.HWP_GetProtectModeWithoutAdmin()
} catch (l) {
u = -1
}
if (u === 1) {
a.reject(605)
} else {
a.reject(s)
}
} else {
a.reject(s)
}
} else {
a.resolve()
}
return a.promise()
}
}, {
key: "JS_StopUpgrade",
value: function re() {
var e = $.Deferred();
var t = this.oPlugin.HWP_StopUpgrade();
setTimeout(function() {
if (t < 0) {
e.reject()
} else {
e.resolve()
}
}, 100);
return e.promise()
}
}, {
key: "JS_GetUpgradeStatus",
value: function oe() {
var e = $.Deferred();
var t = this.oPlugin.HWP_UpgradeStatus();
setTimeout(function() {
if (t < 0) {
e.reject()
} else {
e.resolve(t)
}
}, 100);
return e.promise()
}
}, {
key: "JS_GetUpgradeProgress",
value: function ae() {
var e = $.Deferred();
var t = this.oPlugin.HWP_UpgradeStatus();
if (t >= 0) {
t = this.oPlugin.HWP_UpgradeProgress()
}
setTimeout(function() {
if (t < 0) {
e.reject()
} else {
e.resolve(t)
}
}, 100);
return e.promise()
}
}, {
key: "JS_ExportDeviceLog",
value: function se(e, t, n) {
var i = $.Deferred();
var r = this.oPlugin.HWP_ExportDeviceLog(e, t, n);
setTimeout(function() {
if (r < 0) {
i.reject()
} else {
i.resolve()
}
}, 100);
return i.promise()
}
}, {
key: "JS_ExportReport",
value: function ue(e, t, n) {
var i = $.Deferred();
var r = this.oPlugin.HWP_ExportReport(e, t, n);
setTimeout(function() {
if (r < 0) {
i.reject()
} else {
i.resolve({
status: r
})
}
}, 100);
return i.promise()
}
}, {
key: "JS_StartAsyncDownload",
value: function le(e, t, n, i) {
var r = this;
var o = $.Deferred();
var a = r.oPlugin.HWP_StartDownloadEx(e, t, n, i, "");
setTimeout(function() {
if (a < 0) {
var e = r.oPlugin.HWP_GetHttpErrorInfo();
a = r.oPlugin.HWP_GetLastError();
o.reject({
readyState: 4,
status: a,
responseXML: e ? mt.oUtils.parseXmlFromStr(e) : null
})
} else {
o.resolve(a)
}
}, 100);
return o.promise()
}
}, {
key: "JS_StopAsyncDownload",
value: function fe(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_StopDownload(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_GetDownloadStatus",
value: function ce(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_GetDownloadStatus(e);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve(n)
}
}, 100);
return t.promise()
}
}, {
key: "JS_GetDownloadProgress",
value: function de(e) {
var t = $.Deferred();
var n = this.oPlugin.HWP_GetDownloadStatus(e);
if (n >= 0) {
n = this.oPlugin.HWP_GetDownloadProgress(e)
}
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve(n)
}
}, 100);
return t.promise()
}
}, {
key: "JS_EnablePDC",
value: function he(e, t) {
var n = $.Deferred();
var i = this.oPlugin.HWP_EnablePDC(e, t);
setTimeout(function() {
if (i < 0) {
n.reject()
} else {
n.resolve()
}
}, 100);
return n.promise()
}
}, {
key: "JS_Resize",
value: function ve() {
var e = $.Deferred();
setTimeout(function() {
e.resolve()
}, 100);
return e.promise()
}
}, {
key: "JS_SetDrawCallback",
value: function pe(e, t, n, i, r, o) {
var a = this;
var s = $.Deferred();
a.fCurrentCallback = null;
a.afCurrentCallback[e] = null;
a.fPointCallback = null;
var u = 0;
var l = 0;
if (n !== "Rect") {
if (n === "Line") {
l = 2
} else if (n === "Polygon") {
l = 4
} else if (n === "Point") {
var f = "<?xml version='1.0' encoding='utf-8'?><SnapPointList>";
f += "<mode>1</mode>";
f += "<maxPointNum>1</maxPointNum>";
f += "<SnapPoint><color><r>0</r><g>0</g><b>255</b></color><type>2</type></SnapPoint>";
f += "</SnapPointList>";
u = this.oPlugin.HWP_SetSnapPointInfo(0, f);
setTimeout(function() {
if (u < 0) {
s.reject()
} else {
a.fPointCallback = r;
s.resolve()
}
}, 100);
return s.promise()
} else {
l = 0
}
if (t) {
u = a.oPlugin.HWP_SetPlaybackDrawType(e, l)
} else {
u = a.oPlugin.HWP_ClearDrawLineInfo(e)
}
} else {
if (t) {
var c = 1;
if (o && o.mode >= 0) {
c = o.mode
}
u = a.oPlugin.HWP_EnableZoom(e, c)
} else {
a.oPlugin.HWP_DisableZoom(e)
}
}
setTimeout(function() {
if (u < 0) {
s.reject()
} else {
a.fCurrentCallback = r;
a.afCurrentCallback[e] = r;
s.resolve()
}
}, 100);
return s.promise()
}
}, {
key: "JS_SetDrawStatus",
value: function me(e, t) {
var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
var i = $.Deferred();
var r = 0;
r = this.oPlugin.HWP_SetDrawStatus(e);
if (e) {
if (t) {
r = this.oPlugin.HWP_SetSnapDrawMode(n, t)
} else {
r = this.oPlugin.HWP_SetSnapDrawMode(n, 3)
}
} else {
r = this.oPlugin.HWP_SetSnapDrawMode(n, -1)
}
setTimeout(function() {
i.resolve(r)
}, 100);
return i.promise()
}
}, {
key: "JS_ClearRegion",
value: function ye() {
var e = $.Deferred();
var t = this.oPlugin.HWP_ClearRegion();
setTimeout(function() {
e.resolve(t)
}, 100);
return e.promise()
}
}, {
key: "JS_SetDrawShapeInfo",
value: function Se(e, t) {
var n = $.Deferred();
var i = 0;
if (e === "Rect") {
i = this.oPlugin.HWP_SetSnapDrawMode(0, 1);
if (i >= 0) {
if (t.type === 0) {
var r = "<?xml version='1.0' encoding='utf-8'?><DetectionRegionInfo><videoFormat>PAL</videoFormat><RegionType>roi</RegionType><ROI>";
r += "<HorizontalResolution>704</HorizontalResolution>" + "<VerticalResolution>576</VerticalResolution></ROI>" + "<DisplayMode>" + (t.translucent !== 1 ? "transparent" : "shelter") + "</DisplayMode>" + "<DetectionRegionList></DetectionRegionList><MaxRegionNum>" + t.maxShapeSupport + "</MaxRegionNum></DetectionRegionInfo>";
i = this.oPlugin.HWP_SetRegionInfo(r)
} else if (t.type === 1) {
var o = "<?xml version='1.0' encoding='utf-8'?><SnapPolygonList>";
o += "<SnapPolygon>";
o += "<id>" + t.id + "</id>";
o += "<tips>" + t.tips + "</tips>";
o += "<tipsPos>" + (t.tipsPos || 0) + "</tipsPos>";
o += "<isClosed>false</isClosed>";
o += "<polygonType>0</polygonType>";
o += "<showSquare>" + t.widthHeightRate + "</showSquare>";
o += "<pointList></pointList>";
o += "<color><r>" + mt.oUtils.colorRgb(t.drawColor)[0] + "</r><g>" + mt.oUtils.colorRgb(t.drawColor)[1] + "</g><b>" + mt.oUtils.colorRgb(t.drawColor)[2] + "</b></color>";
o += "</SnapPolygon>";
o += "</SnapPolygonList>";
i = this.oPlugin.HWP_SetSnapPolygonInfo(o)
}
}
} else if (e === "Grid") {
i = this.oPlugin.HWP_SetSnapDrawMode(0, 1);
if (i >= 0) {
var a = "<?xml version='1.0'?><MoveDetection><videoFormat>PAL</videoFormat>";
a += "<RegionType>grid</RegionType><Grid><rowGranularity>" + t.gridRowNum + "</rowGranularity>";
a += "<columnGranularity>" + t.gridColNum + "</columnGranularity></Grid>";
a += "<DisplayMode>transparent</DisplayMode><gridMap></gridMap></MoveDetection>";
i = this.oPlugin.HWP_SetRegionInfo(a)
}
} else if (e === "Polygon") {
i = this.oPlugin.HWP_SetSnapDrawMode(0, 2);
if (i >= 0) {
var s = "<?xml version='1.0' encoding='utf-8'?><SnapPolygonList>";
s += "<SnapPolygon>";
s += "<id>" + t.id + "</id>";
s += "<tips>" + t.tips + "</tips>";
s += "<isClosed>false</isClosed>";
s += "<polygonType>1</polygonType>";
s += "<PointNumMax>" + (t.maxPointSupport + 1) + "</PointNumMax>";
s += "<MinClosed>" + (t.minPointSupport + 1) + "</MinClosed>";
s += "<pointList></pointList>";
s += "<color><r>" + mt.oUtils.colorRgb(t.drawColor)[0] + "</r><g>" + mt.oUtils.colorRgb(t.drawColor)[1] + "</g><b>" + mt.oUtils.colorRgb(t.drawColor)[2] + "</b></color>";
s += "</SnapPolygon>";
s += "</SnapPolygonList>";
i = this.oPlugin.HWP_SetSnapPolygonInfo(s)
}
} else if (e === "Line") {
var u = '<?xml version="1.0" encoding="utf-8"?><SnapLineList>';
u += "<SnapLine>";
u += "<id>" + t.id + "</id>";
u += "<editType>" + t.editType + "</editType>";
u += "<LineTypeEx>" + t.lineType + "</LineTypeEx>";
u += "<Tips>" + t.tips + "</Tips>";
u += "<CustomType>" + t.direction + "</CustomType><MoveChange>" + t.mode + "</MoveChange>";
if (t.lineType !== 2) {
u += "<ArrowType>" + t.direction + "</ArrowType>";
u += "<StartPos><x>" + t.points[0][0] + "</x><y>" + t.points[0][1] + "</y></StartPos><EndPos><x>" + t.points[1][0] + "</x><y>" + t.points[1][1] + "</y></EndPos>"
} else {
u += "<ArrowType>" + (!t.direction ? 0 : t.direction - 1) + "</ArrowType>";
u += "<BreakLine>";
var l = t.points && t.points.length;
if (l > 0) {
u += "<PointList>";
for (var f = 0; f < l; f++) {
u += "<point><x>" + t.points[f][0] + "</x><y>" + t.points[f][1] + "</y></point>"
}
u += "</PointList>"
}
u += "<isClosed>" + (l > 0).toString() + "</isClosed>";
u += "<isShowArrow>" + (t.direction === 0 ? "false" : "true") + "</isShowArrow>";
if (t.minClosed) {
u += "<MinClosed>" + t.minClosed + "</MinClosed>"
}
if (t.pointNumMax) {
u += "<PointNumMax>" + t.pointNumMax + "</PointNumMax>"
}
if (t.directionTips) {
u += "<directionTips>" + t.directionTips + "</directionTips>"
}
u += "</BreakLine>"
}
u += "<LineSelected>false</LineSelected>";
u += "<color><r>" + mt.oUtils.colorRgb(t.drawColor)[0] + "</r><g>" + mt.oUtils.colorRgb(t.drawColor)[1] + "</g><b>" + mt.oUtils.colorRgb(t.drawColor)[2] + "</b></color>";
u += "</SnapLine>";
u += "</SnapLineList>";
i = this.oPlugin.HWP_SetSnapLineInfo(u)
} else if (e === "Point") {
var c = "<?xml version='1.0' encoding='utf-8'?><SnapPointList>";
var d = !t.replace ? 0 : 1;
c += "<mode>" + d + "</mode>";
c += "<SnapPoint>";
if (t.id) {
c += "<id>" + t.id + "</id>"
}
if (t.type) {
c += "<type>" + (t.type === "cross" ? 1 : 2) + "</type>"
}
if (t.drawColor) {
var h = mt.oUtils.colorRgb(t.drawColor);
c += "<color>";
c += "<r>" + h[0] + "</r>";
c += "<g>" + h[1] + "</g>";
c += "<b>" + h[2] + "</b>";
c += "</color>"
}
c += "</SnapPoint>";
c += "</SnapPointList>";
i = this.oPlugin.HWP_SetSnapPointInfo(0, c);
return c
}
setTimeout(function() {
if (i < 0) {
n.reject()
} else {
n.resolve()
}
}, 100);
return n.promise()
}
}, {
key: "JS_SetGridInfo",
value: function ge(e) {
var t = $.Deferred();
var n = "<?xml version='1.0'?><MoveDetection><videoFormat>PAL</videoFormat>";
n += "<RegionType>grid</RegionType><Grid><rowGranularity>" + e.gridRowNum + "</rowGranularity>";
n += "<columnGranularity>" + e.gridColNum + "</columnGranularity></Grid>";
n += "<DisplayMode>transparent</DisplayMode><gridMap>" + e.gridMap + "</gridMap></MoveDetection>";
var i = this.oPlugin.HWP_SetRegionInfo(n);
setTimeout(function() {
if (i < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_GetGridInfo",
value: function _e() {
var e = $.Deferred();
var t = this.oPlugin.HWP_GetRegionInfo();
var n = mt.oUtils.parseXmlFromStr(t);
var i = parseInt($(n).find("columnGranularity").text(), 10);
var r = parseInt($(n).find("rowGranularity").text(), 10);
var o = {
gridColNum: i,
gridRowNum: r,
gridMap: $(n).find("gridMap").text()
};
setTimeout(function() {
e.resolve(o)
}, 100);
return e.promise()
}
}, {
key: "JS_SetRectInfo",
value: function Pe(t) {
var e = $.Deferred();
var n = -1;
if (t[0].type === 0) {
var i = "<?xml version='1.0' encoding='utf-8'?><DetectionRegionInfo><videoFormat>PAL</videoFormat><RegionType>roi</RegionType><ROI>";
var r = "transparent";
if (t[0].translucent === 1) {
r = "shelter"
} else if (t[0].translucent === 2) {
r = "quadrilateral"
}
i += "<HorizontalResolution>704</HorizontalResolution>" + "<VerticalResolution>576</VerticalResolution></ROI>" + "<DisplayMode>" + r + "</DisplayMode>" + "<DetectionRegionList>";
$.each(t, function(e) {
i += "<DetectionRegion>";
i += "<RegionCoordinatesList>";
$.each(t[e].points, function(e, t) {
i += "<RegionCoordinates><positionX>" + Math.round(t[0] * 704) + "</positionX>" + "<positionY>" + Math.round((1 - t[1]) * 576) + "</positionY></RegionCoordinates>"
});
i += "</RegionCoordinatesList>";
i += "</DetectionRegion>"
});
i += "</DetectionRegionList><MaxRegionNum>" + t[0].maxShapeSupport + "</MaxRegionNum></DetectionRegionInfo>";
n = this.oPlugin.HWP_SetRegionInfo(i)
} else if (t[0].type === 1) {
var o = "<?xml version='1.0' encoding='utf-8'?><SnapPolygonList>";
$.each(t, function(e, t) {
o += "<SnapPolygon>";
o += "<id>" + t.id + "</id>";
o += "<EditType>" + (t.editType || 0) + "</EditType>";
o += "<tips>" + (t.tips || "") + "</tips>";
o += "<tipsPos>" + (t.tipsPos || 0) + "</tipsPos>";
o += "<isClosed>true</isClosed>";
o += "<polygonType>0</polygonType>";
o += "<showSquare>" + t.widthHeightRate + "</showSquare>";
o += "<pointList>";
$.each(t.points, function(e, t) {
o += "<point><x>" + t[0] + "</x><y>" + t[1] + "</y></point>"
});
o += "</pointList>";
o += "<color><r>" + mt.oUtils.colorRgb(t.drawColor)[0] + "</r><g>" + mt.oUtils.colorRgb(t.drawColor)[1] + "</g><b>" + mt.oUtils.colorRgb(t.drawColor)[2] + "</b></color>";
o += "</SnapPolygon>"
});
o += "</SnapPolygonList>";
n = this.oPlugin.HWP_SetSnapPolygonInfo(o)
}
setTimeout(function() {
if (n < 0) {
e.reject()
} else {
e.resolve()
}
}, 100);
return e.promise()
}
}, {
key: "JS_GetRectInfo",
value: function we() {
var e = $.Deferred();
var n = [];
var t = this.oPlugin.HWP_GetRegionInfo();
var i = mt.oUtils.parseXmlFromStr(t);
$(i).find("DetectionRegion").each(function(e) {
var t = [];
$(this).find("RegionCoordinatesList").find("RegionCoordinates").each(function() {
t.push([parseInt($(this).find("positionX").text(), 10) / 704, 1 - parseInt($(this).find("positionY").text(), 10) / 576])
});
n.push({
id: e + 1,
points: t
})
});
var a = [];
var r = this.oPlugin.HWP_GetSnapPolygonInfo();
var o = mt.oUtils.parseXmlFromStr(r);
$(o).find("SnapPolygon").each(function() {
var e = parseInt($(this).find("polygonType").text(), 10);
if (e === 0) {
var t = $(this).find("id").text();
var n = $(this).find("isClosed").text() === "true";
var i = $(this).find("tips").text();
var r = [];
$(this).find("pointList").find("point").each(function() {
r.push([parseFloat($(this).find("x").text()), parseFloat($(this).find("y").text())])
});
var o = {
id: t,
closed: n,
points: r,
tips: i
};
a.push(o)
}
});
setTimeout(function() {
if (n.length > 0) {
e.resolve(n)
} else if (a.length > 0) {
e.resolve(a)
} else {
e.resolve([])
}
}, 100);
return e.promise()
}
}, {
key: "JS_SetPolygonInfo",
value: function be(e) {
var t = $.Deferred();
var n = "<?xml version='1.0' encoding='utf-8'?><SnapPolygonList>";
$.each(e, function(e, t) {
if (typeof t.closed === "undefined") {
t.closed = true
}
n += "<SnapPolygon>";
n += "<id>" + t.id + "</id>";
n += "<EditType>" + t.editType + "</EditType>";
n += "<tips>" + t.tips + "</tips>";
n += "<isClosed>" + t.closed.toString() + "</isClosed>";
n += "<polygonType>1</polygonType>";
n += "<pointList>";
$.each(t.points, function(e, t) {
n += "<point><x>" + t[0] + "</x><y>" + t[1] + "</y></point>"
});
n += "</pointList>";
n += "<color><r>" + mt.oUtils.colorRgb(t.drawColor)[0] + "</r><g>" + mt.oUtils.colorRgb(t.drawColor)[1] + "</g><b>" + mt.oUtils.colorRgb(t.drawColor)[2] + "</b></color>";
n += "</SnapPolygon>"
});
n += "</SnapPolygonList>";
var i = this.oPlugin.HWP_SetSnapPolygonInfo(n);
setTimeout(function() {
if (i < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_GetPolygonInfo",
value: function ke() {
var e = $.Deferred();
var l = [];
var t = this.oPlugin.HWP_GetSnapPolygonInfo();
var n = mt.oUtils.parseXmlFromStr(t);
$(n).find("SnapPolygon").each(function() {
var e = parseInt($(this).find("polygonType").text(), 10);
if (e === 1) {
var t = $(this).find("id").text();
var n = $(this).find("isClosed").text() === "true";
var i = $(this).find("tips").text();
var r = "#" + mt.oUtils.colorTransfer($(this).find("r").text()) + mt.oUtils.colorTransfer($(this).find("g").text()) + mt.oUtils.colorTransfer($(this).find("b").text());
var o = parseInt($(this).find("PointNumMax").text(), 10);
var a = parseInt($(this).find("MinClosed").text(), 10);
var s = [];
$(this).find("pointList").find("point").each(function() {
s.push([parseFloat($(this).find("x").text()), parseFloat($(this).find("y").text())])
});
var u = {
id: t,
points: s,
closed: n,
tips: i,
drawColor: r,
polygonType: e,
pointNumMax: o,
minClosed: a
};
l.push(u)
}
});
setTimeout(function() {
e.resolve(l)
}, 100);
return e.promise()
}
}, {
key: "JS_SetLineInfo",
value: function Ce(e) {
var t = $.Deferred();
var r = '<?xml version="1.0" encoding="utf-8"?><SnapLineList>';
$.each(e, function(e, t) {
r += "<SnapLine>";
r += "<id>" + t.id + "</id>";
r += "<editType>" + t.editType + "</editType>";
r += "<LineTypeEx>" + t.lineType + "</LineTypeEx>";
r += "<Tips>" + t.tips + "</Tips>";
if (t.lineType !== 2) {
r += "<MoveChange>" + t.mode + "</MoveChange>";
r += "<ArrowType>" + t.direction + "</ArrowType><CustomType>" + t.direction + "</CustomType><StartPos><x>" + t.points[0][0] + "</x><y>" + t.points[0][1] + "</y></StartPos><EndPos><x>" + t.points[1][0] + "</x><y>" + t.points[1][1] + "</y></EndPos>";
if (t.cutOffPositions) {
r += "<ParkingNoShow>true</ParkingNoShow><ParkingPointList>";
$.each(t.cutOffPositions, function(e, t) {
r += "<parkingWidth>" + t + "</parkingWidth>"
});
r += "</ParkingPointList>"
}
} else {
r += "<ArrowType>" + (!t.direction ? 0 : t.direction - 1) + "</ArrowType><BreakLine><PointList>";
var n = t.points.length;
for (var i = 0; i < n; i++) {
r += "<point><x>" + t.points[i][0] + "</x><y>" + t.points[i][1] + "</y></point>"
}
r += "</PointList><isClosed>" + (n > 0).toString() + "</isClosed>";
r += "<isShowArrow>" + (t.direction === 0 ? "false" : "true") + "</isShowArrow>";
if (t.minClosed) {
r += "<MinClosed>" + t.minClosed + "</MinClosed>"
}
if (t.pointNumMax) {
r += "<PointNumMax>" + t.pointNumMax + "</PointNumMax>"
}
if (t.directionTips) {
r += "<directionTips>" + t.directionTips + "</directionTips>"
}
r += "</BreakLine>"
}
r += "<LineSelected>false</LineSelected>";
r += "<color><r>" + mt.oUtils.colorRgb(t.drawColor)[0] + "</r><g>" + mt.oUtils.colorRgb(t.drawColor)[1] + "</g><b>" + mt.oUtils.colorRgb(t.drawColor)[2] + "</b></color>";
r += "</SnapLine>"
});
r += "</SnapLineList>";
var n = this.oPlugin.HWP_SetSnapLineInfo(r);
setTimeout(function() {
if (n < 0) {
t.reject()
} else {
t.resolve()
}
}, 100);
return t.promise()
}
}, {
key: "JS_GetLineInfo",
value: function Re() {
var e = $.Deferred();
var t = this.oPlugin.HWP_GetSnapLineInfo();
var n = mt.oUtils.parseXmlFromStr(t);
var v = [];
$(n).find("SnapLine").each(function() {
var e = parseInt($(this).find("id").text(), 10);
var t = parseInt($(this).find("LineTypeEx").text(), 10);
var n = $(this).find("tips").text();
var i = void 0;
if (t === 3) {
i = parseInt($(this).find("CustomType").text(), 10) || parseInt($(this).find("LineType").text(), 10)
} else if (t === 1 || t === 4) {
i = parseInt($(this).find("ArrowType").text(), 10)
} else if (t === 2) {
var r = parseInt($(this).find("ArrowType").text(), 10);
if (isNaN(r)) {
r = 1
} else {
r += 1
}
i = r
}
var o = [];
var a = [];
var s = [];
var u = false;
var l = [];
var f = false;
var c = false;
var d = {
bShow: false,
aPoints: []
};
if (t !== 2) {
o.push([parseFloat($(this).find("StartPos").find("x").text()), parseFloat($(this).find("StartPos").find("y").text())]);
o.push([parseFloat($(this).find("EndPos").find("x").text()), parseFloat($(this).find("EndPos").find("y").text())]);
if (t === 4) {
a.push([parseFloat($(this).find("Demarcation").find("Sp_x").text()), parseFloat($(this).find("Demarcation").find("Sp_y").text())]);
a.push([parseFloat($(this).find("Demarcation").find("Ep_x").text()), parseFloat($(this).find("Demarcation").find("Ep_y").text())]);
s.push([parseFloat($(this).find("PDCArrow").find("Sp_x").text()), parseFloat($(this).find("PDCArrow").find("Sp_y").text())]);
s.push([parseFloat($(this).find("PDCArrow").find("Ep_x").text()), parseFloat($(this).find("PDCArrow").find("Ep_y").text())]);
u = "true" === $(this).find("PDCShowMark").text()
}
if (t === 5) {
d.bShow = true;
d.aPoints.length = 0;
$(this).find("PN_Width").each(function() {
d.aPoints.push(parseFloat($(this).text()))
})
}
} else {
$(this).find("BreakLine").find("point").each(function() {
o.push([parseFloat($(this).find("x").text()), parseFloat($(this).find("y").text())])
});
f = "true" === $(this).find("isShowArrow").text();
c = "true" === $(this).find("isClosed").text();
if (f) {
$(this).find("BreakLine").find("BLArrow").each(function() {
l.push([
[parseFloat($(this).find("Sp_x").text()), parseFloat($(this).find("Sp_y").text())],
[parseFloat($(this).find("Ep_x").text()), parseFloat($(this).find("Ep_y").text())]
])
})
}
}
var h = {
id: e,
lineType: t,
tips: n,
points: o,
direction: i,
demarcation: a,
pdcArrow: s,
showMark: u,
showArrow: f,
arrowList: l,
bClosed: c
};
if (d.bShow) {
h.cutOffPositions = d.aPoints
}
v.push(h)
});
setTimeout(function() {
e.resolve(v)
}, 100);
return e.promise()
}
}, {
key: "JS_SetTextOverlay",
value: function Ie(e) {
var t = $.Deferred();
var n = e.channelName.name.replace(/&/g, "&");
n = n.replace(/</g, "<");
var i = e.width ? e.width : 704;
var r = e.height ? e.height : 576;
var o = "<?xml version='1.0' encoding='UTF-8'?><OSD>" + "<videoResolutionWidth>" + i + "</videoResolutionWidth><videoResolutionHeight>" + r + "</videoResolutionHeight>" + "<channelNameOverlay><enabled>" + e.channelName.enable + "</enabled><ChannelName>" + n + "</ChannelName>" + "<alignment>" + e.channelName.alignment + "</alignment>" + "<minMoveValue>" + e.minMoveValue + "</minMoveValue>" + "<