@markw65/monkeyc-optimizer 1.0.7 → 1.0.10

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.
@@ -2,6 +2,782 @@
2
2
  /******/ (() => { // webpackBootstrap
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
+ /***/ 2779:
6
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7
+
8
+ var Buffer = (__webpack_require__(871).Buffer);
9
+
10
+ var CRC_TABLE = [
11
+ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
12
+ 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
13
+ 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
14
+ 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
15
+ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
16
+ 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
17
+ 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
18
+ 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
19
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
20
+ 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
21
+ 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
22
+ 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
23
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
24
+ 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
25
+ 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
26
+ 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
27
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
28
+ 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
29
+ 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
30
+ 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
31
+ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
32
+ 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
33
+ 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
34
+ 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
35
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
36
+ 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
37
+ 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
38
+ 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
39
+ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
40
+ 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
41
+ 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
42
+ 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
43
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
44
+ 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
45
+ 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
46
+ 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
47
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
48
+ 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
49
+ 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
50
+ 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
51
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
52
+ 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
53
+ 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
54
+ 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
55
+ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
56
+ 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
57
+ 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
58
+ 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
59
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
60
+ 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
61
+ 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
62
+ 0x2d02ef8d
63
+ ];
64
+
65
+ if (typeof Int32Array !== 'undefined') {
66
+ CRC_TABLE = new Int32Array(CRC_TABLE);
67
+ }
68
+
69
+ function ensureBuffer(input) {
70
+ if (Buffer.isBuffer(input)) {
71
+ return input;
72
+ }
73
+
74
+ var hasNewBufferAPI =
75
+ typeof Buffer.alloc === "function" &&
76
+ typeof Buffer.from === "function";
77
+
78
+ if (typeof input === "number") {
79
+ return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input);
80
+ }
81
+ else if (typeof input === "string") {
82
+ return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input);
83
+ }
84
+ else {
85
+ throw new Error("input must be buffer, number, or string, received " +
86
+ typeof input);
87
+ }
88
+ }
89
+
90
+ function bufferizeInt(num) {
91
+ var tmp = ensureBuffer(4);
92
+ tmp.writeInt32BE(num, 0);
93
+ return tmp;
94
+ }
95
+
96
+ function _crc32(buf, previous) {
97
+ buf = ensureBuffer(buf);
98
+ if (Buffer.isBuffer(previous)) {
99
+ previous = previous.readUInt32BE(0);
100
+ }
101
+ var crc = ~~previous ^ -1;
102
+ for (var n = 0; n < buf.length; n++) {
103
+ crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8);
104
+ }
105
+ return (crc ^ -1);
106
+ }
107
+
108
+ function crc32() {
109
+ return bufferizeInt(_crc32.apply(null, arguments));
110
+ }
111
+ crc32.signed = function () {
112
+ return _crc32.apply(null, arguments);
113
+ };
114
+ crc32.unsigned = function () {
115
+ return _crc32.apply(null, arguments) >>> 0;
116
+ };
117
+
118
+ module.exports = crc32;
119
+
120
+
121
+ /***/ }),
122
+
123
+ /***/ 1227:
124
+ /***/ ((module, exports, __webpack_require__) => {
125
+
126
+ /* eslint-env browser */
127
+
128
+ /**
129
+ * This is the web browser implementation of `debug()`.
130
+ */
131
+
132
+ exports.formatArgs = formatArgs;
133
+ exports.save = save;
134
+ exports.load = load;
135
+ exports.useColors = useColors;
136
+ exports.storage = localstorage();
137
+ exports.destroy = (() => {
138
+ let warned = false;
139
+
140
+ return () => {
141
+ if (!warned) {
142
+ warned = true;
143
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
144
+ }
145
+ };
146
+ })();
147
+
148
+ /**
149
+ * Colors.
150
+ */
151
+
152
+ exports.colors = [
153
+ '#0000CC',
154
+ '#0000FF',
155
+ '#0033CC',
156
+ '#0033FF',
157
+ '#0066CC',
158
+ '#0066FF',
159
+ '#0099CC',
160
+ '#0099FF',
161
+ '#00CC00',
162
+ '#00CC33',
163
+ '#00CC66',
164
+ '#00CC99',
165
+ '#00CCCC',
166
+ '#00CCFF',
167
+ '#3300CC',
168
+ '#3300FF',
169
+ '#3333CC',
170
+ '#3333FF',
171
+ '#3366CC',
172
+ '#3366FF',
173
+ '#3399CC',
174
+ '#3399FF',
175
+ '#33CC00',
176
+ '#33CC33',
177
+ '#33CC66',
178
+ '#33CC99',
179
+ '#33CCCC',
180
+ '#33CCFF',
181
+ '#6600CC',
182
+ '#6600FF',
183
+ '#6633CC',
184
+ '#6633FF',
185
+ '#66CC00',
186
+ '#66CC33',
187
+ '#9900CC',
188
+ '#9900FF',
189
+ '#9933CC',
190
+ '#9933FF',
191
+ '#99CC00',
192
+ '#99CC33',
193
+ '#CC0000',
194
+ '#CC0033',
195
+ '#CC0066',
196
+ '#CC0099',
197
+ '#CC00CC',
198
+ '#CC00FF',
199
+ '#CC3300',
200
+ '#CC3333',
201
+ '#CC3366',
202
+ '#CC3399',
203
+ '#CC33CC',
204
+ '#CC33FF',
205
+ '#CC6600',
206
+ '#CC6633',
207
+ '#CC9900',
208
+ '#CC9933',
209
+ '#CCCC00',
210
+ '#CCCC33',
211
+ '#FF0000',
212
+ '#FF0033',
213
+ '#FF0066',
214
+ '#FF0099',
215
+ '#FF00CC',
216
+ '#FF00FF',
217
+ '#FF3300',
218
+ '#FF3333',
219
+ '#FF3366',
220
+ '#FF3399',
221
+ '#FF33CC',
222
+ '#FF33FF',
223
+ '#FF6600',
224
+ '#FF6633',
225
+ '#FF9900',
226
+ '#FF9933',
227
+ '#FFCC00',
228
+ '#FFCC33'
229
+ ];
230
+
231
+ /**
232
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
233
+ * and the Firebug extension (any Firefox version) are known
234
+ * to support "%c" CSS customizations.
235
+ *
236
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
237
+ */
238
+
239
+ // eslint-disable-next-line complexity
240
+ function useColors() {
241
+ // NB: In an Electron preload script, document will be defined but not fully
242
+ // initialized. Since we know we're in Chrome, we'll just detect this case
243
+ // explicitly
244
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
245
+ return true;
246
+ }
247
+
248
+ // Internet Explorer and Edge do not support colors.
249
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
250
+ return false;
251
+ }
252
+
253
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
254
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
255
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
256
+ // Is firebug? http://stackoverflow.com/a/398120/376773
257
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
258
+ // Is firefox >= v31?
259
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
260
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
261
+ // Double check webkit in userAgent just in case we are in a worker
262
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
263
+ }
264
+
265
+ /**
266
+ * Colorize log arguments if enabled.
267
+ *
268
+ * @api public
269
+ */
270
+
271
+ function formatArgs(args) {
272
+ args[0] = (this.useColors ? '%c' : '') +
273
+ this.namespace +
274
+ (this.useColors ? ' %c' : ' ') +
275
+ args[0] +
276
+ (this.useColors ? '%c ' : ' ') +
277
+ '+' + module.exports.humanize(this.diff);
278
+
279
+ if (!this.useColors) {
280
+ return;
281
+ }
282
+
283
+ const c = 'color: ' + this.color;
284
+ args.splice(1, 0, c, 'color: inherit');
285
+
286
+ // The final "%c" is somewhat tricky, because there could be other
287
+ // arguments passed either before or after the %c, so we need to
288
+ // figure out the correct index to insert the CSS into
289
+ let index = 0;
290
+ let lastC = 0;
291
+ args[0].replace(/%[a-zA-Z%]/g, match => {
292
+ if (match === '%%') {
293
+ return;
294
+ }
295
+ index++;
296
+ if (match === '%c') {
297
+ // We only are interested in the *last* %c
298
+ // (the user may have provided their own)
299
+ lastC = index;
300
+ }
301
+ });
302
+
303
+ args.splice(lastC, 0, c);
304
+ }
305
+
306
+ /**
307
+ * Invokes `console.debug()` when available.
308
+ * No-op when `console.debug` is not a "function".
309
+ * If `console.debug` is not available, falls back
310
+ * to `console.log`.
311
+ *
312
+ * @api public
313
+ */
314
+ exports.log = console.debug || console.log || (() => {});
315
+
316
+ /**
317
+ * Save `namespaces`.
318
+ *
319
+ * @param {String} namespaces
320
+ * @api private
321
+ */
322
+ function save(namespaces) {
323
+ try {
324
+ if (namespaces) {
325
+ exports.storage.setItem('debug', namespaces);
326
+ } else {
327
+ exports.storage.removeItem('debug');
328
+ }
329
+ } catch (error) {
330
+ // Swallow
331
+ // XXX (@Qix-) should we be logging these?
332
+ }
333
+ }
334
+
335
+ /**
336
+ * Load `namespaces`.
337
+ *
338
+ * @return {String} returns the previously persisted debug modes
339
+ * @api private
340
+ */
341
+ function load() {
342
+ let r;
343
+ try {
344
+ r = exports.storage.getItem('debug');
345
+ } catch (error) {
346
+ // Swallow
347
+ // XXX (@Qix-) should we be logging these?
348
+ }
349
+
350
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
351
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
352
+ r = process.env.DEBUG;
353
+ }
354
+
355
+ return r;
356
+ }
357
+
358
+ /**
359
+ * Localstorage attempts to return the localstorage.
360
+ *
361
+ * This is necessary because safari throws
362
+ * when a user disables cookies/localstorage
363
+ * and you attempt to access it.
364
+ *
365
+ * @return {LocalStorage}
366
+ * @api private
367
+ */
368
+
369
+ function localstorage() {
370
+ try {
371
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
372
+ // The Browser also has localStorage in the global context.
373
+ return localStorage;
374
+ } catch (error) {
375
+ // Swallow
376
+ // XXX (@Qix-) should we be logging these?
377
+ }
378
+ }
379
+
380
+ module.exports = __webpack_require__(2447)(exports);
381
+
382
+ const {formatters} = module.exports;
383
+
384
+ /**
385
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
386
+ */
387
+
388
+ formatters.j = function (v) {
389
+ try {
390
+ return JSON.stringify(v);
391
+ } catch (error) {
392
+ return '[UnexpectedJSONParseError]: ' + error.message;
393
+ }
394
+ };
395
+
396
+
397
+ /***/ }),
398
+
399
+ /***/ 2447:
400
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
401
+
402
+
403
+ /**
404
+ * This is the common logic for both the Node.js and web browser
405
+ * implementations of `debug()`.
406
+ */
407
+
408
+ function setup(env) {
409
+ createDebug.debug = createDebug;
410
+ createDebug.default = createDebug;
411
+ createDebug.coerce = coerce;
412
+ createDebug.disable = disable;
413
+ createDebug.enable = enable;
414
+ createDebug.enabled = enabled;
415
+ createDebug.humanize = __webpack_require__(7824);
416
+ createDebug.destroy = destroy;
417
+
418
+ Object.keys(env).forEach(key => {
419
+ createDebug[key] = env[key];
420
+ });
421
+
422
+ /**
423
+ * The currently active debug mode names, and names to skip.
424
+ */
425
+
426
+ createDebug.names = [];
427
+ createDebug.skips = [];
428
+
429
+ /**
430
+ * Map of special "%n" handling functions, for the debug "format" argument.
431
+ *
432
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
433
+ */
434
+ createDebug.formatters = {};
435
+
436
+ /**
437
+ * Selects a color for a debug namespace
438
+ * @param {String} namespace The namespace string for the debug instance to be colored
439
+ * @return {Number|String} An ANSI color code for the given namespace
440
+ * @api private
441
+ */
442
+ function selectColor(namespace) {
443
+ let hash = 0;
444
+
445
+ for (let i = 0; i < namespace.length; i++) {
446
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
447
+ hash |= 0; // Convert to 32bit integer
448
+ }
449
+
450
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
451
+ }
452
+ createDebug.selectColor = selectColor;
453
+
454
+ /**
455
+ * Create a debugger with the given `namespace`.
456
+ *
457
+ * @param {String} namespace
458
+ * @return {Function}
459
+ * @api public
460
+ */
461
+ function createDebug(namespace) {
462
+ let prevTime;
463
+ let enableOverride = null;
464
+ let namespacesCache;
465
+ let enabledCache;
466
+
467
+ function debug(...args) {
468
+ // Disabled?
469
+ if (!debug.enabled) {
470
+ return;
471
+ }
472
+
473
+ const self = debug;
474
+
475
+ // Set `diff` timestamp
476
+ const curr = Number(new Date());
477
+ const ms = curr - (prevTime || curr);
478
+ self.diff = ms;
479
+ self.prev = prevTime;
480
+ self.curr = curr;
481
+ prevTime = curr;
482
+
483
+ args[0] = createDebug.coerce(args[0]);
484
+
485
+ if (typeof args[0] !== 'string') {
486
+ // Anything else let's inspect with %O
487
+ args.unshift('%O');
488
+ }
489
+
490
+ // Apply any `formatters` transformations
491
+ let index = 0;
492
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
493
+ // If we encounter an escaped % then don't increase the array index
494
+ if (match === '%%') {
495
+ return '%';
496
+ }
497
+ index++;
498
+ const formatter = createDebug.formatters[format];
499
+ if (typeof formatter === 'function') {
500
+ const val = args[index];
501
+ match = formatter.call(self, val);
502
+
503
+ // Now we need to remove `args[index]` since it's inlined in the `format`
504
+ args.splice(index, 1);
505
+ index--;
506
+ }
507
+ return match;
508
+ });
509
+
510
+ // Apply env-specific formatting (colors, etc.)
511
+ createDebug.formatArgs.call(self, args);
512
+
513
+ const logFn = self.log || createDebug.log;
514
+ logFn.apply(self, args);
515
+ }
516
+
517
+ debug.namespace = namespace;
518
+ debug.useColors = createDebug.useColors();
519
+ debug.color = createDebug.selectColor(namespace);
520
+ debug.extend = extend;
521
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
522
+
523
+ Object.defineProperty(debug, 'enabled', {
524
+ enumerable: true,
525
+ configurable: false,
526
+ get: () => {
527
+ if (enableOverride !== null) {
528
+ return enableOverride;
529
+ }
530
+ if (namespacesCache !== createDebug.namespaces) {
531
+ namespacesCache = createDebug.namespaces;
532
+ enabledCache = createDebug.enabled(namespace);
533
+ }
534
+
535
+ return enabledCache;
536
+ },
537
+ set: v => {
538
+ enableOverride = v;
539
+ }
540
+ });
541
+
542
+ // Env-specific initialization logic for debug instances
543
+ if (typeof createDebug.init === 'function') {
544
+ createDebug.init(debug);
545
+ }
546
+
547
+ return debug;
548
+ }
549
+
550
+ function extend(namespace, delimiter) {
551
+ const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
552
+ newDebug.log = this.log;
553
+ return newDebug;
554
+ }
555
+
556
+ /**
557
+ * Enables a debug mode by namespaces. This can include modes
558
+ * separated by a colon and wildcards.
559
+ *
560
+ * @param {String} namespaces
561
+ * @api public
562
+ */
563
+ function enable(namespaces) {
564
+ createDebug.save(namespaces);
565
+ createDebug.namespaces = namespaces;
566
+
567
+ createDebug.names = [];
568
+ createDebug.skips = [];
569
+
570
+ let i;
571
+ const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
572
+ const len = split.length;
573
+
574
+ for (i = 0; i < len; i++) {
575
+ if (!split[i]) {
576
+ // ignore empty strings
577
+ continue;
578
+ }
579
+
580
+ namespaces = split[i].replace(/\*/g, '.*?');
581
+
582
+ if (namespaces[0] === '-') {
583
+ createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
584
+ } else {
585
+ createDebug.names.push(new RegExp('^' + namespaces + '$'));
586
+ }
587
+ }
588
+ }
589
+
590
+ /**
591
+ * Disable debug output.
592
+ *
593
+ * @return {String} namespaces
594
+ * @api public
595
+ */
596
+ function disable() {
597
+ const namespaces = [
598
+ ...createDebug.names.map(toNamespace),
599
+ ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
600
+ ].join(',');
601
+ createDebug.enable('');
602
+ return namespaces;
603
+ }
604
+
605
+ /**
606
+ * Returns true if the given mode name is enabled, false otherwise.
607
+ *
608
+ * @param {String} name
609
+ * @return {Boolean}
610
+ * @api public
611
+ */
612
+ function enabled(name) {
613
+ if (name[name.length - 1] === '*') {
614
+ return true;
615
+ }
616
+
617
+ let i;
618
+ let len;
619
+
620
+ for (i = 0, len = createDebug.skips.length; i < len; i++) {
621
+ if (createDebug.skips[i].test(name)) {
622
+ return false;
623
+ }
624
+ }
625
+
626
+ for (i = 0, len = createDebug.names.length; i < len; i++) {
627
+ if (createDebug.names[i].test(name)) {
628
+ return true;
629
+ }
630
+ }
631
+
632
+ return false;
633
+ }
634
+
635
+ /**
636
+ * Convert regexp to namespace
637
+ *
638
+ * @param {RegExp} regxep
639
+ * @return {String} namespace
640
+ * @api private
641
+ */
642
+ function toNamespace(regexp) {
643
+ return regexp.toString()
644
+ .substring(2, regexp.toString().length - 2)
645
+ .replace(/\.\*\?$/, '*');
646
+ }
647
+
648
+ /**
649
+ * Coerce `val`.
650
+ *
651
+ * @param {Mixed} val
652
+ * @return {Mixed}
653
+ * @api private
654
+ */
655
+ function coerce(val) {
656
+ if (val instanceof Error) {
657
+ return val.stack || val.message;
658
+ }
659
+ return val;
660
+ }
661
+
662
+ /**
663
+ * XXX DO NOT USE. This is a temporary stub function.
664
+ * XXX It WILL be removed in the next major release.
665
+ */
666
+ function destroy() {
667
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
668
+ }
669
+
670
+ createDebug.enable(createDebug.load());
671
+
672
+ return createDebug;
673
+ }
674
+
675
+ module.exports = setup;
676
+
677
+
678
+ /***/ }),
679
+
680
+ /***/ 2840:
681
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
682
+
683
+ var once = __webpack_require__(778);
684
+
685
+ var noop = function() {};
686
+
687
+ var isRequest = function(stream) {
688
+ return stream.setHeader && typeof stream.abort === 'function';
689
+ };
690
+
691
+ var isChildProcess = function(stream) {
692
+ return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
693
+ };
694
+
695
+ var eos = function(stream, opts, callback) {
696
+ if (typeof opts === 'function') return eos(stream, null, opts);
697
+ if (!opts) opts = {};
698
+
699
+ callback = once(callback || noop);
700
+
701
+ var ws = stream._writableState;
702
+ var rs = stream._readableState;
703
+ var readable = opts.readable || (opts.readable !== false && stream.readable);
704
+ var writable = opts.writable || (opts.writable !== false && stream.writable);
705
+ var cancelled = false;
706
+
707
+ var onlegacyfinish = function() {
708
+ if (!stream.writable) onfinish();
709
+ };
710
+
711
+ var onfinish = function() {
712
+ writable = false;
713
+ if (!readable) callback.call(stream);
714
+ };
715
+
716
+ var onend = function() {
717
+ readable = false;
718
+ if (!writable) callback.call(stream);
719
+ };
720
+
721
+ var onexit = function(exitCode) {
722
+ callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
723
+ };
724
+
725
+ var onerror = function(err) {
726
+ callback.call(stream, err);
727
+ };
728
+
729
+ var onclose = function() {
730
+ process.nextTick(onclosenexttick);
731
+ };
732
+
733
+ var onclosenexttick = function() {
734
+ if (cancelled) return;
735
+ if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
736
+ if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
737
+ };
738
+
739
+ var onrequest = function() {
740
+ stream.req.on('finish', onfinish);
741
+ };
742
+
743
+ if (isRequest(stream)) {
744
+ stream.on('complete', onfinish);
745
+ stream.on('abort', onclose);
746
+ if (stream.req) onrequest();
747
+ else stream.on('request', onrequest);
748
+ } else if (writable && !ws) { // legacy streams
749
+ stream.on('end', onlegacyfinish);
750
+ stream.on('close', onlegacyfinish);
751
+ }
752
+
753
+ if (isChildProcess(stream)) stream.on('exit', onexit);
754
+
755
+ stream.on('end', onend);
756
+ stream.on('finish', onfinish);
757
+ if (opts.error !== false) stream.on('error', onerror);
758
+ stream.on('close', onclose);
759
+
760
+ return function() {
761
+ cancelled = true;
762
+ stream.removeListener('complete', onfinish);
763
+ stream.removeListener('abort', onclose);
764
+ stream.removeListener('request', onrequest);
765
+ if (stream.req) stream.req.removeListener('finish', onfinish);
766
+ stream.removeListener('end', onlegacyfinish);
767
+ stream.removeListener('close', onlegacyfinish);
768
+ stream.removeListener('finish', onfinish);
769
+ stream.removeListener('exit', onexit);
770
+ stream.removeListener('end', onend);
771
+ stream.removeListener('error', onerror);
772
+ stream.removeListener('close', onclose);
773
+ };
774
+ };
775
+
776
+ module.exports = eos;
777
+
778
+
779
+ /***/ }),
780
+
5
781
  /***/ 7187:
6
782
  /***/ ((module) => {
7
783
 
@@ -505,6 +1281,986 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
505
1281
  }
506
1282
 
507
1283
 
1284
+ /***/ }),
1285
+
1286
+ /***/ 2106:
1287
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1288
+
1289
+ const debug = __webpack_require__(1227)('extract-zip')
1290
+ // eslint-disable-next-line node/no-unsupported-features/node-builtins
1291
+ const { createWriteStream, promises: fs } = __webpack_require__(6231)
1292
+ const getStream = __webpack_require__(7491)
1293
+ const path = __webpack_require__(1423)
1294
+ const { promisify } = __webpack_require__(6464)
1295
+ const stream = __webpack_require__(8311)
1296
+ const yauzl = __webpack_require__(7766)
1297
+
1298
+ const openZip = promisify(yauzl.open)
1299
+ const pipeline = promisify(stream.pipeline)
1300
+
1301
+ class Extractor {
1302
+ constructor (zipPath, opts) {
1303
+ this.zipPath = zipPath
1304
+ this.opts = opts
1305
+ }
1306
+
1307
+ async extract () {
1308
+ debug('opening', this.zipPath, 'with opts', this.opts)
1309
+
1310
+ this.zipfile = await openZip(this.zipPath, { lazyEntries: true })
1311
+ this.canceled = false
1312
+
1313
+ return new Promise((resolve, reject) => {
1314
+ this.zipfile.on('error', err => {
1315
+ this.canceled = true
1316
+ reject(err)
1317
+ })
1318
+ this.zipfile.readEntry()
1319
+
1320
+ this.zipfile.on('close', () => {
1321
+ if (!this.canceled) {
1322
+ debug('zip extraction complete')
1323
+ resolve()
1324
+ }
1325
+ })
1326
+
1327
+ this.zipfile.on('entry', async entry => {
1328
+ /* istanbul ignore if */
1329
+ if (this.canceled) {
1330
+ debug('skipping entry', entry.fileName, { cancelled: this.canceled })
1331
+ return
1332
+ }
1333
+
1334
+ debug('zipfile entry', entry.fileName)
1335
+
1336
+ if (entry.fileName.startsWith('__MACOSX/')) {
1337
+ this.zipfile.readEntry()
1338
+ return
1339
+ }
1340
+
1341
+ const destDir = path.dirname(path.join(this.opts.dir, entry.fileName))
1342
+
1343
+ try {
1344
+ await fs.mkdir(destDir, { recursive: true })
1345
+
1346
+ const canonicalDestDir = await fs.realpath(destDir)
1347
+ const relativeDestDir = path.relative(this.opts.dir, canonicalDestDir)
1348
+
1349
+ if (relativeDestDir.split(path.sep).includes('..')) {
1350
+ throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`)
1351
+ }
1352
+
1353
+ await this.extractEntry(entry)
1354
+ debug('finished processing', entry.fileName)
1355
+ this.zipfile.readEntry()
1356
+ } catch (err) {
1357
+ this.canceled = true
1358
+ this.zipfile.close()
1359
+ reject(err)
1360
+ }
1361
+ })
1362
+ })
1363
+ }
1364
+
1365
+ async extractEntry (entry) {
1366
+ /* istanbul ignore if */
1367
+ if (this.canceled) {
1368
+ debug('skipping entry extraction', entry.fileName, { cancelled: this.canceled })
1369
+ return
1370
+ }
1371
+
1372
+ if (this.opts.onEntry) {
1373
+ this.opts.onEntry(entry, this.zipfile)
1374
+ }
1375
+
1376
+ const dest = path.join(this.opts.dir, entry.fileName)
1377
+
1378
+ // convert external file attr int into a fs stat mode int
1379
+ const mode = (entry.externalFileAttributes >> 16) & 0xFFFF
1380
+ // check if it's a symlink or dir (using stat mode constants)
1381
+ const IFMT = 61440
1382
+ const IFDIR = 16384
1383
+ const IFLNK = 40960
1384
+ const symlink = (mode & IFMT) === IFLNK
1385
+ let isDir = (mode & IFMT) === IFDIR
1386
+
1387
+ // Failsafe, borrowed from jsZip
1388
+ if (!isDir && entry.fileName.endsWith('/')) {
1389
+ isDir = true
1390
+ }
1391
+
1392
+ // check for windows weird way of specifying a directory
1393
+ // https://github.com/maxogden/extract-zip/issues/13#issuecomment-154494566
1394
+ const madeBy = entry.versionMadeBy >> 8
1395
+ if (!isDir) isDir = (madeBy === 0 && entry.externalFileAttributes === 16)
1396
+
1397
+ debug('extracting entry', { filename: entry.fileName, isDir: isDir, isSymlink: symlink })
1398
+
1399
+ const procMode = this.getExtractedMode(mode, isDir) & 0o777
1400
+
1401
+ // always ensure folders are created
1402
+ const destDir = isDir ? dest : path.dirname(dest)
1403
+
1404
+ const mkdirOptions = { recursive: true }
1405
+ if (isDir) {
1406
+ mkdirOptions.mode = procMode
1407
+ }
1408
+ debug('mkdir', { dir: destDir, ...mkdirOptions })
1409
+ await fs.mkdir(destDir, mkdirOptions)
1410
+ if (isDir) return
1411
+
1412
+ debug('opening read stream', dest)
1413
+ const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry)
1414
+
1415
+ if (symlink) {
1416
+ const link = await getStream(readStream)
1417
+ debug('creating symlink', link, dest)
1418
+ await fs.symlink(link, dest)
1419
+ } else {
1420
+ await pipeline(readStream, createWriteStream(dest, { mode: procMode }))
1421
+ }
1422
+ }
1423
+
1424
+ getExtractedMode (entryMode, isDir) {
1425
+ let mode = entryMode
1426
+ // Set defaults, if necessary
1427
+ if (mode === 0) {
1428
+ if (isDir) {
1429
+ if (this.opts.defaultDirMode) {
1430
+ mode = parseInt(this.opts.defaultDirMode, 10)
1431
+ }
1432
+
1433
+ if (!mode) {
1434
+ mode = 0o755
1435
+ }
1436
+ } else {
1437
+ if (this.opts.defaultFileMode) {
1438
+ mode = parseInt(this.opts.defaultFileMode, 10)
1439
+ }
1440
+
1441
+ if (!mode) {
1442
+ mode = 0o644
1443
+ }
1444
+ }
1445
+ }
1446
+
1447
+ return mode
1448
+ }
1449
+ }
1450
+
1451
+ module.exports = async function (zipPath, opts) {
1452
+ debug('creating target directory', opts.dir)
1453
+
1454
+ if (!path.isAbsolute(opts.dir)) {
1455
+ throw new Error('Target directory is expected to be absolute')
1456
+ }
1457
+
1458
+ await fs.mkdir(opts.dir, { recursive: true })
1459
+ opts.dir = await fs.realpath(opts.dir)
1460
+ return new Extractor(zipPath, opts).extract()
1461
+ }
1462
+
1463
+
1464
+ /***/ }),
1465
+
1466
+ /***/ 2297:
1467
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1468
+
1469
+ "use strict";
1470
+
1471
+ const {PassThrough: PassThroughStream} = __webpack_require__(8311);
1472
+
1473
+ module.exports = options => {
1474
+ options = {...options};
1475
+
1476
+ const {array} = options;
1477
+ let {encoding} = options;
1478
+ const isBuffer = encoding === 'buffer';
1479
+ let objectMode = false;
1480
+
1481
+ if (array) {
1482
+ objectMode = !(encoding || isBuffer);
1483
+ } else {
1484
+ encoding = encoding || 'utf8';
1485
+ }
1486
+
1487
+ if (isBuffer) {
1488
+ encoding = null;
1489
+ }
1490
+
1491
+ const stream = new PassThroughStream({objectMode});
1492
+
1493
+ if (encoding) {
1494
+ stream.setEncoding(encoding);
1495
+ }
1496
+
1497
+ let length = 0;
1498
+ const chunks = [];
1499
+
1500
+ stream.on('data', chunk => {
1501
+ chunks.push(chunk);
1502
+
1503
+ if (objectMode) {
1504
+ length = chunks.length;
1505
+ } else {
1506
+ length += chunk.length;
1507
+ }
1508
+ });
1509
+
1510
+ stream.getBufferedValue = () => {
1511
+ if (array) {
1512
+ return chunks;
1513
+ }
1514
+
1515
+ return isBuffer ? Buffer.concat(chunks, length) : chunks.join('');
1516
+ };
1517
+
1518
+ stream.getBufferedLength = () => length;
1519
+
1520
+ return stream;
1521
+ };
1522
+
1523
+
1524
+ /***/ }),
1525
+
1526
+ /***/ 7491:
1527
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1528
+
1529
+ "use strict";
1530
+
1531
+ const {constants: BufferConstants} = __webpack_require__(871);
1532
+ const pump = __webpack_require__(4286);
1533
+ const bufferStream = __webpack_require__(2297);
1534
+
1535
+ class MaxBufferError extends Error {
1536
+ constructor() {
1537
+ super('maxBuffer exceeded');
1538
+ this.name = 'MaxBufferError';
1539
+ }
1540
+ }
1541
+
1542
+ async function getStream(inputStream, options) {
1543
+ if (!inputStream) {
1544
+ return Promise.reject(new Error('Expected a stream'));
1545
+ }
1546
+
1547
+ options = {
1548
+ maxBuffer: Infinity,
1549
+ ...options
1550
+ };
1551
+
1552
+ const {maxBuffer} = options;
1553
+
1554
+ let stream;
1555
+ await new Promise((resolve, reject) => {
1556
+ const rejectPromise = error => {
1557
+ // Don't retrieve an oversized buffer.
1558
+ if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
1559
+ error.bufferedData = stream.getBufferedValue();
1560
+ }
1561
+
1562
+ reject(error);
1563
+ };
1564
+
1565
+ stream = pump(inputStream, bufferStream(options), error => {
1566
+ if (error) {
1567
+ rejectPromise(error);
1568
+ return;
1569
+ }
1570
+
1571
+ resolve();
1572
+ });
1573
+
1574
+ stream.on('data', () => {
1575
+ if (stream.getBufferedLength() > maxBuffer) {
1576
+ rejectPromise(new MaxBufferError());
1577
+ }
1578
+ });
1579
+ });
1580
+
1581
+ return stream.getBufferedValue();
1582
+ }
1583
+
1584
+ module.exports = getStream;
1585
+ // TODO: Remove this for the next major release
1586
+ module.exports["default"] = getStream;
1587
+ module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});
1588
+ module.exports.array = (stream, options) => getStream(stream, {...options, array: true});
1589
+ module.exports.MaxBufferError = MaxBufferError;
1590
+
1591
+
1592
+ /***/ }),
1593
+
1594
+ /***/ 8913:
1595
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1596
+
1597
+ var fs = __webpack_require__(6231);
1598
+ var util = __webpack_require__(6464);
1599
+ var stream = __webpack_require__(8311);
1600
+ var Readable = stream.Readable;
1601
+ var Writable = stream.Writable;
1602
+ var PassThrough = stream.PassThrough;
1603
+ var Pend = __webpack_require__(9916);
1604
+ var EventEmitter = (__webpack_require__(7187).EventEmitter);
1605
+
1606
+ exports.createFromBuffer = createFromBuffer;
1607
+ exports.createFromFd = createFromFd;
1608
+ exports.BufferSlicer = BufferSlicer;
1609
+ exports.FdSlicer = FdSlicer;
1610
+
1611
+ util.inherits(FdSlicer, EventEmitter);
1612
+ function FdSlicer(fd, options) {
1613
+ options = options || {};
1614
+ EventEmitter.call(this);
1615
+
1616
+ this.fd = fd;
1617
+ this.pend = new Pend();
1618
+ this.pend.max = 1;
1619
+ this.refCount = 0;
1620
+ this.autoClose = !!options.autoClose;
1621
+ }
1622
+
1623
+ FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
1624
+ var self = this;
1625
+ self.pend.go(function(cb) {
1626
+ fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
1627
+ cb();
1628
+ callback(err, bytesRead, buffer);
1629
+ });
1630
+ });
1631
+ };
1632
+
1633
+ FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
1634
+ var self = this;
1635
+ self.pend.go(function(cb) {
1636
+ fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
1637
+ cb();
1638
+ callback(err, written, buffer);
1639
+ });
1640
+ });
1641
+ };
1642
+
1643
+ FdSlicer.prototype.createReadStream = function(options) {
1644
+ return new ReadStream(this, options);
1645
+ };
1646
+
1647
+ FdSlicer.prototype.createWriteStream = function(options) {
1648
+ return new WriteStream(this, options);
1649
+ };
1650
+
1651
+ FdSlicer.prototype.ref = function() {
1652
+ this.refCount += 1;
1653
+ };
1654
+
1655
+ FdSlicer.prototype.unref = function() {
1656
+ var self = this;
1657
+ self.refCount -= 1;
1658
+
1659
+ if (self.refCount > 0) return;
1660
+ if (self.refCount < 0) throw new Error("invalid unref");
1661
+
1662
+ if (self.autoClose) {
1663
+ fs.close(self.fd, onCloseDone);
1664
+ }
1665
+
1666
+ function onCloseDone(err) {
1667
+ if (err) {
1668
+ self.emit('error', err);
1669
+ } else {
1670
+ self.emit('close');
1671
+ }
1672
+ }
1673
+ };
1674
+
1675
+ util.inherits(ReadStream, Readable);
1676
+ function ReadStream(context, options) {
1677
+ options = options || {};
1678
+ Readable.call(this, options);
1679
+
1680
+ this.context = context;
1681
+ this.context.ref();
1682
+
1683
+ this.start = options.start || 0;
1684
+ this.endOffset = options.end;
1685
+ this.pos = this.start;
1686
+ this.destroyed = false;
1687
+ }
1688
+
1689
+ ReadStream.prototype._read = function(n) {
1690
+ var self = this;
1691
+ if (self.destroyed) return;
1692
+
1693
+ var toRead = Math.min(self._readableState.highWaterMark, n);
1694
+ if (self.endOffset != null) {
1695
+ toRead = Math.min(toRead, self.endOffset - self.pos);
1696
+ }
1697
+ if (toRead <= 0) {
1698
+ self.destroyed = true;
1699
+ self.push(null);
1700
+ self.context.unref();
1701
+ return;
1702
+ }
1703
+ self.context.pend.go(function(cb) {
1704
+ if (self.destroyed) return cb();
1705
+ var buffer = new Buffer(toRead);
1706
+ fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
1707
+ if (err) {
1708
+ self.destroy(err);
1709
+ } else if (bytesRead === 0) {
1710
+ self.destroyed = true;
1711
+ self.push(null);
1712
+ self.context.unref();
1713
+ } else {
1714
+ self.pos += bytesRead;
1715
+ self.push(buffer.slice(0, bytesRead));
1716
+ }
1717
+ cb();
1718
+ });
1719
+ });
1720
+ };
1721
+
1722
+ ReadStream.prototype.destroy = function(err) {
1723
+ if (this.destroyed) return;
1724
+ err = err || new Error("stream destroyed");
1725
+ this.destroyed = true;
1726
+ this.emit('error', err);
1727
+ this.context.unref();
1728
+ };
1729
+
1730
+ util.inherits(WriteStream, Writable);
1731
+ function WriteStream(context, options) {
1732
+ options = options || {};
1733
+ Writable.call(this, options);
1734
+
1735
+ this.context = context;
1736
+ this.context.ref();
1737
+
1738
+ this.start = options.start || 0;
1739
+ this.endOffset = (options.end == null) ? Infinity : +options.end;
1740
+ this.bytesWritten = 0;
1741
+ this.pos = this.start;
1742
+ this.destroyed = false;
1743
+
1744
+ this.on('finish', this.destroy.bind(this));
1745
+ }
1746
+
1747
+ WriteStream.prototype._write = function(buffer, encoding, callback) {
1748
+ var self = this;
1749
+ if (self.destroyed) return;
1750
+
1751
+ if (self.pos + buffer.length > self.endOffset) {
1752
+ var err = new Error("maximum file length exceeded");
1753
+ err.code = 'ETOOBIG';
1754
+ self.destroy();
1755
+ callback(err);
1756
+ return;
1757
+ }
1758
+ self.context.pend.go(function(cb) {
1759
+ if (self.destroyed) return cb();
1760
+ fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
1761
+ if (err) {
1762
+ self.destroy();
1763
+ cb();
1764
+ callback(err);
1765
+ } else {
1766
+ self.bytesWritten += bytes;
1767
+ self.pos += bytes;
1768
+ self.emit('progress');
1769
+ cb();
1770
+ callback();
1771
+ }
1772
+ });
1773
+ });
1774
+ };
1775
+
1776
+ WriteStream.prototype.destroy = function() {
1777
+ if (this.destroyed) return;
1778
+ this.destroyed = true;
1779
+ this.context.unref();
1780
+ };
1781
+
1782
+ util.inherits(BufferSlicer, EventEmitter);
1783
+ function BufferSlicer(buffer, options) {
1784
+ EventEmitter.call(this);
1785
+
1786
+ options = options || {};
1787
+ this.refCount = 0;
1788
+ this.buffer = buffer;
1789
+ this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER;
1790
+ }
1791
+
1792
+ BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) {
1793
+ var end = position + length;
1794
+ var delta = end - this.buffer.length;
1795
+ var written = (delta > 0) ? delta : length;
1796
+ this.buffer.copy(buffer, offset, position, end);
1797
+ setImmediate(function() {
1798
+ callback(null, written);
1799
+ });
1800
+ };
1801
+
1802
+ BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) {
1803
+ buffer.copy(this.buffer, position, offset, offset + length);
1804
+ setImmediate(function() {
1805
+ callback(null, length, buffer);
1806
+ });
1807
+ };
1808
+
1809
+ BufferSlicer.prototype.createReadStream = function(options) {
1810
+ options = options || {};
1811
+ var readStream = new PassThrough(options);
1812
+ readStream.destroyed = false;
1813
+ readStream.start = options.start || 0;
1814
+ readStream.endOffset = options.end;
1815
+ // by the time this function returns, we'll be done.
1816
+ readStream.pos = readStream.endOffset || this.buffer.length;
1817
+
1818
+ // respect the maxChunkSize option to slice up the chunk into smaller pieces.
1819
+ var entireSlice = this.buffer.slice(readStream.start, readStream.pos);
1820
+ var offset = 0;
1821
+ while (true) {
1822
+ var nextOffset = offset + this.maxChunkSize;
1823
+ if (nextOffset >= entireSlice.length) {
1824
+ // last chunk
1825
+ if (offset < entireSlice.length) {
1826
+ readStream.write(entireSlice.slice(offset, entireSlice.length));
1827
+ }
1828
+ break;
1829
+ }
1830
+ readStream.write(entireSlice.slice(offset, nextOffset));
1831
+ offset = nextOffset;
1832
+ }
1833
+
1834
+ readStream.end();
1835
+ readStream.destroy = function() {
1836
+ readStream.destroyed = true;
1837
+ };
1838
+ return readStream;
1839
+ };
1840
+
1841
+ BufferSlicer.prototype.createWriteStream = function(options) {
1842
+ var bufferSlicer = this;
1843
+ options = options || {};
1844
+ var writeStream = new Writable(options);
1845
+ writeStream.start = options.start || 0;
1846
+ writeStream.endOffset = (options.end == null) ? this.buffer.length : +options.end;
1847
+ writeStream.bytesWritten = 0;
1848
+ writeStream.pos = writeStream.start;
1849
+ writeStream.destroyed = false;
1850
+ writeStream._write = function(buffer, encoding, callback) {
1851
+ if (writeStream.destroyed) return;
1852
+
1853
+ var end = writeStream.pos + buffer.length;
1854
+ if (end > writeStream.endOffset) {
1855
+ var err = new Error("maximum file length exceeded");
1856
+ err.code = 'ETOOBIG';
1857
+ writeStream.destroyed = true;
1858
+ callback(err);
1859
+ return;
1860
+ }
1861
+ buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length);
1862
+
1863
+ writeStream.bytesWritten += buffer.length;
1864
+ writeStream.pos = end;
1865
+ writeStream.emit('progress');
1866
+ callback();
1867
+ };
1868
+ writeStream.destroy = function() {
1869
+ writeStream.destroyed = true;
1870
+ };
1871
+ return writeStream;
1872
+ };
1873
+
1874
+ BufferSlicer.prototype.ref = function() {
1875
+ this.refCount += 1;
1876
+ };
1877
+
1878
+ BufferSlicer.prototype.unref = function() {
1879
+ this.refCount -= 1;
1880
+
1881
+ if (this.refCount < 0) {
1882
+ throw new Error("invalid unref");
1883
+ }
1884
+ };
1885
+
1886
+ function createFromBuffer(buffer, options) {
1887
+ return new BufferSlicer(buffer, options);
1888
+ }
1889
+
1890
+ function createFromFd(fd, options) {
1891
+ return new FdSlicer(fd, options);
1892
+ }
1893
+
1894
+
1895
+ /***/ }),
1896
+
1897
+ /***/ 7824:
1898
+ /***/ ((module) => {
1899
+
1900
+ /**
1901
+ * Helpers.
1902
+ */
1903
+
1904
+ var s = 1000;
1905
+ var m = s * 60;
1906
+ var h = m * 60;
1907
+ var d = h * 24;
1908
+ var w = d * 7;
1909
+ var y = d * 365.25;
1910
+
1911
+ /**
1912
+ * Parse or format the given `val`.
1913
+ *
1914
+ * Options:
1915
+ *
1916
+ * - `long` verbose formatting [false]
1917
+ *
1918
+ * @param {String|Number} val
1919
+ * @param {Object} [options]
1920
+ * @throws {Error} throw an error if val is not a non-empty string or a number
1921
+ * @return {String|Number}
1922
+ * @api public
1923
+ */
1924
+
1925
+ module.exports = function(val, options) {
1926
+ options = options || {};
1927
+ var type = typeof val;
1928
+ if (type === 'string' && val.length > 0) {
1929
+ return parse(val);
1930
+ } else if (type === 'number' && isFinite(val)) {
1931
+ return options.long ? fmtLong(val) : fmtShort(val);
1932
+ }
1933
+ throw new Error(
1934
+ 'val is not a non-empty string or a valid number. val=' +
1935
+ JSON.stringify(val)
1936
+ );
1937
+ };
1938
+
1939
+ /**
1940
+ * Parse the given `str` and return milliseconds.
1941
+ *
1942
+ * @param {String} str
1943
+ * @return {Number}
1944
+ * @api private
1945
+ */
1946
+
1947
+ function parse(str) {
1948
+ str = String(str);
1949
+ if (str.length > 100) {
1950
+ return;
1951
+ }
1952
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
1953
+ str
1954
+ );
1955
+ if (!match) {
1956
+ return;
1957
+ }
1958
+ var n = parseFloat(match[1]);
1959
+ var type = (match[2] || 'ms').toLowerCase();
1960
+ switch (type) {
1961
+ case 'years':
1962
+ case 'year':
1963
+ case 'yrs':
1964
+ case 'yr':
1965
+ case 'y':
1966
+ return n * y;
1967
+ case 'weeks':
1968
+ case 'week':
1969
+ case 'w':
1970
+ return n * w;
1971
+ case 'days':
1972
+ case 'day':
1973
+ case 'd':
1974
+ return n * d;
1975
+ case 'hours':
1976
+ case 'hour':
1977
+ case 'hrs':
1978
+ case 'hr':
1979
+ case 'h':
1980
+ return n * h;
1981
+ case 'minutes':
1982
+ case 'minute':
1983
+ case 'mins':
1984
+ case 'min':
1985
+ case 'm':
1986
+ return n * m;
1987
+ case 'seconds':
1988
+ case 'second':
1989
+ case 'secs':
1990
+ case 'sec':
1991
+ case 's':
1992
+ return n * s;
1993
+ case 'milliseconds':
1994
+ case 'millisecond':
1995
+ case 'msecs':
1996
+ case 'msec':
1997
+ case 'ms':
1998
+ return n;
1999
+ default:
2000
+ return undefined;
2001
+ }
2002
+ }
2003
+
2004
+ /**
2005
+ * Short format for `ms`.
2006
+ *
2007
+ * @param {Number} ms
2008
+ * @return {String}
2009
+ * @api private
2010
+ */
2011
+
2012
+ function fmtShort(ms) {
2013
+ var msAbs = Math.abs(ms);
2014
+ if (msAbs >= d) {
2015
+ return Math.round(ms / d) + 'd';
2016
+ }
2017
+ if (msAbs >= h) {
2018
+ return Math.round(ms / h) + 'h';
2019
+ }
2020
+ if (msAbs >= m) {
2021
+ return Math.round(ms / m) + 'm';
2022
+ }
2023
+ if (msAbs >= s) {
2024
+ return Math.round(ms / s) + 's';
2025
+ }
2026
+ return ms + 'ms';
2027
+ }
2028
+
2029
+ /**
2030
+ * Long format for `ms`.
2031
+ *
2032
+ * @param {Number} ms
2033
+ * @return {String}
2034
+ * @api private
2035
+ */
2036
+
2037
+ function fmtLong(ms) {
2038
+ var msAbs = Math.abs(ms);
2039
+ if (msAbs >= d) {
2040
+ return plural(ms, msAbs, d, 'day');
2041
+ }
2042
+ if (msAbs >= h) {
2043
+ return plural(ms, msAbs, h, 'hour');
2044
+ }
2045
+ if (msAbs >= m) {
2046
+ return plural(ms, msAbs, m, 'minute');
2047
+ }
2048
+ if (msAbs >= s) {
2049
+ return plural(ms, msAbs, s, 'second');
2050
+ }
2051
+ return ms + ' ms';
2052
+ }
2053
+
2054
+ /**
2055
+ * Pluralization helper.
2056
+ */
2057
+
2058
+ function plural(ms, msAbs, n, name) {
2059
+ var isPlural = msAbs >= n * 1.5;
2060
+ return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
2061
+ }
2062
+
2063
+
2064
+ /***/ }),
2065
+
2066
+ /***/ 778:
2067
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2068
+
2069
+ var wrappy = __webpack_require__(2479)
2070
+ module.exports = wrappy(once)
2071
+ module.exports.strict = wrappy(onceStrict)
2072
+
2073
+ once.proto = once(function () {
2074
+ Object.defineProperty(Function.prototype, 'once', {
2075
+ value: function () {
2076
+ return once(this)
2077
+ },
2078
+ configurable: true
2079
+ })
2080
+
2081
+ Object.defineProperty(Function.prototype, 'onceStrict', {
2082
+ value: function () {
2083
+ return onceStrict(this)
2084
+ },
2085
+ configurable: true
2086
+ })
2087
+ })
2088
+
2089
+ function once (fn) {
2090
+ var f = function () {
2091
+ if (f.called) return f.value
2092
+ f.called = true
2093
+ return f.value = fn.apply(this, arguments)
2094
+ }
2095
+ f.called = false
2096
+ return f
2097
+ }
2098
+
2099
+ function onceStrict (fn) {
2100
+ var f = function () {
2101
+ if (f.called)
2102
+ throw new Error(f.onceError)
2103
+ f.called = true
2104
+ return f.value = fn.apply(this, arguments)
2105
+ }
2106
+ var name = fn.name || 'Function wrapped with `once`'
2107
+ f.onceError = name + " shouldn't be called more than once"
2108
+ f.called = false
2109
+ return f
2110
+ }
2111
+
2112
+
2113
+ /***/ }),
2114
+
2115
+ /***/ 9916:
2116
+ /***/ ((module) => {
2117
+
2118
+ module.exports = Pend;
2119
+
2120
+ function Pend() {
2121
+ this.pending = 0;
2122
+ this.max = Infinity;
2123
+ this.listeners = [];
2124
+ this.waiting = [];
2125
+ this.error = null;
2126
+ }
2127
+
2128
+ Pend.prototype.go = function(fn) {
2129
+ if (this.pending < this.max) {
2130
+ pendGo(this, fn);
2131
+ } else {
2132
+ this.waiting.push(fn);
2133
+ }
2134
+ };
2135
+
2136
+ Pend.prototype.wait = function(cb) {
2137
+ if (this.pending === 0) {
2138
+ cb(this.error);
2139
+ } else {
2140
+ this.listeners.push(cb);
2141
+ }
2142
+ };
2143
+
2144
+ Pend.prototype.hold = function() {
2145
+ return pendHold(this);
2146
+ };
2147
+
2148
+ function pendHold(self) {
2149
+ self.pending += 1;
2150
+ var called = false;
2151
+ return onCb;
2152
+ function onCb(err) {
2153
+ if (called) throw new Error("callback called twice");
2154
+ called = true;
2155
+ self.error = self.error || err;
2156
+ self.pending -= 1;
2157
+ if (self.waiting.length > 0 && self.pending < self.max) {
2158
+ pendGo(self, self.waiting.shift());
2159
+ } else if (self.pending === 0) {
2160
+ var listeners = self.listeners;
2161
+ self.listeners = [];
2162
+ listeners.forEach(cbListener);
2163
+ }
2164
+ }
2165
+ function cbListener(listener) {
2166
+ listener(self.error);
2167
+ }
2168
+ }
2169
+
2170
+ function pendGo(self, fn) {
2171
+ fn(pendHold(self));
2172
+ }
2173
+
2174
+
2175
+ /***/ }),
2176
+
2177
+ /***/ 4286:
2178
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2179
+
2180
+ var once = __webpack_require__(778)
2181
+ var eos = __webpack_require__(2840)
2182
+ var fs = __webpack_require__(6231) // we only need fs to get the ReadStream and WriteStream prototypes
2183
+
2184
+ var noop = function () {}
2185
+ var ancient = /^v?\.0/.test(process.version)
2186
+
2187
+ var isFn = function (fn) {
2188
+ return typeof fn === 'function'
2189
+ }
2190
+
2191
+ var isFS = function (stream) {
2192
+ if (!ancient) return false // newer node version do not need to care about fs is a special way
2193
+ if (!fs) return false // browser
2194
+ return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
2195
+ }
2196
+
2197
+ var isRequest = function (stream) {
2198
+ return stream.setHeader && isFn(stream.abort)
2199
+ }
2200
+
2201
+ var destroyer = function (stream, reading, writing, callback) {
2202
+ callback = once(callback)
2203
+
2204
+ var closed = false
2205
+ stream.on('close', function () {
2206
+ closed = true
2207
+ })
2208
+
2209
+ eos(stream, {readable: reading, writable: writing}, function (err) {
2210
+ if (err) return callback(err)
2211
+ closed = true
2212
+ callback()
2213
+ })
2214
+
2215
+ var destroyed = false
2216
+ return function (err) {
2217
+ if (closed) return
2218
+ if (destroyed) return
2219
+ destroyed = true
2220
+
2221
+ if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
2222
+ if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
2223
+
2224
+ if (isFn(stream.destroy)) return stream.destroy()
2225
+
2226
+ callback(err || new Error('stream was destroyed'))
2227
+ }
2228
+ }
2229
+
2230
+ var call = function (fn) {
2231
+ fn()
2232
+ }
2233
+
2234
+ var pipe = function (from, to) {
2235
+ return from.pipe(to)
2236
+ }
2237
+
2238
+ var pump = function () {
2239
+ var streams = Array.prototype.slice.call(arguments)
2240
+ var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
2241
+
2242
+ if (Array.isArray(streams[0])) streams = streams[0]
2243
+ if (streams.length < 2) throw new Error('pump requires two streams per minimum')
2244
+
2245
+ var error
2246
+ var destroys = streams.map(function (stream, i) {
2247
+ var reading = i < streams.length - 1
2248
+ var writing = i > 0
2249
+ return destroyer(stream, reading, writing, function (err) {
2250
+ if (!error) error = err
2251
+ if (err) destroys.forEach(call)
2252
+ if (reading) return
2253
+ destroys.forEach(call)
2254
+ callback(error)
2255
+ })
2256
+ })
2257
+
2258
+ return streams.reduce(pipe)
2259
+ }
2260
+
2261
+ module.exports = pump
2262
+
2263
+
508
2264
  /***/ }),
509
2265
 
510
2266
  /***/ 6099:
@@ -2077,6 +3833,46 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
2077
3833
  })( false ? 0 : exports)
2078
3834
 
2079
3835
 
3836
+ /***/ }),
3837
+
3838
+ /***/ 2479:
3839
+ /***/ ((module) => {
3840
+
3841
+ // Returns a wrapper function that returns a wrapped callback
3842
+ // The wrapper function should do some stuff, and return a
3843
+ // presumably different callback function.
3844
+ // This makes sure that own properties are retained, so that
3845
+ // decorations and such are not lost along the way.
3846
+ module.exports = wrappy
3847
+ function wrappy (fn, cb) {
3848
+ if (fn && cb) return wrappy(fn)(cb)
3849
+
3850
+ if (typeof fn !== 'function')
3851
+ throw new TypeError('need wrapper function')
3852
+
3853
+ Object.keys(fn).forEach(function (k) {
3854
+ wrapper[k] = fn[k]
3855
+ })
3856
+
3857
+ return wrapper
3858
+
3859
+ function wrapper() {
3860
+ var args = new Array(arguments.length)
3861
+ for (var i = 0; i < args.length; i++) {
3862
+ args[i] = arguments[i]
3863
+ }
3864
+ var ret = fn.apply(this, args)
3865
+ var cb = args[args.length-1]
3866
+ if (typeof ret === 'function' && ret !== cb) {
3867
+ Object.keys(cb).forEach(function (k) {
3868
+ ret[k] = cb[k]
3869
+ })
3870
+ }
3871
+ return ret
3872
+ }
3873
+ }
3874
+
3875
+
2080
3876
  /***/ }),
2081
3877
 
2082
3878
  /***/ 306:
@@ -7080,6 +8876,833 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
7080
8876
  }).call(this);
7081
8877
 
7082
8878
 
8879
+ /***/ }),
8880
+
8881
+ /***/ 7766:
8882
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8883
+
8884
+ var fs = __webpack_require__(6231);
8885
+ var zlib = __webpack_require__(8884);
8886
+ var fd_slicer = __webpack_require__(8913);
8887
+ var crc32 = __webpack_require__(2779);
8888
+ var util = __webpack_require__(6464);
8889
+ var EventEmitter = (__webpack_require__(7187).EventEmitter);
8890
+ var Transform = (__webpack_require__(8311).Transform);
8891
+ var PassThrough = (__webpack_require__(8311).PassThrough);
8892
+ var Writable = (__webpack_require__(8311).Writable);
8893
+
8894
+ exports.open = open;
8895
+ exports.fromFd = fromFd;
8896
+ exports.fromBuffer = fromBuffer;
8897
+ exports.fromRandomAccessReader = fromRandomAccessReader;
8898
+ exports.dosDateTimeToDate = dosDateTimeToDate;
8899
+ exports.validateFileName = validateFileName;
8900
+ exports.ZipFile = ZipFile;
8901
+ exports.Entry = Entry;
8902
+ exports.RandomAccessReader = RandomAccessReader;
8903
+
8904
+ function open(path, options, callback) {
8905
+ if (typeof options === "function") {
8906
+ callback = options;
8907
+ options = null;
8908
+ }
8909
+ if (options == null) options = {};
8910
+ if (options.autoClose == null) options.autoClose = true;
8911
+ if (options.lazyEntries == null) options.lazyEntries = false;
8912
+ if (options.decodeStrings == null) options.decodeStrings = true;
8913
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
8914
+ if (options.strictFileNames == null) options.strictFileNames = false;
8915
+ if (callback == null) callback = defaultCallback;
8916
+ fs.open(path, "r", function(err, fd) {
8917
+ if (err) return callback(err);
8918
+ fromFd(fd, options, function(err, zipfile) {
8919
+ if (err) fs.close(fd, defaultCallback);
8920
+ callback(err, zipfile);
8921
+ });
8922
+ });
8923
+ }
8924
+
8925
+ function fromFd(fd, options, callback) {
8926
+ if (typeof options === "function") {
8927
+ callback = options;
8928
+ options = null;
8929
+ }
8930
+ if (options == null) options = {};
8931
+ if (options.autoClose == null) options.autoClose = false;
8932
+ if (options.lazyEntries == null) options.lazyEntries = false;
8933
+ if (options.decodeStrings == null) options.decodeStrings = true;
8934
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
8935
+ if (options.strictFileNames == null) options.strictFileNames = false;
8936
+ if (callback == null) callback = defaultCallback;
8937
+ fs.fstat(fd, function(err, stats) {
8938
+ if (err) return callback(err);
8939
+ var reader = fd_slicer.createFromFd(fd, {autoClose: true});
8940
+ fromRandomAccessReader(reader, stats.size, options, callback);
8941
+ });
8942
+ }
8943
+
8944
+ function fromBuffer(buffer, options, callback) {
8945
+ if (typeof options === "function") {
8946
+ callback = options;
8947
+ options = null;
8948
+ }
8949
+ if (options == null) options = {};
8950
+ options.autoClose = false;
8951
+ if (options.lazyEntries == null) options.lazyEntries = false;
8952
+ if (options.decodeStrings == null) options.decodeStrings = true;
8953
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
8954
+ if (options.strictFileNames == null) options.strictFileNames = false;
8955
+ // limit the max chunk size. see https://github.com/thejoshwolfe/yauzl/issues/87
8956
+ var reader = fd_slicer.createFromBuffer(buffer, {maxChunkSize: 0x10000});
8957
+ fromRandomAccessReader(reader, buffer.length, options, callback);
8958
+ }
8959
+
8960
+ function fromRandomAccessReader(reader, totalSize, options, callback) {
8961
+ if (typeof options === "function") {
8962
+ callback = options;
8963
+ options = null;
8964
+ }
8965
+ if (options == null) options = {};
8966
+ if (options.autoClose == null) options.autoClose = true;
8967
+ if (options.lazyEntries == null) options.lazyEntries = false;
8968
+ if (options.decodeStrings == null) options.decodeStrings = true;
8969
+ var decodeStrings = !!options.decodeStrings;
8970
+ if (options.validateEntrySizes == null) options.validateEntrySizes = true;
8971
+ if (options.strictFileNames == null) options.strictFileNames = false;
8972
+ if (callback == null) callback = defaultCallback;
8973
+ if (typeof totalSize !== "number") throw new Error("expected totalSize parameter to be a number");
8974
+ if (totalSize > Number.MAX_SAFE_INTEGER) {
8975
+ throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");
8976
+ }
8977
+
8978
+ // the matching unref() call is in zipfile.close()
8979
+ reader.ref();
8980
+
8981
+ // eocdr means End of Central Directory Record.
8982
+ // search backwards for the eocdr signature.
8983
+ // the last field of the eocdr is a variable-length comment.
8984
+ // the comment size is encoded in a 2-byte field in the eocdr, which we can't find without trudging backwards through the comment to find it.
8985
+ // as a consequence of this design decision, it's possible to have ambiguous zip file metadata if a coherent eocdr was in the comment.
8986
+ // we search backwards for a eocdr signature, and hope that whoever made the zip file was smart enough to forbid the eocdr signature in the comment.
8987
+ var eocdrWithoutCommentSize = 22;
8988
+ var maxCommentSize = 0xffff; // 2-byte size
8989
+ var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize);
8990
+ var buffer = newBuffer(bufferSize);
8991
+ var bufferReadStart = totalSize - buffer.length;
8992
+ readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) {
8993
+ if (err) return callback(err);
8994
+ for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) {
8995
+ if (buffer.readUInt32LE(i) !== 0x06054b50) continue;
8996
+ // found eocdr
8997
+ var eocdrBuffer = buffer.slice(i);
8998
+
8999
+ // 0 - End of central directory signature = 0x06054b50
9000
+ // 4 - Number of this disk
9001
+ var diskNumber = eocdrBuffer.readUInt16LE(4);
9002
+ if (diskNumber !== 0) {
9003
+ return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
9004
+ }
9005
+ // 6 - Disk where central directory starts
9006
+ // 8 - Number of central directory records on this disk
9007
+ // 10 - Total number of central directory records
9008
+ var entryCount = eocdrBuffer.readUInt16LE(10);
9009
+ // 12 - Size of central directory (bytes)
9010
+ // 16 - Offset of start of central directory, relative to start of archive
9011
+ var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16);
9012
+ // 20 - Comment length
9013
+ var commentLength = eocdrBuffer.readUInt16LE(20);
9014
+ var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize;
9015
+ if (commentLength !== expectedCommentLength) {
9016
+ return callback(new Error("invalid comment length. expected: " + expectedCommentLength + ". found: " + commentLength));
9017
+ }
9018
+ // 22 - Comment
9019
+ // the encoding is always cp437.
9020
+ var comment = decodeStrings ? decodeBuffer(eocdrBuffer, 22, eocdrBuffer.length, false)
9021
+ : eocdrBuffer.slice(22);
9022
+
9023
+ if (!(entryCount === 0xffff || centralDirectoryOffset === 0xffffffff)) {
9024
+ return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
9025
+ }
9026
+
9027
+ // ZIP64 format
9028
+
9029
+ // ZIP64 Zip64 end of central directory locator
9030
+ var zip64EocdlBuffer = newBuffer(20);
9031
+ var zip64EocdlOffset = bufferReadStart + i - zip64EocdlBuffer.length;
9032
+ readAndAssertNoEof(reader, zip64EocdlBuffer, 0, zip64EocdlBuffer.length, zip64EocdlOffset, function(err) {
9033
+ if (err) return callback(err);
9034
+
9035
+ // 0 - zip64 end of central dir locator signature = 0x07064b50
9036
+ if (zip64EocdlBuffer.readUInt32LE(0) !== 0x07064b50) {
9037
+ return callback(new Error("invalid zip64 end of central directory locator signature"));
9038
+ }
9039
+ // 4 - number of the disk with the start of the zip64 end of central directory
9040
+ // 8 - relative offset of the zip64 end of central directory record
9041
+ var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8);
9042
+ // 16 - total number of disks
9043
+
9044
+ // ZIP64 end of central directory record
9045
+ var zip64EocdrBuffer = newBuffer(56);
9046
+ readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err) {
9047
+ if (err) return callback(err);
9048
+
9049
+ // 0 - zip64 end of central dir signature 4 bytes (0x06064b50)
9050
+ if (zip64EocdrBuffer.readUInt32LE(0) !== 0x06064b50) {
9051
+ return callback(new Error("invalid zip64 end of central directory record signature"));
9052
+ }
9053
+ // 4 - size of zip64 end of central directory record 8 bytes
9054
+ // 12 - version made by 2 bytes
9055
+ // 14 - version needed to extract 2 bytes
9056
+ // 16 - number of this disk 4 bytes
9057
+ // 20 - number of the disk with the start of the central directory 4 bytes
9058
+ // 24 - total number of entries in the central directory on this disk 8 bytes
9059
+ // 32 - total number of entries in the central directory 8 bytes
9060
+ entryCount = readUInt64LE(zip64EocdrBuffer, 32);
9061
+ // 40 - size of the central directory 8 bytes
9062
+ // 48 - offset of start of central directory with respect to the starting disk number 8 bytes
9063
+ centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);
9064
+ // 56 - zip64 extensible data sector (variable size)
9065
+ return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames));
9066
+ });
9067
+ });
9068
+ return;
9069
+ }
9070
+ callback(new Error("end of central directory record signature not found"));
9071
+ });
9072
+ }
9073
+
9074
+ util.inherits(ZipFile, EventEmitter);
9075
+ function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
9076
+ var self = this;
9077
+ EventEmitter.call(self);
9078
+ self.reader = reader;
9079
+ // forward close events
9080
+ self.reader.on("error", function(err) {
9081
+ // error closing the fd
9082
+ emitError(self, err);
9083
+ });
9084
+ self.reader.once("close", function() {
9085
+ self.emit("close");
9086
+ });
9087
+ self.readEntryCursor = centralDirectoryOffset;
9088
+ self.fileSize = fileSize;
9089
+ self.entryCount = entryCount;
9090
+ self.comment = comment;
9091
+ self.entriesRead = 0;
9092
+ self.autoClose = !!autoClose;
9093
+ self.lazyEntries = !!lazyEntries;
9094
+ self.decodeStrings = !!decodeStrings;
9095
+ self.validateEntrySizes = !!validateEntrySizes;
9096
+ self.strictFileNames = !!strictFileNames;
9097
+ self.isOpen = true;
9098
+ self.emittedError = false;
9099
+
9100
+ if (!self.lazyEntries) self._readEntry();
9101
+ }
9102
+ ZipFile.prototype.close = function() {
9103
+ if (!this.isOpen) return;
9104
+ this.isOpen = false;
9105
+ this.reader.unref();
9106
+ };
9107
+
9108
+ function emitErrorAndAutoClose(self, err) {
9109
+ if (self.autoClose) self.close();
9110
+ emitError(self, err);
9111
+ }
9112
+ function emitError(self, err) {
9113
+ if (self.emittedError) return;
9114
+ self.emittedError = true;
9115
+ self.emit("error", err);
9116
+ }
9117
+
9118
+ ZipFile.prototype.readEntry = function() {
9119
+ if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true");
9120
+ this._readEntry();
9121
+ };
9122
+ ZipFile.prototype._readEntry = function() {
9123
+ var self = this;
9124
+ if (self.entryCount === self.entriesRead) {
9125
+ // done with metadata
9126
+ setImmediate(function() {
9127
+ if (self.autoClose) self.close();
9128
+ if (self.emittedError) return;
9129
+ self.emit("end");
9130
+ });
9131
+ return;
9132
+ }
9133
+ if (self.emittedError) return;
9134
+ var buffer = newBuffer(46);
9135
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
9136
+ if (err) return emitErrorAndAutoClose(self, err);
9137
+ if (self.emittedError) return;
9138
+ var entry = new Entry();
9139
+ // 0 - Central directory file header signature
9140
+ var signature = buffer.readUInt32LE(0);
9141
+ if (signature !== 0x02014b50) return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16)));
9142
+ // 4 - Version made by
9143
+ entry.versionMadeBy = buffer.readUInt16LE(4);
9144
+ // 6 - Version needed to extract (minimum)
9145
+ entry.versionNeededToExtract = buffer.readUInt16LE(6);
9146
+ // 8 - General purpose bit flag
9147
+ entry.generalPurposeBitFlag = buffer.readUInt16LE(8);
9148
+ // 10 - Compression method
9149
+ entry.compressionMethod = buffer.readUInt16LE(10);
9150
+ // 12 - File last modification time
9151
+ entry.lastModFileTime = buffer.readUInt16LE(12);
9152
+ // 14 - File last modification date
9153
+ entry.lastModFileDate = buffer.readUInt16LE(14);
9154
+ // 16 - CRC-32
9155
+ entry.crc32 = buffer.readUInt32LE(16);
9156
+ // 20 - Compressed size
9157
+ entry.compressedSize = buffer.readUInt32LE(20);
9158
+ // 24 - Uncompressed size
9159
+ entry.uncompressedSize = buffer.readUInt32LE(24);
9160
+ // 28 - File name length (n)
9161
+ entry.fileNameLength = buffer.readUInt16LE(28);
9162
+ // 30 - Extra field length (m)
9163
+ entry.extraFieldLength = buffer.readUInt16LE(30);
9164
+ // 32 - File comment length (k)
9165
+ entry.fileCommentLength = buffer.readUInt16LE(32);
9166
+ // 34 - Disk number where file starts
9167
+ // 36 - Internal file attributes
9168
+ entry.internalFileAttributes = buffer.readUInt16LE(36);
9169
+ // 38 - External file attributes
9170
+ entry.externalFileAttributes = buffer.readUInt32LE(38);
9171
+ // 42 - Relative offset of local file header
9172
+ entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42);
9173
+
9174
+ if (entry.generalPurposeBitFlag & 0x40) return emitErrorAndAutoClose(self, new Error("strong encryption is not supported"));
9175
+
9176
+ self.readEntryCursor += 46;
9177
+
9178
+ buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength);
9179
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) {
9180
+ if (err) return emitErrorAndAutoClose(self, err);
9181
+ if (self.emittedError) return;
9182
+ // 46 - File name
9183
+ var isUtf8 = (entry.generalPurposeBitFlag & 0x800) !== 0;
9184
+ entry.fileName = self.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf8)
9185
+ : buffer.slice(0, entry.fileNameLength);
9186
+
9187
+ // 46+n - Extra field
9188
+ var fileCommentStart = entry.fileNameLength + entry.extraFieldLength;
9189
+ var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart);
9190
+ entry.extraFields = [];
9191
+ var i = 0;
9192
+ while (i < extraFieldBuffer.length - 3) {
9193
+ var headerId = extraFieldBuffer.readUInt16LE(i + 0);
9194
+ var dataSize = extraFieldBuffer.readUInt16LE(i + 2);
9195
+ var dataStart = i + 4;
9196
+ var dataEnd = dataStart + dataSize;
9197
+ if (dataEnd > extraFieldBuffer.length) return emitErrorAndAutoClose(self, new Error("extra field length exceeds extra field buffer size"));
9198
+ var dataBuffer = newBuffer(dataSize);
9199
+ extraFieldBuffer.copy(dataBuffer, 0, dataStart, dataEnd);
9200
+ entry.extraFields.push({
9201
+ id: headerId,
9202
+ data: dataBuffer,
9203
+ });
9204
+ i = dataEnd;
9205
+ }
9206
+
9207
+ // 46+n+m - File comment
9208
+ entry.fileComment = self.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf8)
9209
+ : buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength);
9210
+ // compatibility hack for https://github.com/thejoshwolfe/yauzl/issues/47
9211
+ entry.comment = entry.fileComment;
9212
+
9213
+ self.readEntryCursor += buffer.length;
9214
+ self.entriesRead += 1;
9215
+
9216
+ if (entry.uncompressedSize === 0xffffffff ||
9217
+ entry.compressedSize === 0xffffffff ||
9218
+ entry.relativeOffsetOfLocalHeader === 0xffffffff) {
9219
+ // ZIP64 format
9220
+ // find the Zip64 Extended Information Extra Field
9221
+ var zip64EiefBuffer = null;
9222
+ for (var i = 0; i < entry.extraFields.length; i++) {
9223
+ var extraField = entry.extraFields[i];
9224
+ if (extraField.id === 0x0001) {
9225
+ zip64EiefBuffer = extraField.data;
9226
+ break;
9227
+ }
9228
+ }
9229
+ if (zip64EiefBuffer == null) {
9230
+ return emitErrorAndAutoClose(self, new Error("expected zip64 extended information extra field"));
9231
+ }
9232
+ var index = 0;
9233
+ // 0 - Original Size 8 bytes
9234
+ if (entry.uncompressedSize === 0xffffffff) {
9235
+ if (index + 8 > zip64EiefBuffer.length) {
9236
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size"));
9237
+ }
9238
+ entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index);
9239
+ index += 8;
9240
+ }
9241
+ // 8 - Compressed Size 8 bytes
9242
+ if (entry.compressedSize === 0xffffffff) {
9243
+ if (index + 8 > zip64EiefBuffer.length) {
9244
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size"));
9245
+ }
9246
+ entry.compressedSize = readUInt64LE(zip64EiefBuffer, index);
9247
+ index += 8;
9248
+ }
9249
+ // 16 - Relative Header Offset 8 bytes
9250
+ if (entry.relativeOffsetOfLocalHeader === 0xffffffff) {
9251
+ if (index + 8 > zip64EiefBuffer.length) {
9252
+ return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset"));
9253
+ }
9254
+ entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index);
9255
+ index += 8;
9256
+ }
9257
+ // 24 - Disk Start Number 4 bytes
9258
+ }
9259
+
9260
+ // check for Info-ZIP Unicode Path Extra Field (0x7075)
9261
+ // see https://github.com/thejoshwolfe/yauzl/issues/33
9262
+ if (self.decodeStrings) {
9263
+ for (var i = 0; i < entry.extraFields.length; i++) {
9264
+ var extraField = entry.extraFields[i];
9265
+ if (extraField.id === 0x7075) {
9266
+ if (extraField.data.length < 6) {
9267
+ // too short to be meaningful
9268
+ continue;
9269
+ }
9270
+ // Version 1 byte version of this extra field, currently 1
9271
+ if (extraField.data.readUInt8(0) !== 1) {
9272
+ // > Changes may not be backward compatible so this extra
9273
+ // > field should not be used if the version is not recognized.
9274
+ continue;
9275
+ }
9276
+ // NameCRC32 4 bytes File Name Field CRC32 Checksum
9277
+ var oldNameCrc32 = extraField.data.readUInt32LE(1);
9278
+ if (crc32.unsigned(buffer.slice(0, entry.fileNameLength)) !== oldNameCrc32) {
9279
+ // > If the CRC check fails, this UTF-8 Path Extra Field should be
9280
+ // > ignored and the File Name field in the header should be used instead.
9281
+ continue;
9282
+ }
9283
+ // UnicodeName Variable UTF-8 version of the entry File Name
9284
+ entry.fileName = decodeBuffer(extraField.data, 5, extraField.data.length, true);
9285
+ break;
9286
+ }
9287
+ }
9288
+ }
9289
+
9290
+ // validate file size
9291
+ if (self.validateEntrySizes && entry.compressionMethod === 0) {
9292
+ var expectedCompressedSize = entry.uncompressedSize;
9293
+ if (entry.isEncrypted()) {
9294
+ // traditional encryption prefixes the file data with a header
9295
+ expectedCompressedSize += 12;
9296
+ }
9297
+ if (entry.compressedSize !== expectedCompressedSize) {
9298
+ var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize;
9299
+ return emitErrorAndAutoClose(self, new Error(msg));
9300
+ }
9301
+ }
9302
+
9303
+ if (self.decodeStrings) {
9304
+ if (!self.strictFileNames) {
9305
+ // allow backslash
9306
+ entry.fileName = entry.fileName.replace(/\\/g, "/");
9307
+ }
9308
+ var errorMessage = validateFileName(entry.fileName, self.validateFileNameOptions);
9309
+ if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage));
9310
+ }
9311
+ self.emit("entry", entry);
9312
+
9313
+ if (!self.lazyEntries) self._readEntry();
9314
+ });
9315
+ });
9316
+ };
9317
+
9318
+ ZipFile.prototype.openReadStream = function(entry, options, callback) {
9319
+ var self = this;
9320
+ // parameter validation
9321
+ var relativeStart = 0;
9322
+ var relativeEnd = entry.compressedSize;
9323
+ if (callback == null) {
9324
+ callback = options;
9325
+ options = {};
9326
+ } else {
9327
+ // validate options that the caller has no excuse to get wrong
9328
+ if (options.decrypt != null) {
9329
+ if (!entry.isEncrypted()) {
9330
+ throw new Error("options.decrypt can only be specified for encrypted entries");
9331
+ }
9332
+ if (options.decrypt !== false) throw new Error("invalid options.decrypt value: " + options.decrypt);
9333
+ if (entry.isCompressed()) {
9334
+ if (options.decompress !== false) throw new Error("entry is encrypted and compressed, and options.decompress !== false");
9335
+ }
9336
+ }
9337
+ if (options.decompress != null) {
9338
+ if (!entry.isCompressed()) {
9339
+ throw new Error("options.decompress can only be specified for compressed entries");
9340
+ }
9341
+ if (!(options.decompress === false || options.decompress === true)) {
9342
+ throw new Error("invalid options.decompress value: " + options.decompress);
9343
+ }
9344
+ }
9345
+ if (options.start != null || options.end != null) {
9346
+ if (entry.isCompressed() && options.decompress !== false) {
9347
+ throw new Error("start/end range not allowed for compressed entry without options.decompress === false");
9348
+ }
9349
+ if (entry.isEncrypted() && options.decrypt !== false) {
9350
+ throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false");
9351
+ }
9352
+ }
9353
+ if (options.start != null) {
9354
+ relativeStart = options.start;
9355
+ if (relativeStart < 0) throw new Error("options.start < 0");
9356
+ if (relativeStart > entry.compressedSize) throw new Error("options.start > entry.compressedSize");
9357
+ }
9358
+ if (options.end != null) {
9359
+ relativeEnd = options.end;
9360
+ if (relativeEnd < 0) throw new Error("options.end < 0");
9361
+ if (relativeEnd > entry.compressedSize) throw new Error("options.end > entry.compressedSize");
9362
+ if (relativeEnd < relativeStart) throw new Error("options.end < options.start");
9363
+ }
9364
+ }
9365
+ // any further errors can either be caused by the zipfile,
9366
+ // or were introduced in a minor version of yauzl,
9367
+ // so should be passed to the client rather than thrown.
9368
+ if (!self.isOpen) return callback(new Error("closed"));
9369
+ if (entry.isEncrypted()) {
9370
+ if (options.decrypt !== false) return callback(new Error("entry is encrypted, and options.decrypt !== false"));
9371
+ }
9372
+ // make sure we don't lose the fd before we open the actual read stream
9373
+ self.reader.ref();
9374
+ var buffer = newBuffer(30);
9375
+ readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) {
9376
+ try {
9377
+ if (err) return callback(err);
9378
+ // 0 - Local file header signature = 0x04034b50
9379
+ var signature = buffer.readUInt32LE(0);
9380
+ if (signature !== 0x04034b50) {
9381
+ return callback(new Error("invalid local file header signature: 0x" + signature.toString(16)));
9382
+ }
9383
+ // all this should be redundant
9384
+ // 4 - Version needed to extract (minimum)
9385
+ // 6 - General purpose bit flag
9386
+ // 8 - Compression method
9387
+ // 10 - File last modification time
9388
+ // 12 - File last modification date
9389
+ // 14 - CRC-32
9390
+ // 18 - Compressed size
9391
+ // 22 - Uncompressed size
9392
+ // 26 - File name length (n)
9393
+ var fileNameLength = buffer.readUInt16LE(26);
9394
+ // 28 - Extra field length (m)
9395
+ var extraFieldLength = buffer.readUInt16LE(28);
9396
+ // 30 - File name
9397
+ // 30+n - Extra field
9398
+ var localFileHeaderEnd = entry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength;
9399
+ var decompress;
9400
+ if (entry.compressionMethod === 0) {
9401
+ // 0 - The file is stored (no compression)
9402
+ decompress = false;
9403
+ } else if (entry.compressionMethod === 8) {
9404
+ // 8 - The file is Deflated
9405
+ decompress = options.decompress != null ? options.decompress : true;
9406
+ } else {
9407
+ return callback(new Error("unsupported compression method: " + entry.compressionMethod));
9408
+ }
9409
+ var fileDataStart = localFileHeaderEnd;
9410
+ var fileDataEnd = fileDataStart + entry.compressedSize;
9411
+ if (entry.compressedSize !== 0) {
9412
+ // bounds check now, because the read streams will probably not complain loud enough.
9413
+ // since we're dealing with an unsigned offset plus an unsigned size,
9414
+ // we only have 1 thing to check for.
9415
+ if (fileDataEnd > self.fileSize) {
9416
+ return callback(new Error("file data overflows file bounds: " +
9417
+ fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize));
9418
+ }
9419
+ }
9420
+ var readStream = self.reader.createReadStream({
9421
+ start: fileDataStart + relativeStart,
9422
+ end: fileDataStart + relativeEnd,
9423
+ });
9424
+ var endpointStream = readStream;
9425
+ if (decompress) {
9426
+ var destroyed = false;
9427
+ var inflateFilter = zlib.createInflateRaw();
9428
+ readStream.on("error", function(err) {
9429
+ // setImmediate here because errors can be emitted during the first call to pipe()
9430
+ setImmediate(function() {
9431
+ if (!destroyed) inflateFilter.emit("error", err);
9432
+ });
9433
+ });
9434
+ readStream.pipe(inflateFilter);
9435
+
9436
+ if (self.validateEntrySizes) {
9437
+ endpointStream = new AssertByteCountStream(entry.uncompressedSize);
9438
+ inflateFilter.on("error", function(err) {
9439
+ // forward zlib errors to the client-visible stream
9440
+ setImmediate(function() {
9441
+ if (!destroyed) endpointStream.emit("error", err);
9442
+ });
9443
+ });
9444
+ inflateFilter.pipe(endpointStream);
9445
+ } else {
9446
+ // the zlib filter is the client-visible stream
9447
+ endpointStream = inflateFilter;
9448
+ }
9449
+ // this is part of yauzl's API, so implement this function on the client-visible stream
9450
+ endpointStream.destroy = function() {
9451
+ destroyed = true;
9452
+ if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream);
9453
+ readStream.unpipe(inflateFilter);
9454
+ // TODO: the inflateFilter may cause a memory leak. see Issue #27.
9455
+ readStream.destroy();
9456
+ };
9457
+ }
9458
+ callback(null, endpointStream);
9459
+ } finally {
9460
+ self.reader.unref();
9461
+ }
9462
+ });
9463
+ };
9464
+
9465
+ function Entry() {
9466
+ }
9467
+ Entry.prototype.getLastModDate = function() {
9468
+ return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime);
9469
+ };
9470
+ Entry.prototype.isEncrypted = function() {
9471
+ return (this.generalPurposeBitFlag & 0x1) !== 0;
9472
+ };
9473
+ Entry.prototype.isCompressed = function() {
9474
+ return this.compressionMethod === 8;
9475
+ };
9476
+
9477
+ function dosDateTimeToDate(date, time) {
9478
+ var day = date & 0x1f; // 1-31
9479
+ var month = (date >> 5 & 0xf) - 1; // 1-12, 0-11
9480
+ var year = (date >> 9 & 0x7f) + 1980; // 0-128, 1980-2108
9481
+
9482
+ var millisecond = 0;
9483
+ var second = (time & 0x1f) * 2; // 0-29, 0-58 (even numbers)
9484
+ var minute = time >> 5 & 0x3f; // 0-59
9485
+ var hour = time >> 11 & 0x1f; // 0-23
9486
+
9487
+ return new Date(year, month, day, hour, minute, second, millisecond);
9488
+ }
9489
+
9490
+ function validateFileName(fileName) {
9491
+ if (fileName.indexOf("\\") !== -1) {
9492
+ return "invalid characters in fileName: " + fileName;
9493
+ }
9494
+ if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) {
9495
+ return "absolute path: " + fileName;
9496
+ }
9497
+ if (fileName.split("/").indexOf("..") !== -1) {
9498
+ return "invalid relative path: " + fileName;
9499
+ }
9500
+ // all good
9501
+ return null;
9502
+ }
9503
+
9504
+ function readAndAssertNoEof(reader, buffer, offset, length, position, callback) {
9505
+ if (length === 0) {
9506
+ // fs.read will throw an out-of-bounds error if you try to read 0 bytes from a 0 byte file
9507
+ return setImmediate(function() { callback(null, newBuffer(0)); });
9508
+ }
9509
+ reader.read(buffer, offset, length, position, function(err, bytesRead) {
9510
+ if (err) return callback(err);
9511
+ if (bytesRead < length) {
9512
+ return callback(new Error("unexpected EOF"));
9513
+ }
9514
+ callback();
9515
+ });
9516
+ }
9517
+
9518
+ util.inherits(AssertByteCountStream, Transform);
9519
+ function AssertByteCountStream(byteCount) {
9520
+ Transform.call(this);
9521
+ this.actualByteCount = 0;
9522
+ this.expectedByteCount = byteCount;
9523
+ }
9524
+ AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) {
9525
+ this.actualByteCount += chunk.length;
9526
+ if (this.actualByteCount > this.expectedByteCount) {
9527
+ var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount;
9528
+ return cb(new Error(msg));
9529
+ }
9530
+ cb(null, chunk);
9531
+ };
9532
+ AssertByteCountStream.prototype._flush = function(cb) {
9533
+ if (this.actualByteCount < this.expectedByteCount) {
9534
+ var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount;
9535
+ return cb(new Error(msg));
9536
+ }
9537
+ cb();
9538
+ };
9539
+
9540
+ util.inherits(RandomAccessReader, EventEmitter);
9541
+ function RandomAccessReader() {
9542
+ EventEmitter.call(this);
9543
+ this.refCount = 0;
9544
+ }
9545
+ RandomAccessReader.prototype.ref = function() {
9546
+ this.refCount += 1;
9547
+ };
9548
+ RandomAccessReader.prototype.unref = function() {
9549
+ var self = this;
9550
+ self.refCount -= 1;
9551
+
9552
+ if (self.refCount > 0) return;
9553
+ if (self.refCount < 0) throw new Error("invalid unref");
9554
+
9555
+ self.close(onCloseDone);
9556
+
9557
+ function onCloseDone(err) {
9558
+ if (err) return self.emit('error', err);
9559
+ self.emit('close');
9560
+ }
9561
+ };
9562
+ RandomAccessReader.prototype.createReadStream = function(options) {
9563
+ var start = options.start;
9564
+ var end = options.end;
9565
+ if (start === end) {
9566
+ var emptyStream = new PassThrough();
9567
+ setImmediate(function() {
9568
+ emptyStream.end();
9569
+ });
9570
+ return emptyStream;
9571
+ }
9572
+ var stream = this._readStreamForRange(start, end);
9573
+
9574
+ var destroyed = false;
9575
+ var refUnrefFilter = new RefUnrefFilter(this);
9576
+ stream.on("error", function(err) {
9577
+ setImmediate(function() {
9578
+ if (!destroyed) refUnrefFilter.emit("error", err);
9579
+ });
9580
+ });
9581
+ refUnrefFilter.destroy = function() {
9582
+ stream.unpipe(refUnrefFilter);
9583
+ refUnrefFilter.unref();
9584
+ stream.destroy();
9585
+ };
9586
+
9587
+ var byteCounter = new AssertByteCountStream(end - start);
9588
+ refUnrefFilter.on("error", function(err) {
9589
+ setImmediate(function() {
9590
+ if (!destroyed) byteCounter.emit("error", err);
9591
+ });
9592
+ });
9593
+ byteCounter.destroy = function() {
9594
+ destroyed = true;
9595
+ refUnrefFilter.unpipe(byteCounter);
9596
+ refUnrefFilter.destroy();
9597
+ };
9598
+
9599
+ return stream.pipe(refUnrefFilter).pipe(byteCounter);
9600
+ };
9601
+ RandomAccessReader.prototype._readStreamForRange = function(start, end) {
9602
+ throw new Error("not implemented");
9603
+ };
9604
+ RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) {
9605
+ var readStream = this.createReadStream({start: position, end: position + length});
9606
+ var writeStream = new Writable();
9607
+ var written = 0;
9608
+ writeStream._write = function(chunk, encoding, cb) {
9609
+ chunk.copy(buffer, offset + written, 0, chunk.length);
9610
+ written += chunk.length;
9611
+ cb();
9612
+ };
9613
+ writeStream.on("finish", callback);
9614
+ readStream.on("error", function(error) {
9615
+ callback(error);
9616
+ });
9617
+ readStream.pipe(writeStream);
9618
+ };
9619
+ RandomAccessReader.prototype.close = function(callback) {
9620
+ setImmediate(callback);
9621
+ };
9622
+
9623
+ util.inherits(RefUnrefFilter, PassThrough);
9624
+ function RefUnrefFilter(context) {
9625
+ PassThrough.call(this);
9626
+ this.context = context;
9627
+ this.context.ref();
9628
+ this.unreffedYet = false;
9629
+ }
9630
+ RefUnrefFilter.prototype._flush = function(cb) {
9631
+ this.unref();
9632
+ cb();
9633
+ };
9634
+ RefUnrefFilter.prototype.unref = function(cb) {
9635
+ if (this.unreffedYet) return;
9636
+ this.unreffedYet = true;
9637
+ this.context.unref();
9638
+ };
9639
+
9640
+ var cp437 = '\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ';
9641
+ function decodeBuffer(buffer, start, end, isUtf8) {
9642
+ if (isUtf8) {
9643
+ return buffer.toString("utf8", start, end);
9644
+ } else {
9645
+ var result = "";
9646
+ for (var i = start; i < end; i++) {
9647
+ result += cp437[buffer[i]];
9648
+ }
9649
+ return result;
9650
+ }
9651
+ }
9652
+
9653
+ function readUInt64LE(buffer, offset) {
9654
+ // there is no native function for this, because we can't actually store 64-bit integers precisely.
9655
+ // after 53 bits, JavaScript's Number type (IEEE 754 double) can't store individual integers anymore.
9656
+ // but since 53 bits is a whole lot more than 32 bits, we do our best anyway.
9657
+ var lower32 = buffer.readUInt32LE(offset);
9658
+ var upper32 = buffer.readUInt32LE(offset + 4);
9659
+ // we can't use bitshifting here, because JavaScript bitshifting only works on 32-bit integers.
9660
+ return upper32 * 0x100000000 + lower32;
9661
+ // as long as we're bounds checking the result of this function against the total file size,
9662
+ // we'll catch any overflow errors, because we already made sure the total file size was within reason.
9663
+ }
9664
+
9665
+ // Node 10 deprecated new Buffer().
9666
+ var newBuffer;
9667
+ if (typeof Buffer.allocUnsafe === "function") {
9668
+ newBuffer = function(len) {
9669
+ return Buffer.allocUnsafe(len);
9670
+ };
9671
+ } else {
9672
+ newBuffer = function(len) {
9673
+ return new Buffer(len);
9674
+ };
9675
+ }
9676
+
9677
+ function defaultCallback(err) {
9678
+ if (err) throw err;
9679
+ }
9680
+
9681
+
9682
+ /***/ }),
9683
+
9684
+ /***/ 871:
9685
+ /***/ ((module) => {
9686
+
9687
+ "use strict";
9688
+ module.exports = require("buffer");
9689
+
9690
+ /***/ }),
9691
+
9692
+ /***/ 6231:
9693
+ /***/ ((module) => {
9694
+
9695
+ "use strict";
9696
+ module.exports = require("fs");
9697
+
9698
+ /***/ }),
9699
+
9700
+ /***/ 1423:
9701
+ /***/ ((module) => {
9702
+
9703
+ "use strict";
9704
+ module.exports = require("path");
9705
+
7083
9706
  /***/ }),
7084
9707
 
7085
9708
  /***/ 8311:
@@ -7104,6 +9727,22 @@ module.exports = require("string_decoder");
7104
9727
  "use strict";
7105
9728
  module.exports = require("timers");
7106
9729
 
9730
+ /***/ }),
9731
+
9732
+ /***/ 6464:
9733
+ /***/ ((module) => {
9734
+
9735
+ "use strict";
9736
+ module.exports = require("util");
9737
+
9738
+ /***/ }),
9739
+
9740
+ /***/ 8884:
9741
+ /***/ ((module) => {
9742
+
9743
+ "use strict";
9744
+ module.exports = require("zlib");
9745
+
7107
9746
  /***/ })
7108
9747
 
7109
9748
  /******/ });
@@ -7179,18 +9818,23 @@ __webpack_require__.d(__webpack_exports__, {
7179
9818
  "launchSimulator": () => (/* reexport */ launchSimulator)
7180
9819
  });
7181
9820
 
9821
+ ;// CONCATENATED MODULE: external "crypto"
9822
+ const external_crypto_namespaceObject = require("crypto");
7182
9823
  ;// CONCATENATED MODULE: external "fs/promises"
7183
9824
  const promises_namespaceObject = require("fs/promises");
7184
- ;// CONCATENATED MODULE: external "path"
7185
- const external_path_namespaceObject = require("path");
9825
+ // EXTERNAL MODULE: external "path"
9826
+ var external_path_ = __webpack_require__(1423);
7186
9827
  ;// CONCATENATED MODULE: external "./api.cjs"
7187
9828
  const external_api_cjs_namespaceObject = require("./api.cjs");
9829
+ ;// CONCATENATED MODULE: external "./sdk-util.cjs"
9830
+ const external_sdk_util_cjs_namespaceObject = require("./sdk-util.cjs");
7188
9831
  ;// CONCATENATED MODULE: external "./util.cjs"
7189
9832
  const external_util_cjs_namespaceObject = require("./util.cjs");
7190
9833
  ;// CONCATENATED MODULE: ./src/build.js
7191
9834
 
7192
9835
 
7193
9836
 
9837
+
7194
9838
  async function build_project(product, options, lineCallback) {
7195
9839
  const {
7196
9840
  workspace,
@@ -7204,7 +9848,7 @@ async function build_project(product, options, lineCallback) {
7204
9848
  typeCheckLevel,
7205
9849
  returnCommand,
7206
9850
  } = options;
7207
- const sdk = await (0,external_util_cjs_namespaceObject.getSdkPath)();
9851
+ const sdk = await (0,external_sdk_util_cjs_namespaceObject.getSdkPath)();
7208
9852
  let extraArgs = [];
7209
9853
  if (compilerOptions) {
7210
9854
  extraArgs.push(...compilerOptions.split(/\s+/));
@@ -7235,7 +9879,7 @@ async function build_project(product, options, lineCallback) {
7235
9879
  if (product) {
7236
9880
  extraArgs.push("-d", simulatorBuild !== false ? `${product}_sim` : product);
7237
9881
  }
7238
- const exe = external_path_namespaceObject.resolve(sdk, "bin", external_util_cjs_namespaceObject.isWin ? "monkeyc.bat" : "monkeyc");
9882
+ const exe = external_path_.resolve(sdk, "bin", external_sdk_util_cjs_namespaceObject.isWin ? "monkeyc.bat" : "monkeyc");
7239
9883
  const args = [
7240
9884
  ["-o", program],
7241
9885
  ["-f", jungleFiles],
@@ -7245,28 +9889,21 @@ async function build_project(product, options, lineCallback) {
7245
9889
 
7246
9890
  const handlers = [
7247
9891
  lineCallback || ((line) => console.log(line)),
7248
- (line) => {
7249
- if (
7250
- /^WARNING: .*: Source path '.*' cannot be resolved to a valid path./.test(
7251
- line
7252
- )
7253
- ) {
7254
- return;
7255
- }
7256
- console.error(line);
7257
- },
9892
+ (line) => console.error(line),
7258
9893
  ];
7259
9894
  return returnCommand
7260
- ? { exe, args }
9895
+ ? { exe, args, program: external_path_.resolve(workspace, program), product }
7261
9896
  : (0,external_util_cjs_namespaceObject.spawnByLine)(exe, args, handlers, {
7262
9897
  cwd: workspace,
7263
9898
  });
7264
9899
  }
7265
9900
 
7266
- ;// CONCATENATED MODULE: ./build/jungle.js
7267
- function peg$subclass(u,A){function E(){this.constructor=u}E.prototype=A.prototype,u.prototype=new E}function peg$SyntaxError(u,A,E,C){var F=Error.call(this,u);return Object.setPrototypeOf&&Object.setPrototypeOf(F,peg$SyntaxError.prototype),F.expected=A,F.found=E,F.location=C,F.name="SyntaxError",F}function peg$padEnd(u,A,E){return E=E||" ",u.length>A?u:(A-=u.length,u+(E+=E.repeat(A)).slice(0,A))}function peg$parse(u,A){var E,C,F,t,B={},r=(A=void 0!==A?A:{}).grammarSource,e={Jungle:Su},D=Su,n=/^[\n\r\u2028\u2029]/,o=/^[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137-\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148-\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C-\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA-\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9-\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC-\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF-\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F-\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0-\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB-\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE-\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6-\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FC7\u1FD0-\u1FD3\u1FD6-\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6-\u1FF7\u210A\u210E-\u210F\u2113\u212F\u2134\u2139\u213C-\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65-\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73-\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3-\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]/,s=/^[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5-\u06E6\u07F4-\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C-\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D-\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C-\uA69D\uA717-\uA71F\uA770\uA788\uA7F8-\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3-\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E-\uFF9F]/,a=/^[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u09FC\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60-\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0CF1-\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065-\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE-\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5-\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A-\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD-\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,c=/^[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]/,l=/^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178-\u0179\u017B\u017D\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A0\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01AF\u01B1-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A-\u023B\u023D-\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E-\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9-\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0-\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E-\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D-\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A]/,i=/^[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E-\u094F\u0982-\u0983\u09BE-\u09C0\u09C7-\u09C8\u09CB-\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB-\u0ACC\u0B02-\u0B03\u0B3E\u0B40\u0B47-\u0B48\u0B4B-\u0B4C\u0B57\u0BBE-\u0BBF\u0BC1-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82-\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7-\u0CC8\u0CCA-\u0CCB\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82-\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2-\u0DF3\u0F3E-\u0F3F\u0F7F\u102B-\u102C\u1031\u1038\u103B-\u103C\u1056-\u1057\u1062-\u1064\u1067-\u106D\u1083-\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7-\u17C8\u1923-\u1926\u1929-\u192B\u1930-\u1931\u1933-\u1938\u1A19-\u1A1A\u1A55\u1A57\u1A61\u1A63-\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B44\u1B82\u1BA1\u1BA6-\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2-\u1BF3\u1C24-\u1C2B\u1C34-\u1C35\u1CE1\u1CF2-\u1CF3\u1CF7\u302E-\u302F\uA823-\uA824\uA827\uA880-\uA881\uA8B4-\uA8C3\uA952-\uA953\uA983\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BD-\uA9C0\uAA2F-\uAA30\uAA33-\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE-\uAAEF\uAAF5\uABE3-\uABE4\uABE6-\uABE7\uABE9-\uABEA\uABEC]/,f=/^[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2-\u09E3\u09FE\u0A01-\u0A02\u0A3C\u0A41-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A51\u0A70-\u0A71\u0A75\u0A81-\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7-\u0AC8\u0ACD\u0AE2-\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62-\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C62-\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC-\u0CCD\u0CE2-\u0CE3\u0D00-\u0D01\u0D3B-\u0D3C\u0D41-\u0D44\u0D4D\u0D62-\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039-\u103A\u103D-\u103E\u1058-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B4-\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885-\u1886\u18A9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193B\u1A17-\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80-\u1B81\u1BA2-\u1BA5\u1BA8-\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8-\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099-\u309A\uA66F\uA674-\uA67D\uA69E-\uA69F\uA6F0-\uA6F1\uA802\uA806\uA80B\uA825-\uA826\uA8C4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31-\uAA32\uAA35-\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7-\uAAB8\uAABE-\uAABF\uAAC1\uAAEC-\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/,h=/^[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]/,x=/^[\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF]/,p=/^[_\u203F-\u2040\u2054\uFE33-\uFE34\uFE4D-\uFE4F\uFF3F]/,d=/^[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,P={type:"any"},g=Pu("=",!1),v=Pu(".",!1),y=Pu(";",!1),m=Pu("$(",!1),$=Pu(")",!1),S=vu("raw string"),b=vu("quoted string"),w=Pu('"',!1),j=Pu("[",!1),O=Pu("]",!1),R=Pu(" ",!1),_=Pu("\t",!1),L=Pu("\\",!1),z=vu("identifier"),M=Pu("_",!1),Z=Pu("$",!1),k=Pu("-",!1),q=Pu("‌",!1),J=Pu("‍",!1),N=Pu("/",!1),Q=Pu("*",!1),U=vu("whitespace"),G=Pu("\v",!1),H=Pu("\f",!1),I=Pu(" ",!1),K=Pu("\ufeff",!1),T=gu(["\n","\r","\u2028","\u2029"],!1,!1),V=vu("end of line"),W=Pu("\n",!1),X=Pu("\r\n",!1),Y=Pu("\r",!1),uu=Pu("\u2028",!1),Au=Pu("\u2029",!1),Eu=vu("comment"),Cu=Pu("#",!1),Fu=gu([["a","z"],"µ",["ß","ö"],["ø","ÿ"],"ā","ă","ą","ć","ĉ","ċ","č","ď","đ","ē","ĕ","ė","ę","ě","ĝ","ğ","ġ","ģ","ĥ","ħ","ĩ","ī","ĭ","į","ı","ij","ĵ",["ķ","ĸ"],"ĺ","ļ","ľ","ŀ","ł","ń","ņ",["ň","ʼn"],"ŋ","ō","ŏ","ő","œ","ŕ","ŗ","ř","ś","ŝ","ş","š","ţ","ť","ŧ","ũ","ū","ŭ","ů","ű","ų","ŵ","ŷ","ź","ż",["ž","ƀ"],"ƃ","ƅ","ƈ",["ƌ","ƍ"],"ƒ","ƕ",["ƙ","ƛ"],"ƞ","ơ","ƣ","ƥ","ƨ",["ƪ","ƫ"],"ƭ","ư","ƴ","ƶ",["ƹ","ƺ"],["ƽ","ƿ"],"dž","lj","nj","ǎ","ǐ","ǒ","ǔ","ǖ","ǘ","ǚ",["ǜ","ǝ"],"ǟ","ǡ","ǣ","ǥ","ǧ","ǩ","ǫ","ǭ",["ǯ","ǰ"],"dz","ǵ","ǹ","ǻ","ǽ","ǿ","ȁ","ȃ","ȅ","ȇ","ȉ","ȋ","ȍ","ȏ","ȑ","ȓ","ȕ","ȗ","ș","ț","ȝ","ȟ","ȡ","ȣ","ȥ","ȧ","ȩ","ȫ","ȭ","ȯ","ȱ",["ȳ","ȹ"],"ȼ",["ȿ","ɀ"],"ɂ","ɇ","ɉ","ɋ","ɍ",["ɏ","ʓ"],["ʕ","ʯ"],"ͱ","ͳ","ͷ",["ͻ","ͽ"],"ΐ",["ά","ώ"],["ϐ","ϑ"],["ϕ","ϗ"],"ϙ","ϛ","ϝ","ϟ","ϡ","ϣ","ϥ","ϧ","ϩ","ϫ","ϭ",["ϯ","ϳ"],"ϵ","ϸ",["ϻ","ϼ"],["а","џ"],"ѡ","ѣ","ѥ","ѧ","ѩ","ѫ","ѭ","ѯ","ѱ","ѳ","ѵ","ѷ","ѹ","ѻ","ѽ","ѿ","ҁ","ҋ","ҍ","ҏ","ґ","ғ","ҕ","җ","ҙ","қ","ҝ","ҟ","ҡ","ң","ҥ","ҧ","ҩ","ҫ","ҭ","ү","ұ","ҳ","ҵ","ҷ","ҹ","һ","ҽ","ҿ","ӂ","ӄ","ӆ","ӈ","ӊ","ӌ",["ӎ","ӏ"],"ӑ","ӓ","ӕ","ӗ","ә","ӛ","ӝ","ӟ","ӡ","ӣ","ӥ","ӧ","ө","ӫ","ӭ","ӯ","ӱ","ӳ","ӵ","ӷ","ӹ","ӻ","ӽ","ӿ","ԁ","ԃ","ԅ","ԇ","ԉ","ԋ","ԍ","ԏ","ԑ","ԓ","ԕ","ԗ","ԙ","ԛ","ԝ","ԟ","ԡ","ԣ","ԥ","ԧ","ԩ","ԫ","ԭ","ԯ",["ՠ","ֈ"],["ა","ჺ"],["ჽ","ჿ"],["ᏸ","ᏽ"],["ᲀ","ᲈ"],["ᴀ","ᴫ"],["ᵫ","ᵷ"],["ᵹ","ᶚ"],"ḁ","ḃ","ḅ","ḇ","ḉ","ḋ","ḍ","ḏ","ḑ","ḓ","ḕ","ḗ","ḙ","ḛ","ḝ","ḟ","ḡ","ḣ","ḥ","ḧ","ḩ","ḫ","ḭ","ḯ","ḱ","ḳ","ḵ","ḷ","ḹ","ḻ","ḽ","ḿ","ṁ","ṃ","ṅ","ṇ","ṉ","ṋ","ṍ","ṏ","ṑ","ṓ","ṕ","ṗ","ṙ","ṛ","ṝ","ṟ","ṡ","ṣ","ṥ","ṧ","ṩ","ṫ","ṭ","ṯ","ṱ","ṳ","ṵ","ṷ","ṹ","ṻ","ṽ","ṿ","ẁ","ẃ","ẅ","ẇ","ẉ","ẋ","ẍ","ẏ","ẑ","ẓ",["ẕ","ẝ"],"ẟ","ạ","ả","ấ","ầ","ẩ","ẫ","ậ","ắ","ằ","ẳ","ẵ","ặ","ẹ","ẻ","ẽ","ế","ề","ể","ễ","ệ","ỉ","ị","ọ","ỏ","ố","ồ","ổ","ỗ","ộ","ớ","ờ","ở","ỡ","ợ","ụ","ủ","ứ","ừ","ử","ữ","ự","ỳ","ỵ","ỷ","ỹ","ỻ","ỽ",["ỿ","ἇ"],["ἐ","ἕ"],["ἠ","ἧ"],["ἰ","ἷ"],["ὀ","ὅ"],["ὐ","ὗ"],["ὠ","ὧ"],["ὰ","ώ"],["ᾀ","ᾇ"],["ᾐ","ᾗ"],["ᾠ","ᾧ"],["ᾰ","ᾴ"],["ᾶ","ᾷ"],"ι",["ῂ","ῄ"],["ῆ","ῇ"],["ῐ","ΐ"],["ῖ","ῗ"],["ῠ","ῧ"],["ῲ","ῴ"],["ῶ","ῷ"],"ℊ",["ℎ","ℏ"],"ℓ","ℯ","ℴ","ℹ",["ℼ","ℽ"],["ⅆ","ⅉ"],"ⅎ","ↄ",["ⰰ","ⱞ"],"ⱡ",["ⱥ","ⱦ"],"ⱨ","ⱪ","ⱬ","ⱱ",["ⱳ","ⱴ"],["ⱶ","ⱻ"],"ⲁ","ⲃ","ⲅ","ⲇ","ⲉ","ⲋ","ⲍ","ⲏ","ⲑ","ⲓ","ⲕ","ⲗ","ⲙ","ⲛ","ⲝ","ⲟ","ⲡ","ⲣ","ⲥ","ⲧ","ⲩ","ⲫ","ⲭ","ⲯ","ⲱ","ⲳ","ⲵ","ⲷ","ⲹ","ⲻ","ⲽ","ⲿ","ⳁ","ⳃ","ⳅ","ⳇ","ⳉ","ⳋ","ⳍ","ⳏ","ⳑ","ⳓ","ⳕ","ⳗ","ⳙ","ⳛ","ⳝ","ⳟ","ⳡ",["ⳣ","ⳤ"],"ⳬ","ⳮ","ⳳ",["ⴀ","ⴥ"],"ⴧ","ⴭ","ꙁ","ꙃ","ꙅ","ꙇ","ꙉ","ꙋ","ꙍ","ꙏ","ꙑ","ꙓ","ꙕ","ꙗ","ꙙ","ꙛ","ꙝ","ꙟ","ꙡ","ꙣ","ꙥ","ꙧ","ꙩ","ꙫ","ꙭ","ꚁ","ꚃ","ꚅ","ꚇ","ꚉ","ꚋ","ꚍ","ꚏ","ꚑ","ꚓ","ꚕ","ꚗ","ꚙ","ꚛ","ꜣ","ꜥ","ꜧ","ꜩ","ꜫ","ꜭ",["ꜯ","ꜱ"],"ꜳ","ꜵ","ꜷ","ꜹ","ꜻ","ꜽ","ꜿ","ꝁ","ꝃ","ꝅ","ꝇ","ꝉ","ꝋ","ꝍ","ꝏ","ꝑ","ꝓ","ꝕ","ꝗ","ꝙ","ꝛ","ꝝ","ꝟ","ꝡ","ꝣ","ꝥ","ꝧ","ꝩ","ꝫ","ꝭ","ꝯ",["ꝱ","ꝸ"],"ꝺ","ꝼ","ꝿ","ꞁ","ꞃ","ꞅ","ꞇ","ꞌ","ꞎ","ꞑ",["ꞓ","ꞕ"],"ꞗ","ꞙ","ꞛ","ꞝ","ꞟ","ꞡ","ꞣ","ꞥ","ꞧ","ꞩ","ꞯ","ꞵ","ꞷ","ꞹ","ꟺ",["ꬰ","ꭚ"],["ꭠ","ꭥ"],["ꭰ","ꮿ"],["ff","st"],["ﬓ","ﬗ"],["a","z"]],!1,!1),tu=gu([["ʰ","ˁ"],["ˆ","ˑ"],["ˠ","ˤ"],"ˬ","ˮ","ʹ","ͺ","ՙ","ـ",["ۥ","ۦ"],["ߴ","ߵ"],"ߺ","ࠚ","ࠤ","ࠨ","ॱ","ๆ","ໆ","ჼ","ៗ","ᡃ","ᪧ",["ᱸ","ᱽ"],["ᴬ","ᵪ"],"ᵸ",["ᶛ","ᶿ"],"ⁱ","ⁿ",["ₐ","ₜ"],["ⱼ","ⱽ"],"ⵯ","ⸯ","々",["〱","〵"],"〻",["ゝ","ゞ"],["ー","ヾ"],"ꀕ",["ꓸ","ꓽ"],"ꘌ","ꙿ",["ꚜ","ꚝ"],["ꜗ","ꜟ"],"ꝰ","ꞈ",["ꟸ","ꟹ"],"ꧏ","ꧦ","ꩰ","ꫝ",["ꫳ","ꫴ"],["ꭜ","ꭟ"],"ー",["゙","゚"]],!1,!1),Bu=gu(["ª","º","ƻ",["ǀ","ǃ"],"ʔ",["א","ת"],["ׯ","ײ"],["ؠ","ؿ"],["ف","ي"],["ٮ","ٯ"],["ٱ","ۓ"],"ە",["ۮ","ۯ"],["ۺ","ۼ"],"ۿ","ܐ",["ܒ","ܯ"],["ݍ","ޥ"],"ޱ",["ߊ","ߪ"],["ࠀ","ࠕ"],["ࡀ","ࡘ"],["ࡠ","ࡪ"],["ࢠ","ࢴ"],["ࢶ","ࢽ"],["ऄ","ह"],"ऽ","ॐ",["क़","ॡ"],["ॲ","ঀ"],["অ","ঌ"],["এ","ঐ"],["ও","ন"],["প","র"],"ল",["শ","হ"],"ঽ","ৎ",["ড়","ঢ়"],["য়","ৡ"],["ৰ","ৱ"],"ৼ",["ਅ","ਊ"],["ਏ","ਐ"],["ਓ","ਨ"],["ਪ","ਰ"],["ਲ","ਲ਼"],["ਵ","ਸ਼"],["ਸ","ਹ"],["ਖ਼","ੜ"],"ਫ਼",["ੲ","ੴ"],["અ","ઍ"],["એ","ઑ"],["ઓ","ન"],["પ","ર"],["લ","ળ"],["વ","હ"],"ઽ","ૐ",["ૠ","ૡ"],"ૹ",["ଅ","ଌ"],["ଏ","ଐ"],["ଓ","ନ"],["ପ","ର"],["ଲ","ଳ"],["ଵ","ହ"],"ଽ",["ଡ଼","ଢ଼"],["ୟ","ୡ"],"ୱ","ஃ",["அ","ஊ"],["எ","ஐ"],["ஒ","க"],["ங","ச"],"ஜ",["ஞ","ட"],["ண","த"],["ந","ப"],["ம","ஹ"],"ௐ",["అ","ఌ"],["ఎ","ఐ"],["ఒ","న"],["ప","హ"],"ఽ",["ౘ","ౚ"],["ౠ","ౡ"],"ಀ",["ಅ","ಌ"],["ಎ","ಐ"],["ಒ","ನ"],["ಪ","ಳ"],["ವ","ಹ"],"ಽ","ೞ",["ೠ","ೡ"],["ೱ","ೲ"],["അ","ഌ"],["എ","ഐ"],["ഒ","ഺ"],"ഽ","ൎ",["ൔ","ൖ"],["ൟ","ൡ"],["ൺ","ൿ"],["අ","ඖ"],["ක","න"],["ඳ","ර"],"ල",["ව","ෆ"],["ก","ะ"],["า","ำ"],["เ","ๅ"],["ກ","ຂ"],"ຄ",["ງ","ຈ"],"ຊ","ຍ",["ດ","ທ"],["ນ","ຟ"],["ມ","ຣ"],"ລ","ວ",["ສ","ຫ"],["ອ","ະ"],["າ","ຳ"],"ຽ",["ເ","ໄ"],["ໜ","ໟ"],"ༀ",["ཀ","ཇ"],["ཉ","ཬ"],["ྈ","ྌ"],["က","ဪ"],"ဿ",["ၐ","ၕ"],["ၚ","ၝ"],"ၡ",["ၥ","ၦ"],["ၮ","ၰ"],["ၵ","ႁ"],"ႎ",["ᄀ","ቈ"],["ቊ","ቍ"],["ቐ","ቖ"],"ቘ",["ቚ","ቝ"],["በ","ኈ"],["ኊ","ኍ"],["ነ","ኰ"],["ኲ","ኵ"],["ኸ","ኾ"],"ዀ",["ዂ","ዅ"],["ወ","ዖ"],["ዘ","ጐ"],["ጒ","ጕ"],["ጘ","ፚ"],["ᎀ","ᎏ"],["ᐁ","ᙬ"],["ᙯ","ᙿ"],["ᚁ","ᚚ"],["ᚠ","ᛪ"],["ᛱ","ᛸ"],["ᜀ","ᜌ"],["ᜎ","ᜑ"],["ᜠ","ᜱ"],["ᝀ","ᝑ"],["ᝠ","ᝬ"],["ᝮ","ᝰ"],["ក","ឳ"],"ៜ",["ᠠ","ᡂ"],["ᡄ","ᡸ"],["ᢀ","ᢄ"],["ᢇ","ᢨ"],"ᢪ",["ᢰ","ᣵ"],["ᤀ","ᤞ"],["ᥐ","ᥭ"],["ᥰ","ᥴ"],["ᦀ","ᦫ"],["ᦰ","ᧉ"],["ᨀ","ᨖ"],["ᨠ","ᩔ"],["ᬅ","ᬳ"],["ᭅ","ᭋ"],["ᮃ","ᮠ"],["ᮮ","ᮯ"],["ᮺ","ᯥ"],["ᰀ","ᰣ"],["ᱍ","ᱏ"],["ᱚ","ᱷ"],["ᳩ","ᳬ"],["ᳮ","ᳱ"],["ᳵ","ᳶ"],["ℵ","ℸ"],["ⴰ","ⵧ"],["ⶀ","ⶖ"],["ⶠ","ⶦ"],["ⶨ","ⶮ"],["ⶰ","ⶶ"],["ⶸ","ⶾ"],["ⷀ","ⷆ"],["ⷈ","ⷎ"],["ⷐ","ⷖ"],["ⷘ","ⷞ"],"〆","〼",["ぁ","ゖ"],"ゟ",["ァ","ヺ"],"ヿ",["ㄅ","ㄯ"],["ㄱ","ㆎ"],["ㆠ","ㆺ"],["ㇰ","ㇿ"],["㐀","䶵"],["一","鿯"],["ꀀ","ꀔ"],["ꀖ","ꒌ"],["ꓐ","ꓷ"],["ꔀ","ꘋ"],["ꘐ","ꘟ"],["ꘪ","ꘫ"],"ꙮ",["ꚠ","ꛥ"],"ꞏ","ꟷ",["ꟻ","ꠁ"],["ꠃ","ꠅ"],["ꠇ","ꠊ"],["ꠌ","ꠢ"],["ꡀ","ꡳ"],["ꢂ","ꢳ"],["ꣲ","ꣷ"],"ꣻ",["ꣽ","ꣾ"],["ꤊ","ꤥ"],["ꤰ","ꥆ"],["ꥠ","ꥼ"],["ꦄ","ꦲ"],["ꧠ","ꧤ"],["ꧧ","ꧯ"],["ꧺ","ꧾ"],["ꨀ","ꨨ"],["ꩀ","ꩂ"],["ꩄ","ꩋ"],["ꩠ","ꩯ"],["ꩱ","ꩶ"],"ꩺ",["ꩾ","ꪯ"],"ꪱ",["ꪵ","ꪶ"],["ꪹ","ꪽ"],"ꫀ","ꫂ",["ꫛ","ꫜ"],["ꫠ","ꫪ"],"ꫲ",["ꬁ","ꬆ"],["ꬉ","ꬎ"],["ꬑ","ꬖ"],["ꬠ","ꬦ"],["ꬨ","ꬮ"],["ꯀ","ꯢ"],["가","힣"],["ힰ","ퟆ"],["ퟋ","ퟻ"],["豈","舘"],["並","龎"],"יִ",["ײַ","ﬨ"],["שׁ","זּ"],["טּ","לּ"],"מּ",["נּ","סּ"],["ףּ","פּ"],["צּ","ﮱ"],["ﯓ","ﴽ"],["ﵐ","ﶏ"],["ﶒ","ﷇ"],["ﷰ","ﷻ"],["ﹰ","ﹴ"],["ﹶ","ﻼ"],["ヲ","ッ"],["ア","ン"],["ᅠ","ᄒ"],["ᅡ","ᅦ"],["ᅧ","ᅬ"],["ᅭ","ᅲ"],["ᅳ","ᅵ"]],!1,!1),ru=gu(["Dž","Lj","Nj","Dz",["ᾈ","ᾏ"],["ᾘ","ᾟ"],["ᾨ","ᾯ"],"ᾼ","ῌ","ῼ"],!1,!1),eu=gu([["A","Z"],["À","Ö"],["Ø","Þ"],"Ā","Ă","Ą","Ć","Ĉ","Ċ","Č","Ď","Đ","Ē","Ĕ","Ė","Ę","Ě","Ĝ","Ğ","Ġ","Ģ","Ĥ","Ħ","Ĩ","Ī","Ĭ","Į","İ","IJ","Ĵ","Ķ","Ĺ","Ļ","Ľ","Ŀ","Ł","Ń","Ņ","Ň","Ŋ","Ō","Ŏ","Ő","Œ","Ŕ","Ŗ","Ř","Ś","Ŝ","Ş","Š","Ţ","Ť","Ŧ","Ũ","Ū","Ŭ","Ů","Ű","Ų","Ŵ","Ŷ",["Ÿ","Ź"],"Ż","Ž",["Ɓ","Ƃ"],"Ƅ",["Ɔ","Ƈ"],["Ɖ","Ƌ"],["Ǝ","Ƒ"],["Ɠ","Ɣ"],["Ɩ","Ƙ"],["Ɯ","Ɲ"],["Ɵ","Ơ"],"Ƣ","Ƥ",["Ʀ","Ƨ"],"Ʃ","Ƭ",["Ʈ","Ư"],["Ʊ","Ƴ"],"Ƶ",["Ʒ","Ƹ"],"Ƽ","DŽ","LJ","NJ","Ǎ","Ǐ","Ǒ","Ǔ","Ǖ","Ǘ","Ǚ","Ǜ","Ǟ","Ǡ","Ǣ","Ǥ","Ǧ","Ǩ","Ǫ","Ǭ","Ǯ","DZ","Ǵ",["Ƕ","Ǹ"],"Ǻ","Ǽ","Ǿ","Ȁ","Ȃ","Ȅ","Ȇ","Ȉ","Ȋ","Ȍ","Ȏ","Ȑ","Ȓ","Ȕ","Ȗ","Ș","Ț","Ȝ","Ȟ","Ƞ","Ȣ","Ȥ","Ȧ","Ȩ","Ȫ","Ȭ","Ȯ","Ȱ","Ȳ",["Ⱥ","Ȼ"],["Ƚ","Ⱦ"],"Ɂ",["Ƀ","Ɇ"],"Ɉ","Ɋ","Ɍ","Ɏ","Ͱ","Ͳ","Ͷ","Ϳ","Ά",["Έ","Ί"],"Ό",["Ύ","Ώ"],["Α","Ρ"],["Σ","Ϋ"],"Ϗ",["ϒ","ϔ"],"Ϙ","Ϛ","Ϝ","Ϟ","Ϡ","Ϣ","Ϥ","Ϧ","Ϩ","Ϫ","Ϭ","Ϯ","ϴ","Ϸ",["Ϲ","Ϻ"],["Ͻ","Я"],"Ѡ","Ѣ","Ѥ","Ѧ","Ѩ","Ѫ","Ѭ","Ѯ","Ѱ","Ѳ","Ѵ","Ѷ","Ѹ","Ѻ","Ѽ","Ѿ","Ҁ","Ҋ","Ҍ","Ҏ","Ґ","Ғ","Ҕ","Җ","Ҙ","Қ","Ҝ","Ҟ","Ҡ","Ң","Ҥ","Ҧ","Ҩ","Ҫ","Ҭ","Ү","Ұ","Ҳ","Ҵ","Ҷ","Ҹ","Һ","Ҽ","Ҿ",["Ӏ","Ӂ"],"Ӄ","Ӆ","Ӈ","Ӊ","Ӌ","Ӎ","Ӑ","Ӓ","Ӕ","Ӗ","Ә","Ӛ","Ӝ","Ӟ","Ӡ","Ӣ","Ӥ","Ӧ","Ө","Ӫ","Ӭ","Ӯ","Ӱ","Ӳ","Ӵ","Ӷ","Ӹ","Ӻ","Ӽ","Ӿ","Ԁ","Ԃ","Ԅ","Ԇ","Ԉ","Ԋ","Ԍ","Ԏ","Ԑ","Ԓ","Ԕ","Ԗ","Ԙ","Ԛ","Ԝ","Ԟ","Ԡ","Ԣ","Ԥ","Ԧ","Ԩ","Ԫ","Ԭ","Ԯ",["Ա","Ֆ"],["Ⴀ","Ⴥ"],"Ⴧ","Ⴭ",["Ꭰ","Ᏽ"],["Ა","Ჺ"],["Ჽ","Ჿ"],"Ḁ","Ḃ","Ḅ","Ḇ","Ḉ","Ḋ","Ḍ","Ḏ","Ḑ","Ḓ","Ḕ","Ḗ","Ḙ","Ḛ","Ḝ","Ḟ","Ḡ","Ḣ","Ḥ","Ḧ","Ḩ","Ḫ","Ḭ","Ḯ","Ḱ","Ḳ","Ḵ","Ḷ","Ḹ","Ḻ","Ḽ","Ḿ","Ṁ","Ṃ","Ṅ","Ṇ","Ṉ","Ṋ","Ṍ","Ṏ","Ṑ","Ṓ","Ṕ","Ṗ","Ṙ","Ṛ","Ṝ","Ṟ","Ṡ","Ṣ","Ṥ","Ṧ","Ṩ","Ṫ","Ṭ","Ṯ","Ṱ","Ṳ","Ṵ","Ṷ","Ṹ","Ṻ","Ṽ","Ṿ","Ẁ","Ẃ","Ẅ","Ẇ","Ẉ","Ẋ","Ẍ","Ẏ","Ẑ","Ẓ","Ẕ","ẞ","Ạ","Ả","Ấ","Ầ","Ẩ","Ẫ","Ậ","Ắ","Ằ","Ẳ","Ẵ","Ặ","Ẹ","Ẻ","Ẽ","Ế","Ề","Ể","Ễ","Ệ","Ỉ","Ị","Ọ","Ỏ","Ố","Ồ","Ổ","Ỗ","Ộ","Ớ","Ờ","Ở","Ỡ","Ợ","Ụ","Ủ","Ứ","Ừ","Ử","Ữ","Ự","Ỳ","Ỵ","Ỷ","Ỹ","Ỻ","Ỽ","Ỿ",["Ἀ","Ἇ"],["Ἐ","Ἕ"],["Ἠ","Ἧ"],["Ἰ","Ἷ"],["Ὀ","Ὅ"],"Ὑ","Ὓ","Ὕ","Ὗ",["Ὠ","Ὧ"],["Ᾰ","Ά"],["Ὲ","Ή"],["Ῐ","Ί"],["Ῠ","Ῥ"],["Ὸ","Ώ"],"ℂ","ℇ",["ℋ","ℍ"],["ℐ","ℒ"],"ℕ",["ℙ","ℝ"],"ℤ","Ω","ℨ",["K","ℭ"],["ℰ","ℳ"],["ℾ","ℿ"],"ⅅ","Ↄ",["Ⰰ","Ⱞ"],"Ⱡ",["Ɫ","Ɽ"],"Ⱨ","Ⱪ","Ⱬ",["Ɑ","Ɒ"],"Ⱳ","Ⱶ",["Ȿ","Ⲁ"],"Ⲃ","Ⲅ","Ⲇ","Ⲉ","Ⲋ","Ⲍ","Ⲏ","Ⲑ","Ⲓ","Ⲕ","Ⲗ","Ⲙ","Ⲛ","Ⲝ","Ⲟ","Ⲡ","Ⲣ","Ⲥ","Ⲧ","Ⲩ","Ⲫ","Ⲭ","Ⲯ","Ⲱ","Ⲳ","Ⲵ","Ⲷ","Ⲹ","Ⲻ","Ⲽ","Ⲿ","Ⳁ","Ⳃ","Ⳅ","Ⳇ","Ⳉ","Ⳋ","Ⳍ","Ⳏ","Ⳑ","Ⳓ","Ⳕ","Ⳗ","Ⳙ","Ⳛ","Ⳝ","Ⳟ","Ⳡ","Ⳣ","Ⳬ","Ⳮ","Ⳳ","Ꙁ","Ꙃ","Ꙅ","Ꙇ","Ꙉ","Ꙋ","Ꙍ","Ꙏ","Ꙑ","Ꙓ","Ꙕ","Ꙗ","Ꙙ","Ꙛ","Ꙝ","Ꙟ","Ꙡ","Ꙣ","Ꙥ","Ꙧ","Ꙩ","Ꙫ","Ꙭ","Ꚁ","Ꚃ","Ꚅ","Ꚇ","Ꚉ","Ꚋ","Ꚍ","Ꚏ","Ꚑ","Ꚓ","Ꚕ","Ꚗ","Ꚙ","Ꚛ","Ꜣ","Ꜥ","Ꜧ","Ꜩ","Ꜫ","Ꜭ","Ꜯ","Ꜳ","Ꜵ","Ꜷ","Ꜹ","Ꜻ","Ꜽ","Ꜿ","Ꝁ","Ꝃ","Ꝅ","Ꝇ","Ꝉ","Ꝋ","Ꝍ","Ꝏ","Ꝑ","Ꝓ","Ꝕ","Ꝗ","Ꝙ","Ꝛ","Ꝝ","Ꝟ","Ꝡ","Ꝣ","Ꝥ","Ꝧ","Ꝩ","Ꝫ","Ꝭ","Ꝯ","Ꝺ","Ꝼ",["Ᵹ","Ꝿ"],"Ꞁ","Ꞃ","Ꞅ","Ꞇ","Ꞌ","Ɥ","Ꞑ","Ꞓ","Ꞗ","Ꞙ","Ꞛ","Ꞝ","Ꞟ","Ꞡ","Ꞣ","Ꞥ","Ꞧ","Ꞩ",["Ɦ","Ɪ"],["Ʞ","Ꞵ"],"Ꞷ","Ꞹ",["A","Z"]],!1,!1),Du=gu(["ः","ऻ",["ा","ी"],["ॉ","ौ"],["ॎ","ॏ"],["ং","ঃ"],["া","ী"],["ে","ৈ"],["ো","ৌ"],"ৗ","ਃ",["ਾ","ੀ"],"ઃ",["ા","ી"],"ૉ",["ો","ૌ"],["ଂ","ଃ"],"ା","ୀ",["େ","ୈ"],["ୋ","ୌ"],"ୗ",["ா","ி"],["ு","ூ"],["ெ","ை"],["ொ","ௌ"],"ௗ",["ఁ","ః"],["ు","ౄ"],["ಂ","ಃ"],"ಾ",["ೀ","ೄ"],["ೇ","ೈ"],["ೊ","ೋ"],["ೕ","ೖ"],["ം","ഃ"],["ാ","ീ"],["െ","ൈ"],["ൊ","ൌ"],"ൗ",["ං","ඃ"],["ා","ෑ"],["ෘ","ෟ"],["ෲ","ෳ"],["༾","༿"],"ཿ",["ါ","ာ"],"ေ","း",["ျ","ြ"],["ၖ","ၗ"],["ၢ","ၤ"],["ၧ","ၭ"],["ႃ","ႄ"],["ႇ","ႌ"],"ႏ",["ႚ","ႜ"],"ា",["ើ","ៅ"],["ះ","ៈ"],["ᤣ","ᤦ"],["ᤩ","ᤫ"],["ᤰ","ᤱ"],["ᤳ","ᤸ"],["ᨙ","ᨚ"],"ᩕ","ᩗ","ᩡ",["ᩣ","ᩤ"],["ᩭ","ᩲ"],"ᬄ","ᬵ","ᬻ",["ᬽ","ᭁ"],["ᭃ","᭄"],"ᮂ","ᮡ",["ᮦ","ᮧ"],"᮪","ᯧ",["ᯪ","ᯬ"],"ᯮ",["᯲","᯳"],["ᰤ","ᰫ"],["ᰴ","ᰵ"],"᳡",["ᳲ","ᳳ"],"᳷",["〮","〯"],["ꠣ","ꠤ"],"ꠧ",["ꢀ","ꢁ"],["ꢴ","ꣃ"],["ꥒ","꥓"],"ꦃ",["ꦴ","ꦵ"],["ꦺ","ꦻ"],["ꦽ","꧀"],["ꨯ","ꨰ"],["ꨳ","ꨴ"],"ꩍ","ꩻ","ꩽ","ꫫ",["ꫮ","ꫯ"],"ꫵ",["ꯣ","ꯤ"],["ꯦ","ꯧ"],["ꯩ","ꯪ"],"꯬"],!1,!1),nu=gu([["̀","ͯ"],["҃","҇"],["֑","ֽ"],"ֿ",["ׁ","ׂ"],["ׄ","ׅ"],"ׇ",["ؐ","ؚ"],["ً","ٟ"],"ٰ",["ۖ","ۜ"],["۟","ۤ"],["ۧ","ۨ"],["۪","ۭ"],"ܑ",["ܰ","݊"],["ަ","ް"],["߫","߳"],"߽",["ࠖ","࠙"],["ࠛ","ࠣ"],["ࠥ","ࠧ"],["ࠩ","࠭"],["࡙","࡛"],["࣓","࣡"],["ࣣ","ं"],"ऺ","़",["ु","ै"],"्",["॑","ॗ"],["ॢ","ॣ"],"ঁ","়",["ু","ৄ"],"্",["ৢ","ৣ"],"৾",["ਁ","ਂ"],"਼",["ੁ","ੂ"],["ੇ","ੈ"],["ੋ","੍"],"ੑ",["ੰ","ੱ"],"ੵ",["ઁ","ં"],"઼",["ુ","ૅ"],["ે","ૈ"],"્",["ૢ","ૣ"],["ૺ","૿"],"ଁ","଼","ି",["ୁ","ୄ"],"୍","ୖ",["ୢ","ୣ"],"ஂ","ீ","்","ఀ","ఄ",["ా","ీ"],["ె","ై"],["ొ","్"],["ౕ","ౖ"],["ౢ","ౣ"],"ಁ","಼","ಿ","ೆ",["ೌ","್"],["ೢ","ೣ"],["ഀ","ഁ"],["഻","഼"],["ു","ൄ"],"്",["ൢ","ൣ"],"්",["ි","ු"],"ූ","ั",["ิ","ฺ"],["็","๎"],"ັ",["ິ","ູ"],["ົ","ຼ"],["່","ໍ"],["༘","༙"],"༵","༷","༹",["ཱ","ཾ"],["ྀ","྄"],["྆","྇"],["ྍ","ྗ"],["ྙ","ྼ"],"࿆",["ိ","ူ"],["ဲ","့"],["္","်"],["ွ","ှ"],["ၘ","ၙ"],["ၞ","ၠ"],["ၱ","ၴ"],"ႂ",["ႅ","ႆ"],"ႍ","ႝ",["፝","፟"],["ᜒ","᜔"],["ᜲ","᜴"],["ᝒ","ᝓ"],["ᝲ","ᝳ"],["឴","឵"],["ិ","ួ"],"ំ",["៉","៓"],"៝",["᠋","᠍"],["ᢅ","ᢆ"],"ᢩ",["ᤠ","ᤢ"],["ᤧ","ᤨ"],"ᤲ",["᤹","᤻"],["ᨗ","ᨘ"],"ᨛ","ᩖ",["ᩘ","ᩞ"],"᩠","ᩢ",["ᩥ","ᩬ"],["ᩳ","᩼"],"᩿",["᪰","᪽"],["ᬀ","ᬃ"],"᬴",["ᬶ","ᬺ"],"ᬼ","ᭂ",["᭫","᭳"],["ᮀ","ᮁ"],["ᮢ","ᮥ"],["ᮨ","ᮩ"],["᮫","ᮭ"],"᯦",["ᯨ","ᯩ"],"ᯭ",["ᯯ","ᯱ"],["ᰬ","ᰳ"],["ᰶ","᰷"],["᳐","᳒"],["᳔","᳠"],["᳢","᳨"],"᳭","᳴",["᳸","᳹"],["᷀","᷹"],["᷻","᷿"],["⃐","⃜"],"⃡",["⃥","⃰"],["⳯","⳱"],"⵿",["ⷠ","ⷿ"],["〪","〭"],["゙","゚"],"꙯",["ꙴ","꙽"],["ꚞ","ꚟ"],["꛰","꛱"],"ꠂ","꠆","ꠋ",["ꠥ","ꠦ"],["꣄","ꣅ"],["꣠","꣱"],"ꣿ",["ꤦ","꤭"],["ꥇ","ꥑ"],["ꦀ","ꦂ"],"꦳",["ꦶ","ꦹ"],"ꦼ","ꧥ",["ꨩ","ꨮ"],["ꨱ","ꨲ"],["ꨵ","ꨶ"],"ꩃ","ꩌ","ꩼ","ꪰ",["ꪲ","ꪴ"],["ꪷ","ꪸ"],["ꪾ","꪿"],"꫁",["ꫬ","ꫭ"],"꫶","ꯥ","ꯨ","꯭","ﬞ",["︀","️"],["︠","︯"]],!1,!1),ou=gu([["0","9"],["٠","٩"],["۰","۹"],["߀","߉"],["०","९"],["০","৯"],["੦","੯"],["૦","૯"],["୦","୯"],["௦","௯"],["౦","౯"],["೦","೯"],["൦","൯"],["෦","෯"],["๐","๙"],["໐","໙"],["༠","༩"],["၀","၉"],["႐","႙"],["០","៩"],["᠐","᠙"],["᥆","᥏"],["᧐","᧙"],["᪀","᪉"],["᪐","᪙"],["᭐","᭙"],["᮰","᮹"],["᱀","᱉"],["᱐","᱙"],["꘠","꘩"],["꣐","꣙"],["꤀","꤉"],["꧐","꧙"],["꧰","꧹"],["꩐","꩙"],["꯰","꯹"],["0","9"]],!1,!1),su=gu([["ᛮ","ᛰ"],["Ⅰ","ↂ"],["ↅ","ↈ"],"〇",["〡","〩"],["〸","〺"],["ꛦ","ꛯ"]],!1,!1),au=gu(["_",["‿","⁀"],"⁔",["︳","︴"],["﹍","﹏"],"_"],!1,!1),cu=gu([" "," "," ",[" "," "]," "," "," "],!1,!1),lu=0,iu=0,fu=[{line:1,column:1}],hu=0,xu=[],pu=0,du={};if("startRule"in A){if(!(A.startRule in e))throw new Error("Can't start parsing from rule \""+A.startRule+'".');D=e[A.startRule]}function Pu(u,A){return{type:"literal",text:u,ignoreCase:A}}function gu(u,A,E){return{type:"class",parts:u,inverted:A,ignoreCase:E}}function vu(u){return{type:"other",description:u}}function yu(A){var E,C=fu[A];if(C)return C;for(E=A-1;!fu[E];)E--;for(C={line:(C=fu[E]).line,column:C.column};E<A;)10===u.charCodeAt(E)?(C.line++,C.column=1):C.column++,E++;return fu[A]=C,C}function mu(u,A){var E=yu(u),C=yu(A);return{source:r,start:{offset:u,line:E.line,column:E.column},end:{offset:A,line:C.line,column:C.column}}}function $u(u){lu<hu||(lu>hu&&(hu=lu,xu=[]),xu.push(u))}function Su(){var A,E,C,F,t,r=32*lu+0,e=du[r];if(e)return lu=e.nextPos,e.result;for(A=lu,E=[],C=lu,F=Ru(),(t=bu())!==B?C=t:(lu=C,C=B);C!==B;)E.push(C),C=lu,F=Ru(),(t=bu())!==B?C=t:(lu=C,C=B);return C=Ru(),F=lu,pu++,u.length>lu?(t=u.charAt(lu),lu++):(t=B,0===pu&&$u(P)),pu--,t===B?F=void 0:(lu=F,F=B),F!==B?A=E:(lu=A,A=B),du[r]={nextPos:lu,result:A},A}function bu(){var A,E,C,F,t,r=32*lu+1,e=du[r];return e?(lu=e.nextPos,e.result):(A=lu,(E=wu())!==B?(Ru(),61===u.charCodeAt(lu)?(C="=",lu++):(C=B,0===pu&&$u(g)),C!==B?(Ru(),(F=ju())!==B?(Ru(),iu=A,t=F,A=Uu({names:E.names,values:t})):(lu=A,A=B)):(lu=A,A=B)):(lu=A,A=B),du[r]={nextPos:lu,result:A},A)}function wu(){var A,E,C,F,t,r,e,D=32*lu+2,n=du[D];if(n)return lu=n.nextPos,n.result;if(A=lu,(E=Lu())!==B){for(C=[],F=lu,_u(),46===u.charCodeAt(lu)?(t=".",lu++):(t=B,0===pu&&$u(v)),t!==B?(_u(),(r=Lu())!==B?F=r:(lu=F,F=B)):(lu=F,F=B);F!==B;)C.push(F),F=lu,_u(),46===u.charCodeAt(lu)?(t=".",lu++):(t=B,0===pu&&$u(v)),t!==B?(_u(),(r=Lu())!==B?F=r:(lu=F,F=B)):(lu=F,F=B);iu=A,e=C,A=Uu({type:"QualifiedName",names:[E,...e]})}else lu=A,A=B;return du[D]={nextPos:lu,result:A},A}function ju(){var A,E,C,F,t,r,e,D=32*lu+3,n=du[D];if(n)return lu=n.nextPos,n.result;if(A=lu,(E=Ou())!==B){for(C=[],F=lu,_u(),59===u.charCodeAt(lu)?(t=";",lu++):(t=B,0===pu&&$u(y)),t!==B?(_u(),(r=Ou())!==B?F=r:(lu=F,F=B)):(lu=F,F=B);F!==B;)C.push(F),F=lu,_u(),59===u.charCodeAt(lu)?(t=";",lu++):(t=B,0===pu&&$u(y)),t!==B?(_u(),(r=Ou())!==B?F=r:(lu=F,F=B)):(lu=F,F=B);iu=A,e=C,A=[E,...e]}else lu=A,A=B;return du[D]={nextPos:lu,result:A},A}function Ou(){var A,E,C,F,t=32*lu+4,r=du[t];return r?(lu=r.nextPos,r.result):(A=lu,"$("===u.substr(lu,2)?(E="$(",lu+=2):(E=B,0===pu&&$u(m)),E!==B&&(C=wu())!==B?(41===u.charCodeAt(lu)?(F=")",lu++):(F=B,0===pu&&$u($)),F!==B?A=C:(lu=A,A=B)):(lu=A,A=B),A===B&&(A=function(){var u,A,E,C,F,t=32*lu+5,r=du[t];if(r)return lu=r.nextPos,r.result;if(pu++,u=lu,(A=Zu())!==B){for(E=[],C=lu,_u(),(F=Zu())!==B?C=F:(lu=C,C=B);C!==B;)E.push(C),C=lu,_u(),(F=Zu())!==B?C=F:(lu=C,C=B);iu=u,u=Uu({type:"Literal",value:A+E.join("")})}else lu=u,u=B;return pu--,u===B&&(A=B,0===pu&&$u(S)),du[t]={nextPos:lu,result:u},u}(),A===B&&(A=function(){var A,E,C,F,t,r,e,D,n,o,s=32*lu+6,a=du[s];if(a)return lu=a.nextPos,a.result;if(pu++,A=lu,34===u.charCodeAt(lu)?(E='"',lu++):(E=B,0===pu&&$u(w)),E!==B){if(C=lu,F=lu,t=[],(r=Zu())!==B)for(;r!==B;)t.push(r),r=Zu();else t=B;if(t!==B){if(r=[],e=lu,D=[],(n=qu())!==B)for(;n!==B;)D.push(n),n=qu();else D=B;if(D!==B){if(n=[],(o=Zu())!==B)for(;o!==B;)n.push(o),o=Zu();else n=B;n!==B?e=D=[D,n]:(lu=e,e=B)}else lu=e,e=B;for(;e!==B;){if(r.push(e),e=lu,D=[],(n=qu())!==B)for(;n!==B;)D.push(n),n=qu();else D=B;if(D!==B){if(n=[],(o=Zu())!==B)for(;o!==B;)n.push(o),o=Zu();else n=B;n!==B?e=D=[D,n]:(lu=e,e=B)}else lu=e,e=B}for(e=[],D=qu();D!==B;)e.push(D),D=qu();F=t=[t,r,e]}else lu=F,F=B;(C=F!==B?u.substring(C,lu):F)!==B?(34===u.charCodeAt(lu)?(F='"',lu++):(F=B,0===pu&&$u(w)),F!==B?(iu=A,A=Uu({type:"Literal",value:C})):(lu=A,A=B)):(lu=A,A=B)}else lu=A,A=B;return pu--,A===B&&(E=B,0===pu&&$u(b)),du[s]={nextPos:lu,result:A},A}(),A===B&&(A=function(){var A,E,C,F,t=32*lu+7,r=du[t];return r?(lu=r.nextPos,r.result):(A=lu,91===u.charCodeAt(lu)?(E="[",lu++):(E=B,0===pu&&$u(j)),E!==B&&(C=ju())!==B?(93===u.charCodeAt(lu)?(F="]",lu++):(F=B,0===pu&&$u(O)),F!==B?(iu=A,A=Uu({type:"SubList",values:C})):(lu=A,A=B)):(lu=A,A=B),du[t]={nextPos:lu,result:A},A)}()))),du[t]={nextPos:lu,result:A},A)}function Ru(){var u,A,E=32*lu+8,C=du[E];if(C)return lu=C.nextPos,C.result;for(u=[],(A=qu())===B&&(A=Nu())===B&&(A=Qu());A!==B;)u.push(A),(A=qu())===B&&(A=Nu())===B&&(A=Qu());return du[E]={nextPos:lu,result:u},u}function _u(){var A,E,C,F,t=32*lu+9,r=du[t];if(r)return lu=r.nextPos,r.result;for(A=[],32===u.charCodeAt(lu)?(E=" ",lu++):(E=B,0===pu&&$u(R)),E===B&&(9===u.charCodeAt(lu)?(E="\t",lu++):(E=B,0===pu&&$u(_)),E===B&&(E=lu,92===u.charCodeAt(lu)?(C="\\",lu++):(C=B,0===pu&&$u(L)),C!==B&&(F=Nu())!==B?E=C=[C,F]:(lu=E,E=B),E===B&&(E=Qu())));E!==B;)A.push(E),32===u.charCodeAt(lu)?(E=" ",lu++):(E=B,0===pu&&$u(R)),E===B&&(9===u.charCodeAt(lu)?(E="\t",lu++):(E=B,0===pu&&$u(_)),E===B&&(E=lu,92===u.charCodeAt(lu)?(C="\\",lu++):(C=B,0===pu&&$u(L)),C!==B&&(F=Nu())!==B?E=C=[C,F]:(lu=E,E=B),E===B&&(E=Qu())));return du[t]={nextPos:lu,result:A},A}function Lu(){var u,A,E,C,F=32*lu+10,t=du[F];if(t)return lu=t.nextPos,t.result;if(pu++,u=lu,(A=zu())!==B){for(E=[],C=Mu();C!==B;)E.push(C),C=Mu();iu=u,u=A+E.join("")}else lu=u,u=B;return pu--,u===B&&(A=B,0===pu&&$u(z)),du[F]={nextPos:lu,result:u},u}function zu(){var A,E=32*lu+11,C=du[E];return C?(lu=C.nextPos,C.result):(A=function(){var A,E=32*lu+14,C=du[E];return C?(lu=C.nextPos,C.result):(A=function(){var A,E=32*lu+25,C=du[E];return C?(lu=C.nextPos,C.result):(l.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(eu)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+21,C=du[E];return C?(lu=C.nextPos,C.result):(o.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(Fu)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+24,C=du[E];return C?(lu=C.nextPos,C.result):(c.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(ru)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+22,C=du[E];return C?(lu=C.nextPos,C.result):(s.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(tu)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+23,C=du[E];return C?(lu=C.nextPos,C.result):(a.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(Bu)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+29,C=du[E];return C?(lu=C.nextPos,C.result):(x.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(su)),du[E]={nextPos:lu,result:A},A)}()))))),du[E]={nextPos:lu,result:A},A)}(),A===B&&(95===u.charCodeAt(lu)?(A="_",lu++):(A=B,0===pu&&$u(M))),du[E]={nextPos:lu,result:A},A)}function Mu(){var A,E=32*lu+12,C=du[E];return C?(lu=C.nextPos,C.result):((A=zu())===B&&(A=function(){var A,E=32*lu+15,C=du[E];return C?(lu=C.nextPos,C.result):(A=function(){var A,E=32*lu+27,C=du[E];return C?(lu=C.nextPos,C.result):(f.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(nu)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+26,C=du[E];return C?(lu=C.nextPos,C.result):(i.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(Du)),du[E]={nextPos:lu,result:A},A)}()),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+28,C=du[E];return C?(lu=C.nextPos,C.result):(h.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(ou)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+30,C=du[E];return C?(lu=C.nextPos,C.result):(p.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(au)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(36===u.charCodeAt(lu)?(A="$",lu++):(A=B,0===pu&&$u(Z)),A===B&&(45===u.charCodeAt(lu)?(A="-",lu++):(A=B,0===pu&&$u(k)),A===B&&(8204===u.charCodeAt(lu)?(A="‌",lu++):(A=B,0===pu&&$u(q)),A===B&&(8205===u.charCodeAt(lu)?(A="‍",lu++):(A=B,0===pu&&$u(J))))))))),du[E]={nextPos:lu,result:A},A)}function Zu(){var A,E,C=32*lu+13,F=du[C];return F?(lu=F.nextPos,F.result):((A=Mu())===B&&(46===u.charCodeAt(lu)?(A=".",lu++):(A=B,0===pu&&$u(v)),A===B&&(47===u.charCodeAt(lu)?(A="/",lu++):(A=B,0===pu&&$u(N)),A===B&&(42===u.charCodeAt(lu)?(A="*",lu++):(A=B,0===pu&&$u(Q)),A===B&&(A=lu,92===u.charCodeAt(lu)?(E="\\",lu++):(E=B,0===pu&&$u(L)),E!==B&&(iu=A,E="/"),A=E)))),du[C]={nextPos:lu,result:A},A)}function ku(){var A,E=32*lu+16,C=du[E];return C?(lu=C.nextPos,C.result):(u.length>lu?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(P)),du[E]={nextPos:lu,result:A},A)}function qu(){var A,E=32*lu+17,C=du[E];return C?(lu=C.nextPos,C.result):(pu++,9===u.charCodeAt(lu)?(A="\t",lu++):(A=B,0===pu&&$u(_)),A===B&&(11===u.charCodeAt(lu)?(A="\v",lu++):(A=B,0===pu&&$u(G)),A===B&&(12===u.charCodeAt(lu)?(A="\f",lu++):(A=B,0===pu&&$u(H)),A===B&&(32===u.charCodeAt(lu)?(A=" ",lu++):(A=B,0===pu&&$u(R)),A===B&&(160===u.charCodeAt(lu)?(A=" ",lu++):(A=B,0===pu&&$u(I)),A===B&&(65279===u.charCodeAt(lu)?(A="\ufeff",lu++):(A=B,0===pu&&$u(K)),A===B&&(A=function(){var A,E=32*lu+31,C=du[E];return C?(lu=C.nextPos,C.result):(d.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(cu)),du[E]={nextPos:lu,result:A},A)}())))))),pu--,A===B&&0===pu&&$u(U),du[E]={nextPos:lu,result:A},A)}function Ju(){var A,E=32*lu+18,C=du[E];return C?(lu=C.nextPos,C.result):(n.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(T)),du[E]={nextPos:lu,result:A},A)}function Nu(){var A,E=32*lu+19,C=du[E];return C?(lu=C.nextPos,C.result):(pu++,10===u.charCodeAt(lu)?(A="\n",lu++):(A=B,0===pu&&$u(W)),A===B&&("\r\n"===u.substr(lu,2)?(A="\r\n",lu+=2):(A=B,0===pu&&$u(X)),A===B&&(13===u.charCodeAt(lu)?(A="\r",lu++):(A=B,0===pu&&$u(Y)),A===B&&(8232===u.charCodeAt(lu)?(A="\u2028",lu++):(A=B,0===pu&&$u(uu)),A===B&&(8233===u.charCodeAt(lu)?(A="\u2029",lu++):(A=B,0===pu&&$u(Au)))))),pu--,A===B&&0===pu&&$u(V),du[E]={nextPos:lu,result:A},A)}function Qu(){var A,E,C,F,t,r,e=32*lu+20,D=du[e];if(D)return lu=D.nextPos,D.result;if(pu++,A=lu,35===u.charCodeAt(lu)?(E="#",lu++):(E=B,0===pu&&$u(Cu)),E!==B){for(C=[],F=lu,t=lu,pu++,r=Ju(),pu--,r===B?t=void 0:(lu=t,t=B),t!==B&&(r=ku())!==B?F=t=[t,r]:(lu=F,F=B);F!==B;)C.push(F),F=lu,t=lu,pu++,r=Ju(),pu--,r===B?t=void 0:(lu=t,t=B),t!==B&&(r=ku())!==B?F=t=[t,r]:(lu=F,F=B);A=E=[E,C]}else lu=A,A=B;return pu--,A===B&&(E=B,0===pu&&$u(Eu)),du[e]={nextPos:lu,result:A},A}function Uu(u){return{...u,source:mu(iu,lu).source}}if((E=D())!==B&&lu===u.length)return E;throw E!==B&&lu<u.length&&$u({type:"end"}),C=xu,F=hu<u.length?u.charAt(hu):null,t=hu<u.length?mu(hu,hu+1):mu(hu,hu),new peg$SyntaxError(peg$SyntaxError.buildMessage(C,F),C,F,t)}peg$subclass(peg$SyntaxError,Error),peg$SyntaxError.prototype.format=function(u){var A="Error: "+this.message;if(this.location){var E,C=null;for(E=0;E<u.length;E++)if(u[E].source===this.location.source){C=u[E].text.split(/\r\n|\n|\r/g);break}var F=this.location.start,t=this.location.source+":"+F.line+":"+F.column;if(C){var B=this.location.end,r=peg$padEnd("",F.line.toString().length),e=C[F.line-1],D=F.line===B.line?B.column:e.length+1;A+="\n --\x3e "+t+"\n"+r+" |\n"+F.line+" | "+e+"\n"+r+" | "+peg$padEnd("",F.column-1)+peg$padEnd("",D-F.column,"^")}else A+="\n at "+t}return A},peg$SyntaxError.buildMessage=function(u,A){var E={literal:function(u){return'"'+F(u.text)+'"'},class:function(u){var A=u.parts.map((function(u){return Array.isArray(u)?t(u[0])+"-"+t(u[1]):t(u)}));return"["+(u.inverted?"^":"")+A+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(u){return u.description}};function C(u){return u.charCodeAt(0).toString(16).toUpperCase()}function F(u){return u.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(u){return"\\x0"+C(u)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(u){return"\\x"+C(u)}))}function t(u){return u.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(u){return"\\x0"+C(u)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(u){return"\\x"+C(u)}))}function B(u){return E[u.type](u)}return"Expected "+function(u){var A,E,C=u.map(B);if(C.sort(),C.length>0){for(A=1,E=1;A<C.length;A++)C[A-1]!==C[A]&&(C[E]=C[A],E++);C.length=E}switch(C.length){case 1:return C[0];case 2:return C[0]+" or "+C[1];default:return C.slice(0,-1).join(", ")+", or "+C[C.length-1]}}(u)+" but "+function(u){return u?'"'+F(u)+'"':"end of input"}(A)+" found."};
9901
+ // EXTERNAL MODULE: ./node_modules/extract-zip/index.js
9902
+ var extract_zip = __webpack_require__(2106);
7268
9903
  // EXTERNAL MODULE: ./node_modules/xml2js/lib/xml2js.js
7269
9904
  var xml2js = __webpack_require__(5055);
9905
+ ;// CONCATENATED MODULE: ./build/jungle.js
9906
+ function peg$subclass(u,A){function E(){this.constructor=u}E.prototype=A.prototype,u.prototype=new E}function peg$SyntaxError(u,A,E,C){var F=Error.call(this,u);return Object.setPrototypeOf&&Object.setPrototypeOf(F,peg$SyntaxError.prototype),F.expected=A,F.found=E,F.location=C,F.name="SyntaxError",F}function peg$padEnd(u,A,E){return E=E||" ",u.length>A?u:(A-=u.length,u+(E+=E.repeat(A)).slice(0,A))}function peg$parse(u,A){var E,C,F,t,B={},r=(A=void 0!==A?A:{}).grammarSource,e={Jungle:Su},D=Su,n=/^[\n\r\u2028\u2029]/,o=/^[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137-\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148-\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C-\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA-\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9-\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC-\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF-\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F-\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0-\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB-\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE-\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6-\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FC7\u1FD0-\u1FD3\u1FD6-\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6-\u1FF7\u210A\u210E-\u210F\u2113\u212F\u2134\u2139\u213C-\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65-\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73-\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3-\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]/,s=/^[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5-\u06E6\u07F4-\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C-\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D-\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C-\uA69D\uA717-\uA71F\uA770\uA788\uA7F8-\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3-\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E-\uFF9F]/,a=/^[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u09FC\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60-\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0CF1-\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E45\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065-\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE-\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5-\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A-\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD-\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,c=/^[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]/,l=/^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178-\u0179\u017B\u017D\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A0\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01AF\u01B1-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A-\u023B\u023D-\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E-\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9-\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0-\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E-\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D-\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A]/,i=/^[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E-\u094F\u0982-\u0983\u09BE-\u09C0\u09C7-\u09C8\u09CB-\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB-\u0ACC\u0B02-\u0B03\u0B3E\u0B40\u0B47-\u0B48\u0B4B-\u0B4C\u0B57\u0BBE-\u0BBF\u0BC1-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82-\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7-\u0CC8\u0CCA-\u0CCB\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82-\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2-\u0DF3\u0F3E-\u0F3F\u0F7F\u102B-\u102C\u1031\u1038\u103B-\u103C\u1056-\u1057\u1062-\u1064\u1067-\u106D\u1083-\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7-\u17C8\u1923-\u1926\u1929-\u192B\u1930-\u1931\u1933-\u1938\u1A19-\u1A1A\u1A55\u1A57\u1A61\u1A63-\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B44\u1B82\u1BA1\u1BA6-\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2-\u1BF3\u1C24-\u1C2B\u1C34-\u1C35\u1CE1\u1CF2-\u1CF3\u1CF7\u302E-\u302F\uA823-\uA824\uA827\uA880-\uA881\uA8B4-\uA8C3\uA952-\uA953\uA983\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BD-\uA9C0\uAA2F-\uAA30\uAA33-\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE-\uAAEF\uAAF5\uABE3-\uABE4\uABE6-\uABE7\uABE9-\uABEA\uABEC]/,f=/^[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2-\u09E3\u09FE\u0A01-\u0A02\u0A3C\u0A41-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A51\u0A70-\u0A71\u0A75\u0A81-\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7-\u0AC8\u0ACD\u0AE2-\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62-\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C62-\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC-\u0CCD\u0CE2-\u0CE3\u0D00-\u0D01\u0D3B-\u0D3C\u0D41-\u0D44\u0D4D\u0D62-\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039-\u103A\u103D-\u103E\u1058-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B4-\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885-\u1886\u18A9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193B\u1A17-\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80-\u1B81\u1BA2-\u1BA5\u1BA8-\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8-\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099-\u309A\uA66F\uA674-\uA67D\uA69E-\uA69F\uA6F0-\uA6F1\uA802\uA806\uA80B\uA825-\uA826\uA8C4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31-\uAA32\uAA35-\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7-\uAAB8\uAABE-\uAABF\uAAC1\uAAEC-\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/,h=/^[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]/,x=/^[\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF]/,p=/^[_\u203F-\u2040\u2054\uFE33-\uFE34\uFE4D-\uFE4F\uFF3F]/,d=/^[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,P={type:"any"},g=Pu("=",!1),v=Pu(".",!1),y=Pu(";",!1),m=Pu("$(",!1),$=Pu(")",!1),S=vu("raw string"),b=vu("quoted string"),w=Pu('"',!1),j=Pu("[",!1),O=Pu("]",!1),R=Pu(" ",!1),_=Pu("\t",!1),L=Pu("\\",!1),z=vu("identifier"),M=Pu("_",!1),Z=Pu("$",!1),k=Pu("-",!1),q=Pu("‌",!1),J=Pu("‍",!1),N=Pu("/",!1),Q=Pu("*",!1),U=vu("whitespace"),G=Pu("\v",!1),H=Pu("\f",!1),I=Pu(" ",!1),K=Pu("\ufeff",!1),T=gu(["\n","\r","\u2028","\u2029"],!1,!1),V=vu("end of line"),W=Pu("\n",!1),X=Pu("\r\n",!1),Y=Pu("\r",!1),uu=Pu("\u2028",!1),Au=Pu("\u2029",!1),Eu=vu("comment"),Cu=Pu("#",!1),Fu=gu([["a","z"],"µ",["ß","ö"],["ø","ÿ"],"ā","ă","ą","ć","ĉ","ċ","č","ď","đ","ē","ĕ","ė","ę","ě","ĝ","ğ","ġ","ģ","ĥ","ħ","ĩ","ī","ĭ","į","ı","ij","ĵ",["ķ","ĸ"],"ĺ","ļ","ľ","ŀ","ł","ń","ņ",["ň","ʼn"],"ŋ","ō","ŏ","ő","œ","ŕ","ŗ","ř","ś","ŝ","ş","š","ţ","ť","ŧ","ũ","ū","ŭ","ů","ű","ų","ŵ","ŷ","ź","ż",["ž","ƀ"],"ƃ","ƅ","ƈ",["ƌ","ƍ"],"ƒ","ƕ",["ƙ","ƛ"],"ƞ","ơ","ƣ","ƥ","ƨ",["ƪ","ƫ"],"ƭ","ư","ƴ","ƶ",["ƹ","ƺ"],["ƽ","ƿ"],"dž","lj","nj","ǎ","ǐ","ǒ","ǔ","ǖ","ǘ","ǚ",["ǜ","ǝ"],"ǟ","ǡ","ǣ","ǥ","ǧ","ǩ","ǫ","ǭ",["ǯ","ǰ"],"dz","ǵ","ǹ","ǻ","ǽ","ǿ","ȁ","ȃ","ȅ","ȇ","ȉ","ȋ","ȍ","ȏ","ȑ","ȓ","ȕ","ȗ","ș","ț","ȝ","ȟ","ȡ","ȣ","ȥ","ȧ","ȩ","ȫ","ȭ","ȯ","ȱ",["ȳ","ȹ"],"ȼ",["ȿ","ɀ"],"ɂ","ɇ","ɉ","ɋ","ɍ",["ɏ","ʓ"],["ʕ","ʯ"],"ͱ","ͳ","ͷ",["ͻ","ͽ"],"ΐ",["ά","ώ"],["ϐ","ϑ"],["ϕ","ϗ"],"ϙ","ϛ","ϝ","ϟ","ϡ","ϣ","ϥ","ϧ","ϩ","ϫ","ϭ",["ϯ","ϳ"],"ϵ","ϸ",["ϻ","ϼ"],["а","џ"],"ѡ","ѣ","ѥ","ѧ","ѩ","ѫ","ѭ","ѯ","ѱ","ѳ","ѵ","ѷ","ѹ","ѻ","ѽ","ѿ","ҁ","ҋ","ҍ","ҏ","ґ","ғ","ҕ","җ","ҙ","қ","ҝ","ҟ","ҡ","ң","ҥ","ҧ","ҩ","ҫ","ҭ","ү","ұ","ҳ","ҵ","ҷ","ҹ","һ","ҽ","ҿ","ӂ","ӄ","ӆ","ӈ","ӊ","ӌ",["ӎ","ӏ"],"ӑ","ӓ","ӕ","ӗ","ә","ӛ","ӝ","ӟ","ӡ","ӣ","ӥ","ӧ","ө","ӫ","ӭ","ӯ","ӱ","ӳ","ӵ","ӷ","ӹ","ӻ","ӽ","ӿ","ԁ","ԃ","ԅ","ԇ","ԉ","ԋ","ԍ","ԏ","ԑ","ԓ","ԕ","ԗ","ԙ","ԛ","ԝ","ԟ","ԡ","ԣ","ԥ","ԧ","ԩ","ԫ","ԭ","ԯ",["ՠ","ֈ"],["ა","ჺ"],["ჽ","ჿ"],["ᏸ","ᏽ"],["ᲀ","ᲈ"],["ᴀ","ᴫ"],["ᵫ","ᵷ"],["ᵹ","ᶚ"],"ḁ","ḃ","ḅ","ḇ","ḉ","ḋ","ḍ","ḏ","ḑ","ḓ","ḕ","ḗ","ḙ","ḛ","ḝ","ḟ","ḡ","ḣ","ḥ","ḧ","ḩ","ḫ","ḭ","ḯ","ḱ","ḳ","ḵ","ḷ","ḹ","ḻ","ḽ","ḿ","ṁ","ṃ","ṅ","ṇ","ṉ","ṋ","ṍ","ṏ","ṑ","ṓ","ṕ","ṗ","ṙ","ṛ","ṝ","ṟ","ṡ","ṣ","ṥ","ṧ","ṩ","ṫ","ṭ","ṯ","ṱ","ṳ","ṵ","ṷ","ṹ","ṻ","ṽ","ṿ","ẁ","ẃ","ẅ","ẇ","ẉ","ẋ","ẍ","ẏ","ẑ","ẓ",["ẕ","ẝ"],"ẟ","ạ","ả","ấ","ầ","ẩ","ẫ","ậ","ắ","ằ","ẳ","ẵ","ặ","ẹ","ẻ","ẽ","ế","ề","ể","ễ","ệ","ỉ","ị","ọ","ỏ","ố","ồ","ổ","ỗ","ộ","ớ","ờ","ở","ỡ","ợ","ụ","ủ","ứ","ừ","ử","ữ","ự","ỳ","ỵ","ỷ","ỹ","ỻ","ỽ",["ỿ","ἇ"],["ἐ","ἕ"],["ἠ","ἧ"],["ἰ","ἷ"],["ὀ","ὅ"],["ὐ","ὗ"],["ὠ","ὧ"],["ὰ","ώ"],["ᾀ","ᾇ"],["ᾐ","ᾗ"],["ᾠ","ᾧ"],["ᾰ","ᾴ"],["ᾶ","ᾷ"],"ι",["ῂ","ῄ"],["ῆ","ῇ"],["ῐ","ΐ"],["ῖ","ῗ"],["ῠ","ῧ"],["ῲ","ῴ"],["ῶ","ῷ"],"ℊ",["ℎ","ℏ"],"ℓ","ℯ","ℴ","ℹ",["ℼ","ℽ"],["ⅆ","ⅉ"],"ⅎ","ↄ",["ⰰ","ⱞ"],"ⱡ",["ⱥ","ⱦ"],"ⱨ","ⱪ","ⱬ","ⱱ",["ⱳ","ⱴ"],["ⱶ","ⱻ"],"ⲁ","ⲃ","ⲅ","ⲇ","ⲉ","ⲋ","ⲍ","ⲏ","ⲑ","ⲓ","ⲕ","ⲗ","ⲙ","ⲛ","ⲝ","ⲟ","ⲡ","ⲣ","ⲥ","ⲧ","ⲩ","ⲫ","ⲭ","ⲯ","ⲱ","ⲳ","ⲵ","ⲷ","ⲹ","ⲻ","ⲽ","ⲿ","ⳁ","ⳃ","ⳅ","ⳇ","ⳉ","ⳋ","ⳍ","ⳏ","ⳑ","ⳓ","ⳕ","ⳗ","ⳙ","ⳛ","ⳝ","ⳟ","ⳡ",["ⳣ","ⳤ"],"ⳬ","ⳮ","ⳳ",["ⴀ","ⴥ"],"ⴧ","ⴭ","ꙁ","ꙃ","ꙅ","ꙇ","ꙉ","ꙋ","ꙍ","ꙏ","ꙑ","ꙓ","ꙕ","ꙗ","ꙙ","ꙛ","ꙝ","ꙟ","ꙡ","ꙣ","ꙥ","ꙧ","ꙩ","ꙫ","ꙭ","ꚁ","ꚃ","ꚅ","ꚇ","ꚉ","ꚋ","ꚍ","ꚏ","ꚑ","ꚓ","ꚕ","ꚗ","ꚙ","ꚛ","ꜣ","ꜥ","ꜧ","ꜩ","ꜫ","ꜭ",["ꜯ","ꜱ"],"ꜳ","ꜵ","ꜷ","ꜹ","ꜻ","ꜽ","ꜿ","ꝁ","ꝃ","ꝅ","ꝇ","ꝉ","ꝋ","ꝍ","ꝏ","ꝑ","ꝓ","ꝕ","ꝗ","ꝙ","ꝛ","ꝝ","ꝟ","ꝡ","ꝣ","ꝥ","ꝧ","ꝩ","ꝫ","ꝭ","ꝯ",["ꝱ","ꝸ"],"ꝺ","ꝼ","ꝿ","ꞁ","ꞃ","ꞅ","ꞇ","ꞌ","ꞎ","ꞑ",["ꞓ","ꞕ"],"ꞗ","ꞙ","ꞛ","ꞝ","ꞟ","ꞡ","ꞣ","ꞥ","ꞧ","ꞩ","ꞯ","ꞵ","ꞷ","ꞹ","ꟺ",["ꬰ","ꭚ"],["ꭠ","ꭥ"],["ꭰ","ꮿ"],["ff","st"],["ﬓ","ﬗ"],["a","z"]],!1,!1),tu=gu([["ʰ","ˁ"],["ˆ","ˑ"],["ˠ","ˤ"],"ˬ","ˮ","ʹ","ͺ","ՙ","ـ",["ۥ","ۦ"],["ߴ","ߵ"],"ߺ","ࠚ","ࠤ","ࠨ","ॱ","ๆ","ໆ","ჼ","ៗ","ᡃ","ᪧ",["ᱸ","ᱽ"],["ᴬ","ᵪ"],"ᵸ",["ᶛ","ᶿ"],"ⁱ","ⁿ",["ₐ","ₜ"],["ⱼ","ⱽ"],"ⵯ","ⸯ","々",["〱","〵"],"〻",["ゝ","ゞ"],["ー","ヾ"],"ꀕ",["ꓸ","ꓽ"],"ꘌ","ꙿ",["ꚜ","ꚝ"],["ꜗ","ꜟ"],"ꝰ","ꞈ",["ꟸ","ꟹ"],"ꧏ","ꧦ","ꩰ","ꫝ",["ꫳ","ꫴ"],["ꭜ","ꭟ"],"ー",["゙","゚"]],!1,!1),Bu=gu(["ª","º","ƻ",["ǀ","ǃ"],"ʔ",["א","ת"],["ׯ","ײ"],["ؠ","ؿ"],["ف","ي"],["ٮ","ٯ"],["ٱ","ۓ"],"ە",["ۮ","ۯ"],["ۺ","ۼ"],"ۿ","ܐ",["ܒ","ܯ"],["ݍ","ޥ"],"ޱ",["ߊ","ߪ"],["ࠀ","ࠕ"],["ࡀ","ࡘ"],["ࡠ","ࡪ"],["ࢠ","ࢴ"],["ࢶ","ࢽ"],["ऄ","ह"],"ऽ","ॐ",["क़","ॡ"],["ॲ","ঀ"],["অ","ঌ"],["এ","ঐ"],["ও","ন"],["প","র"],"ল",["শ","হ"],"ঽ","ৎ",["ড়","ঢ়"],["য়","ৡ"],["ৰ","ৱ"],"ৼ",["ਅ","ਊ"],["ਏ","ਐ"],["ਓ","ਨ"],["ਪ","ਰ"],["ਲ","ਲ਼"],["ਵ","ਸ਼"],["ਸ","ਹ"],["ਖ਼","ੜ"],"ਫ਼",["ੲ","ੴ"],["અ","ઍ"],["એ","ઑ"],["ઓ","ન"],["પ","ર"],["લ","ળ"],["વ","હ"],"ઽ","ૐ",["ૠ","ૡ"],"ૹ",["ଅ","ଌ"],["ଏ","ଐ"],["ଓ","ନ"],["ପ","ର"],["ଲ","ଳ"],["ଵ","ହ"],"ଽ",["ଡ଼","ଢ଼"],["ୟ","ୡ"],"ୱ","ஃ",["அ","ஊ"],["எ","ஐ"],["ஒ","க"],["ங","ச"],"ஜ",["ஞ","ட"],["ண","த"],["ந","ப"],["ம","ஹ"],"ௐ",["అ","ఌ"],["ఎ","ఐ"],["ఒ","న"],["ప","హ"],"ఽ",["ౘ","ౚ"],["ౠ","ౡ"],"ಀ",["ಅ","ಌ"],["ಎ","ಐ"],["ಒ","ನ"],["ಪ","ಳ"],["ವ","ಹ"],"ಽ","ೞ",["ೠ","ೡ"],["ೱ","ೲ"],["അ","ഌ"],["എ","ഐ"],["ഒ","ഺ"],"ഽ","ൎ",["ൔ","ൖ"],["ൟ","ൡ"],["ൺ","ൿ"],["අ","ඖ"],["ක","න"],["ඳ","ර"],"ල",["ව","ෆ"],["ก","ะ"],["า","ำ"],["เ","ๅ"],["ກ","ຂ"],"ຄ",["ງ","ຈ"],"ຊ","ຍ",["ດ","ທ"],["ນ","ຟ"],["ມ","ຣ"],"ລ","ວ",["ສ","ຫ"],["ອ","ະ"],["າ","ຳ"],"ຽ",["ເ","ໄ"],["ໜ","ໟ"],"ༀ",["ཀ","ཇ"],["ཉ","ཬ"],["ྈ","ྌ"],["က","ဪ"],"ဿ",["ၐ","ၕ"],["ၚ","ၝ"],"ၡ",["ၥ","ၦ"],["ၮ","ၰ"],["ၵ","ႁ"],"ႎ",["ᄀ","ቈ"],["ቊ","ቍ"],["ቐ","ቖ"],"ቘ",["ቚ","ቝ"],["በ","ኈ"],["ኊ","ኍ"],["ነ","ኰ"],["ኲ","ኵ"],["ኸ","ኾ"],"ዀ",["ዂ","ዅ"],["ወ","ዖ"],["ዘ","ጐ"],["ጒ","ጕ"],["ጘ","ፚ"],["ᎀ","ᎏ"],["ᐁ","ᙬ"],["ᙯ","ᙿ"],["ᚁ","ᚚ"],["ᚠ","ᛪ"],["ᛱ","ᛸ"],["ᜀ","ᜌ"],["ᜎ","ᜑ"],["ᜠ","ᜱ"],["ᝀ","ᝑ"],["ᝠ","ᝬ"],["ᝮ","ᝰ"],["ក","ឳ"],"ៜ",["ᠠ","ᡂ"],["ᡄ","ᡸ"],["ᢀ","ᢄ"],["ᢇ","ᢨ"],"ᢪ",["ᢰ","ᣵ"],["ᤀ","ᤞ"],["ᥐ","ᥭ"],["ᥰ","ᥴ"],["ᦀ","ᦫ"],["ᦰ","ᧉ"],["ᨀ","ᨖ"],["ᨠ","ᩔ"],["ᬅ","ᬳ"],["ᭅ","ᭋ"],["ᮃ","ᮠ"],["ᮮ","ᮯ"],["ᮺ","ᯥ"],["ᰀ","ᰣ"],["ᱍ","ᱏ"],["ᱚ","ᱷ"],["ᳩ","ᳬ"],["ᳮ","ᳱ"],["ᳵ","ᳶ"],["ℵ","ℸ"],["ⴰ","ⵧ"],["ⶀ","ⶖ"],["ⶠ","ⶦ"],["ⶨ","ⶮ"],["ⶰ","ⶶ"],["ⶸ","ⶾ"],["ⷀ","ⷆ"],["ⷈ","ⷎ"],["ⷐ","ⷖ"],["ⷘ","ⷞ"],"〆","〼",["ぁ","ゖ"],"ゟ",["ァ","ヺ"],"ヿ",["ㄅ","ㄯ"],["ㄱ","ㆎ"],["ㆠ","ㆺ"],["ㇰ","ㇿ"],["㐀","䶵"],["一","鿯"],["ꀀ","ꀔ"],["ꀖ","ꒌ"],["ꓐ","ꓷ"],["ꔀ","ꘋ"],["ꘐ","ꘟ"],["ꘪ","ꘫ"],"ꙮ",["ꚠ","ꛥ"],"ꞏ","ꟷ",["ꟻ","ꠁ"],["ꠃ","ꠅ"],["ꠇ","ꠊ"],["ꠌ","ꠢ"],["ꡀ","ꡳ"],["ꢂ","ꢳ"],["ꣲ","ꣷ"],"ꣻ",["ꣽ","ꣾ"],["ꤊ","ꤥ"],["ꤰ","ꥆ"],["ꥠ","ꥼ"],["ꦄ","ꦲ"],["ꧠ","ꧤ"],["ꧧ","ꧯ"],["ꧺ","ꧾ"],["ꨀ","ꨨ"],["ꩀ","ꩂ"],["ꩄ","ꩋ"],["ꩠ","ꩯ"],["ꩱ","ꩶ"],"ꩺ",["ꩾ","ꪯ"],"ꪱ",["ꪵ","ꪶ"],["ꪹ","ꪽ"],"ꫀ","ꫂ",["ꫛ","ꫜ"],["ꫠ","ꫪ"],"ꫲ",["ꬁ","ꬆ"],["ꬉ","ꬎ"],["ꬑ","ꬖ"],["ꬠ","ꬦ"],["ꬨ","ꬮ"],["ꯀ","ꯢ"],["가","힣"],["ힰ","ퟆ"],["ퟋ","ퟻ"],["豈","舘"],["並","龎"],"יִ",["ײַ","ﬨ"],["שׁ","זּ"],["טּ","לּ"],"מּ",["נּ","סּ"],["ףּ","פּ"],["צּ","ﮱ"],["ﯓ","ﴽ"],["ﵐ","ﶏ"],["ﶒ","ﷇ"],["ﷰ","ﷻ"],["ﹰ","ﹴ"],["ﹶ","ﻼ"],["ヲ","ッ"],["ア","ン"],["ᅠ","ᄒ"],["ᅡ","ᅦ"],["ᅧ","ᅬ"],["ᅭ","ᅲ"],["ᅳ","ᅵ"]],!1,!1),ru=gu(["Dž","Lj","Nj","Dz",["ᾈ","ᾏ"],["ᾘ","ᾟ"],["ᾨ","ᾯ"],"ᾼ","ῌ","ῼ"],!1,!1),eu=gu([["A","Z"],["À","Ö"],["Ø","Þ"],"Ā","Ă","Ą","Ć","Ĉ","Ċ","Č","Ď","Đ","Ē","Ĕ","Ė","Ę","Ě","Ĝ","Ğ","Ġ","Ģ","Ĥ","Ħ","Ĩ","Ī","Ĭ","Į","İ","IJ","Ĵ","Ķ","Ĺ","Ļ","Ľ","Ŀ","Ł","Ń","Ņ","Ň","Ŋ","Ō","Ŏ","Ő","Œ","Ŕ","Ŗ","Ř","Ś","Ŝ","Ş","Š","Ţ","Ť","Ŧ","Ũ","Ū","Ŭ","Ů","Ű","Ų","Ŵ","Ŷ",["Ÿ","Ź"],"Ż","Ž",["Ɓ","Ƃ"],"Ƅ",["Ɔ","Ƈ"],["Ɖ","Ƌ"],["Ǝ","Ƒ"],["Ɠ","Ɣ"],["Ɩ","Ƙ"],["Ɯ","Ɲ"],["Ɵ","Ơ"],"Ƣ","Ƥ",["Ʀ","Ƨ"],"Ʃ","Ƭ",["Ʈ","Ư"],["Ʊ","Ƴ"],"Ƶ",["Ʒ","Ƹ"],"Ƽ","DŽ","LJ","NJ","Ǎ","Ǐ","Ǒ","Ǔ","Ǖ","Ǘ","Ǚ","Ǜ","Ǟ","Ǡ","Ǣ","Ǥ","Ǧ","Ǩ","Ǫ","Ǭ","Ǯ","DZ","Ǵ",["Ƕ","Ǹ"],"Ǻ","Ǽ","Ǿ","Ȁ","Ȃ","Ȅ","Ȇ","Ȉ","Ȋ","Ȍ","Ȏ","Ȑ","Ȓ","Ȕ","Ȗ","Ș","Ț","Ȝ","Ȟ","Ƞ","Ȣ","Ȥ","Ȧ","Ȩ","Ȫ","Ȭ","Ȯ","Ȱ","Ȳ",["Ⱥ","Ȼ"],["Ƚ","Ⱦ"],"Ɂ",["Ƀ","Ɇ"],"Ɉ","Ɋ","Ɍ","Ɏ","Ͱ","Ͳ","Ͷ","Ϳ","Ά",["Έ","Ί"],"Ό",["Ύ","Ώ"],["Α","Ρ"],["Σ","Ϋ"],"Ϗ",["ϒ","ϔ"],"Ϙ","Ϛ","Ϝ","Ϟ","Ϡ","Ϣ","Ϥ","Ϧ","Ϩ","Ϫ","Ϭ","Ϯ","ϴ","Ϸ",["Ϲ","Ϻ"],["Ͻ","Я"],"Ѡ","Ѣ","Ѥ","Ѧ","Ѩ","Ѫ","Ѭ","Ѯ","Ѱ","Ѳ","Ѵ","Ѷ","Ѹ","Ѻ","Ѽ","Ѿ","Ҁ","Ҋ","Ҍ","Ҏ","Ґ","Ғ","Ҕ","Җ","Ҙ","Қ","Ҝ","Ҟ","Ҡ","Ң","Ҥ","Ҧ","Ҩ","Ҫ","Ҭ","Ү","Ұ","Ҳ","Ҵ","Ҷ","Ҹ","Һ","Ҽ","Ҿ",["Ӏ","Ӂ"],"Ӄ","Ӆ","Ӈ","Ӊ","Ӌ","Ӎ","Ӑ","Ӓ","Ӕ","Ӗ","Ә","Ӛ","Ӝ","Ӟ","Ӡ","Ӣ","Ӥ","Ӧ","Ө","Ӫ","Ӭ","Ӯ","Ӱ","Ӳ","Ӵ","Ӷ","Ӹ","Ӻ","Ӽ","Ӿ","Ԁ","Ԃ","Ԅ","Ԇ","Ԉ","Ԋ","Ԍ","Ԏ","Ԑ","Ԓ","Ԕ","Ԗ","Ԙ","Ԛ","Ԝ","Ԟ","Ԡ","Ԣ","Ԥ","Ԧ","Ԩ","Ԫ","Ԭ","Ԯ",["Ա","Ֆ"],["Ⴀ","Ⴥ"],"Ⴧ","Ⴭ",["Ꭰ","Ᏽ"],["Ა","Ჺ"],["Ჽ","Ჿ"],"Ḁ","Ḃ","Ḅ","Ḇ","Ḉ","Ḋ","Ḍ","Ḏ","Ḑ","Ḓ","Ḕ","Ḗ","Ḙ","Ḛ","Ḝ","Ḟ","Ḡ","Ḣ","Ḥ","Ḧ","Ḩ","Ḫ","Ḭ","Ḯ","Ḱ","Ḳ","Ḵ","Ḷ","Ḹ","Ḻ","Ḽ","Ḿ","Ṁ","Ṃ","Ṅ","Ṇ","Ṉ","Ṋ","Ṍ","Ṏ","Ṑ","Ṓ","Ṕ","Ṗ","Ṙ","Ṛ","Ṝ","Ṟ","Ṡ","Ṣ","Ṥ","Ṧ","Ṩ","Ṫ","Ṭ","Ṯ","Ṱ","Ṳ","Ṵ","Ṷ","Ṹ","Ṻ","Ṽ","Ṿ","Ẁ","Ẃ","Ẅ","Ẇ","Ẉ","Ẋ","Ẍ","Ẏ","Ẑ","Ẓ","Ẕ","ẞ","Ạ","Ả","Ấ","Ầ","Ẩ","Ẫ","Ậ","Ắ","Ằ","Ẳ","Ẵ","Ặ","Ẹ","Ẻ","Ẽ","Ế","Ề","Ể","Ễ","Ệ","Ỉ","Ị","Ọ","Ỏ","Ố","Ồ","Ổ","Ỗ","Ộ","Ớ","Ờ","Ở","Ỡ","Ợ","Ụ","Ủ","Ứ","Ừ","Ử","Ữ","Ự","Ỳ","Ỵ","Ỷ","Ỹ","Ỻ","Ỽ","Ỿ",["Ἀ","Ἇ"],["Ἐ","Ἕ"],["Ἠ","Ἧ"],["Ἰ","Ἷ"],["Ὀ","Ὅ"],"Ὑ","Ὓ","Ὕ","Ὗ",["Ὠ","Ὧ"],["Ᾰ","Ά"],["Ὲ","Ή"],["Ῐ","Ί"],["Ῠ","Ῥ"],["Ὸ","Ώ"],"ℂ","ℇ",["ℋ","ℍ"],["ℐ","ℒ"],"ℕ",["ℙ","ℝ"],"ℤ","Ω","ℨ",["K","ℭ"],["ℰ","ℳ"],["ℾ","ℿ"],"ⅅ","Ↄ",["Ⰰ","Ⱞ"],"Ⱡ",["Ɫ","Ɽ"],"Ⱨ","Ⱪ","Ⱬ",["Ɑ","Ɒ"],"Ⱳ","Ⱶ",["Ȿ","Ⲁ"],"Ⲃ","Ⲅ","Ⲇ","Ⲉ","Ⲋ","Ⲍ","Ⲏ","Ⲑ","Ⲓ","Ⲕ","Ⲗ","Ⲙ","Ⲛ","Ⲝ","Ⲟ","Ⲡ","Ⲣ","Ⲥ","Ⲧ","Ⲩ","Ⲫ","Ⲭ","Ⲯ","Ⲱ","Ⲳ","Ⲵ","Ⲷ","Ⲹ","Ⲻ","Ⲽ","Ⲿ","Ⳁ","Ⳃ","Ⳅ","Ⳇ","Ⳉ","Ⳋ","Ⳍ","Ⳏ","Ⳑ","Ⳓ","Ⳕ","Ⳗ","Ⳙ","Ⳛ","Ⳝ","Ⳟ","Ⳡ","Ⳣ","Ⳬ","Ⳮ","Ⳳ","Ꙁ","Ꙃ","Ꙅ","Ꙇ","Ꙉ","Ꙋ","Ꙍ","Ꙏ","Ꙑ","Ꙓ","Ꙕ","Ꙗ","Ꙙ","Ꙛ","Ꙝ","Ꙟ","Ꙡ","Ꙣ","Ꙥ","Ꙧ","Ꙩ","Ꙫ","Ꙭ","Ꚁ","Ꚃ","Ꚅ","Ꚇ","Ꚉ","Ꚋ","Ꚍ","Ꚏ","Ꚑ","Ꚓ","Ꚕ","Ꚗ","Ꚙ","Ꚛ","Ꜣ","Ꜥ","Ꜧ","Ꜩ","Ꜫ","Ꜭ","Ꜯ","Ꜳ","Ꜵ","Ꜷ","Ꜹ","Ꜻ","Ꜽ","Ꜿ","Ꝁ","Ꝃ","Ꝅ","Ꝇ","Ꝉ","Ꝋ","Ꝍ","Ꝏ","Ꝑ","Ꝓ","Ꝕ","Ꝗ","Ꝙ","Ꝛ","Ꝝ","Ꝟ","Ꝡ","Ꝣ","Ꝥ","Ꝧ","Ꝩ","Ꝫ","Ꝭ","Ꝯ","Ꝺ","Ꝼ",["Ᵹ","Ꝿ"],"Ꞁ","Ꞃ","Ꞅ","Ꞇ","Ꞌ","Ɥ","Ꞑ","Ꞓ","Ꞗ","Ꞙ","Ꞛ","Ꞝ","Ꞟ","Ꞡ","Ꞣ","Ꞥ","Ꞧ","Ꞩ",["Ɦ","Ɪ"],["Ʞ","Ꞵ"],"Ꞷ","Ꞹ",["A","Z"]],!1,!1),Du=gu(["ः","ऻ",["ा","ी"],["ॉ","ौ"],["ॎ","ॏ"],["ং","ঃ"],["া","ী"],["ে","ৈ"],["ো","ৌ"],"ৗ","ਃ",["ਾ","ੀ"],"ઃ",["ા","ી"],"ૉ",["ો","ૌ"],["ଂ","ଃ"],"ା","ୀ",["େ","ୈ"],["ୋ","ୌ"],"ୗ",["ா","ி"],["ு","ூ"],["ெ","ை"],["ொ","ௌ"],"ௗ",["ఁ","ః"],["ు","ౄ"],["ಂ","ಃ"],"ಾ",["ೀ","ೄ"],["ೇ","ೈ"],["ೊ","ೋ"],["ೕ","ೖ"],["ം","ഃ"],["ാ","ീ"],["െ","ൈ"],["ൊ","ൌ"],"ൗ",["ං","ඃ"],["ා","ෑ"],["ෘ","ෟ"],["ෲ","ෳ"],["༾","༿"],"ཿ",["ါ","ာ"],"ေ","း",["ျ","ြ"],["ၖ","ၗ"],["ၢ","ၤ"],["ၧ","ၭ"],["ႃ","ႄ"],["ႇ","ႌ"],"ႏ",["ႚ","ႜ"],"ា",["ើ","ៅ"],["ះ","ៈ"],["ᤣ","ᤦ"],["ᤩ","ᤫ"],["ᤰ","ᤱ"],["ᤳ","ᤸ"],["ᨙ","ᨚ"],"ᩕ","ᩗ","ᩡ",["ᩣ","ᩤ"],["ᩭ","ᩲ"],"ᬄ","ᬵ","ᬻ",["ᬽ","ᭁ"],["ᭃ","᭄"],"ᮂ","ᮡ",["ᮦ","ᮧ"],"᮪","ᯧ",["ᯪ","ᯬ"],"ᯮ",["᯲","᯳"],["ᰤ","ᰫ"],["ᰴ","ᰵ"],"᳡",["ᳲ","ᳳ"],"᳷",["〮","〯"],["ꠣ","ꠤ"],"ꠧ",["ꢀ","ꢁ"],["ꢴ","ꣃ"],["ꥒ","꥓"],"ꦃ",["ꦴ","ꦵ"],["ꦺ","ꦻ"],["ꦽ","꧀"],["ꨯ","ꨰ"],["ꨳ","ꨴ"],"ꩍ","ꩻ","ꩽ","ꫫ",["ꫮ","ꫯ"],"ꫵ",["ꯣ","ꯤ"],["ꯦ","ꯧ"],["ꯩ","ꯪ"],"꯬"],!1,!1),nu=gu([["̀","ͯ"],["҃","҇"],["֑","ֽ"],"ֿ",["ׁ","ׂ"],["ׄ","ׅ"],"ׇ",["ؐ","ؚ"],["ً","ٟ"],"ٰ",["ۖ","ۜ"],["۟","ۤ"],["ۧ","ۨ"],["۪","ۭ"],"ܑ",["ܰ","݊"],["ަ","ް"],["߫","߳"],"߽",["ࠖ","࠙"],["ࠛ","ࠣ"],["ࠥ","ࠧ"],["ࠩ","࠭"],["࡙","࡛"],["࣓","࣡"],["ࣣ","ं"],"ऺ","़",["ु","ै"],"्",["॑","ॗ"],["ॢ","ॣ"],"ঁ","়",["ু","ৄ"],"্",["ৢ","ৣ"],"৾",["ਁ","ਂ"],"਼",["ੁ","ੂ"],["ੇ","ੈ"],["ੋ","੍"],"ੑ",["ੰ","ੱ"],"ੵ",["ઁ","ં"],"઼",["ુ","ૅ"],["ે","ૈ"],"્",["ૢ","ૣ"],["ૺ","૿"],"ଁ","଼","ି",["ୁ","ୄ"],"୍","ୖ",["ୢ","ୣ"],"ஂ","ீ","்","ఀ","ఄ",["ా","ీ"],["ె","ై"],["ొ","్"],["ౕ","ౖ"],["ౢ","ౣ"],"ಁ","಼","ಿ","ೆ",["ೌ","್"],["ೢ","ೣ"],["ഀ","ഁ"],["഻","഼"],["ു","ൄ"],"്",["ൢ","ൣ"],"්",["ි","ු"],"ූ","ั",["ิ","ฺ"],["็","๎"],"ັ",["ິ","ູ"],["ົ","ຼ"],["່","ໍ"],["༘","༙"],"༵","༷","༹",["ཱ","ཾ"],["ྀ","྄"],["྆","྇"],["ྍ","ྗ"],["ྙ","ྼ"],"࿆",["ိ","ူ"],["ဲ","့"],["္","်"],["ွ","ှ"],["ၘ","ၙ"],["ၞ","ၠ"],["ၱ","ၴ"],"ႂ",["ႅ","ႆ"],"ႍ","ႝ",["፝","፟"],["ᜒ","᜔"],["ᜲ","᜴"],["ᝒ","ᝓ"],["ᝲ","ᝳ"],["឴","឵"],["ិ","ួ"],"ំ",["៉","៓"],"៝",["᠋","᠍"],["ᢅ","ᢆ"],"ᢩ",["ᤠ","ᤢ"],["ᤧ","ᤨ"],"ᤲ",["᤹","᤻"],["ᨗ","ᨘ"],"ᨛ","ᩖ",["ᩘ","ᩞ"],"᩠","ᩢ",["ᩥ","ᩬ"],["ᩳ","᩼"],"᩿",["᪰","᪽"],["ᬀ","ᬃ"],"᬴",["ᬶ","ᬺ"],"ᬼ","ᭂ",["᭫","᭳"],["ᮀ","ᮁ"],["ᮢ","ᮥ"],["ᮨ","ᮩ"],["᮫","ᮭ"],"᯦",["ᯨ","ᯩ"],"ᯭ",["ᯯ","ᯱ"],["ᰬ","ᰳ"],["ᰶ","᰷"],["᳐","᳒"],["᳔","᳠"],["᳢","᳨"],"᳭","᳴",["᳸","᳹"],["᷀","᷹"],["᷻","᷿"],["⃐","⃜"],"⃡",["⃥","⃰"],["⳯","⳱"],"⵿",["ⷠ","ⷿ"],["〪","〭"],["゙","゚"],"꙯",["ꙴ","꙽"],["ꚞ","ꚟ"],["꛰","꛱"],"ꠂ","꠆","ꠋ",["ꠥ","ꠦ"],["꣄","ꣅ"],["꣠","꣱"],"ꣿ",["ꤦ","꤭"],["ꥇ","ꥑ"],["ꦀ","ꦂ"],"꦳",["ꦶ","ꦹ"],"ꦼ","ꧥ",["ꨩ","ꨮ"],["ꨱ","ꨲ"],["ꨵ","ꨶ"],"ꩃ","ꩌ","ꩼ","ꪰ",["ꪲ","ꪴ"],["ꪷ","ꪸ"],["ꪾ","꪿"],"꫁",["ꫬ","ꫭ"],"꫶","ꯥ","ꯨ","꯭","ﬞ",["︀","️"],["︠","︯"]],!1,!1),ou=gu([["0","9"],["٠","٩"],["۰","۹"],["߀","߉"],["०","९"],["০","৯"],["੦","੯"],["૦","૯"],["୦","୯"],["௦","௯"],["౦","౯"],["೦","೯"],["൦","൯"],["෦","෯"],["๐","๙"],["໐","໙"],["༠","༩"],["၀","၉"],["႐","႙"],["០","៩"],["᠐","᠙"],["᥆","᥏"],["᧐","᧙"],["᪀","᪉"],["᪐","᪙"],["᭐","᭙"],["᮰","᮹"],["᱀","᱉"],["᱐","᱙"],["꘠","꘩"],["꣐","꣙"],["꤀","꤉"],["꧐","꧙"],["꧰","꧹"],["꩐","꩙"],["꯰","꯹"],["0","9"]],!1,!1),su=gu([["ᛮ","ᛰ"],["Ⅰ","ↂ"],["ↅ","ↈ"],"〇",["〡","〩"],["〸","〺"],["ꛦ","ꛯ"]],!1,!1),au=gu(["_",["‿","⁀"],"⁔",["︳","︴"],["﹍","﹏"],"_"],!1,!1),cu=gu([" "," "," ",[" "," "]," "," "," "],!1,!1),lu=0,iu=0,fu=[{line:1,column:1}],hu=0,xu=[],pu=0,du={};if("startRule"in A){if(!(A.startRule in e))throw new Error("Can't start parsing from rule \""+A.startRule+'".');D=e[A.startRule]}function Pu(u,A){return{type:"literal",text:u,ignoreCase:A}}function gu(u,A,E){return{type:"class",parts:u,inverted:A,ignoreCase:E}}function vu(u){return{type:"other",description:u}}function yu(A){var E,C=fu[A];if(C)return C;for(E=A-1;!fu[E];)E--;for(C={line:(C=fu[E]).line,column:C.column};E<A;)10===u.charCodeAt(E)?(C.line++,C.column=1):C.column++,E++;return fu[A]=C,C}function mu(u,A){var E=yu(u),C=yu(A);return{source:r,start:{offset:u,line:E.line,column:E.column},end:{offset:A,line:C.line,column:C.column}}}function $u(u){lu<hu||(lu>hu&&(hu=lu,xu=[]),xu.push(u))}function Su(){var A,E,C,F,t,r=32*lu+0,e=du[r];if(e)return lu=e.nextPos,e.result;for(A=lu,E=[],C=lu,F=Ru(),(t=bu())!==B?C=t:(lu=C,C=B);C!==B;)E.push(C),C=lu,F=Ru(),(t=bu())!==B?C=t:(lu=C,C=B);return C=Ru(),F=lu,pu++,u.length>lu?(t=u.charAt(lu),lu++):(t=B,0===pu&&$u(P)),pu--,t===B?F=void 0:(lu=F,F=B),F!==B?A=E:(lu=A,A=B),du[r]={nextPos:lu,result:A},A}function bu(){var A,E,C,F,t,r=32*lu+1,e=du[r];return e?(lu=e.nextPos,e.result):(A=lu,(E=wu())!==B?(Ru(),61===u.charCodeAt(lu)?(C="=",lu++):(C=B,0===pu&&$u(g)),C!==B?(Ru(),(F=ju())!==B?(Ru(),iu=A,t=F,A=Uu({names:E.names,values:t})):(lu=A,A=B)):(lu=A,A=B)):(lu=A,A=B),du[r]={nextPos:lu,result:A},A)}function wu(){var A,E,C,F,t,r,e,D=32*lu+2,n=du[D];if(n)return lu=n.nextPos,n.result;if(A=lu,(E=Lu())!==B){for(C=[],F=lu,_u(),46===u.charCodeAt(lu)?(t=".",lu++):(t=B,0===pu&&$u(v)),t!==B?(_u(),(r=Lu())!==B?F=r:(lu=F,F=B)):(lu=F,F=B);F!==B;)C.push(F),F=lu,_u(),46===u.charCodeAt(lu)?(t=".",lu++):(t=B,0===pu&&$u(v)),t!==B?(_u(),(r=Lu())!==B?F=r:(lu=F,F=B)):(lu=F,F=B);iu=A,e=C,A=Uu({type:"QualifiedName",names:[E,...e]})}else lu=A,A=B;return du[D]={nextPos:lu,result:A},A}function ju(){var A,E,C,F,t,r,e,D=32*lu+3,n=du[D];if(n)return lu=n.nextPos,n.result;if(A=lu,(E=Ou())!==B){for(C=[],F=lu,_u(),59===u.charCodeAt(lu)?(t=";",lu++):(t=B,0===pu&&$u(y)),t!==B?(_u(),(r=Ou())!==B?F=r:(lu=F,F=B)):(lu=F,F=B);F!==B;)C.push(F),F=lu,_u(),59===u.charCodeAt(lu)?(t=";",lu++):(t=B,0===pu&&$u(y)),t!==B?(_u(),(r=Ou())!==B?F=r:(lu=F,F=B)):(lu=F,F=B);iu=A,e=C,A=[E,...e]}else lu=A,A=B;return du[D]={nextPos:lu,result:A},A}function Ou(){var A,E,C,F,t=32*lu+4,r=du[t];return r?(lu=r.nextPos,r.result):(A=lu,"$("===u.substr(lu,2)?(E="$(",lu+=2):(E=B,0===pu&&$u(m)),E!==B&&(C=wu())!==B?(41===u.charCodeAt(lu)?(F=")",lu++):(F=B,0===pu&&$u($)),F!==B?A=C:(lu=A,A=B)):(lu=A,A=B),A===B&&(A=function(){var u,A,E,C,F,t=32*lu+5,r=du[t];if(r)return lu=r.nextPos,r.result;if(pu++,u=lu,(A=Zu())!==B){for(E=[],C=lu,_u(),(F=Zu())!==B?C=F:(lu=C,C=B);C!==B;)E.push(C),C=lu,_u(),(F=Zu())!==B?C=F:(lu=C,C=B);iu=u,u=Uu({type:"Literal",value:A+E.join("")})}else lu=u,u=B;return pu--,u===B&&(A=B,0===pu&&$u(S)),du[t]={nextPos:lu,result:u},u}(),A===B&&(A=function(){var A,E,C,F,t,r,e,D,n,o,s=32*lu+6,a=du[s];if(a)return lu=a.nextPos,a.result;if(pu++,A=lu,34===u.charCodeAt(lu)?(E='"',lu++):(E=B,0===pu&&$u(w)),E!==B){if(C=lu,F=lu,t=[],(r=Zu())!==B)for(;r!==B;)t.push(r),r=Zu();else t=B;if(t!==B){if(r=[],e=lu,D=[],(n=qu())!==B)for(;n!==B;)D.push(n),n=qu();else D=B;if(D!==B){if(n=[],(o=Zu())!==B)for(;o!==B;)n.push(o),o=Zu();else n=B;n!==B?e=D=[D,n]:(lu=e,e=B)}else lu=e,e=B;for(;e!==B;){if(r.push(e),e=lu,D=[],(n=qu())!==B)for(;n!==B;)D.push(n),n=qu();else D=B;if(D!==B){if(n=[],(o=Zu())!==B)for(;o!==B;)n.push(o),o=Zu();else n=B;n!==B?e=D=[D,n]:(lu=e,e=B)}else lu=e,e=B}for(e=[],D=qu();D!==B;)e.push(D),D=qu();F=t=[t,r,e]}else lu=F,F=B;(C=F!==B?u.substring(C,lu):F)!==B?(34===u.charCodeAt(lu)?(F='"',lu++):(F=B,0===pu&&$u(w)),F!==B?(iu=A,A=Uu({type:"Literal",value:C})):(lu=A,A=B)):(lu=A,A=B)}else lu=A,A=B;return pu--,A===B&&(E=B,0===pu&&$u(b)),du[s]={nextPos:lu,result:A},A}(),A===B&&(A=function(){var A,E,C,F,t=32*lu+7,r=du[t];return r?(lu=r.nextPos,r.result):(A=lu,91===u.charCodeAt(lu)?(E="[",lu++):(E=B,0===pu&&$u(j)),E!==B&&(C=ju())!==B?(93===u.charCodeAt(lu)?(F="]",lu++):(F=B,0===pu&&$u(O)),F!==B?(iu=A,A=Uu({type:"SubList",values:C})):(lu=A,A=B)):(lu=A,A=B),du[t]={nextPos:lu,result:A},A)}()))),du[t]={nextPos:lu,result:A},A)}function Ru(){var u,A,E=32*lu+8,C=du[E];if(C)return lu=C.nextPos,C.result;for(u=[],(A=qu())===B&&(A=Nu())===B&&(A=Qu());A!==B;)u.push(A),(A=qu())===B&&(A=Nu())===B&&(A=Qu());return du[E]={nextPos:lu,result:u},u}function _u(){var A,E,C,F,t=32*lu+9,r=du[t];if(r)return lu=r.nextPos,r.result;for(A=[],32===u.charCodeAt(lu)?(E=" ",lu++):(E=B,0===pu&&$u(R)),E===B&&(9===u.charCodeAt(lu)?(E="\t",lu++):(E=B,0===pu&&$u(_)),E===B&&(E=lu,92===u.charCodeAt(lu)?(C="\\",lu++):(C=B,0===pu&&$u(L)),C!==B&&(F=Nu())!==B?E=C=[C,F]:(lu=E,E=B),E===B&&(E=Qu())));E!==B;)A.push(E),32===u.charCodeAt(lu)?(E=" ",lu++):(E=B,0===pu&&$u(R)),E===B&&(9===u.charCodeAt(lu)?(E="\t",lu++):(E=B,0===pu&&$u(_)),E===B&&(E=lu,92===u.charCodeAt(lu)?(C="\\",lu++):(C=B,0===pu&&$u(L)),C!==B&&(F=Nu())!==B?E=C=[C,F]:(lu=E,E=B),E===B&&(E=Qu())));return du[t]={nextPos:lu,result:A},A}function Lu(){var u,A,E,C,F=32*lu+10,t=du[F];if(t)return lu=t.nextPos,t.result;if(pu++,u=lu,(A=zu())!==B){for(E=[],C=Mu();C!==B;)E.push(C),C=Mu();iu=u,u=A+E.join("")}else lu=u,u=B;return pu--,u===B&&(A=B,0===pu&&$u(z)),du[F]={nextPos:lu,result:u},u}function zu(){var A,E=32*lu+11,C=du[E];return C?(lu=C.nextPos,C.result):(A=function(){var A,E=32*lu+14,C=du[E];return C?(lu=C.nextPos,C.result):(A=function(){var A,E=32*lu+25,C=du[E];return C?(lu=C.nextPos,C.result):(l.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(eu)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+21,C=du[E];return C?(lu=C.nextPos,C.result):(o.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(Fu)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+24,C=du[E];return C?(lu=C.nextPos,C.result):(c.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(ru)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+22,C=du[E];return C?(lu=C.nextPos,C.result):(s.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(tu)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+23,C=du[E];return C?(lu=C.nextPos,C.result):(a.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(Bu)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+29,C=du[E];return C?(lu=C.nextPos,C.result):(x.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(su)),du[E]={nextPos:lu,result:A},A)}()))))),du[E]={nextPos:lu,result:A},A)}(),A===B&&(95===u.charCodeAt(lu)?(A="_",lu++):(A=B,0===pu&&$u(M))),du[E]={nextPos:lu,result:A},A)}function Mu(){var A,E=32*lu+12,C=du[E];return C?(lu=C.nextPos,C.result):((A=zu())===B&&(A=function(){var A,E=32*lu+15,C=du[E];return C?(lu=C.nextPos,C.result):(A=function(){var A,E=32*lu+27,C=du[E];return C?(lu=C.nextPos,C.result):(f.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(nu)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+26,C=du[E];return C?(lu=C.nextPos,C.result):(i.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(Du)),du[E]={nextPos:lu,result:A},A)}()),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+28,C=du[E];return C?(lu=C.nextPos,C.result):(h.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(ou)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(A=function(){var A,E=32*lu+30,C=du[E];return C?(lu=C.nextPos,C.result):(p.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(au)),du[E]={nextPos:lu,result:A},A)}(),A===B&&(36===u.charCodeAt(lu)?(A="$",lu++):(A=B,0===pu&&$u(Z)),A===B&&(45===u.charCodeAt(lu)?(A="-",lu++):(A=B,0===pu&&$u(k)),A===B&&(8204===u.charCodeAt(lu)?(A="‌",lu++):(A=B,0===pu&&$u(q)),A===B&&(8205===u.charCodeAt(lu)?(A="‍",lu++):(A=B,0===pu&&$u(J))))))))),du[E]={nextPos:lu,result:A},A)}function Zu(){var A,E,C=32*lu+13,F=du[C];return F?(lu=F.nextPos,F.result):((A=Mu())===B&&(46===u.charCodeAt(lu)?(A=".",lu++):(A=B,0===pu&&$u(v)),A===B&&(47===u.charCodeAt(lu)?(A="/",lu++):(A=B,0===pu&&$u(N)),A===B&&(42===u.charCodeAt(lu)?(A="*",lu++):(A=B,0===pu&&$u(Q)),A===B&&(A=lu,92===u.charCodeAt(lu)?(E="\\",lu++):(E=B,0===pu&&$u(L)),E!==B&&(iu=A,E="/"),A=E)))),du[C]={nextPos:lu,result:A},A)}function ku(){var A,E=32*lu+16,C=du[E];return C?(lu=C.nextPos,C.result):(u.length>lu?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(P)),du[E]={nextPos:lu,result:A},A)}function qu(){var A,E=32*lu+17,C=du[E];return C?(lu=C.nextPos,C.result):(pu++,9===u.charCodeAt(lu)?(A="\t",lu++):(A=B,0===pu&&$u(_)),A===B&&(11===u.charCodeAt(lu)?(A="\v",lu++):(A=B,0===pu&&$u(G)),A===B&&(12===u.charCodeAt(lu)?(A="\f",lu++):(A=B,0===pu&&$u(H)),A===B&&(32===u.charCodeAt(lu)?(A=" ",lu++):(A=B,0===pu&&$u(R)),A===B&&(160===u.charCodeAt(lu)?(A=" ",lu++):(A=B,0===pu&&$u(I)),A===B&&(65279===u.charCodeAt(lu)?(A="\ufeff",lu++):(A=B,0===pu&&$u(K)),A===B&&(A=function(){var A,E=32*lu+31,C=du[E];return C?(lu=C.nextPos,C.result):(d.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(cu)),du[E]={nextPos:lu,result:A},A)}())))))),pu--,A===B&&0===pu&&$u(U),du[E]={nextPos:lu,result:A},A)}function Ju(){var A,E=32*lu+18,C=du[E];return C?(lu=C.nextPos,C.result):(n.test(u.charAt(lu))?(A=u.charAt(lu),lu++):(A=B,0===pu&&$u(T)),du[E]={nextPos:lu,result:A},A)}function Nu(){var A,E=32*lu+19,C=du[E];return C?(lu=C.nextPos,C.result):(pu++,10===u.charCodeAt(lu)?(A="\n",lu++):(A=B,0===pu&&$u(W)),A===B&&("\r\n"===u.substr(lu,2)?(A="\r\n",lu+=2):(A=B,0===pu&&$u(X)),A===B&&(13===u.charCodeAt(lu)?(A="\r",lu++):(A=B,0===pu&&$u(Y)),A===B&&(8232===u.charCodeAt(lu)?(A="\u2028",lu++):(A=B,0===pu&&$u(uu)),A===B&&(8233===u.charCodeAt(lu)?(A="\u2029",lu++):(A=B,0===pu&&$u(Au)))))),pu--,A===B&&0===pu&&$u(V),du[E]={nextPos:lu,result:A},A)}function Qu(){var A,E,C,F,t,r,e=32*lu+20,D=du[e];if(D)return lu=D.nextPos,D.result;if(pu++,A=lu,35===u.charCodeAt(lu)?(E="#",lu++):(E=B,0===pu&&$u(Cu)),E!==B){for(C=[],F=lu,t=lu,pu++,r=Ju(),pu--,r===B?t=void 0:(lu=t,t=B),t!==B&&(r=ku())!==B?F=t=[t,r]:(lu=F,F=B);F!==B;)C.push(F),F=lu,t=lu,pu++,r=Ju(),pu--,r===B?t=void 0:(lu=t,t=B),t!==B&&(r=ku())!==B?F=t=[t,r]:(lu=F,F=B);A=E=[E,C]}else lu=A,A=B;return pu--,A===B&&(E=B,0===pu&&$u(Eu)),du[e]={nextPos:lu,result:A},A}function Uu(u){return{...u,source:mu(iu,lu).source}}if((E=D())!==B&&lu===u.length)return E;throw E!==B&&lu<u.length&&$u({type:"end"}),C=xu,F=hu<u.length?u.charAt(hu):null,t=hu<u.length?mu(hu,hu+1):mu(hu,hu),new peg$SyntaxError(peg$SyntaxError.buildMessage(C,F),C,F,t)}peg$subclass(peg$SyntaxError,Error),peg$SyntaxError.prototype.format=function(u){var A="Error: "+this.message;if(this.location){var E,C=null;for(E=0;E<u.length;E++)if(u[E].source===this.location.source){C=u[E].text.split(/\r\n|\n|\r/g);break}var F=this.location.start,t=this.location.source+":"+F.line+":"+F.column;if(C){var B=this.location.end,r=peg$padEnd("",F.line.toString().length),e=C[F.line-1],D=F.line===B.line?B.column:e.length+1;A+="\n --\x3e "+t+"\n"+r+" |\n"+F.line+" | "+e+"\n"+r+" | "+peg$padEnd("",F.column-1)+peg$padEnd("",D-F.column,"^")}else A+="\n at "+t}return A},peg$SyntaxError.buildMessage=function(u,A){var E={literal:function(u){return'"'+F(u.text)+'"'},class:function(u){var A=u.parts.map((function(u){return Array.isArray(u)?t(u[0])+"-"+t(u[1]):t(u)}));return"["+(u.inverted?"^":"")+A+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(u){return u.description}};function C(u){return u.charCodeAt(0).toString(16).toUpperCase()}function F(u){return u.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(u){return"\\x0"+C(u)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(u){return"\\x"+C(u)}))}function t(u){return u.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(u){return"\\x0"+C(u)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(u){return"\\x"+C(u)}))}function B(u){return E[u.type](u)}return"Expected "+function(u){var A,E,C=u.map(B);if(C.sort(),C.length>0){for(A=1,E=1;A<C.length;A++)C[A-1]!==C[A]&&(C[E]=C[A],E++);C.length=E}switch(C.length){case 1:return C[0];case 2:return C[0]+" or "+C[1];default:return C.slice(0,-1).join(", ")+", or "+C[C.length-1]}}(u)+" but "+function(u){return u?'"'+F(u)+'"':"end of input"}(A)+" found."};
7270
9907
  ;// CONCATENATED MODULE: ./src/manifest.js
7271
9908
 
7272
9909
 
@@ -7283,30 +9920,49 @@ async function writeManifest(filename, xml) {
7283
9920
  return promises_namespaceObject.writeFile(filename, text);
7284
9921
  }
7285
9922
 
7286
- function manifestProducts(manifest) {
7287
- const app =
7288
- manifest["iq:manifest"]["iq:application"] ||
7289
- manifest["iq:manifest"]["iq:barrel"];
7290
- return app[0]["iq:products"][0]["iq:product"]
7291
- .map((p) => p["$"]["id"])
7292
- .sort()
7293
- .filter((p, i, a) => !i || p !== a[i - 1]);
9923
+ function manifestProducts(manifest) {
9924
+ const app =
9925
+ manifest["iq:manifest"]["iq:application"] ||
9926
+ manifest["iq:manifest"]["iq:barrel"];
9927
+ return ((app[0]["iq:products"] || [{}])[0]["iq:product"] || [])
9928
+ .map((p) => p.$.id)
9929
+ .sort()
9930
+ .filter((p, i, a) => !i || p !== a[i - 1]);
9931
+ }
9932
+
9933
+ function manifestBarrels(manifest) {
9934
+ const app = manifest["iq:manifest"]["iq:application"];
9935
+ if (
9936
+ Array.isArray(app) &&
9937
+ app.length &&
9938
+ app[0] &&
9939
+ Array.isArray(app[0]["iq:barrels"]) &&
9940
+ app[0]["iq:barrels"].length &&
9941
+ Array.isArray(app[0]["iq:barrels"][0]["iq:depends"])
9942
+ ) {
9943
+ return app[0]["iq:barrels"][0]["iq:depends"]
9944
+ .map((p) => p.$.name)
9945
+ .sort()
9946
+ .filter((p, i, a) => !i || p !== a[i - 1]);
9947
+ }
9948
+ return [];
9949
+ }
9950
+
9951
+ function manifestDropBarrels(manifest) {
9952
+ delete manifest["iq:manifest"]["iq:application"][0]["iq:barrels"];
7294
9953
  }
7295
9954
 
7296
- async function getDeviceInfo() {
7297
- const files = await (0,external_util_cjs_namespaceObject.globa)(`${external_util_cjs_namespaceObject.connectiq}/Devices/*/compiler.json`);
7298
- return Promise.all(
7299
- files.map((file) => {
7300
- return promises_namespaceObject.readFile(file).then((data) => {
7301
- const { deviceId, appTypes, deviceFamily } = JSON.parse(
7302
- data.toString()
7303
- );
7304
- return [deviceId, { appTypes, deviceFamily }];
7305
- });
7306
- })
7307
- ).then((info) => {
7308
- return Object.fromEntries(info);
7309
- });
9955
+ function manifestBarrelName(manifestName, manifest) {
9956
+ const barrel = manifest["iq:manifest"]["iq:barrel"];
9957
+ if (!barrel) throw new Error(`Not a barrel manifest: ${manifestName}`);
9958
+ return barrel[0].$.module;
9959
+ }
9960
+
9961
+ function manifestAnnotations(manifest) {
9962
+ const barrel = manifest["iq:manifest"]["iq:barrel"];
9963
+ if (!barrel) return null;
9964
+ const annotations = barrel[0]["iq:annotations"];
9965
+ return annotations && annotations[0]["iq:annotation"];
7310
9966
  }
7311
9967
 
7312
9968
  async function checkManifest(manifest, products) {
@@ -7320,13 +9976,19 @@ async function checkManifest(manifest, products) {
7320
9976
  if (!app) return ok;
7321
9977
 
7322
9978
  const elm = app[0];
7323
- const type = elm.$.type.replace(/-/, "").toLowerCase();
7324
- const deviceInfo = await getDeviceInfo();
9979
+ const id = elm.$.id;
9980
+ if (id.length < 32 || !/^[-_0-9a-f.]+$/.test(id)) {
9981
+ ok = false;
9982
+ elm.$.id = "08070f9d-8b4e-40a4-9c49-fe67a2a55dec";
9983
+ }
9984
+ const type = elm.$.type.replace(/-/g, "").toLowerCase();
9985
+ const deviceInfo = await (0,external_sdk_util_cjs_namespaceObject.getDeviceInfo)();
7325
9986
  const allowedProducts = products.sort().filter(
7326
9987
  (p) =>
7327
9988
  deviceInfo[p] &&
7328
9989
  deviceInfo[p].appTypes.find((at) => {
7329
- return at.type.toLowerCase() === type;
9990
+ const t = at.type.toLowerCase();
9991
+ return t === type || `${t}app` === type;
7330
9992
  })
7331
9993
  );
7332
9994
  if (
@@ -7365,6 +10027,56 @@ async function checkManifest(manifest, products) {
7365
10027
 
7366
10028
 
7367
10029
 
10030
+
10031
+
10032
+
10033
+
10034
+ async function default_jungle() {
10035
+ const assignments = [];
10036
+ const devices = await (0,external_sdk_util_cjs_namespaceObject.getDeviceInfo)();
10037
+ const languages = await (0,external_sdk_util_cjs_namespaceObject.getLanguages)();
10038
+ const literal = (value) => ({ type: "Literal", value });
10039
+ const qname = (name) => ({ type: "QualifiedName", names: name.split(".") });
10040
+ const assign = (name, values) =>
10041
+ assignments.push({ names: name.split("."), values });
10042
+ const rassign = (name, values, base) => {
10043
+ assign(name, base ? [qname(name)].concat(values) : values);
10044
+ };
10045
+ const rezAndLang = (id, rez, base) => {
10046
+ if (base) {
10047
+ assign(id, [qname(base)]);
10048
+ }
10049
+ rassign(`${id}.resourcePath`, [literal(rez)], base);
10050
+
10051
+ languages.forEach((l) =>
10052
+ rassign(`${id}.lang.${l.id}`, [literal(`${rez}-${l.id}`)], base)
10053
+ );
10054
+ };
10055
+ const done = {};
10056
+
10057
+ assign("base.sourcePath", [literal("./**.mc")]);
10058
+ rezAndLang("base", "resources");
10059
+ Object.entries(devices).forEach(([deviceId, { deviceFamily }]) => {
10060
+ const match = deviceFamily.match(/^(\w+)-\d+x\d+/);
10061
+ if (!match) {
10062
+ throw new Error(
10063
+ `Strange deviceFamily (${deviceFamily}) for device ${deviceId}`
10064
+ );
10065
+ }
10066
+ const shape = match[1];
10067
+ if (!(0,external_api_cjs_namespaceObject.hasProperty)(done, shape)) {
10068
+ rezAndLang(shape, `resources-${shape}`, "base");
10069
+ done[shape] = true;
10070
+ }
10071
+ if (!(0,external_api_cjs_namespaceObject.hasProperty)(done, deviceFamily)) {
10072
+ rezAndLang(deviceFamily, `resources-${deviceFamily}`, shape);
10073
+ done[deviceFamily] = true;
10074
+ }
10075
+ rezAndLang(deviceId, `resources-${deviceId}`, deviceFamily);
10076
+ });
10077
+ return process_assignments(assignments, {});
10078
+ }
10079
+
7368
10080
  function process_assignments(assignments, current) {
7369
10081
  return assignments.reduce((state, a) => {
7370
10082
  const { node, dot, dotnames } = a.names.reduce(
@@ -7382,30 +10094,30 @@ function process_assignments(assignments, current) {
7382
10094
  );
7383
10095
  // an assignment to a node overwrites its old value
7384
10096
  Object.keys(node).forEach((k) => delete node[k]);
7385
- if (dot) {
7386
- const process_list = (values) => {
7387
- for (let i = values.length; i--; ) {
7388
- const v = values[i];
7389
- if (
7390
- v.type == "QualifiedName" &&
7391
- v.names.every((n, i) => n === a.names[i])
7392
- ) {
7393
- a.values.splice(
7394
- i,
7395
- 1,
7396
- ...dot.map((v) =>
7397
- v.type == "QualifiedName"
7398
- ? { ...v, names: v.names.concat(dotnames) }
7399
- : v
7400
- )
7401
- );
7402
- } else if (v.type == "SubList") {
7403
- process_list(v.values);
7404
- }
10097
+ const process_list = (values) => {
10098
+ for (let i = values.length; i--; ) {
10099
+ const v = values[i];
10100
+ if (
10101
+ v.type == "QualifiedName" &&
10102
+ v.names.every((n, i) => n === a.names[i])
10103
+ ) {
10104
+ values.splice(
10105
+ i,
10106
+ 1,
10107
+ ...(dot
10108
+ ? dot.map((v) =>
10109
+ v.type == "QualifiedName"
10110
+ ? { ...v, names: v.names.concat(dotnames) }
10111
+ : v
10112
+ )
10113
+ : [])
10114
+ );
10115
+ } else if (v.type == "SubList") {
10116
+ process_list(v.values);
7405
10117
  }
7406
- };
7407
- process_list(a.values);
7408
- }
10118
+ }
10119
+ };
10120
+ process_list(a.values);
7409
10121
  if (
7410
10122
  a.names.length === 1 &&
7411
10123
  a.values.length === 1 &&
@@ -7472,14 +10184,11 @@ async function parse_one(file) {
7472
10184
  // return a jungle object with all local variables resolved,
7473
10185
  // but all qualifier references left unresolved.
7474
10186
  async function process_jungles(sources) {
7475
- const sdk = await (0,external_util_cjs_namespaceObject.getSdkPath)();
7476
-
7477
10187
  if (!Array.isArray(sources)) {
7478
10188
  sources = [sources];
7479
10189
  }
7480
- const all = [[`${sdk}bin/default.jungle`, null], ...sources];
7481
- const results = await Promise.all(all.map(parse_one));
7482
- const state = {};
10190
+ const results = await Promise.all(sources.map(parse_one));
10191
+ const state = await default_jungle();
7483
10192
  results.forEach((r) => process_assignments(r, state));
7484
10193
  return state;
7485
10194
  }
@@ -7569,8 +10278,8 @@ function resolve_node(state, node) {
7569
10278
 
7570
10279
  function resolve_filename(literal, default_source) {
7571
10280
  if (typeof literal === "string") return literal;
7572
- const root = external_path_namespaceObject.dirname(literal.source || default_source);
7573
- return external_path_namespaceObject.resolve(root, literal.value);
10281
+ const root = external_path_.dirname(literal.source || default_source);
10282
+ return external_path_.resolve(root, literal.value);
7574
10283
  }
7575
10284
 
7576
10285
  async function resolve_literals(qualifier, default_source) {
@@ -7579,12 +10288,15 @@ async function resolve_literals(qualifier, default_source) {
7579
10288
  (
7580
10289
  await Promise.all(
7581
10290
  literals.map(async (v) => {
10291
+ if (v.type == "SubList") {
10292
+ return resolve_file_list(v.values);
10293
+ }
7582
10294
  let resolved = resolve_filename(v, default_source);
7583
10295
  if (/[*?\[\]\{\}]/.test(resolved)) {
7584
10296
  // Jungle files can contain "./**.mc" which is supposed to match
7585
10297
  // any mc file under "./". The standard way to express that
7586
10298
  // is "./**/*.mc", which is what glob expects, so translate.
7587
- resolved = resolved.replace(/\/\*\*([^/])/g, "/**/*$1");
10299
+ resolved = resolved.replace(/[\\\/]\*\*([^\\\/])/g, "/**/*$1");
7588
10300
  const match = await (0,external_util_cjs_namespaceObject.globa)(resolved);
7589
10301
  return match.length ? resolved : null;
7590
10302
  } else {
@@ -7624,7 +10336,101 @@ async function resolve_literals(qualifier, default_source) {
7624
10336
  base[name] = literals.map((v) => v.value);
7625
10337
  };
7626
10338
  resolve_literal_list(qualifier, "excludeAnnotations");
7627
- resolve_literal_list(qualifier, "annotations");
10339
+ // turn the annotations inside out.
10340
+ // in the jungle we have
10341
+ // qualifier.BarrelName.annotations = Foo;Bar
10342
+ // but its more convenient as
10343
+ // qualifier.annotations.BarrelName = Foo;Bar
10344
+ const annotations = {};
10345
+ Object.entries(qualifier).forEach(([k, v]) => {
10346
+ if ((0,external_api_cjs_namespaceObject.hasProperty)(v, "annotations")) {
10347
+ annotations[k] = v.annotations;
10348
+ resolve_literal_list(annotations, k);
10349
+ delete qualifier[k];
10350
+ }
10351
+ });
10352
+ qualifier.annotations = annotations;
10353
+ }
10354
+
10355
+ async function find_build_instructions_in_resource(file) {
10356
+ const data = await promises_namespaceObject.readFile(file);
10357
+ const rez = await (0,xml2js.parseStringPromise)(data).catch(() => ({}));
10358
+ if (rez.build && rez.build.exclude) {
10359
+ const dir = external_path_.dirname(file);
10360
+ const sourceExcludes = rez.build.exclude
10361
+ .map((e) => e.$.file)
10362
+ .filter((f) => f != null)
10363
+ .map((f) => external_path_.resolve(dir, f).replace(/\\/g, "/"));
10364
+
10365
+ const filePatterns = rez.build.exclude
10366
+ .map((e) => e.$.dir)
10367
+ .filter((f) => f != null)
10368
+ .map((f) => external_path_.join(dir, f, "**", "*.mc").replace(/\\/g, "/"));
10369
+ if (filePatterns.length) {
10370
+ const files = (
10371
+ await Promise.all(filePatterns.map((p) => (0,external_util_cjs_namespaceObject.globa)(p)))
10372
+ ).flat();
10373
+ sourceExcludes.push(...files);
10374
+ }
10375
+ const excludeAnnotations = rez.build.exclude
10376
+ .map((e) => e.$.annotation)
10377
+ .filter((f) => f != null);
10378
+ return { sourceExcludes, excludeAnnotations };
10379
+ }
10380
+ }
10381
+ async function find_build_instructions(targets) {
10382
+ const resourceGroups = {};
10383
+ await Promise.all(
10384
+ targets.map(async (p) => {
10385
+ if (!p.qualifier.resourcePath) return;
10386
+ const key = p.qualifier.resourcePath.join(";");
10387
+ if (!(0,external_api_cjs_namespaceObject.hasProperty)(resourceGroups, key)) {
10388
+ resourceGroups[key] = {
10389
+ resourcePath: p.qualifier.resourcePath,
10390
+ products: [],
10391
+ };
10392
+ const paths = (
10393
+ await Promise.all(
10394
+ p.qualifier.resourcePath.map((pattern) =>
10395
+ (0,external_util_cjs_namespaceObject.globa)(pattern, { mark: true })
10396
+ )
10397
+ )
10398
+ ).flat();
10399
+
10400
+ const sourceExcludes = [];
10401
+ const excludeAnnotations = [];
10402
+ const resourceFiles = await Promise.all(
10403
+ paths.map((path) =>
10404
+ path.endsWith("/") ? (0,external_util_cjs_namespaceObject.globa)(`${path}**/*.xml`, { mark: true }) : path
10405
+ )
10406
+ );
10407
+ const buildInstructions = await Promise.all(
10408
+ resourceFiles
10409
+ .flat()
10410
+ .filter((file) => !file.endsWith("/"))
10411
+ .map((file) => find_build_instructions_in_resource(file))
10412
+ );
10413
+ buildInstructions
10414
+ .filter((i) => i != null)
10415
+ .map((i) => {
10416
+ if (i.sourceExcludes) sourceExcludes.push(...i.sourceExcludes);
10417
+ if (i.excludeAnnotations)
10418
+ excludeAnnotations.push(...i.excludeAnnotations);
10419
+ });
10420
+ if (sourceExcludes.length) {
10421
+ p.qualifier.sourceExcludes = sourceExcludes;
10422
+ }
10423
+ if (excludeAnnotations.length) {
10424
+ if (p.qualifier.excludeAnnotations) {
10425
+ p.qualifier.excludeAnnotations.push(excludeAnnotations);
10426
+ } else {
10427
+ p.qualifier.excludeAnnotations = excludeAnnotations;
10428
+ }
10429
+ }
10430
+ }
10431
+ resourceGroups[key].products.push(p.product);
10432
+ })
10433
+ );
7628
10434
  }
7629
10435
 
7630
10436
  function identify_optimizer_groups(targets, options) {
@@ -7679,17 +10485,25 @@ function identify_optimizer_groups(targets, options) {
7679
10485
  : null;
7680
10486
 
7681
10487
  targets.forEach((target) => {
7682
- let { sourcePath, barrelPath, excludeAnnotations, annotations } =
7683
- target.qualifier;
10488
+ let {
10489
+ sourcePath,
10490
+ sourceExcludes,
10491
+ barrelPath,
10492
+ barrelMap,
10493
+ excludeAnnotations,
10494
+ annotations,
10495
+ } = target.qualifier;
7684
10496
  if (excludeAnnotations && ignoredExcludeAnnotations) {
7685
10497
  excludeAnnotations = getStrsWithIgnore(
7686
10498
  excludeAnnotations,
7687
10499
  ignoredExcludeAnnotations
7688
10500
  );
7689
10501
  }
7690
- if (annotations && ignoredAnnotations) {
7691
- annotations = getStrsWithIgnore(annotations, ignoredAnnotations);
7692
- }
10502
+ Object.entries(annotations).forEach(([key, value]) => {
10503
+ if (ignoredAnnotations) {
10504
+ annotations[key] = getStrsWithIgnore(value, ignoredAnnotations);
10505
+ }
10506
+ });
7693
10507
  if (ignoredSourcePaths) {
7694
10508
  sourcePath = sourcePath
7695
10509
  .map((path) => Object.keys(ignoredSourcePaths[path]))
@@ -7699,7 +10513,9 @@ function identify_optimizer_groups(targets, options) {
7699
10513
  }
7700
10514
  const optimizerConfig = {
7701
10515
  sourcePath,
10516
+ sourceExcludes,
7702
10517
  barrelPath,
10518
+ barrelMap,
7703
10519
  excludeAnnotations,
7704
10520
  annotations,
7705
10521
  };
@@ -7719,42 +10535,298 @@ function identify_optimizer_groups(targets, options) {
7719
10535
  });
7720
10536
  }
7721
10537
 
7722
- async function get_jungle(jungles, options) {
7723
- options = options || {};
7724
- jungles = jungles
10538
+ /**
10539
+ * Find the barrels referred to by barrelPath.
10540
+ *
10541
+ * Each string in barrelPath is a glob that can expand to a
10542
+ * .jungle file, a .barrel file, or a directory. If it
10543
+ * expands to a directory, that directory is searched recursively
10544
+ * for .barrel files.
10545
+ *
10546
+ * @param {string|string[]} barrelPath the path or paths to search
10547
+ * @returns {Promise<string[]>}
10548
+ */
10549
+ function find_barrels(barrelPath) {
10550
+ if (Array.isArray(barrelPath)) {
10551
+ // This is a sublist. The barrel has more than one jungle file.
10552
+ return Promise.all(
10553
+ barrelPath.map((path) => (0,external_util_cjs_namespaceObject.globa)(path, { mark: true }))
10554
+ ).then((paths) => [
10555
+ paths
10556
+ .flat()
10557
+ .filter((path) => path.endsWith(".jungle"))
10558
+ .join(";"),
10559
+ ]);
10560
+ }
10561
+ return (0,external_util_cjs_namespaceObject.globa)(barrelPath, { mark: true })
10562
+ .then((paths) =>
10563
+ Promise.all(
10564
+ paths.map((path) =>
10565
+ path.endsWith("/") ? (0,external_util_cjs_namespaceObject.globa)(`${path}**/*.barrel`) : path
10566
+ )
10567
+ )
10568
+ )
10569
+ .then((barrelPaths) =>
10570
+ barrelPaths
10571
+ .flat()
10572
+ .filter((path) => path.endsWith(".jungle") || path.endsWith(".barrel"))
10573
+ );
10574
+ }
10575
+
10576
+ /**
10577
+ *@typedef {Object} Target - Build instructions for a particular product in a jungle
10578
+ *
10579
+ * @typedef {Object} JungleInfoBase - The result of parsing a jungle file, without resolving any products
10580
+ * @property {string[]} jungles - Paths to the barrel's jungle files
10581
+ * @property {string} manifest - Path to the barrel's manifest file
10582
+ * @property {Object} xml - The xml content of the manifest, as returned by xml2js
10583
+ * @property {string[]=} annotations - Array of annotations supported by this barrel
10584
+ *
10585
+ * @typedef {Object} PartialJungle - Used to extend JungleInfoBase to ResolvedJungle
10586
+ * @property {Target[]} targets - All of the supported targets in the manifest
10587
+ *
10588
+ * @typedef {Object} PartialBarrel - Used to extend JungleInfoBase to ResolvedBarrel
10589
+ * @property {JungleQualifier} qualifier - the qualifier for this PartialBarrel's target
10590
+ *
10591
+ * @typedef {JungleInfoBase & PartialJungle} ResolvedJungle - The result of parsing an application's jungle file
10592
+ * @typedef {JungleInfoBase & PartialBarrel} ResolvedBarrel - The result of parsing a barrel's jungle file for a particular product
10593
+ *
10594
+ * @typedef {Object} JungleQualifier
10595
+ * @property {string[]=} sourcePath - locations to find source file
10596
+ * @property {string[]=} sourceExcludes - array of files to exclude from the build (from resource build instructions)
10597
+ * @property {string[]=} excludeAnnotations - array of excludeAnnotations
10598
+ * @property {string[]=} resourcePath - locations to find resource files
10599
+ * @property {LangResourcePaths} lang - locations to find resource files
10600
+ * @property {(string|string[])[]=} barrelPath - locations to find barrels
10601
+ * @property {BarrelAnnotations=} annotations - map from barrel names to arrays of annotations
10602
+ * @property {BarrelMap=} barrelMap
10603
+ *
10604
+ * @typedef {{[key:string]:string[]}} LangResourcePaths - Map from language codes to the corresponding resource paths
10605
+ * @typedef {{[key:string]:string[]}} BarrelAnnotations - Map from barrel name to imported annotations
10606
+ * @typedef {{[key:string]:ResolvedBarrel}} BarrelMap - Map from barrel name to the set of resolved barrel projects for that name. Note that they must all share a manifest.
10607
+ */
10608
+
10609
+ /**
10610
+ * Given a .barrel file, unpack it into barrelDir, then process its .jungle file as below
10611
+ * Given a .jungle file, resolve it to a ResolvedJungle
10612
+ *
10613
+ * @param {string} barrel Path to a .jungle or .barrel file to resolve
10614
+ * @param {string} barrelDir Directory where .barrel files should be unpacked
10615
+ * @param {string[]} products The products supported by the importing project
10616
+ * @param {*} options
10617
+ * @returns {Promise<ResolvedJungle>}
10618
+ */
10619
+ function resolve_barrel(barrel, barrelDir, products, options) {
10620
+ const cache = options._cache;
10621
+ if ((0,external_api_cjs_namespaceObject.hasProperty)(cache.barrels, barrel)) {
10622
+ return cache.barrels[barrel];
10623
+ }
10624
+ let promise = Promise.resolve();
10625
+ let rawBarrel = barrel;
10626
+ if (barrel.endsWith(".barrel")) {
10627
+ // A barrel with the given name could in theory resolve to a different physical
10628
+ // barrel file for each product, so uniqify the local name with a sha1.
10629
+ const sha1 = external_crypto_namespaceObject.createHash("sha1")
10630
+ .update(barrel, "binary")
10631
+ .digest("base64")
10632
+ .replace(/[\/=+]/g, "");
10633
+ const localPath = external_path_.resolve(
10634
+ barrelDir,
10635
+ `${external_path_.basename(barrel, ".barrel")}-${sha1}`
10636
+ );
10637
+ rawBarrel = external_path_.resolve(localPath, "barrel.jungle");
10638
+ promise = promise.then(() =>
10639
+ promises_namespaceObject.stat(localPath)
10640
+ .then(
10641
+ (localStat) =>
10642
+ !localStat.isDirectory() ||
10643
+ promises_namespaceObject.stat(barrel)
10644
+ .then((barrelStat) => localStat.mtimeMs < barrelStat.mtimeMs),
10645
+ () => true
10646
+ )
10647
+ .then(
10648
+ (needsUpdate) =>
10649
+ needsUpdate &&
10650
+ promises_namespaceObject.rm(localPath, { recursive: true, force: true })
10651
+ .then(() => extract_zip(barrel, { dir: localPath }))
10652
+ )
10653
+ );
10654
+ }
10655
+ return promise
10656
+ .then(() => get_jungle_and_barrels(rawBarrel, products, options))
10657
+ .then((result) => {
10658
+ if (!cache.barrels) cache.barrels = {};
10659
+ return (cache.barrels[barrel] = { ...result });
10660
+ });
10661
+ }
10662
+
10663
+ /**
10664
+ * Find and resolve the BarrelMap for product, and add it to qualifier.
10665
+ *
10666
+ * @param {string} product The device id we're resolving
10667
+ * @param {JungleQualifier} qualifier The qualifier for product from the main jungle
10668
+ * @param {string[]} barrels The barrels imported by the project's manifest
10669
+ * @param {string[]} products The products supported by the importing project (used when the barrel project has none)
10670
+ * @param {*} options
10671
+ * @returns {Promise<void>}
10672
+ */
10673
+ function resolve_barrels(product, qualifier, barrels, products, options) {
10674
+ if (qualifier.annotations) {
10675
+ Object.keys(qualifier.annotations).forEach((key) => {
10676
+ // delete annotations for non-existent barrels such as
10677
+ if (!barrels.includes(key)) {
10678
+ delete qualifier.annotations[key];
10679
+ }
10680
+ });
10681
+ }
10682
+ if (!barrels.length) {
10683
+ delete qualifier.barrelPath;
10684
+ return;
10685
+ }
10686
+ const cache = options._cache || (options._cache = {});
10687
+ const barrelMapKey = JSON.stringify([barrels, qualifier.barrelPath]);
10688
+ const setBarrelMap = (barrelMap) => {
10689
+ qualifier.barrelMap = barrels.reduce((result, barrel) => {
10690
+ const { targets, ...rest } = barrelMap[barrel];
10691
+ const target = targets.find((t) => t.product === product);
10692
+ if (!target) {
10693
+ throw new Error(`Barrel ${barrel} does not support device ${product}`);
10694
+ }
10695
+ rest.qualifier = target.qualifier;
10696
+ result[barrel] = rest;
10697
+ return result;
10698
+ }, {});
10699
+ };
10700
+ if ((0,external_api_cjs_namespaceObject.hasProperty)(cache.barrelMap, barrelMapKey)) {
10701
+ setBarrelMap(cache.barrelMap[barrelMapKey]);
10702
+ return;
10703
+ }
10704
+ const barrelDir = external_path_.resolve(
10705
+ options.workspace,
10706
+ options.outputPath,
10707
+ "raw-barrels"
10708
+ );
10709
+ const barrelMap = Object.fromEntries(barrels.map((b) => [b, null]));
10710
+ return (qualifier.barrelPath || [])
10711
+ .reduce(
10712
+ (promise, barrelPath) =>
10713
+ promise
10714
+ .then(() => find_barrels(barrelPath))
10715
+ .then((barrelPaths) => {
10716
+ return Promise.all(
10717
+ barrelPaths.map((barrel) =>
10718
+ resolve_barrel(barrel, barrelDir, products, options)
10719
+ )
10720
+ );
10721
+ })
10722
+ .then((resolvedBarrels) => {
10723
+ resolvedBarrels.forEach((resolvedBarrel) => {
10724
+ const name = manifestBarrelName(
10725
+ resolvedBarrel.manifest,
10726
+ resolvedBarrel.xml
10727
+ );
10728
+ if (!(0,external_api_cjs_namespaceObject.hasProperty)(barrelMap, name)) return;
10729
+ if (barrelMap[name]) {
10730
+ const bname = (r) => r.jungles.join(";");
10731
+ throw new Error(
10732
+ `Barrel ${name} already resolved to ${bname(
10733
+ barrelMap[name]
10734
+ )}; can't also resolve to ${bname(resolvedBarrel)}`
10735
+ );
10736
+ }
10737
+ barrelMap[name] = resolvedBarrel;
10738
+ });
10739
+ }),
10740
+ Promise.resolve()
10741
+ )
10742
+ .then(() => {
10743
+ const unresolved = Object.entries(barrelMap).filter((v) => v[1] === null);
10744
+ if (unresolved.length) {
10745
+ throw new Error(
10746
+ `Failed to resolve some barrels: ${unresolved
10747
+ .map(([name]) => name)
10748
+ .join(",")}`
10749
+ );
10750
+ }
10751
+ if (!cache.barrelMap) cache.barrelMap = {};
10752
+ cache.barrelMap[barrelMapKey] = barrelMap;
10753
+ setBarrelMap(barrelMap);
10754
+ });
10755
+ }
10756
+ /**
10757
+ *
10758
+ * @param {string} jungleFiles Semicolon separated list of jungle files
10759
+ * @param {string[]} defaultProducts Default set of products. Only used by a barrel with no products of its own
10760
+ * @param {*} options
10761
+ * @returns {Promise<ResolvedJungle>}
10762
+ */
10763
+ async function get_jungle_and_barrels(jungleFiles, defaultProducts, options) {
10764
+ const jungles = jungleFiles
7725
10765
  .split(";")
7726
- .map((jungle) => external_path_namespaceObject.resolve(options.workspace || "./", jungle));
7727
- const data = await process_jungles(jungles);
10766
+ .map((jungle) => external_path_.resolve(options.workspace || "./", jungle));
10767
+ const barrels_jungle = external_path_.resolve(
10768
+ external_path_.dirname(jungles[0]),
10769
+ "barrels.jungle"
10770
+ );
10771
+ if (!jungles.includes(barrels_jungle)) {
10772
+ if (
10773
+ await promises_namespaceObject.stat(barrels_jungle)
10774
+ .then((s) => s.isFile())
10775
+ .catch(() => false)
10776
+ ) {
10777
+ jungles.push(barrels_jungle);
10778
+ }
10779
+ }
10780
+ const state = await process_jungles(jungles);
7728
10781
  // apparently square_watch is an alias for rectangle_watch
7729
- data["square_watch"] = data["rectangle_watch"];
10782
+ state["square_watch"] = state["rectangle_watch"];
7730
10783
  const manifest_node = resolve_node(
7731
- data,
7732
- resolve_node_by_path(data, ["project", "manifest"])
10784
+ state,
10785
+ resolve_node_by_path(state, ["project", "manifest"])
7733
10786
  );
7734
10787
  if (!manifest_node) throw new Error("No manifest found!");
7735
10788
  const manifest = resolve_filename(manifest_node[0]);
10789
+ if (!options.workspace) {
10790
+ options.workspace = external_path_.dirname(manifest);
10791
+ }
7736
10792
  const xml = await readManifest(manifest);
7737
10793
  const targets = [];
10794
+ const barrels = manifestBarrels(xml);
10795
+ const annotations = manifestAnnotations(xml);
10796
+ const products = manifestProducts(xml);
10797
+ if (products.length === 0) products.push(...defaultProducts);
7738
10798
  let promise = Promise.resolve();
7739
10799
  const add_one = (product, shape) => {
7740
- const qualifier = resolve_node(data, data[product]);
10800
+ const qualifier = resolve_node(state, state[product]);
7741
10801
  if (!qualifier) return;
7742
10802
  promise = promise
7743
10803
  .then(() => resolve_literals(qualifier, manifest))
7744
- .then(() => targets.push({ product, qualifier, shape }));
10804
+ .then(() =>
10805
+ resolve_barrels(product, qualifier, barrels, products, options)
10806
+ )
10807
+ .then(() => {
10808
+ targets.push({ product, qualifier, shape });
10809
+ });
7745
10810
  };
7746
- manifestProducts(xml).forEach((product) => {
7747
- if ((0,external_api_cjs_namespaceObject.hasProperty)(data, product) && data[product].products) {
10811
+ products.forEach((product) => {
10812
+ if ((0,external_api_cjs_namespaceObject.hasProperty)(state, product) && state[product].products) {
7748
10813
  // this was something like round_watch. Add all the corresponding
7749
10814
  // products.
7750
- data[product].products.forEach((p) => add_one(p, product));
10815
+ state[product].products.forEach((p) => add_one(p, product));
7751
10816
  } else {
7752
10817
  add_one(product);
7753
10818
  }
7754
10819
  });
7755
10820
  await promise;
7756
- identify_optimizer_groups(targets, options);
7757
- return { manifest, targets, xml };
10821
+ await find_build_instructions(targets);
10822
+ return { manifest, targets, xml, annotations, jungles };
10823
+ }
10824
+
10825
+ async function get_jungle(jungles, options) {
10826
+ options = options || {};
10827
+ const result = await get_jungle_and_barrels(jungles, [], options);
10828
+ identify_optimizer_groups(result.targets, options);
10829
+ return result;
7758
10830
  }
7759
10831
 
7760
10832
  ;// CONCATENATED MODULE: external "child_process"
@@ -7764,15 +10836,24 @@ const external_child_process_namespaceObject = require("child_process");
7764
10836
 
7765
10837
 
7766
10838
 
10839
+
7767
10840
  function launchSimulator() {
7768
- return (0,external_util_cjs_namespaceObject.getSdkPath)().then((sdk) => {
10841
+ return (0,external_sdk_util_cjs_namespaceObject.getSdkPath)().then((sdk) => {
7769
10842
  const child = (0,external_child_process_namespaceObject.execFile)(
7770
- external_path_namespaceObject.resolve(sdk, "bin", external_util_cjs_namespaceObject.isWin ? "simulator" : "connectiq")
10843
+ external_path_.resolve(sdk, "bin", external_sdk_util_cjs_namespaceObject.isWin ? "simulator" : "connectiq")
7771
10844
  );
7772
10845
  child.unref();
7773
10846
  });
7774
10847
  }
7775
10848
 
10849
+ function simulateProgram(prg, device) {
10850
+ return getSdkPath().then((sdk) =>
10851
+ spawnByLine(path.resolve(sdk, "bin", "monkeydo"), [prg, device], (line) =>
10852
+ console.log(line)
10853
+ )
10854
+ );
10855
+ }
10856
+
7776
10857
  ;// CONCATENATED MODULE: external "@markw65/prettier-plugin-monkeyc"
7777
10858
  const prettier_plugin_monkeyc_namespaceObject = require("@markw65/prettier-plugin-monkeyc");
7778
10859
  ;// CONCATENATED MODULE: ./src/mc-rewrite.js
@@ -7829,12 +10910,8 @@ function collectClassInfo(state) {
7829
10910
  });
7830
10911
  }
7831
10912
 
7832
- async function analyze(fileNames, buildConfig) {
7833
- const excludeAnnotations =
7834
- buildConfig && buildConfig.excludeAnnotations
7835
- ? Object.fromEntries(buildConfig.excludeAnnotations.map((a) => [a, true]))
7836
- : {};
7837
-
10913
+ async function analyze(fnMap) {
10914
+ let excludeAnnotations;
7838
10915
  const allImports = [];
7839
10916
  const state = {
7840
10917
  allFunctions: [],
@@ -7842,11 +10919,11 @@ async function analyze(fileNames, buildConfig) {
7842
10919
  shouldExclude(node) {
7843
10920
  if (node.attrs && node.attrs.attrs) {
7844
10921
  if (
7845
- node.attrs.attrs.filter((attr) => {
10922
+ node.attrs.attrs.some((attr) => {
7846
10923
  if (attr.type != "UnaryExpression") return false;
7847
10924
  if (attr.argument.type != "Identifier") return false;
7848
10925
  return (0,external_api_cjs_namespaceObject.hasProperty)(excludeAnnotations, attr.argument.name);
7849
- }).length
10926
+ })
7850
10927
  ) {
7851
10928
  return true;
7852
10929
  }
@@ -7889,25 +10966,29 @@ async function analyze(fileNames, buildConfig) {
7889
10966
  };
7890
10967
  markApi(state.stack[0]);
7891
10968
 
10969
+ const getAst = (source, monkeyCSource, exclude) => {
10970
+ excludeAnnotations = exclude;
10971
+ const ast = prettier_plugin_monkeyc_namespaceObject.parsers.monkeyc.parse(monkeyCSource, {
10972
+ grammarSource: source,
10973
+ });
10974
+ ast.source = source;
10975
+ ast.monkeyCSource = monkeyCSource;
10976
+ (0,external_api_cjs_namespaceObject.collectNamespaces)(ast, state);
10977
+ return ast;
10978
+ };
7892
10979
  const files = await Promise.all(
7893
- fileNames.map(async (name) => ({
7894
- name,
7895
- monkeyCSource: (await promises_namespaceObject.readFile(name))
7896
- .toString()
7897
- .replace(/\r\n/g, "\n"),
7898
- }))
10980
+ Object.entries(fnMap).map(([name, { excludeAnnotations }]) =>
10981
+ promises_namespaceObject.readFile(name).then((data) => ({
10982
+ name,
10983
+ ast: getAst(
10984
+ name,
10985
+ data.toString().replace(/\r\n/g, "\n"),
10986
+ excludeAnnotations
10987
+ ),
10988
+ }))
10989
+ )
7899
10990
  );
7900
10991
 
7901
- files.forEach((f) => {
7902
- f.ast = prettier_plugin_monkeyc_namespaceObject.parsers.monkeyc.parse(f.monkeyCSource, {
7903
- grammarSource: f.name,
7904
- });
7905
- f.ast.source = f.name;
7906
- f.ast.monkeyCSource = f.monkeyCSource;
7907
- delete f.monkeyCSource;
7908
- (0,external_api_cjs_namespaceObject.collectNamespaces)(f.ast, state);
7909
- });
7910
-
7911
10992
  delete state.shouldExclude;
7912
10993
  delete state.post;
7913
10994
 
@@ -8128,8 +11209,8 @@ function evaluateFunction(func, args) {
8128
11209
  }
8129
11210
  }
8130
11211
 
8131
- async function optimizeMonkeyC(fileNames, buildConfig) {
8132
- const { files, state } = await analyze(fileNames, buildConfig);
11212
+ async function optimizeMonkeyC(fnMap) {
11213
+ const { files, state } = await analyze(fnMap);
8133
11214
  const replace = (node, obj) => {
8134
11215
  for (const k of Object.keys(node)) {
8135
11216
  delete node[k];
@@ -8190,6 +11271,7 @@ async function optimizeMonkeyC(fileNames, buildConfig) {
8190
11271
  (sc.superClass && checkInherited(sc, name))
8191
11272
  );
8192
11273
 
11274
+ state.localsStack = [{}];
8193
11275
  state.exposed = {};
8194
11276
  state.calledFunctions = {};
8195
11277
  state.pre = (node) => {
@@ -8239,8 +11321,74 @@ async function optimizeMonkeyC(fileNames, buildConfig) {
8239
11321
 
8240
11322
  case "EnumDeclaration":
8241
11323
  return false;
8242
- case "VariableDeclarator":
11324
+ case "ForStatement": {
11325
+ const map = state.localsStack.slice(-1).pop().map;
11326
+ if (map) {
11327
+ state.localsStack.push({ node, map: { ...map } });
11328
+ }
11329
+ break;
11330
+ }
11331
+ case "VariableDeclarator": {
11332
+ const locals = state.localsStack.slice(-1).pop();
11333
+ const { map } = locals;
11334
+ if (map) {
11335
+ if ((0,external_api_cjs_namespaceObject.hasProperty)(map, node.id.name)) {
11336
+ // We already have a variable with this name in scope
11337
+ // Recent monkeyc compilers complain, so rename it
11338
+ let suffix = 0;
11339
+ let node_name = node.id.name;
11340
+ const match = node_name.match(/^pmcr_(.*)_(\d+)$/);
11341
+ if (match) {
11342
+ node_name = match[1];
11343
+ suffix = parseInt(match[2], 10) + 1;
11344
+ }
11345
+ if (!locals.inners) {
11346
+ // find all the names declared in this scope, to avoid
11347
+ // more conflicts
11348
+ locals.inners = {};
11349
+ (0,external_api_cjs_namespaceObject.traverseAst)(locals.node, (node) => {
11350
+ if (node.type === "VariableDeclarator") {
11351
+ locals.inners[node.id.name] = true;
11352
+ }
11353
+ });
11354
+ }
11355
+ let name;
11356
+ while (true) {
11357
+ name = `pmcr_${node_name}_${suffix}`;
11358
+ if (
11359
+ !(0,external_api_cjs_namespaceObject.hasProperty)(map, name) &&
11360
+ !(0,external_api_cjs_namespaceObject.hasProperty)(locals.inners, name)
11361
+ ) {
11362
+ // we also need to ensure that we don't hide the name of
11363
+ // an outer module, class, function, enum or variable,
11364
+ // since someone might want to access it from this scope.
11365
+ let ok = false;
11366
+ let i;
11367
+ for (i = state.stack.length; i--; ) {
11368
+ const elm = state.stack[i];
11369
+ if (ok) {
11370
+ if ((0,external_api_cjs_namespaceObject.hasProperty)(elm.decls, name)) {
11371
+ break;
11372
+ }
11373
+ } else if (elm.node.type === "FunctionDeclaration") {
11374
+ ok = true;
11375
+ }
11376
+ }
11377
+ if (i < 0) {
11378
+ break;
11379
+ }
11380
+ }
11381
+ suffix++;
11382
+ }
11383
+ map[node.id.name] = name;
11384
+ map[name] = true;
11385
+ node.id.name = name;
11386
+ } else {
11387
+ map[node.id.name] = true;
11388
+ }
11389
+ }
8243
11390
  return ["init"];
11391
+ }
8244
11392
  case "UnaryExpression":
8245
11393
  if (node.operator == ":") {
8246
11394
  // If we produce a Symbol, for a given name,
@@ -8255,6 +11403,15 @@ async function optimizeMonkeyC(fileNames, buildConfig) {
8255
11403
  }
8256
11404
  break;
8257
11405
  case "Identifier": {
11406
+ const map = state.localsStack.slice(-1).pop().map;
11407
+ if (map) {
11408
+ if ((0,external_api_cjs_namespaceObject.hasProperty)(map, node.name)) {
11409
+ const name = map[node.name];
11410
+ if (name !== true) {
11411
+ node.name = name;
11412
+ }
11413
+ }
11414
+ }
8258
11415
  if ((0,external_api_cjs_namespaceObject.hasProperty)(state.index, node.name)) {
8259
11416
  if (!lookupAndReplace(node)) {
8260
11417
  state.exposed[node.name] = true;
@@ -8275,7 +11432,20 @@ async function optimizeMonkeyC(fileNames, buildConfig) {
8275
11432
  return ["object"];
8276
11433
  }
8277
11434
  break;
11435
+ case "BlockStatement": {
11436
+ const map = state.localsStack.slice(-1).pop().map;
11437
+ if (map) {
11438
+ state.localsStack.push({
11439
+ node,
11440
+ map: { ...map },
11441
+ });
11442
+ }
11443
+ break;
11444
+ }
8278
11445
  case "FunctionDeclaration": {
11446
+ const map = {};
11447
+ node.params && node.params.forEach((p) => (map[p.name] = true));
11448
+ state.localsStack.push({ node, map });
8279
11449
  const [parent] = state.stack.slice(-2);
8280
11450
  if (parent.type == "ClassDeclaration" && !maybeCalled(node)) {
8281
11451
  let used = false;
@@ -8295,6 +11465,9 @@ async function optimizeMonkeyC(fileNames, buildConfig) {
8295
11465
  }
8296
11466
  };
8297
11467
  state.post = (node) => {
11468
+ if (state.localsStack.slice(-1).pop().node === node) {
11469
+ state.localsStack.pop();
11470
+ }
8298
11471
  const opt = optimizeNode(node);
8299
11472
  if (opt) {
8300
11473
  replace(node, opt);
@@ -8443,6 +11616,15 @@ async function optimizeMonkeyC(fileNames, buildConfig) {
8443
11616
 
8444
11617
 
8445
11618
 
11619
+
11620
+
11621
+ function relative_path_no_dotdot(relative) {
11622
+ return relative.replace(
11623
+ /^(\.\.[\\\/])+/,
11624
+ (str) => `__${"dot".repeat(str.length / 3)}__${str.slice(-1)}`
11625
+ );
11626
+ }
11627
+
8446
11628
  async function getVSCodeSettings(path) {
8447
11629
  try {
8448
11630
  const settings = await promises_namespaceObject.readFile(path);
@@ -8470,7 +11652,7 @@ async function getConfig(options) {
8470
11652
  if (config[key]) return;
8471
11653
  if (!promise) {
8472
11654
  promise = Promise.resolve()
8473
- .then(() => getVSCodeSettings(`${external_util_cjs_namespaceObject.appSupport}/Code/User/settings.json`))
11655
+ .then(() => getVSCodeSettings(`${external_sdk_util_cjs_namespaceObject.appSupport}/Code/User/settings.json`))
8474
11656
  .then((globals) =>
8475
11657
  getVSCodeSettings(`${config.workspace}/.vscode/settings.json`).then(
8476
11658
  (locals) => ({ ...globals, ...locals })
@@ -8502,49 +11684,160 @@ async function buildOptimizedProject(product, options) {
8502
11684
  if (product) {
8503
11685
  product = config.products[0];
8504
11686
  if (config.simulatorBuild === false) {
8505
- bin = external_path_namespaceObject.join(bin, product);
11687
+ bin = external_path_.join(bin, product);
8506
11688
  }
8507
11689
  } else {
8508
- bin = external_path_namespaceObject.join(bin, "exported");
11690
+ bin = external_path_.join(bin, "exported");
8509
11691
  name = `${program}.iq`;
8510
11692
  }
8511
- config.program = external_path_namespaceObject.join(bin, name);
11693
+ config.program = external_path_.join(bin, name);
8512
11694
  return build_project(product, config);
8513
11695
  }
8514
11696
 
11697
+ /**
11698
+ * For each barrel project included in the build, we want to build
11699
+ * a local barrel project inside the optimized directory.
11700
+ *
11701
+ * Note that for each named barrel, each target could include a
11702
+ * different barrel, or barrel project. It could even include more
11703
+ * than one - but in that case, they should be separate jungle files
11704
+ * with the same manifest file.
11705
+ *
11706
+ * So for each input barrel (resolvedBarrel.jungles are the jungle
11707
+ * files corresponding to an input barrel), we create a copy of
11708
+ * the barrel with all the sources removed (and pick up the sources
11709
+ * from the input barrel)
11710
+ */
11711
+ async function createLocalBarrels(targets, options) {
11712
+ if (
11713
+ targets.every(
11714
+ (target) =>
11715
+ !target.group.optimizerConfig.barrelMap ||
11716
+ Object.values(target.group.optimizerConfig.barrelMap).every(
11717
+ (resolvedBarrel) => !resolvedBarrel.qualifier.resourcePath
11718
+ )
11719
+ )
11720
+ ) {
11721
+ // there are no barrels, or every barrel has no resources.
11722
+ // we can drop any barrels altogether (we'll need to drop them
11723
+ // from the manifest file too).
11724
+ return;
11725
+ }
11726
+ // where to create the local barrel projects.
11727
+ const barrelDir = external_path_.resolve(
11728
+ options.workspace,
11729
+ options.outputPath,
11730
+ "opt-barrels"
11731
+ );
11732
+ return targets.reduce((promise, target) => {
11733
+ const barrelMap = target.group.optimizerConfig.barrelMap;
11734
+ if (!barrelMap || target.group.optBarrels) {
11735
+ return promise;
11736
+ }
11737
+ const optBarrels = (target.group.optimizerConfig.optBarrels = {});
11738
+ return Object.entries(barrelMap).reduce(
11739
+ (promise, [barrel, resolvedBarrel]) => {
11740
+ const { manifest, jungles } = resolvedBarrel;
11741
+ const rawBarrelDir = external_path_.dirname(jungles[0]);
11742
+ const rawJungles = jungles.map((jungle) =>
11743
+ external_path_.relative(rawBarrelDir, jungle)
11744
+ );
11745
+ const sha1 = external_crypto_namespaceObject.createHash("sha1")
11746
+ .update(rawBarrelDir, "binary")
11747
+ .digest("base64")
11748
+ .replace(/[\/=+]/g, "");
11749
+ const optBarrelDir = external_path_.resolve(barrelDir, `${barrel}-${sha1}`);
11750
+ if (!(0,external_api_cjs_namespaceObject.hasProperty)(optBarrels, barrel)) {
11751
+ optBarrels[barrel] = {
11752
+ rawBarrelDir,
11753
+ manifest,
11754
+ jungleFiles: [...rawJungles],
11755
+ optBarrelDir,
11756
+ };
11757
+ return promise.then(() =>
11758
+ (0,external_util_cjs_namespaceObject.copyRecursiveAsNeeded)(
11759
+ rawBarrelDir,
11760
+ optBarrelDir,
11761
+ (src) => !src.endsWith(".mc")
11762
+ )
11763
+ );
11764
+ }
11765
+ if (
11766
+ optBarrels[barrel].manifest !== manifest ||
11767
+ optBarrels[barrel].optBarrelDir !== optBarrelDir ||
11768
+ optBarrels[barrel].rawBarrelDir != rawBarrelDir
11769
+ ) {
11770
+ throw new Error(
11771
+ `For device ${
11772
+ target.product
11773
+ }, barrel ${barrel} was mapped to both ${external_path_.relative(
11774
+ optBarrels[barrel].rawBarrelDir,
11775
+ optBarrels[barrel].manifest
11776
+ )} in ${optBarrels[barrel].rawBarrelDir} and ${external_path_.relative(
11777
+ rawBarrelDir,
11778
+ manifest
11779
+ )} in ${rawBarrelDir}.`
11780
+ );
11781
+ }
11782
+ optBarrels[barrel].jungleFiles.push(...rawJungles);
11783
+ return promise;
11784
+ },
11785
+ promise
11786
+ );
11787
+ }, Promise.resolve());
11788
+ }
11789
+
8515
11790
  async function generateOptimizedProject(options) {
8516
11791
  const config = await getConfig(options);
8517
11792
  const workspace = config.workspace;
8518
11793
 
8519
- const { manifest, targets, xml } = await get_jungle(
11794
+ const { manifest, targets, xml, jungles } = await get_jungle(
8520
11795
  config.jungleFiles,
8521
11796
  config
8522
11797
  );
11798
+
11799
+ const dependencyFiles = [manifest, ...jungles];
11800
+ await createLocalBarrels(targets, options);
11801
+
8523
11802
  const buildConfigs = {};
8524
11803
  const products = {};
8525
11804
  let pick_one = config.products ? config.products.indexOf("pick-one") : -1;
11805
+ if (config.skipOptimization) {
11806
+ if (pick_one >= 0) {
11807
+ options.products = [...options.products];
11808
+ options.products[pick_one] = targets[0].product;
11809
+ }
11810
+ return {
11811
+ jungleFiles: config.jungleFiles,
11812
+ program: external_path_.basename(external_path_.dirname(manifest)),
11813
+ };
11814
+ }
11815
+ let dropBarrels = false;
11816
+ const configKey = (p) =>
11817
+ p.group.key + (config.releaseBuild ? "-release" : "-debug");
8526
11818
  targets.forEach((p) => {
8527
- const key = p.group.key + (config.releaseBuild ? "-release" : "-debug");
11819
+ const key = configKey(p);
8528
11820
  if (!(0,external_api_cjs_namespaceObject.hasProperty)(buildConfigs, key)) {
8529
11821
  p.group.dir = key;
8530
- buildConfigs[key] = null;
8531
- if (p.group.optimizerConfig["excludeAnnotations"] == null) {
8532
- p.group.optimizerConfig["excludeAnnotations"] = [];
11822
+ if (
11823
+ p.group.optimizerConfig.barrelMap &&
11824
+ !p.group.optimizerConfig.optBarrels
11825
+ ) {
11826
+ dropBarrels = true;
8533
11827
  }
8534
- // Note that we exclude (:debug) in release builds, and we
8535
- // exclude (:release) in debug builds. This isn't backwards!
8536
- p.group.optimizerConfig["excludeAnnotations"].push(
8537
- config.releaseBuild ? "debug" : "release"
8538
- );
11828
+ buildConfigs[key] = null;
8539
11829
  }
8540
11830
  if (
8541
11831
  pick_one >= 0 ||
8542
- !config.products ||
8543
- config.products.includes(p.product) ||
8544
- (p.shape && config.products.includes(p.shape))
11832
+ !options.products ||
11833
+ options.products.includes(p.product) ||
11834
+ (p.shape && options.products.includes(p.shape))
8545
11835
  ) {
8546
11836
  if (pick_one >= 0) {
8547
- config.products[pick_one] = p.product;
11837
+ // don't modify the original array since it may be shared
11838
+ // (and *is* shared when we're called from test.js)
11839
+ options.products = [...options.products];
11840
+ options.products[pick_one] = p.product;
8548
11841
  pick_one = -1;
8549
11842
  }
8550
11843
  if (!buildConfigs[key]) {
@@ -8557,25 +11850,29 @@ async function generateOptimizedProject(options) {
8557
11850
 
8558
11851
  // console.log(JSON.stringify(targets));
8559
11852
 
8560
- const jungle_dir = external_path_namespaceObject.resolve(workspace, config.outputPath);
11853
+ const jungle_dir = external_path_.resolve(workspace, config.outputPath);
8561
11854
  await promises_namespaceObject.mkdir(jungle_dir, { recursive: true });
8562
- const relative_path = (s) => external_path_namespaceObject.relative(jungle_dir, s);
11855
+ const relative_path = (s) => external_path_.relative(jungle_dir, s);
8563
11856
  let relative_manifest = relative_path(manifest);
8564
- const manifestOk = await checkManifest(
8565
- xml,
8566
- targets.map((t) => t.product)
8567
- );
11857
+ const manifestOk =
11858
+ (!config.checkManifest ||
11859
+ (await checkManifest(
11860
+ xml,
11861
+ targets.map((t) => t.product)
11862
+ ))) &&
11863
+ !dropBarrels;
8568
11864
  const promises = Object.keys(buildConfigs)
8569
11865
  .sort()
8570
11866
  .map((key) => {
8571
11867
  const buildConfig = buildConfigs[key];
8572
- const outputPath = external_path_namespaceObject.join(config.outputPath, key);
11868
+ const outputPath = external_path_.join(config.outputPath, key);
8573
11869
 
8574
11870
  return buildConfig
8575
11871
  ? generateOneConfig({
8576
11872
  ...config,
8577
11873
  buildConfig,
8578
11874
  outputPath,
11875
+ dependencyFiles,
8579
11876
  }).catch((e) => {
8580
11877
  if (!e.stack) {
8581
11878
  e = new Error(e.toString());
@@ -8583,58 +11880,101 @@ async function generateOptimizedProject(options) {
8583
11880
  e.products = products[key];
8584
11881
  throw e;
8585
11882
  })
8586
- : promises_namespaceObject.rm(external_path_namespaceObject.resolve(workspace, outputPath), {
11883
+ : promises_namespaceObject.rm(external_path_.resolve(workspace, outputPath), {
8587
11884
  recursive: true,
8588
11885
  force: true,
8589
11886
  });
8590
11887
  });
8591
11888
 
8592
11889
  if (!manifestOk) {
8593
- const manifestFile = external_path_namespaceObject.join(jungle_dir, "manifest.xml");
11890
+ if (dropBarrels) {
11891
+ manifestDropBarrels(xml);
11892
+ }
11893
+ const manifestFile = external_path_.join(jungle_dir, "manifest.xml");
8594
11894
  promises.push(writeManifest(manifestFile, xml));
8595
11895
  relative_manifest = "manifest.xml";
8596
11896
  }
8597
11897
 
8598
11898
  const parts = [`project.manifest=${relative_manifest}`];
8599
- const process_field = (prefix, base, name, map) =>
8600
- base[name] &&
8601
- parts.push(
8602
- `${prefix}${name} = ${base[name]
8603
- .map((s) => (map ? map(s) : s))
8604
- .join(";")}`
8605
- );
11899
+ const process_field = (prefix, base, name, mapper) => {
11900
+ if (!base[name]) return;
11901
+ const map_one = (s) => (mapper ? mapper(s) : s);
11902
+ const map = (s) =>
11903
+ Array.isArray(s) ? `[${s.map(map_one).join(";")}]` : map_one(s);
11904
+ parts.push(`${prefix}${name} = ${base[name].map(map).join(";")}`);
11905
+ };
8606
11906
  targets.forEach((jungle) => {
11907
+ if (!buildConfigs[configKey(jungle)]) return;
8607
11908
  const { product, qualifier, group } = jungle;
8608
11909
  const prefix = `${product}.`;
8609
11910
  process_field(prefix, qualifier, "sourcePath", (s) =>
8610
- external_path_namespaceObject.join(group.dir, external_path_namespaceObject.relative(workspace, s))
8611
- .replace(/(\/\*\*)\/\*/g, "$1")
11911
+ external_path_.join(
11912
+ group.dir,
11913
+ "source",
11914
+ relative_path_no_dotdot(external_path_.relative(workspace, s))
11915
+ )
11916
+ .replace(/([\\\/]\*\*)[\\\/]\*/g, "$1")
8612
11917
  );
11918
+ if (group.optimizerConfig.optBarrels) {
11919
+ parts.push(
11920
+ `${prefix}barrelPath = ${Object.values(group.optimizerConfig.optBarrels)
11921
+ .map(
11922
+ (value) =>
11923
+ `[${value.jungleFiles
11924
+ .map((j) => relative_path(external_path_.join(value.optBarrelDir, j)))
11925
+ .join(";")}]`
11926
+ )
11927
+ .join(";")}`
11928
+ );
11929
+ }
11930
+ if (group.optimizerConfig.barrelMap) {
11931
+ parts.push(
11932
+ `${prefix}sourcePath = ${[`$(${prefix}sourcePath)`]
11933
+ .concat(
11934
+ Object.entries(group.optimizerConfig.barrelMap)
11935
+ .map(([barrel, resolvedBarrel]) => {
11936
+ const root = external_path_.dirname(resolvedBarrel.jungles[0]);
11937
+ return (resolvedBarrel.qualifier.sourcePath || []).map((s) =>
11938
+ external_path_.join(group.dir, "barrels", barrel, external_path_.relative(root, s))
11939
+ .replace(/([\\\/]\*\*)[\\\/]\*/g, "$1")
11940
+ );
11941
+ })
11942
+ .flat()
11943
+ .sort()
11944
+ .filter((s, i, arr) => !i || s !== arr[i - 1])
11945
+ )
11946
+ .join(";")}`
11947
+ );
11948
+ }
11949
+ // annotations were handled via source transformations.
8613
11950
  process_field(prefix, qualifier, "resourcePath", relative_path);
8614
- process_field(prefix, qualifier, "barrelPath", relative_path);
8615
- process_field(prefix, qualifier, "annotations");
8616
11951
  process_field(prefix, qualifier, "excludeAnnotations");
8617
11952
  if (qualifier.lang) {
8618
- Object.entries(qualifier.lang).forEach(([key, value]) => {
8619
- process_field(`${prefix}lang.`, value, key, relative_path);
11953
+ Object.keys(qualifier.lang).forEach((key) => {
11954
+ process_field(`${prefix}lang.`, qualifier.lang, key, relative_path);
8620
11955
  });
8621
11956
  }
8622
11957
  });
8623
11958
 
8624
- const jungleFiles = external_path_namespaceObject.join(
11959
+ const jungleFiles = external_path_.join(
8625
11960
  jungle_dir,
8626
11961
  `${config.releaseBuild ? "release" : "debug"}.jungle`
8627
11962
  );
8628
11963
  promises.push(promises_namespaceObject.writeFile(jungleFiles, parts.join("\n")));
8629
11964
 
8630
11965
  await Promise.all(promises);
8631
- return { jungleFiles, program: external_path_namespaceObject.basename(external_path_namespaceObject.dirname(manifest)) };
11966
+ return {
11967
+ jungleFiles,
11968
+ program: external_path_.basename(external_path_.dirname(manifest)),
11969
+ };
8632
11970
  }
8633
11971
 
8634
- async function generateOneConfig(config) {
8635
- const { workspace, buildConfig } = config;
8636
- const output = external_path_namespaceObject.join(workspace, config.outputPath);
8637
-
11972
+ async function fileInfoFromConfig(
11973
+ workspace,
11974
+ output,
11975
+ buildConfig,
11976
+ extraExcludes
11977
+ ) {
8638
11978
  const paths = (
8639
11979
  await Promise.all(
8640
11980
  buildConfig.sourcePath.map((pattern) =>
@@ -8653,27 +11993,128 @@ async function generateOneConfig(config) {
8653
11993
  )
8654
11994
  )
8655
11995
  .flat()
8656
- .filter((file) => !file.endsWith("/"))
8657
- .map((file) => external_path_namespaceObject.relative(workspace, file))
8658
- .filter((file) => !file.startsWith("bin"));
11996
+ .filter(
11997
+ (file) =>
11998
+ file.endsWith(".mc") &&
11999
+ !external_path_.relative(workspace, file).startsWith("bin") &&
12000
+ (!buildConfig.sourceExcludes ||
12001
+ !buildConfig.sourceExcludes.includes(file))
12002
+ );
12003
+
12004
+ const excludeAnnotations = Object.assign(
12005
+ buildConfig.excludeAnnotations
12006
+ ? Object.fromEntries(
12007
+ buildConfig.excludeAnnotations.map((ex) => [ex, true])
12008
+ )
12009
+ : {},
12010
+ extraExcludes
12011
+ );
12012
+
12013
+ return Object.fromEntries(
12014
+ files.map((file) => [
12015
+ file,
12016
+ {
12017
+ output: external_path_.join(
12018
+ output,
12019
+ relative_path_no_dotdot(external_path_.relative(workspace, file))
12020
+ ),
12021
+ excludeAnnotations,
12022
+ },
12023
+ ])
12024
+ );
12025
+ }
12026
+
12027
+ function excludesFromAnnotations(barrel, annotations, resolvedBarrel) {
12028
+ const excludes = resolvedBarrel.annotations
12029
+ ? Object.fromEntries(resolvedBarrel.annotations.map((a) => [a, true]))
12030
+ : {};
12031
+ if (annotations && annotations[barrel]) {
12032
+ annotations[barrel].forEach((a) => {
12033
+ delete excludes[a];
12034
+ });
12035
+ }
12036
+ return excludes;
12037
+ }
8659
12038
 
8660
- const fnMap = Object.fromEntries(
8661
- files
8662
- .filter((src) => /\.mc$/.test(src))
8663
- .map((file) => [external_path_namespaceObject.join(workspace, file), external_path_namespaceObject.join(output, file)])
12039
+ async function generateOneConfig(config) {
12040
+ const { workspace, buildConfig } = config;
12041
+ const output = external_path_.join(workspace, config.outputPath);
12042
+
12043
+ const dependencyFiles = [...config.dependencyFiles];
12044
+
12045
+ const buildModeExcludes = {
12046
+ // note: exclude debug in release builds, and release in debug builds
12047
+ [config.releaseBuild ? "debug" : "release"]: true,
12048
+ };
12049
+
12050
+ const fnMap = await fileInfoFromConfig(
12051
+ workspace,
12052
+ external_path_.join(output, "source"),
12053
+ buildConfig,
12054
+ buildModeExcludes
8664
12055
  );
8665
12056
 
8666
- const source_time = await (0,external_util_cjs_namespaceObject.last_modified)(Object.keys(fnMap));
8667
- const opt_time = await (0,external_util_cjs_namespaceObject.first_modified)(Object.values(fnMap));
8668
- if (source_time < opt_time) return;
12057
+ if (buildConfig.barrelMap) {
12058
+ const barrelFnMaps = await Promise.all(
12059
+ Object.entries(buildConfig.barrelMap)
12060
+ .map(([barrel, resolvedBarrel]) => {
12061
+ dependencyFiles.push(
12062
+ ...resolvedBarrel.jungles,
12063
+ resolvedBarrel.manifest
12064
+ );
12065
+ return fileInfoFromConfig(
12066
+ external_path_.dirname(resolvedBarrel.jungles[0]),
12067
+ external_path_.join(output, "barrels", barrel),
12068
+ resolvedBarrel.qualifier,
12069
+ {
12070
+ ...buildModeExcludes,
12071
+ ...excludesFromAnnotations(
12072
+ barrel,
12073
+ buildConfig.annotations,
12074
+ resolvedBarrel
12075
+ ),
12076
+ }
12077
+ );
12078
+ })
12079
+ .flat()
12080
+ );
12081
+ barrelFnMaps.forEach((barrelFnMap) => Object.assign(fnMap, barrelFnMap));
12082
+ }
12083
+
12084
+ const actualOptimizedFiles = (
12085
+ await (0,external_util_cjs_namespaceObject.globa)(external_path_.join(output, "**", "*.mc"), { mark: true })
12086
+ )
12087
+ .filter((file) => !file.endsWith("/"))
12088
+ .sort();
12089
+
12090
+ // check that the set of files thats actually there is the same as the
12091
+ // set of files we're going to generate (in case eg a jungle file change
12092
+ // might have altered it)
12093
+ if (
12094
+ actualOptimizedFiles.length == Object.values(fnMap).length &&
12095
+ Object.values(fnMap)
12096
+ .map((v) => v.output)
12097
+ .sort()
12098
+ .every((f, i) => f == actualOptimizedFiles[i])
12099
+ ) {
12100
+ // now if the newest source file is older than
12101
+ // the oldest optimized file, we don't need to regenerate
12102
+ const source_time = await (0,external_util_cjs_namespaceObject.last_modified)(
12103
+ Object.keys(fnMap).concat(dependencyFiles)
12104
+ );
12105
+ const opt_time = await (0,external_util_cjs_namespaceObject.first_modified)(
12106
+ Object.values(fnMap).map((v) => v.output)
12107
+ );
12108
+ if (source_time < opt_time && 1652050734499 < opt_time) return;
12109
+ }
8669
12110
 
8670
12111
  await promises_namespaceObject.rm(output, { recursive: true, force: true });
8671
12112
  await promises_namespaceObject.mkdir(output, { recursive: true });
8672
- const optFiles = await optimizeMonkeyC(Object.keys(fnMap), buildConfig);
12113
+ const optFiles = await optimizeMonkeyC(fnMap);
8673
12114
  return await Promise.all(
8674
12115
  optFiles.map(async (file) => {
8675
- const name = fnMap[file.name];
8676
- const dir = external_path_namespaceObject.dirname(name);
12116
+ const name = fnMap[file.name].output;
12117
+ const dir = external_path_.dirname(name);
8677
12118
  await promises_namespaceObject.mkdir(dir, { recursive: true });
8678
12119
 
8679
12120
  const opt_source = (0,external_api_cjs_namespaceObject.formatAst)(file.ast);