keycloakify 11.6.0 → 11.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1009 @@
1
+ "use strict";
2
+ exports.id = 615;
3
+ exports.ids = [615];
4
+ exports.modules = {
5
+
6
+ /***/ 61615:
7
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
+
9
+ // ESM COMPAT FLAG
10
+ __webpack_require__.r(__webpack_exports__);
11
+
12
+ // EXPORTS
13
+ __webpack_require__.d(__webpack_exports__, {
14
+ "command": () => (/* binding */ command)
15
+ });
16
+
17
+ // EXTERNAL MODULE: external "path"
18
+ var external_path_ = __webpack_require__(71017);
19
+ // EXTERNAL MODULE: external "fs"
20
+ var external_fs_ = __webpack_require__(57147);
21
+ // EXTERNAL MODULE: ./dist/bin/shared/customHandler_delegate.js + 1 modules
22
+ var customHandler_delegate = __webpack_require__(72138);
23
+ // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
24
+ var assert = __webpack_require__(29041);
25
+ // EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
26
+ var id = __webpack_require__(38469);
27
+ ;// CONCATENATED MODULE: ./dist/bin/shared/addPostinstallScriptIfNotPresent.js
28
+
29
+
30
+ (0,assert/* assert */.h)();
31
+ function addPostinstallScriptIfNotPresent(params) {
32
+ var _a;
33
+ const { parsedPackageJson, buildContext } = params;
34
+ const cmd_base = "keycloakify postinstall";
35
+ const projectCliOptionValue = (() => {
36
+ const packageJsonDirPath = (0,external_path_.dirname)(buildContext.packageJsonFilePath);
37
+ const relativePath = (0,external_path_.relative)(packageJsonDirPath, buildContext.projectDirPath);
38
+ if (relativePath === "") {
39
+ return undefined;
40
+ }
41
+ return relativePath.split(external_path_.sep).join("/");
42
+ })();
43
+ const generateCmd = (params) => {
44
+ const { cmd_preexisting } = params;
45
+ let cmd = cmd_preexisting === undefined ? "" : `${cmd_preexisting} && `;
46
+ cmd += cmd_base;
47
+ if (projectCliOptionValue !== undefined) {
48
+ cmd += ` -p ${projectCliOptionValue}`;
49
+ }
50
+ return cmd;
51
+ };
52
+ {
53
+ const scripts = ((_a = parsedPackageJson.scripts) !== null && _a !== void 0 ? _a : (parsedPackageJson.scripts = {}));
54
+ for (const scriptName of ["postinstall", "prepare"]) {
55
+ const cmd_preexisting = scripts[scriptName];
56
+ if (cmd_preexisting === undefined) {
57
+ continue;
58
+ }
59
+ if (cmd_preexisting.includes(cmd_base)) {
60
+ scripts[scriptName] = generateCmd({ cmd_preexisting });
61
+ return;
62
+ }
63
+ }
64
+ }
65
+ parsedPackageJson.scripts = Object.assign({ postinstall: generateCmd({ cmd_preexisting: undefined }) }, parsedPackageJson.scripts);
66
+ }
67
+ //# sourceMappingURL=addPostinstallScriptIfNotPresent.js.map
68
+ // EXTERNAL MODULE: ./dist/bin/tools/runPrettier.js
69
+ var runPrettier = __webpack_require__(48433);
70
+ // EXTERNAL MODULE: ./dist/bin/tools/npmInstall.js
71
+ var npmInstall = __webpack_require__(50030);
72
+ // EXTERNAL MODULE: external "child_process"
73
+ var external_child_process_ = __webpack_require__(32081);
74
+ // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
75
+ var lib = __webpack_require__(52300);
76
+ // EXTERNAL MODULE: ./node_modules/chalk/source/index.js
77
+ var source = __webpack_require__(78818);
78
+ var source_default = /*#__PURE__*/__webpack_require__.n(source);
79
+ ;// CONCATENATED MODULE: ./dist/bin/initialize-admin-theme.js
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+ async function command(params) {
92
+ var _a;
93
+ const { buildContext } = params;
94
+ const { hasBeenHandled } = (0,customHandler_delegate/* maybeDelegateCommandToCustomHandler */.q)({
95
+ commandName: "initialize-admin-theme",
96
+ buildContext
97
+ });
98
+ if (hasBeenHandled) {
99
+ return;
100
+ }
101
+ {
102
+ const adminThemeSrcDirPath = (0,external_path_.join)(buildContext.themeSrcDirPath, "admin");
103
+ if (external_fs_.existsSync(adminThemeSrcDirPath) &&
104
+ external_fs_.readdirSync(adminThemeSrcDirPath).length > 0) {
105
+ console.warn(source_default().red(`There is already a ${(0,external_path_.relative)(process.cwd(), adminThemeSrcDirPath)} directory in your project. Aborting.`));
106
+ process.exit(-1);
107
+ }
108
+ }
109
+ const parsedPackageJson = (() => {
110
+ const zParsedPackageJson = (() => {
111
+ const zTargetType = lib.z.object({
112
+ scripts: lib.z.record(lib.z.union([lib.z.string(), lib.z.undefined()])).optional(),
113
+ dependencies: lib.z.record(lib.z.union([lib.z.string(), lib.z.undefined()])).optional(),
114
+ devDependencies: lib.z.record(lib.z.union([lib.z.string(), lib.z.undefined()])).optional()
115
+ });
116
+ assert/* assert */.h;
117
+ return (0,id.id)(zTargetType);
118
+ })();
119
+ const parsedPackageJson = JSON.parse(external_fs_.readFileSync(buildContext.packageJsonFilePath).toString("utf8"));
120
+ zParsedPackageJson.parse(parsedPackageJson);
121
+ (0,assert/* assert */.h)((0,assert.is)(parsedPackageJson));
122
+ return parsedPackageJson;
123
+ })();
124
+ addPostinstallScriptIfNotPresent({
125
+ parsedPackageJson,
126
+ buildContext
127
+ });
128
+ const uiSharedMajor = (() => {
129
+ const dependencies = Object.assign(Object.assign({}, parsedPackageJson.devDependencies), parsedPackageJson.dependencies);
130
+ const version = dependencies["@keycloakify/keycloak-ui-shared"];
131
+ if (version === undefined) {
132
+ return undefined;
133
+ }
134
+ const match = version.match(/^[^~]?(\d+)\./);
135
+ if (match === null) {
136
+ return undefined;
137
+ }
138
+ return match[1];
139
+ })();
140
+ const moduleName = "@keycloakify/keycloak-admin-ui";
141
+ const version = JSON.parse(external_child_process_.execSync(`npm show ${moduleName} versions --json`)
142
+ .toString("utf8")
143
+ .trim())
144
+ .reverse()
145
+ .filter(version => !version.includes("-"))
146
+ .find(version => uiSharedMajor === undefined ? true : version.startsWith(`${uiSharedMajor}.`));
147
+ (0,assert/* assert */.h)(version !== undefined);
148
+ ((_a = parsedPackageJson.dependencies) !== null && _a !== void 0 ? _a : (parsedPackageJson.dependencies = {}))[moduleName] = `~${version}`;
149
+ if (parsedPackageJson.devDependencies !== undefined) {
150
+ delete parsedPackageJson.devDependencies[moduleName];
151
+ }
152
+ {
153
+ let sourceCode = JSON.stringify(parsedPackageJson, undefined, 2);
154
+ if (await (0,runPrettier/* getIsPrettierAvailable */.MT)()) {
155
+ sourceCode = await (0,runPrettier/* runPrettier */.eY)({
156
+ sourceCode,
157
+ filePath: buildContext.packageJsonFilePath
158
+ });
159
+ }
160
+ external_fs_.writeFileSync(buildContext.packageJsonFilePath, Buffer.from(sourceCode, "utf8"));
161
+ }
162
+ await (0,npmInstall/* npmInstall */.c)({
163
+ packageJsonDirPath: (0,external_path_.dirname)(buildContext.packageJsonFilePath)
164
+ });
165
+ }
166
+ //# sourceMappingURL=initialize-admin-theme.js.map
167
+
168
+ /***/ }),
169
+
170
+ /***/ 72138:
171
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
172
+
173
+
174
+ // EXPORTS
175
+ __webpack_require__.d(__webpack_exports__, {
176
+ "q": () => (/* binding */ maybeDelegateCommandToCustomHandler)
177
+ });
178
+
179
+ // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
180
+ var esm_assert = __webpack_require__(29041);
181
+ // EXTERNAL MODULE: ./dist/bin/shared/constants.js
182
+ var constants = __webpack_require__(173);
183
+ ;// CONCATENATED MODULE: ./dist/bin/shared/customHandler.js
184
+
185
+
186
+ const BIN_NAME = "_keycloakify-custom-handler";
187
+ const NOT_IMPLEMENTED_EXIT_CODE = 78;
188
+ function readParams(params) {
189
+ const { apiVersion } = params;
190
+ assert(apiVersion === "v1");
191
+ const commandName = (() => {
192
+ const envValue = process.env[CUSTOM_HANDLER_ENV_NAMES.COMMAND_NAME];
193
+ assert(envValue !== undefined);
194
+ return envValue;
195
+ })();
196
+ const buildContext = (() => {
197
+ const envValue = process.env[CUSTOM_HANDLER_ENV_NAMES.BUILD_CONTEXT];
198
+ assert(envValue !== undefined);
199
+ return JSON.parse(envValue);
200
+ })();
201
+ return { commandName, buildContext };
202
+ }
203
+ //# sourceMappingURL=customHandler.js.map
204
+ // EXTERNAL MODULE: external "child_process"
205
+ var external_child_process_ = __webpack_require__(32081);
206
+ // EXTERNAL MODULE: ./dist/bin/tools/nodeModulesBinDirPath.js
207
+ var tools_nodeModulesBinDirPath = __webpack_require__(73776);
208
+ // EXTERNAL MODULE: external "fs"
209
+ var external_fs_ = __webpack_require__(57147);
210
+ ;// CONCATENATED MODULE: ./dist/bin/shared/customHandler_delegate.js
211
+
212
+
213
+
214
+
215
+
216
+
217
+ (0,esm_assert/* assert */.h)();
218
+ function maybeDelegateCommandToCustomHandler(params) {
219
+ const { commandName, buildContext } = params;
220
+ const nodeModulesBinDirPath = (0,tools_nodeModulesBinDirPath/* getNodeModulesBinDirPath */.K)();
221
+ if (!external_fs_.readdirSync(nodeModulesBinDirPath).includes(BIN_NAME)) {
222
+ return { hasBeenHandled: false };
223
+ }
224
+ try {
225
+ external_child_process_.execSync(`npx ${BIN_NAME}`, {
226
+ stdio: "inherit",
227
+ env: Object.assign(Object.assign({}, process.env), { [constants/* CUSTOM_HANDLER_ENV_NAMES.COMMAND_NAME */._S.COMMAND_NAME]: commandName, [constants/* CUSTOM_HANDLER_ENV_NAMES.BUILD_CONTEXT */._S.BUILD_CONTEXT]: JSON.stringify(buildContext) })
228
+ });
229
+ }
230
+ catch (error) {
231
+ const status = error.status;
232
+ if (status === NOT_IMPLEMENTED_EXIT_CODE) {
233
+ return { hasBeenHandled: false };
234
+ }
235
+ process.exit(status);
236
+ }
237
+ return { hasBeenHandled: true };
238
+ }
239
+ //# sourceMappingURL=customHandler_delegate.js.map
240
+
241
+ /***/ }),
242
+
243
+ /***/ 12171:
244
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
245
+
246
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
247
+ /* harmony export */ "h": () => (/* binding */ SemVer)
248
+ /* harmony export */ });
249
+ var SemVer;
250
+ (function (SemVer) {
251
+ const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
252
+ function parse(versionStr) {
253
+ const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
254
+ if (!match) {
255
+ throw new Error(`${versionStr} is not a valid semantic version`);
256
+ }
257
+ const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
258
+ const str = match[3];
259
+ return str === undefined ? 0 : parseInt(str);
260
+ })() }, (() => {
261
+ const str = match[4];
262
+ return str === undefined ? {} : { rc: parseInt(str) };
263
+ })());
264
+ const initialStr = stringify(semVer);
265
+ Object.defineProperty(semVer, "parsedFrom", {
266
+ enumerable: true,
267
+ get: function () {
268
+ const currentStr = stringify(this);
269
+ if (currentStr !== initialStr) {
270
+ throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
271
+ }
272
+ return versionStr;
273
+ }
274
+ });
275
+ return semVer;
276
+ }
277
+ SemVer.parse = parse;
278
+ function stringify(v) {
279
+ return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
280
+ }
281
+ SemVer.stringify = stringify;
282
+ /**
283
+ *
284
+ * v1 < v2 => -1
285
+ * v1 === v2 => 0
286
+ * v1 > v2 => 1
287
+ *
288
+ */
289
+ function compare(v1, v2) {
290
+ const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
291
+ const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
292
+ for (const level of ["major", "minor", "patch", "rc"]) {
293
+ if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
294
+ return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
295
+ }
296
+ }
297
+ return 0;
298
+ }
299
+ SemVer.compare = compare;
300
+ /*
301
+ console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
302
+ console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
303
+ console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
304
+ */
305
+ function bumpType(params) {
306
+ const versionAhead = typeof params.versionAhead === "string"
307
+ ? parse(params.versionAhead)
308
+ : params.versionAhead;
309
+ const versionBehind = typeof params.versionBehind === "string"
310
+ ? parse(params.versionBehind)
311
+ : params.versionBehind;
312
+ if (compare(versionBehind, versionAhead) === 1) {
313
+ throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
314
+ }
315
+ for (const level of ["major", "minor", "patch", "rc"]) {
316
+ if (versionBehind[level] !== versionAhead[level]) {
317
+ return level;
318
+ }
319
+ }
320
+ return "no bump";
321
+ }
322
+ SemVer.bumpType = bumpType;
323
+ })(SemVer || (SemVer = {}));
324
+ //# sourceMappingURL=SemVer.js.map
325
+
326
+ /***/ }),
327
+
328
+ /***/ 89693:
329
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
330
+
331
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
332
+ /* harmony export */ "a": () => (/* binding */ rmSync)
333
+ /* harmony export */ });
334
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
335
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
336
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
337
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
338
+ /* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
339
+
340
+
341
+
342
+ /**
343
+ * Polyfill of fs.rmSync(dirPath, { "recursive": true })
344
+ * For older version of Node
345
+ */
346
+ function rmSync(dirPath, options) {
347
+ if (_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.compare */ .h.compare(_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse(process.version), _SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse("14.14.0")) > 0) {
348
+ fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(dirPath, options);
349
+ return;
350
+ }
351
+ const { force = true } = options;
352
+ if (force && !fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
353
+ return;
354
+ }
355
+ const removeDir_rec = (dirPath) => fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath).forEach(basename => {
356
+ const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
357
+ if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
358
+ removeDir_rec(fileOrDirPath);
359
+ return;
360
+ }
361
+ else {
362
+ fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(fileOrDirPath);
363
+ }
364
+ });
365
+ removeDir_rec(dirPath);
366
+ }
367
+ //# sourceMappingURL=fs.rmSync.js.map
368
+
369
+ /***/ }),
370
+
371
+ /***/ 73776:
372
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
373
+
374
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
375
+ /* harmony export */ "K": () => (/* binding */ getNodeModulesBinDirPath)
376
+ /* harmony export */ });
377
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
378
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
379
+
380
+ let cache = undefined;
381
+ function getNodeModulesBinDirPath() {
382
+ if (cache !== undefined) {
383
+ return cache;
384
+ }
385
+ const binPath = process.argv[1];
386
+ const segments = [".bin"];
387
+ let foundNodeModules = false;
388
+ for (const segment of binPath.split(path__WEBPACK_IMPORTED_MODULE_0__.sep).reverse()) {
389
+ skip_segment: {
390
+ if (foundNodeModules) {
391
+ break skip_segment;
392
+ }
393
+ if (segment === "node_modules") {
394
+ foundNodeModules = true;
395
+ break skip_segment;
396
+ }
397
+ continue;
398
+ }
399
+ segments.unshift(segment);
400
+ }
401
+ const nodeModulesBinDirPath = segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep);
402
+ cache = nodeModulesBinDirPath;
403
+ return nodeModulesBinDirPath;
404
+ }
405
+ //# sourceMappingURL=nodeModulesBinDirPath.js.map
406
+
407
+ /***/ }),
408
+
409
+ /***/ 50030:
410
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
411
+
412
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
413
+ /* harmony export */ "c": () => (/* binding */ npmInstall)
414
+ /* harmony export */ });
415
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
416
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
417
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
418
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
419
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32081);
420
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_2__);
421
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78818);
422
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_3__);
423
+ /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(52300);
424
+ /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29041);
425
+ /* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(38469);
426
+ /* harmony import */ var tsafe_objectKeys__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(23483);
427
+ /* harmony import */ var _getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84794);
428
+ /* harmony import */ var tsafe_exclude__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(83101);
429
+ /* harmony import */ var _fs_rmSync__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(89693);
430
+ /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(50689);
431
+ /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_7__);
432
+
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+ async function npmInstall(params) {
445
+ const { packageJsonDirPath } = params;
446
+ const packageManagerBinName = (() => {
447
+ const packageMangers = [
448
+ {
449
+ binName: "yarn",
450
+ lockFileBasename: "yarn.lock"
451
+ },
452
+ {
453
+ binName: "npm",
454
+ lockFileBasename: "package-lock.json"
455
+ },
456
+ {
457
+ binName: "pnpm",
458
+ lockFileBasename: "pnpm-lock.yaml"
459
+ },
460
+ {
461
+ binName: "bun",
462
+ lockFileBasename: "bun.lockdb"
463
+ },
464
+ {
465
+ binName: "deno",
466
+ lockFileBasename: "deno.lock"
467
+ }
468
+ ];
469
+ for (const packageManager of packageMangers) {
470
+ if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, packageManager.lockFileBasename)) ||
471
+ fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(process.cwd(), packageManager.lockFileBasename))) {
472
+ return packageManager.binName;
473
+ }
474
+ }
475
+ throw new Error("No lock file found, cannot tell which package manager to use for installing dependencies.");
476
+ })();
477
+ console.log(`Installing the new dependencies...`);
478
+ install_without_breaking_links: {
479
+ if (packageManagerBinName !== "yarn") {
480
+ break install_without_breaking_links;
481
+ }
482
+ const garronejLinkInfos = getGarronejLinkInfos({ packageJsonDirPath });
483
+ if (garronejLinkInfos === undefined) {
484
+ break install_without_breaking_links;
485
+ }
486
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_3___default().green("Installing in a way that won't break the links..."));
487
+ await installWithoutBreakingLinks({
488
+ packageJsonDirPath,
489
+ garronejLinkInfos
490
+ });
491
+ return;
492
+ }
493
+ try {
494
+ await runPackageManagerInstall({
495
+ packageManagerBinName,
496
+ cwd: packageJsonDirPath
497
+ });
498
+ }
499
+ catch (_a) {
500
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_3___default().yellow(`\`${packageManagerBinName} install\` failed, continuing anyway...`));
501
+ }
502
+ }
503
+ async function runPackageManagerInstall(params) {
504
+ const { packageManagerBinName, cwd } = params;
505
+ const dCompleted = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_7__.Deferred();
506
+ const child = child_process__WEBPACK_IMPORTED_MODULE_2__.spawn(packageManagerBinName, ["install"], {
507
+ cwd,
508
+ env: process.env,
509
+ shell: true
510
+ });
511
+ child.stdout.on("data", data => process.stdout.write(data));
512
+ child.stderr.on("data", data => {
513
+ if (data.toString("utf8").includes("has unmet peer dependency")) {
514
+ return;
515
+ }
516
+ process.stderr.write(data);
517
+ });
518
+ child.on("exit", code => {
519
+ if (code !== 0) {
520
+ dCompleted.reject(new Error(`Failed with code ${code}`));
521
+ return;
522
+ }
523
+ dCompleted.resolve();
524
+ });
525
+ await dCompleted.pr;
526
+ }
527
+ function getGarronejLinkInfos(params) {
528
+ const { packageJsonDirPath } = params;
529
+ const nodeModuleDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, "node_modules");
530
+ if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(nodeModuleDirPath)) {
531
+ return undefined;
532
+ }
533
+ const linkedModuleNames = [];
534
+ let yarnHomeDirPath = undefined;
535
+ const getIsLinkedByGarronejScript = (path) => {
536
+ let realPath;
537
+ try {
538
+ realPath = fs__WEBPACK_IMPORTED_MODULE_0__.readlinkSync(path);
539
+ }
540
+ catch (_a) {
541
+ return false;
542
+ }
543
+ const doesIncludeYarnHome = realPath.includes(".yarn_home");
544
+ if (!doesIncludeYarnHome) {
545
+ return false;
546
+ }
547
+ set_yarnHomeDirPath: {
548
+ if (yarnHomeDirPath !== undefined) {
549
+ break set_yarnHomeDirPath;
550
+ }
551
+ const [firstElement] = (0,_getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_5__/* .getAbsoluteAndInOsFormatPath */ .c)({
552
+ pathIsh: realPath,
553
+ cwd: (0,path__WEBPACK_IMPORTED_MODULE_1__.dirname)(path)
554
+ }).split(".yarn_home");
555
+ yarnHomeDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(firstElement, ".yarn_home");
556
+ }
557
+ return true;
558
+ };
559
+ for (const basename of fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(nodeModuleDirPath)) {
560
+ const path = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModuleDirPath, basename);
561
+ if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(path).isSymbolicLink()) {
562
+ if (basename.startsWith("@")) {
563
+ return undefined;
564
+ }
565
+ if (!getIsLinkedByGarronejScript(path)) {
566
+ return undefined;
567
+ }
568
+ linkedModuleNames.push(basename);
569
+ continue;
570
+ }
571
+ if (!fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(path).isDirectory()) {
572
+ continue;
573
+ }
574
+ if (basename.startsWith("@")) {
575
+ for (const subBasename of fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(path)) {
576
+ const subPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(path, subBasename);
577
+ if (!fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(subPath).isSymbolicLink()) {
578
+ continue;
579
+ }
580
+ if (!getIsLinkedByGarronejScript(subPath)) {
581
+ return undefined;
582
+ }
583
+ linkedModuleNames.push(`${basename}/${subBasename}`);
584
+ }
585
+ }
586
+ }
587
+ if (yarnHomeDirPath === undefined) {
588
+ return undefined;
589
+ }
590
+ return { linkedModuleNames, yarnHomeDirPath };
591
+ }
592
+ async function installWithoutBreakingLinks(params) {
593
+ const { packageJsonDirPath, garronejLinkInfos: { linkedModuleNames, yarnHomeDirPath } } = params;
594
+ const parsedPackageJson = (() => {
595
+ const packageJsonFilePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, "package.json");
596
+ const zParsedPackageJson = (() => {
597
+ const zTargetType = zod__WEBPACK_IMPORTED_MODULE_8__.z.object({
598
+ scripts: zod__WEBPACK_IMPORTED_MODULE_8__.z.record(zod__WEBPACK_IMPORTED_MODULE_8__.z.string()).optional()
599
+ });
600
+ tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .h;
601
+ return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_9__.id)(zTargetType);
602
+ })();
603
+ const parsedPackageJson = JSON.parse(fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(packageJsonFilePath).toString("utf8"));
604
+ zParsedPackageJson.parse(parsedPackageJson);
605
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .h)((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__.is)(parsedPackageJson));
606
+ return parsedPackageJson;
607
+ })();
608
+ const isImplementedScriptByName = {
609
+ postinstall: false,
610
+ prepare: false
611
+ };
612
+ delete_postinstall_script: {
613
+ if (parsedPackageJson.scripts === undefined) {
614
+ break delete_postinstall_script;
615
+ }
616
+ for (const scriptName of (0,tsafe_objectKeys__WEBPACK_IMPORTED_MODULE_10__/* .objectKeys */ .Y)(isImplementedScriptByName)) {
617
+ if (parsedPackageJson.scripts[scriptName] === undefined) {
618
+ continue;
619
+ }
620
+ isImplementedScriptByName[scriptName] = true;
621
+ delete parsedPackageJson.scripts[scriptName];
622
+ }
623
+ }
624
+ const tmpProjectDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(yarnHomeDirPath, "tmpProject");
625
+ if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(tmpProjectDirPath)) {
626
+ (0,_fs_rmSync__WEBPACK_IMPORTED_MODULE_6__/* .rmSync */ .a)(tmpProjectDirPath, { recursive: true });
627
+ }
628
+ fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(tmpProjectDirPath, { recursive: true });
629
+ fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tmpProjectDirPath, "package.json"), JSON.stringify(parsedPackageJson, undefined, 4));
630
+ const YARN_LOCK = "yarn.lock";
631
+ fs__WEBPACK_IMPORTED_MODULE_0__.copyFileSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, YARN_LOCK), (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tmpProjectDirPath, YARN_LOCK));
632
+ await runPackageManagerInstall({
633
+ packageManagerBinName: "yarn",
634
+ cwd: tmpProjectDirPath
635
+ });
636
+ // NOTE: Moving the modules from the tmp project to the actual project
637
+ // without messing up the links.
638
+ {
639
+ const { getAreSameVersions } = (() => {
640
+ const zParsedPackageJson = (() => {
641
+ const zTargetType = zod__WEBPACK_IMPORTED_MODULE_8__.z.object({
642
+ version: zod__WEBPACK_IMPORTED_MODULE_8__.z.string()
643
+ });
644
+ tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .h;
645
+ return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_9__.id)(zTargetType);
646
+ })();
647
+ function readVersion(params) {
648
+ const { moduleDirPath } = params;
649
+ const packageJsonFilePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(moduleDirPath, "package.json");
650
+ const packageJson = JSON.parse(fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(packageJsonFilePath).toString("utf8"));
651
+ zParsedPackageJson.parse(packageJson);
652
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .h)((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__.is)(packageJson));
653
+ return packageJson.version;
654
+ }
655
+ function getAreSameVersions(params) {
656
+ const { moduleDirPath_a, moduleDirPath_b } = params;
657
+ return (readVersion({ moduleDirPath: moduleDirPath_a }) ===
658
+ readVersion({ moduleDirPath: moduleDirPath_b }));
659
+ }
660
+ return { getAreSameVersions };
661
+ })();
662
+ const nodeModulesDirPath_tmpProject = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tmpProjectDirPath, "node_modules");
663
+ const nodeModulesDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, "node_modules");
664
+ const modulePaths = fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(nodeModulesDirPath_tmpProject)
665
+ .map(basename => {
666
+ if (basename.startsWith(".")) {
667
+ return undefined;
668
+ }
669
+ const path = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesDirPath_tmpProject, basename);
670
+ if (basename.startsWith("@")) {
671
+ return fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(path)
672
+ .map(subBasename => {
673
+ if (subBasename.startsWith(".")) {
674
+ return undefined;
675
+ }
676
+ const subPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(path, subBasename);
677
+ if (!fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(subPath).isDirectory()) {
678
+ return undefined;
679
+ }
680
+ return {
681
+ moduleName: `${basename}/${subBasename}`,
682
+ moduleDirPath_tmpProject: subPath,
683
+ moduleDirPath: (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesDirPath, basename, subBasename)
684
+ };
685
+ })
686
+ .filter((0,tsafe_exclude__WEBPACK_IMPORTED_MODULE_11__/* .exclude */ .D)(undefined));
687
+ }
688
+ if (!fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(path).isDirectory()) {
689
+ return undefined;
690
+ }
691
+ return [
692
+ {
693
+ moduleName: basename,
694
+ moduleDirPath_tmpProject: path,
695
+ moduleDirPath: (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesDirPath, basename)
696
+ }
697
+ ];
698
+ })
699
+ .filter((0,tsafe_exclude__WEBPACK_IMPORTED_MODULE_11__/* .exclude */ .D)(undefined))
700
+ .flat();
701
+ for (const { moduleName, moduleDirPath, moduleDirPath_tmpProject } of modulePaths) {
702
+ if (linkedModuleNames.includes(moduleName)) {
703
+ continue;
704
+ }
705
+ let doesTargetModuleExist = false;
706
+ skip_condition: {
707
+ if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(moduleDirPath)) {
708
+ break skip_condition;
709
+ }
710
+ doesTargetModuleExist = true;
711
+ const areSameVersions = getAreSameVersions({
712
+ moduleDirPath_a: moduleDirPath,
713
+ moduleDirPath_b: moduleDirPath_tmpProject
714
+ });
715
+ if (!areSameVersions) {
716
+ break skip_condition;
717
+ }
718
+ continue;
719
+ }
720
+ if (doesTargetModuleExist) {
721
+ (0,_fs_rmSync__WEBPACK_IMPORTED_MODULE_6__/* .rmSync */ .a)(moduleDirPath, { recursive: true });
722
+ }
723
+ {
724
+ const dirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.dirname)(moduleDirPath);
725
+ if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
726
+ fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(dirPath, { recursive: true });
727
+ }
728
+ }
729
+ fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(moduleDirPath_tmpProject, moduleDirPath);
730
+ }
731
+ move_bin: {
732
+ const binDirPath_tmpProject = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesDirPath_tmpProject, ".bin");
733
+ const binDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesDirPath, ".bin");
734
+ if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(binDirPath_tmpProject)) {
735
+ break move_bin;
736
+ }
737
+ for (const basename of fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(binDirPath_tmpProject)) {
738
+ const path_tmpProject = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(binDirPath_tmpProject, basename);
739
+ const path = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(binDirPath, basename);
740
+ if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(path)) {
741
+ continue;
742
+ }
743
+ fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(path_tmpProject, path);
744
+ }
745
+ }
746
+ }
747
+ fs__WEBPACK_IMPORTED_MODULE_0__.cpSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tmpProjectDirPath, YARN_LOCK), (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, YARN_LOCK));
748
+ (0,_fs_rmSync__WEBPACK_IMPORTED_MODULE_6__/* .rmSync */ .a)(tmpProjectDirPath, { recursive: true });
749
+ for (const scriptName of (0,tsafe_objectKeys__WEBPACK_IMPORTED_MODULE_10__/* .objectKeys */ .Y)(isImplementedScriptByName)) {
750
+ if (!isImplementedScriptByName[scriptName]) {
751
+ continue;
752
+ }
753
+ child_process__WEBPACK_IMPORTED_MODULE_2__.execSync(`yarn run ${scriptName}`, {
754
+ cwd: packageJsonDirPath,
755
+ stdio: "inherit"
756
+ });
757
+ }
758
+ }
759
+ //# sourceMappingURL=npmInstall.js.map
760
+
761
+ /***/ }),
762
+
763
+ /***/ 48433:
764
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
765
+
766
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
767
+ /* harmony export */ "LG": () => (/* binding */ getPrettier),
768
+ /* harmony export */ "MT": () => (/* binding */ getIsPrettierAvailable),
769
+ /* harmony export */ "eY": () => (/* binding */ runPrettier)
770
+ /* harmony export */ });
771
+ /* harmony import */ var _nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73776);
772
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
773
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
774
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73292);
775
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_2__);
776
+ /* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38469);
777
+ /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29041);
778
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(78818);
779
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_4__);
780
+ /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6113);
781
+ /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_5__);
782
+ /* harmony import */ var tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(76030);
783
+ /* harmony import */ var _readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(64795);
784
+
785
+
786
+
787
+
788
+
789
+
790
+
791
+
792
+
793
+ getIsPrettierAvailable.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_7__.id)(undefined);
794
+ async function getIsPrettierAvailable() {
795
+ var _a;
796
+ if (getIsPrettierAvailable.cache !== undefined) {
797
+ return getIsPrettierAvailable.cache;
798
+ }
799
+ const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)();
800
+ const prettierBinPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesBinDirPath, "prettier");
801
+ const stats = await fs_promises__WEBPACK_IMPORTED_MODULE_2__.stat(prettierBinPath).catch(() => undefined);
802
+ const isPrettierAvailable = (_a = stats === null || stats === void 0 ? void 0 : stats.isFile()) !== null && _a !== void 0 ? _a : false;
803
+ getIsPrettierAvailable.cache = isPrettierAvailable;
804
+ return isPrettierAvailable;
805
+ }
806
+ getPrettier.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_7__.id)(undefined);
807
+ async function getPrettier() {
808
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .h)(getIsPrettierAvailable());
809
+ if (getPrettier.cache !== undefined) {
810
+ return getPrettier.cache;
811
+ }
812
+ let prettier = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_7__.id)(undefined);
813
+ import_prettier: {
814
+ // NOTE: When module is linked we want to make sure we import the correct version
815
+ // of prettier, that is the one of the project, not the one of this repo.
816
+ // So we do a sketchy eval to bypass ncc.
817
+ // We make sure to only do that when linking, otherwise we import properly.
818
+ if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_6__/* .readThisNpmPackageVersion */ .K)().startsWith("0.0.0")) {
819
+ eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__/* .symToStr */ .r)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_1__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(), "..", "prettier"))}")`);
820
+ (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .h)(!(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__.is)(prettier));
821
+ break import_prettier;
822
+ }
823
+ prettier = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 79421, 23));
824
+ }
825
+ const configHash = await (async () => {
826
+ const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(), ".."));
827
+ if (configFilePath === null) {
828
+ return "";
829
+ }
830
+ const data = await fs_promises__WEBPACK_IMPORTED_MODULE_2__.readFile(configFilePath);
831
+ return crypto__WEBPACK_IMPORTED_MODULE_5__.createHash("sha256").update(data).digest("hex");
832
+ })();
833
+ const prettierAndConfig = {
834
+ prettier,
835
+ configHash
836
+ };
837
+ getPrettier.cache = prettierAndConfig;
838
+ return prettierAndConfig;
839
+ }
840
+ async function runPrettier(params) {
841
+ const { sourceCode, filePath } = params;
842
+ let formattedSourceCode;
843
+ try {
844
+ const { prettier } = await getPrettier();
845
+ const { ignored, inferredParser } = await prettier.getFileInfo(filePath, {
846
+ resolveConfig: true
847
+ });
848
+ if (ignored || inferredParser === null) {
849
+ return sourceCode;
850
+ }
851
+ const config = await prettier.resolveConfig(filePath);
852
+ formattedSourceCode = await prettier.format(sourceCode, Object.assign(Object.assign({}, config), { filePath, parser: inferredParser }));
853
+ }
854
+ catch (error) {
855
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_4___default().red(`You probably need to upgrade the version of prettier in your project`));
856
+ throw error;
857
+ }
858
+ return formattedSourceCode;
859
+ }
860
+ //# sourceMappingURL=runPrettier.js.map
861
+
862
+ /***/ }),
863
+
864
+ /***/ 50689:
865
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
866
+
867
+
868
+ var __extends = (this && this.__extends) || (function () {
869
+ var extendStatics = function (d, b) {
870
+ extendStatics = Object.setPrototypeOf ||
871
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
872
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
873
+ return extendStatics(d, b);
874
+ };
875
+ return function (d, b) {
876
+ if (typeof b !== "function" && b !== null)
877
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
878
+ extendStatics(d, b);
879
+ function __() { this.constructor = d; }
880
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
881
+ };
882
+ })();
883
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
884
+ exports.VoidDeferred = exports.Deferred = void 0;
885
+ var overwriteReadonlyProp_1 = __webpack_require__(47803);
886
+ var Deferred = /** @class */ (function () {
887
+ function Deferred() {
888
+ var _this_1 = this;
889
+ this.isPending = true;
890
+ var resolve;
891
+ var reject;
892
+ this.pr = new Promise(function (resolve_, reject_) {
893
+ resolve = function (value) {
894
+ (0, overwriteReadonlyProp_1.overwriteReadonlyProp)(_this_1, "isPending", false);
895
+ resolve_(value);
896
+ };
897
+ reject = function (error) {
898
+ (0, overwriteReadonlyProp_1.overwriteReadonlyProp)(_this_1, "isPending", false);
899
+ reject_(error);
900
+ };
901
+ });
902
+ this.resolve = resolve;
903
+ this.reject = reject;
904
+ }
905
+ return Deferred;
906
+ }());
907
+ exports.Deferred = Deferred;
908
+ var VoidDeferred = /** @class */ (function (_super) {
909
+ __extends(VoidDeferred, _super);
910
+ function VoidDeferred() {
911
+ return _super !== null && _super.apply(this, arguments) || this;
912
+ }
913
+ return VoidDeferred;
914
+ }(Deferred));
915
+ exports.VoidDeferred = VoidDeferred;
916
+ //# sourceMappingURL=Deferred.js.map
917
+
918
+ /***/ }),
919
+
920
+ /***/ 47803:
921
+ /***/ (function(__unused_webpack_module, exports) {
922
+
923
+
924
+ var __assign = (this && this.__assign) || function () {
925
+ __assign = Object.assign || function(t) {
926
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
927
+ s = arguments[i];
928
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
929
+ t[p] = s[p];
930
+ }
931
+ return t;
932
+ };
933
+ return __assign.apply(this, arguments);
934
+ };
935
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
936
+ exports.overwriteReadonlyProp = void 0;
937
+ /**
938
+ * Assign a value to a property even if the object is freezed or if the property is not writable
939
+ * Throw if the assignation fail ( for example if the property is non configurable write: false )
940
+ * */
941
+ var overwriteReadonlyProp = function (obj, propertyName, value) {
942
+ try {
943
+ obj[propertyName] = value;
944
+ }
945
+ catch (_a) { }
946
+ if (obj[propertyName] === value) {
947
+ return value;
948
+ }
949
+ var errorDefineProperty = undefined;
950
+ var propertyDescriptor = Object.getOwnPropertyDescriptor(obj, propertyName) || {
951
+ "enumerable": true,
952
+ "configurable": true,
953
+ };
954
+ if (!!propertyDescriptor.get) {
955
+ throw new Error("Probably a wrong ides to overwrite ".concat(String(propertyName), " getter"));
956
+ }
957
+ try {
958
+ Object.defineProperty(obj, propertyName, __assign(__assign({}, propertyDescriptor), { value: value }));
959
+ }
960
+ catch (error) {
961
+ errorDefineProperty = error;
962
+ }
963
+ if (obj[propertyName] !== value) {
964
+ throw errorDefineProperty || new Error("Can't assign");
965
+ }
966
+ return value;
967
+ };
968
+ exports.overwriteReadonlyProp = overwriteReadonlyProp;
969
+ //# sourceMappingURL=overwriteReadonlyProp.js.map
970
+
971
+ /***/ }),
972
+
973
+ /***/ 23483:
974
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
975
+
976
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
977
+ /* harmony export */ "Y": () => (/* binding */ objectKeys)
978
+ /* harmony export */ });
979
+ /** https://docs.tsafe.dev/objectKeys */
980
+ function objectKeys(o) {
981
+ return Object.keys(o);
982
+ }
983
+
984
+
985
+ //# sourceMappingURL=objectKeys.mjs.map
986
+
987
+
988
+ /***/ }),
989
+
990
+ /***/ 76030:
991
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
992
+
993
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
994
+ /* harmony export */ "r": () => (/* binding */ symToStr)
995
+ /* harmony export */ });
996
+ /** @see <https://docs.tsafe.dev/main/symtostr> */
997
+ function symToStr(wrap) {
998
+ // @ts-expect-error: We know better
999
+ return Object.keys(wrap)[0];
1000
+ }
1001
+
1002
+
1003
+ //# sourceMappingURL=symToStr.mjs.map
1004
+
1005
+
1006
+ /***/ })
1007
+
1008
+ };
1009
+ ;