create-turbo 1.13.4-canary.4 → 2.0.0-canary.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +4 -370
- package/dist/cli.js +2 -2
- package/package.json +5 -5
package/LICENSE
CHANGED
@@ -1,373 +1,7 @@
|
|
1
|
-
|
2
|
-
==================================
|
1
|
+
Copyright (c) 2024 Vercel, Inc
|
3
2
|
|
4
|
-
|
5
|
-
--------------
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
4
|
|
7
|
-
|
8
|
-
means each individual or legal entity that creates, contributes to
|
9
|
-
the creation of, or owns Covered Software.
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
10
6
|
|
11
|
-
|
12
|
-
means the combination of the Contributions of others (if any) used
|
13
|
-
by a Contributor and that particular Contributor's Contribution.
|
14
|
-
|
15
|
-
1.3. "Contribution"
|
16
|
-
means Covered Software of a particular Contributor.
|
17
|
-
|
18
|
-
1.4. "Covered Software"
|
19
|
-
means Source Code Form to which the initial Contributor has attached
|
20
|
-
the notice in Exhibit A, the Executable Form of such Source Code
|
21
|
-
Form, and Modifications of such Source Code Form, in each case
|
22
|
-
including portions thereof.
|
23
|
-
|
24
|
-
1.5. "Incompatible With Secondary Licenses"
|
25
|
-
means
|
26
|
-
|
27
|
-
(a) that the initial Contributor has attached the notice described
|
28
|
-
in Exhibit B to the Covered Software; or
|
29
|
-
|
30
|
-
(b) that the Covered Software was made available under the terms of
|
31
|
-
version 1.1 or earlier of the License, but not also under the
|
32
|
-
terms of a Secondary License.
|
33
|
-
|
34
|
-
1.6. "Executable Form"
|
35
|
-
means any form of the work other than Source Code Form.
|
36
|
-
|
37
|
-
1.7. "Larger Work"
|
38
|
-
means a work that combines Covered Software with other material, in
|
39
|
-
a separate file or files, that is not Covered Software.
|
40
|
-
|
41
|
-
1.8. "License"
|
42
|
-
means this document.
|
43
|
-
|
44
|
-
1.9. "Licensable"
|
45
|
-
means having the right to grant, to the maximum extent possible,
|
46
|
-
whether at the time of the initial grant or subsequently, any and
|
47
|
-
all of the rights conveyed by this License.
|
48
|
-
|
49
|
-
1.10. "Modifications"
|
50
|
-
means any of the following:
|
51
|
-
|
52
|
-
(a) any file in Source Code Form that results from an addition to,
|
53
|
-
deletion from, or modification of the contents of Covered
|
54
|
-
Software; or
|
55
|
-
|
56
|
-
(b) any new file in Source Code Form that contains any Covered
|
57
|
-
Software.
|
58
|
-
|
59
|
-
1.11. "Patent Claims" of a Contributor
|
60
|
-
means any patent claim(s), including without limitation, method,
|
61
|
-
process, and apparatus claims, in any patent Licensable by such
|
62
|
-
Contributor that would be infringed, but for the grant of the
|
63
|
-
License, by the making, using, selling, offering for sale, having
|
64
|
-
made, import, or transfer of either its Contributions or its
|
65
|
-
Contributor Version.
|
66
|
-
|
67
|
-
1.12. "Secondary License"
|
68
|
-
means either the GNU General Public License, Version 2.0, the GNU
|
69
|
-
Lesser General Public License, Version 2.1, the GNU Affero General
|
70
|
-
Public License, Version 3.0, or any later versions of those
|
71
|
-
licenses.
|
72
|
-
|
73
|
-
1.13. "Source Code Form"
|
74
|
-
means the form of the work preferred for making modifications.
|
75
|
-
|
76
|
-
1.14. "You" (or "Your")
|
77
|
-
means an individual or a legal entity exercising rights under this
|
78
|
-
License. For legal entities, "You" includes any entity that
|
79
|
-
controls, is controlled by, or is under common control with You. For
|
80
|
-
purposes of this definition, "control" means (a) the power, direct
|
81
|
-
or indirect, to cause the direction or management of such entity,
|
82
|
-
whether by contract or otherwise, or (b) ownership of more than
|
83
|
-
fifty percent (50%) of the outstanding shares or beneficial
|
84
|
-
ownership of such entity.
|
85
|
-
|
86
|
-
2. License Grants and Conditions
|
87
|
-
--------------------------------
|
88
|
-
|
89
|
-
2.1. Grants
|
90
|
-
|
91
|
-
Each Contributor hereby grants You a world-wide, royalty-free,
|
92
|
-
non-exclusive license:
|
93
|
-
|
94
|
-
(a) under intellectual property rights (other than patent or trademark)
|
95
|
-
Licensable by such Contributor to use, reproduce, make available,
|
96
|
-
modify, display, perform, distribute, and otherwise exploit its
|
97
|
-
Contributions, either on an unmodified basis, with Modifications, or
|
98
|
-
as part of a Larger Work; and
|
99
|
-
|
100
|
-
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
101
|
-
for sale, have made, import, and otherwise transfer either its
|
102
|
-
Contributions or its Contributor Version.
|
103
|
-
|
104
|
-
2.2. Effective Date
|
105
|
-
|
106
|
-
The licenses granted in Section 2.1 with respect to any Contribution
|
107
|
-
become effective for each Contribution on the date the Contributor first
|
108
|
-
distributes such Contribution.
|
109
|
-
|
110
|
-
2.3. Limitations on Grant Scope
|
111
|
-
|
112
|
-
The licenses granted in this Section 2 are the only rights granted under
|
113
|
-
this License. No additional rights or licenses will be implied from the
|
114
|
-
distribution or licensing of Covered Software under this License.
|
115
|
-
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
116
|
-
Contributor:
|
117
|
-
|
118
|
-
(a) for any code that a Contributor has removed from Covered Software;
|
119
|
-
or
|
120
|
-
|
121
|
-
(b) for infringements caused by: (i) Your and any other third party's
|
122
|
-
modifications of Covered Software, or (ii) the combination of its
|
123
|
-
Contributions with other software (except as part of its Contributor
|
124
|
-
Version); or
|
125
|
-
|
126
|
-
(c) under Patent Claims infringed by Covered Software in the absence of
|
127
|
-
its Contributions.
|
128
|
-
|
129
|
-
This License does not grant any rights in the trademarks, service marks,
|
130
|
-
or logos of any Contributor (except as may be necessary to comply with
|
131
|
-
the notice requirements in Section 3.4).
|
132
|
-
|
133
|
-
2.4. Subsequent Licenses
|
134
|
-
|
135
|
-
No Contributor makes additional grants as a result of Your choice to
|
136
|
-
distribute the Covered Software under a subsequent version of this
|
137
|
-
License (see Section 10.2) or under the terms of a Secondary License (if
|
138
|
-
permitted under the terms of Section 3.3).
|
139
|
-
|
140
|
-
2.5. Representation
|
141
|
-
|
142
|
-
Each Contributor represents that the Contributor believes its
|
143
|
-
Contributions are its original creation(s) or it has sufficient rights
|
144
|
-
to grant the rights to its Contributions conveyed by this License.
|
145
|
-
|
146
|
-
2.6. Fair Use
|
147
|
-
|
148
|
-
This License is not intended to limit any rights You have under
|
149
|
-
applicable copyright doctrines of fair use, fair dealing, or other
|
150
|
-
equivalents.
|
151
|
-
|
152
|
-
2.7. Conditions
|
153
|
-
|
154
|
-
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
155
|
-
in Section 2.1.
|
156
|
-
|
157
|
-
3. Responsibilities
|
158
|
-
-------------------
|
159
|
-
|
160
|
-
3.1. Distribution of Source Form
|
161
|
-
|
162
|
-
All distribution of Covered Software in Source Code Form, including any
|
163
|
-
Modifications that You create or to which You contribute, must be under
|
164
|
-
the terms of this License. You must inform recipients that the Source
|
165
|
-
Code Form of the Covered Software is governed by the terms of this
|
166
|
-
License, and how they can obtain a copy of this License. You may not
|
167
|
-
attempt to alter or restrict the recipients' rights in the Source Code
|
168
|
-
Form.
|
169
|
-
|
170
|
-
3.2. Distribution of Executable Form
|
171
|
-
|
172
|
-
If You distribute Covered Software in Executable Form then:
|
173
|
-
|
174
|
-
(a) such Covered Software must also be made available in Source Code
|
175
|
-
Form, as described in Section 3.1, and You must inform recipients of
|
176
|
-
the Executable Form how they can obtain a copy of such Source Code
|
177
|
-
Form by reasonable means in a timely manner, at a charge no more
|
178
|
-
than the cost of distribution to the recipient; and
|
179
|
-
|
180
|
-
(b) You may distribute such Executable Form under the terms of this
|
181
|
-
License, or sublicense it under different terms, provided that the
|
182
|
-
license for the Executable Form does not attempt to limit or alter
|
183
|
-
the recipients' rights in the Source Code Form under this License.
|
184
|
-
|
185
|
-
3.3. Distribution of a Larger Work
|
186
|
-
|
187
|
-
You may create and distribute a Larger Work under terms of Your choice,
|
188
|
-
provided that You also comply with the requirements of this License for
|
189
|
-
the Covered Software. If the Larger Work is a combination of Covered
|
190
|
-
Software with a work governed by one or more Secondary Licenses, and the
|
191
|
-
Covered Software is not Incompatible With Secondary Licenses, this
|
192
|
-
License permits You to additionally distribute such Covered Software
|
193
|
-
under the terms of such Secondary License(s), so that the recipient of
|
194
|
-
the Larger Work may, at their option, further distribute the Covered
|
195
|
-
Software under the terms of either this License or such Secondary
|
196
|
-
License(s).
|
197
|
-
|
198
|
-
3.4. Notices
|
199
|
-
|
200
|
-
You may not remove or alter the substance of any license notices
|
201
|
-
(including copyright notices, patent notices, disclaimers of warranty,
|
202
|
-
or limitations of liability) contained within the Source Code Form of
|
203
|
-
the Covered Software, except that You may alter any license notices to
|
204
|
-
the extent required to remedy known factual inaccuracies.
|
205
|
-
|
206
|
-
3.5. Application of Additional Terms
|
207
|
-
|
208
|
-
You may choose to offer, and to charge a fee for, warranty, support,
|
209
|
-
indemnity or liability obligations to one or more recipients of Covered
|
210
|
-
Software. However, You may do so only on Your own behalf, and not on
|
211
|
-
behalf of any Contributor. You must make it absolutely clear that any
|
212
|
-
such warranty, support, indemnity, or liability obligation is offered by
|
213
|
-
You alone, and You hereby agree to indemnify every Contributor for any
|
214
|
-
liability incurred by such Contributor as a result of warranty, support,
|
215
|
-
indemnity or liability terms You offer. You may include additional
|
216
|
-
disclaimers of warranty and limitations of liability specific to any
|
217
|
-
jurisdiction.
|
218
|
-
|
219
|
-
4. Inability to Comply Due to Statute or Regulation
|
220
|
-
---------------------------------------------------
|
221
|
-
|
222
|
-
If it is impossible for You to comply with any of the terms of this
|
223
|
-
License with respect to some or all of the Covered Software due to
|
224
|
-
statute, judicial order, or regulation then You must: (a) comply with
|
225
|
-
the terms of this License to the maximum extent possible; and (b)
|
226
|
-
describe the limitations and the code they affect. Such description must
|
227
|
-
be placed in a text file included with all distributions of the Covered
|
228
|
-
Software under this License. Except to the extent prohibited by statute
|
229
|
-
or regulation, such description must be sufficiently detailed for a
|
230
|
-
recipient of ordinary skill to be able to understand it.
|
231
|
-
|
232
|
-
5. Termination
|
233
|
-
--------------
|
234
|
-
|
235
|
-
5.1. The rights granted under this License will terminate automatically
|
236
|
-
if You fail to comply with any of its terms. However, if You become
|
237
|
-
compliant, then the rights granted under this License from a particular
|
238
|
-
Contributor are reinstated (a) provisionally, unless and until such
|
239
|
-
Contributor explicitly and finally terminates Your grants, and (b) on an
|
240
|
-
ongoing basis, if such Contributor fails to notify You of the
|
241
|
-
non-compliance by some reasonable means prior to 60 days after You have
|
242
|
-
come back into compliance. Moreover, Your grants from a particular
|
243
|
-
Contributor are reinstated on an ongoing basis if such Contributor
|
244
|
-
notifies You of the non-compliance by some reasonable means, this is the
|
245
|
-
first time You have received notice of non-compliance with this License
|
246
|
-
from such Contributor, and You become compliant prior to 30 days after
|
247
|
-
Your receipt of the notice.
|
248
|
-
|
249
|
-
5.2. If You initiate litigation against any entity by asserting a patent
|
250
|
-
infringement claim (excluding declaratory judgment actions,
|
251
|
-
counter-claims, and cross-claims) alleging that a Contributor Version
|
252
|
-
directly or indirectly infringes any patent, then the rights granted to
|
253
|
-
You by any and all Contributors for the Covered Software under Section
|
254
|
-
2.1 of this License shall terminate.
|
255
|
-
|
256
|
-
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
257
|
-
end user license agreements (excluding distributors and resellers) which
|
258
|
-
have been validly granted by You or Your distributors under this License
|
259
|
-
prior to termination shall survive termination.
|
260
|
-
|
261
|
-
************************************************************************
|
262
|
-
* *
|
263
|
-
* 6. Disclaimer of Warranty *
|
264
|
-
* ------------------------- *
|
265
|
-
* *
|
266
|
-
* Covered Software is provided under this License on an "as is" *
|
267
|
-
* basis, without warranty of any kind, either expressed, implied, or *
|
268
|
-
* statutory, including, without limitation, warranties that the *
|
269
|
-
* Covered Software is free of defects, merchantable, fit for a *
|
270
|
-
* particular purpose or non-infringing. The entire risk as to the *
|
271
|
-
* quality and performance of the Covered Software is with You. *
|
272
|
-
* Should any Covered Software prove defective in any respect, You *
|
273
|
-
* (not any Contributor) assume the cost of any necessary servicing, *
|
274
|
-
* repair, or correction. This disclaimer of warranty constitutes an *
|
275
|
-
* essential part of this License. No use of any Covered Software is *
|
276
|
-
* authorized under this License except under this disclaimer. *
|
277
|
-
* *
|
278
|
-
************************************************************************
|
279
|
-
|
280
|
-
************************************************************************
|
281
|
-
* *
|
282
|
-
* 7. Limitation of Liability *
|
283
|
-
* -------------------------- *
|
284
|
-
* *
|
285
|
-
* Under no circumstances and under no legal theory, whether tort *
|
286
|
-
* (including negligence), contract, or otherwise, shall any *
|
287
|
-
* Contributor, or anyone who distributes Covered Software as *
|
288
|
-
* permitted above, be liable to You for any direct, indirect, *
|
289
|
-
* special, incidental, or consequential damages of any character *
|
290
|
-
* including, without limitation, damages for lost profits, loss of *
|
291
|
-
* goodwill, work stoppage, computer failure or malfunction, or any *
|
292
|
-
* and all other commercial damages or losses, even if such party *
|
293
|
-
* shall have been informed of the possibility of such damages. This *
|
294
|
-
* limitation of liability shall not apply to liability for death or *
|
295
|
-
* personal injury resulting from such party's negligence to the *
|
296
|
-
* extent applicable law prohibits such limitation. Some *
|
297
|
-
* jurisdictions do not allow the exclusion or limitation of *
|
298
|
-
* incidental or consequential damages, so this exclusion and *
|
299
|
-
* limitation may not apply to You. *
|
300
|
-
* *
|
301
|
-
************************************************************************
|
302
|
-
|
303
|
-
8. Litigation
|
304
|
-
-------------
|
305
|
-
|
306
|
-
Any litigation relating to this License may be brought only in the
|
307
|
-
courts of a jurisdiction where the defendant maintains its principal
|
308
|
-
place of business and such litigation shall be governed by laws of that
|
309
|
-
jurisdiction, without reference to its conflict-of-law provisions.
|
310
|
-
Nothing in this Section shall prevent a party's ability to bring
|
311
|
-
cross-claims or counter-claims.
|
312
|
-
|
313
|
-
9. Miscellaneous
|
314
|
-
----------------
|
315
|
-
|
316
|
-
This License represents the complete agreement concerning the subject
|
317
|
-
matter hereof. If any provision of this License is held to be
|
318
|
-
unenforceable, such provision shall be reformed only to the extent
|
319
|
-
necessary to make it enforceable. Any law or regulation which provides
|
320
|
-
that the language of a contract shall be construed against the drafter
|
321
|
-
shall not be used to construe this License against a Contributor.
|
322
|
-
|
323
|
-
10. Versions of the License
|
324
|
-
---------------------------
|
325
|
-
|
326
|
-
10.1. New Versions
|
327
|
-
|
328
|
-
Mozilla Foundation is the license steward. Except as provided in Section
|
329
|
-
10.3, no one other than the license steward has the right to modify or
|
330
|
-
publish new versions of this License. Each version will be given a
|
331
|
-
distinguishing version number.
|
332
|
-
|
333
|
-
10.2. Effect of New Versions
|
334
|
-
|
335
|
-
You may distribute the Covered Software under the terms of the version
|
336
|
-
of the License under which You originally received the Covered Software,
|
337
|
-
or under the terms of any subsequent version published by the license
|
338
|
-
steward.
|
339
|
-
|
340
|
-
10.3. Modified Versions
|
341
|
-
|
342
|
-
If you create software not governed by this License, and you want to
|
343
|
-
create a new license for such software, you may create and use a
|
344
|
-
modified version of this License if you rename the license and remove
|
345
|
-
any references to the name of the license steward (except to note that
|
346
|
-
such modified license differs from this License).
|
347
|
-
|
348
|
-
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
349
|
-
Licenses
|
350
|
-
|
351
|
-
If You choose to distribute Source Code Form that is Incompatible With
|
352
|
-
Secondary Licenses under the terms of this version of the License, the
|
353
|
-
notice described in Exhibit B of this License must be attached.
|
354
|
-
|
355
|
-
Exhibit A - Source Code Form License Notice
|
356
|
-
-------------------------------------------
|
357
|
-
|
358
|
-
This Source Code Form is subject to the terms of the Mozilla Public
|
359
|
-
License, v. 2.0. If a copy of the MPL was not distributed with this
|
360
|
-
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
361
|
-
|
362
|
-
If it is not possible or desirable to put the notice in a particular
|
363
|
-
file, then You may include the notice in a location (such as a LICENSE
|
364
|
-
file in a relevant directory) where a recipient would be likely to look
|
365
|
-
for such a notice.
|
366
|
-
|
367
|
-
You may add additional accurate notices of copyright ownership.
|
368
|
-
|
369
|
-
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
370
|
-
---------------------------------------------------------
|
371
|
-
|
372
|
-
This Source Code Form is "Incompatible With Secondary Licenses", as
|
373
|
-
defined by the Mozilla Public License, v. 2.0.
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/cli.js
CHANGED
@@ -51,7 +51,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);m(y)}return}
|
|
51
51
|
`,`1. Your spelling of example ${Zr.default.red(`"${e}"`)} might be incorrect.
|
52
52
|
`,"2. You might not be connected to the internet or you are behind a proxy."),process.exit(1))}let o=Ms.default.resolve(t);await ky(Ms.default.dirname(o))||(Mt("The application path is not writable, please check folder permissions and try again."),Mt("It is likely you do not have write permissions for this folder."),process.exit(1));let a=Ms.default.basename(o);try{await(0,qs.mkdir)(o,{recursive:!0})}catch(p){Mt("Unable to create project directory"),Mt(p),process.exit(1)}let{isEmpty:u,conflicts:c}=Co(o);u||(Mt(`${Zr.default.dim(o)} has ${c.length} conflicting ${c.length===1?"file":"files"} - please try a different location`),process.exit(1));let l=process.cwd();process.chdir(o);let h=ld("Downloading files...");try{!r&&n?(Nt(`
|
53
53
|
Downloading files from repo ${Zr.default.cyan(e)}. This might take a moment.`),Nt(),h.start(),await(0,Oy.default)(()=>Ry(o,n),{retries:3})):(Nt(`
|
54
|
-
Downloading files${r?"":` for example ${Zr.default.cyan(e)}`}. This might take a moment.`),Nt(),h.start(),await(0,Oy.default)(()=>Ty(o,e),{retries:3}))}catch(p){throw new js(Hq(p)?p.message:String(p))}finally{h.stop()}let f=Ms.default.join(o,"package.json"),d=(0,qs.existsSync)(f),m=[];if(d){let p;try{p=(0,qs.readJsonSync)(f)}catch{}p&&m.push(...Object.keys(p.scripts||{}))}let y=t;return Ms.default.join(l,a)===t&&(y=a),{cdPath:y,hasPackageJson:d,availableScripts:m,repoInfo:n}}var Js=require("fs");var aR=ae(require("chalk"));var M1=ae(require("crypto")),yl=new Uint8Array(256),ml=yl.length;function Py(){return ml>yl.length-16&&(M1.default.randomFillSync(yl),ml=0),yl.slice(ml,ml+=16)}var Qe=[];for(let t=0;t<256;++t)Qe.push((t+256).toString(16).slice(1));function j1(t,e=0){return Qe[t[e+0]]+Qe[t[e+1]]+Qe[t[e+2]]+Qe[t[e+3]]+"-"+Qe[t[e+4]]+Qe[t[e+5]]+"-"+Qe[t[e+6]]+Qe[t[e+7]]+"-"+Qe[t[e+8]]+Qe[t[e+9]]+"-"+Qe[t[e+10]]+Qe[t[e+11]]+Qe[t[e+12]]+Qe[t[e+13]]+Qe[t[e+14]]+Qe[t[e+15]]}var q1=ae(require("crypto")),Iy={randomUUID:q1.default.randomUUID};function $q(t,e,r){if(Iy.randomUUID&&!e&&!t)return Iy.randomUUID();t=t||{};let i=t.random||(t.rng||Py)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){r=r||0;for(let n=0;n<16;++n)e[r+n]=i[n];return e}return j1(i)}var dn=$q;var Re;(function(t){t.assertEqual=n=>n;function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let s={};for(let o of n)s[o]=o;return s},t.getValidEnumValues=n=>{let s=t.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(let a of s)o[a]=n[a];return t.objectValues(o)},t.objectValues=n=>t.objectKeys(n).map(function(s){return n[s]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let s=[];for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&s.push(o);return s},t.find=(n,s)=>{for(let o of n)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,s=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(Re||(Re={}));var By;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(By||(By={}));var oe=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oi=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map!="undefined"&&t instanceof Map?oe.map:typeof Set!="undefined"&&t instanceof Set?oe.set:typeof Date!="undefined"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},ne=Re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),zq=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Tt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},i={_errors:[]},n=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)i._errors.push(r(o));else{let a=i,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,Re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Tt.create=t=>new Tt(t);var sa=(t,e)=>{let r;switch(t.code){case ne.invalid_type:t.received===oe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ne.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Re.jsonStringifyReplacer)}`;break;case ne.unrecognized_keys:r=`Unrecognized key(s) in object: ${Re.joinValues(t.keys,", ")}`;break;case ne.invalid_union:r="Invalid input";break;case ne.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Re.joinValues(t.options)}`;break;case ne.invalid_enum_value:r=`Invalid enum value. Expected ${Re.joinValues(t.options)}, received '${t.received}'`;break;case ne.invalid_arguments:r="Invalid function arguments";break;case ne.invalid_return_type:r="Invalid function return type";break;case ne.invalid_date:r="Invalid date";break;case ne.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Re.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case ne.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case ne.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case ne.custom:r="Invalid input";break;case ne.invalid_intersection_types:r="Intersection results could not be merged";break;case ne.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case ne.not_finite:r="Number must be finite";break;default:r=e.defaultError,Re.assertNever(t)}return{message:r}},$1=sa;function Gq(t){$1=t}function _l(){return $1}var bl=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,s=[...r,...n.path||[]],o={...n,path:s},a="",u=i.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...n,path:s,message:n.message||a}},Wq=[];function ce(t,e){let r=bl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_l(),sa].filter(i=>!!i)});t.common.issues.push(r)}var Ze=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return be;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return Ze.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:s,value:o}=n;if(s.status==="aborted"||o.status==="aborted")return be;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value!="undefined"||n.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}},be=Object.freeze({status:"aborted"}),z1=t=>({status:"dirty",value:t}),ft=t=>({status:"valid",value:t}),Ny=t=>t.status==="aborted",My=t=>t.status==="dirty",oa=t=>t.status==="valid",El=t=>typeof Promise!="undefined"&&t instanceof Promise,me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(me||(me={}));var Yt=class{constructor(e,r,i,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},U1=(t,e)=>{if(oa(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Tt(t.common.issues);return this._error=r,this._error}}};function Ee(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data=="undefined"?{message:i!=null?i:a.defaultError}:{message:r!=null?r:a.defaultError},description:n}}var ve=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Oi(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ze,ctx:{common:e.parent.common,data:e.data,parsedType:Oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(El(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r==null?void 0:r.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oi(e)},s=this._parseSync({data:e,path:n.path,parent:n});return U1(n,s)}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oi(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(El(n)?n:Promise.resolve(n));return U1(i,s)}refine(e,r){let i=n=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,s)=>{let o=e(n),a=()=>s.addIssue({code:ne.custom,...i(n)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new Ot({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return rr.create(this,this._def)}nullable(){return ei.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kt.create(this,this._def)}promise(){return Ii.create(this,this._def)}or(e){return gn.create([this,e],this._def)}and(e){return _n.create(this,e,this._def)}transform(e){return new Ot({...Ee(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Sn({...Ee(this._def),innerType:this,defaultValue:r,typeName:ge.ZodDefault})}brand(){return new vl({typeName:ge.ZodBranded,type:this,...Ee(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ws({...Ee(this._def),innerType:this,catchValue:r,typeName:ge.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return xn.create(this,e)}readonly(){return Ys.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Vq=/^c[^\s-]{8,}$/i,Yq=/^[a-z][a-z0-9]*$/,Kq=/^[0-9A-HJKMNP-TV-Z]{26}$/,Zq=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Jq=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ly,Qq=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,eU=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,tU=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function rU(t,e){return!!((e==="v4"||!e)&&Qq.test(t)||(e==="v6"||!e)&&eU.test(t))}var Rt=class extends ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){let s=this._getOrReturnCtx(e);return ce(s,{code:ne.invalid_type,expected:oe.string,received:s.parsedType}),be}let i=new Ze,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(n=this._getOrReturnCtx(e,n),o?ce(n,{code:ne.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ce(n,{code:ne.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")Jq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"email",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Ly||(Ly=new RegExp(Xq,"u")),Ly.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"emoji",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")Zq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"uuid",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Vq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"cuid",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")Yq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"cuid2",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")Kq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"ulid",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),ce(n,{validation:"url",code:ne.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"regex",code:ne.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?tU(s).test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="ip"?rU(e.data,s.version)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"ip",code:ne.invalid_string,message:s.message}),i.dirty()):Re.assertNever(s);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(n=>e.test(n),{validation:r,code:ne.invalid_string,...me.errToObj(i)})}_addCheck(e){return new Rt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...me.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...me.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...me.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...me.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...me.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...me.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...me.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...me.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...me.errToObj(r)})}nonempty(e){return this.min(1,me.errToObj(e))}trim(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Rt.create=t=>{var e;return new Rt({checks:[],typeName:ge.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function iU(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,s=parseInt(t.toFixed(n).replace(".","")),o=parseInt(e.toFixed(n).replace(".",""));return s%o/Math.pow(10,n)}var Er=class extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==oe.number){let s=this._getOrReturnCtx(e);return ce(s,{code:ne.invalid_type,expected:oe.number,received:s.parsedType}),be}let i,n=new Ze;for(let s of this._def.checks)s.kind==="int"?Re.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?iU(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.not_finite,message:s.message}),n.dirty()):Re.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,i,n){return new Er({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:me.toString(n)}]})}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Re.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Er.create=t=>new Er({checks:[],typeName:ge.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});var vr=class extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==oe.bigint){let s=this._getOrReturnCtx(e);return ce(s,{code:ne.invalid_type,expected:oe.bigint,received:s.parsedType}),be}let i,n=new Ze;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):Re.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,i,n){return new vr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:me.toString(n)}]})}_addCheck(e){return new vr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};vr.create=t=>{var e;return new vr({checks:[],typeName:ge.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};var pn=class extends ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.boolean,received:i.parsedType}),be}return ft(e.data)}};pn.create=t=>new pn({typeName:ge.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});var Xr=class extends ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){let s=this._getOrReturnCtx(e);return ce(s,{code:ne.invalid_type,expected:oe.date,received:s.parsedType}),be}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return ce(s,{code:ne.invalid_date}),be}let i=new Ze,n;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Re.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Xr({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:me.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:me.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Xr.create=t=>new Xr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ge.ZodDate,...Ee(t)});var Hs=class extends ve{_parse(e){if(this._getType(e)!==oe.symbol){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.symbol,received:i.parsedType}),be}return ft(e.data)}};Hs.create=t=>new Hs({typeName:ge.ZodSymbol,...Ee(t)});var mn=class extends ve{_parse(e){if(this._getType(e)!==oe.undefined){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.undefined,received:i.parsedType}),be}return ft(e.data)}};mn.create=t=>new mn({typeName:ge.ZodUndefined,...Ee(t)});var yn=class extends ve{_parse(e){if(this._getType(e)!==oe.null){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.null,received:i.parsedType}),be}return ft(e.data)}};yn.create=t=>new yn({typeName:ge.ZodNull,...Ee(t)});var Pi=class extends ve{constructor(){super(...arguments),this._any=!0}_parse(e){return ft(e.data)}};Pi.create=t=>new Pi({typeName:ge.ZodAny,...Ee(t)});var Jr=class extends ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ft(e.data)}};Jr.create=t=>new Jr({typeName:ge.ZodUnknown,...Ee(t)});var ir=class extends ve{_parse(e){let r=this._getOrReturnCtx(e);return ce(r,{code:ne.invalid_type,expected:oe.never,received:r.parsedType}),be}};ir.create=t=>new ir({typeName:ge.ZodNever,...Ee(t)});var $s=class extends ve{_parse(e){if(this._getType(e)!==oe.undefined){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.void,received:i.parsedType}),be}return ft(e.data)}};$s.create=t=>new $s({typeName:ge.ZodVoid,...Ee(t)});var kt=class extends ve{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==oe.array)return ce(r,{code:ne.invalid_type,expected:oe.array,received:r.parsedType}),be;if(n.exactLength!==null){let o=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(o||a)&&(ce(r,{code:o?ne.too_big:ne.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(ce(r,{code:ne.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(ce(r,{code:ne.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>n.type._parseAsync(new Yt(r,o,r.path,a)))).then(o=>Ze.mergeArray(i,o));let s=[...r.data].map((o,a)=>n.type._parseSync(new Yt(r,o,r.path,a)));return Ze.mergeArray(i,s)}get element(){return this._def.type}min(e,r){return new kt({...this._def,minLength:{value:e,message:me.toString(r)}})}max(e,r){return new kt({...this._def,maxLength:{value:e,message:me.toString(r)}})}length(e,r){return new kt({...this._def,exactLength:{value:e,message:me.toString(r)}})}nonempty(e){return this.min(1,e)}};kt.create=(t,e)=>new kt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...Ee(e)});function Us(t){if(t instanceof Ie){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=rr.create(Us(i))}return new Ie({...t._def,shape:()=>e})}else return t instanceof kt?new kt({...t._def,type:Us(t.element)}):t instanceof rr?rr.create(Us(t.unwrap())):t instanceof ei?ei.create(Us(t.unwrap())):t instanceof Kt?Kt.create(t.items.map(e=>Us(e))):t}var Ie=class extends ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Re.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==oe.object){let c=this._getOrReturnCtx(e);return ce(c,{code:ne.invalid_type,expected:oe.object,received:c.parsedType}),be}let{status:i,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ir&&this._def.unknownKeys==="strip"))for(let c in n.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=s[c],h=n.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Yt(n,h,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof ir){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:n.data[l]}});else if(c==="strict")a.length>0&&(ce(n,{code:ne.unrecognized_keys,keys:a}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let h=n.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Yt(n,h,n.path,l)),alwaysSet:l in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of u){let h=await l.key;c.push({key:h,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>Ze.mergeObjectSync(i,c)):Ze.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return me.errToObj,new Ie({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{var n,s,o,a;let u=(o=(s=(n=this._def).errorMap)===null||s===void 0?void 0:s.call(n,r,i).message)!==null&&o!==void 0?o:i.defaultError;return r.code==="unrecognized_keys"?{message:(a=me.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Ie({...this._def,unknownKeys:"strip"})}passthrough(){return new Ie({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ie({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ie({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ge.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Ie({...this._def,catchall:e})}pick(e){let r={};return Re.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(r[i]=this.shape[i])}),new Ie({...this._def,shape:()=>r})}omit(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{e[i]||(r[i]=this.shape[i])}),new Ie({...this._def,shape:()=>r})}deepPartial(){return Us(this)}partial(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];e&&!e[i]?r[i]=n:r[i]=n.optional()}),new Ie({...this._def,shape:()=>r})}required(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])r[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof rr;)s=s._def.innerType;r[i]=s}}),new Ie({...this._def,shape:()=>r})}keyof(){return G1(Re.objectKeys(this.shape))}};Ie.create=(t,e)=>new Ie({shape:()=>t,unknownKeys:"strip",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});Ie.strictCreate=(t,e)=>new Ie({shape:()=>t,unknownKeys:"strict",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});Ie.lazycreate=(t,e)=>new Ie({shape:t,unknownKeys:"strip",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});var gn=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Tt(a.ctx.common.issues));return ce(r,{code:ne.invalid_union,unionErrors:o}),be}if(r.common.async)return Promise.all(i.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(n);{let s,o=[];for(let u of i){let c={...r,common:{...r.common,issues:[]},parent:null},l=u._parseSync({data:r.data,path:r.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(u=>new Tt(u));return ce(r,{code:ne.invalid_union,unionErrors:a}),be}}get options(){return this._def.options}};gn.create=(t,e)=>new gn({options:t,typeName:ge.ZodUnion,...Ee(e)});var gl=t=>t instanceof En?gl(t.schema):t instanceof Ot?gl(t.innerType()):t instanceof vn?[t.value]:t instanceof wr?t.options:t instanceof wn?Object.keys(t.enum):t instanceof Sn?gl(t._def.innerType):t instanceof mn?[void 0]:t instanceof yn?[null]:null,zs=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.object)return ce(r,{code:ne.invalid_type,expected:oe.object,received:r.parsedType}),be;let i=this.discriminator,n=r.data[i],s=this.optionsMap.get(n);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ce(r,{code:ne.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let n=new Map;for(let s of r){let o=gl(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,s)}}return new zs({typeName:ge.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...Ee(i)})}};function jy(t,e){let r=Oi(t),i=Oi(e);if(t===e)return{valid:!0,data:t};if(r===oe.object&&i===oe.object){let n=Re.objectKeys(e),s=Re.objectKeys(t).filter(a=>n.indexOf(a)!==-1),o={...t,...e};for(let a of s){let u=jy(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===oe.array&&i===oe.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],u=jy(o,a);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return r===oe.date&&i===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var _n=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(s,o)=>{if(Ny(s)||Ny(o))return be;let a=jy(s.value,o.value);return a.valid?((My(s)||My(o))&&r.dirty(),{status:r.value,value:a.data}):(ce(i,{code:ne.invalid_intersection_types}),be)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>n(s,o)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};_n.create=(t,e,r)=>new _n({left:t,right:e,typeName:ge.ZodIntersection,...Ee(r)});var Kt=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.array)return ce(i,{code:ne.invalid_type,expected:oe.array,received:i.parsedType}),be;if(i.data.length<this._def.items.length)return ce(i,{code:ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&i.data.length>this._def.items.length&&(ce(i,{code:ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...i.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new Yt(i,o,i.path,a)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>Ze.mergeArray(r,o)):Ze.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Kt({...this._def,rest:e})}};Kt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Kt({items:t,typeName:ge.ZodTuple,rest:null,...Ee(e)})};var bn=class extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.object)return ce(i,{code:ne.invalid_type,expected:oe.object,received:i.parsedType}),be;let n=[],s=this._def.keyType,o=this._def.valueType;for(let a in i.data)n.push({key:s._parse(new Yt(i,a,i.path,a)),value:o._parse(new Yt(i,i.data[a],i.path,a))});return i.common.async?Ze.mergeObjectAsync(r,n):Ze.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof ve?new bn({keyType:e,valueType:r,typeName:ge.ZodRecord,...Ee(i)}):new bn({keyType:Rt.create(),valueType:e,typeName:ge.ZodRecord,...Ee(r)})}},Gs=class extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.map)return ce(i,{code:ne.invalid_type,expected:oe.map,received:i.parsedType}),be;let n=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([a,u],c)=>({key:n._parse(new Yt(i,a,i.path,[c,"key"])),value:s._parse(new Yt(i,u,i.path,[c,"value"]))}));if(i.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return be;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return be;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};Gs.create=(t,e,r)=>new Gs({valueType:e,keyType:t,typeName:ge.ZodMap,...Ee(r)});var Qr=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.set)return ce(i,{code:ne.invalid_type,expected:oe.set,received:i.parsedType}),be;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(ce(i,{code:ne.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(ce(i,{code:ne.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let s=this._def.valueType;function o(u){let c=new Set;for(let l of u){if(l.status==="aborted")return be;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...i.data.values()].map((u,c)=>s._parse(new Yt(i,u,i.path,c)));return i.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new Qr({...this._def,minSize:{value:e,message:me.toString(r)}})}max(e,r){return new Qr({...this._def,maxSize:{value:e,message:me.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({valueType:t,minSize:null,maxSize:null,typeName:ge.ZodSet,...Ee(e)});var Fi=class extends ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.function)return ce(r,{code:ne.invalid_type,expected:oe.function,received:r.parsedType}),be;function i(a,u){return bl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_l(),sa].filter(c=>!!c),issueData:{code:ne.invalid_arguments,argumentsError:u}})}function n(a,u){return bl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_l(),sa].filter(c=>!!c),issueData:{code:ne.invalid_return_type,returnTypeError:u}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Ii){let a=this;return ft(async function(...u){let c=new Tt([]),l=await a._def.args.parseAsync(u,s).catch(d=>{throw c.addIssue(i(u,d)),c}),h=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(h,s).catch(d=>{throw c.addIssue(n(h,d)),c})})}else{let a=this;return ft(function(...u){let c=a._def.args.safeParse(u,s);if(!c.success)throw new Tt([i(u,c.error)]);let l=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(l,s);if(!h.success)throw new Tt([n(l,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Fi({...this._def,args:Kt.create(e).rest(Jr.create())})}returns(e){return new Fi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new Fi({args:e||Kt.create([]).rest(Jr.create()),returns:r||Jr.create(),typeName:ge.ZodFunction,...Ee(i)})}},En=class extends ve{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};En.create=(t,e)=>new En({getter:t,typeName:ge.ZodLazy,...Ee(e)});var vn=class extends ve{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ce(r,{received:r.data,code:ne.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}};vn.create=(t,e)=>new vn({value:t,typeName:ge.ZodLiteral,...Ee(e)});function G1(t,e){return new wr({values:t,typeName:ge.ZodEnum,...Ee(e)})}var wr=class extends ve{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return ce(r,{expected:Re.joinValues(i),received:r.parsedType,code:ne.invalid_type}),be}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),i=this._def.values;return ce(r,{received:r.data,code:ne.invalid_enum_value,options:i}),be}return ft(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return wr.create(e)}exclude(e){return wr.create(this.options.filter(r=>!e.includes(r)))}};wr.create=G1;var wn=class extends ve{_parse(e){let r=Re.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==oe.string&&i.parsedType!==oe.number){let n=Re.objectValues(r);return ce(i,{expected:Re.joinValues(n),received:i.parsedType,code:ne.invalid_type}),be}if(r.indexOf(e.data)===-1){let n=Re.objectValues(r);return ce(i,{received:i.data,code:ne.invalid_enum_value,options:n}),be}return ft(e.data)}get enum(){return this._def.values}};wn.create=(t,e)=>new wn({values:t,typeName:ge.ZodNativeEnum,...Ee(e)});var Ii=class extends ve{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.promise&&r.common.async===!1)return ce(r,{code:ne.invalid_type,expected:oe.promise,received:r.parsedType}),be;let i=r.parsedType===oe.promise?r.data:Promise.resolve(r.data);return ft(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ii.create=(t,e)=>new Ii({type:t,typeName:ge.ZodPromise,...Ee(e)});var Ot=class extends ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:o=>{ce(i,o),o.fatal?r.abort():r.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let o=n.transform(i.data,s);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:i.path,parent:i})):this._def.schema._parseSync({data:o,path:i.path,parent:i})}if(n.type==="refinement"){let o=a=>{let u=n.refinement(a,s);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?be:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?be:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!oa(o))return o;let a=n.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>oa(o)?Promise.resolve(n.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Re.assertNever(n)}};Ot.create=(t,e,r)=>new Ot({schema:t,typeName:ge.ZodEffects,effect:e,...Ee(r)});Ot.createWithPreprocess=(t,e,r)=>new Ot({schema:e,effect:{type:"preprocess",transform:t},typeName:ge.ZodEffects,...Ee(r)});var rr=class extends ve{_parse(e){return this._getType(e)===oe.undefined?ft(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};rr.create=(t,e)=>new rr({innerType:t,typeName:ge.ZodOptional,...Ee(e)});var ei=class extends ve{_parse(e){return this._getType(e)===oe.null?ft(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ei.create=(t,e)=>new ei({innerType:t,typeName:ge.ZodNullable,...Ee(e)});var Sn=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===oe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Sn.create=(t,e)=>new Sn({innerType:t,typeName:ge.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});var Ws=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return El(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Tt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Tt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Ws.create=(t,e)=>new Ws({innerType:t,typeName:ge.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});var Vs=class extends ve{_parse(e){if(this._getType(e)!==oe.nan){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.nan,received:i.parsedType}),be}return{status:"valid",value:e.data}}};Vs.create=t=>new Vs({typeName:ge.ZodNaN,...Ee(t)});var nU=Symbol("zod_brand"),vl=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},xn=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?be:s.status==="dirty"?(r.dirty(),z1(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?be:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,r){return new xn({in:e,out:r,typeName:ge.ZodPipeline})}},Ys=class extends ve{_parse(e){let r=this._def.innerType._parse(e);return oa(r)&&(r.value=Object.freeze(r.value)),r}};Ys.create=(t,e)=>new Ys({innerType:t,typeName:ge.ZodReadonly,...Ee(e)});var W1=(t,e={},r)=>t?Pi.create().superRefine((i,n)=>{var s,o;if(!t(i)){let a=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,u=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...c,fatal:u})}}):Pi.create(),sU={object:Ie.lazycreate},ge;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ge||(ge={}));var oU=(t,e={message:`Input not instance of ${t.name}`})=>W1(r=>r instanceof t,e),V1=Rt.create,Y1=Er.create,aU=Vs.create,uU=vr.create,K1=pn.create,cU=Xr.create,lU=Hs.create,hU=mn.create,fU=yn.create,dU=Pi.create,pU=Jr.create,mU=ir.create,yU=$s.create,gU=kt.create,_U=Ie.create,bU=Ie.strictCreate,EU=gn.create,vU=zs.create,wU=_n.create,SU=Kt.create,xU=bn.create,DU=Gs.create,AU=Qr.create,CU=Fi.create,RU=En.create,TU=vn.create,kU=wr.create,OU=wn.create,FU=Ii.create,H1=Ot.create,PU=rr.create,IU=ei.create,LU=Ot.createWithPreprocess,BU=xn.create,NU=()=>V1().optional(),MU=()=>Y1().optional(),jU=()=>K1().optional(),qU={string:t=>Rt.create({...t,coerce:!0}),number:t=>Er.create({...t,coerce:!0}),boolean:t=>pn.create({...t,coerce:!0}),bigint:t=>vr.create({...t,coerce:!0}),date:t=>Xr.create({...t,coerce:!0})},UU=be,Ks=Object.freeze({__proto__:null,defaultErrorMap:sa,setErrorMap:Gq,getErrorMap:_l,makeIssue:bl,EMPTY_PATH:Wq,addIssueToContext:ce,ParseStatus:Ze,INVALID:be,DIRTY:z1,OK:ft,isAborted:Ny,isDirty:My,isValid:oa,isAsync:El,get util(){return Re},get objectUtil(){return By},ZodParsedType:oe,getParsedType:Oi,ZodType:ve,ZodString:Rt,ZodNumber:Er,ZodBigInt:vr,ZodBoolean:pn,ZodDate:Xr,ZodSymbol:Hs,ZodUndefined:mn,ZodNull:yn,ZodAny:Pi,ZodUnknown:Jr,ZodNever:ir,ZodVoid:$s,ZodArray:kt,ZodObject:Ie,ZodUnion:gn,ZodDiscriminatedUnion:zs,ZodIntersection:_n,ZodTuple:Kt,ZodRecord:bn,ZodMap:Gs,ZodSet:Qr,ZodFunction:Fi,ZodLazy:En,ZodLiteral:vn,ZodEnum:wr,ZodNativeEnum:wn,ZodPromise:Ii,ZodEffects:Ot,ZodTransformer:Ot,ZodOptional:rr,ZodNullable:ei,ZodDefault:Sn,ZodCatch:Ws,ZodNaN:Vs,BRAND:nU,ZodBranded:vl,ZodPipeline:xn,ZodReadonly:Ys,custom:W1,Schema:ve,ZodSchema:ve,late:sU,get ZodFirstPartyTypeKind(){return ge},coerce:qU,any:dU,array:gU,bigint:uU,boolean:K1,date:cU,discriminatedUnion:vU,effect:H1,enum:kU,function:CU,instanceof:oU,intersection:wU,lazy:RU,literal:TU,map:DU,nan:aU,nativeEnum:OU,never:mU,null:fU,nullable:IU,number:Y1,object:_U,oboolean:jU,onumber:MU,optional:PU,ostring:NU,pipeline:BU,preprocess:LU,promise:FU,record:xU,set:AU,strictObject:bU,string:V1,symbol:lU,transformer:H1,tuple:SU,undefined:hU,union:EU,unknown:pU,void:yU,NEVER:UU,ZodIssueCode:ne,quotelessJson:zq,ZodError:Tt});var Gy=ae(require("os")),nR=ae(require("crypto")),sR=ae(require("path")),oR=ae(iR());function JU(t){let e=process.version,r=Gy.default.type(),i=Gy.default.arch();return`${t.name} ${t.version} ${e} ${r} ${i}`}async function XU(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,oR.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return sR.default.join(t,"turborepo","telemetry.json")}function QU({input:t,salt:e}){return nR.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var Zs={buildUserAgent:JU,oneWayHashWithSalt:QU,defaultConfigPath:XU};var eH="TURBO_TELEMETRY_DEBUG",tH="TURBO_TELEMETRY_DISABLED",rH="TURBO_TELEMETRY_MESSAGE_DISABLED",iH="DO_NOT_TRACK",nH=Ks.object({telemetry_enabled:Ks.boolean(),telemetry_id:Ks.string(),telemetry_salt:Ks.string(),telemetry_alerted:Ks.string().optional()}),Et=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,Js.readFileSync)(e,"utf-8"),i=JSON.parse(r),n=Et.validateConfig(i);return new Et({configPath:e,config:n})}catch{return Et.tryRemove({configPath:e})?Et.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await Zs.defaultConfigPath();return Et.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return nH.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=dn(),i=dn(),n=Zs.oneWayHashWithSalt({input:r,salt:i}),s=new Et({configPath:e,config:{telemetry_enabled:!0,telemetry_id:n,telemetry_salt:i}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,Js.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,Js.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[iH]||"0",r=process.env[tH]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[rH]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(ue.log(),ue.bold("Attention:"),ue.grey("Turborepo now collects completely anonymous telemetry regarding usage."),ue.grey("This information is used to shape the Turborepo roadmap and prioritize features."),ue.grey("You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:"),ue.underline(aR.default.grey("https://turbo.build/repo/docs/telemetry"))),this.alertShown()}enable(){this.config.telemetry_enabled=!0,this.tryWrite()}disable(){this.config.telemetry_enabled=!1,this.tryWrite()}alertShown(){return this.hasSeenAlert()||(this.config.telemetry_alerted=new Date().toISOString(),this.tryWrite()),!0}oneWayHash(e){return Zs.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[eH]||"0";return e==="1"||e.toLowerCase()==="true"}};var uR=ae(Sy());var sH=20,oH="/api/turborepo/v1/events",Dn=class{constructor({api:e,packageInfo:r,config:i,opts:n}){this.batchSize=sH;this.timeout=250;this.sessionId=dn();this.eventBatches=[];this.events=[];let s=new URL(oH,e);this.api=s.toString(),this.packageInfo=r,this.config=i,n!=null&&n.timeout&&(this.timeout=n.timeout),n!=null&&n.batchSize&&(this.batchSize=n.batchSize)}hasPendingEvents(){return this.events.length!==0}async waitForFlush(){await Promise.all(this.eventBatches)}flushEvents(){let e=this.events.splice(0,this.batchSize);this.config.isEnabled()&&this.eventBatches.push(uR.default.post(this.api,{timeout:this.timeout,json:e,headers:{"x-turbo-telemetry-id":this.config.id,"x-turbo-session-id":this.sessionId,"User-Agent":Zs.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:i,isSensitive:n}){let s={id:dn(),key:e,value:n?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:i};return Et.isDebug()&&(ue.log(),ue.bold("[telemetry event]"),ue.dimmed(JSON.stringify(s,null,2)),ue.log()),this.config.isEnabled()&&(this.events.push({package:s}),this.events.length>=this.batchSize&&this.flushEvents()),s}async close(){for(;this.hasPendingEvents();)this.flushEvents();try{await this.waitForFlush()}catch{}}trackCliOption({option:e,value:r}){return this.track({key:`option:${e}`,value:r})}trackCliArgument({argument:e,value:r}){return this.track({key:`argument:${e}`,value:r})}trackCliCommand({command:e,value:r}){return this.track({key:`command:${e}`,value:r})}trackCommandStatus({command:e,status:r}){return this.trackCliCommand({command:e,value:r})}trackCommandWarning(e){return this.track({key:"warning",value:e})}trackCommandError(e){return this.track({key:"error",value:e})}};var aa=class extends Dn{trackOptionExample(e){if(e)return this.trackCliOption({option:"example",value:e})}trackOptionPackageManager(e){if(e)return this.trackCliOption({option:"package_manager",value:e})}trackOptionSkipInstall(e){if(e)return this.trackCliOption({option:"skip_install",value:e.toString()})}trackOptionSkipTransforms(e){if(e)return this.trackCliOption({option:"skip_transforms",value:e.toString()})}trackOptionTurboVersion(e){if(e)return this.trackCliOption({option:"turbo_version",value:e})}trackOptionExamplePath(e){if(e)return this.trackCliOption({option:"example_path",value:e})}trackArgumentDirectory(e){if(e)return this.trackCliArgument({argument:"project_directory",value:"provided"})}trackArgumentPackageManager(e){if(e)return this.trackCliArgument({argument:"package_manager",value:e})}};var dR=ae(fR());var uH=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],ua=class extends Dn{trackCI(){var e;return this.track({key:"ci",value:(e=dR.name)!=null?e:"unknown"})}trackArgumentWorkspace(e){if(e)return this.trackCliArgument({argument:"workspace",value:"provided"})}trackOptionTask(e){if(e)return this.trackCliOption({option:"task",value:uH.includes(e)?e:"other"})}trackOptionFallback(e){if(e)return this.trackCliOption({option:"fallback",value:e})}trackOptionDirectory(e){if(e)return this.trackCliOption({option:"directory",value:"custom"})}trackOptionMaxBuffer(e){if(e!==void 0)return this.trackCliOption({option:"max_buffer",value:e.toString()})}};var cH={"create-turbo":aa,"turbo-ignore":ua},lH="https://telemetry.vercel.com";async function Wy({packageInfo:t,opts:e}){let r=cH[t.name],i=await Et.fromDefaultConfig();return i?(i.showAlert(),{telemetry:new r({api:lH,packageInfo:t,config:i,opts:e})}):{telemetry:void 0}}var ca=ae(require("chalk"));var pR=require("commander"),mR="status",hH=["enable","disable",mR];function fH(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();ue.log(`Status: ${e?ca.default.bold(ca.default.green("Enabled")):ca.default.bold(ca.default.red("Disabled"))}`),ue.log(),e?ue.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):ue.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),ue.log("Learn more: https://turbo.build/repo/docs/telemetry")}function dH(t,e){if(!e.telemetry){ue.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),ue.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),ue.bold("Success!")),ue.log(),fH(e)}function Vy(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new pR.Argument("[action]","Action to perform").choices(hH).default(mR)).action(dH)}var FT=require("proxy-agent");var An={name:"create-turbo",version:"1.13.4-canary.4",description:"Create a new Turborepo",homepage:"https://turbo.build/repo",license:"MPL-2.0",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turbo/issues"},bin:{"create-turbo":"dist/cli.js"},scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{chalk:"4.1.2",commander:"^11.0.0","fs-extra":"^11.1.1",inquirer:"^8.0.0","proxy-agent":"^6.2.2",rimraf:"^3.0.2",semver:"^7.3.8","update-check":"^1.5.4"},devDependencies:{"@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"^9.0.13","@types/inquirer":"^7.3.1","@types/jest":"^27.4.0","@types/node":"^18.17.2","@types/rimraf":"^3.0.2","@types/semver":"^7.3.9",jest:"^27.4.3","ts-jest":"^27.1.1",tsup:"^6.7.0",typescript:"^5.2.2"},files:["dist"]};var yR=ae(require("chalk")),gR=ae(require("update-check"));var mH=(0,gR.default)(An).catch(()=>null);async function Yy(){try{let t=await mH;t!=null&&t.latest&&(ue.log(),ue.log(yR.default.yellow.bold("A new version of `create-turbo` is available!")),ue.log()),process.exit()}catch{}}var ba=ae(require("path")),et=ae(require("chalk"));var Ni=ae(require("chalk"),1),PR=ae(vu(),1),IR=ae(xu(),1),jR=ae(require("os"),1),qR=ae(is(),1),$W=require("fs-extra");var YW=ae(ou(),1),ZW=require("fs-extra"),XW=require("fs-extra"),eV=require("chalk"),HR=require("stream"),$R=require("util"),nV=require("fs-extra"),uV=require("chalk"),lV=require("fs-extra"),Cn=ae(require("path"),1),dt=require("fs-extra"),zR=ae(is(),1),GR=ae(require("path"),1),WR=require("fs-extra"),VR=ae(require("chalk"),1),ri=ae(require("path"),1),YR=ae(is(),1),It=require("fs-extra"),KR=ae(ou(),1);var ha=ae(require("path"),1),xr=require("fs-extra"),ro=ae(require("path"),1),Dr=require("fs-extra"),fa=ae(require("path"),1),Ar=require("fs-extra"),Pt=ae(require("chalk"),1),tT=ae(xu(),1),rT=ae(is(),1),iT=ae(vu(),1),nT=require("semver"),sT=ae(require("chalk"),1),yH=Object.create,Jy=Object.defineProperty,gH=Object.getOwnPropertyDescriptor,_H=Object.getOwnPropertyNames,bH=Object.getPrototypeOf,EH=Object.prototype.hasOwnProperty,ye=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),vH=(t,e)=>()=>(t&&(e=t(t=0)),e),de=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),wH=(t,e)=>{for(var r in e)Jy(t,r,{get:e[r],enumerable:!0})},SH=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _H(e))!EH.call(t,n)&&n!==r&&Jy(t,n,{get:()=>e[n],enumerable:!(i=gH(e,n))||i.enumerable});return t},Al=(t,e,r)=>(r=t!=null?yH(bH(t)):{},SH(e||!t||!t.__esModule?Jy(r,"default",{value:t,enumerable:!0}):r,t)),ee=vH(()=>{}),xH=de((t,e)=>{ee();function r(i){return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,r(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),DH=de((t,e)=>{ee();var r=xH().default;function i(){"use strict";e.exports=i=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var n,s={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(q,g,_){q[g]=_.value},c=typeof Symbol=="function"?Symbol:{},l=c.iterator||"@@iterator",h=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function d(q,g,_){return Object.defineProperty(q,g,{value:_,enumerable:!0,configurable:!0,writable:!0}),q[g]}try{d({},"")}catch{d=function(q,g,_){return q[g]=_}}function m(q,g,_,E){var R=g&&g.prototype instanceof T?g:T,x=Object.create(R.prototype),H=new z(E||[]);return u(x,"_invoke",{value:te(q,_,H)}),x}function y(q,g,_){try{return{type:"normal",arg:q.call(g,_)}}catch(E){return{type:"throw",arg:E}}}s.wrap=m;var p="suspendedStart",v="suspendedYield",C="executing",F="completed",P={};function T(){}function M(){}function S(){}var D={};d(D,l,function(){return this});var U=Object.getPrototypeOf,W=U&&U(U(Z([])));W&&W!==o&&a.call(W,l)&&(D=W);var N=S.prototype=T.prototype=Object.create(D);function V(q){["next","throw","return"].forEach(function(g){d(q,g,function(_){return this._invoke(g,_)})})}function Q(q,g){function _(R,x,H,$){var ie=y(q[R],q,x);if(ie.type!=="throw"){var Y=ie.arg,he=Y.value;return he&&r(he)=="object"&&a.call(he,"__await")?g.resolve(he.__await).then(function(J){_("next",J,H,$)},function(J){_("throw",J,H,$)}):g.resolve(he).then(function(J){Y.value=J,H(Y)},function(J){return _("throw",J,H,$)})}$(ie.arg)}var E;u(this,"_invoke",{value:function(R,x){function H(){return new g(function($,ie){_(R,x,$,ie)})}return E=E?E.then(H,H):H()}})}function te(q,g,_){var E=p;return function(R,x){if(E===C)throw new Error("Generator is already running");if(E===F){if(R==="throw")throw x;return{value:n,done:!0}}for(_.method=R,_.arg=x;;){var H=_.delegate;if(H){var $=j(H,_);if($){if($===P)continue;return $}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(E===p)throw E=F,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);E=C;var ie=y(q,g,_);if(ie.type==="normal"){if(E=_.done?F:v,ie.arg===P)continue;return{value:ie.arg,done:_.done}}ie.type==="throw"&&(E=F,_.method="throw",_.arg=ie.arg)}}}function j(q,g){var _=g.method,E=q.iterator[_];if(E===n)return g.delegate=null,_==="throw"&&q.iterator.return&&(g.method="return",g.arg=n,j(q,g),g.method==="throw")||_!=="return"&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+_+"' method")),P;var R=y(E,q.iterator,g.arg);if(R.type==="throw")return g.method="throw",g.arg=R.arg,g.delegate=null,P;var x=R.arg;return x?x.done?(g[q.resultName]=x.value,g.next=q.nextLoc,g.method!=="return"&&(g.method="next",g.arg=n),g.delegate=null,P):x:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,P)}function I(q){var g={tryLoc:q[0]};1 in q&&(g.catchLoc=q[1]),2 in q&&(g.finallyLoc=q[2],g.afterLoc=q[3]),this.tryEntries.push(g)}function L(q){var g=q.completion||{};g.type="normal",delete g.arg,q.completion=g}function z(q){this.tryEntries=[{tryLoc:"root"}],q.forEach(I,this),this.reset(!0)}function Z(q){if(q||q===""){var g=q[l];if(g)return g.call(q);if(typeof q.next=="function")return q;if(!isNaN(q.length)){var _=-1,E=function R(){for(;++_<q.length;)if(a.call(q,_))return R.value=q[_],R.done=!1,R;return R.value=n,R.done=!0,R};return E.next=E}}throw new TypeError(r(q)+" is not iterable")}return M.prototype=S,u(N,"constructor",{value:S,configurable:!0}),u(S,"constructor",{value:M,configurable:!0}),M.displayName=d(S,f,"GeneratorFunction"),s.isGeneratorFunction=function(q){var g=typeof q=="function"&&q.constructor;return!!g&&(g===M||(g.displayName||g.name)==="GeneratorFunction")},s.mark=function(q){return Object.setPrototypeOf?Object.setPrototypeOf(q,S):(q.__proto__=S,d(q,f,"GeneratorFunction")),q.prototype=Object.create(N),q},s.awrap=function(q){return{__await:q}},V(Q.prototype),d(Q.prototype,h,function(){return this}),s.AsyncIterator=Q,s.async=function(q,g,_,E,R){R===void 0&&(R=Promise);var x=new Q(m(q,g,_,E),R);return s.isGeneratorFunction(g)?x:x.next().then(function(H){return H.done?H.value:x.next()})},V(N),d(N,f,"Generator"),d(N,l,function(){return this}),d(N,"toString",function(){return"[object Generator]"}),s.keys=function(q){var g=Object(q),_=[];for(var E in g)_.push(E);return _.reverse(),function R(){for(;_.length;){var x=_.pop();if(x in g)return R.value=x,R.done=!1,R}return R.done=!0,R}},s.values=Z,z.prototype={constructor:z,reset:function(q){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(L),!q)for(var g in this)g.charAt(0)==="t"&&a.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=n)},stop:function(){this.done=!0;var q=this.tryEntries[0].completion;if(q.type==="throw")throw q.arg;return this.rval},dispatchException:function(q){if(this.done)throw q;var g=this;function _(ie,Y){return x.type="throw",x.arg=q,g.next=ie,Y&&(g.method="next",g.arg=n),!!Y}for(var E=this.tryEntries.length-1;E>=0;--E){var R=this.tryEntries[E],x=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var H=a.call(R,"catchLoc"),$=a.call(R,"finallyLoc");if(H&&$){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(H){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else{if(!$)throw new Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return _(R.finallyLoc)}}}},abrupt:function(q,g){for(var _=this.tryEntries.length-1;_>=0;--_){var E=this.tryEntries[_];if(E.tryLoc<=this.prev&&a.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var R=E;break}}R&&(q==="break"||q==="continue")&&R.tryLoc<=g&&g<=R.finallyLoc&&(R=null);var x=R?R.completion:{};return x.type=q,x.arg=g,R?(this.method="next",this.next=R.finallyLoc,P):this.complete(x)},complete:function(q,g){if(q.type==="throw")throw q.arg;return q.type==="break"||q.type==="continue"?this.next=q.arg:q.type==="return"?(this.rval=this.arg=q.arg,this.method="return",this.next="end"):q.type==="normal"&&g&&(this.next=g),P},finish:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.finallyLoc===q)return this.complete(_.completion,_.afterLoc),L(_),P}},catch:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.tryLoc===q){var E=_.completion;if(E.type==="throw"){var R=E.arg;L(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(q,g,_){return this.delegate={iterator:Z(q),resultName:g,nextLoc:_},this.method==="next"&&(this.arg=n),P}},s}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),AH=de((t,e)=>{ee();var r=DH()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),CH=de((t,e)=>{"use strict";ee();var r=(i,...n)=>new Promise(s=>{s(i(...n))});e.exports=r,e.exports.default=r}),RH=de((t,e)=>{"use strict";ee();var r=CH(),i=n=>{if(!((Number.isInteger(n)||n===1/0)&&n>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let s=[],o=0,a=()=>{o--,s.length>0&&s.shift()()},u=(h,f,...d)=>{o++;let m=r(h,...d);f(m),m.then(a,a)},c=(h,f,...d)=>{o<n?u(h,f,...d):s.push(u.bind(null,h,f,...d))},l=(h,...f)=>new Promise(d=>c(h,d,...f));return Object.defineProperties(l,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),l};e.exports=i,e.exports.default=i}),TH=de((t,e)=>{"use strict";ee();var r=RH(),i=class extends Error{constructor(a){super(),this.value=a}},n=async(a,u)=>u(await a),s=async a=>{let u=await Promise.all(a);if(u[1]===!0)throw new i(u[0]);return!1},o=async(a,u,c)=>{c={concurrency:1/0,preserveOrder:!0,...c};let l=r(c.concurrency),h=[...a].map(d=>[d,l(n,d,u)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(h.map(d=>f(s,d)))}catch(d){if(d instanceof i)return d.value;throw d}};e.exports=o,e.exports.default=o}),kH=de((t,e)=>{"use strict";ee();var r=ye("path"),i=ye("fs"),{promisify:n}=ye("util"),s=TH(),o=n(i.stat),a=n(i.lstat),u={directory:"isDirectory",file:"isFile"};function c({type:h}){if(!(h in u))throw new Error(`Invalid type specified: ${h}`)}var l=(h,f)=>h===void 0||f[u[h]]();e.exports=async(h,f)=>{f={cwd:process.cwd(),type:"file",allowSymlinks:!0,...f},c(f);let d=f.allowSymlinks?o:a;return s(h,async m=>{try{let y=await d(r.resolve(f.cwd,m));return l(f.type,y)}catch{return!1}},f)},e.exports.sync=(h,f)=>{f={cwd:process.cwd(),allowSymlinks:!0,type:"file",...f},c(f);let d=f.allowSymlinks?i.statSync:i.lstatSync;for(let m of h)try{let y=d(r.resolve(f.cwd,m));if(l(f.type,y))return m}catch{}}}),OH=de((t,e)=>{"use strict";ee();var r=ye("fs"),{promisify:i}=ye("util"),n=i(r.access);e.exports=async s=>{try{return await n(s),!0}catch{return!1}},e.exports.sync=s=>{try{return r.accessSync(s),!0}catch{return!1}}}),FH=de((t,e)=>{"use strict";ee();var r=ye("path"),i=kH(),n=OH(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=async f=>{if(typeof o!="function")return i(l,f);let d=await o(f.cwd);return typeof d=="string"?i([d],f):d};for(;;){let f=await h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.sync=(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=f=>{if(typeof o!="function")return i.sync(l,f);let d=o(f.cwd);return typeof d=="string"?i.sync([d],f):d};for(;;){let f=h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.exists=n,e.exports.sync.exists=n.sync,e.exports.stop=s}),da=de((t,e)=>{"use strict";ee();var r=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);e.exports=i=>i?Object.keys(i).map(n=>[r.has(n)?r.get(n):n,i[n]]).reduce((n,s)=>(n[s[0]]=s[1],n),Object.create(null)):{}}),Xy=de((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=ye("events"),n=ye("stream"),s=ye("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),v=Symbol("flowing"),C=Symbol("paused"),F=Symbol("resume"),P=Symbol("buffer"),T=Symbol("pipes"),M=Symbol("bufferLength"),S=Symbol("bufferPush"),D=Symbol("bufferShift"),U=Symbol("objectMode"),W=Symbol("destroyed"),N=Symbol("emitData"),V=Symbol("emitEnd"),Q=Symbol("emitEnd2"),te=Symbol("async"),j=R=>Promise.resolve().then(R),I=global._MP_NO_ITERATOR_SYMBOLS_!=="1",L=I&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),z=I&&Symbol.iterator||Symbol("iterator not implemented"),Z=R=>R==="end"||R==="finish"||R==="prefinish",q=R=>R instanceof ArrayBuffer||typeof R=="object"&&R.constructor&&R.constructor.name==="ArrayBuffer"&&R.byteLength>=0,g=R=>!Buffer.isBuffer(R)&&ArrayBuffer.isView(R),_=class{constructor(R,x,H){this.src=R,this.dest=x,this.opts=H,this.ondrain=()=>R[F](),x.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},E=class extends _{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(R,x,H){super(R,x,H),this.proxyErrors=$=>x.emit("error",$),R.on("error",this.proxyErrors)}};e.exports=class ER extends n{constructor(x){super(),this[v]=!1,this[C]=!1,this[T]=[],this[P]=[],this[U]=x&&x.objectMode||!1,this[U]?this[y]=null:this[y]=x&&x.encoding||null,this[y]==="buffer"&&(this[y]=null),this[te]=x&&!!x.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[M]=0,this[W]=!1,x&&x.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[P]}),x&&x.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[T]})}get bufferLength(){return this[M]}get encoding(){return this[y]}set encoding(x){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[y]&&x!==this[y]&&(this[p]&&this[p].lastNeed||this[M]))throw new Error("cannot change encoding");this[y]!==x&&(this[p]=x?new s(x):null,this[P].length&&(this[P]=this[P].map(H=>this[p].write(H)))),this[y]=x}setEncoding(x){this.encoding=x}get objectMode(){return this[U]}set objectMode(x){this[U]=this[U]||!!x}get async(){return this[te]}set async(x){this[te]=this[te]||!!x}write(x,H,$){if(this[o])throw new Error("write after end");if(this[W])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof H=="function"&&($=H,H="utf8"),H||(H="utf8");let ie=this[te]?j:Y=>Y();return!this[U]&&!Buffer.isBuffer(x)&&(g(x)?x=Buffer.from(x.buffer,x.byteOffset,x.byteLength):q(x)?x=Buffer.from(x):typeof x!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",x):this[S](x),this[M]!==0&&this.emit("readable"),$&&ie($),this.flowing):x.length?(typeof x=="string"&&!(H===this[y]&&!this[p].lastNeed)&&(x=Buffer.from(x,H)),Buffer.isBuffer(x)&&this[y]&&(x=this[p].write(x)),this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",x):this[S](x),this[M]!==0&&this.emit("readable"),$&&ie($),this.flowing):(this[M]!==0&&this.emit("readable"),$&&ie($),this.flowing)}read(x){if(this[W])return null;if(this[M]===0||x===0||x>this[M])return this[a](),null;this[U]&&(x=null),this[P].length>1&&!this[U]&&(this.encoding?this[P]=[this[P].join("")]:this[P]=[Buffer.concat(this[P],this[M])]);let H=this[f](x||null,this[P][0]);return this[a](),H}[f](x,H){return x===H.length||x===null?this[D]():(this[P][0]=H.slice(x),H=H.slice(0,x),this[M]-=x),this.emit("data",H),!this[P].length&&!this[o]&&this.emit("drain"),H}end(x,H,$){return typeof x=="function"&&($=x,x=null),typeof H=="function"&&($=H,H="utf8"),x&&this.write(x,H),$&&this.once("end",$),this[o]=!0,this.writable=!1,(this.flowing||!this[C])&&this[a](),this}[F](){this[W]||(this[C]=!1,this[v]=!0,this.emit("resume"),this[P].length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[F]()}pause(){this[v]=!1,this[C]=!0}get destroyed(){return this[W]}get flowing(){return this[v]}get paused(){return this[C]}[S](x){this[U]?this[M]+=1:this[M]+=x.length,this[P].push(x)}[D](){return this[P].length&&(this[U]?this[M]-=1:this[M]-=this[P][0].length),this[P].shift()}[d](x){do;while(this[m](this[D]()));!x&&!this[P].length&&!this[o]&&this.emit("drain")}[m](x){return x?(this.emit("data",x),this.flowing):!1}pipe(x,H){if(this[W])return;let $=this[u];return H=H||{},x===r.stdout||x===r.stderr?H.end=!1:H.end=H.end!==!1,H.proxyErrors=!!H.proxyErrors,$?H.end&&x.end():(this[T].push(H.proxyErrors?new E(this,x,H):new _(this,x,H)),this[te]?j(()=>this[F]()):this[F]()),x}unpipe(x){let H=this[T].find($=>$.dest===x);H&&(this[T].splice(this[T].indexOf(H),1),H.unpipe())}addListener(x,H){return this.on(x,H)}on(x,H){let $=super.on(x,H);return x==="data"&&!this[T].length&&!this.flowing?this[F]():x==="readable"&&this[M]!==0?super.emit("readable"):Z(x)&&this[u]?(super.emit(x),this.removeAllListeners(x)):x==="error"&&this[l]&&(this[te]?j(()=>H.call(this,this[l])):H.call(this,this[l])),$}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[W]&&this[P].length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[h]&&this.emit("close"),this[c]=!1)}emit(x,H,...$){if(x!=="error"&&x!=="close"&&x!==W&&this[W])return;if(x==="data")return H?this[te]?j(()=>this[N](H)):this[N](H):!1;if(x==="end")return this[V]();if(x==="close"){if(this[h]=!0,!this[u]&&!this[W])return;let Y=super.emit("close");return this.removeAllListeners("close"),Y}else if(x==="error"){this[l]=H;let Y=super.emit("error",H);return this[a](),Y}else if(x==="resume"){let Y=super.emit("resume");return this[a](),Y}else if(x==="finish"||x==="prefinish"){let Y=super.emit(x);return this.removeAllListeners(x),Y}let ie=super.emit(x,H,...$);return this[a](),ie}[N](x){for(let $ of this[T])$.dest.write(x)===!1&&this.pause();let H=super.emit("data",x);return this[a](),H}[V](){this[u]||(this[u]=!0,this.readable=!1,this[te]?j(()=>this[Q]()):this[Q]())}[Q](){if(this[p]){let H=this[p].end();if(H){for(let $ of this[T])$.dest.write(H);super.emit("data",H)}}for(let H of this[T])H.end();let x=super.emit("end");return this.removeAllListeners("end"),x}collect(){let x=[];this[U]||(x.dataLength=0);let H=this.promise();return this.on("data",$=>{x.push($),this[U]||(x.dataLength+=$.length)}),H.then(()=>x)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(x=>this[U]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?x.join(""):Buffer.concat(x,x.dataLength))}promise(){return new Promise((x,H)=>{this.on(W,()=>H(new Error("stream destroyed"))),this.on("error",$=>H($)),this.on("end",()=>x())})}[L](){return{next:()=>{let x=this.read();if(x!==null)return Promise.resolve({done:!1,value:x});if(this[o])return Promise.resolve({done:!0});let H=null,$=null,ie=w=>{this.removeListener("data",Y),this.removeListener("end",he),$(w)},Y=w=>{this.removeListener("error",ie),this.removeListener("end",he),this.pause(),H({value:w,done:!!this[o]})},he=()=>{this.removeListener("error",ie),this.removeListener("data",Y),H({done:!0})},J=()=>ie(new Error("stream destroyed"));return new Promise((w,B)=>{$=B,H=w,this.once(W,J),this.once("error",ie),this.once("end",he),this.once("data",Y)})}}}[z](){return{next:()=>{let x=this.read();return{value:x,done:x===null}}}}destroy(x){return this[W]?(x?this.emit("error",x):this.emit(W),this):(this[W]=!0,this[P].length=0,this[M]=0,typeof this.close=="function"&&!this[h]&&this.close(),x?this.emit("error",x):this.emit(W),this)}static isStream(x){return!!x&&(x instanceof ER||x instanceof n||x instanceof i&&(typeof x.pipe=="function"||typeof x.write=="function"&&typeof x.end=="function"))}}}),PH=de((t,e)=>{ee();var r=ye("zlib").constants||{ZLIB_VERNUM:4736};e.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},r))}),vR=de((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=ye("events"),n=ye("stream"),s=ye("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),v=Symbol("flowing"),C=Symbol("paused"),F=Symbol("resume"),P=Symbol("bufferLength"),T=Symbol("bufferPush"),M=Symbol("bufferShift"),S=Symbol("objectMode"),D=Symbol("destroyed"),U=Symbol("emitData"),W=Symbol("emitEnd"),N=Symbol("emitEnd2"),V=Symbol("async"),Q=_=>Promise.resolve().then(_),te=global._MP_NO_ITERATOR_SYMBOLS_!=="1",j=te&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),I=te&&Symbol.iterator||Symbol("iterator not implemented"),L=_=>_==="end"||_==="finish"||_==="prefinish",z=_=>_ instanceof ArrayBuffer||typeof _=="object"&&_.constructor&&_.constructor.name==="ArrayBuffer"&&_.byteLength>=0,Z=_=>!Buffer.isBuffer(_)&&ArrayBuffer.isView(_),q=class{constructor(_,E,R){this.src=_,this.dest=E,this.opts=R,this.ondrain=()=>_[F](),E.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},g=class extends q{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(_,E,R){super(_,E,R),this.proxyErrors=x=>E.emit("error",x),_.on("error",this.proxyErrors)}};e.exports=class wR extends n{constructor(E){super(),this[v]=!1,this[C]=!1,this.pipes=[],this.buffer=[],this[S]=E&&E.objectMode||!1,this[S]?this[y]=null:this[y]=E&&E.encoding||null,this[y]==="buffer"&&(this[y]=null),this[V]=E&&!!E.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[P]=0,this[D]=!1}get bufferLength(){return this[P]}get encoding(){return this[y]}set encoding(E){if(this[S])throw new Error("cannot set encoding in objectMode");if(this[y]&&E!==this[y]&&(this[p]&&this[p].lastNeed||this[P]))throw new Error("cannot change encoding");this[y]!==E&&(this[p]=E?new s(E):null,this.buffer.length&&(this.buffer=this.buffer.map(R=>this[p].write(R)))),this[y]=E}setEncoding(E){this.encoding=E}get objectMode(){return this[S]}set objectMode(E){this[S]=this[S]||!!E}get async(){return this[V]}set async(E){this[V]=this[V]||!!E}write(E,R,x){if(this[o])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof R=="function"&&(x=R,R="utf8"),R||(R="utf8");let H=this[V]?Q:$=>$();return!this[S]&&!Buffer.isBuffer(E)&&(Z(E)?E=Buffer.from(E.buffer,E.byteOffset,E.byteLength):z(E)?E=Buffer.from(E):typeof E!="string"&&(this.objectMode=!0)),this[S]?(this.flowing&&this[P]!==0&&this[d](!0),this.flowing?this.emit("data",E):this[T](E),this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing):E.length?(typeof E=="string"&&!(R===this[y]&&!this[p].lastNeed)&&(E=Buffer.from(E,R)),Buffer.isBuffer(E)&&this[y]&&(E=this[p].write(E)),this.flowing&&this[P]!==0&&this[d](!0),this.flowing?this.emit("data",E):this[T](E),this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing):(this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing)}read(E){if(this[D])return null;if(this[P]===0||E===0||E>this[P])return this[a](),null;this[S]&&(E=null),this.buffer.length>1&&!this[S]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[P])]);let R=this[f](E||null,this.buffer[0]);return this[a](),R}[f](E,R){return E===R.length||E===null?this[M]():(this.buffer[0]=R.slice(E),R=R.slice(0,E),this[P]-=E),this.emit("data",R),!this.buffer.length&&!this[o]&&this.emit("drain"),R}end(E,R,x){return typeof E=="function"&&(x=E,E=null),typeof R=="function"&&(x=R,R="utf8"),E&&this.write(E,R),x&&this.once("end",x),this[o]=!0,this.writable=!1,(this.flowing||!this[C])&&this[a](),this}[F](){this[D]||(this[C]=!1,this[v]=!0,this.emit("resume"),this.buffer.length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[F]()}pause(){this[v]=!1,this[C]=!0}get destroyed(){return this[D]}get flowing(){return this[v]}get paused(){return this[C]}[T](E){this[S]?this[P]+=1:this[P]+=E.length,this.buffer.push(E)}[M](){return this.buffer.length&&(this[S]?this[P]-=1:this[P]-=this.buffer[0].length),this.buffer.shift()}[d](E){do;while(this[m](this[M]()));!E&&!this.buffer.length&&!this[o]&&this.emit("drain")}[m](E){return E?(this.emit("data",E),this.flowing):!1}pipe(E,R){if(this[D])return;let x=this[u];return R=R||{},E===r.stdout||E===r.stderr?R.end=!1:R.end=R.end!==!1,R.proxyErrors=!!R.proxyErrors,x?R.end&&E.end():(this.pipes.push(R.proxyErrors?new g(this,E,R):new q(this,E,R)),this[V]?Q(()=>this[F]()):this[F]()),E}unpipe(E){let R=this.pipes.find(x=>x.dest===E);R&&(this.pipes.splice(this.pipes.indexOf(R),1),R.unpipe())}addListener(E,R){return this.on(E,R)}on(E,R){let x=super.on(E,R);return E==="data"&&!this.pipes.length&&!this.flowing?this[F]():E==="readable"&&this[P]!==0?super.emit("readable"):L(E)&&this[u]?(super.emit(E),this.removeAllListeners(E)):E==="error"&&this[l]&&(this[V]?Q(()=>R.call(this,this[l])):R.call(this,this[l])),x}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[D]&&this.buffer.length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[h]&&this.emit("close"),this[c]=!1)}emit(E,R,...x){if(E!=="error"&&E!=="close"&&E!==D&&this[D])return;if(E==="data")return R?this[V]?Q(()=>this[U](R)):this[U](R):!1;if(E==="end")return this[W]();if(E==="close"){if(this[h]=!0,!this[u]&&!this[D])return;let $=super.emit("close");return this.removeAllListeners("close"),$}else if(E==="error"){this[l]=R;let $=super.emit("error",R);return this[a](),$}else if(E==="resume"){let $=super.emit("resume");return this[a](),$}else if(E==="finish"||E==="prefinish"){let $=super.emit(E);return this.removeAllListeners(E),$}let H=super.emit(E,R,...x);return this[a](),H}[U](E){for(let x of this.pipes)x.dest.write(E)===!1&&this.pause();let R=super.emit("data",E);return this[a](),R}[W](){this[u]||(this[u]=!0,this.readable=!1,this[V]?Q(()=>this[N]()):this[N]())}[N](){if(this[p]){let R=this[p].end();if(R){for(let x of this.pipes)x.dest.write(R);super.emit("data",R)}}for(let R of this.pipes)R.end();let E=super.emit("end");return this.removeAllListeners("end"),E}collect(){let E=[];this[S]||(E.dataLength=0);let R=this.promise();return this.on("data",x=>{E.push(x),this[S]||(E.dataLength+=x.length)}),R.then(()=>E)}concat(){return this[S]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(E=>this[S]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?E.join(""):Buffer.concat(E,E.dataLength))}promise(){return new Promise((E,R)=>{this.on(D,()=>R(new Error("stream destroyed"))),this.on("error",x=>R(x)),this.on("end",()=>E())})}[j](){return{next:()=>{let E=this.read();if(E!==null)return Promise.resolve({done:!1,value:E});if(this[o])return Promise.resolve({done:!0});let R=null,x=null,H=he=>{this.removeListener("data",$),this.removeListener("end",ie),x(he)},$=he=>{this.removeListener("error",H),this.removeListener("end",ie),this.pause(),R({value:he,done:!!this[o]})},ie=()=>{this.removeListener("error",H),this.removeListener("data",$),R({done:!0})},Y=()=>H(new Error("stream destroyed"));return new Promise((he,J)=>{x=J,R=he,this.once(D,Y),this.once("error",H),this.once("end",ie),this.once("data",$)})}}}[I](){return{next:()=>{let E=this.read();return{value:E,done:E===null}}}}destroy(E){return this[D]?(E?this.emit("error",E):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[P]=0,typeof this.close=="function"&&!this[h]&&this.close(),E?this.emit("error",E):this.emit(D),this)}static isStream(E){return!!E&&(E instanceof wR||E instanceof n||E instanceof i&&(typeof E.pipe=="function"||typeof E.write=="function"&&typeof E.end=="function"))}}}),SR=de(t=>{"use strict";ee();var e=ye("assert"),r=ye("buffer").Buffer,i=ye("zlib"),n=t.constants=PH(),s=vR(),o=r.concat,a=Symbol("_superWrite"),u=class extends Error{constructor(L){super("zlib: "+L.message),this.code=L.code,this.errno=L.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+L.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},c=Symbol("opts"),l=Symbol("flushFlag"),h=Symbol("finishFlushFlag"),f=Symbol("fullFlushFlag"),d=Symbol("handle"),m=Symbol("onError"),y=Symbol("sawError"),p=Symbol("level"),v=Symbol("strategy"),C=Symbol("ended"),F=Symbol("_defaultFullFlush"),P=class extends s{constructor(L,z){if(!L||typeof L!="object")throw new TypeError("invalid options for ZlibBase constructor");super(L),this[y]=!1,this[C]=!1,this[c]=L,this[l]=L.flush,this[h]=L.finishFlush;try{this[d]=new i[z](L)}catch(Z){throw new u(Z)}this[m]=Z=>{this[y]||(this[y]=!0,this.close(),this.emit("error",Z))},this[d].on("error",Z=>this[m](new u(Z))),this.once("end",()=>this.close)}close(){this[d]&&(this[d].close(),this[d]=null,this.emit("close"))}reset(){if(!this[y])return e(this[d],"zlib binding closed"),this[d].reset()}flush(L){this.ended||(typeof L!="number"&&(L=this[f]),this.write(Object.assign(r.alloc(0),{[l]:L})))}end(L,z,Z){return L&&this.write(L,z),this.flush(this[h]),this[C]=!0,super.end(null,null,Z)}get ended(){return this[C]}write(L,z,Z){if(typeof z=="function"&&(Z=z,z="utf8"),typeof L=="string"&&(L=r.from(L,z)),this[y])return;e(this[d],"zlib binding closed");let q=this[d]._handle,g=q.close;q.close=()=>{};let _=this[d].close;this[d].close=()=>{},r.concat=x=>x;let E;try{let x=typeof L[l]=="number"?L[l]:this[l];E=this[d]._processChunk(L,x),r.concat=o}catch(x){r.concat=o,this[m](new u(x))}finally{this[d]&&(this[d]._handle=q,q.close=g,this[d].close=_,this[d].removeAllListeners("error"))}this[d]&&this[d].on("error",x=>this[m](new u(x)));let R;if(E)if(Array.isArray(E)&&E.length>0){R=this[a](r.from(E[0]));for(let x=1;x<E.length;x++)R=this[a](E[x])}else R=this[a](r.from(E));return Z&&Z(),R}[a](L){return super.write(L)}},T=class extends P{constructor(L,z){L=L||{},L.flush=L.flush||n.Z_NO_FLUSH,L.finishFlush=L.finishFlush||n.Z_FINISH,super(L,z),this[f]=n.Z_FULL_FLUSH,this[p]=L.level,this[v]=L.strategy}params(L,z){if(!this[y]){if(!this[d])throw new Error("cannot switch params when binding is closed");if(!this[d].params)throw new Error("not supported in this implementation");if(this[p]!==L||this[v]!==z){this.flush(n.Z_SYNC_FLUSH),e(this[d],"zlib binding closed");let Z=this[d].flush;this[d].flush=(q,g)=>{this.flush(q),g()};try{this[d].params(L,z)}finally{this[d].flush=Z}this[d]&&(this[p]=L,this[v]=z)}}}},M=class extends T{constructor(L){super(L,"Deflate")}},S=class extends T{constructor(L){super(L,"Inflate")}},D=Symbol("_portable"),U=class extends T{constructor(L){super(L,"Gzip"),this[D]=L&&!!L.portable}[a](L){return this[D]?(this[D]=!1,L[9]=255,super[a](L)):super[a](L)}},W=class extends T{constructor(L){super(L,"Gunzip")}},N=class extends T{constructor(L){super(L,"DeflateRaw")}},V=class extends T{constructor(L){super(L,"InflateRaw")}},Q=class extends T{constructor(L){super(L,"Unzip")}},te=class extends P{constructor(L,z){L=L||{},L.flush=L.flush||n.BROTLI_OPERATION_PROCESS,L.finishFlush=L.finishFlush||n.BROTLI_OPERATION_FINISH,super(L,z),this[f]=n.BROTLI_OPERATION_FLUSH}},j=class extends te{constructor(L){super(L,"BrotliCompress")}},I=class extends te{constructor(L){super(L,"BrotliDecompress")}};t.Deflate=M,t.Inflate=S,t.Gzip=U,t.Gunzip=W,t.DeflateRaw=N,t.InflateRaw=V,t.Unzip=Q,typeof i.BrotliCompress=="function"?(t.BrotliCompress=j,t.BrotliDecompress=I):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),pa=de((t,e)=>{ee();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?i=>i:i=>i&&i.replace(/\\/g,"/")}),Qy=de((t,e)=>{"use strict";ee();var r=Xy(),i=pa(),n=Symbol("slurp");e.exports=class extends r{constructor(s,o,a){switch(super(),this.pause(),this.extended=o,this.globalExtended=a,this.header=s,this.startBlockSize=512*Math.ceil(s.size/512),this.blockRemain=this.startBlockSize,this.remain=s.size,this.type=s.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=i(s.path),this.mode=s.mode,this.mode&&(this.mode=this.mode&4095),this.uid=s.uid,this.gid=s.gid,this.uname=s.uname,this.gname=s.gname,this.size=s.size,this.mtime=s.mtime,this.atime=s.atime,this.ctime=s.ctime,this.linkpath=i(s.linkpath),this.uname=s.uname,this.gname=s.gname,o&&this[n](o),a&&this[n](a,!0)}write(s){let o=s.length;if(o>this.blockRemain)throw new Error("writing more to entry than is appropriate");let a=this.remain,u=this.blockRemain;return this.remain=Math.max(0,a-o),this.blockRemain=Math.max(0,u-o),this.ignore?!0:a>=o?super.write(s):super.write(s.slice(0,a))}[n](s,o){for(let a in s)s[a]!==null&&s[a]!==void 0&&!(o&&a==="path")&&(this[a]=a==="path"||a==="linkpath"?i(s[a]):s[a])}}}),xR=de(t=>{"use strict";ee(),t.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),t.code=new Map(Array.from(t.name).map(e=>[e[1],e[0]]))}),IH=de((t,e)=>{"use strict";ee();var r=(l,h)=>{if(Number.isSafeInteger(l))l<0?n(l,h):i(l,h);else throw Error("cannot encode number outside of javascript safe integer range");return h},i=(l,h)=>{h[0]=128;for(var f=h.length;f>1;f--)h[f-1]=l&255,l=Math.floor(l/256)},n=(l,h)=>{h[0]=255;var f=!1;l=l*-1;for(var d=h.length;d>1;d--){var m=l&255;l=Math.floor(l/256),f?h[d-1]=u(m):m===0?h[d-1]=0:(f=!0,h[d-1]=c(m))}},s=l=>{let h=l[0],f=h===128?a(l.slice(1,l.length)):h===255?o(l):null;if(f===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(f))throw Error("parsed number outside of javascript safe integer range");return f},o=l=>{for(var h=l.length,f=0,d=!1,m=h-1;m>-1;m--){var y=l[m],p;d?p=u(y):y===0?p=y:(d=!0,p=c(y)),p!==0&&(f-=p*Math.pow(256,h-m-1))}return f},a=l=>{for(var h=l.length,f=0,d=h-1;d>-1;d--){var m=l[d];m!==0&&(f+=m*Math.pow(256,h-d-1))}return f},u=l=>(255^l)&255,c=l=>(255^l)+1&255;e.exports={encode:r,parse:s}}),ma=de((t,e)=>{"use strict";ee();var r=xR(),i=ye("path").posix,n=IH(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(S,D,U,W){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[o]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(S)?this.decode(S,D||0,U,W):S&&this.set(S)}decode(S,D,U,W){if(D||(D=0),!S||!(S.length>=D+512))throw new Error("need 512 bytes for header");if(this.path=c(S,D,100),this.mode=f(S,D+100,8),this.uid=f(S,D+108,8),this.gid=f(S,D+116,8),this.size=f(S,D+124,12),this.mtime=l(S,D+136,12),this.cksum=f(S,D+148,12),this[s](U),this[s](W,!0),this[o]=c(S,D+156,1),this[o]===""&&(this[o]="0"),this[o]==="0"&&this.path.slice(-1)==="/"&&(this[o]="5"),this[o]==="5"&&(this.size=0),this.linkpath=c(S,D+157,100),S.slice(D+257,D+265).toString()==="ustar\x0000")if(this.uname=c(S,D+265,32),this.gname=c(S,D+297,32),this.devmaj=f(S,D+329,8),this.devmin=f(S,D+337,8),S[D+475]!==0){let V=c(S,D+345,155);this.path=V+"/"+this.path}else{let V=c(S,D+345,130);V&&(this.path=V+"/"+this.path),this.atime=l(S,D+476,12),this.ctime=l(S,D+488,12)}let N=8*32;for(let V=D;V<D+148;V++)N+=S[V];for(let V=D+156;V<D+512;V++)N+=S[V];this.cksumValid=N===this.cksum,this.cksum===null&&N===8*32&&(this.nullBlock=!0)}[s](S,D){for(let U in S)S[U]!==null&&S[U]!==void 0&&!(D&&U==="path")&&(this[U]=S[U])}encode(S,D){if(S||(S=this.block=Buffer.alloc(512),D=0),D||(D=0),!(S.length>=D+512))throw new Error("need 512 bytes for header");let U=this.ctime||this.atime?130:155,W=u(this.path||"",U),N=W[0],V=W[1];this.needPax=W[2],this.needPax=M(S,D,100,N)||this.needPax,this.needPax=p(S,D+100,8,this.mode)||this.needPax,this.needPax=p(S,D+108,8,this.uid)||this.needPax,this.needPax=p(S,D+116,8,this.gid)||this.needPax,this.needPax=p(S,D+124,12,this.size)||this.needPax,this.needPax=P(S,D+136,12,this.mtime)||this.needPax,S[D+156]=this[o].charCodeAt(0),this.needPax=M(S,D+157,100,this.linkpath)||this.needPax,S.write("ustar\x0000",D+257,8),this.needPax=M(S,D+265,32,this.uname)||this.needPax,this.needPax=M(S,D+297,32,this.gname)||this.needPax,this.needPax=p(S,D+329,8,this.devmaj)||this.needPax,this.needPax=p(S,D+337,8,this.devmin)||this.needPax,this.needPax=M(S,D+345,U,V)||this.needPax,S[D+475]!==0?this.needPax=M(S,D+345,155,V)||this.needPax:(this.needPax=M(S,D+345,130,V)||this.needPax,this.needPax=P(S,D+476,12,this.atime)||this.needPax,this.needPax=P(S,D+488,12,this.ctime)||this.needPax);let Q=8*32;for(let te=D;te<D+148;te++)Q+=S[te];for(let te=D+156;te<D+512;te++)Q+=S[te];return this.cksum=Q,p(S,D+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(S){for(let D in S)S[D]!==null&&S[D]!==void 0&&(this[D]=S[D])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(S){r.code.has(S)?this[o]=r.code.get(S):this[o]=S}},u=(S,D)=>{let U=S,W="",N,V=i.parse(S).root||".";if(Buffer.byteLength(U)<100)N=[U,W,!1];else{W=i.dirname(U),U=i.basename(U);do Buffer.byteLength(U)<=100&&Buffer.byteLength(W)<=D?N=[U,W,!1]:Buffer.byteLength(U)>100&&Buffer.byteLength(W)<=D?N=[U.slice(0,100-1),W,!0]:(U=i.join(i.basename(W),U),W=i.dirname(W));while(W!==V&&!N);N||(N=[S.slice(0,100-1),"",!0])}return N},c=(S,D,U)=>S.slice(D,D+U).toString("utf8").replace(/\0.*/,""),l=(S,D,U)=>h(f(S,D,U)),h=S=>S===null?null:new Date(S*1e3),f=(S,D,U)=>S[D]&128?n.parse(S.slice(D,D+U)):m(S,D,U),d=S=>isNaN(S)?null:S,m=(S,D,U)=>d(parseInt(S.slice(D,D+U).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},p=(S,D,U,W)=>W===null?!1:W>y[U]||W<0?(n.encode(W,S.slice(D,D+U)),!0):(v(S,D,U,W),!1),v=(S,D,U,W)=>S.write(C(W,U),D,U,"ascii"),C=(S,D)=>F(Math.floor(S).toString(8),D),F=(S,D)=>(S.length===D-1?S:new Array(D-S.length-1).join("0")+S+" ")+"\0",P=(S,D,U,W)=>W===null?!1:p(S,D,U,W.getTime()/1e3),T=new Array(156).join("\0"),M=(S,D,U,W)=>W===null?!1:(S.write(W+T,D,U,"utf8"),W.length!==Buffer.byteLength(W)||W.length>U);e.exports=a}),e0=de((t,e)=>{"use strict";ee();var r=ma(),i=ye("path"),n=class{constructor(u,c){this.atime=u.atime||null,this.charset=u.charset||null,this.comment=u.comment||null,this.ctime=u.ctime||null,this.gid=u.gid||null,this.gname=u.gname||null,this.linkpath=u.linkpath||null,this.mtime=u.mtime||null,this.path=u.path||null,this.size=u.size||null,this.uid=u.uid||null,this.uname=u.uname||null,this.dev=u.dev||null,this.ino=u.ino||null,this.nlink=u.nlink||null,this.global=c||!1}encode(){let u=this.encodeBody();if(u==="")return null;let c=Buffer.byteLength(u),l=512*Math.ceil(1+c/512),h=Buffer.allocUnsafe(l);for(let f=0;f<512;f++)h[f]=0;new r({path:("PaxHeader/"+i.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:c,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(h),h.write(u,512,c,"utf8");for(let f=c+512;f<h.length;f++)h[f]=0;return h}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(u){if(this[u]===null||this[u]===void 0)return"";let c=this[u]instanceof Date?this[u].getTime()/1e3:this[u],l=" "+(u==="dev"||u==="ino"||u==="nlink"?"SCHILY.":"")+u+"="+c+`
|
54
|
+
Downloading files${r?"":` for example ${Zr.default.cyan(e)}`}. This might take a moment.`),Nt(),h.start(),await(0,Oy.default)(()=>Ty(o,e),{retries:3}))}catch(p){throw new js(Hq(p)?p.message:String(p))}finally{h.stop()}let f=Ms.default.join(o,"package.json"),d=(0,qs.existsSync)(f),m=[];if(d){let p;try{p=(0,qs.readJsonSync)(f)}catch{}p&&m.push(...Object.keys(p.scripts||{}))}let y=t;return Ms.default.join(l,a)===t&&(y=a),{cdPath:y,hasPackageJson:d,availableScripts:m,repoInfo:n}}var Js=require("fs");var aR=ae(require("chalk"));var M1=ae(require("crypto")),yl=new Uint8Array(256),ml=yl.length;function Py(){return ml>yl.length-16&&(M1.default.randomFillSync(yl),ml=0),yl.slice(ml,ml+=16)}var Qe=[];for(let t=0;t<256;++t)Qe.push((t+256).toString(16).slice(1));function j1(t,e=0){return Qe[t[e+0]]+Qe[t[e+1]]+Qe[t[e+2]]+Qe[t[e+3]]+"-"+Qe[t[e+4]]+Qe[t[e+5]]+"-"+Qe[t[e+6]]+Qe[t[e+7]]+"-"+Qe[t[e+8]]+Qe[t[e+9]]+"-"+Qe[t[e+10]]+Qe[t[e+11]]+Qe[t[e+12]]+Qe[t[e+13]]+Qe[t[e+14]]+Qe[t[e+15]]}var q1=ae(require("crypto")),Iy={randomUUID:q1.default.randomUUID};function $q(t,e,r){if(Iy.randomUUID&&!e&&!t)return Iy.randomUUID();t=t||{};let i=t.random||(t.rng||Py)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){r=r||0;for(let n=0;n<16;++n)e[r+n]=i[n];return e}return j1(i)}var dn=$q;var Re;(function(t){t.assertEqual=n=>n;function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let s={};for(let o of n)s[o]=o;return s},t.getValidEnumValues=n=>{let s=t.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(let a of s)o[a]=n[a];return t.objectValues(o)},t.objectValues=n=>t.objectKeys(n).map(function(s){return n[s]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let s=[];for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&s.push(o);return s},t.find=(n,s)=>{for(let o of n)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,s=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(Re||(Re={}));var By;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(By||(By={}));var oe=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oi=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map!="undefined"&&t instanceof Map?oe.map:typeof Set!="undefined"&&t instanceof Set?oe.set:typeof Date!="undefined"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},ne=Re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),zq=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Tt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},i={_errors:[]},n=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)i._errors.push(r(o));else{let a=i,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,Re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Tt.create=t=>new Tt(t);var sa=(t,e)=>{let r;switch(t.code){case ne.invalid_type:t.received===oe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ne.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Re.jsonStringifyReplacer)}`;break;case ne.unrecognized_keys:r=`Unrecognized key(s) in object: ${Re.joinValues(t.keys,", ")}`;break;case ne.invalid_union:r="Invalid input";break;case ne.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Re.joinValues(t.options)}`;break;case ne.invalid_enum_value:r=`Invalid enum value. Expected ${Re.joinValues(t.options)}, received '${t.received}'`;break;case ne.invalid_arguments:r="Invalid function arguments";break;case ne.invalid_return_type:r="Invalid function return type";break;case ne.invalid_date:r="Invalid date";break;case ne.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Re.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case ne.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case ne.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case ne.custom:r="Invalid input";break;case ne.invalid_intersection_types:r="Intersection results could not be merged";break;case ne.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case ne.not_finite:r="Number must be finite";break;default:r=e.defaultError,Re.assertNever(t)}return{message:r}},$1=sa;function Gq(t){$1=t}function _l(){return $1}var bl=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,s=[...r,...n.path||[]],o={...n,path:s},a="",u=i.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...n,path:s,message:n.message||a}},Wq=[];function ce(t,e){let r=bl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_l(),sa].filter(i=>!!i)});t.common.issues.push(r)}var Ze=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return be;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return Ze.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:s,value:o}=n;if(s.status==="aborted"||o.status==="aborted")return be;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value!="undefined"||n.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}},be=Object.freeze({status:"aborted"}),z1=t=>({status:"dirty",value:t}),ft=t=>({status:"valid",value:t}),Ny=t=>t.status==="aborted",My=t=>t.status==="dirty",oa=t=>t.status==="valid",El=t=>typeof Promise!="undefined"&&t instanceof Promise,me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(me||(me={}));var Yt=class{constructor(e,r,i,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},U1=(t,e)=>{if(oa(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Tt(t.common.issues);return this._error=r,this._error}}};function Ee(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data=="undefined"?{message:i!=null?i:a.defaultError}:{message:r!=null?r:a.defaultError},description:n}}var ve=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Oi(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ze,ctx:{common:e.parent.common,data:e.data,parsedType:Oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(El(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r==null?void 0:r.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oi(e)},s=this._parseSync({data:e,path:n.path,parent:n});return U1(n,s)}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oi(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(El(n)?n:Promise.resolve(n));return U1(i,s)}refine(e,r){let i=n=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,s)=>{let o=e(n),a=()=>s.addIssue({code:ne.custom,...i(n)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new Ot({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return rr.create(this,this._def)}nullable(){return ei.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kt.create(this,this._def)}promise(){return Ii.create(this,this._def)}or(e){return gn.create([this,e],this._def)}and(e){return _n.create(this,e,this._def)}transform(e){return new Ot({...Ee(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Sn({...Ee(this._def),innerType:this,defaultValue:r,typeName:ge.ZodDefault})}brand(){return new vl({typeName:ge.ZodBranded,type:this,...Ee(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ws({...Ee(this._def),innerType:this,catchValue:r,typeName:ge.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return xn.create(this,e)}readonly(){return Ys.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Vq=/^c[^\s-]{8,}$/i,Yq=/^[a-z][a-z0-9]*$/,Kq=/^[0-9A-HJKMNP-TV-Z]{26}$/,Zq=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Jq=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ly,Qq=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,eU=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,tU=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function rU(t,e){return!!((e==="v4"||!e)&&Qq.test(t)||(e==="v6"||!e)&&eU.test(t))}var Rt=class extends ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){let s=this._getOrReturnCtx(e);return ce(s,{code:ne.invalid_type,expected:oe.string,received:s.parsedType}),be}let i=new Ze,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(n=this._getOrReturnCtx(e,n),o?ce(n,{code:ne.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ce(n,{code:ne.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")Jq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"email",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Ly||(Ly=new RegExp(Xq,"u")),Ly.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"emoji",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")Zq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"uuid",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Vq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"cuid",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")Yq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"cuid2",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")Kq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"ulid",code:ne.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),ce(n,{validation:"url",code:ne.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"regex",code:ne.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?tU(s).test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="ip"?rU(e.data,s.version)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"ip",code:ne.invalid_string,message:s.message}),i.dirty()):Re.assertNever(s);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(n=>e.test(n),{validation:r,code:ne.invalid_string,...me.errToObj(i)})}_addCheck(e){return new Rt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...me.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...me.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...me.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...me.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...me.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...me.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...me.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...me.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...me.errToObj(r)})}nonempty(e){return this.min(1,me.errToObj(e))}trim(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Rt.create=t=>{var e;return new Rt({checks:[],typeName:ge.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function iU(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,s=parseInt(t.toFixed(n).replace(".","")),o=parseInt(e.toFixed(n).replace(".",""));return s%o/Math.pow(10,n)}var Er=class extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==oe.number){let s=this._getOrReturnCtx(e);return ce(s,{code:ne.invalid_type,expected:oe.number,received:s.parsedType}),be}let i,n=new Ze;for(let s of this._def.checks)s.kind==="int"?Re.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?iU(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.not_finite,message:s.message}),n.dirty()):Re.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,i,n){return new Er({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:me.toString(n)}]})}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Re.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Er.create=t=>new Er({checks:[],typeName:ge.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});var vr=class extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==oe.bigint){let s=this._getOrReturnCtx(e);return ce(s,{code:ne.invalid_type,expected:oe.bigint,received:s.parsedType}),be}let i,n=new Ze;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ne.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):Re.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,i,n){return new vr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:me.toString(n)}]})}_addCheck(e){return new vr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};vr.create=t=>{var e;return new vr({checks:[],typeName:ge.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};var pn=class extends ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.boolean,received:i.parsedType}),be}return ft(e.data)}};pn.create=t=>new pn({typeName:ge.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});var Xr=class extends ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){let s=this._getOrReturnCtx(e);return ce(s,{code:ne.invalid_type,expected:oe.date,received:s.parsedType}),be}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return ce(s,{code:ne.invalid_date}),be}let i=new Ze,n;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ne.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Re.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Xr({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:me.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:me.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Xr.create=t=>new Xr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ge.ZodDate,...Ee(t)});var Hs=class extends ve{_parse(e){if(this._getType(e)!==oe.symbol){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.symbol,received:i.parsedType}),be}return ft(e.data)}};Hs.create=t=>new Hs({typeName:ge.ZodSymbol,...Ee(t)});var mn=class extends ve{_parse(e){if(this._getType(e)!==oe.undefined){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.undefined,received:i.parsedType}),be}return ft(e.data)}};mn.create=t=>new mn({typeName:ge.ZodUndefined,...Ee(t)});var yn=class extends ve{_parse(e){if(this._getType(e)!==oe.null){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.null,received:i.parsedType}),be}return ft(e.data)}};yn.create=t=>new yn({typeName:ge.ZodNull,...Ee(t)});var Pi=class extends ve{constructor(){super(...arguments),this._any=!0}_parse(e){return ft(e.data)}};Pi.create=t=>new Pi({typeName:ge.ZodAny,...Ee(t)});var Jr=class extends ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ft(e.data)}};Jr.create=t=>new Jr({typeName:ge.ZodUnknown,...Ee(t)});var ir=class extends ve{_parse(e){let r=this._getOrReturnCtx(e);return ce(r,{code:ne.invalid_type,expected:oe.never,received:r.parsedType}),be}};ir.create=t=>new ir({typeName:ge.ZodNever,...Ee(t)});var $s=class extends ve{_parse(e){if(this._getType(e)!==oe.undefined){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.void,received:i.parsedType}),be}return ft(e.data)}};$s.create=t=>new $s({typeName:ge.ZodVoid,...Ee(t)});var kt=class extends ve{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==oe.array)return ce(r,{code:ne.invalid_type,expected:oe.array,received:r.parsedType}),be;if(n.exactLength!==null){let o=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(o||a)&&(ce(r,{code:o?ne.too_big:ne.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(ce(r,{code:ne.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(ce(r,{code:ne.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>n.type._parseAsync(new Yt(r,o,r.path,a)))).then(o=>Ze.mergeArray(i,o));let s=[...r.data].map((o,a)=>n.type._parseSync(new Yt(r,o,r.path,a)));return Ze.mergeArray(i,s)}get element(){return this._def.type}min(e,r){return new kt({...this._def,minLength:{value:e,message:me.toString(r)}})}max(e,r){return new kt({...this._def,maxLength:{value:e,message:me.toString(r)}})}length(e,r){return new kt({...this._def,exactLength:{value:e,message:me.toString(r)}})}nonempty(e){return this.min(1,e)}};kt.create=(t,e)=>new kt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...Ee(e)});function Us(t){if(t instanceof Ie){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=rr.create(Us(i))}return new Ie({...t._def,shape:()=>e})}else return t instanceof kt?new kt({...t._def,type:Us(t.element)}):t instanceof rr?rr.create(Us(t.unwrap())):t instanceof ei?ei.create(Us(t.unwrap())):t instanceof Kt?Kt.create(t.items.map(e=>Us(e))):t}var Ie=class extends ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Re.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==oe.object){let c=this._getOrReturnCtx(e);return ce(c,{code:ne.invalid_type,expected:oe.object,received:c.parsedType}),be}let{status:i,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ir&&this._def.unknownKeys==="strip"))for(let c in n.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=s[c],h=n.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Yt(n,h,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof ir){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:n.data[l]}});else if(c==="strict")a.length>0&&(ce(n,{code:ne.unrecognized_keys,keys:a}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let h=n.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Yt(n,h,n.path,l)),alwaysSet:l in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of u){let h=await l.key;c.push({key:h,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>Ze.mergeObjectSync(i,c)):Ze.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return me.errToObj,new Ie({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{var n,s,o,a;let u=(o=(s=(n=this._def).errorMap)===null||s===void 0?void 0:s.call(n,r,i).message)!==null&&o!==void 0?o:i.defaultError;return r.code==="unrecognized_keys"?{message:(a=me.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Ie({...this._def,unknownKeys:"strip"})}passthrough(){return new Ie({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ie({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ie({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ge.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Ie({...this._def,catchall:e})}pick(e){let r={};return Re.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(r[i]=this.shape[i])}),new Ie({...this._def,shape:()=>r})}omit(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{e[i]||(r[i]=this.shape[i])}),new Ie({...this._def,shape:()=>r})}deepPartial(){return Us(this)}partial(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];e&&!e[i]?r[i]=n:r[i]=n.optional()}),new Ie({...this._def,shape:()=>r})}required(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])r[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof rr;)s=s._def.innerType;r[i]=s}}),new Ie({...this._def,shape:()=>r})}keyof(){return G1(Re.objectKeys(this.shape))}};Ie.create=(t,e)=>new Ie({shape:()=>t,unknownKeys:"strip",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});Ie.strictCreate=(t,e)=>new Ie({shape:()=>t,unknownKeys:"strict",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});Ie.lazycreate=(t,e)=>new Ie({shape:t,unknownKeys:"strip",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});var gn=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Tt(a.ctx.common.issues));return ce(r,{code:ne.invalid_union,unionErrors:o}),be}if(r.common.async)return Promise.all(i.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(n);{let s,o=[];for(let u of i){let c={...r,common:{...r.common,issues:[]},parent:null},l=u._parseSync({data:r.data,path:r.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(u=>new Tt(u));return ce(r,{code:ne.invalid_union,unionErrors:a}),be}}get options(){return this._def.options}};gn.create=(t,e)=>new gn({options:t,typeName:ge.ZodUnion,...Ee(e)});var gl=t=>t instanceof En?gl(t.schema):t instanceof Ot?gl(t.innerType()):t instanceof vn?[t.value]:t instanceof wr?t.options:t instanceof wn?Object.keys(t.enum):t instanceof Sn?gl(t._def.innerType):t instanceof mn?[void 0]:t instanceof yn?[null]:null,zs=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.object)return ce(r,{code:ne.invalid_type,expected:oe.object,received:r.parsedType}),be;let i=this.discriminator,n=r.data[i],s=this.optionsMap.get(n);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ce(r,{code:ne.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let n=new Map;for(let s of r){let o=gl(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,s)}}return new zs({typeName:ge.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...Ee(i)})}};function jy(t,e){let r=Oi(t),i=Oi(e);if(t===e)return{valid:!0,data:t};if(r===oe.object&&i===oe.object){let n=Re.objectKeys(e),s=Re.objectKeys(t).filter(a=>n.indexOf(a)!==-1),o={...t,...e};for(let a of s){let u=jy(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===oe.array&&i===oe.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],u=jy(o,a);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return r===oe.date&&i===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var _n=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(s,o)=>{if(Ny(s)||Ny(o))return be;let a=jy(s.value,o.value);return a.valid?((My(s)||My(o))&&r.dirty(),{status:r.value,value:a.data}):(ce(i,{code:ne.invalid_intersection_types}),be)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>n(s,o)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};_n.create=(t,e,r)=>new _n({left:t,right:e,typeName:ge.ZodIntersection,...Ee(r)});var Kt=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.array)return ce(i,{code:ne.invalid_type,expected:oe.array,received:i.parsedType}),be;if(i.data.length<this._def.items.length)return ce(i,{code:ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&i.data.length>this._def.items.length&&(ce(i,{code:ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...i.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new Yt(i,o,i.path,a)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>Ze.mergeArray(r,o)):Ze.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Kt({...this._def,rest:e})}};Kt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Kt({items:t,typeName:ge.ZodTuple,rest:null,...Ee(e)})};var bn=class extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.object)return ce(i,{code:ne.invalid_type,expected:oe.object,received:i.parsedType}),be;let n=[],s=this._def.keyType,o=this._def.valueType;for(let a in i.data)n.push({key:s._parse(new Yt(i,a,i.path,a)),value:o._parse(new Yt(i,i.data[a],i.path,a))});return i.common.async?Ze.mergeObjectAsync(r,n):Ze.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof ve?new bn({keyType:e,valueType:r,typeName:ge.ZodRecord,...Ee(i)}):new bn({keyType:Rt.create(),valueType:e,typeName:ge.ZodRecord,...Ee(r)})}},Gs=class extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.map)return ce(i,{code:ne.invalid_type,expected:oe.map,received:i.parsedType}),be;let n=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([a,u],c)=>({key:n._parse(new Yt(i,a,i.path,[c,"key"])),value:s._parse(new Yt(i,u,i.path,[c,"value"]))}));if(i.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return be;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return be;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};Gs.create=(t,e,r)=>new Gs({valueType:e,keyType:t,typeName:ge.ZodMap,...Ee(r)});var Qr=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.set)return ce(i,{code:ne.invalid_type,expected:oe.set,received:i.parsedType}),be;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(ce(i,{code:ne.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(ce(i,{code:ne.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let s=this._def.valueType;function o(u){let c=new Set;for(let l of u){if(l.status==="aborted")return be;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...i.data.values()].map((u,c)=>s._parse(new Yt(i,u,i.path,c)));return i.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new Qr({...this._def,minSize:{value:e,message:me.toString(r)}})}max(e,r){return new Qr({...this._def,maxSize:{value:e,message:me.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({valueType:t,minSize:null,maxSize:null,typeName:ge.ZodSet,...Ee(e)});var Fi=class extends ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.function)return ce(r,{code:ne.invalid_type,expected:oe.function,received:r.parsedType}),be;function i(a,u){return bl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_l(),sa].filter(c=>!!c),issueData:{code:ne.invalid_arguments,argumentsError:u}})}function n(a,u){return bl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_l(),sa].filter(c=>!!c),issueData:{code:ne.invalid_return_type,returnTypeError:u}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Ii){let a=this;return ft(async function(...u){let c=new Tt([]),l=await a._def.args.parseAsync(u,s).catch(d=>{throw c.addIssue(i(u,d)),c}),h=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(h,s).catch(d=>{throw c.addIssue(n(h,d)),c})})}else{let a=this;return ft(function(...u){let c=a._def.args.safeParse(u,s);if(!c.success)throw new Tt([i(u,c.error)]);let l=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(l,s);if(!h.success)throw new Tt([n(l,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Fi({...this._def,args:Kt.create(e).rest(Jr.create())})}returns(e){return new Fi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new Fi({args:e||Kt.create([]).rest(Jr.create()),returns:r||Jr.create(),typeName:ge.ZodFunction,...Ee(i)})}},En=class extends ve{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};En.create=(t,e)=>new En({getter:t,typeName:ge.ZodLazy,...Ee(e)});var vn=class extends ve{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ce(r,{received:r.data,code:ne.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}};vn.create=(t,e)=>new vn({value:t,typeName:ge.ZodLiteral,...Ee(e)});function G1(t,e){return new wr({values:t,typeName:ge.ZodEnum,...Ee(e)})}var wr=class extends ve{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return ce(r,{expected:Re.joinValues(i),received:r.parsedType,code:ne.invalid_type}),be}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),i=this._def.values;return ce(r,{received:r.data,code:ne.invalid_enum_value,options:i}),be}return ft(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return wr.create(e)}exclude(e){return wr.create(this.options.filter(r=>!e.includes(r)))}};wr.create=G1;var wn=class extends ve{_parse(e){let r=Re.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==oe.string&&i.parsedType!==oe.number){let n=Re.objectValues(r);return ce(i,{expected:Re.joinValues(n),received:i.parsedType,code:ne.invalid_type}),be}if(r.indexOf(e.data)===-1){let n=Re.objectValues(r);return ce(i,{received:i.data,code:ne.invalid_enum_value,options:n}),be}return ft(e.data)}get enum(){return this._def.values}};wn.create=(t,e)=>new wn({values:t,typeName:ge.ZodNativeEnum,...Ee(e)});var Ii=class extends ve{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.promise&&r.common.async===!1)return ce(r,{code:ne.invalid_type,expected:oe.promise,received:r.parsedType}),be;let i=r.parsedType===oe.promise?r.data:Promise.resolve(r.data);return ft(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ii.create=(t,e)=>new Ii({type:t,typeName:ge.ZodPromise,...Ee(e)});var Ot=class extends ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:o=>{ce(i,o),o.fatal?r.abort():r.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let o=n.transform(i.data,s);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:i.path,parent:i})):this._def.schema._parseSync({data:o,path:i.path,parent:i})}if(n.type==="refinement"){let o=a=>{let u=n.refinement(a,s);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?be:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?be:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!oa(o))return o;let a=n.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>oa(o)?Promise.resolve(n.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Re.assertNever(n)}};Ot.create=(t,e,r)=>new Ot({schema:t,typeName:ge.ZodEffects,effect:e,...Ee(r)});Ot.createWithPreprocess=(t,e,r)=>new Ot({schema:e,effect:{type:"preprocess",transform:t},typeName:ge.ZodEffects,...Ee(r)});var rr=class extends ve{_parse(e){return this._getType(e)===oe.undefined?ft(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};rr.create=(t,e)=>new rr({innerType:t,typeName:ge.ZodOptional,...Ee(e)});var ei=class extends ve{_parse(e){return this._getType(e)===oe.null?ft(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ei.create=(t,e)=>new ei({innerType:t,typeName:ge.ZodNullable,...Ee(e)});var Sn=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===oe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Sn.create=(t,e)=>new Sn({innerType:t,typeName:ge.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});var Ws=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return El(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Tt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Tt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Ws.create=(t,e)=>new Ws({innerType:t,typeName:ge.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});var Vs=class extends ve{_parse(e){if(this._getType(e)!==oe.nan){let i=this._getOrReturnCtx(e);return ce(i,{code:ne.invalid_type,expected:oe.nan,received:i.parsedType}),be}return{status:"valid",value:e.data}}};Vs.create=t=>new Vs({typeName:ge.ZodNaN,...Ee(t)});var nU=Symbol("zod_brand"),vl=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},xn=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?be:s.status==="dirty"?(r.dirty(),z1(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?be:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,r){return new xn({in:e,out:r,typeName:ge.ZodPipeline})}},Ys=class extends ve{_parse(e){let r=this._def.innerType._parse(e);return oa(r)&&(r.value=Object.freeze(r.value)),r}};Ys.create=(t,e)=>new Ys({innerType:t,typeName:ge.ZodReadonly,...Ee(e)});var W1=(t,e={},r)=>t?Pi.create().superRefine((i,n)=>{var s,o;if(!t(i)){let a=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,u=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...c,fatal:u})}}):Pi.create(),sU={object:Ie.lazycreate},ge;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ge||(ge={}));var oU=(t,e={message:`Input not instance of ${t.name}`})=>W1(r=>r instanceof t,e),V1=Rt.create,Y1=Er.create,aU=Vs.create,uU=vr.create,K1=pn.create,cU=Xr.create,lU=Hs.create,hU=mn.create,fU=yn.create,dU=Pi.create,pU=Jr.create,mU=ir.create,yU=$s.create,gU=kt.create,_U=Ie.create,bU=Ie.strictCreate,EU=gn.create,vU=zs.create,wU=_n.create,SU=Kt.create,xU=bn.create,DU=Gs.create,AU=Qr.create,CU=Fi.create,RU=En.create,TU=vn.create,kU=wr.create,OU=wn.create,FU=Ii.create,H1=Ot.create,PU=rr.create,IU=ei.create,LU=Ot.createWithPreprocess,BU=xn.create,NU=()=>V1().optional(),MU=()=>Y1().optional(),jU=()=>K1().optional(),qU={string:t=>Rt.create({...t,coerce:!0}),number:t=>Er.create({...t,coerce:!0}),boolean:t=>pn.create({...t,coerce:!0}),bigint:t=>vr.create({...t,coerce:!0}),date:t=>Xr.create({...t,coerce:!0})},UU=be,Ks=Object.freeze({__proto__:null,defaultErrorMap:sa,setErrorMap:Gq,getErrorMap:_l,makeIssue:bl,EMPTY_PATH:Wq,addIssueToContext:ce,ParseStatus:Ze,INVALID:be,DIRTY:z1,OK:ft,isAborted:Ny,isDirty:My,isValid:oa,isAsync:El,get util(){return Re},get objectUtil(){return By},ZodParsedType:oe,getParsedType:Oi,ZodType:ve,ZodString:Rt,ZodNumber:Er,ZodBigInt:vr,ZodBoolean:pn,ZodDate:Xr,ZodSymbol:Hs,ZodUndefined:mn,ZodNull:yn,ZodAny:Pi,ZodUnknown:Jr,ZodNever:ir,ZodVoid:$s,ZodArray:kt,ZodObject:Ie,ZodUnion:gn,ZodDiscriminatedUnion:zs,ZodIntersection:_n,ZodTuple:Kt,ZodRecord:bn,ZodMap:Gs,ZodSet:Qr,ZodFunction:Fi,ZodLazy:En,ZodLiteral:vn,ZodEnum:wr,ZodNativeEnum:wn,ZodPromise:Ii,ZodEffects:Ot,ZodTransformer:Ot,ZodOptional:rr,ZodNullable:ei,ZodDefault:Sn,ZodCatch:Ws,ZodNaN:Vs,BRAND:nU,ZodBranded:vl,ZodPipeline:xn,ZodReadonly:Ys,custom:W1,Schema:ve,ZodSchema:ve,late:sU,get ZodFirstPartyTypeKind(){return ge},coerce:qU,any:dU,array:gU,bigint:uU,boolean:K1,date:cU,discriminatedUnion:vU,effect:H1,enum:kU,function:CU,instanceof:oU,intersection:wU,lazy:RU,literal:TU,map:DU,nan:aU,nativeEnum:OU,never:mU,null:fU,nullable:IU,number:Y1,object:_U,oboolean:jU,onumber:MU,optional:PU,ostring:NU,pipeline:BU,preprocess:LU,promise:FU,record:xU,set:AU,strictObject:bU,string:V1,symbol:lU,transformer:H1,tuple:SU,undefined:hU,union:EU,unknown:pU,void:yU,NEVER:UU,ZodIssueCode:ne,quotelessJson:zq,ZodError:Tt});var Gy=ae(require("os")),nR=ae(require("crypto")),sR=ae(require("path")),oR=ae(iR());function JU(t){let e=process.version,r=Gy.default.type(),i=Gy.default.arch();return`${t.name} ${t.version} ${e} ${r} ${i}`}async function XU(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,oR.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return sR.default.join(t,"turborepo","telemetry.json")}function QU({input:t,salt:e}){return nR.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var Zs={buildUserAgent:JU,oneWayHashWithSalt:QU,defaultConfigPath:XU};var eH="TURBO_TELEMETRY_DEBUG",tH="TURBO_TELEMETRY_DISABLED",rH="TURBO_TELEMETRY_MESSAGE_DISABLED",iH="DO_NOT_TRACK",nH=Ks.object({telemetry_enabled:Ks.boolean(),telemetry_id:Ks.string(),telemetry_salt:Ks.string(),telemetry_alerted:Ks.string().optional()}),Et=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,Js.readFileSync)(e,"utf-8"),i=JSON.parse(r),n=Et.validateConfig(i);return new Et({configPath:e,config:n})}catch{return Et.tryRemove({configPath:e})?Et.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await Zs.defaultConfigPath();return Et.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return nH.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=dn(),i=dn(),n=Zs.oneWayHashWithSalt({input:r,salt:i}),s=new Et({configPath:e,config:{telemetry_enabled:!0,telemetry_id:n,telemetry_salt:i}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,Js.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,Js.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[iH]||"0",r=process.env[tH]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[rH]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(ue.log(),ue.bold("Attention:"),ue.grey("Turborepo now collects completely anonymous telemetry regarding usage."),ue.grey("This information is used to shape the Turborepo roadmap and prioritize features."),ue.grey("You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:"),ue.underline(aR.default.grey("https://turbo.build/repo/docs/telemetry"))),this.alertShown()}enable(){this.config.telemetry_enabled=!0,this.tryWrite()}disable(){this.config.telemetry_enabled=!1,this.tryWrite()}alertShown(){return this.hasSeenAlert()||(this.config.telemetry_alerted=new Date().toISOString(),this.tryWrite()),!0}oneWayHash(e){return Zs.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[eH]||"0";return e==="1"||e.toLowerCase()==="true"}};var uR=ae(Sy());var sH=20,oH="/api/turborepo/v1/events",Dn=class{constructor({api:e,packageInfo:r,config:i,opts:n}){this.batchSize=sH;this.timeout=250;this.sessionId=dn();this.eventBatches=[];this.events=[];let s=new URL(oH,e);this.api=s.toString(),this.packageInfo=r,this.config=i,n!=null&&n.timeout&&(this.timeout=n.timeout),n!=null&&n.batchSize&&(this.batchSize=n.batchSize)}hasPendingEvents(){return this.events.length!==0}async waitForFlush(){await Promise.all(this.eventBatches)}flushEvents(){let e=this.events.splice(0,this.batchSize);this.config.isEnabled()&&this.eventBatches.push(uR.default.post(this.api,{timeout:this.timeout,json:e,headers:{"x-turbo-telemetry-id":this.config.id,"x-turbo-session-id":this.sessionId,"User-Agent":Zs.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:i,isSensitive:n}){let s={id:dn(),key:e,value:n?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:i};return Et.isDebug()&&(ue.log(),ue.bold("[telemetry event]"),ue.dimmed(JSON.stringify(s,null,2)),ue.log()),this.config.isEnabled()&&(this.events.push({package:s}),this.events.length>=this.batchSize&&this.flushEvents()),s}async close(){for(;this.hasPendingEvents();)this.flushEvents();try{await this.waitForFlush()}catch{}}trackCliOption({option:e,value:r}){return this.track({key:`option:${e}`,value:r})}trackCliArgument({argument:e,value:r}){return this.track({key:`argument:${e}`,value:r})}trackCliCommand({command:e,value:r}){return this.track({key:`command:${e}`,value:r})}trackCommandStatus({command:e,status:r}){return this.trackCliCommand({command:e,value:r})}trackCommandWarning(e){return this.track({key:"warning",value:e})}trackCommandError(e){return this.track({key:"error",value:e})}};var aa=class extends Dn{trackOptionExample(e){if(e)return this.trackCliOption({option:"example",value:e})}trackOptionPackageManager(e){if(e)return this.trackCliOption({option:"package_manager",value:e})}trackOptionSkipInstall(e){if(e)return this.trackCliOption({option:"skip_install",value:e.toString()})}trackOptionSkipTransforms(e){if(e)return this.trackCliOption({option:"skip_transforms",value:e.toString()})}trackOptionTurboVersion(e){if(e)return this.trackCliOption({option:"turbo_version",value:e})}trackOptionExamplePath(e){if(e)return this.trackCliOption({option:"example_path",value:e})}trackArgumentDirectory(e){if(e)return this.trackCliArgument({argument:"project_directory",value:"provided"})}trackArgumentPackageManager(e){if(e)return this.trackCliArgument({argument:"package_manager",value:e})}};var dR=ae(fR());var uH=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],ua=class extends Dn{trackCI(){var e;return this.track({key:"ci",value:(e=dR.name)!=null?e:"unknown"})}trackArgumentWorkspace(e){if(e)return this.trackCliArgument({argument:"workspace",value:"provided"})}trackOptionTask(e){if(e)return this.trackCliOption({option:"task",value:uH.includes(e)?e:"other"})}trackOptionFallback(e){if(e)return this.trackCliOption({option:"fallback",value:e})}trackOptionDirectory(e){if(e)return this.trackCliOption({option:"directory",value:"custom"})}trackOptionMaxBuffer(e){if(e!==void 0)return this.trackCliOption({option:"max_buffer",value:e.toString()})}};var cH={"create-turbo":aa,"turbo-ignore":ua},lH="https://telemetry.vercel.com";async function Wy({packageInfo:t,opts:e}){let r=cH[t.name],i=await Et.fromDefaultConfig();return i?(i.showAlert(),{telemetry:new r({api:lH,packageInfo:t,config:i,opts:e})}):{telemetry:void 0}}var ca=ae(require("chalk"));var pR=require("commander"),mR="status",hH=["enable","disable",mR];function fH(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();ue.log(`Status: ${e?ca.default.bold(ca.default.green("Enabled")):ca.default.bold(ca.default.red("Disabled"))}`),ue.log(),e?ue.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):ue.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),ue.log("Learn more: https://turbo.build/repo/docs/telemetry")}function dH(t,e){if(!e.telemetry){ue.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),ue.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),ue.bold("Success!")),ue.log(),fH(e)}function Vy(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new pR.Argument("[action]","Action to perform").choices(hH).default(mR)).action(dH)}var FT=require("proxy-agent");var An={name:"create-turbo",version:"2.0.0-canary.0",description:"Create a new Turborepo",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turbo/issues"},bin:{"create-turbo":"dist/cli.js"},scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{chalk:"4.1.2",commander:"^11.0.0","fs-extra":"^11.1.1",inquirer:"^8.0.0","proxy-agent":"^6.2.2",rimraf:"^3.0.2",semver:"^7.3.8","update-check":"^1.5.4"},devDependencies:{"@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"^9.0.13","@types/inquirer":"^7.3.1","@types/jest":"^27.4.0","@types/node":"^18.17.2","@types/rimraf":"^3.0.2","@types/semver":"^7.3.9",jest:"^27.4.3","ts-jest":"^27.1.1",tsup:"^6.7.0",typescript:"^5.2.2"},files:["dist"]};var yR=ae(require("chalk")),gR=ae(require("update-check"));var mH=(0,gR.default)(An).catch(()=>null);async function Yy(){try{let t=await mH;t!=null&&t.latest&&(ue.log(),ue.log(yR.default.yellow.bold("A new version of `create-turbo` is available!")),ue.log()),process.exit()}catch{}}var ba=ae(require("path")),et=ae(require("chalk"));var Ni=ae(require("chalk"),1),PR=ae(vu(),1),IR=ae(xu(),1),jR=ae(require("os"),1),qR=ae(is(),1),$W=require("fs-extra");var YW=ae(ou(),1),ZW=require("fs-extra"),XW=require("fs-extra"),eV=require("chalk"),HR=require("stream"),$R=require("util"),nV=require("fs-extra"),uV=require("chalk"),lV=require("fs-extra"),Cn=ae(require("path"),1),dt=require("fs-extra"),zR=ae(is(),1),GR=ae(require("path"),1),WR=require("fs-extra"),VR=ae(require("chalk"),1),ri=ae(require("path"),1),YR=ae(is(),1),It=require("fs-extra"),KR=ae(ou(),1);var ha=ae(require("path"),1),xr=require("fs-extra"),ro=ae(require("path"),1),Dr=require("fs-extra"),fa=ae(require("path"),1),Ar=require("fs-extra"),Pt=ae(require("chalk"),1),tT=ae(xu(),1),rT=ae(is(),1),iT=ae(vu(),1),nT=require("semver"),sT=ae(require("chalk"),1),yH=Object.create,Jy=Object.defineProperty,gH=Object.getOwnPropertyDescriptor,_H=Object.getOwnPropertyNames,bH=Object.getPrototypeOf,EH=Object.prototype.hasOwnProperty,ye=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),vH=(t,e)=>()=>(t&&(e=t(t=0)),e),de=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),wH=(t,e)=>{for(var r in e)Jy(t,r,{get:e[r],enumerable:!0})},SH=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _H(e))!EH.call(t,n)&&n!==r&&Jy(t,n,{get:()=>e[n],enumerable:!(i=gH(e,n))||i.enumerable});return t},Al=(t,e,r)=>(r=t!=null?yH(bH(t)):{},SH(e||!t||!t.__esModule?Jy(r,"default",{value:t,enumerable:!0}):r,t)),ee=vH(()=>{}),xH=de((t,e)=>{ee();function r(i){return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,r(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),DH=de((t,e)=>{ee();var r=xH().default;function i(){"use strict";e.exports=i=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var n,s={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(q,g,_){q[g]=_.value},c=typeof Symbol=="function"?Symbol:{},l=c.iterator||"@@iterator",h=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function d(q,g,_){return Object.defineProperty(q,g,{value:_,enumerable:!0,configurable:!0,writable:!0}),q[g]}try{d({},"")}catch{d=function(q,g,_){return q[g]=_}}function m(q,g,_,E){var R=g&&g.prototype instanceof T?g:T,x=Object.create(R.prototype),H=new z(E||[]);return u(x,"_invoke",{value:te(q,_,H)}),x}function y(q,g,_){try{return{type:"normal",arg:q.call(g,_)}}catch(E){return{type:"throw",arg:E}}}s.wrap=m;var p="suspendedStart",v="suspendedYield",C="executing",F="completed",P={};function T(){}function M(){}function S(){}var D={};d(D,l,function(){return this});var U=Object.getPrototypeOf,W=U&&U(U(Z([])));W&&W!==o&&a.call(W,l)&&(D=W);var N=S.prototype=T.prototype=Object.create(D);function V(q){["next","throw","return"].forEach(function(g){d(q,g,function(_){return this._invoke(g,_)})})}function Q(q,g){function _(R,x,H,$){var ie=y(q[R],q,x);if(ie.type!=="throw"){var Y=ie.arg,he=Y.value;return he&&r(he)=="object"&&a.call(he,"__await")?g.resolve(he.__await).then(function(J){_("next",J,H,$)},function(J){_("throw",J,H,$)}):g.resolve(he).then(function(J){Y.value=J,H(Y)},function(J){return _("throw",J,H,$)})}$(ie.arg)}var E;u(this,"_invoke",{value:function(R,x){function H(){return new g(function($,ie){_(R,x,$,ie)})}return E=E?E.then(H,H):H()}})}function te(q,g,_){var E=p;return function(R,x){if(E===C)throw new Error("Generator is already running");if(E===F){if(R==="throw")throw x;return{value:n,done:!0}}for(_.method=R,_.arg=x;;){var H=_.delegate;if(H){var $=j(H,_);if($){if($===P)continue;return $}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(E===p)throw E=F,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);E=C;var ie=y(q,g,_);if(ie.type==="normal"){if(E=_.done?F:v,ie.arg===P)continue;return{value:ie.arg,done:_.done}}ie.type==="throw"&&(E=F,_.method="throw",_.arg=ie.arg)}}}function j(q,g){var _=g.method,E=q.iterator[_];if(E===n)return g.delegate=null,_==="throw"&&q.iterator.return&&(g.method="return",g.arg=n,j(q,g),g.method==="throw")||_!=="return"&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+_+"' method")),P;var R=y(E,q.iterator,g.arg);if(R.type==="throw")return g.method="throw",g.arg=R.arg,g.delegate=null,P;var x=R.arg;return x?x.done?(g[q.resultName]=x.value,g.next=q.nextLoc,g.method!=="return"&&(g.method="next",g.arg=n),g.delegate=null,P):x:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,P)}function I(q){var g={tryLoc:q[0]};1 in q&&(g.catchLoc=q[1]),2 in q&&(g.finallyLoc=q[2],g.afterLoc=q[3]),this.tryEntries.push(g)}function L(q){var g=q.completion||{};g.type="normal",delete g.arg,q.completion=g}function z(q){this.tryEntries=[{tryLoc:"root"}],q.forEach(I,this),this.reset(!0)}function Z(q){if(q||q===""){var g=q[l];if(g)return g.call(q);if(typeof q.next=="function")return q;if(!isNaN(q.length)){var _=-1,E=function R(){for(;++_<q.length;)if(a.call(q,_))return R.value=q[_],R.done=!1,R;return R.value=n,R.done=!0,R};return E.next=E}}throw new TypeError(r(q)+" is not iterable")}return M.prototype=S,u(N,"constructor",{value:S,configurable:!0}),u(S,"constructor",{value:M,configurable:!0}),M.displayName=d(S,f,"GeneratorFunction"),s.isGeneratorFunction=function(q){var g=typeof q=="function"&&q.constructor;return!!g&&(g===M||(g.displayName||g.name)==="GeneratorFunction")},s.mark=function(q){return Object.setPrototypeOf?Object.setPrototypeOf(q,S):(q.__proto__=S,d(q,f,"GeneratorFunction")),q.prototype=Object.create(N),q},s.awrap=function(q){return{__await:q}},V(Q.prototype),d(Q.prototype,h,function(){return this}),s.AsyncIterator=Q,s.async=function(q,g,_,E,R){R===void 0&&(R=Promise);var x=new Q(m(q,g,_,E),R);return s.isGeneratorFunction(g)?x:x.next().then(function(H){return H.done?H.value:x.next()})},V(N),d(N,f,"Generator"),d(N,l,function(){return this}),d(N,"toString",function(){return"[object Generator]"}),s.keys=function(q){var g=Object(q),_=[];for(var E in g)_.push(E);return _.reverse(),function R(){for(;_.length;){var x=_.pop();if(x in g)return R.value=x,R.done=!1,R}return R.done=!0,R}},s.values=Z,z.prototype={constructor:z,reset:function(q){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(L),!q)for(var g in this)g.charAt(0)==="t"&&a.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=n)},stop:function(){this.done=!0;var q=this.tryEntries[0].completion;if(q.type==="throw")throw q.arg;return this.rval},dispatchException:function(q){if(this.done)throw q;var g=this;function _(ie,Y){return x.type="throw",x.arg=q,g.next=ie,Y&&(g.method="next",g.arg=n),!!Y}for(var E=this.tryEntries.length-1;E>=0;--E){var R=this.tryEntries[E],x=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var H=a.call(R,"catchLoc"),$=a.call(R,"finallyLoc");if(H&&$){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(H){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else{if(!$)throw new Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return _(R.finallyLoc)}}}},abrupt:function(q,g){for(var _=this.tryEntries.length-1;_>=0;--_){var E=this.tryEntries[_];if(E.tryLoc<=this.prev&&a.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var R=E;break}}R&&(q==="break"||q==="continue")&&R.tryLoc<=g&&g<=R.finallyLoc&&(R=null);var x=R?R.completion:{};return x.type=q,x.arg=g,R?(this.method="next",this.next=R.finallyLoc,P):this.complete(x)},complete:function(q,g){if(q.type==="throw")throw q.arg;return q.type==="break"||q.type==="continue"?this.next=q.arg:q.type==="return"?(this.rval=this.arg=q.arg,this.method="return",this.next="end"):q.type==="normal"&&g&&(this.next=g),P},finish:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.finallyLoc===q)return this.complete(_.completion,_.afterLoc),L(_),P}},catch:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.tryLoc===q){var E=_.completion;if(E.type==="throw"){var R=E.arg;L(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(q,g,_){return this.delegate={iterator:Z(q),resultName:g,nextLoc:_},this.method==="next"&&(this.arg=n),P}},s}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),AH=de((t,e)=>{ee();var r=DH()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),CH=de((t,e)=>{"use strict";ee();var r=(i,...n)=>new Promise(s=>{s(i(...n))});e.exports=r,e.exports.default=r}),RH=de((t,e)=>{"use strict";ee();var r=CH(),i=n=>{if(!((Number.isInteger(n)||n===1/0)&&n>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let s=[],o=0,a=()=>{o--,s.length>0&&s.shift()()},u=(h,f,...d)=>{o++;let m=r(h,...d);f(m),m.then(a,a)},c=(h,f,...d)=>{o<n?u(h,f,...d):s.push(u.bind(null,h,f,...d))},l=(h,...f)=>new Promise(d=>c(h,d,...f));return Object.defineProperties(l,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),l};e.exports=i,e.exports.default=i}),TH=de((t,e)=>{"use strict";ee();var r=RH(),i=class extends Error{constructor(a){super(),this.value=a}},n=async(a,u)=>u(await a),s=async a=>{let u=await Promise.all(a);if(u[1]===!0)throw new i(u[0]);return!1},o=async(a,u,c)=>{c={concurrency:1/0,preserveOrder:!0,...c};let l=r(c.concurrency),h=[...a].map(d=>[d,l(n,d,u)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(h.map(d=>f(s,d)))}catch(d){if(d instanceof i)return d.value;throw d}};e.exports=o,e.exports.default=o}),kH=de((t,e)=>{"use strict";ee();var r=ye("path"),i=ye("fs"),{promisify:n}=ye("util"),s=TH(),o=n(i.stat),a=n(i.lstat),u={directory:"isDirectory",file:"isFile"};function c({type:h}){if(!(h in u))throw new Error(`Invalid type specified: ${h}`)}var l=(h,f)=>h===void 0||f[u[h]]();e.exports=async(h,f)=>{f={cwd:process.cwd(),type:"file",allowSymlinks:!0,...f},c(f);let d=f.allowSymlinks?o:a;return s(h,async m=>{try{let y=await d(r.resolve(f.cwd,m));return l(f.type,y)}catch{return!1}},f)},e.exports.sync=(h,f)=>{f={cwd:process.cwd(),allowSymlinks:!0,type:"file",...f},c(f);let d=f.allowSymlinks?i.statSync:i.lstatSync;for(let m of h)try{let y=d(r.resolve(f.cwd,m));if(l(f.type,y))return m}catch{}}}),OH=de((t,e)=>{"use strict";ee();var r=ye("fs"),{promisify:i}=ye("util"),n=i(r.access);e.exports=async s=>{try{return await n(s),!0}catch{return!1}},e.exports.sync=s=>{try{return r.accessSync(s),!0}catch{return!1}}}),FH=de((t,e)=>{"use strict";ee();var r=ye("path"),i=kH(),n=OH(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=async f=>{if(typeof o!="function")return i(l,f);let d=await o(f.cwd);return typeof d=="string"?i([d],f):d};for(;;){let f=await h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.sync=(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=f=>{if(typeof o!="function")return i.sync(l,f);let d=o(f.cwd);return typeof d=="string"?i.sync([d],f):d};for(;;){let f=h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.exists=n,e.exports.sync.exists=n.sync,e.exports.stop=s}),da=de((t,e)=>{"use strict";ee();var r=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);e.exports=i=>i?Object.keys(i).map(n=>[r.has(n)?r.get(n):n,i[n]]).reduce((n,s)=>(n[s[0]]=s[1],n),Object.create(null)):{}}),Xy=de((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=ye("events"),n=ye("stream"),s=ye("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),v=Symbol("flowing"),C=Symbol("paused"),F=Symbol("resume"),P=Symbol("buffer"),T=Symbol("pipes"),M=Symbol("bufferLength"),S=Symbol("bufferPush"),D=Symbol("bufferShift"),U=Symbol("objectMode"),W=Symbol("destroyed"),N=Symbol("emitData"),V=Symbol("emitEnd"),Q=Symbol("emitEnd2"),te=Symbol("async"),j=R=>Promise.resolve().then(R),I=global._MP_NO_ITERATOR_SYMBOLS_!=="1",L=I&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),z=I&&Symbol.iterator||Symbol("iterator not implemented"),Z=R=>R==="end"||R==="finish"||R==="prefinish",q=R=>R instanceof ArrayBuffer||typeof R=="object"&&R.constructor&&R.constructor.name==="ArrayBuffer"&&R.byteLength>=0,g=R=>!Buffer.isBuffer(R)&&ArrayBuffer.isView(R),_=class{constructor(R,x,H){this.src=R,this.dest=x,this.opts=H,this.ondrain=()=>R[F](),x.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},E=class extends _{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(R,x,H){super(R,x,H),this.proxyErrors=$=>x.emit("error",$),R.on("error",this.proxyErrors)}};e.exports=class ER extends n{constructor(x){super(),this[v]=!1,this[C]=!1,this[T]=[],this[P]=[],this[U]=x&&x.objectMode||!1,this[U]?this[y]=null:this[y]=x&&x.encoding||null,this[y]==="buffer"&&(this[y]=null),this[te]=x&&!!x.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[M]=0,this[W]=!1,x&&x.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[P]}),x&&x.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[T]})}get bufferLength(){return this[M]}get encoding(){return this[y]}set encoding(x){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[y]&&x!==this[y]&&(this[p]&&this[p].lastNeed||this[M]))throw new Error("cannot change encoding");this[y]!==x&&(this[p]=x?new s(x):null,this[P].length&&(this[P]=this[P].map(H=>this[p].write(H)))),this[y]=x}setEncoding(x){this.encoding=x}get objectMode(){return this[U]}set objectMode(x){this[U]=this[U]||!!x}get async(){return this[te]}set async(x){this[te]=this[te]||!!x}write(x,H,$){if(this[o])throw new Error("write after end");if(this[W])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof H=="function"&&($=H,H="utf8"),H||(H="utf8");let ie=this[te]?j:Y=>Y();return!this[U]&&!Buffer.isBuffer(x)&&(g(x)?x=Buffer.from(x.buffer,x.byteOffset,x.byteLength):q(x)?x=Buffer.from(x):typeof x!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",x):this[S](x),this[M]!==0&&this.emit("readable"),$&&ie($),this.flowing):x.length?(typeof x=="string"&&!(H===this[y]&&!this[p].lastNeed)&&(x=Buffer.from(x,H)),Buffer.isBuffer(x)&&this[y]&&(x=this[p].write(x)),this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",x):this[S](x),this[M]!==0&&this.emit("readable"),$&&ie($),this.flowing):(this[M]!==0&&this.emit("readable"),$&&ie($),this.flowing)}read(x){if(this[W])return null;if(this[M]===0||x===0||x>this[M])return this[a](),null;this[U]&&(x=null),this[P].length>1&&!this[U]&&(this.encoding?this[P]=[this[P].join("")]:this[P]=[Buffer.concat(this[P],this[M])]);let H=this[f](x||null,this[P][0]);return this[a](),H}[f](x,H){return x===H.length||x===null?this[D]():(this[P][0]=H.slice(x),H=H.slice(0,x),this[M]-=x),this.emit("data",H),!this[P].length&&!this[o]&&this.emit("drain"),H}end(x,H,$){return typeof x=="function"&&($=x,x=null),typeof H=="function"&&($=H,H="utf8"),x&&this.write(x,H),$&&this.once("end",$),this[o]=!0,this.writable=!1,(this.flowing||!this[C])&&this[a](),this}[F](){this[W]||(this[C]=!1,this[v]=!0,this.emit("resume"),this[P].length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[F]()}pause(){this[v]=!1,this[C]=!0}get destroyed(){return this[W]}get flowing(){return this[v]}get paused(){return this[C]}[S](x){this[U]?this[M]+=1:this[M]+=x.length,this[P].push(x)}[D](){return this[P].length&&(this[U]?this[M]-=1:this[M]-=this[P][0].length),this[P].shift()}[d](x){do;while(this[m](this[D]()));!x&&!this[P].length&&!this[o]&&this.emit("drain")}[m](x){return x?(this.emit("data",x),this.flowing):!1}pipe(x,H){if(this[W])return;let $=this[u];return H=H||{},x===r.stdout||x===r.stderr?H.end=!1:H.end=H.end!==!1,H.proxyErrors=!!H.proxyErrors,$?H.end&&x.end():(this[T].push(H.proxyErrors?new E(this,x,H):new _(this,x,H)),this[te]?j(()=>this[F]()):this[F]()),x}unpipe(x){let H=this[T].find($=>$.dest===x);H&&(this[T].splice(this[T].indexOf(H),1),H.unpipe())}addListener(x,H){return this.on(x,H)}on(x,H){let $=super.on(x,H);return x==="data"&&!this[T].length&&!this.flowing?this[F]():x==="readable"&&this[M]!==0?super.emit("readable"):Z(x)&&this[u]?(super.emit(x),this.removeAllListeners(x)):x==="error"&&this[l]&&(this[te]?j(()=>H.call(this,this[l])):H.call(this,this[l])),$}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[W]&&this[P].length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[h]&&this.emit("close"),this[c]=!1)}emit(x,H,...$){if(x!=="error"&&x!=="close"&&x!==W&&this[W])return;if(x==="data")return H?this[te]?j(()=>this[N](H)):this[N](H):!1;if(x==="end")return this[V]();if(x==="close"){if(this[h]=!0,!this[u]&&!this[W])return;let Y=super.emit("close");return this.removeAllListeners("close"),Y}else if(x==="error"){this[l]=H;let Y=super.emit("error",H);return this[a](),Y}else if(x==="resume"){let Y=super.emit("resume");return this[a](),Y}else if(x==="finish"||x==="prefinish"){let Y=super.emit(x);return this.removeAllListeners(x),Y}let ie=super.emit(x,H,...$);return this[a](),ie}[N](x){for(let $ of this[T])$.dest.write(x)===!1&&this.pause();let H=super.emit("data",x);return this[a](),H}[V](){this[u]||(this[u]=!0,this.readable=!1,this[te]?j(()=>this[Q]()):this[Q]())}[Q](){if(this[p]){let H=this[p].end();if(H){for(let $ of this[T])$.dest.write(H);super.emit("data",H)}}for(let H of this[T])H.end();let x=super.emit("end");return this.removeAllListeners("end"),x}collect(){let x=[];this[U]||(x.dataLength=0);let H=this.promise();return this.on("data",$=>{x.push($),this[U]||(x.dataLength+=$.length)}),H.then(()=>x)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(x=>this[U]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?x.join(""):Buffer.concat(x,x.dataLength))}promise(){return new Promise((x,H)=>{this.on(W,()=>H(new Error("stream destroyed"))),this.on("error",$=>H($)),this.on("end",()=>x())})}[L](){return{next:()=>{let x=this.read();if(x!==null)return Promise.resolve({done:!1,value:x});if(this[o])return Promise.resolve({done:!0});let H=null,$=null,ie=w=>{this.removeListener("data",Y),this.removeListener("end",he),$(w)},Y=w=>{this.removeListener("error",ie),this.removeListener("end",he),this.pause(),H({value:w,done:!!this[o]})},he=()=>{this.removeListener("error",ie),this.removeListener("data",Y),H({done:!0})},J=()=>ie(new Error("stream destroyed"));return new Promise((w,B)=>{$=B,H=w,this.once(W,J),this.once("error",ie),this.once("end",he),this.once("data",Y)})}}}[z](){return{next:()=>{let x=this.read();return{value:x,done:x===null}}}}destroy(x){return this[W]?(x?this.emit("error",x):this.emit(W),this):(this[W]=!0,this[P].length=0,this[M]=0,typeof this.close=="function"&&!this[h]&&this.close(),x?this.emit("error",x):this.emit(W),this)}static isStream(x){return!!x&&(x instanceof ER||x instanceof n||x instanceof i&&(typeof x.pipe=="function"||typeof x.write=="function"&&typeof x.end=="function"))}}}),PH=de((t,e)=>{ee();var r=ye("zlib").constants||{ZLIB_VERNUM:4736};e.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},r))}),vR=de((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=ye("events"),n=ye("stream"),s=ye("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),v=Symbol("flowing"),C=Symbol("paused"),F=Symbol("resume"),P=Symbol("bufferLength"),T=Symbol("bufferPush"),M=Symbol("bufferShift"),S=Symbol("objectMode"),D=Symbol("destroyed"),U=Symbol("emitData"),W=Symbol("emitEnd"),N=Symbol("emitEnd2"),V=Symbol("async"),Q=_=>Promise.resolve().then(_),te=global._MP_NO_ITERATOR_SYMBOLS_!=="1",j=te&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),I=te&&Symbol.iterator||Symbol("iterator not implemented"),L=_=>_==="end"||_==="finish"||_==="prefinish",z=_=>_ instanceof ArrayBuffer||typeof _=="object"&&_.constructor&&_.constructor.name==="ArrayBuffer"&&_.byteLength>=0,Z=_=>!Buffer.isBuffer(_)&&ArrayBuffer.isView(_),q=class{constructor(_,E,R){this.src=_,this.dest=E,this.opts=R,this.ondrain=()=>_[F](),E.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},g=class extends q{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(_,E,R){super(_,E,R),this.proxyErrors=x=>E.emit("error",x),_.on("error",this.proxyErrors)}};e.exports=class wR extends n{constructor(E){super(),this[v]=!1,this[C]=!1,this.pipes=[],this.buffer=[],this[S]=E&&E.objectMode||!1,this[S]?this[y]=null:this[y]=E&&E.encoding||null,this[y]==="buffer"&&(this[y]=null),this[V]=E&&!!E.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[P]=0,this[D]=!1}get bufferLength(){return this[P]}get encoding(){return this[y]}set encoding(E){if(this[S])throw new Error("cannot set encoding in objectMode");if(this[y]&&E!==this[y]&&(this[p]&&this[p].lastNeed||this[P]))throw new Error("cannot change encoding");this[y]!==E&&(this[p]=E?new s(E):null,this.buffer.length&&(this.buffer=this.buffer.map(R=>this[p].write(R)))),this[y]=E}setEncoding(E){this.encoding=E}get objectMode(){return this[S]}set objectMode(E){this[S]=this[S]||!!E}get async(){return this[V]}set async(E){this[V]=this[V]||!!E}write(E,R,x){if(this[o])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof R=="function"&&(x=R,R="utf8"),R||(R="utf8");let H=this[V]?Q:$=>$();return!this[S]&&!Buffer.isBuffer(E)&&(Z(E)?E=Buffer.from(E.buffer,E.byteOffset,E.byteLength):z(E)?E=Buffer.from(E):typeof E!="string"&&(this.objectMode=!0)),this[S]?(this.flowing&&this[P]!==0&&this[d](!0),this.flowing?this.emit("data",E):this[T](E),this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing):E.length?(typeof E=="string"&&!(R===this[y]&&!this[p].lastNeed)&&(E=Buffer.from(E,R)),Buffer.isBuffer(E)&&this[y]&&(E=this[p].write(E)),this.flowing&&this[P]!==0&&this[d](!0),this.flowing?this.emit("data",E):this[T](E),this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing):(this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing)}read(E){if(this[D])return null;if(this[P]===0||E===0||E>this[P])return this[a](),null;this[S]&&(E=null),this.buffer.length>1&&!this[S]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[P])]);let R=this[f](E||null,this.buffer[0]);return this[a](),R}[f](E,R){return E===R.length||E===null?this[M]():(this.buffer[0]=R.slice(E),R=R.slice(0,E),this[P]-=E),this.emit("data",R),!this.buffer.length&&!this[o]&&this.emit("drain"),R}end(E,R,x){return typeof E=="function"&&(x=E,E=null),typeof R=="function"&&(x=R,R="utf8"),E&&this.write(E,R),x&&this.once("end",x),this[o]=!0,this.writable=!1,(this.flowing||!this[C])&&this[a](),this}[F](){this[D]||(this[C]=!1,this[v]=!0,this.emit("resume"),this.buffer.length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[F]()}pause(){this[v]=!1,this[C]=!0}get destroyed(){return this[D]}get flowing(){return this[v]}get paused(){return this[C]}[T](E){this[S]?this[P]+=1:this[P]+=E.length,this.buffer.push(E)}[M](){return this.buffer.length&&(this[S]?this[P]-=1:this[P]-=this.buffer[0].length),this.buffer.shift()}[d](E){do;while(this[m](this[M]()));!E&&!this.buffer.length&&!this[o]&&this.emit("drain")}[m](E){return E?(this.emit("data",E),this.flowing):!1}pipe(E,R){if(this[D])return;let x=this[u];return R=R||{},E===r.stdout||E===r.stderr?R.end=!1:R.end=R.end!==!1,R.proxyErrors=!!R.proxyErrors,x?R.end&&E.end():(this.pipes.push(R.proxyErrors?new g(this,E,R):new q(this,E,R)),this[V]?Q(()=>this[F]()):this[F]()),E}unpipe(E){let R=this.pipes.find(x=>x.dest===E);R&&(this.pipes.splice(this.pipes.indexOf(R),1),R.unpipe())}addListener(E,R){return this.on(E,R)}on(E,R){let x=super.on(E,R);return E==="data"&&!this.pipes.length&&!this.flowing?this[F]():E==="readable"&&this[P]!==0?super.emit("readable"):L(E)&&this[u]?(super.emit(E),this.removeAllListeners(E)):E==="error"&&this[l]&&(this[V]?Q(()=>R.call(this,this[l])):R.call(this,this[l])),x}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[D]&&this.buffer.length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[h]&&this.emit("close"),this[c]=!1)}emit(E,R,...x){if(E!=="error"&&E!=="close"&&E!==D&&this[D])return;if(E==="data")return R?this[V]?Q(()=>this[U](R)):this[U](R):!1;if(E==="end")return this[W]();if(E==="close"){if(this[h]=!0,!this[u]&&!this[D])return;let $=super.emit("close");return this.removeAllListeners("close"),$}else if(E==="error"){this[l]=R;let $=super.emit("error",R);return this[a](),$}else if(E==="resume"){let $=super.emit("resume");return this[a](),$}else if(E==="finish"||E==="prefinish"){let $=super.emit(E);return this.removeAllListeners(E),$}let H=super.emit(E,R,...x);return this[a](),H}[U](E){for(let x of this.pipes)x.dest.write(E)===!1&&this.pause();let R=super.emit("data",E);return this[a](),R}[W](){this[u]||(this[u]=!0,this.readable=!1,this[V]?Q(()=>this[N]()):this[N]())}[N](){if(this[p]){let R=this[p].end();if(R){for(let x of this.pipes)x.dest.write(R);super.emit("data",R)}}for(let R of this.pipes)R.end();let E=super.emit("end");return this.removeAllListeners("end"),E}collect(){let E=[];this[S]||(E.dataLength=0);let R=this.promise();return this.on("data",x=>{E.push(x),this[S]||(E.dataLength+=x.length)}),R.then(()=>E)}concat(){return this[S]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(E=>this[S]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?E.join(""):Buffer.concat(E,E.dataLength))}promise(){return new Promise((E,R)=>{this.on(D,()=>R(new Error("stream destroyed"))),this.on("error",x=>R(x)),this.on("end",()=>E())})}[j](){return{next:()=>{let E=this.read();if(E!==null)return Promise.resolve({done:!1,value:E});if(this[o])return Promise.resolve({done:!0});let R=null,x=null,H=he=>{this.removeListener("data",$),this.removeListener("end",ie),x(he)},$=he=>{this.removeListener("error",H),this.removeListener("end",ie),this.pause(),R({value:he,done:!!this[o]})},ie=()=>{this.removeListener("error",H),this.removeListener("data",$),R({done:!0})},Y=()=>H(new Error("stream destroyed"));return new Promise((he,J)=>{x=J,R=he,this.once(D,Y),this.once("error",H),this.once("end",ie),this.once("data",$)})}}}[I](){return{next:()=>{let E=this.read();return{value:E,done:E===null}}}}destroy(E){return this[D]?(E?this.emit("error",E):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[P]=0,typeof this.close=="function"&&!this[h]&&this.close(),E?this.emit("error",E):this.emit(D),this)}static isStream(E){return!!E&&(E instanceof wR||E instanceof n||E instanceof i&&(typeof E.pipe=="function"||typeof E.write=="function"&&typeof E.end=="function"))}}}),SR=de(t=>{"use strict";ee();var e=ye("assert"),r=ye("buffer").Buffer,i=ye("zlib"),n=t.constants=PH(),s=vR(),o=r.concat,a=Symbol("_superWrite"),u=class extends Error{constructor(L){super("zlib: "+L.message),this.code=L.code,this.errno=L.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+L.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},c=Symbol("opts"),l=Symbol("flushFlag"),h=Symbol("finishFlushFlag"),f=Symbol("fullFlushFlag"),d=Symbol("handle"),m=Symbol("onError"),y=Symbol("sawError"),p=Symbol("level"),v=Symbol("strategy"),C=Symbol("ended"),F=Symbol("_defaultFullFlush"),P=class extends s{constructor(L,z){if(!L||typeof L!="object")throw new TypeError("invalid options for ZlibBase constructor");super(L),this[y]=!1,this[C]=!1,this[c]=L,this[l]=L.flush,this[h]=L.finishFlush;try{this[d]=new i[z](L)}catch(Z){throw new u(Z)}this[m]=Z=>{this[y]||(this[y]=!0,this.close(),this.emit("error",Z))},this[d].on("error",Z=>this[m](new u(Z))),this.once("end",()=>this.close)}close(){this[d]&&(this[d].close(),this[d]=null,this.emit("close"))}reset(){if(!this[y])return e(this[d],"zlib binding closed"),this[d].reset()}flush(L){this.ended||(typeof L!="number"&&(L=this[f]),this.write(Object.assign(r.alloc(0),{[l]:L})))}end(L,z,Z){return L&&this.write(L,z),this.flush(this[h]),this[C]=!0,super.end(null,null,Z)}get ended(){return this[C]}write(L,z,Z){if(typeof z=="function"&&(Z=z,z="utf8"),typeof L=="string"&&(L=r.from(L,z)),this[y])return;e(this[d],"zlib binding closed");let q=this[d]._handle,g=q.close;q.close=()=>{};let _=this[d].close;this[d].close=()=>{},r.concat=x=>x;let E;try{let x=typeof L[l]=="number"?L[l]:this[l];E=this[d]._processChunk(L,x),r.concat=o}catch(x){r.concat=o,this[m](new u(x))}finally{this[d]&&(this[d]._handle=q,q.close=g,this[d].close=_,this[d].removeAllListeners("error"))}this[d]&&this[d].on("error",x=>this[m](new u(x)));let R;if(E)if(Array.isArray(E)&&E.length>0){R=this[a](r.from(E[0]));for(let x=1;x<E.length;x++)R=this[a](E[x])}else R=this[a](r.from(E));return Z&&Z(),R}[a](L){return super.write(L)}},T=class extends P{constructor(L,z){L=L||{},L.flush=L.flush||n.Z_NO_FLUSH,L.finishFlush=L.finishFlush||n.Z_FINISH,super(L,z),this[f]=n.Z_FULL_FLUSH,this[p]=L.level,this[v]=L.strategy}params(L,z){if(!this[y]){if(!this[d])throw new Error("cannot switch params when binding is closed");if(!this[d].params)throw new Error("not supported in this implementation");if(this[p]!==L||this[v]!==z){this.flush(n.Z_SYNC_FLUSH),e(this[d],"zlib binding closed");let Z=this[d].flush;this[d].flush=(q,g)=>{this.flush(q),g()};try{this[d].params(L,z)}finally{this[d].flush=Z}this[d]&&(this[p]=L,this[v]=z)}}}},M=class extends T{constructor(L){super(L,"Deflate")}},S=class extends T{constructor(L){super(L,"Inflate")}},D=Symbol("_portable"),U=class extends T{constructor(L){super(L,"Gzip"),this[D]=L&&!!L.portable}[a](L){return this[D]?(this[D]=!1,L[9]=255,super[a](L)):super[a](L)}},W=class extends T{constructor(L){super(L,"Gunzip")}},N=class extends T{constructor(L){super(L,"DeflateRaw")}},V=class extends T{constructor(L){super(L,"InflateRaw")}},Q=class extends T{constructor(L){super(L,"Unzip")}},te=class extends P{constructor(L,z){L=L||{},L.flush=L.flush||n.BROTLI_OPERATION_PROCESS,L.finishFlush=L.finishFlush||n.BROTLI_OPERATION_FINISH,super(L,z),this[f]=n.BROTLI_OPERATION_FLUSH}},j=class extends te{constructor(L){super(L,"BrotliCompress")}},I=class extends te{constructor(L){super(L,"BrotliDecompress")}};t.Deflate=M,t.Inflate=S,t.Gzip=U,t.Gunzip=W,t.DeflateRaw=N,t.InflateRaw=V,t.Unzip=Q,typeof i.BrotliCompress=="function"?(t.BrotliCompress=j,t.BrotliDecompress=I):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),pa=de((t,e)=>{ee();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?i=>i:i=>i&&i.replace(/\\/g,"/")}),Qy=de((t,e)=>{"use strict";ee();var r=Xy(),i=pa(),n=Symbol("slurp");e.exports=class extends r{constructor(s,o,a){switch(super(),this.pause(),this.extended=o,this.globalExtended=a,this.header=s,this.startBlockSize=512*Math.ceil(s.size/512),this.blockRemain=this.startBlockSize,this.remain=s.size,this.type=s.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=i(s.path),this.mode=s.mode,this.mode&&(this.mode=this.mode&4095),this.uid=s.uid,this.gid=s.gid,this.uname=s.uname,this.gname=s.gname,this.size=s.size,this.mtime=s.mtime,this.atime=s.atime,this.ctime=s.ctime,this.linkpath=i(s.linkpath),this.uname=s.uname,this.gname=s.gname,o&&this[n](o),a&&this[n](a,!0)}write(s){let o=s.length;if(o>this.blockRemain)throw new Error("writing more to entry than is appropriate");let a=this.remain,u=this.blockRemain;return this.remain=Math.max(0,a-o),this.blockRemain=Math.max(0,u-o),this.ignore?!0:a>=o?super.write(s):super.write(s.slice(0,a))}[n](s,o){for(let a in s)s[a]!==null&&s[a]!==void 0&&!(o&&a==="path")&&(this[a]=a==="path"||a==="linkpath"?i(s[a]):s[a])}}}),xR=de(t=>{"use strict";ee(),t.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),t.code=new Map(Array.from(t.name).map(e=>[e[1],e[0]]))}),IH=de((t,e)=>{"use strict";ee();var r=(l,h)=>{if(Number.isSafeInteger(l))l<0?n(l,h):i(l,h);else throw Error("cannot encode number outside of javascript safe integer range");return h},i=(l,h)=>{h[0]=128;for(var f=h.length;f>1;f--)h[f-1]=l&255,l=Math.floor(l/256)},n=(l,h)=>{h[0]=255;var f=!1;l=l*-1;for(var d=h.length;d>1;d--){var m=l&255;l=Math.floor(l/256),f?h[d-1]=u(m):m===0?h[d-1]=0:(f=!0,h[d-1]=c(m))}},s=l=>{let h=l[0],f=h===128?a(l.slice(1,l.length)):h===255?o(l):null;if(f===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(f))throw Error("parsed number outside of javascript safe integer range");return f},o=l=>{for(var h=l.length,f=0,d=!1,m=h-1;m>-1;m--){var y=l[m],p;d?p=u(y):y===0?p=y:(d=!0,p=c(y)),p!==0&&(f-=p*Math.pow(256,h-m-1))}return f},a=l=>{for(var h=l.length,f=0,d=h-1;d>-1;d--){var m=l[d];m!==0&&(f+=m*Math.pow(256,h-d-1))}return f},u=l=>(255^l)&255,c=l=>(255^l)+1&255;e.exports={encode:r,parse:s}}),ma=de((t,e)=>{"use strict";ee();var r=xR(),i=ye("path").posix,n=IH(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(S,D,U,W){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[o]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(S)?this.decode(S,D||0,U,W):S&&this.set(S)}decode(S,D,U,W){if(D||(D=0),!S||!(S.length>=D+512))throw new Error("need 512 bytes for header");if(this.path=c(S,D,100),this.mode=f(S,D+100,8),this.uid=f(S,D+108,8),this.gid=f(S,D+116,8),this.size=f(S,D+124,12),this.mtime=l(S,D+136,12),this.cksum=f(S,D+148,12),this[s](U),this[s](W,!0),this[o]=c(S,D+156,1),this[o]===""&&(this[o]="0"),this[o]==="0"&&this.path.slice(-1)==="/"&&(this[o]="5"),this[o]==="5"&&(this.size=0),this.linkpath=c(S,D+157,100),S.slice(D+257,D+265).toString()==="ustar\x0000")if(this.uname=c(S,D+265,32),this.gname=c(S,D+297,32),this.devmaj=f(S,D+329,8),this.devmin=f(S,D+337,8),S[D+475]!==0){let V=c(S,D+345,155);this.path=V+"/"+this.path}else{let V=c(S,D+345,130);V&&(this.path=V+"/"+this.path),this.atime=l(S,D+476,12),this.ctime=l(S,D+488,12)}let N=8*32;for(let V=D;V<D+148;V++)N+=S[V];for(let V=D+156;V<D+512;V++)N+=S[V];this.cksumValid=N===this.cksum,this.cksum===null&&N===8*32&&(this.nullBlock=!0)}[s](S,D){for(let U in S)S[U]!==null&&S[U]!==void 0&&!(D&&U==="path")&&(this[U]=S[U])}encode(S,D){if(S||(S=this.block=Buffer.alloc(512),D=0),D||(D=0),!(S.length>=D+512))throw new Error("need 512 bytes for header");let U=this.ctime||this.atime?130:155,W=u(this.path||"",U),N=W[0],V=W[1];this.needPax=W[2],this.needPax=M(S,D,100,N)||this.needPax,this.needPax=p(S,D+100,8,this.mode)||this.needPax,this.needPax=p(S,D+108,8,this.uid)||this.needPax,this.needPax=p(S,D+116,8,this.gid)||this.needPax,this.needPax=p(S,D+124,12,this.size)||this.needPax,this.needPax=P(S,D+136,12,this.mtime)||this.needPax,S[D+156]=this[o].charCodeAt(0),this.needPax=M(S,D+157,100,this.linkpath)||this.needPax,S.write("ustar\x0000",D+257,8),this.needPax=M(S,D+265,32,this.uname)||this.needPax,this.needPax=M(S,D+297,32,this.gname)||this.needPax,this.needPax=p(S,D+329,8,this.devmaj)||this.needPax,this.needPax=p(S,D+337,8,this.devmin)||this.needPax,this.needPax=M(S,D+345,U,V)||this.needPax,S[D+475]!==0?this.needPax=M(S,D+345,155,V)||this.needPax:(this.needPax=M(S,D+345,130,V)||this.needPax,this.needPax=P(S,D+476,12,this.atime)||this.needPax,this.needPax=P(S,D+488,12,this.ctime)||this.needPax);let Q=8*32;for(let te=D;te<D+148;te++)Q+=S[te];for(let te=D+156;te<D+512;te++)Q+=S[te];return this.cksum=Q,p(S,D+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(S){for(let D in S)S[D]!==null&&S[D]!==void 0&&(this[D]=S[D])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(S){r.code.has(S)?this[o]=r.code.get(S):this[o]=S}},u=(S,D)=>{let U=S,W="",N,V=i.parse(S).root||".";if(Buffer.byteLength(U)<100)N=[U,W,!1];else{W=i.dirname(U),U=i.basename(U);do Buffer.byteLength(U)<=100&&Buffer.byteLength(W)<=D?N=[U,W,!1]:Buffer.byteLength(U)>100&&Buffer.byteLength(W)<=D?N=[U.slice(0,100-1),W,!0]:(U=i.join(i.basename(W),U),W=i.dirname(W));while(W!==V&&!N);N||(N=[S.slice(0,100-1),"",!0])}return N},c=(S,D,U)=>S.slice(D,D+U).toString("utf8").replace(/\0.*/,""),l=(S,D,U)=>h(f(S,D,U)),h=S=>S===null?null:new Date(S*1e3),f=(S,D,U)=>S[D]&128?n.parse(S.slice(D,D+U)):m(S,D,U),d=S=>isNaN(S)?null:S,m=(S,D,U)=>d(parseInt(S.slice(D,D+U).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},p=(S,D,U,W)=>W===null?!1:W>y[U]||W<0?(n.encode(W,S.slice(D,D+U)),!0):(v(S,D,U,W),!1),v=(S,D,U,W)=>S.write(C(W,U),D,U,"ascii"),C=(S,D)=>F(Math.floor(S).toString(8),D),F=(S,D)=>(S.length===D-1?S:new Array(D-S.length-1).join("0")+S+" ")+"\0",P=(S,D,U,W)=>W===null?!1:p(S,D,U,W.getTime()/1e3),T=new Array(156).join("\0"),M=(S,D,U,W)=>W===null?!1:(S.write(W+T,D,U,"utf8"),W.length!==Buffer.byteLength(W)||W.length>U);e.exports=a}),e0=de((t,e)=>{"use strict";ee();var r=ma(),i=ye("path"),n=class{constructor(u,c){this.atime=u.atime||null,this.charset=u.charset||null,this.comment=u.comment||null,this.ctime=u.ctime||null,this.gid=u.gid||null,this.gname=u.gname||null,this.linkpath=u.linkpath||null,this.mtime=u.mtime||null,this.path=u.path||null,this.size=u.size||null,this.uid=u.uid||null,this.uname=u.uname||null,this.dev=u.dev||null,this.ino=u.ino||null,this.nlink=u.nlink||null,this.global=c||!1}encode(){let u=this.encodeBody();if(u==="")return null;let c=Buffer.byteLength(u),l=512*Math.ceil(1+c/512),h=Buffer.allocUnsafe(l);for(let f=0;f<512;f++)h[f]=0;new r({path:("PaxHeader/"+i.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:c,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(h),h.write(u,512,c,"utf8");for(let f=c+512;f<h.length;f++)h[f]=0;return h}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(u){if(this[u]===null||this[u]===void 0)return"";let c=this[u]instanceof Date?this[u].getTime()/1e3:this[u],l=" "+(u==="dev"||u==="ino"||u==="nlink"?"SCHILY.":"")+u+"="+c+`
|
55
55
|
`,h=Buffer.byteLength(l),f=Math.floor(Math.log(h)/Math.log(10))+1;return h+f>=Math.pow(10,f)&&(f+=1),f+h+l}};n.parse=(u,c,l)=>new n(s(o(u),c),l);var s=(u,c)=>c?Object.keys(u).reduce((l,h)=>(l[h]=u[h],l),c):u,o=u=>u.replace(/\n$/,"").split(`
|
56
56
|
`).reduce(a,Object.create(null)),a=(u,c)=>{let l=parseInt(c,10);if(l!==Buffer.byteLength(c)+1)return u;c=c.slice((l+" ").length);let h=c.split("="),f=h.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!f)return u;let d=h.join("=");return u[f]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(f)?new Date(d*1e3):/^[0-9]+$/.test(d)?+d:d,u};e.exports=n}),ya=de((t,e)=>{ee(),e.exports=r=>{let i=r.length-1,n=-1;for(;i>-1&&r.charAt(i)==="/";)n=i,i--;return n===-1?r:r.slice(0,n)}}),t0=de((t,e)=>{"use strict";ee(),e.exports=r=>class extends r{warn(i,n,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=n instanceof Error&&n.code||i,s.tarCode=i,!this.strict&&s.recoverable!==!1?(n instanceof Error&&(s=Object.assign(n,s),n=n.message),this.emit("warn",s.tarCode,n,s)):n instanceof Error?this.emit("error",Object.assign(n,s)):this.emit("error",Object.assign(new Error(`${i}: ${n}`),s))}}}),DR=de((t,e)=>{"use strict";ee();var r=["|","<",">","?",":"],i=r.map(o=>String.fromCharCode(61440+o.charCodeAt(0))),n=new Map(r.map((o,a)=>[o,i[a]])),s=new Map(i.map((o,a)=>[o,r[a]]));e.exports={encode:o=>r.reduce((a,u)=>a.split(u).join(n.get(u)),o),decode:o=>i.reduce((a,u)=>a.split(u).join(s.get(u)),o)}}),AR=de((t,e)=>{ee();var{isAbsolute:r,parse:i}=ye("path").win32;e.exports=n=>{let s="",o=i(n);for(;r(n)||o.root;){let a=n.charAt(0)==="/"&&n.slice(0,4)!=="//?/"?"/":o.root;n=n.slice(a.length),s+=a,o=i(n)}return[s,n]}}),LH=de((t,e)=>{"use strict";ee(),e.exports=(r,i,n)=>(r&=4095,n&&(r=(r|384)&-19),i&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)}),CR=de((t,e)=>{"use strict";ee();var r=Xy(),i=e0(),n=ma(),s=ye("fs"),o=ye("path"),a=pa(),u=ya(),c=(_,E)=>E?(_=a(_).replace(/^\.(\/|$)/,""),u(E)+"/"+_):a(_),l=16*1024*1024,h=Symbol("process"),f=Symbol("file"),d=Symbol("directory"),m=Symbol("symlink"),y=Symbol("hardlink"),p=Symbol("header"),v=Symbol("read"),C=Symbol("lstat"),F=Symbol("onlstat"),P=Symbol("onread"),T=Symbol("onreadlink"),M=Symbol("openfile"),S=Symbol("onopenfile"),D=Symbol("close"),U=Symbol("mode"),W=Symbol("awaitDrain"),N=Symbol("ondrain"),V=Symbol("prefix"),Q=Symbol("hadError"),te=t0(),j=DR(),I=AR(),L=LH(),z=te(class extends r{constructor(_,E){if(E=E||{},super(E),typeof _!="string")throw new TypeError("path is required");this.path=a(_),this.portable=!!E.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=E.maxReadSize||l,this.linkCache=E.linkCache||new Map,this.statCache=E.statCache||new Map,this.preservePaths=!!E.preservePaths,this.cwd=a(E.cwd||process.cwd()),this.strict=!!E.strict,this.noPax=!!E.noPax,this.noMtime=!!E.noMtime,this.mtime=E.mtime||null,this.prefix=E.prefix?a(E.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof E.onwarn=="function"&&this.on("warn",E.onwarn);let R=!1;if(!this.preservePaths){let[x,H]=I(this.path);x&&(this.path=H,R=x)}this.win32=!!E.win32||process.platform==="win32",this.win32&&(this.path=j.decode(this.path.replace(/\\/g,"/")),_=_.replace(/\\/g,"/")),this.absolute=a(E.absolute||o.resolve(this.cwd,_)),this.path===""&&(this.path="./"),R&&this.warn("TAR_ENTRY_INFO",`stripping ${R} from absolute path`,{entry:this,path:R+this.path}),this.statCache.has(this.absolute)?this[F](this.statCache.get(this.absolute)):this[C]()}emit(_,...E){return _==="error"&&(this[Q]=!0),super.emit(_,...E)}[C](){s.lstat(this.absolute,(_,E)=>{if(_)return this.emit("error",_);this[F](E)})}[F](_){this.statCache.set(this.absolute,_),this.stat=_,_.isFile()||(_.size=0),this.type=g(_),this.emit("stat",_),this[h]()}[h](){switch(this.type){case"File":return this[f]();case"Directory":return this[d]();case"SymbolicLink":return this[m]();default:return this.end()}}[U](_){return L(_,this.type==="Directory",this.portable)}[V](_){return c(_,this.prefix)}[p](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new n({path:this[V](this.path),linkpath:this.type==="Link"?this[V](this.linkpath):this.linkpath,mode:this[U](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new i({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[V](this.path),linkpath:this.type==="Link"?this[V](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[d](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[p](),this.end()}[m](){s.readlink(this.absolute,(_,E)=>{if(_)return this.emit("error",_);this[T](E)})}[T](_){this.linkpath=a(_),this[p](),this.end()}[y](_){this.type="Link",this.linkpath=a(o.relative(this.cwd,_)),this.stat.size=0,this[p](),this.end()}[f](){if(this.stat.nlink>1){let _=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(_)){let E=this.linkCache.get(_);if(E.indexOf(this.cwd)===0)return this[y](E)}this.linkCache.set(_,this.absolute)}if(this[p](),this.stat.size===0)return this.end();this[M]()}[M](){s.open(this.absolute,"r",(_,E)=>{if(_)return this.emit("error",_);this[S](E)})}[S](_){if(this.fd=_,this[Q])return this[D]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let E=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(E),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[v]()}[v](){let{fd:_,buf:E,offset:R,length:x,pos:H}=this;s.read(_,E,R,x,H,($,ie)=>{if($)return this[D](()=>this.emit("error",$));this[P](ie)})}[D](_){s.close(this.fd,_)}[P](_){if(_<=0&&this.remain>0){let R=new Error("encountered unexpected EOF");return R.path=this.absolute,R.syscall="read",R.code="EOF",this[D](()=>this.emit("error",R))}if(_>this.remain){let R=new Error("did not encounter expected EOF");return R.path=this.absolute,R.syscall="read",R.code="EOF",this[D](()=>this.emit("error",R))}if(_===this.remain)for(let R=_;R<this.length&&_<this.blockRemain;R++)this.buf[R+this.offset]=0,_++,this.remain++;let E=this.offset===0&&_===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+_);this.write(E)?this[N]():this[W](()=>this[N]())}[W](_){this.once("drain",_)}write(_){if(this.blockRemain<_.length){let E=new Error("writing more data than expected");return E.path=this.absolute,this.emit("error",E)}return this.remain-=_.length,this.blockRemain-=_.length,this.pos+=_.length,this.offset+=_.length,super.write(_)}[N](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[D](_=>_?this.emit("error",_):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[v]()}}),Z=class extends z{[C](){this[F](s.lstatSync(this.absolute))}[m](){this[T](s.readlinkSync(this.absolute))}[M](){this[S](s.openSync(this.absolute,"r"))}[v](){let _=!0;try{let{fd:E,buf:R,offset:x,length:H,pos:$}=this,ie=s.readSync(E,R,x,H,$);this[P](ie),_=!1}finally{if(_)try{this[D](()=>{})}catch{}}}[W](_){_()}[D](_){s.closeSync(this.fd),_()}},q=te(class extends r{constructor(_,E){E=E||{},super(E),this.preservePaths=!!E.preservePaths,this.portable=!!E.portable,this.strict=!!E.strict,this.noPax=!!E.noPax,this.noMtime=!!E.noMtime,this.readEntry=_,this.type=_.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=E.prefix||null,this.path=a(_.path),this.mode=this[U](_.mode),this.uid=this.portable?null:_.uid,this.gid=this.portable?null:_.gid,this.uname=this.portable?null:_.uname,this.gname=this.portable?null:_.gname,this.size=_.size,this.mtime=this.noMtime?null:E.mtime||_.mtime,this.atime=this.portable?null:_.atime,this.ctime=this.portable?null:_.ctime,this.linkpath=a(_.linkpath),typeof E.onwarn=="function"&&this.on("warn",E.onwarn);let R=!1;if(!this.preservePaths){let[x,H]=I(this.path);x&&(this.path=H,R=x)}this.remain=_.size,this.blockRemain=_.startBlockSize,this.header=new n({path:this[V](this.path),linkpath:this.type==="Link"?this[V](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),R&&this.warn("TAR_ENTRY_INFO",`stripping ${R} from absolute path`,{entry:this,path:R+this.path}),this.header.encode()&&!this.noPax&&super.write(new i({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[V](this.path),linkpath:this.type==="Link"?this[V](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),_.pipe(this)}[V](_){return c(_,this.prefix)}[U](_){return L(_,this.type==="Directory",this.portable)}write(_){let E=_.length;if(E>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=E,super.write(_)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});z.Sync=Z,z.Tar=q;var g=_=>_.isFile()?"File":_.isDirectory()?"Directory":_.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=z}),BH=de((t,e)=>{"use strict";ee(),e.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let i=this.head;i;i=i.next)yield i.value}}}),RR=de((t,e)=>{"use strict";ee(),e.exports=r,r.Node=o,r.create=r;function r(a){var u=this;if(u instanceof r||(u=new r),u.tail=null,u.head=null,u.length=0,a&&typeof a.forEach=="function")a.forEach(function(h){u.push(h)});else if(arguments.length>0)for(var c=0,l=arguments.length;c<l;c++)u.push(arguments[c]);return u}r.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var u=a.next,c=a.prev;return u&&(u.prev=c),c&&(c.next=u),a===this.head&&(this.head=u),a===this.tail&&(this.tail=c),a.list.length--,a.next=null,a.prev=null,a.list=null,u},r.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var u=this.head;a.list=this,a.next=u,u&&(u.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},r.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var u=this.tail;a.list=this,a.prev=u,u&&(u.next=a),this.tail=a,this.head||(this.head=a),this.length++}},r.prototype.push=function(){for(var a=0,u=arguments.length;a<u;a++)n(this,arguments[a]);return this.length},r.prototype.unshift=function(){for(var a=0,u=arguments.length;a<u;a++)s(this,arguments[a]);return this.length},r.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},r.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},r.prototype.forEach=function(a,u){u=u||this;for(var c=this.head,l=0;c!==null;l++)a.call(u,c.value,l,this),c=c.next},r.prototype.forEachReverse=function(a,u){u=u||this;for(var c=this.tail,l=this.length-1;c!==null;l--)a.call(u,c.value,l,this),c=c.prev},r.prototype.get=function(a){for(var u=0,c=this.head;c!==null&&u<a;u++)c=c.next;if(u===a&&c!==null)return c.value},r.prototype.getReverse=function(a){for(var u=0,c=this.tail;c!==null&&u<a;u++)c=c.prev;if(u===a&&c!==null)return c.value},r.prototype.map=function(a,u){u=u||this;for(var c=new r,l=this.head;l!==null;)c.push(a.call(u,l.value,this)),l=l.next;return c},r.prototype.mapReverse=function(a,u){u=u||this;for(var c=new r,l=this.tail;l!==null;)c.push(a.call(u,l.value,this)),l=l.prev;return c},r.prototype.reduce=function(a,u){var c,l=this.head;if(arguments.length>1)c=u;else if(this.head)l=this.head.next,c=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;l!==null;h++)c=a(c,l.value,h),l=l.next;return c},r.prototype.reduceReverse=function(a,u){var c,l=this.tail;if(arguments.length>1)c=u;else if(this.tail)l=this.tail.prev,c=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=this.length-1;l!==null;h--)c=a(c,l.value,h),l=l.prev;return c},r.prototype.toArray=function(){for(var a=new Array(this.length),u=0,c=this.head;c!==null;u++)a[u]=c.value,c=c.next;return a},r.prototype.toArrayReverse=function(){for(var a=new Array(this.length),u=0,c=this.tail;c!==null;u++)a[u]=c.value,c=c.prev;return a},r.prototype.slice=function(a,u){u=u||this.length,u<0&&(u+=this.length),a=a||0,a<0&&(a+=this.length);var c=new r;if(u<a||u<0)return c;a<0&&(a=0),u>this.length&&(u=this.length);for(var l=0,h=this.head;h!==null&&l<a;l++)h=h.next;for(;h!==null&&l<u;l++,h=h.next)c.push(h.value);return c},r.prototype.sliceReverse=function(a,u){u=u||this.length,u<0&&(u+=this.length),a=a||0,a<0&&(a+=this.length);var c=new r;if(u<a||u<0)return c;a<0&&(a=0),u>this.length&&(u=this.length);for(var l=this.length,h=this.tail;h!==null&&l>u;l--)h=h.prev;for(;h!==null&&l>a;l--,h=h.prev)c.push(h.value);return c},r.prototype.splice=function(a,u,...c){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var l=0,h=this.head;h!==null&&l<a;l++)h=h.next;for(var f=[],l=0;h&&l<u;l++)f.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var l=0;l<c.length;l++)h=i(this,h,c[l]);return f},r.prototype.reverse=function(){for(var a=this.head,u=this.tail,c=a;c!==null;c=c.prev){var l=c.prev;c.prev=c.next,c.next=l}return this.head=u,this.tail=a,this};function i(a,u,c){var l=u===a.head?new o(c,null,u,a):new o(c,u,u.next,a);return l.next===null&&(a.tail=l),l.prev===null&&(a.head=l),a.length++,l}function n(a,u){a.tail=new o(u,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function s(a,u){a.head=new o(u,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function o(a,u,c,l){if(!(this instanceof o))return new o(a,u,c,l);this.list=l,this.value=a,u?(u.next=this,this.prev=u):this.prev=null,c?(c.prev=this,this.next=c):this.next=null}try{BH()(r)}catch{}}),r0=de((t,e)=>{"use strict";ee();var r=class{constructor(g,_){this.path=g||"./",this.absolute=_,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},i=Xy(),n=SR(),s=Qy(),o=CR(),a=o.Sync,u=o.Tar,c=RR(),l=Buffer.alloc(1024),h=Symbol("onStat"),f=Symbol("ended"),d=Symbol("queue"),m=Symbol("current"),y=Symbol("process"),p=Symbol("processing"),v=Symbol("processJob"),C=Symbol("jobs"),F=Symbol("jobDone"),P=Symbol("addFSEntry"),T=Symbol("addTarEntry"),M=Symbol("stat"),S=Symbol("readdir"),D=Symbol("onreaddir"),U=Symbol("pipe"),W=Symbol("entry"),N=Symbol("entryOpt"),V=Symbol("writeEntryClass"),Q=Symbol("write"),te=Symbol("ondrain"),j=ye("fs"),I=ye("path"),L=t0(),z=pa(),Z=L(class extends i{constructor(g){super(g),g=g||Object.create(null),this.opt=g,this.file=g.file||"",this.cwd=g.cwd||process.cwd(),this.maxReadSize=g.maxReadSize,this.preservePaths=!!g.preservePaths,this.strict=!!g.strict,this.noPax=!!g.noPax,this.prefix=z(g.prefix||""),this.linkCache=g.linkCache||new Map,this.statCache=g.statCache||new Map,this.readdirCache=g.readdirCache||new Map,this[V]=o,typeof g.onwarn=="function"&&this.on("warn",g.onwarn),this.portable=!!g.portable,this.zip=null,g.gzip?(typeof g.gzip!="object"&&(g.gzip={}),this.portable&&(g.gzip.portable=!0),this.zip=new n.Gzip(g.gzip),this.zip.on("data",_=>super.write(_)),this.zip.on("end",_=>super.end()),this.zip.on("drain",_=>this[te]()),this.on("resume",_=>this.zip.resume())):this.on("drain",this[te]),this.noDirRecurse=!!g.noDirRecurse,this.follow=!!g.follow,this.noMtime=!!g.noMtime,this.mtime=g.mtime||null,this.filter=typeof g.filter=="function"?g.filter:_=>!0,this[d]=new c,this[C]=0,this.jobs=+g.jobs||4,this[p]=!1,this[f]=!1}[Q](g){return super.write(g)}add(g){return this.write(g),this}end(g){return g&&this.write(g),this[f]=!0,this[y](),this}write(g){if(this[f])throw new Error("write after end");return g instanceof s?this[T](g):this[P](g),this.flowing}[T](g){let _=z(I.resolve(this.cwd,g.path));if(!this.filter(g.path,g))g.resume();else{let E=new r(g.path,_,!1);E.entry=new u(g,this[N](E)),E.entry.on("end",R=>this[F](E)),this[C]+=1,this[d].push(E)}this[y]()}[P](g){let _=z(I.resolve(this.cwd,g));this[d].push(new r(g,_)),this[y]()}[M](g){g.pending=!0,this[C]+=1;let _=this.follow?"stat":"lstat";j[_](g.absolute,(E,R)=>{g.pending=!1,this[C]-=1,E?this.emit("error",E):this[h](g,R)})}[h](g,_){this.statCache.set(g.absolute,_),g.stat=_,this.filter(g.path,_)||(g.ignore=!0),this[y]()}[S](g){g.pending=!0,this[C]+=1,j.readdir(g.absolute,(_,E)=>{if(g.pending=!1,this[C]-=1,_)return this.emit("error",_);this[D](g,E)})}[D](g,_){this.readdirCache.set(g.absolute,_),g.readdir=_,this[y]()}[y](){if(!this[p]){this[p]=!0;for(let g=this[d].head;g!==null&&this[C]<this.jobs;g=g.next)if(this[v](g.value),g.value.ignore){let _=g.next;this[d].removeNode(g),g.next=_}this[p]=!1,this[f]&&!this[d].length&&this[C]===0&&(this.zip?this.zip.end(l):(super.write(l),super.end()))}}get[m](){return this[d]&&this[d].head&&this[d].head.value}[F](g){this[d].shift(),this[C]-=1,this[y]()}[v](g){if(!g.pending){if(g.entry){g===this[m]&&!g.piped&&this[U](g);return}if(g.stat||(this.statCache.has(g.absolute)?this[h](g,this.statCache.get(g.absolute)):this[M](g)),!!g.stat&&!g.ignore&&!(!this.noDirRecurse&&g.stat.isDirectory()&&!g.readdir&&(this.readdirCache.has(g.absolute)?this[D](g,this.readdirCache.get(g.absolute)):this[S](g),!g.readdir))){if(g.entry=this[W](g),!g.entry){g.ignore=!0;return}g===this[m]&&!g.piped&&this[U](g)}}}[N](g){return{onwarn:(_,E,R)=>this.warn(_,E,R),noPax:this.noPax,cwd:this.cwd,absolute:g.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[W](g){this[C]+=1;try{return new this[V](g.path,this[N](g)).on("end",()=>this[F](g)).on("error",_=>this.emit("error",_))}catch(_){this.emit("error",_)}}[te](){this[m]&&this[m].entry&&this[m].entry.resume()}[U](g){g.piped=!0,g.readdir&&g.readdir.forEach(R=>{let x=g.path,H=x==="./"?"":x.replace(/\/*$/,"/");this[P](H+R)});let _=g.entry,E=this.zip;E?_.on("data",R=>{E.write(R)||_.pause()}):_.on("data",R=>{super.write(R)||_.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),q=class extends Z{constructor(g){super(g),this[V]=a}pause(){}resume(){}[M](g){let _=this.follow?"statSync":"lstatSync";this[h](g,j[_](g.absolute))}[S](g,_){this[D](g,j.readdirSync(g.absolute))}[U](g){let _=g.entry,E=this.zip;g.readdir&&g.readdir.forEach(R=>{let x=g.path,H=x==="./"?"":x.replace(/\/*$/,"/");this[P](H+R)}),E?_.on("data",R=>{E.write(R)}):_.on("data",R=>{super[Q](R)})}};Z.Sync=q,e.exports=Z}),ga=de(t=>{"use strict";ee();var e=vR(),r=ye("events").EventEmitter,i=ye("fs"),n=i.writev;if(!n){let g=process.binding("fs"),_=g.FSReqWrap||g.FSReqCallback;n=(E,R,x,H)=>{let $=(Y,he)=>H(Y,he,R),ie=new _;ie.oncomplete=$,g.writeBuffers(E,R,x,ie)}}var s=Symbol("_autoClose"),o=Symbol("_close"),a=Symbol("_ended"),u=Symbol("_fd"),c=Symbol("_finished"),l=Symbol("_flags"),h=Symbol("_flush"),f=Symbol("_handleChunk"),d=Symbol("_makeBuf"),m=Symbol("_mode"),y=Symbol("_needDrain"),p=Symbol("_onerror"),v=Symbol("_onopen"),C=Symbol("_onread"),F=Symbol("_onwrite"),P=Symbol("_open"),T=Symbol("_path"),M=Symbol("_pos"),S=Symbol("_queue"),D=Symbol("_read"),U=Symbol("_readSize"),W=Symbol("_reading"),N=Symbol("_remain"),V=Symbol("_size"),Q=Symbol("_write"),te=Symbol("_writing"),j=Symbol("_defaultFlag"),I=Symbol("_errored"),L=class extends e{constructor(g,_){if(_=_||{},super(_),this.readable=!0,this.writable=!1,typeof g!="string")throw new TypeError("path must be a string");this[I]=!1,this[u]=typeof _.fd=="number"?_.fd:null,this[T]=g,this[U]=_.readSize||16*1024*1024,this[W]=!1,this[V]=typeof _.size=="number"?_.size:1/0,this[N]=this[V],this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0,typeof this[u]=="number"?this[D]():this[P]()}get fd(){return this[u]}get path(){return this[T]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[P](){i.open(this[T],"r",(g,_)=>this[v](g,_))}[v](g,_){g?this[p](g):(this[u]=_,this.emit("open",_),this[D]())}[d](){return Buffer.allocUnsafe(Math.min(this[U],this[N]))}[D](){if(!this[W]){this[W]=!0;let g=this[d]();if(g.length===0)return process.nextTick(()=>this[C](null,0,g));i.read(this[u],g,0,g.length,null,(_,E,R)=>this[C](_,E,R))}}[C](g,_,E){this[W]=!1,g?this[p](g):this[f](_,E)&&this[D]()}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.close(g,_=>_?this.emit("error",_):this.emit("close"))}}[p](g){this[W]=!0,this[o](),this.emit("error",g)}[f](g,_){let E=!1;return this[N]-=g,g>0&&(E=super.write(g<_.length?_.slice(0,g):_)),(g===0||this[N]<=0)&&(E=!1,this[o](),super.end()),E}emit(g,_){switch(g){case"prefinish":case"finish":break;case"drain":typeof this[u]=="number"&&this[D]();break;case"error":return this[I]?void 0:(this[I]=!0,super.emit(g,_));default:return super.emit(g,_)}}},z=class extends L{[P](){let g=!0;try{this[v](null,i.openSync(this[T],"r")),g=!1}finally{g&&this[o]()}}[D](){let g=!0;try{if(!this[W]){this[W]=!0;do{let _=this[d](),E=_.length===0?0:i.readSync(this[u],_,0,_.length,null);if(!this[f](E,_))break}while(!0);this[W]=!1}g=!1}finally{g&&this[o]()}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.closeSync(g),this.emit("close")}}},Z=class extends r{constructor(g,_){_=_||{},super(_),this.readable=!1,this.writable=!0,this[I]=!1,this[te]=!1,this[a]=!1,this[y]=!1,this[S]=[],this[T]=g,this[u]=typeof _.fd=="number"?_.fd:null,this[m]=_.mode===void 0?438:_.mode,this[M]=typeof _.start=="number"?_.start:null,this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0;let E=this[M]!==null?"r+":"w";this[j]=_.flags===void 0,this[l]=this[j]?E:_.flags,this[u]===null&&this[P]()}emit(g,_){if(g==="error"){if(this[I])return;this[I]=!0}return super.emit(g,_)}get fd(){return this[u]}get path(){return this[T]}[p](g){this[o](),this[te]=!0,this.emit("error",g)}[P](){i.open(this[T],this[l],this[m],(g,_)=>this[v](g,_))}[v](g,_){this[j]&&this[l]==="r+"&&g&&g.code==="ENOENT"?(this[l]="w",this[P]()):g?this[p](g):(this[u]=_,this.emit("open",_),this[h]())}end(g,_){return g&&this.write(g,_),this[a]=!0,!this[te]&&!this[S].length&&typeof this[u]=="number"&&this[F](null,0),this}write(g,_){return typeof g=="string"&&(g=Buffer.from(g,_)),this[a]?(this.emit("error",new Error("write() after end()")),!1):this[u]===null||this[te]||this[S].length?(this[S].push(g),this[y]=!0,!1):(this[te]=!0,this[Q](g),!0)}[Q](g){i.write(this[u],g,0,g.length,this[M],(_,E)=>this[F](_,E))}[F](g,_){g?this[p](g):(this[M]!==null&&(this[M]+=_),this[S].length?this[h]():(this[te]=!1,this[a]&&!this[c]?(this[c]=!0,this[o](),this.emit("finish")):this[y]&&(this[y]=!1,this.emit("drain"))))}[h](){if(this[S].length===0)this[a]&&this[F](null,0);else if(this[S].length===1)this[Q](this[S].pop());else{let g=this[S];this[S]=[],n(this[u],g,this[M],(_,E)=>this[F](_,E))}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.close(g,_=>_?this.emit("error",_):this.emit("close"))}}},q=class extends Z{[P](){let g;if(this[j]&&this[l]==="r+")try{g=i.openSync(this[T],this[l],this[m])}catch(_){if(_.code==="ENOENT")return this[l]="w",this[P]();throw _}else g=i.openSync(this[T],this[l],this[m]);this[v](null,g)}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.closeSync(g),this.emit("close")}}[Q](g){let _=!0;try{this[F](null,i.writeSync(this[u],g,0,g.length,this[M])),_=!1}finally{if(_)try{this[o]()}catch{}}}};t.ReadStream=L,t.ReadStreamSync=z,t.WriteStream=Z,t.WriteStreamSync=q}),i0=de((t,e)=>{"use strict";ee();var r=t0(),i=ma(),n=ye("events"),s=RR(),o=1024*1024,a=Qy(),u=e0(),c=SR(),{nextTick:l}=ye("process"),h=Buffer.from([31,139]),f=Symbol("state"),d=Symbol("writeEntry"),m=Symbol("readEntry"),y=Symbol("nextEntry"),p=Symbol("processEntry"),v=Symbol("extendedHeader"),C=Symbol("globalExtendedHeader"),F=Symbol("meta"),P=Symbol("emitMeta"),T=Symbol("buffer"),M=Symbol("queue"),S=Symbol("ended"),D=Symbol("emittedEnd"),U=Symbol("emit"),W=Symbol("unzip"),N=Symbol("consumeChunk"),V=Symbol("consumeChunkSub"),Q=Symbol("consumeBody"),te=Symbol("consumeMeta"),j=Symbol("consumeHeader"),I=Symbol("consuming"),L=Symbol("bufferConcat"),z=Symbol("maybeEnd"),Z=Symbol("writing"),q=Symbol("aborted"),g=Symbol("onDone"),_=Symbol("sawValidEntry"),E=Symbol("sawNullBlock"),R=Symbol("sawEOF"),x=Symbol("closeStream"),H=$=>!0;e.exports=r(class extends n{constructor($){$=$||{},super($),this.file=$.file||"",this[_]=null,this.on(g,ie=>{(this[f]==="begin"||this[_]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),$.ondone?this.on(g,$.ondone):this.on(g,ie=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!$.strict,this.maxMetaEntrySize=$.maxMetaEntrySize||o,this.filter=typeof $.filter=="function"?$.filter:H,this.writable=!0,this.readable=!1,this[M]=new s,this[T]=null,this[m]=null,this[d]=null,this[f]="begin",this[F]="",this[v]=null,this[C]=null,this[S]=!1,this[W]=null,this[q]=!1,this[E]=!1,this[R]=!1,this.on("end",()=>this[x]()),typeof $.onwarn=="function"&&this.on("warn",$.onwarn),typeof $.onentry=="function"&&this.on("entry",$.onentry)}[j]($,ie){this[_]===null&&(this[_]=!1);let Y;try{Y=new i($,ie,this[v],this[C])}catch(he){return this.warn("TAR_ENTRY_INVALID",he)}if(Y.nullBlock)this[E]?(this[R]=!0,this[f]==="begin"&&(this[f]="header"),this[U]("eof")):(this[E]=!0,this[U]("nullBlock"));else if(this[E]=!1,!Y.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:Y});else if(!Y.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:Y});else{let he=Y.type;if(/^(Symbolic)?Link$/.test(he)&&!Y.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:Y});else if(!/^(Symbolic)?Link$/.test(he)&&Y.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:Y});else{let J=this[d]=new a(Y,this[v],this[C]);if(!this[_])if(J.remain){let w=()=>{J.invalid||(this[_]=!0)};J.on("end",w)}else this[_]=!0;J.meta?J.size>this.maxMetaEntrySize?(J.ignore=!0,this[U]("ignoredEntry",J),this[f]="ignore",J.resume()):J.size>0&&(this[F]="",J.on("data",w=>this[F]+=w),this[f]="meta"):(this[v]=null,J.ignore=J.ignore||!this.filter(J.path,J),J.ignore?(this[U]("ignoredEntry",J),this[f]=J.remain?"ignore":"header",J.resume()):(J.remain?this[f]="body":(this[f]="header",J.end()),this[m]?this[M].push(J):(this[M].push(J),this[y]())))}}}[x](){l(()=>this.emit("close"))}[p]($){let ie=!0;return $?Array.isArray($)?this.emit.apply(this,$):(this[m]=$,this.emit("entry",$),$.emittedEnd||($.on("end",Y=>this[y]()),ie=!1)):(this[m]=null,ie=!1),ie}[y](){do;while(this[p](this[M].shift()));if(!this[M].length){let $=this[m];!$||$.flowing||$.size===$.remain?this[Z]||this.emit("drain"):$.once("drain",ie=>this.emit("drain"))}}[Q]($,ie){let Y=this[d],he=Y.blockRemain,J=he>=$.length&&ie===0?$:$.slice(ie,ie+he);return Y.write(J),Y.blockRemain||(this[f]="header",this[d]=null,Y.end()),J.length}[te]($,ie){let Y=this[d],he=this[Q]($,ie);return this[d]||this[P](Y),he}[U]($,ie,Y){!this[M].length&&!this[m]?this.emit($,ie,Y):this[M].push([$,ie,Y])}[P]($){switch(this[U]("meta",this[F]),$.type){case"ExtendedHeader":case"OldExtendedHeader":this[v]=u.parse(this[F],this[v],!1);break;case"GlobalExtendedHeader":this[C]=u.parse(this[F],this[C],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[v]=this[v]||Object.create(null),this[v].path=this[F].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[v]=this[v]||Object.create(null),this[v].linkpath=this[F].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+$.type)}}abort($){this[q]=!0,this.emit("abort",$),this.warn("TAR_ABORT",$,{recoverable:!1})}write($){if(this[q])return;if(this[W]===null&&$){if(this[T]&&($=Buffer.concat([this[T],$]),this[T]=null),$.length<h.length)return this[T]=$,!0;for(let Y=0;this[W]===null&&Y<h.length;Y++)$[Y]!==h[Y]&&(this[W]=!1);if(this[W]===null){let Y=this[S];this[S]=!1,this[W]=new c.Unzip,this[W].on("data",J=>this[N](J)),this[W].on("error",J=>this.abort(J)),this[W].on("end",J=>{this[S]=!0,this[N]()}),this[Z]=!0;let he=this[W][Y?"end":"write"]($);return this[Z]=!1,he}}this[Z]=!0,this[W]?this[W].write($):this[N]($),this[Z]=!1;let ie=this[M].length?!1:this[m]?this[m].flowing:!0;return!ie&&!this[M].length&&this[m].once("drain",Y=>this.emit("drain")),ie}[L]($){$&&!this[q]&&(this[T]=this[T]?Buffer.concat([this[T],$]):$)}[z](){if(this[S]&&!this[D]&&!this[q]&&!this[I]){this[D]=!0;let $=this[d];if($&&$.blockRemain){let ie=this[T]?this[T].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${$.blockRemain} more bytes, only ${ie} available)`,{entry:$}),this[T]&&$.write(this[T]),$.end()}this[U](g)}}[N]($){if(this[I])this[L]($);else if(!$&&!this[T])this[z]();else{if(this[I]=!0,this[T]){this[L]($);let ie=this[T];this[T]=null,this[V](ie)}else this[V]($);for(;this[T]&&this[T].length>=512&&!this[q]&&!this[R];){let ie=this[T];this[T]=null,this[V](ie)}this[I]=!1}(!this[T]||this[S])&&this[z]()}[V]($){let ie=0,Y=$.length;for(;ie+512<=Y&&!this[q]&&!this[R];)switch(this[f]){case"begin":case"header":this[j]($,ie),ie+=512;break;case"ignore":case"body":ie+=this[Q]($,ie);break;case"meta":ie+=this[te]($,ie);break;default:throw new Error("invalid state: "+this[f])}ie<Y&&(this[T]?this[T]=Buffer.concat([$.slice(ie),this[T]]):this[T]=$.slice(ie))}end($){this[q]||(this[W]?this[W].end($):(this[S]=!0,this.write($)))}})}),n0=de((t,e)=>{"use strict";ee();var r=da(),i=i0(),n=ye("fs"),s=ga(),o=ye("path"),a=ya();e.exports=(d,m,y)=>{typeof d=="function"?(y=d,m=null,d={}):Array.isArray(d)&&(m=d,d={}),typeof m=="function"&&(y=m,m=null),m?m=Array.from(m):m=[];let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return m.length&&c(p,m),p.noResume||u(p),p.file&&p.sync?l(p):p.file?h(p,y):f(p)};var u=d=>{let m=d.onentry;d.onentry=m?y=>{m(y),y.resume()}:y=>y.resume()},c=(d,m)=>{let y=new Map(m.map(C=>[a(C),!0])),p=d.filter,v=(C,F)=>{let P=F||o.parse(C).root||".",T=C===P?!1:y.has(C)?y.get(C):v(o.dirname(C),P);return y.set(C,T),T};d.filter=p?(C,F)=>p(C,F)&&v(a(C)):C=>v(a(C))},l=d=>{let m=f(d),y=d.file,p=!0,v;try{let C=n.statSync(y),F=d.maxReadSize||16*1024*1024;if(C.size<F)m.end(n.readFileSync(y));else{let P=0,T=Buffer.allocUnsafe(F);for(v=n.openSync(y,"r");P<C.size;){let M=n.readSync(v,T,0,F,P);P+=M,m.write(T.slice(0,M))}m.end()}p=!1}finally{if(p&&v)try{n.closeSync(v)}catch{}}},h=(d,m)=>{let y=new i(d),p=d.maxReadSize||16*1024*1024,v=d.file,C=new Promise((F,P)=>{y.on("error",P),y.on("end",F),n.stat(v,(T,M)=>{if(T)P(T);else{let S=new s.ReadStream(v,{readSize:p,size:M.size});S.on("error",P),S.pipe(y)}})});return m?C.then(m,m):C},f=d=>new i(d)}),NH=de((t,e)=>{"use strict";ee();var r=da(),i=r0(),n=ga(),s=n0(),o=ye("path");e.exports=(d,m,y)=>{if(typeof m=="function"&&(y=m),Array.isArray(d)&&(m=d,d={}),!m||!Array.isArray(m)||!m.length)throw new TypeError("no files or directories specified");m=Array.from(m);let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return p.file&&p.sync?a(p,m):p.file?u(p,m,y):p.sync?h(p,m):f(p,m)};var a=(d,m)=>{let y=new i.Sync(d),p=new n.WriteStreamSync(d.file,{mode:d.mode||438});y.pipe(p),c(y,m)},u=(d,m,y)=>{let p=new i(d),v=new n.WriteStream(d.file,{mode:d.mode||438});p.pipe(v);let C=new Promise((F,P)=>{v.on("error",P),v.on("close",F),p.on("error",P)});return l(p,m),y?C.then(y,y):C},c=(d,m)=>{m.forEach(y=>{y.charAt(0)==="@"?s({file:o.resolve(d.cwd,y.slice(1)),sync:!0,noResume:!0,onentry:p=>d.add(p)}):d.add(y)}),d.end()},l=(d,m)=>{for(;m.length;){let y=m.shift();if(y.charAt(0)==="@")return s({file:o.resolve(d.cwd,y.slice(1)),noResume:!0,onentry:p=>d.add(p)}).then(p=>l(d,m));d.add(y)}d.end()},h=(d,m)=>{let y=new i.Sync(d);return c(y,m),y},f=(d,m)=>{let y=new i(d);return l(y,m),y}}),TR=de((t,e)=>{"use strict";ee();var r=da(),i=r0(),n=ye("fs"),s=ga(),o=n0(),a=ye("path"),u=ma();e.exports=(m,y,p)=>{let v=r(m);if(!v.file)throw new TypeError("file is required");if(v.gzip)throw new TypeError("cannot append to compressed archives");if(!y||!Array.isArray(y)||!y.length)throw new TypeError("no files or directories specified");return y=Array.from(y),v.sync?c(v,y):h(v,y,p)};var c=(m,y)=>{let p=new i.Sync(m),v=!0,C,F;try{try{C=n.openSync(m.file,"r+")}catch(M){if(M.code==="ENOENT")C=n.openSync(m.file,"w+");else throw M}let P=n.fstatSync(C),T=Buffer.alloc(512);e:for(F=0;F<P.size;F+=512){for(let D=0,U=0;D<512;D+=U){if(U=n.readSync(C,T,D,T.length-D,F+D),F===0&&T[0]===31&&T[1]===139)throw new Error("cannot append to compressed archives");if(!U)break e}let M=new u(T);if(!M.cksumValid)break;let S=512*Math.ceil(M.size/512);if(F+S+512>P.size)break;F+=S,m.mtimeCache&&m.mtimeCache.set(M.path,M.mtime)}v=!1,l(m,p,F,C,y)}finally{if(v)try{n.closeSync(C)}catch{}}},l=(m,y,p,v,C)=>{let F=new s.WriteStreamSync(m.file,{fd:v,start:p});y.pipe(F),f(y,C)},h=(m,y,p)=>{y=Array.from(y);let v=new i(m),C=(P,T,M)=>{let S=(V,Q)=>{V?n.close(P,te=>M(V)):M(null,Q)},D=0;if(T===0)return S(null,0);let U=0,W=Buffer.alloc(512),N=(V,Q)=>{if(V)return S(V);if(U+=Q,U<512&&Q)return n.read(P,W,U,W.length-U,D+U,N);if(D===0&&W[0]===31&&W[1]===139)return S(new Error("cannot append to compressed archives"));if(U<512)return S(null,D);let te=new u(W);if(!te.cksumValid)return S(null,D);let j=512*Math.ceil(te.size/512);if(D+j+512>T||(D+=j+512,D>=T))return S(null,D);m.mtimeCache&&m.mtimeCache.set(te.path,te.mtime),U=0,n.read(P,W,0,512,D,N)};n.read(P,W,0,512,D,N)},F=new Promise((P,T)=>{v.on("error",T);let M="r+",S=(D,U)=>{if(D&&D.code==="ENOENT"&&M==="r+")return M="w+",n.open(m.file,M,S);if(D)return T(D);n.fstat(U,(W,N)=>{if(W)return n.close(U,()=>T(W));C(U,N.size,(V,Q)=>{if(V)return T(V);let te=new s.WriteStream(m.file,{fd:U,start:Q});v.pipe(te),te.on("error",T),te.on("close",P),d(v,y)})})};n.open(m.file,M,S)});return p?F.then(p,p):F},f=(m,y)=>{y.forEach(p=>{p.charAt(0)==="@"?o({file:a.resolve(m.cwd,p.slice(1)),sync:!0,noResume:!0,onentry:v=>m.add(v)}):m.add(p)}),m.end()},d=(m,y)=>{for(;y.length;){let p=y.shift();if(p.charAt(0)==="@")return o({file:a.resolve(m.cwd,p.slice(1)),noResume:!0,onentry:v=>m.add(v)}).then(v=>d(m,y));m.add(p)}m.end()}}),MH=de((t,e)=>{"use strict";ee();var r=da(),i=TR();e.exports=(s,o,a)=>{let u=r(s);if(!u.file)throw new TypeError("file is required");if(u.gzip)throw new TypeError("cannot append to compressed archives");if(!o||!Array.isArray(o)||!o.length)throw new TypeError("no files or directories specified");return o=Array.from(o),n(u),i(u,o,a)};var n=s=>{let o=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=o?(a,u)=>o(a,u)&&!(s.mtimeCache.get(a)>u.mtime):(a,u)=>!(s.mtimeCache.get(a)>u.mtime)}}),jH=de((t,e)=>{ee();var{promisify:r}=ye("util"),i=ye("fs"),n=s=>{if(!s)s={mode:511,fs:i};else if(typeof s=="object")s={mode:511,fs:i,...s};else if(typeof s=="number")s={mode:s,fs:i};else if(typeof s=="string")s={mode:parseInt(s,8),fs:i};else throw new TypeError("invalid options argument");return s.mkdir=s.mkdir||s.fs.mkdir||i.mkdir,s.mkdirAsync=r(s.mkdir),s.stat=s.stat||s.fs.stat||i.stat,s.statAsync=r(s.stat),s.statSync=s.statSync||s.fs.statSync||i.statSync,s.mkdirSync=s.mkdirSync||s.fs.mkdirSync||i.mkdirSync,s};e.exports=n}),qH=de((t,e)=>{ee();var r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:i,parse:n}=ye("path"),s=o=>{if(/\0/.test(o))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:o,code:"ERR_INVALID_ARG_VALUE"});if(o=i(o),r==="win32"){let a=/[*|"<>?:]/,{root:u}=n(o);if(a.test(o.substr(u.length)))throw Object.assign(new Error("Illegal characters in path."),{path:o,code:"EINVAL"})}return o};e.exports=s}),UH=de((t,e)=>{ee();var{dirname:r}=ye("path"),i=(s,o,a=void 0)=>a===o?Promise.resolve():s.statAsync(o).then(u=>u.isDirectory()?a:void 0,u=>u.code==="ENOENT"?i(s,r(o),o):void 0),n=(s,o,a=void 0)=>{if(a!==o)try{return s.statSync(o).isDirectory()?a:void 0}catch(u){return u.code==="ENOENT"?n(s,r(o),o):void 0}};e.exports={findMade:i,findMadeSync:n}}),kR=de((t,e)=>{ee();var{dirname:r}=ye("path"),i=(s,o,a)=>{o.recursive=!1;let u=r(s);return u===s?o.mkdirAsync(s,o).catch(c=>{if(c.code!=="EISDIR")throw c}):o.mkdirAsync(s,o).then(()=>a||s,c=>{if(c.code==="ENOENT")return i(u,o).then(l=>i(s,o,l));if(c.code!=="EEXIST"&&c.code!=="EROFS")throw c;return o.statAsync(s).then(l=>{if(l.isDirectory())return a;throw c},()=>{throw c})})},n=(s,o,a)=>{let u=r(s);if(o.recursive=!1,u===s)try{return o.mkdirSync(s,o)}catch(c){if(c.code!=="EISDIR")throw c;return}try{return o.mkdirSync(s,o),a||s}catch(c){if(c.code==="ENOENT")return n(s,o,n(u,o,a));if(c.code!=="EEXIST"&&c.code!=="EROFS")throw c;try{if(!o.statSync(s).isDirectory())throw c}catch{throw c}}};e.exports={mkdirpManual:i,mkdirpManualSync:n}}),HH=de((t,e)=>{ee();var{dirname:r}=ye("path"),{findMade:i,findMadeSync:n}=UH(),{mkdirpManual:s,mkdirpManualSync:o}=kR(),a=(c,l)=>(l.recursive=!0,r(c)===c?l.mkdirAsync(c,l):i(l,c).then(h=>l.mkdirAsync(c,l).then(()=>h).catch(f=>{if(f.code==="ENOENT")return s(c,l);throw f}))),u=(c,l)=>{if(l.recursive=!0,r(c)===c)return l.mkdirSync(c,l);let h=n(l,c);try{return l.mkdirSync(c,l),h}catch(f){if(f.code==="ENOENT")return o(c,l);throw f}};e.exports={mkdirpNative:a,mkdirpNativeSync:u}}),$H=de((t,e)=>{ee();var r=ye("fs"),i=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,n=i.replace(/^v/,"").split("."),s=+n[0]>10||+n[0]==10&&+n[1]>=12,o=s?u=>u.mkdir===r.mkdir:()=>!1,a=s?u=>u.mkdirSync===r.mkdirSync:()=>!1;e.exports={useNative:o,useNativeSync:a}}),zH=de((t,e)=>{ee();var r=jH(),i=qH(),{mkdirpNative:n,mkdirpNativeSync:s}=HH(),{mkdirpManual:o,mkdirpManualSync:a}=kR(),{useNative:u,useNativeSync:c}=$H(),l=(f,d)=>(f=i(f),d=r(d),u(d)?n(f,d):o(f,d)),h=(f,d)=>(f=i(f),d=r(d),c(d)?s(f,d):a(f,d));l.sync=h,l.native=(f,d)=>n(i(f),r(d)),l.manual=(f,d)=>o(i(f),r(d)),l.nativeSync=(f,d)=>s(i(f),r(d)),l.manualSync=(f,d)=>a(i(f),r(d)),e.exports=l}),GH=de((t,e)=>{"use strict";ee();var r=ye("fs"),i=ye("path"),n=r.lchown?"lchown":"chown",s=r.lchownSync?"lchownSync":"chownSync",o=r.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),a=(F,P,T)=>{try{return r[s](F,P,T)}catch(M){if(M.code!=="ENOENT")throw M}},u=(F,P,T)=>{try{return r.chownSync(F,P,T)}catch(M){if(M.code!=="ENOENT")throw M}},c=o?(F,P,T,M)=>S=>{!S||S.code!=="EISDIR"?M(S):r.chown(F,P,T,M)}:(F,P,T,M)=>M,l=o?(F,P,T)=>{try{return a(F,P,T)}catch(M){if(M.code!=="EISDIR")throw M;u(F,P,T)}}:(F,P,T)=>a(F,P,T),h=process.version,f=(F,P,T)=>r.readdir(F,P,T),d=(F,P)=>r.readdirSync(F,P);/^v4\./.test(h)&&(f=(F,P,T)=>r.readdir(F,T));var m=(F,P,T,M)=>{r[n](F,P,T,c(F,P,T,S=>{M(S&&S.code!=="ENOENT"?S:null)}))},y=(F,P,T,M,S)=>{if(typeof P=="string")return r.lstat(i.resolve(F,P),(D,U)=>{if(D)return S(D.code!=="ENOENT"?D:null);U.name=P,y(F,U,T,M,S)});if(P.isDirectory())p(i.resolve(F,P.name),T,M,D=>{if(D)return S(D);let U=i.resolve(F,P.name);m(U,T,M,S)});else{let D=i.resolve(F,P.name);m(D,T,M,S)}},p=(F,P,T,M)=>{f(F,{withFileTypes:!0},(S,D)=>{if(S){if(S.code==="ENOENT")return M();if(S.code!=="ENOTDIR"&&S.code!=="ENOTSUP")return M(S)}if(S||!D.length)return m(F,P,T,M);let U=D.length,W=null,N=V=>{if(!W){if(V)return M(W=V);if(--U===0)return m(F,P,T,M)}};D.forEach(V=>y(F,V,P,T,N))})},v=(F,P,T,M)=>{if(typeof P=="string")try{let S=r.lstatSync(i.resolve(F,P));S.name=P,P=S}catch(S){if(S.code==="ENOENT")return;throw S}P.isDirectory()&&C(i.resolve(F,P.name),T,M),l(i.resolve(F,P.name),T,M)},C=(F,P,T)=>{let M;try{M=d(F,{withFileTypes:!0})}catch(S){if(S.code==="ENOENT")return;if(S.code==="ENOTDIR"||S.code==="ENOTSUP")return l(F,P,T);throw S}return M&&M.length&&M.forEach(S=>v(F,S,P,T)),l(F,P,T)};e.exports=p,p.sync=C}),WH=de((t,e)=>{"use strict";ee();var r=zH(),i=ye("fs"),n=ye("path"),s=GH(),o=pa(),a=class extends Error{constructor(y,p){super("Cannot extract through symbolic link"),this.path=p,this.symlink=y}get name(){return"SylinkError"}},u=class extends Error{constructor(y,p){super(p+": Cannot cd into '"+y+"'"),this.path=y,this.code=p}get name(){return"CwdError"}},c=(y,p)=>y.get(o(p)),l=(y,p,v)=>y.set(o(p),v),h=(y,p)=>{i.stat(y,(v,C)=>{(v||!C.isDirectory())&&(v=new u(y,v&&v.code||"ENOTDIR")),p(v)})};e.exports=(y,p,v)=>{y=o(y);let C=p.umask,F=p.mode|448,P=(F&C)!==0,T=p.uid,M=p.gid,S=typeof T=="number"&&typeof M=="number"&&(T!==p.processUid||M!==p.processGid),D=p.preserve,U=p.unlink,W=p.cache,N=o(p.cwd),V=(te,j)=>{te?v(te):(l(W,y,!0),j&&S?s(j,T,M,I=>V(I)):P?i.chmod(y,F,v):v())};if(W&&c(W,y)===!0)return V();if(y===N)return h(y,V);if(D)return r(y,{mode:F}).then(te=>V(null,te),V);let Q=o(n.relative(N,y)).split("/");f(N,Q,F,W,U,N,null,V)};var f=(y,p,v,C,F,P,T,M)=>{if(!p.length)return M(null,T);let S=p.shift(),D=o(n.resolve(y+"/"+S));if(c(C,D))return f(D,p,v,C,F,P,T,M);i.mkdir(D,v,d(D,p,v,C,F,P,T,M))},d=(y,p,v,C,F,P,T,M)=>S=>{S?i.lstat(y,(D,U)=>{if(D)D.path=D.path&&o(D.path),M(D);else if(U.isDirectory())f(y,p,v,C,F,P,T,M);else if(F)i.unlink(y,W=>{if(W)return M(W);i.mkdir(y,v,d(y,p,v,C,F,P,T,M))});else{if(U.isSymbolicLink())return M(new a(y,y+"/"+p.join("/")));M(S)}}):(T=T||y,f(y,p,v,C,F,P,T,M))},m=y=>{let p=!1,v="ENOTDIR";try{p=i.statSync(y).isDirectory()}catch(C){v=C.code}finally{if(!p)throw new u(y,v)}};e.exports.sync=(y,p)=>{y=o(y);let v=p.umask,C=p.mode|448,F=(C&v)!==0,P=p.uid,T=p.gid,M=typeof P=="number"&&typeof T=="number"&&(P!==p.processUid||T!==p.processGid),S=p.preserve,D=p.unlink,U=p.cache,W=o(p.cwd),N=te=>{l(U,y,!0),te&&M&&s.sync(te,P,T),F&&i.chmodSync(y,C)};if(U&&c(U,y)===!0)return N();if(y===W)return m(W),N();if(S)return N(r.sync(y,C));let V=o(n.relative(W,y)).split("/"),Q=null;for(let te=V.shift(),j=W;te&&(j+="/"+te);te=V.shift())if(j=o(n.resolve(j)),!c(U,j))try{i.mkdirSync(j,C),Q=Q||j,l(U,j,!0)}catch{let I=i.lstatSync(j);if(I.isDirectory()){l(U,j,!0);continue}else if(D){i.unlinkSync(j),i.mkdirSync(j,C),Q=Q||j,l(U,j,!0);continue}else if(I.isSymbolicLink())return new a(j,j+"/"+V.join("/"))}return N(Q)}}),OR=de((t,e)=>{ee();var r=Object.create(null),{hasOwnProperty:i}=Object.prototype;e.exports=n=>(i.call(r,n)||(r[n]=n.normalize("NFKD")),r[n])}),VH=de((t,e)=>{ee();var r=ye("assert"),i=OR(),n=ya(),{join:s}=ye("path"),o=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,a=o==="win32";e.exports=()=>{let u=new Map,c=new Map,l=p=>p.split("/").slice(0,-1).reduce((v,C)=>(v.length&&(C=s(v[v.length-1],C)),v.push(C||"/"),v),[]),h=new Set,f=p=>{let v=c.get(p);if(!v)throw new Error("function does not have any path reservations");return{paths:v.paths.map(C=>u.get(C)),dirs:[...v.dirs].map(C=>u.get(C))}},d=p=>{let{paths:v,dirs:C}=f(p);return v.every(F=>F[0]===p)&&C.every(F=>F[0]instanceof Set&&F[0].has(p))},m=p=>h.has(p)||!d(p)?!1:(h.add(p),p(()=>y(p)),!0),y=p=>{if(!h.has(p))return!1;let{paths:v,dirs:C}=c.get(p),F=new Set;return v.forEach(P=>{let T=u.get(P);r.equal(T[0],p),T.length===1?u.delete(P):(T.shift(),typeof T[0]=="function"?F.add(T[0]):T[0].forEach(M=>F.add(M)))}),C.forEach(P=>{let T=u.get(P);r(T[0]instanceof Set),T[0].size===1&&T.length===1?u.delete(P):T[0].size===1?(T.shift(),F.add(T[0])):T[0].delete(p)}),h.delete(p),F.forEach(P=>m(P)),!0};return{check:d,reserve:(p,v)=>{p=a?["win32 parallelization disabled"]:p.map(F=>i(n(s(F))).toLowerCase());let C=new Set(p.map(F=>l(F)).reduce((F,P)=>F.concat(P)));return c.set(v,{dirs:C,paths:p}),p.forEach(F=>{let P=u.get(F);P?P.push(v):u.set(F,[v])}),C.forEach(F=>{let P=u.get(F);P?P[P.length-1]instanceof Set?P[P.length-1].add(v):P.push(new Set([v])):u.set(F,[new Set([v])])}),m(v)}}}}),YH=de((t,e)=>{ee();var r=process.env.__FAKE_PLATFORM__||process.platform,i=r==="win32",n=global.__FAKE_TESTING_FS__||ye("fs"),{O_CREAT:s,O_TRUNC:o,O_WRONLY:a,UV_FS_O_FILEMAP:u=0}=n.constants,c=i&&!!u,l=512*1024,h=u|o|s|a;e.exports=c?f=>f<l?h:"w":()=>"w"}),FR=de((t,e)=>{"use strict";ee();var r=ye("assert"),i=i0(),n=ye("fs"),s=ga(),o=ye("path"),a=WH(),u=DR(),c=VH(),l=AR(),h=pa(),f=ya(),d=OR(),m=Symbol("onEntry"),y=Symbol("checkFs"),p=Symbol("checkFs2"),v=Symbol("pruneCache"),C=Symbol("isReusable"),F=Symbol("makeFs"),P=Symbol("file"),T=Symbol("directory"),M=Symbol("link"),S=Symbol("symlink"),D=Symbol("hardlink"),U=Symbol("unsupported"),W=Symbol("checkPath"),N=Symbol("mkdir"),V=Symbol("onError"),Q=Symbol("pending"),te=Symbol("pend"),j=Symbol("unpend"),I=Symbol("ended"),L=Symbol("maybeClose"),z=Symbol("skip"),Z=Symbol("doChown"),q=Symbol("uid"),g=Symbol("gid"),_=Symbol("checkedCwd"),E=ye("crypto"),R=YH(),x=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,H=x==="win32",$=(b,G)=>{if(!H)return n.unlink(b,G);let re=b+".DELETE."+E.randomBytes(16).toString("hex");n.rename(b,re,le=>{if(le)return G(le);n.unlink(re,G)})},ie=b=>{if(!H)return n.unlinkSync(b);let G=b+".DELETE."+E.randomBytes(16).toString("hex");n.renameSync(b,G),n.unlinkSync(G)},Y=(b,G,re)=>b===b>>>0?b:G===G>>>0?G:re,he=b=>d(f(h(b))).toLowerCase(),J=(b,G)=>{G=he(G);for(let re of b.keys()){let le=he(re);(le===G||le.indexOf(G+"/")===0)&&b.delete(re)}},w=b=>{for(let G of b.keys())b.delete(G)},B=class extends i{constructor(b){if(b||(b={}),b.ondone=G=>{this[I]=!0,this[L]()},super(b),this[_]=!1,this.reservations=c(),this.transform=typeof b.transform=="function"?b.transform:null,this.writable=!0,this.readable=!1,this[Q]=0,this[I]=!1,this.dirCache=b.dirCache||new Map,typeof b.uid=="number"||typeof b.gid=="number"){if(typeof b.uid!="number"||typeof b.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(b.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=b.uid,this.gid=b.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;b.preserveOwner===void 0&&typeof b.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!b.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=b.forceChown===!0,this.win32=!!b.win32||H,this.newer=!!b.newer,this.keep=!!b.keep,this.noMtime=!!b.noMtime,this.preservePaths=!!b.preservePaths,this.unlink=!!b.unlink,this.cwd=h(o.resolve(b.cwd||process.cwd())),this.strip=+b.strip||0,this.processUmask=b.noChmod?0:process.umask(),this.umask=typeof b.umask=="number"?b.umask:this.processUmask,this.dmode=b.dmode||511&~this.umask,this.fmode=b.fmode||438&~this.umask,this.on("entry",G=>this[m](G))}warn(b,G,re={}){return(b==="TAR_BAD_ARCHIVE"||b==="TAR_ABORT")&&(re.recoverable=!1),super.warn(b,G,re)}[L](){this[I]&&this[Q]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[W](b){if(this.strip){let G=h(b.path).split("/");if(G.length<this.strip)return!1;if(b.path=G.slice(this.strip).join("/"),b.type==="Link"){let re=h(b.linkpath).split("/");if(re.length>=this.strip)b.linkpath=re.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let G=h(b.path),re=G.split("/");if(re.includes("..")||H&&/^[a-z]:\.\.$/i.test(re[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:b,path:G}),!1;let[le,pe]=l(G);le&&(b.path=pe,this.warn("TAR_ENTRY_INFO",`stripping ${le} from absolute path`,{entry:b,path:G}))}if(o.isAbsolute(b.path)?b.absolute=h(o.resolve(b.path)):b.absolute=h(o.resolve(this.cwd,b.path)),!this.preservePaths&&b.absolute.indexOf(this.cwd+"/")!==0&&b.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:b,path:h(b.path),resolvedPath:b.absolute,cwd:this.cwd}),!1;if(b.absolute===this.cwd&&b.type!=="Directory"&&b.type!=="GNUDumpDir")return!1;if(this.win32){let{root:G}=o.win32.parse(b.absolute);b.absolute=G+u.encode(b.absolute.slice(G.length));let{root:re}=o.win32.parse(b.path);b.path=re+u.encode(b.path.slice(re.length))}return!0}[m](b){if(!this[W](b))return b.resume();switch(r.equal(typeof b.absolute,"string"),b.type){case"Directory":case"GNUDumpDir":b.mode&&(b.mode=b.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[y](b);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[U](b)}}[V](b,G){b.name==="CwdError"?this.emit("error",b):(this.warn("TAR_ENTRY_ERROR",b,{entry:G}),this[j](),G.resume())}[N](b,G,re){a(h(b),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:G,noChmod:this.noChmod},re)}[Z](b){return this.forceChown||this.preserveOwner&&(typeof b.uid=="number"&&b.uid!==this.processUid||typeof b.gid=="number"&&b.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[q](b){return Y(this.uid,b.uid,this.processUid)}[g](b){return Y(this.gid,b.gid,this.processGid)}[P](b,G){let re=b.mode&4095||this.fmode,le=new s.WriteStream(b.absolute,{flags:R(b.size),mode:re,autoClose:!1});le.on("error",we=>{le.fd&&n.close(le.fd,()=>{}),le.write=()=>!0,this[V](we,b),G()});let pe=1,Se=we=>{if(we){le.fd&&n.close(le.fd,()=>{}),this[V](we,b),G();return}--pe===0&&n.close(le.fd,He=>{He?this[V](He,b):this[j](),G()})};le.on("finish",we=>{let He=b.absolute,Zt=le.fd;if(b.mtime&&!this.noMtime){pe++;let Jt=b.atime||new Date,no=b.mtime;n.futimes(Zt,Jt,no,so=>so?n.utimes(He,Jt,no,Nl=>Se(Nl&&so)):Se())}if(this[Z](b)){pe++;let Jt=this[q](b),no=this[g](b);n.fchown(Zt,Jt,no,so=>so?n.chown(He,Jt,no,Nl=>Se(Nl&&so)):Se())}Se()});let xe=this.transform&&this.transform(b)||b;xe!==b&&(xe.on("error",we=>{this[V](we,b),G()}),b.pipe(xe)),xe.pipe(le)}[T](b,G){let re=b.mode&4095||this.dmode;this[N](b.absolute,re,le=>{if(le){this[V](le,b),G();return}let pe=1,Se=xe=>{--pe===0&&(G(),this[j](),b.resume())};b.mtime&&!this.noMtime&&(pe++,n.utimes(b.absolute,b.atime||new Date,b.mtime,Se)),this[Z](b)&&(pe++,n.chown(b.absolute,this[q](b),this[g](b),Se)),Se()})}[U](b){b.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${b.type}`,{entry:b}),b.resume()}[S](b,G){this[M](b,b.linkpath,"symlink",G)}[D](b,G){let re=h(o.resolve(this.cwd,b.linkpath));this[M](b,re,"link",G)}[te](){this[Q]++}[j](){this[Q]--,this[L]()}[z](b){this[j](),b.resume()}[C](b,G){return b.type==="File"&&!this.unlink&&G.isFile()&&G.nlink<=1&&!H}[y](b){this[te]();let G=[b.path];b.linkpath&&G.push(b.linkpath),this.reservations.reserve(G,re=>this[p](b,re))}[v](b){b.type==="SymbolicLink"?w(this.dirCache):b.type!=="Directory"&&J(this.dirCache,b.absolute)}[p](b,G){this[v](b);let re=xe=>{this[v](b),G(xe)},le=()=>{this[N](this.cwd,this.dmode,xe=>{if(xe){this[V](xe,b),re();return}this[_]=!0,pe()})},pe=()=>{if(b.absolute!==this.cwd){let xe=h(o.dirname(b.absolute));if(xe!==this.cwd)return this[N](xe,this.dmode,we=>{if(we){this[V](we,b),re();return}Se()})}Se()},Se=()=>{n.lstat(b.absolute,(xe,we)=>{if(we&&(this.keep||this.newer&&we.mtime>b.mtime)){this[z](b),re();return}if(xe||this[C](b,we))return this[F](null,b,re);if(we.isDirectory()){if(b.type==="Directory"){let He=!this.noChmod&&b.mode&&(we.mode&4095)!==b.mode,Zt=Jt=>this[F](Jt,b,re);return He?n.chmod(b.absolute,b.mode,Zt):Zt()}if(b.absolute!==this.cwd)return n.rmdir(b.absolute,He=>this[F](He,b,re))}if(b.absolute===this.cwd)return this[F](null,b,re);$(b.absolute,He=>this[F](He,b,re))})};this[_]?pe():le()}[F](b,G,re){if(b){this[V](b,G),re();return}switch(G.type){case"File":case"OldFile":case"ContiguousFile":return this[P](G,re);case"Link":return this[D](G,re);case"SymbolicLink":return this[S](G,re);case"Directory":case"GNUDumpDir":return this[T](G,re)}}[M](b,G,re,le){n[re](G,b.absolute,pe=>{pe?this[V](pe,b):(this[j](),b.resume()),le()})}},A=b=>{try{return[null,b()]}catch(G){return[G,null]}},X=class extends B{[F](b,G){return super[F](b,G,()=>{})}[y](b){if(this[v](b),!this[_]){let pe=this[N](this.cwd,this.dmode);if(pe)return this[V](pe,b);this[_]=!0}if(b.absolute!==this.cwd){let pe=h(o.dirname(b.absolute));if(pe!==this.cwd){let Se=this[N](pe,this.dmode);if(Se)return this[V](Se,b)}}let[G,re]=A(()=>n.lstatSync(b.absolute));if(re&&(this.keep||this.newer&&re.mtime>b.mtime))return this[z](b);if(G||this[C](b,re))return this[F](null,b);if(re.isDirectory()){if(b.type==="Directory"){let Se=!this.noChmod&&b.mode&&(re.mode&4095)!==b.mode,[xe]=Se?A(()=>{n.chmodSync(b.absolute,b.mode)}):[];return this[F](xe,b)}let[pe]=A(()=>n.rmdirSync(b.absolute));this[F](pe,b)}let[le]=b.absolute===this.cwd?[]:A(()=>ie(b.absolute));this[F](le,b)}[P](b,G){let re=b.mode&4095||this.fmode,le=xe=>{let we;try{n.closeSync(pe)}catch(He){we=He}(xe||we)&&this[V](xe||we,b),G()},pe;try{pe=n.openSync(b.absolute,R(b.size),re)}catch(xe){return le(xe)}let Se=this.transform&&this.transform(b)||b;Se!==b&&(Se.on("error",xe=>this[V](xe,b)),b.pipe(Se)),Se.on("data",xe=>{try{n.writeSync(pe,xe,0,xe.length)}catch(we){le(we)}}),Se.on("end",xe=>{let we=null;if(b.mtime&&!this.noMtime){let He=b.atime||new Date,Zt=b.mtime;try{n.futimesSync(pe,He,Zt)}catch(Jt){try{n.utimesSync(b.absolute,He,Zt)}catch{we=Jt}}}if(this[Z](b)){let He=this[q](b),Zt=this[g](b);try{n.fchownSync(pe,He,Zt)}catch(Jt){try{n.chownSync(b.absolute,He,Zt)}catch{we=we||Jt}}}le(we)})}[T](b,G){let re=b.mode&4095||this.dmode,le=this[N](b.absolute,re);if(le){this[V](le,b),G();return}if(b.mtime&&!this.noMtime)try{n.utimesSync(b.absolute,b.atime||new Date,b.mtime)}catch{}if(this[Z](b))try{n.chownSync(b.absolute,this[q](b),this[g](b))}catch{}G(),b.resume()}[N](b,G){try{return a.sync(h(b),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:G})}catch(re){return re}}[M](b,G,re,le){try{n[re+"Sync"](G,b.absolute),le(),b.resume()}catch(pe){return this[V](pe,b)}}};B.Sync=X,e.exports=B}),KH=de((t,e)=>{"use strict";ee();var r=da(),i=FR(),n=ye("fs"),s=ga(),o=ye("path"),a=ya();e.exports=(d,m,y)=>{typeof d=="function"?(y=d,m=null,d={}):Array.isArray(d)&&(m=d,d={}),typeof m=="function"&&(y=m,m=null),m?m=Array.from(m):m=[];let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return m.length&&u(p,m),p.file&&p.sync?c(p):p.file?l(p,y):p.sync?h(p):f(p)};var u=(d,m)=>{let y=new Map(m.map(C=>[a(C),!0])),p=d.filter,v=(C,F)=>{let P=F||o.parse(C).root||".",T=C===P?!1:y.has(C)?y.get(C):v(o.dirname(C),P);return y.set(C,T),T};d.filter=p?(C,F)=>p(C,F)&&v(a(C)):C=>v(a(C))},c=d=>{let m=new i.Sync(d),y=d.file,p=n.statSync(y),v=d.maxReadSize||16*1024*1024;new s.ReadStreamSync(y,{readSize:v,size:p.size}).pipe(m)},l=(d,m)=>{let y=new i(d),p=d.maxReadSize||16*1024*1024,v=d.file,C=new Promise((F,P)=>{y.on("error",P),y.on("close",F),n.stat(v,(T,M)=>{if(T)P(T);else{let S=new s.ReadStream(v,{readSize:p,size:M.size});S.on("error",P),S.pipe(y)}})});return m?C.then(m,m):C},h=d=>new i.Sync(d),f=d=>new i(d)}),ZH=de(t=>{"use strict";ee(),t.c=t.create=NH(),t.r=t.replace=TR(),t.t=t.list=n0(),t.u=t.update=MH(),t.x=t.extract=KH(),t.Pack=r0(),t.Unpack=FR(),t.Parse=i0(),t.ReadEntry=Qy(),t.WriteEntry=CR(),t.Header=ma(),t.Pax=e0(),t.types=xR()}),JH=de((t,e)=>{ee();function r(i,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=n||{},this._maxRetryTime=n&&n.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=r,r.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},r.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},r.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var n=new Date().getTime();if(i&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(i),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var s=this._timeouts.shift();if(s===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),s=this._cachedTimeouts.slice(-1);else return!1;var o=this;return this._timer=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},s),this._options.unref&&this._timer.unref(),!0},r.prototype.attempt=function(i,n){this._fn=i,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var s=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){s._operationTimeoutCb()},s._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},r.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)},r.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)},r.prototype.start=r.prototype.try,r.prototype.errors=function(){return this._errors},r.prototype.attempts=function(){return this._attempts},r.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},n=null,s=0,o=0;o<this._errors.length;o++){var a=this._errors[o],u=a.message,c=(i[u]||0)+1;i[u]=c,c>=s&&(n=a,s=c)}return n}}),XH=de(t=>{ee();var e=JH();t.operation=function(r){var i=t.timeouts(r);return new e(i,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},t.timeouts=function(r){if(r instanceof Array)return[].concat(r);var i={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in r)i[n]=r[n];if(i.minTimeout>i.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],o=0;o<i.retries;o++)s.push(this.createTimeout(o,i));return r&&r.forever&&!s.length&&s.push(this.createTimeout(o,i)),s.sort(function(a,u){return a-u}),s},t.createTimeout=function(r,i){var n=i.randomize?Math.random()+1:1,s=Math.round(n*Math.max(i.minTimeout,1)*Math.pow(i.factor,r));return s=Math.min(s,i.maxTimeout),s},t.wrap=function(r,i,n){if(i instanceof Array&&(n=i,i=null),!n){n=[];for(var s in r)typeof r[s]=="function"&&n.push(s)}for(var o=0;o<n.length;o++){var a=n[o],u=r[a];r[a]=function(c){var l=t.operation(i),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(d){l.retry(d)||(d&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){c.apply(r,h)})}.bind(r,u),r[a].options=i}}}),QH=de((t,e)=>{ee(),e.exports=XH()}),e6=de((t,e)=>{ee();var r=QH();function i(n,s){function o(a,u){var c=s||{},l;"randomize"in c||(c.randomize=!0),l=r.operation(c);function h(m){u(m||new Error("Aborted"))}function f(m,y){if(m.bail){h(m);return}l.retry(m)?c.onRetry&&c.onRetry(m,y):u(l.mainError())}function d(m){var y;try{y=n(h,m)}catch(p){f(p,m);return}Promise.resolve(y).then(a).catch(function(p){f(p,m)})}l.attempt(d)}return new Promise(o)}e.exports=i}),t6={};wH(t6,{bold:()=>o6,dimmed:()=>u6,error:()=>f6,grey:()=>c6,info:()=>s6,item:()=>l6,log:()=>Tn,turboBlue:()=>eo,turboGradient:()=>i6,turboLoader:()=>n6,turboRed:()=>NR,underline:()=>a6,warn:()=>h6,yellow:()=>MR});ee();var LR="#0099F7",BR="#F11712",r6="#FFFF00",i6=(0,IR.default)(LR,BR),eo=Ni.default.hex(LR),NR=Ni.default.hex(BR),MR=Ni.default.hex(r6),n6=t=>(0,PR.default)({text:t,spinner:{frames:[" ",eo("> "),eo(">> "),eo(">>>")]}}),s6=(...t)=>{Tn(eo.bold(">>>"),...t)},o6=(...t)=>{Tn(Ni.default.bold(...t))},a6=(...t)=>{Tn(Ni.default.underline(...t))},u6=(...t)=>{Tn(Ni.default.dim(...t))},c6=(...t)=>{Tn(Ni.default.grey(...t))},l6=(...t)=>{Tn(eo.bold(" \u2022"),...t)},Tn=(...t)=>{console.log(...t)},h6=(...t)=>{console.error(MR.bold(">>>"),...t)},f6=(...t)=>{console.error(NR.bold(">>>"),...t)};ee();async function Sl(t,e=[],r){let i={cwd:jR.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:n}=await(0,qR.default)(t,e,i);return n.trim()}catch{return}}async function UR(){let[t,e,r,i]=await Promise.all([Sl("yarnpkg",["--version"]),Sl("npm",["--version"]),Sl("pnpm",["--version"]),Sl("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:i}}ee();ee();ee();var UW=Al(AH());ee();ee();function d6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}ee();ee();function Ky(t){return Ky=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ky(t)}ee();function p6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m6(t,e){if(e&&(Ky(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p6(t)}ee();function Dl(t){return Dl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dl(t)}ee();ee();function la(t,e){return la=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},la(t,e)}function y6(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&la(t,e)}ee();ee();function g6(t){return Function.toString.call(t).indexOf("[native code]")!==-1}ee();ee();function _6(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xl(t,e,r){return _6()?xl=Reflect.construct.bind():xl=function(i,n,s){var o=[null];o.push.apply(o,n);var a=Function.bind.apply(i,o),u=new a;return s&&la(u,s.prototype),u},xl.apply(null,arguments)}function Zy(t){var e=typeof Map=="function"?new Map:void 0;return Zy=function(r){if(r===null||!g6(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return xl(r,arguments,Dl(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),la(i,r)},Zy(t)}var HW=Al(FH()),GW=function(t){y6(e,t);function e(r){var i;return d6(this,e),i=m6(this,Dl(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),i.directory=r,i}return e}(Zy(Error));ee();ee();ee();ee();ee();ee();var rV=Al(ZH()),iV=(0,$R.promisify)(HR.Stream.pipeline);ee();ee();var aV=Al(e6());ee();ee();ee();var qe=class extends Error{constructor(t,e){var r;super(t),this.name="ConvertError",this.type=(r=e==null?void 0:e.type)!=null?r:"unknown",Error.captureStackTrace(this,qe)}};ee();ee();ee();ee();var b6=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function vt({workspaceRoot:t}){let e=ri.default.join(t,"package.json");try{return(0,It.readJsonSync)(e,"utf8")}catch(r){if(r&&typeof r=="object"&&"code"in r){if(r.code==="ENOENT")throw new qe(`no "package.json" found at ${t}`,{type:"package_json-missing"});if(r.code==="EJSONPARSE")throw new qe(`failed to parse "package.json" at ${t}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${t}`)}}function Cl({workspaceRoot:t}){let{packageManager:e}=vt({workspaceRoot:t});if(e)try{let r=b6.exec(e);if(r){let[i,n]=r;return n}}catch{}}function _a({workspaceRoot:t}){let e=vt({workspaceRoot:t}),r=ri.default.basename(t),{name:i=r,description:n}=e;return{name:i,description:n}}function _R({workspaceRoot:t}){let e=ri.default.join(t,"pnpm-workspace.yaml");if((0,It.existsSync)(e))try{let r=fh.load((0,It.readFileSync)(e,"utf8"));if(r instanceof Object&&"packages"in r&&Array.isArray(r.packages))return r.packages}catch{throw new qe(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function Rl({root:t,lockFile:e,workspaceConfig:r}){let i=s=>ri.default.join(t,s),n={root:t,lockfile:i(e),packageJson:i("package.json"),nodeModules:i("node_modules")};return r&&(n.workspaceConfig=i(r)),n}function s0({workspaces:t}){var e;return t?Array.isArray(t)?t:"packages"in t?(e=t.packages)!=null?e:[]:[]:[]}function Tl({workspaceRoot:t,workspaceGlobs:e}){return e?e.flatMap(r=>{let i=[`${r}/package.json`];return(0,KR.sync)(i,{onlyFiles:!0,absolute:!0,cwd:t,ignore:["**/node_modules/**"]})}).map(r=>{let i=ri.default.dirname(r),{name:n,description:s}=_a({workspaceRoot:i});return{name:n,description:s,paths:{root:i,packageJson:r,nodeModules:ri.default.join(i,"node_modules")}}}):[]}function E6({directory:t}){let e=ri.default.resolve(process.cwd(),t);return{exists:(0,It.existsSync)(e),absolute:e}}function Mi({packageManager:t,action:e,project:r}){let i=r.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${t} ${i?"workspaces":""} ${e==="remove"?"from":"to"} ${r.name}`}function v6({project:t}){let e=r=>!(r.includes("*")&&(r.includes("**")||r.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(i=>r.includes(i)));return t.workspaceData.globs.every(e)}function ti({project:t,options:e}){e!=null&&e.dry||(0,It.rmSync)(t.paths.lockfile,{force:!0})}async function ZR({project:t,options:e}){if(!(e!=null&&e.dry)&&(0,It.existsSync)(t.paths.lockfile))try{let{stdout:r}=await(0,YR.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:t.paths.root});await(0,It.writeFile)(ri.default.join(t.paths.root,"yarn.lock"),r)}catch{}finally{(0,It.rmSync)(t.paths.lockfile,{force:!0})}}function w6({dependencyList:t,project:e,to:r}){let i=[];return e.workspaceData.workspaces.forEach(n=>{let{name:s}=n;if(t[s]){let o=t[s],a=o.startsWith("workspace:")?o.slice(10):o;t[s]=r.name==="pnpm"?`workspace:${a}`:a,i.push(s)}}),{dependencyList:t,updated:i}}function Li({project:t,workspace:e,to:r,logger:i,options:n}){if(["yarn","npm","bun"].includes(r.name)&&["yarn","npm","bun"].includes(t.packageManager))return;let s=vt({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(h=>{let f=s[h];if(f){let{updated:d,dependencyList:m}=w6({dependencyList:f,project:t,to:r});s[h]=m,o[h]=d}});let u=h=>{let f=o[h].length;if(f>0)return`${VR.default.green(f.toString())} ${h}`},c=a.map(u).filter(Boolean),l=`./${GR.default.relative(t.paths.root,e.paths.packageJson)}`;if(c.length>=1){let h="updating";c.forEach((f,d)=>{c.length===1?h+=` ${f} in ${l}`:d===c.length-1?h+=`and ${f} in ${l}`:h+=` ${f}, `}),i.workspaceStep(h)}else i.workspaceStep(`no workspace dependencies found in ${l}`);n!=null&&n.dry||(0,WR.writeJSONSync)(e.paths.packageJson,s,{spaces:2})}var Bi={name:"pnpm",lock:"pnpm-lock.yaml"};async function JR(t){let e=Cn.default.join(t.workspaceRoot,Bi.lock),r=Cn.default.join(t.workspaceRoot,"pnpm-workspace.yaml"),i=Cl({workspaceRoot:t.workspaceRoot});return(0,dt.existsSync)(e)||(0,dt.existsSync)(r)||i===Bi.name}async function S6(t){if(!await JR(t))throw new qe("Not a pnpm project",{type:"package_manager-unexpected"});let{name:e,description:r}=_a(t);return{name:e,description:r,packageManager:Bi.name,paths:Rl({root:t.workspaceRoot,lockFile:Bi.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:_R(t),workspaces:Tl({workspaceGlobs:_R(t),...t})}}}async function x6(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;i.mainStep(Mi({action:"create",packageManager:Bi.name,project:e}));let o=vt({workspaceRoot:e.paths.root});i.rootHeader(),o.packageManager=`${r.name}@${r.version}`,i.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),n!=null&&n.dry||((0,dt.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),s&&(i.rootStep('adding "pnpm-workspace.yaml"'),(0,dt.writeFileSync)(Cn.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
57
57
|
${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
|
@@ -84,7 +84,7 @@ yarn-error.log*
|
|
84
84
|
.vercel
|
85
85
|
`,V6="git rev-parse --is-inside-work-tree",Y6="hg --cwd . root";function K6(){try{return(0,ji.execSync)(V6,{stdio:"ignore"}),!0}catch{}return!1}function Z6(){try{return(0,ji.execSync)(Y6,{stdio:"ignore"}),!0}catch{}return!1}function hT(t,e){let r=!1;try{return K6()||Z6()?!1:((0,ji.execSync)("git init",{stdio:"ignore"}),(0,ji.execSync)("git add -A",{stdio:"ignore"}),r=!0,(0,ji.execSync)("git checkout -b main",{stdio:"ignore"}),dT(e),!0)}catch{if(r)try{(0,cT.sync)(uT.default.join(t,".git"))}catch{}return!1}}function a0(t){try{return dT(t),!0}catch{return!1}}function fT(){try{J6()}catch{}}function J6(){(0,ji.execSync)("git add -A",{stdio:"ignore"})}function dT(t){(0,ji.execSync)(`git commit --author="Turbobot <turbobot@vercel.com>" -am "${t}"`,{stdio:"ignore"})}var pT=require("child_process"),u0=ae(require("dns")),mT=ae(require("url"));function X6(){if(process.env.https_proxy)return process.env.https_proxy;try{let t=(0,pT.execSync)("npm config get https-proxy").toString().trim();return t!=="null"?t:void 0}catch{}}function yT(){return new Promise(t=>{u0.default.lookup("registry.yarnpkg.com",e=>{if(!e){t(!0);return}let r=X6();if(!r){t(!1);return}let{hostname:i}=mT.default.parse(r);if(!i){t(!1);return}u0.default.lookup(i,n=>{t(n===null)})})})}var gT={name:"package-manager"};async function _T(t){let{project:e,prompts:r}=t,{root:i,packageManager:n}=r;if(n&&e.packageManager!==n.name)await aT({root:i,to:n.name,options:{skipInstall:!0}});else return{result:"not-applicable",...gT};return{result:"success",...gT}}var c0=ae(require("path")),qi=require("fs-extra"),bT=ae(require("semver/functions/prerelease"));var Q6=new Set(["basic","default"]);function Pl(t){return Q6.has(t)}var nr=class extends Error{constructor(r,i){var n,s;super(r);this.name="TransformError",this.transform=(n=i==null?void 0:i.transform)!=null?n:"unknown",this.fatal=(s=i==null?void 0:i.fatal)!=null?s:!0,Error.captureStackTrace(this,nr)}};var Il={name:"official-starter"};async function ET(t){var c;let{prompts:e,example:r,opts:i}=t,n=Pl(r.name);if(!(!r.repo||r.repo.username==="vercel"&&r.repo.name==="turbo"))return{result:"not-applicable",...Il};let o=c0.default.join(e.root,"package.json"),a=c0.default.join(e.root,"meta.json"),u=(0,qi.existsSync)(o);try{(0,qi.rmSync)(a,{force:!0})}catch{}if(u){let l;try{l=(0,qi.readJsonSync)(o)}catch{throw new nr("Unable to read package.json",{transform:Il.name,fatal:!1})}if(l){if(n&&(l.name=e.projectName),(c=l.devDependencies)!=null&&c.turbo){let h=(0,bT.default)(An.version)!==null;i.turboVersion?l.devDependencies.turbo=i.turboVersion:h?l.devDependencies.turbo="canary":l.devDependencies.turbo="latest"}try{(0,qi.writeJsonSync)(o,l,{spaces:2})}catch{throw new nr("Unable to write package.json",{transform:Il.name,fatal:!1})}}}return{result:"success",...Il}}var vT=ae(require("path")),h0=ae(require("fs-extra"));var l0={name:"git-ignore"};async function wT(t){let{prompts:e}=t,r=vT.default.join(e.root,".gitignore");try{if(!h0.default.existsSync(r))h0.default.writeFileSync(r,lT);else return{result:"not-applicable",...l0}}catch{throw new nr("Unable to write .gitignore",{transform:l0.name,fatal:!1})}return{result:"success",...l0}}var Ll=require("fs-extra"),ST={name:"pnpm-eslint"},e4={"eslint.workingDirectories":[{mode:"auto"}]};async function xT(t){let{project:e,prompts:r}=t,{packageManager:i}=r;if((i==null?void 0:i.name)==="pnpm")await(0,Ll.mkdir)(`${e.paths.root}/.vscode`,{recursive:!0}),await(0,Ll.writeJson)(`${e.paths.root}/.vscode/settings.json`,e4,{spaces:2});else return{result:"not-applicable",...ST};return{result:"success",...ST}}var DT=[ET,wT,_T,xT];var f0=ae(require("inquirer"));async function AT({dir:t}){let e=await f0.default.prompt({type:"input",name:"projectDirectory",message:"Where would you like to create your turborepo?",when:!t,default:"./my-turborepo",validate:i=>{let{valid:n,error:s}=Pu(i);return!n&&s?s:!0},filter:i=>i.trim()}),{projectDirectory:r=t}=e;return Pu(r)}async function CT({manager:t,skipTransforms:e}){if(e)return;let r=await Ao(),i=await f0.default.prompt({name:"packageManagerInput",type:"list",message:"Which package manager do you want to use?",when:!t||!r[t],choices:[{pm:"npm",label:"npm workspaces"},{pm:"pnpm",label:"pnpm workspaces"},{pm:"yarn",label:"yarn workspaces"},{pm:"bun",label:"bun workspaces (beta)"}].map(({pm:s,label:o})=>({name:o,value:s,disabled:r[s]?!1:"not installed"}))}),{packageManagerInput:n=t}=i;return{name:n,version:r[n]}}var{turboGradient:d0,turboLoader:r4,info:RT,error:Ea,warn:p0}=ue;function i4(t){var e,r,i,n,s,o;(e=t.telemetry)==null||e.trackOptionPackageManager(t.packageManager),(r=t.telemetry)==null||r.trackOptionSkipInstall(t.skipInstall),(i=t.telemetry)==null||i.trackOptionSkipTransforms(t.skipTransforms),(n=t.telemetry)==null||n.trackOptionExample(t.example),(s=t.telemetry)==null||s.trackOptionTurboVersion(t.turboVersion),(o=t.telemetry)==null||o.trackOptionExamplePath(t.examplePath)}function m0(t,e){if(e==null||e.trackCommandStatus({command:"create",status:"error"}),t instanceof nr)Ea(et.default.bold(t.transform),et.default.red(t.message)),t.fatal&&process.exit(1);else if(t instanceof qe&&t.type!=="unknown")Ea(et.default.red(t.message)),process.exit(1);else if(t instanceof js)Ea(et.default.red("Unable to download template from Github")),Ea(et.default.red(t.message)),process.exit(1);else throw t}var TT={build:"Build",dev:"Develop",test:"Test",lint:"Lint"};async function y0(t,e,r){var D,U,W,N;(D=r.telemetry)==null||D.trackCommandStatus({command:"create",status:"start"}),(U=r.telemetry)==null||U.trackArgumentPackageManager(e),(W=r.telemetry)==null||W.trackArgumentDirectory(!!t),i4(r);let{packageManager:i,skipInstall:n,skipTransforms:s}=r;ue.log(et.default.bold(d0(`
|
86
86
|
>>> TURBOREPO
|
87
|
-
`))),RT("Welcome to Turborepo! Let's get you set up with a new codebase."),ue.log();let o=i!=null?i:e,[a,u]=await Promise.all([yT(),Ao()]);a||(Ea("You appear to be offline. Please check your network connection and try again."),process.exit(1));let{root:c,projectName:l}=await AT({dir:t}),h=ba.default.relative(process.cwd(),c),f=h==="",d=await CT({manager:o,skipTransforms:s});o&&r.skipTransforms&&p0("--skip-transforms conflicts with <package-manager>. The package manager argument will be ignored.");let{example:m,examplePath:y}=r,p=m&&m!=="default"?m:"basic",v={};try{v=await Fy({appPath:c,example:p,isDefaultExample:Pl(p),examplePath:y})}catch(V){m0(V,r.telemetry)}let{hasPackageJson:C,availableScripts:F,repoInfo:P}=v;hT(c,`feat(create-turbo): create ${p}`);let T={};try{T=await kl({root:c})}catch(V){m0(V,r.telemetry)}if(!s)for(let V of DT)try{let Q=await V({example:{repo:P,name:p},project:T,prompts:{projectName:l,root:c,packageManager:d},opts:r});Q.result==="success"&&(fT(),a0(`feat(create-turbo): apply ${Q.name} transform`))}catch(Q){m0(Q,r.telemetry)}let M=s||!d?{name:T.packageManager,version:u[T.packageManager]}:d;if(RT("Created a new Turborepo with the following:"),ue.log(),T.workspaceData.workspaces.length>0){let V=T.workspaceData.workspaces.map(te=>({group:ba.default.relative(c,te.paths.root).split(ba.default.sep)[0]||"",title:ba.default.relative(c,te.paths.root),description:te.description})).sort((te,j)=>te.title.localeCompare(j.title)),Q;V.forEach(({group:te,title:j,description:I},L)=>{(L===0||te!==Q)&&ue.log(et.default.cyan(te)),ue.log(` - ${et.default.bold(j)}${I?`: ${I}`:""}`),Q=te})}else ue.log(et.default.cyan("apps")),ue.log(` - ${et.default.bold(l)}`);if(ue.log(),C&&!n){if(r.skipTransforms&&!u[T.packageManager])p0(`Unable to install dependencies - "${p}" uses "${T.packageManager}" which could not be found.`),p0(`Try running without "--skip-transforms" to convert "${p}" to a package manager that is available on your system.`),ue.log();else if(M.version){ue.log("Installing packages. This might take a couple of minutes."),ue.log();let V=r4("Installing dependencies...").start();await Fl({project:T,to:M,options:{interactive:!1}}),a0("feat(create-turbo): install dependencies"),V.stop()}}f?ue.log(`${et.default.bold(d0(">>> Success!"))} Your new Turborepo is ready.`):ue.log(`${et.default.bold(d0(">>> Success!"))} Created a new Turborepo at "${h}".`);let S=Ol(M);S&&C&&(ue.log(`Inside ${f?"this":"that"} directory, you can run several commands:`),ue.log(),F.filter(V=>TT[V]).forEach(V=>{ue.log(et.default.cyan(` ${S.command} run ${V}`)),ue.log(` ${TT[V]} all apps and packages`),ue.log()}),ue.log("Turborepo will cache locally by default. For an additional"),ue.log("speed boost, enable Remote Caching with Vercel by"),ue.log("entering the following command:"),ue.log(),ue.log(et.default.cyan(` ${S.executable} turbo login`)),ue.log(),ue.log("We suggest that you begin by typing:"),ue.log(),f||ue.log(` ${et.default.cyan("cd")} ${h}`),ue.log(et.default.cyan(` ${S.executable} turbo login`)),ue.log()),(N=r.telemetry)==null||N.trackCommandStatus({command:"create",status:"end"})}var Bl,PT=new FT.ProxyAgent;kT.default.globalAgent=PT;OT.default.globalAgent=PT;var _0=new va.Command;_0.name(g0.default.bold(ue.turboGradient("create-turbo"))).description("Create a new Turborepo").usage(`${g0.default.bold("<project-directory>")} [options]`).hook("preAction",async(t,e)=>{let{telemetry:r}=await Wy({packageInfo:{name:"create-turbo",version:An.version}});e.addOption(new va.Option("--telemetry").default(r).hideHelp()),Bl=r}).hook("postAction",async()=>{await(Bl==null?void 0:Bl.close())}).argument("[project-directory]").
|
87
|
+
`))),RT("Welcome to Turborepo! Let's get you set up with a new codebase."),ue.log();let o=i!=null?i:e,[a,u]=await Promise.all([yT(),Ao()]);a||(Ea("You appear to be offline. Please check your network connection and try again."),process.exit(1));let{root:c,projectName:l}=await AT({dir:t}),h=ba.default.relative(process.cwd(),c),f=h==="",d=await CT({manager:o,skipTransforms:s});o&&r.skipTransforms&&p0("--skip-transforms conflicts with <package-manager>. The package manager argument will be ignored.");let{example:m,examplePath:y}=r,p=m&&m!=="default"?m:"basic",v={};try{v=await Fy({appPath:c,example:p,isDefaultExample:Pl(p),examplePath:y})}catch(V){m0(V,r.telemetry)}let{hasPackageJson:C,availableScripts:F,repoInfo:P}=v;hT(c,`feat(create-turbo): create ${p}`);let T={};try{T=await kl({root:c})}catch(V){m0(V,r.telemetry)}if(!s)for(let V of DT)try{let Q=await V({example:{repo:P,name:p},project:T,prompts:{projectName:l,root:c,packageManager:d},opts:r});Q.result==="success"&&(fT(),a0(`feat(create-turbo): apply ${Q.name} transform`))}catch(Q){m0(Q,r.telemetry)}let M=s||!d?{name:T.packageManager,version:u[T.packageManager]}:d;if(RT("Created a new Turborepo with the following:"),ue.log(),T.workspaceData.workspaces.length>0){let V=T.workspaceData.workspaces.map(te=>({group:ba.default.relative(c,te.paths.root).split(ba.default.sep)[0]||"",title:ba.default.relative(c,te.paths.root),description:te.description})).sort((te,j)=>te.title.localeCompare(j.title)),Q;V.forEach(({group:te,title:j,description:I},L)=>{(L===0||te!==Q)&&ue.log(et.default.cyan(te)),ue.log(` - ${et.default.bold(j)}${I?`: ${I}`:""}`),Q=te})}else ue.log(et.default.cyan("apps")),ue.log(` - ${et.default.bold(l)}`);if(ue.log(),C&&!n){if(r.skipTransforms&&!u[T.packageManager])p0(`Unable to install dependencies - "${p}" uses "${T.packageManager}" which could not be found.`),p0(`Try running without "--skip-transforms" to convert "${p}" to a package manager that is available on your system.`),ue.log();else if(M.version){ue.log("Installing packages. This might take a couple of minutes."),ue.log();let V=r4("Installing dependencies...").start();await Fl({project:T,to:M,options:{interactive:!1}}),a0("feat(create-turbo): install dependencies"),V.stop()}}f?ue.log(`${et.default.bold(d0(">>> Success!"))} Your new Turborepo is ready.`):ue.log(`${et.default.bold(d0(">>> Success!"))} Created a new Turborepo at "${h}".`);let S=Ol(M);S&&C&&(ue.log(`Inside ${f?"this":"that"} directory, you can run several commands:`),ue.log(),F.filter(V=>TT[V]).forEach(V=>{ue.log(et.default.cyan(` ${S.command} run ${V}`)),ue.log(` ${TT[V]} all apps and packages`),ue.log()}),ue.log("Turborepo will cache locally by default. For an additional"),ue.log("speed boost, enable Remote Caching with Vercel by"),ue.log("entering the following command:"),ue.log(),ue.log(et.default.cyan(` ${S.executable} turbo login`)),ue.log(),ue.log("We suggest that you begin by typing:"),ue.log(),f||ue.log(` ${et.default.cyan("cd")} ${h}`),ue.log(et.default.cyan(` ${S.executable} turbo login`)),ue.log()),(N=r.telemetry)==null||N.trackCommandStatus({command:"create",status:"end"})}var Bl,PT=new FT.ProxyAgent;kT.default.globalAgent=PT;OT.default.globalAgent=PT;var _0=new va.Command;_0.name(g0.default.bold(ue.turboGradient("create-turbo"))).description("Create a new Turborepo").usage(`${g0.default.bold("<project-directory>")} [options]`).hook("preAction",async(t,e)=>{let{telemetry:r}=await Wy({packageInfo:{name:"create-turbo",version:An.version}});e.addOption(new va.Option("--telemetry").default(r).hideHelp()),Bl=r}).hook("postAction",async()=>{await(Bl==null?void 0:Bl.close())}).argument("[project-directory]").addOption(new va.Option("-m, --package-manager <package-manager>","Specify the package manager to use").choices(["npm","yarn","pnpm","bun"])).option("--skip-install","Do not run a package manager install after creating the project",!1).option("--skip-transforms","Do not run any code transformation after creating the project",!1).option("--turbo-version <version>","Use a specific version of turbo (default: latest)").option("-e, --example [name]|[github-url]",`
|
88
88
|
An example to bootstrap the app with. You can use an example name
|
89
89
|
from the official Turborepo repo or a GitHub URL. The URL can use
|
90
90
|
any branch and/or subdirectory
|
package/package.json
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "create-turbo",
|
3
|
-
"version": "
|
3
|
+
"version": "2.0.0-canary.0",
|
4
4
|
"description": "Create a new Turborepo",
|
5
5
|
"homepage": "https://turbo.build/repo",
|
6
|
-
"license": "
|
6
|
+
"license": "MIT",
|
7
7
|
"repository": {
|
8
8
|
"type": "git",
|
9
9
|
"url": "https://github.com/vercel/turbo",
|
@@ -36,12 +36,12 @@
|
|
36
36
|
"ts-jest": "^27.1.1",
|
37
37
|
"tsup": "^6.7.0",
|
38
38
|
"typescript": "^5.2.2",
|
39
|
-
"@turbo/eslint-config": "0.0.0",
|
40
|
-
"@turbo/telemetry": "0.0.0",
|
41
39
|
"@turbo/test-utils": "0.0.0",
|
42
40
|
"@turbo/tsconfig": "0.0.0",
|
43
41
|
"@turbo/utils": "0.0.0",
|
44
|
-
"@turbo/
|
42
|
+
"@turbo/telemetry": "0.0.0",
|
43
|
+
"@turbo/eslint-config": "0.0.0",
|
44
|
+
"@turbo/workspaces": "2.0.0-canary.0"
|
45
45
|
},
|
46
46
|
"files": [
|
47
47
|
"dist"
|