@pluve/logger-sdk 0.0.11 → 0.0.12
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/cjs/compress/compression.js +32 -11
- package/dist/cjs/core/loggerSDK.js +9 -7
- package/dist/cjs/core/queueManager.js +20 -6
- package/dist/cjs/transport/pixelImageTransport.js +1 -2
- package/dist/cjs/transport/transportAdapter.js +30 -13
- package/dist/esm/compress/compression.js +30 -11
- package/dist/esm/core/loggerSDK.js +7 -5
- package/dist/esm/core/queueManager.js +20 -6
- package/dist/esm/transport/pixelImageTransport.js +2 -3
- package/dist/esm/transport/transportAdapter.js +74 -15
- package/dist/types/compress/compression.d.ts +2 -0
- package/dist/types/transport/transportAdapter.d.ts +3 -5
- package/dist/umd/logger-sdk.min.js +1 -1
- package/package.json +1 -2
|
@@ -19,12 +19,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/compress/compression.ts
|
|
20
20
|
var compression_exports = {};
|
|
21
21
|
__export(compression_exports, {
|
|
22
|
+
convert2Base64: () => convert2Base64,
|
|
23
|
+
convert2Base64FromArray: () => convert2Base64FromArray,
|
|
22
24
|
gzipCompress: () => gzipCompress,
|
|
23
25
|
isGzipSupported: () => isGzipSupported
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(compression_exports);
|
|
26
28
|
var import_fflate = require("fflate");
|
|
27
|
-
var import_js_base64 = require("js-base64");
|
|
28
29
|
var import_environment = require("../utils/environment");
|
|
29
30
|
function toUtf8Bytes(s) {
|
|
30
31
|
if (typeof TextEncoder !== "undefined") {
|
|
@@ -53,14 +54,7 @@ async function gzipCompress(data) {
|
|
|
53
54
|
const compressedStream = readable.pipeThrough(gzip);
|
|
54
55
|
const compressedBuffer = await new Response(compressedStream).arrayBuffer();
|
|
55
56
|
const bytes = new Uint8Array(compressedBuffer);
|
|
56
|
-
|
|
57
|
-
for (let i = 0; i < bytes.byteLength; i += 1) {
|
|
58
|
-
binary += String.fromCharCode(bytes[i]);
|
|
59
|
-
}
|
|
60
|
-
if (typeof btoa !== "undefined") {
|
|
61
|
-
return btoa(binary);
|
|
62
|
-
}
|
|
63
|
-
return Buffer.from(binary, "base64").toString("base64");
|
|
57
|
+
return convert2Base64FromArray(bytes);
|
|
64
58
|
} catch (e) {
|
|
65
59
|
console.log("gzipCompress 压缩失败,尝试使用 fflate 库", e);
|
|
66
60
|
}
|
|
@@ -68,17 +62,44 @@ async function gzipCompress(data) {
|
|
|
68
62
|
try {
|
|
69
63
|
const input = toUtf8Bytes(data);
|
|
70
64
|
const compressed = (0, import_fflate.gzipSync)(input);
|
|
71
|
-
return
|
|
65
|
+
return convert2Base64FromArray(compressed);
|
|
72
66
|
} catch (e) {
|
|
73
67
|
console.log("gzipCompress 压缩失败", e);
|
|
74
68
|
}
|
|
75
|
-
return
|
|
69
|
+
return data;
|
|
70
|
+
}
|
|
71
|
+
function convert2Base64FromArray(data) {
|
|
72
|
+
let binary = "";
|
|
73
|
+
for (let i = 0; i < data.length; i += 1) {
|
|
74
|
+
binary += String.fromCharCode(data[i]);
|
|
75
|
+
}
|
|
76
|
+
if (typeof btoa !== "undefined") {
|
|
77
|
+
return btoa(binary);
|
|
78
|
+
}
|
|
79
|
+
if (typeof Buffer !== "undefined") {
|
|
80
|
+
return Buffer.from(binary, "base64").toString("base64");
|
|
81
|
+
}
|
|
82
|
+
throw new Error("convert2Base64FromArray 不支持转换");
|
|
83
|
+
}
|
|
84
|
+
function convert2Base64(data) {
|
|
85
|
+
if (typeof btoa !== "undefined") {
|
|
86
|
+
try {
|
|
87
|
+
return btoa(data);
|
|
88
|
+
} catch {
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (typeof Buffer !== "undefined") {
|
|
92
|
+
return Buffer.from(data, "base64").toString("base64");
|
|
93
|
+
}
|
|
94
|
+
return data;
|
|
76
95
|
}
|
|
77
96
|
function isGzipSupported() {
|
|
78
97
|
return (0, import_environment.isBrowser)() && typeof CompressionStream !== "undefined";
|
|
79
98
|
}
|
|
80
99
|
// Annotate the CommonJS export names for ESM import in node:
|
|
81
100
|
0 && (module.exports = {
|
|
101
|
+
convert2Base64,
|
|
102
|
+
convert2Base64FromArray,
|
|
82
103
|
gzipCompress,
|
|
83
104
|
isGzipSupported
|
|
84
105
|
});
|
|
@@ -140,7 +140,7 @@ var LoggerSDK = class {
|
|
|
140
140
|
debug: this.opts.debug
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
this.transporter =
|
|
143
|
+
this.transporter = void 0;
|
|
144
144
|
this.sessionId = (0, import_session.getSessionId)();
|
|
145
145
|
this.envTags = (0, import_environment.collectEnvironmentTags)();
|
|
146
146
|
this.initSDK(this.opts, (data) => {
|
|
@@ -455,8 +455,9 @@ var LoggerSDK = class {
|
|
|
455
455
|
*/
|
|
456
456
|
async sendEvent(event) {
|
|
457
457
|
const sendFn = async () => {
|
|
458
|
-
|
|
459
|
-
|
|
458
|
+
const transporter = this.transporter || await import_transportAdapter.TransportAdapter.getInstance(this.opts).getTransporter();
|
|
459
|
+
this.transporter = transporter;
|
|
460
|
+
await transporter.send({
|
|
460
461
|
appId: event.appId,
|
|
461
462
|
appStage: event.stage,
|
|
462
463
|
items: [
|
|
@@ -469,7 +470,7 @@ var LoggerSDK = class {
|
|
|
469
470
|
throwable: event.throwable
|
|
470
471
|
}
|
|
471
472
|
]
|
|
472
|
-
})
|
|
473
|
+
});
|
|
473
474
|
};
|
|
474
475
|
if (this.opts.enableRetry && this.retryManager) {
|
|
475
476
|
await this.retryManager.executeWithRetry(event.logId, sendFn);
|
|
@@ -505,8 +506,9 @@ var LoggerSDK = class {
|
|
|
505
506
|
if (chunk.length > 0) {
|
|
506
507
|
const batchId = `batch_${(0, import_tools.now)()}_${Math.random().toString(36).substring(2, 9)}_${key}_${i}`;
|
|
507
508
|
const sendFn = async () => {
|
|
508
|
-
|
|
509
|
-
|
|
509
|
+
const transporter = this.transporter || await import_transportAdapter.TransportAdapter.getInstance(this.opts).getTransporter();
|
|
510
|
+
this.transporter = transporter;
|
|
511
|
+
await transporter.send({
|
|
510
512
|
appId: chunk[0].appId,
|
|
511
513
|
appStage: chunk[0].stage,
|
|
512
514
|
items: chunk.map((event) => ({
|
|
@@ -517,7 +519,7 @@ var LoggerSDK = class {
|
|
|
517
519
|
message: event.message,
|
|
518
520
|
throwable: event.throwable
|
|
519
521
|
}))
|
|
520
|
-
})
|
|
522
|
+
});
|
|
521
523
|
};
|
|
522
524
|
const task = this.opts.enableRetry && this.retryManager ? this.retryManager.executeWithRetry(batchId, sendFn) : sendFn();
|
|
523
525
|
tasks.push(task);
|
|
@@ -47,17 +47,31 @@ var QueueManager = class {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
async loadLocalForage() {
|
|
50
|
+
if (!(0, import_environment.isBrowser)())
|
|
51
|
+
return null;
|
|
50
52
|
try {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
const g = globalThis;
|
|
54
|
+
if (g && g.localforage && typeof g.localforage.getItem === "function") {
|
|
55
|
+
this.localforage = g.localforage;
|
|
56
|
+
return this.localforage;
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
const mod = await import(
|
|
60
|
+
/* @vite-ignore */
|
|
61
|
+
"localforage"
|
|
62
|
+
);
|
|
63
|
+
this.localforage = mod;
|
|
64
|
+
return this.localforage;
|
|
65
|
+
} catch (e) {
|
|
66
|
+
(0, import_tools.logDebug)(!!this.opts.debug, "localforage dynamic import failed, fallback to localStorage", e);
|
|
67
|
+
this.localforage = null;
|
|
68
|
+
return null;
|
|
56
69
|
}
|
|
57
70
|
} catch (e) {
|
|
58
71
|
(0, import_tools.logDebug)(!!this.opts.debug, "localforage load error", e);
|
|
72
|
+
this.localforage = null;
|
|
73
|
+
return null;
|
|
59
74
|
}
|
|
60
|
-
return null;
|
|
61
75
|
}
|
|
62
76
|
/**
|
|
63
77
|
* 添加日志到队列
|
|
@@ -22,7 +22,6 @@ __export(pixelImageTransport_exports, {
|
|
|
22
22
|
PixelImageTransport: () => PixelImageTransport
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(pixelImageTransport_exports);
|
|
25
|
-
var import_js_base64 = require("js-base64");
|
|
26
25
|
var import_environment = require("../utils/environment");
|
|
27
26
|
var import_tools = require("../utils/tools");
|
|
28
27
|
var import_config = require("../config");
|
|
@@ -52,7 +51,7 @@ var PixelImageTransport = class {
|
|
|
52
51
|
(0, import_tools.logDebug)(!!((_g = this.opts) == null ? void 0 : _g.debug), `original body size: ${body.length}, compressed body size: ${compressedBody.length}`);
|
|
53
52
|
(0, import_tools.logDebug)(!!((_h = this.opts) == null ? void 0 : _h.debug), "PixelImage request gzip compress body: ", compressedBody);
|
|
54
53
|
} else {
|
|
55
|
-
compressedBody =
|
|
54
|
+
compressedBody = (0, import_compression.convert2Base64)(body);
|
|
56
55
|
}
|
|
57
56
|
const cacheBuster = `_=${Date.now()}`;
|
|
58
57
|
const qs = `appId=${((_i = this.opts) == null ? void 0 : _i.appId) || ""}&appStage=${((_j = this.opts) == null ? void 0 : _j.logStage) || ""}&${param}=${encodeURIComponent(compressedBody)}&gzip=${((_k = this.opts) == null ? void 0 : _k.enableGzip) ? 1 : 0}&${cacheBuster}`;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// src/transport/transportAdapter.ts
|
|
@@ -23,14 +33,9 @@ __export(transportAdapter_exports, {
|
|
|
23
33
|
});
|
|
24
34
|
module.exports = __toCommonJS(transportAdapter_exports);
|
|
25
35
|
var import_environment = require("../utils/environment");
|
|
26
|
-
var import_beaconTransport = require("./beaconTransport");
|
|
27
|
-
var import_pixelImageTransport = require("./pixelImageTransport");
|
|
28
|
-
var import_wechatTransport = require("./wechatTransport");
|
|
29
36
|
var TransportAdapter = class {
|
|
30
37
|
constructor(opts) {
|
|
31
|
-
this.
|
|
32
|
-
this.pixelImageTransport = new import_pixelImageTransport.PixelImageTransport(opts);
|
|
33
|
-
this.wechatTransport = new import_wechatTransport.WechatTransport(opts);
|
|
38
|
+
this.opts = opts;
|
|
34
39
|
}
|
|
35
40
|
static getInstance(opts) {
|
|
36
41
|
if (!TransportAdapter.instance) {
|
|
@@ -38,16 +43,28 @@ var TransportAdapter = class {
|
|
|
38
43
|
}
|
|
39
44
|
return TransportAdapter.instance;
|
|
40
45
|
}
|
|
41
|
-
getTransporter() {
|
|
46
|
+
async getTransporter() {
|
|
42
47
|
if ((0, import_environment.isWeChatMiniProgram)()) {
|
|
43
|
-
|
|
48
|
+
const mod = await import(
|
|
49
|
+
/* @vite-ignore */
|
|
50
|
+
"./wechatTransport"
|
|
51
|
+
);
|
|
52
|
+
return new mod.WechatTransport(this.opts);
|
|
44
53
|
}
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
const beaconMod = await import(
|
|
55
|
+
/* @vite-ignore */
|
|
56
|
+
"./beaconTransport"
|
|
57
|
+
);
|
|
58
|
+
const pixelMod = await import(
|
|
59
|
+
/* @vite-ignore */
|
|
60
|
+
"./pixelImageTransport"
|
|
61
|
+
);
|
|
62
|
+
const beacon = new beaconMod.BeaconTransport(this.opts);
|
|
63
|
+
const pixel = new pixelMod.PixelImageTransport(this.opts);
|
|
64
|
+
if (beacon.isSupported()) {
|
|
65
|
+
return beacon;
|
|
49
66
|
}
|
|
50
|
-
return
|
|
67
|
+
return pixel;
|
|
51
68
|
}
|
|
52
69
|
};
|
|
53
70
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -21,7 +21,6 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21
21
|
|
|
22
22
|
// src/compress/compression.ts
|
|
23
23
|
import { gzipSync } from "fflate";
|
|
24
|
-
import { Base64 } from "js-base64";
|
|
25
24
|
import { isBrowser } from "../utils/environment";
|
|
26
25
|
function toUtf8Bytes(s) {
|
|
27
26
|
if (typeof TextEncoder !== "undefined") {
|
|
@@ -51,14 +50,7 @@ function gzipCompress(data) {
|
|
|
51
50
|
const compressedStream = readable.pipeThrough(gzip);
|
|
52
51
|
const compressedBuffer = yield new Response(compressedStream).arrayBuffer();
|
|
53
52
|
const bytes = new Uint8Array(compressedBuffer);
|
|
54
|
-
|
|
55
|
-
for (let i = 0; i < bytes.byteLength; i += 1) {
|
|
56
|
-
binary += String.fromCharCode(bytes[i]);
|
|
57
|
-
}
|
|
58
|
-
if (typeof btoa !== "undefined") {
|
|
59
|
-
return btoa(binary);
|
|
60
|
-
}
|
|
61
|
-
return Buffer.from(binary, "base64").toString("base64");
|
|
53
|
+
return convert2Base64FromArray(bytes);
|
|
62
54
|
} catch (e) {
|
|
63
55
|
console.log("gzipCompress 压缩失败,尝试使用 fflate 库", e);
|
|
64
56
|
}
|
|
@@ -66,17 +58,44 @@ function gzipCompress(data) {
|
|
|
66
58
|
try {
|
|
67
59
|
const input = toUtf8Bytes(data);
|
|
68
60
|
const compressed = gzipSync(input);
|
|
69
|
-
return
|
|
61
|
+
return convert2Base64FromArray(compressed);
|
|
70
62
|
} catch (e) {
|
|
71
63
|
console.log("gzipCompress 压缩失败", e);
|
|
72
64
|
}
|
|
73
|
-
return
|
|
65
|
+
return data;
|
|
74
66
|
});
|
|
75
67
|
}
|
|
68
|
+
function convert2Base64FromArray(data) {
|
|
69
|
+
let binary = "";
|
|
70
|
+
for (let i = 0; i < data.length; i += 1) {
|
|
71
|
+
binary += String.fromCharCode(data[i]);
|
|
72
|
+
}
|
|
73
|
+
if (typeof btoa !== "undefined") {
|
|
74
|
+
return btoa(binary);
|
|
75
|
+
}
|
|
76
|
+
if (typeof Buffer !== "undefined") {
|
|
77
|
+
return Buffer.from(binary, "base64").toString("base64");
|
|
78
|
+
}
|
|
79
|
+
throw new Error("convert2Base64FromArray 不支持转换");
|
|
80
|
+
}
|
|
81
|
+
function convert2Base64(data) {
|
|
82
|
+
if (typeof btoa !== "undefined") {
|
|
83
|
+
try {
|
|
84
|
+
return btoa(data);
|
|
85
|
+
} catch (e) {
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (typeof Buffer !== "undefined") {
|
|
89
|
+
return Buffer.from(data, "base64").toString("base64");
|
|
90
|
+
}
|
|
91
|
+
return data;
|
|
92
|
+
}
|
|
76
93
|
function isGzipSupported() {
|
|
77
94
|
return isBrowser() && typeof CompressionStream !== "undefined";
|
|
78
95
|
}
|
|
79
96
|
export {
|
|
97
|
+
convert2Base64,
|
|
98
|
+
convert2Base64FromArray,
|
|
80
99
|
gzipCompress,
|
|
81
100
|
isGzipSupported
|
|
82
101
|
};
|
|
@@ -137,7 +137,7 @@ var LoggerSDK = class {
|
|
|
137
137
|
debug: this.opts.debug
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
-
this.transporter =
|
|
140
|
+
this.transporter = void 0;
|
|
141
141
|
this.sessionId = getSessionId();
|
|
142
142
|
this.envTags = collectEnvironmentTags();
|
|
143
143
|
this.initSDK(this.opts, (data) => {
|
|
@@ -461,8 +461,9 @@ var LoggerSDK = class {
|
|
|
461
461
|
sendEvent(event) {
|
|
462
462
|
return __async(this, null, function* () {
|
|
463
463
|
const sendFn = () => __async(this, null, function* () {
|
|
464
|
-
|
|
465
|
-
|
|
464
|
+
const transporter = this.transporter || (yield TransportAdapter.getInstance(this.opts).getTransporter());
|
|
465
|
+
this.transporter = transporter;
|
|
466
|
+
yield transporter.send({
|
|
466
467
|
appId: event.appId,
|
|
467
468
|
appStage: event.stage,
|
|
468
469
|
items: [
|
|
@@ -513,8 +514,9 @@ var LoggerSDK = class {
|
|
|
513
514
|
if (chunk.length > 0) {
|
|
514
515
|
const batchId = `batch_${now()}_${Math.random().toString(36).substring(2, 9)}_${key}_${i}`;
|
|
515
516
|
const sendFn = () => __async(this, null, function* () {
|
|
516
|
-
|
|
517
|
-
|
|
517
|
+
const transporter = this.transporter || (yield TransportAdapter.getInstance(this.opts).getTransporter());
|
|
518
|
+
this.transporter = transporter;
|
|
519
|
+
yield transporter.send({
|
|
518
520
|
appId: chunk[0].appId,
|
|
519
521
|
appStage: chunk[0].stage,
|
|
520
522
|
items: chunk.map((event) => ({
|
|
@@ -65,17 +65,31 @@ var QueueManager = class {
|
|
|
65
65
|
}
|
|
66
66
|
loadLocalForage() {
|
|
67
67
|
return __async(this, null, function* () {
|
|
68
|
+
if (!isBrowser())
|
|
69
|
+
return null;
|
|
68
70
|
try {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
const g = globalThis;
|
|
72
|
+
if (g && g.localforage && typeof g.localforage.getItem === "function") {
|
|
73
|
+
this.localforage = g.localforage;
|
|
74
|
+
return this.localforage;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const mod = yield Promise.resolve().then(() => __toESM(__require(
|
|
78
|
+
/* @vite-ignore */
|
|
79
|
+
"localforage"
|
|
80
|
+
)));
|
|
81
|
+
this.localforage = mod;
|
|
82
|
+
return this.localforage;
|
|
83
|
+
} catch (e) {
|
|
84
|
+
logDebug(!!this.opts.debug, "localforage dynamic import failed, fallback to localStorage", e);
|
|
85
|
+
this.localforage = null;
|
|
86
|
+
return null;
|
|
74
87
|
}
|
|
75
88
|
} catch (e) {
|
|
76
89
|
logDebug(!!this.opts.debug, "localforage load error", e);
|
|
90
|
+
this.localforage = null;
|
|
91
|
+
return null;
|
|
77
92
|
}
|
|
78
|
-
return null;
|
|
79
93
|
});
|
|
80
94
|
}
|
|
81
95
|
/**
|
|
@@ -20,11 +20,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
// src/transport/pixelImageTransport.ts
|
|
23
|
-
import { Base64 } from "js-base64";
|
|
24
23
|
import { isBrowser } from "../utils/environment";
|
|
25
24
|
import { logDebug, now, safeStringify } from "../utils/tools";
|
|
26
25
|
import { getPixelBatchApi } from "../config";
|
|
27
|
-
import { gzipCompress } from "../compress/compression";
|
|
26
|
+
import { convert2Base64, gzipCompress } from "../compress/compression";
|
|
28
27
|
var PixelImageTransport = class {
|
|
29
28
|
constructor(opts) {
|
|
30
29
|
/** 传输器名称 */
|
|
@@ -51,7 +50,7 @@ var PixelImageTransport = class {
|
|
|
51
50
|
logDebug(!!((_g = this.opts) == null ? void 0 : _g.debug), `original body size: ${body.length}, compressed body size: ${compressedBody.length}`);
|
|
52
51
|
logDebug(!!((_h = this.opts) == null ? void 0 : _h.debug), "PixelImage request gzip compress body: ", compressedBody);
|
|
53
52
|
} else {
|
|
54
|
-
compressedBody =
|
|
53
|
+
compressedBody = convert2Base64(body);
|
|
55
54
|
}
|
|
56
55
|
const cacheBuster = `_=${Date.now()}`;
|
|
57
56
|
const qs = `appId=${((_i = this.opts) == null ? void 0 : _i.appId) || ""}&appStage=${((_j = this.opts) == null ? void 0 : _j.logStage) || ""}&${param}=${encodeURIComponent(compressedBody)}&gzip=${((_k = this.opts) == null ? void 0 : _k.enableGzip) ? 1 : 0}&${cacheBuster}`;
|
|
@@ -1,13 +1,58 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined")
|
|
11
|
+
return require.apply(this, arguments);
|
|
12
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
+
});
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __async = (__this, __arguments, generator) => {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
var fulfilled = (value) => {
|
|
33
|
+
try {
|
|
34
|
+
step(generator.next(value));
|
|
35
|
+
} catch (e) {
|
|
36
|
+
reject(e);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var rejected = (value) => {
|
|
40
|
+
try {
|
|
41
|
+
step(generator.throw(value));
|
|
42
|
+
} catch (e) {
|
|
43
|
+
reject(e);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
47
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
1
51
|
// src/transport/transportAdapter.ts
|
|
2
52
|
import { isWeChatMiniProgram } from "../utils/environment";
|
|
3
|
-
import { BeaconTransport } from "./beaconTransport";
|
|
4
|
-
import { PixelImageTransport } from "./pixelImageTransport";
|
|
5
|
-
import { WechatTransport } from "./wechatTransport";
|
|
6
53
|
var TransportAdapter = class {
|
|
7
54
|
constructor(opts) {
|
|
8
|
-
this.
|
|
9
|
-
this.pixelImageTransport = new PixelImageTransport(opts);
|
|
10
|
-
this.wechatTransport = new WechatTransport(opts);
|
|
55
|
+
this.opts = opts;
|
|
11
56
|
}
|
|
12
57
|
static getInstance(opts) {
|
|
13
58
|
if (!TransportAdapter.instance) {
|
|
@@ -16,15 +61,29 @@ var TransportAdapter = class {
|
|
|
16
61
|
return TransportAdapter.instance;
|
|
17
62
|
}
|
|
18
63
|
getTransporter() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
64
|
+
return __async(this, null, function* () {
|
|
65
|
+
if (isWeChatMiniProgram()) {
|
|
66
|
+
const mod = yield Promise.resolve().then(() => __toESM(__require(
|
|
67
|
+
/* @vite-ignore */
|
|
68
|
+
"./wechatTransport"
|
|
69
|
+
)));
|
|
70
|
+
return new mod.WechatTransport(this.opts);
|
|
71
|
+
}
|
|
72
|
+
const beaconMod = yield Promise.resolve().then(() => __toESM(__require(
|
|
73
|
+
/* @vite-ignore */
|
|
74
|
+
"./beaconTransport"
|
|
75
|
+
)));
|
|
76
|
+
const pixelMod = yield Promise.resolve().then(() => __toESM(__require(
|
|
77
|
+
/* @vite-ignore */
|
|
78
|
+
"./pixelImageTransport"
|
|
79
|
+
)));
|
|
80
|
+
const beacon = new beaconMod.BeaconTransport(this.opts);
|
|
81
|
+
const pixel = new pixelMod.PixelImageTransport(this.opts);
|
|
82
|
+
if (beacon.isSupported()) {
|
|
83
|
+
return beacon;
|
|
84
|
+
}
|
|
85
|
+
return pixel;
|
|
86
|
+
});
|
|
28
87
|
}
|
|
29
88
|
};
|
|
30
89
|
export {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { Transporter, TransportOptions } from './transport';
|
|
1
|
+
import type { Transporter, TransportOptions } from './transport';
|
|
2
2
|
export declare class TransportAdapter {
|
|
3
3
|
private static instance;
|
|
4
|
-
private
|
|
5
|
-
private pixelImageTransport;
|
|
6
|
-
private wechatTransport;
|
|
4
|
+
private opts;
|
|
7
5
|
private constructor();
|
|
8
6
|
static getInstance(opts: TransportOptions): TransportAdapter;
|
|
9
|
-
getTransporter(): Transporter
|
|
7
|
+
getTransporter(): Promise<Transporter>;
|
|
10
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Base64"),require("localforage")):"function"==typeof define&&define.amd?define(["Base64","localforage"],t):"object"==typeof exports?exports.LoggerSDK=t(require("Base64"),require("localforage")):e.LoggerSDK=t(e.Base64,e.localforage)}(self,(function(e,t){return function(){var r,n,o={307:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=u(e),a=i[0],s=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),l=0,f=s>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(c(e,s,s+a>u?u:s+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},179:function(e,t,r){"use strict";var n=r(505).default,o=r(307),i=r(525),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;var s=2147483647;function u(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|v(e,t),n=u(r),o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(F(e,Uint8Array)){var t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(e));if(F(e,ArrayBuffer)||e&&F(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(F(e,SharedArrayBuffer)||e&&F(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(null!=o&&o!==e)return c.from(o,t,r);var i=function(e){if(c.isBuffer(e)){var t=0|g(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||G(e.length)?u(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(e))}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return f(e),u(e<0?0:0|g(e))}function p(e){for(var t=e.length<0?0:0|g(e.length),r=u(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function g(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function v(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||F(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+n(e));var r=e.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return o?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return L(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),G(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){var i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var f=!0,h=0;h<u;h++)if(c(e,i+h)!==c(t,h)){f=!1;break}if(f)return i}return-1}function x(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(G(s))return a;e[r+a]=s}return a}function S(e,t,r,n){return D(q(t,e.length-r),e,r,n)}function _(e,t,r,n){return D(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return D(z(t),e,r,n)}function k(e,t,r,n){return D(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function C(e,t,r){return 0===t&&r===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,a,s,u,c=e[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}(e,t,r)},c.allocUnsafe=function(e){return h(e)},c.allocUnsafeSlow=function(e){return h(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(F(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),F(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=c.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(F(i,Uint8Array))o+i.length>n.length?c.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},c.byteLength=v,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},c.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,o,i){if(F(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+n(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),t<0||r>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&t>=r)return 0;if(o>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(o>>>=0),s=(r>>>=0)-(t>>>=0),u=Math.min(a,s),l=this.slice(o,i),f=e.slice(t,r),h=0;h<u;++h)if(l[h]!==f[h]){a=l[h],s=f[h];break}return a<s?-1:s<a?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function L(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function M(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function I(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=W[e[i]];return o}function R(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function T(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function P(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,o){return t=+t,r>>>=0,o||P(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,o){return t=+t,r>>>=0,o||P(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||B(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||B(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=c.isBuffer(e)?e:c.from(e,n),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};var U=/[^+/0-9A-Za-z-_]/g;function q(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return o.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function F(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}var W=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}()},948:function(e,t,r){var n,o,i;r(505).default;!function(a,s){"use strict";o=[r(901)],void 0===(i="function"==typeof(n=function(e){var t=/(^|@)\S+:\d+/,r=/^\s*at .*(\S+:\d+|\(native\))/m,n=/^(eval@)?(\[native code])?$/;return{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(r))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(e){return!!e.match(r)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),n=r.match(/ (\(.+\)$)/);r=n?r.replace(n[0],""):r;var o=this.extractLocation(n?n[1]:r),i=n&&r||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new e({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[2],source:t})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(e){return!e.match(n)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e({functionName:t});var r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(r),o=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(r,""));return new e({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),o=[],i=2,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push(new e({fileName:s[2],lineNumber:s[1],source:n[i]}))}return o},parseOpera10:function(t){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),o=[],i=0,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push(new e({functionName:s[3]||void 0,fileName:s[2],lineNumber:s[1],source:n[i]}))}return o},parseOpera11:function(r){return r.stack.split("\n").filter((function(e){return!!e.match(t)&&!e.match(/^Error created at/)}),this).map((function(t){var r,n=t.split("@"),o=this.extractLocation(n.pop()),i=n.shift()||"",a=i.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;i.match(/\(([^)]*)\)/)&&(r=i.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===r||"[arguments not available]"===r?void 0:r.split(",");return new e({functionName:a,args:s,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:t})}),this)}}})?n.apply(t,o):n)||(e.exports=i)}()},525:function(e,t){t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,h=r?-1:1,p=e[t+f];for(f+=h,i=p&(1<<-l)-1,p>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=h,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=c}return(p?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+p]=255&s,p+=d,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+p]=255&a,p+=d,a/=256,c-=8);e[r+p-d]|=128*g}},430:function(e,t,r){var n=r(685),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,t){for(var r=new i,n=0,o=e.length;n<o;n++)r.add(e[n],t);return r},i.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(e,t){var r=n.toSetString(e),i=o.call(this._set,r),a=this._array.length;i&&!t||this._array.push(e),i||(this._set[r]=a)},i.prototype.has=function(e){var t=n.toSetString(e);return o.call(this._set,t)},i.prototype.indexOf=function(e){var t=n.toSetString(e);if(o.call(this._set,t))return this._set[t];throw new Error('"'+e+'" is not in the set.')},i.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},i.prototype.toArray=function(){return this._array.slice()},t.I=i},773:function(e,t,r){var n=r(626);t.encode=function(e){var t,r="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&o,(o>>>=5)>0&&(t|=32),r+=n.encode(t)}while(o>0);return r},t.decode=function(e,t,r){var o,i,a,s,u=e.length,c=0,l=0;do{if(t>=u)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=n.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),c+=(i&=31)<<l,l+=5}while(o);r.value=(s=(a=c)>>1,1==(1&a)?-s:s),r.rest=t}},626:function(e,t){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<r.length)return r[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},509:function(e,t){function r(e,n,o,i,a,s){var u=Math.floor((n-e)/2)+e,c=a(o,i[u],!0);return 0===c?u:c>0?n-u>1?r(u,n,o,i,a,s):s==t.LEAST_UPPER_BOUND?n<i.length?n:-1:u:u-e>1?r(e,u,o,i,a,s):s==t.LEAST_UPPER_BOUND?u:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,n,o,i){if(0===n.length)return-1;var a=r(-1,n.length,e,n,o,i||t.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===o(n[a],n[a-1],!0);)--a;return a}},186:function(e,t,r){var n=r(685);function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){var t,r,o,i,a,s;t=this._last,r=e,o=t.generatedLine,i=r.generatedLine,a=t.generatedColumn,s=r.generatedColumn,i>o||i==o&&s>=a||n.compareByGeneratedPositionsInflated(t,r)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(n.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.H=o},906:function(e,t){function r(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function n(e,t,o,i){if(o<i){var a=o-1;r(e,(l=o,f=i,Math.round(l+Math.random()*(f-l))),i);for(var s=e[i],u=o;u<i;u++)t(e[u],s)<=0&&r(e,a+=1,u);r(e,a+1,u);var c=a+1;n(e,t,o,c-1),n(e,t,c+1,i)}var l,f}t.U=function(e,t){n(e,t,0,e.length-1)}},351:function(e,t,r){var n=r(685),o=r(509),i=r(430).I,a=r(773),s=r(906).U;function u(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new f(t):new c(t)}function c(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=n.getArg(t,"version"),o=n.getArg(t,"sources"),a=n.getArg(t,"names",[]),s=n.getArg(t,"sourceRoot",null),u=n.getArg(t,"sourcesContent",null),c=n.getArg(t,"mappings"),l=n.getArg(t,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);o=o.map(String).map(n.normalize).map((function(e){return s&&n.isAbsolute(s)&&n.isAbsolute(e)?n.relative(s,e):e})),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(o,!0),this.sourceRoot=s,this.sourcesContent=u,this._mappings=c,this.file=l}function l(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function f(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=n.getArg(t,"version"),o=n.getArg(t,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=o.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=n.getArg(e,"offset"),r=n.getArg(t,"line"),o=n.getArg(t,"column");if(r<a.line||r===a.line&&o<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=t,{generatedOffset:{generatedLine:r+1,generatedColumn:o+1},consumer:new u(n.getArg(e,"map"))}}))}u.fromSourceMap=function(e){return c.fromSourceMap(e)},u.prototype._version=3,u.prototype.__generatedMappings=null,Object.defineProperty(u.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),u.prototype.__originalMappings=null,Object.defineProperty(u.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),u.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return";"===r||","===r},u.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},u.GENERATED_ORDER=1,u.ORIGINAL_ORDER=2,u.GREATEST_LOWER_BOUND=1,u.LEAST_UPPER_BOUND=2,u.prototype.eachMapping=function(e,t,r){var o,i=t||null;switch(r||u.GENERATED_ORDER){case u.GENERATED_ORDER:o=this._generatedMappings;break;case u.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;o.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return null!=t&&null!=a&&(t=n.join(a,t)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}}),this).forEach(e,i)},u.prototype.allGeneratedPositionsFor=function(e){var t=n.getArg(e,"line"),r={source:n.getArg(e,"source"),originalLine:t,originalColumn:n.getArg(e,"column",0)};if(null!=this.sourceRoot&&(r.source=n.relative(this.sourceRoot,r.source)),!this._sources.has(r.source))return[];r.source=this._sources.indexOf(r.source);var i=[],a=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(a>=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var c=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==c;)i.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return i},t.SourceMapConsumer=u,c.prototype=Object.create(u.prototype),c.prototype.consumer=u,c.fromSourceMap=function(e){var t=Object.create(c.prototype),r=t._names=i.fromArray(e._names.toArray(),!0),o=t._sources=i.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),u=t.__generatedMappings=[],f=t.__originalMappings=[],h=0,p=a.length;h<p;h++){var d=a[h],g=new l;g.generatedLine=d.generatedLine,g.generatedColumn=d.generatedColumn,d.source&&(g.source=o.indexOf(d.source),g.originalLine=d.originalLine,g.originalColumn=d.originalColumn,d.name&&(g.name=r.indexOf(d.name)),f.push(g)),u.push(g)}return s(t.__originalMappings,n.compareByOriginalPositions),t},c.prototype._version=3,Object.defineProperty(c.prototype,"sources",{get:function(){return this._sources.toArray().map((function(e){return null!=this.sourceRoot?n.join(this.sourceRoot,e):e}),this)}}),c.prototype._parseMappings=function(e,t){for(var r,o,i,u,c,f=1,h=0,p=0,d=0,g=0,v=0,m=e.length,y=0,b={},w={},x=[],S=[];y<m;)if(";"===e.charAt(y))f++,y++,h=0;else if(","===e.charAt(y))y++;else{for((r=new l).generatedLine=f,u=y;u<m&&!this._charIsMappingSeparator(e,u);u++);if(i=b[o=e.slice(y,u)])y+=o.length;else{for(i=[];y<u;)a.decode(e,y,w),c=w.value,y=w.rest,i.push(c);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");b[o]=i}r.generatedColumn=h+i[0],h=r.generatedColumn,i.length>1&&(r.source=g+i[1],g+=i[1],r.originalLine=p+i[2],p=r.originalLine,r.originalLine+=1,r.originalColumn=d+i[3],d=r.originalColumn,i.length>4&&(r.name=v+i[4],v+=i[4])),S.push(r),"number"==typeof r.originalLine&&x.push(r)}s(S,n.compareByGeneratedPositionsDeflated),this.__generatedMappings=S,s(x,n.compareByOriginalPositions),this.__originalMappings=x},c.prototype._findMapping=function(e,t,r,n,i,a){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return o.search(e,t,i,a)},c.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},c.prototype.originalPositionFor=function(e){var t={generatedLine:n.getArg(e,"line"),generatedColumn:n.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",n.compareByGeneratedPositionsDeflated,n.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(r>=0){var o=this._generatedMappings[r];if(o.generatedLine===t.generatedLine){var i=n.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=n.join(this.sourceRoot,i)));var a=n.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:i,line:n.getArg(o,"originalLine",null),column:n.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e})))},c.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=n.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=n.urlParse(this.sourceRoot))){var o=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(e){var t=n.getArg(e,"source");if(null!=this.sourceRoot&&(t=n.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};var r={source:t=this._sources.indexOf(t),originalLine:n.getArg(e,"line"),originalColumn:n.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,n.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:n.getArg(i,"generatedLine",null),column:n.getArg(i,"generatedColumn",null),lastColumn:n.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},f.prototype=Object.create(u.prototype),f.prototype.constructor=u,f.prototype._version=3,Object.defineProperty(f.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),f.prototype.originalPositionFor=function(e){var t={generatedLine:n.getArg(e,"line"),generatedColumn:n.getArg(e,"column")},r=o.search(t,this._sections,(function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r||e.generatedColumn-t.generatedOffset.generatedColumn})),i=this._sections[r];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},f.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},f.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r].consumer.sourceContentFor(e,!0);if(n)return n}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},f.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(-1!==r.consumer.sources.indexOf(n.getArg(e,"source"))){var o=r.consumer.generatedPositionFor(e);if(o)return{line:o.line+(r.generatedOffset.generatedLine-1),column:o.column+(r.generatedOffset.generatedLine===o.line?r.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},f.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var o=this._sections[r],i=o.consumer._generatedMappings,a=0;a<i.length;a++){var u=i[a],c=o.consumer._sources.at(u.source);null!==o.consumer.sourceRoot&&(c=n.join(o.consumer.sourceRoot,c)),this._sources.add(c),c=this._sources.indexOf(c);var l=o.consumer._names.at(u.name);this._names.add(l),l=this._names.indexOf(l);var f={source:c,generatedLine:u.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(o.generatedOffset.generatedLine===u.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:l};this.__generatedMappings.push(f),"number"==typeof f.originalLine&&this.__originalMappings.push(f)}s(this.__generatedMappings,n.compareByGeneratedPositionsDeflated),s(this.__originalMappings,n.compareByOriginalPositions)}},60:function(e,t,r){var n=r(773),o=r(685),i=r(430).I,a=r(186).H;function s(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new i,this._names=new i,this._mappings=new a,this._sourcesContents=null}s.prototype._version=3,s.fromSourceMap=function(e){var t=e.sourceRoot,r=new s({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=o.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)})),e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&r.setSourceContent(t,n)})),r},s.prototype.addMapping=function(e){var t=o.getArg(e,"generated"),r=o.getArg(e,"original",null),n=o.getArg(e,"source",null),i=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,i),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:i})},s.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=o.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},s.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var a=this._sourceRoot;null!=a&&(n=o.relative(a,n));var s=new i,u=new i;this._mappings.unsortedForEach((function(t){if(t.source===n&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=r&&(t.source=o.join(r,t.source)),null!=a&&(t.source=o.relative(a,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var c=t.source;null==c||s.has(c)||s.add(c);var l=t.name;null==l||u.has(l)||u.add(l)}),this),this._sources=s,this._names=u,e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=o.join(r,t)),null!=a&&(t=o.relative(a,t)),this.setSourceContent(t,n))}),this)},s.prototype._validateMapping=function(e,t,r,n){if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},s.prototype._serializeMappings=function(){for(var e,t,r,i,a=0,s=1,u=0,c=0,l=0,f=0,h="",p=this._mappings.toArray(),d=0,g=p.length;d<g;d++){if(e="",(t=p[d]).generatedLine!==s)for(a=0;t.generatedLine!==s;)e+=";",s++;else if(d>0){if(!o.compareByGeneratedPositionsInflated(t,p[d-1]))continue;e+=","}e+=n.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(i=this._sources.indexOf(t.source),e+=n.encode(i-f),f=i,e+=n.encode(t.originalLine-1-c),c=t.originalLine-1,e+=n.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=n.encode(r-l),l=r)),h+=e}return h},s.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var r=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)},s.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},s.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=s},164:function(e,t,r){var n=r(60).SourceMapGenerator,o=r(685),i=/(\r?\n)/,a="$$$isSourceNode$$$";function s(e,t,r,n,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==o?null:o,this[a]=!0,null!=n&&this.add(n)}s.fromStringWithSourceMap=function(e,t,r){var n=new s,a=e.split(i),u=function(){return a.shift()+(a.shift()||"")},c=1,l=0,f=null;return t.eachMapping((function(e){if(null!==f){if(!(c<e.generatedLine)){var t=(r=a[0]).substr(0,e.generatedColumn-l);return a[0]=r.substr(e.generatedColumn-l),l=e.generatedColumn,h(f,t),void(f=e)}h(f,u()),c++,l=0}for(;c<e.generatedLine;)n.add(u()),c++;if(l<e.generatedColumn){var r=a[0];n.add(r.substr(0,e.generatedColumn)),a[0]=r.substr(e.generatedColumn),l=e.generatedColumn}f=e}),this),a.length>0&&(f&&h(f,u()),n.add(a.join(""))),t.sources.forEach((function(e){var i=t.sourceContentFor(e);null!=i&&(null!=r&&(e=o.join(r,e)),n.setSourceContent(e,i))})),n;function h(e,t){if(null===e||void 0===e.source)n.add(t);else{var i=r?o.join(r,e.source):e.source;n.add(new s(e.originalLine,e.originalColumn,i,t,e.name))}}},s.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},s.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},s.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r<n;r++)(t=this.children[r])[a]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},s.prototype.join=function(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;r<n-1;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},s.prototype.replaceRight=function(e,t){var r=this.children[this.children.length-1];return r[a]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},s.prototype.setSourceContent=function(e,t){this.sourceContents[o.toSetString(e)]=t},s.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][a]&&this.children[t].walkSourceContents(e);var n=Object.keys(this.sourceContents);for(t=0,r=n.length;t<r;t++)e(o.fromSetString(n[t]),this.sourceContents[n[t]])},s.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},s.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},r=new n(e),o=!1,i=null,a=null,s=null,u=null;return this.walk((function(e,n){t.code+=e,null!==n.source&&null!==n.line&&null!==n.column?(i===n.source&&a===n.line&&s===n.column&&u===n.name||r.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:t.line,column:t.column},name:n.name}),i=n.source,a=n.line,s=n.column,u=n.name,o=!0):o&&(r.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var c=0,l=e.length;c<l;c++)10===e.charCodeAt(c)?(t.line++,t.column=0,c+1===l?(i=null,o=!1):o&&r.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:t.line,column:t.column},name:n.name})):t.column++})),this.walkSourceContents((function(e,t){r.setSourceContent(e,t)})),{code:t.code,map:r}},t.SourceNode=s},685:function(e,t){t.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,n=/^data:.+\,.+$/;function o(e){var t=e.match(r);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function a(e){var r=e,n=o(e);if(n){if(!n.path)return e;r=n.path}for(var a,s=t.isAbsolute(r),u=r.split(/\/+/),c=0,l=u.length-1;l>=0;l--)"."===(a=u[l])?u.splice(l,1):".."===a?c++:c>0&&(""===a?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return""===(r=u.join("/"))&&(r=s?"/":"."),n?(n.path=r,i(n)):r}t.urlParse=o,t.urlGenerate=i,t.normalize=a,t.join=function(e,t){""===e&&(e="."),""===t&&(t=".");var r=o(t),s=o(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),i(r);if(r||t.match(n))return t;if(s&&!s.host&&!s.path)return s.host=t,i(s);var u="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=u,i(s)):u},t.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(r)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var s=!("__proto__"in Object.create(null));function u(e){return e}function c(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function l(e,t){return e===t?0:e>t?1:-1}t.toSetString=s?u:function(e){return c(e)?"$"+e:e},t.fromSetString=s?u:function(e){return c(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,r){var n=e.source-t.source;return 0!==n||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)||r||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=e.generatedLine-t.generatedLine)?n:e.name-t.name},t.compareByGeneratedPositionsDeflated=function(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||r||0!==(n=e.source-t.source)||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:e.name-t.name},t.compareByGeneratedPositionsInflated=function(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=l(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:l(e.name,t.name)}},8:function(e,t,r){t.SourceMapGenerator=r(60).SourceMapGenerator,t.SourceMapConsumer=r(351).SourceMapConsumer,t.SourceNode=r(164).SourceNode},894:function(e,t,r){var n,o,i,a=r(505).default;!function(s,u){"use strict";o=[r(901)],n=function(e){return{backtrace:function(t){var r=[],n=10;"object"===a(t)&&"number"==typeof t.maxStackSize&&(n=t.maxStackSize);for(var o=arguments.callee;o&&r.length<n&&o.arguments;){for(var i=new Array(o.arguments.length),s=0;s<i.length;++s)i[s]=o.arguments[s];/function(?:\s+([\w$]+))+\s*\(/.test(o.toString())?r.push(new e({functionName:RegExp.$1||void 0,args:i})):r.push(new e({args:i}));try{o=o.caller}catch(e){break}}return r}}},void 0===(i="function"==typeof n?n.apply(t,o):n)||(e.exports=i)}()},901:function(e,t,r){var n,o,i;r(505).default;!function(r,a){"use strict";o=[],void 0===(i="function"==typeof(n=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function r(e){return function(){return this[e]}}var n=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],i=["fileName","functionName","source"],a=["args"],s=["evalOrigin"],u=n.concat(o,i,a,s);function c(e){if(e)for(var r=0;r<u.length;r++)void 0!==e[u[r]]&&this["set"+t(u[r])](e[u[r]])}c.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof c)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new c(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",n=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:n?n+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r}},c.fromString=function(e){var t=e.indexOf("("),r=e.lastIndexOf(")"),n=e.substring(0,t),o=e.substring(t+1,r).split(","),i=e.substring(r+1);if(0===i.indexOf("@"))var a=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(i,""),s=a[1],u=a[2],l=a[3];return new c({functionName:n,args:o||void 0,fileName:s,lineNumber:u||void 0,columnNumber:l||void 0})};for(var l=0;l<n.length;l++)c.prototype["get"+t(n[l])]=r(n[l]),c.prototype["set"+t(n[l])]=function(e){return function(t){this[e]=Boolean(t)}}(n[l]);for(var f=0;f<o.length;f++)c.prototype["get"+t(o[f])]=r(o[f]),c.prototype["set"+t(o[f])]=function(t){return function(r){if(!e(r))throw new TypeError(t+" must be a Number");this[t]=Number(r)}}(o[f]);for(var h=0;h<i.length;h++)c.prototype["get"+t(i[h])]=r(i[h]),c.prototype["set"+t(i[h])]=function(e){return function(t){this[e]=String(t)}}(i[h]);return c})?n.apply(t,o):n)||(e.exports=i)}()},500:function(e,t,r){var n,o,i,a=r(505).default;!function(s,u){"use strict";o=[r(8),r(901)],void 0===(i="function"==typeof(n=function(e,t){function r(e){return new Promise((function(t,r){var n=new XMLHttpRequest;n.open("get",e),n.onerror=r,n.onreadystatechange=function(){4===n.readyState&&(n.status>=200&&n.status<300||"file://"===e.substr(0,7)&&n.responseText?t(n.responseText):r(new Error("HTTP status: "+n.status+" retrieving "+e)))},n.send()}))}function n(e){if("undefined"!=typeof window&&window.atob)return window.atob(e);throw new Error("You must supply a polyfill for window.atob in this environment")}function o(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function i(e,t){for(var r=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],n=e.split("\n"),o="",i=Math.min(t,20),a=0;a<i;++a){var s=n[t-a-1],u=s.indexOf("//");if(u>=0&&(s=s.substr(0,u)),s){o=s+o;for(var c=r.length,l=0;l<c;l++){var f=r[l].exec(o);if(f&&f[1])return f[1]}}}}function s(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")}function u(e){if("object"!==a(e))throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!=0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!=0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function c(e){for(var t,r,n=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;r=n.exec(e);)t=r[1];if(t)return t;throw new Error("sourceMappingURL not found")}function l(e,r,n){return new Promise((function(o,i){var a=r.originalPositionFor({line:e.lineNumber,column:e.columnNumber});if(a.source){var s=r.sourceContentFor(a.source);s&&(n[a.source]=s),o(new t({functionName:a.name||e.functionName,args:e.args,fileName:a.source,lineNumber:a.line,columnNumber:a.column}))}else i(new Error("Could not get original source for given stackframe and source map"))}))}return function a(f){if(!(this instanceof a))return new a(f);f=f||{},this.sourceCache=f.sourceCache||{},this.sourceMapConsumerCache=f.sourceMapConsumerCache||{},this.ajax=f.ajax||r,this._atob=f.atob||n,this._get=function(e){return new Promise(function(t,r){var n="data:"===e.substr(0,5);if(this.sourceCache[e])t(this.sourceCache[e]);else if(f.offline&&!n)r(new Error("Cannot make network requests in offline mode"));else if(n){var o=/^data:application\/json;([\w=:"-]+;)*base64,/,i=e.match(o);if(i){var a=i[0].length,s=e.substr(a),u=this._atob(s);this.sourceCache[e]=u,t(u)}else r(new Error("The encoding of the inline sourcemap is not supported"))}else{var c=this.ajax(e,{method:"get"});this.sourceCache[e]=c,c.then(t,r)}}.bind(this))},this._getSourceMapConsumer=function(t,r){return new Promise(function(n){if(this.sourceMapConsumerCache[t])n(this.sourceMapConsumerCache[t]);else{var i=new Promise(function(n,i){return this._get(t).then((function(t){"string"==typeof t&&(t=o(t.replace(/^\)\]\}'/,""))),void 0===t.sourceRoot&&(t.sourceRoot=r),n(new e.SourceMapConsumer(t))})).catch(i)}.bind(this));this.sourceMapConsumerCache[t]=i,n(i)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(t,r){this.getMappedLocation(e).then(function(e){function r(){t(e)}this.findFunctionName(e).then(t,r).catch(r)}.bind(this),r)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(r,n){u(e),this._get(e.fileName).then((function(n){var o=e.lineNumber,a=e.columnNumber,s=i(n,o,a);r(s?new t({functionName:s,args:e.args,fileName:e.fileName,lineNumber:o,columnNumber:a}):e)}),n).catch(n)}.bind(this))},this.getMappedLocation=function(e){return new Promise(function(t,r){s(),u(e);var n=this.sourceCache,o=e.fileName;this._get(o).then(function(r){var i=c(r),a="data:"===i.substr(0,5),s=o.substring(0,o.lastIndexOf("/")+1);return"/"===i[0]||a||/^https?:\/\/|^\/\//i.test(i)||(i=s+i),this._getSourceMapConsumer(i,s).then((function(r){return l(e,r,n).then(t).catch((function(){t(e)}))}))}.bind(this),r).catch(r)}.bind(this))}}})?n.apply(t,o):n)||(e.exports=i)}()},693:function(e,t,r){var n,o,i,a=r(505).default;!function(s,u){"use strict";o=[r(948),r(894),r(500)],n=function(e,t,r){var n={filter:function(e){return-1===(e.functionName||"").indexOf("StackTrace$$")&&-1===(e.functionName||"").indexOf("ErrorStackParser$$")&&-1===(e.functionName||"").indexOf("StackTraceGPS$$")&&-1===(e.functionName||"").indexOf("StackGenerator$$")},sourceCache:{}},o=function(){try{throw new Error}catch(e){return e}};function i(e,t){var r={};return[e,t].forEach((function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r})),r}function s(e){return e.stack||e["opera#sourceloc"]}function u(e,t){return"function"==typeof t?e.filter(t):e}return{get:function(e){var t=o();return s(t)?this.fromError(t,e):this.generateArtificially(e)},getSync:function(r){r=i(n,r);var a=o();return u(s(a)?e.parse(a):t.backtrace(r),r.filter)},fromError:function(t,o){o=i(n,o);var a=new r(o);return new Promise(function(r){var n=u(e.parse(t),o.filter);r(Promise.all(n.map((function(e){return new Promise((function(t){function r(){t(e)}a.pinpoint(e).then(t,r).catch(r)}))}))))}.bind(this))},generateArtificially:function(e){e=i(n,e);var r=t.backtrace(e);return"function"==typeof e.filter&&(r=r.filter(e.filter)),Promise.resolve(r)},instrument:function(e,t,r,n){if("function"!=typeof e)throw new Error("Cannot instrument non-function object");if("function"==typeof e.__stacktraceOriginalFn)return e;var o=function(){try{return this.get().then(t,r).catch(r),e.apply(n||this,arguments)}catch(e){throw s(e)&&this.fromError(e).then(t,r).catch(r),e}}.bind(this);return o.__stacktraceOriginalFn=e,o},deinstrument:function(e){if("function"!=typeof e)throw new Error("Cannot de-instrument non-function object");return"function"==typeof e.__stacktraceOriginalFn?e.__stacktraceOriginalFn:e},report:function(e,t,r,n){return new Promise((function(o,i){var s=new XMLHttpRequest;if(s.onerror=i,s.onreadystatechange=function(){4===s.readyState&&(s.status>=200&&s.status<400?o(s.responseText):i(new Error("POST to "+t+" failed with status: "+s.status)))},s.open("post",t),s.setRequestHeader("Content-Type","application/json"),n&&"object"===a(n.headers)){var u=n.headers;for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&s.setRequestHeader(c,u[c])}var l={stack:e};null!=r&&(l.message=r),s.send(JSON.stringify(l))}))}}},void 0===(i="function"==typeof n?n.apply(t,o):n)||(e.exports=i)}()},64:function(t){"use strict";t.exports=e},349:function(e){"use strict";e.exports=t},663:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},342:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},750:function(e){function t(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=e.apply(r,n);function s(e){t(a,o,i,s,u,"next",e)}function u(e){t(a,o,i,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},811:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},997:function(e,t,r){var n=r(969);function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},411:function(e,t,r){var n=r(969);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},644:function(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},149:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},731:function(e,t,r){var n=r(411);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.exports=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},25:function(e,t,r){var n=r(505).default;function o(){"use strict";e.exports=o=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(t){h=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),a=new R(n||[]);return s(i,"_invoke",{value:A(e,r,a)}),i}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var g="suspendedStart",v="executing",m="completed",y={};function b(){}function w(){}function x(){}var S={};h(S,c,(function(){return this}));var _=Object.getPrototypeOf,E=_&&_(_(T([])));E&&E!==i&&a.call(E,c)&&(S=E);var k=x.prototype=b.prototype=Object.create(S);function C(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(o,i,s,u){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var o;s(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}})}function A(e,r,n){var o=g;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=L(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===g)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=d(e,r,n);if("normal"===c.type){if(o=n.done?m:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=d(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(a.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,s(k,"constructor",{value:x,configurable:!0}),s(x,"constructor",{value:w,configurable:!0}),w.displayName=h(x,f,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,h(e,f,"GeneratorFunction")),e.prototype=Object.create(k),e},r.awrap=function(e){return{__await:e}},C(O.prototype),h(O.prototype,l,(function(){return this})),r.AsyncIterator=O,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var a=new O(p(e,t,n,o),i);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(k),h(k,f,"Generator"),h(k,c,(function(){return this})),h(k,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=T,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},r}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},488:function(e,t,r){var n=r(342),o=r(644),i=r(239),a=r(149);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},159:function(e,t,r){var n=r(505).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},969:function(e,t,r){var n=r(505).default,o=r(159);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},505:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},239:function(e,t,r){var n=r(663);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e].call(r.exports,r,r.exports,a),r.exports}a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},a.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var o=Object.create(null);a.r(o);var i={};r=r||[null,n({}),n([]),n(n)];for(var s=2&t&&e;"object"==typeof s&&!~r.indexOf(s);s=n(s))Object.getOwnPropertyNames(s).forEach((function(t){i[t]=function(){return e[t]}}));return i.default=function(){return e},a.d(o,i),o},a.d=function(e,t){for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return function(){"use strict";a.r(s),a.d(s,{LoggerSDK:function(){return Pe},gzipCompress:function(){return _e},isGzipSupported:function(){return ke}});var e=a(25),t=a.n(e),r=a(750),n=a.n(r),o=a(488),i=a.n(o),u=a(811),c=a.n(u),l=a(997),f=a.n(l),h=a(411),p=a.n(h),d=a(693),g=a.n(d);function v(e){return m.apply(this,arguments)}function m(){return(m=n()(t()().mark((function e(r){var n;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g().fromError(r);case 2:return n=e.sent,e.abrupt("return",n.slice(0,5).map((function(e){return{file:e.fileName||"",line:e.lineNumber||0,column:e.columnNumber||0,function:e.functionName||void 0}})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var y=a(505),b=a.n(y),w=(a(179).lW,function(){return Date.now()});function x(e){var t=new WeakSet;return JSON.stringify(e,(function(e,r){if(r&&"object"===b()(r)){if(t.has(r))return"[Circular]";t.add(r)}return r}))}function S(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e&&(t=console).debug.apply(t,["[LoggerSDK]"].concat(n))}function _(e){return E.apply(this,arguments)}function E(){return(E=n()(t()().mark((function e(r){var n;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",{location:"",throwable:""});case 2:return e.next=4,v(r);case 4:return n=e.sent,e.abrupt("return",n&&n.length>0?{location:[n[0]].map((function(e){return"".concat(e.file,":").concat(e.line,":").concat(e.column)})).join("\n\t"),throwable:n.map((function(e){return"".concat(e.file,":").concat(e.line,":").concat(e.column)})).join("\n\t")}:{location:"",throwable:""});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var k=function(e){switch(e){case"product":default:return"https://apm.pharmacyyf.com";case"testing":return"https://apm-te.pharmacyyf.com";case"develop":return"https://chief-dev.yifengx.com"}},C=function(e){return"".concat(k(e),"/yfcloud-apm/log/front/batchSave")};function O(){try{return"undefined"!=typeof window&&void 0!==window.document}catch(e){return!1}}function A(){try{return"undefined"!=typeof wx&&"function"==typeof wx.getSystemInfo}catch(e){return!1}}function L(){if(A())try{var e=getCurrentPages();if(e&&e.length>0)return e[e.length-1].route||""}catch(e){return""}return O()?window.location.href:""}function M(){var e=function(){var e={platform:"unknown"};if(A()){e.platform="wechat";try{var t=wx.getSystemInfoSync();e.systemInfo={brand:t.brand,model:t.model,system:t.system,platform:t.platform,version:t.version,SDKVersion:t.SDKVersion},e.screenWidth=t.screenWidth,e.screenHeight=t.screenHeight,e.language=t.language}catch(e){}}else O()&&(e.platform="browser",e.userAgent=navigator.userAgent,e.screenWidth=window.screen.width,e.screenHeight=window.screen.height,e.language=navigator.language);return e}(),t={platform:e.platform};if("browser"===e.platform&&e.userAgent){var r=function(e){var t=e.toLowerCase(),r="Unknown",n="",o="Unknown",a="";if(t.indexOf("chrome")>-1&&-1===t.indexOf("edge")){r="Chrome";var s=t.match(/chrome\/(\d+\.\d+)/);n=s?s[1]:""}else if(t.indexOf("safari")>-1&&-1===t.indexOf("chrome")){r="Safari";var u=t.match(/version\/(\d+\.\d+)/);n=u?u[1]:""}else if(t.indexOf("firefox")>-1){r="Firefox";var c=t.match(/firefox\/(\d+\.\d+)/);n=c?c[1]:""}else if(t.indexOf("edge")>-1){r="Edge";var l=t.match(/edge\/(\d+\.\d+)/);n=l?l[1]:""}if(t.indexOf("iphone")>-1||t.indexOf("ipad")>-1){o="iOS";var f=t.match(/os (\d+[._]\d+)/);a=f?f[1].replace("_","."):""}else if(t.indexOf("windows")>-1)o="Windows",t.indexOf("windows nt 10")>-1?a="10":t.indexOf("windows nt 6.3")>-1?a="8.1":t.indexOf("windows nt 6.2")>-1?a="8":t.indexOf("windows nt 6.1")>-1&&(a="7");else if(t.indexOf("mac os")>-1){o="macOS";var h=t.match(/mac os x (\d+[._]\d+)/);a=h?h[1].replace("_","."):""}else if(t.indexOf("android")>-1){o="Android";var p=t.match(/android (\d+(?:\.\d+)?)/);p?-1===(a=i()(p,2)[1]).indexOf(".")&&(a="".concat(a,".0")):a=""}else t.indexOf("linux")>-1&&(o="Linux");return{browser:r,browserVersion:n,os:o,osVersion:a}}(e.userAgent);t.browser=r.browser,t.browserVersion=r.browserVersion,t.os=r.os,t.osVersion=r.osVersion,t.screenWidth=e.screenWidth,t.screenHeight=e.screenHeight,t.language=e.language}else"wechat"===e.platform&&e.systemInfo&&(t.brand=e.systemInfo.brand,t.model=e.systemInfo.model,t.system=e.systemInfo.system,t.wechatVersion=e.systemInfo.version,t.SDKVersion=e.systemInfo.SDKVersion,t.screenWidth=e.screenWidth,t.screenHeight=e.screenHeight,t.language=e.language);return t}var I=a(731),R=a.n(I),T=Uint8Array,B=Uint16Array,P=Int32Array,j=new T([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,0,0,0]),N=new T([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),U=new T([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),q=function(e,t){for(var r=new B(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var o=new P(r[30]);for(n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},z=q(j,2),D=z.b,F=z.r;D[28]=258,F[258]=28;for(var G=q(N,0),W=(G.b,G.r),$=new B(32768),K=0;K<32768;++K){var J=(43690&K)>>1|(21845&K)<<1;J=(61680&(J=(52428&J)>>2|(13107&J)<<2))>>4|(3855&J)<<4,$[K]=((65280&J)>>8|(255&J)<<8)>>1}var H=function(e,t,r){for(var n=e.length,o=0,i=new B(t);o<n;++o)e[o]&&++i[e[o]-1];var a,s=new B(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(r){a=new B(1<<t);var u=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],l=t-e[o],f=s[e[o]-1]++<<l,h=f|(1<<l)-1;f<=h;++f)a[$[f]>>u]=c}else for(a=new B(n),o=0;o<n;++o)e[o]&&(a[o]=$[s[e[o]-1]++]>>15-e[o]);return a},V=new T(288);for(K=0;K<144;++K)V[K]=8;for(K=144;K<256;++K)V[K]=9;for(K=256;K<280;++K)V[K]=7;for(K=280;K<288;++K)V[K]=8;var Y=new T(32);for(K=0;K<32;++K)Y[K]=5;var Q=H(V,9,0),Z=H(Y,5,0),X=function(e){return(e+7)/8|0},ee=function(e,t,r){return(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length),new T(e.subarray(t,r))},te=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},re=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},ne=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return{t:le,l:0};if(1==o){var a=new T(r[0].s+1);return a[r[0].s]=1,{t:a,l:1}}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var s=r[0],u=r[1],c=0,l=1,f=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};l!=o-1;)s=r[r[c].f<r[f].f?c++:f++],u=r[c!=l&&r[c].f<r[f].f?c++:f++],r[l++]={s:-1,f:s.f+u.f,l:s,r:u};var h=i[0].s;for(n=1;n<o;++n)i[n].s>h&&(h=i[n].s);var p=new B(h+1),d=oe(r[l-1],p,0);if(d>t){n=0;var g=0,v=d-t,m=1<<v;for(i.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<o;++n){var y=i[n].s;if(!(p[y]>t))break;g+=m-(1<<d-p[y]),p[y]=t}for(g>>=v;g>0;){var b=i[n].s;p[b]<t?g-=1<<t-p[b]++-1:++n}for(;n>=0&&g;--n){var w=i[n].s;p[w]==t&&(--p[w],++g)}d=t}return{t:new T(p),l:d}},oe=function e(t,r,n){return-1==t.s?Math.max(e(t.l,r,n+1),e(t.r,r,n+1)):r[t.s]=n},ie=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new B(++t),n=0,o=e[0],i=1,a=function(e){r[n++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return{c:r.subarray(0,n),n:t}},ae=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},se=function(e,t,r){var n=r.length,o=X(t+2);e[o]=255&n,e[o+1]=n>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<n;++i)e[o+i+4]=r[i];return 8*(o+4+n)},ue=function(e,t,r,n,o,i,a,s,u,c,l){te(t,l++,r),++o[256];for(var f=ne(o,15),h=f.t,p=f.l,d=ne(i,15),g=d.t,v=d.l,m=ie(h),y=m.c,b=m.n,w=ie(g),x=w.c,S=w.n,_=new B(19),E=0;E<y.length;++E)++_[31&y[E]];for(E=0;E<x.length;++E)++_[31&x[E]];for(var k=ne(_,7),C=k.t,O=k.l,A=19;A>4&&!C[U[A-1]];--A);var L,M,I,R,T=c+5<<3,P=ae(o,V)+ae(i,Y)+a,q=ae(o,h)+ae(i,g)+a+14+3*A+ae(_,C)+2*_[16]+3*_[17]+7*_[18];if(u>=0&&T<=P&&T<=q)return se(t,l,e.subarray(u,u+c));if(te(t,l,1+(q<P)),l+=2,q<P){L=H(h,p,0),M=h,I=H(g,v,0),R=g;var z=H(C,O,0);te(t,l,b-257),te(t,l+5,S-1),te(t,l+10,A-4),l+=14;for(E=0;E<A;++E)te(t,l+3*E,C[U[E]]);l+=3*A;for(var D=[y,x],F=0;F<2;++F){var G=D[F];for(E=0;E<G.length;++E){var W=31&G[E];te(t,l,z[W]),l+=C[W],W>15&&(te(t,l,G[E]>>5&127),l+=G[E]>>12)}}}else L=Q,M=V,I=Z,R=Y;for(E=0;E<s;++E){var $=n[E];if($>255){re(t,l,L[(W=$>>18&31)+257]),l+=M[W+257],W>7&&(te(t,l,$>>23&31),l+=j[W]);var K=31&$;re(t,l,I[K]),l+=R[K],K>3&&(re(t,l,$>>5&8191),l+=N[K])}else re(t,l,L[$]),l+=M[$]}return re(t,l,L[256]),l+M[256]},ce=new P([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),le=new T(0),fe=function(e,t,r,n,o,i){var a=i.z||e.length,s=new T(n+a+5*(1+Math.ceil(a/7e3))+o),u=s.subarray(n,s.length-o),c=i.l,l=7&(i.r||0);if(t){l&&(u[0]=i.r>>3);for(var f=ce[t-1],h=f>>13,p=8191&f,d=(1<<r)-1,g=i.p||new B(32768),v=i.h||new B(d+1),m=Math.ceil(r/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&d},w=new P(25e3),x=new B(288),S=new B(32),_=0,E=0,k=i.i||0,C=0,O=i.w||0,A=0;k+2<a;++k){var L=b(k),M=32767&k,I=v[L];if(g[M]=I,v[L]=M,O<=k){var R=a-k;if((_>7e3||C>24576)&&(R>423||!c)){l=ue(e,u,0,w,x,S,E,C,A,k-A,l),C=_=E=0,A=k;for(var U=0;U<286;++U)x[U]=0;for(U=0;U<30;++U)S[U]=0}var q=2,z=0,D=p,G=M-I&32767;if(R>2&&L==b(k-G))for(var $=Math.min(h,R)-1,K=Math.min(32767,k),J=Math.min(258,R);G<=K&&--D&&M!=I;){if(e[k+q]==e[k+q-G]){for(var H=0;H<J&&e[k+H]==e[k+H-G];++H);if(H>q){if(q=H,z=G,H>$)break;var V=Math.min(G,H-2),Y=0;for(U=0;U<V;++U){var Q=k-G+U&32767,Z=Q-g[Q]&32767;Z>Y&&(Y=Z,I=Q)}}}G+=(M=I)-(I=g[M])&32767}if(z){w[C++]=268435456|F[q]<<18|W[z];var te=31&F[q],re=31&W[z];E+=j[te]+N[re],++x[257+te],++S[re],O=k+q,++_}else w[C++]=e[k],++x[e[k]]}}for(k=Math.max(k,O);k<a;++k)w[C++]=e[k],++x[e[k]];l=ue(e,u,c,w,x,S,E,C,A,k-A,l),c||(i.r=7&l|u[l/8|0]<<3,l-=7,i.h=v,i.p=g,i.i=k,i.w=O)}else{for(k=i.w||0;k<a+c;k+=65535){var ne=k+65535;ne>=a&&(u[l/8|0]=c,ne=a),l=se(u,l+1,e.subarray(k,ne))}i.i=a}return ee(s,0,n+X(l)+o)},he=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&-306674912)^r>>>1;e[t]=r}return e}(),pe=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=he[255&r^t[n]]^r>>>8;e=r},d:function(){return~e}}},de=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),a=new T(i.length+e.length);a.set(i),a.set(e,i.length),e=a,o.w=i.length}return fe(e,null==t.level?6:t.level,null==t.mem?o.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,r,n,o)},ge=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},ve=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&ge(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}},me=function(e){return 10+(e.filename?e.filename.length+1:0)};function ye(e,t){t||(t={});var r=pe(),n=e.length;r.p(e);var o=de(e,t,me(t),8),i=o.length;return ve(o,t),ge(o,i-8,r.d()),ge(o,i-4,n),o}var be="undefined"!=typeof TextDecoder&&new TextDecoder;try{be.decode(le,{stream:!0}),1}catch(e){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;var we=a(64),xe=a(179).lW;function Se(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var t=encodeURIComponent(e),r=[],n=0;n<t.length;n+=1){var o=t[n];"%"===o?(r.push(parseInt(t.slice(n+1,n+3),16)),n+=2):r.push(o.charCodeAt(0))}return new Uint8Array(r)}function _e(e){return Ee.apply(this,arguments)}function Ee(){return Ee=n()(t()().mark((function e(r){var n,o,i,a,s,u,c,l,f,h,p;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!O()||"undefined"==typeof CompressionStream){e.next=21;break}return e.prev=1,n=new TextEncoder,o=n.encode(r),i=new CompressionStream("gzip"),a=new Blob([o]).stream(),s=a.pipeThrough(i),e.next=9,new Response(s).arrayBuffer();case 9:for(u=e.sent,c=new Uint8Array(u),l="",f=0;f<c.byteLength;f+=1)l+=String.fromCharCode(c[f]);if("undefined"==typeof btoa){e.next=15;break}return e.abrupt("return",btoa(l));case 15:return e.abrupt("return",xe.from(l,"base64").toString("base64"));case 18:e.prev=18,e.t0=e.catch(1),console.log("gzipCompress 压缩失败,尝试使用 fflate 库",e.t0);case 21:return e.prev=21,h=Se(r),p=ye(h),e.abrupt("return",we.Base64.fromUint8Array(p,!1));case 27:e.prev=27,e.t1=e.catch(21),console.log("gzipCompress 压缩失败",e.t1);case 30:return e.abrupt("return",we.Base64.encode(r,!1));case 31:case"end":return e.stop()}}),e,null,[[1,18],[21,27]])}))),Ee.apply(this,arguments)}function ke(){return O()&&"undefined"!=typeof CompressionStream}var Ce=function(){function e(t){c()(this,e),p()(this,"name","beacon"),p()(this,"opts",void 0),this.opts=t}var r;return f()(e,[{key:"isSupported",value:function(){return O()&&"undefined"!=typeof navigator&&navigator.sendBeacon&&"function"==typeof navigator.sendBeacon}},{key:"send",value:(r=n()(t()().mark((function e(r){var n,o,i,a,s,u,c,l,f,h,p;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s="string"==typeof r?r:x(r),u=C((null===(n=this.opts)||void 0===n?void 0:n.env)||"develop"),c="application/json",null===(o=this.opts)||void 0===o||!o.enableGzip||null!==(i=this.opts)&&void 0!==i&&i.gzipOnlyInBatchMode&&!(r.items.length>0)){e.next=9;break}return e.next=6,_e(x(r.items));case 6:l=e.sent,s=x(R()(R()({},r),{},{items:l})),c="application/json; charset=utf-8";case 9:return f=new Blob([s],{type:c}),h=navigator.sendBeacon(u,f),S(!(null===(a=this.opts)||void 0===a||!a.debug),"sendBeacon result",h),h||S(!(null===(p=this.opts)||void 0===p||!p.debug),"sendBeacon failed (queue full or other error)"),e.abrupt("return",Promise.resolve());case 14:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]),e}(),Oe=function(){function e(t){c()(this,e),p()(this,"name","image"),p()(this,"opts",void 0),this.opts=t}var r;return f()(e,[{key:"isSupported",value:function(){return O()&&"undefined"!=typeof Image}},{key:"send",value:(r=n()(t()().mark((function e(r){var n,o,i,a,s,u,c,l,f,h,p,d,g,v,m,y,b,_,E,C,O,A=this;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=x(r.items),t=(null===(n=this.opts)||void 0===n?void 0:n.env)||"develop",f="".concat(k(t),"/yfcloud-apm/log/front/pixelBatchSave"),h="items",p=(null===(o=this.opts)||void 0===o?void 0:o.maxPixelUrlLen)||8192,null===(i=this.opts)||void 0===i||!i.enableGzip||null!==(a=this.opts)&&void 0!==a&&a.gzipOnlyInBatchMode&&!(r.items.length>0)){e.next=15;break}return b=w(),S(!(null===(g=this.opts)||void 0===g||!g.debug),"PixelImage request gzip compress body: ",l),e.next=9,_e(l);case 9:d=e.sent,S(!(null===(v=this.opts)||void 0===v||!v.debug),"PixelImage request gzip compress cost: ",w()-b),S(!(null===(m=this.opts)||void 0===m||!m.debug),"original body size: ".concat(l.length,", compressed body size: ").concat(d.length)),S(!(null===(y=this.opts)||void 0===y||!y.debug),"PixelImage request gzip compress body: ",d),e.next=16;break;case 15:d=we.Base64.encode(l,!1);case 16:return _="_=".concat(Date.now()),E="appId=".concat((null===(s=this.opts)||void 0===s?void 0:s.appId)||"","&appStage=").concat((null===(u=this.opts)||void 0===u?void 0:u.logStage)||"","&").concat(h,"=").concat(encodeURIComponent(d),"&gzip=").concat(null!==(c=this.opts)&&void 0!==c&&c.enableGzip?1:0,"&").concat(_),(C=f.includes("?")?"".concat(f,"&").concat(E):"".concat(f,"?").concat(E)).length>p&&S(!(null===(O=this.opts)||void 0===O||!O.debug),"URL too long (".concat(C.length," > ").concat(p,")")),e.abrupt("return",new Promise((function(e,t){var r,n=new Image,o=!1;r=setTimeout((function(){o||(o=!0,n.src="",t(new Error("Image request timeout after 5000ms")))}),5e3),n.onload=function(){r&&clearTimeout(r),o||(o=!0,e())},n.onerror=function(t,n,i,a,s){var u,c;S(!(null===(u=A.opts)||void 0===u||!u.debug),"Image request failed",t,n,i,a,s),r&&clearTimeout(r),o||(o=!0,S(!(null===(c=A.opts)||void 0===c||!c.debug),"Image request failed",t,n,i,a,s),e())},n.src=C})));case 21:case"end":return e.stop()}var t}),e,this)}))),function(e){return r.apply(this,arguments)})}]),e}(),Ae=function(){function e(t){c()(this,e),p()(this,"name","wechat"),p()(this,"opts",void 0),this.opts=t}var r;return f()(e,[{key:"isSupported",value:function(){return A()}},{key:"send",value:(r=n()(t()().mark((function e(r){var n,o,i,a,s,u,c,l,f,h,p,d=this;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a="string"==typeof r?r:x(r),s=C((null===(n=this.opts)||void 0===n?void 0:n.env)||"develop"),u=1e4,c="application/json",null===(o=this.opts)||void 0===o||!o.enableGzip||null!==(i=this.opts)&&void 0!==i&&i.gzipOnlyInBatchMode&&!(r.items.length>0)){e.next=13;break}return h=w(),S(!(null===(l=this.opts)||void 0===l||!l.debug),"WeChat request enable gzip compress: ",h),e.next=9,_e(x(r.items));case 9:p=e.sent,a=x(R()(R()({},r),{},{items:p})),S(!(null===(f=this.opts)||void 0===f||!f.debug),"WeChat request gzip compress cost: ",w()-h),c="application/json; charset=utf-8";case 13:return e.abrupt("return",new Promise((function(e,t){var r,n,o=!1;n=setTimeout((function(){o||(o=!0,t(new Error("WeChat request timeout after ".concat(u,"ms"))))}),u),wx.request({url:s,method:"POST",data:a,header:{"Content-Type":c,token:(null===(r=d.opts)||void 0===r?void 0:r.token)||""},success:function(r){n&&clearTimeout(n),o||(o=!0,r.statusCode>=200&&r.statusCode<300?e():t(new Error("HTTP ".concat(r.statusCode))))},fail:function(e){var r;n&&clearTimeout(n),o||(o=!0,S(!(null===(r=this.opts)||void 0===r||!r.debug),"WeChat request failed",e),t(new Error("WeChat request failed: ".concat(e.errMsg||"unknown error"))))}})})));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]),e}(),Le=function(){function e(t){c()(this,e),p()(this,"beaconTransport",void 0),p()(this,"pixelImageTransport",void 0),p()(this,"wechatTransport",void 0),this.beaconTransport=new Ce(t),this.pixelImageTransport=new Oe(t),this.wechatTransport=new Ae(t)}return f()(e,[{key:"getTransporter",value:function(){if(A())return this.wechatTransport;var e=[this.beaconTransport,this.pixelImageTransport].find((function(e){return e.isSupported()}));return e||this.pixelImageTransport}}],[{key:"getInstance",value:function(t){return e.instance||(e.instance=new e(t)),e.instance}}]),e}();function Me(){return"".concat(Date.now(),"_").concat(Math.random().toString(36).substring(2,15))}function Ie(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Math.floor(16*Math.random());return("x"===e?t:Math.floor(t%4+8)).toString(16)}))}p()(Le,"instance",void 0);var Re=function(){function e(){c()(this,e)}var r;return f()(e,null,[{key:"post",value:(r=n()(t()().mark((function e(r,n,o){return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(S(!0,"post",r,n,o),!A()){e.next=3;break}return e.abrupt("return",new Promise((function(e,t){wx.request({url:r,method:"POST",data:JSON.stringify(n),header:{"Content-Type":"application/json",Authorization:"Bearer ".concat(o)},success:function(t){return e({type:"wechat",response:t})},fail:function(e){return t({type:"wechat",error:e})}})})));case 3:if("undefined"!=typeof fetch){e.next=5;break}return e.abrupt("return",new Promise((function(e,t){var i=new XMLHttpRequest;i.open("POST",r,!0),i.setRequestHeader("Content-Type","application/json"),i.setRequestHeader("Authorization","Bearer ".concat(o)),i.onreadystatechange=function(){4===i.readyState&&(200===i.status?e({type:"xhr",response:i.responseText}):t({type:"xhr",error:new Error(i.statusText)}))},i.send(JSON.stringify(n))})));case 5:return e.abrupt("return",new Promise((function(e,t){fetch(r,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(o)}}).then((function(t){return e({type:"fetch",response:t})})).catch((function(e){return t({type:"fetch",error:e})}))})));case 6:case"end":return e.stop()}}),e)}))),function(e,t,n){return r.apply(this,arguments)})}]),e}(),Te=function(){function e(t){var r=this;c()(this,e),p()(this,"queue",[]),p()(this,"opts",void 0),p()(this,"storageKey",void 0),p()(this,"localforage",null),this.opts=t,this.storageKey="".concat(t.storagePrefix,"_queue"),this.loadLocalForage().then((function(){r.opts.enableStorage&&r.loadFromStorage()}))}var r,o;return f()(e,[{key:"loadLocalForage",value:(o=n()(t()().mark((function e(){var r=this;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{O()&&Promise.resolve().then(a.t.bind(a,349,23)).then((function(e){r.localforage=e,S(!!r.opts.debug,e)}))}catch(e){S(!!this.opts.debug,"localforage load error",e)}return e.abrupt("return",null);case 2:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"enqueue",value:function(e){return this.queue.length>=this.opts.maxSize&&(this.queue.shift(),S(!!this.opts.debug,"Queue full, dropped oldest event")),this.queue.push(e),S(!!this.opts.debug,"Enqueued event",e),this.opts.enableStorage&&this.saveToStorage(),!0}},{key:"peek",value:function(e){return this.queue.slice(0,e)}},{key:"dequeue",value:function(e){var t=this.queue.splice(0,e);return S(!!this.opts.debug,"Dequeued ".concat(t.length," events")),this.opts.enableStorage&&this.saveToStorage(),t}},{key:"size",value:function(){return this.queue.length}},{key:"clear",value:function(){this.queue=[],S(!!this.opts.debug,"Queue cleared"),this.opts.enableStorage&&this.removeFromStorage()}},{key:"loadFromStorage",value:(r=n()(t()().mark((function e(){var r,n,o,i,a;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,r=null,!A()){e.next=6;break}r=wx.getStorageSync(this.storageKey),e.next=30;break;case 6:if(!O()){e.next=30;break}if(this.localforage){e.next=10;break}return e.next=10,this.loadLocalForage();case 10:if(e.prev=10,!this.localforage){e.next=17;break}return e.next=14,this.localforage.getItem(this.storageKey);case 14:e.t0=e.sent,e.next=18;break;case 17:e.t0=null;case 18:if(n=e.t0,!Array.isArray(n)){e.next=23;break}return this.queue=n.slice(0,this.opts.maxSize),S(!!this.opts.debug,"Loaded ".concat(this.queue.length," events from IndexedDB")),e.abrupt("return");case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(10),S(!!this.opts.debug,"IndexedDB load error, falling back to localStorage",e.t1);case 28:if("undefined"!=typeof localStorage&&(o=localStorage.getItem(this.storageKey)))try{i=JSON.parse(o),Array.isArray(i)&&(this.queue=i.slice(0,this.opts.maxSize),S(!!this.opts.debug,"Loaded ".concat(this.queue.length," events from localStorage")))}catch(e){}return e.abrupt("return");case 30:r&&(a=JSON.parse(r),Array.isArray(a)&&(this.queue=a.slice(0,this.opts.maxSize),S(!!this.opts.debug,"Loaded ".concat(this.queue.length," events from storage")))),e.next=36;break;case 33:e.prev=33,e.t2=e.catch(0),S(!!this.opts.debug,"Failed to load queue from storage",e.t2);case 36:case"end":return e.stop()}}),e,this,[[0,33],[10,25]])}))),function(){return r.apply(this,arguments)})},{key:"saveToStorage",value:function(){var e=this;try{var t=x(this.queue);if(A())wx.setStorageSync(this.storageKey,t);else if(O()){var r=function(){"undefined"!=typeof localStorage&&(localStorage.setItem(e.storageKey,t),S(!!e.opts.debug,"Saved ".concat(e.queue.length," events to localStorage")))};this.localforage?this.localforage.setItem(this.storageKey,this.queue).then((function(){S(!!e.opts.debug,"Saved ".concat(e.queue.length," events to IndexedDB"))})).catch((function(t){S(!!e.opts.debug,"IndexedDB save error, falling back to localStorage",t),r()})):this.loadLocalForage().then((function(){return e.localforage?e.localforage.setItem(e.storageKey,e.queue).then((function(){S(!!e.opts.debug,"Saved ".concat(e.queue.length," events to IndexedDB"))})).catch((function(t){S(!!e.opts.debug,"IndexedDB save error, falling back to localStorage",t),r()})):(r(),null)})).catch((function(t){S(!!e.opts.debug,"IndexedDB save error, falling back to localStorage",t),r()}))}}catch(e){S(!!this.opts.debug,"Failed to save queue to storage",e)}}},{key:"removeFromStorage",value:function(){var e=this;try{if(A())wx.removeStorageSync(this.storageKey);else if(O()){var t=function(){"undefined"!=typeof localStorage&&(localStorage.removeItem(e.storageKey),S(!!e.opts.debug,"Removed queue from localStorage"))};this.localforage?this.localforage.removeItem(this.storageKey).then((function(){S(!!e.opts.debug,"Removed queue from IndexedDB")})).catch((function(r){S(!!e.opts.debug,"IndexedDB remove error, falling back to localStorage",r),t()})):this.loadLocalForage().then((function(){return e.localforage?e.localforage.removeItem(e.storageKey).then((function(){S(!!e.opts.debug,"Removed queue from IndexedDB")})).catch((function(r){S(!!e.opts.debug,"IndexedDB remove error, falling back to localStorage",r),t()})):(t(),null)})).catch((function(r){S(!!e.opts.debug,"IndexedDB remove error, falling back to localStorage",r),t()}))}}catch(e){S(!!this.opts.debug,"Failed to remove queue from storage",e)}}}]),e}(),Be=function(){function e(t){c()(this,e),p()(this,"opts",void 0),p()(this,"retryingTasks",new Map),this.opts=t}var r,o;return f()(e,[{key:"executeWithRetry",value:(o=n()(t()().mark((function e(r,n){var o,i;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.retryingTasks.has(r)){e.next=3;break}throw S(!!this.opts.debug,"Task ".concat(r," already retrying, skipped")),new Error("Task ".concat(r," already retrying"));case 3:return o={id:r,fn:n,retries:0,maxRetries:this.opts.maxRetries,baseDelay:this.opts.baseDelay,useBackoff:this.opts.useBackoff},this.retryingTasks.set(r,o),e.prev=5,e.next=8,this.executeTask(o);case 8:return i=e.sent,this.retryingTasks.delete(r),e.abrupt("return",i);case 13:throw e.prev=13,e.t0=e.catch(5),this.retryingTasks.delete(r),e.t0;case 17:case"end":return e.stop()}}),e,this,[[5,13]])}))),function(e,t){return o.apply(this,arguments)})},{key:"executeTask",value:(r=n()(t()().mark((function r(n){var o,i;return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n.retries<=n.maxRetries)){t.next=21;break}return t.prev=1,t.next=4,n.fn();case 4:return o=t.sent,n.retries>0&&S(!!this.opts.debug,"Task ".concat(n.id," succeeded after ").concat(n.retries," retries")),t.abrupt("return",o);case 9:if(t.prev=9,t.t0=t.catch(1),n.retries+=1,!(n.retries>n.maxRetries)){t.next=15;break}throw S(!!this.opts.debug,"Task ".concat(n.id," failed after ").concat(n.maxRetries," retries")),t.t0;case 15:return i=e.calculateDelay(n.retries,n.baseDelay,n.useBackoff),S(!!this.opts.debug,"Task ".concat(n.id," failed (attempt ").concat(n.retries,"/").concat(n.maxRetries,"), retrying in ").concat(i,"ms")),t.next=19,e.sleep(i);case 19:t.next=0;break;case 21:throw new Error("Task ".concat(n.id," exceeded max retries"));case 22:case"end":return t.stop()}}),r,this,[[1,9]])}))),function(e){return r.apply(this,arguments)})},{key:"getRetryingCount",value:function(){return this.retryingTasks.size}},{key:"clear",value:function(){this.retryingTasks.clear()}}],[{key:"calculateDelay",value:function(e,t,r){if(!r)return t;var n=t*Math.pow(2,e-1),o=.3*Math.random()*n;return Math.min(n+o,3e4)}},{key:"sleep",value:function(e){return new Promise((function(t){return setTimeout(t,e)}))}}]),e}(),Pe=function(){function e(){c()(this,e),p()(this,"opts",void 0),p()(this,"seq",0),p()(this,"closed",!1),p()(this,"envTags",{}),p()(this,"initialized",!1),p()(this,"sessionId",void 0),p()(this,"queueManager",void 0),p()(this,"retryManager",void 0),p()(this,"transporter",void 0),p()(this,"batchTimer",void 0),p()(this,"isSending",!1),p()(this,"collectSwitch",0),p()(this,"collectLogLevel",[]),p()(this,"recentAutoEvents",new Map),p()(this,"offJs",void 0),p()(this,"offPromise",void 0),p()(this,"offResource",void 0),p()(this,"offWxError",void 0),p()(this,"offWxUnhandled",void 0),this.sessionId=Me()}var r,o,a,s,u,l;return f()(e,[{key:"init",value:function(e){var r=this;this.opts={appId:"".concat(e.appId,"-frontend")||0,env:e.env||"develop",logStage:e.logStage,debug:!!e.debug,enableGzip:!1!==e.enableGzip,gzipOnlyInBatchMode:!1!==e.gzipOnlyInBatchMode,maxPixelUrlLen:e.maxPixelUrlLen||8192,enableBatch:!0===e.enableBatch,batchSize:e.batchSize||20,batchInterval:e.batchInterval||15e3,maxQueueSize:e.maxQueueSize||100,enableStorage:!0===e.enableBatch||!1!==e.enableStorage,storagePrefix:e.storagePrefix||"logger_sdk",enableRetry:!1!==e.enableRetry,maxRetries:e.maxRetries||3,retryDelay:e.retryDelay||1e3,retryBackoff:!1!==e.retryBackoff,userId:e.userId,storeCode:e.storeCode,token:e.token,sampleRate:"number"==typeof e.sampleRate?e.sampleRate:1,levelSampleRate:e.levelSampleRate||{ERROR:.8,WARN:.5,INFO:.1,FATAL:1},sourceSampleRate:e.sourceSampleRate||{js:.8,promise:.5,resource:.2,custom:1},pathSampleRate:e.pathSampleRate||{"/":1},enableAutoCapture:!1!==e.enableAutoCapture,autoCapture:e.autoCapture||{js:!0,promise:!0,resource:!0,wechat:!0}},this.opts.enableBatch&&(this.queueManager=new Te({maxSize:this.opts.maxQueueSize,enableStorage:this.opts.enableStorage,storagePrefix:this.opts.storagePrefix,debug:this.opts.debug})),this.opts.enableRetry&&(this.retryManager=new Be({maxRetries:this.opts.maxRetries,baseDelay:this.opts.retryDelay,useBackoff:this.opts.retryBackoff,debug:this.opts.debug})),this.transporter=Le.getInstance(this.opts).getTransporter(),this.sessionId=Me(),this.envTags=M(),this.initSDK(this.opts,(function(e){var o,i,a;r.collectSwitch=e.collectSwitch,r.collectLogLevel=e.collectLogLevel,r.opts.sampleRate=e.samplingRate,null!==(o=r.opts)&&void 0!==o&&o.enableBatch&&r.startBatchTimer(),r.initialized=!0,r.attachUnloadHandlers();var s,u,c,l,f,h=!1!==(null===(i=r.opts)||void 0===i?void 0:i.enableAutoCapture),p=(null===(a=r.opts)||void 0===a?void 0:a.autoCapture)||{};h&&!1!==p.js&&(r.offJs=function(e,r){if("undefined"!=typeof window){var o=function(){var o=n()(t()().mark((function n(o){var i;return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(S(e,"registerJsErrorCapture error",o),o.error){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,v(o.error);case 5:i=t.sent,r({type:"js",message:o.error.message,stack:i,throwable:o.error.stack||""});case 7:case"end":return t.stop()}}),n)})));return function(e){return o.apply(this,arguments)}}();return window.addEventListener("error",o),function(){return window.removeEventListener("error",o)}}}(!(null===(s=r.opts)||void 0===s||!s.debug),r.trackInner.bind(r)));h&&!1!==p.promise&&(r.offPromise=function(e,r){if("undefined"!=typeof window){var o=function(){var o=n()(t()().mark((function n(o){var i,a;return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(S(e,"registerPromiseErrorCapture unhandledrejection",o),!((i=o.reason)instanceof Error)){t.next=7;break}return t.next=5,v(i);case 5:a=t.sent,r({type:"promise",message:i.message,stack:a,throwable:i.stack||""});case 7:case"end":return t.stop()}}),n)})));return function(e){return o.apply(this,arguments)}}();return window.addEventListener("unhandledrejection",o),function(){return window.removeEventListener("unhandledrejection",o)}}}(!(null===(u=r.opts)||void 0===u||!u.debug),r.trackInner.bind(r)));h&&!1!==p.resource&&(r.offResource=function(e,t){if("undefined"!=typeof window){var r=function(r){S(e,"registerResourceErrorCapture error",r);var n,o=r.target;(null!=o&&o.src||null!=o&&o.href)&&t({type:"resource",message:"Resource load failed: ".concat((null==o?void 0:o.src)||(null==o?void 0:o.href)),stack:[],throwable:(null==r||null===(n=r.error)||void 0===n?void 0:n.stack)||""})};return window.addEventListener("error",r,!0),function(){return window.removeEventListener("error",r,!0)}}}(!(null===(c=r.opts)||void 0===c||!c.debug),r.trackInner.bind(r)));h&&!1!==p.wechat&&(r.offWxError=function(e,r){if(A())try{var o=globalThis.wx;if(o&&"function"==typeof o.onError){var i=function(){var o=n()(t()().mark((function n(o){var i,a,s,u;return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return S(e,"registerWechatErrorCapture onError",o),a=String(null!==(i=null==o?void 0:o.message)&&void 0!==i?i:o),s=o instanceof Error?o:new Error(a),t.next=5,v(s);case 5:u=t.sent,r({type:"js",message:s.message,stack:u,throwable:s.stack||""});case 7:case"end":return t.stop()}}),n)})));return function(e){return o.apply(this,arguments)}}();return o.onError(i),function(){try{o.offError&&o.offError(i)}catch(e){}}}}catch(t){S(e,"registerWechatErrorCapture attach failed",t)}}(!(null===(l=r.opts)||void 0===l||!l.debug),r.trackInner.bind(r)),r.offWxUnhandled=function(e,r){if(A())try{var o=globalThis.wx;if(o&&"function"==typeof o.onUnhandledRejection){var i=function(){var o=n()(t()().mark((function n(o){var i,a,s;return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=null==o?void 0:o.reason,S(e,"registerWechatUnhandledCapture onUnhandledRejection",i),a=i instanceof Error?i:new Error(String(i)),t.next=5,v(a);case 5:s=t.sent,r({type:"promise",message:a.message,stack:s,throwable:a.stack||""});case 7:case"end":return t.stop()}}),n)})));return function(e){return o.apply(this,arguments)}}();return o.onUnhandledRejection(i),function(){try{o.offUnhandledRejection&&o.offUnhandledRejection(i)}catch(e){}}}}catch(t){S(e,"registerWechatUnhandledCapture attach failed",t)}}(!(null===(f=r.opts)||void 0===f||!f.debug),r.trackInner.bind(r)))}))}},{key:"identify",value:function(e){var t;S(!(null===(t=this.opts)||void 0===t||!t.debug),"identify",e),this.opts&&(this.opts.userId=e)}},{key:"setStoreCode",value:function(e){var t;S(!(null===(t=this.opts)||void 0===t||!t.debug),"setStoreCode",e),this.opts&&(this.opts.storeCode=e)}},{key:"setStage",value:function(e){var t;S(!(null===(t=this.opts)||void 0===t||!t.debug),"setStage",e),this.opts&&(this.opts.env=e)}},{key:"flattenEnvTags",value:function(){return Object.entries(this.envTags||{}).map((function(e){var t=i()(e,2),r=t[0],n=t[1];return"".concat(r,"=").concat(n)})).join(",")}},{key:"track",value:(l=n()(t()().mark((function e(r){var n,o,i,a,s,u,c,l,f,h,p,d,g,v;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.message,i=r.error,a=r.traceId,s=r.logLevel,u=void 0===s?"INFO":s,S(!(null===(n=this.opts)||void 0===n||!n.debug),"track",{message:o,error:i,traceId:a,logLevel:u}),!this.closed){e.next=4;break}return e.abrupt("return");case 4:if(this.initialized){e.next=7;break}return S(!(null===(c=this.opts)||void 0===c||!c.debug),"SDK not initialized, skip track"),e.abrupt("return");case 7:if(this.shouldSend(u,"custom",L(),a,o)){e.next=10;break}return S(!(null===(l=this.opts)||void 0===l||!l.debug),"Event sampled out",{logLevel:u,traceId:a,message:o}),e.abrupt("return");case 10:if(this.seq+=1,f="",h="",!(i instanceof Error)){e.next=28;break}return e.prev=14,e.next=17,_(i);case 17:p=e.sent,d=p.location,g=p.throwable,f=d||"",h=g||i.stack||"",e.next=28;break;case 24:e.prev=24,e.t0=e.catch(14),f="",h=i.stack||"";case 28:v={logId:"".concat(this.opts.appId).concat(Ie()).concat(w()),seq:this.seq,appId:this.opts.appId||"unknown",stage:this.opts.logStage,level:u,traceId:a,frontendId:this.sessionId,url:L(),location:f,message:"[message]: ".concat(o,"; [envTags]: ").concat(this.flattenEnvTags(),"; [t]: ").concat(w()),throwable:h,userId:this.opts.userId,storeCode:this.opts.storeCode},this.doTrack(v);case 30:case"end":return e.stop()}}),e,this,[[14,24]])}))),function(e){return l.apply(this,arguments)})},{key:"trackInner",value:function(e){var t,r;if(!this.closed)if(this.initialized){S(!(null===(t=this.opts)||void 0===t||!t.debug),"trackInner",e);var n,o="".concat(e.type,"|").concat((n=e.message,n.replace(/\d+/g,"{n}").replace(/https?:\/\/\S+/g,"{url}").replace(/[a-f0-9]{16,}/gi,"{id}").slice(0,200)),"|").concat(String(this.sessionId||"")),i=w();if(!(i-(this.recentAutoEvents.get(o)||0)<3e3))if(this.recentAutoEvents.set(o,i),this.shouldSend("ERROR",e.type,L(),void 0,e.message)){this.seq+=1;var a,s,u,c,l="",f=(null===(r=e.stack)||void 0===r?void 0:r.map((function(e){return"".concat(e.file,":").concat(e.line,":").concat(e.column)})).join("\n\t"))||"";if(e.stack&&e.stack.length>0)l="".concat(null===(a=e.stack)||void 0===a?void 0:a[0].file,":").concat(null===(s=e.stack)||void 0===s?void 0:s[0].line,":").concat(null===(u=e.stack)||void 0===u?void 0:u[0].column,":").concat(null===(c=e.stack)||void 0===c?void 0:c[0].function);var h={logId:"".concat(this.opts.appId).concat(Ie()).concat(w()),seq:this.seq,appId:this.opts.appId||"unknown",stage:this.opts.env||"develop",level:"ERROR",frontendId:this.sessionId,url:L(),location:l,message:"[message]: ".concat(e.message,"; [envTags]: ").concat(this.flattenEnvTags(),"; [t]: ").concat(w()),throwable:f,userId:this.opts.userId,storeCode:this.opts.storeCode};this.doTrack(h)}else{var p;S(!(null===(p=this.opts)||void 0===p||!p.debug),"Auto-captured event sampled out",e.message)}}else{var d;S(!(null===(d=this.opts)||void 0===d||!d.debug),"SDK not initialized, skip track")}}},{key:"shouldSend",value:function(e,t,r,n,o){var i,a,s,u,c,l=this;if("FATAL"===e)return!0;if(0===this.collectSwitch)return S(!(null===(u=this.opts)||void 0===u||!u.debug),"Collect switch is off, skip track"),!1;if(!this.collectLogLevel.some((function(t){return t===e})))return S(!(null===(c=this.opts)||void 0===c||!c.debug),"Log level(".concat(e,") not in collect log level, skip track")),!1;var f,h=null===(i=this.opts)||void 0===i||null===(i=i.levelSampleRate)||void 0===i?void 0:i[e],p=null===(a=this.opts)||void 0===a||null===(a=a.sourceSampleRate)||void 0===a?void 0:a[t],d=(null===(s=this.opts)||void 0===s?void 0:s.pathSampleRate)||{},g=Object.keys(d);if(g.length){for(var v="",m=0;m<g.length;m+=1){var y=g[m];r.startsWith(y)&&y.length>=v.length&&(v=y)}v&&(f=d[v])}var b=function(e){if("number"==typeof h)return h;if("number"==typeof p)return p;if("number"==typeof f)return f;var t=null===(e=l.opts)||void 0===e?void 0:e.sampleRate;return"number"==typeof t?t:1}(),w=Math.max(0,Math.min(1,b));if(w>=1)return!0;var x=function(e){for(var t=2166136261,r=0;r<e.length;r+=1)t=(t^=e.charCodeAt(r))+(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)>>>0;return t%1e4/1e4}("".concat(String(n||""),"|").concat(String(o||""),"|").concat(String(this.sessionId||""),"|").concat(String(e),"|").concat(String(t),"|").concat(String(r)));return x<w}},{key:"doTrack",value:(u=n()(t()().mark((function e(r){var n,o,i;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(S(!(null===(n=this.opts)||void 0===n||!n.debug),"track",r),!this.opts.enableBatch||!this.queueManager){e.next=9;break}if(this.queueManager.enqueue(r),!(this.queueManager.size()>=this.opts.batchSize)){e.next=7;break}return S(!(null===(o=this.opts)||void 0===o||!o.debug),"Queue size reached batch size, flushing immediately"),e.next=7,this.flush();case 7:e.next=17;break;case 9:return e.prev=9,e.next=12,this.sendEvent(r);case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(9),S(!(null===(i=this.opts)||void 0===i||!i.debug),"track failed",e.t0);case 17:case"end":return e.stop()}}),e,this,[[9,14]])}))),function(e){return u.apply(this,arguments)})},{key:"flush",value:(s=n()(t()().mark((function e(){var r,n,o,i,a;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.queueManager&&0!==this.queueManager.size()){e.next=2;break}return e.abrupt("return");case 2:if(!this.isSending){e.next=5;break}return S(!(null===(n=this.opts)||void 0===n||!n.debug),"Already sending, skip flush"),e.abrupt("return");case 5:if(this.isSending=!0,S(!(null===(r=this.opts)||void 0===r||!r.debug),"Flushing ".concat(this.queueManager.size()," events")),e.prev=7,0!==(i=this.queueManager.peek(this.queueManager.size())).length){e.next=11;break}return e.abrupt("return");case 11:return e.next=13,this.sendBatch(i);case 13:this.queueManager.dequeue(i.length),S(!(null===(o=this.opts)||void 0===o||!o.debug),"Flushed ".concat(i.length," events successfully")),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(7),S(!(null===(a=this.opts)||void 0===a||!a.debug),"Flush failed",e.t0);case 20:return e.prev=20,this.isSending=!1,e.finish(20);case 23:case"end":return e.stop()}}),e,this,[[7,17,20,23]])}))),function(){return s.apply(this,arguments)})},{key:"destroy",value:(a=n()(t()().mark((function r(){return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.closed=!0,this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=null),t.next=4,this.flush();case 4:this.queueManager&&this.queueManager.clear(),this.retryManager&&this.retryManager.clear(),this.offJs&&(this.offJs(),this.offJs=void 0),this.offPromise&&(this.offPromise(),this.offPromise=void 0),this.offResource&&(this.offResource(),this.offResource=void 0),this.offWxError&&(this.offWxError(),this.offWxError=void 0),this.offWxUnhandled&&(this.offWxUnhandled(),this.offWxUnhandled=void 0),this.initialized=!1,this.sessionId=void 0,e.instance=void 0;case 14:case"end":return t.stop()}}),r,this)}))),function(){return a.apply(this,arguments)})},{key:"sendEvent",value:(o=n()(t()().mark((function e(r){var o,i=this;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=function(){var e=n()(t()().mark((function e(){var n;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(n=i.transporter)||void 0===n?void 0:n.send({appId:r.appId,appStage:r.stage,items:[{level:"FATAL"===r.level?"ERROR":r.level,traceId:r.traceId,frontendId:r.frontendId,location:r.location,message:r.message,throwable:r.throwable}]});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),!this.opts.enableRetry||!this.retryManager){e.next=6;break}return e.next=4,this.retryManager.executeWithRetry(r.logId,o);case 4:e.next=8;break;case 6:return e.next=8,o();case 8:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"sendBatch",value:(r=n()(t()().mark((function e(r){var o,a,s,u,c,l,f,h,p,d,g,v,m,y,b,x=this;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==r.length){e.next=2;break}return e.abrupt("return");case 2:for(a=new Map,s=0;s<r.length;s+=1)u=r[s],c="".concat(u.appId,"|").concat(u.stage),(l=a.get(c))?l.push(u):a.set(c,[u]);f=Math.min(200,(null===(o=this.opts)||void 0===o?void 0:o.batchSize)||50),h=Array.from(a.entries()),p=[],d=0;case 8:if(!(d<h.length)){e.next=21;break}g=i()(h[d],2),v=g[0],(m=g[1]).sort((function(e,t){return e.seq-t.seq})),y=t()().mark((function e(){var r,o,i,a;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(r=m.slice(b,b+f)).length>0&&(o="batch_".concat(w(),"_").concat(Math.random().toString(36).substring(2,9),"_").concat(v,"_").concat(b),i=function(){var e=n()(t()().mark((function e(){var n;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(n=x.transporter)||void 0===n?void 0:n.send({appId:r[0].appId,appStage:r[0].stage,items:r.map((function(e){return{level:"FATAL"===e.level?"ERROR":e.level,traceId:e.traceId,frontendId:e.frontendId,location:e.location,message:e.message,throwable:e.throwable}}))});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=x.opts.enableRetry&&x.retryManager?x.retryManager.executeWithRetry(o,i):i(),p.push(a));case 2:case"end":return e.stop()}}),e)})),b=0;case 13:if(!(b<m.length)){e.next=18;break}return e.delegateYield(y(),"t0",15);case 15:b+=f,e.next=13;break;case 18:d+=1,e.next=8;break;case 21:return e.next=23,Promise.all(p);case 23:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"startBatchTimer",value:function(){var e,t=this;this.batchTimer||(this.batchTimer=setInterval((function(){var e;!t.closed&&t.queueManager&&t.queueManager.size()>0&&(S(!(null===(e=t.opts)||void 0===e||!e.debug),"Batch timer triggered, flushing queue"),t.flush().catch((function(e){var r;S(!(null===(r=t.opts)||void 0===r||!r.debug),"Batch timer flush failed",e)})))}),this.opts.batchInterval),S(!(null===(e=this.opts)||void 0===e||!e.debug),"Batch timer started with interval ".concat(this.opts.batchInterval,"ms")))}},{key:"attachUnloadHandlers",value:function(){var e,t=this;if(!1!==(null===(e=this.opts)||void 0===e?void 0:e.enableAutoCapture)&&O()){var r=window;document.addEventListener&&document.addEventListener("visibilitychange",(function(){try{var e;if("hidden"===document.visibilityState)t.flush().catch((function(){})),S(!(null===(e=t.opts)||void 0===e||!e.debug),"Page hidden, flushed queue")}catch(e){}})),r.addEventListener&&r.addEventListener("pagehide",(function(){try{var e,r;S(!(null===(e=t.opts)||void 0===e||!e.debug),"Page hide, flushed queue"),t.flush().catch((function(){})),S(!(null===(r=t.opts)||void 0===r||!r.debug),"Page hide, flushed queue")}catch(e){}})),r.addEventListener&&r.addEventListener("beforeunload",(function(){try{var e,r;S(!(null===(e=t.opts)||void 0===e||!e.debug),"Page unload, flushed queue"),t.flush().catch((function(){})),S(!(null===(r=t.opts)||void 0===r||!r.debug),"Page unload, flushed queue")}catch(e){}}))}}},{key:"initSDK",value:function(e,r){var o,i,a=this;Re.post((i=(null===(o=this.opts)||void 0===o?void 0:o.env)||"develop","".concat(k(i),"/yfcloud-apm/log/front/init")),{appId:e.appId,message:"init",appStage:e.logStage,location:"",userId:e.userId,storeCode:e.storeCode},e.token).then(function(){var e=n()(t()().mark((function e(n){var o,i,s,u,c,l,f,h;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(S(!(null===(o=a.opts)||void 0===o||!o.debug),"Register success",n),n){e.next=3;break}return e.abrupt("return");case 3:if(i=n.type,s=n.response,n.error,u=!1,"wechat"!==i||200!==(null==s?void 0:s.statusCode)){e.next=10;break}u=!0,c=s.data.data,e.next=19;break;case 10:if("fetch"!==i){e.next=18;break}return e.next=13,null==s||null===(l=s.json)||void 0===l?void 0:l.call(s);case 13:h=e.sent,S(!(null===(f=a.opts)||void 0===f||!f.debug),"Register fetch response",h),0===(null==h?void 0:h.code)&&(u=!0,c=h.data),e.next=19;break;case 18:"xhr"===i&&(u=!0);case 19:u&&c&&r(c);case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){var t;S(!(null===(t=a.opts)||void 0===t||!t.debug),"Failed to initialize SDK",e)}))}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();p()(Pe,"instance",void 0)}(),s}()}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("localforage")):"function"==typeof define&&define.amd?define(["localforage"],t):"object"==typeof exports?exports.LoggerSDK=t(require("localforage")):e.LoggerSDK=t(e.localforage)}(self,(function(e){return function(){var t,r,n={26:function(e,t,r){"use strict";r.d(t,{oB:function(){return ee},X$:function(){return Y},aM:function(){return te}});var n=r(25),o=r.n(n),i=r(750),a=r.n(i),s=Uint8Array,u=Uint16Array,c=Int32Array,l=new s([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,0,0,0]),f=new s([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,0,0]),h=new s([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=function(e,t){for(var r=new u(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var o=new c(r[30]);for(n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},d=p(l,2),g=d.b,v=d.r;g[28]=258,v[258]=28;for(var m=p(f,0),y=(m.b,m.r),b=new u(32768),w=0;w<32768;++w){var x=(43690&w)>>1|(21845&w)<<1;x=(61680&(x=(52428&x)>>2|(13107&x)<<2))>>4|(3855&x)<<4,b[w]=((65280&x)>>8|(255&x)<<8)>>1}var S=function(e,t,r){for(var n=e.length,o=0,i=new u(t);o<n;++o)e[o]&&++i[e[o]-1];var a,s=new u(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(r){a=new u(1<<t);var c=15-t;for(o=0;o<n;++o)if(e[o])for(var l=o<<4|e[o],f=t-e[o],h=s[e[o]-1]++<<f,p=h|(1<<f)-1;h<=p;++h)a[b[h]>>c]=l}else for(a=new u(n),o=0;o<n;++o)e[o]&&(a[o]=b[s[e[o]-1]++]>>15-e[o]);return a},_=new s(288);for(w=0;w<144;++w)_[w]=8;for(w=144;w<256;++w)_[w]=9;for(w=256;w<280;++w)_[w]=7;for(w=280;w<288;++w)_[w]=8;var k=new s(32);for(w=0;w<32;++w)k[w]=5;var E=S(_,9,0),O=S(k,5,0),C=function(e){return(e+7)/8|0},A=function(e,t,r){return(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length),new s(e.subarray(t,r))},L=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},M=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},I=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return{t:U,l:0};if(1==o){var a=new s(r[0].s+1);return a[r[0].s]=1,{t:a,l:1}}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var c=r[0],l=r[1],f=0,h=1,p=2;for(r[0]={s:-1,f:c.f+l.f,l:c,r:l};h!=o-1;)c=r[r[f].f<r[p].f?f++:p++],l=r[f!=h&&r[f].f<r[p].f?f++:p++],r[h++]={s:-1,f:c.f+l.f,l:c,r:l};var d=i[0].s;for(n=1;n<o;++n)i[n].s>d&&(d=i[n].s);var g=new u(d+1),v=R(r[h-1],g,0);if(v>t){n=0;var m=0,y=v-t,b=1<<y;for(i.sort((function(e,t){return g[t.s]-g[e.s]||e.f-t.f}));n<o;++n){var w=i[n].s;if(!(g[w]>t))break;m+=b-(1<<v-g[w]),g[w]=t}for(m>>=y;m>0;){var x=i[n].s;g[x]<t?m-=1<<t-g[x]++-1:++n}for(;n>=0&&m;--n){var S=i[n].s;g[S]==t&&(--g[S],++m)}v=t}return{t:new s(g),l:v}},R=function e(t,r,n){return-1==t.s?Math.max(e(t.l,r,n+1),e(t.r,r,n+1)):r[t.s]=n},T=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new u(++t),n=0,o=e[0],i=1,a=function(e){r[n++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return{c:r.subarray(0,n),n:t}},B=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},P=function(e,t,r){var n=r.length,o=C(t+2);e[o]=255&n,e[o+1]=n>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<n;++i)e[o+i+4]=r[i];return 8*(o+4+n)},j=function(e,t,r,n,o,i,a,s,c,p,d){L(t,d++,r),++o[256];for(var g=I(o,15),v=g.t,m=g.l,y=I(i,15),b=y.t,w=y.l,x=T(v),C=x.c,A=x.n,R=T(b),j=R.c,N=R.n,U=new u(19),q=0;q<C.length;++q)++U[31&C[q]];for(q=0;q<j.length;++q)++U[31&j[q]];for(var z=I(U,7),F=z.t,D=z.l,G=19;G>4&&!F[h[G-1]];--G);var W,$,H,K,J=p+5<<3,V=B(o,_)+B(i,k)+a,Q=B(o,v)+B(i,b)+a+14+3*G+B(U,F)+2*U[16]+3*U[17]+7*U[18];if(c>=0&&J<=V&&J<=Q)return P(t,d,e.subarray(c,c+p));if(L(t,d,1+(Q<V)),d+=2,Q<V){W=S(v,m,0),$=v,H=S(b,w,0),K=b;var Y=S(F,D,0);L(t,d,A-257),L(t,d+5,N-1),L(t,d+10,G-4),d+=14;for(q=0;q<G;++q)L(t,d+3*q,F[h[q]]);d+=3*G;for(var X=[C,j],Z=0;Z<2;++Z){var ee=X[Z];for(q=0;q<ee.length;++q){var te=31&ee[q];L(t,d,Y[te]),d+=F[te],te>15&&(L(t,d,ee[q]>>5&127),d+=ee[q]>>12)}}}else W=E,$=_,H=O,K=k;for(q=0;q<s;++q){var re=n[q];if(re>255){M(t,d,W[(te=re>>18&31)+257]),d+=$[te+257],te>7&&(L(t,d,re>>23&31),d+=l[te]);var ne=31&re;M(t,d,H[ne]),d+=K[ne],ne>3&&(M(t,d,re>>5&8191),d+=f[ne])}else M(t,d,W[re]),d+=$[re]}return M(t,d,W[256]),d+$[256]},N=new c([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),U=new s(0),q=function(e,t,r,n,o,i){var a=i.z||e.length,h=new s(n+a+5*(1+Math.ceil(a/7e3))+o),p=h.subarray(n,h.length-o),d=i.l,g=7&(i.r||0);if(t){g&&(p[0]=i.r>>3);for(var m=N[t-1],b=m>>13,w=8191&m,x=(1<<r)-1,S=i.p||new u(32768),_=i.h||new u(x+1),k=Math.ceil(r/3),E=2*k,O=function(t){return(e[t]^e[t+1]<<k^e[t+2]<<E)&x},L=new c(25e3),M=new u(288),I=new u(32),R=0,T=0,B=i.i||0,U=0,q=i.w||0,z=0;B+2<a;++B){var F=O(B),D=32767&B,G=_[F];if(S[D]=G,_[F]=D,q<=B){var W=a-B;if((R>7e3||U>24576)&&(W>423||!d)){g=j(e,p,0,L,M,I,T,U,z,B-z,g),U=R=T=0,z=B;for(var $=0;$<286;++$)M[$]=0;for($=0;$<30;++$)I[$]=0}var H=2,K=0,J=w,V=D-G&32767;if(W>2&&F==O(B-V))for(var Q=Math.min(b,W)-1,Y=Math.min(32767,B),X=Math.min(258,W);V<=Y&&--J&&D!=G;){if(e[B+H]==e[B+H-V]){for(var Z=0;Z<X&&e[B+Z]==e[B+Z-V];++Z);if(Z>H){if(H=Z,K=V,Z>Q)break;var ee=Math.min(V,Z-2),te=0;for($=0;$<ee;++$){var re=B-V+$&32767,ne=re-S[re]&32767;ne>te&&(te=ne,G=re)}}}V+=(D=G)-(G=S[D])&32767}if(K){L[U++]=268435456|v[H]<<18|y[K];var oe=31&v[H],ie=31&y[K];T+=l[oe]+f[ie],++M[257+oe],++I[ie],q=B+H,++R}else L[U++]=e[B],++M[e[B]]}}for(B=Math.max(B,q);B<a;++B)L[U++]=e[B],++M[e[B]];g=j(e,p,d,L,M,I,T,U,z,B-z,g),d||(i.r=7&g|p[g/8|0]<<3,g-=7,i.h=_,i.p=S,i.i=B,i.w=q)}else{for(B=i.w||0;B<a+d;B+=65535){var ae=B+65535;ae>=a&&(p[g/8|0]=d,ae=a),g=P(p,g+1,e.subarray(B,ae))}i.i=a}return A(h,0,n+C(g)+o)},z=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&-306674912)^r>>>1;e[t]=r}return e}(),F=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=z[255&r^t[n]]^r>>>8;e=r},d:function(){return~e}}},D=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),a=new s(i.length+e.length);a.set(i),a.set(e,i.length),e=a,o.w=i.length}return q(e,null==t.level?6:t.level,null==t.mem?o.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,r,n,o)},G=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},W=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&G(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}},$=function(e){return 10+(e.filename?e.filename.length+1:0)};function H(e,t){t||(t={});var r=F(),n=e.length;r.p(e);var o=D(e,t,$(t),8),i=o.length;return W(o,t),G(o,i-8,r.d()),G(o,i-4,n),o}var K="undefined"!=typeof TextDecoder&&new TextDecoder;try{K.decode(U,{stream:!0}),1}catch(e){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;var J=r(19),V=r(179).lW;function Q(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var t=encodeURIComponent(e),r=[],n=0;n<t.length;n+=1){var o=t[n];"%"===o?(r.push(parseInt(t.slice(n+1,n+3),16)),n+=2):r.push(o.charCodeAt(0))}return new Uint8Array(r)}function Y(e){return X.apply(this,arguments)}function X(){return X=a()(o()().mark((function e(t){var r,n,i,a,s,u,c,l,f;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,J.jU)()||"undefined"==typeof CompressionStream){e.next=17;break}return e.prev=1,r=new TextEncoder,n=r.encode(t),i=new CompressionStream("gzip"),a=new Blob([n]).stream(),s=a.pipeThrough(i),e.next=9,new Response(s).arrayBuffer();case 9:return u=e.sent,c=new Uint8Array(u),e.abrupt("return",Z(c));case 14:e.prev=14,e.t0=e.catch(1),console.log("gzipCompress 压缩失败,尝试使用 fflate 库",e.t0);case 17:return e.prev=17,l=Q(t),f=H(l),e.abrupt("return",Z(f));case 23:e.prev=23,e.t1=e.catch(17),console.log("gzipCompress 压缩失败",e.t1);case 26:return e.abrupt("return",t);case 27:case"end":return e.stop()}}),e,null,[[1,14],[17,23]])}))),X.apply(this,arguments)}function Z(e){for(var t="",r=0;r<e.length;r+=1)t+=String.fromCharCode(e[r]);if("undefined"!=typeof btoa)return btoa(t);if(void 0!==V)return V.from(t,"base64").toString("base64");throw new Error("convert2Base64FromArray 不支持转换")}function ee(e){if("undefined"!=typeof btoa)try{return btoa(e)}catch(e){}return void 0!==V?V.from(e,"base64").toString("base64"):e}function te(){return(0,J.jU)()&&"undefined"!=typeof CompressionStream}},226:function(e,t,r){"use strict";r.d(t,{N5:function(){return i},Qg:function(){return o},xk:function(){return a}});var n=function(e){switch(e){case"product":default:return"https://apm.pharmacyyf.com";case"testing":return"https://apm-te.pharmacyyf.com";case"develop":return"https://chief-dev.yifengx.com"}},o=function(e){return"".concat(n(e),"/yfcloud-apm/log/front/init")},i=function(e){return"".concat(n(e),"/yfcloud-apm/log/front/batchSave")},a=function(e){return"".concat(n(e),"/yfcloud-apm/log/front/pixelBatchSave")}},862:function(e,t,r){"use strict";r.d(t,{T:function(){return c}});var n=r(25),o=r.n(n),i=r(750),a=r.n(i),s=r(693),u=r.n(s);function c(e){return l.apply(this,arguments)}function l(){return(l=a()(o()().mark((function e(t){var r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u().fromError(t);case 2:return r=e.sent,e.abrupt("return",r.slice(0,5).map((function(e){return{file:e.fileName||"",line:e.lineNumber||0,column:e.columnNumber||0,function:e.functionName||void 0}})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},780:function(e,t,r){"use strict";r.r(t),r.d(t,{BeaconTransport:function(){return b}});var n=r(25),o=r.n(n),i=r(731),a=r.n(i),s=r(750),u=r.n(s),c=r(811),l=r.n(c),f=r(997),h=r.n(f),p=r(411),d=r.n(p),g=r(26),v=r(226),m=r(19),y=r(327),b=function(){function e(t){l()(this,e),d()(this,"name","beacon"),d()(this,"opts",void 0),this.opts=t}var t;return h()(e,[{key:"isSupported",value:function(){return(0,m.jU)()&&"undefined"!=typeof navigator&&navigator.sendBeacon&&"function"==typeof navigator.sendBeacon}},{key:"send",value:(t=u()(o()().mark((function e(t){var r,n,i,s,u,c,l,f,h,p,d;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u="string"==typeof t?t:(0,y.or)(t),c=(0,v.N5)((null===(r=this.opts)||void 0===r?void 0:r.env)||"develop"),l="application/json",null===(n=this.opts)||void 0===n||!n.enableGzip||null!==(i=this.opts)&&void 0!==i&&i.gzipOnlyInBatchMode&&!(t.items.length>0)){e.next=9;break}return e.next=6,(0,g.X$)((0,y.or)(t.items));case 6:f=e.sent,u=(0,y.or)(a()(a()({},t),{},{items:f})),l="application/json; charset=utf-8";case 9:return h=new Blob([u],{type:l}),p=navigator.sendBeacon(c,h),(0,y.o7)(!(null===(s=this.opts)||void 0===s||!s.debug),"sendBeacon result",p),p||(0,y.o7)(!(null===(d=this.opts)||void 0===d||!d.debug),"sendBeacon failed (queue full or other error)"),e.abrupt("return",Promise.resolve());case 14:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}()},173:function(e,t,r){"use strict";r.r(t),r.d(t,{PixelImageTransport:function(){return m}});var n=r(25),o=r.n(n),i=r(750),a=r.n(i),s=r(811),u=r.n(s),c=r(997),l=r.n(c),f=r(411),h=r.n(f),p=r(19),d=r(327),g=r(226),v=r(26),m=function(){function e(t){u()(this,e),h()(this,"name","image"),h()(this,"opts",void 0),this.opts=t}var t;return l()(e,[{key:"isSupported",value:function(){return(0,p.jU)()&&"undefined"!=typeof Image}},{key:"send",value:(t=a()(o()().mark((function e(t){var r,n,i,a,s,u,c,l,f,h,p,m,y,b,w,x,S,_,k,E,O,C=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=(0,d.or)(t.items),f=(0,g.xk)((null===(r=this.opts)||void 0===r?void 0:r.env)||"develop"),h="items",p=(null===(n=this.opts)||void 0===n?void 0:n.maxPixelUrlLen)||8192,null===(i=this.opts)||void 0===i||!i.enableGzip||null!==(a=this.opts)&&void 0!==a&&a.gzipOnlyInBatchMode&&!(t.items.length>0)){e.next=15;break}return S=(0,d.zO)(),(0,d.o7)(!(null===(y=this.opts)||void 0===y||!y.debug),"PixelImage request gzip compress body: ",l),e.next=9,(0,v.X$)(l);case 9:m=e.sent,(0,d.o7)(!(null===(b=this.opts)||void 0===b||!b.debug),"PixelImage request gzip compress cost: ",(0,d.zO)()-S),(0,d.o7)(!(null===(w=this.opts)||void 0===w||!w.debug),"original body size: ".concat(l.length,", compressed body size: ").concat(m.length)),(0,d.o7)(!(null===(x=this.opts)||void 0===x||!x.debug),"PixelImage request gzip compress body: ",m),e.next=16;break;case 15:m=(0,v.oB)(l);case 16:return _="_=".concat(Date.now()),k="appId=".concat((null===(s=this.opts)||void 0===s?void 0:s.appId)||"","&appStage=").concat((null===(u=this.opts)||void 0===u?void 0:u.logStage)||"","&").concat(h,"=").concat(encodeURIComponent(m),"&gzip=").concat(null!==(c=this.opts)&&void 0!==c&&c.enableGzip?1:0,"&").concat(_),(E=f.includes("?")?"".concat(f,"&").concat(k):"".concat(f,"?").concat(k)).length>p&&(0,d.o7)(!(null===(O=this.opts)||void 0===O||!O.debug),"URL too long (".concat(E.length," > ").concat(p,")")),e.abrupt("return",new Promise((function(e,t){var r,n=new Image,o=!1;r=setTimeout((function(){o||(o=!0,n.src="",t(new Error("Image request timeout after 5000ms")))}),5e3),n.onload=function(){r&&clearTimeout(r),o||(o=!0,e())},n.onerror=function(t,n,i,a,s){var u,c;(0,d.o7)(!(null===(u=C.opts)||void 0===u||!u.debug),"Image request failed",t,n,i,a,s),r&&clearTimeout(r),o||(o=!0,(0,d.o7)(!(null===(c=C.opts)||void 0===c||!c.debug),"Image request failed",t,n,i,a,s),e())},n.src=E})));case 21:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}()},624:function(e,t,r){"use strict";r.r(t),r.d(t,{WechatTransport:function(){return b}});var n=r(25),o=r.n(n),i=r(731),a=r.n(i),s=r(750),u=r.n(s),c=r(811),l=r.n(c),f=r(997),h=r.n(f),p=r(411),d=r.n(p),g=r(26),v=r(226),m=r(19),y=r(327),b=function(){function e(t){l()(this,e),d()(this,"name","wechat"),d()(this,"opts",void 0),this.opts=t}var t;return h()(e,[{key:"isSupported",value:function(){return(0,m.FH)()}},{key:"send",value:(t=u()(o()().mark((function e(t){var r,n,i,s,u,c,l,f,h,p,d,m=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s="string"==typeof t?t:(0,y.or)(t),u=(0,v.N5)((null===(r=this.opts)||void 0===r?void 0:r.env)||"develop"),c=1e4,l="application/json",null===(n=this.opts)||void 0===n||!n.enableGzip||null!==(i=this.opts)&&void 0!==i&&i.gzipOnlyInBatchMode&&!(t.items.length>0)){e.next=13;break}return p=(0,y.zO)(),(0,y.o7)(!(null===(f=this.opts)||void 0===f||!f.debug),"WeChat request enable gzip compress: ",p),e.next=9,(0,g.X$)((0,y.or)(t.items));case 9:d=e.sent,s=(0,y.or)(a()(a()({},t),{},{items:d})),(0,y.o7)(!(null===(h=this.opts)||void 0===h||!h.debug),"WeChat request gzip compress cost: ",(0,y.zO)()-p),l="application/json; charset=utf-8";case 13:return e.abrupt("return",new Promise((function(e,t){var r,n,o=!1;n=setTimeout((function(){o||(o=!0,t(new Error("WeChat request timeout after ".concat(c,"ms"))))}),c),wx.request({url:u,method:"POST",data:s,header:{"Content-Type":l,token:(null===(r=m.opts)||void 0===r?void 0:r.token)||""},success:function(r){n&&clearTimeout(n),o||(o=!0,r.statusCode>=200&&r.statusCode<300?e():t(new Error("HTTP ".concat(r.statusCode))))},fail:function(e){var r;n&&clearTimeout(n),o||(o=!0,(0,y.o7)(!(null===(r=this.opts)||void 0===r||!r.debug),"WeChat request failed",e),t(new Error("WeChat request failed: ".concat(e.errMsg||"unknown error"))))}})})));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}()},19:function(e,t,r){"use strict";r.d(t,{FH:function(){return a},bq:function(){return s},iH:function(){return u},jU:function(){return i}});var n=r(488),o=r.n(n);function i(){try{return"undefined"!=typeof window&&void 0!==window.document}catch(e){return!1}}function a(){try{return"undefined"!=typeof wx&&"function"==typeof wx.getSystemInfo}catch(e){return!1}}function s(){if(a())try{var e=getCurrentPages();if(e&&e.length>0)return e[e.length-1].route||""}catch(e){return""}return i()?window.location.href:""}function u(){var e=function(){var e={platform:"unknown"};if(a()){e.platform="wechat";try{var t=wx.getSystemInfoSync();e.systemInfo={brand:t.brand,model:t.model,system:t.system,platform:t.platform,version:t.version,SDKVersion:t.SDKVersion},e.screenWidth=t.screenWidth,e.screenHeight=t.screenHeight,e.language=t.language}catch(e){}}else i()&&(e.platform="browser",e.userAgent=navigator.userAgent,e.screenWidth=window.screen.width,e.screenHeight=window.screen.height,e.language=navigator.language);return e}(),t={platform:e.platform};if("browser"===e.platform&&e.userAgent){var r=function(e){var t=e.toLowerCase(),r="Unknown",n="",i="Unknown",a="";if(t.indexOf("chrome")>-1&&-1===t.indexOf("edge")){r="Chrome";var s=t.match(/chrome\/(\d+\.\d+)/);n=s?s[1]:""}else if(t.indexOf("safari")>-1&&-1===t.indexOf("chrome")){r="Safari";var u=t.match(/version\/(\d+\.\d+)/);n=u?u[1]:""}else if(t.indexOf("firefox")>-1){r="Firefox";var c=t.match(/firefox\/(\d+\.\d+)/);n=c?c[1]:""}else if(t.indexOf("edge")>-1){r="Edge";var l=t.match(/edge\/(\d+\.\d+)/);n=l?l[1]:""}if(t.indexOf("iphone")>-1||t.indexOf("ipad")>-1){i="iOS";var f=t.match(/os (\d+[._]\d+)/);a=f?f[1].replace("_","."):""}else if(t.indexOf("windows")>-1)i="Windows",t.indexOf("windows nt 10")>-1?a="10":t.indexOf("windows nt 6.3")>-1?a="8.1":t.indexOf("windows nt 6.2")>-1?a="8":t.indexOf("windows nt 6.1")>-1&&(a="7");else if(t.indexOf("mac os")>-1){i="macOS";var h=t.match(/mac os x (\d+[._]\d+)/);a=h?h[1].replace("_","."):""}else if(t.indexOf("android")>-1){i="Android";var p=t.match(/android (\d+(?:\.\d+)?)/);p?-1===(a=o()(p,2)[1]).indexOf(".")&&(a="".concat(a,".0")):a=""}else t.indexOf("linux")>-1&&(i="Linux");return{browser:r,browserVersion:n,os:i,osVersion:a}}(e.userAgent);t.browser=r.browser,t.browserVersion=r.browserVersion,t.os=r.os,t.osVersion=r.osVersion,t.screenWidth=e.screenWidth,t.screenHeight=e.screenHeight,t.language=e.language}else"wechat"===e.platform&&e.systemInfo&&(t.brand=e.systemInfo.brand,t.model=e.systemInfo.model,t.system=e.systemInfo.system,t.wechatVersion=e.systemInfo.version,t.SDKVersion=e.systemInfo.SDKVersion,t.screenWidth=e.screenWidth,t.screenHeight=e.screenHeight,t.language=e.language);return t}},327:function(e,t,r){"use strict";r.d(t,{Hk:function(){return d},R_:function(){return h},o7:function(){return p},or:function(){return f},xn:function(){return g},zO:function(){return l}});var n=r(25),o=r.n(n),i=r(750),a=r.n(i),s=r(505),u=r.n(s),c=r(862),l=(r(179).lW,function(){return Date.now()});function f(e){var t=new WeakSet;return JSON.stringify(e,(function(e,r){if(r&&"object"===u()(r)){if(t.has(r))return"[Circular]";t.add(r)}return r}))}function h(e){return e.replace(/\d+/g,"{n}").replace(/https?:\/\/\S+/g,"{url}").replace(/[a-f0-9]{16,}/gi,"{id}").slice(0,200)}function p(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e&&(t=console).debug.apply(t,["[LoggerSDK]"].concat(n))}function d(e){for(var t=2166136261,r=0;r<e.length;r+=1)t=(t^=e.charCodeAt(r))+(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)>>>0;return t%1e4/1e4}function g(e){return v.apply(this,arguments)}function v(){return(v=a()(o()().mark((function e(t){var r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",{location:"",throwable:""});case 2:return e.next=4,(0,c.T)(t);case 4:return r=e.sent,e.abrupt("return",r&&r.length>0?{location:[r[0]].map((function(e){return"".concat(e.file,":").concat(e.line,":").concat(e.column)})).join("\n\t"),throwable:r.map((function(e){return"".concat(e.file,":").concat(e.line,":").concat(e.column)})).join("\n\t")}:{location:"",throwable:""});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},307:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=u(e),a=i[0],s=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),l=0,f=s>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(c(e,s,s+a>u?u:s+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},179:function(e,t,r){"use strict";var n=r(505).default,o=r(307),i=r(525),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;var s=2147483647;function u(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|v(e,t),n=u(r),o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(D(e,Uint8Array)){var t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(e));if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(D(e,SharedArrayBuffer)||e&&D(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(null!=o&&o!==e)return c.from(o,t,r);var i=function(e){if(c.isBuffer(e)){var t=0|g(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||G(e.length)?u(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(e))}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return f(e),u(e<0?0:0|g(e))}function p(e){for(var t=e.length<0?0:0|g(e.length),r=u(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function g(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function v(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+n(e));var r=e.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return o?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return L(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),G(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){var i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var f=!0,h=0;h<u;h++)if(c(e,i+h)!==c(t,h)){f=!1;break}if(f)return i}return-1}function x(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(G(s))return a;e[r+a]=s}return a}function S(e,t,r,n){return F(q(t,e.length-r),e,r,n)}function _(e,t,r,n){return F(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return F(z(t),e,r,n)}function E(e,t,r,n){return F(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,a,s,u,c=e[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}(e,t,r)},c.allocUnsafe=function(e){return h(e)},c.allocUnsafeSlow=function(e){return h(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(D(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),D(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=c.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(D(i,Uint8Array))o+i.length>n.length?c.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else{if(!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},c.byteLength=v,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},c.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,o,i){if(D(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+n(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),t<0||r>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&t>=r)return 0;if(o>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(o>>>=0),s=(r>>>=0)-(t>>>=0),u=Math.min(a,s),l=this.slice(o,i),f=e.slice(t,r),h=0;h<u;++h)if(l[h]!==f[h]){a=l[h],s=f[h];break}return a<s?-1:s<a?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function L(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function M(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function I(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=W[e[i]];return o}function R(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function T(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function P(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,o){return t=+t,r>>>=0,o||P(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,o){return t=+t,r>>>=0,o||P(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||B(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||B(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);B(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=c.isBuffer(e)?e:c.from(e,n),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};var U=/[^+/0-9A-Za-z-_]/g;function q(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return o.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function G(e){return e!=e}var W=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}()},948:function(e,t,r){var n,o,i;r(505).default;!function(a,s){"use strict";o=[r(901)],void 0===(i="function"==typeof(n=function(e){var t=/(^|@)\S+:\d+/,r=/^\s*at .*(\S+:\d+|\(native\))/m,n=/^(eval@)?(\[native code])?$/;return{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(r))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(e){return!!e.match(r)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),n=r.match(/ (\(.+\)$)/);r=n?r.replace(n[0],""):r;var o=this.extractLocation(n?n[1]:r),i=n&&r||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new e({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[2],source:t})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(e){return!e.match(n)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e({functionName:t});var r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(r),o=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(r,""));return new e({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),o=[],i=2,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push(new e({fileName:s[2],lineNumber:s[1],source:n[i]}))}return o},parseOpera10:function(t){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),o=[],i=0,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push(new e({functionName:s[3]||void 0,fileName:s[2],lineNumber:s[1],source:n[i]}))}return o},parseOpera11:function(r){return r.stack.split("\n").filter((function(e){return!!e.match(t)&&!e.match(/^Error created at/)}),this).map((function(t){var r,n=t.split("@"),o=this.extractLocation(n.pop()),i=n.shift()||"",a=i.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;i.match(/\(([^)]*)\)/)&&(r=i.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===r||"[arguments not available]"===r?void 0:r.split(",");return new e({functionName:a,args:s,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:t})}),this)}}})?n.apply(t,o):n)||(e.exports=i)}()},525:function(e,t){t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,h=r?-1:1,p=e[t+f];for(f+=h,i=p&(1<<-l)-1,p>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=h,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=c}return(p?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+p]=255&s,p+=d,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+p]=255&a,p+=d,a/=256,c-=8);e[r+p-d]|=128*g}},430:function(e,t,r){var n=r(685),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,t){for(var r=new i,n=0,o=e.length;n<o;n++)r.add(e[n],t);return r},i.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(e,t){var r=n.toSetString(e),i=o.call(this._set,r),a=this._array.length;i&&!t||this._array.push(e),i||(this._set[r]=a)},i.prototype.has=function(e){var t=n.toSetString(e);return o.call(this._set,t)},i.prototype.indexOf=function(e){var t=n.toSetString(e);if(o.call(this._set,t))return this._set[t];throw new Error('"'+e+'" is not in the set.')},i.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},i.prototype.toArray=function(){return this._array.slice()},t.I=i},773:function(e,t,r){var n=r(626);t.encode=function(e){var t,r="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&o,(o>>>=5)>0&&(t|=32),r+=n.encode(t)}while(o>0);return r},t.decode=function(e,t,r){var o,i,a,s,u=e.length,c=0,l=0;do{if(t>=u)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=n.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),c+=(i&=31)<<l,l+=5}while(o);r.value=(s=(a=c)>>1,1==(1&a)?-s:s),r.rest=t}},626:function(e,t){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<r.length)return r[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},509:function(e,t){function r(e,n,o,i,a,s){var u=Math.floor((n-e)/2)+e,c=a(o,i[u],!0);return 0===c?u:c>0?n-u>1?r(u,n,o,i,a,s):s==t.LEAST_UPPER_BOUND?n<i.length?n:-1:u:u-e>1?r(e,u,o,i,a,s):s==t.LEAST_UPPER_BOUND?u:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,n,o,i){if(0===n.length)return-1;var a=r(-1,n.length,e,n,o,i||t.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===o(n[a],n[a-1],!0);)--a;return a}},186:function(e,t,r){var n=r(685);function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){var t,r,o,i,a,s;t=this._last,r=e,o=t.generatedLine,i=r.generatedLine,a=t.generatedColumn,s=r.generatedColumn,i>o||i==o&&s>=a||n.compareByGeneratedPositionsInflated(t,r)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(n.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.H=o},906:function(e,t){function r(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function n(e,t,o,i){if(o<i){var a=o-1;r(e,(l=o,f=i,Math.round(l+Math.random()*(f-l))),i);for(var s=e[i],u=o;u<i;u++)t(e[u],s)<=0&&r(e,a+=1,u);r(e,a+1,u);var c=a+1;n(e,t,o,c-1),n(e,t,c+1,i)}var l,f}t.U=function(e,t){n(e,t,0,e.length-1)}},351:function(e,t,r){var n=r(685),o=r(509),i=r(430).I,a=r(773),s=r(906).U;function u(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new f(t):new c(t)}function c(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=n.getArg(t,"version"),o=n.getArg(t,"sources"),a=n.getArg(t,"names",[]),s=n.getArg(t,"sourceRoot",null),u=n.getArg(t,"sourcesContent",null),c=n.getArg(t,"mappings"),l=n.getArg(t,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);o=o.map(String).map(n.normalize).map((function(e){return s&&n.isAbsolute(s)&&n.isAbsolute(e)?n.relative(s,e):e})),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(o,!0),this.sourceRoot=s,this.sourcesContent=u,this._mappings=c,this.file=l}function l(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function f(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=n.getArg(t,"version"),o=n.getArg(t,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=o.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=n.getArg(e,"offset"),r=n.getArg(t,"line"),o=n.getArg(t,"column");if(r<a.line||r===a.line&&o<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=t,{generatedOffset:{generatedLine:r+1,generatedColumn:o+1},consumer:new u(n.getArg(e,"map"))}}))}u.fromSourceMap=function(e){return c.fromSourceMap(e)},u.prototype._version=3,u.prototype.__generatedMappings=null,Object.defineProperty(u.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),u.prototype.__originalMappings=null,Object.defineProperty(u.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),u.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return";"===r||","===r},u.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},u.GENERATED_ORDER=1,u.ORIGINAL_ORDER=2,u.GREATEST_LOWER_BOUND=1,u.LEAST_UPPER_BOUND=2,u.prototype.eachMapping=function(e,t,r){var o,i=t||null;switch(r||u.GENERATED_ORDER){case u.GENERATED_ORDER:o=this._generatedMappings;break;case u.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;o.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return null!=t&&null!=a&&(t=n.join(a,t)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}}),this).forEach(e,i)},u.prototype.allGeneratedPositionsFor=function(e){var t=n.getArg(e,"line"),r={source:n.getArg(e,"source"),originalLine:t,originalColumn:n.getArg(e,"column",0)};if(null!=this.sourceRoot&&(r.source=n.relative(this.sourceRoot,r.source)),!this._sources.has(r.source))return[];r.source=this._sources.indexOf(r.source);var i=[],a=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(a>=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var c=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==c;)i.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return i},t.SourceMapConsumer=u,c.prototype=Object.create(u.prototype),c.prototype.consumer=u,c.fromSourceMap=function(e){var t=Object.create(c.prototype),r=t._names=i.fromArray(e._names.toArray(),!0),o=t._sources=i.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),u=t.__generatedMappings=[],f=t.__originalMappings=[],h=0,p=a.length;h<p;h++){var d=a[h],g=new l;g.generatedLine=d.generatedLine,g.generatedColumn=d.generatedColumn,d.source&&(g.source=o.indexOf(d.source),g.originalLine=d.originalLine,g.originalColumn=d.originalColumn,d.name&&(g.name=r.indexOf(d.name)),f.push(g)),u.push(g)}return s(t.__originalMappings,n.compareByOriginalPositions),t},c.prototype._version=3,Object.defineProperty(c.prototype,"sources",{get:function(){return this._sources.toArray().map((function(e){return null!=this.sourceRoot?n.join(this.sourceRoot,e):e}),this)}}),c.prototype._parseMappings=function(e,t){for(var r,o,i,u,c,f=1,h=0,p=0,d=0,g=0,v=0,m=e.length,y=0,b={},w={},x=[],S=[];y<m;)if(";"===e.charAt(y))f++,y++,h=0;else if(","===e.charAt(y))y++;else{for((r=new l).generatedLine=f,u=y;u<m&&!this._charIsMappingSeparator(e,u);u++);if(i=b[o=e.slice(y,u)])y+=o.length;else{for(i=[];y<u;)a.decode(e,y,w),c=w.value,y=w.rest,i.push(c);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");b[o]=i}r.generatedColumn=h+i[0],h=r.generatedColumn,i.length>1&&(r.source=g+i[1],g+=i[1],r.originalLine=p+i[2],p=r.originalLine,r.originalLine+=1,r.originalColumn=d+i[3],d=r.originalColumn,i.length>4&&(r.name=v+i[4],v+=i[4])),S.push(r),"number"==typeof r.originalLine&&x.push(r)}s(S,n.compareByGeneratedPositionsDeflated),this.__generatedMappings=S,s(x,n.compareByOriginalPositions),this.__originalMappings=x},c.prototype._findMapping=function(e,t,r,n,i,a){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return o.search(e,t,i,a)},c.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},c.prototype.originalPositionFor=function(e){var t={generatedLine:n.getArg(e,"line"),generatedColumn:n.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",n.compareByGeneratedPositionsDeflated,n.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(r>=0){var o=this._generatedMappings[r];if(o.generatedLine===t.generatedLine){var i=n.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=n.join(this.sourceRoot,i)));var a=n.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:i,line:n.getArg(o,"originalLine",null),column:n.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e})))},c.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=n.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=n.urlParse(this.sourceRoot))){var o=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(e){var t=n.getArg(e,"source");if(null!=this.sourceRoot&&(t=n.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};var r={source:t=this._sources.indexOf(t),originalLine:n.getArg(e,"line"),originalColumn:n.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,n.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:n.getArg(i,"generatedLine",null),column:n.getArg(i,"generatedColumn",null),lastColumn:n.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},f.prototype=Object.create(u.prototype),f.prototype.constructor=u,f.prototype._version=3,Object.defineProperty(f.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),f.prototype.originalPositionFor=function(e){var t={generatedLine:n.getArg(e,"line"),generatedColumn:n.getArg(e,"column")},r=o.search(t,this._sections,(function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r||e.generatedColumn-t.generatedOffset.generatedColumn})),i=this._sections[r];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},f.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},f.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r].consumer.sourceContentFor(e,!0);if(n)return n}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},f.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(-1!==r.consumer.sources.indexOf(n.getArg(e,"source"))){var o=r.consumer.generatedPositionFor(e);if(o)return{line:o.line+(r.generatedOffset.generatedLine-1),column:o.column+(r.generatedOffset.generatedLine===o.line?r.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},f.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var o=this._sections[r],i=o.consumer._generatedMappings,a=0;a<i.length;a++){var u=i[a],c=o.consumer._sources.at(u.source);null!==o.consumer.sourceRoot&&(c=n.join(o.consumer.sourceRoot,c)),this._sources.add(c),c=this._sources.indexOf(c);var l=o.consumer._names.at(u.name);this._names.add(l),l=this._names.indexOf(l);var f={source:c,generatedLine:u.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(o.generatedOffset.generatedLine===u.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:l};this.__generatedMappings.push(f),"number"==typeof f.originalLine&&this.__originalMappings.push(f)}s(this.__generatedMappings,n.compareByGeneratedPositionsDeflated),s(this.__originalMappings,n.compareByOriginalPositions)}},60:function(e,t,r){var n=r(773),o=r(685),i=r(430).I,a=r(186).H;function s(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new i,this._names=new i,this._mappings=new a,this._sourcesContents=null}s.prototype._version=3,s.fromSourceMap=function(e){var t=e.sourceRoot,r=new s({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=o.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)})),e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&r.setSourceContent(t,n)})),r},s.prototype.addMapping=function(e){var t=o.getArg(e,"generated"),r=o.getArg(e,"original",null),n=o.getArg(e,"source",null),i=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,i),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:i})},s.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=o.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},s.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var a=this._sourceRoot;null!=a&&(n=o.relative(a,n));var s=new i,u=new i;this._mappings.unsortedForEach((function(t){if(t.source===n&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=r&&(t.source=o.join(r,t.source)),null!=a&&(t.source=o.relative(a,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var c=t.source;null==c||s.has(c)||s.add(c);var l=t.name;null==l||u.has(l)||u.add(l)}),this),this._sources=s,this._names=u,e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=o.join(r,t)),null!=a&&(t=o.relative(a,t)),this.setSourceContent(t,n))}),this)},s.prototype._validateMapping=function(e,t,r,n){if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},s.prototype._serializeMappings=function(){for(var e,t,r,i,a=0,s=1,u=0,c=0,l=0,f=0,h="",p=this._mappings.toArray(),d=0,g=p.length;d<g;d++){if(e="",(t=p[d]).generatedLine!==s)for(a=0;t.generatedLine!==s;)e+=";",s++;else if(d>0){if(!o.compareByGeneratedPositionsInflated(t,p[d-1]))continue;e+=","}e+=n.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(i=this._sources.indexOf(t.source),e+=n.encode(i-f),f=i,e+=n.encode(t.originalLine-1-c),c=t.originalLine-1,e+=n.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=n.encode(r-l),l=r)),h+=e}return h},s.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var r=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)},s.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},s.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=s},164:function(e,t,r){var n=r(60).SourceMapGenerator,o=r(685),i=/(\r?\n)/,a="$$$isSourceNode$$$";function s(e,t,r,n,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==o?null:o,this[a]=!0,null!=n&&this.add(n)}s.fromStringWithSourceMap=function(e,t,r){var n=new s,a=e.split(i),u=function(){return a.shift()+(a.shift()||"")},c=1,l=0,f=null;return t.eachMapping((function(e){if(null!==f){if(!(c<e.generatedLine)){var t=(r=a[0]).substr(0,e.generatedColumn-l);return a[0]=r.substr(e.generatedColumn-l),l=e.generatedColumn,h(f,t),void(f=e)}h(f,u()),c++,l=0}for(;c<e.generatedLine;)n.add(u()),c++;if(l<e.generatedColumn){var r=a[0];n.add(r.substr(0,e.generatedColumn)),a[0]=r.substr(e.generatedColumn),l=e.generatedColumn}f=e}),this),a.length>0&&(f&&h(f,u()),n.add(a.join(""))),t.sources.forEach((function(e){var i=t.sourceContentFor(e);null!=i&&(null!=r&&(e=o.join(r,e)),n.setSourceContent(e,i))})),n;function h(e,t){if(null===e||void 0===e.source)n.add(t);else{var i=r?o.join(r,e.source):e.source;n.add(new s(e.originalLine,e.originalColumn,i,t,e.name))}}},s.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},s.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},s.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r<n;r++)(t=this.children[r])[a]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},s.prototype.join=function(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;r<n-1;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},s.prototype.replaceRight=function(e,t){var r=this.children[this.children.length-1];return r[a]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},s.prototype.setSourceContent=function(e,t){this.sourceContents[o.toSetString(e)]=t},s.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][a]&&this.children[t].walkSourceContents(e);var n=Object.keys(this.sourceContents);for(t=0,r=n.length;t<r;t++)e(o.fromSetString(n[t]),this.sourceContents[n[t]])},s.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},s.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},r=new n(e),o=!1,i=null,a=null,s=null,u=null;return this.walk((function(e,n){t.code+=e,null!==n.source&&null!==n.line&&null!==n.column?(i===n.source&&a===n.line&&s===n.column&&u===n.name||r.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:t.line,column:t.column},name:n.name}),i=n.source,a=n.line,s=n.column,u=n.name,o=!0):o&&(r.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var c=0,l=e.length;c<l;c++)10===e.charCodeAt(c)?(t.line++,t.column=0,c+1===l?(i=null,o=!1):o&&r.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:t.line,column:t.column},name:n.name})):t.column++})),this.walkSourceContents((function(e,t){r.setSourceContent(e,t)})),{code:t.code,map:r}},t.SourceNode=s},685:function(e,t){t.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,n=/^data:.+\,.+$/;function o(e){var t=e.match(r);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function a(e){var r=e,n=o(e);if(n){if(!n.path)return e;r=n.path}for(var a,s=t.isAbsolute(r),u=r.split(/\/+/),c=0,l=u.length-1;l>=0;l--)"."===(a=u[l])?u.splice(l,1):".."===a?c++:c>0&&(""===a?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return""===(r=u.join("/"))&&(r=s?"/":"."),n?(n.path=r,i(n)):r}t.urlParse=o,t.urlGenerate=i,t.normalize=a,t.join=function(e,t){""===e&&(e="."),""===t&&(t=".");var r=o(t),s=o(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),i(r);if(r||t.match(n))return t;if(s&&!s.host&&!s.path)return s.host=t,i(s);var u="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=u,i(s)):u},t.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(r)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var s=!("__proto__"in Object.create(null));function u(e){return e}function c(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function l(e,t){return e===t?0:e>t?1:-1}t.toSetString=s?u:function(e){return c(e)?"$"+e:e},t.fromSetString=s?u:function(e){return c(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,r){var n=e.source-t.source;return 0!==n||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)||r||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=e.generatedLine-t.generatedLine)?n:e.name-t.name},t.compareByGeneratedPositionsDeflated=function(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||r||0!==(n=e.source-t.source)||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:e.name-t.name},t.compareByGeneratedPositionsInflated=function(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=l(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:l(e.name,t.name)}},8:function(e,t,r){t.SourceMapGenerator=r(60).SourceMapGenerator,t.SourceMapConsumer=r(351).SourceMapConsumer,t.SourceNode=r(164).SourceNode},894:function(e,t,r){var n,o,i,a=r(505).default;!function(s,u){"use strict";o=[r(901)],n=function(e){return{backtrace:function(t){var r=[],n=10;"object"===a(t)&&"number"==typeof t.maxStackSize&&(n=t.maxStackSize);for(var o=arguments.callee;o&&r.length<n&&o.arguments;){for(var i=new Array(o.arguments.length),s=0;s<i.length;++s)i[s]=o.arguments[s];/function(?:\s+([\w$]+))+\s*\(/.test(o.toString())?r.push(new e({functionName:RegExp.$1||void 0,args:i})):r.push(new e({args:i}));try{o=o.caller}catch(e){break}}return r}}},void 0===(i="function"==typeof n?n.apply(t,o):n)||(e.exports=i)}()},901:function(e,t,r){var n,o,i;r(505).default;!function(r,a){"use strict";o=[],void 0===(i="function"==typeof(n=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function r(e){return function(){return this[e]}}var n=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],i=["fileName","functionName","source"],a=["args"],s=["evalOrigin"],u=n.concat(o,i,a,s);function c(e){if(e)for(var r=0;r<u.length;r++)void 0!==e[u[r]]&&this["set"+t(u[r])](e[u[r]])}c.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof c)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new c(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",n=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:n?n+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r}},c.fromString=function(e){var t=e.indexOf("("),r=e.lastIndexOf(")"),n=e.substring(0,t),o=e.substring(t+1,r).split(","),i=e.substring(r+1);if(0===i.indexOf("@"))var a=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(i,""),s=a[1],u=a[2],l=a[3];return new c({functionName:n,args:o||void 0,fileName:s,lineNumber:u||void 0,columnNumber:l||void 0})};for(var l=0;l<n.length;l++)c.prototype["get"+t(n[l])]=r(n[l]),c.prototype["set"+t(n[l])]=function(e){return function(t){this[e]=Boolean(t)}}(n[l]);for(var f=0;f<o.length;f++)c.prototype["get"+t(o[f])]=r(o[f]),c.prototype["set"+t(o[f])]=function(t){return function(r){if(!e(r))throw new TypeError(t+" must be a Number");this[t]=Number(r)}}(o[f]);for(var h=0;h<i.length;h++)c.prototype["get"+t(i[h])]=r(i[h]),c.prototype["set"+t(i[h])]=function(e){return function(t){this[e]=String(t)}}(i[h]);return c})?n.apply(t,o):n)||(e.exports=i)}()},500:function(e,t,r){var n,o,i,a=r(505).default;!function(s,u){"use strict";o=[r(8),r(901)],void 0===(i="function"==typeof(n=function(e,t){function r(e){return new Promise((function(t,r){var n=new XMLHttpRequest;n.open("get",e),n.onerror=r,n.onreadystatechange=function(){4===n.readyState&&(n.status>=200&&n.status<300||"file://"===e.substr(0,7)&&n.responseText?t(n.responseText):r(new Error("HTTP status: "+n.status+" retrieving "+e)))},n.send()}))}function n(e){if("undefined"!=typeof window&&window.atob)return window.atob(e);throw new Error("You must supply a polyfill for window.atob in this environment")}function o(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function i(e,t){for(var r=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],n=e.split("\n"),o="",i=Math.min(t,20),a=0;a<i;++a){var s=n[t-a-1],u=s.indexOf("//");if(u>=0&&(s=s.substr(0,u)),s){o=s+o;for(var c=r.length,l=0;l<c;l++){var f=r[l].exec(o);if(f&&f[1])return f[1]}}}}function s(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")}function u(e){if("object"!==a(e))throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!=0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!=0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function c(e){for(var t,r,n=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;r=n.exec(e);)t=r[1];if(t)return t;throw new Error("sourceMappingURL not found")}function l(e,r,n){return new Promise((function(o,i){var a=r.originalPositionFor({line:e.lineNumber,column:e.columnNumber});if(a.source){var s=r.sourceContentFor(a.source);s&&(n[a.source]=s),o(new t({functionName:a.name||e.functionName,args:e.args,fileName:a.source,lineNumber:a.line,columnNumber:a.column}))}else i(new Error("Could not get original source for given stackframe and source map"))}))}return function a(f){if(!(this instanceof a))return new a(f);f=f||{},this.sourceCache=f.sourceCache||{},this.sourceMapConsumerCache=f.sourceMapConsumerCache||{},this.ajax=f.ajax||r,this._atob=f.atob||n,this._get=function(e){return new Promise(function(t,r){var n="data:"===e.substr(0,5);if(this.sourceCache[e])t(this.sourceCache[e]);else if(f.offline&&!n)r(new Error("Cannot make network requests in offline mode"));else if(n){var o=/^data:application\/json;([\w=:"-]+;)*base64,/,i=e.match(o);if(i){var a=i[0].length,s=e.substr(a),u=this._atob(s);this.sourceCache[e]=u,t(u)}else r(new Error("The encoding of the inline sourcemap is not supported"))}else{var c=this.ajax(e,{method:"get"});this.sourceCache[e]=c,c.then(t,r)}}.bind(this))},this._getSourceMapConsumer=function(t,r){return new Promise(function(n){if(this.sourceMapConsumerCache[t])n(this.sourceMapConsumerCache[t]);else{var i=new Promise(function(n,i){return this._get(t).then((function(t){"string"==typeof t&&(t=o(t.replace(/^\)\]\}'/,""))),void 0===t.sourceRoot&&(t.sourceRoot=r),n(new e.SourceMapConsumer(t))})).catch(i)}.bind(this));this.sourceMapConsumerCache[t]=i,n(i)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(t,r){this.getMappedLocation(e).then(function(e){function r(){t(e)}this.findFunctionName(e).then(t,r).catch(r)}.bind(this),r)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(r,n){u(e),this._get(e.fileName).then((function(n){var o=e.lineNumber,a=e.columnNumber,s=i(n,o,a);r(s?new t({functionName:s,args:e.args,fileName:e.fileName,lineNumber:o,columnNumber:a}):e)}),n).catch(n)}.bind(this))},this.getMappedLocation=function(e){return new Promise(function(t,r){s(),u(e);var n=this.sourceCache,o=e.fileName;this._get(o).then(function(r){var i=c(r),a="data:"===i.substr(0,5),s=o.substring(0,o.lastIndexOf("/")+1);return"/"===i[0]||a||/^https?:\/\/|^\/\//i.test(i)||(i=s+i),this._getSourceMapConsumer(i,s).then((function(r){return l(e,r,n).then(t).catch((function(){t(e)}))}))}.bind(this),r).catch(r)}.bind(this))}}})?n.apply(t,o):n)||(e.exports=i)}()},693:function(e,t,r){var n,o,i,a=r(505).default;!function(s,u){"use strict";o=[r(948),r(894),r(500)],n=function(e,t,r){var n={filter:function(e){return-1===(e.functionName||"").indexOf("StackTrace$$")&&-1===(e.functionName||"").indexOf("ErrorStackParser$$")&&-1===(e.functionName||"").indexOf("StackTraceGPS$$")&&-1===(e.functionName||"").indexOf("StackGenerator$$")},sourceCache:{}},o=function(){try{throw new Error}catch(e){return e}};function i(e,t){var r={};return[e,t].forEach((function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r})),r}function s(e){return e.stack||e["opera#sourceloc"]}function u(e,t){return"function"==typeof t?e.filter(t):e}return{get:function(e){var t=o();return s(t)?this.fromError(t,e):this.generateArtificially(e)},getSync:function(r){r=i(n,r);var a=o();return u(s(a)?e.parse(a):t.backtrace(r),r.filter)},fromError:function(t,o){o=i(n,o);var a=new r(o);return new Promise(function(r){var n=u(e.parse(t),o.filter);r(Promise.all(n.map((function(e){return new Promise((function(t){function r(){t(e)}a.pinpoint(e).then(t,r).catch(r)}))}))))}.bind(this))},generateArtificially:function(e){e=i(n,e);var r=t.backtrace(e);return"function"==typeof e.filter&&(r=r.filter(e.filter)),Promise.resolve(r)},instrument:function(e,t,r,n){if("function"!=typeof e)throw new Error("Cannot instrument non-function object");if("function"==typeof e.__stacktraceOriginalFn)return e;var o=function(){try{return this.get().then(t,r).catch(r),e.apply(n||this,arguments)}catch(e){throw s(e)&&this.fromError(e).then(t,r).catch(r),e}}.bind(this);return o.__stacktraceOriginalFn=e,o},deinstrument:function(e){if("function"!=typeof e)throw new Error("Cannot de-instrument non-function object");return"function"==typeof e.__stacktraceOriginalFn?e.__stacktraceOriginalFn:e},report:function(e,t,r,n){return new Promise((function(o,i){var s=new XMLHttpRequest;if(s.onerror=i,s.onreadystatechange=function(){4===s.readyState&&(s.status>=200&&s.status<400?o(s.responseText):i(new Error("POST to "+t+" failed with status: "+s.status)))},s.open("post",t),s.setRequestHeader("Content-Type","application/json"),n&&"object"===a(n.headers)){var u=n.headers;for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&s.setRequestHeader(c,u[c])}var l={stack:e};null!=r&&(l.message=r),s.send(JSON.stringify(l))}))}}},void 0===(i="function"==typeof n?n.apply(t,o):n)||(e.exports=i)}()},349:function(t){"use strict";t.exports=e},663:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},342:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},750:function(e){function t(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=e.apply(r,n);function s(e){t(a,o,i,s,u,"next",e)}function u(e){t(a,o,i,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},811:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},997:function(e,t,r){var n=r(969);function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},411:function(e,t,r){var n=r(969);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},644:function(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},149:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},731:function(e,t,r){var n=r(411);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.exports=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},25:function(e,t,r){var n=r(505).default;function o(){"use strict";e.exports=o=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(t){h=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),a=new R(n||[]);return s(i,"_invoke",{value:A(e,r,a)}),i}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var g="suspendedStart",v="executing",m="completed",y={};function b(){}function w(){}function x(){}var S={};h(S,c,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(T([])));k&&k!==i&&a.call(k,c)&&(S=k);var E=x.prototype=b.prototype=Object.create(S);function O(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function r(o,i,s,u){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var o;s(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}})}function A(e,r,n){var o=g;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=L(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===g)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=d(e,r,n);if("normal"===c.type){if(o=n.done?m:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=d(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(a.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,s(E,"constructor",{value:x,configurable:!0}),s(x,"constructor",{value:w,configurable:!0}),w.displayName=h(x,f,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,h(e,f,"GeneratorFunction")),e.prototype=Object.create(E),e},r.awrap=function(e){return{__await:e}},O(C.prototype),h(C.prototype,l,(function(){return this})),r.AsyncIterator=C,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var a=new C(p(e,t,n,o),i);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},O(E),h(E,f,"Generator"),h(E,c,(function(){return this})),h(E,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=T,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},r}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},488:function(e,t,r){var n=r(342),o=r(644),i=r(239),a=r(149);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},159:function(e,t,r){var n=r(505).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},969:function(e,t,r){var n=r(505).default,o=r(159);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},505:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},239:function(e,t,r){var n=r(663);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return n[e].call(r.exports,r,r.exports,i),r.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},r=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},i.t=function(e,n){if(1&n&&(e=this(e)),8&n)return e;if("object"==typeof e&&e){if(4&n&&e.__esModule)return e;if(16&n&&"function"==typeof e.then)return e}var o=Object.create(null);i.r(o);var a={};t=t||[null,r({}),r([]),r(r)];for(var s=2&n&&e;"object"==typeof s&&!~t.indexOf(s);s=r(s))Object.getOwnPropertyNames(s).forEach((function(t){a[t]=function(){return e[t]}}));return a.default=function(){return e},i.d(o,a),o},i.d=function(e,t){for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){"use strict";i.r(a),i.d(a,{LoggerSDK:function(){return k},gzipCompress:function(){return E.X$},isGzipSupported:function(){return E.aM}});var e=i(25),t=i.n(e),r=i(750),n=i.n(r),o=i(488),s=i.n(o),u=i(811),c=i.n(u),l=i(997),f=i.n(l),h=i(411),p=i.n(h),d=i(862),g=i(327);var v=i(226),m=i(19),y=function(){function e(t){c()(this,e),p()(this,"opts",void 0),this.opts=t}var r;return f()(e,[{key:"getTransporter",value:(r=n()(t()().mark((function e(){var r,n,o,a,s;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,m.FH)()){e.next=5;break}return e.next=3,Promise.resolve().then(i.bind(i,624));case 3:return r=e.sent,e.abrupt("return",new r.WechatTransport(this.opts));case 5:return e.next=7,Promise.resolve().then(i.bind(i,780));case 7:return n=e.sent,e.next=10,Promise.resolve().then(i.bind(i,173));case 10:if(o=e.sent,a=new n.BeaconTransport(this.opts),s=new o.PixelImageTransport(this.opts),!a.isSupported()){e.next=15;break}return e.abrupt("return",a);case 15:return e.abrupt("return",s);case 16:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}],[{key:"getInstance",value:function(t){return e.instance||(e.instance=new e(t)),e.instance}}]),e}();function b(){return"".concat(Date.now(),"_").concat(Math.random().toString(36).substring(2,15))}function w(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Math.floor(16*Math.random());return("x"===e?t:Math.floor(t%4+8)).toString(16)}))}p()(y,"instance",void 0);var x=function(){function e(){c()(this,e)}var r;return f()(e,null,[{key:"post",value:(r=n()(t()().mark((function e(r,n,o){return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,g.o7)(!0,"post",r,n,o),!(0,m.FH)()){e.next=3;break}return e.abrupt("return",new Promise((function(e,t){wx.request({url:r,method:"POST",data:JSON.stringify(n),header:{"Content-Type":"application/json",Authorization:"Bearer ".concat(o)},success:function(t){return e({type:"wechat",response:t})},fail:function(e){return t({type:"wechat",error:e})}})})));case 3:if("undefined"!=typeof fetch){e.next=5;break}return e.abrupt("return",new Promise((function(e,t){var i=new XMLHttpRequest;i.open("POST",r,!0),i.setRequestHeader("Content-Type","application/json"),i.setRequestHeader("Authorization","Bearer ".concat(o)),i.onreadystatechange=function(){4===i.readyState&&(200===i.status?e({type:"xhr",response:i.responseText}):t({type:"xhr",error:new Error(i.statusText)}))},i.send(JSON.stringify(n))})));case 5:return e.abrupt("return",new Promise((function(e,t){fetch(r,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(o)}}).then((function(t){return e({type:"fetch",response:t})})).catch((function(e){return t({type:"fetch",error:e})}))})));case 6:case"end":return e.stop()}}),e)}))),function(e,t,n){return r.apply(this,arguments)})}]),e}(),S=function(){function e(t){var r=this;c()(this,e),p()(this,"queue",[]),p()(this,"opts",void 0),p()(this,"storageKey",void 0),p()(this,"localforage",null),this.opts=t,this.storageKey="".concat(t.storagePrefix,"_queue"),this.loadLocalForage().then((function(){r.opts.enableStorage&&r.loadFromStorage()}))}var r,o;return f()(e,[{key:"loadLocalForage",value:(o=n()(t()().mark((function e(){var r,n;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,m.jU)()){e.next=2;break}return e.abrupt("return",null);case 2:if(e.prev=2,!(r=globalThis)||!r.localforage||"function"!=typeof r.localforage.getItem){e.next=7;break}return this.localforage=r.localforage,e.abrupt("return",this.localforage);case 7:return e.prev=7,e.next=10,Promise.resolve().then(i.t.bind(i,349,23));case 10:return n=e.sent,this.localforage=n,e.abrupt("return",this.localforage);case 15:return e.prev=15,e.t0=e.catch(7),(0,g.o7)(!!this.opts.debug,"localforage dynamic import failed, fallback to localStorage",e.t0),this.localforage=null,e.abrupt("return",null);case 20:e.next=27;break;case 22:return e.prev=22,e.t1=e.catch(2),(0,g.o7)(!!this.opts.debug,"localforage load error",e.t1),this.localforage=null,e.abrupt("return",null);case 27:case"end":return e.stop()}}),e,this,[[2,22],[7,15]])}))),function(){return o.apply(this,arguments)})},{key:"enqueue",value:function(e){return this.queue.length>=this.opts.maxSize&&(this.queue.shift(),(0,g.o7)(!!this.opts.debug,"Queue full, dropped oldest event")),this.queue.push(e),(0,g.o7)(!!this.opts.debug,"Enqueued event",e),this.opts.enableStorage&&this.saveToStorage(),!0}},{key:"peek",value:function(e){return this.queue.slice(0,e)}},{key:"dequeue",value:function(e){var t=this.queue.splice(0,e);return(0,g.o7)(!!this.opts.debug,"Dequeued ".concat(t.length," events")),this.opts.enableStorage&&this.saveToStorage(),t}},{key:"size",value:function(){return this.queue.length}},{key:"clear",value:function(){this.queue=[],(0,g.o7)(!!this.opts.debug,"Queue cleared"),this.opts.enableStorage&&this.removeFromStorage()}},{key:"loadFromStorage",value:(r=n()(t()().mark((function e(){var r,n,o,i,a;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,r=null,!(0,m.FH)()){e.next=6;break}r=wx.getStorageSync(this.storageKey),e.next=30;break;case 6:if(!(0,m.jU)()){e.next=30;break}if(this.localforage){e.next=10;break}return e.next=10,this.loadLocalForage();case 10:if(e.prev=10,!this.localforage){e.next=17;break}return e.next=14,this.localforage.getItem(this.storageKey);case 14:e.t0=e.sent,e.next=18;break;case 17:e.t0=null;case 18:if(n=e.t0,!Array.isArray(n)){e.next=23;break}return this.queue=n.slice(0,this.opts.maxSize),(0,g.o7)(!!this.opts.debug,"Loaded ".concat(this.queue.length," events from IndexedDB")),e.abrupt("return");case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(10),(0,g.o7)(!!this.opts.debug,"IndexedDB load error, falling back to localStorage",e.t1);case 28:if("undefined"!=typeof localStorage&&(o=localStorage.getItem(this.storageKey)))try{i=JSON.parse(o),Array.isArray(i)&&(this.queue=i.slice(0,this.opts.maxSize),(0,g.o7)(!!this.opts.debug,"Loaded ".concat(this.queue.length," events from localStorage")))}catch(e){}return e.abrupt("return");case 30:r&&(a=JSON.parse(r),Array.isArray(a)&&(this.queue=a.slice(0,this.opts.maxSize),(0,g.o7)(!!this.opts.debug,"Loaded ".concat(this.queue.length," events from storage")))),e.next=36;break;case 33:e.prev=33,e.t2=e.catch(0),(0,g.o7)(!!this.opts.debug,"Failed to load queue from storage",e.t2);case 36:case"end":return e.stop()}}),e,this,[[0,33],[10,25]])}))),function(){return r.apply(this,arguments)})},{key:"saveToStorage",value:function(){var e=this;try{var t=(0,g.or)(this.queue);if((0,m.FH)())wx.setStorageSync(this.storageKey,t);else if((0,m.jU)()){var r=function(){"undefined"!=typeof localStorage&&(localStorage.setItem(e.storageKey,t),(0,g.o7)(!!e.opts.debug,"Saved ".concat(e.queue.length," events to localStorage")))};this.localforage?this.localforage.setItem(this.storageKey,this.queue).then((function(){(0,g.o7)(!!e.opts.debug,"Saved ".concat(e.queue.length," events to IndexedDB"))})).catch((function(t){(0,g.o7)(!!e.opts.debug,"IndexedDB save error, falling back to localStorage",t),r()})):this.loadLocalForage().then((function(){return e.localforage?e.localforage.setItem(e.storageKey,e.queue).then((function(){(0,g.o7)(!!e.opts.debug,"Saved ".concat(e.queue.length," events to IndexedDB"))})).catch((function(t){(0,g.o7)(!!e.opts.debug,"IndexedDB save error, falling back to localStorage",t),r()})):(r(),null)})).catch((function(t){(0,g.o7)(!!e.opts.debug,"IndexedDB save error, falling back to localStorage",t),r()}))}}catch(e){(0,g.o7)(!!this.opts.debug,"Failed to save queue to storage",e)}}},{key:"removeFromStorage",value:function(){var e=this;try{if((0,m.FH)())wx.removeStorageSync(this.storageKey);else if((0,m.jU)()){var t=function(){"undefined"!=typeof localStorage&&(localStorage.removeItem(e.storageKey),(0,g.o7)(!!e.opts.debug,"Removed queue from localStorage"))};this.localforage?this.localforage.removeItem(this.storageKey).then((function(){(0,g.o7)(!!e.opts.debug,"Removed queue from IndexedDB")})).catch((function(r){(0,g.o7)(!!e.opts.debug,"IndexedDB remove error, falling back to localStorage",r),t()})):this.loadLocalForage().then((function(){return e.localforage?e.localforage.removeItem(e.storageKey).then((function(){(0,g.o7)(!!e.opts.debug,"Removed queue from IndexedDB")})).catch((function(r){(0,g.o7)(!!e.opts.debug,"IndexedDB remove error, falling back to localStorage",r),t()})):(t(),null)})).catch((function(r){(0,g.o7)(!!e.opts.debug,"IndexedDB remove error, falling back to localStorage",r),t()}))}}catch(e){(0,g.o7)(!!this.opts.debug,"Failed to remove queue from storage",e)}}}]),e}(),_=function(){function e(t){c()(this,e),p()(this,"opts",void 0),p()(this,"retryingTasks",new Map),this.opts=t}var r,o;return f()(e,[{key:"executeWithRetry",value:(o=n()(t()().mark((function e(r,n){var o,i;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.retryingTasks.has(r)){e.next=3;break}throw(0,g.o7)(!!this.opts.debug,"Task ".concat(r," already retrying, skipped")),new Error("Task ".concat(r," already retrying"));case 3:return o={id:r,fn:n,retries:0,maxRetries:this.opts.maxRetries,baseDelay:this.opts.baseDelay,useBackoff:this.opts.useBackoff},this.retryingTasks.set(r,o),e.prev=5,e.next=8,this.executeTask(o);case 8:return i=e.sent,this.retryingTasks.delete(r),e.abrupt("return",i);case 13:throw e.prev=13,e.t0=e.catch(5),this.retryingTasks.delete(r),e.t0;case 17:case"end":return e.stop()}}),e,this,[[5,13]])}))),function(e,t){return o.apply(this,arguments)})},{key:"executeTask",value:(r=n()(t()().mark((function r(n){var o,i;return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n.retries<=n.maxRetries)){t.next=21;break}return t.prev=1,t.next=4,n.fn();case 4:return o=t.sent,n.retries>0&&(0,g.o7)(!!this.opts.debug,"Task ".concat(n.id," succeeded after ").concat(n.retries," retries")),t.abrupt("return",o);case 9:if(t.prev=9,t.t0=t.catch(1),n.retries+=1,!(n.retries>n.maxRetries)){t.next=15;break}throw(0,g.o7)(!!this.opts.debug,"Task ".concat(n.id," failed after ").concat(n.maxRetries," retries")),t.t0;case 15:return i=e.calculateDelay(n.retries,n.baseDelay,n.useBackoff),(0,g.o7)(!!this.opts.debug,"Task ".concat(n.id," failed (attempt ").concat(n.retries,"/").concat(n.maxRetries,"), retrying in ").concat(i,"ms")),t.next=19,e.sleep(i);case 19:t.next=0;break;case 21:throw new Error("Task ".concat(n.id," exceeded max retries"));case 22:case"end":return t.stop()}}),r,this,[[1,9]])}))),function(e){return r.apply(this,arguments)})},{key:"getRetryingCount",value:function(){return this.retryingTasks.size}},{key:"clear",value:function(){this.retryingTasks.clear()}}],[{key:"calculateDelay",value:function(e,t,r){if(!r)return t;var n=t*Math.pow(2,e-1),o=.3*Math.random()*n;return Math.min(n+o,3e4)}},{key:"sleep",value:function(e){return new Promise((function(t){return setTimeout(t,e)}))}}]),e}(),k=function(){function e(){c()(this,e),p()(this,"opts",void 0),p()(this,"seq",0),p()(this,"closed",!1),p()(this,"envTags",{}),p()(this,"initialized",!1),p()(this,"sessionId",void 0),p()(this,"queueManager",void 0),p()(this,"retryManager",void 0),p()(this,"transporter",void 0),p()(this,"batchTimer",void 0),p()(this,"isSending",!1),p()(this,"collectSwitch",0),p()(this,"collectLogLevel",[]),p()(this,"recentAutoEvents",new Map),p()(this,"offJs",void 0),p()(this,"offPromise",void 0),p()(this,"offResource",void 0),p()(this,"offWxError",void 0),p()(this,"offWxUnhandled",void 0),this.sessionId=b()}var r,o,i,a,u,l;return f()(e,[{key:"init",value:function(e){var r=this;this.opts={appId:"".concat(e.appId,"-frontend")||0,env:e.env||"develop",logStage:e.logStage,debug:!!e.debug,enableGzip:!1!==e.enableGzip,gzipOnlyInBatchMode:!1!==e.gzipOnlyInBatchMode,maxPixelUrlLen:e.maxPixelUrlLen||8192,enableBatch:!0===e.enableBatch,batchSize:e.batchSize||20,batchInterval:e.batchInterval||15e3,maxQueueSize:e.maxQueueSize||100,enableStorage:!0===e.enableBatch||!1!==e.enableStorage,storagePrefix:e.storagePrefix||"logger_sdk",enableRetry:!1!==e.enableRetry,maxRetries:e.maxRetries||3,retryDelay:e.retryDelay||1e3,retryBackoff:!1!==e.retryBackoff,userId:e.userId,storeCode:e.storeCode,token:e.token,sampleRate:"number"==typeof e.sampleRate?e.sampleRate:1,levelSampleRate:e.levelSampleRate||{ERROR:.8,WARN:.5,INFO:.1,FATAL:1},sourceSampleRate:e.sourceSampleRate||{js:.8,promise:.5,resource:.2,custom:1},pathSampleRate:e.pathSampleRate||{"/":1},enableAutoCapture:!1!==e.enableAutoCapture,autoCapture:e.autoCapture||{js:!0,promise:!0,resource:!0,wechat:!0}},this.opts.enableBatch&&(this.queueManager=new S({maxSize:this.opts.maxQueueSize,enableStorage:this.opts.enableStorage,storagePrefix:this.opts.storagePrefix,debug:this.opts.debug})),this.opts.enableRetry&&(this.retryManager=new _({maxRetries:this.opts.maxRetries,baseDelay:this.opts.retryDelay,useBackoff:this.opts.retryBackoff,debug:this.opts.debug})),this.transporter=void 0,this.sessionId=b(),this.envTags=(0,m.iH)(),this.initSDK(this.opts,(function(e){var o,i,a;r.collectSwitch=e.collectSwitch,r.collectLogLevel=e.collectLogLevel,r.opts.sampleRate=e.samplingRate,null!==(o=r.opts)&&void 0!==o&&o.enableBatch&&r.startBatchTimer(),r.initialized=!0,r.attachUnloadHandlers();var s,u,c,l,f,h=!1!==(null===(i=r.opts)||void 0===i?void 0:i.enableAutoCapture),p=(null===(a=r.opts)||void 0===a?void 0:a.autoCapture)||{};h&&!1!==p.js&&(r.offJs=function(e,r){if("undefined"!=typeof window){var o=function(){var o=n()(t()().mark((function n(o){var i;return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((0,g.o7)(e,"registerJsErrorCapture error",o),o.error){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,(0,d.T)(o.error);case 5:i=t.sent,r({type:"js",message:o.error.message,stack:i,throwable:o.error.stack||""});case 7:case"end":return t.stop()}}),n)})));return function(e){return o.apply(this,arguments)}}();return window.addEventListener("error",o),function(){return window.removeEventListener("error",o)}}}(!(null===(s=r.opts)||void 0===s||!s.debug),r.trackInner.bind(r)));h&&!1!==p.promise&&(r.offPromise=function(e,r){if("undefined"!=typeof window){var o=function(){var o=n()(t()().mark((function n(o){var i,a;return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((0,g.o7)(e,"registerPromiseErrorCapture unhandledrejection",o),!((i=o.reason)instanceof Error)){t.next=7;break}return t.next=5,(0,d.T)(i);case 5:a=t.sent,r({type:"promise",message:i.message,stack:a,throwable:i.stack||""});case 7:case"end":return t.stop()}}),n)})));return function(e){return o.apply(this,arguments)}}();return window.addEventListener("unhandledrejection",o),function(){return window.removeEventListener("unhandledrejection",o)}}}(!(null===(u=r.opts)||void 0===u||!u.debug),r.trackInner.bind(r)));h&&!1!==p.resource&&(r.offResource=function(e,t){if("undefined"!=typeof window){var r=function(r){(0,g.o7)(e,"registerResourceErrorCapture error",r);var n,o=r.target;(null!=o&&o.src||null!=o&&o.href)&&t({type:"resource",message:"Resource load failed: ".concat((null==o?void 0:o.src)||(null==o?void 0:o.href)),stack:[],throwable:(null==r||null===(n=r.error)||void 0===n?void 0:n.stack)||""})};return window.addEventListener("error",r,!0),function(){return window.removeEventListener("error",r,!0)}}}(!(null===(c=r.opts)||void 0===c||!c.debug),r.trackInner.bind(r)));h&&!1!==p.wechat&&(r.offWxError=function(e,r){if((0,m.FH)())try{var o=globalThis.wx;if(o&&"function"==typeof o.onError){var i=function(){var o=n()(t()().mark((function n(o){var i,a,s,u;return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(0,g.o7)(e,"registerWechatErrorCapture onError",o),a=String(null!==(i=null==o?void 0:o.message)&&void 0!==i?i:o),s=o instanceof Error?o:new Error(a),t.next=5,(0,d.T)(s);case 5:u=t.sent,r({type:"js",message:s.message,stack:u,throwable:s.stack||""});case 7:case"end":return t.stop()}}),n)})));return function(e){return o.apply(this,arguments)}}();return o.onError(i),function(){try{o.offError&&o.offError(i)}catch(e){}}}}catch(t){(0,g.o7)(e,"registerWechatErrorCapture attach failed",t)}}(!(null===(l=r.opts)||void 0===l||!l.debug),r.trackInner.bind(r)),r.offWxUnhandled=function(e,r){if((0,m.FH)())try{var o=globalThis.wx;if(o&&"function"==typeof o.onUnhandledRejection){var i=function(){var o=n()(t()().mark((function n(o){var i,a,s;return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=null==o?void 0:o.reason,(0,g.o7)(e,"registerWechatUnhandledCapture onUnhandledRejection",i),a=i instanceof Error?i:new Error(String(i)),t.next=5,(0,d.T)(a);case 5:s=t.sent,r({type:"promise",message:a.message,stack:s,throwable:a.stack||""});case 7:case"end":return t.stop()}}),n)})));return function(e){return o.apply(this,arguments)}}();return o.onUnhandledRejection(i),function(){try{o.offUnhandledRejection&&o.offUnhandledRejection(i)}catch(e){}}}}catch(t){(0,g.o7)(e,"registerWechatUnhandledCapture attach failed",t)}}(!(null===(f=r.opts)||void 0===f||!f.debug),r.trackInner.bind(r)))}))}},{key:"identify",value:function(e){var t;(0,g.o7)(!(null===(t=this.opts)||void 0===t||!t.debug),"identify",e),this.opts&&(this.opts.userId=e)}},{key:"setStoreCode",value:function(e){var t;(0,g.o7)(!(null===(t=this.opts)||void 0===t||!t.debug),"setStoreCode",e),this.opts&&(this.opts.storeCode=e)}},{key:"setStage",value:function(e){var t;(0,g.o7)(!(null===(t=this.opts)||void 0===t||!t.debug),"setStage",e),this.opts&&(this.opts.env=e)}},{key:"flattenEnvTags",value:function(){return Object.entries(this.envTags||{}).map((function(e){var t=s()(e,2),r=t[0],n=t[1];return"".concat(r,"=").concat(n)})).join(",")}},{key:"track",value:(l=n()(t()().mark((function e(r){var n,o,i,a,s,u,c,l,f,h,p,d,v,y;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.message,i=r.error,a=r.traceId,s=r.logLevel,u=void 0===s?"INFO":s,(0,g.o7)(!(null===(n=this.opts)||void 0===n||!n.debug),"track",{message:o,error:i,traceId:a,logLevel:u}),!this.closed){e.next=4;break}return e.abrupt("return");case 4:if(this.initialized){e.next=7;break}return(0,g.o7)(!(null===(c=this.opts)||void 0===c||!c.debug),"SDK not initialized, skip track"),e.abrupt("return");case 7:if(this.shouldSend(u,"custom",(0,m.bq)(),a,o)){e.next=10;break}return(0,g.o7)(!(null===(l=this.opts)||void 0===l||!l.debug),"Event sampled out",{logLevel:u,traceId:a,message:o}),e.abrupt("return");case 10:if(this.seq+=1,f="",h="",!(i instanceof Error)){e.next=28;break}return e.prev=14,e.next=17,(0,g.xn)(i);case 17:p=e.sent,d=p.location,v=p.throwable,f=d||"",h=v||i.stack||"",e.next=28;break;case 24:e.prev=24,e.t0=e.catch(14),f="",h=i.stack||"";case 28:y={logId:"".concat(this.opts.appId).concat(w()).concat((0,g.zO)()),seq:this.seq,appId:this.opts.appId||"unknown",stage:this.opts.logStage,level:u,traceId:a,frontendId:this.sessionId,url:(0,m.bq)(),location:f,message:"[message]: ".concat(o,"; [envTags]: ").concat(this.flattenEnvTags(),"; [t]: ").concat((0,g.zO)()),throwable:h,userId:this.opts.userId,storeCode:this.opts.storeCode},this.doTrack(y);case 30:case"end":return e.stop()}}),e,this,[[14,24]])}))),function(e){return l.apply(this,arguments)})},{key:"trackInner",value:function(e){var t,r;if(!this.closed)if(this.initialized){(0,g.o7)(!(null===(t=this.opts)||void 0===t||!t.debug),"trackInner",e);var n="".concat(e.type,"|").concat((0,g.R_)(e.message),"|").concat(String(this.sessionId||"")),o=(0,g.zO)();if(!(o-(this.recentAutoEvents.get(n)||0)<3e3))if(this.recentAutoEvents.set(n,o),this.shouldSend("ERROR",e.type,(0,m.bq)(),void 0,e.message)){this.seq+=1;var i,a,s,u,c="",l=(null===(r=e.stack)||void 0===r?void 0:r.map((function(e){return"".concat(e.file,":").concat(e.line,":").concat(e.column)})).join("\n\t"))||"";if(e.stack&&e.stack.length>0)c="".concat(null===(i=e.stack)||void 0===i?void 0:i[0].file,":").concat(null===(a=e.stack)||void 0===a?void 0:a[0].line,":").concat(null===(s=e.stack)||void 0===s?void 0:s[0].column,":").concat(null===(u=e.stack)||void 0===u?void 0:u[0].function);var f={logId:"".concat(this.opts.appId).concat(w()).concat((0,g.zO)()),seq:this.seq,appId:this.opts.appId||"unknown",stage:this.opts.env||"develop",level:"ERROR",frontendId:this.sessionId,url:(0,m.bq)(),location:c,message:"[message]: ".concat(e.message,"; [envTags]: ").concat(this.flattenEnvTags(),"; [t]: ").concat((0,g.zO)()),throwable:l,userId:this.opts.userId,storeCode:this.opts.storeCode};this.doTrack(f)}else{var h;(0,g.o7)(!(null===(h=this.opts)||void 0===h||!h.debug),"Auto-captured event sampled out",e.message)}}else{var p;(0,g.o7)(!(null===(p=this.opts)||void 0===p||!p.debug),"SDK not initialized, skip track")}}},{key:"shouldSend",value:function(e,t,r,n,o){var i,a,s,u,c,l=this;if("FATAL"===e)return!0;if(0===this.collectSwitch)return(0,g.o7)(!(null===(u=this.opts)||void 0===u||!u.debug),"Collect switch is off, skip track"),!1;if(!this.collectLogLevel.some((function(t){return t===e})))return(0,g.o7)(!(null===(c=this.opts)||void 0===c||!c.debug),"Log level(".concat(e,") not in collect log level, skip track")),!1;var f,h=null===(i=this.opts)||void 0===i||null===(i=i.levelSampleRate)||void 0===i?void 0:i[e],p=null===(a=this.opts)||void 0===a||null===(a=a.sourceSampleRate)||void 0===a?void 0:a[t],d=(null===(s=this.opts)||void 0===s?void 0:s.pathSampleRate)||{},v=Object.keys(d);if(v.length){for(var m="",y=0;y<v.length;y+=1){var b=v[y];r.startsWith(b)&&b.length>=m.length&&(m=b)}m&&(f=d[m])}var w=function(e){if("number"==typeof h)return h;if("number"==typeof p)return p;if("number"==typeof f)return f;var t=null===(e=l.opts)||void 0===e?void 0:e.sampleRate;return"number"==typeof t?t:1}(),x=Math.max(0,Math.min(1,w));if(x>=1)return!0;var S="".concat(String(n||""),"|").concat(String(o||""),"|").concat(String(this.sessionId||""),"|").concat(String(e),"|").concat(String(t),"|").concat(String(r));return(0,g.Hk)(S)<x}},{key:"doTrack",value:(u=n()(t()().mark((function e(r){var n,o,i;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,g.o7)(!(null===(n=this.opts)||void 0===n||!n.debug),"track",r),!this.opts.enableBatch||!this.queueManager){e.next=9;break}if(this.queueManager.enqueue(r),!(this.queueManager.size()>=this.opts.batchSize)){e.next=7;break}return(0,g.o7)(!(null===(o=this.opts)||void 0===o||!o.debug),"Queue size reached batch size, flushing immediately"),e.next=7,this.flush();case 7:e.next=17;break;case 9:return e.prev=9,e.next=12,this.sendEvent(r);case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(9),(0,g.o7)(!(null===(i=this.opts)||void 0===i||!i.debug),"track failed",e.t0);case 17:case"end":return e.stop()}}),e,this,[[9,14]])}))),function(e){return u.apply(this,arguments)})},{key:"flush",value:(a=n()(t()().mark((function e(){var r,n,o,i,a;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.queueManager&&0!==this.queueManager.size()){e.next=2;break}return e.abrupt("return");case 2:if(!this.isSending){e.next=5;break}return(0,g.o7)(!(null===(n=this.opts)||void 0===n||!n.debug),"Already sending, skip flush"),e.abrupt("return");case 5:if(this.isSending=!0,(0,g.o7)(!(null===(r=this.opts)||void 0===r||!r.debug),"Flushing ".concat(this.queueManager.size()," events")),e.prev=7,0!==(i=this.queueManager.peek(this.queueManager.size())).length){e.next=11;break}return e.abrupt("return");case 11:return e.next=13,this.sendBatch(i);case 13:this.queueManager.dequeue(i.length),(0,g.o7)(!(null===(o=this.opts)||void 0===o||!o.debug),"Flushed ".concat(i.length," events successfully")),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(7),(0,g.o7)(!(null===(a=this.opts)||void 0===a||!a.debug),"Flush failed",e.t0);case 20:return e.prev=20,this.isSending=!1,e.finish(20);case 23:case"end":return e.stop()}}),e,this,[[7,17,20,23]])}))),function(){return a.apply(this,arguments)})},{key:"destroy",value:(i=n()(t()().mark((function r(){return t()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.closed=!0,this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=null),t.next=4,this.flush();case 4:this.queueManager&&this.queueManager.clear(),this.retryManager&&this.retryManager.clear(),this.offJs&&(this.offJs(),this.offJs=void 0),this.offPromise&&(this.offPromise(),this.offPromise=void 0),this.offResource&&(this.offResource(),this.offResource=void 0),this.offWxError&&(this.offWxError(),this.offWxError=void 0),this.offWxUnhandled&&(this.offWxUnhandled(),this.offWxUnhandled=void 0),this.initialized=!1,this.sessionId=void 0,e.instance=void 0;case 14:case"end":return t.stop()}}),r,this)}))),function(){return i.apply(this,arguments)})},{key:"sendEvent",value:(o=n()(t()().mark((function e(r){var o,i=this;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=function(){var e=n()(t()().mark((function e(){var n;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=i.transporter,e.t0){e.next=5;break}return e.next=4,y.getInstance(i.opts).getTransporter();case 4:e.t0=e.sent;case 5:return n=e.t0,i.transporter=n,e.next=9,n.send({appId:r.appId,appStage:r.stage,items:[{level:"FATAL"===r.level?"ERROR":r.level,traceId:r.traceId,frontendId:r.frontendId,location:r.location,message:r.message,throwable:r.throwable}]});case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),!this.opts.enableRetry||!this.retryManager){e.next=6;break}return e.next=4,this.retryManager.executeWithRetry(r.logId,o);case 4:e.next=8;break;case 6:return e.next=8,o();case 8:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"sendBatch",value:(r=n()(t()().mark((function e(r){var o,i,a,u,c,l,f,h,p,d,v,m,b,w,x,S=this;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==r.length){e.next=2;break}return e.abrupt("return");case 2:for(i=new Map,a=0;a<r.length;a+=1)u=r[a],c="".concat(u.appId,"|").concat(u.stage),(l=i.get(c))?l.push(u):i.set(c,[u]);f=Math.min(200,(null===(o=this.opts)||void 0===o?void 0:o.batchSize)||50),h=Array.from(i.entries()),p=[],d=0;case 8:if(!(d<h.length)){e.next=21;break}v=s()(h[d],2),m=v[0],(b=v[1]).sort((function(e,t){return e.seq-t.seq})),w=t()().mark((function e(){var r,o,i,a;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(r=b.slice(x,x+f)).length>0&&(o="batch_".concat((0,g.zO)(),"_").concat(Math.random().toString(36).substring(2,9),"_").concat(m,"_").concat(x),i=function(){var e=n()(t()().mark((function e(){var n;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=S.transporter,e.t0){e.next=5;break}return e.next=4,y.getInstance(S.opts).getTransporter();case 4:e.t0=e.sent;case 5:return n=e.t0,S.transporter=n,e.next=9,n.send({appId:r[0].appId,appStage:r[0].stage,items:r.map((function(e){return{level:"FATAL"===e.level?"ERROR":e.level,traceId:e.traceId,frontendId:e.frontendId,location:e.location,message:e.message,throwable:e.throwable}}))});case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=S.opts.enableRetry&&S.retryManager?S.retryManager.executeWithRetry(o,i):i(),p.push(a));case 2:case"end":return e.stop()}}),e)})),x=0;case 13:if(!(x<b.length)){e.next=18;break}return e.delegateYield(w(),"t0",15);case 15:x+=f,e.next=13;break;case 18:d+=1,e.next=8;break;case 21:return e.next=23,Promise.all(p);case 23:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"startBatchTimer",value:function(){var e,t=this;this.batchTimer||(this.batchTimer=setInterval((function(){var e;!t.closed&&t.queueManager&&t.queueManager.size()>0&&((0,g.o7)(!(null===(e=t.opts)||void 0===e||!e.debug),"Batch timer triggered, flushing queue"),t.flush().catch((function(e){var r;(0,g.o7)(!(null===(r=t.opts)||void 0===r||!r.debug),"Batch timer flush failed",e)})))}),this.opts.batchInterval),(0,g.o7)(!(null===(e=this.opts)||void 0===e||!e.debug),"Batch timer started with interval ".concat(this.opts.batchInterval,"ms")))}},{key:"attachUnloadHandlers",value:function(){var e,t=this;if(!1!==(null===(e=this.opts)||void 0===e?void 0:e.enableAutoCapture)&&(0,m.jU)()){var r=window;document.addEventListener&&document.addEventListener("visibilitychange",(function(){try{var e;if("hidden"===document.visibilityState)t.flush().catch((function(){})),(0,g.o7)(!(null===(e=t.opts)||void 0===e||!e.debug),"Page hidden, flushed queue")}catch(e){}})),r.addEventListener&&r.addEventListener("pagehide",(function(){try{var e,r;(0,g.o7)(!(null===(e=t.opts)||void 0===e||!e.debug),"Page hide, flushed queue"),t.flush().catch((function(){})),(0,g.o7)(!(null===(r=t.opts)||void 0===r||!r.debug),"Page hide, flushed queue")}catch(e){}})),r.addEventListener&&r.addEventListener("beforeunload",(function(){try{var e,r;(0,g.o7)(!(null===(e=t.opts)||void 0===e||!e.debug),"Page unload, flushed queue"),t.flush().catch((function(){})),(0,g.o7)(!(null===(r=t.opts)||void 0===r||!r.debug),"Page unload, flushed queue")}catch(e){}}))}}},{key:"initSDK",value:function(e,r){var o,i=this;x.post((0,v.Qg)((null===(o=this.opts)||void 0===o?void 0:o.env)||"develop"),{appId:e.appId,message:"init",appStage:e.logStage,location:"",userId:e.userId,storeCode:e.storeCode},e.token).then(function(){var e=n()(t()().mark((function e(n){var o,a,s,u,c,l,f,h;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,g.o7)(!(null===(o=i.opts)||void 0===o||!o.debug),"Register success",n),n){e.next=3;break}return e.abrupt("return");case 3:if(a=n.type,s=n.response,n.error,u=!1,"wechat"!==a||200!==(null==s?void 0:s.statusCode)){e.next=10;break}u=!0,c=s.data.data,e.next=19;break;case 10:if("fetch"!==a){e.next=18;break}return e.next=13,null==s||null===(l=s.json)||void 0===l?void 0:l.call(s);case 13:h=e.sent,(0,g.o7)(!(null===(f=i.opts)||void 0===f||!f.debug),"Register fetch response",h),0===(null==h?void 0:h.code)&&(u=!0,c=h.data),e.next=19;break;case 18:"xhr"===a&&(u=!0);case 19:u&&c&&r(c);case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){var t;(0,g.o7)(!(null===(t=i.opts)||void 0===t||!t.debug),"Failed to initialize SDK",e)}))}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();p()(k,"instance",void 0);var E=i(26)}(),a}()}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluve/logger-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "logger sdk",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"logger"
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
"stacktrace-js": "^2.0.2"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"js-base64": "^3.7.5",
|
|
71
70
|
"localforage": "^1.10.0"
|
|
72
71
|
}
|
|
73
72
|
}
|