@gglib/utils 0.6.2 → 0.8.1
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/LICENSE +7 -0
- package/Readme.md +11 -7
- package/dist/bundles/utils.esm.js +1904 -0
- package/dist/bundles/utils.esm.js.map +1 -0
- package/dist/stats.html +211 -170
- package/dist/utils/src/collections/IdMap.d.ts +13 -0
- package/dist/utils/src/collections/IdMap.d.ts.map +1 -0
- package/dist/utils/src/collections/IdMap.js +63 -0
- package/dist/utils/src/collections/IdMap.js.map +1 -0
- package/dist/utils/src/collections/IdSet.d.ts +11 -0
- package/dist/utils/src/collections/IdSet.d.ts.map +1 -0
- package/dist/utils/src/collections/IdSet.js +47 -0
- package/dist/utils/src/collections/IdSet.js.map +1 -0
- package/dist/utils/src/collections/PooledList.d.ts +15 -0
- package/dist/utils/src/collections/PooledList.d.ts.map +1 -0
- package/dist/utils/src/collections/PooledList.js +44 -0
- package/dist/utils/src/collections/PooledList.js.map +1 -0
- package/dist/utils/src/collections/PriorityQueue.d.ts +27 -0
- package/dist/utils/src/collections/PriorityQueue.d.ts.map +1 -0
- package/dist/utils/src/collections/PriorityQueue.js +142 -0
- package/dist/utils/src/collections/PriorityQueue.js.map +1 -0
- package/dist/utils/src/collections/array.d.ts +27 -0
- package/dist/utils/src/collections/array.d.ts.map +1 -0
- package/dist/utils/src/collections/array.js +55 -0
- package/dist/utils/src/collections/array.js.map +1 -0
- package/dist/utils/src/collections/index.d.ts +6 -0
- package/dist/utils/src/collections/index.d.ts.map +1 -0
- package/dist/utils/src/collections/index.js +6 -0
- package/dist/utils/src/collections/index.js.map +1 -0
- package/dist/utils/src/events/bus.d.ts +15 -0
- package/dist/utils/src/events/bus.d.ts.map +1 -0
- package/dist/utils/src/events/bus.js +47 -0
- package/dist/utils/src/events/bus.js.map +1 -0
- package/dist/utils/src/events/channel.d.ts +23 -0
- package/dist/utils/src/events/channel.d.ts.map +1 -0
- package/dist/utils/src/events/channel.js +95 -0
- package/dist/utils/src/events/channel.js.map +1 -0
- package/dist/utils/src/events/emitter.d.ts +14 -0
- package/dist/utils/src/events/emitter.d.ts.map +1 -0
- package/dist/utils/src/events/emitter.js +37 -0
- package/dist/utils/src/events/emitter.js.map +1 -0
- package/dist/utils/src/events/index.d.ts +6 -0
- package/dist/utils/src/events/index.d.ts.map +1 -0
- package/dist/utils/src/events/index.js +6 -0
- package/dist/utils/src/events/index.js.map +1 -0
- package/dist/utils/src/events/source.d.ts +20 -0
- package/dist/utils/src/events/source.d.ts.map +1 -0
- package/dist/utils/src/events/source.js +69 -0
- package/dist/utils/src/events/source.js.map +1 -0
- package/dist/utils/src/events/types.d.ts +3 -0
- package/dist/utils/src/events/types.d.ts.map +1 -0
- package/dist/utils/src/events/types.js +2 -0
- package/dist/utils/src/events/types.js.map +1 -0
- package/dist/utils/src/index.d.ts +5 -9
- package/dist/utils/src/index.d.ts.map +1 -1
- package/dist/utils/src/index.js +5 -9
- package/dist/utils/src/index.js.map +1 -1
- package/dist/utils/src/{BinaryReader.d.ts → reader/BinaryReader.d.ts} +19 -1
- package/dist/utils/src/reader/BinaryReader.d.ts.map +1 -0
- package/dist/utils/src/{BinaryReader.js → reader/BinaryReader.js} +80 -61
- package/dist/utils/src/reader/BinaryReader.js.map +1 -0
- package/dist/utils/src/reader/TextReader.d.ts +245 -0
- package/dist/utils/src/reader/TextReader.d.ts.map +1 -0
- package/dist/utils/src/reader/TextReader.js +465 -0
- package/dist/utils/src/reader/TextReader.js.map +1 -0
- package/dist/utils/src/reader/index.d.ts +3 -0
- package/dist/utils/src/reader/index.d.ts.map +1 -0
- package/dist/utils/src/reader/index.js +3 -0
- package/dist/utils/src/reader/index.js.map +1 -0
- package/dist/utils/src/types/brand.d.ts +26 -0
- package/dist/utils/src/types/brand.d.ts.map +1 -0
- package/dist/utils/src/types/brand.js +4 -0
- package/dist/utils/src/types/brand.js.map +1 -0
- package/dist/utils/src/types/index.d.ts +4 -0
- package/dist/utils/src/types/index.d.ts.map +1 -0
- package/dist/utils/src/types/index.js +4 -0
- package/dist/utils/src/types/index.js.map +1 -0
- package/dist/utils/src/types/json-rpc.d.ts +72 -0
- package/dist/utils/src/types/json-rpc.d.ts.map +1 -0
- package/dist/utils/src/types/json-rpc.js +99 -0
- package/dist/utils/src/types/json-rpc.js.map +1 -0
- package/dist/utils/src/types/rxjs.d.ts +17 -0
- package/dist/utils/src/types/rxjs.d.ts.map +1 -0
- package/dist/utils/src/types/rxjs.js +10 -0
- package/dist/utils/src/types/rxjs.js.map +1 -0
- package/dist/utils/src/uri/index.d.ts +4 -0
- package/dist/utils/src/uri/index.d.ts.map +1 -0
- package/dist/utils/src/uri/index.js +4 -0
- package/dist/utils/src/uri/index.js.map +1 -0
- package/dist/utils/src/uri/merge.d.ts +2 -0
- package/dist/utils/src/uri/merge.d.ts.map +1 -0
- package/dist/utils/src/uri/merge.js +56 -0
- package/dist/utils/src/uri/merge.js.map +1 -0
- package/dist/utils/src/uri/parse.d.ts +129 -0
- package/dist/utils/src/uri/parse.d.ts.map +1 -0
- package/dist/utils/src/uri/parse.js +83 -0
- package/dist/utils/src/uri/parse.js.map +1 -0
- package/dist/utils/src/uri/path.d.ts +22 -0
- package/dist/utils/src/uri/path.d.ts.map +1 -0
- package/dist/utils/src/uri/path.js +34 -0
- package/dist/utils/src/uri/path.js.map +1 -0
- package/dist/utils/src/utils/dom.d.ts +7 -2
- package/dist/utils/src/utils/dom.d.ts.map +1 -1
- package/dist/utils/src/utils/dom.js +59 -63
- package/dist/utils/src/utils/dom.js.map +1 -1
- package/dist/utils/src/utils/index.d.ts +3 -8
- package/dist/utils/src/utils/index.d.ts.map +1 -1
- package/dist/utils/src/utils/index.js +3 -8
- package/dist/utils/src/utils/index.js.map +1 -1
- package/dist/utils/src/utils/logfmt.d.ts +53 -0
- package/dist/utils/src/utils/logfmt.d.ts.map +1 -0
- package/dist/utils/src/utils/logfmt.js +66 -0
- package/dist/utils/src/utils/logfmt.js.map +1 -0
- package/dist/utils/src/utils/loop.d.ts +12 -28
- package/dist/utils/src/utils/loop.d.ts.map +1 -1
- package/dist/utils/src/utils/loop.js +23 -54
- package/dist/utils/src/utils/loop.js.map +1 -1
- package/dist/utils/src/utils/metric.d.ts +23 -0
- package/dist/utils/src/utils/metric.d.ts.map +1 -0
- package/dist/utils/src/utils/metric.js +47 -0
- package/dist/utils/src/utils/metric.js.map +1 -0
- package/dist/utils/src/utils/uuid.js +3 -3
- package/dist/utils/src/utils/uuid.js.map +1 -1
- package/dist/utils/src/utils/worker.d.ts +18 -0
- package/dist/utils/src/utils/worker.d.ts.map +1 -0
- package/dist/utils/src/utils/worker.js +23 -0
- package/dist/utils/src/utils/worker.js.map +1 -0
- package/dist/utils/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +11 -4
- package/dist/bundles/utils.umd.js +0 -1663
- package/dist/bundles/utils.umd.js.map +0 -1
- package/dist/utils/src/BinaryReader.d.ts.map +0 -1
- package/dist/utils/src/BinaryReader.js.map +0 -1
- package/dist/utils/src/BinaryReader.spec.d.ts +0 -2
- package/dist/utils/src/BinaryReader.spec.d.ts.map +0 -1
- package/dist/utils/src/BinaryReader.spec.js +0 -38
- package/dist/utils/src/BinaryReader.spec.js.map +0 -1
- package/dist/utils/src/DataUri.d.ts +0 -36
- package/dist/utils/src/DataUri.d.ts.map +0 -1
- package/dist/utils/src/DataUri.js +0 -45
- package/dist/utils/src/DataUri.js.map +0 -1
- package/dist/utils/src/DataUri.spec.d.ts +0 -2
- package/dist/utils/src/DataUri.spec.d.ts.map +0 -1
- package/dist/utils/src/DataUri.spec.js +0 -34
- package/dist/utils/src/DataUri.spec.js.map +0 -1
- package/dist/utils/src/Events.d.ts +0 -59
- package/dist/utils/src/Events.d.ts.map +0 -1
- package/dist/utils/src/Events.js +0 -125
- package/dist/utils/src/Events.js.map +0 -1
- package/dist/utils/src/Events.spec.d.ts +0 -2
- package/dist/utils/src/Events.spec.d.ts.map +0 -1
- package/dist/utils/src/Events.spec.js +0 -61
- package/dist/utils/src/Events.spec.js.map +0 -1
- package/dist/utils/src/Http.d.ts +0 -56
- package/dist/utils/src/Http.d.ts.map +0 -1
- package/dist/utils/src/Http.js +0 -60
- package/dist/utils/src/Http.js.map +0 -1
- package/dist/utils/src/Http.spec.d.ts +0 -2
- package/dist/utils/src/Http.spec.d.ts.map +0 -1
- package/dist/utils/src/Http.spec.js +0 -23
- package/dist/utils/src/Http.spec.js.map +0 -1
- package/dist/utils/src/Immutable.d.ts +0 -10
- package/dist/utils/src/Immutable.d.ts.map +0 -1
- package/dist/utils/src/Immutable.js +0 -2
- package/dist/utils/src/Immutable.js.map +0 -1
- package/dist/utils/src/JsonRpc.d.ts +0 -35
- package/dist/utils/src/JsonRpc.d.ts.map +0 -1
- package/dist/utils/src/JsonRpc.js +0 -2
- package/dist/utils/src/JsonRpc.js.map +0 -1
- package/dist/utils/src/Log.d.ts +0 -26
- package/dist/utils/src/Log.d.ts.map +0 -1
- package/dist/utils/src/Log.js +0 -77
- package/dist/utils/src/Log.js.map +0 -1
- package/dist/utils/src/TextReader.d.ts +0 -100
- package/dist/utils/src/TextReader.d.ts.map +0 -1
- package/dist/utils/src/TextReader.js +0 -217
- package/dist/utils/src/TextReader.js.map +0 -1
- package/dist/utils/src/TextReader.spec.d.ts +0 -2
- package/dist/utils/src/TextReader.spec.d.ts.map +0 -1
- package/dist/utils/src/TextReader.spec.js +0 -42
- package/dist/utils/src/TextReader.spec.js.map +0 -1
- package/dist/utils/src/Uri.d.ts +0 -29
- package/dist/utils/src/Uri.d.ts.map +0 -1
- package/dist/utils/src/Uri.js +0 -129
- package/dist/utils/src/Uri.js.map +0 -1
- package/dist/utils/src/Uri.spec.d.ts +0 -2
- package/dist/utils/src/Uri.spec.d.ts.map +0 -1
- package/dist/utils/src/Uri.spec.js +0 -43
- package/dist/utils/src/Uri.spec.js.map +0 -1
- package/dist/utils/src/WebWorker.d.ts +0 -105
- package/dist/utils/src/WebWorker.d.ts.map +0 -1
- package/dist/utils/src/WebWorker.js +0 -216
- package/dist/utils/src/WebWorker.js.map +0 -1
- package/dist/utils/src/WebWorker.spec.d.ts +0 -2
- package/dist/utils/src/WebWorker.spec.d.ts.map +0 -1
- package/dist/utils/src/WebWorker.spec.js +0 -30
- package/dist/utils/src/WebWorker.spec.js.map +0 -1
- package/dist/utils/src/utils/array.d.ts +0 -39
- package/dist/utils/src/utils/array.d.ts.map +0 -1
- package/dist/utils/src/utils/array.js +0 -63
- package/dist/utils/src/utils/array.js.map +0 -1
- package/dist/utils/src/utils/get-canvas.d.ts +0 -7
- package/dist/utils/src/utils/get-canvas.d.ts.map +0 -1
- package/dist/utils/src/utils/get-canvas.js +0 -22
- package/dist/utils/src/utils/get-canvas.js.map +0 -1
- package/dist/utils/src/utils/get-option.d.ts +0 -11
- package/dist/utils/src/utils/get-option.d.ts.map +0 -1
- package/dist/utils/src/utils/get-option.js +0 -16
- package/dist/utils/src/utils/get-option.js.map +0 -1
- package/dist/utils/src/utils/getImageData.d.ts +0 -7
- package/dist/utils/src/utils/getImageData.d.ts.map +0 -1
- package/dist/utils/src/utils/getImageData.js +0 -25
- package/dist/utils/src/utils/getImageData.js.map +0 -1
- package/dist/utils/src/utils/getImageData.spec.d.ts +0 -2
- package/dist/utils/src/utils/getImageData.spec.d.ts.map +0 -1
- package/dist/utils/src/utils/getImageData.spec.js +0 -22
- package/dist/utils/src/utils/getImageData.spec.js.map +0 -1
- package/dist/utils/src/utils/hasOwnProperty.d.ts +0 -5
- package/dist/utils/src/utils/hasOwnProperty.d.ts.map +0 -1
- package/dist/utils/src/utils/hasOwnProperty.js +0 -7
- package/dist/utils/src/utils/hasOwnProperty.js.map +0 -1
- package/dist/utils/src/utils/loop.spec.d.ts +0 -2
- package/dist/utils/src/utils/loop.spec.d.ts.map +0 -1
- package/dist/utils/src/utils/loop.spec.js +0 -17
- package/dist/utils/src/utils/loop.spec.js.map +0 -1
- package/dist/utils/src/utils/object.d.ts +0 -23
- package/dist/utils/src/utils/object.d.ts.map +0 -1
- package/dist/utils/src/utils/object.js +0 -90
- package/dist/utils/src/utils/object.js.map +0 -1
- package/dist/utils/src/utils/string.d.ts +0 -19
- package/dist/utils/src/utils/string.d.ts.map +0 -1
- package/dist/utils/src/utils/string.js +0 -25
- package/dist/utils/src/utils/string.js.map +0 -1
- package/dist/utils/src/utils/type.d.ts +0 -58
- package/dist/utils/src/utils/type.d.ts.map +0 -1
- package/dist/utils/src/utils/type.js +0 -17
- package/dist/utils/src/utils/type.js.map +0 -1
- package/dist/utils/tsconfig.tsbuildinfo +0 -510
|
@@ -1,1663 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('Gglib.Utils', ['exports'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Gglib = global.Gglib || {}, global.Gglib.Utils = {})));
|
|
5
|
-
}(this, (function (exports) { 'use strict';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A wrapper around the ArrayBuffer and DataView. Simplifies reading binary data.
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
var BinaryReader = /** @class */ (function () {
|
|
13
|
-
/**
|
|
14
|
-
* Creates a new instance of {@link BinaryReader}
|
|
15
|
-
*
|
|
16
|
-
* @param data - The data to read
|
|
17
|
-
*/
|
|
18
|
-
function BinaryReader(data) {
|
|
19
|
-
/**
|
|
20
|
-
* Byte order to read. Default is `true`
|
|
21
|
-
*/
|
|
22
|
-
this.littleEndian = true;
|
|
23
|
-
this.data = data;
|
|
24
|
-
this.view = new DataView(this.data);
|
|
25
|
-
this.position = 0;
|
|
26
|
-
}
|
|
27
|
-
Object.defineProperty(BinaryReader.prototype, "canRead", {
|
|
28
|
-
/**
|
|
29
|
-
* Checks whether the readers position has not reached the end of the buffer
|
|
30
|
-
*/
|
|
31
|
-
get: function () {
|
|
32
|
-
return this.position < this.data.byteLength;
|
|
33
|
-
},
|
|
34
|
-
enumerable: false,
|
|
35
|
-
configurable: true
|
|
36
|
-
});
|
|
37
|
-
/**
|
|
38
|
-
* Reads a specified number of bytes
|
|
39
|
-
*
|
|
40
|
-
* @param length - The number of bytes to read
|
|
41
|
-
* @param output - The destination array to read into
|
|
42
|
-
*/
|
|
43
|
-
BinaryReader.prototype.readBytes = function (length, output) {
|
|
44
|
-
if (output === void 0) { output = []; }
|
|
45
|
-
while (length > 0) {
|
|
46
|
-
output.push(this.view.getUint8(this.position++));
|
|
47
|
-
length--;
|
|
48
|
-
}
|
|
49
|
-
return output;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Reads a specified number of bytes as a byte array
|
|
53
|
-
*
|
|
54
|
-
* @param length - The number of bytes to read
|
|
55
|
-
*/
|
|
56
|
-
BinaryReader.prototype.readByteArray = function (length) {
|
|
57
|
-
return new Int8Array(this.slice(length));
|
|
58
|
-
};
|
|
59
|
-
BinaryReader.prototype.readBuffer = function (buffer, index, length) {
|
|
60
|
-
var end = index + length;
|
|
61
|
-
while (index < end) {
|
|
62
|
-
buffer[index++] = this.view.getUint8(this.position++);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Reads a single unsigned byte value
|
|
67
|
-
*/
|
|
68
|
-
BinaryReader.prototype.readUByte = function () {
|
|
69
|
-
return this.view.getUint8(this.position++);
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Reads a single signed byte value
|
|
73
|
-
*/
|
|
74
|
-
BinaryReader.prototype.readByte = function () {
|
|
75
|
-
return this.view.getInt8(this.position++);
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Reads a single unsigned short value
|
|
79
|
-
*/
|
|
80
|
-
BinaryReader.prototype.readUShort = function () {
|
|
81
|
-
var result = this.view.getUint16(this.position, this.littleEndian);
|
|
82
|
-
this.position += 2;
|
|
83
|
-
return result;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* Reads a single signed short value
|
|
87
|
-
*/
|
|
88
|
-
BinaryReader.prototype.readShort = function () {
|
|
89
|
-
var result = this.view.getInt16(this.position, this.littleEndian);
|
|
90
|
-
this.position += 2;
|
|
91
|
-
return result;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Reads a single uint32 value
|
|
95
|
-
*/
|
|
96
|
-
BinaryReader.prototype.readUInt = function () {
|
|
97
|
-
var result = this.view.getUint32(this.position, this.littleEndian);
|
|
98
|
-
this.position += 4;
|
|
99
|
-
return result;
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Reads a single int32 value
|
|
103
|
-
*/
|
|
104
|
-
BinaryReader.prototype.readInt = function () {
|
|
105
|
-
var result = this.view.getInt32(this.position, this.littleEndian);
|
|
106
|
-
this.position += 4;
|
|
107
|
-
return result;
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* Reads a two uint32 values as low and high bits.
|
|
111
|
-
*/
|
|
112
|
-
BinaryReader.prototype.readLong = function () {
|
|
113
|
-
var lo = this.readUInt();
|
|
114
|
-
var hi = this.readUInt() << 32;
|
|
115
|
-
return hi + lo;
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Reads a single float32 value
|
|
119
|
-
*/
|
|
120
|
-
BinaryReader.prototype.readFloat = function () {
|
|
121
|
-
var result = this.view.getFloat32(this.position, this.littleEndian);
|
|
122
|
-
this.position += 4;
|
|
123
|
-
return result;
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* Reads a single float64 value
|
|
127
|
-
*/
|
|
128
|
-
BinaryReader.prototype.readDouble = function () {
|
|
129
|
-
var result = this.view.getFloat64(this.position, this.littleEndian);
|
|
130
|
-
this.position += 8;
|
|
131
|
-
return result;
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Jumps to the given position on the data array
|
|
135
|
-
*
|
|
136
|
-
* @param position - The new index
|
|
137
|
-
*/
|
|
138
|
-
BinaryReader.prototype.seekAbsolute = function (position) {
|
|
139
|
-
this.position = position;
|
|
140
|
-
};
|
|
141
|
-
/**
|
|
142
|
-
* Jumps to the given position (relative to the current postion) on the data array
|
|
143
|
-
*
|
|
144
|
-
* @param position - The new relative position
|
|
145
|
-
*/
|
|
146
|
-
BinaryReader.prototype.seekRelative = function (position) {
|
|
147
|
-
this.position += position;
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* Reads a string
|
|
151
|
-
*
|
|
152
|
-
* @param length - The length in bytes to read
|
|
153
|
-
*/
|
|
154
|
-
BinaryReader.prototype.readString = function (length) {
|
|
155
|
-
var result = [];
|
|
156
|
-
while (length > 0) {
|
|
157
|
-
result.push(String.fromCharCode(this.view.getUint8(this.position++)));
|
|
158
|
-
length--;
|
|
159
|
-
}
|
|
160
|
-
return result.join('');
|
|
161
|
-
};
|
|
162
|
-
/**
|
|
163
|
-
* Returns a section of the buffer starting at current position
|
|
164
|
-
*
|
|
165
|
-
* @param length - The length to slice
|
|
166
|
-
*/
|
|
167
|
-
BinaryReader.prototype.slice = function (length) {
|
|
168
|
-
this.position += length;
|
|
169
|
-
return this.data.slice(this.position - length, this.position);
|
|
170
|
-
};
|
|
171
|
-
BinaryReader.prototype.subarray = function (type, byteLength) {
|
|
172
|
-
var result = new type(this.data, this.position, byteLength / type.BYTES_PER_ELEMENT);
|
|
173
|
-
this.position += byteLength;
|
|
174
|
-
return result;
|
|
175
|
-
};
|
|
176
|
-
return BinaryReader;
|
|
177
|
-
}());
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* A wrapper around a string. Simplifies reading arbitrary formatted text data.
|
|
181
|
-
*
|
|
182
|
-
* @public
|
|
183
|
-
*/
|
|
184
|
-
var TextReader = /** @class */ (function () {
|
|
185
|
-
/**
|
|
186
|
-
* Creates a new instance of {@link TextReader}
|
|
187
|
-
*
|
|
188
|
-
* @param text - The text data to read
|
|
189
|
-
*/
|
|
190
|
-
function TextReader(text) {
|
|
191
|
-
this.text = text;
|
|
192
|
-
this.index = 0;
|
|
193
|
-
/**
|
|
194
|
-
* Characters that identify a white space. Default is `' \t\r\n\f'`.
|
|
195
|
-
*/
|
|
196
|
-
this.whitespaces = ' \t\r\n\f';
|
|
197
|
-
}
|
|
198
|
-
Object.defineProperty(TextReader.prototype, "canRead", {
|
|
199
|
-
/**
|
|
200
|
-
* Checks whether the readers position has not reached the end of the string
|
|
201
|
-
*/
|
|
202
|
-
get: function () {
|
|
203
|
-
return this.index < this.text.length;
|
|
204
|
-
},
|
|
205
|
-
enumerable: false,
|
|
206
|
-
configurable: true
|
|
207
|
-
});
|
|
208
|
-
Object.defineProperty(TextReader.prototype, "char", {
|
|
209
|
-
/**
|
|
210
|
-
* Gets the character at the current readers position.
|
|
211
|
-
*/
|
|
212
|
-
get: function () {
|
|
213
|
-
return this.text[this.index];
|
|
214
|
-
},
|
|
215
|
-
enumerable: false,
|
|
216
|
-
configurable: true
|
|
217
|
-
});
|
|
218
|
-
Object.defineProperty(TextReader.prototype, "rest", {
|
|
219
|
-
/**
|
|
220
|
-
* Gets a substring until the end of the string.
|
|
221
|
-
*/
|
|
222
|
-
get: function () {
|
|
223
|
-
return this.text.substring(this.index);
|
|
224
|
-
},
|
|
225
|
-
enumerable: false,
|
|
226
|
-
configurable: true
|
|
227
|
-
});
|
|
228
|
-
/**
|
|
229
|
-
* Advances the readers position to the next character.
|
|
230
|
-
*
|
|
231
|
-
* @remarks
|
|
232
|
-
* If the reader is finished reading, an empty string will be returned
|
|
233
|
-
*
|
|
234
|
-
* @returns the character at the new position
|
|
235
|
-
*/
|
|
236
|
-
TextReader.prototype.next = function () {
|
|
237
|
-
if (!this.canRead) {
|
|
238
|
-
return '';
|
|
239
|
-
}
|
|
240
|
-
this.index++;
|
|
241
|
-
return this.char;
|
|
242
|
-
};
|
|
243
|
-
/**
|
|
244
|
-
* Skips whites paces at current position and then reads until next whitespace character
|
|
245
|
-
*
|
|
246
|
-
* @returns the string that was being read
|
|
247
|
-
*/
|
|
248
|
-
TextReader.prototype.nextToken = function () {
|
|
249
|
-
if (!this.canRead) {
|
|
250
|
-
return '';
|
|
251
|
-
}
|
|
252
|
-
var i = this.index;
|
|
253
|
-
this.skipWhile(this.whitespaces);
|
|
254
|
-
this.skipUntil(this.whitespaces);
|
|
255
|
-
this.skipWhile(this.whitespaces);
|
|
256
|
-
return this.text.substr(i, this.index - i).trim();
|
|
257
|
-
};
|
|
258
|
-
/**
|
|
259
|
-
* Reads until next occurrence of a new line character
|
|
260
|
-
*
|
|
261
|
-
* @param cb - on optional callback that will receive a new reader for the new line
|
|
262
|
-
* @returns the string that was being read
|
|
263
|
-
*/
|
|
264
|
-
TextReader.prototype.nextLine = function (cb) {
|
|
265
|
-
if (!this.canRead) {
|
|
266
|
-
return '';
|
|
267
|
-
}
|
|
268
|
-
var i = this.index;
|
|
269
|
-
this.skipUntil('\n');
|
|
270
|
-
this.next();
|
|
271
|
-
var line = this.text.substr(i, this.index - i).trim();
|
|
272
|
-
if (cb) {
|
|
273
|
-
cb(new TextReader(line));
|
|
274
|
-
}
|
|
275
|
-
return line;
|
|
276
|
-
};
|
|
277
|
-
/**
|
|
278
|
-
* Skips until next occurrence of `start` character and then reads the text until the `end` character
|
|
279
|
-
*
|
|
280
|
-
* @param start - character identifying the begin of a block
|
|
281
|
-
* @param end - character identifying the begin of a block
|
|
282
|
-
* @param cb - a callback to call with a new text reader
|
|
283
|
-
*/
|
|
284
|
-
TextReader.prototype.nextBlock = function (start, end, cb) {
|
|
285
|
-
if (!this.canRead) {
|
|
286
|
-
return '';
|
|
287
|
-
}
|
|
288
|
-
this.skipUntil(start, true);
|
|
289
|
-
var iStart = this.index;
|
|
290
|
-
var iEnd = this.index;
|
|
291
|
-
var depth = 1;
|
|
292
|
-
while (this.canRead) {
|
|
293
|
-
if (start.indexOf(this.char) >= 0) {
|
|
294
|
-
depth++;
|
|
295
|
-
}
|
|
296
|
-
if (end.indexOf(this.char) >= 0) {
|
|
297
|
-
depth--;
|
|
298
|
-
if (depth === 0) {
|
|
299
|
-
iEnd = this.index;
|
|
300
|
-
this.next();
|
|
301
|
-
break;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
this.next();
|
|
305
|
-
}
|
|
306
|
-
var block = this.text.substring(iStart, iEnd);
|
|
307
|
-
if (cb) {
|
|
308
|
-
cb(new TextReader(block));
|
|
309
|
-
}
|
|
310
|
-
return block;
|
|
311
|
-
};
|
|
312
|
-
/**
|
|
313
|
-
* Returns the next character but does not advance the reader position.
|
|
314
|
-
*/
|
|
315
|
-
TextReader.prototype.peek = function () {
|
|
316
|
-
var i = this.index;
|
|
317
|
-
var c = this.next();
|
|
318
|
-
this.index = i;
|
|
319
|
-
return c;
|
|
320
|
-
};
|
|
321
|
-
/**
|
|
322
|
-
* Returns the next token but does not advance the reader position.
|
|
323
|
-
*/
|
|
324
|
-
TextReader.prototype.peekToken = function () {
|
|
325
|
-
var i = this.index;
|
|
326
|
-
var t = this.nextToken();
|
|
327
|
-
this.index = i;
|
|
328
|
-
return t;
|
|
329
|
-
};
|
|
330
|
-
/**
|
|
331
|
-
* Returns the current line but does not advance the reader position
|
|
332
|
-
*/
|
|
333
|
-
TextReader.prototype.peekLine = function () {
|
|
334
|
-
var i = this.index;
|
|
335
|
-
var l = this.nextLine();
|
|
336
|
-
this.index = i;
|
|
337
|
-
return l;
|
|
338
|
-
};
|
|
339
|
-
/**
|
|
340
|
-
* Skips all whitespace characters
|
|
341
|
-
*/
|
|
342
|
-
TextReader.prototype.skipWhitespace = function () {
|
|
343
|
-
this.skipWhile(this.whitespaces);
|
|
344
|
-
};
|
|
345
|
-
/**
|
|
346
|
-
* Skips all characters in given string
|
|
347
|
-
*
|
|
348
|
-
* @param char - the characters to skip
|
|
349
|
-
*/
|
|
350
|
-
TextReader.prototype.skipWhile = function (char) {
|
|
351
|
-
while (this.canRead && char.indexOf(this.char) >= 0) {
|
|
352
|
-
this.next();
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
/**
|
|
356
|
-
* Skips characters until occurrence of one in the given string
|
|
357
|
-
*
|
|
358
|
-
* @param char - the characters to stop at
|
|
359
|
-
*/
|
|
360
|
-
TextReader.prototype.skipUntil = function (char, andBeyond) {
|
|
361
|
-
if (andBeyond === void 0) { andBeyond = false; }
|
|
362
|
-
while (this.canRead && char.indexOf(this.char) === -1) {
|
|
363
|
-
this.next();
|
|
364
|
-
}
|
|
365
|
-
if (andBeyond) {
|
|
366
|
-
this.skipWhile(char);
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
/**
|
|
370
|
-
* Reads the next token but throws an error if it does not match the given value
|
|
371
|
-
*
|
|
372
|
-
* @param value - The value to match
|
|
373
|
-
*/
|
|
374
|
-
TextReader.prototype.consumeToken = function (value) {
|
|
375
|
-
if (this.peekToken() !== value) {
|
|
376
|
-
var line = (this.text.match(/\n/g) || []).length;
|
|
377
|
-
var post = this.index - this.text.lastIndexOf('\n');
|
|
378
|
-
throw new Error("expected token \"" + value + "\" but was \"" + this.peekToken() + "\" at " + line + ":" + post);
|
|
379
|
-
}
|
|
380
|
-
this.nextToken();
|
|
381
|
-
};
|
|
382
|
-
/**
|
|
383
|
-
* Consumes the next token only if it matches the given value. Otherwise leaves the state untouched.
|
|
384
|
-
*/
|
|
385
|
-
TextReader.prototype.acceptToken = function (value) {
|
|
386
|
-
if (this.peekToken() !== value) {
|
|
387
|
-
return false;
|
|
388
|
-
}
|
|
389
|
-
this.nextToken();
|
|
390
|
-
return true;
|
|
391
|
-
};
|
|
392
|
-
return TextReader;
|
|
393
|
-
}());
|
|
394
|
-
|
|
395
|
-
// for explanation see:
|
|
396
|
-
// https://www.debuggex.com/
|
|
397
|
-
var regex = /^data:(([a-z0-9-]+\/[a-z0-9+-]+)?((;\s*([a-z0-9-]+=)?(([a-z0-9]+)|("[^"]*")))+)?)?\s*,(.*)$/;
|
|
398
|
-
/**
|
|
399
|
-
* Describes parts of a data Uri
|
|
400
|
-
*
|
|
401
|
-
* @public
|
|
402
|
-
*/
|
|
403
|
-
var DataUri = /** @class */ (function () {
|
|
404
|
-
function DataUri() {
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Checks whether a string represents a data uri
|
|
408
|
-
*
|
|
409
|
-
* @param uri - The Uri to check
|
|
410
|
-
*/
|
|
411
|
-
DataUri.isDataUri = function (uri) {
|
|
412
|
-
return regex.test(uri);
|
|
413
|
-
};
|
|
414
|
-
/**
|
|
415
|
-
* Parses a uri into a data uri object
|
|
416
|
-
*
|
|
417
|
-
* @param uri - The Uri to parse
|
|
418
|
-
*/
|
|
419
|
-
DataUri.parse = function (uri) {
|
|
420
|
-
if (!DataUri.isDataUri(uri)) {
|
|
421
|
-
return {
|
|
422
|
-
uri: uri,
|
|
423
|
-
contentType: undefined,
|
|
424
|
-
isBase64: false,
|
|
425
|
-
data: undefined,
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
|
-
var match = regex.exec(uri);
|
|
429
|
-
return {
|
|
430
|
-
uri: uri,
|
|
431
|
-
contentType: match[1] || 'text/plain; charset=US-ASCII',
|
|
432
|
-
isBase64: /;\s*base64$/.test(match[1] || ''),
|
|
433
|
-
data: match[9],
|
|
434
|
-
};
|
|
435
|
-
};
|
|
436
|
-
return DataUri;
|
|
437
|
-
}());
|
|
438
|
-
|
|
439
|
-
function triggerEvents(events, args) {
|
|
440
|
-
for (var i = 0; i < events.length; i++) {
|
|
441
|
-
events[i].callback.apply(events[i].ctx, args);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* Base class with an event system
|
|
446
|
-
*
|
|
447
|
-
* @remarks
|
|
448
|
-
* Implements logic for binding and unbinding methods to and from events.
|
|
449
|
-
* The code is taken from the {@link https://github.com/jashkenas/backbone | Backbone} project
|
|
450
|
-
*
|
|
451
|
-
* @public
|
|
452
|
-
*/
|
|
453
|
-
var Events = /** @class */ (function () {
|
|
454
|
-
function Events() {
|
|
455
|
-
this.events = {};
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Bind an event to a `callback` function.
|
|
459
|
-
*
|
|
460
|
-
* @remarks
|
|
461
|
-
* Passing `"all"` will bind the callback to all events fired.
|
|
462
|
-
* @param name - The name of the event
|
|
463
|
-
* @param callback - The function to call when the even fires
|
|
464
|
-
* @param context - The value of 'this' inside the callback
|
|
465
|
-
*/
|
|
466
|
-
Events.prototype.on = function (name, callback, context) {
|
|
467
|
-
var _this = this;
|
|
468
|
-
this.events = this.events || {};
|
|
469
|
-
var events = this.events[name] || [];
|
|
470
|
-
this.events[name] = events;
|
|
471
|
-
events.push({
|
|
472
|
-
callback: callback,
|
|
473
|
-
context: context,
|
|
474
|
-
ctx: context || this,
|
|
475
|
-
});
|
|
476
|
-
return function () { return _this.off(name, callback); };
|
|
477
|
-
};
|
|
478
|
-
/**
|
|
479
|
-
* Bind an event to only be triggered a single time.
|
|
480
|
-
*
|
|
481
|
-
* @param name - The name of the event
|
|
482
|
-
* @param callback - The function to call when the even fires
|
|
483
|
-
* @param context - The value of 'this' inside the callback
|
|
484
|
-
*/
|
|
485
|
-
Events.prototype.once = function (name, callback, context) {
|
|
486
|
-
// tslint:disable-next-line
|
|
487
|
-
var once = function () {
|
|
488
|
-
if (once.called) {
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
once.called = true;
|
|
492
|
-
once.parent.off(name, once);
|
|
493
|
-
callback.apply(context, arguments);
|
|
494
|
-
};
|
|
495
|
-
once.parent = this;
|
|
496
|
-
once._callback = callback;
|
|
497
|
-
return this.on(name, once);
|
|
498
|
-
};
|
|
499
|
-
/**
|
|
500
|
-
* Remove one or many callbacks.
|
|
501
|
-
*
|
|
502
|
-
* @remarks
|
|
503
|
-
* - If `context` is null, removes all callbacks with that function.
|
|
504
|
-
* - If `callback` is null, removes all callbacks for the event.
|
|
505
|
-
* - If `name` is null, removes all bound callbacks for all events.
|
|
506
|
-
*
|
|
507
|
-
* @param name - The name of the event to unbind from
|
|
508
|
-
* @param callback - The function to unbind
|
|
509
|
-
* @param context - The value of 'this' inside the callback
|
|
510
|
-
*/
|
|
511
|
-
Events.prototype.off = function (name, callback, context) {
|
|
512
|
-
if (!this.events) {
|
|
513
|
-
return this;
|
|
514
|
-
}
|
|
515
|
-
if (!name && !callback && !context) {
|
|
516
|
-
this.events = {};
|
|
517
|
-
return this;
|
|
518
|
-
}
|
|
519
|
-
for (var _i = 0, _a = Object.keys(this.events); _i < _a.length; _i++) {
|
|
520
|
-
name = _a[_i];
|
|
521
|
-
var events = this.events[name] || [];
|
|
522
|
-
var retain = events.filter(function (ev) {
|
|
523
|
-
return (callback && callback !== ev.callback && callback !== ev.callback._callback) || (context && context !== ev.context);
|
|
524
|
-
});
|
|
525
|
-
if (retain.length) {
|
|
526
|
-
this.events[name] = retain;
|
|
527
|
-
}
|
|
528
|
-
else {
|
|
529
|
-
delete this.events[name];
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
return this;
|
|
533
|
-
};
|
|
534
|
-
/**
|
|
535
|
-
* Trigger one or many events, firing all bound callbacks.
|
|
536
|
-
*
|
|
537
|
-
* @remarks
|
|
538
|
-
* Callbacks are passed the same arguments as `trigger` is, apart from the event name
|
|
539
|
-
* (unless you're listening on `"all"`, which will cause your callback to
|
|
540
|
-
* receive the true name of the event as the first argument).
|
|
541
|
-
*
|
|
542
|
-
* @param name - The name of the event to trigger
|
|
543
|
-
*/
|
|
544
|
-
Events.prototype.trigger = function (name) {
|
|
545
|
-
var args = [];
|
|
546
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
547
|
-
args[_i - 1] = arguments[_i];
|
|
548
|
-
}
|
|
549
|
-
if (!this.events) {
|
|
550
|
-
return this;
|
|
551
|
-
}
|
|
552
|
-
if (this.events[name]) {
|
|
553
|
-
triggerEvents(this.events[name], args);
|
|
554
|
-
}
|
|
555
|
-
if (this.events.all) {
|
|
556
|
-
triggerEvents(this.events.all, args);
|
|
557
|
-
}
|
|
558
|
-
return this;
|
|
559
|
-
};
|
|
560
|
-
return Events;
|
|
561
|
-
}());
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
* Checks whether an object is an array
|
|
565
|
-
*
|
|
566
|
-
* @public
|
|
567
|
-
*/
|
|
568
|
-
var isArray = Array.isArray;
|
|
569
|
-
/**
|
|
570
|
-
*
|
|
571
|
-
* @param v Checks whether an object is an ArrayBufferView
|
|
572
|
-
*/
|
|
573
|
-
function isArrayBufferView(v) {
|
|
574
|
-
var it = v;
|
|
575
|
-
return it != null && it.buffer != null && it.byteLength != null && it.byteOffset != null;
|
|
576
|
-
}
|
|
577
|
-
var concatArray = [].concat;
|
|
578
|
-
/**
|
|
579
|
-
*
|
|
580
|
-
* @public
|
|
581
|
-
*/
|
|
582
|
-
function flattenArray(value) {
|
|
583
|
-
return concatArray.apply([], value || []);
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
* Removes an item from given array
|
|
587
|
-
*
|
|
588
|
-
* @param list
|
|
589
|
-
* @param item
|
|
590
|
-
*/
|
|
591
|
-
function removeFromArray(list, item) {
|
|
592
|
-
var index = list.indexOf(item);
|
|
593
|
-
if (index >= 0) {
|
|
594
|
-
list.splice(index, 1);
|
|
595
|
-
return true;
|
|
596
|
-
}
|
|
597
|
-
return false;
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* Adds an item to given array but only if it is not already included
|
|
601
|
-
*
|
|
602
|
-
* @param set - the array
|
|
603
|
-
* @param item - the item
|
|
604
|
-
*/
|
|
605
|
-
function addToArraySet(set, item) {
|
|
606
|
-
var index = set.indexOf(item);
|
|
607
|
-
if (index === -1) {
|
|
608
|
-
set.push(item);
|
|
609
|
-
return true;
|
|
610
|
-
}
|
|
611
|
-
return false;
|
|
612
|
-
}
|
|
613
|
-
/**
|
|
614
|
-
* Pushes an item into the given array. If array is null, a new instance is created
|
|
615
|
-
*
|
|
616
|
-
* @param list - the array
|
|
617
|
-
* @param item - the item
|
|
618
|
-
* @returns the given array or a new instance
|
|
619
|
-
*/
|
|
620
|
-
function append(list, item) {
|
|
621
|
-
list = list || [];
|
|
622
|
-
list.push(item);
|
|
623
|
-
return list;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
/**
|
|
627
|
-
* Gets a value by key from an options object
|
|
628
|
-
*
|
|
629
|
-
* @public
|
|
630
|
-
* @param options - The options object
|
|
631
|
-
* @param key - The key to access
|
|
632
|
-
* @param fallback - The fallback value
|
|
633
|
-
* @returns the value behind the `key`. If the `key` is missing `fallback` is returned.
|
|
634
|
-
*/
|
|
635
|
-
function getOption(options, key, fallback) {
|
|
636
|
-
if (options && key in options) {
|
|
637
|
-
return options[key];
|
|
638
|
-
}
|
|
639
|
-
return fallback;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
var vendors = ['', 'moz', 'webkit', 'ms', 'o'];
|
|
643
|
-
/**
|
|
644
|
-
* @public
|
|
645
|
-
* @param el
|
|
646
|
-
* @param name
|
|
647
|
-
* @param variants
|
|
648
|
-
*/
|
|
649
|
-
function vendorProperty(el, name) {
|
|
650
|
-
var variants = [];
|
|
651
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
652
|
-
variants[_i - 2] = arguments[_i];
|
|
653
|
-
}
|
|
654
|
-
for (var _a = 0, vendors_1 = vendors; _a < vendors_1.length; _a++) {
|
|
655
|
-
var prefix = vendors_1[_a];
|
|
656
|
-
if (prefix) {
|
|
657
|
-
var vendorName = prefix + name[0].toUpperCase() + String(name).substr(1);
|
|
658
|
-
if (vendorName in el) {
|
|
659
|
-
return vendorName;
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
else if (name in el) {
|
|
663
|
-
return name.toString();
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
for (var _b = 0, variants_1 = variants; _b < variants_1.length; _b++) {
|
|
667
|
-
var variant = variants_1[_b];
|
|
668
|
-
if (variant in el) {
|
|
669
|
-
return variant;
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
return null;
|
|
673
|
-
}
|
|
674
|
-
/**
|
|
675
|
-
* @public
|
|
676
|
-
* @param el
|
|
677
|
-
* @param name
|
|
678
|
-
* @param variants
|
|
679
|
-
*/
|
|
680
|
-
function vendorEvent(el, name) {
|
|
681
|
-
var variants = [];
|
|
682
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
683
|
-
variants[_i - 2] = arguments[_i];
|
|
684
|
-
}
|
|
685
|
-
var suffix = name.toString().replace(/^on/, '');
|
|
686
|
-
for (var _a = 0, vendors_2 = vendors; _a < vendors_2.length; _a++) {
|
|
687
|
-
var prefix = vendors_2[_a];
|
|
688
|
-
var event_1 = 'on' + prefix + suffix;
|
|
689
|
-
if (event_1 in el) {
|
|
690
|
-
return event_1;
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
for (var _b = 0, variants_2 = variants; _b < variants_2.length; _b++) {
|
|
694
|
-
var variant = variants_2[_b];
|
|
695
|
-
if (variant in el) {
|
|
696
|
-
return variant;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
return null;
|
|
700
|
-
}
|
|
701
|
-
var docHidden = vendorProperty(document, 'hidden');
|
|
702
|
-
var docVisibilityState = vendorProperty(document, 'visibilityState');
|
|
703
|
-
var docVisibilityChange = vendorEvent(document, 'onvisibilitychange');
|
|
704
|
-
/**
|
|
705
|
-
* @public
|
|
706
|
-
*/
|
|
707
|
-
var documentVisibilityApi = {
|
|
708
|
-
/**
|
|
709
|
-
* Checks whether the current document is hidden.
|
|
710
|
-
* See {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/hidden | Document.hidden}
|
|
711
|
-
*
|
|
712
|
-
* @public
|
|
713
|
-
*/
|
|
714
|
-
get isHidden() {
|
|
715
|
-
return getOption(document, docHidden, false);
|
|
716
|
-
},
|
|
717
|
-
/**
|
|
718
|
-
* Checks whether the current document is hidden.
|
|
719
|
-
* See {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/hidden | Document.hidden}
|
|
720
|
-
*
|
|
721
|
-
* @public
|
|
722
|
-
*/
|
|
723
|
-
get isVisible() {
|
|
724
|
-
return getOption(document, docHidden, true);
|
|
725
|
-
},
|
|
726
|
-
/**
|
|
727
|
-
* Gets the visibility state of current document.
|
|
728
|
-
* See {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState | Document.visibilityState}
|
|
729
|
-
*
|
|
730
|
-
* @public
|
|
731
|
-
*/
|
|
732
|
-
get visibilityState() {
|
|
733
|
-
return getOption(document, docVisibilityState, 'visible');
|
|
734
|
-
},
|
|
735
|
-
/**
|
|
736
|
-
* Adds a listener to the
|
|
737
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/onvisibilitychange | Document.onvisibilitychange}
|
|
738
|
-
* event
|
|
739
|
-
*
|
|
740
|
-
* @public
|
|
741
|
-
*/
|
|
742
|
-
onVisibilityChange: function (callback, options) {
|
|
743
|
-
if (docVisibilityChange) {
|
|
744
|
-
document.addEventListener(docVisibilityChange, callback, options);
|
|
745
|
-
}
|
|
746
|
-
},
|
|
747
|
-
/**
|
|
748
|
-
* Removes a listener from the
|
|
749
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/onvisibilitychange | Document.onvisibilitychange}
|
|
750
|
-
* event
|
|
751
|
-
*
|
|
752
|
-
* @public
|
|
753
|
-
*/
|
|
754
|
-
offVisibilityChange: function (callback, options) {
|
|
755
|
-
if (docVisibilityChange) {
|
|
756
|
-
document.removeEventListener(docVisibilityChange, callback, options);
|
|
757
|
-
}
|
|
758
|
-
},
|
|
759
|
-
};
|
|
760
|
-
/**
|
|
761
|
-
* @public
|
|
762
|
-
*/
|
|
763
|
-
var PointerLockApi = /** @class */ (function () {
|
|
764
|
-
function PointerLockApi() {
|
|
765
|
-
this.pointerlockchange = vendorEvent(document, 'pointerlockchange');
|
|
766
|
-
this.pointerlockerror = vendorEvent(document, 'pointerlockerror');
|
|
767
|
-
this.requestPointerLockName = vendorProperty(document, 'requestPointerLock');
|
|
768
|
-
this.exitPointerLockName = vendorProperty(document, 'exitPointerLock');
|
|
769
|
-
this.pointerLockElementName = vendorProperty(document, 'pointerLockElement');
|
|
770
|
-
}
|
|
771
|
-
Object.defineProperty(PointerLockApi.prototype, "isSupported", {
|
|
772
|
-
get: function () {
|
|
773
|
-
return !!this.exitPointerLockName;
|
|
774
|
-
},
|
|
775
|
-
enumerable: false,
|
|
776
|
-
configurable: true
|
|
777
|
-
});
|
|
778
|
-
Object.defineProperty(PointerLockApi.prototype, "pointerLockElement", {
|
|
779
|
-
get: function () {
|
|
780
|
-
return getOption(document, this.pointerLockElementName, null);
|
|
781
|
-
},
|
|
782
|
-
enumerable: false,
|
|
783
|
-
configurable: true
|
|
784
|
-
});
|
|
785
|
-
PointerLockApi.prototype.onChange = function (callback, options) {
|
|
786
|
-
if (this.pointerlockchange) {
|
|
787
|
-
document.addEventListener(this.pointerlockchange, callback, options);
|
|
788
|
-
}
|
|
789
|
-
};
|
|
790
|
-
PointerLockApi.prototype.offChange = function (callback, options) {
|
|
791
|
-
if (this.pointerlockchange) {
|
|
792
|
-
document.removeEventListener(this.pointerlockchange, callback, options);
|
|
793
|
-
}
|
|
794
|
-
};
|
|
795
|
-
PointerLockApi.prototype.onError = function (callback, options) {
|
|
796
|
-
if (this.pointerlockerror) {
|
|
797
|
-
document.addEventListener(this.pointerlockerror, callback, options);
|
|
798
|
-
}
|
|
799
|
-
};
|
|
800
|
-
PointerLockApi.prototype.offError = function (callback, options) {
|
|
801
|
-
if (this.pointerlockerror) {
|
|
802
|
-
document.removeEventListener(this.pointerlockerror, callback, options);
|
|
803
|
-
}
|
|
804
|
-
};
|
|
805
|
-
PointerLockApi.prototype.requestLock = function (target) {
|
|
806
|
-
this.requestPointerLockName = this.requestPointerLockName || vendorProperty(target, 'requestPointerLock');
|
|
807
|
-
if (this.requestPointerLockName) {
|
|
808
|
-
target[this.requestPointerLockName]();
|
|
809
|
-
}
|
|
810
|
-
};
|
|
811
|
-
PointerLockApi.prototype.exitLock = function () {
|
|
812
|
-
if (this.exitPointerLockName) {
|
|
813
|
-
document[this.exitPointerLockName]();
|
|
814
|
-
}
|
|
815
|
-
};
|
|
816
|
-
return PointerLockApi;
|
|
817
|
-
}());
|
|
818
|
-
|
|
819
|
-
var canvas = null;
|
|
820
|
-
/**
|
|
821
|
-
* Extracts image data from an {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement | HTMLImageElement}
|
|
822
|
-
*
|
|
823
|
-
* @public
|
|
824
|
-
*/
|
|
825
|
-
function getImageData(image, width, height) {
|
|
826
|
-
if (!image.complete) {
|
|
827
|
-
throw new Error('image must be completed');
|
|
828
|
-
}
|
|
829
|
-
canvas = canvas || document.createElement('canvas');
|
|
830
|
-
canvas.width = width || image.naturalWidth;
|
|
831
|
-
canvas.height = height || image.naturalHeight;
|
|
832
|
-
var ctx = canvas.getContext('2d');
|
|
833
|
-
ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
834
|
-
var imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
835
|
-
var data = imgData.data;
|
|
836
|
-
var result = [];
|
|
837
|
-
result.length = data.length / 4;
|
|
838
|
-
for (var i = 0; i < result.length; i += 1) {
|
|
839
|
-
result[i] = data[i * 4];
|
|
840
|
-
}
|
|
841
|
-
return result;
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
/**
|
|
845
|
-
* Gets the current timestamp. Uses performance.now() if available.
|
|
846
|
-
*
|
|
847
|
-
* @public
|
|
848
|
-
*/
|
|
849
|
-
var getTime = (function () {
|
|
850
|
-
if (window.performance && typeof window.performance.now === 'function') {
|
|
851
|
-
return function () { return window.performance.now(); };
|
|
852
|
-
}
|
|
853
|
-
return function () { return Date.now(); };
|
|
854
|
-
})();
|
|
855
|
-
function withWindowBinding() {
|
|
856
|
-
var names = [];
|
|
857
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
858
|
-
names[_i] = arguments[_i];
|
|
859
|
-
}
|
|
860
|
-
for (var _a = 0, names_1 = names; _a < names_1.length; _a++) {
|
|
861
|
-
var name_1 = names_1[_a];
|
|
862
|
-
if (name_1 in window) {
|
|
863
|
-
return window[name_1].bind(window);
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
return null;
|
|
867
|
-
}
|
|
868
|
-
/**
|
|
869
|
-
* Browsersafe {@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame | requestAnimationFrame }
|
|
870
|
-
* function
|
|
871
|
-
* @public
|
|
872
|
-
*/
|
|
873
|
-
var requestAnimationFrame = withWindowBinding('requestAnimationFrame', // prefer without wendor prefix
|
|
874
|
-
'mozRequestAnimationFrame', // fallback to vendor prefix
|
|
875
|
-
'webkitRequestAnimationFrame', 'msRequestAnimationFrame') || (function (cb) { return setTimeout(function () { return cb(getTime()); }); }); // no RAF support => usage with setTimeout
|
|
876
|
-
/**
|
|
877
|
-
* Browsersafe {@link https://developer.mozilla.org/en-US/docs/Web/API/window/cancelAnimationFrame | cancelAnimationFrame }
|
|
878
|
-
* function
|
|
879
|
-
* @public
|
|
880
|
-
*/
|
|
881
|
-
var cancelAnimationFrame = withWindowBinding('cancelAnimationFrame', // prefer without wendor prefix
|
|
882
|
-
'mozCancelAnimationFrame', // fallback to vendor prefix
|
|
883
|
-
'webkitCancelAnimationFrame', 'msCancelAnimationFrame', 'clearTimeout');
|
|
884
|
-
/**
|
|
885
|
-
* Spins the given `update` function in a loop by utilizing `requestAnimationFrame`
|
|
886
|
-
*
|
|
887
|
-
* @public
|
|
888
|
-
* @remarks
|
|
889
|
-
* A primitive loop scheduler with no fixed time support or any optimizations.
|
|
890
|
-
* Simply schedules the given `update` function with `requestAnimationFrame`.
|
|
891
|
-
*/
|
|
892
|
-
function loop(update) {
|
|
893
|
-
var requestId = null;
|
|
894
|
-
var timestamp = getTime();
|
|
895
|
-
function tick() {
|
|
896
|
-
var dt = getTime() - timestamp;
|
|
897
|
-
timestamp += dt;
|
|
898
|
-
update(timestamp, dt);
|
|
899
|
-
requestId = requestAnimationFrame(tick);
|
|
900
|
-
}
|
|
901
|
-
var looper = function () {
|
|
902
|
-
if (requestId == null) {
|
|
903
|
-
timestamp = getTime();
|
|
904
|
-
requestId = requestAnimationFrame(tick);
|
|
905
|
-
}
|
|
906
|
-
};
|
|
907
|
-
looper.kill = function () {
|
|
908
|
-
if (requestId != null) {
|
|
909
|
-
cancelAnimationFrame(requestId);
|
|
910
|
-
requestId = null;
|
|
911
|
-
}
|
|
912
|
-
};
|
|
913
|
-
looper();
|
|
914
|
-
return looper;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
/**
|
|
918
|
-
* @public
|
|
919
|
-
*/
|
|
920
|
-
function hasOwnProperty(object, property) {
|
|
921
|
-
return Object.prototype.hasOwnProperty.call(object, property);
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
/**
|
|
925
|
-
* Checks whether a value is of type 'object' and is not an array or null
|
|
926
|
-
*
|
|
927
|
-
* @public
|
|
928
|
-
*/
|
|
929
|
-
function isObject(value) {
|
|
930
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
931
|
-
}
|
|
932
|
-
/**
|
|
933
|
-
* Picks properties from the given source object if they are not undefined
|
|
934
|
-
*
|
|
935
|
-
* @public
|
|
936
|
-
*/
|
|
937
|
-
function pick(src) {
|
|
938
|
-
var rest = [];
|
|
939
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
940
|
-
rest[_i - 1] = arguments[_i];
|
|
941
|
-
}
|
|
942
|
-
var result = {};
|
|
943
|
-
for (var i = 1; i < arguments.length; i += 1) {
|
|
944
|
-
var key = arguments[i];
|
|
945
|
-
var value = src[key];
|
|
946
|
-
if (value !== void 0) {
|
|
947
|
-
result[key] = value;
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
return result;
|
|
951
|
-
}
|
|
952
|
-
/**
|
|
953
|
-
* Creates a copy of an object, an array or a primitive.
|
|
954
|
-
*
|
|
955
|
-
* @public
|
|
956
|
-
*/
|
|
957
|
-
function copy(srcOrDeep, srcOrDest, dest) {
|
|
958
|
-
var deep = false;
|
|
959
|
-
var src;
|
|
960
|
-
var dst;
|
|
961
|
-
if (typeof srcOrDeep === 'boolean') {
|
|
962
|
-
deep = srcOrDeep;
|
|
963
|
-
src = srcOrDest;
|
|
964
|
-
dst = dest;
|
|
965
|
-
}
|
|
966
|
-
else {
|
|
967
|
-
deep = false;
|
|
968
|
-
src = srcOrDeep;
|
|
969
|
-
dst = srcOrDest;
|
|
970
|
-
}
|
|
971
|
-
dst = Array.isArray(src) ? [] : {};
|
|
972
|
-
var value;
|
|
973
|
-
var isArray;
|
|
974
|
-
var isObj;
|
|
975
|
-
for (var key in src) {
|
|
976
|
-
if (hasOwnProperty(src, key)) {
|
|
977
|
-
value = src[key];
|
|
978
|
-
isArray = Array.isArray(value);
|
|
979
|
-
isObj = value != null && typeof value === 'object';
|
|
980
|
-
if (deep && value && (isArray || isObj)) {
|
|
981
|
-
dst[key] = copy(deep, value);
|
|
982
|
-
}
|
|
983
|
-
else if (value !== void 0) {
|
|
984
|
-
dst[key] = value;
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
return dst;
|
|
989
|
-
}
|
|
990
|
-
/**
|
|
991
|
-
* Extends the first argument with properties of all latter arguments
|
|
992
|
-
*
|
|
993
|
-
* @public
|
|
994
|
-
*/
|
|
995
|
-
function extend(dst, a, b, c, d, e, f) {
|
|
996
|
-
var length = arguments.length;
|
|
997
|
-
if (length < 2 || dst == null) {
|
|
998
|
-
return dst;
|
|
999
|
-
}
|
|
1000
|
-
var i;
|
|
1001
|
-
var src;
|
|
1002
|
-
for (i = 1; i < length; i += 1) {
|
|
1003
|
-
src = arguments[i];
|
|
1004
|
-
for (var key in src) {
|
|
1005
|
-
if (hasOwnProperty(src, key)) {
|
|
1006
|
-
dst[key] = src[key];
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
return dst;
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
/**
|
|
1014
|
-
* Removes leading and trailing spaces of a string
|
|
1015
|
-
*
|
|
1016
|
-
* @public
|
|
1017
|
-
*/
|
|
1018
|
-
function trim(value) {
|
|
1019
|
-
return value.replace(/(^\s*|\s*$)/g, '');
|
|
1020
|
-
}
|
|
1021
|
-
/**
|
|
1022
|
-
* Splits a string into lines
|
|
1023
|
-
*
|
|
1024
|
-
* @public
|
|
1025
|
-
*/
|
|
1026
|
-
function getLines(value) {
|
|
1027
|
-
return value.replace(/(\r\n)|\n/g, '\n').split('\n');
|
|
1028
|
-
}
|
|
1029
|
-
/**
|
|
1030
|
-
* Checks whether a value is a string
|
|
1031
|
-
*
|
|
1032
|
-
* @public
|
|
1033
|
-
*/
|
|
1034
|
-
function isString(value) {
|
|
1035
|
-
return typeof value === 'string';
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
/**
|
|
1039
|
-
* A token identifying a type
|
|
1040
|
-
*
|
|
1041
|
-
* @public
|
|
1042
|
-
*/
|
|
1043
|
-
var TypeToken = /** @class */ (function () {
|
|
1044
|
-
function TypeToken(name, options) {
|
|
1045
|
-
this.name = name;
|
|
1046
|
-
this.factory = (options === null || options === void 0 ? void 0 : options.factory) || (function () { return {}; });
|
|
1047
|
-
}
|
|
1048
|
-
TypeToken.prototype.toString = function () {
|
|
1049
|
-
return "TypeToken " + this.name;
|
|
1050
|
-
};
|
|
1051
|
-
return TypeToken;
|
|
1052
|
-
}());
|
|
1053
|
-
|
|
1054
|
-
/**
|
|
1055
|
-
* Generates a random uuid string
|
|
1056
|
-
*
|
|
1057
|
-
* @public
|
|
1058
|
-
*/
|
|
1059
|
-
function uuid() {
|
|
1060
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
1061
|
-
var r = Math.random() * 16 | 0; // tslint:disable-line
|
|
1062
|
-
var v = c == 'x' ? r : (r & 0x3 | 0x8); // tslint:disable-line
|
|
1063
|
-
return v.toString(16);
|
|
1064
|
-
});
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
/**
|
|
1068
|
-
* Gets a canvas element by a CSS selector or creates a new instance of HTMLCanvasElement
|
|
1069
|
-
*
|
|
1070
|
-
* @public
|
|
1071
|
-
*/
|
|
1072
|
-
function getOrCreateCanvas(canvas) {
|
|
1073
|
-
if (canvas instanceof HTMLCanvasElement) {
|
|
1074
|
-
return canvas;
|
|
1075
|
-
}
|
|
1076
|
-
if (isString(canvas)) {
|
|
1077
|
-
var element = document.getElementById(canvas) || document.querySelector(canvas);
|
|
1078
|
-
if (element instanceof HTMLCanvasElement) {
|
|
1079
|
-
return element;
|
|
1080
|
-
}
|
|
1081
|
-
else {
|
|
1082
|
-
throw new Error("expected '" + canvas + "' to select a HTMLCanvasElement but got '" + element + "'");
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
return document.createElement('canvas');
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
function setXhrHeaders(xhr, headers) {
|
|
1089
|
-
if (!headers) {
|
|
1090
|
-
return;
|
|
1091
|
-
}
|
|
1092
|
-
for (var key in headers) {
|
|
1093
|
-
if (hasOwnProperty(headers, key)) {
|
|
1094
|
-
xhr.setRequestHeader(key, headers[key]);
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
function sendXhr(xhr, options, async) {
|
|
1099
|
-
return new Promise(function (resolve, reject) {
|
|
1100
|
-
var complete = function () {
|
|
1101
|
-
if (200 <= xhr.status && xhr.status < 400) {
|
|
1102
|
-
resolve(xhr);
|
|
1103
|
-
}
|
|
1104
|
-
else {
|
|
1105
|
-
reject(xhr);
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
if (!async) {
|
|
1109
|
-
xhr.send(options.data);
|
|
1110
|
-
complete();
|
|
1111
|
-
return;
|
|
1112
|
-
}
|
|
1113
|
-
xhr.onreadystatechange = function () {
|
|
1114
|
-
if (xhr.readyState === XMLHttpRequest.DONE) {
|
|
1115
|
-
complete();
|
|
1116
|
-
}
|
|
1117
|
-
};
|
|
1118
|
-
xhr.send(options.data);
|
|
1119
|
-
});
|
|
1120
|
-
}
|
|
1121
|
-
/**
|
|
1122
|
-
* Creates and send an XMLHttpRequest
|
|
1123
|
-
*
|
|
1124
|
-
* @public
|
|
1125
|
-
* @param options - Request options
|
|
1126
|
-
*/
|
|
1127
|
-
function httpRequest(options) {
|
|
1128
|
-
var async = options.async === false ? false : true;
|
|
1129
|
-
var xhr = options.xhr || new XMLHttpRequest();
|
|
1130
|
-
xhr.open(options.type || 'GET', options.url, async, options.username, options.password);
|
|
1131
|
-
setXhrHeaders(xhr, options.headers);
|
|
1132
|
-
return sendXhr(xhr, options, async);
|
|
1133
|
-
}
|
|
1134
|
-
/**
|
|
1135
|
-
* @public
|
|
1136
|
-
*/
|
|
1137
|
-
var Http = {
|
|
1138
|
-
createXMLHttpRequest: function (responseType) {
|
|
1139
|
-
if (responseType === void 0) { responseType = 'text'; }
|
|
1140
|
-
var result = new XMLHttpRequest();
|
|
1141
|
-
result.responseType = responseType;
|
|
1142
|
-
return result;
|
|
1143
|
-
},
|
|
1144
|
-
request: httpRequest,
|
|
1145
|
-
};
|
|
1146
|
-
|
|
1147
|
-
/*! *****************************************************************************
|
|
1148
|
-
Copyright (c) Microsoft Corporation.
|
|
1149
|
-
|
|
1150
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
1151
|
-
purpose with or without fee is hereby granted.
|
|
1152
|
-
|
|
1153
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1154
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1155
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1156
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1157
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1158
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1159
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
1160
|
-
***************************************************************************** */
|
|
1161
|
-
|
|
1162
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
1163
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1164
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1165
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
1166
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
1167
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
1168
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1169
|
-
});
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
function __generator(thisArg, body) {
|
|
1173
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
1174
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
1175
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
1176
|
-
function step(op) {
|
|
1177
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1178
|
-
while (_) try {
|
|
1179
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1180
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
1181
|
-
switch (op[0]) {
|
|
1182
|
-
case 0: case 1: t = op; break;
|
|
1183
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
1184
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
1185
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
1186
|
-
default:
|
|
1187
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
1188
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
1189
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
1190
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
1191
|
-
if (t[2]) _.ops.pop();
|
|
1192
|
-
_.trys.pop(); continue;
|
|
1193
|
-
}
|
|
1194
|
-
op = body.call(thisArg, _);
|
|
1195
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
1196
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
function __spreadArray(to, from) {
|
|
1201
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
1202
|
-
to[j] = from[i];
|
|
1203
|
-
return to;
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
function bindConsoleFn(key) {
|
|
1207
|
-
if (globalThis.console && key in console) {
|
|
1208
|
-
return console[key].bind(console);
|
|
1209
|
-
}
|
|
1210
|
-
return function () { return null; };
|
|
1211
|
-
}
|
|
1212
|
-
var EnabledLogger = {
|
|
1213
|
-
log: bindConsoleFn('log'),
|
|
1214
|
-
info: bindConsoleFn('info'),
|
|
1215
|
-
debug: bindConsoleFn('debug'),
|
|
1216
|
-
warn: bindConsoleFn('warn'),
|
|
1217
|
-
error: bindConsoleFn('error'),
|
|
1218
|
-
group: bindConsoleFn('group'),
|
|
1219
|
-
groupCollapsed: bindConsoleFn('groupCollapsed'),
|
|
1220
|
-
groupEnd: bindConsoleFn('groupEnd'),
|
|
1221
|
-
};
|
|
1222
|
-
var DisabledLogger = {
|
|
1223
|
-
log: function () { return (void 0); },
|
|
1224
|
-
info: function () { return (void 0); },
|
|
1225
|
-
debug: function () { return (void 0); },
|
|
1226
|
-
warn: function () { return (void 0); },
|
|
1227
|
-
error: function () { return (void 0); },
|
|
1228
|
-
group: function () { return (void 0); },
|
|
1229
|
-
groupCollapsed: function () { return (void 0); },
|
|
1230
|
-
groupEnd: function () { return (void 0); },
|
|
1231
|
-
};
|
|
1232
|
-
/**
|
|
1233
|
-
* @public
|
|
1234
|
-
*/
|
|
1235
|
-
var Log = {
|
|
1236
|
-
/**
|
|
1237
|
-
* Disables this logger. No log will be printed to console.
|
|
1238
|
-
*/
|
|
1239
|
-
disable: function () {
|
|
1240
|
-
Object.assign(Log, DisabledLogger);
|
|
1241
|
-
},
|
|
1242
|
-
/**
|
|
1243
|
-
* Enables this logger. Logs will be printed to console
|
|
1244
|
-
*/
|
|
1245
|
-
enable: function () {
|
|
1246
|
-
Object.assign(Log, EnabledLogger);
|
|
1247
|
-
},
|
|
1248
|
-
log: bindConsoleFn('log'),
|
|
1249
|
-
info: bindConsoleFn('info'),
|
|
1250
|
-
debug: bindConsoleFn('debug'),
|
|
1251
|
-
warn: bindConsoleFn('warn'),
|
|
1252
|
-
error: bindConsoleFn('error'),
|
|
1253
|
-
group: bindConsoleFn('group'),
|
|
1254
|
-
groupCollapsed: bindConsoleFn('groupCollapsed'),
|
|
1255
|
-
groupEnd: bindConsoleFn('groupEnd'),
|
|
1256
|
-
/**
|
|
1257
|
-
* Calls the function and automatically closes the log group after the result has been resolved
|
|
1258
|
-
*/
|
|
1259
|
-
groupEndAsync: function (fn) {
|
|
1260
|
-
var groupEnded = false;
|
|
1261
|
-
return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1262
|
-
return __generator(this, function (_a) {
|
|
1263
|
-
Promise.resolve(fn()).then(function (result) {
|
|
1264
|
-
if (!groupEnded) {
|
|
1265
|
-
groupEnded = true;
|
|
1266
|
-
Log.groupEnd();
|
|
1267
|
-
}
|
|
1268
|
-
resolve(result);
|
|
1269
|
-
}).catch(function (err) {
|
|
1270
|
-
if (!groupEnded) {
|
|
1271
|
-
groupEnded = true;
|
|
1272
|
-
Log.groupEnd();
|
|
1273
|
-
}
|
|
1274
|
-
reject(err);
|
|
1275
|
-
});
|
|
1276
|
-
return [2 /*return*/];
|
|
1277
|
-
});
|
|
1278
|
-
}); });
|
|
1279
|
-
}
|
|
1280
|
-
};
|
|
1281
|
-
|
|
1282
|
-
// source: https://github.com/nodejs/node/blob/master/lib/path.js
|
|
1283
|
-
var pathSplit = /^(\/?|[\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
|
|
1284
|
-
// source: http://blog.stevenlevithan.com/archives/parseuri
|
|
1285
|
-
var options = {
|
|
1286
|
-
key: [
|
|
1287
|
-
'source',
|
|
1288
|
-
'protocol',
|
|
1289
|
-
'authority',
|
|
1290
|
-
'userInfo',
|
|
1291
|
-
'user',
|
|
1292
|
-
'password',
|
|
1293
|
-
'host',
|
|
1294
|
-
'port',
|
|
1295
|
-
'relative',
|
|
1296
|
-
'path',
|
|
1297
|
-
'directory',
|
|
1298
|
-
'file',
|
|
1299
|
-
'query',
|
|
1300
|
-
'anchor',
|
|
1301
|
-
],
|
|
1302
|
-
q: {
|
|
1303
|
-
name: 'queryKey',
|
|
1304
|
-
parser: /(?:^|&)([^&=]*)=?([^&]*)/g,
|
|
1305
|
-
},
|
|
1306
|
-
parser: {
|
|
1307
|
-
// tslint:disable
|
|
1308
|
-
strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
|
|
1309
|
-
loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
|
|
1310
|
-
// tslint:enable
|
|
1311
|
-
},
|
|
1312
|
-
};
|
|
1313
|
-
function isAbsolute(path) {
|
|
1314
|
-
return !!path && path[0] === '/';
|
|
1315
|
-
}
|
|
1316
|
-
function hasProtocol(path) {
|
|
1317
|
-
return !!path && !!path.match(/^[a-zA-Z]+:\/\//i);
|
|
1318
|
-
}
|
|
1319
|
-
function collapse(path) {
|
|
1320
|
-
var wasAbsolute = isAbsolute(path);
|
|
1321
|
-
var parts = [];
|
|
1322
|
-
for (var _i = 0, _a = path.split(/\//); _i < _a.length; _i++) {
|
|
1323
|
-
var token = _a[_i];
|
|
1324
|
-
if (!token || token === '.') {
|
|
1325
|
-
continue;
|
|
1326
|
-
}
|
|
1327
|
-
if (token === '..') {
|
|
1328
|
-
parts.pop();
|
|
1329
|
-
}
|
|
1330
|
-
else {
|
|
1331
|
-
parts.push(token);
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
var result = parts.join('/');
|
|
1335
|
-
if (wasAbsolute) {
|
|
1336
|
-
result = "/" + result;
|
|
1337
|
-
}
|
|
1338
|
-
return result;
|
|
1339
|
-
}
|
|
1340
|
-
/**
|
|
1341
|
-
* @public
|
|
1342
|
-
*/
|
|
1343
|
-
var Uri = /** @class */ (function () {
|
|
1344
|
-
function Uri() {
|
|
1345
|
-
}
|
|
1346
|
-
/**
|
|
1347
|
-
* Parses a string and extracts all uri components
|
|
1348
|
-
*/
|
|
1349
|
-
Uri.parse = function (path, strict) {
|
|
1350
|
-
if (strict === void 0) { strict = true; }
|
|
1351
|
-
var o = options;
|
|
1352
|
-
var m = o.parser[strict ? 'strict' : 'loose'].exec(path);
|
|
1353
|
-
var uri = new Uri();
|
|
1354
|
-
var i = 14;
|
|
1355
|
-
while (i--) {
|
|
1356
|
-
uri[o.key[i]] = m[i] || '';
|
|
1357
|
-
}
|
|
1358
|
-
uri[o.q.name] = {};
|
|
1359
|
-
uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
|
|
1360
|
-
if ($1) {
|
|
1361
|
-
uri[o.q.name][$1] = $2;
|
|
1362
|
-
}
|
|
1363
|
-
});
|
|
1364
|
-
return uri;
|
|
1365
|
-
};
|
|
1366
|
-
Uri.dir = function (path) {
|
|
1367
|
-
return Uri.parse(path).directory;
|
|
1368
|
-
};
|
|
1369
|
-
Uri.file = function (path) {
|
|
1370
|
-
return pathSplit.exec(path)[2];
|
|
1371
|
-
};
|
|
1372
|
-
Uri.ext = function (path) {
|
|
1373
|
-
return pathSplit.exec(path)[3];
|
|
1374
|
-
};
|
|
1375
|
-
Uri.merge = function (a, b) {
|
|
1376
|
-
if (hasProtocol(b)) {
|
|
1377
|
-
return b;
|
|
1378
|
-
}
|
|
1379
|
-
var aUri = Uri.parse(a);
|
|
1380
|
-
var bUri = Uri.parse(b);
|
|
1381
|
-
var path = isAbsolute(b) ? b : aUri.directory + bUri.path;
|
|
1382
|
-
path = collapse(path);
|
|
1383
|
-
if (bUri.query) {
|
|
1384
|
-
path += "?" + bUri.query;
|
|
1385
|
-
}
|
|
1386
|
-
if (bUri.anchor) {
|
|
1387
|
-
path += "#" + bUri.anchor;
|
|
1388
|
-
}
|
|
1389
|
-
var result = '';
|
|
1390
|
-
if (aUri.protocol) {
|
|
1391
|
-
result = aUri.protocol + '://';
|
|
1392
|
-
}
|
|
1393
|
-
if (aUri.authority) {
|
|
1394
|
-
result += aUri.authority;
|
|
1395
|
-
}
|
|
1396
|
-
if (!isAbsolute(path)) {
|
|
1397
|
-
result += '/';
|
|
1398
|
-
}
|
|
1399
|
-
return result + path;
|
|
1400
|
-
};
|
|
1401
|
-
Uri.escape = function (fragment) {
|
|
1402
|
-
if (fragment.length > 1) {
|
|
1403
|
-
return fragment[0] + fragment.substring(1).replace(/[!"#$%&'()*+,-.\/\\:;<=>?@\[\]^`{|}~]/gi, function (token) { return "\\" + token; });
|
|
1404
|
-
}
|
|
1405
|
-
return fragment;
|
|
1406
|
-
};
|
|
1407
|
-
return Uri;
|
|
1408
|
-
}());
|
|
1409
|
-
|
|
1410
|
-
var workers = [];
|
|
1411
|
-
var tasks = new Map();
|
|
1412
|
-
var requestCounter = 0;
|
|
1413
|
-
/**
|
|
1414
|
-
* Provides a mechanism for registering functions as background tasks which can be executed on a worker thread
|
|
1415
|
-
*
|
|
1416
|
-
* @public
|
|
1417
|
-
* @remarks
|
|
1418
|
-
* The class is a wrapper around the {@link https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker | Web Worker Api}.
|
|
1419
|
-
*
|
|
1420
|
-
* To enable the functionality it is required that the `workerUrl` is set and points to
|
|
1421
|
-
* a worker script which should run in the worker thread.
|
|
1422
|
-
*
|
|
1423
|
-
* Functions that should run on the worker thread may be registered at any time, before or after
|
|
1424
|
-
* the functionality is enabled.
|
|
1425
|
-
*
|
|
1426
|
-
* It is important that this class and the registry of background tasks are all bundled
|
|
1427
|
-
* in the application bundle as well as in the worker bundle
|
|
1428
|
-
*
|
|
1429
|
-
* @example
|
|
1430
|
-
* ```ts
|
|
1431
|
-
* const myTask = WebWorker.task("myBackgroundTask", () => {
|
|
1432
|
-
* // do heavy things
|
|
1433
|
-
* })
|
|
1434
|
-
*
|
|
1435
|
-
* WebWorker.enable('http://example.com/gglib.umd.js')
|
|
1436
|
-
*
|
|
1437
|
-
* myTask() // will run on a worker thread
|
|
1438
|
-
* WebWorker.exec("myBackgroundTask") // same task as above
|
|
1439
|
-
*
|
|
1440
|
-
* WebWorker.disable() // disables webworker functionality
|
|
1441
|
-
* myTask() // will run on main thread
|
|
1442
|
-
* WebWorker.exec("myBackgroundTask") // same task as above
|
|
1443
|
-
* ```
|
|
1444
|
-
*/
|
|
1445
|
-
var WebWorker = /** @class */ (function () {
|
|
1446
|
-
function WebWorker(script) {
|
|
1447
|
-
this.handler = new Map();
|
|
1448
|
-
this.worker = new Worker(script);
|
|
1449
|
-
this.worker.onmessage = this.handleMessage.bind(this);
|
|
1450
|
-
this.worker.onerror = function (e) { return Log.error(e); };
|
|
1451
|
-
}
|
|
1452
|
-
/**
|
|
1453
|
-
* Enables a webworker and limits to the number of threads
|
|
1454
|
-
*
|
|
1455
|
-
* @public
|
|
1456
|
-
* @param workerCount - Total number of workers to activate
|
|
1457
|
-
*/
|
|
1458
|
-
WebWorker.enable = function (workerUrl, workerCount) {
|
|
1459
|
-
if (workerCount === void 0) { workerCount = 1; }
|
|
1460
|
-
if (!WebWorker.isSupported || WebWorker.isWorkerContext) {
|
|
1461
|
-
return false;
|
|
1462
|
-
}
|
|
1463
|
-
WebWorker.disable();
|
|
1464
|
-
while (workerCount > 0) {
|
|
1465
|
-
workers.push(new WebWorker(workerUrl));
|
|
1466
|
-
}
|
|
1467
|
-
return true;
|
|
1468
|
-
};
|
|
1469
|
-
/**
|
|
1470
|
-
* Disables a webworker script
|
|
1471
|
-
*
|
|
1472
|
-
* @remarks if `script` is not given all webworker are disabled
|
|
1473
|
-
*
|
|
1474
|
-
* @public
|
|
1475
|
-
*/
|
|
1476
|
-
WebWorker.disable = function () {
|
|
1477
|
-
while (workers.length) {
|
|
1478
|
-
workers.pop().terminate();
|
|
1479
|
-
}
|
|
1480
|
-
};
|
|
1481
|
-
/**
|
|
1482
|
-
* Registers a named function that can be executed in a webworker thread
|
|
1483
|
-
*
|
|
1484
|
-
* @public
|
|
1485
|
-
*
|
|
1486
|
-
* @param name - The task name
|
|
1487
|
-
* @param action - The task action
|
|
1488
|
-
* @param thread - The worker index on which the action should be executed
|
|
1489
|
-
*/
|
|
1490
|
-
WebWorker.task = function (name, action, thread) {
|
|
1491
|
-
if (thread === void 0) { thread = 0; }
|
|
1492
|
-
if (tasks.has(name)) {
|
|
1493
|
-
Promise.reject("Task '" + name + "' is already defined");
|
|
1494
|
-
}
|
|
1495
|
-
tasks.set(name, {
|
|
1496
|
-
name: name,
|
|
1497
|
-
action: action,
|
|
1498
|
-
thread: thread,
|
|
1499
|
-
});
|
|
1500
|
-
return function () {
|
|
1501
|
-
var params = [];
|
|
1502
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1503
|
-
params[_i] = arguments[_i];
|
|
1504
|
-
}
|
|
1505
|
-
return WebWorker.exec.apply(WebWorker, __spreadArray([name], params));
|
|
1506
|
-
};
|
|
1507
|
-
};
|
|
1508
|
-
/**
|
|
1509
|
-
* Executes a task that has been previously registered with the `task` method.
|
|
1510
|
-
*
|
|
1511
|
-
* @public
|
|
1512
|
-
* @remarks
|
|
1513
|
-
* This will execute a registered task in a web worker thread. If web workers
|
|
1514
|
-
* are disabled then the task will be executed in the browser thread instead.
|
|
1515
|
-
*/
|
|
1516
|
-
WebWorker.exec = function (method) {
|
|
1517
|
-
var _a;
|
|
1518
|
-
var params = [];
|
|
1519
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1520
|
-
params[_i - 1] = arguments[_i];
|
|
1521
|
-
}
|
|
1522
|
-
if (!tasks.has(method)) {
|
|
1523
|
-
return Promise.reject(new Error("Task '" + method + "' not found"));
|
|
1524
|
-
}
|
|
1525
|
-
var task = tasks.get(method);
|
|
1526
|
-
var worker = workers[task.thread] || workers[0];
|
|
1527
|
-
if (!worker) {
|
|
1528
|
-
return Promise.resolve((_a = task.action).call.apply(_a, __spreadArray([{}], params)));
|
|
1529
|
-
}
|
|
1530
|
-
return worker.postMessage({
|
|
1531
|
-
method: task.name,
|
|
1532
|
-
params: params,
|
|
1533
|
-
id: requestCounter++,
|
|
1534
|
-
});
|
|
1535
|
-
};
|
|
1536
|
-
WebWorker.prototype.terminate = function () {
|
|
1537
|
-
this.worker.terminate();
|
|
1538
|
-
};
|
|
1539
|
-
WebWorker.prototype.postMessage = function (request) {
|
|
1540
|
-
var _this = this;
|
|
1541
|
-
request.id = request.id || requestCounter++;
|
|
1542
|
-
if (this.handler.has(request.id)) {
|
|
1543
|
-
return Promise.reject("A request with same id '" + request.id + "' is already running");
|
|
1544
|
-
}
|
|
1545
|
-
return new Promise(function (resolve, reject) {
|
|
1546
|
-
_this.handler.set(request.id, function (e) {
|
|
1547
|
-
_this.handler.delete(request.id);
|
|
1548
|
-
if (e.error) {
|
|
1549
|
-
reject(e.error);
|
|
1550
|
-
}
|
|
1551
|
-
else {
|
|
1552
|
-
resolve(e.result);
|
|
1553
|
-
}
|
|
1554
|
-
});
|
|
1555
|
-
_this.worker.postMessage(request);
|
|
1556
|
-
});
|
|
1557
|
-
};
|
|
1558
|
-
WebWorker.prototype.handleMessage = function (message) {
|
|
1559
|
-
if (!('data' in message) || !message.data) {
|
|
1560
|
-
return;
|
|
1561
|
-
}
|
|
1562
|
-
var data = message.data;
|
|
1563
|
-
if (!('id' in data)) {
|
|
1564
|
-
return;
|
|
1565
|
-
}
|
|
1566
|
-
var id = data.id;
|
|
1567
|
-
var handle = this.handler.get(id);
|
|
1568
|
-
if (handle) {
|
|
1569
|
-
handle(data);
|
|
1570
|
-
}
|
|
1571
|
-
};
|
|
1572
|
-
/**
|
|
1573
|
-
* Determines whether this context is inside a web worker
|
|
1574
|
-
*
|
|
1575
|
-
* @public
|
|
1576
|
-
*/
|
|
1577
|
-
WebWorker.isWorkerContext = typeof self['importScripts'] === 'function';
|
|
1578
|
-
/**
|
|
1579
|
-
* Determines whether this context is inside a browser window
|
|
1580
|
-
*
|
|
1581
|
-
* @public
|
|
1582
|
-
*/
|
|
1583
|
-
WebWorker.isWindowContext = typeof self['importScripts'] !== 'function';
|
|
1584
|
-
/**
|
|
1585
|
-
* Determines whether web porker api is supported
|
|
1586
|
-
*
|
|
1587
|
-
* @public
|
|
1588
|
-
*/
|
|
1589
|
-
WebWorker.isSupported = typeof Worker !== 'undefined';
|
|
1590
|
-
return WebWorker;
|
|
1591
|
-
}());
|
|
1592
|
-
if (WebWorker.isWorkerContext) {
|
|
1593
|
-
var worker_1 = globalThis;
|
|
1594
|
-
addEventListener('message', function (message) {
|
|
1595
|
-
if (!('data' in message) || !message.data) {
|
|
1596
|
-
return; // not for us
|
|
1597
|
-
}
|
|
1598
|
-
var data = message.data;
|
|
1599
|
-
var task = tasks.get(data.method);
|
|
1600
|
-
if (!task) {
|
|
1601
|
-
return; // not for us
|
|
1602
|
-
}
|
|
1603
|
-
Promise.resolve()
|
|
1604
|
-
.then(function () { return task.action.apply({}, data.params); })
|
|
1605
|
-
.then(function (result) {
|
|
1606
|
-
return {
|
|
1607
|
-
id: data.id,
|
|
1608
|
-
result: result,
|
|
1609
|
-
error: null,
|
|
1610
|
-
};
|
|
1611
|
-
})
|
|
1612
|
-
.catch(function (e) {
|
|
1613
|
-
return {
|
|
1614
|
-
id: data.id,
|
|
1615
|
-
result: null,
|
|
1616
|
-
error: e,
|
|
1617
|
-
};
|
|
1618
|
-
})
|
|
1619
|
-
.then(function (response) { return worker_1.postMessage(response); });
|
|
1620
|
-
});
|
|
1621
|
-
}
|
|
1622
|
-
|
|
1623
|
-
exports.BinaryReader = BinaryReader;
|
|
1624
|
-
exports.DataUri = DataUri;
|
|
1625
|
-
exports.Events = Events;
|
|
1626
|
-
exports.Http = Http;
|
|
1627
|
-
exports.Log = Log;
|
|
1628
|
-
exports.PointerLockApi = PointerLockApi;
|
|
1629
|
-
exports.TextReader = TextReader;
|
|
1630
|
-
exports.TypeToken = TypeToken;
|
|
1631
|
-
exports.Uri = Uri;
|
|
1632
|
-
exports.WebWorker = WebWorker;
|
|
1633
|
-
exports.addToArraySet = addToArraySet;
|
|
1634
|
-
exports.append = append;
|
|
1635
|
-
exports.cancelAnimationFrame = cancelAnimationFrame;
|
|
1636
|
-
exports.copy = copy;
|
|
1637
|
-
exports.documentVisibilityApi = documentVisibilityApi;
|
|
1638
|
-
exports.extend = extend;
|
|
1639
|
-
exports.flattenArray = flattenArray;
|
|
1640
|
-
exports.getImageData = getImageData;
|
|
1641
|
-
exports.getLines = getLines;
|
|
1642
|
-
exports.getOption = getOption;
|
|
1643
|
-
exports.getOrCreateCanvas = getOrCreateCanvas;
|
|
1644
|
-
exports.getTime = getTime;
|
|
1645
|
-
exports.hasOwnProperty = hasOwnProperty;
|
|
1646
|
-
exports.httpRequest = httpRequest;
|
|
1647
|
-
exports.isArray = isArray;
|
|
1648
|
-
exports.isArrayBufferView = isArrayBufferView;
|
|
1649
|
-
exports.isObject = isObject;
|
|
1650
|
-
exports.isString = isString;
|
|
1651
|
-
exports.loop = loop;
|
|
1652
|
-
exports.pick = pick;
|
|
1653
|
-
exports.removeFromArray = removeFromArray;
|
|
1654
|
-
exports.requestAnimationFrame = requestAnimationFrame;
|
|
1655
|
-
exports.trim = trim;
|
|
1656
|
-
exports.uuid = uuid;
|
|
1657
|
-
exports.vendorEvent = vendorEvent;
|
|
1658
|
-
exports.vendorProperty = vendorProperty;
|
|
1659
|
-
|
|
1660
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1661
|
-
|
|
1662
|
-
})));
|
|
1663
|
-
//# sourceMappingURL=utils.umd.js.map
|