@intelligentgraphics/ig.gfx.packager 3.0.3 → 3.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/build/cli-2c3347fd.js +2487 -0
  2. package/build/cli-2c3347fd.js.map +1 -0
  3. package/build/{lib/dependencies.mjs → dependencies-300450ae.js} +62 -4
  4. package/build/dependencies-300450ae.js.map +1 -0
  5. package/build/generate-97bb8b12.js +231 -0
  6. package/build/generate-97bb8b12.js.map +1 -0
  7. package/build/{commands/build/index.mjs → index-01b0ddab.js} +151 -8
  8. package/build/index-01b0ddab.js.map +1 -0
  9. package/build/{commands/publish/index.mjs → index-f59e50ec.js} +181 -16
  10. package/build/index-f59e50ec.js.map +1 -0
  11. package/build/index.mjs +1 -1
  12. package/build/index.mjs.map +1 -1
  13. package/build/{commands/postinstall.mjs → postinstall-5bba19eb.js} +18 -8
  14. package/build/postinstall-5bba19eb.js.map +1 -0
  15. package/build/{commands/publishNpm.mjs → publishNpm-eb07f766.js} +21 -9
  16. package/build/publishNpm-eb07f766.js.map +1 -0
  17. package/build/versionFile-af5ed4bc.js +370 -0
  18. package/build/versionFile-af5ed4bc.js.map +1 -0
  19. package/package.json +8 -7
  20. package/readme.md +107 -32
  21. package/build/cli.mjs +0 -313
  22. package/build/cli.mjs.map +0 -1
  23. package/build/commands/build/docs.mjs +0 -34
  24. package/build/commands/build/docs.mjs.map +0 -1
  25. package/build/commands/build/index.mjs.map +0 -1
  26. package/build/commands/build/tsc.mjs +0 -84
  27. package/build/commands/build/tsc.mjs.map +0 -1
  28. package/build/commands/generate.mjs +0 -182
  29. package/build/commands/generate.mjs.map +0 -1
  30. package/build/commands/postinstall.mjs.map +0 -1
  31. package/build/commands/publish/index.mjs.map +0 -1
  32. package/build/commands/publish/zip.mjs +0 -168
  33. package/build/commands/publish/zip.mjs.map +0 -1
  34. package/build/commands/publishNpm.mjs.map +0 -1
  35. package/build/lib/assetService.mjs +0 -111
  36. package/build/lib/assetService.mjs.map +0 -1
  37. package/build/lib/banner.mjs +0 -20
  38. package/build/lib/banner.mjs.map +0 -1
  39. package/build/lib/dependencies.mjs.map +0 -1
  40. package/build/lib/error.mjs +0 -15
  41. package/build/lib/error.mjs.map +0 -1
  42. package/build/lib/fs.mjs +0 -19
  43. package/build/lib/fs.mjs.map +0 -1
  44. package/build/lib/git.mjs +0 -37
  45. package/build/lib/git.mjs.map +0 -1
  46. package/build/lib/log.mjs +0 -9
  47. package/build/lib/log.mjs.map +0 -1
  48. package/build/lib/npmPackage.mjs +0 -19
  49. package/build/lib/npmPackage.mjs.map +0 -1
  50. package/build/lib/package.mjs +0 -129
  51. package/build/lib/package.mjs.map +0 -1
  52. package/build/lib/packageVersion.mjs +0 -174
  53. package/build/lib/packageVersion.mjs.map +0 -1
  54. package/build/lib/parseVersion.mjs +0 -54
  55. package/build/lib/parseVersion.mjs.map +0 -1
  56. package/build/lib/prompter.mjs +0 -31
  57. package/build/lib/prompter.mjs.map +0 -1
  58. package/build/lib/publishedPackage.mjs +0 -66
  59. package/build/lib/publishedPackage.mjs.map +0 -1
  60. package/build/lib/scripts.mjs +0 -10
  61. package/build/lib/scripts.mjs.map +0 -1
  62. package/build/lib/stripUtf8Bom.mjs +0 -11
  63. package/build/lib/stripUtf8Bom.mjs.map +0 -1
  64. package/build/lib/toposort.mjs +0 -26
  65. package/build/lib/toposort.mjs.map +0 -1
  66. package/build/lib/versionFile.mjs +0 -78
  67. package/build/lib/versionFile.mjs.map +0 -1
  68. package/build/lib/workspace.mjs +0 -51
  69. package/build/lib/workspace.mjs.map +0 -1
@@ -0,0 +1,2487 @@
1
+ import updateNotifier from 'update-notifier';
2
+ import * as fs$1 from 'fs';
3
+ import fs__default from 'fs';
4
+ import * as path$1 from 'path';
5
+ import path__default from 'path';
6
+ import yargs from 'yargs/yargs';
7
+ import { fileURLToPath } from 'url';
8
+ import glob from 'glob';
9
+ import 'resolve';
10
+ import { writePackageSync } from 'write-pkg';
11
+ import 'node:path';
12
+ import 'node:fs';
13
+ import require$$0 from 'assert';
14
+ import require$$2 from 'events';
15
+ import require$$6 from 'util';
16
+ import axios from 'axios';
17
+ import inquirer from 'inquirer';
18
+
19
+ const stripUtf8Bom = text => {
20
+ // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string
21
+ // conversion translates it to FEFF (UTF-16 BOM).
22
+ if (text.charCodeAt(0) === 0xfeff) {
23
+ return text.slice(1);
24
+ }
25
+ return text;
26
+ };
27
+
28
+ const readNpmManifest = directory => {
29
+ const packageJsonPath = path$1.join(directory, "package.json");
30
+ const packageJson = stripUtf8Bom(fs$1.readFileSync(packageJsonPath, {
31
+ encoding: "utf8"
32
+ }));
33
+ return JSON.parse(packageJson);
34
+ };
35
+ const writeNpmManifest = (directory, packageJson) => {
36
+ const packageJsonPath = path$1.join(directory, "package.json");
37
+ writePackageSync(packageJsonPath, packageJson);
38
+ };
39
+
40
+ const getNodeErrorCode = error => {
41
+ if (error !== null && typeof error === "object" && error.code !== undefined) {
42
+ return error.code;
43
+ }
44
+ };
45
+
46
+ /**
47
+ * No such file or directory: Commonly raised by fs operations to indicate that a component of the specified pathname does not exist. No entity (file or directory) could be found by the given path.
48
+ *
49
+ * @param {unknown} error
50
+ */
51
+ const isErrorENOENT = error => getNodeErrorCode(error) === "ENOENT";
52
+
53
+ // Functionality related to working with a single package.
54
+ const PACKAGE_FILE = "_Package.json";
55
+ const INDEX_FILE = "_Index.json";
56
+ const ANIMATION_FILE_SUFFIX = ".animation.json";
57
+
58
+ /**
59
+ * Describes the location of a single package.
60
+ *
61
+ * @export
62
+ * @interface PackageLocation
63
+ */
64
+
65
+ const parseCreatorPackageName = manifest => {
66
+ const [domain, ...subdomainParts] = manifest.Package.split(".");
67
+ return {
68
+ domain,
69
+ subdomain: subdomainParts.join(".")
70
+ };
71
+ };
72
+ /**
73
+ * Detects the package at the given directory.
74
+ *
75
+ * @param {string} directory
76
+ * @returns {PackageLocation}
77
+ */
78
+ const detectPackage = (workspace, directory) => {
79
+ directory = path$1.resolve(workspace.path, directory);
80
+ const scriptsPath = path$1.join(directory, "Scripts");
81
+ const tsPath = path$1.join(directory, "ts");
82
+ let location;
83
+ if (fs$1.existsSync(scriptsPath)) {
84
+ location = {
85
+ _kind: "PackageLocation",
86
+ path: directory,
87
+ scriptsDir: scriptsPath,
88
+ manifestDir: scriptsPath
89
+ };
90
+ } else if (fs$1.existsSync(tsPath)) {
91
+ location = {
92
+ _kind: "PackageLocation",
93
+ path: directory,
94
+ scriptsDir: tsPath,
95
+ manifestDir: directory
96
+ };
97
+ } else {
98
+ location = {
99
+ _kind: "PackageLocation",
100
+ path: directory,
101
+ scriptsDir: directory,
102
+ manifestDir: directory
103
+ };
104
+ }
105
+ try {
106
+ readPackageCreatorManifest(location);
107
+ } catch (err) {
108
+ if (isErrorENOENT(err)) {
109
+ throw new Error(`No _Package.json found in ${location.manifestDir}`);
110
+ }
111
+ throw err;
112
+ }
113
+ return location;
114
+ };
115
+ const readPackageCreatorManifest = location => {
116
+ const packageJsonPath = path$1.join(location.manifestDir, PACKAGE_FILE);
117
+ const packageJson = stripUtf8Bom(fs$1.readFileSync(packageJsonPath, {
118
+ encoding: "utf8"
119
+ }));
120
+ const result = JSON.parse(packageJson);
121
+ return {
122
+ ...result,
123
+ Scope: result.Scope || result.Package
124
+ };
125
+ };
126
+ const writePackageCreatorManifest = (location, creatorPackage) => {
127
+ const packageJsonPath = path$1.join(location.manifestDir, PACKAGE_FILE);
128
+ fs$1.writeFileSync(packageJsonPath, JSON.stringify(creatorPackage, null, "\t") + "\n");
129
+ };
130
+ const getPackageCreatorIndexPath = location => path$1.join(location.manifestDir, INDEX_FILE);
131
+ const readPackageCreatorIndex = location => {
132
+ try {
133
+ const indexPath = getPackageCreatorIndexPath(location);
134
+ const index = stripUtf8Bom(fs$1.readFileSync(indexPath, {
135
+ encoding: "utf8"
136
+ }));
137
+ return JSON.parse(index);
138
+ } catch (err) {
139
+ if (isErrorENOENT(err)) {
140
+ return undefined;
141
+ }
142
+ throw err;
143
+ }
144
+ };
145
+ const writePackageCreatorIndex = (location, index) => {
146
+ const indexPath = getPackageCreatorIndexPath(location);
147
+ fs$1.writeFileSync(indexPath, JSON.stringify(index, null, "\t") + "\n");
148
+ };
149
+ const readPackageNpmManifest = location => {
150
+ try {
151
+ return readNpmManifest(location.manifestDir);
152
+ } catch (err) {
153
+ if (isErrorENOENT(err)) {
154
+ return undefined;
155
+ }
156
+ throw err;
157
+ }
158
+ };
159
+ const writePackageNpmManifest = (location, packageJson) => {
160
+ writeNpmManifest(location.manifestDir, packageJson);
161
+ };
162
+ const readPackageAnimationList = location => {
163
+ const directoryContent = fs$1.readdirSync(location.manifestDir);
164
+ const animationPathList = [];
165
+ for (const entry of directoryContent) {
166
+ if (entry.endsWith(ANIMATION_FILE_SUFFIX)) {
167
+ const animationPath = path$1.join(location.manifestDir, entry);
168
+ animationPathList.push(animationPath);
169
+ }
170
+ }
171
+ return animationPathList;
172
+ };
173
+ const getPackageReleasesDirectory = location => path$1.join(location.path, "Releases");
174
+
175
+ // Functionality related to working with a workspace consisting of multiple packages.
176
+
177
+ /**
178
+ * Describe the location of a workspace constining of n packages.
179
+ *
180
+ * @export
181
+ * @interface WorkspaceLocation
182
+ */
183
+
184
+ const detectWorkspace = directory => {
185
+ directory = path$1.resolve(process.cwd(), directory);
186
+ return {
187
+ _kind: "WorkspaceLocation",
188
+ path: directory
189
+ };
190
+ };
191
+ const readWorkspaceNpmManifest = workspace => {
192
+ try {
193
+ return readNpmManifest(workspace.path);
194
+ } catch (err) {
195
+ if (isErrorENOENT(err)) {
196
+ throw new Error(`Expected a package.json file to exist in ${workspace.path}. See packager readme for instructions on how to create the package.json.`);
197
+ }
198
+ throw err;
199
+ }
200
+ };
201
+ const writeWorkspaceNpmManifest = (workspace, packageJson) => writeNpmManifest(workspace.path, packageJson);
202
+ const getWorkspaceOutputPath = workspace => path$1.join(workspace.path, "bin");
203
+ const getWorkspaceLibPath = workspace => path$1.join(workspace.path, "lib");
204
+ function* iterateWorkspacePackages(workspace) {
205
+ const entries = fs$1.readdirSync(workspace.path, {
206
+ withFileTypes: true
207
+ });
208
+ for (const entry of entries) {
209
+ if (!entry.isDirectory()) {
210
+ continue;
211
+ }
212
+ try {
213
+ yield detectPackage(workspace, entry.name);
214
+ } catch {}
215
+ }
216
+ }
217
+
218
+ const getPackageTypescriptFiles = location => glob.sync("**/*.ts", {
219
+ absolute: true,
220
+ cwd: location.scriptsDir,
221
+ ignore: "node_modules/**/*"
222
+ });
223
+
224
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
225
+
226
+ var writeFileAtomicExports = {};
227
+ var writeFileAtomic = {
228
+ get exports(){ return writeFileAtomicExports; },
229
+ set exports(v){ writeFileAtomicExports = v; },
230
+ };
231
+
232
+ var imurmurhashExports = {};
233
+ var imurmurhash = {
234
+ get exports(){ return imurmurhashExports; },
235
+ set exports(v){ imurmurhashExports = v; },
236
+ };
237
+
238
+ /**
239
+ * @preserve
240
+ * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
241
+ *
242
+ * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
243
+ * @see http://github.com/homebrewing/brauhaus-diff
244
+ * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
245
+ * @see http://github.com/garycourt/murmurhash-js
246
+ * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
247
+ * @see http://sites.google.com/site/murmurhash/
248
+ */
249
+ (function (module) {
250
+ (function () {
251
+ var cache;
252
+
253
+ // Call this function without `new` to use the cached object (good for
254
+ // single-threaded environments), or with `new` to create a new object.
255
+ //
256
+ // @param {string} key A UTF-16 or ASCII string
257
+ // @param {number} seed An optional positive integer
258
+ // @return {object} A MurmurHash3 object for incremental hashing
259
+ function MurmurHash3(key, seed) {
260
+ var m = this instanceof MurmurHash3 ? this : cache;
261
+ m.reset(seed);
262
+ if (typeof key === 'string' && key.length > 0) {
263
+ m.hash(key);
264
+ }
265
+ if (m !== this) {
266
+ return m;
267
+ }
268
+ }
269
+
270
+ // Incrementally add a string to this hash
271
+ //
272
+ // @param {string} key A UTF-16 or ASCII string
273
+ // @return {object} this
274
+ MurmurHash3.prototype.hash = function (key) {
275
+ var h1, k1, i, top, len;
276
+ len = key.length;
277
+ this.len += len;
278
+ k1 = this.k1;
279
+ i = 0;
280
+ switch (this.rem) {
281
+ case 0:
282
+ k1 ^= len > i ? key.charCodeAt(i++) & 0xffff : 0;
283
+ case 1:
284
+ k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0;
285
+ case 2:
286
+ k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0;
287
+ case 3:
288
+ k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0;
289
+ k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0;
290
+ }
291
+ this.rem = len + this.rem & 3; // & 3 is same as % 4
292
+ len -= this.rem;
293
+ if (len > 0) {
294
+ h1 = this.h1;
295
+ while (1) {
296
+ k1 = k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000 & 0xffffffff;
297
+ k1 = k1 << 15 | k1 >>> 17;
298
+ k1 = k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000 & 0xffffffff;
299
+ h1 ^= k1;
300
+ h1 = h1 << 13 | h1 >>> 19;
301
+ h1 = h1 * 5 + 0xe6546b64 & 0xffffffff;
302
+ if (i >= len) {
303
+ break;
304
+ }
305
+ k1 = key.charCodeAt(i++) & 0xffff ^ (key.charCodeAt(i++) & 0xffff) << 8 ^ (key.charCodeAt(i++) & 0xffff) << 16;
306
+ top = key.charCodeAt(i++);
307
+ k1 ^= (top & 0xff) << 24 ^ (top & 0xff00) >> 8;
308
+ }
309
+ k1 = 0;
310
+ switch (this.rem) {
311
+ case 3:
312
+ k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16;
313
+ case 2:
314
+ k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8;
315
+ case 1:
316
+ k1 ^= key.charCodeAt(i) & 0xffff;
317
+ }
318
+ this.h1 = h1;
319
+ }
320
+ this.k1 = k1;
321
+ return this;
322
+ };
323
+
324
+ // Get the result of this hash
325
+ //
326
+ // @return {number} The 32-bit hash
327
+ MurmurHash3.prototype.result = function () {
328
+ var k1, h1;
329
+ k1 = this.k1;
330
+ h1 = this.h1;
331
+ if (k1 > 0) {
332
+ k1 = k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000 & 0xffffffff;
333
+ k1 = k1 << 15 | k1 >>> 17;
334
+ k1 = k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000 & 0xffffffff;
335
+ h1 ^= k1;
336
+ }
337
+ h1 ^= this.len;
338
+ h1 ^= h1 >>> 16;
339
+ h1 = h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000 & 0xffffffff;
340
+ h1 ^= h1 >>> 13;
341
+ h1 = h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000 & 0xffffffff;
342
+ h1 ^= h1 >>> 16;
343
+ return h1 >>> 0;
344
+ };
345
+
346
+ // Reset the hash object for reuse
347
+ //
348
+ // @param {number} seed An optional positive integer
349
+ MurmurHash3.prototype.reset = function (seed) {
350
+ this.h1 = typeof seed === 'number' ? seed : 0;
351
+ this.rem = this.k1 = this.len = 0;
352
+ return this;
353
+ };
354
+
355
+ // A cached object to use. This can be safely used if you're in a single-
356
+ // threaded environment, otherwise you need to create new hashes to use.
357
+ cache = new MurmurHash3();
358
+ {
359
+ module.exports = MurmurHash3;
360
+ }
361
+ })();
362
+ })(imurmurhash);
363
+
364
+ var signalExitExports = {};
365
+ var signalExit = {
366
+ get exports(){ return signalExitExports; },
367
+ set exports(v){ signalExitExports = v; },
368
+ };
369
+
370
+ var signalsExports = {};
371
+ var signals$1 = {
372
+ get exports(){ return signalsExports; },
373
+ set exports(v){ signalsExports = v; },
374
+ };
375
+
376
+ var hasRequiredSignals;
377
+ function requireSignals() {
378
+ if (hasRequiredSignals) return signalsExports;
379
+ hasRequiredSignals = 1;
380
+ (function (module) {
381
+ // This is not the set of all possible signals.
382
+ //
383
+ // It IS, however, the set of all signals that trigger
384
+ // an exit on either Linux or BSD systems. Linux is a
385
+ // superset of the signal names supported on BSD, and
386
+ // the unknown signals just fail to register, so we can
387
+ // catch that easily enough.
388
+ //
389
+ // Don't bother with SIGKILL. It's uncatchable, which
390
+ // means that we can't fire any callbacks anyway.
391
+ //
392
+ // If a user does happen to register a handler on a non-
393
+ // fatal signal like SIGWINCH or something, and then
394
+ // exit, it'll end up firing `process.emit('exit')`, so
395
+ // the handler will be fired anyway.
396
+ //
397
+ // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
398
+ // artificially, inherently leave the process in a
399
+ // state from which it is not safe to try and enter JS
400
+ // listeners.
401
+ module.exports = ['SIGABRT', 'SIGALRM', 'SIGHUP', 'SIGINT', 'SIGTERM'];
402
+ if (process.platform !== 'win32') {
403
+ module.exports.push('SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'
404
+ // should detect profiler and enable/disable accordingly.
405
+ // see #21
406
+ // 'SIGPROF'
407
+ );
408
+ }
409
+
410
+ if (process.platform === 'linux') {
411
+ module.exports.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED');
412
+ }
413
+ })(signals$1);
414
+ return signalsExports;
415
+ }
416
+
417
+ // Note: since nyc uses this module to output coverage, any lines
418
+ // that are in the direct sync flow of nyc's outputCoverage are
419
+ // ignored, since we can never get coverage for them.
420
+ // grab a reference to node's real process object right away
421
+ var process$2 = commonjsGlobal.process;
422
+ const processOk = function (process) {
423
+ return process && typeof process === 'object' && typeof process.removeListener === 'function' && typeof process.emit === 'function' && typeof process.reallyExit === 'function' && typeof process.listeners === 'function' && typeof process.kill === 'function' && typeof process.pid === 'number' && typeof process.on === 'function';
424
+ };
425
+
426
+ // some kind of non-node environment, just no-op
427
+ /* istanbul ignore if */
428
+ if (!processOk(process$2)) {
429
+ signalExit.exports = function () {
430
+ return function () {};
431
+ };
432
+ } else {
433
+ var assert = require$$0;
434
+ var signals = requireSignals();
435
+ var isWin = /^win/i.test(process$2.platform);
436
+ var EE = require$$2;
437
+ /* istanbul ignore if */
438
+ if (typeof EE !== 'function') {
439
+ EE = EE.EventEmitter;
440
+ }
441
+ var emitter;
442
+ if (process$2.__signal_exit_emitter__) {
443
+ emitter = process$2.__signal_exit_emitter__;
444
+ } else {
445
+ emitter = process$2.__signal_exit_emitter__ = new EE();
446
+ emitter.count = 0;
447
+ emitter.emitted = {};
448
+ }
449
+
450
+ // Because this emitter is a global, we have to check to see if a
451
+ // previous version of this library failed to enable infinite listeners.
452
+ // I know what you're about to say. But literally everything about
453
+ // signal-exit is a compromise with evil. Get used to it.
454
+ if (!emitter.infinite) {
455
+ emitter.setMaxListeners(Infinity);
456
+ emitter.infinite = true;
457
+ }
458
+ signalExit.exports = function (cb, opts) {
459
+ /* istanbul ignore if */
460
+ if (!processOk(commonjsGlobal.process)) {
461
+ return function () {};
462
+ }
463
+ assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler');
464
+ if (loaded === false) {
465
+ load();
466
+ }
467
+ var ev = 'exit';
468
+ if (opts && opts.alwaysLast) {
469
+ ev = 'afterexit';
470
+ }
471
+ var remove = function () {
472
+ emitter.removeListener(ev, cb);
473
+ if (emitter.listeners('exit').length === 0 && emitter.listeners('afterexit').length === 0) {
474
+ unload();
475
+ }
476
+ };
477
+ emitter.on(ev, cb);
478
+ return remove;
479
+ };
480
+ var unload = function unload() {
481
+ if (!loaded || !processOk(commonjsGlobal.process)) {
482
+ return;
483
+ }
484
+ loaded = false;
485
+ signals.forEach(function (sig) {
486
+ try {
487
+ process$2.removeListener(sig, sigListeners[sig]);
488
+ } catch (er) {}
489
+ });
490
+ process$2.emit = originalProcessEmit;
491
+ process$2.reallyExit = originalProcessReallyExit;
492
+ emitter.count -= 1;
493
+ };
494
+ signalExitExports.unload = unload;
495
+ var emit = function emit(event, code, signal) {
496
+ /* istanbul ignore if */
497
+ if (emitter.emitted[event]) {
498
+ return;
499
+ }
500
+ emitter.emitted[event] = true;
501
+ emitter.emit(event, code, signal);
502
+ };
503
+
504
+ // { <signal>: <listener fn>, ... }
505
+ var sigListeners = {};
506
+ signals.forEach(function (sig) {
507
+ sigListeners[sig] = function listener() {
508
+ /* istanbul ignore if */
509
+ if (!processOk(commonjsGlobal.process)) {
510
+ return;
511
+ }
512
+ // If there are no other listeners, an exit is coming!
513
+ // Simplest way: remove us and then re-send the signal.
514
+ // We know that this will kill the process, so we can
515
+ // safely emit now.
516
+ var listeners = process$2.listeners(sig);
517
+ if (listeners.length === emitter.count) {
518
+ unload();
519
+ emit('exit', null, sig);
520
+ /* istanbul ignore next */
521
+ emit('afterexit', null, sig);
522
+ /* istanbul ignore next */
523
+ if (isWin && sig === 'SIGHUP') {
524
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
525
+ // so use a supported signal instead
526
+ sig = 'SIGINT';
527
+ }
528
+ /* istanbul ignore next */
529
+ process$2.kill(process$2.pid, sig);
530
+ }
531
+ };
532
+ });
533
+ signalExitExports.signals = function () {
534
+ return signals;
535
+ };
536
+ var loaded = false;
537
+ var load = function load() {
538
+ if (loaded || !processOk(commonjsGlobal.process)) {
539
+ return;
540
+ }
541
+ loaded = true;
542
+
543
+ // This is the number of onSignalExit's that are in play.
544
+ // It's important so that we can count the correct number of
545
+ // listeners on signals, and don't wait for the other one to
546
+ // handle it instead of us.
547
+ emitter.count += 1;
548
+ signals = signals.filter(function (sig) {
549
+ try {
550
+ process$2.on(sig, sigListeners[sig]);
551
+ return true;
552
+ } catch (er) {
553
+ return false;
554
+ }
555
+ });
556
+ process$2.emit = processEmit;
557
+ process$2.reallyExit = processReallyExit;
558
+ };
559
+ signalExitExports.load = load;
560
+ var originalProcessReallyExit = process$2.reallyExit;
561
+ var processReallyExit = function processReallyExit(code) {
562
+ /* istanbul ignore if */
563
+ if (!processOk(commonjsGlobal.process)) {
564
+ return;
565
+ }
566
+ process$2.exitCode = code || /* istanbul ignore next */0;
567
+ emit('exit', process$2.exitCode, null);
568
+ /* istanbul ignore next */
569
+ emit('afterexit', process$2.exitCode, null);
570
+ /* istanbul ignore next */
571
+ originalProcessReallyExit.call(process$2, process$2.exitCode);
572
+ };
573
+ var originalProcessEmit = process$2.emit;
574
+ var processEmit = function processEmit(ev, arg) {
575
+ if (ev === 'exit' && processOk(commonjsGlobal.process)) {
576
+ /* istanbul ignore else */
577
+ if (arg !== undefined) {
578
+ process$2.exitCode = arg;
579
+ }
580
+ var ret = originalProcessEmit.apply(this, arguments);
581
+ /* istanbul ignore next */
582
+ emit('exit', process$2.exitCode, null);
583
+ /* istanbul ignore next */
584
+ emit('afterexit', process$2.exitCode, null);
585
+ /* istanbul ignore next */
586
+ return ret;
587
+ } else {
588
+ return originalProcessEmit.apply(this, arguments);
589
+ }
590
+ };
591
+ }
592
+
593
+ var check = function (it) {
594
+ return it && it.Math == Math && it;
595
+ };
596
+
597
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
598
+ var global$b =
599
+ // eslint-disable-next-line es/no-global-this -- safe
600
+ check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) ||
601
+ // eslint-disable-next-line no-restricted-globals -- safe
602
+ check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
603
+ // eslint-disable-next-line no-new-func -- fallback
604
+ function () {
605
+ return this;
606
+ }() || Function('return this')();
607
+
608
+ var fails$8 = function (exec) {
609
+ try {
610
+ return !!exec();
611
+ } catch (error) {
612
+ return true;
613
+ }
614
+ };
615
+
616
+ var fails$7 = fails$8;
617
+ var functionBindNative = !fails$7(function () {
618
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
619
+ var test = function () {/* empty */}.bind();
620
+ // eslint-disable-next-line no-prototype-builtins -- safe
621
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
622
+ });
623
+
624
+ var NATIVE_BIND$1 = functionBindNative;
625
+ var call$4 = Function.prototype.call;
626
+ var functionCall = NATIVE_BIND$1 ? call$4.bind(call$4) : function () {
627
+ return call$4.apply(call$4, arguments);
628
+ };
629
+
630
+ // eslint-disable-next-line es/no-typed-arrays -- safe
631
+ var arrayBufferBasicDetection = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
632
+
633
+ var fails$6 = fails$8;
634
+
635
+ // Detect IE8's incomplete defineProperty implementation
636
+ var descriptors = !fails$6(function () {
637
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
638
+ return Object.defineProperty({}, 1, {
639
+ get: function () {
640
+ return 7;
641
+ }
642
+ })[1] != 7;
643
+ });
644
+
645
+ var documentAll$2 = typeof document == 'object' && document.all;
646
+
647
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
648
+ // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
649
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
650
+ var documentAll_1 = {
651
+ all: documentAll$2,
652
+ IS_HTMLDDA: IS_HTMLDDA
653
+ };
654
+
655
+ var $documentAll$1 = documentAll_1;
656
+ var documentAll$1 = $documentAll$1.all;
657
+
658
+ // `IsCallable` abstract operation
659
+ // https://tc39.es/ecma262/#sec-iscallable
660
+ var isCallable$d = $documentAll$1.IS_HTMLDDA ? function (argument) {
661
+ return typeof argument == 'function' || argument === documentAll$1;
662
+ } : function (argument) {
663
+ return typeof argument == 'function';
664
+ };
665
+
666
+ var isCallable$c = isCallable$d;
667
+ var $documentAll = documentAll_1;
668
+ var documentAll = $documentAll.all;
669
+ var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
670
+ return typeof it == 'object' ? it !== null : isCallable$c(it) || it === documentAll;
671
+ } : function (it) {
672
+ return typeof it == 'object' ? it !== null : isCallable$c(it);
673
+ };
674
+
675
+ var NATIVE_BIND = functionBindNative;
676
+ var FunctionPrototype$1 = Function.prototype;
677
+ var call$3 = FunctionPrototype$1.call;
678
+ var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype$1.bind.bind(call$3, call$3);
679
+ var functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
680
+ return function () {
681
+ return call$3.apply(fn, arguments);
682
+ };
683
+ };
684
+
685
+ // we can't use just `it == null` since of `document.all` special case
686
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
687
+ var isNullOrUndefined$2 = function (it) {
688
+ return it === null || it === undefined;
689
+ };
690
+
691
+ var isNullOrUndefined$1 = isNullOrUndefined$2;
692
+ var $TypeError$6 = TypeError;
693
+
694
+ // `RequireObjectCoercible` abstract operation
695
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
696
+ var requireObjectCoercible$1 = function (it) {
697
+ if (isNullOrUndefined$1(it)) throw $TypeError$6("Can't call method on " + it);
698
+ return it;
699
+ };
700
+
701
+ var requireObjectCoercible = requireObjectCoercible$1;
702
+ var $Object$3 = Object;
703
+
704
+ // `ToObject` abstract operation
705
+ // https://tc39.es/ecma262/#sec-toobject
706
+ var toObject$2 = function (argument) {
707
+ return $Object$3(requireObjectCoercible(argument));
708
+ };
709
+
710
+ var uncurryThis$6 = functionUncurryThis;
711
+ var toObject$1 = toObject$2;
712
+ var hasOwnProperty = uncurryThis$6({}.hasOwnProperty);
713
+
714
+ // `HasOwnProperty` abstract operation
715
+ // https://tc39.es/ecma262/#sec-hasownproperty
716
+ // eslint-disable-next-line es/no-object-hasown -- safe
717
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
718
+ return hasOwnProperty(toObject$1(it), key);
719
+ };
720
+
721
+ var sharedExports = {};
722
+ var shared$3 = {
723
+ get exports(){ return sharedExports; },
724
+ set exports(v){ sharedExports = v; },
725
+ };
726
+
727
+ var global$a = global$b;
728
+
729
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
730
+ var defineProperty$2 = Object.defineProperty;
731
+ var defineGlobalProperty$2 = function (key, value) {
732
+ try {
733
+ defineProperty$2(global$a, key, {
734
+ value: value,
735
+ configurable: true,
736
+ writable: true
737
+ });
738
+ } catch (error) {
739
+ global$a[key] = value;
740
+ }
741
+ return value;
742
+ };
743
+
744
+ var global$9 = global$b;
745
+ var defineGlobalProperty$1 = defineGlobalProperty$2;
746
+ var SHARED = '__core-js_shared__';
747
+ var store$3 = global$9[SHARED] || defineGlobalProperty$1(SHARED, {});
748
+ var sharedStore = store$3;
749
+
750
+ var store$2 = sharedStore;
751
+ (shared$3.exports = function (key, value) {
752
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
753
+ })('versions', []).push({
754
+ version: '3.29.1',
755
+ mode: 'global',
756
+ copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
757
+ license: 'https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE',
758
+ source: 'https://github.com/zloirock/core-js'
759
+ });
760
+
761
+ var uncurryThis$5 = functionUncurryThis;
762
+ var id = 0;
763
+ var postfix = Math.random();
764
+ var toString$2 = uncurryThis$5(1.0.toString);
765
+ var uid$3 = function (key) {
766
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
767
+ };
768
+
769
+ var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
770
+
771
+ var global$8 = global$b;
772
+ var userAgent = engineUserAgent;
773
+ var process$1 = global$8.process;
774
+ var Deno = global$8.Deno;
775
+ var versions = process$1 && process$1.versions || Deno && Deno.version;
776
+ var v8 = versions && versions.v8;
777
+ var match, version;
778
+ if (v8) {
779
+ match = v8.split('.');
780
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
781
+ // but their correct versions are not interesting for us
782
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
783
+ }
784
+
785
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
786
+ // so check `userAgent` even if `.v8` exists, but 0
787
+ if (!version && userAgent) {
788
+ match = userAgent.match(/Edge\/(\d+)/);
789
+ if (!match || match[1] >= 74) {
790
+ match = userAgent.match(/Chrome\/(\d+)/);
791
+ if (match) version = +match[1];
792
+ }
793
+ }
794
+ var engineV8Version = version;
795
+
796
+ /* eslint-disable es/no-symbol -- required for testing */
797
+ var V8_VERSION = engineV8Version;
798
+ var fails$5 = fails$8;
799
+
800
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
801
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
802
+ var symbol = Symbol();
803
+ // Chrome 38 Symbol has incorrect toString conversion
804
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
805
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
806
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
807
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
808
+ });
809
+
810
+ /* eslint-disable es/no-symbol -- required for testing */
811
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
812
+ var useSymbolAsUid = NATIVE_SYMBOL$1 && !Symbol.sham && typeof Symbol.iterator == 'symbol';
813
+
814
+ var global$7 = global$b;
815
+ var shared$2 = sharedExports;
816
+ var hasOwn$5 = hasOwnProperty_1;
817
+ var uid$2 = uid$3;
818
+ var NATIVE_SYMBOL = symbolConstructorDetection;
819
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
820
+ var Symbol$1 = global$7.Symbol;
821
+ var WellKnownSymbolsStore = shared$2('wks');
822
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$2;
823
+ var wellKnownSymbol$4 = function (name) {
824
+ if (!hasOwn$5(WellKnownSymbolsStore, name)) {
825
+ WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$5(Symbol$1, name) ? Symbol$1[name] : createWellKnownSymbol('Symbol.' + name);
826
+ }
827
+ return WellKnownSymbolsStore[name];
828
+ };
829
+
830
+ var wellKnownSymbol$3 = wellKnownSymbol$4;
831
+ var TO_STRING_TAG$2 = wellKnownSymbol$3('toStringTag');
832
+ var test = {};
833
+ test[TO_STRING_TAG$2] = 'z';
834
+ var toStringTagSupport = String(test) === '[object z]';
835
+
836
+ var uncurryThis$4 = functionUncurryThis;
837
+ var toString$1 = uncurryThis$4({}.toString);
838
+ var stringSlice$1 = uncurryThis$4(''.slice);
839
+ var classofRaw$1 = function (it) {
840
+ return stringSlice$1(toString$1(it), 8, -1);
841
+ };
842
+
843
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
844
+ var isCallable$b = isCallable$d;
845
+ var classofRaw = classofRaw$1;
846
+ var wellKnownSymbol$2 = wellKnownSymbol$4;
847
+ var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
848
+ var $Object$2 = Object;
849
+
850
+ // ES3 wrong here
851
+ var CORRECT_ARGUMENTS = classofRaw(function () {
852
+ return arguments;
853
+ }()) == 'Arguments';
854
+
855
+ // fallback for IE11 Script Access Denied error
856
+ var tryGet = function (it, key) {
857
+ try {
858
+ return it[key];
859
+ } catch (error) {/* empty */}
860
+ };
861
+
862
+ // getting tag from ES6+ `Object.prototype.toString`
863
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
864
+ var O, tag, result;
865
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
866
+ // @@toStringTag case
867
+ : typeof (tag = tryGet(O = $Object$2(it), TO_STRING_TAG$1)) == 'string' ? tag
868
+ // builtinTag case
869
+ : CORRECT_ARGUMENTS ? classofRaw(O)
870
+ // ES3 arguments fallback
871
+ : (result = classofRaw(O)) == 'Object' && isCallable$b(O.callee) ? 'Arguments' : result;
872
+ };
873
+
874
+ var $String$3 = String;
875
+ var tryToString$2 = function (argument) {
876
+ try {
877
+ return $String$3(argument);
878
+ } catch (error) {
879
+ return 'Object';
880
+ }
881
+ };
882
+
883
+ var objectDefineProperty = {};
884
+
885
+ var global$6 = global$b;
886
+ var isObject$5 = isObject$6;
887
+ var document$1 = global$6.document;
888
+ // typeof document.createElement is 'object' in old IE
889
+ var EXISTS$1 = isObject$5(document$1) && isObject$5(document$1.createElement);
890
+ var documentCreateElement = function (it) {
891
+ return EXISTS$1 ? document$1.createElement(it) : {};
892
+ };
893
+
894
+ var DESCRIPTORS$6 = descriptors;
895
+ var fails$4 = fails$8;
896
+ var createElement = documentCreateElement;
897
+
898
+ // Thanks to IE8 for its funny defineProperty
899
+ var ie8DomDefine = !DESCRIPTORS$6 && !fails$4(function () {
900
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
901
+ return Object.defineProperty(createElement('div'), 'a', {
902
+ get: function () {
903
+ return 7;
904
+ }
905
+ }).a != 7;
906
+ });
907
+
908
+ var DESCRIPTORS$5 = descriptors;
909
+ var fails$3 = fails$8;
910
+
911
+ // V8 ~ Chrome 36-
912
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
913
+ var v8PrototypeDefineBug = DESCRIPTORS$5 && fails$3(function () {
914
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
915
+ return Object.defineProperty(function () {/* empty */}, 'prototype', {
916
+ value: 42,
917
+ writable: false
918
+ }).prototype != 42;
919
+ });
920
+
921
+ var isObject$4 = isObject$6;
922
+ var $String$2 = String;
923
+ var $TypeError$5 = TypeError;
924
+
925
+ // `Assert: Type(argument) is Object`
926
+ var anObject$2 = function (argument) {
927
+ if (isObject$4(argument)) return argument;
928
+ throw $TypeError$5($String$2(argument) + ' is not an object');
929
+ };
930
+
931
+ var global$5 = global$b;
932
+ var isCallable$a = isCallable$d;
933
+ var aFunction = function (argument) {
934
+ return isCallable$a(argument) ? argument : undefined;
935
+ };
936
+ var getBuiltIn$1 = function (namespace, method) {
937
+ return arguments.length < 2 ? aFunction(global$5[namespace]) : global$5[namespace] && global$5[namespace][method];
938
+ };
939
+
940
+ var uncurryThis$3 = functionUncurryThis;
941
+ var objectIsPrototypeOf = uncurryThis$3({}.isPrototypeOf);
942
+
943
+ var getBuiltIn = getBuiltIn$1;
944
+ var isCallable$9 = isCallable$d;
945
+ var isPrototypeOf$1 = objectIsPrototypeOf;
946
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
947
+ var $Object$1 = Object;
948
+ var isSymbol$2 = USE_SYMBOL_AS_UID ? function (it) {
949
+ return typeof it == 'symbol';
950
+ } : function (it) {
951
+ var $Symbol = getBuiltIn('Symbol');
952
+ return isCallable$9($Symbol) && isPrototypeOf$1($Symbol.prototype, $Object$1(it));
953
+ };
954
+
955
+ var isCallable$8 = isCallable$d;
956
+ var tryToString$1 = tryToString$2;
957
+ var $TypeError$4 = TypeError;
958
+
959
+ // `Assert: IsCallable(argument) is true`
960
+ var aCallable$2 = function (argument) {
961
+ if (isCallable$8(argument)) return argument;
962
+ throw $TypeError$4(tryToString$1(argument) + ' is not a function');
963
+ };
964
+
965
+ var aCallable$1 = aCallable$2;
966
+ var isNullOrUndefined = isNullOrUndefined$2;
967
+
968
+ // `GetMethod` abstract operation
969
+ // https://tc39.es/ecma262/#sec-getmethod
970
+ var getMethod$1 = function (V, P) {
971
+ var func = V[P];
972
+ return isNullOrUndefined(func) ? undefined : aCallable$1(func);
973
+ };
974
+
975
+ var call$2 = functionCall;
976
+ var isCallable$7 = isCallable$d;
977
+ var isObject$3 = isObject$6;
978
+ var $TypeError$3 = TypeError;
979
+
980
+ // `OrdinaryToPrimitive` abstract operation
981
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
982
+ var ordinaryToPrimitive$1 = function (input, pref) {
983
+ var fn, val;
984
+ if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$3(val = call$2(fn, input))) return val;
985
+ if (isCallable$7(fn = input.valueOf) && !isObject$3(val = call$2(fn, input))) return val;
986
+ if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$3(val = call$2(fn, input))) return val;
987
+ throw $TypeError$3("Can't convert object to primitive value");
988
+ };
989
+
990
+ var call$1 = functionCall;
991
+ var isObject$2 = isObject$6;
992
+ var isSymbol$1 = isSymbol$2;
993
+ var getMethod = getMethod$1;
994
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
995
+ var wellKnownSymbol$1 = wellKnownSymbol$4;
996
+ var $TypeError$2 = TypeError;
997
+ var TO_PRIMITIVE = wellKnownSymbol$1('toPrimitive');
998
+
999
+ // `ToPrimitive` abstract operation
1000
+ // https://tc39.es/ecma262/#sec-toprimitive
1001
+ var toPrimitive$1 = function (input, pref) {
1002
+ if (!isObject$2(input) || isSymbol$1(input)) return input;
1003
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
1004
+ var result;
1005
+ if (exoticToPrim) {
1006
+ if (pref === undefined) pref = 'default';
1007
+ result = call$1(exoticToPrim, input, pref);
1008
+ if (!isObject$2(result) || isSymbol$1(result)) return result;
1009
+ throw $TypeError$2("Can't convert object to primitive value");
1010
+ }
1011
+ if (pref === undefined) pref = 'number';
1012
+ return ordinaryToPrimitive(input, pref);
1013
+ };
1014
+
1015
+ var toPrimitive = toPrimitive$1;
1016
+ var isSymbol = isSymbol$2;
1017
+
1018
+ // `ToPropertyKey` abstract operation
1019
+ // https://tc39.es/ecma262/#sec-topropertykey
1020
+ var toPropertyKey$1 = function (argument) {
1021
+ var key = toPrimitive(argument, 'string');
1022
+ return isSymbol(key) ? key : key + '';
1023
+ };
1024
+
1025
+ var DESCRIPTORS$4 = descriptors;
1026
+ var IE8_DOM_DEFINE = ie8DomDefine;
1027
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1028
+ var anObject$1 = anObject$2;
1029
+ var toPropertyKey = toPropertyKey$1;
1030
+ var $TypeError$1 = TypeError;
1031
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
1032
+ var $defineProperty = Object.defineProperty;
1033
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1034
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1035
+ var ENUMERABLE = 'enumerable';
1036
+ var CONFIGURABLE$1 = 'configurable';
1037
+ var WRITABLE = 'writable';
1038
+
1039
+ // `Object.defineProperty` method
1040
+ // https://tc39.es/ecma262/#sec-object.defineproperty
1041
+ objectDefineProperty.f = DESCRIPTORS$4 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
1042
+ anObject$1(O);
1043
+ P = toPropertyKey(P);
1044
+ anObject$1(Attributes);
1045
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
1046
+ var current = $getOwnPropertyDescriptor(O, P);
1047
+ if (current && current[WRITABLE]) {
1048
+ O[P] = Attributes.value;
1049
+ Attributes = {
1050
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
1051
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
1052
+ writable: false
1053
+ };
1054
+ }
1055
+ }
1056
+ return $defineProperty(O, P, Attributes);
1057
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
1058
+ anObject$1(O);
1059
+ P = toPropertyKey(P);
1060
+ anObject$1(Attributes);
1061
+ if (IE8_DOM_DEFINE) try {
1062
+ return $defineProperty(O, P, Attributes);
1063
+ } catch (error) {/* empty */}
1064
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError$1('Accessors not supported');
1065
+ if ('value' in Attributes) O[P] = Attributes.value;
1066
+ return O;
1067
+ };
1068
+
1069
+ var createPropertyDescriptor$1 = function (bitmap, value) {
1070
+ return {
1071
+ enumerable: !(bitmap & 1),
1072
+ configurable: !(bitmap & 2),
1073
+ writable: !(bitmap & 4),
1074
+ value: value
1075
+ };
1076
+ };
1077
+
1078
+ var DESCRIPTORS$3 = descriptors;
1079
+ var definePropertyModule$1 = objectDefineProperty;
1080
+ var createPropertyDescriptor = createPropertyDescriptor$1;
1081
+ var createNonEnumerableProperty$2 = DESCRIPTORS$3 ? function (object, key, value) {
1082
+ return definePropertyModule$1.f(object, key, createPropertyDescriptor(1, value));
1083
+ } : function (object, key, value) {
1084
+ object[key] = value;
1085
+ return object;
1086
+ };
1087
+
1088
+ var makeBuiltInExports = {};
1089
+ var makeBuiltIn$3 = {
1090
+ get exports(){ return makeBuiltInExports; },
1091
+ set exports(v){ makeBuiltInExports = v; },
1092
+ };
1093
+
1094
+ var DESCRIPTORS$2 = descriptors;
1095
+ var hasOwn$4 = hasOwnProperty_1;
1096
+ var FunctionPrototype = Function.prototype;
1097
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1098
+ var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
1099
+ var EXISTS = hasOwn$4(FunctionPrototype, 'name');
1100
+ // additional protection from minified / mangled / dropped function names
1101
+ var PROPER = EXISTS && function something() {/* empty */}.name === 'something';
1102
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable);
1103
+ var functionName = {
1104
+ EXISTS: EXISTS,
1105
+ PROPER: PROPER,
1106
+ CONFIGURABLE: CONFIGURABLE
1107
+ };
1108
+
1109
+ var uncurryThis$2 = functionUncurryThis;
1110
+ var isCallable$6 = isCallable$d;
1111
+ var store$1 = sharedStore;
1112
+ var functionToString = uncurryThis$2(Function.toString);
1113
+
1114
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
1115
+ if (!isCallable$6(store$1.inspectSource)) {
1116
+ store$1.inspectSource = function (it) {
1117
+ return functionToString(it);
1118
+ };
1119
+ }
1120
+ var inspectSource$1 = store$1.inspectSource;
1121
+
1122
+ var global$4 = global$b;
1123
+ var isCallable$5 = isCallable$d;
1124
+ var WeakMap$1 = global$4.WeakMap;
1125
+ var weakMapBasicDetection = isCallable$5(WeakMap$1) && /native code/.test(String(WeakMap$1));
1126
+
1127
+ var shared$1 = sharedExports;
1128
+ var uid$1 = uid$3;
1129
+ var keys = shared$1('keys');
1130
+ var sharedKey$2 = function (key) {
1131
+ return keys[key] || (keys[key] = uid$1(key));
1132
+ };
1133
+
1134
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
1135
+ var global$3 = global$b;
1136
+ var isObject$1 = isObject$6;
1137
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
1138
+ var hasOwn$3 = hasOwnProperty_1;
1139
+ var shared = sharedStore;
1140
+ var sharedKey$1 = sharedKey$2;
1141
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
1142
+ var TypeError$2 = global$3.TypeError;
1143
+ var WeakMap = global$3.WeakMap;
1144
+ var set, get, has;
1145
+ var enforce = function (it) {
1146
+ return has(it) ? get(it) : set(it, {});
1147
+ };
1148
+ var getterFor = function (TYPE) {
1149
+ return function (it) {
1150
+ var state;
1151
+ if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
1152
+ throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
1153
+ }
1154
+ return state;
1155
+ };
1156
+ };
1157
+ if (NATIVE_WEAK_MAP || shared.state) {
1158
+ var store = shared.state || (shared.state = new WeakMap());
1159
+ /* eslint-disable no-self-assign -- prototype methods protection */
1160
+ store.get = store.get;
1161
+ store.has = store.has;
1162
+ store.set = store.set;
1163
+ /* eslint-enable no-self-assign -- prototype methods protection */
1164
+ set = function (it, metadata) {
1165
+ if (store.has(it)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
1166
+ metadata.facade = it;
1167
+ store.set(it, metadata);
1168
+ return metadata;
1169
+ };
1170
+ get = function (it) {
1171
+ return store.get(it) || {};
1172
+ };
1173
+ has = function (it) {
1174
+ return store.has(it);
1175
+ };
1176
+ } else {
1177
+ var STATE = sharedKey$1('state');
1178
+ set = function (it, metadata) {
1179
+ if (hasOwn$3(it, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
1180
+ metadata.facade = it;
1181
+ createNonEnumerableProperty$1(it, STATE, metadata);
1182
+ return metadata;
1183
+ };
1184
+ get = function (it) {
1185
+ return hasOwn$3(it, STATE) ? it[STATE] : {};
1186
+ };
1187
+ has = function (it) {
1188
+ return hasOwn$3(it, STATE);
1189
+ };
1190
+ }
1191
+ var internalState = {
1192
+ set: set,
1193
+ get: get,
1194
+ has: has,
1195
+ enforce: enforce,
1196
+ getterFor: getterFor
1197
+ };
1198
+
1199
+ var uncurryThis$1 = functionUncurryThis;
1200
+ var fails$2 = fails$8;
1201
+ var isCallable$4 = isCallable$d;
1202
+ var hasOwn$2 = hasOwnProperty_1;
1203
+ var DESCRIPTORS$1 = descriptors;
1204
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
1205
+ var inspectSource = inspectSource$1;
1206
+ var InternalStateModule$1 = internalState;
1207
+ var enforceInternalState$1 = InternalStateModule$1.enforce;
1208
+ var getInternalState$1 = InternalStateModule$1.get;
1209
+ var $String$1 = String;
1210
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
1211
+ var defineProperty$1 = Object.defineProperty;
1212
+ var stringSlice = uncurryThis$1(''.slice);
1213
+ var replace = uncurryThis$1(''.replace);
1214
+ var join = uncurryThis$1([].join);
1215
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$2(function () {
1216
+ return defineProperty$1(function () {/* empty */}, 'length', {
1217
+ value: 8
1218
+ }).length !== 8;
1219
+ });
1220
+ var TEMPLATE = String(String).split('String');
1221
+ var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
1222
+ if (stringSlice($String$1(name), 0, 7) === 'Symbol(') {
1223
+ name = '[' + replace($String$1(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
1224
+ }
1225
+ if (options && options.getter) name = 'get ' + name;
1226
+ if (options && options.setter) name = 'set ' + name;
1227
+ if (!hasOwn$2(value, 'name') || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
1228
+ if (DESCRIPTORS$1) defineProperty$1(value, 'name', {
1229
+ value: name,
1230
+ configurable: true
1231
+ });else value.name = name;
1232
+ }
1233
+ if (CONFIGURABLE_LENGTH && options && hasOwn$2(options, 'arity') && value.length !== options.arity) {
1234
+ defineProperty$1(value, 'length', {
1235
+ value: options.arity
1236
+ });
1237
+ }
1238
+ try {
1239
+ if (options && hasOwn$2(options, 'constructor') && options.constructor) {
1240
+ if (DESCRIPTORS$1) defineProperty$1(value, 'prototype', {
1241
+ writable: false
1242
+ });
1243
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
1244
+ } else if (value.prototype) value.prototype = undefined;
1245
+ } catch (error) {/* empty */}
1246
+ var state = enforceInternalState$1(value);
1247
+ if (!hasOwn$2(state, 'source')) {
1248
+ state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
1249
+ }
1250
+ return value;
1251
+ };
1252
+
1253
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
1254
+ // eslint-disable-next-line no-extend-native -- required
1255
+ Function.prototype.toString = makeBuiltIn$2(function toString() {
1256
+ return isCallable$4(this) && getInternalState$1(this).source || inspectSource(this);
1257
+ }, 'toString');
1258
+
1259
+ var isCallable$3 = isCallable$d;
1260
+ var definePropertyModule = objectDefineProperty;
1261
+ var makeBuiltIn$1 = makeBuiltInExports;
1262
+ var defineGlobalProperty = defineGlobalProperty$2;
1263
+ var defineBuiltIn$1 = function (O, key, value, options) {
1264
+ if (!options) options = {};
1265
+ var simple = options.enumerable;
1266
+ var name = options.name !== undefined ? options.name : key;
1267
+ if (isCallable$3(value)) makeBuiltIn$1(value, name, options);
1268
+ if (options.global) {
1269
+ if (simple) O[key] = value;else defineGlobalProperty(key, value);
1270
+ } else {
1271
+ try {
1272
+ if (!options.unsafe) delete O[key];else if (O[key]) simple = true;
1273
+ } catch (error) {/* empty */}
1274
+ if (simple) O[key] = value;else definePropertyModule.f(O, key, {
1275
+ value: value,
1276
+ enumerable: false,
1277
+ configurable: !options.nonConfigurable,
1278
+ writable: !options.nonWritable
1279
+ });
1280
+ }
1281
+ return O;
1282
+ };
1283
+
1284
+ var makeBuiltIn = makeBuiltInExports;
1285
+ var defineProperty = objectDefineProperty;
1286
+ var defineBuiltInAccessor$1 = function (target, name, descriptor) {
1287
+ if (descriptor.get) makeBuiltIn(descriptor.get, name, {
1288
+ getter: true
1289
+ });
1290
+ if (descriptor.set) makeBuiltIn(descriptor.set, name, {
1291
+ setter: true
1292
+ });
1293
+ return defineProperty.f(target, name, descriptor);
1294
+ };
1295
+
1296
+ var fails$1 = fails$8;
1297
+ var correctPrototypeGetter = !fails$1(function () {
1298
+ function F() {/* empty */}
1299
+ F.prototype.constructor = null;
1300
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1301
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1302
+ });
1303
+
1304
+ var hasOwn$1 = hasOwnProperty_1;
1305
+ var isCallable$2 = isCallable$d;
1306
+ var toObject = toObject$2;
1307
+ var sharedKey = sharedKey$2;
1308
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1309
+ var IE_PROTO = sharedKey('IE_PROTO');
1310
+ var $Object = Object;
1311
+ var ObjectPrototype$1 = $Object.prototype;
1312
+
1313
+ // `Object.getPrototypeOf` method
1314
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1315
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
1316
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
1317
+ var object = toObject(O);
1318
+ if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1319
+ var constructor = object.constructor;
1320
+ if (isCallable$2(constructor) && object instanceof constructor) {
1321
+ return constructor.prototype;
1322
+ }
1323
+ return object instanceof $Object ? ObjectPrototype$1 : null;
1324
+ };
1325
+
1326
+ var uncurryThis = functionUncurryThis;
1327
+ var aCallable = aCallable$2;
1328
+ var functionUncurryThisAccessor = function (object, key, method) {
1329
+ try {
1330
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1331
+ return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
1332
+ } catch (error) {/* empty */}
1333
+ };
1334
+
1335
+ var isCallable$1 = isCallable$d;
1336
+ var $String = String;
1337
+ var $TypeError = TypeError;
1338
+ var aPossiblePrototype$1 = function (argument) {
1339
+ if (typeof argument == 'object' || isCallable$1(argument)) return argument;
1340
+ throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
1341
+ };
1342
+
1343
+ /* eslint-disable no-proto -- safe */
1344
+ var uncurryThisAccessor = functionUncurryThisAccessor;
1345
+ var anObject = anObject$2;
1346
+ var aPossiblePrototype = aPossiblePrototype$1;
1347
+
1348
+ // `Object.setPrototypeOf` method
1349
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1350
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1351
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1352
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1353
+ var CORRECT_SETTER = false;
1354
+ var test = {};
1355
+ var setter;
1356
+ try {
1357
+ setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
1358
+ setter(test, []);
1359
+ CORRECT_SETTER = test instanceof Array;
1360
+ } catch (error) {/* empty */}
1361
+ return function setPrototypeOf(O, proto) {
1362
+ anObject(O);
1363
+ aPossiblePrototype(proto);
1364
+ if (CORRECT_SETTER) setter(O, proto);else O.__proto__ = proto;
1365
+ return O;
1366
+ };
1367
+ }() : undefined);
1368
+
1369
+ var NATIVE_ARRAY_BUFFER = arrayBufferBasicDetection;
1370
+ var DESCRIPTORS = descriptors;
1371
+ var global$2 = global$b;
1372
+ var isCallable = isCallable$d;
1373
+ var isObject = isObject$6;
1374
+ var hasOwn = hasOwnProperty_1;
1375
+ var classof = classof$1;
1376
+ var tryToString = tryToString$2;
1377
+ var createNonEnumerableProperty = createNonEnumerableProperty$2;
1378
+ var defineBuiltIn = defineBuiltIn$1;
1379
+ var defineBuiltInAccessor = defineBuiltInAccessor$1;
1380
+ var isPrototypeOf = objectIsPrototypeOf;
1381
+ var getPrototypeOf = objectGetPrototypeOf;
1382
+ var setPrototypeOf = objectSetPrototypeOf;
1383
+ var wellKnownSymbol = wellKnownSymbol$4;
1384
+ var uid = uid$3;
1385
+ var InternalStateModule = internalState;
1386
+ var enforceInternalState = InternalStateModule.enforce;
1387
+ var getInternalState = InternalStateModule.get;
1388
+ var Int8Array$2 = global$2.Int8Array;
1389
+ var Int8ArrayPrototype$1 = Int8Array$2 && Int8Array$2.prototype;
1390
+ var Uint8ClampedArray$1 = global$2.Uint8ClampedArray;
1391
+ var Uint8ClampedArrayPrototype = Uint8ClampedArray$1 && Uint8ClampedArray$1.prototype;
1392
+ var TypedArray = Int8Array$2 && getPrototypeOf(Int8Array$2);
1393
+ var TypedArrayPrototype = Int8ArrayPrototype$1 && getPrototypeOf(Int8ArrayPrototype$1);
1394
+ var ObjectPrototype = Object.prototype;
1395
+ var TypeError$1 = global$2.TypeError;
1396
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1397
+ var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
1398
+ var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';
1399
+ // Fixing native typed arrays in Opera Presto crashes the browser, see #595
1400
+ var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global$2.opera) !== 'Opera';
1401
+ var TYPED_ARRAY_TAG_REQUIRED = false;
1402
+ var NAME, Constructor, Prototype;
1403
+ var TypedArrayConstructorsList = {
1404
+ Int8Array: 1,
1405
+ Uint8Array: 1,
1406
+ Uint8ClampedArray: 1,
1407
+ Int16Array: 2,
1408
+ Uint16Array: 2,
1409
+ Int32Array: 4,
1410
+ Uint32Array: 4,
1411
+ Float32Array: 4,
1412
+ Float64Array: 8
1413
+ };
1414
+ var BigIntArrayConstructorsList = {
1415
+ BigInt64Array: 8,
1416
+ BigUint64Array: 8
1417
+ };
1418
+ var isView = function isView(it) {
1419
+ if (!isObject(it)) return false;
1420
+ var klass = classof(it);
1421
+ return klass === 'DataView' || hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
1422
+ };
1423
+ var getTypedArrayConstructor = function (it) {
1424
+ var proto = getPrototypeOf(it);
1425
+ if (!isObject(proto)) return;
1426
+ var state = getInternalState(proto);
1427
+ return state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto);
1428
+ };
1429
+ var isTypedArray$3 = function (it) {
1430
+ if (!isObject(it)) return false;
1431
+ var klass = classof(it);
1432
+ return hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
1433
+ };
1434
+ var aTypedArray$1 = function (it) {
1435
+ if (isTypedArray$3(it)) return it;
1436
+ throw TypeError$1('Target is not a typed array');
1437
+ };
1438
+ var aTypedArrayConstructor = function (C) {
1439
+ if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C;
1440
+ throw TypeError$1(tryToString(C) + ' is not a typed array constructor');
1441
+ };
1442
+ var exportTypedArrayMethod$1 = function (KEY, property, forced, options) {
1443
+ if (!DESCRIPTORS) return;
1444
+ if (forced) for (var ARRAY in TypedArrayConstructorsList) {
1445
+ var TypedArrayConstructor = global$2[ARRAY];
1446
+ if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try {
1447
+ delete TypedArrayConstructor.prototype[KEY];
1448
+ } catch (error) {
1449
+ // old WebKit bug - some methods are non-configurable
1450
+ try {
1451
+ TypedArrayConstructor.prototype[KEY] = property;
1452
+ } catch (error2) {/* empty */}
1453
+ }
1454
+ }
1455
+ if (!TypedArrayPrototype[KEY] || forced) {
1456
+ defineBuiltIn(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype$1[KEY] || property, options);
1457
+ }
1458
+ };
1459
+ var exportTypedArrayStaticMethod = function (KEY, property, forced) {
1460
+ var ARRAY, TypedArrayConstructor;
1461
+ if (!DESCRIPTORS) return;
1462
+ if (setPrototypeOf) {
1463
+ if (forced) for (ARRAY in TypedArrayConstructorsList) {
1464
+ TypedArrayConstructor = global$2[ARRAY];
1465
+ if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try {
1466
+ delete TypedArrayConstructor[KEY];
1467
+ } catch (error) {/* empty */}
1468
+ }
1469
+ if (!TypedArray[KEY] || forced) {
1470
+ // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable
1471
+ try {
1472
+ return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
1473
+ } catch (error) {/* empty */}
1474
+ } else return;
1475
+ }
1476
+ for (ARRAY in TypedArrayConstructorsList) {
1477
+ TypedArrayConstructor = global$2[ARRAY];
1478
+ if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
1479
+ defineBuiltIn(TypedArrayConstructor, KEY, property);
1480
+ }
1481
+ }
1482
+ };
1483
+ for (NAME in TypedArrayConstructorsList) {
1484
+ Constructor = global$2[NAME];
1485
+ Prototype = Constructor && Constructor.prototype;
1486
+ if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;else NATIVE_ARRAY_BUFFER_VIEWS = false;
1487
+ }
1488
+ for (NAME in BigIntArrayConstructorsList) {
1489
+ Constructor = global$2[NAME];
1490
+ Prototype = Constructor && Constructor.prototype;
1491
+ if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
1492
+ }
1493
+
1494
+ // WebKit bug - typed arrays constructors prototype is Object.prototype
1495
+ if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
1496
+ // eslint-disable-next-line no-shadow -- safe
1497
+ TypedArray = function TypedArray() {
1498
+ throw TypeError$1('Incorrect invocation');
1499
+ };
1500
+ if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
1501
+ if (global$2[NAME]) setPrototypeOf(global$2[NAME], TypedArray);
1502
+ }
1503
+ }
1504
+ if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
1505
+ TypedArrayPrototype = TypedArray.prototype;
1506
+ if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
1507
+ if (global$2[NAME]) setPrototypeOf(global$2[NAME].prototype, TypedArrayPrototype);
1508
+ }
1509
+ }
1510
+
1511
+ // WebKit bug - one more object in Uint8ClampedArray prototype chain
1512
+ if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
1513
+ setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
1514
+ }
1515
+ if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {
1516
+ TYPED_ARRAY_TAG_REQUIRED = true;
1517
+ defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, {
1518
+ configurable: true,
1519
+ get: function () {
1520
+ return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
1521
+ }
1522
+ });
1523
+ for (NAME in TypedArrayConstructorsList) if (global$2[NAME]) {
1524
+ createNonEnumerableProperty(global$2[NAME], TYPED_ARRAY_TAG, NAME);
1525
+ }
1526
+ }
1527
+ var arrayBufferViewCore = {
1528
+ NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
1529
+ TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
1530
+ aTypedArray: aTypedArray$1,
1531
+ aTypedArrayConstructor: aTypedArrayConstructor,
1532
+ exportTypedArrayMethod: exportTypedArrayMethod$1,
1533
+ exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
1534
+ getTypedArrayConstructor: getTypedArrayConstructor,
1535
+ isView: isView,
1536
+ isTypedArray: isTypedArray$3,
1537
+ TypedArray: TypedArray,
1538
+ TypedArrayPrototype: TypedArrayPrototype
1539
+ };
1540
+
1541
+ var ceil = Math.ceil;
1542
+ var floor = Math.floor;
1543
+
1544
+ // `Math.trunc` method
1545
+ // https://tc39.es/ecma262/#sec-math.trunc
1546
+ // eslint-disable-next-line es/no-math-trunc -- safe
1547
+ var mathTrunc = Math.trunc || function trunc(x) {
1548
+ var n = +x;
1549
+ return (n > 0 ? floor : ceil)(n);
1550
+ };
1551
+
1552
+ var trunc = mathTrunc;
1553
+
1554
+ // `ToIntegerOrInfinity` abstract operation
1555
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
1556
+ var toIntegerOrInfinity$2 = function (argument) {
1557
+ var number = +argument;
1558
+ // eslint-disable-next-line no-self-compare -- NaN check
1559
+ return number !== number || number === 0 ? 0 : trunc(number);
1560
+ };
1561
+
1562
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
1563
+ var min = Math.min;
1564
+
1565
+ // `ToLength` abstract operation
1566
+ // https://tc39.es/ecma262/#sec-tolength
1567
+ var toLength$1 = function (argument) {
1568
+ return argument > 0 ? min(toIntegerOrInfinity$1(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
1569
+ };
1570
+
1571
+ var toLength = toLength$1;
1572
+
1573
+ // `LengthOfArrayLike` abstract operation
1574
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
1575
+ var lengthOfArrayLike$1 = function (obj) {
1576
+ return toLength(obj.length);
1577
+ };
1578
+
1579
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
1580
+ var $RangeError$1 = RangeError;
1581
+ var toPositiveInteger$1 = function (it) {
1582
+ var result = toIntegerOrInfinity(it);
1583
+ if (result < 0) throw $RangeError$1("The argument can't be less than 0");
1584
+ return result;
1585
+ };
1586
+
1587
+ var toPositiveInteger = toPositiveInteger$1;
1588
+ var $RangeError = RangeError;
1589
+ var toOffset$1 = function (it, BYTES) {
1590
+ var offset = toPositiveInteger(it);
1591
+ if (offset % BYTES) throw $RangeError('Wrong offset');
1592
+ return offset;
1593
+ };
1594
+
1595
+ var global$1 = global$b;
1596
+ var call = functionCall;
1597
+ var ArrayBufferViewCore = arrayBufferViewCore;
1598
+ var lengthOfArrayLike = lengthOfArrayLike$1;
1599
+ var toOffset = toOffset$1;
1600
+ var toIndexedObject = toObject$2;
1601
+ var fails = fails$8;
1602
+ var RangeError$1 = global$1.RangeError;
1603
+ var Int8Array$1 = global$1.Int8Array;
1604
+ var Int8ArrayPrototype = Int8Array$1 && Int8Array$1.prototype;
1605
+ var $set = Int8ArrayPrototype && Int8ArrayPrototype.set;
1606
+ var aTypedArray = ArrayBufferViewCore.aTypedArray;
1607
+ var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
1608
+ var WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function () {
1609
+ // eslint-disable-next-line es/no-typed-arrays -- required for testing
1610
+ var array = new Uint8ClampedArray(2);
1611
+ call($set, array, {
1612
+ length: 1,
1613
+ 0: 3
1614
+ }, 1);
1615
+ return array[1] !== 3;
1616
+ });
1617
+
1618
+ // https://bugs.chromium.org/p/v8/issues/detail?id=11294 and other
1619
+ var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () {
1620
+ var array = new Int8Array$1(2);
1621
+ array.set(1);
1622
+ array.set('2', 1);
1623
+ return array[0] !== 0 || array[1] !== 2;
1624
+ });
1625
+
1626
+ // `%TypedArray%.prototype.set` method
1627
+ // https://tc39.es/ecma262/#sec-%typedarray%.prototype.set
1628
+ exportTypedArrayMethod('set', function set(arrayLike /* , offset */) {
1629
+ aTypedArray(this);
1630
+ var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);
1631
+ var src = toIndexedObject(arrayLike);
1632
+ if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS) return call($set, this, src, offset);
1633
+ var length = this.length;
1634
+ var len = lengthOfArrayLike(src);
1635
+ var index = 0;
1636
+ if (len + offset > length) throw RangeError$1('Wrong length');
1637
+ while (index < len) this[offset + index] = src[index++];
1638
+ }, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG);
1639
+
1640
+ var isTypedarray = isTypedArray$2;
1641
+ isTypedArray$2.strict = isStrictTypedArray;
1642
+ isTypedArray$2.loose = isLooseTypedArray;
1643
+ var toString = Object.prototype.toString;
1644
+ var names = {
1645
+ '[object Int8Array]': true,
1646
+ '[object Int16Array]': true,
1647
+ '[object Int32Array]': true,
1648
+ '[object Uint8Array]': true,
1649
+ '[object Uint8ClampedArray]': true,
1650
+ '[object Uint16Array]': true,
1651
+ '[object Uint32Array]': true,
1652
+ '[object Float32Array]': true,
1653
+ '[object Float64Array]': true
1654
+ };
1655
+ function isTypedArray$2(arr) {
1656
+ return isStrictTypedArray(arr) || isLooseTypedArray(arr);
1657
+ }
1658
+ function isStrictTypedArray(arr) {
1659
+ return arr instanceof Int8Array || arr instanceof Int16Array || arr instanceof Int32Array || arr instanceof Uint8Array || arr instanceof Uint8ClampedArray || arr instanceof Uint16Array || arr instanceof Uint32Array || arr instanceof Float32Array || arr instanceof Float64Array;
1660
+ }
1661
+ function isLooseTypedArray(arr) {
1662
+ return names[toString.call(arr)];
1663
+ }
1664
+
1665
+ /**
1666
+ * Convert a typed array to a Buffer without a copy
1667
+ *
1668
+ * Author: Feross Aboukhadijeh <https://feross.org>
1669
+ * License: MIT
1670
+ *
1671
+ * `npm install typedarray-to-buffer`
1672
+ */
1673
+ var isTypedArray$1 = isTypedarray.strict;
1674
+ var typedarrayToBuffer = function typedarrayToBuffer(arr) {
1675
+ if (isTypedArray$1(arr)) {
1676
+ // To avoid a copy, use the typed array's underlying ArrayBuffer to back new Buffer
1677
+ var buf = Buffer.from(arr.buffer);
1678
+ if (arr.byteLength !== arr.buffer.byteLength) {
1679
+ // Respect the "view", i.e. byteOffset and byteLength, without doing a copy
1680
+ buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength);
1681
+ }
1682
+ return buf;
1683
+ } else {
1684
+ // Pass through all other types to `Buffer.from`
1685
+ return Buffer.from(arr);
1686
+ }
1687
+ };
1688
+
1689
+ writeFileAtomic.exports = writeFile;
1690
+ writeFileAtomicExports.sync = writeFileSync;
1691
+ writeFileAtomicExports._getTmpname = getTmpname; // for testing
1692
+ writeFileAtomicExports._cleanupOnExit = cleanupOnExit;
1693
+ const fs = fs__default;
1694
+ const MurmurHash3 = imurmurhashExports;
1695
+ const onExit = signalExitExports;
1696
+ const path = path__default;
1697
+ const isTypedArray = isTypedarray;
1698
+ const typedArrayToBuffer = typedarrayToBuffer;
1699
+ const {
1700
+ promisify
1701
+ } = require$$6;
1702
+ const activeFiles = {};
1703
+
1704
+ // if we run inside of a worker_thread, `process.pid` is not unique
1705
+ /* istanbul ignore next */
1706
+ const threadId = function getId() {
1707
+ try {
1708
+ const workerThreads = require('worker_threads');
1709
+
1710
+ /// if we are in main thread, this is set to `0`
1711
+ return workerThreads.threadId;
1712
+ } catch (e) {
1713
+ // worker_threads are not available, fallback to 0
1714
+ return 0;
1715
+ }
1716
+ }();
1717
+ let invocations = 0;
1718
+ function getTmpname(filename) {
1719
+ return filename + '.' + MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result();
1720
+ }
1721
+ function cleanupOnExit(tmpfile) {
1722
+ return () => {
1723
+ try {
1724
+ fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile);
1725
+ } catch (_) {}
1726
+ };
1727
+ }
1728
+ function serializeActiveFile(absoluteName) {
1729
+ return new Promise(resolve => {
1730
+ // make a queue if it doesn't already exist
1731
+ if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [];
1732
+ activeFiles[absoluteName].push(resolve); // add this job to the queue
1733
+ if (activeFiles[absoluteName].length === 1) resolve(); // kick off the first one
1734
+ });
1735
+ }
1736
+
1737
+ // https://github.com/isaacs/node-graceful-fs/blob/master/polyfills.js#L315-L342
1738
+ function isChownErrOk(err) {
1739
+ if (err.code === 'ENOSYS') {
1740
+ return true;
1741
+ }
1742
+ const nonroot = !process.getuid || process.getuid() !== 0;
1743
+ if (nonroot) {
1744
+ if (err.code === 'EINVAL' || err.code === 'EPERM') {
1745
+ return true;
1746
+ }
1747
+ }
1748
+ return false;
1749
+ }
1750
+ async function writeFileAsync(filename, data, options = {}) {
1751
+ if (typeof options === 'string') {
1752
+ options = {
1753
+ encoding: options
1754
+ };
1755
+ }
1756
+ let fd;
1757
+ let tmpfile;
1758
+ /* istanbul ignore next -- The closure only gets called when onExit triggers */
1759
+ const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile));
1760
+ const absoluteName = path.resolve(filename);
1761
+ try {
1762
+ await serializeActiveFile(absoluteName);
1763
+ const truename = await promisify(fs.realpath)(filename).catch(() => filename);
1764
+ tmpfile = getTmpname(truename);
1765
+ if (!options.mode || !options.chown) {
1766
+ // Either mode or chown is not explicitly set
1767
+ // Default behavior is to copy it from original file
1768
+ const stats = await promisify(fs.stat)(truename).catch(() => {});
1769
+ if (stats) {
1770
+ if (options.mode == null) {
1771
+ options.mode = stats.mode;
1772
+ }
1773
+ if (options.chown == null && process.getuid) {
1774
+ options.chown = {
1775
+ uid: stats.uid,
1776
+ gid: stats.gid
1777
+ };
1778
+ }
1779
+ }
1780
+ }
1781
+ fd = await promisify(fs.open)(tmpfile, 'w', options.mode);
1782
+ if (options.tmpfileCreated) {
1783
+ await options.tmpfileCreated(tmpfile);
1784
+ }
1785
+ if (isTypedArray(data)) {
1786
+ data = typedArrayToBuffer(data);
1787
+ }
1788
+ if (Buffer.isBuffer(data)) {
1789
+ await promisify(fs.write)(fd, data, 0, data.length, 0);
1790
+ } else if (data != null) {
1791
+ await promisify(fs.write)(fd, String(data), 0, String(options.encoding || 'utf8'));
1792
+ }
1793
+ if (options.fsync !== false) {
1794
+ await promisify(fs.fsync)(fd);
1795
+ }
1796
+ await promisify(fs.close)(fd);
1797
+ fd = null;
1798
+ if (options.chown) {
1799
+ await promisify(fs.chown)(tmpfile, options.chown.uid, options.chown.gid).catch(err => {
1800
+ if (!isChownErrOk(err)) {
1801
+ throw err;
1802
+ }
1803
+ });
1804
+ }
1805
+ if (options.mode) {
1806
+ await promisify(fs.chmod)(tmpfile, options.mode).catch(err => {
1807
+ if (!isChownErrOk(err)) {
1808
+ throw err;
1809
+ }
1810
+ });
1811
+ }
1812
+ await promisify(fs.rename)(tmpfile, truename);
1813
+ } finally {
1814
+ if (fd) {
1815
+ await promisify(fs.close)(fd).catch( /* istanbul ignore next */
1816
+ () => {});
1817
+ }
1818
+ removeOnExitHandler();
1819
+ await promisify(fs.unlink)(tmpfile).catch(() => {});
1820
+ activeFiles[absoluteName].shift(); // remove the element added by serializeSameFile
1821
+ if (activeFiles[absoluteName].length > 0) {
1822
+ activeFiles[absoluteName][0](); // start next job if one is pending
1823
+ } else delete activeFiles[absoluteName];
1824
+ }
1825
+ }
1826
+ function writeFile(filename, data, options, callback) {
1827
+ if (options instanceof Function) {
1828
+ callback = options;
1829
+ options = {};
1830
+ }
1831
+ const promise = writeFileAsync(filename, data, options);
1832
+ if (callback) {
1833
+ promise.then(callback, callback);
1834
+ }
1835
+ return promise;
1836
+ }
1837
+ function writeFileSync(filename, data, options) {
1838
+ if (typeof options === 'string') options = {
1839
+ encoding: options
1840
+ };else if (!options) options = {};
1841
+ try {
1842
+ filename = fs.realpathSync(filename);
1843
+ } catch (ex) {
1844
+ // it's ok, it'll happen on a not yet existing file
1845
+ }
1846
+ const tmpfile = getTmpname(filename);
1847
+ if (!options.mode || !options.chown) {
1848
+ // Either mode or chown is not explicitly set
1849
+ // Default behavior is to copy it from original file
1850
+ try {
1851
+ const stats = fs.statSync(filename);
1852
+ options = Object.assign({}, options);
1853
+ if (!options.mode) {
1854
+ options.mode = stats.mode;
1855
+ }
1856
+ if (!options.chown && process.getuid) {
1857
+ options.chown = {
1858
+ uid: stats.uid,
1859
+ gid: stats.gid
1860
+ };
1861
+ }
1862
+ } catch (ex) {
1863
+ // ignore stat errors
1864
+ }
1865
+ }
1866
+ let fd;
1867
+ const cleanup = cleanupOnExit(tmpfile);
1868
+ const removeOnExitHandler = onExit(cleanup);
1869
+ let threw = true;
1870
+ try {
1871
+ fd = fs.openSync(tmpfile, 'w', options.mode || 0o666);
1872
+ if (options.tmpfileCreated) {
1873
+ options.tmpfileCreated(tmpfile);
1874
+ }
1875
+ if (isTypedArray(data)) {
1876
+ data = typedArrayToBuffer(data);
1877
+ }
1878
+ if (Buffer.isBuffer(data)) {
1879
+ fs.writeSync(fd, data, 0, data.length, 0);
1880
+ } else if (data != null) {
1881
+ fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8'));
1882
+ }
1883
+ if (options.fsync !== false) {
1884
+ fs.fsyncSync(fd);
1885
+ }
1886
+ fs.closeSync(fd);
1887
+ fd = null;
1888
+ if (options.chown) {
1889
+ try {
1890
+ fs.chownSync(tmpfile, options.chown.uid, options.chown.gid);
1891
+ } catch (err) {
1892
+ if (!isChownErrOk(err)) {
1893
+ throw err;
1894
+ }
1895
+ }
1896
+ }
1897
+ if (options.mode) {
1898
+ try {
1899
+ fs.chmodSync(tmpfile, options.mode);
1900
+ } catch (err) {
1901
+ if (!isChownErrOk(err)) {
1902
+ throw err;
1903
+ }
1904
+ }
1905
+ }
1906
+ fs.renameSync(tmpfile, filename);
1907
+ threw = false;
1908
+ } finally {
1909
+ if (fd) {
1910
+ try {
1911
+ fs.closeSync(fd);
1912
+ } catch (ex) {
1913
+ // ignore close errors at this stage, error may have closed fd already.
1914
+ }
1915
+ }
1916
+ removeOnExitHandler();
1917
+ if (threw) {
1918
+ cleanup();
1919
+ }
1920
+ }
1921
+ }
1922
+
1923
+ const PLUGIN_ID = "0feba3a0-b6d1-11e6-9598-0800200c9a66";
1924
+ /**
1925
+ * Starts an IG.Asset.Server session and returns the sessionId
1926
+ *
1927
+ * @param {SessionStartParams} params
1928
+ * @returns
1929
+ */
1930
+ const startSession = async ({
1931
+ url,
1932
+ authentication,
1933
+ ...params
1934
+ }) => {
1935
+ const payload = {
1936
+ ...params,
1937
+ user: undefined,
1938
+ password: undefined,
1939
+ license: undefined,
1940
+ plugin: PLUGIN_ID
1941
+ };
1942
+ if (authentication.type === "credentials") {
1943
+ payload.user = authentication.username;
1944
+ payload.password = authentication.password;
1945
+ } else if (authentication.type === "license") {
1946
+ payload.license = authentication.license;
1947
+ }
1948
+ const {
1949
+ data: {
1950
+ session: sessionId,
1951
+ state,
1952
+ response
1953
+ }
1954
+ } = await axios.post(`Session/Start2`, JSON.stringify(payload), {
1955
+ baseURL: url
1956
+ });
1957
+ if (state !== "SUCCESS") {
1958
+ let message = `Could not start session. IG.Asset.Server responded with ${state}`;
1959
+ if (response) {
1960
+ message += `: ${response}`;
1961
+ }
1962
+ throw new Error(message);
1963
+ }
1964
+ return {
1965
+ url,
1966
+ sessionId,
1967
+ domain: params.domain,
1968
+ subDomain: params.subDomain
1969
+ };
1970
+ };
1971
+ const closeSession = async session => {
1972
+ await axios.get(`Session/Close/${session.sessionId}`, {
1973
+ baseURL: session.url
1974
+ });
1975
+ };
1976
+ const uploadPackage = async (session, {
1977
+ name,
1978
+ version
1979
+ }, zipFilePath) => {
1980
+ try {
1981
+ await uploadPackageToUrl(session.url, `UploadPackage/${session.sessionId}/${name}_${version}`, zipFilePath);
1982
+ } catch (err) {
1983
+ await uploadPackageToUrl(session.url, `UploadPackage/${session.sessionId}/${name}_${version}/`, zipFilePath);
1984
+ }
1985
+ };
1986
+ const uploadPackageToUrl = async (url, path, zipFilePath) => {
1987
+ const {
1988
+ data,
1989
+ status
1990
+ } = await axios.post(path, fs$1.createReadStream(zipFilePath), {
1991
+ baseURL: url
1992
+ });
1993
+ let objectBody;
1994
+ if (typeof data === "string") {
1995
+ try {
1996
+ objectBody = JSON.parse(data);
1997
+ } catch (err) {}
1998
+ } else if (typeof data === "object") {
1999
+ objectBody = data;
2000
+ }
2001
+ if (objectBody !== undefined) {
2002
+ if ("state" in objectBody && objectBody.state !== "SUCCESS") {
2003
+ throw new Error(objectBody.response ?? objectBody.state);
2004
+ }
2005
+ }
2006
+ if (status >= 400) {
2007
+ if (objectBody !== undefined) {
2008
+ let text_1 = "";
2009
+ for (const key in objectBody) {
2010
+ text_1 += key + ": \n";
2011
+ if (typeof objectBody[key] === "object") {
2012
+ text_1 += JSON.stringify(objectBody[key], undefined, 2);
2013
+ } else {
2014
+ text_1 += objectBody[key];
2015
+ }
2016
+ text_1 += "\n\n";
2017
+ }
2018
+ throw new Error(text_1);
2019
+ }
2020
+ throw new Error(data);
2021
+ }
2022
+ return data;
2023
+ };
2024
+ const getExistingPackages = async session => {
2025
+ const {
2026
+ data
2027
+ } = await axios.get(`Script/GetInformation/${session.sessionId}`, {
2028
+ baseURL: session.url,
2029
+ validateStatus: status => status === 404 || status === 200
2030
+ }).catch(err => {
2031
+ throw new Error(`Failed to get existing packages: ${err.message}`);
2032
+ });
2033
+ return data;
2034
+ };
2035
+
2036
+ const createDefaultPrompter = () => {
2037
+ return {
2038
+ confirm: async message => {
2039
+ const {
2040
+ confirm
2041
+ } = await inquirer.prompt([{
2042
+ type: "confirm",
2043
+ message,
2044
+ name: "confirm"
2045
+ }]);
2046
+ return confirm;
2047
+ },
2048
+ ask: async question => {
2049
+ const {
2050
+ answer
2051
+ } = await inquirer.prompt([{
2052
+ type: "list",
2053
+ message: question.message,
2054
+ name: "answer",
2055
+ choices: question.options,
2056
+ default: question.default
2057
+ }]);
2058
+ return answer;
2059
+ }
2060
+ };
2061
+ };
2062
+
2063
+ const __filename$1 = fileURLToPath(import.meta.url);
2064
+ const __dirname = path$1.dirname(__filename$1);
2065
+ const pjson = JSON.parse(fs$1.readFileSync(path$1.join(__dirname, "..", "package.json"), "utf8"));
2066
+ const captureError = err => {
2067
+ console.log("");
2068
+ if (process.env.NODE_ENV !== "production") {
2069
+ console.error(err);
2070
+ } else {
2071
+ console.error("Stopped execution because of the following error: " + err.message);
2072
+ }
2073
+ };
2074
+ const buildOptions = {
2075
+ outDir: {
2076
+ description: "Output directory",
2077
+ type: "string",
2078
+ default: "bin",
2079
+ coerce: input => input === undefined || input === null ? undefined : path$1.resolve(process.cwd(), input)
2080
+ },
2081
+ minimize: {
2082
+ description: "Minify output",
2083
+ type: "boolean",
2084
+ default: true
2085
+ },
2086
+ cwd: {
2087
+ description: "Working directory",
2088
+ type: "string",
2089
+ default: process.cwd()
2090
+ },
2091
+ clean: {
2092
+ description: "Empty output dir before compiling",
2093
+ type: "boolean",
2094
+ default: false
2095
+ },
2096
+ docs: {
2097
+ type: "boolean",
2098
+ default: false
2099
+ }
2100
+ };
2101
+ const preCommandCheck = async workspaceLocation => {
2102
+ var _repositoryPackage$de, _repositoryPackage$de2;
2103
+ const executedLocalPackager = path$1.relative(process.cwd(), __filename$1).indexOf("..") === -1;
2104
+ const repositoryPackage = readWorkspaceNpmManifest(workspaceLocation);
2105
+ if (repositoryPackage !== null && repositoryPackage !== void 0 && (_repositoryPackage$de = repositoryPackage.dependencies) !== null && _repositoryPackage$de !== void 0 && _repositoryPackage$de["@intelligentgraphics/ig.gfx.packager"] || repositoryPackage !== null && repositoryPackage !== void 0 && (_repositoryPackage$de2 = repositoryPackage.devDependencies) !== null && _repositoryPackage$de2 !== void 0 && _repositoryPackage$de2["@intelligentgraphics/ig.gfx.packager"]) {
2106
+ const parts = ["Detected locally installed ig.gfx.packager."];
2107
+ if (executedLocalPackager) {
2108
+ parts.push('Run "npm install -g @intelligentgraphics/ig.gfx.packager@latest" to install the global version, if it is not yet installed.');
2109
+ }
2110
+ parts.push('Run "npm uninstall @intelligentgraphics/ig.gfx.packager" to remove the local version.');
2111
+ console.error(parts.join("\n"));
2112
+ process.exit(1);
2113
+ }
2114
+ if (executedLocalPackager) {
2115
+ console.error(`Detected locally installed ig.gfx.packager.
2116
+ Run "npm install -g @intelligentgraphics/ig.gfx.packager@latest" to install the global version, if it is not yet installed.
2117
+ Run "npm install" to get rid of the local packager version.`);
2118
+ process.exit(1);
2119
+ }
2120
+ const notifier = updateNotifier({
2121
+ pkg: pjson,
2122
+ shouldNotifyInNpmScript: true,
2123
+ updateCheckInterval: 1000 * 60
2124
+ });
2125
+ notifier.notify({
2126
+ isGlobal: true,
2127
+ defer: true
2128
+ });
2129
+ if (repositoryPackage === undefined) {
2130
+ throw new Error("Could not load package.json file in current directory");
2131
+ }
2132
+ repositoryPackage.scripts ??= {};
2133
+ repositoryPackage.scripts.postinstall = "packager postinstall";
2134
+ writeWorkspaceNpmManifest(workspaceLocation, repositoryPackage);
2135
+ };
2136
+ const yargsInstance = yargs(process.argv.slice(2));
2137
+ const resolvePackagesWithTypescriptFromMaybePatterns = (args = [], workspace) => {
2138
+ const folders = new Map();
2139
+ for (const arg of args) {
2140
+ glob.sync(arg, {
2141
+ cwd: workspace.path,
2142
+ absolute: true
2143
+ }).forEach(folder => {
2144
+ try {
2145
+ const location = detectPackage(workspace, folder);
2146
+ if (getPackageTypescriptFiles(location).length === 0) {
2147
+ return;
2148
+ }
2149
+ folders.set(folder, location);
2150
+ } catch (err) {}
2151
+ });
2152
+ }
2153
+ return Array.from(folders.values());
2154
+ };
2155
+ yargsInstance.command("build [directories...]", "Builds the specified directories", argv => argv.options(buildOptions), async ({
2156
+ directories = [],
2157
+ ...options
2158
+ }) => {
2159
+ const workspace = detectWorkspace(options.cwd);
2160
+ const folders = resolvePackagesWithTypescriptFromMaybePatterns(directories, workspace);
2161
+ await preCommandCheck(workspace);
2162
+ if (folders.length === 0) {
2163
+ return console.log("No build targets found. Please check wether a folder with the provided name exists and wether it has _Package.json.");
2164
+ }
2165
+ const {
2166
+ buildFolders
2167
+ } = await import('./index-01b0ddab.js').then(function (n) { return n.i; });
2168
+ await buildFolders({
2169
+ ...options,
2170
+ packages: folders,
2171
+ workspace
2172
+ }).catch(captureError);
2173
+ });
2174
+ yargsInstance.command("publish [directory]", "Publishes the specified directory", argv => argv.options({
2175
+ ...buildOptions,
2176
+ noUpload: {
2177
+ type: "boolean",
2178
+ default: false,
2179
+ description: "Only zip built files and do not upload them"
2180
+ },
2181
+ domain: {
2182
+ type: "string",
2183
+ description: "Overwrite the publish domain. Defaults to the one in the _Package.json"
2184
+ },
2185
+ subdomain: {
2186
+ type: "string",
2187
+ description: "Overwrite the publish subdomain. Defaults to the one in the _Package.json"
2188
+ },
2189
+ newVersion: {
2190
+ type: "string",
2191
+ description: "The name of the new version",
2192
+ default: process.env.VERSION,
2193
+ required: true
2194
+ },
2195
+ address: {
2196
+ type: "string",
2197
+ description: "Address",
2198
+ default: "localhost"
2199
+ },
2200
+ service: {
2201
+ type: "string",
2202
+ description: "IG.Asset.Server url",
2203
+ default: process.env.IG_GFX_ASSET_SERVICE,
2204
+ required: true
2205
+ },
2206
+ user: {
2207
+ type: "string",
2208
+ description: "User",
2209
+ default: process.env.IG_GFX_USER
2210
+ },
2211
+ password: {
2212
+ type: "string",
2213
+ description: "Password",
2214
+ default: process.env.IG_GFX_PWD
2215
+ },
2216
+ docs: {
2217
+ type: "boolean",
2218
+ default: false,
2219
+ description: "Generate typedoc documentation"
2220
+ },
2221
+ pushOnly: {
2222
+ type: "boolean",
2223
+ default: false,
2224
+ description: "Try to upload an existing zip file without building and validating the version number"
2225
+ },
2226
+ license: {
2227
+ type: "string",
2228
+ description: "Path to a license file",
2229
+ default: process.env.IG_GFX_LICENSE
2230
+ },
2231
+ skipDependencies: {
2232
+ type: "boolean",
2233
+ default: false,
2234
+ description: "Skip dependency checks"
2235
+ }
2236
+ }), async ({
2237
+ directory,
2238
+ user,
2239
+ password,
2240
+ service,
2241
+ license,
2242
+ ...options
2243
+ }) => {
2244
+ const workspace = detectWorkspace(options.cwd);
2245
+ const folder = detectPackage(workspace, directory);
2246
+ await preCommandCheck(workspace);
2247
+ if (!options.noUpload) {
2248
+ if (!service) {
2249
+ captureError(new Error('The IG.Asset.Server url has to either be provided using the option --service or through the "IG_GFX_ASSET_SERVICE" environment variable'));
2250
+ return;
2251
+ }
2252
+ if (!license && (!user || !password)) {
2253
+ captureError(new Error(`Expected authentication to be provided through either of the following methods:
2254
+ - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable
2255
+ - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`));
2256
+ return;
2257
+ }
2258
+ if (license && !license.endsWith(".iglic")) {
2259
+ captureError(new Error(`Expected the license path to end with the extension .iglic. Received the path "${license}". You may need to reload your environment variables by restarting the program you're using to execute the packager.`));
2260
+ return;
2261
+ }
2262
+ }
2263
+ let authentication;
2264
+ if (license) {
2265
+ const fullLicensePath = path$1.resolve(process.cwd(), license);
2266
+ try {
2267
+ const content = fs$1.readFileSync(fullLicensePath);
2268
+ authentication = {
2269
+ type: "license",
2270
+ license: content.toString("base64")
2271
+ };
2272
+ } catch (err) {
2273
+ if ((err === null || err === void 0 ? void 0 : err.code) === "ENOENT") {
2274
+ captureError(new Error(`Expected to find a license file at path: ${fullLicensePath}`));
2275
+ return;
2276
+ }
2277
+ captureError(new Error(`Failed to read license file at path: ${fullLicensePath}`));
2278
+ return;
2279
+ }
2280
+ } else if (user && password) {
2281
+ console.log(`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`);
2282
+ authentication = {
2283
+ type: "credentials",
2284
+ username: user,
2285
+ password
2286
+ };
2287
+ }
2288
+ const {
2289
+ releaseFolder
2290
+ } = await import('./index-f59e50ec.js');
2291
+ const prompter = createDefaultPrompter();
2292
+ const fullOptions = {
2293
+ ...options,
2294
+ authentication,
2295
+ service: service,
2296
+ directory: folder,
2297
+ banner: true,
2298
+ prompter,
2299
+ newVersion: options.newVersion,
2300
+ workspace
2301
+ };
2302
+ await releaseFolder(fullOptions).catch(captureError);
2303
+ });
2304
+ yargsInstance.command("testConnection [directory]", "Tests connection to asset service", argv => argv.options({
2305
+ domain: {
2306
+ type: "string",
2307
+ description: "Overwrite the publish domain. Defaults to the one in the _Package.json"
2308
+ },
2309
+ subdomain: {
2310
+ type: "string",
2311
+ description: "Overwrite the publish subdomain. Defaults to the one in the _Package.json"
2312
+ },
2313
+ address: {
2314
+ type: "string",
2315
+ description: "Address",
2316
+ default: "localhost"
2317
+ },
2318
+ service: {
2319
+ type: "string",
2320
+ description: "IG.Asset.Server url",
2321
+ default: process.env.IG_GFX_ASSET_SERVICE,
2322
+ required: true
2323
+ },
2324
+ user: {
2325
+ type: "string",
2326
+ description: "User",
2327
+ default: process.env.IG_GFX_USER
2328
+ },
2329
+ password: {
2330
+ type: "string",
2331
+ description: "Password",
2332
+ default: process.env.IG_GFX_PWD
2333
+ },
2334
+ license: {
2335
+ type: "string",
2336
+ description: "Path to a license file",
2337
+ default: process.env.IG_GFX_LICENSE
2338
+ }
2339
+ }), async ({
2340
+ user,
2341
+ password,
2342
+ service,
2343
+ license,
2344
+ subdomain,
2345
+ domain,
2346
+ address,
2347
+ directory
2348
+ }) => {
2349
+ if (!service) {
2350
+ captureError(new Error('The IG.Asset.Server url has to either be provided using the option --service or through the "IG_GFX_ASSET_SERVICE" environment variable'));
2351
+ return;
2352
+ }
2353
+ if (!license && (!user || !password)) {
2354
+ captureError(new Error(`Expected authentication to be provided through either of the following methods:
2355
+ - as a path to a license file using the --license option or the IG_GFX_LICENSE environment variable
2356
+ - as a username and password using the --user and --password options, or the IG_GFX_USER and IG_GFX_PWD environment variables`));
2357
+ return;
2358
+ }
2359
+ if (license && !license.endsWith(".iglic")) {
2360
+ captureError(new Error(`Expected the license path to end with the extension .iglic. Received the path "${license}". You may need to reload your environment variables by restarting the program you're using to execute the packager.`));
2361
+ return;
2362
+ }
2363
+ let authentication;
2364
+ if (license) {
2365
+ const fullLicensePath = path$1.resolve(process.cwd(), license);
2366
+ try {
2367
+ const content = fs$1.readFileSync(fullLicensePath);
2368
+ authentication = {
2369
+ type: "license",
2370
+ license: content.toString("base64")
2371
+ };
2372
+ } catch (err) {
2373
+ if ((err === null || err === void 0 ? void 0 : err.code) === "ENOENT") {
2374
+ captureError(new Error(`Expected to find a license file at path: ${fullLicensePath}`));
2375
+ return;
2376
+ }
2377
+ captureError(new Error(`Failed to read license file at path: ${fullLicensePath}`));
2378
+ return;
2379
+ }
2380
+ } else if (user && password) {
2381
+ console.log(`Detected usage of username and password authentication. Please migrate to the new license file based authentication.`);
2382
+ authentication = {
2383
+ type: "credentials",
2384
+ username: user,
2385
+ password
2386
+ };
2387
+ }
2388
+ if (authentication === undefined) {
2389
+ throw new Error(`Expected authentication to be available`);
2390
+ }
2391
+ if (typeof directory === "string") {
2392
+ const workspace = detectWorkspace(process.cwd());
2393
+ const folder = detectPackage(workspace, directory);
2394
+ const manifest = readPackageCreatorManifest(folder);
2395
+ const parsedName = parseCreatorPackageName(manifest);
2396
+ if (domain === undefined) {
2397
+ domain = parsedName.domain;
2398
+ }
2399
+ if (subdomain === undefined) {
2400
+ subdomain = parsedName.subdomain;
2401
+ }
2402
+ }
2403
+ if (domain === undefined || subdomain === undefined) {
2404
+ throw new Error(`Expected either domain and subdomain to be provided through options or to be executed for a specific package directory`);
2405
+ }
2406
+ const session = await startSession({
2407
+ url: service,
2408
+ address,
2409
+ domain,
2410
+ subDomain: subdomain,
2411
+ authentication
2412
+ });
2413
+ await closeSession(session);
2414
+ console.log(`Asset service session successfully started and closed`);
2415
+ });
2416
+ yargsInstance.command({
2417
+ command: "generateIndex [directory]",
2418
+ builder: argv => {
2419
+ return argv.option("ignore", {
2420
+ type: "array",
2421
+ default: [],
2422
+ description: "Files to ignore while generating index"
2423
+ });
2424
+ },
2425
+ handler: async ({
2426
+ directory,
2427
+ ignore
2428
+ }) => {
2429
+ const workspace = detectWorkspace(process.cwd());
2430
+ await preCommandCheck(workspace);
2431
+ const {
2432
+ extract
2433
+ } = await import('./generate-97bb8b12.js');
2434
+ const location = detectPackage(workspace, directory);
2435
+ extract(location, ignore);
2436
+ }
2437
+ });
2438
+ yargsInstance.command({
2439
+ command: "postinstall",
2440
+ builder: argv => argv,
2441
+ handler: async () => {
2442
+ const {
2443
+ executePostInstall
2444
+ } = await import('./postinstall-5bba19eb.js');
2445
+ executePostInstall(detectWorkspace(process.cwd()));
2446
+ },
2447
+ describe: "Runs postinstall tasks"
2448
+ });
2449
+ yargsInstance.command({
2450
+ command: "publishNpm [directory]",
2451
+ builder: argv => argv.options({
2452
+ newVersion: {
2453
+ type: "string",
2454
+ description: "Name of the new version",
2455
+ default: process.env.VERSION,
2456
+ required: true
2457
+ },
2458
+ dryRun: {
2459
+ type: "boolean"
2460
+ }
2461
+ }),
2462
+ handler: async ({
2463
+ directory,
2464
+ newVersion,
2465
+ dryRun
2466
+ }) => {
2467
+ const workspace = detectWorkspace(process.cwd());
2468
+ const {
2469
+ publishToNpm
2470
+ } = await import('./publishNpm-eb07f766.js');
2471
+ await publishToNpm({
2472
+ workspace,
2473
+ location: detectPackage(workspace, directory),
2474
+ version: newVersion,
2475
+ dryRun
2476
+ }).catch(captureError);
2477
+ },
2478
+ describe: "Publishes the package to npm"
2479
+ });
2480
+ yargsInstance.demandCommand().pkgConf("packager").showHelpOnFail(false).version(pjson.version).argv;
2481
+
2482
+ var cli = /*#__PURE__*/Object.freeze({
2483
+ __proto__: null
2484
+ });
2485
+
2486
+ export { INDEX_FILE as I, PACKAGE_FILE as P, readPackageAnimationList as a, readPackageCreatorIndex as b, readWorkspaceNpmManifest as c, getPackageReleasesDirectory as d, getExistingPackages as e, closeSession as f, getWorkspaceOutputPath as g, getPackageTypescriptFiles as h, isErrorENOENT as i, writePackageCreatorIndex as j, getWorkspaceLibPath as k, readNpmManifest as l, stripUtf8Bom as m, readPackageNpmManifest as n, writePackageNpmManifest as o, parseCreatorPackageName as p, iterateWorkspacePackages as q, readPackageCreatorManifest as r, startSession as s, cli as t, uploadPackage as u, writePackageCreatorManifest as w };
2487
+ //# sourceMappingURL=cli-2c3347fd.js.map