vercel 59.11.2 → 59.11.7

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 (154) hide show
  1. package/dist/chunks/{add-BKSHWTPX.js → add-KSJQYR5C.js} +23 -18
  2. package/dist/chunks/{add-RBW7QITR.js → add-PERLOALD.js} +37 -23
  3. package/dist/chunks/{add-HPLJZFM2.js → add-WU2QYHYL.js} +23 -18
  4. package/dist/chunks/{build-V4ZLAJWB.js → build-F3J6FLPD.js} +23 -18
  5. package/dist/chunks/{chunk-NGGLYKNU.js → chunk-26CU4Q3C.js} +3 -115
  6. package/dist/chunks/{chunk-QFAS4OVW.js → chunk-2JIX6UMI.js} +3 -84
  7. package/dist/chunks/chunk-2TSBB22D.js +14059 -0
  8. package/dist/chunks/chunk-332LMJLZ.js +16014 -0
  9. package/dist/chunks/{chunk-AYLY3ZVL.js → chunk-3VM7HWF6.js} +2 -2
  10. package/dist/chunks/chunk-4IALDGB7.js +22 -0
  11. package/dist/chunks/chunk-4IVSM24H.js +522 -0
  12. package/dist/chunks/{chunk-5XECIWME.js → chunk-5NF5HOBJ.js} +5 -3
  13. package/dist/chunks/chunk-6E6KPBXY.js +43 -0
  14. package/dist/chunks/chunk-7KROIXQM.js +59 -0
  15. package/dist/chunks/{chunk-ASBP32T6.js → chunk-7MRDIPJY.js} +1 -1
  16. package/dist/chunks/chunk-A5JZS6ZN.js +92 -0
  17. package/dist/chunks/{chunk-7ST552E3.js → chunk-AKLTIZCU.js} +1 -1
  18. package/dist/chunks/{chunk-26XDDLXM.js → chunk-ARU7VBKR.js} +2 -2
  19. package/dist/chunks/chunk-B5XLQKHI.js +849 -0
  20. package/dist/chunks/chunk-C762AAVU.js +137 -0
  21. package/dist/chunks/{chunk-WA2SJE5S.js → chunk-CEDN47PH.js} +4 -4
  22. package/dist/chunks/{chunk-ONRLTUP2.js → chunk-CNDPIHY5.js} +24 -22
  23. package/dist/chunks/{chunk-BMKU5KEL.js → chunk-CV5YC2EN.js} +1 -1
  24. package/dist/chunks/chunk-DBYHS3CK.js +257 -0
  25. package/dist/chunks/{chunk-HDBQPBL6.js → chunk-DSTNNQVV.js} +12 -8
  26. package/dist/chunks/{chunk-QAT3CW4G.js → chunk-EFYMIIER.js} +2 -2
  27. package/dist/chunks/{chunk-NBW3BWOJ.js → chunk-EPOLDWRA.js} +2 -2
  28. package/dist/chunks/{chunk-B4TXCKXE.js → chunk-EZQDYIVB.js} +10 -8
  29. package/dist/chunks/{chunk-2EAIC3SH.js → chunk-FL4JLNT2.js} +8 -8
  30. package/dist/chunks/chunk-FRVG4OW3.js +7438 -0
  31. package/dist/chunks/{chunk-FKDO3CM4.js → chunk-FVNJTRCE.js} +17 -13
  32. package/dist/chunks/chunk-FVT74RZ5.js +1536 -0
  33. package/dist/chunks/chunk-G3PXSXIB.js +18188 -0
  34. package/dist/chunks/chunk-G5FBSUL4.js +822 -0
  35. package/dist/chunks/{chunk-FRAXI2WT.js → chunk-GCVXKRR5.js} +3 -3
  36. package/dist/chunks/chunk-GHKJAK5V.js +1288 -0
  37. package/dist/chunks/{chunk-Q5K5DEOK.js → chunk-GUU4Z2AQ.js} +42 -28
  38. package/dist/chunks/{chunk-OQ3C5VXZ.js → chunk-GVNCVKCI.js} +4 -2
  39. package/dist/chunks/chunk-HB4UKFDO.js +1295 -0
  40. package/dist/chunks/chunk-HRXRELD3.js +338 -0
  41. package/dist/chunks/{chunk-IJ4X426J.js → chunk-IIMSID24.js} +1 -1
  42. package/dist/chunks/{chunk-O75LSD3C.js → chunk-JSD4EZL3.js} +1 -1
  43. package/dist/chunks/{chunk-7AEEQOD4.js → chunk-K3RED3VO.js} +1 -1
  44. package/dist/chunks/{chunk-RSEAADCE.js → chunk-KEKR7OCB.js} +6 -4
  45. package/dist/chunks/{chunk-3T7WSWZH.js → chunk-KFWQ3EFH.js} +1 -1
  46. package/dist/chunks/{chunk-L3UXB2CW.js → chunk-KW7BS25T.js} +1 -1
  47. package/dist/chunks/{chunk-RO44KX6Y.js → chunk-N4QHMXOO.js} +11 -7
  48. package/dist/chunks/{chunk-XRWOTCDO.js → chunk-ND5CF2H3.js} +1 -1
  49. package/dist/chunks/{chunk-RSJBU3ON.js → chunk-NSOYO6JQ.js} +35 -27
  50. package/dist/chunks/{chunk-RKDCNQ4S.js → chunk-NW34PW6V.js} +3 -105
  51. package/dist/chunks/{chunk-C5HKWXRR.js → chunk-OAMU5QO6.js} +1 -1
  52. package/dist/chunks/{chunk-MTWHQEXI.js → chunk-OIH6FP5Y.js} +5 -3
  53. package/dist/chunks/chunk-P7VSBDR4.js +827 -0
  54. package/dist/chunks/chunk-PEC3CQSK.js +90 -0
  55. package/dist/chunks/{chunk-QDV5LZ4Q.js → chunk-PFM75KY3.js} +12 -8
  56. package/dist/chunks/chunk-PJXMXMCO.js +81 -0
  57. package/dist/chunks/chunk-PNGVSHR3.js +40 -0
  58. package/dist/chunks/{chunk-TPATD2MM.js → chunk-QHS645AZ.js} +14 -6
  59. package/dist/chunks/{chunk-OTXE7MHI.js → chunk-QKX7WKIN.js} +8 -6
  60. package/dist/chunks/chunk-QOPTXV4G.js +417 -0
  61. package/dist/chunks/chunk-RN6V5ODW.js +114 -0
  62. package/dist/chunks/chunk-RVBZ64EQ.js +52 -0
  63. package/dist/chunks/chunk-SHFNEZVI.js +49 -0
  64. package/dist/chunks/{chunk-OO3OF6MK.js → chunk-TGNEG57M.js} +44 -15
  65. package/dist/chunks/{chunk-WNAKOXGK.js → chunk-TO7QZGYK.js} +1 -1
  66. package/dist/chunks/chunk-UARGTFCT.js +875 -0
  67. package/dist/chunks/{chunk-FWKSJYDV.js → chunk-UG2WOB5L.js} +1 -1
  68. package/dist/chunks/chunk-V4RMJKQP.js +36 -0
  69. package/dist/chunks/chunk-VT3Z7HF6.js +233 -0
  70. package/dist/chunks/chunk-VUS2JQB2.js +121 -0
  71. package/dist/chunks/{chunk-6CZZ3SH3.js → chunk-VYC45Q4Z.js} +2 -2
  72. package/dist/chunks/{chunk-4KVJ2M4J.js → chunk-WL6QYSGD.js} +78 -17
  73. package/dist/chunks/{chunk-FZRBF25Y.js → chunk-X7DBBZQD.js} +4 -4
  74. package/dist/chunks/{chunk-2NJJ2K5S.js → chunk-XD4DCYMX.js} +6 -6
  75. package/dist/chunks/{chunk-ZSFEACZU.js → chunk-XFF5TGRA.js} +1 -1
  76. package/dist/chunks/{chunk-6TBDHUXK.js → chunk-XIFATBH5.js} +21 -15
  77. package/dist/chunks/chunk-XNIZGCN5.js +58 -0
  78. package/dist/chunks/chunk-XPJLPUKO.js +117 -0
  79. package/dist/chunks/{chunk-FXD67VN5.js → chunk-XUAWTW4W.js} +1 -1
  80. package/dist/chunks/{chunk-I526H4AS.js → chunk-YS76T533.js} +2 -2
  81. package/dist/chunks/chunk-Z7JWYFOY.js +58 -0
  82. package/dist/chunks/{chunk-6JPVTPTU.js → chunk-ZBEECGFD.js} +3 -3
  83. package/dist/chunks/{chunk-52QYYTM5.js → chunk-ZDU2NODC.js} +3 -127
  84. package/dist/chunks/chunk-ZW6HETRE.js +97 -0
  85. package/dist/chunks/{clear-IYGWCNXT.js → clear-XUQO4ZTK.js} +23 -18
  86. package/dist/chunks/{compile-vercel-config-NEEBZRUJ.js → compile-vercel-config-D3ARNHTN.js} +8 -11
  87. package/dist/chunks/{config-6DS6BBR2.js → config-37OAE7QJ.js} +22 -17
  88. package/dist/chunks/{config-NTB5EMV4.js → config-MEDLXUVM.js} +23 -18
  89. package/dist/chunks/{delete-LLC2OGHA.js → delete-3N3YZZOF.js} +16 -12
  90. package/dist/chunks/{delete-LSGID5FV.js → delete-VSWDZ2SW.js} +19 -14
  91. package/dist/chunks/detect-projects-ODNU4PK2.js +18 -0
  92. package/dist/chunks/detect-services-TESZCQWG.js +40 -0
  93. package/dist/chunks/{disable-H4EXEQK7.js → disable-A4FLFMC7.js} +17 -13
  94. package/dist/chunks/{discard-FG6VKHWN.js → discard-CHGFULBZ.js} +17 -13
  95. package/dist/chunks/{edit-YE7D3CPJ.js → edit-JZ63AJYQ.js} +17 -13
  96. package/dist/chunks/{edit-BZJSGUHT.js → edit-MHSYAPDR.js} +19 -15
  97. package/dist/chunks/{enable-6ESD4QTE.js → enable-KD46SEC5.js} +17 -13
  98. package/dist/chunks/{exec-XH4K34JM.js → exec-4IPHZ55G.js} +9 -5
  99. package/dist/chunks/{export-QWSJROLG.js → export-42QZLBSN.js} +16 -13
  100. package/dist/chunks/{image-LTHQMKFG.js → image-GP4H73A2.js} +11 -8
  101. package/dist/chunks/{import-builders-6O7ILGQJ.js → import-builders-6TBLMPL2.js} +18 -13
  102. package/dist/chunks/{inspect-2C4ZSNYC.js → inspect-5FMWMY3C.js} +22 -18
  103. package/dist/chunks/{inspect-N6SMHV3Z.js → inspect-MUVK6MMT.js} +18 -14
  104. package/dist/chunks/{inspect-F7KCTHIL.js → inspect-Q3DWW7MC.js} +22 -18
  105. package/dist/chunks/{inspect-TWDPMXZ5.js → inspect-QFXAOUL4.js} +18 -14
  106. package/dist/chunks/{inspect-ICKNCDMT.js → inspect-RNTSYM6O.js} +18 -14
  107. package/dist/chunks/{list-NWTIJF3L.js → list-IHHIPXEC.js} +20 -16
  108. package/dist/chunks/{list-IPGQVBJO.js → list-JRNWLSO5.js} +16 -14
  109. package/dist/chunks/{list-DS7ZOUXA.js → list-XHD5DLEX.js} +23 -19
  110. package/dist/chunks/{login-F7A7ONKC.js → login-PCT6KFWY.js} +23 -18
  111. package/dist/chunks/{ls-NBDX3MKN.js → ls-GPEHEFCF.js} +24 -18
  112. package/dist/chunks/{ls-RNGO257R.js → ls-PF7F4PP4.js} +27 -23
  113. package/dist/chunks/{ls-XINES6PL.js → ls-PQZ2RIDX.js} +24 -18
  114. package/dist/chunks/{ls-D4TUDBIH.js → ls-SVOHC3XW.js} +24 -18
  115. package/dist/chunks/{ls-2QW3ZSM6.js → ls-TGHCCARZ.js} +24 -18
  116. package/dist/chunks/{ls-LSJEUPFX.js → ls-VRIH5WA3.js} +22 -15
  117. package/dist/chunks/{open-VRQDWZAW.js → open-E7DEKYDU.js} +18 -13
  118. package/dist/chunks/{permissions-6C5C7TEV.js → permissions-JKOONWVL.js} +14 -11
  119. package/dist/chunks/{publish-GVIZPNLN.js → publish-EDDELDE5.js} +17 -13
  120. package/dist/chunks/pull-646WEVDE.js +45 -0
  121. package/dist/chunks/{push-EFZ5P5Z6.js → push-LTNW5OVD.js} +23 -18
  122. package/dist/chunks/{query-GBS2PIT4.js → query-LU4N6KPO.js} +22 -19
  123. package/dist/chunks/{reorder-TN65IFRL.js → reorder-22PKJMZP.js} +17 -13
  124. package/dist/chunks/{reply-DYVEV3PY.js → reply-SF2EZMVZ.js} +17 -13
  125. package/dist/chunks/{resolve-JAWFBPUM.js → resolve-ZCZGXTOT.js} +16 -12
  126. package/dist/chunks/resolve-deployment-framework-preset-NPE6RLV3.js +36 -0
  127. package/dist/chunks/{restore-TJVMHUBQ.js → restore-VJAWZXB4.js} +17 -13
  128. package/dist/chunks/{rm-7XACNZ2U.js → rm-KN2QFCKO.js} +23 -18
  129. package/dist/chunks/{rm-REJVXALW.js → rm-KVEAJPRE.js} +23 -18
  130. package/dist/chunks/{rm-CBPNMSRP.js → rm-OSZ5FZUM.js} +23 -16
  131. package/dist/chunks/{rm-5B5VHWWN.js → rm-W722Q2AO.js} +21 -18
  132. package/dist/chunks/{rm-HQ5CYNJA.js → rm-WNPGTUBH.js} +23 -18
  133. package/dist/chunks/{routes-2OLIBRYX.js → routes-QVMBXOSX.js} +7 -3
  134. package/dist/chunks/{rule-inspect-ZSTDDFID.js → rule-inspect-25Z6SNX3.js} +28 -24
  135. package/dist/chunks/{rules-VGV4M4KY.js → rules-65LKAQ35.js} +15 -12
  136. package/dist/chunks/{schema-45SJNY5L.js → schema-7D6IGJEJ.js} +9 -7
  137. package/dist/chunks/{schema-GMTQOQCV.js → schema-NXCW4M75.js} +19 -17
  138. package/dist/chunks/{set-Z5FO2FCC.js → set-FYJVKMPV.js} +20 -13
  139. package/dist/chunks/setup-and-link-KXPZE32P.js +65 -0
  140. package/dist/chunks/{tags-SDRXWJ63.js → tags-ANIRP5E3.js} +10 -7
  141. package/dist/chunks/{types-JGANJ5EQ.js → types-4GAJ7XQQ.js} +9 -7
  142. package/dist/chunks/{update-JBQBC3IV.js → update-UT6CTKVG.js} +32 -19
  143. package/dist/commands/build/index.js +86 -49
  144. package/dist/commands/deploy/index.js +75 -66
  145. package/dist/commands/dev/index.js +98 -52
  146. package/dist/commands/env/index.js +67 -43
  147. package/dist/commands/link/index.js +48 -27
  148. package/dist/commands/list/index.js +33 -22
  149. package/dist/commands-bulk.js +1659 -1287
  150. package/dist/index.js +62 -40
  151. package/dist/version.mjs +1 -1
  152. package/package.json +46 -46
  153. package/dist/chunks/chunk-WYU64FLP.js +0 -62123
  154. package/dist/chunks/chunk-XNFHNTS2.js +0 -2939
@@ -1,2939 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import {
8
- output_manager_default,
9
- require_signal_exit
10
- } from "./chunk-QFAS4OVW.js";
11
- import {
12
- __commonJS,
13
- __require,
14
- __toESM
15
- } from "./chunk-TZ2YI2VH.js";
16
-
17
- // ../../internals/constants/dist/index.js
18
- var require_dist = __commonJS({
19
- "../../internals/constants/dist/index.js"(exports) {
20
- "use strict";
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.TITLE = exports.NAME = exports.LOGO = exports.PROJECT_ENV_TARGET = void 0;
23
- exports.PROJECT_ENV_TARGET = [
24
- "production",
25
- "preview",
26
- "development"
27
- ];
28
- exports.LOGO = "\u25B2";
29
- exports.NAME = "vercel";
30
- exports.TITLE = "Vercel";
31
- }
32
- });
33
-
34
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
35
- var require_polyfills = __commonJS({
36
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports, module) {
37
- var constants = __require("constants");
38
- var origCwd = process.cwd;
39
- var cwd = null;
40
- var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
41
- process.cwd = function() {
42
- if (!cwd)
43
- cwd = origCwd.call(process);
44
- return cwd;
45
- };
46
- try {
47
- process.cwd();
48
- } catch (er) {
49
- }
50
- if (typeof process.chdir === "function") {
51
- chdir = process.chdir;
52
- process.chdir = function(d) {
53
- cwd = null;
54
- chdir.call(process, d);
55
- };
56
- if (Object.setPrototypeOf)
57
- Object.setPrototypeOf(process.chdir, chdir);
58
- }
59
- var chdir;
60
- module.exports = patch;
61
- function patch(fs) {
62
- if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
63
- patchLchmod(fs);
64
- }
65
- if (!fs.lutimes) {
66
- patchLutimes(fs);
67
- }
68
- fs.chown = chownFix(fs.chown);
69
- fs.fchown = chownFix(fs.fchown);
70
- fs.lchown = chownFix(fs.lchown);
71
- fs.chmod = chmodFix(fs.chmod);
72
- fs.fchmod = chmodFix(fs.fchmod);
73
- fs.lchmod = chmodFix(fs.lchmod);
74
- fs.chownSync = chownFixSync(fs.chownSync);
75
- fs.fchownSync = chownFixSync(fs.fchownSync);
76
- fs.lchownSync = chownFixSync(fs.lchownSync);
77
- fs.chmodSync = chmodFixSync(fs.chmodSync);
78
- fs.fchmodSync = chmodFixSync(fs.fchmodSync);
79
- fs.lchmodSync = chmodFixSync(fs.lchmodSync);
80
- fs.stat = statFix(fs.stat);
81
- fs.fstat = statFix(fs.fstat);
82
- fs.lstat = statFix(fs.lstat);
83
- fs.statSync = statFixSync(fs.statSync);
84
- fs.fstatSync = statFixSync(fs.fstatSync);
85
- fs.lstatSync = statFixSync(fs.lstatSync);
86
- if (fs.chmod && !fs.lchmod) {
87
- fs.lchmod = function(path, mode, cb) {
88
- if (cb)
89
- process.nextTick(cb);
90
- };
91
- fs.lchmodSync = function() {
92
- };
93
- }
94
- if (fs.chown && !fs.lchown) {
95
- fs.lchown = function(path, uid, gid, cb) {
96
- if (cb)
97
- process.nextTick(cb);
98
- };
99
- fs.lchownSync = function() {
100
- };
101
- }
102
- if (platform === "win32") {
103
- fs.rename = typeof fs.rename !== "function" ? fs.rename : function(fs$rename) {
104
- function rename(from, to, cb) {
105
- var start = Date.now();
106
- var backoff = 0;
107
- fs$rename(from, to, function CB(er) {
108
- if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
109
- setTimeout(function() {
110
- fs.stat(to, function(stater, st) {
111
- if (stater && stater.code === "ENOENT")
112
- fs$rename(from, to, CB);
113
- else
114
- cb(er);
115
- });
116
- }, backoff);
117
- if (backoff < 100)
118
- backoff += 10;
119
- return;
120
- }
121
- if (cb)
122
- cb(er);
123
- });
124
- }
125
- if (Object.setPrototypeOf)
126
- Object.setPrototypeOf(rename, fs$rename);
127
- return rename;
128
- }(fs.rename);
129
- }
130
- fs.read = typeof fs.read !== "function" ? fs.read : function(fs$read) {
131
- function read(fd, buffer, offset, length, position, callback_) {
132
- var callback;
133
- if (callback_ && typeof callback_ === "function") {
134
- var eagCounter = 0;
135
- callback = function(er, _, __) {
136
- if (er && er.code === "EAGAIN" && eagCounter < 10) {
137
- eagCounter++;
138
- return fs$read.call(fs, fd, buffer, offset, length, position, callback);
139
- }
140
- callback_.apply(this, arguments);
141
- };
142
- }
143
- return fs$read.call(fs, fd, buffer, offset, length, position, callback);
144
- }
145
- if (Object.setPrototypeOf)
146
- Object.setPrototypeOf(read, fs$read);
147
- return read;
148
- }(fs.read);
149
- fs.readSync = typeof fs.readSync !== "function" ? fs.readSync : function(fs$readSync) {
150
- return function(fd, buffer, offset, length, position) {
151
- var eagCounter = 0;
152
- while (true) {
153
- try {
154
- return fs$readSync.call(fs, fd, buffer, offset, length, position);
155
- } catch (er) {
156
- if (er.code === "EAGAIN" && eagCounter < 10) {
157
- eagCounter++;
158
- continue;
159
- }
160
- throw er;
161
- }
162
- }
163
- };
164
- }(fs.readSync);
165
- function patchLchmod(fs2) {
166
- fs2.lchmod = function(path, mode, callback) {
167
- fs2.open(
168
- path,
169
- constants.O_WRONLY | constants.O_SYMLINK,
170
- mode,
171
- function(err, fd) {
172
- if (err) {
173
- if (callback)
174
- callback(err);
175
- return;
176
- }
177
- fs2.fchmod(fd, mode, function(err2) {
178
- fs2.close(fd, function(err22) {
179
- if (callback)
180
- callback(err2 || err22);
181
- });
182
- });
183
- }
184
- );
185
- };
186
- fs2.lchmodSync = function(path, mode) {
187
- var fd = fs2.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
188
- var threw = true;
189
- var ret;
190
- try {
191
- ret = fs2.fchmodSync(fd, mode);
192
- threw = false;
193
- } finally {
194
- if (threw) {
195
- try {
196
- fs2.closeSync(fd);
197
- } catch (er) {
198
- }
199
- } else {
200
- fs2.closeSync(fd);
201
- }
202
- }
203
- return ret;
204
- };
205
- }
206
- function patchLutimes(fs2) {
207
- if (constants.hasOwnProperty("O_SYMLINK") && fs2.futimes) {
208
- fs2.lutimes = function(path, at, mt, cb) {
209
- fs2.open(path, constants.O_SYMLINK, function(er, fd) {
210
- if (er) {
211
- if (cb)
212
- cb(er);
213
- return;
214
- }
215
- fs2.futimes(fd, at, mt, function(er2) {
216
- fs2.close(fd, function(er22) {
217
- if (cb)
218
- cb(er2 || er22);
219
- });
220
- });
221
- });
222
- };
223
- fs2.lutimesSync = function(path, at, mt) {
224
- var fd = fs2.openSync(path, constants.O_SYMLINK);
225
- var ret;
226
- var threw = true;
227
- try {
228
- ret = fs2.futimesSync(fd, at, mt);
229
- threw = false;
230
- } finally {
231
- if (threw) {
232
- try {
233
- fs2.closeSync(fd);
234
- } catch (er) {
235
- }
236
- } else {
237
- fs2.closeSync(fd);
238
- }
239
- }
240
- return ret;
241
- };
242
- } else if (fs2.futimes) {
243
- fs2.lutimes = function(_a, _b, _c, cb) {
244
- if (cb)
245
- process.nextTick(cb);
246
- };
247
- fs2.lutimesSync = function() {
248
- };
249
- }
250
- }
251
- function chmodFix(orig) {
252
- if (!orig)
253
- return orig;
254
- return function(target, mode, cb) {
255
- return orig.call(fs, target, mode, function(er) {
256
- if (chownErOk(er))
257
- er = null;
258
- if (cb)
259
- cb.apply(this, arguments);
260
- });
261
- };
262
- }
263
- function chmodFixSync(orig) {
264
- if (!orig)
265
- return orig;
266
- return function(target, mode) {
267
- try {
268
- return orig.call(fs, target, mode);
269
- } catch (er) {
270
- if (!chownErOk(er))
271
- throw er;
272
- }
273
- };
274
- }
275
- function chownFix(orig) {
276
- if (!orig)
277
- return orig;
278
- return function(target, uid, gid, cb) {
279
- return orig.call(fs, target, uid, gid, function(er) {
280
- if (chownErOk(er))
281
- er = null;
282
- if (cb)
283
- cb.apply(this, arguments);
284
- });
285
- };
286
- }
287
- function chownFixSync(orig) {
288
- if (!orig)
289
- return orig;
290
- return function(target, uid, gid) {
291
- try {
292
- return orig.call(fs, target, uid, gid);
293
- } catch (er) {
294
- if (!chownErOk(er))
295
- throw er;
296
- }
297
- };
298
- }
299
- function statFix(orig) {
300
- if (!orig)
301
- return orig;
302
- return function(target, options, cb) {
303
- if (typeof options === "function") {
304
- cb = options;
305
- options = null;
306
- }
307
- function callback(er, stats) {
308
- if (stats) {
309
- if (stats.uid < 0)
310
- stats.uid += 4294967296;
311
- if (stats.gid < 0)
312
- stats.gid += 4294967296;
313
- }
314
- if (cb)
315
- cb.apply(this, arguments);
316
- }
317
- return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
318
- };
319
- }
320
- function statFixSync(orig) {
321
- if (!orig)
322
- return orig;
323
- return function(target, options) {
324
- var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
325
- if (stats) {
326
- if (stats.uid < 0)
327
- stats.uid += 4294967296;
328
- if (stats.gid < 0)
329
- stats.gid += 4294967296;
330
- }
331
- return stats;
332
- };
333
- }
334
- function chownErOk(er) {
335
- if (!er)
336
- return true;
337
- if (er.code === "ENOSYS")
338
- return true;
339
- var nonroot = !process.getuid || process.getuid() !== 0;
340
- if (nonroot) {
341
- if (er.code === "EINVAL" || er.code === "EPERM")
342
- return true;
343
- }
344
- return false;
345
- }
346
- }
347
- }
348
- });
349
-
350
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
351
- var require_legacy_streams = __commonJS({
352
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
353
- var Stream = __require("stream").Stream;
354
- module.exports = legacy;
355
- function legacy(fs) {
356
- return {
357
- ReadStream,
358
- WriteStream
359
- };
360
- function ReadStream(path, options) {
361
- if (!(this instanceof ReadStream))
362
- return new ReadStream(path, options);
363
- Stream.call(this);
364
- var self = this;
365
- this.path = path;
366
- this.fd = null;
367
- this.readable = true;
368
- this.paused = false;
369
- this.flags = "r";
370
- this.mode = 438;
371
- this.bufferSize = 64 * 1024;
372
- options = options || {};
373
- var keys = Object.keys(options);
374
- for (var index = 0, length = keys.length; index < length; index++) {
375
- var key = keys[index];
376
- this[key] = options[key];
377
- }
378
- if (this.encoding)
379
- this.setEncoding(this.encoding);
380
- if (this.start !== void 0) {
381
- if ("number" !== typeof this.start) {
382
- throw TypeError("start must be a Number");
383
- }
384
- if (this.end === void 0) {
385
- this.end = Infinity;
386
- } else if ("number" !== typeof this.end) {
387
- throw TypeError("end must be a Number");
388
- }
389
- if (this.start > this.end) {
390
- throw new Error("start must be <= end");
391
- }
392
- this.pos = this.start;
393
- }
394
- if (this.fd !== null) {
395
- process.nextTick(function() {
396
- self._read();
397
- });
398
- return;
399
- }
400
- fs.open(this.path, this.flags, this.mode, function(err, fd) {
401
- if (err) {
402
- self.emit("error", err);
403
- self.readable = false;
404
- return;
405
- }
406
- self.fd = fd;
407
- self.emit("open", fd);
408
- self._read();
409
- });
410
- }
411
- function WriteStream(path, options) {
412
- if (!(this instanceof WriteStream))
413
- return new WriteStream(path, options);
414
- Stream.call(this);
415
- this.path = path;
416
- this.fd = null;
417
- this.writable = true;
418
- this.flags = "w";
419
- this.encoding = "binary";
420
- this.mode = 438;
421
- this.bytesWritten = 0;
422
- options = options || {};
423
- var keys = Object.keys(options);
424
- for (var index = 0, length = keys.length; index < length; index++) {
425
- var key = keys[index];
426
- this[key] = options[key];
427
- }
428
- if (this.start !== void 0) {
429
- if ("number" !== typeof this.start) {
430
- throw TypeError("start must be a Number");
431
- }
432
- if (this.start < 0) {
433
- throw new Error("start must be >= zero");
434
- }
435
- this.pos = this.start;
436
- }
437
- this.busy = false;
438
- this._queue = [];
439
- if (this.fd === null) {
440
- this._open = fs.open;
441
- this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
442
- this.flush();
443
- }
444
- }
445
- }
446
- }
447
- });
448
-
449
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js
450
- var require_clone = __commonJS({
451
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports, module) {
452
- "use strict";
453
- module.exports = clone;
454
- var getPrototypeOf = Object.getPrototypeOf || function(obj) {
455
- return obj.__proto__;
456
- };
457
- function clone(obj) {
458
- if (obj === null || typeof obj !== "object")
459
- return obj;
460
- if (obj instanceof Object)
461
- var copy = { __proto__: getPrototypeOf(obj) };
462
- else
463
- var copy = /* @__PURE__ */ Object.create(null);
464
- Object.getOwnPropertyNames(obj).forEach(function(key) {
465
- Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
466
- });
467
- return copy;
468
- }
469
- }
470
- });
471
-
472
- // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
473
- var require_graceful_fs = __commonJS({
474
- "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
475
- var fs = __require("fs");
476
- var polyfills = require_polyfills();
477
- var legacy = require_legacy_streams();
478
- var clone = require_clone();
479
- var util = __require("util");
480
- var gracefulQueue;
481
- var previousSymbol;
482
- if (typeof Symbol === "function" && typeof Symbol.for === "function") {
483
- gracefulQueue = Symbol.for("graceful-fs.queue");
484
- previousSymbol = Symbol.for("graceful-fs.previous");
485
- } else {
486
- gracefulQueue = "___graceful-fs.queue";
487
- previousSymbol = "___graceful-fs.previous";
488
- }
489
- function noop() {
490
- }
491
- function publishQueue(context, queue2) {
492
- Object.defineProperty(context, gracefulQueue, {
493
- get: function() {
494
- return queue2;
495
- }
496
- });
497
- }
498
- var debug = noop;
499
- if (util.debuglog)
500
- debug = util.debuglog("gfs4");
501
- else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
502
- debug = function() {
503
- var m = util.format.apply(util, arguments);
504
- m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
505
- console.error(m);
506
- };
507
- if (!fs[gracefulQueue]) {
508
- queue = global[gracefulQueue] || [];
509
- publishQueue(fs, queue);
510
- fs.close = function(fs$close) {
511
- function close(fd, cb) {
512
- return fs$close.call(fs, fd, function(err) {
513
- if (!err) {
514
- resetQueue();
515
- }
516
- if (typeof cb === "function")
517
- cb.apply(this, arguments);
518
- });
519
- }
520
- Object.defineProperty(close, previousSymbol, {
521
- value: fs$close
522
- });
523
- return close;
524
- }(fs.close);
525
- fs.closeSync = function(fs$closeSync) {
526
- function closeSync(fd) {
527
- fs$closeSync.apply(fs, arguments);
528
- resetQueue();
529
- }
530
- Object.defineProperty(closeSync, previousSymbol, {
531
- value: fs$closeSync
532
- });
533
- return closeSync;
534
- }(fs.closeSync);
535
- if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
536
- process.on("exit", function() {
537
- debug(fs[gracefulQueue]);
538
- __require("assert").equal(fs[gracefulQueue].length, 0);
539
- });
540
- }
541
- }
542
- var queue;
543
- if (!global[gracefulQueue]) {
544
- publishQueue(global, fs[gracefulQueue]);
545
- }
546
- module.exports = patch(clone(fs));
547
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
548
- module.exports = patch(fs);
549
- fs.__patched = true;
550
- }
551
- function patch(fs2) {
552
- polyfills(fs2);
553
- fs2.gracefulify = patch;
554
- fs2.createReadStream = createReadStream;
555
- fs2.createWriteStream = createWriteStream;
556
- var fs$readFile = fs2.readFile;
557
- fs2.readFile = readFile;
558
- function readFile(path, options, cb) {
559
- if (typeof options === "function")
560
- cb = options, options = null;
561
- return go$readFile(path, options, cb);
562
- function go$readFile(path2, options2, cb2, startTime) {
563
- return fs$readFile(path2, options2, function(err) {
564
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
565
- enqueue([go$readFile, [path2, options2, cb2], err, startTime || Date.now(), Date.now()]);
566
- else {
567
- if (typeof cb2 === "function")
568
- cb2.apply(this, arguments);
569
- }
570
- });
571
- }
572
- }
573
- var fs$writeFile = fs2.writeFile;
574
- fs2.writeFile = writeFile;
575
- function writeFile(path, data, options, cb) {
576
- if (typeof options === "function")
577
- cb = options, options = null;
578
- return go$writeFile(path, data, options, cb);
579
- function go$writeFile(path2, data2, options2, cb2, startTime) {
580
- return fs$writeFile(path2, data2, options2, function(err) {
581
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
582
- enqueue([go$writeFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
583
- else {
584
- if (typeof cb2 === "function")
585
- cb2.apply(this, arguments);
586
- }
587
- });
588
- }
589
- }
590
- var fs$appendFile = fs2.appendFile;
591
- if (fs$appendFile)
592
- fs2.appendFile = appendFile;
593
- function appendFile(path, data, options, cb) {
594
- if (typeof options === "function")
595
- cb = options, options = null;
596
- return go$appendFile(path, data, options, cb);
597
- function go$appendFile(path2, data2, options2, cb2, startTime) {
598
- return fs$appendFile(path2, data2, options2, function(err) {
599
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
600
- enqueue([go$appendFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
601
- else {
602
- if (typeof cb2 === "function")
603
- cb2.apply(this, arguments);
604
- }
605
- });
606
- }
607
- }
608
- var fs$copyFile = fs2.copyFile;
609
- if (fs$copyFile)
610
- fs2.copyFile = copyFile;
611
- function copyFile(src, dest, flags, cb) {
612
- if (typeof flags === "function") {
613
- cb = flags;
614
- flags = 0;
615
- }
616
- return go$copyFile(src, dest, flags, cb);
617
- function go$copyFile(src2, dest2, flags2, cb2, startTime) {
618
- return fs$copyFile(src2, dest2, flags2, function(err) {
619
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
620
- enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
621
- else {
622
- if (typeof cb2 === "function")
623
- cb2.apply(this, arguments);
624
- }
625
- });
626
- }
627
- }
628
- var fs$readdir = fs2.readdir;
629
- fs2.readdir = readdir;
630
- var noReaddirOptionVersions = /^v[0-5]\./;
631
- function readdir(path, options, cb) {
632
- if (typeof options === "function")
633
- cb = options, options = null;
634
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path2, options2, cb2, startTime) {
635
- return fs$readdir(path2, fs$readdirCallback(
636
- path2,
637
- options2,
638
- cb2,
639
- startTime
640
- ));
641
- } : function go$readdir2(path2, options2, cb2, startTime) {
642
- return fs$readdir(path2, options2, fs$readdirCallback(
643
- path2,
644
- options2,
645
- cb2,
646
- startTime
647
- ));
648
- };
649
- return go$readdir(path, options, cb);
650
- function fs$readdirCallback(path2, options2, cb2, startTime) {
651
- return function(err, files) {
652
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
653
- enqueue([
654
- go$readdir,
655
- [path2, options2, cb2],
656
- err,
657
- startTime || Date.now(),
658
- Date.now()
659
- ]);
660
- else {
661
- if (files && files.sort)
662
- files.sort();
663
- if (typeof cb2 === "function")
664
- cb2.call(this, err, files);
665
- }
666
- };
667
- }
668
- }
669
- if (process.version.substr(0, 4) === "v0.8") {
670
- var legStreams = legacy(fs2);
671
- ReadStream = legStreams.ReadStream;
672
- WriteStream = legStreams.WriteStream;
673
- }
674
- var fs$ReadStream = fs2.ReadStream;
675
- if (fs$ReadStream) {
676
- ReadStream.prototype = Object.create(fs$ReadStream.prototype);
677
- ReadStream.prototype.open = ReadStream$open;
678
- }
679
- var fs$WriteStream = fs2.WriteStream;
680
- if (fs$WriteStream) {
681
- WriteStream.prototype = Object.create(fs$WriteStream.prototype);
682
- WriteStream.prototype.open = WriteStream$open;
683
- }
684
- Object.defineProperty(fs2, "ReadStream", {
685
- get: function() {
686
- return ReadStream;
687
- },
688
- set: function(val) {
689
- ReadStream = val;
690
- },
691
- enumerable: true,
692
- configurable: true
693
- });
694
- Object.defineProperty(fs2, "WriteStream", {
695
- get: function() {
696
- return WriteStream;
697
- },
698
- set: function(val) {
699
- WriteStream = val;
700
- },
701
- enumerable: true,
702
- configurable: true
703
- });
704
- var FileReadStream = ReadStream;
705
- Object.defineProperty(fs2, "FileReadStream", {
706
- get: function() {
707
- return FileReadStream;
708
- },
709
- set: function(val) {
710
- FileReadStream = val;
711
- },
712
- enumerable: true,
713
- configurable: true
714
- });
715
- var FileWriteStream = WriteStream;
716
- Object.defineProperty(fs2, "FileWriteStream", {
717
- get: function() {
718
- return FileWriteStream;
719
- },
720
- set: function(val) {
721
- FileWriteStream = val;
722
- },
723
- enumerable: true,
724
- configurable: true
725
- });
726
- function ReadStream(path, options) {
727
- if (this instanceof ReadStream)
728
- return fs$ReadStream.apply(this, arguments), this;
729
- else
730
- return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
731
- }
732
- function ReadStream$open() {
733
- var that = this;
734
- open(that.path, that.flags, that.mode, function(err, fd) {
735
- if (err) {
736
- if (that.autoClose)
737
- that.destroy();
738
- that.emit("error", err);
739
- } else {
740
- that.fd = fd;
741
- that.emit("open", fd);
742
- that.read();
743
- }
744
- });
745
- }
746
- function WriteStream(path, options) {
747
- if (this instanceof WriteStream)
748
- return fs$WriteStream.apply(this, arguments), this;
749
- else
750
- return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
751
- }
752
- function WriteStream$open() {
753
- var that = this;
754
- open(that.path, that.flags, that.mode, function(err, fd) {
755
- if (err) {
756
- that.destroy();
757
- that.emit("error", err);
758
- } else {
759
- that.fd = fd;
760
- that.emit("open", fd);
761
- }
762
- });
763
- }
764
- function createReadStream(path, options) {
765
- return new fs2.ReadStream(path, options);
766
- }
767
- function createWriteStream(path, options) {
768
- return new fs2.WriteStream(path, options);
769
- }
770
- var fs$open = fs2.open;
771
- fs2.open = open;
772
- function open(path, flags, mode, cb) {
773
- if (typeof mode === "function")
774
- cb = mode, mode = null;
775
- return go$open(path, flags, mode, cb);
776
- function go$open(path2, flags2, mode2, cb2, startTime) {
777
- return fs$open(path2, flags2, mode2, function(err, fd) {
778
- if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
779
- enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
780
- else {
781
- if (typeof cb2 === "function")
782
- cb2.apply(this, arguments);
783
- }
784
- });
785
- }
786
- }
787
- return fs2;
788
- }
789
- function enqueue(elem) {
790
- debug("ENQUEUE", elem[0].name, elem[1]);
791
- fs[gracefulQueue].push(elem);
792
- retry();
793
- }
794
- var retryTimer;
795
- function resetQueue() {
796
- var now = Date.now();
797
- for (var i = 0; i < fs[gracefulQueue].length; ++i) {
798
- if (fs[gracefulQueue][i].length > 2) {
799
- fs[gracefulQueue][i][3] = now;
800
- fs[gracefulQueue][i][4] = now;
801
- }
802
- }
803
- retry();
804
- }
805
- function retry() {
806
- clearTimeout(retryTimer);
807
- retryTimer = void 0;
808
- if (fs[gracefulQueue].length === 0)
809
- return;
810
- var elem = fs[gracefulQueue].shift();
811
- var fn = elem[0];
812
- var args = elem[1];
813
- var err = elem[2];
814
- var startTime = elem[3];
815
- var lastTime = elem[4];
816
- if (startTime === void 0) {
817
- debug("RETRY", fn.name, args);
818
- fn.apply(null, args);
819
- } else if (Date.now() - startTime >= 6e4) {
820
- debug("TIMEOUT", fn.name, args);
821
- var cb = args.pop();
822
- if (typeof cb === "function")
823
- cb.call(null, err);
824
- } else {
825
- var sinceAttempt = Date.now() - lastTime;
826
- var sinceStart = Math.max(lastTime - startTime, 1);
827
- var desiredDelay = Math.min(sinceStart * 1.2, 100);
828
- if (sinceAttempt >= desiredDelay) {
829
- debug("RETRY", fn.name, args);
830
- fn.apply(null, args.concat([startTime]));
831
- } else {
832
- fs[gracefulQueue].push(elem);
833
- }
834
- }
835
- if (retryTimer === void 0) {
836
- retryTimer = setTimeout(retry, 0);
837
- }
838
- }
839
- }
840
- });
841
-
842
- // ../../node_modules/.pnpm/strip-bom@3.0.0/node_modules/strip-bom/index.js
843
- var require_strip_bom = __commonJS({
844
- "../../node_modules/.pnpm/strip-bom@3.0.0/node_modules/strip-bom/index.js"(exports, module) {
845
- "use strict";
846
- module.exports = (x) => {
847
- if (typeof x !== "string") {
848
- throw new TypeError("Expected a string, got " + typeof x);
849
- }
850
- if (x.charCodeAt(0) === 65279) {
851
- return x.slice(1);
852
- }
853
- return x;
854
- };
855
- }
856
- });
857
-
858
- // ../../node_modules/.pnpm/is-arrayish@0.2.1/node_modules/is-arrayish/index.js
859
- var require_is_arrayish = __commonJS({
860
- "../../node_modules/.pnpm/is-arrayish@0.2.1/node_modules/is-arrayish/index.js"(exports, module) {
861
- "use strict";
862
- module.exports = function isArrayish(obj) {
863
- if (!obj) {
864
- return false;
865
- }
866
- return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && obj.splice instanceof Function;
867
- };
868
- }
869
- });
870
-
871
- // ../../node_modules/.pnpm/error-ex@1.3.4/node_modules/error-ex/index.js
872
- var require_error_ex = __commonJS({
873
- "../../node_modules/.pnpm/error-ex@1.3.4/node_modules/error-ex/index.js"(exports, module) {
874
- "use strict";
875
- var util = __require("util");
876
- var isArrayish = require_is_arrayish();
877
- var errorEx = function errorEx2(name, properties) {
878
- if (!name || name.constructor !== String) {
879
- properties = name || {};
880
- name = Error.name;
881
- }
882
- var errorExError = function ErrorEXError(message) {
883
- if (!this) {
884
- return new ErrorEXError(message);
885
- }
886
- message = message instanceof Error ? message.message : message || this.message;
887
- Error.call(this, message);
888
- Error.captureStackTrace(this, errorExError);
889
- this.name = name;
890
- Object.defineProperty(this, "message", {
891
- configurable: true,
892
- enumerable: false,
893
- get: function() {
894
- var newMessage = message.split(/\r?\n/g);
895
- for (var key in properties) {
896
- if (!properties.hasOwnProperty(key)) {
897
- continue;
898
- }
899
- var modifier = properties[key];
900
- if ("message" in modifier) {
901
- newMessage = modifier.message(this[key], newMessage) || newMessage;
902
- if (!isArrayish(newMessage)) {
903
- newMessage = [newMessage];
904
- }
905
- }
906
- }
907
- return newMessage.join("\n");
908
- },
909
- set: function(v) {
910
- message = v;
911
- }
912
- });
913
- var overwrittenStack = null;
914
- var stackDescriptor = Object.getOwnPropertyDescriptor(this, "stack");
915
- var stackGetter = stackDescriptor.get;
916
- var stackValue = stackDescriptor.value;
917
- delete stackDescriptor.value;
918
- delete stackDescriptor.writable;
919
- stackDescriptor.set = function(newstack) {
920
- overwrittenStack = newstack;
921
- };
922
- stackDescriptor.get = function() {
923
- var stack = (overwrittenStack || (stackGetter ? stackGetter.call(this) : stackValue)).split(/\r?\n+/g);
924
- if (!overwrittenStack) {
925
- stack[0] = this.name + ": " + this.message;
926
- }
927
- var lineCount = 1;
928
- for (var key in properties) {
929
- if (!properties.hasOwnProperty(key)) {
930
- continue;
931
- }
932
- var modifier = properties[key];
933
- if ("line" in modifier) {
934
- var line = modifier.line(this[key]);
935
- if (line) {
936
- stack.splice(lineCount++, 0, " " + line);
937
- }
938
- }
939
- if ("stack" in modifier) {
940
- modifier.stack(this[key], stack);
941
- }
942
- }
943
- return stack.join("\n");
944
- };
945
- Object.defineProperty(this, "stack", stackDescriptor);
946
- };
947
- if (Object.setPrototypeOf) {
948
- Object.setPrototypeOf(errorExError.prototype, Error.prototype);
949
- Object.setPrototypeOf(errorExError, Error);
950
- } else {
951
- util.inherits(errorExError, Error);
952
- }
953
- return errorExError;
954
- };
955
- errorEx.append = function(str, def) {
956
- return {
957
- message: function(v, message) {
958
- v = v || def;
959
- if (v) {
960
- message[0] += " " + str.replace("%s", v.toString());
961
- }
962
- return message;
963
- }
964
- };
965
- };
966
- errorEx.line = function(str, def) {
967
- return {
968
- line: function(v) {
969
- v = v || def;
970
- if (v) {
971
- return str.replace("%s", v.toString());
972
- }
973
- return null;
974
- }
975
- };
976
- };
977
- module.exports = errorEx;
978
- }
979
- });
980
-
981
- // ../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/vendor/unicode.js
982
- var require_unicode = __commonJS({
983
- "../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/vendor/unicode.js"(exports, module) {
984
- var Uni = module.exports;
985
- module.exports.isWhiteSpace = function isWhiteSpace(x) {
986
- return x === " " || x === "\xA0" || x === "\uFEFF" || x >= " " && x <= "\r" || x === "\u1680" || x === "\u180E" || x >= "\u2000" && x <= "\u200A" || x === "\u2028" || x === "\u2029" || x === "\u202F" || x === "\u205F" || x === "\u3000";
987
- };
988
- module.exports.isWhiteSpaceJSON = function isWhiteSpaceJSON(x) {
989
- return x === " " || x === " " || x === "\n" || x === "\r";
990
- };
991
- module.exports.isLineTerminator = function isLineTerminator(x) {
992
- return x === "\n" || x === "\r" || x === "\u2028" || x === "\u2029";
993
- };
994
- module.exports.isLineTerminatorJSON = function isLineTerminatorJSON(x) {
995
- return x === "\n" || x === "\r";
996
- };
997
- module.exports.isIdentifierStart = function isIdentifierStart(x) {
998
- return x === "$" || x === "_" || x >= "A" && x <= "Z" || x >= "a" && x <= "z" || x >= "\x80" && Uni.NonAsciiIdentifierStart.test(x);
999
- };
1000
- module.exports.isIdentifierPart = function isIdentifierPart(x) {
1001
- return x === "$" || x === "_" || x >= "A" && x <= "Z" || x >= "a" && x <= "z" || x >= "0" && x <= "9" || x >= "\x80" && Uni.NonAsciiIdentifierPart.test(x);
1002
- };
1003
- module.exports.NonAsciiIdentifierStart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/;
1004
- module.exports.NonAsciiIdentifierPart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C82\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D02\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191C\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE26\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/;
1005
- }
1006
- });
1007
-
1008
- // ../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/vendor/parse.js
1009
- var require_parse = __commonJS({
1010
- "../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/vendor/parse.js"(exports, module) {
1011
- var Uni = require_unicode();
1012
- function isHexDigit(x) {
1013
- return x >= "0" && x <= "9" || x >= "A" && x <= "F" || x >= "a" && x <= "f";
1014
- }
1015
- function isOctDigit(x) {
1016
- return x >= "0" && x <= "7";
1017
- }
1018
- function isDecDigit(x) {
1019
- return x >= "0" && x <= "9";
1020
- }
1021
- var unescapeMap = {
1022
- "'": "'",
1023
- '"': '"',
1024
- "\\": "\\",
1025
- "b": "\b",
1026
- "f": "\f",
1027
- "n": "\n",
1028
- "r": "\r",
1029
- "t": " ",
1030
- "v": "\v",
1031
- "/": "/"
1032
- };
1033
- function formatError(input, msg, position, lineno, column, json5) {
1034
- var result = msg + " at " + (lineno + 1) + ":" + (column + 1), tmppos = position - column - 1, srcline = "", underline = "";
1035
- var isLineTerminator = json5 ? Uni.isLineTerminator : Uni.isLineTerminatorJSON;
1036
- if (tmppos < position - 70) {
1037
- tmppos = position - 70;
1038
- }
1039
- while (1) {
1040
- var chr = input[++tmppos];
1041
- if (isLineTerminator(chr) || tmppos === input.length) {
1042
- if (position >= tmppos) {
1043
- underline += "^";
1044
- }
1045
- break;
1046
- }
1047
- srcline += chr;
1048
- if (position === tmppos) {
1049
- underline += "^";
1050
- } else if (position > tmppos) {
1051
- underline += input[tmppos] === " " ? " " : " ";
1052
- }
1053
- if (srcline.length > 78)
1054
- break;
1055
- }
1056
- return result + "\n" + srcline + "\n" + underline;
1057
- }
1058
- function parse(input, options) {
1059
- var json5 = !(options.mode === "json" || options.legacy);
1060
- var isLineTerminator = json5 ? Uni.isLineTerminator : Uni.isLineTerminatorJSON;
1061
- var isWhiteSpace = json5 ? Uni.isWhiteSpace : Uni.isWhiteSpaceJSON;
1062
- var length = input.length, lineno = 0, linestart = 0, position = 0, stack = [];
1063
- var tokenStart = function() {
1064
- };
1065
- var tokenEnd = function(v) {
1066
- return v;
1067
- };
1068
- if (options._tokenize) {
1069
- ;
1070
- (function() {
1071
- var start = null;
1072
- tokenStart = function() {
1073
- if (start !== null)
1074
- throw Error("internal error, token overlap");
1075
- start = position;
1076
- };
1077
- tokenEnd = function(v, type) {
1078
- if (start != position) {
1079
- var hash = {
1080
- raw: input.substr(start, position - start),
1081
- type,
1082
- stack: stack.slice(0)
1083
- };
1084
- if (v !== void 0)
1085
- hash.value = v;
1086
- options._tokenize.call(null, hash);
1087
- }
1088
- start = null;
1089
- return v;
1090
- };
1091
- })();
1092
- }
1093
- function fail(msg) {
1094
- var column = position - linestart;
1095
- if (!msg) {
1096
- if (position < length) {
1097
- var token = "'" + JSON.stringify(input[position]).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
1098
- if (!msg)
1099
- msg = "Unexpected token " + token;
1100
- } else {
1101
- if (!msg)
1102
- msg = "Unexpected end of input";
1103
- }
1104
- }
1105
- var error = SyntaxError(formatError(input, msg, position, lineno, column, json5));
1106
- error.row = lineno + 1;
1107
- error.column = column + 1;
1108
- throw error;
1109
- }
1110
- function newline(chr) {
1111
- if (chr === "\r" && input[position] === "\n")
1112
- position++;
1113
- linestart = position;
1114
- lineno++;
1115
- }
1116
- function parseGeneric() {
1117
- var result;
1118
- while (position < length) {
1119
- tokenStart();
1120
- var chr = input[position++];
1121
- if (chr === '"' || chr === "'" && json5) {
1122
- return tokenEnd(parseString(chr), "literal");
1123
- } else if (chr === "{") {
1124
- tokenEnd(void 0, "separator");
1125
- return parseObject();
1126
- } else if (chr === "[") {
1127
- tokenEnd(void 0, "separator");
1128
- return parseArray();
1129
- } else if (chr === "-" || chr === "." || isDecDigit(chr) || json5 && (chr === "+" || chr === "I" || chr === "N")) {
1130
- return tokenEnd(parseNumber(), "literal");
1131
- } else if (chr === "n") {
1132
- parseKeyword("null");
1133
- return tokenEnd(null, "literal");
1134
- } else if (chr === "t") {
1135
- parseKeyword("true");
1136
- return tokenEnd(true, "literal");
1137
- } else if (chr === "f") {
1138
- parseKeyword("false");
1139
- return tokenEnd(false, "literal");
1140
- } else {
1141
- position--;
1142
- return tokenEnd(void 0);
1143
- }
1144
- }
1145
- }
1146
- function parseKey() {
1147
- var result;
1148
- while (position < length) {
1149
- tokenStart();
1150
- var chr = input[position++];
1151
- if (chr === '"' || chr === "'" && json5) {
1152
- return tokenEnd(parseString(chr), "key");
1153
- } else if (chr === "{") {
1154
- tokenEnd(void 0, "separator");
1155
- return parseObject();
1156
- } else if (chr === "[") {
1157
- tokenEnd(void 0, "separator");
1158
- return parseArray();
1159
- } else if (chr === "." || isDecDigit(chr)) {
1160
- return tokenEnd(parseNumber(true), "key");
1161
- } else if (json5 && Uni.isIdentifierStart(chr) || chr === "\\" && input[position] === "u") {
1162
- var rollback = position - 1;
1163
- var result = parseIdentifier();
1164
- if (result === void 0) {
1165
- position = rollback;
1166
- return tokenEnd(void 0);
1167
- } else {
1168
- return tokenEnd(result, "key");
1169
- }
1170
- } else {
1171
- position--;
1172
- return tokenEnd(void 0);
1173
- }
1174
- }
1175
- }
1176
- function skipWhiteSpace() {
1177
- tokenStart();
1178
- while (position < length) {
1179
- var chr = input[position++];
1180
- if (isLineTerminator(chr)) {
1181
- position--;
1182
- tokenEnd(void 0, "whitespace");
1183
- tokenStart();
1184
- position++;
1185
- newline(chr);
1186
- tokenEnd(void 0, "newline");
1187
- tokenStart();
1188
- } else if (isWhiteSpace(chr)) {
1189
- } else if (chr === "/" && json5 && (input[position] === "/" || input[position] === "*")) {
1190
- position--;
1191
- tokenEnd(void 0, "whitespace");
1192
- tokenStart();
1193
- position++;
1194
- skipComment(input[position++] === "*");
1195
- tokenEnd(void 0, "comment");
1196
- tokenStart();
1197
- } else {
1198
- position--;
1199
- break;
1200
- }
1201
- }
1202
- return tokenEnd(void 0, "whitespace");
1203
- }
1204
- function skipComment(multi) {
1205
- while (position < length) {
1206
- var chr = input[position++];
1207
- if (isLineTerminator(chr)) {
1208
- if (!multi) {
1209
- position--;
1210
- return;
1211
- }
1212
- newline(chr);
1213
- } else if (chr === "*" && multi) {
1214
- if (input[position] === "/") {
1215
- position++;
1216
- return;
1217
- }
1218
- } else {
1219
- }
1220
- }
1221
- if (multi) {
1222
- fail("Unclosed multiline comment");
1223
- }
1224
- }
1225
- function parseKeyword(keyword) {
1226
- var _pos = position;
1227
- var len = keyword.length;
1228
- for (var i = 1; i < len; i++) {
1229
- if (position >= length || keyword[i] != input[position]) {
1230
- position = _pos - 1;
1231
- fail();
1232
- }
1233
- position++;
1234
- }
1235
- }
1236
- function parseObject() {
1237
- var result = options.null_prototype ? /* @__PURE__ */ Object.create(null) : {}, empty_object = {}, is_non_empty = false;
1238
- while (position < length) {
1239
- skipWhiteSpace();
1240
- var item1 = parseKey();
1241
- skipWhiteSpace();
1242
- tokenStart();
1243
- var chr = input[position++];
1244
- tokenEnd(void 0, "separator");
1245
- if (chr === "}" && item1 === void 0) {
1246
- if (!json5 && is_non_empty) {
1247
- position--;
1248
- fail("Trailing comma in object");
1249
- }
1250
- return result;
1251
- } else if (chr === ":" && item1 !== void 0) {
1252
- skipWhiteSpace();
1253
- stack.push(item1);
1254
- var item2 = parseGeneric();
1255
- stack.pop();
1256
- if (item2 === void 0)
1257
- fail("No value found for key " + item1);
1258
- if (typeof item1 !== "string") {
1259
- if (!json5 || typeof item1 !== "number") {
1260
- fail("Wrong key type: " + item1);
1261
- }
1262
- }
1263
- if ((item1 in empty_object || empty_object[item1] != null) && options.reserved_keys !== "replace") {
1264
- if (options.reserved_keys === "throw") {
1265
- fail("Reserved key: " + item1);
1266
- } else {
1267
- }
1268
- } else {
1269
- if (typeof options.reviver === "function") {
1270
- item2 = options.reviver.call(null, item1, item2);
1271
- }
1272
- if (item2 !== void 0) {
1273
- is_non_empty = true;
1274
- Object.defineProperty(result, item1, {
1275
- value: item2,
1276
- enumerable: true,
1277
- configurable: true,
1278
- writable: true
1279
- });
1280
- }
1281
- }
1282
- skipWhiteSpace();
1283
- tokenStart();
1284
- var chr = input[position++];
1285
- tokenEnd(void 0, "separator");
1286
- if (chr === ",") {
1287
- continue;
1288
- } else if (chr === "}") {
1289
- return result;
1290
- } else {
1291
- fail();
1292
- }
1293
- } else {
1294
- position--;
1295
- fail();
1296
- }
1297
- }
1298
- fail();
1299
- }
1300
- function parseArray() {
1301
- var result = [];
1302
- while (position < length) {
1303
- skipWhiteSpace();
1304
- stack.push(result.length);
1305
- var item = parseGeneric();
1306
- stack.pop();
1307
- skipWhiteSpace();
1308
- tokenStart();
1309
- var chr = input[position++];
1310
- tokenEnd(void 0, "separator");
1311
- if (item !== void 0) {
1312
- if (typeof options.reviver === "function") {
1313
- item = options.reviver.call(null, String(result.length), item);
1314
- }
1315
- if (item === void 0) {
1316
- result.length++;
1317
- item = true;
1318
- } else {
1319
- result.push(item);
1320
- }
1321
- }
1322
- if (chr === ",") {
1323
- if (item === void 0) {
1324
- fail("Elisions are not supported");
1325
- }
1326
- } else if (chr === "]") {
1327
- if (!json5 && item === void 0 && result.length) {
1328
- position--;
1329
- fail("Trailing comma in array");
1330
- }
1331
- return result;
1332
- } else {
1333
- position--;
1334
- fail();
1335
- }
1336
- }
1337
- }
1338
- function parseNumber() {
1339
- position--;
1340
- var start = position, chr = input[position++], t;
1341
- var to_num = function(is_octal2) {
1342
- var str = input.substr(start, position - start);
1343
- if (is_octal2) {
1344
- var result = parseInt(str.replace(/^0o?/, ""), 8);
1345
- } else {
1346
- var result = Number(str);
1347
- }
1348
- if (Number.isNaN(result)) {
1349
- position--;
1350
- fail('Bad numeric literal - "' + input.substr(start, position - start + 1) + '"');
1351
- } else if (!json5 && !str.match(/^-?(0|[1-9][0-9]*)(\.[0-9]+)?(e[+-]?[0-9]+)?$/i)) {
1352
- position--;
1353
- fail('Non-json numeric literal - "' + input.substr(start, position - start + 1) + '"');
1354
- } else {
1355
- return result;
1356
- }
1357
- };
1358
- if (chr === "-" || chr === "+" && json5)
1359
- chr = input[position++];
1360
- if (chr === "N" && json5) {
1361
- parseKeyword("NaN");
1362
- return NaN;
1363
- }
1364
- if (chr === "I" && json5) {
1365
- parseKeyword("Infinity");
1366
- return to_num();
1367
- }
1368
- if (chr >= "1" && chr <= "9") {
1369
- while (position < length && isDecDigit(input[position]))
1370
- position++;
1371
- chr = input[position++];
1372
- }
1373
- if (chr === "0") {
1374
- chr = input[position++];
1375
- var is_octal = chr === "o" || chr === "O" || isOctDigit(chr);
1376
- var is_hex = chr === "x" || chr === "X";
1377
- if (json5 && (is_octal || is_hex)) {
1378
- while (position < length && (is_hex ? isHexDigit : isOctDigit)(input[position]))
1379
- position++;
1380
- var sign = 1;
1381
- if (input[start] === "-") {
1382
- sign = -1;
1383
- start++;
1384
- } else if (input[start] === "+") {
1385
- start++;
1386
- }
1387
- return sign * to_num(is_octal);
1388
- }
1389
- }
1390
- if (chr === ".") {
1391
- while (position < length && isDecDigit(input[position]))
1392
- position++;
1393
- chr = input[position++];
1394
- }
1395
- if (chr === "e" || chr === "E") {
1396
- chr = input[position++];
1397
- if (chr === "-" || chr === "+")
1398
- position++;
1399
- while (position < length && isDecDigit(input[position]))
1400
- position++;
1401
- chr = input[position++];
1402
- }
1403
- position--;
1404
- return to_num();
1405
- }
1406
- function parseIdentifier() {
1407
- position--;
1408
- var result = "";
1409
- while (position < length) {
1410
- var chr = input[position++];
1411
- if (chr === "\\" && input[position] === "u" && isHexDigit(input[position + 1]) && isHexDigit(input[position + 2]) && isHexDigit(input[position + 3]) && isHexDigit(input[position + 4])) {
1412
- chr = String.fromCharCode(parseInt(input.substr(position + 1, 4), 16));
1413
- position += 5;
1414
- }
1415
- if (result.length) {
1416
- if (Uni.isIdentifierPart(chr)) {
1417
- result += chr;
1418
- } else {
1419
- position--;
1420
- return result;
1421
- }
1422
- } else {
1423
- if (Uni.isIdentifierStart(chr)) {
1424
- result += chr;
1425
- } else {
1426
- return void 0;
1427
- }
1428
- }
1429
- }
1430
- fail();
1431
- }
1432
- function parseString(endChar) {
1433
- var result = "";
1434
- while (position < length) {
1435
- var chr = input[position++];
1436
- if (chr === endChar) {
1437
- return result;
1438
- } else if (chr === "\\") {
1439
- if (position >= length)
1440
- fail();
1441
- chr = input[position++];
1442
- if (unescapeMap[chr] && (json5 || chr != "v" && chr != "'")) {
1443
- result += unescapeMap[chr];
1444
- } else if (json5 && isLineTerminator(chr)) {
1445
- newline(chr);
1446
- } else if (chr === "u" || chr === "x" && json5) {
1447
- var off = chr === "u" ? 4 : 2;
1448
- for (var i = 0; i < off; i++) {
1449
- if (position >= length)
1450
- fail();
1451
- if (!isHexDigit(input[position]))
1452
- fail("Bad escape sequence");
1453
- position++;
1454
- }
1455
- result += String.fromCharCode(parseInt(input.substr(position - off, off), 16));
1456
- } else if (json5 && isOctDigit(chr)) {
1457
- if (chr < "4" && isOctDigit(input[position]) && isOctDigit(input[position + 1])) {
1458
- var digits = 3;
1459
- } else if (isOctDigit(input[position])) {
1460
- var digits = 2;
1461
- } else {
1462
- var digits = 1;
1463
- }
1464
- position += digits - 1;
1465
- result += String.fromCharCode(parseInt(input.substr(position - digits, digits), 8));
1466
- } else if (json5) {
1467
- result += chr;
1468
- } else {
1469
- position--;
1470
- fail();
1471
- }
1472
- } else if (isLineTerminator(chr)) {
1473
- fail();
1474
- } else {
1475
- if (!json5 && chr.charCodeAt(0) < 32) {
1476
- position--;
1477
- fail("Unexpected control character");
1478
- }
1479
- result += chr;
1480
- }
1481
- }
1482
- fail();
1483
- }
1484
- skipWhiteSpace();
1485
- var return_value = parseGeneric();
1486
- if (return_value !== void 0 || position < length) {
1487
- skipWhiteSpace();
1488
- if (position >= length) {
1489
- if (typeof options.reviver === "function") {
1490
- return_value = options.reviver.call(null, "", return_value);
1491
- }
1492
- return return_value;
1493
- } else {
1494
- fail();
1495
- }
1496
- } else {
1497
- if (position) {
1498
- fail("No data, only a whitespace");
1499
- } else {
1500
- fail("No data, empty input");
1501
- }
1502
- }
1503
- }
1504
- module.exports.parse = function parseJSON(input, options) {
1505
- if (typeof options === "function") {
1506
- options = {
1507
- reviver: options
1508
- };
1509
- }
1510
- if (input === void 0) {
1511
- return void 0;
1512
- }
1513
- if (typeof input !== "string")
1514
- input = String(input);
1515
- if (options == null)
1516
- options = {};
1517
- if (options.reserved_keys == null)
1518
- options.reserved_keys = "ignore";
1519
- if (options.reserved_keys === "throw" || options.reserved_keys === "ignore") {
1520
- if (options.null_prototype == null) {
1521
- options.null_prototype = true;
1522
- }
1523
- }
1524
- try {
1525
- return parse(input, options);
1526
- } catch (err) {
1527
- if (err instanceof SyntaxError && err.row != null && err.column != null) {
1528
- var old_err = err;
1529
- err = SyntaxError(old_err.message);
1530
- err.column = old_err.column;
1531
- err.row = old_err.row;
1532
- }
1533
- throw err;
1534
- }
1535
- };
1536
- module.exports.tokenize = function tokenizeJSON(input, options) {
1537
- if (options == null)
1538
- options = {};
1539
- options._tokenize = function(smth) {
1540
- if (options._addstack)
1541
- smth.stack.unshift.apply(smth.stack, options._addstack);
1542
- tokens.push(smth);
1543
- };
1544
- var tokens = [];
1545
- tokens.data = module.exports.parse(input, options);
1546
- return tokens;
1547
- };
1548
- }
1549
- });
1550
-
1551
- // ../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/index.js
1552
- var require_parse_json = __commonJS({
1553
- "../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/index.js"(exports, module) {
1554
- "use strict";
1555
- var errorEx = require_error_ex();
1556
- var fallback = require_parse();
1557
- function appendPosition(message) {
1558
- const posRe = / at (\d+:\d+) in/;
1559
- const numbers = posRe.exec(message);
1560
- return message.replace(posRe, " in") + ":" + numbers[1];
1561
- }
1562
- var JSONError = errorEx("JSONError", {
1563
- fileName: errorEx.append("in %s"),
1564
- appendPosition: {
1565
- message: (shouldAppend, original) => {
1566
- if (shouldAppend) {
1567
- original[0] = appendPosition(original[0]);
1568
- }
1569
- return original;
1570
- }
1571
- }
1572
- });
1573
- module.exports = (input, reviver, filename) => {
1574
- if (typeof reviver === "string") {
1575
- filename = reviver;
1576
- reviver = null;
1577
- }
1578
- try {
1579
- try {
1580
- return JSON.parse(input, reviver);
1581
- } catch (err) {
1582
- fallback.parse(input, {
1583
- mode: "json",
1584
- reviver
1585
- });
1586
- throw err;
1587
- }
1588
- } catch (err) {
1589
- const jsonErr = new JSONError(err);
1590
- if (filename) {
1591
- jsonErr.fileName = filename;
1592
- jsonErr.appendPosition = true;
1593
- }
1594
- throw jsonErr;
1595
- }
1596
- };
1597
- }
1598
- });
1599
-
1600
- // ../../node_modules/.pnpm/pify@2.3.0/node_modules/pify/index.js
1601
- var require_pify = __commonJS({
1602
- "../../node_modules/.pnpm/pify@2.3.0/node_modules/pify/index.js"(exports, module) {
1603
- "use strict";
1604
- var processFn = function(fn, P, opts) {
1605
- return function() {
1606
- var that = this;
1607
- var args = new Array(arguments.length);
1608
- for (var i = 0; i < arguments.length; i++) {
1609
- args[i] = arguments[i];
1610
- }
1611
- return new P(function(resolve2, reject) {
1612
- args.push(function(err, result) {
1613
- if (err) {
1614
- reject(err);
1615
- } else if (opts.multiArgs) {
1616
- var results = new Array(arguments.length - 1);
1617
- for (var i2 = 1; i2 < arguments.length; i2++) {
1618
- results[i2 - 1] = arguments[i2];
1619
- }
1620
- resolve2(results);
1621
- } else {
1622
- resolve2(result);
1623
- }
1624
- });
1625
- fn.apply(that, args);
1626
- });
1627
- };
1628
- };
1629
- var pify = module.exports = function(obj, P, opts) {
1630
- if (typeof P !== "function") {
1631
- opts = P;
1632
- P = Promise;
1633
- }
1634
- opts = opts || {};
1635
- opts.exclude = opts.exclude || [/.+Sync$/];
1636
- var filter = function(key) {
1637
- var match = function(pattern) {
1638
- return typeof pattern === "string" ? key === pattern : pattern.test(key);
1639
- };
1640
- return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
1641
- };
1642
- var ret = typeof obj === "function" ? function() {
1643
- if (opts.excludeMain) {
1644
- return obj.apply(this, arguments);
1645
- }
1646
- return processFn(obj, P, opts).apply(this, arguments);
1647
- } : {};
1648
- return Object.keys(obj).reduce(function(ret2, key) {
1649
- var x = obj[key];
1650
- ret2[key] = typeof x === "function" && filter(key) ? processFn(x, P, opts) : x;
1651
- return ret2;
1652
- }, ret);
1653
- };
1654
- pify.all = pify;
1655
- }
1656
- });
1657
-
1658
- // ../../node_modules/.pnpm/load-json-file@3.0.0/node_modules/load-json-file/index.js
1659
- var require_load_json_file = __commonJS({
1660
- "../../node_modules/.pnpm/load-json-file@3.0.0/node_modules/load-json-file/index.js"(exports, module) {
1661
- "use strict";
1662
- var path = __require("path");
1663
- var fs = require_graceful_fs();
1664
- var stripBom = require_strip_bom();
1665
- var parseJson = require_parse_json();
1666
- var pify = require_pify();
1667
- var parse = (data, fp) => parseJson(stripBom(data), path.relative(".", fp));
1668
- module.exports = (fp) => pify(fs.readFile)(fp, "utf8").then((data) => parse(data, fp));
1669
- module.exports.sync = (fp) => parse(fs.readFileSync(fp, "utf8"), fp);
1670
- }
1671
- });
1672
-
1673
- // ../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js
1674
- var require_imurmurhash = __commonJS({
1675
- "../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js"(exports, module) {
1676
- (function() {
1677
- var cache;
1678
- function MurmurHash3(key, seed) {
1679
- var m = this instanceof MurmurHash3 ? this : cache;
1680
- m.reset(seed);
1681
- if (typeof key === "string" && key.length > 0) {
1682
- m.hash(key);
1683
- }
1684
- if (m !== this) {
1685
- return m;
1686
- }
1687
- }
1688
- ;
1689
- MurmurHash3.prototype.hash = function(key) {
1690
- var h1, k1, i, top, len;
1691
- len = key.length;
1692
- this.len += len;
1693
- k1 = this.k1;
1694
- i = 0;
1695
- switch (this.rem) {
1696
- case 0:
1697
- k1 ^= len > i ? key.charCodeAt(i++) & 65535 : 0;
1698
- case 1:
1699
- k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 8 : 0;
1700
- case 2:
1701
- k1 ^= len > i ? (key.charCodeAt(i++) & 65535) << 16 : 0;
1702
- case 3:
1703
- k1 ^= len > i ? (key.charCodeAt(i) & 255) << 24 : 0;
1704
- k1 ^= len > i ? (key.charCodeAt(i++) & 65280) >> 8 : 0;
1705
- }
1706
- this.rem = len + this.rem & 3;
1707
- len -= this.rem;
1708
- if (len > 0) {
1709
- h1 = this.h1;
1710
- while (1) {
1711
- k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295;
1712
- k1 = k1 << 15 | k1 >>> 17;
1713
- k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295;
1714
- h1 ^= k1;
1715
- h1 = h1 << 13 | h1 >>> 19;
1716
- h1 = h1 * 5 + 3864292196 & 4294967295;
1717
- if (i >= len) {
1718
- break;
1719
- }
1720
- k1 = key.charCodeAt(i++) & 65535 ^ (key.charCodeAt(i++) & 65535) << 8 ^ (key.charCodeAt(i++) & 65535) << 16;
1721
- top = key.charCodeAt(i++);
1722
- k1 ^= (top & 255) << 24 ^ (top & 65280) >> 8;
1723
- }
1724
- k1 = 0;
1725
- switch (this.rem) {
1726
- case 3:
1727
- k1 ^= (key.charCodeAt(i + 2) & 65535) << 16;
1728
- case 2:
1729
- k1 ^= (key.charCodeAt(i + 1) & 65535) << 8;
1730
- case 1:
1731
- k1 ^= key.charCodeAt(i) & 65535;
1732
- }
1733
- this.h1 = h1;
1734
- }
1735
- this.k1 = k1;
1736
- return this;
1737
- };
1738
- MurmurHash3.prototype.result = function() {
1739
- var k1, h1;
1740
- k1 = this.k1;
1741
- h1 = this.h1;
1742
- if (k1 > 0) {
1743
- k1 = k1 * 11601 + (k1 & 65535) * 3432906752 & 4294967295;
1744
- k1 = k1 << 15 | k1 >>> 17;
1745
- k1 = k1 * 13715 + (k1 & 65535) * 461832192 & 4294967295;
1746
- h1 ^= k1;
1747
- }
1748
- h1 ^= this.len;
1749
- h1 ^= h1 >>> 16;
1750
- h1 = h1 * 51819 + (h1 & 65535) * 2246770688 & 4294967295;
1751
- h1 ^= h1 >>> 13;
1752
- h1 = h1 * 44597 + (h1 & 65535) * 3266445312 & 4294967295;
1753
- h1 ^= h1 >>> 16;
1754
- return h1 >>> 0;
1755
- };
1756
- MurmurHash3.prototype.reset = function(seed) {
1757
- this.h1 = typeof seed === "number" ? seed : 0;
1758
- this.rem = this.k1 = this.len = 0;
1759
- return this;
1760
- };
1761
- cache = new MurmurHash3();
1762
- if (typeof module != "undefined") {
1763
- module.exports = MurmurHash3;
1764
- } else {
1765
- this.MurmurHash3 = MurmurHash3;
1766
- }
1767
- })();
1768
- }
1769
- });
1770
-
1771
- // ../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js
1772
- var require_write_file_atomic = __commonJS({
1773
- "../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js"(exports, module) {
1774
- "use strict";
1775
- module.exports = writeFile;
1776
- module.exports.sync = writeFileSync;
1777
- module.exports._getTmpname = getTmpname;
1778
- module.exports._cleanupOnExit = cleanupOnExit;
1779
- var fs = require_graceful_fs();
1780
- var MurmurHash3 = require_imurmurhash();
1781
- var onExit = require_signal_exit();
1782
- var path = __require("path");
1783
- var activeFiles = {};
1784
- var threadId = function getId() {
1785
- try {
1786
- var workerThreads = __require("worker_threads");
1787
- return workerThreads.threadId;
1788
- } catch (e) {
1789
- return 0;
1790
- }
1791
- }();
1792
- var invocations = 0;
1793
- function getTmpname(filename) {
1794
- return filename + "." + MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result();
1795
- }
1796
- function cleanupOnExit(tmpfile) {
1797
- return function() {
1798
- try {
1799
- fs.unlinkSync(typeof tmpfile === "function" ? tmpfile() : tmpfile);
1800
- } catch (_) {
1801
- }
1802
- };
1803
- }
1804
- function writeFile(filename, data, options, callback) {
1805
- if (options) {
1806
- if (options instanceof Function) {
1807
- callback = options;
1808
- options = {};
1809
- } else if (typeof options === "string") {
1810
- options = { encoding: options };
1811
- }
1812
- } else {
1813
- options = {};
1814
- }
1815
- var Promise2 = options.Promise || global.Promise;
1816
- var truename;
1817
- var fd;
1818
- var tmpfile;
1819
- var removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile));
1820
- var absoluteName = path.resolve(filename);
1821
- new Promise2(function serializeSameFile(resolve2) {
1822
- if (!activeFiles[absoluteName])
1823
- activeFiles[absoluteName] = [];
1824
- activeFiles[absoluteName].push(resolve2);
1825
- if (activeFiles[absoluteName].length === 1)
1826
- resolve2();
1827
- }).then(function getRealPath() {
1828
- return new Promise2(function(resolve2) {
1829
- fs.realpath(filename, function(_, realname) {
1830
- truename = realname || filename;
1831
- tmpfile = getTmpname(truename);
1832
- resolve2();
1833
- });
1834
- });
1835
- }).then(function stat() {
1836
- return new Promise2(function stat2(resolve2) {
1837
- if (options.mode && options.chown)
1838
- resolve2();
1839
- else {
1840
- fs.stat(truename, function(err, stats) {
1841
- if (err || !stats)
1842
- resolve2();
1843
- else {
1844
- options = Object.assign({}, options);
1845
- if (options.mode == null) {
1846
- options.mode = stats.mode;
1847
- }
1848
- if (options.chown == null && process.getuid) {
1849
- options.chown = { uid: stats.uid, gid: stats.gid };
1850
- }
1851
- resolve2();
1852
- }
1853
- });
1854
- }
1855
- });
1856
- }).then(function thenWriteFile() {
1857
- return new Promise2(function(resolve2, reject) {
1858
- fs.open(tmpfile, "w", options.mode, function(err, _fd) {
1859
- fd = _fd;
1860
- if (err)
1861
- reject(err);
1862
- else
1863
- resolve2();
1864
- });
1865
- });
1866
- }).then(function write() {
1867
- return new Promise2(function(resolve2, reject) {
1868
- if (Buffer.isBuffer(data)) {
1869
- fs.write(fd, data, 0, data.length, 0, function(err) {
1870
- if (err)
1871
- reject(err);
1872
- else
1873
- resolve2();
1874
- });
1875
- } else if (data != null) {
1876
- fs.write(fd, String(data), 0, String(options.encoding || "utf8"), function(err) {
1877
- if (err)
1878
- reject(err);
1879
- else
1880
- resolve2();
1881
- });
1882
- } else
1883
- resolve2();
1884
- });
1885
- }).then(function syncAndClose() {
1886
- return new Promise2(function(resolve2, reject) {
1887
- if (options.fsync !== false) {
1888
- fs.fsync(fd, function(err) {
1889
- if (err)
1890
- fs.close(fd, () => reject(err));
1891
- else
1892
- fs.close(fd, resolve2);
1893
- });
1894
- } else {
1895
- fs.close(fd, resolve2);
1896
- }
1897
- });
1898
- }).then(function chown() {
1899
- fd = null;
1900
- if (options.chown) {
1901
- return new Promise2(function(resolve2, reject) {
1902
- fs.chown(tmpfile, options.chown.uid, options.chown.gid, function(err) {
1903
- if (err)
1904
- reject(err);
1905
- else
1906
- resolve2();
1907
- });
1908
- });
1909
- }
1910
- }).then(function chmod() {
1911
- if (options.mode) {
1912
- return new Promise2(function(resolve2, reject) {
1913
- fs.chmod(tmpfile, options.mode, function(err) {
1914
- if (err)
1915
- reject(err);
1916
- else
1917
- resolve2();
1918
- });
1919
- });
1920
- }
1921
- }).then(function rename() {
1922
- return new Promise2(function(resolve2, reject) {
1923
- fs.rename(tmpfile, truename, function(err) {
1924
- if (err)
1925
- reject(err);
1926
- else
1927
- resolve2();
1928
- });
1929
- });
1930
- }).then(function success() {
1931
- removeOnExitHandler();
1932
- callback();
1933
- }, function fail(err) {
1934
- return new Promise2((resolve2) => {
1935
- return fd ? fs.close(fd, resolve2) : resolve2();
1936
- }).then(() => {
1937
- removeOnExitHandler();
1938
- fs.unlink(tmpfile, function() {
1939
- callback(err);
1940
- });
1941
- });
1942
- }).then(function checkQueue() {
1943
- activeFiles[absoluteName].shift();
1944
- if (activeFiles[absoluteName].length > 0) {
1945
- activeFiles[absoluteName][0]();
1946
- } else
1947
- delete activeFiles[absoluteName];
1948
- });
1949
- }
1950
- function writeFileSync(filename, data, options) {
1951
- if (typeof options === "string")
1952
- options = { encoding: options };
1953
- else if (!options)
1954
- options = {};
1955
- try {
1956
- filename = fs.realpathSync(filename);
1957
- } catch (ex) {
1958
- }
1959
- var tmpfile = getTmpname(filename);
1960
- if (!options.mode || !options.chown) {
1961
- try {
1962
- var stats = fs.statSync(filename);
1963
- options = Object.assign({}, options);
1964
- if (!options.mode) {
1965
- options.mode = stats.mode;
1966
- }
1967
- if (!options.chown && process.getuid) {
1968
- options.chown = { uid: stats.uid, gid: stats.gid };
1969
- }
1970
- } catch (ex) {
1971
- }
1972
- }
1973
- var fd;
1974
- var cleanup = cleanupOnExit(tmpfile);
1975
- var removeOnExitHandler = onExit(cleanup);
1976
- try {
1977
- fd = fs.openSync(tmpfile, "w", options.mode);
1978
- if (Buffer.isBuffer(data)) {
1979
- fs.writeSync(fd, data, 0, data.length, 0);
1980
- } else if (data != null) {
1981
- fs.writeSync(fd, String(data), 0, String(options.encoding || "utf8"));
1982
- }
1983
- if (options.fsync !== false) {
1984
- fs.fsyncSync(fd);
1985
- }
1986
- fs.closeSync(fd);
1987
- if (options.chown)
1988
- fs.chownSync(tmpfile, options.chown.uid, options.chown.gid);
1989
- if (options.mode)
1990
- fs.chmodSync(tmpfile, options.mode);
1991
- fs.renameSync(tmpfile, filename);
1992
- removeOnExitHandler();
1993
- } catch (err) {
1994
- if (fd) {
1995
- try {
1996
- fs.closeSync(fd);
1997
- } catch (ex) {
1998
- }
1999
- }
2000
- removeOnExitHandler();
2001
- cleanup();
2002
- throw err;
2003
- }
2004
- }
2005
- }
2006
- });
2007
-
2008
- // ../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js
2009
- var require_is_plain_obj = __commonJS({
2010
- "../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js"(exports, module) {
2011
- "use strict";
2012
- var toString = Object.prototype.toString;
2013
- module.exports = function(x) {
2014
- var prototype;
2015
- return toString.call(x) === "[object Object]" && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));
2016
- };
2017
- }
2018
- });
2019
-
2020
- // ../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js
2021
- var require_sort_keys = __commonJS({
2022
- "../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js"(exports, module) {
2023
- "use strict";
2024
- var isPlainObj = require_is_plain_obj();
2025
- module.exports = function(obj, opts) {
2026
- if (!isPlainObj(obj)) {
2027
- throw new TypeError("Expected a plain object");
2028
- }
2029
- opts = opts || {};
2030
- if (typeof opts === "function") {
2031
- opts = { compare: opts };
2032
- }
2033
- var deep = opts.deep;
2034
- var seenInput = [];
2035
- var seenOutput = [];
2036
- var sortKeys = function(x) {
2037
- var seenIndex = seenInput.indexOf(x);
2038
- if (seenIndex !== -1) {
2039
- return seenOutput[seenIndex];
2040
- }
2041
- var ret = {};
2042
- var keys = Object.keys(x).sort(opts.compare);
2043
- seenInput.push(x);
2044
- seenOutput.push(ret);
2045
- for (var i = 0; i < keys.length; i++) {
2046
- var key = keys[i];
2047
- var val = x[key];
2048
- ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val;
2049
- }
2050
- return ret;
2051
- };
2052
- return sortKeys(obj);
2053
- };
2054
- }
2055
- });
2056
-
2057
- // ../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js
2058
- var require_pify2 = __commonJS({
2059
- "../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js"(exports, module) {
2060
- "use strict";
2061
- var processFn = (fn, opts) => function() {
2062
- const P = opts.promiseModule;
2063
- const args = new Array(arguments.length);
2064
- for (let i = 0; i < arguments.length; i++) {
2065
- args[i] = arguments[i];
2066
- }
2067
- return new P((resolve2, reject) => {
2068
- if (opts.errorFirst) {
2069
- args.push(function(err, result) {
2070
- if (opts.multiArgs) {
2071
- const results = new Array(arguments.length - 1);
2072
- for (let i = 1; i < arguments.length; i++) {
2073
- results[i - 1] = arguments[i];
2074
- }
2075
- if (err) {
2076
- results.unshift(err);
2077
- reject(results);
2078
- } else {
2079
- resolve2(results);
2080
- }
2081
- } else if (err) {
2082
- reject(err);
2083
- } else {
2084
- resolve2(result);
2085
- }
2086
- });
2087
- } else {
2088
- args.push(function(result) {
2089
- if (opts.multiArgs) {
2090
- const results = new Array(arguments.length - 1);
2091
- for (let i = 0; i < arguments.length; i++) {
2092
- results[i] = arguments[i];
2093
- }
2094
- resolve2(results);
2095
- } else {
2096
- resolve2(result);
2097
- }
2098
- });
2099
- }
2100
- fn.apply(this, args);
2101
- });
2102
- };
2103
- module.exports = (obj, opts) => {
2104
- opts = Object.assign({
2105
- exclude: [/.+(Sync|Stream)$/],
2106
- errorFirst: true,
2107
- promiseModule: Promise
2108
- }, opts);
2109
- const filter = (key) => {
2110
- const match = (pattern) => typeof pattern === "string" ? key === pattern : pattern.test(key);
2111
- return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
2112
- };
2113
- let ret;
2114
- if (typeof obj === "function") {
2115
- ret = function() {
2116
- if (opts.excludeMain) {
2117
- return obj.apply(this, arguments);
2118
- }
2119
- return processFn(obj, opts).apply(this, arguments);
2120
- };
2121
- } else {
2122
- ret = Object.create(Object.getPrototypeOf(obj));
2123
- }
2124
- for (const key in obj) {
2125
- const x = obj[key];
2126
- ret[key] = typeof x === "function" && filter(key) ? processFn(x, opts) : x;
2127
- }
2128
- return ret;
2129
- };
2130
- }
2131
- });
2132
-
2133
- // ../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js
2134
- var require_make_dir = __commonJS({
2135
- "../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js"(exports, module) {
2136
- "use strict";
2137
- var fs = __require("fs");
2138
- var path = __require("path");
2139
- var pify = require_pify2();
2140
- var defaults = {
2141
- mode: 511 & ~process.umask(),
2142
- fs
2143
- };
2144
- var checkPath = (pth) => {
2145
- if (process.platform === "win32") {
2146
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
2147
- if (pathHasInvalidWinCharacters) {
2148
- const err = new Error(`Path contains invalid characters: ${pth}`);
2149
- err.code = "EINVAL";
2150
- throw err;
2151
- }
2152
- }
2153
- };
2154
- module.exports = (input, opts) => Promise.resolve().then(() => {
2155
- checkPath(input);
2156
- opts = Object.assign({}, defaults, opts);
2157
- const mkdir = pify(opts.fs.mkdir);
2158
- const stat = pify(opts.fs.stat);
2159
- const make = (pth) => {
2160
- return mkdir(pth, opts.mode).then(() => pth).catch((err) => {
2161
- if (err.code === "ENOENT") {
2162
- if (err.message.includes("null bytes") || path.dirname(pth) === pth) {
2163
- throw err;
2164
- }
2165
- return make(path.dirname(pth)).then(() => make(pth));
2166
- }
2167
- return stat(pth).then((stats) => stats.isDirectory() ? pth : Promise.reject()).catch(() => {
2168
- throw err;
2169
- });
2170
- });
2171
- };
2172
- return make(path.resolve(input));
2173
- });
2174
- module.exports.sync = (input, opts) => {
2175
- checkPath(input);
2176
- opts = Object.assign({}, defaults, opts);
2177
- const make = (pth) => {
2178
- try {
2179
- opts.fs.mkdirSync(pth, opts.mode);
2180
- } catch (err) {
2181
- if (err.code === "ENOENT") {
2182
- if (err.message.includes("null bytes") || path.dirname(pth) === pth) {
2183
- throw err;
2184
- }
2185
- make(path.dirname(pth));
2186
- return make(pth);
2187
- }
2188
- try {
2189
- if (!opts.fs.statSync(pth).isDirectory()) {
2190
- throw new Error("The path is not a directory");
2191
- }
2192
- } catch (_) {
2193
- throw err;
2194
- }
2195
- }
2196
- return pth;
2197
- };
2198
- return make(path.resolve(input));
2199
- };
2200
- }
2201
- });
2202
-
2203
- // ../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js
2204
- var require_detect_indent = __commonJS({
2205
- "../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js"(exports, module) {
2206
- "use strict";
2207
- var INDENT_RE = /^(?:( )+|\t+)/;
2208
- function getMostUsed(indents) {
2209
- let result = 0;
2210
- let maxUsed = 0;
2211
- let maxWeight = 0;
2212
- for (const entry of indents) {
2213
- const key = entry[0];
2214
- const val = entry[1];
2215
- const u = val[0];
2216
- const w = val[1];
2217
- if (u > maxUsed || u === maxUsed && w > maxWeight) {
2218
- maxUsed = u;
2219
- maxWeight = w;
2220
- result = Number(key);
2221
- }
2222
- }
2223
- return result;
2224
- }
2225
- module.exports = (str) => {
2226
- if (typeof str !== "string") {
2227
- throw new TypeError("Expected a string");
2228
- }
2229
- let tabs = 0;
2230
- let spaces = 0;
2231
- let prev = 0;
2232
- const indents = /* @__PURE__ */ new Map();
2233
- let current;
2234
- let isIndent;
2235
- for (const line of str.split(/\n/g)) {
2236
- if (!line) {
2237
- continue;
2238
- }
2239
- let indent2;
2240
- const matches = line.match(INDENT_RE);
2241
- if (matches) {
2242
- indent2 = matches[0].length;
2243
- if (matches[1]) {
2244
- spaces++;
2245
- } else {
2246
- tabs++;
2247
- }
2248
- } else {
2249
- indent2 = 0;
2250
- }
2251
- const diff = indent2 - prev;
2252
- prev = indent2;
2253
- if (diff) {
2254
- isIndent = diff > 0;
2255
- current = indents.get(isIndent ? diff : -diff);
2256
- if (current) {
2257
- current[0]++;
2258
- } else {
2259
- current = [1, 0];
2260
- indents.set(diff, current);
2261
- }
2262
- } else if (current) {
2263
- current[1] += Number(isIndent);
2264
- }
2265
- }
2266
- const amount = getMostUsed(indents);
2267
- let type;
2268
- let indent;
2269
- if (!amount) {
2270
- type = null;
2271
- indent = "";
2272
- } else if (spaces >= tabs) {
2273
- type = "space";
2274
- indent = " ".repeat(amount);
2275
- } else {
2276
- type = "tab";
2277
- indent = " ".repeat(amount);
2278
- }
2279
- return {
2280
- amount,
2281
- type,
2282
- indent
2283
- };
2284
- };
2285
- }
2286
- });
2287
-
2288
- // ../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js
2289
- var require_write_json_file = __commonJS({
2290
- "../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js"(exports, module) {
2291
- "use strict";
2292
- var path = __require("path");
2293
- var fs = require_graceful_fs();
2294
- var writeFileAtomic = require_write_file_atomic();
2295
- var sortKeys = require_sort_keys();
2296
- var makeDir = require_make_dir();
2297
- var pify = require_pify();
2298
- var detectIndent = require_detect_indent();
2299
- var init = (fn, fp, data, opts) => {
2300
- if (!fp) {
2301
- throw new TypeError("Expected a filepath");
2302
- }
2303
- if (data === void 0) {
2304
- throw new TypeError("Expected data to stringify");
2305
- }
2306
- opts = Object.assign({
2307
- indent: " ",
2308
- sortKeys: false
2309
- }, opts);
2310
- if (opts.sortKeys) {
2311
- data = sortKeys(data, {
2312
- deep: true,
2313
- compare: typeof opts.sortKeys === "function" && opts.sortKeys
2314
- });
2315
- }
2316
- return fn(fp, data, opts);
2317
- };
2318
- var readFile = (fp) => pify(fs.readFile)(fp, "utf8").catch(() => {
2319
- });
2320
- var main = (fp, data, opts) => {
2321
- return (opts.detectIndent ? readFile(fp) : Promise.resolve()).then((str) => {
2322
- const indent = str ? detectIndent(str).indent : opts.indent;
2323
- const json = JSON.stringify(data, opts.replacer, indent);
2324
- return pify(writeFileAtomic)(fp, `${json}
2325
- `, { mode: opts.mode });
2326
- });
2327
- };
2328
- var mainSync = (fp, data, opts) => {
2329
- let indent = opts.indent;
2330
- if (opts.detectIndent) {
2331
- try {
2332
- const file = fs.readFileSync(fp, "utf8");
2333
- indent = detectIndent(file).indent;
2334
- } catch (err) {
2335
- if (err.code !== "ENOENT") {
2336
- throw err;
2337
- }
2338
- }
2339
- }
2340
- const json = JSON.stringify(data, opts.replacer, indent);
2341
- return writeFileAtomic.sync(fp, `${json}
2342
- `, { mode: opts.mode });
2343
- };
2344
- module.exports = (fp, data, opts) => {
2345
- return makeDir(path.dirname(fp), { fs }).then(() => init(main, fp, data, opts));
2346
- };
2347
- module.exports.sync = (fp, data, opts) => {
2348
- makeDir.sync(path.dirname(fp), { fs });
2349
- init(mainSync, fp, data, opts);
2350
- };
2351
- }
2352
- });
2353
-
2354
- // src/util/native-install.ts
2355
- import { getDataPath } from "@vercel/cli-config";
2356
- import { resolve } from "path";
2357
- function isNativeBinaryInstall() {
2358
- return process.env.VERCEL_VC_NATIVE === "1";
2359
- }
2360
- function getInstallRoot() {
2361
- const root = process.env.VERCEL_INSTALL_DIR;
2362
- return root ? resolve(root) : getDataPath();
2363
- }
2364
-
2365
- // src/util/telemetry/index.ts
2366
- import { randomUUID as randomUUID2 } from "crypto";
2367
- import os from "os";
2368
- var import_constants = __toESM(require_dist(), 1);
2369
- import { spawn } from "child_process";
2370
- import { cloneEnv } from "@vercel/build-utils";
2371
-
2372
- // src/util/telemetry/session.ts
2373
- var import_load_json_file = __toESM(require_load_json_file(), 1);
2374
- var import_write_json_file = __toESM(require_write_json_file(), 1);
2375
- import { randomUUID } from "crypto";
2376
- import { mkdirSync } from "fs";
2377
- import { dirname } from "path";
2378
- var DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS = 30 * 60 * 1e3;
2379
- var DEFAULT_CLI_SESSION_MAX_LIFETIME_MS = 24 * 60 * 60 * 1e3;
2380
- function isPersistedCliSession(value) {
2381
- if (!value || typeof value !== "object") {
2382
- return false;
2383
- }
2384
- const session = value;
2385
- return typeof session.id === "string" && typeof session.createdAt === "number" && Number.isFinite(session.createdAt) && typeof session.lastSeenAt === "number" && Number.isFinite(session.lastSeenAt);
2386
- }
2387
- function isPersistedCliDevice(value) {
2388
- if (!value || typeof value !== "object") {
2389
- return false;
2390
- }
2391
- const device = value;
2392
- return typeof device.id === "string";
2393
- }
2394
- function readPersistedCliSession(filePath) {
2395
- try {
2396
- const session = import_load_json_file.default.sync(filePath);
2397
- return isPersistedCliSession(session) ? session : null;
2398
- } catch {
2399
- return null;
2400
- }
2401
- }
2402
- function writePersistedCliSession(filePath, session) {
2403
- try {
2404
- mkdirSync(dirname(filePath), { recursive: true });
2405
- import_write_json_file.default.sync(filePath, session, { indent: 2 });
2406
- } catch {
2407
- }
2408
- }
2409
- function readPersistedCliDevice(filePath) {
2410
- try {
2411
- const device = import_load_json_file.default.sync(filePath);
2412
- return isPersistedCliDevice(device) ? device : null;
2413
- } catch {
2414
- return null;
2415
- }
2416
- }
2417
- function writePersistedCliDevice(filePath, device) {
2418
- try {
2419
- mkdirSync(dirname(filePath), { recursive: true });
2420
- import_write_json_file.default.sync(filePath, device, { indent: 2 });
2421
- } catch {
2422
- }
2423
- }
2424
- function getOrCreatePersistedCliSession(opts) {
2425
- const now = opts.now?.() ?? Date.now();
2426
- const inactivityTimeoutMs = opts.inactivityTimeoutMs ?? DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS;
2427
- const maxLifetimeMs = opts.maxLifetimeMs ?? DEFAULT_CLI_SESSION_MAX_LIFETIME_MS;
2428
- const existing = readPersistedCliSession(opts.filePath);
2429
- const shouldReuseExisting = existing && now - existing.lastSeenAt <= inactivityTimeoutMs && now - existing.createdAt <= maxLifetimeMs;
2430
- const session = shouldReuseExisting ? {
2431
- ...existing,
2432
- lastSeenAt: now
2433
- } : {
2434
- id: randomUUID(),
2435
- createdAt: now,
2436
- lastSeenAt: now
2437
- };
2438
- writePersistedCliSession(opts.filePath, session);
2439
- return session;
2440
- }
2441
- function touchPersistedCliSession(opts, session) {
2442
- const nextSession = {
2443
- ...session,
2444
- lastSeenAt: opts.now?.() ?? Date.now()
2445
- };
2446
- writePersistedCliSession(opts.filePath, nextSession);
2447
- return nextSession;
2448
- }
2449
- function getOrCreatePersistedCliDevice(opts) {
2450
- const existing = readPersistedCliDevice(opts.filePath);
2451
- if (existing) {
2452
- return existing;
2453
- }
2454
- const device = {
2455
- id: randomUUID()
2456
- };
2457
- writePersistedCliDevice(opts.filePath, device);
2458
- return device;
2459
- }
2460
-
2461
- // src/util/telemetry/index.ts
2462
- var LogLabel = `['telemetry']:`;
2463
- var MAX_ERROR_SERVER_MESSAGE_LENGTH = 500;
2464
- var TelemetryClient = class {
2465
- constructor({ opts }) {
2466
- this.redactedValue = "[REDACTED]";
2467
- this.noValueToTriggerPrompt = "[TRIGGER_PROMPT]";
2468
- this.redactedArgumentsLength = (args) => {
2469
- if (args && args.length === 1) {
2470
- return "ONE";
2471
- }
2472
- if (args.length > 1) {
2473
- return "MANY";
2474
- }
2475
- return "NONE";
2476
- };
2477
- this.redactedTargetName = (target) => {
2478
- if (import_constants.PROJECT_ENV_TARGET.includes(target)) {
2479
- return target;
2480
- }
2481
- return this.redactedValue;
2482
- };
2483
- this.isDebug = opts.isDebug || false;
2484
- this.store = opts.store;
2485
- }
2486
- track(eventData) {
2487
- if (this.isDebug) {
2488
- output_manager_default.debug(`${LogLabel} ${eventData.key}:${eventData.value}`);
2489
- }
2490
- const event = {
2491
- id: randomUUID2(),
2492
- eventTime: Date.now(),
2493
- ...eventData
2494
- };
2495
- this.store.add(event);
2496
- }
2497
- trackCliCommand(eventData) {
2498
- this.track({
2499
- key: `command:${eventData.command}`,
2500
- value: eventData.value
2501
- });
2502
- }
2503
- trackCliSubcommand(eventData) {
2504
- this.track({
2505
- key: `subcommand:${eventData.subcommand}`,
2506
- value: eventData.value
2507
- });
2508
- }
2509
- trackCliArgument(eventData) {
2510
- if (eventData.value) {
2511
- this.track({
2512
- key: `argument:${eventData.arg}`,
2513
- value: eventData.value
2514
- });
2515
- }
2516
- }
2517
- trackCliOption(eventData) {
2518
- this.track({
2519
- key: `option:${eventData.option}`,
2520
- value: eventData.value
2521
- });
2522
- }
2523
- trackTargetEnvironment(targetEnvironment) {
2524
- this.track({
2525
- key: "target_environment",
2526
- value: targetEnvironment
2527
- });
2528
- }
2529
- trackCommandOutput(eventData) {
2530
- this.track({
2531
- key: `output:${eventData.key}`,
2532
- value: eventData.value
2533
- });
2534
- }
2535
- trackCliFlag(flag) {
2536
- this.track({
2537
- key: `flag:${flag}`,
2538
- value: "TRUE"
2539
- });
2540
- }
2541
- trackOidcTokenRefresh(count) {
2542
- this.track({
2543
- key: "oidc-token-refresh",
2544
- value: `${count}`
2545
- });
2546
- }
2547
- trackCPUs() {
2548
- this.track({
2549
- key: "cpu_count",
2550
- value: String(os.cpus().length)
2551
- });
2552
- }
2553
- trackAgenticUse(agent) {
2554
- if (agent) {
2555
- this.track({
2556
- key: "agent",
2557
- value: agent
2558
- });
2559
- }
2560
- }
2561
- trackPlatform() {
2562
- this.track({
2563
- key: "platform",
2564
- value: os.platform()
2565
- });
2566
- }
2567
- trackArch() {
2568
- this.track({
2569
- key: "arch",
2570
- value: os.arch()
2571
- });
2572
- }
2573
- trackCI(ciVendorName) {
2574
- if (ciVendorName) {
2575
- this.track({
2576
- key: "ci",
2577
- value: ciVendorName
2578
- });
2579
- }
2580
- }
2581
- trackStdinIsTTY(isTTY) {
2582
- this.track({
2583
- key: "stdin_is_tty",
2584
- value: isTTY ? "true" : "false"
2585
- });
2586
- }
2587
- trackVersion(version) {
2588
- if (version) {
2589
- this.track({
2590
- key: "version",
2591
- value: version
2592
- });
2593
- }
2594
- }
2595
- trackDefaultDeploy() {
2596
- this.track({
2597
- key: "default-deploy",
2598
- value: "TRUE"
2599
- });
2600
- }
2601
- trackProjectId(projectId) {
2602
- if (projectId) {
2603
- this.track({
2604
- key: "project_id",
2605
- value: projectId
2606
- });
2607
- }
2608
- }
2609
- trackInvocationId(invocationId) {
2610
- if (invocationId) {
2611
- this.track({
2612
- key: "invocation_id",
2613
- value: invocationId
2614
- });
2615
- }
2616
- }
2617
- trackDeviceId(deviceId) {
2618
- if (deviceId) {
2619
- this.track({
2620
- key: "device_id",
2621
- value: deviceId
2622
- });
2623
- }
2624
- }
2625
- trackVercelPluginActiveSession() {
2626
- this.track({
2627
- key: "vercel_plugin_active_session",
2628
- value: "TRUE"
2629
- });
2630
- }
2631
- trackVercelPluginVersion(version) {
2632
- if (version) {
2633
- this.track({
2634
- key: "vercel_plugin_version",
2635
- value: version
2636
- });
2637
- }
2638
- }
2639
- trackErrorStatus(status) {
2640
- if (typeof status !== "undefined") {
2641
- this.track({
2642
- key: "error_status",
2643
- value: String(status)
2644
- });
2645
- }
2646
- }
2647
- trackErrorCode(code) {
2648
- if (code) {
2649
- this.track({
2650
- key: "error_code",
2651
- value: code
2652
- });
2653
- }
2654
- }
2655
- trackErrorSlug(slug) {
2656
- if (slug) {
2657
- this.track({
2658
- key: "error_slug",
2659
- value: slug
2660
- });
2661
- }
2662
- }
2663
- trackErrorAction(action) {
2664
- if (action) {
2665
- this.track({
2666
- key: "error_action",
2667
- value: action
2668
- });
2669
- }
2670
- }
2671
- trackErrorServerMessage(serverMessage) {
2672
- if (serverMessage) {
2673
- const normalizedServerMessage = serverMessage.trim().replace(/\s+/g, " ");
2674
- this.track({
2675
- key: "error_server_message",
2676
- value: normalizedServerMessage.slice(
2677
- 0,
2678
- MAX_ERROR_SERVER_MESSAGE_LENGTH
2679
- )
2680
- });
2681
- }
2682
- }
2683
- trackExtension() {
2684
- this.track({
2685
- key: "extension",
2686
- value: this.redactedValue
2687
- });
2688
- }
2689
- trackLoginState(state) {
2690
- if (state === "started")
2691
- this.loginAttempt = randomUUID2();
2692
- if (this.loginAttempt) {
2693
- this.track({ key: `login:attempt:${this.loginAttempt}`, value: state });
2694
- }
2695
- if (state !== "started")
2696
- this.loginAttempt = void 0;
2697
- }
2698
- trackCliFlagHelp(command, subcommands) {
2699
- let subcommand;
2700
- if (subcommands) {
2701
- subcommand = Array.isArray(subcommands) ? subcommands[0] : subcommands;
2702
- }
2703
- this.track({
2704
- key: "flag:help",
2705
- value: subcommand ? `${command}:${subcommand}` : command
2706
- });
2707
- }
2708
- /**
2709
- * Tracks the --format option for JSON output.
2710
- * This is a common option across many commands, so it's defined in the base class.
2711
- */
2712
- trackCliOptionFormat(format) {
2713
- if (format) {
2714
- const allowedFormat = ["json"].includes(format) ? format : this.redactedValue;
2715
- this.trackCliOption({
2716
- option: "format",
2717
- value: allowedFormat
2718
- });
2719
- }
2720
- }
2721
- /**
2722
- * Tracks the --project option. Value is redacted because project names/IDs
2723
- * may be sensitive. Accepts `string | string[]` so commands with a repeatable
2724
- * `--project` can override. Not all commands support repeated `--project` flags
2725
- */
2726
- trackCliOptionProject(value) {
2727
- if (!value)
2728
- return;
2729
- if (Array.isArray(value) && value.length === 0)
2730
- return;
2731
- this.trackCliOption({
2732
- option: "project",
2733
- value: this.redactedValue
2734
- });
2735
- }
2736
- };
2737
- var TelemetryEventStore = class {
2738
- constructor(opts) {
2739
- this.teamId = "NO_TEAM_ID";
2740
- this.userId = "NO_USER_ID";
2741
- this.projectId = "NO_PROJECT_ID";
2742
- this.isDebug = opts?.isDebug || false;
2743
- this.events = [];
2744
- this.config = opts?.config;
2745
- this.cliDeviceOptions = opts?.cliDevice;
2746
- this.cliSessionOptions = opts?.cliSession;
2747
- this.invocationId = randomUUID2();
2748
- this.deviceId = randomUUID2();
2749
- if (this.cliDeviceOptions) {
2750
- this.cliDevice = getOrCreatePersistedCliDevice(this.cliDeviceOptions);
2751
- this.deviceId = this.cliDevice.id;
2752
- }
2753
- if (this.cliSessionOptions) {
2754
- this.cliSession = getOrCreatePersistedCliSession(this.cliSessionOptions);
2755
- this.sessionId = this.cliSession.id;
2756
- } else {
2757
- this.sessionId = randomUUID2();
2758
- }
2759
- }
2760
- add(event) {
2761
- event.sessionId = this.sessionId;
2762
- event.teamId = this.teamId;
2763
- event.userId = this.userId;
2764
- event.projectId = this.projectId;
2765
- this.events.push(event);
2766
- }
2767
- updateTeamId(teamId) {
2768
- if (teamId) {
2769
- this.teamId = teamId;
2770
- }
2771
- }
2772
- updateUserId(userId) {
2773
- if (userId) {
2774
- this.userId = userId;
2775
- }
2776
- }
2777
- updateProjectId(projectId) {
2778
- if (projectId) {
2779
- this.projectId = projectId;
2780
- }
2781
- }
2782
- get hasUserId() {
2783
- return this.userId !== "NO_USER_ID";
2784
- }
2785
- get currentProjectId() {
2786
- return this.projectId;
2787
- }
2788
- get currentInvocationId() {
2789
- return this.invocationId;
2790
- }
2791
- get currentDeviceId() {
2792
- return this.deviceId;
2793
- }
2794
- get currentSessionId() {
2795
- return this.sessionId;
2796
- }
2797
- get readonlyEvents() {
2798
- return Array.from(this.events);
2799
- }
2800
- reset() {
2801
- this.events = [];
2802
- }
2803
- get enabled() {
2804
- if (process.env.VERCEL_TELEMETRY_DISABLED) {
2805
- return false;
2806
- }
2807
- return this.config?.enabled ?? true;
2808
- }
2809
- async save() {
2810
- if (this.cliSession && this.cliSessionOptions) {
2811
- this.cliSession = touchPersistedCliSession(
2812
- this.cliSessionOptions,
2813
- this.cliSession
2814
- );
2815
- }
2816
- if (this.isDebug) {
2817
- output_manager_default.log(`${LogLabel} Flushing Events`);
2818
- for (const event of this.events) {
2819
- event.teamId = this.teamId;
2820
- event.userId = this.userId;
2821
- event.projectId = this.projectId;
2822
- output_manager_default.log(JSON.stringify(event));
2823
- }
2824
- return;
2825
- }
2826
- if (this.enabled) {
2827
- const sessionId = this.events[0].sessionId;
2828
- if (!sessionId) {
2829
- output_manager_default.debug("Unable to send metrics: no session ID");
2830
- return;
2831
- }
2832
- const events = this.events.map((event) => {
2833
- delete event.sessionId;
2834
- delete event.teamId;
2835
- delete event.userId;
2836
- delete event.projectId;
2837
- const { eventTime, ...rest } = event;
2838
- return {
2839
- event_time: eventTime,
2840
- team_id: this.teamId,
2841
- user_id: this.userId,
2842
- project_id: this.projectId,
2843
- ...rest
2844
- };
2845
- });
2846
- const payload = {
2847
- headers: {
2848
- "Client-id": "vercel-cli",
2849
- "x-vercel-cli-topic-id": "generic",
2850
- "x-vercel-cli-session-id": sessionId
2851
- },
2852
- body: events
2853
- };
2854
- await this.sendToSubprocess(payload, output_manager_default.debugEnabled);
2855
- }
2856
- }
2857
- /**
2858
- * Send the telemetry events to a subprocess, this invokes the `telemetry flush` command
2859
- * and passes a stringified payload to the subprocess, there's a risk that if the event payload
2860
- * increases in size, it may exceed the maximum buffer size for the subprocess, in which case the
2861
- * child process will error and not send anything.
2862
- * FIXME: handle max buffer size
2863
- */
2864
- async sendToSubprocess(payload, outputDebugEnabled) {
2865
- const flushArgs = ["telemetry", "flush", JSON.stringify(payload)];
2866
- let nodeBinaryPath;
2867
- let script;
2868
- if (isNativeBinaryInstall()) {
2869
- nodeBinaryPath = process.execPath;
2870
- script = flushArgs;
2871
- } else {
2872
- const args = [process.execPath, process.argv[0], process.argv[1]];
2873
- if (args[0] === args[1]) {
2874
- args.shift();
2875
- }
2876
- nodeBinaryPath = args[0];
2877
- script = [...args.slice(1), ...flushArgs];
2878
- }
2879
- const env = cloneEnv(process.env, {
2880
- VERCEL_TELEMETRY_DISABLED: "1"
2881
- });
2882
- if (outputDebugEnabled) {
2883
- return new Promise((resolve2) => {
2884
- const childProcess = spawn(nodeBinaryPath, script, {
2885
- env,
2886
- stdio: ["ignore", "pipe", "pipe"]
2887
- });
2888
- childProcess.stderr.on("data", (data) => output_manager_default.debug(data.toString()));
2889
- childProcess.stdout.on("data", (data) => output_manager_default.debug(data.toString()));
2890
- childProcess.on("error", (d) => {
2891
- output_manager_default.debug(d);
2892
- });
2893
- const timeout = setTimeout(() => {
2894
- output_manager_default.debug("Telemetry subprocess killed due to timeout");
2895
- childProcess.kill();
2896
- }, 2e3);
2897
- childProcess.on("exit", (code) => {
2898
- output_manager_default.debug(`Telemetry subprocess exited with code ${code}`);
2899
- childProcess.unref();
2900
- timeout.unref();
2901
- resolve2();
2902
- });
2903
- });
2904
- } else {
2905
- const childProcess = spawn(nodeBinaryPath, script, {
2906
- stdio: "ignore",
2907
- env,
2908
- windowsHide: true,
2909
- detached: true
2910
- });
2911
- childProcess.unref();
2912
- }
2913
- }
2914
- };
2915
-
2916
- export {
2917
- require_graceful_fs,
2918
- require_dist,
2919
- require_load_json_file,
2920
- isNativeBinaryInstall,
2921
- getInstallRoot,
2922
- TelemetryClient,
2923
- TelemetryEventStore
2924
- };
2925
- /*! Bundled license information:
2926
-
2927
- imurmurhash/imurmurhash.js:
2928
- (**
2929
- * @preserve
2930
- * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
2931
- *
2932
- * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
2933
- * @see http://github.com/homebrewing/brauhaus-diff
2934
- * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
2935
- * @see http://github.com/garycourt/murmurhash-js
2936
- * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
2937
- * @see http://sites.google.com/site/murmurhash/
2938
- *)
2939
- */