@omg-dev/app 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{ChangelogPage-Bv_rKSK3.js → ChangelogPage-CejE1VcX.js} +25 -1
- package/dist-lib/{SessionFilesPanel-BTJ9vqdn.js → SessionFilesPanel-Bzc-HWNn.js} +1 -1
- package/dist-lib/{TermView-BTJAs7MJ.js → TermView-DX1zRdQ0.js} +2 -2
- package/dist-lib/{chat-engine-B40IRpBU.js → chat-engine-BYYnhuN8.js} +1 -1
- package/dist-lib/{coding-agents-page-DQKPO5Bl.js → coding-agents-page-2q0Wn61f.js} +1 -1
- package/dist-lib/{computer-page-DovSToHI.js → computer-page-n4KHgPOG.js} +1151 -1148
- package/dist-lib/{embedded-DPWsHnEw.js → embedded-Dt3VNxzY.js} +8568 -8439
- package/dist-lib/index.js +1 -1
- package/dist-lib/{keyboard-B1h20l1J.js → keyboard-ByK0m_uu.js} +1 -1
- package/dist-lib/{resume-session-sheet-CNJj84m_.js → resume-session-sheet-D02gOXe7.js} +1 -1
- package/dist-lib/{session-token-usage-DMGD9_8J.js → session-token-usage-CSQmNDWb.js} +1 -1
- package/dist-lib/{shipped-page-CLVvmH2T.js → shipped-page-DcKhcFXt.js} +1 -1
- package/dist-lib/{streamdown-response-CaF9L4PO.js → streamdown-response-B9qHxPVw.js} +1 -1
- package/dist-lib/styles.css +1 -1
- package/package.json +2 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { f as
|
|
4
|
-
import { K as
|
|
1
|
+
import { jsxs as pe, jsx as J, Fragment as zt } from "react/jsx-runtime";
|
|
2
|
+
import { useState as Ve, useRef as Qe, useCallback as ve, useEffect as Le } from "react";
|
|
3
|
+
import { f as Fn, a3 as Ai, ab as Mn, B as Ge, R as Tn, X as Qn, L as Xi, ae as Ln } from "./embedded-Dt3VNxzY.js";
|
|
4
|
+
import { K as Rn } from "./keyboard-ByK0m_uu.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.577.0 - ISC
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
11
|
+
const Bn = [
|
|
12
12
|
[
|
|
13
13
|
"path",
|
|
14
14
|
{
|
|
@@ -16,38 +16,38 @@ const Rn = [
|
|
|
16
16
|
key: "edeuup"
|
|
17
17
|
}
|
|
18
18
|
]
|
|
19
|
-
],
|
|
20
|
-
function
|
|
19
|
+
], Dn = Fn("mouse-pointer-2", Bn);
|
|
20
|
+
function In(i) {
|
|
21
21
|
return i >>> 0;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function _i(i) {
|
|
24
24
|
return i | 0;
|
|
25
25
|
}
|
|
26
|
-
let
|
|
27
|
-
}, re = () => {
|
|
26
|
+
let Fi = "warn", L = () => {
|
|
28
27
|
}, ae = () => {
|
|
29
|
-
},
|
|
28
|
+
}, oe = () => {
|
|
29
|
+
}, Z = () => {
|
|
30
30
|
};
|
|
31
|
-
function
|
|
32
|
-
if (typeof i > "u" ? i =
|
|
31
|
+
function Pn(i) {
|
|
32
|
+
if (typeof i > "u" ? i = Fi : Fi = i, L = ae = oe = Z = () => {
|
|
33
33
|
}, typeof window.console < "u")
|
|
34
34
|
switch (i) {
|
|
35
35
|
case "debug":
|
|
36
36
|
L = console.debug.bind(window.console);
|
|
37
37
|
case "info":
|
|
38
|
-
|
|
38
|
+
ae = console.info.bind(window.console);
|
|
39
39
|
case "warn":
|
|
40
|
-
|
|
40
|
+
oe = console.warn.bind(window.console);
|
|
41
41
|
case "error":
|
|
42
|
-
|
|
42
|
+
Z = console.error.bind(window.console);
|
|
43
43
|
case "none":
|
|
44
44
|
break;
|
|
45
45
|
default:
|
|
46
46
|
throw new window.Error("invalid logging type '" + i + "'");
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
function
|
|
49
|
+
Pn();
|
|
50
|
+
function Ot(i, t = !1) {
|
|
51
51
|
try {
|
|
52
52
|
return decodeURIComponent(escape(i));
|
|
53
53
|
} catch (e) {
|
|
@@ -56,10 +56,10 @@ function zt(i, t = !1) {
|
|
|
56
56
|
throw e;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function be(i) {
|
|
60
60
|
return unescape(encodeURIComponent(i));
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const gi = {
|
|
63
63
|
/* Convert data (an array of integers) to a Base64 string. */
|
|
64
64
|
toBase64Table: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),
|
|
65
65
|
base64Pad: "=",
|
|
@@ -212,7 +212,7 @@ const pi = {
|
|
|
212
212
|
for (let h = 0, c = t; c < i.length; c++) {
|
|
213
213
|
const o = this.toBinaryTable[i.charCodeAt(c) & 127], l = i.charAt(c) === this.base64Pad;
|
|
214
214
|
if (o === -1) {
|
|
215
|
-
|
|
215
|
+
Z("Illegal character code " + i.charCodeAt(c) + " at position " + c);
|
|
216
216
|
continue;
|
|
217
217
|
}
|
|
218
218
|
a = a << 6 | o, r += 6, r >= 8 && (r -= 8, l || (n[h++] = a >> r & 255), a &= (1 << r) - 1);
|
|
@@ -224,33 +224,33 @@ const pi = {
|
|
|
224
224
|
return n;
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
|
-
let
|
|
227
|
+
let js = "ontouchstart" in document.documentElement || // required for Chrome debugger
|
|
228
228
|
document.ontouchstart !== void 0 || // required for MS Surface
|
|
229
229
|
navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
|
230
230
|
window.addEventListener("touchstart", function i() {
|
|
231
|
-
|
|
231
|
+
js = !0, window.removeEventListener("touchstart", i, !1);
|
|
232
232
|
}, !1);
|
|
233
|
-
let
|
|
233
|
+
let ft = 10 * (window.devicePixelRatio || 1), qs = !1;
|
|
234
234
|
try {
|
|
235
235
|
const i = document.createElement("canvas");
|
|
236
|
-
i.style.cursor = 'url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default', i.style.cursor.indexOf("url") === 0 ? (
|
|
236
|
+
i.style.cursor = 'url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default', i.style.cursor.indexOf("url") === 0 ? (ae("Data URI scheme cursor supported"), qs = !0) : oe("Data URI scheme cursor not supported");
|
|
237
237
|
} catch (i) {
|
|
238
|
-
|
|
238
|
+
Z("Data URI scheme cursor test exception: " + i);
|
|
239
239
|
}
|
|
240
|
-
const
|
|
241
|
-
let
|
|
240
|
+
const Un = qs;
|
|
241
|
+
let Nn = !0;
|
|
242
242
|
try {
|
|
243
243
|
const i = document.createElement("div");
|
|
244
244
|
i.style.visibility = "hidden", i.style.overflow = "scroll", document.body.appendChild(i);
|
|
245
245
|
const t = document.createElement("div");
|
|
246
246
|
i.appendChild(t);
|
|
247
247
|
const e = i.offsetWidth - t.offsetWidth;
|
|
248
|
-
i.parentNode.removeChild(i),
|
|
248
|
+
i.parentNode.removeChild(i), Nn = e != 0;
|
|
249
249
|
} catch (i) {
|
|
250
|
-
|
|
250
|
+
Z("Scrollbar test exception: " + i);
|
|
251
251
|
}
|
|
252
|
-
let
|
|
253
|
-
async function
|
|
252
|
+
let Js = !1;
|
|
253
|
+
async function Hn() {
|
|
254
254
|
if (!("VideoDecoder" in window))
|
|
255
255
|
return !1;
|
|
256
256
|
const i = {
|
|
@@ -261,7 +261,7 @@ async function Un() {
|
|
|
261
261
|
};
|
|
262
262
|
if (!(await VideoDecoder.isConfigSupported(i)).supported)
|
|
263
263
|
return !1;
|
|
264
|
-
const e = new Uint8Array(
|
|
264
|
+
const e = new Uint8Array(gi.decode(
|
|
265
265
|
"AAAAAWdCwBTZnpuAgICgAAADACAAAAZB4oVNAAAAAWjJYyyAAAABBgX//4HcRem95tlIt5Ys2CDZI+7veDI2NCAtIGNvcmUgMTY0IHIzMTA4IDMxZTE5ZjkgLSBILjI2NC9NUEVHLTQgQVZDIGNvZGVjIC0gQ29weWxlZnQgMjAwMy0yMDIzIC0gaHR0cDovL3d3dy52aWRlb2xhbi5vcmcveDI2NC5odG1sIC0gb3B0aW9uczogY2FiYWM9MCByZWY9NSBkZWJsb2NrPTE6MDowIGFuYWx5c2U9MHgxOjB4MTExIG1lPWhleCBzdWJtZT04IHBzeT0xIHBzeV9yZD0xLjAwOjAuMDAgbWl4ZWRfcmVmPTEgbWVfcmFuZ2U9MTYgY2hyb21hX21lPTEgdHJlbGxpcz0yIDh4OGRjdD0wIGNxbT0wIGRlYWR6b25lPTIxLDExIGZhc3RfcHNraXA9MSBjaHJvbWFfcXBfb2Zmc2V0PS0yIHRocmVhZHM9MSBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTAgd2VpZ2h0cD0wIGtleWludD1pbmZpbml0ZSBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NTAgcmM9YWJyIG1idHJlZT0xIGJpdHJhdGU9NDAwIHJhdGV0b2w9MS4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAABZYiEBrxmKAAPVccAAS044AA5DRJMnkycJk4TPw=="
|
|
266
266
|
));
|
|
267
267
|
let s = !1, n = null, r = new VideoDecoder({
|
|
@@ -284,17 +284,17 @@ async function Un() {
|
|
|
284
284
|
}
|
|
285
285
|
return !(!s || n !== null);
|
|
286
286
|
}
|
|
287
|
-
|
|
287
|
+
Js = await Hn();
|
|
288
288
|
function Ie() {
|
|
289
289
|
return !!/mac/i.exec(navigator.platform);
|
|
290
290
|
}
|
|
291
291
|
function Et() {
|
|
292
292
|
return !!/win/i.exec(navigator.platform);
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function We() {
|
|
295
295
|
return !!/ipad/i.exec(navigator.platform) || !!/iphone/i.exec(navigator.platform) || !!/ipod/i.exec(navigator.platform);
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function Ze(i, t, e) {
|
|
298
298
|
const s = e.getBoundingClientRect();
|
|
299
299
|
let n = { x: 0, y: 0 };
|
|
300
300
|
return i < s.left ? n.x = 0 : i >= s.right ? n.x = s.width - 1 : n.x = i - s.left, t < s.top ? n.y = 0 : t >= s.bottom ? n.y = s.height - 1 : n.y = t - s.top, n;
|
|
@@ -302,39 +302,39 @@ function je(i, t, e) {
|
|
|
302
302
|
function Re(i) {
|
|
303
303
|
i.stopPropagation(), i.preventDefault();
|
|
304
304
|
}
|
|
305
|
-
let
|
|
305
|
+
let Vt = !1, $s = null;
|
|
306
306
|
document.captureElement = null;
|
|
307
|
-
function
|
|
308
|
-
if (
|
|
307
|
+
function Xe(i) {
|
|
308
|
+
if (Vt) return;
|
|
309
309
|
const t = new i.constructor(i.type, i);
|
|
310
|
-
|
|
310
|
+
Vt = !0, document.captureElement ? document.captureElement.dispatchEvent(t) : $s.dispatchEvent(t), Vt = !1, i.stopPropagation(), t.defaultPrevented && i.preventDefault(), i.type === "mouseup" && sn();
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function en() {
|
|
313
313
|
const i = document.getElementById("noVNC_mouse_capture_elem");
|
|
314
314
|
i.style.cursor = window.getComputedStyle(document.captureElement).cursor;
|
|
315
315
|
}
|
|
316
|
-
const
|
|
317
|
-
function
|
|
316
|
+
const tn = new MutationObserver(en);
|
|
317
|
+
function zn(i) {
|
|
318
318
|
if (i.setCapture)
|
|
319
319
|
i.setCapture(), document.captureElement = i;
|
|
320
320
|
else {
|
|
321
|
-
|
|
321
|
+
sn();
|
|
322
322
|
let t = document.getElementById("noVNC_mouse_capture_elem");
|
|
323
|
-
t === null && (t = document.createElement("div"), t.id = "noVNC_mouse_capture_elem", t.style.position = "fixed", t.style.top = "0px", t.style.left = "0px", t.style.width = "100%", t.style.height = "100%", t.style.zIndex = 1e4, t.style.display = "none", document.body.appendChild(t), t.addEventListener("contextmenu",
|
|
323
|
+
t === null && (t = document.createElement("div"), t.id = "noVNC_mouse_capture_elem", t.style.position = "fixed", t.style.top = "0px", t.style.left = "0px", t.style.width = "100%", t.style.height = "100%", t.style.zIndex = 1e4, t.style.display = "none", document.body.appendChild(t), t.addEventListener("contextmenu", Xe), t.addEventListener("mousemove", Xe), t.addEventListener("mouseup", Xe)), document.captureElement = i, tn.observe(i, { attributes: !0 }), en(), t.style.display = "", window.addEventListener("mousemove", Xe), window.addEventListener("mouseup", Xe);
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function sn() {
|
|
327
327
|
if (document.releaseCapture)
|
|
328
328
|
document.releaseCapture(), document.captureElement = null;
|
|
329
329
|
else {
|
|
330
330
|
if (!document.captureElement)
|
|
331
331
|
return;
|
|
332
|
-
|
|
332
|
+
$s = document.captureElement, document.captureElement = null, tn.disconnect();
|
|
333
333
|
const i = document.getElementById("noVNC_mouse_capture_elem");
|
|
334
|
-
i.style.display = "none", window.removeEventListener("mousemove",
|
|
334
|
+
i.style.display = "none", window.removeEventListener("mousemove", Xe), window.removeEventListener("mouseup", Xe);
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
class
|
|
337
|
+
class nn {
|
|
338
338
|
constructor() {
|
|
339
339
|
this._listeners = /* @__PURE__ */ new Map();
|
|
340
340
|
}
|
|
@@ -348,7 +348,7 @@ class sn {
|
|
|
348
348
|
return this._listeners.has(t.type) ? (this._listeners.get(t.type).forEach((e) => e.call(this, t)), !t.defaultPrevented) : !0;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
class
|
|
351
|
+
class On {
|
|
352
352
|
constructor(t) {
|
|
353
353
|
if (this._drawCtx = null, this._renderQ = [], this._flushPromise = null, this._fbWidth = 0, this._fbHeight = 0, this._prevDrawStyle = "", L(">> Display.constructor"), this._target = t, !this._target)
|
|
354
354
|
throw new Error("Target must be set");
|
|
@@ -401,10 +401,10 @@ class Hn {
|
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
absX(t) {
|
|
404
|
-
return this._scale === 0 ? 0 :
|
|
404
|
+
return this._scale === 0 ? 0 : _i(t / this._scale + this._viewportLoc.x);
|
|
405
405
|
}
|
|
406
406
|
absY(t) {
|
|
407
|
-
return this._scale === 0 ? 0 :
|
|
407
|
+
return this._scale === 0 ? 0 : _i(t / this._scale + this._viewportLoc.y);
|
|
408
408
|
}
|
|
409
409
|
resize(t, e) {
|
|
410
410
|
this._prevDrawStyle = "", this._fbWidth = t, this._fbHeight = e;
|
|
@@ -494,7 +494,7 @@ class Hn {
|
|
|
494
494
|
if (s === 0 || n === 0)
|
|
495
495
|
return;
|
|
496
496
|
const h = new Image();
|
|
497
|
-
h.src = "data: " + r + ";base64," +
|
|
497
|
+
h.src = "data: " + r + ";base64," + gi.encode(a), this._renderQPush({
|
|
498
498
|
type: "img",
|
|
499
499
|
img: h,
|
|
500
500
|
x: t,
|
|
@@ -588,7 +588,7 @@ class Hn {
|
|
|
588
588
|
case "img":
|
|
589
589
|
if (e.img.complete) {
|
|
590
590
|
if (e.img.width !== e.width || e.img.height !== e.height) {
|
|
591
|
-
|
|
591
|
+
Z("Decoded image has incorrect dimensions. Got " + e.img.width + "x" + e.img.height + ". Expected " + e.width + "x" + e.height + ".");
|
|
592
592
|
return;
|
|
593
593
|
}
|
|
594
594
|
this.drawImage(e.img, e.x, e.y), e.img.src = "";
|
|
@@ -598,7 +598,7 @@ class Hn {
|
|
|
598
598
|
case "frame":
|
|
599
599
|
if (e.frame.ready) {
|
|
600
600
|
let s = e.frame.frame;
|
|
601
|
-
(s.codedWidth < e.width || s.codedHeight < e.height) &&
|
|
601
|
+
(s.codedWidth < e.width || s.codedHeight < e.height) && oe("Decoded video frame does not cover its full rectangle area. Expecting at least " + e.width + "x" + e.height + " but got " + s.codedWidth + "x" + s.codedHeight);
|
|
602
602
|
const n = 0, r = 0, a = e.width, h = e.height, c = e.x, o = e.y, l = a, x = h;
|
|
603
603
|
this.drawImage(s, n, r, a, h, c, o, l, x), s.close();
|
|
604
604
|
} else {
|
|
@@ -614,7 +614,7 @@ class Hn {
|
|
|
614
614
|
this._renderQ.length === 0 && this._flushPromise !== null && (this._flushResolve(), this._flushPromise = null, this._flushResolve = null);
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function me(i, t, e, s, n) {
|
|
618
618
|
if (t.subarray && i.subarray) {
|
|
619
619
|
i.set(t.subarray(e, e + s), n);
|
|
620
620
|
return;
|
|
@@ -622,8 +622,8 @@ function ve(i, t, e, s, n) {
|
|
|
622
622
|
for (var r = 0; r < s; r++)
|
|
623
623
|
i[n + r] = t[e + r];
|
|
624
624
|
}
|
|
625
|
-
var
|
|
626
|
-
function
|
|
625
|
+
var Xt = Uint8Array, ce = Uint16Array, Ft = Int32Array;
|
|
626
|
+
function di(i, t, e, s) {
|
|
627
627
|
for (var n = i & 65535 | 0, r = i >>> 16 & 65535 | 0, a = 0; e !== 0; ) {
|
|
628
628
|
a = e > 2e3 ? 2e3 : e, e -= a;
|
|
629
629
|
do
|
|
@@ -633,7 +633,7 @@ function _i(i, t, e, s) {
|
|
|
633
633
|
}
|
|
634
634
|
return n | r << 16 | 0;
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function $() {
|
|
637
637
|
for (var i, t = [], e = 0; e < 256; e++) {
|
|
638
638
|
i = e;
|
|
639
639
|
for (var s = 0; s < 8; s++)
|
|
@@ -642,39 +642,39 @@ function q() {
|
|
|
642
642
|
}
|
|
643
643
|
return t;
|
|
644
644
|
}
|
|
645
|
-
|
|
646
|
-
var
|
|
647
|
-
function
|
|
648
|
-
var e, s, n, r, a, h, c, o, l, x, f, d, k,
|
|
649
|
-
e = i.state, s = i.next_in,
|
|
645
|
+
$();
|
|
646
|
+
var xt = 30, Vn = 12;
|
|
647
|
+
function Gn(i, t) {
|
|
648
|
+
var e, s, n, r, a, h, c, o, l, x, f, d, k, E, X, C, M, A, S, F, N, K, I, P, Q;
|
|
649
|
+
e = i.state, s = i.next_in, P = i.input, n = s + (i.avail_in - 5), r = i.next_out, Q = i.output, a = r - (t - i.avail_out), h = r + (i.avail_out - 257), c = e.dmax, o = e.wsize, l = e.whave, x = e.wnext, f = e.window, d = e.hold, k = e.bits, E = e.lencode, X = e.distcode, C = (1 << e.lenbits) - 1, M = (1 << e.distbits) - 1;
|
|
650
650
|
e:
|
|
651
651
|
do {
|
|
652
|
-
k < 15 && (d +=
|
|
652
|
+
k < 15 && (d += P[s++] << k, k += 8, d += P[s++] << k, k += 8), A = E[d & C];
|
|
653
653
|
t:
|
|
654
654
|
for (; ; ) {
|
|
655
655
|
if (S = A >>> 24, d >>>= S, k -= S, S = A >>> 16 & 255, S === 0)
|
|
656
656
|
Q[r++] = A & 65535;
|
|
657
657
|
else if (S & 16) {
|
|
658
|
-
F = A & 65535, S &= 15, S && (k < S && (d +=
|
|
658
|
+
F = A & 65535, S &= 15, S && (k < S && (d += P[s++] << k, k += 8), F += d & (1 << S) - 1, d >>>= S, k -= S), k < 15 && (d += P[s++] << k, k += 8, d += P[s++] << k, k += 8), A = X[d & M];
|
|
659
659
|
i:
|
|
660
660
|
for (; ; ) {
|
|
661
661
|
if (S = A >>> 24, d >>>= S, k -= S, S = A >>> 16 & 255, S & 16) {
|
|
662
|
-
if (
|
|
663
|
-
i.msg = "invalid distance too far back", e.mode =
|
|
662
|
+
if (N = A & 65535, S &= 15, k < S && (d += P[s++] << k, k += 8, k < S && (d += P[s++] << k, k += 8)), N += d & (1 << S) - 1, N > c) {
|
|
663
|
+
i.msg = "invalid distance too far back", e.mode = xt;
|
|
664
664
|
break e;
|
|
665
665
|
}
|
|
666
|
-
if (d >>>= S, k -= S, S = r - a,
|
|
667
|
-
if (S =
|
|
668
|
-
i.msg = "invalid distance too far back", e.mode =
|
|
666
|
+
if (d >>>= S, k -= S, S = r - a, N > S) {
|
|
667
|
+
if (S = N - S, S > l && e.sane) {
|
|
668
|
+
i.msg = "invalid distance too far back", e.mode = xt;
|
|
669
669
|
break e;
|
|
670
670
|
}
|
|
671
|
-
if (K = 0,
|
|
671
|
+
if (K = 0, I = f, x === 0) {
|
|
672
672
|
if (K += o - S, S < F) {
|
|
673
673
|
F -= S;
|
|
674
674
|
do
|
|
675
675
|
Q[r++] = f[K++];
|
|
676
676
|
while (--S);
|
|
677
|
-
K = r -
|
|
677
|
+
K = r - N, I = Q;
|
|
678
678
|
}
|
|
679
679
|
} else if (x < S) {
|
|
680
680
|
if (K += o + x - S, S -= x, S < F) {
|
|
@@ -687,7 +687,7 @@ function On(i, t) {
|
|
|
687
687
|
do
|
|
688
688
|
Q[r++] = f[K++];
|
|
689
689
|
while (--S);
|
|
690
|
-
K = r -
|
|
690
|
+
K = r - N, I = Q;
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
} else if (K += x - S, S < F) {
|
|
@@ -695,13 +695,13 @@ function On(i, t) {
|
|
|
695
695
|
do
|
|
696
696
|
Q[r++] = f[K++];
|
|
697
697
|
while (--S);
|
|
698
|
-
K = r -
|
|
698
|
+
K = r - N, I = Q;
|
|
699
699
|
}
|
|
700
700
|
for (; F > 2; )
|
|
701
|
-
Q[r++] =
|
|
702
|
-
F && (Q[r++] =
|
|
701
|
+
Q[r++] = I[K++], Q[r++] = I[K++], Q[r++] = I[K++], F -= 3;
|
|
702
|
+
F && (Q[r++] = I[K++], F > 1 && (Q[r++] = I[K++]));
|
|
703
703
|
} else {
|
|
704
|
-
K = r -
|
|
704
|
+
K = r - N;
|
|
705
705
|
do
|
|
706
706
|
Q[r++] = Q[K++], Q[r++] = Q[K++], Q[r++] = Q[K++], F -= 3;
|
|
707
707
|
while (F > 2);
|
|
@@ -711,19 +711,19 @@ function On(i, t) {
|
|
|
711
711
|
A = X[(A & 65535) + (d & (1 << S) - 1)];
|
|
712
712
|
continue i;
|
|
713
713
|
} else {
|
|
714
|
-
i.msg = "invalid distance code", e.mode =
|
|
714
|
+
i.msg = "invalid distance code", e.mode = xt;
|
|
715
715
|
break e;
|
|
716
716
|
}
|
|
717
717
|
break;
|
|
718
718
|
}
|
|
719
719
|
} else if ((S & 64) === 0) {
|
|
720
|
-
A =
|
|
720
|
+
A = E[(A & 65535) + (d & (1 << S) - 1)];
|
|
721
721
|
continue t;
|
|
722
722
|
} else if (S & 32) {
|
|
723
|
-
e.mode =
|
|
723
|
+
e.mode = Vn;
|
|
724
724
|
break e;
|
|
725
725
|
} else {
|
|
726
|
-
i.msg = "invalid literal/length code", e.mode =
|
|
726
|
+
i.msg = "invalid literal/length code", e.mode = xt;
|
|
727
727
|
break e;
|
|
728
728
|
}
|
|
729
729
|
break;
|
|
@@ -731,7 +731,7 @@ function On(i, t) {
|
|
|
731
731
|
} while (s < n && r < h);
|
|
732
732
|
F = k >> 3, s -= F, k -= F << 3, d &= (1 << k) - 1, i.next_in = s, i.next_out = r, i.avail_in = s < n ? 5 + (n - s) : 5 - (s - n), i.avail_out = r < h ? 257 + (h - r) : 257 - (r - h), e.hold = d, e.bits = k;
|
|
733
733
|
}
|
|
734
|
-
var Be = 15,
|
|
734
|
+
var Be = 15, Mi = 852, Ti = 592, Qi = 0, Gt = 1, Li = 2, Wn = [
|
|
735
735
|
/* Length codes 257..285 base */
|
|
736
736
|
3,
|
|
737
737
|
4,
|
|
@@ -764,7 +764,7 @@ var Be = 15, Fi = 852, Mi = 592, Ti = 0, Vt = 1, Qi = 2, Vn = [
|
|
|
764
764
|
258,
|
|
765
765
|
0,
|
|
766
766
|
0
|
|
767
|
-
],
|
|
767
|
+
], Zn = [
|
|
768
768
|
/* Length codes 257..285 extra */
|
|
769
769
|
16,
|
|
770
770
|
16,
|
|
@@ -797,7 +797,7 @@ var Be = 15, Fi = 852, Mi = 592, Ti = 0, Vt = 1, Qi = 2, Vn = [
|
|
|
797
797
|
16,
|
|
798
798
|
72,
|
|
799
799
|
78
|
|
800
|
-
],
|
|
800
|
+
], Yn = [
|
|
801
801
|
/* Distance codes 0..29 base */
|
|
802
802
|
1,
|
|
803
803
|
2,
|
|
@@ -831,7 +831,7 @@ var Be = 15, Fi = 852, Mi = 592, Ti = 0, Vt = 1, Qi = 2, Vn = [
|
|
|
831
831
|
24577,
|
|
832
832
|
0,
|
|
833
833
|
0
|
|
834
|
-
],
|
|
834
|
+
], jn = [
|
|
835
835
|
/* Distance codes 0..29 extra */
|
|
836
836
|
16,
|
|
837
837
|
16,
|
|
@@ -866,84 +866,84 @@ var Be = 15, Fi = 852, Mi = 592, Ti = 0, Vt = 1, Qi = 2, Vn = [
|
|
|
866
866
|
64,
|
|
867
867
|
64
|
|
868
868
|
];
|
|
869
|
-
function
|
|
870
|
-
var c = h.bits, o = 0, l = 0, x = 0, f = 0, d = 0, k = 0,
|
|
869
|
+
function tt(i, t, e, s, n, r, a, h) {
|
|
870
|
+
var c = h.bits, o = 0, l = 0, x = 0, f = 0, d = 0, k = 0, E = 0, X = 0, C = 0, M = 0, A, S, F, N, K, I = null, P = 0, Q, z = new ce(Be + 1), j = new ce(Be + 1), T = null, D = 0, q, H, B;
|
|
871
871
|
for (o = 0; o <= Be; o++)
|
|
872
|
-
|
|
872
|
+
z[o] = 0;
|
|
873
873
|
for (l = 0; l < s; l++)
|
|
874
|
-
|
|
875
|
-
for (d = c, f = Be; f >= 1 &&
|
|
874
|
+
z[t[e + l]]++;
|
|
875
|
+
for (d = c, f = Be; f >= 1 && z[f] === 0; f--)
|
|
876
876
|
;
|
|
877
877
|
if (d > f && (d = f), f === 0)
|
|
878
878
|
return n[r++] = 1 << 24 | 64 << 16 | 0, n[r++] = 1 << 24 | 64 << 16 | 0, h.bits = 1, 0;
|
|
879
|
-
for (x = 1; x < f &&
|
|
879
|
+
for (x = 1; x < f && z[x] === 0; x++)
|
|
880
880
|
;
|
|
881
881
|
for (d < x && (d = x), X = 1, o = 1; o <= Be; o++)
|
|
882
|
-
if (X <<= 1, X -=
|
|
882
|
+
if (X <<= 1, X -= z[o], X < 0)
|
|
883
883
|
return -1;
|
|
884
|
-
if (X > 0 && (i ===
|
|
884
|
+
if (X > 0 && (i === Qi || f !== 1))
|
|
885
885
|
return -1;
|
|
886
|
-
for (
|
|
887
|
-
|
|
886
|
+
for (j[1] = 0, o = 1; o < Be; o++)
|
|
887
|
+
j[o + 1] = j[o] + z[o];
|
|
888
888
|
for (l = 0; l < s; l++)
|
|
889
|
-
t[e + l] !== 0 && (a[
|
|
890
|
-
if (i ===
|
|
889
|
+
t[e + l] !== 0 && (a[j[t[e + l]]++] = l);
|
|
890
|
+
if (i === Qi ? (I = T = a, Q = 19) : i === Gt ? (I = Wn, P -= 257, T = Zn, D -= 257, Q = 256) : (I = Yn, T = jn, Q = -1), M = 0, l = 0, o = x, K = r, k = d, E = 0, F = -1, C = 1 << d, N = C - 1, i === Gt && C > Mi || i === Li && C > Ti)
|
|
891
891
|
return 1;
|
|
892
892
|
for (; ; ) {
|
|
893
|
-
|
|
893
|
+
q = o - E, a[l] < Q ? (H = 0, B = a[l]) : a[l] > Q ? (H = T[D + a[l]], B = I[P + a[l]]) : (H = 96, B = 0), A = 1 << o - E, S = 1 << k, x = S;
|
|
894
894
|
do
|
|
895
|
-
S -= A, n[K + (
|
|
895
|
+
S -= A, n[K + (M >> E) + S] = q << 24 | H << 16 | B | 0;
|
|
896
896
|
while (S !== 0);
|
|
897
|
-
for (A = 1 << o - 1;
|
|
897
|
+
for (A = 1 << o - 1; M & A; )
|
|
898
898
|
A >>= 1;
|
|
899
|
-
if (A !== 0 ? (
|
|
899
|
+
if (A !== 0 ? (M &= A - 1, M += A) : M = 0, l++, --z[o] === 0) {
|
|
900
900
|
if (o === f)
|
|
901
901
|
break;
|
|
902
902
|
o = t[e + a[l]];
|
|
903
903
|
}
|
|
904
|
-
if (o > d && (
|
|
905
|
-
for (
|
|
904
|
+
if (o > d && (M & N) !== F) {
|
|
905
|
+
for (E === 0 && (E = d), K += x, k = o - E, X = 1 << k; k + E < f && (X -= z[k + E], !(X <= 0)); )
|
|
906
906
|
k++, X <<= 1;
|
|
907
|
-
if (
|
|
907
|
+
if (C += 1 << k, i === Gt && C > Mi || i === Li && C > Ti)
|
|
908
908
|
return 1;
|
|
909
|
-
F =
|
|
909
|
+
F = M & N, n[F] = d << 24 | k << 16 | K - r | 0;
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
|
-
return
|
|
912
|
+
return M !== 0 && (n[K + M] = o - E << 24 | 64 << 16 | 0), h.bits = d, 0;
|
|
913
913
|
}
|
|
914
|
-
var
|
|
915
|
-
const
|
|
916
|
-
var
|
|
917
|
-
function
|
|
914
|
+
var qn = 0, rn = 1, an = 2;
|
|
915
|
+
const Ri = 4, Mt = 0, Jn = 1, $n = 2, Te = -2, er = -3, tr = -4, ir = -5, Bi = 8;
|
|
916
|
+
var on = 1, Di = 2, Ii = 3, Pi = 4, Ui = 5, Ni = 6, Hi = 7, zi = 8, Oi = 9, Vi = 10, Gi = 11, ge = 12, Wt = 13, Wi = 14, Zt = 15, Zi = 16, Yi = 17, ji = 18, qi = 19, pt = 20, gt = 21, Ji = 22, $i = 23, es = 24, ts = 25, is = 26, Yt = 27, ss = 28, ns = 29, G = 30, sr = 31, nr = 32, rr = 852, ar = 592, or = 15, hr = or;
|
|
917
|
+
function rs(i) {
|
|
918
918
|
return (i >>> 24 & 255) + (i >>> 8 & 65280) + ((i & 65280) << 8) + ((i & 255) << 24);
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, 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
|
|
920
|
+
function lr() {
|
|
921
|
+
this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, 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 ce(320), this.work = new ce(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
|
|
922
922
|
}
|
|
923
|
-
function
|
|
923
|
+
function cr(i) {
|
|
924
924
|
var t;
|
|
925
|
-
return !i || !i.state ?
|
|
925
|
+
return !i || !i.state ? Te : (t = i.state, i.total_in = i.total_out = t.total = 0, i.msg = "", t.wrap && (i.adler = t.wrap & 1), t.mode = on, t.last = 0, t.havedict = 0, t.dmax = 32768, t.head = null, t.hold = 0, t.bits = 0, t.lencode = t.lendyn = new Ft(rr), t.distcode = t.distdyn = new Ft(ar), t.sane = 1, t.back = -1, Mt);
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function hn(i) {
|
|
928
928
|
var t;
|
|
929
|
-
return !i || !i.state ?
|
|
929
|
+
return !i || !i.state ? Te : (t = i.state, t.wsize = 0, t.whave = 0, t.wnext = 0, cr(i));
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function ur(i, t) {
|
|
932
932
|
var e, s;
|
|
933
|
-
return !i || !i.state || (s = i.state, t < 0 ? (e = 0, t = -t) : (e = (t >> 4) + 1, t < 48 && (t &= 15)), t && (t < 8 || t > 15)) ?
|
|
933
|
+
return !i || !i.state || (s = i.state, t < 0 ? (e = 0, t = -t) : (e = (t >> 4) + 1, t < 48 && (t &= 15)), t && (t < 8 || t > 15)) ? Te : (s.window !== null && s.wbits !== t && (s.window = null), s.wrap = e, s.wbits = t, hn(i));
|
|
934
934
|
}
|
|
935
|
-
function
|
|
935
|
+
function _r(i, t) {
|
|
936
936
|
var e, s;
|
|
937
|
-
return i ? (s = new
|
|
937
|
+
return i ? (s = new lr(), i.state = s, s.window = null, e = ur(i, t), e !== Mt && (i.state = null), e) : Te;
|
|
938
938
|
}
|
|
939
|
-
function
|
|
940
|
-
return
|
|
939
|
+
function dr(i) {
|
|
940
|
+
return _r(i, hr);
|
|
941
941
|
}
|
|
942
|
-
var
|
|
943
|
-
function
|
|
944
|
-
if (
|
|
942
|
+
var as = !0, jt, qt;
|
|
943
|
+
function fr(i) {
|
|
944
|
+
if (as) {
|
|
945
945
|
var t;
|
|
946
|
-
for (
|
|
946
|
+
for (jt = new Ft(512), qt = new Ft(32), t = 0; t < 144; )
|
|
947
947
|
i.lens[t++] = 8;
|
|
948
948
|
for (; t < 256; )
|
|
949
949
|
i.lens[t++] = 9;
|
|
@@ -951,30 +951,30 @@ function _r(i) {
|
|
|
951
951
|
i.lens[t++] = 7;
|
|
952
952
|
for (; t < 288; )
|
|
953
953
|
i.lens[t++] = 8;
|
|
954
|
-
for (
|
|
954
|
+
for (tt(rn, i.lens, 0, 288, jt, 0, i.work, { bits: 9 }), t = 0; t < 32; )
|
|
955
955
|
i.lens[t++] = 5;
|
|
956
|
-
|
|
956
|
+
tt(an, i.lens, 0, 32, qt, 0, i.work, { bits: 5 }), as = !1;
|
|
957
957
|
}
|
|
958
|
-
i.lencode =
|
|
958
|
+
i.lencode = jt, i.lenbits = 9, i.distcode = qt, i.distbits = 5;
|
|
959
959
|
}
|
|
960
|
-
function
|
|
960
|
+
function xr(i, t, e, s) {
|
|
961
961
|
var n, r = i.state;
|
|
962
|
-
return r.window === null && (r.wsize = 1 << r.wbits, r.wnext = 0, r.whave = 0, r.window = new
|
|
962
|
+
return r.window === null && (r.wsize = 1 << r.wbits, r.wnext = 0, r.whave = 0, r.window = new Xt(r.wsize)), s >= r.wsize ? (me(r.window, t, e - r.wsize, r.wsize, 0), r.wnext = 0, r.whave = r.wsize) : (n = r.wsize - r.wnext, n > s && (n = s), me(r.window, t, e - s, n, r.wnext), s -= n, s ? (me(r.window, t, e - s, s, 0), r.wnext = s, r.whave = r.wsize) : (r.wnext += n, r.wnext === r.wsize && (r.wnext = 0), r.whave < r.wsize && (r.whave += n))), 0;
|
|
963
963
|
}
|
|
964
|
-
function
|
|
965
|
-
var e, s, n, r, a, h, c, o, l, x, f, d, k,
|
|
964
|
+
function pr(i, t) {
|
|
965
|
+
var e, s, n, r, a, h, c, o, l, x, f, d, k, E, X = 0, C, M, A, S, F, N, K, I, P = new Xt(4), Q, z, j = (
|
|
966
966
|
/* permutation of code lengths */
|
|
967
967
|
[16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]
|
|
968
968
|
);
|
|
969
969
|
if (!i || !i.state || !i.output || !i.input && i.avail_in !== 0)
|
|
970
|
-
return
|
|
971
|
-
e = i.state, e.mode ===
|
|
970
|
+
return Te;
|
|
971
|
+
e = i.state, e.mode === ge && (e.mode = Wt), a = i.next_out, n = i.output, c = i.avail_out, r = i.next_in, s = i.input, h = i.avail_in, o = e.hold, l = e.bits, x = h, f = c, I = Mt;
|
|
972
972
|
e:
|
|
973
973
|
for (; ; )
|
|
974
974
|
switch (e.mode) {
|
|
975
|
-
case
|
|
975
|
+
case on:
|
|
976
976
|
if (e.wrap === 0) {
|
|
977
|
-
e.mode =
|
|
977
|
+
e.mode = Wt;
|
|
978
978
|
break;
|
|
979
979
|
}
|
|
980
980
|
for (; l < 16; ) {
|
|
@@ -983,71 +983,71 @@ function fr(i, t) {
|
|
|
983
983
|
h--, o += s[r++] << l, l += 8;
|
|
984
984
|
}
|
|
985
985
|
if (e.wrap & 2 && o === 35615) {
|
|
986
|
-
e.check = 0,
|
|
986
|
+
e.check = 0, P[0] = o & 255, P[1] = o >>> 8 & 255, e.check = $(e.check), o = 0, l = 0, e.mode = Di;
|
|
987
987
|
break;
|
|
988
988
|
}
|
|
989
989
|
if (e.flags = 0, e.head && (e.head.done = !1), !(e.wrap & 1) || /* check if zlib header allowed */
|
|
990
990
|
(((o & 255) << 8) + (o >> 8)) % 31) {
|
|
991
|
-
i.msg = "incorrect header check", e.mode =
|
|
991
|
+
i.msg = "incorrect header check", e.mode = G;
|
|
992
992
|
break;
|
|
993
993
|
}
|
|
994
|
-
if ((o & 15) !==
|
|
995
|
-
i.msg = "unknown compression method", e.mode =
|
|
994
|
+
if ((o & 15) !== Bi) {
|
|
995
|
+
i.msg = "unknown compression method", e.mode = G;
|
|
996
996
|
break;
|
|
997
997
|
}
|
|
998
998
|
if (o >>>= 4, l -= 4, K = (o & 15) + 8, e.wbits === 0)
|
|
999
999
|
e.wbits = K;
|
|
1000
1000
|
else if (K > e.wbits) {
|
|
1001
|
-
i.msg = "invalid window size", e.mode =
|
|
1001
|
+
i.msg = "invalid window size", e.mode = G;
|
|
1002
1002
|
break;
|
|
1003
1003
|
}
|
|
1004
|
-
e.dmax = 1 << K, i.adler = e.check = 1, e.mode = o & 512 ?
|
|
1004
|
+
e.dmax = 1 << K, i.adler = e.check = 1, e.mode = o & 512 ? Vi : ge, o = 0, l = 0;
|
|
1005
1005
|
break;
|
|
1006
|
-
case
|
|
1006
|
+
case Di:
|
|
1007
1007
|
for (; l < 16; ) {
|
|
1008
1008
|
if (h === 0)
|
|
1009
1009
|
break e;
|
|
1010
1010
|
h--, o += s[r++] << l, l += 8;
|
|
1011
1011
|
}
|
|
1012
|
-
if (e.flags = o, (e.flags & 255) !==
|
|
1013
|
-
i.msg = "unknown compression method", e.mode =
|
|
1012
|
+
if (e.flags = o, (e.flags & 255) !== Bi) {
|
|
1013
|
+
i.msg = "unknown compression method", e.mode = G;
|
|
1014
1014
|
break;
|
|
1015
1015
|
}
|
|
1016
1016
|
if (e.flags & 57344) {
|
|
1017
|
-
i.msg = "unknown header flags set", e.mode =
|
|
1017
|
+
i.msg = "unknown header flags set", e.mode = G;
|
|
1018
1018
|
break;
|
|
1019
1019
|
}
|
|
1020
|
-
e.head && (e.head.text = o >> 8 & 1), e.flags & 512 && (
|
|
1020
|
+
e.head && (e.head.text = o >> 8 & 1), e.flags & 512 && (P[0] = o & 255, P[1] = o >>> 8 & 255, e.check = $(e.check)), o = 0, l = 0, e.mode = Ii;
|
|
1021
1021
|
/* falls through */
|
|
1022
|
-
case
|
|
1022
|
+
case Ii:
|
|
1023
1023
|
for (; l < 32; ) {
|
|
1024
1024
|
if (h === 0)
|
|
1025
1025
|
break e;
|
|
1026
1026
|
h--, o += s[r++] << l, l += 8;
|
|
1027
1027
|
}
|
|
1028
|
-
e.head && (e.head.time = o), e.flags & 512 && (
|
|
1028
|
+
e.head && (e.head.time = o), e.flags & 512 && (P[0] = o & 255, P[1] = o >>> 8 & 255, P[2] = o >>> 16 & 255, P[3] = o >>> 24 & 255, e.check = $(e.check)), o = 0, l = 0, e.mode = Pi;
|
|
1029
1029
|
/* falls through */
|
|
1030
|
-
case
|
|
1030
|
+
case Pi:
|
|
1031
1031
|
for (; l < 16; ) {
|
|
1032
1032
|
if (h === 0)
|
|
1033
1033
|
break e;
|
|
1034
1034
|
h--, o += s[r++] << l, l += 8;
|
|
1035
1035
|
}
|
|
1036
|
-
e.head && (e.head.xflags = o & 255, e.head.os = o >> 8), e.flags & 512 && (
|
|
1036
|
+
e.head && (e.head.xflags = o & 255, e.head.os = o >> 8), e.flags & 512 && (P[0] = o & 255, P[1] = o >>> 8 & 255, e.check = $(e.check)), o = 0, l = 0, e.mode = Ui;
|
|
1037
1037
|
/* falls through */
|
|
1038
|
-
case
|
|
1038
|
+
case Ui:
|
|
1039
1039
|
if (e.flags & 1024) {
|
|
1040
1040
|
for (; l < 16; ) {
|
|
1041
1041
|
if (h === 0)
|
|
1042
1042
|
break e;
|
|
1043
1043
|
h--, o += s[r++] << l, l += 8;
|
|
1044
1044
|
}
|
|
1045
|
-
e.length = o, e.head && (e.head.extra_len = o), e.flags & 512 && (
|
|
1045
|
+
e.length = o, e.head && (e.head.extra_len = o), e.flags & 512 && (P[0] = o & 255, P[1] = o >>> 8 & 255, e.check = $(e.check)), o = 0, l = 0;
|
|
1046
1046
|
} else e.head && (e.head.extra = null);
|
|
1047
|
-
e.mode =
|
|
1047
|
+
e.mode = Ni;
|
|
1048
1048
|
/* falls through */
|
|
1049
|
-
case
|
|
1050
|
-
if (e.flags & 1024 && (d = e.length, d > h && (d = h), d && (e.head && (K = e.head.extra_len - e.length, e.head.extra || (e.head.extra = new Array(e.head.extra_len)),
|
|
1049
|
+
case Ni:
|
|
1050
|
+
if (e.flags & 1024 && (d = e.length, d > h && (d = h), d && (e.head && (K = e.head.extra_len - e.length, e.head.extra || (e.head.extra = new Array(e.head.extra_len)), me(
|
|
1051
1051
|
e.head.extra,
|
|
1052
1052
|
s,
|
|
1053
1053
|
r,
|
|
@@ -1056,11 +1056,11 @@ function fr(i, t) {
|
|
|
1056
1056
|
d,
|
|
1057
1057
|
/*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
|
|
1058
1058
|
K
|
|
1059
|
-
)), e.flags & 512 && (e.check =
|
|
1059
|
+
)), e.flags & 512 && (e.check = $(e.check)), h -= d, r += d, e.length -= d), e.length))
|
|
1060
1060
|
break e;
|
|
1061
|
-
e.length = 0, e.mode =
|
|
1061
|
+
e.length = 0, e.mode = Hi;
|
|
1062
1062
|
/* falls through */
|
|
1063
|
-
case
|
|
1063
|
+
case Hi:
|
|
1064
1064
|
if (e.flags & 2048) {
|
|
1065
1065
|
if (h === 0)
|
|
1066
1066
|
break e;
|
|
@@ -1068,12 +1068,12 @@ function fr(i, t) {
|
|
|
1068
1068
|
do
|
|
1069
1069
|
K = s[r + d++], e.head && K && e.length < 65536 && (e.head.name += String.fromCharCode(K));
|
|
1070
1070
|
while (K && d < h);
|
|
1071
|
-
if (e.flags & 512 && (e.check =
|
|
1071
|
+
if (e.flags & 512 && (e.check = $(e.check)), h -= d, r += d, K)
|
|
1072
1072
|
break e;
|
|
1073
1073
|
} else e.head && (e.head.name = null);
|
|
1074
|
-
e.length = 0, e.mode =
|
|
1074
|
+
e.length = 0, e.mode = zi;
|
|
1075
1075
|
/* falls through */
|
|
1076
|
-
case
|
|
1076
|
+
case zi:
|
|
1077
1077
|
if (e.flags & 4096) {
|
|
1078
1078
|
if (h === 0)
|
|
1079
1079
|
break e;
|
|
@@ -1081,12 +1081,12 @@ function fr(i, t) {
|
|
|
1081
1081
|
do
|
|
1082
1082
|
K = s[r + d++], e.head && K && e.length < 65536 && (e.head.comment += String.fromCharCode(K));
|
|
1083
1083
|
while (K && d < h);
|
|
1084
|
-
if (e.flags & 512 && (e.check =
|
|
1084
|
+
if (e.flags & 512 && (e.check = $(e.check)), h -= d, r += d, K)
|
|
1085
1085
|
break e;
|
|
1086
1086
|
} else e.head && (e.head.comment = null);
|
|
1087
|
-
e.mode =
|
|
1087
|
+
e.mode = Oi;
|
|
1088
1088
|
/* falls through */
|
|
1089
|
-
case
|
|
1089
|
+
case Oi:
|
|
1090
1090
|
if (e.flags & 512) {
|
|
1091
1091
|
for (; l < 16; ) {
|
|
1092
1092
|
if (h === 0)
|
|
@@ -1094,31 +1094,31 @@ function fr(i, t) {
|
|
|
1094
1094
|
h--, o += s[r++] << l, l += 8;
|
|
1095
1095
|
}
|
|
1096
1096
|
if (o !== (e.check & 65535)) {
|
|
1097
|
-
i.msg = "header crc mismatch", e.mode =
|
|
1097
|
+
i.msg = "header crc mismatch", e.mode = G;
|
|
1098
1098
|
break;
|
|
1099
1099
|
}
|
|
1100
1100
|
o = 0, l = 0;
|
|
1101
1101
|
}
|
|
1102
|
-
e.head && (e.head.hcrc = e.flags >> 9 & 1, e.head.done = !0), i.adler = e.check = 0, e.mode =
|
|
1102
|
+
e.head && (e.head.hcrc = e.flags >> 9 & 1, e.head.done = !0), i.adler = e.check = 0, e.mode = ge;
|
|
1103
1103
|
break;
|
|
1104
|
-
case
|
|
1104
|
+
case Vi:
|
|
1105
1105
|
for (; l < 32; ) {
|
|
1106
1106
|
if (h === 0)
|
|
1107
1107
|
break e;
|
|
1108
1108
|
h--, o += s[r++] << l, l += 8;
|
|
1109
1109
|
}
|
|
1110
|
-
i.adler = e.check =
|
|
1110
|
+
i.adler = e.check = rs(o), o = 0, l = 0, e.mode = Gi;
|
|
1111
1111
|
/* falls through */
|
|
1112
|
-
case
|
|
1112
|
+
case Gi:
|
|
1113
1113
|
if (e.havedict === 0)
|
|
1114
|
-
return i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l,
|
|
1115
|
-
i.adler = e.check = 1, e.mode =
|
|
1114
|
+
return i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l, $n;
|
|
1115
|
+
i.adler = e.check = 1, e.mode = ge;
|
|
1116
1116
|
/* falls through */
|
|
1117
|
-
case
|
|
1117
|
+
case ge:
|
|
1118
1118
|
/* falls through */
|
|
1119
|
-
case
|
|
1119
|
+
case Wt:
|
|
1120
1120
|
if (e.last) {
|
|
1121
|
-
o >>>= l & 7, l -= l & 7, e.mode =
|
|
1121
|
+
o >>>= l & 7, l -= l & 7, e.mode = Yt;
|
|
1122
1122
|
break;
|
|
1123
1123
|
}
|
|
1124
1124
|
for (; l < 3; ) {
|
|
@@ -1128,201 +1128,201 @@ function fr(i, t) {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
switch (e.last = o & 1, o >>>= 1, l -= 1, o & 3) {
|
|
1130
1130
|
case 0:
|
|
1131
|
-
e.mode =
|
|
1131
|
+
e.mode = Wi;
|
|
1132
1132
|
break;
|
|
1133
1133
|
case 1:
|
|
1134
|
-
|
|
1134
|
+
fr(e), e.mode = pt;
|
|
1135
1135
|
break;
|
|
1136
1136
|
case 2:
|
|
1137
|
-
e.mode =
|
|
1137
|
+
e.mode = Yi;
|
|
1138
1138
|
break;
|
|
1139
1139
|
case 3:
|
|
1140
|
-
i.msg = "invalid block type", e.mode =
|
|
1140
|
+
i.msg = "invalid block type", e.mode = G;
|
|
1141
1141
|
}
|
|
1142
1142
|
o >>>= 2, l -= 2;
|
|
1143
1143
|
break;
|
|
1144
|
-
case
|
|
1144
|
+
case Wi:
|
|
1145
1145
|
for (o >>>= l & 7, l -= l & 7; l < 32; ) {
|
|
1146
1146
|
if (h === 0)
|
|
1147
1147
|
break e;
|
|
1148
1148
|
h--, o += s[r++] << l, l += 8;
|
|
1149
1149
|
}
|
|
1150
1150
|
if ((o & 65535) !== (o >>> 16 ^ 65535)) {
|
|
1151
|
-
i.msg = "invalid stored block lengths", e.mode =
|
|
1151
|
+
i.msg = "invalid stored block lengths", e.mode = G;
|
|
1152
1152
|
break;
|
|
1153
1153
|
}
|
|
1154
|
-
e.length = o & 65535, o = 0, l = 0, e.mode =
|
|
1154
|
+
e.length = o & 65535, o = 0, l = 0, e.mode = Zt;
|
|
1155
1155
|
/* falls through */
|
|
1156
|
-
case
|
|
1157
|
-
e.mode =
|
|
1156
|
+
case Zt:
|
|
1157
|
+
e.mode = Zi;
|
|
1158
1158
|
/* falls through */
|
|
1159
|
-
case
|
|
1159
|
+
case Zi:
|
|
1160
1160
|
if (d = e.length, d) {
|
|
1161
1161
|
if (d > h && (d = h), d > c && (d = c), d === 0)
|
|
1162
1162
|
break e;
|
|
1163
|
-
|
|
1163
|
+
me(n, s, r, d, a), h -= d, r += d, c -= d, a += d, e.length -= d;
|
|
1164
1164
|
break;
|
|
1165
1165
|
}
|
|
1166
|
-
e.mode =
|
|
1166
|
+
e.mode = ge;
|
|
1167
1167
|
break;
|
|
1168
|
-
case
|
|
1168
|
+
case Yi:
|
|
1169
1169
|
for (; l < 14; ) {
|
|
1170
1170
|
if (h === 0)
|
|
1171
1171
|
break e;
|
|
1172
1172
|
h--, o += s[r++] << l, l += 8;
|
|
1173
1173
|
}
|
|
1174
1174
|
if (e.nlen = (o & 31) + 257, o >>>= 5, l -= 5, e.ndist = (o & 31) + 1, o >>>= 5, l -= 5, e.ncode = (o & 15) + 4, o >>>= 4, l -= 4, e.nlen > 286 || e.ndist > 30) {
|
|
1175
|
-
i.msg = "too many length or distance symbols", e.mode =
|
|
1175
|
+
i.msg = "too many length or distance symbols", e.mode = G;
|
|
1176
1176
|
break;
|
|
1177
1177
|
}
|
|
1178
|
-
e.have = 0, e.mode =
|
|
1178
|
+
e.have = 0, e.mode = ji;
|
|
1179
1179
|
/* falls through */
|
|
1180
|
-
case
|
|
1180
|
+
case ji:
|
|
1181
1181
|
for (; e.have < e.ncode; ) {
|
|
1182
1182
|
for (; l < 3; ) {
|
|
1183
1183
|
if (h === 0)
|
|
1184
1184
|
break e;
|
|
1185
1185
|
h--, o += s[r++] << l, l += 8;
|
|
1186
1186
|
}
|
|
1187
|
-
e.lens[
|
|
1187
|
+
e.lens[j[e.have++]] = o & 7, o >>>= 3, l -= 3;
|
|
1188
1188
|
}
|
|
1189
1189
|
for (; e.have < 19; )
|
|
1190
|
-
e.lens[
|
|
1191
|
-
if (e.lencode = e.lendyn, e.lenbits = 7, Q = { bits: e.lenbits },
|
|
1192
|
-
i.msg = "invalid code lengths set", e.mode =
|
|
1190
|
+
e.lens[j[e.have++]] = 0;
|
|
1191
|
+
if (e.lencode = e.lendyn, e.lenbits = 7, Q = { bits: e.lenbits }, I = tt(qn, e.lens, 0, 19, e.lencode, 0, e.work, Q), e.lenbits = Q.bits, I) {
|
|
1192
|
+
i.msg = "invalid code lengths set", e.mode = G;
|
|
1193
1193
|
break;
|
|
1194
1194
|
}
|
|
1195
|
-
e.have = 0, e.mode =
|
|
1195
|
+
e.have = 0, e.mode = qi;
|
|
1196
1196
|
/* falls through */
|
|
1197
|
-
case
|
|
1197
|
+
case qi:
|
|
1198
1198
|
for (; e.have < e.nlen + e.ndist; ) {
|
|
1199
|
-
for (; X = e.lencode[o & (1 << e.lenbits) - 1],
|
|
1199
|
+
for (; X = e.lencode[o & (1 << e.lenbits) - 1], C = X >>> 24, M = X >>> 16 & 255, A = X & 65535, !(C <= l); ) {
|
|
1200
1200
|
if (h === 0)
|
|
1201
1201
|
break e;
|
|
1202
1202
|
h--, o += s[r++] << l, l += 8;
|
|
1203
1203
|
}
|
|
1204
1204
|
if (A < 16)
|
|
1205
|
-
o >>>=
|
|
1205
|
+
o >>>= C, l -= C, e.lens[e.have++] = A;
|
|
1206
1206
|
else {
|
|
1207
1207
|
if (A === 16) {
|
|
1208
|
-
for (
|
|
1208
|
+
for (z = C + 2; l < z; ) {
|
|
1209
1209
|
if (h === 0)
|
|
1210
1210
|
break e;
|
|
1211
1211
|
h--, o += s[r++] << l, l += 8;
|
|
1212
1212
|
}
|
|
1213
|
-
if (o >>>=
|
|
1214
|
-
i.msg = "invalid bit length repeat", e.mode =
|
|
1213
|
+
if (o >>>= C, l -= C, e.have === 0) {
|
|
1214
|
+
i.msg = "invalid bit length repeat", e.mode = G;
|
|
1215
1215
|
break;
|
|
1216
1216
|
}
|
|
1217
1217
|
K = e.lens[e.have - 1], d = 3 + (o & 3), o >>>= 2, l -= 2;
|
|
1218
1218
|
} else if (A === 17) {
|
|
1219
|
-
for (
|
|
1219
|
+
for (z = C + 3; l < z; ) {
|
|
1220
1220
|
if (h === 0)
|
|
1221
1221
|
break e;
|
|
1222
1222
|
h--, o += s[r++] << l, l += 8;
|
|
1223
1223
|
}
|
|
1224
|
-
o >>>=
|
|
1224
|
+
o >>>= C, l -= C, K = 0, d = 3 + (o & 7), o >>>= 3, l -= 3;
|
|
1225
1225
|
} else {
|
|
1226
|
-
for (
|
|
1226
|
+
for (z = C + 7; l < z; ) {
|
|
1227
1227
|
if (h === 0)
|
|
1228
1228
|
break e;
|
|
1229
1229
|
h--, o += s[r++] << l, l += 8;
|
|
1230
1230
|
}
|
|
1231
|
-
o >>>=
|
|
1231
|
+
o >>>= C, l -= C, K = 0, d = 11 + (o & 127), o >>>= 7, l -= 7;
|
|
1232
1232
|
}
|
|
1233
1233
|
if (e.have + d > e.nlen + e.ndist) {
|
|
1234
|
-
i.msg = "invalid bit length repeat", e.mode =
|
|
1234
|
+
i.msg = "invalid bit length repeat", e.mode = G;
|
|
1235
1235
|
break;
|
|
1236
1236
|
}
|
|
1237
1237
|
for (; d--; )
|
|
1238
1238
|
e.lens[e.have++] = K;
|
|
1239
1239
|
}
|
|
1240
1240
|
}
|
|
1241
|
-
if (e.mode ===
|
|
1241
|
+
if (e.mode === G)
|
|
1242
1242
|
break;
|
|
1243
1243
|
if (e.lens[256] === 0) {
|
|
1244
|
-
i.msg = "invalid code -- missing end-of-block", e.mode =
|
|
1244
|
+
i.msg = "invalid code -- missing end-of-block", e.mode = G;
|
|
1245
1245
|
break;
|
|
1246
1246
|
}
|
|
1247
|
-
if (e.lenbits = 9, Q = { bits: e.lenbits },
|
|
1248
|
-
i.msg = "invalid literal/lengths set", e.mode =
|
|
1247
|
+
if (e.lenbits = 9, Q = { bits: e.lenbits }, I = tt(rn, e.lens, 0, e.nlen, e.lencode, 0, e.work, Q), e.lenbits = Q.bits, I) {
|
|
1248
|
+
i.msg = "invalid literal/lengths set", e.mode = G;
|
|
1249
1249
|
break;
|
|
1250
1250
|
}
|
|
1251
|
-
if (e.distbits = 6, e.distcode = e.distdyn, Q = { bits: e.distbits },
|
|
1252
|
-
i.msg = "invalid distances set", e.mode =
|
|
1251
|
+
if (e.distbits = 6, e.distcode = e.distdyn, Q = { bits: e.distbits }, I = tt(an, e.lens, e.nlen, e.ndist, e.distcode, 0, e.work, Q), e.distbits = Q.bits, I) {
|
|
1252
|
+
i.msg = "invalid distances set", e.mode = G;
|
|
1253
1253
|
break;
|
|
1254
1254
|
}
|
|
1255
|
+
e.mode = pt;
|
|
1256
|
+
/* falls through */
|
|
1257
|
+
case pt:
|
|
1255
1258
|
e.mode = gt;
|
|
1256
1259
|
/* falls through */
|
|
1257
1260
|
case gt:
|
|
1258
|
-
e.mode = bt;
|
|
1259
|
-
/* falls through */
|
|
1260
|
-
case bt:
|
|
1261
1261
|
if (h >= 6 && c >= 258) {
|
|
1262
|
-
i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l,
|
|
1262
|
+
i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l, Gn(i, f), a = i.next_out, n = i.output, c = i.avail_out, r = i.next_in, s = i.input, h = i.avail_in, o = e.hold, l = e.bits, e.mode === ge && (e.back = -1);
|
|
1263
1263
|
break;
|
|
1264
1264
|
}
|
|
1265
|
-
for (e.back = 0; X = e.lencode[o & (1 << e.lenbits) - 1],
|
|
1265
|
+
for (e.back = 0; X = e.lencode[o & (1 << e.lenbits) - 1], C = X >>> 24, M = X >>> 16 & 255, A = X & 65535, !(C <= l); ) {
|
|
1266
1266
|
if (h === 0)
|
|
1267
1267
|
break e;
|
|
1268
1268
|
h--, o += s[r++] << l, l += 8;
|
|
1269
1269
|
}
|
|
1270
|
-
if (
|
|
1271
|
-
for (S =
|
|
1270
|
+
if (M && (M & 240) === 0) {
|
|
1271
|
+
for (S = C, F = M, N = A; X = e.lencode[N + ((o & (1 << S + F) - 1) >> S)], C = X >>> 24, M = X >>> 16 & 255, A = X & 65535, !(S + C <= l); ) {
|
|
1272
1272
|
if (h === 0)
|
|
1273
1273
|
break e;
|
|
1274
1274
|
h--, o += s[r++] << l, l += 8;
|
|
1275
1275
|
}
|
|
1276
1276
|
o >>>= S, l -= S, e.back += S;
|
|
1277
1277
|
}
|
|
1278
|
-
if (o >>>=
|
|
1279
|
-
e.mode =
|
|
1278
|
+
if (o >>>= C, l -= C, e.back += C, e.length = A, M === 0) {
|
|
1279
|
+
e.mode = is;
|
|
1280
1280
|
break;
|
|
1281
1281
|
}
|
|
1282
|
-
if (
|
|
1283
|
-
e.back = -1, e.mode =
|
|
1282
|
+
if (M & 32) {
|
|
1283
|
+
e.back = -1, e.mode = ge;
|
|
1284
1284
|
break;
|
|
1285
1285
|
}
|
|
1286
|
-
if (
|
|
1287
|
-
i.msg = "invalid literal/length code", e.mode =
|
|
1286
|
+
if (M & 64) {
|
|
1287
|
+
i.msg = "invalid literal/length code", e.mode = G;
|
|
1288
1288
|
break;
|
|
1289
1289
|
}
|
|
1290
|
-
e.extra =
|
|
1290
|
+
e.extra = M & 15, e.mode = Ji;
|
|
1291
1291
|
/* falls through */
|
|
1292
|
-
case
|
|
1292
|
+
case Ji:
|
|
1293
1293
|
if (e.extra) {
|
|
1294
|
-
for (
|
|
1294
|
+
for (z = e.extra; l < z; ) {
|
|
1295
1295
|
if (h === 0)
|
|
1296
1296
|
break e;
|
|
1297
1297
|
h--, o += s[r++] << l, l += 8;
|
|
1298
1298
|
}
|
|
1299
1299
|
e.length += o & (1 << e.extra) - 1, o >>>= e.extra, l -= e.extra, e.back += e.extra;
|
|
1300
1300
|
}
|
|
1301
|
-
e.was = e.length, e.mode =
|
|
1301
|
+
e.was = e.length, e.mode = $i;
|
|
1302
1302
|
/* falls through */
|
|
1303
|
-
case
|
|
1304
|
-
for (; X = e.distcode[o & (1 << e.distbits) - 1],
|
|
1303
|
+
case $i:
|
|
1304
|
+
for (; X = e.distcode[o & (1 << e.distbits) - 1], C = X >>> 24, M = X >>> 16 & 255, A = X & 65535, !(C <= l); ) {
|
|
1305
1305
|
if (h === 0)
|
|
1306
1306
|
break e;
|
|
1307
1307
|
h--, o += s[r++] << l, l += 8;
|
|
1308
1308
|
}
|
|
1309
|
-
if ((
|
|
1310
|
-
for (S =
|
|
1309
|
+
if ((M & 240) === 0) {
|
|
1310
|
+
for (S = C, F = M, N = A; X = e.distcode[N + ((o & (1 << S + F) - 1) >> S)], C = X >>> 24, M = X >>> 16 & 255, A = X & 65535, !(S + C <= l); ) {
|
|
1311
1311
|
if (h === 0)
|
|
1312
1312
|
break e;
|
|
1313
1313
|
h--, o += s[r++] << l, l += 8;
|
|
1314
1314
|
}
|
|
1315
1315
|
o >>>= S, l -= S, e.back += S;
|
|
1316
1316
|
}
|
|
1317
|
-
if (o >>>=
|
|
1318
|
-
i.msg = "invalid distance code", e.mode =
|
|
1317
|
+
if (o >>>= C, l -= C, e.back += C, M & 64) {
|
|
1318
|
+
i.msg = "invalid distance code", e.mode = G;
|
|
1319
1319
|
break;
|
|
1320
1320
|
}
|
|
1321
|
-
e.offset = A, e.extra =
|
|
1321
|
+
e.offset = A, e.extra = M & 15, e.mode = es;
|
|
1322
1322
|
/* falls through */
|
|
1323
|
-
case
|
|
1323
|
+
case es:
|
|
1324
1324
|
if (e.extra) {
|
|
1325
|
-
for (
|
|
1325
|
+
for (z = e.extra; l < z; ) {
|
|
1326
1326
|
if (h === 0)
|
|
1327
1327
|
break e;
|
|
1328
1328
|
h--, o += s[r++] << l, l += 8;
|
|
@@ -1330,34 +1330,34 @@ function fr(i, t) {
|
|
|
1330
1330
|
e.offset += o & (1 << e.extra) - 1, o >>>= e.extra, l -= e.extra, e.back += e.extra;
|
|
1331
1331
|
}
|
|
1332
1332
|
if (e.offset > e.dmax) {
|
|
1333
|
-
i.msg = "invalid distance too far back", e.mode =
|
|
1333
|
+
i.msg = "invalid distance too far back", e.mode = G;
|
|
1334
1334
|
break;
|
|
1335
1335
|
}
|
|
1336
|
-
e.mode =
|
|
1336
|
+
e.mode = ts;
|
|
1337
1337
|
/* falls through */
|
|
1338
|
-
case
|
|
1338
|
+
case ts:
|
|
1339
1339
|
if (c === 0)
|
|
1340
1340
|
break e;
|
|
1341
1341
|
if (d = f - c, e.offset > d) {
|
|
1342
1342
|
if (d = e.offset - d, d > e.whave && e.sane) {
|
|
1343
|
-
i.msg = "invalid distance too far back", e.mode =
|
|
1343
|
+
i.msg = "invalid distance too far back", e.mode = G;
|
|
1344
1344
|
break;
|
|
1345
1345
|
}
|
|
1346
|
-
d > e.wnext ? (d -= e.wnext, k = e.wsize - d) : k = e.wnext - d, d > e.length && (d = e.length),
|
|
1346
|
+
d > e.wnext ? (d -= e.wnext, k = e.wsize - d) : k = e.wnext - d, d > e.length && (d = e.length), E = e.window;
|
|
1347
1347
|
} else
|
|
1348
|
-
|
|
1348
|
+
E = n, k = a - e.offset, d = e.length;
|
|
1349
1349
|
d > c && (d = c), c -= d, e.length -= d;
|
|
1350
1350
|
do
|
|
1351
|
-
n[a++] =
|
|
1351
|
+
n[a++] = E[k++];
|
|
1352
1352
|
while (--d);
|
|
1353
|
-
e.length === 0 && (e.mode =
|
|
1353
|
+
e.length === 0 && (e.mode = gt);
|
|
1354
1354
|
break;
|
|
1355
|
-
case
|
|
1355
|
+
case is:
|
|
1356
1356
|
if (c === 0)
|
|
1357
1357
|
break e;
|
|
1358
|
-
n[a++] = e.length, c--, e.mode =
|
|
1358
|
+
n[a++] = e.length, c--, e.mode = gt;
|
|
1359
1359
|
break;
|
|
1360
|
-
case
|
|
1360
|
+
case Yt:
|
|
1361
1361
|
if (e.wrap) {
|
|
1362
1362
|
for (; l < 32; ) {
|
|
1363
1363
|
if (h === 0)
|
|
@@ -1365,15 +1365,15 @@ function fr(i, t) {
|
|
|
1365
1365
|
h--, o |= s[r++] << l, l += 8;
|
|
1366
1366
|
}
|
|
1367
1367
|
if (f -= c, i.total_out += f, e.total += f, f && (i.adler = e.check = /*UPDATE(state.check, put - _out, _out);*/
|
|
1368
|
-
e.flags ?
|
|
1369
|
-
i.msg = "incorrect data check", e.mode =
|
|
1368
|
+
e.flags ? $(e.check) : di(e.check, n, f, a - f)), f = c, (e.flags ? o : rs(o)) !== e.check) {
|
|
1369
|
+
i.msg = "incorrect data check", e.mode = G;
|
|
1370
1370
|
break;
|
|
1371
1371
|
}
|
|
1372
1372
|
o = 0, l = 0;
|
|
1373
1373
|
}
|
|
1374
|
-
e.mode =
|
|
1374
|
+
e.mode = ss;
|
|
1375
1375
|
/* falls through */
|
|
1376
|
-
case
|
|
1376
|
+
case ss:
|
|
1377
1377
|
if (e.wrap && e.flags) {
|
|
1378
1378
|
for (; l < 32; ) {
|
|
1379
1379
|
if (h === 0)
|
|
@@ -1381,199 +1381,199 @@ function fr(i, t) {
|
|
|
1381
1381
|
h--, o += s[r++] << l, l += 8;
|
|
1382
1382
|
}
|
|
1383
1383
|
if (o !== (e.total & 4294967295)) {
|
|
1384
|
-
i.msg = "incorrect length check", e.mode =
|
|
1384
|
+
i.msg = "incorrect length check", e.mode = G;
|
|
1385
1385
|
break;
|
|
1386
1386
|
}
|
|
1387
1387
|
o = 0, l = 0;
|
|
1388
1388
|
}
|
|
1389
|
-
e.mode =
|
|
1389
|
+
e.mode = ns;
|
|
1390
1390
|
/* falls through */
|
|
1391
|
-
case
|
|
1392
|
-
|
|
1391
|
+
case ns:
|
|
1392
|
+
I = Jn;
|
|
1393
1393
|
break e;
|
|
1394
|
-
case
|
|
1395
|
-
|
|
1394
|
+
case G:
|
|
1395
|
+
I = er;
|
|
1396
1396
|
break e;
|
|
1397
|
-
case
|
|
1398
|
-
return
|
|
1399
|
-
case
|
|
1397
|
+
case sr:
|
|
1398
|
+
return tr;
|
|
1399
|
+
case nr:
|
|
1400
1400
|
/* falls through */
|
|
1401
1401
|
default:
|
|
1402
|
-
return
|
|
1402
|
+
return Te;
|
|
1403
1403
|
}
|
|
1404
|
-
return i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l, (e.wsize || f !== i.avail_out && e.mode <
|
|
1405
|
-
e.flags ?
|
|
1404
|
+
return i.next_out = a, i.avail_out = c, i.next_in = r, i.avail_in = h, e.hold = o, e.bits = l, (e.wsize || f !== i.avail_out && e.mode < G && (e.mode < Yt || t !== Ri)) && xr(i, i.output, i.next_out, f - i.avail_out), x -= i.avail_in, f -= i.avail_out, i.total_in += x, i.total_out += f, e.total += f, e.wrap && f && (i.adler = e.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
|
|
1405
|
+
e.flags ? $(e.check, n, f, i.next_out - f) : di(e.check, n, f, i.next_out - f)), i.data_type = e.bits + (e.last ? 64 : 0) + (e.mode === ge ? 128 : 0) + (e.mode === pt || e.mode === Zt ? 256 : 0), (x === 0 && f === 0 || t === Ri) && I === Mt && (I = ir), I;
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1407
|
+
function ln() {
|
|
1408
1408
|
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;
|
|
1409
1409
|
}
|
|
1410
|
-
class
|
|
1410
|
+
class Dt {
|
|
1411
1411
|
constructor() {
|
|
1412
|
-
this.strm = new
|
|
1412
|
+
this.strm = new ln(), this.chunkSize = 1024 * 10 * 10, this.strm.output = new Uint8Array(this.chunkSize), dr(this.strm);
|
|
1413
1413
|
}
|
|
1414
1414
|
setInput(t) {
|
|
1415
1415
|
t ? (this.strm.input = t, this.strm.avail_in = this.strm.input.length, this.strm.next_in = 0) : (this.strm.input = null, this.strm.avail_in = 0, this.strm.next_in = 0);
|
|
1416
1416
|
}
|
|
1417
1417
|
inflate(t) {
|
|
1418
|
-
if (t > this.chunkSize && (this.chunkSize = t, this.strm.output = new Uint8Array(this.chunkSize)), this.strm.next_out = 0, this.strm.avail_out = t,
|
|
1418
|
+
if (t > this.chunkSize && (this.chunkSize = t, this.strm.output = new Uint8Array(this.chunkSize)), this.strm.next_out = 0, this.strm.avail_out = t, pr(this.strm, 0) < 0)
|
|
1419
1419
|
throw new Error("zlib inflate failed");
|
|
1420
1420
|
if (this.strm.next_out != t)
|
|
1421
1421
|
throw new Error("Incomplete zlib block");
|
|
1422
1422
|
return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
|
|
1423
1423
|
}
|
|
1424
1424
|
reset() {
|
|
1425
|
-
|
|
1425
|
+
hn(this.strm);
|
|
1426
1426
|
}
|
|
1427
1427
|
}
|
|
1428
|
-
var
|
|
1428
|
+
var gr = 4, os = 0, hs = 1, br = 2;
|
|
1429
1429
|
function Oe(i) {
|
|
1430
1430
|
for (var t = i.length; --t >= 0; )
|
|
1431
1431
|
i[t] = 0;
|
|
1432
1432
|
}
|
|
1433
|
-
var
|
|
1433
|
+
var wr = 0, mr = 1, vr = 2, yr = 3, kr = 258, bi = 29, lt = 256, nt = lt + 1 + bi, He = 30, wi = 19, cn = 2 * nt + 1, Me = 15, Jt = 16, Sr = 7, un = 256, _n = 16, dn = 17, fn = 18, fi = (
|
|
1434
1434
|
/* extra bits for each length code */
|
|
1435
1435
|
[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]
|
|
1436
|
-
),
|
|
1436
|
+
), Ct = (
|
|
1437
1437
|
/* extra bits for each distance code */
|
|
1438
1438
|
[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]
|
|
1439
|
-
),
|
|
1439
|
+
), Er = (
|
|
1440
1440
|
/* extra bits for each bit length code */
|
|
1441
1441
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]
|
|
1442
|
-
),
|
|
1443
|
-
Oe(
|
|
1444
|
-
var
|
|
1445
|
-
Oe(
|
|
1446
|
-
var
|
|
1447
|
-
Oe(
|
|
1448
|
-
var
|
|
1449
|
-
Oe(
|
|
1450
|
-
var
|
|
1451
|
-
Oe(
|
|
1452
|
-
var
|
|
1453
|
-
Oe(
|
|
1454
|
-
function
|
|
1442
|
+
), xn = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], Cr = 512, ke = new Array((nt + 2) * 2);
|
|
1443
|
+
Oe(ke);
|
|
1444
|
+
var it = new Array(He * 2);
|
|
1445
|
+
Oe(it);
|
|
1446
|
+
var rt = new Array(Cr);
|
|
1447
|
+
Oe(rt);
|
|
1448
|
+
var at = new Array(kr - yr + 1);
|
|
1449
|
+
Oe(at);
|
|
1450
|
+
var mi = new Array(bi);
|
|
1451
|
+
Oe(mi);
|
|
1452
|
+
var Tt = new Array(He);
|
|
1453
|
+
Oe(Tt);
|
|
1454
|
+
function $t(i, t, e, s, n) {
|
|
1455
1455
|
this.static_tree = i, this.extra_bits = t, this.extra_base = e, this.elems = s, this.max_length = n, this.has_stree = i && i.length;
|
|
1456
1456
|
}
|
|
1457
|
-
var
|
|
1458
|
-
function
|
|
1457
|
+
var pn, gn, bn;
|
|
1458
|
+
function ei(i, t) {
|
|
1459
1459
|
this.dyn_tree = i, this.max_code = 0, this.stat_desc = t;
|
|
1460
1460
|
}
|
|
1461
|
-
function
|
|
1462
|
-
return i < 256 ?
|
|
1461
|
+
function wn(i) {
|
|
1462
|
+
return i < 256 ? rt[i] : rt[256 + (i >>> 7)];
|
|
1463
1463
|
}
|
|
1464
|
-
function
|
|
1464
|
+
function Qt(i, t) {
|
|
1465
1465
|
i.pending_buf[i.pending++] = t & 255, i.pending_buf[i.pending++] = t >>> 8 & 255;
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1468
|
-
i.bi_valid >
|
|
1467
|
+
function le(i, t, e) {
|
|
1468
|
+
i.bi_valid > Jt - e ? (i.bi_buf |= t << i.bi_valid & 65535, Qt(i, i.bi_buf), i.bi_buf = t >> Jt - i.bi_valid, i.bi_valid += e - Jt) : (i.bi_buf |= t << i.bi_valid & 65535, i.bi_valid += e);
|
|
1469
1469
|
}
|
|
1470
|
-
function
|
|
1471
|
-
|
|
1470
|
+
function we(i, t, e) {
|
|
1471
|
+
le(
|
|
1472
1472
|
i,
|
|
1473
1473
|
e[t * 2],
|
|
1474
1474
|
e[t * 2 + 1]
|
|
1475
1475
|
/*.Len*/
|
|
1476
1476
|
);
|
|
1477
1477
|
}
|
|
1478
|
-
function
|
|
1478
|
+
function mn(i, t) {
|
|
1479
1479
|
var e = 0;
|
|
1480
1480
|
do
|
|
1481
1481
|
e |= i & 1, i >>>= 1, e <<= 1;
|
|
1482
1482
|
while (--t > 0);
|
|
1483
1483
|
return e >>> 1;
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1486
|
-
var e = t.dyn_tree, s = t.max_code, n = t.stat_desc.static_tree, r = t.stat_desc.has_stree, a = t.stat_desc.extra_bits, h = t.stat_desc.extra_base, c = t.stat_desc.max_length, o, l, x, f, d, k,
|
|
1487
|
-
for (f = 0; f <=
|
|
1485
|
+
function Kr(i, t) {
|
|
1486
|
+
var e = t.dyn_tree, s = t.max_code, n = t.stat_desc.static_tree, r = t.stat_desc.has_stree, a = t.stat_desc.extra_bits, h = t.stat_desc.extra_base, c = t.stat_desc.max_length, o, l, x, f, d, k, E = 0;
|
|
1487
|
+
for (f = 0; f <= Me; f++)
|
|
1488
1488
|
i.bl_count[f] = 0;
|
|
1489
|
-
for (e[i.heap[i.heap_max] * 2 + 1] = 0, o = i.heap_max + 1; o <
|
|
1490
|
-
l = i.heap[o], f = e[e[l * 2 + 1] * 2 + 1] + 1, f > c && (f = c,
|
|
1491
|
-
if (
|
|
1489
|
+
for (e[i.heap[i.heap_max] * 2 + 1] = 0, o = i.heap_max + 1; o < cn; o++)
|
|
1490
|
+
l = i.heap[o], f = e[e[l * 2 + 1] * 2 + 1] + 1, f > c && (f = c, E++), e[l * 2 + 1] = f, !(l > s) && (i.bl_count[f]++, d = 0, l >= h && (d = a[l - h]), k = e[l * 2], i.opt_len += k * (f + d), r && (i.static_len += k * (n[l * 2 + 1] + d)));
|
|
1491
|
+
if (E !== 0) {
|
|
1492
1492
|
do {
|
|
1493
1493
|
for (f = c - 1; i.bl_count[f] === 0; )
|
|
1494
1494
|
f--;
|
|
1495
|
-
i.bl_count[f]--, i.bl_count[f + 1] += 2, i.bl_count[c]--,
|
|
1496
|
-
} while (
|
|
1495
|
+
i.bl_count[f]--, i.bl_count[f + 1] += 2, i.bl_count[c]--, E -= 2;
|
|
1496
|
+
} while (E > 0);
|
|
1497
1497
|
for (f = c; f !== 0; f--)
|
|
1498
1498
|
for (l = i.bl_count[f]; l !== 0; )
|
|
1499
1499
|
x = i.heap[--o], !(x > s) && (e[x * 2 + 1] !== f && (i.opt_len += (f - e[x * 2 + 1]) * e[x * 2], e[x * 2 + 1] = f), l--);
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1503
|
-
var s = new Array(
|
|
1504
|
-
for (r = 1; r <=
|
|
1502
|
+
function vn(i, t, e) {
|
|
1503
|
+
var s = new Array(Me + 1), n = 0, r, a;
|
|
1504
|
+
for (r = 1; r <= Me; r++)
|
|
1505
1505
|
s[r] = n = n + e[r - 1] << 1;
|
|
1506
1506
|
for (a = 0; a <= t; a++) {
|
|
1507
1507
|
var h = i[a * 2 + 1];
|
|
1508
|
-
h !== 0 && (i[a * 2] =
|
|
1508
|
+
h !== 0 && (i[a * 2] = mn(s[h]++, h));
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
|
-
function
|
|
1512
|
-
var i, t, e, s, n, r = new Array(
|
|
1513
|
-
for (e = 0, s = 0; s <
|
|
1514
|
-
for (
|
|
1515
|
-
|
|
1516
|
-
for (
|
|
1517
|
-
for (
|
|
1518
|
-
|
|
1511
|
+
function Ar() {
|
|
1512
|
+
var i, t, e, s, n, r = new Array(Me + 1);
|
|
1513
|
+
for (e = 0, s = 0; s < bi - 1; s++)
|
|
1514
|
+
for (mi[s] = e, i = 0; i < 1 << fi[s]; i++)
|
|
1515
|
+
at[e++] = s;
|
|
1516
|
+
for (at[e - 1] = s, n = 0, s = 0; s < 16; s++)
|
|
1517
|
+
for (Tt[s] = n, i = 0; i < 1 << Ct[s]; i++)
|
|
1518
|
+
rt[n++] = s;
|
|
1519
1519
|
for (n >>= 7; s < He; s++)
|
|
1520
|
-
for (
|
|
1521
|
-
|
|
1522
|
-
for (t = 0; t <=
|
|
1520
|
+
for (Tt[s] = n << 7, i = 0; i < 1 << Ct[s] - 7; i++)
|
|
1521
|
+
rt[256 + n++] = s;
|
|
1522
|
+
for (t = 0; t <= Me; t++)
|
|
1523
1523
|
r[t] = 0;
|
|
1524
1524
|
for (i = 0; i <= 143; )
|
|
1525
|
-
|
|
1525
|
+
ke[i * 2 + 1] = 8, i++, r[8]++;
|
|
1526
1526
|
for (; i <= 255; )
|
|
1527
|
-
|
|
1527
|
+
ke[i * 2 + 1] = 9, i++, r[9]++;
|
|
1528
1528
|
for (; i <= 279; )
|
|
1529
|
-
|
|
1529
|
+
ke[i * 2 + 1] = 7, i++, r[7]++;
|
|
1530
1530
|
for (; i <= 287; )
|
|
1531
|
-
|
|
1532
|
-
for (
|
|
1533
|
-
|
|
1534
|
-
|
|
1531
|
+
ke[i * 2 + 1] = 8, i++, r[8]++;
|
|
1532
|
+
for (vn(ke, nt + 1, r), i = 0; i < He; i++)
|
|
1533
|
+
it[i * 2 + 1] = 5, it[i * 2] = mn(i, 5);
|
|
1534
|
+
pn = new $t(ke, fi, lt + 1, nt, Me), gn = new $t(it, Ct, 0, He, Me), bn = new $t(new Array(0), Er, 0, wi, Sr);
|
|
1535
1535
|
}
|
|
1536
|
-
function
|
|
1536
|
+
function yn(i) {
|
|
1537
1537
|
var t;
|
|
1538
|
-
for (t = 0; t <
|
|
1538
|
+
for (t = 0; t < nt; t++)
|
|
1539
1539
|
i.dyn_ltree[t * 2] = 0;
|
|
1540
1540
|
for (t = 0; t < He; t++)
|
|
1541
1541
|
i.dyn_dtree[t * 2] = 0;
|
|
1542
|
-
for (t = 0; t <
|
|
1542
|
+
for (t = 0; t < wi; t++)
|
|
1543
1543
|
i.bl_tree[t * 2] = 0;
|
|
1544
|
-
i.dyn_ltree[
|
|
1544
|
+
i.dyn_ltree[un * 2] = 1, i.opt_len = i.static_len = 0, i.last_lit = i.matches = 0;
|
|
1545
1545
|
}
|
|
1546
|
-
function
|
|
1547
|
-
i.bi_valid > 8 ?
|
|
1546
|
+
function kn(i) {
|
|
1547
|
+
i.bi_valid > 8 ? Qt(i, i.bi_buf) : i.bi_valid > 0 && (i.pending_buf[i.pending++] = i.bi_buf), i.bi_buf = 0, i.bi_valid = 0;
|
|
1548
1548
|
}
|
|
1549
|
-
function
|
|
1550
|
-
|
|
1549
|
+
function Xr(i, t, e, s) {
|
|
1550
|
+
kn(i), Qt(i, e), Qt(i, ~e), me(i.pending_buf, i.window, t, e, i.pending), i.pending += e;
|
|
1551
1551
|
}
|
|
1552
|
-
function
|
|
1552
|
+
function ls(i, t, e, s) {
|
|
1553
1553
|
var n = t * 2, r = e * 2;
|
|
1554
1554
|
return i[n] < i[r] || i[n] === i[r] && s[t] <= s[e];
|
|
1555
1555
|
}
|
|
1556
|
-
function
|
|
1557
|
-
for (var s = i.heap[e], n = e << 1; n <= i.heap_len && (n < i.heap_len &&
|
|
1556
|
+
function ti(i, t, e) {
|
|
1557
|
+
for (var s = i.heap[e], n = e << 1; n <= i.heap_len && (n < i.heap_len && ls(t, i.heap[n + 1], i.heap[n], i.depth) && n++, !ls(t, s, i.heap[n], i.depth)); )
|
|
1558
1558
|
i.heap[e] = i.heap[n], e = n, n <<= 1;
|
|
1559
1559
|
i.heap[e] = s;
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1561
|
+
function cs(i, t, e) {
|
|
1562
1562
|
var s, n, r = 0, a, h;
|
|
1563
1563
|
if (i.last_lit !== 0)
|
|
1564
1564
|
do
|
|
1565
|
-
s = i.pending_buf[i.d_buf + r * 2] << 8 | i.pending_buf[i.d_buf + r * 2 + 1], n = i.pending_buf[i.l_buf + r], r++, s === 0 ?
|
|
1565
|
+
s = i.pending_buf[i.d_buf + r * 2] << 8 | i.pending_buf[i.d_buf + r * 2 + 1], n = i.pending_buf[i.l_buf + r], r++, s === 0 ? we(i, n, t) : (a = at[n], we(i, a + lt + 1, t), h = fi[a], h !== 0 && (n -= mi[a], le(i, n, h)), s--, a = wn(s), we(i, a, e), h = Ct[a], h !== 0 && (s -= Tt[a], le(i, s, h)));
|
|
1566
1566
|
while (r < i.last_lit);
|
|
1567
|
-
|
|
1567
|
+
we(i, un, t);
|
|
1568
1568
|
}
|
|
1569
|
-
function
|
|
1569
|
+
function xi(i, t) {
|
|
1570
1570
|
var e = t.dyn_tree, s = t.stat_desc.static_tree, n = t.stat_desc.has_stree, r = t.stat_desc.elems, a, h, c = -1, o;
|
|
1571
|
-
for (i.heap_len = 0, i.heap_max =
|
|
1571
|
+
for (i.heap_len = 0, i.heap_max = cn, a = 0; a < r; a++)
|
|
1572
1572
|
e[a * 2] !== 0 ? (i.heap[++i.heap_len] = c = a, i.depth[a] = 0) : e[a * 2 + 1] = 0;
|
|
1573
1573
|
for (; i.heap_len < 2; )
|
|
1574
1574
|
o = i.heap[++i.heap_len] = c < 2 ? ++c : 0, e[o * 2] = 1, i.depth[o] = 0, i.opt_len--, n && (i.static_len -= s[o * 2 + 1]);
|
|
1575
1575
|
for (t.max_code = c, a = i.heap_len >> 1; a >= 1; a--)
|
|
1576
|
-
|
|
1576
|
+
ti(i, e, a);
|
|
1577
1577
|
o = r;
|
|
1578
1578
|
do
|
|
1579
1579
|
a = i.heap[
|
|
@@ -1582,7 +1582,7 @@ function fi(i, t) {
|
|
|
1582
1582
|
], i.heap[
|
|
1583
1583
|
1
|
|
1584
1584
|
/*SMALLEST*/
|
|
1585
|
-
] = i.heap[i.heap_len--],
|
|
1585
|
+
] = i.heap[i.heap_len--], ti(
|
|
1586
1586
|
i,
|
|
1587
1587
|
e,
|
|
1588
1588
|
1
|
|
@@ -1593,7 +1593,7 @@ function fi(i, t) {
|
|
|
1593
1593
|
], i.heap[--i.heap_max] = a, i.heap[--i.heap_max] = h, e[o * 2] = e[a * 2] + e[h * 2], i.depth[o] = (i.depth[a] >= i.depth[h] ? i.depth[a] : i.depth[h]) + 1, e[a * 2 + 1] = e[h * 2 + 1] = o, i.heap[
|
|
1594
1594
|
1
|
|
1595
1595
|
/*SMALLEST*/
|
|
1596
|
-
] = o++,
|
|
1596
|
+
] = o++, ti(
|
|
1597
1597
|
i,
|
|
1598
1598
|
e,
|
|
1599
1599
|
1
|
|
@@ -1603,64 +1603,64 @@ function fi(i, t) {
|
|
|
1603
1603
|
i.heap[--i.heap_max] = i.heap[
|
|
1604
1604
|
1
|
|
1605
1605
|
/*SMALLEST*/
|
|
1606
|
-
],
|
|
1606
|
+
], Kr(i, t), vn(e, c, i.bl_count);
|
|
1607
1607
|
}
|
|
1608
|
-
function
|
|
1608
|
+
function us(i, t, e) {
|
|
1609
1609
|
var s, n = -1, r, a = t[1], h = 0, c = 7, o = 4;
|
|
1610
1610
|
for (a === 0 && (c = 138, o = 3), t[(e + 1) * 2 + 1] = 65535, s = 0; s <= e; s++)
|
|
1611
|
-
r = a, a = t[(s + 1) * 2 + 1], !(++h < c && r === a) && (h < o ? i.bl_tree[r * 2] += h : r !== 0 ? (r !== n && i.bl_tree[r * 2]++, i.bl_tree[
|
|
1611
|
+
r = a, a = t[(s + 1) * 2 + 1], !(++h < c && r === a) && (h < o ? i.bl_tree[r * 2] += h : r !== 0 ? (r !== n && i.bl_tree[r * 2]++, i.bl_tree[_n * 2]++) : h <= 10 ? i.bl_tree[dn * 2]++ : i.bl_tree[fn * 2]++, h = 0, n = r, a === 0 ? (c = 138, o = 3) : r === a ? (c = 6, o = 3) : (c = 7, o = 4));
|
|
1612
1612
|
}
|
|
1613
|
-
function
|
|
1613
|
+
function _s(i, t, e) {
|
|
1614
1614
|
var s, n = -1, r, a = t[1], h = 0, c = 7, o = 4;
|
|
1615
1615
|
for (a === 0 && (c = 138, o = 3), s = 0; s <= e; s++)
|
|
1616
1616
|
if (r = a, a = t[(s + 1) * 2 + 1], !(++h < c && r === a)) {
|
|
1617
1617
|
if (h < o)
|
|
1618
1618
|
do
|
|
1619
|
-
|
|
1619
|
+
we(i, r, i.bl_tree);
|
|
1620
1620
|
while (--h !== 0);
|
|
1621
|
-
else r !== 0 ? (r !== n && (
|
|
1621
|
+
else r !== 0 ? (r !== n && (we(i, r, i.bl_tree), h--), we(i, _n, i.bl_tree), le(i, h - 3, 2)) : h <= 10 ? (we(i, dn, i.bl_tree), le(i, h - 3, 3)) : (we(i, fn, i.bl_tree), le(i, h - 11, 7));
|
|
1622
1622
|
h = 0, n = r, a === 0 ? (c = 138, o = 3) : r === a ? (c = 6, o = 3) : (c = 7, o = 4);
|
|
1623
1623
|
}
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1625
|
+
function Fr(i) {
|
|
1626
1626
|
var t;
|
|
1627
|
-
for (
|
|
1627
|
+
for (us(i, i.dyn_ltree, i.l_desc.max_code), us(i, i.dyn_dtree, i.d_desc.max_code), xi(i, i.bl_desc), t = wi - 1; t >= 3 && i.bl_tree[xn[t] * 2 + 1] === 0; t--)
|
|
1628
1628
|
;
|
|
1629
1629
|
return i.opt_len += 3 * (t + 1) + 5 + 5 + 4, t;
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1631
|
+
function Mr(i, t, e, s) {
|
|
1632
1632
|
var n;
|
|
1633
|
-
for (
|
|
1634
|
-
|
|
1635
|
-
|
|
1633
|
+
for (le(i, t - 257, 5), le(i, e - 1, 5), le(i, s - 4, 4), n = 0; n < s; n++)
|
|
1634
|
+
le(i, i.bl_tree[xn[n] * 2 + 1], 3);
|
|
1635
|
+
_s(i, i.dyn_ltree, t - 1), _s(i, i.dyn_dtree, e - 1);
|
|
1636
1636
|
}
|
|
1637
|
-
function
|
|
1637
|
+
function Tr(i) {
|
|
1638
1638
|
var t = 4093624447, e;
|
|
1639
1639
|
for (e = 0; e <= 31; e++, t >>>= 1)
|
|
1640
1640
|
if (t & 1 && i.dyn_ltree[e * 2] !== 0)
|
|
1641
|
-
return
|
|
1641
|
+
return os;
|
|
1642
1642
|
if (i.dyn_ltree[18] !== 0 || i.dyn_ltree[20] !== 0 || i.dyn_ltree[26] !== 0)
|
|
1643
|
-
return
|
|
1644
|
-
for (e = 32; e <
|
|
1643
|
+
return hs;
|
|
1644
|
+
for (e = 32; e < lt; e++)
|
|
1645
1645
|
if (i.dyn_ltree[e * 2] !== 0)
|
|
1646
|
-
return
|
|
1647
|
-
return
|
|
1646
|
+
return hs;
|
|
1647
|
+
return os;
|
|
1648
1648
|
}
|
|
1649
|
-
var
|
|
1650
|
-
function
|
|
1651
|
-
|
|
1649
|
+
var ds = !1;
|
|
1650
|
+
function Qr(i) {
|
|
1651
|
+
ds || (Ar(), ds = !0), i.l_desc = new ei(i.dyn_ltree, pn), i.d_desc = new ei(i.dyn_dtree, gn), i.bl_desc = new ei(i.bl_tree, bn), i.bi_buf = 0, i.bi_valid = 0, yn(i);
|
|
1652
1652
|
}
|
|
1653
|
-
function
|
|
1654
|
-
|
|
1653
|
+
function Sn(i, t, e, s) {
|
|
1654
|
+
le(i, (wr << 1) + (s ? 1 : 0), 3), Xr(i, t, e);
|
|
1655
1655
|
}
|
|
1656
|
-
function
|
|
1656
|
+
function Lr(i, t, e, s) {
|
|
1657
1657
|
var n, r, a = 0;
|
|
1658
|
-
i.level > 0 ? (i.strm.data_type ===
|
|
1658
|
+
i.level > 0 ? (i.strm.data_type === br && (i.strm.data_type = Tr(i)), xi(i, i.l_desc), xi(i, i.d_desc), a = Fr(i), n = i.opt_len + 3 + 7 >>> 3, r = i.static_len + 3 + 7 >>> 3, r <= n && (n = r)) : n = r = e + 5, e + 4 <= n && t !== -1 ? Sn(i, t, e, s) : i.strategy === gr || r === n ? (le(i, (mr << 1) + (s ? 1 : 0), 3), cs(i, ke, it)) : (le(i, (vr << 1) + (s ? 1 : 0), 3), Mr(i, i.l_desc.max_code + 1, i.d_desc.max_code + 1, a + 1), cs(i, i.dyn_ltree, i.dyn_dtree)), yn(i), s && kn(i);
|
|
1659
1659
|
}
|
|
1660
|
-
function
|
|
1661
|
-
return i.pending_buf[i.d_buf + i.last_lit * 2] = t >>> 8 & 255, i.pending_buf[i.d_buf + i.last_lit * 2 + 1] = t & 255, i.pending_buf[i.l_buf + i.last_lit] = e & 255, i.last_lit++, t === 0 ? i.dyn_ltree[e * 2]++ : (i.matches++, t--, i.dyn_ltree[(
|
|
1660
|
+
function Ce(i, t, e) {
|
|
1661
|
+
return i.pending_buf[i.d_buf + i.last_lit * 2] = t >>> 8 & 255, i.pending_buf[i.d_buf + i.last_lit * 2 + 1] = t & 255, i.pending_buf[i.l_buf + i.last_lit] = e & 255, i.last_lit++, t === 0 ? i.dyn_ltree[e * 2]++ : (i.matches++, t--, i.dyn_ltree[(at[e] + lt + 1) * 2]++, i.dyn_dtree[wn(t) * 2]++), i.last_lit === i.lit_bufsize - 1;
|
|
1662
1662
|
}
|
|
1663
|
-
const
|
|
1663
|
+
const Rr = {
|
|
1664
1664
|
2: "need dictionary",
|
|
1665
1665
|
/* Z_NEED_DICT 2 */
|
|
1666
1666
|
1: "stream end",
|
|
@@ -1679,37 +1679,37 @@ const Qr = {
|
|
|
1679
1679
|
/* Z_BUF_ERROR (-5) */
|
|
1680
1680
|
"-6": "incompatible version"
|
|
1681
1681
|
/* Z_VERSION_ERROR (-6) */
|
|
1682
|
-
},
|
|
1683
|
-
var
|
|
1682
|
+
}, ct = 0, fs = 3, ot = 4, Br = 5, Pe = 0, ze = -2, ii = -5, En = -1, Dr = 1, bt = 2, Ir = 3, Pr = 4, Ur = 0, Nr = 2, vi = 8;
|
|
1683
|
+
var Hr = 15, zr = 8, Or = 29, Vr = 256, pi = Vr + 1 + Or, Gr = 30, Wr = 19, Zr = 2 * pi + 1, Yr = 15, O = 3, Se = 258, _e = Se + O + 1, jr = 32, Cn = 42, xs = 69, si = 73, ni = 91, ri = 103, $e = 113, wt = 666, ee = 1, ut = 2, ht = 3, It = 4, qr = 3;
|
|
1684
1684
|
function Ue(i, t) {
|
|
1685
|
-
return i.msg =
|
|
1685
|
+
return i.msg = Rr[t], t;
|
|
1686
1686
|
}
|
|
1687
|
-
function
|
|
1687
|
+
function ps(i) {
|
|
1688
1688
|
return (i << 1) - (i > 4 ? 9 : 0);
|
|
1689
1689
|
}
|
|
1690
|
-
function
|
|
1690
|
+
function Fe(i) {
|
|
1691
1691
|
for (var t = i.length; --t >= 0; )
|
|
1692
1692
|
i[t] = 0;
|
|
1693
1693
|
}
|
|
1694
|
-
function
|
|
1694
|
+
function Ae(i) {
|
|
1695
1695
|
var t = i.state, e = t.pending;
|
|
1696
|
-
e > i.avail_out && (e = i.avail_out), e !== 0 && (
|
|
1696
|
+
e > i.avail_out && (e = i.avail_out), e !== 0 && (me(i.output, t.pending_buf, t.pending_out, e, i.next_out), i.next_out += e, t.pending_out += e, i.total_out += e, i.avail_out -= e, t.pending -= e, t.pending === 0 && (t.pending_out = 0));
|
|
1697
1697
|
}
|
|
1698
|
-
function
|
|
1699
|
-
|
|
1698
|
+
function he(i, t) {
|
|
1699
|
+
Lr(i, i.block_start >= 0 ? i.block_start : -1, i.strstart - i.block_start, t), i.block_start = i.strstart, Ae(i.strm);
|
|
1700
1700
|
}
|
|
1701
|
-
function
|
|
1701
|
+
function W(i, t) {
|
|
1702
1702
|
i.pending_buf[i.pending++] = t;
|
|
1703
1703
|
}
|
|
1704
|
-
function
|
|
1704
|
+
function ai(i, t) {
|
|
1705
1705
|
i.pending_buf[i.pending++] = t >>> 8 & 255, i.pending_buf[i.pending++] = t & 255;
|
|
1706
1706
|
}
|
|
1707
|
-
function
|
|
1707
|
+
function Jr(i, t, e, s) {
|
|
1708
1708
|
var n = i.avail_in;
|
|
1709
|
-
return n > s && (n = s), n === 0 ? 0 : (i.avail_in -= n,
|
|
1709
|
+
return n > s && (n = s), n === 0 ? 0 : (i.avail_in -= n, me(t, i.input, i.next_in, n, e), i.state.wrap === 1 ? i.adler = di(i.adler, t, n, e) : i.state.wrap === 2 && (i.adler = $(i.adler)), i.next_in += n, i.total_in += n, n);
|
|
1710
1710
|
}
|
|
1711
|
-
function
|
|
1712
|
-
var e = i.max_chain_length, s = i.strstart, n, r, a = i.prev_length, h = i.nice_match, c = i.strstart > i.w_size -
|
|
1711
|
+
function Kn(i, t) {
|
|
1712
|
+
var e = i.max_chain_length, s = i.strstart, n, r, a = i.prev_length, h = i.nice_match, c = i.strstart > i.w_size - _e ? i.strstart - (i.w_size - _e) : 0, o = i.window, l = i.w_mask, x = i.prev, f = i.strstart + Se, d = o[s + a - 1], k = o[s + a];
|
|
1713
1713
|
i.prev_length >= i.good_match && (e >>= 2), h > i.lookahead && (h = i.lookahead);
|
|
1714
1714
|
do
|
|
1715
1715
|
if (n = t, !(o[n + a] !== k || o[n + a - 1] !== d || o[n] !== o[s] || o[++n] !== o[s + 1])) {
|
|
@@ -1717,7 +1717,7 @@ function En(i, t) {
|
|
|
1717
1717
|
do
|
|
1718
1718
|
;
|
|
1719
1719
|
while (o[++s] === o[++n] && o[++s] === o[++n] && o[++s] === o[++n] && o[++s] === o[++n] && o[++s] === o[++n] && o[++s] === o[++n] && o[++s] === o[++n] && o[++s] === o[++n] && s < f);
|
|
1720
|
-
if (r =
|
|
1720
|
+
if (r = Se - (f - s), s = f - Se, r > a) {
|
|
1721
1721
|
if (i.match_start = t, a = r, r >= h)
|
|
1722
1722
|
break;
|
|
1723
1723
|
d = o[s + a - 1], k = o[s + a];
|
|
@@ -1726,11 +1726,11 @@ function En(i, t) {
|
|
|
1726
1726
|
while ((t = x[t & l]) > c && --e !== 0);
|
|
1727
1727
|
return a <= i.lookahead ? a : i.lookahead;
|
|
1728
1728
|
}
|
|
1729
|
-
function
|
|
1729
|
+
function _t(i) {
|
|
1730
1730
|
var t = i.w_size, e, s, n, r, a;
|
|
1731
1731
|
do {
|
|
1732
|
-
if (r = i.window_size - i.lookahead - i.strstart, i.strstart >= t + (t -
|
|
1733
|
-
|
|
1732
|
+
if (r = i.window_size - i.lookahead - i.strstart, i.strstart >= t + (t - _e)) {
|
|
1733
|
+
me(i.window, i.window, t, t, 0), i.match_start -= t, i.strstart -= t, i.block_start -= t, s = i.hash_size, e = s;
|
|
1734
1734
|
do
|
|
1735
1735
|
n = i.head[--e], i.head[e] = n >= t ? n - t : 0;
|
|
1736
1736
|
while (--s);
|
|
@@ -1742,225 +1742,225 @@ function ft(i) {
|
|
|
1742
1742
|
}
|
|
1743
1743
|
if (i.strm.avail_in === 0)
|
|
1744
1744
|
break;
|
|
1745
|
-
if (s =
|
|
1746
|
-
for (a = i.strstart - i.insert, i.ins_h = i.window[a], i.ins_h = (i.ins_h << i.hash_shift ^ i.window[a + 1]) & i.hash_mask; i.insert && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[a +
|
|
1745
|
+
if (s = Jr(i.strm, i.window, i.strstart + i.lookahead, r), i.lookahead += s, i.lookahead + i.insert >= O)
|
|
1746
|
+
for (a = i.strstart - i.insert, i.ins_h = i.window[a], i.ins_h = (i.ins_h << i.hash_shift ^ i.window[a + 1]) & i.hash_mask; i.insert && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[a + O - 1]) & i.hash_mask, i.prev[a & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = a, a++, i.insert--, !(i.lookahead + i.insert < O)); )
|
|
1747
1747
|
;
|
|
1748
|
-
} while (i.lookahead <
|
|
1748
|
+
} while (i.lookahead < _e && i.strm.avail_in !== 0);
|
|
1749
1749
|
}
|
|
1750
|
-
function
|
|
1750
|
+
function $r(i, t) {
|
|
1751
1751
|
var e = 65535;
|
|
1752
1752
|
for (e > i.pending_buf_size - 5 && (e = i.pending_buf_size - 5); ; ) {
|
|
1753
1753
|
if (i.lookahead <= 1) {
|
|
1754
|
-
if (
|
|
1754
|
+
if (_t(i), i.lookahead === 0 && t === ct)
|
|
1755
1755
|
return ee;
|
|
1756
1756
|
if (i.lookahead === 0)
|
|
1757
1757
|
break;
|
|
1758
1758
|
}
|
|
1759
1759
|
i.strstart += i.lookahead, i.lookahead = 0;
|
|
1760
1760
|
var s = i.block_start + e;
|
|
1761
|
-
if ((i.strstart === 0 || i.strstart >= s) && (i.lookahead = i.strstart - s, i.strstart = s,
|
|
1761
|
+
if ((i.strstart === 0 || i.strstart >= s) && (i.lookahead = i.strstart - s, i.strstart = s, he(i, !1), i.strm.avail_out === 0) || i.strstart - i.block_start >= i.w_size - _e && (he(i, !1), i.strm.avail_out === 0))
|
|
1762
1762
|
return ee;
|
|
1763
1763
|
}
|
|
1764
|
-
return i.insert = 0, t ===
|
|
1764
|
+
return i.insert = 0, t === ot ? (he(i, !0), i.strm.avail_out === 0 ? ht : It) : (i.strstart > i.block_start && (he(i, !1), i.strm.avail_out === 0), ee);
|
|
1765
1765
|
}
|
|
1766
|
-
function
|
|
1766
|
+
function oi(i, t) {
|
|
1767
1767
|
for (var e, s; ; ) {
|
|
1768
|
-
if (i.lookahead <
|
|
1769
|
-
if (
|
|
1768
|
+
if (i.lookahead < _e) {
|
|
1769
|
+
if (_t(i), i.lookahead < _e && t === ct)
|
|
1770
1770
|
return ee;
|
|
1771
1771
|
if (i.lookahead === 0)
|
|
1772
1772
|
break;
|
|
1773
1773
|
}
|
|
1774
|
-
if (e = 0, i.lookahead >=
|
|
1775
|
-
if (s =
|
|
1774
|
+
if (e = 0, i.lookahead >= O && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + O - 1]) & i.hash_mask, e = i.prev[i.strstart & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = i.strstart), e !== 0 && i.strstart - e <= i.w_size - _e && (i.match_length = Kn(i, e)), i.match_length >= O)
|
|
1775
|
+
if (s = Ce(i, i.strstart - i.match_start, i.match_length - O), i.lookahead -= i.match_length, i.match_length <= i.max_lazy_match && i.lookahead >= O) {
|
|
1776
1776
|
i.match_length--;
|
|
1777
1777
|
do
|
|
1778
|
-
i.strstart++, i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart +
|
|
1778
|
+
i.strstart++, i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + O - 1]) & i.hash_mask, e = i.prev[i.strstart & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = i.strstart;
|
|
1779
1779
|
while (--i.match_length !== 0);
|
|
1780
1780
|
i.strstart++;
|
|
1781
1781
|
} else
|
|
1782
1782
|
i.strstart += i.match_length, i.match_length = 0, i.ins_h = i.window[i.strstart], i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + 1]) & i.hash_mask;
|
|
1783
1783
|
else
|
|
1784
|
-
s =
|
|
1785
|
-
if (s && (
|
|
1784
|
+
s = Ce(i, 0, i.window[i.strstart]), i.lookahead--, i.strstart++;
|
|
1785
|
+
if (s && (he(i, !1), i.strm.avail_out === 0))
|
|
1786
1786
|
return ee;
|
|
1787
1787
|
}
|
|
1788
|
-
return i.insert = i.strstart <
|
|
1788
|
+
return i.insert = i.strstart < O - 1 ? i.strstart : O - 1, t === ot ? (he(i, !0), i.strm.avail_out === 0 ? ht : It) : i.last_lit && (he(i, !1), i.strm.avail_out === 0) ? ee : ut;
|
|
1789
1789
|
}
|
|
1790
1790
|
function De(i, t) {
|
|
1791
1791
|
for (var e, s, n; ; ) {
|
|
1792
|
-
if (i.lookahead <
|
|
1793
|
-
if (
|
|
1792
|
+
if (i.lookahead < _e) {
|
|
1793
|
+
if (_t(i), i.lookahead < _e && t === ct)
|
|
1794
1794
|
return ee;
|
|
1795
1795
|
if (i.lookahead === 0)
|
|
1796
1796
|
break;
|
|
1797
1797
|
}
|
|
1798
|
-
if (e = 0, i.lookahead >=
|
|
1799
|
-
n = i.strstart + i.lookahead -
|
|
1798
|
+
if (e = 0, i.lookahead >= O && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + O - 1]) & i.hash_mask, e = i.prev[i.strstart & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = i.strstart), i.prev_length = i.match_length, i.prev_match = i.match_start, i.match_length = O - 1, e !== 0 && i.prev_length < i.max_lazy_match && i.strstart - e <= i.w_size - _e && (i.match_length = Kn(i, e), i.match_length <= 5 && (i.strategy === Dr || i.match_length === O && i.strstart - i.match_start > 4096) && (i.match_length = O - 1)), i.prev_length >= O && i.match_length <= i.prev_length) {
|
|
1799
|
+
n = i.strstart + i.lookahead - O, s = Ce(i, i.strstart - 1 - i.prev_match, i.prev_length - O), i.lookahead -= i.prev_length - 1, i.prev_length -= 2;
|
|
1800
1800
|
do
|
|
1801
|
-
++i.strstart <= n && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart +
|
|
1801
|
+
++i.strstart <= n && (i.ins_h = (i.ins_h << i.hash_shift ^ i.window[i.strstart + O - 1]) & i.hash_mask, e = i.prev[i.strstart & i.w_mask] = i.head[i.ins_h], i.head[i.ins_h] = i.strstart);
|
|
1802
1802
|
while (--i.prev_length !== 0);
|
|
1803
|
-
if (i.match_available = 0, i.match_length =
|
|
1803
|
+
if (i.match_available = 0, i.match_length = O - 1, i.strstart++, s && (he(i, !1), i.strm.avail_out === 0))
|
|
1804
1804
|
return ee;
|
|
1805
1805
|
} else if (i.match_available) {
|
|
1806
|
-
if (s =
|
|
1806
|
+
if (s = Ce(i, 0, i.window[i.strstart - 1]), s && he(i, !1), i.strstart++, i.lookahead--, i.strm.avail_out === 0)
|
|
1807
1807
|
return ee;
|
|
1808
1808
|
} else
|
|
1809
1809
|
i.match_available = 1, i.strstart++, i.lookahead--;
|
|
1810
1810
|
}
|
|
1811
|
-
return i.match_available && (s =
|
|
1811
|
+
return i.match_available && (s = Ce(i, 0, i.window[i.strstart - 1]), i.match_available = 0), i.insert = i.strstart < O - 1 ? i.strstart : O - 1, t === ot ? (he(i, !0), i.strm.avail_out === 0 ? ht : It) : i.last_lit && (he(i, !1), i.strm.avail_out === 0) ? ee : ut;
|
|
1812
1812
|
}
|
|
1813
|
-
function
|
|
1814
|
-
for (var e, s, n, r, a = i.window; !(i.lookahead <=
|
|
1815
|
-
if (i.match_length = 0, i.lookahead >=
|
|
1816
|
-
r = i.strstart +
|
|
1813
|
+
function ea(i, t) {
|
|
1814
|
+
for (var e, s, n, r, a = i.window; !(i.lookahead <= Se && (_t(i), i.lookahead <= Se, i.lookahead === 0)); ) {
|
|
1815
|
+
if (i.match_length = 0, i.lookahead >= O && i.strstart > 0 && (n = i.strstart - 1, s = a[n], s === a[++n] && s === a[++n] && s === a[++n])) {
|
|
1816
|
+
r = i.strstart + Se;
|
|
1817
1817
|
do
|
|
1818
1818
|
;
|
|
1819
1819
|
while (s === a[++n] && s === a[++n] && s === a[++n] && s === a[++n] && s === a[++n] && s === a[++n] && s === a[++n] && s === a[++n] && n < r);
|
|
1820
|
-
i.match_length =
|
|
1820
|
+
i.match_length = Se - (r - n), i.match_length > i.lookahead && (i.match_length = i.lookahead);
|
|
1821
1821
|
}
|
|
1822
|
-
if (i.match_length >=
|
|
1822
|
+
if (i.match_length >= O ? (e = Ce(i, 1, i.match_length - O), i.lookahead -= i.match_length, i.strstart += i.match_length, i.match_length = 0) : (e = Ce(i, 0, i.window[i.strstart]), i.lookahead--, i.strstart++), e && (he(i, !1), i.strm.avail_out === 0))
|
|
1823
1823
|
return ee;
|
|
1824
1824
|
}
|
|
1825
|
-
return i.insert = 0, i.last_lit && (
|
|
1825
|
+
return i.insert = 0, i.last_lit && (he(i, !1), i.strm.avail_out === 0) ? ee : ut;
|
|
1826
1826
|
}
|
|
1827
|
-
function
|
|
1828
|
-
for (var e; !(i.lookahead === 0 && (
|
|
1829
|
-
if (i.match_length = 0, e =
|
|
1827
|
+
function ta(i, t) {
|
|
1828
|
+
for (var e; !(i.lookahead === 0 && (_t(i), i.lookahead === 0)); )
|
|
1829
|
+
if (i.match_length = 0, e = Ce(i, 0, i.window[i.strstart]), i.lookahead--, i.strstart++, e && (he(i, !1), i.strm.avail_out === 0))
|
|
1830
1830
|
return ee;
|
|
1831
|
-
return i.insert = 0, i.last_lit && (
|
|
1831
|
+
return i.insert = 0, i.last_lit && (he(i, !1), i.strm.avail_out === 0) ? ee : ut;
|
|
1832
1832
|
}
|
|
1833
|
-
function
|
|
1833
|
+
function de(i, t, e, s, n) {
|
|
1834
1834
|
this.good_length = i, this.max_lazy = t, this.nice_length = e, this.max_chain = s, this.func = n;
|
|
1835
1835
|
}
|
|
1836
1836
|
var Ne;
|
|
1837
1837
|
Ne = [
|
|
1838
1838
|
/* good lazy nice chain */
|
|
1839
|
-
new
|
|
1839
|
+
new de(0, 0, 0, 0, $r),
|
|
1840
1840
|
/* 0 store only */
|
|
1841
|
-
new
|
|
1841
|
+
new de(4, 4, 8, 4, oi),
|
|
1842
1842
|
/* 1 max speed, no lazy matches */
|
|
1843
|
-
new
|
|
1843
|
+
new de(4, 5, 16, 8, oi),
|
|
1844
1844
|
/* 2 */
|
|
1845
|
-
new
|
|
1845
|
+
new de(4, 6, 32, 32, oi),
|
|
1846
1846
|
/* 3 */
|
|
1847
|
-
new
|
|
1847
|
+
new de(4, 4, 16, 16, De),
|
|
1848
1848
|
/* 4 lazy matches */
|
|
1849
|
-
new
|
|
1849
|
+
new de(8, 16, 32, 32, De),
|
|
1850
1850
|
/* 5 */
|
|
1851
|
-
new
|
|
1851
|
+
new de(8, 16, 128, 128, De),
|
|
1852
1852
|
/* 6 */
|
|
1853
|
-
new
|
|
1853
|
+
new de(8, 32, 128, 256, De),
|
|
1854
1854
|
/* 7 */
|
|
1855
|
-
new
|
|
1855
|
+
new de(32, 128, 258, 1024, De),
|
|
1856
1856
|
/* 8 */
|
|
1857
|
-
new
|
|
1857
|
+
new de(32, 258, 258, 4096, De)
|
|
1858
1858
|
/* 9 max compression */
|
|
1859
1859
|
];
|
|
1860
|
-
function
|
|
1861
|
-
i.window_size = 2 * i.w_size,
|
|
1860
|
+
function ia(i) {
|
|
1861
|
+
i.window_size = 2 * i.w_size, Fe(i.head), i.max_lazy_match = Ne[i.level].max_lazy, i.good_match = Ne[i.level].good_length, i.nice_match = Ne[i.level].nice_length, i.max_chain_length = Ne[i.level].max_chain, i.strstart = 0, i.block_start = 0, i.lookahead = 0, i.insert = 0, i.match_length = i.prev_length = O - 1, i.match_available = 0, i.ins_h = 0;
|
|
1862
1862
|
}
|
|
1863
|
-
function
|
|
1864
|
-
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 =
|
|
1863
|
+
function sa() {
|
|
1864
|
+
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 = vi, 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 ce(Zr * 2), this.dyn_dtree = new ce((2 * Gr + 1) * 2), this.bl_tree = new ce((2 * Wr + 1) * 2), Fe(this.dyn_ltree), Fe(this.dyn_dtree), Fe(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new ce(Yr + 1), this.heap = new ce(2 * pi + 1), Fe(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new ce(2 * pi + 1), Fe(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;
|
|
1865
1865
|
}
|
|
1866
|
-
function
|
|
1866
|
+
function na(i) {
|
|
1867
1867
|
var t;
|
|
1868
|
-
return !i || !i.state ? Ue(i, ze) : (i.total_in = i.total_out = 0, i.data_type =
|
|
1868
|
+
return !i || !i.state ? Ue(i, ze) : (i.total_in = i.total_out = 0, i.data_type = Nr, t = i.state, t.pending = 0, t.pending_out = 0, t.wrap < 0 && (t.wrap = -t.wrap), t.status = t.wrap ? Cn : $e, i.adler = t.wrap === 2 ? 0 : 1, t.last_flush = ct, Qr(t), Pe);
|
|
1869
1869
|
}
|
|
1870
|
-
function
|
|
1871
|
-
var t =
|
|
1872
|
-
return t === Pe &&
|
|
1870
|
+
function ra(i) {
|
|
1871
|
+
var t = na(i);
|
|
1872
|
+
return t === Pe && ia(i.state), t;
|
|
1873
1873
|
}
|
|
1874
|
-
function
|
|
1874
|
+
function aa(i, t, e, s, n, r) {
|
|
1875
1875
|
if (!i)
|
|
1876
1876
|
return ze;
|
|
1877
1877
|
var a = 1;
|
|
1878
|
-
if (t ===
|
|
1878
|
+
if (t === En && (t = 6), t < 0 || t > 9 || r < 0 || r > Pr)
|
|
1879
1879
|
return Ue(i, ze);
|
|
1880
|
-
var h = new
|
|
1881
|
-
return i.state = h, h.strm = i, h.wrap = a, h.gzhead = null, h.w_bits = s, h.w_size = 1 << h.w_bits, h.w_mask = h.w_size - 1, h.hash_bits = n + 7, h.hash_size = 1 << h.hash_bits, h.hash_mask = h.hash_size - 1, h.hash_shift = ~~((h.hash_bits +
|
|
1880
|
+
var h = new sa();
|
|
1881
|
+
return i.state = h, h.strm = i, h.wrap = a, h.gzhead = null, h.w_bits = s, h.w_size = 1 << h.w_bits, h.w_mask = h.w_size - 1, h.hash_bits = n + 7, h.hash_size = 1 << h.hash_bits, h.hash_mask = h.hash_size - 1, h.hash_shift = ~~((h.hash_bits + O - 1) / O), h.window = new Xt(h.w_size * 2), h.head = new ce(h.hash_size), h.prev = new ce(h.w_size), h.lit_bufsize = 1 << n + 6, h.pending_buf_size = h.lit_bufsize * 4, h.pending_buf = new Xt(h.pending_buf_size), h.d_buf = 1 * h.lit_bufsize, h.l_buf = 3 * h.lit_bufsize, h.level = t, h.strategy = r, h.method = e, ra(i);
|
|
1882
1882
|
}
|
|
1883
|
-
function
|
|
1884
|
-
return
|
|
1883
|
+
function oa(i, t) {
|
|
1884
|
+
return aa(i, t, vi, Hr, zr, Ur);
|
|
1885
1885
|
}
|
|
1886
|
-
function
|
|
1886
|
+
function gs(i, t) {
|
|
1887
1887
|
var e, s, n, r;
|
|
1888
|
-
if (!i || !i.state || t >
|
|
1888
|
+
if (!i || !i.state || t > Br || t < 0)
|
|
1889
1889
|
return i ? Ue(i, ze) : ze;
|
|
1890
|
-
if (s = i.state, !i.output || !i.input && i.avail_in !== 0 || s.status ===
|
|
1891
|
-
return Ue(i, i.avail_out === 0 ?
|
|
1890
|
+
if (s = i.state, !i.output || !i.input && i.avail_in !== 0 || s.status === wt && t !== ot)
|
|
1891
|
+
return Ue(i, i.avail_out === 0 ? ii : ze);
|
|
1892
1892
|
if (s.strm = i, e = s.last_flush, s.last_flush = t, s.status === Cn)
|
|
1893
1893
|
if (s.wrap === 2)
|
|
1894
|
-
i.adler = 0,
|
|
1894
|
+
i.adler = 0, W(s, 31), W(s, 139), W(s, 8), s.gzhead ? (W(
|
|
1895
1895
|
s,
|
|
1896
1896
|
(s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (s.gzhead.extra ? 4 : 0) + (s.gzhead.name ? 8 : 0) + (s.gzhead.comment ? 16 : 0)
|
|
1897
|
-
),
|
|
1897
|
+
), W(s, s.gzhead.time & 255), W(s, s.gzhead.time >> 8 & 255), W(s, s.gzhead.time >> 16 & 255), W(s, s.gzhead.time >> 24 & 255), W(s, s.level === 9 ? 2 : s.strategy >= bt || s.level < 2 ? 4 : 0), W(s, s.gzhead.os & 255), s.gzhead.extra && s.gzhead.extra.length && (W(s, s.gzhead.extra.length & 255), W(s, s.gzhead.extra.length >> 8 & 255)), s.gzhead.hcrc && (i.adler = $(i.adler, s.pending_buf, s.pending)), s.gzindex = 0, s.status = xs) : (W(s, 0), W(s, 0), W(s, 0), W(s, 0), W(s, 0), W(s, s.level === 9 ? 2 : s.strategy >= bt || s.level < 2 ? 4 : 0), W(s, qr), s.status = $e);
|
|
1898
1898
|
else {
|
|
1899
|
-
var a =
|
|
1900
|
-
s.strategy >=
|
|
1899
|
+
var a = vi + (s.w_bits - 8 << 4) << 8, h = -1;
|
|
1900
|
+
s.strategy >= bt || s.level < 2 ? h = 0 : s.level < 6 ? h = 1 : s.level === 6 ? h = 2 : h = 3, a |= h << 6, s.strstart !== 0 && (a |= jr), a += 31 - a % 31, s.status = $e, ai(s, a), s.strstart !== 0 && (ai(s, i.adler >>> 16), ai(s, i.adler & 65535)), i.adler = 1;
|
|
1901
1901
|
}
|
|
1902
|
-
if (s.status ===
|
|
1902
|
+
if (s.status === xs)
|
|
1903
1903
|
if (s.gzhead.extra) {
|
|
1904
|
-
for (n = s.pending; s.gzindex < (s.gzhead.extra.length & 65535) && !(s.pending === s.pending_buf_size && (s.gzhead.hcrc && s.pending > n && (i.adler =
|
|
1905
|
-
|
|
1906
|
-
s.gzhead.hcrc && s.pending > n && (i.adler =
|
|
1904
|
+
for (n = s.pending; s.gzindex < (s.gzhead.extra.length & 65535) && !(s.pending === s.pending_buf_size && (s.gzhead.hcrc && s.pending > n && (i.adler = $(i.adler, s.pending_buf, s.pending - n)), Ae(i), n = s.pending, s.pending === s.pending_buf_size)); )
|
|
1905
|
+
W(s, s.gzhead.extra[s.gzindex] & 255), s.gzindex++;
|
|
1906
|
+
s.gzhead.hcrc && s.pending > n && (i.adler = $(i.adler, s.pending_buf, s.pending - n)), s.gzindex === s.gzhead.extra.length && (s.gzindex = 0, s.status = si);
|
|
1907
1907
|
} else
|
|
1908
|
-
s.status =
|
|
1909
|
-
if (s.status ===
|
|
1908
|
+
s.status = si;
|
|
1909
|
+
if (s.status === si)
|
|
1910
1910
|
if (s.gzhead.name) {
|
|
1911
1911
|
n = s.pending;
|
|
1912
1912
|
do {
|
|
1913
|
-
if (s.pending === s.pending_buf_size && (s.gzhead.hcrc && s.pending > n && (i.adler =
|
|
1913
|
+
if (s.pending === s.pending_buf_size && (s.gzhead.hcrc && s.pending > n && (i.adler = $(i.adler, s.pending_buf, s.pending - n)), Ae(i), n = s.pending, s.pending === s.pending_buf_size)) {
|
|
1914
1914
|
r = 1;
|
|
1915
1915
|
break;
|
|
1916
1916
|
}
|
|
1917
|
-
s.gzindex < s.gzhead.name.length ? r = s.gzhead.name.charCodeAt(s.gzindex++) & 255 : r = 0,
|
|
1917
|
+
s.gzindex < s.gzhead.name.length ? r = s.gzhead.name.charCodeAt(s.gzindex++) & 255 : r = 0, W(s, r);
|
|
1918
1918
|
} while (r !== 0);
|
|
1919
|
-
s.gzhead.hcrc && s.pending > n && (i.adler =
|
|
1919
|
+
s.gzhead.hcrc && s.pending > n && (i.adler = $(i.adler, s.pending_buf, s.pending - n)), r === 0 && (s.gzindex = 0, s.status = ni);
|
|
1920
1920
|
} else
|
|
1921
|
-
s.status =
|
|
1922
|
-
if (s.status ===
|
|
1921
|
+
s.status = ni;
|
|
1922
|
+
if (s.status === ni)
|
|
1923
1923
|
if (s.gzhead.comment) {
|
|
1924
1924
|
n = s.pending;
|
|
1925
1925
|
do {
|
|
1926
|
-
if (s.pending === s.pending_buf_size && (s.gzhead.hcrc && s.pending > n && (i.adler =
|
|
1926
|
+
if (s.pending === s.pending_buf_size && (s.gzhead.hcrc && s.pending > n && (i.adler = $(i.adler, s.pending_buf, s.pending - n)), Ae(i), n = s.pending, s.pending === s.pending_buf_size)) {
|
|
1927
1927
|
r = 1;
|
|
1928
1928
|
break;
|
|
1929
1929
|
}
|
|
1930
|
-
s.gzindex < s.gzhead.comment.length ? r = s.gzhead.comment.charCodeAt(s.gzindex++) & 255 : r = 0,
|
|
1930
|
+
s.gzindex < s.gzhead.comment.length ? r = s.gzhead.comment.charCodeAt(s.gzindex++) & 255 : r = 0, W(s, r);
|
|
1931
1931
|
} while (r !== 0);
|
|
1932
|
-
s.gzhead.hcrc && s.pending > n && (i.adler =
|
|
1932
|
+
s.gzhead.hcrc && s.pending > n && (i.adler = $(i.adler, s.pending_buf, s.pending - n)), r === 0 && (s.status = ri);
|
|
1933
1933
|
} else
|
|
1934
|
-
s.status =
|
|
1935
|
-
if (s.status ===
|
|
1936
|
-
if (
|
|
1934
|
+
s.status = ri;
|
|
1935
|
+
if (s.status === ri && (s.gzhead.hcrc ? (s.pending + 2 > s.pending_buf_size && Ae(i), s.pending + 2 <= s.pending_buf_size && (W(s, i.adler & 255), W(s, i.adler >> 8 & 255), i.adler = 0, s.status = $e)) : s.status = $e), s.pending !== 0) {
|
|
1936
|
+
if (Ae(i), i.avail_out === 0)
|
|
1937
1937
|
return s.last_flush = -1, Pe;
|
|
1938
|
-
} else if (i.avail_in === 0 &&
|
|
1939
|
-
return Ue(i,
|
|
1940
|
-
if (s.status ===
|
|
1941
|
-
return Ue(i,
|
|
1942
|
-
if (i.avail_in !== 0 || s.lookahead !== 0 || s.status !==
|
|
1943
|
-
var c = s.strategy ===
|
|
1944
|
-
if ((c ===
|
|
1938
|
+
} else if (i.avail_in === 0 && ps(t) <= ps(e) && t !== ot)
|
|
1939
|
+
return Ue(i, ii);
|
|
1940
|
+
if (s.status === wt && i.avail_in !== 0)
|
|
1941
|
+
return Ue(i, ii);
|
|
1942
|
+
if (i.avail_in !== 0 || s.lookahead !== 0 || s.status !== wt) {
|
|
1943
|
+
var c = s.strategy === bt ? ta(s) : s.strategy === Ir ? ea(s, t) : Ne[s.level].func(s, t);
|
|
1944
|
+
if ((c === ht || c === It) && (s.status = wt), c === ee || c === ht)
|
|
1945
1945
|
return i.avail_out === 0 && (s.last_flush = -1), Pe;
|
|
1946
|
-
if (c ===
|
|
1946
|
+
if (c === ut && (Sn(s, 0, 0, !1), Fe(s.head), s.lookahead === 0 && (s.strstart = 0, s.block_start = 0, s.insert = 0), Ae(i), i.avail_out === 0))
|
|
1947
1947
|
return s.last_flush = -1, Pe;
|
|
1948
1948
|
}
|
|
1949
1949
|
return Pe;
|
|
1950
1950
|
}
|
|
1951
|
-
class
|
|
1951
|
+
class ha {
|
|
1952
1952
|
constructor() {
|
|
1953
|
-
this.strm = new
|
|
1953
|
+
this.strm = new ln(), this.chunkSize = 1024 * 10 * 10, this.outputBuffer = new Uint8Array(this.chunkSize), oa(this.strm, En);
|
|
1954
1954
|
}
|
|
1955
1955
|
deflate(t) {
|
|
1956
1956
|
this.strm.input = t, this.strm.avail_in = this.strm.input.length, this.strm.next_in = 0, this.strm.output = this.outputBuffer, this.strm.avail_out = this.chunkSize, this.strm.next_out = 0;
|
|
1957
|
-
let e =
|
|
1957
|
+
let e = gs(this.strm, fs), s = new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
|
|
1958
1958
|
if (e < 0)
|
|
1959
1959
|
throw new Error("zlib deflate failed");
|
|
1960
1960
|
if (this.strm.avail_in > 0) {
|
|
1961
1961
|
let n = [s], r = s.length;
|
|
1962
1962
|
do {
|
|
1963
|
-
if (this.strm.output = new Uint8Array(this.chunkSize), this.strm.next_out = 0, this.strm.avail_out = this.chunkSize, e =
|
|
1963
|
+
if (this.strm.output = new Uint8Array(this.chunkSize), this.strm.next_out = 0, this.strm.avail_out = this.chunkSize, e = gs(this.strm, fs), e < 0)
|
|
1964
1964
|
throw new Error("zlib deflate failed");
|
|
1965
1965
|
let c = new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
|
|
1966
1966
|
r += c.length, n.push(c);
|
|
@@ -2275,7 +2275,7 @@ const _ = {
|
|
|
2275
2275
|
XF86XK_Hibernate: 269025192,
|
|
2276
2276
|
XF86XK_AudioMicMute: 269025202,
|
|
2277
2277
|
XF86XK_Next_VMode: 269024802
|
|
2278
|
-
},
|
|
2278
|
+
}, la = {
|
|
2279
2279
|
256: 960,
|
|
2280
2280
|
// XK_Amacron
|
|
2281
2281
|
257: 992,
|
|
@@ -3594,14 +3594,14 @@ const _ = {
|
|
|
3594
3594
|
// XK_kana_conjunctive
|
|
3595
3595
|
12540: 1200
|
|
3596
3596
|
// XK_prolongedsound
|
|
3597
|
-
},
|
|
3597
|
+
}, ca = {
|
|
3598
3598
|
lookup(i) {
|
|
3599
3599
|
if (i >= 32 && i <= 255)
|
|
3600
3600
|
return i;
|
|
3601
|
-
const t =
|
|
3601
|
+
const t = la[i];
|
|
3602
3602
|
return t !== void 0 ? t : 16777216 | i;
|
|
3603
3603
|
}
|
|
3604
|
-
},
|
|
3604
|
+
}, bs = {
|
|
3605
3605
|
8: "Backspace",
|
|
3606
3606
|
9: "Tab",
|
|
3607
3607
|
10: "NumpadClear",
|
|
@@ -3707,7 +3707,7 @@ const _ = {
|
|
|
3707
3707
|
183: "LaunchApp2",
|
|
3708
3708
|
225: "AltRight"
|
|
3709
3709
|
// Only when it is AltGraph
|
|
3710
|
-
},
|
|
3710
|
+
}, ws = {
|
|
3711
3711
|
// 3.1.1.1. Writing System Keys
|
|
3712
3712
|
Backspace: "Backspace",
|
|
3713
3713
|
// 3.1.1.2. Functional Keys
|
|
@@ -3804,49 +3804,49 @@ const _ = {
|
|
|
3804
3804
|
AudioVolumeMute: "AudioVolumeMute",
|
|
3805
3805
|
AudioVolumeUp: "AudioVolumeUp",
|
|
3806
3806
|
WakeUp: "WakeUp"
|
|
3807
|
-
},
|
|
3807
|
+
}, Ke = {};
|
|
3808
3808
|
function m(i, t) {
|
|
3809
3809
|
if (t === void 0) throw new Error('Undefined keysym for key "' + i + '"');
|
|
3810
|
-
if (i in
|
|
3811
|
-
|
|
3810
|
+
if (i in Ke) throw new Error('Duplicate entry for key "' + i + '"');
|
|
3811
|
+
Ke[i] = [t, t, t, t];
|
|
3812
3812
|
}
|
|
3813
|
-
function
|
|
3813
|
+
function Pt(i, t, e) {
|
|
3814
3814
|
if (t === void 0) throw new Error('Undefined keysym for key "' + i + '"');
|
|
3815
3815
|
if (e === void 0) throw new Error('Undefined keysym for key "' + i + '"');
|
|
3816
|
-
if (i in
|
|
3817
|
-
|
|
3816
|
+
if (i in Ke) throw new Error('Duplicate entry for key "' + i + '"');
|
|
3817
|
+
Ke[i] = [t, t, e, t];
|
|
3818
3818
|
}
|
|
3819
|
-
function
|
|
3819
|
+
function V(i, t, e) {
|
|
3820
3820
|
if (t === void 0) throw new Error('Undefined keysym for key "' + i + '"');
|
|
3821
3821
|
if (e === void 0) throw new Error('Undefined keysym for key "' + i + '"');
|
|
3822
|
-
if (i in
|
|
3823
|
-
|
|
3822
|
+
if (i in Ke) throw new Error('Duplicate entry for key "' + i + '"');
|
|
3823
|
+
Ke[i] = [t, t, t, e];
|
|
3824
3824
|
}
|
|
3825
|
-
|
|
3825
|
+
Pt("Alt", _.XK_Alt_L, _.XK_Alt_R);
|
|
3826
3826
|
m("AltGraph", _.XK_ISO_Level3_Shift);
|
|
3827
3827
|
m("CapsLock", _.XK_Caps_Lock);
|
|
3828
|
-
|
|
3829
|
-
|
|
3828
|
+
Pt("Control", _.XK_Control_L, _.XK_Control_R);
|
|
3829
|
+
Pt("Meta", _.XK_Super_L, _.XK_Super_R);
|
|
3830
3830
|
m("NumLock", _.XK_Num_Lock);
|
|
3831
3831
|
m("ScrollLock", _.XK_Scroll_Lock);
|
|
3832
|
-
|
|
3833
|
-
|
|
3832
|
+
Pt("Shift", _.XK_Shift_L, _.XK_Shift_R);
|
|
3833
|
+
V("Enter", _.XK_Return, _.XK_KP_Enter);
|
|
3834
3834
|
m("Tab", _.XK_Tab);
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3835
|
+
V(" ", _.XK_space, _.XK_KP_Space);
|
|
3836
|
+
V("ArrowDown", _.XK_Down, _.XK_KP_Down);
|
|
3837
|
+
V("ArrowLeft", _.XK_Left, _.XK_KP_Left);
|
|
3838
|
+
V("ArrowRight", _.XK_Right, _.XK_KP_Right);
|
|
3839
|
+
V("ArrowUp", _.XK_Up, _.XK_KP_Up);
|
|
3840
|
+
V("End", _.XK_End, _.XK_KP_End);
|
|
3841
|
+
V("Home", _.XK_Home, _.XK_KP_Home);
|
|
3842
|
+
V("PageDown", _.XK_Next, _.XK_KP_Next);
|
|
3843
|
+
V("PageUp", _.XK_Prior, _.XK_KP_Prior);
|
|
3844
3844
|
m("Backspace", _.XK_BackSpace);
|
|
3845
|
-
|
|
3845
|
+
V("Clear", _.XK_Clear, _.XK_KP_Begin);
|
|
3846
3846
|
m("Copy", _.XF86XK_Copy);
|
|
3847
3847
|
m("Cut", _.XF86XK_Cut);
|
|
3848
|
-
|
|
3849
|
-
|
|
3848
|
+
V("Delete", _.XK_Delete, _.XK_KP_Delete);
|
|
3849
|
+
V("Insert", _.XK_Insert, _.XK_KP_Insert);
|
|
3850
3850
|
m("Paste", _.XF86XK_Paste);
|
|
3851
3851
|
m("Redo", _.XK_Redo);
|
|
3852
3852
|
m("Undo", _.XK_Undo);
|
|
@@ -3976,24 +3976,24 @@ m("RandomToggle", _.XF86XK_AudioRandomPlay);
|
|
|
3976
3976
|
m("SplitScreenToggle", _.XF86XK_SplitScreen);
|
|
3977
3977
|
m("Subtitle", _.XF86XK_Subtitle);
|
|
3978
3978
|
m("VideoModeNext", _.XF86XK_Next_VMode);
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
function
|
|
3979
|
+
V("=", _.XK_equal, _.XK_KP_Equal);
|
|
3980
|
+
V("+", _.XK_plus, _.XK_KP_Add);
|
|
3981
|
+
V("-", _.XK_minus, _.XK_KP_Subtract);
|
|
3982
|
+
V("*", _.XK_asterisk, _.XK_KP_Multiply);
|
|
3983
|
+
V("/", _.XK_slash, _.XK_KP_Divide);
|
|
3984
|
+
V(".", _.XK_period, _.XK_KP_Decimal);
|
|
3985
|
+
V(",", _.XK_comma, _.XK_KP_Separator);
|
|
3986
|
+
V("0", _.XK_0, _.XK_KP_0);
|
|
3987
|
+
V("1", _.XK_1, _.XK_KP_1);
|
|
3988
|
+
V("2", _.XK_2, _.XK_KP_2);
|
|
3989
|
+
V("3", _.XK_3, _.XK_KP_3);
|
|
3990
|
+
V("4", _.XK_4, _.XK_KP_4);
|
|
3991
|
+
V("5", _.XK_5, _.XK_KP_5);
|
|
3992
|
+
V("6", _.XK_6, _.XK_KP_6);
|
|
3993
|
+
V("7", _.XK_7, _.XK_KP_7);
|
|
3994
|
+
V("8", _.XK_8, _.XK_KP_8);
|
|
3995
|
+
V("9", _.XK_9, _.XK_KP_9);
|
|
3996
|
+
function st(i) {
|
|
3997
3997
|
if (i.code) {
|
|
3998
3998
|
switch (i.code) {
|
|
3999
3999
|
case "OSLeft":
|
|
@@ -4003,8 +4003,8 @@ function rt(i) {
|
|
|
4003
4003
|
}
|
|
4004
4004
|
return i.code;
|
|
4005
4005
|
}
|
|
4006
|
-
if (i.keyCode in
|
|
4007
|
-
let t =
|
|
4006
|
+
if (i.keyCode in bs) {
|
|
4007
|
+
let t = bs[i.keyCode];
|
|
4008
4008
|
if (Ie() && t === "ContextMenu" && (t = "MetaRight"), i.location === 2)
|
|
4009
4009
|
switch (t) {
|
|
4010
4010
|
case "ShiftLeft":
|
|
@@ -4043,7 +4043,7 @@ function rt(i) {
|
|
|
4043
4043
|
}
|
|
4044
4044
|
return "Unidentified";
|
|
4045
4045
|
}
|
|
4046
|
-
function
|
|
4046
|
+
function ua(i) {
|
|
4047
4047
|
if (i.key !== void 0 && i.key !== "Unidentified") {
|
|
4048
4048
|
switch (i.key) {
|
|
4049
4049
|
case "OS":
|
|
@@ -4067,23 +4067,23 @@ function la(i) {
|
|
|
4067
4067
|
}
|
|
4068
4068
|
return i.key === "\0" && i.code === "NumpadDecimal" ? "Delete" : i.key;
|
|
4069
4069
|
}
|
|
4070
|
-
const t =
|
|
4071
|
-
return t in
|
|
4070
|
+
const t = st(i);
|
|
4071
|
+
return t in ws ? ws[t] : i.charCode ? String.fromCharCode(i.charCode) : "Unidentified";
|
|
4072
4072
|
}
|
|
4073
|
-
function
|
|
4074
|
-
const t =
|
|
4073
|
+
function _a(i) {
|
|
4074
|
+
const t = ua(i);
|
|
4075
4075
|
if (t === "Unidentified")
|
|
4076
4076
|
return null;
|
|
4077
|
-
if (t in
|
|
4077
|
+
if (t in Ke) {
|
|
4078
4078
|
let s = i.location;
|
|
4079
|
-
if (t === "Meta" && s === 0 && (s = 2), t === "Clear" && s === 3 &&
|
|
4080
|
-
let n =
|
|
4079
|
+
if (t === "Meta" && s === 0 && (s = 2), t === "Clear" && s === 3 && st(i) === "NumLock" && (s = 0), (s === void 0 || s > 3) && (s = 0), t === "Meta") {
|
|
4080
|
+
let n = st(i);
|
|
4081
4081
|
if (n === "AltLeft")
|
|
4082
4082
|
return _.XK_Meta_L;
|
|
4083
4083
|
if (n === "AltRight")
|
|
4084
4084
|
return _.XK_Meta_R;
|
|
4085
4085
|
}
|
|
4086
|
-
if (t === "Clear" &&
|
|
4086
|
+
if (t === "Clear" && st(i) === "NumLock")
|
|
4087
4087
|
return _.XK_Num_Lock;
|
|
4088
4088
|
if (Et())
|
|
4089
4089
|
switch (t) {
|
|
@@ -4094,14 +4094,14 @@ function ca(i) {
|
|
|
4094
4094
|
case "KanaMode":
|
|
4095
4095
|
return _.XK_Romaji;
|
|
4096
4096
|
}
|
|
4097
|
-
return
|
|
4097
|
+
return Ke[t][s];
|
|
4098
4098
|
}
|
|
4099
4099
|
if (t.length !== 1)
|
|
4100
4100
|
return null;
|
|
4101
4101
|
const e = t.charCodeAt();
|
|
4102
|
-
return e ?
|
|
4102
|
+
return e ? ca.lookup(e) : null;
|
|
4103
4103
|
}
|
|
4104
|
-
class
|
|
4104
|
+
class da {
|
|
4105
4105
|
constructor(t) {
|
|
4106
4106
|
this._target = t || null, this._keyDownList = {}, this._altGrArmed = !1, this._eventHandlers = {
|
|
4107
4107
|
keyup: this._handleKeyUp.bind(this),
|
|
@@ -4122,7 +4122,7 @@ class ua {
|
|
|
4122
4122
|
L("onkeyevent " + (s ? "down" : "up") + ", keysym: " + t, ", code: " + e + ", numlock: " + n + ", capslock: " + r), this.onkeyevent(t, e, s, n, r);
|
|
4123
4123
|
}
|
|
4124
4124
|
_getKeyCode(t) {
|
|
4125
|
-
const e =
|
|
4125
|
+
const e = st(t);
|
|
4126
4126
|
if (e !== "Unidentified")
|
|
4127
4127
|
return e;
|
|
4128
4128
|
if (t.keyCode && t.keyCode !== 229)
|
|
@@ -4137,12 +4137,12 @@ class ua {
|
|
|
4137
4137
|
}
|
|
4138
4138
|
_handleKeyDown(t) {
|
|
4139
4139
|
const e = this._getKeyCode(t);
|
|
4140
|
-
let s =
|
|
4141
|
-
if ((Ie() ||
|
|
4140
|
+
let s = _a(t), n = t.getModifierState("NumLock"), r = t.getModifierState("CapsLock");
|
|
4141
|
+
if ((Ie() || We()) && (n = null), this._altGrArmed && (this._altGrArmed = !1, clearTimeout(this._altGrTimeout), e === "AltRight" && t.timeStamp - this._altGrCtrlTime < 50 ? s = _.XK_ISO_Level3_Shift : this._sendKeyEvent(_.XK_Control_L, "ControlLeft", !0, n, r)), e === "Unidentified") {
|
|
4142
4142
|
s && (this._sendKeyEvent(s, e, !0, n, r), this._sendKeyEvent(s, e, !1, n, r)), Re(t);
|
|
4143
4143
|
return;
|
|
4144
4144
|
}
|
|
4145
|
-
if (Ie() ||
|
|
4145
|
+
if (Ie() || We())
|
|
4146
4146
|
switch (s) {
|
|
4147
4147
|
case _.XK_Super_L:
|
|
4148
4148
|
s = _.XK_Alt_L;
|
|
@@ -4157,11 +4157,11 @@ class ua {
|
|
|
4157
4157
|
s = _.XK_ISO_Level3_Shift;
|
|
4158
4158
|
break;
|
|
4159
4159
|
}
|
|
4160
|
-
if (e in this._keyDownList && (s = this._keyDownList[e]), (Ie() ||
|
|
4160
|
+
if (e in this._keyDownList && (s = this._keyDownList[e]), (Ie() || We()) && t.metaKey && e !== "MetaLeft" && e !== "MetaRight") {
|
|
4161
4161
|
this._sendKeyEvent(s, e, !0, n, r), this._sendKeyEvent(s, e, !1, n, r), Re(t);
|
|
4162
4162
|
return;
|
|
4163
4163
|
}
|
|
4164
|
-
if ((Ie() ||
|
|
4164
|
+
if ((Ie() || We()) && e === "CapsLock") {
|
|
4165
4165
|
this._sendKeyEvent(_.XK_Caps_Lock, "CapsLock", !0, n, r), this._sendKeyEvent(_.XK_Caps_Lock, "CapsLock", !1, n, r), Re(t);
|
|
4166
4166
|
return;
|
|
4167
4167
|
}
|
|
@@ -4185,7 +4185,7 @@ class ua {
|
|
|
4185
4185
|
_handleKeyUp(t) {
|
|
4186
4186
|
Re(t);
|
|
4187
4187
|
const e = this._getKeyCode(t);
|
|
4188
|
-
if (this._interruptAltGrSequence(), (Ie() ||
|
|
4188
|
+
if (this._interruptAltGrSequence(), (Ie() || We()) && e === "CapsLock") {
|
|
4189
4189
|
this._sendKeyEvent(_.XK_Caps_Lock, "CapsLock", !0), this._sendKeyEvent(_.XK_Caps_Lock, "CapsLock", !1);
|
|
4190
4190
|
return;
|
|
4191
4191
|
}
|
|
@@ -4216,10 +4216,10 @@ class ua {
|
|
|
4216
4216
|
this._target.removeEventListener("keydown", this._eventHandlers.keydown), this._target.removeEventListener("keyup", this._eventHandlers.keyup), window.removeEventListener("blur", this._eventHandlers.blur), this._allKeysUp();
|
|
4217
4217
|
}
|
|
4218
4218
|
}
|
|
4219
|
-
const
|
|
4220
|
-
class
|
|
4219
|
+
const fe = 0, ms = 1, vs = 2, ys = 4, ks = 8, hi = 16, Ye = 32, je = 64, li = 127, Ss = 50, fa = 90, Es = 250, xa = 1e3, pa = 1e3, ga = 50;
|
|
4220
|
+
class ba {
|
|
4221
4221
|
constructor() {
|
|
4222
|
-
this._target = null, this._state =
|
|
4222
|
+
this._target = null, this._state = li, this._tracked = [], this._ignored = [], this._waitingRelease = !1, this._releaseStart = 0, this._longpressTimeoutId = null, this._twoTouchTimeoutId = null, this._boundEventHandler = this._eventHandler.bind(this);
|
|
4223
4223
|
}
|
|
4224
4224
|
attach(t) {
|
|
4225
4225
|
this.detach(), this._target = t, this._target.addEventListener(
|
|
@@ -4271,16 +4271,16 @@ class pa {
|
|
|
4271
4271
|
}
|
|
4272
4272
|
}
|
|
4273
4273
|
_touchStart(t, e, s) {
|
|
4274
|
-
if (this._hasDetectedGesture() || this._state ===
|
|
4274
|
+
if (this._hasDetectedGesture() || this._state === fe) {
|
|
4275
4275
|
this._ignored.push(t);
|
|
4276
4276
|
return;
|
|
4277
4277
|
}
|
|
4278
|
-
if (this._tracked.length > 0 && Date.now() - this._tracked[0].started >
|
|
4279
|
-
this._state =
|
|
4278
|
+
if (this._tracked.length > 0 && Date.now() - this._tracked[0].started > Es) {
|
|
4279
|
+
this._state = fe, this._ignored.push(t);
|
|
4280
4280
|
return;
|
|
4281
4281
|
}
|
|
4282
4282
|
if (this._waitingRelease) {
|
|
4283
|
-
this._state =
|
|
4283
|
+
this._state = fe, this._ignored.push(t);
|
|
4284
4284
|
return;
|
|
4285
4285
|
}
|
|
4286
4286
|
switch (this._tracked.push({
|
|
@@ -4303,7 +4303,7 @@ class pa {
|
|
|
4303
4303
|
this._state &= -99;
|
|
4304
4304
|
break;
|
|
4305
4305
|
default:
|
|
4306
|
-
this._state =
|
|
4306
|
+
this._state = fe;
|
|
4307
4307
|
}
|
|
4308
4308
|
}
|
|
4309
4309
|
_touchMove(t, e, s) {
|
|
@@ -4313,16 +4313,16 @@ class pa {
|
|
|
4313
4313
|
n.lastX = e, n.lastY = s;
|
|
4314
4314
|
let r = e - n.firstX, a = s - n.firstY;
|
|
4315
4315
|
if ((n.firstX !== n.lastX || n.firstY !== n.lastY) && (n.angle = Math.atan2(a, r) * 180 / Math.PI), !this._hasDetectedGesture()) {
|
|
4316
|
-
if (Math.hypot(r, a) <
|
|
4316
|
+
if (Math.hypot(r, a) < Ss)
|
|
4317
4317
|
return;
|
|
4318
|
-
if (this._state &= -24, this._stopLongpressTimeout(), this._tracked.length !== 1 && (this._state &= ~
|
|
4318
|
+
if (this._state &= -24, this._stopLongpressTimeout(), this._tracked.length !== 1 && (this._state &= ~ks), this._tracked.length !== 2 && (this._state &= -97), this._tracked.length === 2) {
|
|
4319
4319
|
let h = this._tracked.find((o) => o.id !== t);
|
|
4320
4320
|
if (Math.hypot(
|
|
4321
4321
|
h.firstX - h.lastX,
|
|
4322
4322
|
h.firstY - h.lastY
|
|
4323
|
-
) >
|
|
4323
|
+
) > Ss) {
|
|
4324
4324
|
let o = Math.abs(n.angle - h.angle);
|
|
4325
|
-
o = Math.abs((o + 180) % 360 - 180), o >
|
|
4325
|
+
o = Math.abs((o + 180) % 360 - 180), o > fa ? this._state &= ~Ye : this._state &= ~je, this._isTwoTouchTimeoutRunning() && this._stopTwoTouchTimeout();
|
|
4326
4326
|
} else this._isTwoTouchTimeoutRunning() || this._startTwoTouchTimeout();
|
|
4327
4327
|
}
|
|
4328
4328
|
if (!this._hasDetectedGesture())
|
|
@@ -4333,10 +4333,10 @@ class pa {
|
|
|
4333
4333
|
}
|
|
4334
4334
|
_touchEnd(t, e, s) {
|
|
4335
4335
|
if (this._ignored.indexOf(t) !== -1) {
|
|
4336
|
-
this._ignored.splice(this._ignored.indexOf(t), 1), this._ignored.length === 0 && this._tracked.length === 0 && (this._state =
|
|
4336
|
+
this._ignored.splice(this._ignored.indexOf(t), 1), this._ignored.length === 0 && this._tracked.length === 0 && (this._state = li, this._waitingRelease = !1);
|
|
4337
4337
|
return;
|
|
4338
4338
|
}
|
|
4339
|
-
if (!this._hasDetectedGesture() && this._isTwoTouchTimeoutRunning() && (this._stopTwoTouchTimeout(), this._state =
|
|
4339
|
+
if (!this._hasDetectedGesture() && this._isTwoTouchTimeoutRunning() && (this._stopTwoTouchTimeout(), this._state = fe), !this._hasDetectedGesture() && (this._state &= -105, this._state &= ~hi, this._stopLongpressTimeout(), !this._waitingRelease))
|
|
4340
4340
|
switch (this._releaseStart = Date.now(), this._waitingRelease = !0, this._tracked.length) {
|
|
4341
4341
|
case 1:
|
|
4342
4342
|
this._state &= -7;
|
|
@@ -4346,25 +4346,25 @@ class pa {
|
|
|
4346
4346
|
break;
|
|
4347
4347
|
}
|
|
4348
4348
|
if (this._waitingRelease) {
|
|
4349
|
-
Date.now() - this._releaseStart >
|
|
4349
|
+
Date.now() - this._releaseStart > Es && (this._state = fe), this._tracked.some((r) => Date.now() - r.started > xa) && (this._state = fe);
|
|
4350
4350
|
let n = this._tracked.find((r) => r.id === t);
|
|
4351
4351
|
if (n.active = !1, this._hasDetectedGesture())
|
|
4352
4352
|
this._pushEvent("gesturestart");
|
|
4353
|
-
else if (this._state !==
|
|
4353
|
+
else if (this._state !== fe)
|
|
4354
4354
|
return;
|
|
4355
4355
|
}
|
|
4356
4356
|
this._hasDetectedGesture() && this._pushEvent("gestureend");
|
|
4357
4357
|
for (let n = 0; n < this._tracked.length; n++)
|
|
4358
4358
|
this._tracked[n].active && this._ignored.push(this._tracked[n].id);
|
|
4359
|
-
this._tracked = [], this._state =
|
|
4359
|
+
this._tracked = [], this._state = fe, this._ignored.indexOf(t) !== -1 && this._ignored.splice(this._ignored.indexOf(t), 1), this._ignored.length === 0 && (this._state = li, this._waitingRelease = !1);
|
|
4360
4360
|
}
|
|
4361
4361
|
_hasDetectedGesture() {
|
|
4362
|
-
return !(this._state ===
|
|
4362
|
+
return !(this._state === fe || this._state & this._state - 1 || this._state & (ms | vs | ys) && this._tracked.some((t) => t.active));
|
|
4363
4363
|
}
|
|
4364
4364
|
_startLongpressTimeout() {
|
|
4365
4365
|
this._stopLongpressTimeout(), this._longpressTimeoutId = setTimeout(
|
|
4366
4366
|
() => this._longpressTimeout(),
|
|
4367
|
-
|
|
4367
|
+
pa
|
|
4368
4368
|
);
|
|
4369
4369
|
}
|
|
4370
4370
|
_stopLongpressTimeout() {
|
|
@@ -4373,12 +4373,12 @@ class pa {
|
|
|
4373
4373
|
_longpressTimeout() {
|
|
4374
4374
|
if (this._hasDetectedGesture())
|
|
4375
4375
|
throw new Error("A longpress gesture failed, conflict with a different gesture");
|
|
4376
|
-
this._state =
|
|
4376
|
+
this._state = hi, this._pushEvent("gesturestart");
|
|
4377
4377
|
}
|
|
4378
4378
|
_startTwoTouchTimeout() {
|
|
4379
4379
|
this._stopTwoTouchTimeout(), this._twoTouchTimeoutId = setTimeout(
|
|
4380
4380
|
() => this._twoTouchTimeout(),
|
|
4381
|
-
|
|
4381
|
+
ga
|
|
4382
4382
|
);
|
|
4383
4383
|
}
|
|
4384
4384
|
_stopTwoTouchTimeout() {
|
|
@@ -4391,20 +4391,20 @@ class pa {
|
|
|
4391
4391
|
if (this._tracked.length === 0)
|
|
4392
4392
|
throw new Error("A pinch or two drag gesture failed, no tracked touches");
|
|
4393
4393
|
let t = this._getAverageMovement(), e = Math.abs(t.x), s = Math.abs(t.y), n = this._getAverageDistance(), r = Math.abs(Math.hypot(n.first.x, n.first.y) - Math.hypot(n.last.x, n.last.y));
|
|
4394
|
-
s < r && e < r ? this._state =
|
|
4394
|
+
s < r && e < r ? this._state = je : this._state = Ye, this._pushEvent("gesturestart"), this._pushEvent("gesturemove");
|
|
4395
4395
|
}
|
|
4396
4396
|
_pushEvent(t) {
|
|
4397
4397
|
let e = { type: this._stateToGesture(this._state) }, s = this._getPosition(), n = s.last;
|
|
4398
4398
|
switch (t === "gesturestart" && (n = s.first), this._state) {
|
|
4399
|
-
case
|
|
4400
|
-
case
|
|
4399
|
+
case Ye:
|
|
4400
|
+
case je:
|
|
4401
4401
|
n = s.first;
|
|
4402
4402
|
break;
|
|
4403
4403
|
}
|
|
4404
|
-
if (e.clientX = n.x, e.clientY = n.y, this._state ===
|
|
4404
|
+
if (e.clientX = n.x, e.clientY = n.y, this._state === je) {
|
|
4405
4405
|
let a = this._getAverageDistance();
|
|
4406
4406
|
t === "gesturestart" ? (e.magnitudeX = a.first.x, e.magnitudeY = a.first.y) : (e.magnitudeX = a.last.x, e.magnitudeY = a.last.y);
|
|
4407
|
-
} else if (this._state ===
|
|
4407
|
+
} else if (this._state === Ye)
|
|
4408
4408
|
if (t === "gesturestart")
|
|
4409
4409
|
e.magnitudeX = 0, e.magnitudeY = 0;
|
|
4410
4410
|
else {
|
|
@@ -4416,19 +4416,19 @@ class pa {
|
|
|
4416
4416
|
}
|
|
4417
4417
|
_stateToGesture(t) {
|
|
4418
4418
|
switch (t) {
|
|
4419
|
-
case ws:
|
|
4420
|
-
return "onetap";
|
|
4421
4419
|
case ms:
|
|
4422
|
-
return "
|
|
4420
|
+
return "onetap";
|
|
4423
4421
|
case vs:
|
|
4424
|
-
return "
|
|
4422
|
+
return "twotap";
|
|
4425
4423
|
case ys:
|
|
4424
|
+
return "threetap";
|
|
4425
|
+
case ks:
|
|
4426
4426
|
return "drag";
|
|
4427
|
-
case
|
|
4427
|
+
case hi:
|
|
4428
4428
|
return "longpress";
|
|
4429
|
-
case
|
|
4429
|
+
case Ye:
|
|
4430
4430
|
return "twodrag";
|
|
4431
|
-
case
|
|
4431
|
+
case je:
|
|
4432
4432
|
return "pinch";
|
|
4433
4433
|
}
|
|
4434
4434
|
throw new Error("Unknown gesture state: " + t);
|
|
@@ -4473,10 +4473,10 @@ class pa {
|
|
|
4473
4473
|
};
|
|
4474
4474
|
}
|
|
4475
4475
|
}
|
|
4476
|
-
const
|
|
4477
|
-
class
|
|
4476
|
+
const qe = !Un || js;
|
|
4477
|
+
class wa {
|
|
4478
4478
|
constructor() {
|
|
4479
|
-
this._target = null, this._canvas = document.createElement("canvas"),
|
|
4479
|
+
this._target = null, this._canvas = document.createElement("canvas"), qe && (this._canvas.style.position = "fixed", this._canvas.style.zIndex = "65535", this._canvas.style.pointerEvents = "none", this._canvas.style.userSelect = "none", this._canvas.style.WebkitUserSelect = "none", this._canvas.style.visibility = "hidden"), this._position = { x: 0, y: 0 }, this._hotSpot = { x: 0, y: 0 }, this._eventHandlers = {
|
|
4480
4480
|
mouseover: this._handleMouseOver.bind(this),
|
|
4481
4481
|
mouseleave: this._handleMouseLeave.bind(this),
|
|
4482
4482
|
mousemove: this._handleMouseMove.bind(this),
|
|
@@ -4484,7 +4484,7 @@ class ga {
|
|
|
4484
4484
|
};
|
|
4485
4485
|
}
|
|
4486
4486
|
attach(t) {
|
|
4487
|
-
if (this._target && this.detach(), this._target = t,
|
|
4487
|
+
if (this._target && this.detach(), this._target = t, qe) {
|
|
4488
4488
|
document.body.appendChild(this._canvas);
|
|
4489
4489
|
const e = { capture: !0, passive: !0 };
|
|
4490
4490
|
this._target.addEventListener("mouseover", this._eventHandlers.mouseover, e), this._target.addEventListener("mouseleave", this._eventHandlers.mouseleave, e), this._target.addEventListener("mousemove", this._eventHandlers.mousemove, e), this._target.addEventListener("mouseup", this._eventHandlers.mouseup, e);
|
|
@@ -4493,7 +4493,7 @@ class ga {
|
|
|
4493
4493
|
}
|
|
4494
4494
|
detach() {
|
|
4495
4495
|
if (this._target) {
|
|
4496
|
-
if (
|
|
4496
|
+
if (qe) {
|
|
4497
4497
|
const t = { capture: !0, passive: !0 };
|
|
4498
4498
|
this._target.removeEventListener("mouseover", this._eventHandlers.mouseover, t), this._target.removeEventListener("mouseleave", this._eventHandlers.mouseleave, t), this._target.removeEventListener("mousemove", this._eventHandlers.mousemove, t), this._target.removeEventListener("mouseup", this._eventHandlers.mouseup, t), document.contains(this._canvas) && document.body.removeChild(this._canvas);
|
|
4499
4499
|
}
|
|
@@ -4509,7 +4509,7 @@ class ga {
|
|
|
4509
4509
|
let a = this._canvas.getContext("2d");
|
|
4510
4510
|
this._canvas.width = n, this._canvas.height = r;
|
|
4511
4511
|
let h = new ImageData(new Uint8ClampedArray(t), n, r);
|
|
4512
|
-
if (a.clearRect(0, 0, n, r), a.putImageData(h, 0, 0),
|
|
4512
|
+
if (a.clearRect(0, 0, n, r), a.putImageData(h, 0, 0), qe)
|
|
4513
4513
|
this._updatePosition();
|
|
4514
4514
|
else {
|
|
4515
4515
|
let c = this._canvas.toDataURL();
|
|
@@ -4522,7 +4522,7 @@ class ga {
|
|
|
4522
4522
|
// Mouse events might be emulated, this allows
|
|
4523
4523
|
// moving the cursor in such cases
|
|
4524
4524
|
move(t, e) {
|
|
4525
|
-
if (
|
|
4525
|
+
if (!qe)
|
|
4526
4526
|
return;
|
|
4527
4527
|
window.visualViewport ? (this._position.x = t + window.visualViewport.offsetLeft, this._position.y = e + window.visualViewport.offsetTop) : (this._position.x = t, this._position.y = e), this._updatePosition();
|
|
4528
4528
|
let s = document.elementFromPoint(t, e);
|
|
@@ -4568,16 +4568,16 @@ class ga {
|
|
|
4568
4568
|
return document.captureElement && document.documentElement.contains(document.captureElement);
|
|
4569
4569
|
}
|
|
4570
4570
|
}
|
|
4571
|
-
const
|
|
4571
|
+
const ci = 40 * 1024 * 1024, mt = {
|
|
4572
4572
|
CONNECTING: "connecting",
|
|
4573
4573
|
OPEN: "open",
|
|
4574
4574
|
CLOSING: "closing",
|
|
4575
4575
|
CLOSED: "closed"
|
|
4576
|
-
},
|
|
4577
|
-
CONNECTING: [WebSocket.CONNECTING,
|
|
4578
|
-
OPEN: [WebSocket.OPEN,
|
|
4579
|
-
CLOSING: [WebSocket.CLOSING,
|
|
4580
|
-
CLOSED: [WebSocket.CLOSED,
|
|
4576
|
+
}, vt = {
|
|
4577
|
+
CONNECTING: [WebSocket.CONNECTING, mt.CONNECTING],
|
|
4578
|
+
OPEN: [WebSocket.OPEN, mt.OPEN],
|
|
4579
|
+
CLOSING: [WebSocket.CLOSING, mt.CLOSING],
|
|
4580
|
+
CLOSED: [WebSocket.CLOSED, mt.CLOSED]
|
|
4581
4581
|
}, Cs = [
|
|
4582
4582
|
"send",
|
|
4583
4583
|
"close",
|
|
@@ -4588,7 +4588,7 @@ const li = 40 * 1024 * 1024, vt = {
|
|
|
4588
4588
|
"protocol",
|
|
4589
4589
|
"readyState"
|
|
4590
4590
|
];
|
|
4591
|
-
class
|
|
4591
|
+
class ma {
|
|
4592
4592
|
constructor() {
|
|
4593
4593
|
this._websocket = null, this._rQi = 0, this._rQlen = 0, this._rQbufferSize = 1024 * 1024 * 4, this._rQ = null, this._sQbufferSize = 1024 * 10, this._sQlen = 0, this._sQ = null, this._eventHandlers = {
|
|
4594
4594
|
message: () => {
|
|
@@ -4604,7 +4604,7 @@ class ba {
|
|
|
4604
4604
|
// Getters and setters
|
|
4605
4605
|
get readyState() {
|
|
4606
4606
|
let t;
|
|
4607
|
-
return this._websocket === null ? "unused" : (t = this._websocket.readyState,
|
|
4607
|
+
return this._websocket === null ? "unused" : (t = this._websocket.readyState, vt.CONNECTING.includes(t) ? "connecting" : vt.OPEN.includes(t) ? "open" : vt.CLOSING.includes(t) ? "closing" : vt.CLOSED.includes(t) ? "closed" : "unknown");
|
|
4608
4608
|
}
|
|
4609
4609
|
// Receive queue
|
|
4610
4610
|
rQpeek8() {
|
|
@@ -4716,7 +4716,7 @@ class ba {
|
|
|
4716
4716
|
throw new Error("Raw channel missing property: " + n);
|
|
4717
4717
|
}
|
|
4718
4718
|
this._websocket = t, this._websocket.binaryType = "arraybuffer", this._websocket.onmessage = this._recvMessage.bind(this), this._websocket.onopen = () => {
|
|
4719
|
-
L(">> WebSock.onopen"), this._websocket.protocol &&
|
|
4719
|
+
L(">> WebSock.onopen"), this._websocket.protocol && ae("Server choose sub-protocol: " + this._websocket.protocol), this._eventHandlers.open(), L("<< WebSock.onopen");
|
|
4720
4720
|
}, this._websocket.onclose = (s) => {
|
|
4721
4721
|
L(">> WebSock.onclose"), this._eventHandlers.close(s), L("<< WebSock.onclose");
|
|
4722
4722
|
}, this._websocket.onerror = (s) => {
|
|
@@ -4724,7 +4724,7 @@ class ba {
|
|
|
4724
4724
|
};
|
|
4725
4725
|
}
|
|
4726
4726
|
close() {
|
|
4727
|
-
this._websocket && ((this.readyState === "connecting" || this.readyState === "open") && (
|
|
4727
|
+
this._websocket && ((this.readyState === "connecting" || this.readyState === "open") && (ae("Closing WebSocket connection"), this._websocket.close()), this._websocket.onmessage = () => {
|
|
4728
4728
|
});
|
|
4729
4729
|
}
|
|
4730
4730
|
// private methods
|
|
@@ -4735,8 +4735,8 @@ class ba {
|
|
|
4735
4735
|
// unnecessary copying.
|
|
4736
4736
|
_expandCompactRQ(t) {
|
|
4737
4737
|
const e = (this._rQlen - this._rQi + t) * 8, s = this._rQbufferSize < e;
|
|
4738
|
-
if (s && (this._rQbufferSize = Math.max(this._rQbufferSize * 2, e)), this._rQbufferSize >
|
|
4739
|
-
throw new Error("Receive queue buffer exceeded " +
|
|
4738
|
+
if (s && (this._rQbufferSize = Math.max(this._rQbufferSize * 2, e)), this._rQbufferSize > ci && (this._rQbufferSize = ci, this._rQbufferSize - (this._rQlen - this._rQi) < t))
|
|
4739
|
+
throw new Error("Receive queue buffer exceeded " + ci + " bytes, and the new message could not fit");
|
|
4740
4740
|
if (s) {
|
|
4741
4741
|
const n = this._rQ.buffer;
|
|
4742
4742
|
this._rQ = new Uint8Array(this._rQbufferSize), this._rQ.set(new Uint8Array(n, this._rQi, this._rQlen - this._rQi));
|
|
@@ -4751,7 +4751,7 @@ class ba {
|
|
|
4751
4751
|
e.length > this._rQbufferSize - this._rQlen && this._expandCompactRQ(e.length), this._rQ.set(e, this._rQlen), this._rQlen += e.length, this._rQlen - this._rQi > 0 ? this._eventHandlers.message() : L("Ignoring empty message");
|
|
4752
4752
|
}
|
|
4753
4753
|
}
|
|
4754
|
-
const
|
|
4754
|
+
const va = {
|
|
4755
4755
|
Again: 57349,
|
|
4756
4756
|
/* html:Again (Again) -> linux:129 (KEY_AGAIN) -> atset1:57349 */
|
|
4757
4757
|
AltLeft: 56,
|
|
@@ -5109,7 +5109,7 @@ const wa = {
|
|
|
5109
5109
|
pseudoEncodingVMwareCursor: 1464686180,
|
|
5110
5110
|
pseudoEncodingExtendedClipboard: 3231835598
|
|
5111
5111
|
};
|
|
5112
|
-
class
|
|
5112
|
+
class yi {
|
|
5113
5113
|
constructor() {
|
|
5114
5114
|
this._key = null;
|
|
5115
5115
|
}
|
|
@@ -5117,7 +5117,7 @@ class vi {
|
|
|
5117
5117
|
return { name: "AES-ECB" };
|
|
5118
5118
|
}
|
|
5119
5119
|
static async importKey(t, e, s, n) {
|
|
5120
|
-
const r = new
|
|
5120
|
+
const r = new yi();
|
|
5121
5121
|
return await r._importKey(t, s, n), r;
|
|
5122
5122
|
}
|
|
5123
5123
|
async _importKey(t, e, s) {
|
|
@@ -5144,7 +5144,7 @@ class vi {
|
|
|
5144
5144
|
return s;
|
|
5145
5145
|
}
|
|
5146
5146
|
}
|
|
5147
|
-
class
|
|
5147
|
+
class ki {
|
|
5148
5148
|
constructor() {
|
|
5149
5149
|
this._rawKey = null, this._ctrKey = null, this._cbcKey = null, this._zeroBlock = new Uint8Array(16), this._prefixBlock0 = this._zeroBlock, this._prefixBlock1 = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]), this._prefixBlock2 = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2]);
|
|
5150
5150
|
}
|
|
@@ -5200,7 +5200,7 @@ class yi {
|
|
|
5200
5200
|
return h = new Uint8Array(h), h.slice(h.length - 32, h.length - 16);
|
|
5201
5201
|
}
|
|
5202
5202
|
static async importKey(t, e, s, n) {
|
|
5203
|
-
const r = new
|
|
5203
|
+
const r = new ki();
|
|
5204
5204
|
return await r._importKey(t), r;
|
|
5205
5205
|
}
|
|
5206
5206
|
async _importKey(t) {
|
|
@@ -5237,7 +5237,7 @@ class yi {
|
|
|
5237
5237
|
return await this._decryptCTR(s, h);
|
|
5238
5238
|
}
|
|
5239
5239
|
}
|
|
5240
|
-
const
|
|
5240
|
+
const Ks = [
|
|
5241
5241
|
13,
|
|
5242
5242
|
16,
|
|
5243
5243
|
10,
|
|
@@ -5286,7 +5286,7 @@ const Es = [
|
|
|
5286
5286
|
35,
|
|
5287
5287
|
28,
|
|
5288
5288
|
31
|
|
5289
|
-
],
|
|
5289
|
+
], ya = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28], u = 0;
|
|
5290
5290
|
let p, g, v, b, w, y;
|
|
5291
5291
|
p = 65536;
|
|
5292
5292
|
g = 1 << 24;
|
|
@@ -5294,7 +5294,7 @@ v = p | g;
|
|
|
5294
5294
|
b = 4;
|
|
5295
5295
|
w = 1024;
|
|
5296
5296
|
y = b | w;
|
|
5297
|
-
const
|
|
5297
|
+
const As = [
|
|
5298
5298
|
v | w,
|
|
5299
5299
|
u | u,
|
|
5300
5300
|
p | u,
|
|
@@ -5366,7 +5366,7 @@ v = p | g;
|
|
|
5366
5366
|
b = 32;
|
|
5367
5367
|
w = 32768;
|
|
5368
5368
|
y = b | w;
|
|
5369
|
-
const
|
|
5369
|
+
const Xs = [
|
|
5370
5370
|
v | y,
|
|
5371
5371
|
g | w,
|
|
5372
5372
|
u | w,
|
|
@@ -5438,7 +5438,7 @@ v = p | g;
|
|
|
5438
5438
|
b = 8;
|
|
5439
5439
|
w = 512;
|
|
5440
5440
|
y = b | w;
|
|
5441
|
-
const
|
|
5441
|
+
const Fs = [
|
|
5442
5442
|
u | y,
|
|
5443
5443
|
v | w,
|
|
5444
5444
|
u | u,
|
|
@@ -5510,7 +5510,7 @@ v = p | g;
|
|
|
5510
5510
|
b = 1;
|
|
5511
5511
|
w = 128;
|
|
5512
5512
|
y = b | w;
|
|
5513
|
-
const
|
|
5513
|
+
const Ms = [
|
|
5514
5514
|
v | b,
|
|
5515
5515
|
p | y,
|
|
5516
5516
|
p | y,
|
|
@@ -5582,7 +5582,7 @@ v = p | g;
|
|
|
5582
5582
|
b = 256;
|
|
5583
5583
|
w = 1 << 19;
|
|
5584
5584
|
y = b | w;
|
|
5585
|
-
const
|
|
5585
|
+
const Ts = [
|
|
5586
5586
|
u | b,
|
|
5587
5587
|
p | y,
|
|
5588
5588
|
p | w,
|
|
@@ -5654,7 +5654,7 @@ v = p | g;
|
|
|
5654
5654
|
b = 16;
|
|
5655
5655
|
w = 16384;
|
|
5656
5656
|
y = b | w;
|
|
5657
|
-
const
|
|
5657
|
+
const Qs = [
|
|
5658
5658
|
g | b,
|
|
5659
5659
|
v | u,
|
|
5660
5660
|
u | w,
|
|
@@ -5726,7 +5726,7 @@ v = p | g;
|
|
|
5726
5726
|
b = 2;
|
|
5727
5727
|
w = 2048;
|
|
5728
5728
|
y = b | w;
|
|
5729
|
-
const
|
|
5729
|
+
const Ls = [
|
|
5730
5730
|
p | u,
|
|
5731
5731
|
v | b,
|
|
5732
5732
|
g | y,
|
|
@@ -5798,7 +5798,7 @@ v = p | g;
|
|
|
5798
5798
|
b = 64;
|
|
5799
5799
|
w = 4096;
|
|
5800
5800
|
y = b | w;
|
|
5801
|
-
const
|
|
5801
|
+
const Rs = [
|
|
5802
5802
|
g | y,
|
|
5803
5803
|
u | w,
|
|
5804
5804
|
p | u,
|
|
@@ -5864,7 +5864,7 @@ const Ls = [
|
|
|
5864
5864
|
g | u,
|
|
5865
5865
|
v | w
|
|
5866
5866
|
];
|
|
5867
|
-
class
|
|
5867
|
+
class An {
|
|
5868
5868
|
constructor(t) {
|
|
5869
5869
|
this.keys = [];
|
|
5870
5870
|
const e = [], s = [], n = [];
|
|
@@ -5878,11 +5878,11 @@ class Kn {
|
|
|
5878
5878
|
n[a] = n[h] = 0;
|
|
5879
5879
|
for (let c = 28; c < 59; c += 28)
|
|
5880
5880
|
for (let o = c - 28; o < c; ++o) {
|
|
5881
|
-
const l = o +
|
|
5881
|
+
const l = o + ya[r];
|
|
5882
5882
|
s[o] = l < c ? e[l] : e[l - 28];
|
|
5883
5883
|
}
|
|
5884
5884
|
for (let c = 0; c < 24; ++c)
|
|
5885
|
-
s[
|
|
5885
|
+
s[Ks[c]] !== 0 && (n[a] |= 1 << 23 - c), s[Ks[c + 24]] !== 0 && (n[h] |= 1 << 23 - c);
|
|
5886
5886
|
}
|
|
5887
5887
|
for (let r = 0, a = 0, h = 0; r < 16; ++r) {
|
|
5888
5888
|
const c = n[a++], o = n[a++];
|
|
@@ -5896,15 +5896,15 @@ class Kn {
|
|
|
5896
5896
|
n = e[s++] << 24 | e[s++] << 16 | e[s++] << 8 | e[s++], r = e[s++] << 24 | e[s++] << 16 | e[s++] << 8 | e[s++], a = (n >>> 4 ^ r) & 252645135, r ^= a, n ^= a << 4, a = (n >>> 16 ^ r) & 65535, r ^= a, n ^= a << 16, a = (r >>> 2 ^ n) & 858993459, n ^= a, r ^= a << 2, a = (r >>> 8 ^ n) & 16711935, n ^= a, r ^= a << 8, r = r << 1 | r >>> 31 & 1, a = (n ^ r) & 2863311530, n ^= a, r ^= a, n = n << 1 | n >>> 31 & 1;
|
|
5897
5897
|
for (let h = 0, c = 0; h < 8; ++h) {
|
|
5898
5898
|
a = r << 28 | r >>> 4, a ^= this.keys[c++];
|
|
5899
|
-
let o =
|
|
5900
|
-
o |=
|
|
5899
|
+
let o = Ls[a & 63];
|
|
5900
|
+
o |= Ts[a >>> 8 & 63], o |= Fs[a >>> 16 & 63], o |= As[a >>> 24 & 63], a = r ^ this.keys[c++], o |= Rs[a & 63], o |= Qs[a >>> 8 & 63], o |= Ms[a >>> 16 & 63], o |= Xs[a >>> 24 & 63], n ^= o, a = n << 28 | n >>> 4, a ^= this.keys[c++], o = Ls[a & 63], o |= Ts[a >>> 8 & 63], o |= Fs[a >>> 16 & 63], o |= As[a >>> 24 & 63], a = n ^ this.keys[c++], o |= Rs[a & 63], o |= Qs[a >>> 8 & 63], o |= Ms[a >>> 16 & 63], o |= Xs[a >>> 24 & 63], r ^= o;
|
|
5901
5901
|
}
|
|
5902
5902
|
for (r = r << 31 | r >>> 1, a = (n ^ r) & 2863311530, n ^= a, r ^= a, n = n << 31 | n >>> 1, a = (n >>> 8 ^ r) & 16711935, r ^= a, n ^= a << 8, a = (n >>> 2 ^ r) & 858993459, r ^= a, n ^= a << 2, a = (r >>> 16 ^ n) & 65535, n ^= a, r ^= a << 16, a = (r >>> 4 ^ n) & 252645135, n ^= a, r ^= a << 4, a = [r, n], s = 0; s < 8; s++)
|
|
5903
5903
|
e[s] = (a[s >>> 2] >>> 8 * (3 - s % 4)) % 256, e[s] < 0 && (e[s] += 256);
|
|
5904
5904
|
return e;
|
|
5905
5905
|
}
|
|
5906
5906
|
}
|
|
5907
|
-
class
|
|
5907
|
+
class Si {
|
|
5908
5908
|
constructor() {
|
|
5909
5909
|
this._cipher = null;
|
|
5910
5910
|
}
|
|
@@ -5912,11 +5912,11 @@ class ki {
|
|
|
5912
5912
|
return { name: "DES-ECB" };
|
|
5913
5913
|
}
|
|
5914
5914
|
static importKey(t, e, s, n) {
|
|
5915
|
-
const r = new
|
|
5915
|
+
const r = new Si();
|
|
5916
5916
|
return r._importKey(t), r;
|
|
5917
5917
|
}
|
|
5918
5918
|
_importKey(t, e, s) {
|
|
5919
|
-
this._cipher = new
|
|
5919
|
+
this._cipher = new An(t);
|
|
5920
5920
|
}
|
|
5921
5921
|
encrypt(t, e) {
|
|
5922
5922
|
const s = new Uint8Array(e);
|
|
@@ -5928,7 +5928,7 @@ class ki {
|
|
|
5928
5928
|
return s;
|
|
5929
5929
|
}
|
|
5930
5930
|
}
|
|
5931
|
-
class
|
|
5931
|
+
class Ei {
|
|
5932
5932
|
constructor() {
|
|
5933
5933
|
this._cipher = null;
|
|
5934
5934
|
}
|
|
@@ -5936,11 +5936,11 @@ class Si {
|
|
|
5936
5936
|
return { name: "DES-CBC" };
|
|
5937
5937
|
}
|
|
5938
5938
|
static importKey(t, e, s, n) {
|
|
5939
|
-
const r = new
|
|
5939
|
+
const r = new Ei();
|
|
5940
5940
|
return r._importKey(t), r;
|
|
5941
5941
|
}
|
|
5942
5942
|
_importKey(t) {
|
|
5943
|
-
this._cipher = new
|
|
5943
|
+
this._cipher = new An(t);
|
|
5944
5944
|
}
|
|
5945
5945
|
encrypt(t, e) {
|
|
5946
5946
|
const s = new Uint8Array(e);
|
|
@@ -5956,13 +5956,13 @@ class Si {
|
|
|
5956
5956
|
return s;
|
|
5957
5957
|
}
|
|
5958
5958
|
}
|
|
5959
|
-
function
|
|
5959
|
+
function Lt(i, t, e) {
|
|
5960
5960
|
let s = 1n;
|
|
5961
5961
|
for (i = i % e; t > 0n; )
|
|
5962
5962
|
(t & 1n) === 1n && (s = s * i % e), t = t >> 1n, i = i * i % e;
|
|
5963
5963
|
return s;
|
|
5964
5964
|
}
|
|
5965
|
-
function
|
|
5965
|
+
function Rt(i, t = 0) {
|
|
5966
5966
|
let e = i.toString(16);
|
|
5967
5967
|
t === 0 && (t = Math.ceil(e.length / 2)), e = e.padStart(t * 2, "0");
|
|
5968
5968
|
const s = e.length / 2, n = new Uint8Array(s);
|
|
@@ -5970,13 +5970,13 @@ function Bt(i, t = 0) {
|
|
|
5970
5970
|
n[r] = parseInt(e.slice(r * 2, r * 2 + 2), 16);
|
|
5971
5971
|
return n;
|
|
5972
5972
|
}
|
|
5973
|
-
function
|
|
5973
|
+
function ue(i) {
|
|
5974
5974
|
let t = "0x";
|
|
5975
5975
|
for (let e = 0; e < i.length; e++)
|
|
5976
5976
|
t += i[e].toString(16).padStart(2, "0");
|
|
5977
5977
|
return BigInt(t);
|
|
5978
5978
|
}
|
|
5979
|
-
class
|
|
5979
|
+
class Bt {
|
|
5980
5980
|
constructor() {
|
|
5981
5981
|
this._keyLength = 0, this._keyBytes = 0, this._n = null, this._e = null, this._d = null, this._nBigInt = null, this._eBigInt = null, this._dBigInt = null, this._extractable = !1;
|
|
5982
5982
|
}
|
|
@@ -5984,14 +5984,14 @@ class Dt {
|
|
|
5984
5984
|
return { name: "RSA-PKCS1-v1_5" };
|
|
5985
5985
|
}
|
|
5986
5986
|
_base64urlDecode(t) {
|
|
5987
|
-
return t = t.replace(/-/g, "+").replace(/_/g, "/"), t = t.padEnd(Math.ceil(t.length / 4) * 4, "="),
|
|
5987
|
+
return t = t.replace(/-/g, "+").replace(/_/g, "/"), t = t.padEnd(Math.ceil(t.length / 4) * 4, "="), gi.decode(t);
|
|
5988
5988
|
}
|
|
5989
5989
|
_padArray(t, e) {
|
|
5990
5990
|
const s = new Uint8Array(e);
|
|
5991
5991
|
return s.set(t, e - t.length), s;
|
|
5992
5992
|
}
|
|
5993
5993
|
static async generateKey(t, e, s) {
|
|
5994
|
-
const n = new
|
|
5994
|
+
const n = new Bt();
|
|
5995
5995
|
return await n._generateKey(t, e), { privateKey: n };
|
|
5996
5996
|
}
|
|
5997
5997
|
async _generateKey(t, e) {
|
|
@@ -6006,19 +6006,19 @@ class Dt {
|
|
|
6006
6006
|
!0,
|
|
6007
6007
|
["encrypt", "decrypt"]
|
|
6008
6008
|
), n = await window.crypto.subtle.exportKey("jwk", s.privateKey);
|
|
6009
|
-
this._n = this._padArray(this._base64urlDecode(n.n), this._keyBytes), this._nBigInt =
|
|
6009
|
+
this._n = this._padArray(this._base64urlDecode(n.n), this._keyBytes), this._nBigInt = ue(this._n), this._e = this._padArray(this._base64urlDecode(n.e), this._keyBytes), this._eBigInt = ue(this._e), this._d = this._padArray(this._base64urlDecode(n.d), this._keyBytes), this._dBigInt = ue(this._d), this._extractable = e;
|
|
6010
6010
|
}
|
|
6011
6011
|
static async importKey(t, e, s, n) {
|
|
6012
6012
|
if (n.length !== 1 || n[0] !== "encrypt")
|
|
6013
6013
|
throw new Error("only support importing RSA public key");
|
|
6014
|
-
const r = new
|
|
6014
|
+
const r = new Bt();
|
|
6015
6015
|
return await r._importKey(t, s), r;
|
|
6016
6016
|
}
|
|
6017
6017
|
async _importKey(t, e) {
|
|
6018
6018
|
const s = t.n, n = t.e;
|
|
6019
6019
|
if (s.length !== n.length)
|
|
6020
6020
|
throw new Error("the sizes of modulus and public exponent do not match");
|
|
6021
|
-
this._keyBytes = s.length, this._keyLength = this._keyBytes * 8, this._n = new Uint8Array(this._keyBytes), this._e = new Uint8Array(this._keyBytes), this._n.set(s), this._e.set(n), this._nBigInt =
|
|
6021
|
+
this._keyBytes = s.length, this._keyLength = this._keyBytes * 8, this._n = new Uint8Array(this._keyBytes), this._e = new Uint8Array(this._keyBytes), this._n.set(s), this._e.set(n), this._nBigInt = ue(this._n), this._eBigInt = ue(this._e), this._extractable = e;
|
|
6022
6022
|
}
|
|
6023
6023
|
async encrypt(t, e) {
|
|
6024
6024
|
if (e.length > this._keyBytes - 11)
|
|
@@ -6029,13 +6029,13 @@ class Dt {
|
|
|
6029
6029
|
s[h] = Math.floor(s[h] * 254 / 255 + 1);
|
|
6030
6030
|
const n = new Uint8Array(this._keyBytes);
|
|
6031
6031
|
n[1] = 2, n.set(s, 2), n.set(e, s.length + 3);
|
|
6032
|
-
const r =
|
|
6033
|
-
return
|
|
6032
|
+
const r = ue(n), a = Lt(r, this._eBigInt, this._nBigInt);
|
|
6033
|
+
return Rt(a, this._keyBytes);
|
|
6034
6034
|
}
|
|
6035
6035
|
async decrypt(t, e) {
|
|
6036
6036
|
if (e.length !== this._keyBytes)
|
|
6037
6037
|
return null;
|
|
6038
|
-
const s =
|
|
6038
|
+
const s = ue(e), n = Lt(s, this._dBigInt, this._nBigInt), r = Rt(n, this._keyBytes);
|
|
6039
6039
|
if (r[0] !== 0 || r[1] !== 2)
|
|
6040
6040
|
return null;
|
|
6041
6041
|
let a = 2;
|
|
@@ -6049,7 +6049,7 @@ class Dt {
|
|
|
6049
6049
|
return { n: this._n, e: this._e, d: this._d };
|
|
6050
6050
|
}
|
|
6051
6051
|
}
|
|
6052
|
-
class
|
|
6052
|
+
class ka {
|
|
6053
6053
|
constructor(t) {
|
|
6054
6054
|
this._key = t;
|
|
6055
6055
|
}
|
|
@@ -6069,85 +6069,85 @@ class Ci {
|
|
|
6069
6069
|
}
|
|
6070
6070
|
static generateKey(t, e) {
|
|
6071
6071
|
const s = new Ci();
|
|
6072
|
-
return s._generateKey(t), { privateKey: s, publicKey: new
|
|
6072
|
+
return s._generateKey(t), { privateKey: s, publicKey: new ka(s._publicKey) };
|
|
6073
6073
|
}
|
|
6074
6074
|
_generateKey(t) {
|
|
6075
6075
|
const e = t.g, s = t.p;
|
|
6076
|
-
this._keyBytes = s.length, this._gBigInt =
|
|
6076
|
+
this._keyBytes = s.length, this._gBigInt = ue(e), this._pBigInt = ue(s), this._privateKey = window.crypto.getRandomValues(new Uint8Array(this._keyBytes)), this._privateKeyBigInt = ue(this._privateKey), this._publicKey = Rt(Lt(
|
|
6077
6077
|
this._gBigInt,
|
|
6078
6078
|
this._privateKeyBigInt,
|
|
6079
6079
|
this._pBigInt
|
|
6080
6080
|
), this._keyBytes);
|
|
6081
6081
|
}
|
|
6082
6082
|
deriveBits(t, e) {
|
|
6083
|
-
const s = Math.ceil(e / 8), n = new Uint8Array(t.public), r = s > this._keyBytes ? s : this._keyBytes, a =
|
|
6084
|
-
return
|
|
6083
|
+
const s = Math.ceil(e / 8), n = new Uint8Array(t.public), r = s > this._keyBytes ? s : this._keyBytes, a = Lt(ue(n), this._privateKeyBigInt, this._pBigInt);
|
|
6084
|
+
return Rt(a, r).slice(0, r);
|
|
6085
6085
|
}
|
|
6086
6086
|
}
|
|
6087
|
-
async function
|
|
6087
|
+
async function Sa(i) {
|
|
6088
6088
|
let t = "";
|
|
6089
6089
|
for (let e = 0; e < i.length; e++)
|
|
6090
6090
|
t += String.fromCharCode(i[e]);
|
|
6091
|
-
return
|
|
6091
|
+
return Ea(Ka(Aa(Ca(t), 8 * t.length)));
|
|
6092
6092
|
}
|
|
6093
|
-
function
|
|
6093
|
+
function Ea(i) {
|
|
6094
6094
|
let t = new Uint8Array(i.length);
|
|
6095
6095
|
for (let e = 0; e < i.length; e++)
|
|
6096
6096
|
t[e] = i.charCodeAt(e);
|
|
6097
6097
|
return t;
|
|
6098
6098
|
}
|
|
6099
|
-
function
|
|
6099
|
+
function Ca(i) {
|
|
6100
6100
|
let t = Array(i.length >> 2);
|
|
6101
6101
|
for (let e = 0; e < t.length; e++) t[e] = 0;
|
|
6102
6102
|
for (let e = 0; e < 8 * i.length; e += 8) t[e >> 5] |= (255 & i.charCodeAt(e / 8)) << e % 32;
|
|
6103
6103
|
return t;
|
|
6104
6104
|
}
|
|
6105
|
-
function
|
|
6105
|
+
function Ka(i) {
|
|
6106
6106
|
let t = "";
|
|
6107
6107
|
for (let e = 0; e < 32 * i.length; e += 8) t += String.fromCharCode(i[e >> 5] >>> e % 32 & 255);
|
|
6108
6108
|
return t;
|
|
6109
6109
|
}
|
|
6110
|
-
function
|
|
6110
|
+
function Aa(i, t) {
|
|
6111
6111
|
i[t >> 5] |= 128 << t % 32, i[14 + (t + 64 >>> 9 << 4)] = t;
|
|
6112
6112
|
let e = 1732584193, s = -271733879, n = -1732584194, r = 271733878;
|
|
6113
6113
|
for (let a = 0; a < i.length; a += 16) {
|
|
6114
6114
|
let h = e, c = s, o = n, l = r;
|
|
6115
|
-
s =
|
|
6115
|
+
s = re(s = re(s = re(s = re(s = ne(s = ne(s = ne(s = ne(s = se(s = se(s = se(s = se(s = ie(s = ie(s = ie(s = ie(s, n = ie(n, r = ie(r, e = ie(e, s, n, r, i[a + 0], 7, -680876936), s, n, i[a + 1], 12, -389564586), e, s, i[a + 2], 17, 606105819), r, e, i[a + 3], 22, -1044525330), n = ie(n, r = ie(r, e = ie(e, s, n, r, i[a + 4], 7, -176418897), s, n, i[a + 5], 12, 1200080426), e, s, i[a + 6], 17, -1473231341), r, e, i[a + 7], 22, -45705983), n = ie(n, r = ie(r, e = ie(e, s, n, r, i[a + 8], 7, 1770035416), s, n, i[a + 9], 12, -1958414417), e, s, i[a + 10], 17, -42063), r, e, i[a + 11], 22, -1990404162), n = ie(n, r = ie(r, e = ie(e, s, n, r, i[a + 12], 7, 1804603682), s, n, i[a + 13], 12, -40341101), e, s, i[a + 14], 17, -1502002290), r, e, i[a + 15], 22, 1236535329), n = se(n, r = se(r, e = se(e, s, n, r, i[a + 1], 5, -165796510), s, n, i[a + 6], 9, -1069501632), e, s, i[a + 11], 14, 643717713), r, e, i[a + 0], 20, -373897302), n = se(n, r = se(r, e = se(e, s, n, r, i[a + 5], 5, -701558691), s, n, i[a + 10], 9, 38016083), e, s, i[a + 15], 14, -660478335), r, e, i[a + 4], 20, -405537848), n = se(n, r = se(r, e = se(e, s, n, r, i[a + 9], 5, 568446438), s, n, i[a + 14], 9, -1019803690), e, s, i[a + 3], 14, -187363961), r, e, i[a + 8], 20, 1163531501), n = se(n, r = se(r, e = se(e, s, n, r, i[a + 13], 5, -1444681467), s, n, i[a + 2], 9, -51403784), e, s, i[a + 7], 14, 1735328473), r, e, i[a + 12], 20, -1926607734), n = ne(n, r = ne(r, e = ne(e, s, n, r, i[a + 5], 4, -378558), s, n, i[a + 8], 11, -2022574463), e, s, i[a + 11], 16, 1839030562), r, e, i[a + 14], 23, -35309556), n = ne(n, r = ne(r, e = ne(e, s, n, r, i[a + 1], 4, -1530992060), s, n, i[a + 4], 11, 1272893353), e, s, i[a + 7], 16, -155497632), r, e, i[a + 10], 23, -1094730640), n = ne(n, r = ne(r, e = ne(e, s, n, r, i[a + 13], 4, 681279174), s, n, i[a + 0], 11, -358537222), e, s, i[a + 3], 16, -722521979), r, e, i[a + 6], 23, 76029189), n = ne(n, r = ne(r, e = ne(e, s, n, r, i[a + 9], 4, -640364487), s, n, i[a + 12], 11, -421815835), e, s, i[a + 15], 16, 530742520), r, e, i[a + 2], 23, -995338651), n = re(n, r = re(r, e = re(e, s, n, r, i[a + 0], 6, -198630844), s, n, i[a + 7], 10, 1126891415), e, s, i[a + 14], 15, -1416354905), r, e, i[a + 5], 21, -57434055), n = re(n, r = re(r, e = re(e, s, n, r, i[a + 12], 6, 1700485571), s, n, i[a + 3], 10, -1894986606), e, s, i[a + 10], 15, -1051523), r, e, i[a + 1], 21, -2054922799), n = re(n, r = re(r, e = re(e, s, n, r, i[a + 8], 6, 1873313359), s, n, i[a + 15], 10, -30611744), e, s, i[a + 6], 15, -1560198380), r, e, i[a + 13], 21, 1309151649), n = re(n, r = re(r, e = re(e, s, n, r, i[a + 4], 6, -145523070), s, n, i[a + 11], 10, -1120210379), e, s, i[a + 2], 15, 718787259), r, e, i[a + 9], 21, -343485551), e = Ee(e, h), s = Ee(s, c), n = Ee(n, o), r = Ee(r, l);
|
|
6116
6116
|
}
|
|
6117
6117
|
return Array(e, s, n, r);
|
|
6118
6118
|
}
|
|
6119
|
-
function
|
|
6120
|
-
return Ee(
|
|
6121
|
-
}
|
|
6122
|
-
function te(i, t, e, s, n, r, a) {
|
|
6123
|
-
return Nt(t & e | ~t & s, i, t, n, r, a);
|
|
6119
|
+
function Ut(i, t, e, s, n, r) {
|
|
6120
|
+
return Ee(Xa(Ee(Ee(t, i), Ee(s, r)), n), e);
|
|
6124
6121
|
}
|
|
6125
6122
|
function ie(i, t, e, s, n, r, a) {
|
|
6126
|
-
return
|
|
6123
|
+
return Ut(t & e | ~t & s, i, t, n, r, a);
|
|
6127
6124
|
}
|
|
6128
6125
|
function se(i, t, e, s, n, r, a) {
|
|
6129
|
-
return
|
|
6126
|
+
return Ut(t & s | e & ~s, i, t, n, r, a);
|
|
6130
6127
|
}
|
|
6131
6128
|
function ne(i, t, e, s, n, r, a) {
|
|
6132
|
-
return
|
|
6129
|
+
return Ut(t ^ e ^ s, i, t, n, r, a);
|
|
6130
|
+
}
|
|
6131
|
+
function re(i, t, e, s, n, r, a) {
|
|
6132
|
+
return Ut(e ^ (t | ~s), i, t, n, r, a);
|
|
6133
6133
|
}
|
|
6134
6134
|
function Ee(i, t) {
|
|
6135
6135
|
let e = (65535 & i) + (65535 & t);
|
|
6136
6136
|
return (i >> 16) + (t >> 16) + (e >> 16) << 16 | 65535 & e;
|
|
6137
6137
|
}
|
|
6138
|
-
function
|
|
6138
|
+
function Xa(i, t) {
|
|
6139
6139
|
return i << t | i >>> 32 - t;
|
|
6140
6140
|
}
|
|
6141
|
-
class
|
|
6141
|
+
class Fa {
|
|
6142
6142
|
constructor() {
|
|
6143
6143
|
this._algorithms = {
|
|
6144
|
-
"AES-ECB":
|
|
6145
|
-
"AES-EAX":
|
|
6146
|
-
"DES-ECB":
|
|
6147
|
-
"DES-CBC":
|
|
6148
|
-
"RSA-PKCS1-v1_5":
|
|
6144
|
+
"AES-ECB": yi,
|
|
6145
|
+
"AES-EAX": ki,
|
|
6146
|
+
"DES-ECB": Si,
|
|
6147
|
+
"DES-CBC": Ei,
|
|
6148
|
+
"RSA-PKCS1-v1_5": Bt,
|
|
6149
6149
|
DH: Ci,
|
|
6150
|
-
MD5:
|
|
6150
|
+
MD5: Sa
|
|
6151
6151
|
};
|
|
6152
6152
|
}
|
|
6153
6153
|
encrypt(t, e, s) {
|
|
@@ -6199,13 +6199,13 @@ class Aa {
|
|
|
6199
6199
|
return e.deriveBits(t, s);
|
|
6200
6200
|
}
|
|
6201
6201
|
}
|
|
6202
|
-
const
|
|
6203
|
-
class
|
|
6202
|
+
const Y = new Fa();
|
|
6203
|
+
class Bs {
|
|
6204
6204
|
constructor() {
|
|
6205
6205
|
this._cipher = null, this._counter = new Uint8Array(16);
|
|
6206
6206
|
}
|
|
6207
6207
|
async setKey(t) {
|
|
6208
|
-
this._cipher = await
|
|
6208
|
+
this._cipher = await Y.importKey(
|
|
6209
6209
|
"raw",
|
|
6210
6210
|
t,
|
|
6211
6211
|
{ name: "AES-EAX" },
|
|
@@ -6214,7 +6214,7 @@ class Rs {
|
|
|
6214
6214
|
);
|
|
6215
6215
|
}
|
|
6216
6216
|
async makeMessage(t) {
|
|
6217
|
-
const e = new Uint8Array([(t.length & 65280) >>> 8, t.length & 255]), s = await
|
|
6217
|
+
const e = new Uint8Array([(t.length & 65280) >>> 8, t.length & 255]), s = await Y.encrypt({
|
|
6218
6218
|
name: "AES-EAX",
|
|
6219
6219
|
iv: this._counter,
|
|
6220
6220
|
additionalData: e
|
|
@@ -6224,7 +6224,7 @@ class Rs {
|
|
|
6224
6224
|
return n.set(e), n.set(s, 2), n;
|
|
6225
6225
|
}
|
|
6226
6226
|
async receiveMessage(t, e) {
|
|
6227
|
-
const s = new Uint8Array([(t & 65280) >>> 8, t & 255]), n = await
|
|
6227
|
+
const s = new Uint8Array([(t & 65280) >>> 8, t & 255]), n = await Y.decrypt({
|
|
6228
6228
|
name: "AES-EAX",
|
|
6229
6229
|
iv: this._counter,
|
|
6230
6230
|
additionalData: s
|
|
@@ -6233,7 +6233,7 @@ class Rs {
|
|
|
6233
6233
|
return n;
|
|
6234
6234
|
}
|
|
6235
6235
|
}
|
|
6236
|
-
class
|
|
6236
|
+
class Ma extends nn {
|
|
6237
6237
|
constructor(t, e) {
|
|
6238
6238
|
super(), this._hasStarted = !1, this._checkSock = null, this._checkCredentials = null, this._approveServerResolve = null, this._sockReject = null, this._credentialsReject = null, this._approveServerReject = null, this._sock = t, this._getCredentials = e;
|
|
6239
6239
|
}
|
|
@@ -6276,7 +6276,7 @@ class Xa extends sn {
|
|
|
6276
6276
|
throw new Error("RA2: server public key is too long: " + e);
|
|
6277
6277
|
const s = Math.ceil(e / 8);
|
|
6278
6278
|
await this._waitSockAsync(s * 2);
|
|
6279
|
-
const n = this._sock.rQshiftBytes(s), r = this._sock.rQshiftBytes(s), a = await
|
|
6279
|
+
const n = this._sock.rQshiftBytes(s), r = this._sock.rQshiftBytes(s), a = await Y.importKey(
|
|
6280
6280
|
"raw",
|
|
6281
6281
|
{ n, e: r },
|
|
6282
6282
|
{ name: "RSA-PKCS1-v1_5" },
|
|
@@ -6288,78 +6288,78 @@ class Xa extends sn {
|
|
|
6288
6288
|
this.dispatchEvent(new CustomEvent("serververification", {
|
|
6289
6289
|
detail: { type: "RSA", publickey: h }
|
|
6290
6290
|
})), await c;
|
|
6291
|
-
const o = 2048, l = Math.ceil(o / 8), x = (await
|
|
6291
|
+
const o = 2048, l = Math.ceil(o / 8), x = (await Y.generateKey({
|
|
6292
6292
|
name: "RSA-PKCS1-v1_5",
|
|
6293
6293
|
modulusLength: o,
|
|
6294
6294
|
publicExponent: new Uint8Array([1, 0, 1])
|
|
6295
|
-
}, !0, ["encrypt"])).privateKey, f = await
|
|
6296
|
-
|
|
6295
|
+
}, !0, ["encrypt"])).privateKey, f = await Y.exportKey("raw", x), d = f.n, k = f.e, E = new Uint8Array(4 + l * 2);
|
|
6296
|
+
E[0] = (o & 4278190080) >>> 24, E[1] = (o & 16711680) >>> 16, E[2] = (o & 65280) >>> 8, E[3] = o & 255, E.set(d, 4), E.set(k, 4 + l), this._sock.sQpushBytes(E), this._sock.flush();
|
|
6297
6297
|
const X = new Uint8Array(16);
|
|
6298
6298
|
window.crypto.getRandomValues(X);
|
|
6299
|
-
const
|
|
6299
|
+
const C = await Y.encrypt(
|
|
6300
6300
|
{ name: "RSA-PKCS1-v1_5" },
|
|
6301
6301
|
a,
|
|
6302
6302
|
X
|
|
6303
|
-
),
|
|
6304
|
-
if (
|
|
6303
|
+
), M = new Uint8Array(2 + s);
|
|
6304
|
+
if (M[0] = (s & 65280) >>> 8, M[1] = s & 255, M.set(C, 2), this._sock.sQpushBytes(M), this._sock.flush(), await this._waitSockAsync(2), this._sock.rQshift16() !== l)
|
|
6305
6305
|
throw new Error("RA2: wrong encrypted message length");
|
|
6306
|
-
const A = this._sock.rQshiftBytes(l), S = await
|
|
6306
|
+
const A = this._sock.rQshiftBytes(l), S = await Y.decrypt(
|
|
6307
6307
|
{ name: "RSA-PKCS1-v1_5" },
|
|
6308
6308
|
x,
|
|
6309
6309
|
A
|
|
6310
6310
|
);
|
|
6311
6311
|
if (S === null || S.length !== 16)
|
|
6312
6312
|
throw new Error("RA2: corrupted server encrypted random");
|
|
6313
|
-
let F = new Uint8Array(32),
|
|
6314
|
-
F.set(S), F.set(X, 16),
|
|
6315
|
-
const K = new
|
|
6313
|
+
let F = new Uint8Array(32), N = new Uint8Array(32);
|
|
6314
|
+
F.set(S), F.set(X, 16), N.set(X), N.set(S, 16), F = await window.crypto.subtle.digest("SHA-1", F), F = new Uint8Array(F).slice(0, 16), N = await window.crypto.subtle.digest("SHA-1", N), N = new Uint8Array(N).slice(0, 16);
|
|
6315
|
+
const K = new Bs();
|
|
6316
6316
|
await K.setKey(F);
|
|
6317
|
-
const
|
|
6318
|
-
await
|
|
6319
|
-
let
|
|
6320
|
-
if (
|
|
6317
|
+
const I = new Bs();
|
|
6318
|
+
await I.setKey(N);
|
|
6319
|
+
let P = new Uint8Array(8 + s * 2 + l * 2), Q = new Uint8Array(8 + s * 2 + l * 2);
|
|
6320
|
+
if (P.set(h), P.set(E, 4 + s * 2), Q.set(E), Q.set(h, 4 + l * 2), P = await window.crypto.subtle.digest("SHA-1", P), Q = await window.crypto.subtle.digest("SHA-1", Q), P = new Uint8Array(P), Q = new Uint8Array(Q), this._sock.sQpushBytes(await K.makeMessage(Q)), this._sock.flush(), await this._waitSockAsync(38), this._sock.rQshift16() !== 20)
|
|
6321
6321
|
throw new Error("RA2: wrong server hash");
|
|
6322
|
-
const
|
|
6322
|
+
const z = await I.receiveMessage(
|
|
6323
6323
|
20,
|
|
6324
6324
|
this._sock.rQshiftBytes(36)
|
|
6325
6325
|
);
|
|
6326
|
-
if (
|
|
6326
|
+
if (z === null)
|
|
6327
6327
|
throw new Error("RA2: failed to authenticate the message");
|
|
6328
|
-
for (let
|
|
6329
|
-
if (
|
|
6328
|
+
for (let B = 0; B < 20; B++)
|
|
6329
|
+
if (z[B] !== P[B])
|
|
6330
6330
|
throw new Error("RA2: wrong server hash");
|
|
6331
6331
|
if (await this._waitSockAsync(19), this._sock.rQshift16() !== 1)
|
|
6332
6332
|
throw new Error("RA2: wrong subtype");
|
|
6333
|
-
let
|
|
6333
|
+
let j = await I.receiveMessage(
|
|
6334
6334
|
1,
|
|
6335
6335
|
this._sock.rQshiftBytes(17)
|
|
6336
6336
|
);
|
|
6337
|
-
if (
|
|
6337
|
+
if (j === null)
|
|
6338
6338
|
throw new Error("RA2: failed to authenticate the message");
|
|
6339
|
-
|
|
6340
|
-
let
|
|
6341
|
-
if (
|
|
6339
|
+
j = j[0];
|
|
6340
|
+
let T = this._waitCredentialsAsync(j);
|
|
6341
|
+
if (j === 1)
|
|
6342
6342
|
(this._getCredentials().username === void 0 || this._getCredentials().password === void 0) && this.dispatchEvent(new CustomEvent(
|
|
6343
6343
|
"credentialsrequired",
|
|
6344
6344
|
{ detail: { types: ["username", "password"] } }
|
|
6345
6345
|
));
|
|
6346
|
-
else if (
|
|
6346
|
+
else if (j === 2)
|
|
6347
6347
|
this._getCredentials().password === void 0 && this.dispatchEvent(new CustomEvent(
|
|
6348
6348
|
"credentialsrequired",
|
|
6349
6349
|
{ detail: { types: ["password"] } }
|
|
6350
6350
|
));
|
|
6351
6351
|
else
|
|
6352
6352
|
throw new Error("RA2: wrong subtype");
|
|
6353
|
-
await
|
|
6354
|
-
let
|
|
6355
|
-
|
|
6356
|
-
const
|
|
6357
|
-
|
|
6358
|
-
for (let
|
|
6359
|
-
B
|
|
6360
|
-
for (let
|
|
6361
|
-
|
|
6362
|
-
this._sock.sQpushBytes(await K.makeMessage(
|
|
6353
|
+
await T;
|
|
6354
|
+
let D;
|
|
6355
|
+
j === 1 ? D = be(this._getCredentials().username).slice(0, 255) : D = "";
|
|
6356
|
+
const q = be(this._getCredentials().password).slice(0, 255), H = new Uint8Array(D.length + q.length + 2);
|
|
6357
|
+
H[0] = D.length, H[D.length + 1] = q.length;
|
|
6358
|
+
for (let B = 0; B < D.length; B++)
|
|
6359
|
+
H[B + 1] = D.charCodeAt(B);
|
|
6360
|
+
for (let B = 0; B < q.length; B++)
|
|
6361
|
+
H[D.length + 2 + B] = q.charCodeAt(B);
|
|
6362
|
+
this._sock.sQpushBytes(await K.makeMessage(H)), this._sock.flush();
|
|
6363
6363
|
}
|
|
6364
6364
|
get hasStarted() {
|
|
6365
6365
|
return this._hasStarted;
|
|
@@ -6368,7 +6368,7 @@ class Xa extends sn {
|
|
|
6368
6368
|
this._hasStarted = t;
|
|
6369
6369
|
}
|
|
6370
6370
|
}
|
|
6371
|
-
class
|
|
6371
|
+
class Ta {
|
|
6372
6372
|
constructor() {
|
|
6373
6373
|
this._lines = 0;
|
|
6374
6374
|
}
|
|
@@ -6395,7 +6395,7 @@ class Fa {
|
|
|
6395
6395
|
return !0;
|
|
6396
6396
|
}
|
|
6397
6397
|
}
|
|
6398
|
-
class
|
|
6398
|
+
class Qa {
|
|
6399
6399
|
decodeRect(t, e, s, n, r, a, h) {
|
|
6400
6400
|
if (r.rQwait("COPYRECT", 4))
|
|
6401
6401
|
return !1;
|
|
@@ -6403,7 +6403,7 @@ class Ma {
|
|
|
6403
6403
|
return s === 0 || n === 0 || a.copyImage(c, o, t, e, s, n), !0;
|
|
6404
6404
|
}
|
|
6405
6405
|
}
|
|
6406
|
-
class
|
|
6406
|
+
class La {
|
|
6407
6407
|
constructor() {
|
|
6408
6408
|
this._subrects = 0;
|
|
6409
6409
|
}
|
|
@@ -6424,7 +6424,7 @@ class Ta {
|
|
|
6424
6424
|
return !0;
|
|
6425
6425
|
}
|
|
6426
6426
|
}
|
|
6427
|
-
class
|
|
6427
|
+
class Ra {
|
|
6428
6428
|
constructor() {
|
|
6429
6429
|
this._tiles = 0, this._lastsubencoding = 0, this._tileBuffer = new Uint8Array(256 * 4);
|
|
6430
6430
|
}
|
|
@@ -6436,32 +6436,32 @@ class Qa {
|
|
|
6436
6436
|
let o = r.rQpeek8();
|
|
6437
6437
|
if (o > 30)
|
|
6438
6438
|
throw new Error("Illegal hextile subencoding (subencoding: " + o + ")");
|
|
6439
|
-
const l = this._totalTiles - this._tiles, x = l % this._tilesX, f = Math.floor(l / this._tilesX), d = t + x * 16, k = e + f * 16,
|
|
6439
|
+
const l = this._totalTiles - this._tiles, x = l % this._tilesX, f = Math.floor(l / this._tilesX), d = t + x * 16, k = e + f * 16, E = Math.min(16, t + s - d), X = Math.min(16, e + n - k);
|
|
6440
6440
|
if (o & 1)
|
|
6441
|
-
c +=
|
|
6441
|
+
c += E * X * 4;
|
|
6442
6442
|
else if (o & 2 && (c += 4), o & 4 && (c += 4), o & 8) {
|
|
6443
6443
|
if (c++, r.rQwait("HEXTILE", c))
|
|
6444
6444
|
return !1;
|
|
6445
|
-
let
|
|
6446
|
-
o & 16 ? c +=
|
|
6445
|
+
let C = r.rQpeekBytes(c).at(-1);
|
|
6446
|
+
o & 16 ? c += C * 6 : c += C * 2;
|
|
6447
6447
|
}
|
|
6448
6448
|
if (r.rQwait("HEXTILE", c))
|
|
6449
6449
|
return !1;
|
|
6450
6450
|
if (r.rQshift8(), o === 0)
|
|
6451
|
-
this._lastsubencoding & 1 ? L(" Ignoring blank after RAW") : a.fillRect(d, k,
|
|
6451
|
+
this._lastsubencoding & 1 ? L(" Ignoring blank after RAW") : a.fillRect(d, k, E, X, this._background);
|
|
6452
6452
|
else if (o & 1) {
|
|
6453
|
-
let
|
|
6454
|
-
for (let A = 0; A <
|
|
6455
|
-
|
|
6456
|
-
a.blitImage(d, k,
|
|
6453
|
+
let C = E * X, M = r.rQshiftBytes(C * 4, !1);
|
|
6454
|
+
for (let A = 0; A < C; A++)
|
|
6455
|
+
M[A * 4 + 3] = 255;
|
|
6456
|
+
a.blitImage(d, k, E, X, M, 0);
|
|
6457
6457
|
} else {
|
|
6458
|
-
if (o & 2 && (this._background = new Uint8Array(r.rQshiftBytes(4))), o & 4 && (this._foreground = new Uint8Array(r.rQshiftBytes(4))), this._startTile(d, k,
|
|
6459
|
-
let
|
|
6460
|
-
for (let
|
|
6458
|
+
if (o & 2 && (this._background = new Uint8Array(r.rQshiftBytes(4))), o & 4 && (this._foreground = new Uint8Array(r.rQshiftBytes(4))), this._startTile(d, k, E, X, this._background), o & 8) {
|
|
6459
|
+
let C = r.rQshift8();
|
|
6460
|
+
for (let M = 0; M < C; M++) {
|
|
6461
6461
|
let A;
|
|
6462
6462
|
o & 16 ? A = r.rQshiftBytes(4) : A = this._foreground;
|
|
6463
|
-
const S = r.rQshift8(), F = S >> 4,
|
|
6464
|
-
this._subTile(F,
|
|
6463
|
+
const S = r.rQshift8(), F = S >> 4, N = S & 15, K = r.rQshift8(), I = (K >> 4) + 1, P = (K & 15) + 1;
|
|
6464
|
+
this._subTile(F, N, I, P, A);
|
|
6465
6465
|
}
|
|
6466
6466
|
}
|
|
6467
6467
|
this._finishTile(a);
|
|
@@ -6482,8 +6482,8 @@ class Qa {
|
|
|
6482
6482
|
const a = r[0], h = r[1], c = r[2], o = t + s, l = e + n, x = this._tileBuffer, f = this._tileW;
|
|
6483
6483
|
for (let d = e; d < l; d++)
|
|
6484
6484
|
for (let k = t; k < o; k++) {
|
|
6485
|
-
const
|
|
6486
|
-
x[
|
|
6485
|
+
const E = (k + d * f) * 4;
|
|
6486
|
+
x[E] = a, x[E + 1] = h, x[E + 2] = c, x[E + 3] = 255;
|
|
6487
6487
|
}
|
|
6488
6488
|
}
|
|
6489
6489
|
// draw the current tile to the screen
|
|
@@ -6498,9 +6498,9 @@ class Qa {
|
|
|
6498
6498
|
);
|
|
6499
6499
|
}
|
|
6500
6500
|
}
|
|
6501
|
-
class
|
|
6501
|
+
class Ba {
|
|
6502
6502
|
constructor() {
|
|
6503
|
-
this._zlib = new
|
|
6503
|
+
this._zlib = new Dt(), this._length = 0;
|
|
6504
6504
|
}
|
|
6505
6505
|
decodeRect(t, e, s, n, r, a, h) {
|
|
6506
6506
|
if (s === 0 || n === 0)
|
|
@@ -6519,11 +6519,11 @@ class La {
|
|
|
6519
6519
|
return a.blitImage(t, e, s, n, c, 0), !0;
|
|
6520
6520
|
}
|
|
6521
6521
|
}
|
|
6522
|
-
class
|
|
6522
|
+
class Xn {
|
|
6523
6523
|
constructor() {
|
|
6524
6524
|
this._ctl = null, this._filter = null, this._numColors = 0, this._palette = new Uint8Array(1024), this._len = 0, this._zlibs = [];
|
|
6525
6525
|
for (let t = 0; t < 4; t++)
|
|
6526
|
-
this._zlibs[t] = new
|
|
6526
|
+
this._zlibs[t] = new Dt();
|
|
6527
6527
|
}
|
|
6528
6528
|
decodeRect(t, e, s, n, r, a, h) {
|
|
6529
6529
|
if (this._ctl === null) {
|
|
@@ -6531,7 +6531,7 @@ class An {
|
|
|
6531
6531
|
return !1;
|
|
6532
6532
|
this._ctl = r.rQshift8();
|
|
6533
6533
|
for (let o = 0; o < 4; o++)
|
|
6534
|
-
this._ctl >> o & 1 && (this._zlibs[o].reset(),
|
|
6534
|
+
this._ctl >> o & 1 && (this._zlibs[o].reset(), ae("Reset zlib stream " + o));
|
|
6535
6535
|
this._ctl = this._ctl >> 4;
|
|
6536
6536
|
}
|
|
6537
6537
|
let c;
|
|
@@ -6692,10 +6692,10 @@ class An {
|
|
|
6692
6692
|
for (let x = 0; x < n; x++) {
|
|
6693
6693
|
let f, d, k;
|
|
6694
6694
|
for (k = 0; k < l; k++)
|
|
6695
|
-
for (let
|
|
6696
|
-
f = (x * s + k * 8 + 7 -
|
|
6697
|
-
for (let
|
|
6698
|
-
f = (x * s + k * 8 + 7 -
|
|
6695
|
+
for (let E = 7; E >= 0; E--)
|
|
6696
|
+
f = (x * s + k * 8 + 7 - E) * 4, d = (r[x * o + k] >> E & 1) * 3, c[f] = a[d], c[f + 1] = a[d + 1], c[f + 2] = a[d + 2], c[f + 3] = 255;
|
|
6697
|
+
for (let E = 7; E >= 8 - s % 8; E--)
|
|
6698
|
+
f = (x * s + k * 8 + 7 - E) * 4, d = (r[x * o + k] >> E & 1) * 3, c[f] = a[d], c[f + 1] = a[d + 1], c[f + 2] = a[d + 2], c[f + 3] = 255;
|
|
6699
6699
|
}
|
|
6700
6700
|
h.blitImage(t, e, s, n, c, 0, !1);
|
|
6701
6701
|
}
|
|
@@ -6722,25 +6722,25 @@ class An {
|
|
|
6722
6722
|
this._zlibs[t].setInput(l), l = this._zlibs[t].inflate(o), this._zlibs[t].setInput(null);
|
|
6723
6723
|
}
|
|
6724
6724
|
let x = new Uint8Array(4 * n * r), f = 0, d = 0, k = new Uint8Array(3);
|
|
6725
|
-
for (let
|
|
6725
|
+
for (let M = 0; M < n; M++) {
|
|
6726
6726
|
for (let A = 0; A < 3; A++) {
|
|
6727
6727
|
const S = k[A], F = l[d++] + S;
|
|
6728
6728
|
x[f++] = F, k[A] = F;
|
|
6729
6729
|
}
|
|
6730
6730
|
x[f++] = 255;
|
|
6731
6731
|
}
|
|
6732
|
-
let
|
|
6733
|
-
for (let
|
|
6734
|
-
k.fill(0),
|
|
6732
|
+
let E = 0, X = new Uint8Array(3), C = new Uint8Array(3);
|
|
6733
|
+
for (let M = 1; M < r; M++) {
|
|
6734
|
+
k.fill(0), C.fill(0);
|
|
6735
6735
|
for (let A = 0; A < n; A++) {
|
|
6736
6736
|
for (let S = 0; S < 3; S++) {
|
|
6737
|
-
X[S] = x[
|
|
6738
|
-
let F = k[S] + X[S] -
|
|
6737
|
+
X[S] = x[E++];
|
|
6738
|
+
let F = k[S] + X[S] - C[S];
|
|
6739
6739
|
F < 0 ? F = 0 : F > 255 && (F = 255);
|
|
6740
|
-
const
|
|
6741
|
-
x[f++] =
|
|
6740
|
+
const N = l[d++] + F;
|
|
6741
|
+
x[f++] = N, C[S] = X[S], k[S] = N;
|
|
6742
6742
|
}
|
|
6743
|
-
x[f++] = 255,
|
|
6743
|
+
x[f++] = 255, E++;
|
|
6744
6744
|
}
|
|
6745
6745
|
}
|
|
6746
6746
|
return h.blitImage(e, s, n, r, x, 0, !1), !0;
|
|
@@ -6761,7 +6761,7 @@ class An {
|
|
|
6761
6761
|
return (!this._scratchBuffer || this._scratchBuffer.length < t) && (this._scratchBuffer = new Uint8Array(t)), this._scratchBuffer;
|
|
6762
6762
|
}
|
|
6763
6763
|
}
|
|
6764
|
-
class
|
|
6764
|
+
class Da extends Xn {
|
|
6765
6765
|
_pngRect(t, e, s, n, r, a, h) {
|
|
6766
6766
|
let c = this._readData(r);
|
|
6767
6767
|
return c === null ? !1 : (a.imageRect(t, e, s, n, "image/png", c), !0);
|
|
@@ -6770,10 +6770,10 @@ class Ra extends An {
|
|
|
6770
6770
|
throw new Error("BasicCompression received in TightPNG rect");
|
|
6771
6771
|
}
|
|
6772
6772
|
}
|
|
6773
|
-
const
|
|
6774
|
-
class
|
|
6773
|
+
const yt = 64, kt = 64;
|
|
6774
|
+
class Ia {
|
|
6775
6775
|
constructor() {
|
|
6776
|
-
this._length = 0, this._inflator = new
|
|
6776
|
+
this._length = 0, this._inflator = new Dt(), this._pixelBuffer = new Uint8Array(yt * kt * 4), this._tileBuffer = new Uint8Array(yt * kt * 4);
|
|
6777
6777
|
}
|
|
6778
6778
|
decodeRect(t, e, s, n, r, a, h) {
|
|
6779
6779
|
if (this._length === 0) {
|
|
@@ -6785,26 +6785,26 @@ class Ba {
|
|
|
6785
6785
|
return !1;
|
|
6786
6786
|
const c = r.rQshiftBytes(this._length, !1);
|
|
6787
6787
|
this._inflator.setInput(c);
|
|
6788
|
-
for (let o = e; o < e + n; o +=
|
|
6789
|
-
let l = Math.min(
|
|
6790
|
-
for (let x = t; x < t + s; x +=
|
|
6791
|
-
let f = Math.min(
|
|
6788
|
+
for (let o = e; o < e + n; o += kt) {
|
|
6789
|
+
let l = Math.min(kt, e + n - o);
|
|
6790
|
+
for (let x = t; x < t + s; x += yt) {
|
|
6791
|
+
let f = Math.min(yt, t + s - x);
|
|
6792
6792
|
const d = f * l, k = this._inflator.inflate(1)[0];
|
|
6793
6793
|
if (k === 0) {
|
|
6794
|
-
const
|
|
6795
|
-
a.blitImage(x, o, f, l,
|
|
6794
|
+
const E = this._readPixels(d);
|
|
6795
|
+
a.blitImage(x, o, f, l, E, 0, !1);
|
|
6796
6796
|
} else if (k === 1) {
|
|
6797
|
-
const
|
|
6798
|
-
a.fillRect(x, o, f, l, [
|
|
6797
|
+
const E = this._readPixels(1);
|
|
6798
|
+
a.fillRect(x, o, f, l, [E[0], E[1], E[2]]);
|
|
6799
6799
|
} else if (k >= 2 && k <= 16) {
|
|
6800
|
-
const
|
|
6801
|
-
a.blitImage(x, o, f, l,
|
|
6800
|
+
const E = this._decodePaletteTile(k, d, f, l);
|
|
6801
|
+
a.blitImage(x, o, f, l, E, 0, !1);
|
|
6802
6802
|
} else if (k === 128) {
|
|
6803
|
-
const
|
|
6804
|
-
a.blitImage(x, o, f, l,
|
|
6803
|
+
const E = this._decodeRLETile(d);
|
|
6804
|
+
a.blitImage(x, o, f, l, E, 0, !1);
|
|
6805
6805
|
} else if (k >= 130 && k <= 255) {
|
|
6806
|
-
const
|
|
6807
|
-
a.blitImage(x, o, f, l,
|
|
6806
|
+
const E = this._decodeRLEPaletteTile(k - 128, d);
|
|
6807
|
+
a.blitImage(x, o, f, l, E, 0, !1);
|
|
6808
6808
|
} else
|
|
6809
6809
|
throw new Error("Unknown subencoding: " + k);
|
|
6810
6810
|
}
|
|
@@ -6872,7 +6872,7 @@ class Ba {
|
|
|
6872
6872
|
return t + 1;
|
|
6873
6873
|
}
|
|
6874
6874
|
}
|
|
6875
|
-
class
|
|
6875
|
+
class Pa {
|
|
6876
6876
|
constructor() {
|
|
6877
6877
|
this._cachedQuantTables = [], this._cachedHuffmanTables = [], this._segments = [];
|
|
6878
6878
|
}
|
|
@@ -6949,7 +6949,7 @@ class Da {
|
|
|
6949
6949
|
return a[0] = e, a[1] = s, a[2] = n >> 8, a[3] = n, a.set(t.rQshiftBytes(n - 2 + r, !1), 4), a;
|
|
6950
6950
|
}
|
|
6951
6951
|
}
|
|
6952
|
-
class
|
|
6952
|
+
class Ua {
|
|
6953
6953
|
constructor(t) {
|
|
6954
6954
|
this._data = t, this._index = 0, this.profileIdc = null, this.constraintSet = null, this.levelIdc = null;
|
|
6955
6955
|
}
|
|
@@ -6984,7 +6984,7 @@ class Ia {
|
|
|
6984
6984
|
case 8:
|
|
6985
6985
|
return {};
|
|
6986
6986
|
default:
|
|
6987
|
-
|
|
6987
|
+
oe("Unhandled unit type: ", s);
|
|
6988
6988
|
break;
|
|
6989
6989
|
}
|
|
6990
6990
|
return {};
|
|
@@ -7007,7 +7007,7 @@ class Ia {
|
|
|
7007
7007
|
};
|
|
7008
7008
|
}
|
|
7009
7009
|
}
|
|
7010
|
-
class
|
|
7010
|
+
class Na {
|
|
7011
7011
|
constructor(t, e) {
|
|
7012
7012
|
this.lastUsed = 0, this._width = t, this._height = e, this._profileIdc = null, this._constraintSet = null, this._levelIdc = null, this._decoder = null, this._pendingFrames = [];
|
|
7013
7013
|
}
|
|
@@ -7049,18 +7049,18 @@ class Pa {
|
|
|
7049
7049
|
}), this._pendingFrames.push(e), e;
|
|
7050
7050
|
}
|
|
7051
7051
|
decode(t) {
|
|
7052
|
-
let e = new
|
|
7052
|
+
let e = new Ua(t), s = null, n = Math.round(window.performance.now() * 1e3);
|
|
7053
7053
|
for (; ; ) {
|
|
7054
7054
|
let r = e.parse();
|
|
7055
7055
|
if (r === null)
|
|
7056
7056
|
break;
|
|
7057
7057
|
if (e.profileIdc !== null && (self._profileIdc = e.profileIdc, self._constraintSet = e.constraintSet, self._levelIdc = e.levelIdc), this._decoder === null || this._decoder.state !== "configured") {
|
|
7058
7058
|
if (!r.key) {
|
|
7059
|
-
|
|
7059
|
+
oe("Missing key frame. Can't decode until one arrives");
|
|
7060
7060
|
continue;
|
|
7061
7061
|
}
|
|
7062
7062
|
if (self._profileIdc === null) {
|
|
7063
|
-
|
|
7063
|
+
oe("Cannot config decoder. Have not received SPS and PPS yet.");
|
|
7064
7064
|
continue;
|
|
7065
7065
|
}
|
|
7066
7066
|
this._configureDecoder(
|
|
@@ -7078,13 +7078,13 @@ class Pa {
|
|
|
7078
7078
|
try {
|
|
7079
7079
|
this._decoder.decode(a);
|
|
7080
7080
|
} catch (h) {
|
|
7081
|
-
|
|
7081
|
+
oe("Failed to decode:", h);
|
|
7082
7082
|
}
|
|
7083
7083
|
}
|
|
7084
7084
|
return s !== null && (s.keep = !0), s;
|
|
7085
7085
|
}
|
|
7086
7086
|
}
|
|
7087
|
-
class
|
|
7087
|
+
class Ha {
|
|
7088
7088
|
constructor() {
|
|
7089
7089
|
this._tick = 0, this._contexts = {};
|
|
7090
7090
|
}
|
|
@@ -7102,7 +7102,7 @@ class Ua {
|
|
|
7102
7102
|
let h = this._findOldestContextId();
|
|
7103
7103
|
delete this._contexts[h];
|
|
7104
7104
|
}
|
|
7105
|
-
let a = new
|
|
7105
|
+
let a = new Na(s, n);
|
|
7106
7106
|
return this._contexts[this._contextId(t, e, s, n)] = a, a;
|
|
7107
7107
|
}
|
|
7108
7108
|
_getContext(t, e, s, n) {
|
|
@@ -7130,14 +7130,14 @@ class Ua {
|
|
|
7130
7130
|
return !0;
|
|
7131
7131
|
}
|
|
7132
7132
|
}
|
|
7133
|
-
const
|
|
7134
|
-
class
|
|
7133
|
+
const za = 3, Oa = "rgb(40, 40, 40)", Ds = 17, Is = 50, Ps = 19, Je = 75, ye = 50, Va = 1e3, Ga = 50, Us = 1, St = 2, Ns = 6, Hs = 16, ui = 19, zs = 22, Os = 30, Vs = 113, Gs = 129, Ws = 256, xe = 1, Zs = 1 << 24, Kt = 1 << 25, Ys = 1 << 26, et = 1 << 27, At = 1 << 28;
|
|
7134
|
+
class U extends nn {
|
|
7135
7135
|
constructor(t, e, s) {
|
|
7136
7136
|
if (!t)
|
|
7137
7137
|
throw new Error("Must specify target");
|
|
7138
7138
|
if (!e)
|
|
7139
7139
|
throw new Error("Must specify URL, WebSocket or RTCDataChannel");
|
|
7140
|
-
window.isSecureContext ||
|
|
7140
|
+
window.isSecureContext || Z("noVNC requires a secure context (TLS). Expect crashes!"), super(), this._target = t, typeof e == "string" ? this._url = e : (this._url = null, this._rawChannel = e), s = s || {}, this._rfbCredentials = s.credentials || {}, this._shared = "shared" in s ? !!s.shared : !0, this._repeaterID = s.repeaterID || "", this._wsProtocols = s.wsProtocols || [], this._rfbConnectionState = "", this._rfbInitState = "", this._rfbAuthScheme = -1, this._rfbCleanDisconnect = !0, this._rfbRSAAESAuthenticationState = null, this._rfbVersion = 0, this._rfbMaxVersion = 3.8, this._rfbTightVNC = !1, this._rfbVeNCryptState = 0, this._rfbXvpVer = 0, this._fbWidth = 0, this._fbHeight = 0, this._fbName = "", this._capabilities = { power: !1 }, this._supportsFence = !1, this._supportsContinuousUpdates = !1, this._enabledContinuousUpdates = !1, this._supportsSetDesktopSize = !1, this._screenID = 0, this._screenFlags = 0, this._pendingRemoteResize = !1, this._lastResize = 0, this._qemuExtKeyEventSupported = !1, this._extendedPointerEventSupported = !1, this._clipboardText = null, this._clipboardServerCapabilitiesActions = {}, this._clipboardServerCapabilitiesFormats = {}, this._sock = null, this._display = null, this._flushing = !1, this._keyboard = null, this._gestures = null, this._resizeObserver = null, this._disconnTimer = null, this._resizeTimeout = null, this._mouseMoveTimer = null, this._decoders = {}, this._FBU = {
|
|
7141
7141
|
rects: 0,
|
|
7142
7142
|
x: 0,
|
|
7143
7143
|
y: 0,
|
|
@@ -7152,13 +7152,13 @@ class I extends sn {
|
|
|
7152
7152
|
handleGesture: this._handleGesture.bind(this),
|
|
7153
7153
|
handleRSAAESCredentialsRequired: this._handleRSAAESCredentialsRequired.bind(this),
|
|
7154
7154
|
handleRSAAESServerVerification: this._handleRSAAESServerVerification.bind(this)
|
|
7155
|
-
}, L(">> RFB.constructor"), this._screen = document.createElement("div"), this._screen.style.display = "flex", this._screen.style.width = "100%", this._screen.style.height = "100%", this._screen.style.overflow = "auto", this._screen.style.background =
|
|
7155
|
+
}, L(">> RFB.constructor"), this._screen = document.createElement("div"), this._screen.style.display = "flex", this._screen.style.width = "100%", this._screen.style.height = "100%", this._screen.style.overflow = "auto", this._screen.style.background = Oa, this._canvas = document.createElement("canvas"), this._canvas.style.margin = "auto", this._canvas.style.outline = "none", this._canvas.width = 0, this._canvas.height = 0, this._canvas.tabIndex = -1, this._screen.appendChild(this._canvas), this._cursor = new wa(), this._cursorImage = U.cursors.none, this._decoders[R.encodingRaw] = new Ta(), this._decoders[R.encodingCopyRect] = new Qa(), this._decoders[R.encodingRRE] = new La(), this._decoders[R.encodingHextile] = new Ra(), this._decoders[R.encodingZlib] = new Ba(), this._decoders[R.encodingTight] = new Xn(), this._decoders[R.encodingTightPNG] = new Da(), this._decoders[R.encodingZRLE] = new Ia(), this._decoders[R.encodingJPEG] = new Pa(), this._decoders[R.encodingH264] = new Ha();
|
|
7156
7156
|
try {
|
|
7157
|
-
this._display = new
|
|
7157
|
+
this._display = new On(this._canvas);
|
|
7158
7158
|
} catch (n) {
|
|
7159
|
-
throw
|
|
7159
|
+
throw Z("Display exception: " + n), n;
|
|
7160
7160
|
}
|
|
7161
|
-
this._keyboard = new
|
|
7161
|
+
this._keyboard = new da(this._canvas), this._keyboard.onkeyevent = this._handleKeyEvent.bind(this), this._remoteCapsLock = null, this._remoteNumLock = null, this._gestures = new ba(), this._sock = new ma(), this._sock.on("open", this._socketOpen.bind(this)), this._sock.on("close", this._socketClose.bind(this)), this._sock.on("message", this._handleMessage.bind(this)), this._sock.on("error", this._socketError.bind(this)), this._expectedClientWidth = null, this._expectedClientHeight = null, this._resizeObserver = new ResizeObserver(this._eventHandlers.handleResize), this._updateConnectionState("connecting"), L("<< RFB.constructor"), this.dragViewport = !1, this.focusOnClick = !0, this._viewOnly = !1, this._clipViewport = !1, this._clippingViewport = !1, this._scaleViewport = !1, this._resizeSession = !1, this._showDotCursor = !1, this._qualityLevel = 6, this._compressionLevel = 2;
|
|
7162
7162
|
}
|
|
7163
7163
|
// ===== PROPERTIES =====
|
|
7164
7164
|
get viewOnly() {
|
|
@@ -7183,7 +7183,7 @@ class I extends sn {
|
|
|
7183
7183
|
return 0;
|
|
7184
7184
|
}
|
|
7185
7185
|
set touchButton(t) {
|
|
7186
|
-
|
|
7186
|
+
oe("Using old API!");
|
|
7187
7187
|
}
|
|
7188
7188
|
get clipViewport() {
|
|
7189
7189
|
return this._clipViewport;
|
|
@@ -7220,7 +7220,7 @@ class I extends sn {
|
|
|
7220
7220
|
}
|
|
7221
7221
|
set qualityLevel(t) {
|
|
7222
7222
|
if (!Number.isInteger(t) || t < 0 || t > 9) {
|
|
7223
|
-
|
|
7223
|
+
Z("qualityLevel must be an integer between 0 and 9");
|
|
7224
7224
|
return;
|
|
7225
7225
|
}
|
|
7226
7226
|
this._qualityLevel !== t && (this._qualityLevel = t, this._rfbConnectionState === "connected" && this._sendEncodings());
|
|
@@ -7230,7 +7230,7 @@ class I extends sn {
|
|
|
7230
7230
|
}
|
|
7231
7231
|
set compressionLevel(t) {
|
|
7232
7232
|
if (!Number.isInteger(t) || t < 0 || t > 9) {
|
|
7233
|
-
|
|
7233
|
+
Z("compressionLevel must be an integer between 0 and 9");
|
|
7234
7234
|
return;
|
|
7235
7235
|
}
|
|
7236
7236
|
this._compressionLevel !== t && (this._compressionLevel = t, this._rfbConnectionState === "connected" && this._sendEncodings());
|
|
@@ -7246,7 +7246,7 @@ class I extends sn {
|
|
|
7246
7246
|
this._rfbCredentials = t, this._resumeAuthentication();
|
|
7247
7247
|
}
|
|
7248
7248
|
sendCtrlAltDel() {
|
|
7249
|
-
this._rfbConnectionState !== "connected" || this._viewOnly || (
|
|
7249
|
+
this._rfbConnectionState !== "connected" || this._viewOnly || (ae("Sending Ctrl-Alt-Del"), this.sendKey(_.XK_Control_L, "ControlLeft", !0), this.sendKey(_.XK_Alt_L, "AltLeft", !0), this.sendKey(_.XK_Delete, "Delete", !0), this.sendKey(_.XK_Delete, "Delete", !1), this.sendKey(_.XK_Alt_L, "AltLeft", !1), this.sendKey(_.XK_Control_L, "ControlLeft", !1));
|
|
7250
7250
|
}
|
|
7251
7251
|
machineShutdown() {
|
|
7252
7252
|
this._xvpOp(1, 2);
|
|
@@ -7266,13 +7266,13 @@ class I extends sn {
|
|
|
7266
7266
|
this.sendKey(t, e, !0), this.sendKey(t, e, !1);
|
|
7267
7267
|
return;
|
|
7268
7268
|
}
|
|
7269
|
-
const n =
|
|
7269
|
+
const n = va[e];
|
|
7270
7270
|
if (this._qemuExtKeyEventSupported && n)
|
|
7271
|
-
t = t || 0,
|
|
7271
|
+
t = t || 0, ae("Sending key (" + (s ? "down" : "up") + "): keysym " + t + ", scancode " + n), U.messages.QEMUExtendedKeyEvent(this._sock, t, s, n);
|
|
7272
7272
|
else {
|
|
7273
7273
|
if (!t)
|
|
7274
7274
|
return;
|
|
7275
|
-
|
|
7275
|
+
ae("Sending keysym (" + (s ? "down" : "up") + "): " + t), U.messages.keyEvent(this._sock, t, s ? 1 : 0);
|
|
7276
7276
|
}
|
|
7277
7277
|
}
|
|
7278
7278
|
focus(t) {
|
|
@@ -7283,8 +7283,8 @@ class I extends sn {
|
|
|
7283
7283
|
}
|
|
7284
7284
|
clipboardPasteFrom(t) {
|
|
7285
7285
|
if (!(this._rfbConnectionState !== "connected" || this._viewOnly))
|
|
7286
|
-
if (this._clipboardServerCapabilitiesFormats[
|
|
7287
|
-
this._clipboardText = t,
|
|
7286
|
+
if (this._clipboardServerCapabilitiesFormats[xe] && this._clipboardServerCapabilitiesActions[et])
|
|
7287
|
+
this._clipboardText = t, U.messages.extendedClipboardNotify(this._sock, [xe]);
|
|
7288
7288
|
else {
|
|
7289
7289
|
let e, s, n;
|
|
7290
7290
|
e = 0;
|
|
@@ -7295,7 +7295,7 @@ class I extends sn {
|
|
|
7295
7295
|
let a = r.codePointAt(0);
|
|
7296
7296
|
a > 255 && (a = 63), n[s++] = a;
|
|
7297
7297
|
}
|
|
7298
|
-
|
|
7298
|
+
U.messages.clientCutText(this._sock, n);
|
|
7299
7299
|
}
|
|
7300
7300
|
}
|
|
7301
7301
|
getImageData() {
|
|
@@ -7310,9 +7310,9 @@ class I extends sn {
|
|
|
7310
7310
|
// ===== PRIVATE METHODS =====
|
|
7311
7311
|
_connect() {
|
|
7312
7312
|
if (L(">> RFB.connect"), this._url)
|
|
7313
|
-
|
|
7313
|
+
ae(`connecting to ${this._url}`), this._sock.open(this._url, this._wsProtocols);
|
|
7314
7314
|
else {
|
|
7315
|
-
if (
|
|
7315
|
+
if (ae(`attaching ${this._rawChannel} to Websock`), this._sock.attach(this._rawChannel), this._sock.readyState === "closed")
|
|
7316
7316
|
throw Error("Cannot use already closed WebSocket/RTCDataChannel");
|
|
7317
7317
|
this._sock.readyState === "open" && this._socketOpen();
|
|
7318
7318
|
}
|
|
@@ -7353,7 +7353,7 @@ class I extends sn {
|
|
|
7353
7353
|
this._sock.off("close"), this._rawChannel = null;
|
|
7354
7354
|
}
|
|
7355
7355
|
_socketError(t) {
|
|
7356
|
-
|
|
7356
|
+
oe("WebSocket on-error event");
|
|
7357
7357
|
}
|
|
7358
7358
|
_focusCanvas(t) {
|
|
7359
7359
|
this.focusOnClick && this.focus({ preventScroll: !0 });
|
|
@@ -7415,7 +7415,7 @@ class I extends sn {
|
|
|
7415
7415
|
}
|
|
7416
7416
|
this._resizeTimeout = null;
|
|
7417
7417
|
const t = this._screenSize();
|
|
7418
|
-
t.w === this._fbWidth && t.h === this._fbHeight || (this._pendingRemoteResize = !0, this._lastResize = Date.now(),
|
|
7418
|
+
t.w === this._fbWidth && t.h === this._fbHeight || (this._pendingRemoteResize = !0, this._lastResize = Date.now(), U.messages.setDesktopSize(
|
|
7419
7419
|
this._sock,
|
|
7420
7420
|
Math.floor(t.w),
|
|
7421
7421
|
Math.floor(t.h),
|
|
@@ -7446,36 +7446,36 @@ class I extends sn {
|
|
|
7446
7446
|
return;
|
|
7447
7447
|
}
|
|
7448
7448
|
if (e === "disconnected") {
|
|
7449
|
-
|
|
7449
|
+
Z("Tried changing state of a disconnected RFB object");
|
|
7450
7450
|
return;
|
|
7451
7451
|
}
|
|
7452
7452
|
switch (t) {
|
|
7453
7453
|
case "connected":
|
|
7454
7454
|
if (e !== "connecting") {
|
|
7455
|
-
|
|
7455
|
+
Z("Bad transition to connected state, previous connection state: " + e);
|
|
7456
7456
|
return;
|
|
7457
7457
|
}
|
|
7458
7458
|
break;
|
|
7459
7459
|
case "disconnected":
|
|
7460
7460
|
if (e !== "disconnecting") {
|
|
7461
|
-
|
|
7461
|
+
Z("Bad transition to disconnected state, previous connection state: " + e);
|
|
7462
7462
|
return;
|
|
7463
7463
|
}
|
|
7464
7464
|
break;
|
|
7465
7465
|
case "connecting":
|
|
7466
7466
|
if (e !== "") {
|
|
7467
|
-
|
|
7467
|
+
Z("Bad transition to connecting state, previous connection state: " + e);
|
|
7468
7468
|
return;
|
|
7469
7469
|
}
|
|
7470
7470
|
break;
|
|
7471
7471
|
case "disconnecting":
|
|
7472
7472
|
if (e !== "connected" && e !== "connecting") {
|
|
7473
|
-
|
|
7473
|
+
Z("Bad transition to disconnecting state, previous connection state: " + e);
|
|
7474
7474
|
return;
|
|
7475
7475
|
}
|
|
7476
7476
|
break;
|
|
7477
7477
|
default:
|
|
7478
|
-
|
|
7478
|
+
Z("Unknown connection state: " + t);
|
|
7479
7479
|
return;
|
|
7480
7480
|
}
|
|
7481
7481
|
switch (this._rfbConnectionState = t, L("New state '" + t + "', was '" + e + "'."), this._disconnTimer && t !== "disconnecting" && (L("Clearing disconnect timer"), clearTimeout(this._disconnTimer), this._disconnTimer = null, this._sock.off("close")), t) {
|
|
@@ -7487,8 +7487,8 @@ class I extends sn {
|
|
|
7487
7487
|
break;
|
|
7488
7488
|
case "disconnecting":
|
|
7489
7489
|
this._disconnect(), this._disconnTimer = setTimeout(() => {
|
|
7490
|
-
|
|
7491
|
-
},
|
|
7490
|
+
Z("Disconnection timed out."), this._updateConnectionState("disconnected");
|
|
7491
|
+
}, za * 1e3);
|
|
7492
7492
|
break;
|
|
7493
7493
|
case "disconnected":
|
|
7494
7494
|
this.dispatchEvent(new CustomEvent(
|
|
@@ -7506,16 +7506,16 @@ class I extends sn {
|
|
|
7506
7506
|
_fail(t) {
|
|
7507
7507
|
switch (this._rfbConnectionState) {
|
|
7508
7508
|
case "disconnecting":
|
|
7509
|
-
|
|
7509
|
+
Z("Failed when disconnecting: " + t);
|
|
7510
7510
|
break;
|
|
7511
7511
|
case "connected":
|
|
7512
|
-
|
|
7512
|
+
Z("Failed while connected: " + t);
|
|
7513
7513
|
break;
|
|
7514
7514
|
case "connecting":
|
|
7515
|
-
|
|
7515
|
+
Z("Failed when connecting: " + t);
|
|
7516
7516
|
break;
|
|
7517
7517
|
default:
|
|
7518
|
-
|
|
7518
|
+
Z("RFB failure: " + t);
|
|
7519
7519
|
break;
|
|
7520
7520
|
}
|
|
7521
7521
|
return this._rfbCleanDisconnect = !1, this._updateConnectionState("disconnecting"), this._updateConnectionState("disconnected"), !1;
|
|
@@ -7528,12 +7528,12 @@ class I extends sn {
|
|
|
7528
7528
|
}
|
|
7529
7529
|
_handleMessage() {
|
|
7530
7530
|
if (this._sock.rQwait("message", 1)) {
|
|
7531
|
-
|
|
7531
|
+
oe("handleMessage called on an empty receive queue");
|
|
7532
7532
|
return;
|
|
7533
7533
|
}
|
|
7534
7534
|
switch (this._rfbConnectionState) {
|
|
7535
7535
|
case "disconnected":
|
|
7536
|
-
|
|
7536
|
+
Z("Got data while disconnected");
|
|
7537
7537
|
break;
|
|
7538
7538
|
case "connected":
|
|
7539
7539
|
for (; !(this._flushing || !this._normalMsg() || this._sock.rQwait("message", 1)); )
|
|
@@ -7544,7 +7544,7 @@ class I extends sn {
|
|
|
7544
7544
|
;
|
|
7545
7545
|
break;
|
|
7546
7546
|
default:
|
|
7547
|
-
|
|
7547
|
+
Z("Got data while in an invalid state");
|
|
7548
7548
|
break;
|
|
7549
7549
|
}
|
|
7550
7550
|
}
|
|
@@ -7572,11 +7572,11 @@ class I extends sn {
|
|
|
7572
7572
|
_handleMouse(t) {
|
|
7573
7573
|
if (t.type === "click" && t.target !== this._canvas || (t.stopPropagation(), t.preventDefault(), t.type === "click" || t.type === "contextmenu"))
|
|
7574
7574
|
return;
|
|
7575
|
-
let e =
|
|
7575
|
+
let e = Ze(
|
|
7576
7576
|
t.clientX,
|
|
7577
7577
|
t.clientY,
|
|
7578
7578
|
this._canvas
|
|
7579
|
-
), s =
|
|
7579
|
+
), s = U._convertButtonMask(t.buttons), n = t.type == "mousedown";
|
|
7580
7580
|
switch (t.type) {
|
|
7581
7581
|
case "mousedown":
|
|
7582
7582
|
case "mouseup":
|
|
@@ -7591,12 +7591,12 @@ class I extends sn {
|
|
|
7591
7591
|
}
|
|
7592
7592
|
this._sendMouse(e.x, e.y, this._mouseButtonMask);
|
|
7593
7593
|
}
|
|
7594
|
-
n &&
|
|
7594
|
+
n && zn(this._canvas), this._handleMouseButton(e.x, e.y, s);
|
|
7595
7595
|
break;
|
|
7596
7596
|
case "mousemove":
|
|
7597
7597
|
if (this._viewportDragging) {
|
|
7598
7598
|
const r = this._viewportDragPos.x - e.x, a = this._viewportDragPos.y - e.y;
|
|
7599
|
-
(this._viewportHasMoved || Math.abs(r) >
|
|
7599
|
+
(this._viewportHasMoved || Math.abs(r) > ft || Math.abs(a) > ft) && (this._viewportHasMoved = !0, this._viewportDragPos = { x: e.x, y: e.y }, this._display.viewportChangePos(r, a));
|
|
7600
7600
|
break;
|
|
7601
7601
|
}
|
|
7602
7602
|
this._handleMouseMove(e.x, e.y);
|
|
@@ -7609,9 +7609,9 @@ class I extends sn {
|
|
|
7609
7609
|
_handleMouseMove(t, e) {
|
|
7610
7610
|
if (this._mousePos = { x: t, y: e }, this._mouseMoveTimer == null) {
|
|
7611
7611
|
const s = Date.now() - this._mouseLastMoveTime;
|
|
7612
|
-
s >
|
|
7612
|
+
s > Ds ? (this._sendMouse(t, e, this._mouseButtonMask), this._mouseLastMoveTime = Date.now()) : this._mouseMoveTimer = setTimeout(() => {
|
|
7613
7613
|
this._handleDelayedMouseMove();
|
|
7614
|
-
},
|
|
7614
|
+
}, Ds - s);
|
|
7615
7615
|
}
|
|
7616
7616
|
}
|
|
7617
7617
|
_handleDelayedMouseMove() {
|
|
@@ -7627,12 +7627,12 @@ class I extends sn {
|
|
|
7627
7627
|
if (s & 32768)
|
|
7628
7628
|
throw new Error("Illegal mouse button mask (mask: " + s + ")");
|
|
7629
7629
|
let n = s & 32640;
|
|
7630
|
-
this._extendedPointerEventSupported && n ?
|
|
7630
|
+
this._extendedPointerEventSupported && n ? U.messages.extendedPointerEvent(
|
|
7631
7631
|
this._sock,
|
|
7632
7632
|
this._display.absX(t),
|
|
7633
7633
|
this._display.absY(e),
|
|
7634
7634
|
s
|
|
7635
|
-
) :
|
|
7635
|
+
) : U.messages.pointerEvent(
|
|
7636
7636
|
this._sock,
|
|
7637
7637
|
this._display.absX(t),
|
|
7638
7638
|
this._display.absY(e),
|
|
@@ -7643,25 +7643,25 @@ class I extends sn {
|
|
|
7643
7643
|
if (this._rfbConnectionState !== "connected" || this._viewOnly)
|
|
7644
7644
|
return;
|
|
7645
7645
|
t.stopPropagation(), t.preventDefault();
|
|
7646
|
-
let e =
|
|
7646
|
+
let e = Ze(
|
|
7647
7647
|
t.clientX,
|
|
7648
7648
|
t.clientY,
|
|
7649
7649
|
this._canvas
|
|
7650
|
-
), s =
|
|
7651
|
-
t.deltaMode !== 0 && (n *=
|
|
7650
|
+
), s = U._convertButtonMask(t.buttons), n = t.deltaX, r = t.deltaY;
|
|
7651
|
+
t.deltaMode !== 0 && (n *= Ps, r *= Ps), this._accumulatedWheelDeltaX += n, this._accumulatedWheelDeltaY += r, Math.abs(this._accumulatedWheelDeltaX) >= Is && (this._accumulatedWheelDeltaX < 0 ? (this._handleMouseButton(e.x, e.y, s | 32), this._handleMouseButton(e.x, e.y, s)) : this._accumulatedWheelDeltaX > 0 && (this._handleMouseButton(e.x, e.y, s | 64), this._handleMouseButton(e.x, e.y, s)), this._accumulatedWheelDeltaX = 0), Math.abs(this._accumulatedWheelDeltaY) >= Is && (this._accumulatedWheelDeltaY < 0 ? (this._handleMouseButton(e.x, e.y, s | 8), this._handleMouseButton(e.x, e.y, s)) : this._accumulatedWheelDeltaY > 0 && (this._handleMouseButton(e.x, e.y, s | 16), this._handleMouseButton(e.x, e.y, s)), this._accumulatedWheelDeltaY = 0);
|
|
7652
7652
|
}
|
|
7653
7653
|
_fakeMouseMove(t, e, s) {
|
|
7654
7654
|
this._handleMouseMove(e, s), this._cursor.move(t.detail.clientX, t.detail.clientY);
|
|
7655
7655
|
}
|
|
7656
7656
|
_handleTapEvent(t, e) {
|
|
7657
|
-
let s =
|
|
7657
|
+
let s = Ze(
|
|
7658
7658
|
t.detail.clientX,
|
|
7659
7659
|
t.detail.clientY,
|
|
7660
7660
|
this._canvas
|
|
7661
7661
|
);
|
|
7662
|
-
if (this._gestureLastTapTime !== null && Date.now() - this._gestureLastTapTime <
|
|
7662
|
+
if (this._gestureLastTapTime !== null && Date.now() - this._gestureLastTapTime < Va && this._gestureFirstDoubleTapEv.detail.type === t.detail.type) {
|
|
7663
7663
|
let n = this._gestureFirstDoubleTapEv.detail.clientX - t.detail.clientX, r = this._gestureFirstDoubleTapEv.detail.clientY - t.detail.clientY;
|
|
7664
|
-
Math.hypot(n, r) <
|
|
7664
|
+
Math.hypot(n, r) < Ga ? s = Ze(
|
|
7665
7665
|
this._gestureFirstDoubleTapEv.detail.clientX,
|
|
7666
7666
|
this._gestureFirstDoubleTapEv.detail.clientY,
|
|
7667
7667
|
this._canvas
|
|
@@ -7671,7 +7671,7 @@ class I extends sn {
|
|
|
7671
7671
|
this._gestureLastTapTime = Date.now(), this._fakeMouseMove(this._gestureFirstDoubleTapEv, s.x, s.y), this._handleMouseButton(s.x, s.y, e), this._handleMouseButton(s.x, s.y, 0);
|
|
7672
7672
|
}
|
|
7673
7673
|
_handleGesture(t) {
|
|
7674
|
-
let e, s =
|
|
7674
|
+
let e, s = Ze(
|
|
7675
7675
|
t.detail.clientX,
|
|
7676
7676
|
t.detail.clientY,
|
|
7677
7677
|
this._canvas
|
|
@@ -7716,26 +7716,26 @@ class I extends sn {
|
|
|
7716
7716
|
if (this.dragViewport) {
|
|
7717
7717
|
this._viewportDragging = !0;
|
|
7718
7718
|
const n = this._viewportDragPos.x - s.x, r = this._viewportDragPos.y - s.y;
|
|
7719
|
-
(this._viewportHasMoved || Math.abs(n) >
|
|
7719
|
+
(this._viewportHasMoved || Math.abs(n) > ft || Math.abs(r) > ft) && (this._viewportHasMoved = !0, this._viewportDragPos = { x: s.x, y: s.y }, this._display.viewportChangePos(n, r));
|
|
7720
7720
|
} else
|
|
7721
7721
|
this._fakeMouseMove(t, s.x, s.y);
|
|
7722
7722
|
break;
|
|
7723
7723
|
case "twodrag":
|
|
7724
|
-
for (this._fakeMouseMove(t, s.x, s.y); t.detail.magnitudeY - this._gestureLastMagnitudeY >
|
|
7725
|
-
this._handleMouseButton(s.x, s.y, 8), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeY +=
|
|
7726
|
-
for (; t.detail.magnitudeY - this._gestureLastMagnitudeY < -
|
|
7727
|
-
this._handleMouseButton(s.x, s.y, 16), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeY -=
|
|
7728
|
-
for (; t.detail.magnitudeX - this._gestureLastMagnitudeX >
|
|
7729
|
-
this._handleMouseButton(s.x, s.y, 32), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeX +=
|
|
7730
|
-
for (; t.detail.magnitudeX - this._gestureLastMagnitudeX < -
|
|
7731
|
-
this._handleMouseButton(s.x, s.y, 64), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeX -=
|
|
7724
|
+
for (this._fakeMouseMove(t, s.x, s.y); t.detail.magnitudeY - this._gestureLastMagnitudeY > ye; )
|
|
7725
|
+
this._handleMouseButton(s.x, s.y, 8), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeY += ye;
|
|
7726
|
+
for (; t.detail.magnitudeY - this._gestureLastMagnitudeY < -ye; )
|
|
7727
|
+
this._handleMouseButton(s.x, s.y, 16), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeY -= ye;
|
|
7728
|
+
for (; t.detail.magnitudeX - this._gestureLastMagnitudeX > ye; )
|
|
7729
|
+
this._handleMouseButton(s.x, s.y, 32), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeX += ye;
|
|
7730
|
+
for (; t.detail.magnitudeX - this._gestureLastMagnitudeX < -ye; )
|
|
7731
|
+
this._handleMouseButton(s.x, s.y, 64), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeX -= ye;
|
|
7732
7732
|
break;
|
|
7733
7733
|
case "pinch":
|
|
7734
|
-
if (this._fakeMouseMove(t, s.x, s.y), e = Math.hypot(t.detail.magnitudeX, t.detail.magnitudeY), Math.abs(e - this._gestureLastMagnitudeX) >
|
|
7735
|
-
for (this._handleKeyEvent(_.XK_Control_L, "ControlLeft", !0); e - this._gestureLastMagnitudeX >
|
|
7736
|
-
this._handleMouseButton(s.x, s.y, 8), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeX +=
|
|
7737
|
-
for (; e - this._gestureLastMagnitudeX < -
|
|
7738
|
-
this._handleMouseButton(s.x, s.y, 16), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeX -=
|
|
7734
|
+
if (this._fakeMouseMove(t, s.x, s.y), e = Math.hypot(t.detail.magnitudeX, t.detail.magnitudeY), Math.abs(e - this._gestureLastMagnitudeX) > Je) {
|
|
7735
|
+
for (this._handleKeyEvent(_.XK_Control_L, "ControlLeft", !0); e - this._gestureLastMagnitudeX > Je; )
|
|
7736
|
+
this._handleMouseButton(s.x, s.y, 8), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeX += Je;
|
|
7737
|
+
for (; e - this._gestureLastMagnitudeX < -Je; )
|
|
7738
|
+
this._handleMouseButton(s.x, s.y, 16), this._handleMouseButton(s.x, s.y, 0), this._gestureLastMagnitudeX -= Je;
|
|
7739
7739
|
}
|
|
7740
7740
|
this._handleKeyEvent(_.XK_Control_L, "ControlLeft", !1);
|
|
7741
7741
|
break;
|
|
@@ -7769,7 +7769,7 @@ class I extends sn {
|
|
|
7769
7769
|
if (this._sock.rQwait("version", 12))
|
|
7770
7770
|
return !1;
|
|
7771
7771
|
const t = this._sock.rQshiftStr(12).substr(4, 7);
|
|
7772
|
-
|
|
7772
|
+
ae("Server ProtocolVersion: " + t);
|
|
7773
7773
|
let e = 0;
|
|
7774
7774
|
switch (t) {
|
|
7775
7775
|
case "000.000":
|
|
@@ -7808,15 +7808,15 @@ class I extends sn {
|
|
|
7808
7808
|
}
|
|
7809
7809
|
_isSupportedSecurityType(t) {
|
|
7810
7810
|
return [
|
|
7811
|
-
Ps,
|
|
7812
|
-
Ct,
|
|
7813
7811
|
Us,
|
|
7812
|
+
St,
|
|
7814
7813
|
Ns,
|
|
7815
|
-
ci,
|
|
7816
7814
|
Hs,
|
|
7815
|
+
ui,
|
|
7817
7816
|
zs,
|
|
7818
7817
|
Os,
|
|
7819
|
-
|
|
7818
|
+
Vs,
|
|
7819
|
+
Ws
|
|
7820
7820
|
].includes(t);
|
|
7821
7821
|
}
|
|
7822
7822
|
_negotiateSecurity() {
|
|
@@ -7870,7 +7870,7 @@ class I extends sn {
|
|
|
7870
7870
|
return this._rfbCredentials.username === void 0 || this._rfbCredentials.password === void 0 || this._rfbCredentials.target === void 0 ? (this.dispatchEvent(new CustomEvent(
|
|
7871
7871
|
"credentialsrequired",
|
|
7872
7872
|
{ detail: { types: ["username", "password", "target"] } }
|
|
7873
|
-
)), !1) : (this._sock.sQpush8(this._rfbCredentials.username.length), this._sock.sQpush8(this._rfbCredentials.target.length), this._sock.sQpushString(this._rfbCredentials.username), this._sock.sQpushString(this._rfbCredentials.target), this._sock.flush(), this._rfbAuthScheme =
|
|
7873
|
+
)), !1) : (this._sock.sQpush8(this._rfbCredentials.username.length), this._sock.sQpush8(this._rfbCredentials.target.length), this._sock.sQpushString(this._rfbCredentials.username), this._sock.sQpushString(this._rfbCredentials.target), this._sock.flush(), this._rfbAuthScheme = St, this._negotiateAuthentication());
|
|
7874
7874
|
}
|
|
7875
7875
|
// VeNCrypt authentication, currently only supports version 0.2 and only Plain subtype
|
|
7876
7876
|
_negotiateVeNCryptAuth() {
|
|
@@ -7906,7 +7906,7 @@ class I extends sn {
|
|
|
7906
7906
|
t.push(this._sock.rQshift32());
|
|
7907
7907
|
this._rfbAuthScheme = -1;
|
|
7908
7908
|
for (let e of t)
|
|
7909
|
-
if (e !==
|
|
7909
|
+
if (e !== ui && this._isSupportedSecurityType(e)) {
|
|
7910
7910
|
this._rfbAuthScheme = e;
|
|
7911
7911
|
break;
|
|
7912
7912
|
}
|
|
@@ -7919,7 +7919,7 @@ class I extends sn {
|
|
|
7919
7919
|
"credentialsrequired",
|
|
7920
7920
|
{ detail: { types: ["username", "password"] } }
|
|
7921
7921
|
)), !1;
|
|
7922
|
-
const t =
|
|
7922
|
+
const t = be(this._rfbCredentials.username), e = be(this._rfbCredentials.password);
|
|
7923
7923
|
return this._sock.sQpush32(t.length), this._sock.sQpush32(e.length), this._sock.sQpushString(t), this._sock.sQpushString(e), this._sock.flush(), this._rfbInitState = "SecurityResult", !0;
|
|
7924
7924
|
}
|
|
7925
7925
|
_negotiateStdVNCAuth() {
|
|
@@ -7930,7 +7930,7 @@ class I extends sn {
|
|
|
7930
7930
|
"credentialsrequired",
|
|
7931
7931
|
{ detail: { types: ["password"] } }
|
|
7932
7932
|
)), !1;
|
|
7933
|
-
const t = Array.prototype.slice.call(this._sock.rQshiftBytes(16)), e =
|
|
7933
|
+
const t = Array.prototype.slice.call(this._sock.rQshiftBytes(16)), e = U.genDES(this._rfbCredentials.password, t);
|
|
7934
7934
|
return this._sock.sQpushBytes(e), this._sock.flush(), this._rfbInitState = "SecurityResult", !0;
|
|
7935
7935
|
}
|
|
7936
7936
|
_negotiateARDAuth() {
|
|
@@ -7946,7 +7946,7 @@ class I extends sn {
|
|
|
7946
7946
|
let t = this._sock.rQshiftBytes(2), e = this._sock.rQshift16();
|
|
7947
7947
|
if (this._sock.rQwait("read ard keylength", e * 2, 4))
|
|
7948
7948
|
return !1;
|
|
7949
|
-
let s = this._sock.rQshiftBytes(e), n = this._sock.rQshiftBytes(e), r =
|
|
7949
|
+
let s = this._sock.rQshiftBytes(e), n = this._sock.rQshiftBytes(e), r = Y.generateKey(
|
|
7950
7950
|
{ name: "DH", g: t, p: s },
|
|
7951
7951
|
!1,
|
|
7952
7952
|
["deriveBits"]
|
|
@@ -7954,24 +7954,24 @@ class I extends sn {
|
|
|
7954
7954
|
return this._negotiateARDAuthAsync(e, n, r), !1;
|
|
7955
7955
|
}
|
|
7956
7956
|
async _negotiateARDAuthAsync(t, e, s) {
|
|
7957
|
-
const n =
|
|
7957
|
+
const n = Y.exportKey("raw", s.publicKey), r = Y.deriveBits(
|
|
7958
7958
|
{ name: "DH", public: e },
|
|
7959
7959
|
s.privateKey,
|
|
7960
7960
|
t * 8
|
|
7961
|
-
), a =
|
|
7961
|
+
), a = be(this._rfbCredentials.username).substring(0, 63), h = be(this._rfbCredentials.password).substring(0, 63), c = window.crypto.getRandomValues(new Uint8Array(128));
|
|
7962
7962
|
for (let f = 0; f < a.length; f++)
|
|
7963
7963
|
c[f] = a.charCodeAt(f);
|
|
7964
7964
|
c[a.length] = 0;
|
|
7965
7965
|
for (let f = 0; f < h.length; f++)
|
|
7966
7966
|
c[64 + f] = h.charCodeAt(f);
|
|
7967
7967
|
c[64 + h.length] = 0;
|
|
7968
|
-
const o = await
|
|
7968
|
+
const o = await Y.digest("MD5", r), l = await Y.importKey(
|
|
7969
7969
|
"raw",
|
|
7970
7970
|
o,
|
|
7971
7971
|
{ name: "AES-ECB" },
|
|
7972
7972
|
!1,
|
|
7973
7973
|
["encrypt"]
|
|
7974
|
-
), x = await
|
|
7974
|
+
), x = await Y.encrypt({ name: "AES-ECB" }, l, c);
|
|
7975
7975
|
this._rfbCredentials.ardCredentials = x, this._rfbCredentials.ardPublicKey = n, this._resumeAuthentication();
|
|
7976
7976
|
}
|
|
7977
7977
|
_negotiateTightUnixAuth() {
|
|
@@ -8024,9 +8024,9 @@ class I extends sn {
|
|
|
8024
8024
|
case "STDVNOAUTH__":
|
|
8025
8025
|
return this._rfbInitState = "SecurityResult", !0;
|
|
8026
8026
|
case "STDVVNCAUTH_":
|
|
8027
|
-
return this._rfbAuthScheme =
|
|
8027
|
+
return this._rfbAuthScheme = St, !0;
|
|
8028
8028
|
case "TGHTULGNAUTH":
|
|
8029
|
-
return this._rfbAuthScheme =
|
|
8029
|
+
return this._rfbAuthScheme = Gs, !0;
|
|
8030
8030
|
default:
|
|
8031
8031
|
return this._fail("Unsupported tiny auth scheme (scheme: " + n + ")");
|
|
8032
8032
|
}
|
|
@@ -8039,7 +8039,7 @@ class I extends sn {
|
|
|
8039
8039
|
this.dispatchEvent(t);
|
|
8040
8040
|
}
|
|
8041
8041
|
_negotiateRA2neAuth() {
|
|
8042
|
-
return this._rfbRSAAESAuthenticationState === null && (this._rfbRSAAESAuthenticationState = new
|
|
8042
|
+
return this._rfbRSAAESAuthenticationState === null && (this._rfbRSAAESAuthenticationState = new Ma(this._sock, () => this._rfbCredentials), this._rfbRSAAESAuthenticationState.addEventListener(
|
|
8043
8043
|
"serververification",
|
|
8044
8044
|
this._eventHandlers.handleRSAAESServerVerification
|
|
8045
8045
|
), this._rfbRSAAESAuthenticationState.addEventListener(
|
|
@@ -8065,7 +8065,7 @@ class I extends sn {
|
|
|
8065
8065
|
"credentialsrequired",
|
|
8066
8066
|
{ detail: { types: ["username", "password"] } }
|
|
8067
8067
|
)), !1;
|
|
8068
|
-
const t = this._sock.rQshiftBytes(8), e = this._sock.rQshiftBytes(8), s = this._sock.rQshiftBytes(8), n =
|
|
8068
|
+
const t = this._sock.rQshiftBytes(8), e = this._sock.rQshiftBytes(8), s = this._sock.rQshiftBytes(8), n = Y.generateKey({ name: "DH", g: t, p: e }, !0, ["deriveBits"]), r = Y.exportKey("raw", n.publicKey), a = Y.deriveBits({ name: "DH", public: s }, n.privateKey, 64), h = Y.importKey("raw", a, { name: "DES-CBC" }, !1, ["encrypt"]), c = be(this._rfbCredentials.username).substring(0, 255), o = be(this._rfbCredentials.password).substring(0, 63);
|
|
8069
8069
|
let l = new Uint8Array(256), x = new Uint8Array(64);
|
|
8070
8070
|
window.crypto.getRandomValues(l), window.crypto.getRandomValues(x);
|
|
8071
8071
|
for (let f = 0; f < c.length; f++)
|
|
@@ -8073,29 +8073,29 @@ class I extends sn {
|
|
|
8073
8073
|
l[c.length] = 0;
|
|
8074
8074
|
for (let f = 0; f < o.length; f++)
|
|
8075
8075
|
x[f] = o.charCodeAt(f);
|
|
8076
|
-
return x[o.length] = 0, l =
|
|
8076
|
+
return x[o.length] = 0, l = Y.encrypt({ name: "DES-CBC", iv: a }, h, l), x = Y.encrypt({ name: "DES-CBC", iv: a }, h, x), this._sock.sQpushBytes(r), this._sock.sQpushBytes(l), this._sock.sQpushBytes(x), this._sock.flush(), this._rfbInitState = "SecurityResult", !0;
|
|
8077
8077
|
}
|
|
8078
8078
|
_negotiateAuthentication() {
|
|
8079
8079
|
switch (this._rfbAuthScheme) {
|
|
8080
|
-
case
|
|
8080
|
+
case Us:
|
|
8081
8081
|
return this._rfbVersion >= 3.8 ? this._rfbInitState = "SecurityResult" : this._rfbInitState = "ClientInitialisation", !0;
|
|
8082
|
-
case Hs:
|
|
8083
|
-
return this._negotiateXvpAuth();
|
|
8084
8082
|
case zs:
|
|
8083
|
+
return this._negotiateXvpAuth();
|
|
8084
|
+
case Os:
|
|
8085
8085
|
return this._negotiateARDAuth();
|
|
8086
|
-
case
|
|
8086
|
+
case St:
|
|
8087
8087
|
return this._negotiateStdVNCAuth();
|
|
8088
|
-
case
|
|
8088
|
+
case Hs:
|
|
8089
8089
|
return this._negotiateTightAuth();
|
|
8090
|
-
case
|
|
8090
|
+
case ui:
|
|
8091
8091
|
return this._negotiateVeNCryptAuth();
|
|
8092
|
-
case
|
|
8092
|
+
case Ws:
|
|
8093
8093
|
return this._negotiatePlainAuth();
|
|
8094
|
-
case
|
|
8094
|
+
case Gs:
|
|
8095
8095
|
return this._negotiateTightUnixAuth();
|
|
8096
|
-
case
|
|
8096
|
+
case Ns:
|
|
8097
8097
|
return this._negotiateRA2neAuth();
|
|
8098
|
-
case
|
|
8098
|
+
case Vs:
|
|
8099
8099
|
return this._negotiateMSLogonIIAuth();
|
|
8100
8100
|
default:
|
|
8101
8101
|
return this._fail("Unsupported auth scheme (scheme: " + this._rfbAuthScheme + ")");
|
|
@@ -8119,21 +8119,21 @@ class I extends sn {
|
|
|
8119
8119
|
if (this._sock.rQwait("server init name", d, 24))
|
|
8120
8120
|
return !1;
|
|
8121
8121
|
let k = this._sock.rQshiftStr(d);
|
|
8122
|
-
if (k =
|
|
8122
|
+
if (k = Ot(k, !0), this._rfbTightVNC) {
|
|
8123
8123
|
if (this._sock.rQwait("TightVNC extended server init header", 8, 24 + d))
|
|
8124
8124
|
return !1;
|
|
8125
|
-
const
|
|
8125
|
+
const E = this._sock.rQshift16(), X = this._sock.rQshift16(), C = this._sock.rQshift16();
|
|
8126
8126
|
this._sock.rQskipBytes(2);
|
|
8127
|
-
const
|
|
8128
|
-
if (this._sock.rQwait("TightVNC extended server init header",
|
|
8127
|
+
const M = (E + X + C) * 16;
|
|
8128
|
+
if (this._sock.rQwait("TightVNC extended server init header", M, 32 + d))
|
|
8129
8129
|
return !1;
|
|
8130
|
-
this._sock.rQskipBytes(16 *
|
|
8130
|
+
this._sock.rQskipBytes(16 * E), this._sock.rQskipBytes(16 * X), this._sock.rQskipBytes(16 * C);
|
|
8131
8131
|
}
|
|
8132
|
-
return
|
|
8132
|
+
return ae("Screen: " + t + "x" + e + ", bpp: " + s + ", depth: " + n + ", bigEndian: " + r + ", trueColor: " + a + ", redMax: " + h + ", greenMax: " + c + ", blueMax: " + o + ", redShift: " + l + ", greenShift: " + x + ", blueShift: " + f), this._setDesktopName(k), this._resize(t, e), this._viewOnly || this._keyboard.grab(), this._fbDepth = 24, this._fbName === "Intel(r) AMT KVM" && (oe("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."), this._fbDepth = 8), U.messages.pixelFormat(this._sock, this._fbDepth, !0), this._sendEncodings(), U.messages.fbUpdateRequest(this._sock, !1, 0, 0, this._fbWidth, this._fbHeight), this._updateConnectionState("connected"), !0;
|
|
8133
8133
|
}
|
|
8134
8134
|
_sendEncodings() {
|
|
8135
8135
|
const t = [];
|
|
8136
|
-
t.push(R.encodingCopyRect), this._fbDepth == 24 && (
|
|
8136
|
+
t.push(R.encodingCopyRect), this._fbDepth == 24 && (Js && t.push(R.encodingH264), t.push(R.encodingTight), t.push(R.encodingTightPNG), t.push(R.encodingZRLE), t.push(R.encodingJPEG), t.push(R.encodingHextile), t.push(R.encodingRRE), t.push(R.encodingZlib)), t.push(R.encodingRaw), t.push(R.pseudoEncodingQualityLevel0 + this._qualityLevel), t.push(R.pseudoEncodingCompressLevel0 + this._compressionLevel), t.push(R.pseudoEncodingDesktopSize), t.push(R.pseudoEncodingLastRect), t.push(R.pseudoEncodingQEMUExtendedKeyEvent), t.push(R.pseudoEncodingQEMULedEvent), t.push(R.pseudoEncodingExtendedDesktopSize), t.push(R.pseudoEncodingXvp), t.push(R.pseudoEncodingFence), t.push(R.pseudoEncodingContinuousUpdates), t.push(R.pseudoEncodingDesktopName), t.push(R.pseudoEncodingExtendedClipboard), t.push(R.pseudoEncodingExtendedMouseButtons), this._fbDepth == 24 && (t.push(R.pseudoEncodingVMwareCursor), t.push(R.pseudoEncodingCursor)), U.messages.clientEncodings(this._sock, t);
|
|
8137
8137
|
}
|
|
8138
8138
|
/* RFB protocol initialization states:
|
|
8139
8139
|
* ProtocolVersion
|
|
@@ -8176,7 +8176,7 @@ class I extends sn {
|
|
|
8176
8176
|
return !1;
|
|
8177
8177
|
this._sock.rQskipBytes(3);
|
|
8178
8178
|
let t = this._sock.rQshift32();
|
|
8179
|
-
if (t =
|
|
8179
|
+
if (t = _i(t), this._sock.rQwait("ServerCutText content", Math.abs(t), 8))
|
|
8180
8180
|
return !1;
|
|
8181
8181
|
if (t >= 0) {
|
|
8182
8182
|
const e = this._sock.rQshiftStr(t);
|
|
@@ -8190,7 +8190,7 @@ class I extends sn {
|
|
|
8190
8190
|
t = Math.abs(t);
|
|
8191
8191
|
const e = this._sock.rQshift32();
|
|
8192
8192
|
let s = e & 65535, n = e & 4278190080;
|
|
8193
|
-
if (!!(n &
|
|
8193
|
+
if (!!(n & Zs)) {
|
|
8194
8194
|
this._clipboardServerCapabilitiesFormats = {}, this._clipboardServerCapabilitiesActions = {};
|
|
8195
8195
|
for (let h = 0; h <= 15; h++) {
|
|
8196
8196
|
let c = 1 << h;
|
|
@@ -8201,30 +8201,30 @@ class I extends sn {
|
|
|
8201
8201
|
this._clipboardServerCapabilitiesActions[c] = !!(n & c);
|
|
8202
8202
|
}
|
|
8203
8203
|
let a = [
|
|
8204
|
-
Ws,
|
|
8205
|
-
At,
|
|
8206
8204
|
Zs,
|
|
8207
|
-
|
|
8208
|
-
|
|
8205
|
+
Kt,
|
|
8206
|
+
Ys,
|
|
8207
|
+
et,
|
|
8208
|
+
At
|
|
8209
8209
|
];
|
|
8210
|
-
|
|
8211
|
-
} else if (n ===
|
|
8210
|
+
U.messages.extendedClipboardCaps(this._sock, a, { extendedClipboardFormatText: 0 });
|
|
8211
|
+
} else if (n === Kt) {
|
|
8212
8212
|
if (this._viewOnly)
|
|
8213
8213
|
return !0;
|
|
8214
|
-
this._clipboardText != null && this._clipboardServerCapabilitiesActions[
|
|
8215
|
-
} else if (n ===
|
|
8214
|
+
this._clipboardText != null && this._clipboardServerCapabilitiesActions[At] && s & xe && U.messages.extendedClipboardProvide(this._sock, [xe], [this._clipboardText]);
|
|
8215
|
+
} else if (n === Ys) {
|
|
8216
8216
|
if (this._viewOnly)
|
|
8217
8217
|
return !0;
|
|
8218
|
-
this._clipboardServerCapabilitiesActions[
|
|
8219
|
-
} else if (n ===
|
|
8218
|
+
this._clipboardServerCapabilitiesActions[et] && (this._clipboardText != null ? U.messages.extendedClipboardNotify(this._sock, [xe]) : U.messages.extendedClipboardNotify(this._sock, []));
|
|
8219
|
+
} else if (n === et) {
|
|
8220
8220
|
if (this._viewOnly)
|
|
8221
8221
|
return !0;
|
|
8222
|
-
this._clipboardServerCapabilitiesActions[
|
|
8223
|
-
} else if (n ===
|
|
8224
|
-
if (this._viewOnly || !(s &
|
|
8222
|
+
this._clipboardServerCapabilitiesActions[Kt] && s & xe && U.messages.extendedClipboardRequest(this._sock, [xe]);
|
|
8223
|
+
} else if (n === At) {
|
|
8224
|
+
if (this._viewOnly || !(s & xe))
|
|
8225
8225
|
return !0;
|
|
8226
8226
|
this._clipboardText = null;
|
|
8227
|
-
let a = this._sock.rQshiftBytes(t - 4), h = new
|
|
8227
|
+
let a = this._sock.rQshiftBytes(t - 4), h = new Dt(), c = null;
|
|
8228
8228
|
h.setInput(a);
|
|
8229
8229
|
for (let o = 0; o <= 15; o++) {
|
|
8230
8230
|
let l = 1 << o;
|
|
@@ -8232,14 +8232,14 @@ class I extends sn {
|
|
|
8232
8232
|
let x = 0, f = h.inflate(4);
|
|
8233
8233
|
x |= f[0] << 24, x |= f[1] << 16, x |= f[2] << 8, x |= f[3];
|
|
8234
8234
|
let d = h.inflate(x);
|
|
8235
|
-
l ===
|
|
8235
|
+
l === xe && (c = d);
|
|
8236
8236
|
}
|
|
8237
8237
|
}
|
|
8238
8238
|
if (h.setInput(null), c !== null) {
|
|
8239
8239
|
let o = "";
|
|
8240
8240
|
for (let l = 0; l < c.length; l++)
|
|
8241
8241
|
o += String.fromCharCode(c[l]);
|
|
8242
|
-
c = o, c =
|
|
8242
|
+
c = o, c = Ot(c), c.length > 0 && c.charAt(c.length - 1) === "\0" && (c = c.slice(0, -1)), c = c.replaceAll(`\r
|
|
8243
8243
|
`, `
|
|
8244
8244
|
`), this.dispatchEvent(new CustomEvent(
|
|
8245
8245
|
"clipboard",
|
|
@@ -8258,9 +8258,9 @@ class I extends sn {
|
|
|
8258
8258
|
let t = this._sock.rQshift32(), e = this._sock.rQshift8();
|
|
8259
8259
|
if (this._sock.rQwait("ServerFence payload", e, 9))
|
|
8260
8260
|
return !1;
|
|
8261
|
-
e > 64 && (
|
|
8261
|
+
e > 64 && (oe("Bad payload length (" + e + ") in fence response"), e = 64);
|
|
8262
8262
|
const s = this._sock.rQshiftStr(e);
|
|
8263
|
-
return this._supportsFence = !0, t & 1 << 31 ? (t &= 3,
|
|
8263
|
+
return this._supportsFence = !0, t & 1 << 31 ? (t &= 3, U.messages.clientFence(this._sock, t, s), !0) : this._fail("Unexpected fence response");
|
|
8264
8264
|
}
|
|
8265
8265
|
_handleXvpMsg() {
|
|
8266
8266
|
if (this._sock.rQwait("XVP version and message", 3, 1))
|
|
@@ -8269,10 +8269,10 @@ class I extends sn {
|
|
|
8269
8269
|
const t = this._sock.rQshift8(), e = this._sock.rQshift8();
|
|
8270
8270
|
switch (e) {
|
|
8271
8271
|
case 0:
|
|
8272
|
-
|
|
8272
|
+
Z("XVP operation failed");
|
|
8273
8273
|
break;
|
|
8274
8274
|
case 1:
|
|
8275
|
-
this._rfbXvpVer = t,
|
|
8275
|
+
this._rfbXvpVer = t, ae("XVP extensions enabled (version " + this._rfbXvpVer + ")"), this._setCapability("power", !0);
|
|
8276
8276
|
break;
|
|
8277
8277
|
default:
|
|
8278
8278
|
this._fail("Illegal server XVP message (msg: " + e + ")");
|
|
@@ -8286,7 +8286,7 @@ class I extends sn {
|
|
|
8286
8286
|
let e, s;
|
|
8287
8287
|
switch (t) {
|
|
8288
8288
|
case 0:
|
|
8289
|
-
return s = this._framebufferUpdate(), s && !this._enabledContinuousUpdates &&
|
|
8289
|
+
return s = this._framebufferUpdate(), s && !this._enabledContinuousUpdates && U.messages.fbUpdateRequest(
|
|
8290
8290
|
this._sock,
|
|
8291
8291
|
!0,
|
|
8292
8292
|
0,
|
|
@@ -8304,7 +8304,7 @@ class I extends sn {
|
|
|
8304
8304
|
case 3:
|
|
8305
8305
|
return this._handleServerCutText();
|
|
8306
8306
|
case 150:
|
|
8307
|
-
return e = !this._supportsContinuousUpdates, this._supportsContinuousUpdates = !0, this._enabledContinuousUpdates = !1, e && (this._enabledContinuousUpdates = !0, this._updateContinuousUpdates(),
|
|
8307
|
+
return e = !this._supportsContinuousUpdates, this._supportsContinuousUpdates = !0, this._enabledContinuousUpdates = !1, e && (this._enabledContinuousUpdates = !0, this._updateContinuousUpdates(), ae("Enabling continuous updates.")), !0;
|
|
8308
8308
|
case 248:
|
|
8309
8309
|
return this._handleServerFenceMsg();
|
|
8310
8310
|
case 250:
|
|
@@ -8381,8 +8381,8 @@ class I extends sn {
|
|
|
8381
8381
|
l[x] = this._sock.rQshift32();
|
|
8382
8382
|
for (let x = 0; x < s * n; x++)
|
|
8383
8383
|
if (o[x] == 0) {
|
|
8384
|
-
let f = l[x], d = f >> 8 & 255, k = f >> 16 & 255,
|
|
8385
|
-
a[x * h] = d, a[x * h + 1] = k, a[x * h + 2] =
|
|
8384
|
+
let f = l[x], d = f >> 8 & 255, k = f >> 16 & 255, E = f >> 24 & 255;
|
|
8385
|
+
a[x * h] = d, a[x * h + 1] = k, a[x * h + 2] = E, a[x * h + 3] = 255;
|
|
8386
8386
|
} else (o[x] & -256) == -256 ? l[x] == 0 ? (a[x * h] = 0, a[x * h + 1] = 0, a[x * h + 2] = 0, a[x * h + 3] = 0) : (l[x] & -256, a[x * h] = 0, a[x * h + 1] = 0, a[x * h + 2] = 0, a[x * h + 3] = 255) : (a[x * h] = 0, a[x * h + 1] = 0, a[x * h + 2] = 0, a[x * h + 3] = 255);
|
|
8387
8387
|
} else if (r == 1) {
|
|
8388
8388
|
if (this._sock.rQwait(
|
|
@@ -8397,7 +8397,7 @@ class I extends sn {
|
|
|
8397
8397
|
a[c * 4] = o >> 24 & 255, a[c * 4 + 1] = o >> 16 & 255, a[c * 4 + 2] = o >> 8 & 255, a[c * 4 + 3] = o & 255;
|
|
8398
8398
|
}
|
|
8399
8399
|
} else
|
|
8400
|
-
return
|
|
8400
|
+
return oe("The given cursor type is not supported: " + r + " given."), !1;
|
|
8401
8401
|
return this._updateCursor(a, t, e, s, n), !0;
|
|
8402
8402
|
}
|
|
8403
8403
|
_handleCursor() {
|
|
@@ -8409,8 +8409,8 @@ class I extends sn {
|
|
|
8409
8409
|
let l = new Uint8Array(s * n * 4), x = 0;
|
|
8410
8410
|
for (let f = 0; f < n; f++)
|
|
8411
8411
|
for (let d = 0; d < s; d++) {
|
|
8412
|
-
let k = f * Math.ceil(s / 8) + Math.floor(d / 8),
|
|
8413
|
-
l[x] = c[x + 2], l[x + 1] = c[x + 1], l[x + 2] = c[x], l[x + 3] =
|
|
8412
|
+
let k = f * Math.ceil(s / 8) + Math.floor(d / 8), E = o[k] << d % 8 & 128 ? 255 : 0;
|
|
8413
|
+
l[x] = c[x + 2], l[x + 1] = c[x + 1], l[x + 2] = c[x], l[x + 3] = E, x += 4;
|
|
8414
8414
|
}
|
|
8415
8415
|
return this._updateCursor(l, t, e, s, n), !0;
|
|
8416
8416
|
}
|
|
@@ -8421,7 +8421,7 @@ class I extends sn {
|
|
|
8421
8421
|
if (this._sock.rQwait("DesktopName", t, 4))
|
|
8422
8422
|
return !1;
|
|
8423
8423
|
let e = this._sock.rQshiftStr(t);
|
|
8424
|
-
return e =
|
|
8424
|
+
return e = Ot(e, !0), this._setDesktopName(e), !0;
|
|
8425
8425
|
}
|
|
8426
8426
|
_handleLedEvent() {
|
|
8427
8427
|
if (this._sock.rQwait("LED status", 1))
|
|
@@ -8456,7 +8456,7 @@ class I extends sn {
|
|
|
8456
8456
|
n = "Unknown reason";
|
|
8457
8457
|
break;
|
|
8458
8458
|
}
|
|
8459
|
-
|
|
8459
|
+
oe("Server did not accept the resize request: " + n);
|
|
8460
8460
|
} else
|
|
8461
8461
|
this._resize(this._FBU.width, this._FBU.height);
|
|
8462
8462
|
return s && this._requestRemoteResize(), this._FBU.x === 1 && this._FBU.y === 0 && this._requestRemoteResize(), !0;
|
|
@@ -8480,7 +8480,7 @@ class I extends sn {
|
|
|
8480
8480
|
}
|
|
8481
8481
|
}
|
|
8482
8482
|
_updateContinuousUpdates() {
|
|
8483
|
-
this._enabledContinuousUpdates &&
|
|
8483
|
+
this._enabledContinuousUpdates && U.messages.enableContinuousUpdates(
|
|
8484
8484
|
this._sock,
|
|
8485
8485
|
!0,
|
|
8486
8486
|
0,
|
|
@@ -8494,7 +8494,7 @@ class I extends sn {
|
|
|
8494
8494
|
this._fbWidth = t, this._fbHeight = e, this._display.resize(this._fbWidth, this._fbHeight), this._updateClip(), this._updateScale(), this._updateContinuousUpdates(), this._saveExpectedClientSize();
|
|
8495
8495
|
}
|
|
8496
8496
|
_xvpOp(t, e) {
|
|
8497
|
-
this._rfbXvpVer < t || (
|
|
8497
|
+
this._rfbXvpVer < t || (ae("Sending XVP operation " + e + " (version " + t + ")"), U.messages.xvpOp(this._sock, t, e));
|
|
8498
8498
|
}
|
|
8499
8499
|
_updateCursor(t, e, s, n, r) {
|
|
8500
8500
|
this._cursorImage = {
|
|
@@ -8516,7 +8516,7 @@ class I extends sn {
|
|
|
8516
8516
|
_refreshCursor() {
|
|
8517
8517
|
if (this._rfbConnectionState !== "connecting" && this._rfbConnectionState !== "connected")
|
|
8518
8518
|
return;
|
|
8519
|
-
const t = this._shouldShowDotCursor() ?
|
|
8519
|
+
const t = this._shouldShowDotCursor() ? U.cursors.dot : this._cursorImage;
|
|
8520
8520
|
this._cursor.change(
|
|
8521
8521
|
t.rgbaPixels,
|
|
8522
8522
|
t.hotx,
|
|
@@ -8526,17 +8526,17 @@ class I extends sn {
|
|
|
8526
8526
|
);
|
|
8527
8527
|
}
|
|
8528
8528
|
static genDES(t, e) {
|
|
8529
|
-
const s = t.split("").map((r) => r.charCodeAt(0)), n =
|
|
8529
|
+
const s = t.split("").map((r) => r.charCodeAt(0)), n = Y.importKey(
|
|
8530
8530
|
"raw",
|
|
8531
8531
|
s,
|
|
8532
8532
|
{ name: "DES-ECB" },
|
|
8533
8533
|
!1,
|
|
8534
8534
|
["encrypt"]
|
|
8535
8535
|
);
|
|
8536
|
-
return
|
|
8536
|
+
return Y.encrypt({ name: "DES-ECB" }, n, e);
|
|
8537
8537
|
}
|
|
8538
8538
|
}
|
|
8539
|
-
|
|
8539
|
+
U.messages = {
|
|
8540
8540
|
keyEvent(i, t, e) {
|
|
8541
8541
|
i.sQpush8(4), i.sQpush8(e), i.sQpush16(0), i.sQpush32(t), i.flush();
|
|
8542
8542
|
},
|
|
@@ -8570,13 +8570,13 @@ I.messages = {
|
|
|
8570
8570
|
return e[0] = n >> 24, e[1] = 0, e[2] = 0, e[3] = s, e;
|
|
8571
8571
|
},
|
|
8572
8572
|
extendedClipboardProvide(i, t, e) {
|
|
8573
|
-
let s = new
|
|
8573
|
+
let s = new ha(), n = [];
|
|
8574
8574
|
for (let h = 0; h < t.length; h++) {
|
|
8575
|
-
if (t[h] !=
|
|
8575
|
+
if (t[h] != xe)
|
|
8576
8576
|
throw new Error("Unsupported extended clipboard format for Provide message.");
|
|
8577
8577
|
e[h] = e[h].replace(/\r\n|\r|\n/gm, `\r
|
|
8578
8578
|
`);
|
|
8579
|
-
let c =
|
|
8579
|
+
let c = be(e[h] + "\0");
|
|
8580
8580
|
n.push(
|
|
8581
8581
|
c.length >> 24 & 255,
|
|
8582
8582
|
c.length >> 16 & 255,
|
|
@@ -8587,37 +8587,37 @@ I.messages = {
|
|
|
8587
8587
|
n.push(c.charCodeAt(o));
|
|
8588
8588
|
}
|
|
8589
8589
|
let r = s.deflate(new Uint8Array(n)), a = new Uint8Array(4 + r.length);
|
|
8590
|
-
a.set(
|
|
8591
|
-
[
|
|
8590
|
+
a.set(U.messages._buildExtendedClipboardFlags(
|
|
8591
|
+
[At],
|
|
8592
8592
|
t
|
|
8593
|
-
)), a.set(r, 4),
|
|
8593
|
+
)), a.set(r, 4), U.messages.clientCutText(i, a, !0);
|
|
8594
8594
|
},
|
|
8595
8595
|
extendedClipboardNotify(i, t) {
|
|
8596
|
-
let e =
|
|
8597
|
-
[
|
|
8596
|
+
let e = U.messages._buildExtendedClipboardFlags(
|
|
8597
|
+
[et],
|
|
8598
8598
|
t
|
|
8599
8599
|
);
|
|
8600
|
-
|
|
8600
|
+
U.messages.clientCutText(i, e, !0);
|
|
8601
8601
|
},
|
|
8602
8602
|
extendedClipboardRequest(i, t) {
|
|
8603
|
-
let e =
|
|
8604
|
-
[
|
|
8603
|
+
let e = U.messages._buildExtendedClipboardFlags(
|
|
8604
|
+
[Kt],
|
|
8605
8605
|
t
|
|
8606
8606
|
);
|
|
8607
|
-
|
|
8607
|
+
U.messages.clientCutText(i, e, !0);
|
|
8608
8608
|
},
|
|
8609
8609
|
extendedClipboardCaps(i, t, e) {
|
|
8610
8610
|
let s = Object.keys(e), n = new Uint8Array(4 + 4 * s.length);
|
|
8611
|
-
s.map((a) => parseInt(a)), s.sort((a, h) => a - h), n.set(
|
|
8611
|
+
s.map((a) => parseInt(a)), s.sort((a, h) => a - h), n.set(U.messages._buildExtendedClipboardFlags(t, []));
|
|
8612
8612
|
let r = 4;
|
|
8613
8613
|
for (let a = 0; a < s.length; a++)
|
|
8614
8614
|
n[r] = e[s[a]] >> 24, n[r + 1] = e[s[a]] >> 16, n[r + 2] = e[s[a]] >> 8, n[r + 3] = e[s[a]] >> 0, r += 4, n[3] |= 1 << s[a];
|
|
8615
|
-
|
|
8615
|
+
U.messages.clientCutText(i, n, !0);
|
|
8616
8616
|
},
|
|
8617
8617
|
clientCutText(i, t, e = !1) {
|
|
8618
8618
|
i.sQpush8(6), i.sQpush8(0), i.sQpush8(0), i.sQpush8(0);
|
|
8619
8619
|
let s;
|
|
8620
|
-
e ? s =
|
|
8620
|
+
e ? s = In(-t.length) : s = t.length, i.sQpush32(s), i.sQpushBytes(t), i.flush();
|
|
8621
8621
|
},
|
|
8622
8622
|
setDesktopSize(i, t, e, s, n) {
|
|
8623
8623
|
i.sQpush8(251), i.sQpush8(0), i.sQpush16(t), i.sQpush16(e), i.sQpush8(1), i.sQpush8(0), i.sQpush32(s), i.sQpush16(0), i.sQpush16(0), i.sQpush16(t), i.sQpush16(e), i.sQpush32(n), i.flush();
|
|
@@ -8647,7 +8647,7 @@ I.messages = {
|
|
|
8647
8647
|
i.sQpush8(250), i.sQpush8(0), i.sQpush8(t), i.sQpush8(e), i.flush();
|
|
8648
8648
|
}
|
|
8649
8649
|
};
|
|
8650
|
-
|
|
8650
|
+
U.cursors = {
|
|
8651
8651
|
none: {
|
|
8652
8652
|
rgbaPixels: new Uint8Array(),
|
|
8653
8653
|
w: 0,
|
|
@@ -8702,7 +8702,7 @@ I.cursors = {
|
|
|
8702
8702
|
hoty: 1
|
|
8703
8703
|
}
|
|
8704
8704
|
};
|
|
8705
|
-
class
|
|
8705
|
+
class Wa {
|
|
8706
8706
|
constructor(t) {
|
|
8707
8707
|
this.socket = t, t.binaryType = "arraybuffer", t.addEventListener("open", () => this.onopen?.()), t.addEventListener("message", (e) => this.onmessage?.(e)), t.addEventListener("close", (e) => this.onclose?.(e)), t.addEventListener("error", () => this.onerror?.());
|
|
8708
8708
|
}
|
|
@@ -8725,266 +8725,269 @@ class Va {
|
|
|
8725
8725
|
this.socket.close(t, e);
|
|
8726
8726
|
}
|
|
8727
8727
|
}
|
|
8728
|
-
function
|
|
8729
|
-
const [e, s] =
|
|
8728
|
+
function Ja({ active: i, onClose: t }) {
|
|
8729
|
+
const [e, s] = Ve(null), [n, r] = Ve("idle"), [a, h] = Ve(null), [c, o] = Ve(!0), [l, x] = Ve(
|
|
8730
8730
|
typeof window < "u" && window.matchMedia?.("(pointer: coarse)").matches
|
|
8731
|
-
), f =
|
|
8731
|
+
), f = Qe(null), d = Qe(null), k = Qe(null), E = Qe(null), X = Qe(null), C = ve(async () => {
|
|
8732
8732
|
try {
|
|
8733
|
-
const
|
|
8734
|
-
if (!
|
|
8735
|
-
s(await
|
|
8733
|
+
const T = await Ai("/api/computer/status");
|
|
8734
|
+
if (!T.ok) return;
|
|
8735
|
+
s(await T.json());
|
|
8736
8736
|
} catch {
|
|
8737
8737
|
}
|
|
8738
8738
|
}, []);
|
|
8739
|
-
|
|
8739
|
+
Le(() => {
|
|
8740
8740
|
if (!i) return;
|
|
8741
|
-
|
|
8742
|
-
const
|
|
8743
|
-
return () => clearInterval(
|
|
8744
|
-
}, [i,
|
|
8745
|
-
const
|
|
8741
|
+
C();
|
|
8742
|
+
const T = setInterval(() => void C(), 5e3);
|
|
8743
|
+
return () => clearInterval(T);
|
|
8744
|
+
}, [i, C]);
|
|
8745
|
+
const M = ve(() => {
|
|
8746
8746
|
try {
|
|
8747
8747
|
d.current?.disconnect();
|
|
8748
8748
|
} catch {
|
|
8749
8749
|
}
|
|
8750
8750
|
d.current = null;
|
|
8751
|
-
}, []), A =
|
|
8751
|
+
}, []), A = ve(async () => {
|
|
8752
8752
|
if (!(d.current || !f.current)) {
|
|
8753
8753
|
r("connecting"), h(null);
|
|
8754
8754
|
try {
|
|
8755
|
-
const
|
|
8755
|
+
const T = await Mn("/api/computer"), D = new U(f.current, new Wa(T), {
|
|
8756
8756
|
shared: !0
|
|
8757
8757
|
});
|
|
8758
|
-
|
|
8758
|
+
D.scaleViewport = !0, D.background = "#0b0b0d", D.showDotCursor = !0, D.viewOnly = c, D.addEventListener("connect", () => r("live")), D.addEventListener("disconnect", () => {
|
|
8759
8759
|
d.current = null, r("idle");
|
|
8760
|
-
}), d.current =
|
|
8761
|
-
} catch (
|
|
8762
|
-
r("idle"), h(
|
|
8760
|
+
}), d.current = D;
|
|
8761
|
+
} catch (T) {
|
|
8762
|
+
r("idle"), h(T instanceof Error ? T.message : "could not open the screen");
|
|
8763
8763
|
}
|
|
8764
8764
|
}
|
|
8765
8765
|
}, [c]);
|
|
8766
|
-
|
|
8766
|
+
Le(() => {
|
|
8767
8767
|
d.current && (d.current.viewOnly = c);
|
|
8768
|
-
}, [c]),
|
|
8769
|
-
!i || !e || e.running || !e.deps.ok || n === "starting" || a ||
|
|
8770
|
-
}, [i, e?.running, e?.deps.ok, n, a]),
|
|
8768
|
+
}, [c]), Le(() => {
|
|
8769
|
+
!i || !e || e.running || !e.deps.ok || n === "starting" || a || Q();
|
|
8770
|
+
}, [i, e?.running, e?.deps.ok, n, a]), Le(() => {
|
|
8771
8771
|
if (!i) {
|
|
8772
|
-
|
|
8772
|
+
M();
|
|
8773
8773
|
return;
|
|
8774
8774
|
}
|
|
8775
8775
|
e?.running && !d.current && A();
|
|
8776
|
-
}, [i, e?.running, A,
|
|
8777
|
-
const S =
|
|
8776
|
+
}, [i, e?.running, A, M]), Le(() => M, [M]);
|
|
8777
|
+
const S = ve(
|
|
8778
8778
|
() => f.current?.querySelector("canvas") ?? null,
|
|
8779
8779
|
[]
|
|
8780
|
-
), F =
|
|
8781
|
-
(
|
|
8782
|
-
const
|
|
8783
|
-
!
|
|
8784
|
-
new MouseEvent(
|
|
8780
|
+
), F = ve(
|
|
8781
|
+
(T, D, q = 0) => {
|
|
8782
|
+
const H = S(), B = E.current;
|
|
8783
|
+
!H || !B || H.dispatchEvent(
|
|
8784
|
+
new MouseEvent(T, {
|
|
8785
8785
|
bubbles: !0,
|
|
8786
8786
|
cancelable: !0,
|
|
8787
|
-
clientX:
|
|
8788
|
-
clientY:
|
|
8789
|
-
button:
|
|
8790
|
-
buttons:
|
|
8787
|
+
clientX: B.x,
|
|
8788
|
+
clientY: B.y,
|
|
8789
|
+
button: q,
|
|
8790
|
+
buttons: D
|
|
8791
8791
|
})
|
|
8792
8792
|
);
|
|
8793
8793
|
},
|
|
8794
8794
|
[S]
|
|
8795
|
-
),
|
|
8796
|
-
(
|
|
8797
|
-
const
|
|
8798
|
-
if (!
|
|
8799
|
-
const
|
|
8800
|
-
|
|
8801
|
-
x: Math.min(
|
|
8802
|
-
y: Math.min(
|
|
8795
|
+
), N = ve(
|
|
8796
|
+
(T, D) => {
|
|
8797
|
+
const q = S();
|
|
8798
|
+
if (!q) return;
|
|
8799
|
+
const H = q.getBoundingClientRect(), B = E.current ?? { x: H.left + H.width / 2, y: H.top + H.height / 2 };
|
|
8800
|
+
E.current = {
|
|
8801
|
+
x: Math.min(H.right - 1, Math.max(H.left, B.x + T)),
|
|
8802
|
+
y: Math.min(H.bottom - 1, Math.max(H.top, B.y + D))
|
|
8803
8803
|
}, F("mousemove", 0);
|
|
8804
8804
|
},
|
|
8805
8805
|
[S, F]
|
|
8806
|
-
), K =
|
|
8807
|
-
(
|
|
8808
|
-
F("mousedown",
|
|
8806
|
+
), K = ve(
|
|
8807
|
+
(T) => {
|
|
8808
|
+
F("mousedown", T === 2 ? 2 : 1, T), F("mouseup", 0, T);
|
|
8809
8809
|
},
|
|
8810
8810
|
[F]
|
|
8811
|
-
),
|
|
8812
|
-
|
|
8813
|
-
const
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8811
|
+
), I = Qe(null);
|
|
8812
|
+
Le(() => {
|
|
8813
|
+
const T = I.current;
|
|
8814
|
+
if (!T) return;
|
|
8815
|
+
const D = (B) => {
|
|
8816
|
+
if (B.preventDefault(), B.touches.length !== 1) return;
|
|
8817
|
+
const te = B.touches[0];
|
|
8818
|
+
X.current = { x: te.clientX, y: te.clientY, moved: !1, at: Date.now() };
|
|
8819
|
+
}, q = (B) => {
|
|
8820
|
+
B.preventDefault();
|
|
8821
|
+
const te = X.current;
|
|
8822
|
+
if (!te || B.touches.length !== 1) return;
|
|
8823
|
+
const dt = B.touches[0], Nt = dt.clientX - te.x, Ht = dt.clientY - te.y;
|
|
8824
|
+
(Math.abs(Nt) > 3 || Math.abs(Ht) > 3) && (te.moved = !0);
|
|
8825
|
+
const Ki = Math.min(2.5, 1 + Math.hypot(Nt, Ht) / 12);
|
|
8826
|
+
N(Nt * Ki, Ht * Ki), te.x = dt.clientX, te.y = dt.clientY;
|
|
8827
|
+
}, H = (B) => {
|
|
8828
|
+
B.preventDefault();
|
|
8829
|
+
const te = X.current;
|
|
8830
|
+
X.current = null, te && !te.moved && Date.now() - te.at < 400 && K(0);
|
|
8831
|
+
};
|
|
8832
|
+
return T.addEventListener("touchstart", D, { passive: !1 }), T.addEventListener("touchmove", q, { passive: !1 }), T.addEventListener("touchend", H, { passive: !1 }), T.addEventListener("touchcancel", H, { passive: !1 }), () => {
|
|
8833
|
+
T.removeEventListener("touchstart", D), T.removeEventListener("touchmove", q), T.removeEventListener("touchend", H), T.removeEventListener("touchcancel", H);
|
|
8834
|
+
};
|
|
8835
|
+
}, [N, K, e?.running, c, l]);
|
|
8836
|
+
const P = ve(() => {
|
|
8826
8837
|
o(!1), k.current?.focus();
|
|
8827
|
-
}, []),
|
|
8838
|
+
}, []), Q = async () => {
|
|
8828
8839
|
r("starting"), h(null);
|
|
8829
8840
|
try {
|
|
8830
|
-
const
|
|
8831
|
-
if (!
|
|
8832
|
-
s(await
|
|
8833
|
-
} catch (
|
|
8834
|
-
h(
|
|
8841
|
+
const T = await Ai("/api/computer/start", { method: "POST" });
|
|
8842
|
+
if (!T.ok) throw new Error(await T.text() || "failed to start");
|
|
8843
|
+
s(await T.json());
|
|
8844
|
+
} catch (T) {
|
|
8845
|
+
h(T instanceof Error ? T.message : "failed to start the computer"), r("idle");
|
|
8835
8846
|
}
|
|
8836
|
-
},
|
|
8847
|
+
}, z = e?.deps, j = !!e?.running;
|
|
8837
8848
|
return (
|
|
8838
8849
|
// Full bleed: the screen is the page. No title, no chrome, no padding --
|
|
8839
8850
|
// every pixel spent on framing is a pixel not spent on the desktop.
|
|
8840
|
-
/* @__PURE__ */
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
className: "absolute inset-0 z-[6] touch-none",
|
|
8852
|
-
onTouchStart: P,
|
|
8853
|
-
onTouchMove: D,
|
|
8854
|
-
onTouchEnd: Q,
|
|
8855
|
-
onTouchCancel: Q,
|
|
8856
|
-
onDoubleClick: () => K(0),
|
|
8857
|
-
onContextMenu: (M) => {
|
|
8858
|
-
M.preventDefault(), K(2);
|
|
8859
|
-
}
|
|
8860
|
-
}
|
|
8861
|
-
) : null,
|
|
8862
|
-
/* @__PURE__ */ j(
|
|
8863
|
-
"textarea",
|
|
8864
|
-
{
|
|
8865
|
-
ref: k,
|
|
8866
|
-
"aria-hidden": !0,
|
|
8867
|
-
tabIndex: -1,
|
|
8868
|
-
className: "pointer-events-none absolute size-px opacity-0",
|
|
8869
|
-
autoCapitalize: "off",
|
|
8870
|
-
autoCorrect: "off",
|
|
8871
|
-
spellCheck: !1,
|
|
8872
|
-
onChange: (M) => {
|
|
8873
|
-
const B = d.current, N = M.target.value;
|
|
8874
|
-
if (M.target.value = "", !!B)
|
|
8875
|
-
for (const Y of N) {
|
|
8876
|
-
const le = Y.codePointAt(0) ?? 0, Ve = le < 256 ? le : 16777216 + le;
|
|
8877
|
-
B.sendKey(Ve, null, !0), B.sendKey(Ve, null, !1);
|
|
8878
|
-
}
|
|
8879
|
-
},
|
|
8880
|
-
onKeyDown: (M) => {
|
|
8881
|
-
const B = d.current;
|
|
8882
|
-
if (!B) return;
|
|
8883
|
-
const Y = {
|
|
8884
|
-
Enter: 65293,
|
|
8885
|
-
Backspace: 65288,
|
|
8886
|
-
Tab: 65289,
|
|
8887
|
-
Escape: 65307,
|
|
8888
|
-
ArrowLeft: 65361,
|
|
8889
|
-
ArrowUp: 65362,
|
|
8890
|
-
ArrowRight: 65363,
|
|
8891
|
-
ArrowDown: 65364
|
|
8892
|
-
}[M.key];
|
|
8893
|
-
Y && (M.preventDefault(), B.sendKey(Y, M.code || null, !0), B.sendKey(Y, M.code || null, !1));
|
|
8894
|
-
}
|
|
8895
|
-
}
|
|
8896
|
-
),
|
|
8897
|
-
/* @__PURE__ */ fe("div", { className: "absolute right-3 top-3 z-10 flex items-center gap-2", children: [
|
|
8898
|
-
$ ? /* @__PURE__ */ fe(Ht, { children: [
|
|
8899
|
-
/* @__PURE__ */ fe(
|
|
8900
|
-
Le,
|
|
8851
|
+
/* @__PURE__ */ pe(
|
|
8852
|
+
"div",
|
|
8853
|
+
{
|
|
8854
|
+
className: "relative h-full min-h-0 w-full overflow-hidden bg-[#0b0b0d]",
|
|
8855
|
+
onPointerDownCapture: (T) => {
|
|
8856
|
+
const D = T.pointerType === "touch";
|
|
8857
|
+
x((q) => q === D ? q : D);
|
|
8858
|
+
},
|
|
8859
|
+
children: [
|
|
8860
|
+
/* @__PURE__ */ J(
|
|
8861
|
+
"div",
|
|
8901
8862
|
{
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
className: "shadow-lg",
|
|
8905
|
-
onClick: () => o((M) => !M),
|
|
8906
|
-
children: [
|
|
8907
|
-
/* @__PURE__ */ j(Ai, { className: "mr-1.5 size-3.5" }),
|
|
8908
|
-
c ? "Take control" : "Controlling"
|
|
8909
|
-
]
|
|
8863
|
+
ref: f,
|
|
8864
|
+
className: "absolute inset-0 touch-none select-none [-webkit-touch-callout:none] [overscroll-behavior:none]"
|
|
8910
8865
|
}
|
|
8911
8866
|
),
|
|
8912
|
-
/* @__PURE__ */
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8867
|
+
j && !c && l ? /* @__PURE__ */ J(
|
|
8868
|
+
"div",
|
|
8869
|
+
{
|
|
8870
|
+
ref: I,
|
|
8871
|
+
className: "absolute inset-0 z-[6] touch-none select-none",
|
|
8872
|
+
onContextMenu: (T) => {
|
|
8873
|
+
T.preventDefault(), K(2);
|
|
8874
|
+
}
|
|
8875
|
+
}
|
|
8876
|
+
) : null,
|
|
8877
|
+
/* @__PURE__ */ J(
|
|
8878
|
+
"textarea",
|
|
8879
|
+
{
|
|
8880
|
+
ref: k,
|
|
8881
|
+
"aria-hidden": !0,
|
|
8882
|
+
tabIndex: -1,
|
|
8883
|
+
className: "pointer-events-none absolute size-px opacity-0",
|
|
8884
|
+
autoCapitalize: "off",
|
|
8885
|
+
autoCorrect: "off",
|
|
8886
|
+
spellCheck: !1,
|
|
8887
|
+
onChange: (T) => {
|
|
8888
|
+
const D = d.current, q = T.target.value;
|
|
8889
|
+
if (T.target.value = "", !!D)
|
|
8890
|
+
for (const H of q) {
|
|
8891
|
+
const B = H.codePointAt(0) ?? 0, te = B < 256 ? B : 16777216 + B;
|
|
8892
|
+
D.sendKey(te, null, !0), D.sendKey(te, null, !1);
|
|
8893
|
+
}
|
|
8894
|
+
},
|
|
8895
|
+
onKeyDown: (T) => {
|
|
8896
|
+
const D = d.current;
|
|
8897
|
+
if (!D) return;
|
|
8898
|
+
const H = {
|
|
8899
|
+
Enter: 65293,
|
|
8900
|
+
Backspace: 65288,
|
|
8901
|
+
Tab: 65289,
|
|
8902
|
+
Escape: 65307,
|
|
8903
|
+
ArrowLeft: 65361,
|
|
8904
|
+
ArrowUp: 65362,
|
|
8905
|
+
ArrowRight: 65363,
|
|
8906
|
+
ArrowDown: 65364
|
|
8907
|
+
}[T.key];
|
|
8908
|
+
H && (T.preventDefault(), D.sendKey(H, T.code || null, !0), D.sendKey(H, T.code || null, !1));
|
|
8923
8909
|
}
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8910
|
+
}
|
|
8911
|
+
),
|
|
8912
|
+
/* @__PURE__ */ pe("div", { className: "absolute right-3 top-3 z-10 flex items-center gap-2", children: [
|
|
8913
|
+
j ? /* @__PURE__ */ pe(zt, { children: [
|
|
8914
|
+
/* @__PURE__ */ pe(
|
|
8915
|
+
Ge,
|
|
8916
|
+
{
|
|
8917
|
+
variant: c ? "secondary" : "default",
|
|
8918
|
+
size: "sm",
|
|
8919
|
+
className: "shadow-lg",
|
|
8920
|
+
onClick: () => o((T) => !T),
|
|
8921
|
+
children: [
|
|
8922
|
+
/* @__PURE__ */ J(Dn, { className: "mr-1.5 size-3.5" }),
|
|
8923
|
+
c ? "Take control" : "Controlling"
|
|
8924
|
+
]
|
|
8925
|
+
}
|
|
8926
|
+
),
|
|
8927
|
+
/* @__PURE__ */ J(zt, { children: /* @__PURE__ */ J(
|
|
8928
|
+
Ge,
|
|
8929
|
+
{
|
|
8930
|
+
variant: "secondary",
|
|
8931
|
+
size: "icon-sm",
|
|
8932
|
+
className: "shadow-lg",
|
|
8933
|
+
onClick: P,
|
|
8934
|
+
"aria-label": "Show the keyboard",
|
|
8935
|
+
title: "Keyboard",
|
|
8936
|
+
children: /* @__PURE__ */ J(Rn, { className: "size-3.5" })
|
|
8937
|
+
}
|
|
8938
|
+
) }),
|
|
8939
|
+
/* @__PURE__ */ J(
|
|
8940
|
+
Ge,
|
|
8941
|
+
{
|
|
8942
|
+
variant: "secondary",
|
|
8943
|
+
size: "icon-sm",
|
|
8944
|
+
className: "shadow-lg",
|
|
8945
|
+
onClick: () => {
|
|
8946
|
+
M(), A();
|
|
8947
|
+
},
|
|
8948
|
+
"aria-label": "Reconnect",
|
|
8949
|
+
title: "Reconnect",
|
|
8950
|
+
children: /* @__PURE__ */ J(Tn, { className: "size-3.5" })
|
|
8951
|
+
}
|
|
8952
|
+
)
|
|
8953
|
+
] }) : null,
|
|
8954
|
+
t ? /* @__PURE__ */ J(
|
|
8955
|
+
Ge,
|
|
8927
8956
|
{
|
|
8928
8957
|
variant: "secondary",
|
|
8929
8958
|
size: "icon-sm",
|
|
8930
8959
|
className: "shadow-lg",
|
|
8931
|
-
onClick:
|
|
8932
|
-
"aria-label": "
|
|
8933
|
-
title: "
|
|
8934
|
-
children: /* @__PURE__ */
|
|
8960
|
+
onClick: t,
|
|
8961
|
+
"aria-label": "Close the computer",
|
|
8962
|
+
title: "Close",
|
|
8963
|
+
children: /* @__PURE__ */ J(Qn, { className: "size-4" })
|
|
8935
8964
|
}
|
|
8936
|
-
)
|
|
8965
|
+
) : null
|
|
8937
8966
|
] }),
|
|
8938
|
-
/* @__PURE__ */
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
}
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
onClick: t,
|
|
8960
|
-
"aria-label": "Close the computer",
|
|
8961
|
-
title: "Close",
|
|
8962
|
-
children: /* @__PURE__ */ j(Tn, { className: "size-4" })
|
|
8963
|
-
}
|
|
8964
|
-
) : null
|
|
8965
|
-
] }),
|
|
8966
|
-
$ && n !== "live" && !a ? /* @__PURE__ */ j("div", { className: "pointer-events-none absolute inset-0 z-[5] flex items-center justify-center", children: /* @__PURE__ */ fe("div", { className: "flex items-center gap-2 rounded-full bg-card/90 px-4 py-2 text-sm shadow-lg backdrop-blur", children: [
|
|
8967
|
-
/* @__PURE__ */ j(Ki, { className: "size-4 animate-spin" }),
|
|
8968
|
-
n === "starting" ? "Starting the computer…" : "Connecting to the screen…"
|
|
8969
|
-
] }) }) : null,
|
|
8970
|
-
!$ || a || he && !he.ok ? /* @__PURE__ */ j("div", { className: "absolute inset-0 z-[5] flex items-center justify-center p-6", children: /* @__PURE__ */ fe("div", { className: "w-full max-w-md space-y-3 rounded-2xl border border-border bg-card/90 p-5 text-center backdrop-blur", children: [
|
|
8971
|
-
he && !he.ok ? /* @__PURE__ */ fe(Ht, { children: [
|
|
8972
|
-
/* @__PURE__ */ j("p", { className: "text-sm font-medium", children: "The computer needs a few packages." }),
|
|
8973
|
-
/* @__PURE__ */ fe("p", { className: "text-xs text-muted-foreground", children: [
|
|
8974
|
-
"Missing: ",
|
|
8975
|
-
he.missing.join(", ")
|
|
8976
|
-
] }),
|
|
8977
|
-
/* @__PURE__ */ j("pre", { className: "overflow-x-auto rounded bg-muted p-2 text-left text-xs", children: he.hint })
|
|
8978
|
-
] }) : a ? /* @__PURE__ */ j("p", { className: "text-sm text-destructive", children: a }) : /* @__PURE__ */ j("p", { className: "text-sm text-muted-foreground", children: "Start the computer to open a desktop with a browser the agent can drive." }),
|
|
8979
|
-
$ ? null : /* @__PURE__ */ fe(Le, { disabled: n === "starting" || he?.ok === !1, onClick: () => void J(), children: [
|
|
8980
|
-
n === "starting" ? /* @__PURE__ */ j(Ki, { className: "mr-1.5 size-4 animate-spin" }) : /* @__PURE__ */ j(Qn, { className: "mr-1.5 size-4" }),
|
|
8981
|
-
"Start the computer"
|
|
8982
|
-
] })
|
|
8983
|
-
] }) }) : null
|
|
8984
|
-
] })
|
|
8967
|
+
j && n !== "live" && !a ? /* @__PURE__ */ J("div", { className: "pointer-events-none absolute inset-0 z-[5] flex items-center justify-center", children: /* @__PURE__ */ pe("div", { className: "flex items-center gap-2 rounded-full bg-card/90 px-4 py-2 text-sm shadow-lg backdrop-blur", children: [
|
|
8968
|
+
/* @__PURE__ */ J(Xi, { className: "size-4 animate-spin" }),
|
|
8969
|
+
n === "starting" ? "Starting the computer…" : "Connecting to the screen…"
|
|
8970
|
+
] }) }) : null,
|
|
8971
|
+
!j || a || z && !z.ok ? /* @__PURE__ */ J("div", { className: "absolute inset-0 z-[5] flex items-center justify-center p-6", children: /* @__PURE__ */ pe("div", { className: "w-full max-w-md space-y-3 rounded-2xl border border-border bg-card/90 p-5 text-center backdrop-blur", children: [
|
|
8972
|
+
z && !z.ok ? /* @__PURE__ */ pe(zt, { children: [
|
|
8973
|
+
/* @__PURE__ */ J("p", { className: "text-sm font-medium", children: "The computer needs a few packages." }),
|
|
8974
|
+
/* @__PURE__ */ pe("p", { className: "text-xs text-muted-foreground", children: [
|
|
8975
|
+
"Missing: ",
|
|
8976
|
+
z.missing.join(", ")
|
|
8977
|
+
] }),
|
|
8978
|
+
/* @__PURE__ */ J("pre", { className: "overflow-x-auto rounded bg-muted p-2 text-left text-xs", children: z.hint })
|
|
8979
|
+
] }) : a ? /* @__PURE__ */ J("p", { className: "text-sm text-destructive", children: a }) : /* @__PURE__ */ J("p", { className: "text-sm text-muted-foreground", children: "Start the computer to open a desktop with a browser the agent can drive." }),
|
|
8980
|
+
j ? null : /* @__PURE__ */ pe(Ge, { disabled: n === "starting" || z?.ok === !1, onClick: () => void Q(), children: [
|
|
8981
|
+
n === "starting" ? /* @__PURE__ */ J(Xi, { className: "mr-1.5 size-4 animate-spin" }) : /* @__PURE__ */ J(Ln, { className: "mr-1.5 size-4" }),
|
|
8982
|
+
"Start the computer"
|
|
8983
|
+
] })
|
|
8984
|
+
] }) }) : null
|
|
8985
|
+
]
|
|
8986
|
+
}
|
|
8987
|
+
)
|
|
8985
8988
|
);
|
|
8986
8989
|
}
|
|
8987
8990
|
export {
|
|
8988
|
-
|
|
8989
|
-
|
|
8991
|
+
Ja as ComputerPage,
|
|
8992
|
+
Ja as default
|
|
8990
8993
|
};
|