prismic 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{auth-hgWfYVlQ.mjs → auth-D5YibiqF.mjs} +1 -1
- package/dist/{builders-hKD4IrLX-OKUYHMsz.mjs → builders-hKD4IrLX-DzjbepsH.mjs} +1 -1
- package/dist/core-C9QC2jUZ.mjs +173 -0
- package/dist/index.mjs +59 -57
- package/dist/{nextjs-qunlKbpH.mjs → nextjs-DZchmZBW.mjs} +51 -51
- package/dist/{nuxt-SaF4IAMg.mjs → nuxt-BL0XxxuM.mjs} +7 -7
- package/dist/package-ln6JGWAi.mjs +1 -0
- package/dist/packageJson-yTgvK-Vp.mjs +2 -0
- package/dist/{request-BX9m6W7p.mjs → request-DFL5MlKG.mjs} +1 -1
- package/dist/{segment-CusldEBw.mjs → segment-BiyM1DAx.mjs} +1 -1
- package/dist/subprocesses/refreshToken.mjs +1 -1
- package/dist/subprocesses/sendSegmentEvents.mjs +1 -1
- package/dist/subprocesses/updateVersionState.mjs +1 -1
- package/dist/{sveltekit-CiHFqDi2.mjs → sveltekit-BSicYgQU.mjs} +30 -30
- package/dist/{update-notifier-CG7Szvo5.mjs → update-notifier-0ylnuuXF.mjs} +1 -1
- package/package.json +1 -1
- package/dist/core-DvI8OCsA.mjs +0 -173
- package/dist/package-C8ZHSYR2.mjs +0 -1
- package/dist/packageJson-XOWTfdbI.mjs +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as e,
|
|
1
|
+
import{C as e,N as t,a as n,b as r,c as i,i as a,s as o,t as s,u as c,v as l,w as u}from"./core-C9QC2jUZ.mjs";import{c as d,f,p}from"./request-DFL5MlKG.mjs";import{i as m,n as h,r as g}from"./packageJson-yTgvK-Vp.mjs";import{i as _,r as v}from"./auth-D5YibiqF.mjs";import{createRequire as y}from"node:module";import{fileURLToPath as b}from"node:url";import{relative as x}from"node:path";const S=i`
|
|
2
2
|
return (
|
|
3
3
|
<section
|
|
4
4
|
data-slice-type={slice.slice_type}
|
|
@@ -9,36 +9,36 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
9
9
|
<strong>You can edit this slice directly in your code editor.</strong>
|
|
10
10
|
</section>
|
|
11
11
|
)
|
|
12
|
-
`;function C(e){let{name:n,id:r,typescript:
|
|
12
|
+
`;function C(e){let{name:n,id:r,typescript:a}=e,o=t(n),s=t(r),c=i`
|
|
13
13
|
import { FC } from "react";
|
|
14
14
|
import { Content } from "@prismicio/client";
|
|
15
15
|
import { SliceComponentProps } from "@prismicio/react";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Props for \`${
|
|
18
|
+
* Props for \`${o}\`.
|
|
19
19
|
*/
|
|
20
|
-
export type ${
|
|
20
|
+
export type ${o}Props = SliceComponentProps<Content.${s}Slice>;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Component for "${n}" Slices.
|
|
24
24
|
*/
|
|
25
|
-
const ${
|
|
25
|
+
const ${o}: FC<${o}Props> = ({ slice }) => {
|
|
26
26
|
${S}
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
export default ${
|
|
30
|
-
`,l=
|
|
29
|
+
export default ${o}
|
|
30
|
+
`,l=i`
|
|
31
31
|
/**
|
|
32
|
-
* @typedef {import("@prismicio/client").Content.${
|
|
33
|
-
* @typedef {import("@prismicio/react").SliceComponentProps<${
|
|
34
|
-
* @type {import("react").FC<${
|
|
32
|
+
* @typedef {import("@prismicio/client").Content.${s}Slice} ${o}Slice
|
|
33
|
+
* @typedef {import("@prismicio/react").SliceComponentProps<${o}Slice>} ${o}Props
|
|
34
|
+
* @type {import("react").FC<${o}Props>}
|
|
35
35
|
*/
|
|
36
|
-
const ${
|
|
36
|
+
const ${o} = ({ slice }) => {
|
|
37
37
|
${S}
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
export default ${
|
|
41
|
-
`;return
|
|
40
|
+
export default ${o};
|
|
41
|
+
`;return a?c:l}function w(e){let{model:t,routePath:n,typescript:r,appRouter:a}=e;return a?t.repeatable?r?i`
|
|
42
42
|
import { SliceZone } from "@prismicio/react";
|
|
43
43
|
import { createClient } from "@/prismicio";
|
|
44
44
|
import { components } from "@/slices";
|
|
@@ -50,7 +50,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
50
50
|
|
|
51
51
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
52
52
|
}
|
|
53
|
-
`:
|
|
53
|
+
`:i`
|
|
54
54
|
import { SliceZone } from "@prismicio/react";
|
|
55
55
|
import { createClient } from "@/prismicio";
|
|
56
56
|
import { components } from "@/slices";
|
|
@@ -65,7 +65,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
65
65
|
|
|
66
66
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
67
67
|
}
|
|
68
|
-
`:
|
|
68
|
+
`:i`
|
|
69
69
|
import { SliceZone } from "@prismicio/react";
|
|
70
70
|
import { createClient } from "@/prismicio";
|
|
71
71
|
import { components } from "@/slices";
|
|
@@ -76,7 +76,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
76
76
|
|
|
77
77
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
78
78
|
}
|
|
79
|
-
`:t.repeatable?r?
|
|
79
|
+
`:t.repeatable?r?i`
|
|
80
80
|
import type { InferGetStaticPropsType, GetStaticPropsContext } from "next";
|
|
81
81
|
import { SliceZone } from "@prismicio/react";
|
|
82
82
|
import { createClient } from "@/prismicio";
|
|
@@ -104,7 +104,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
104
104
|
fallback: false,
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
`:
|
|
107
|
+
`:i`
|
|
108
108
|
import { SliceZone } from "@prismicio/react";
|
|
109
109
|
import { createClient } from "@/prismicio";
|
|
110
110
|
import { components } from "@/slices";
|
|
@@ -132,7 +132,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
132
132
|
fallback: false,
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
`:r?
|
|
135
|
+
`:r?i`
|
|
136
136
|
import type { InferGetStaticPropsType, GetStaticPropsContext } from "next";
|
|
137
137
|
import { SliceZone } from "@prismicio/react";
|
|
138
138
|
import { createClient } from "@/prismicio";
|
|
@@ -148,7 +148,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
148
148
|
export default function Page({ page }: InferGetStaticPropsType<typeof getStaticProps>) {
|
|
149
149
|
return <SliceZone slices={page.data.slices} components={components} />;
|
|
150
150
|
}
|
|
151
|
-
`:
|
|
151
|
+
`:i`
|
|
152
152
|
import { SliceZone } from "@prismicio/react";
|
|
153
153
|
import { createClient } from "@/prismicio";
|
|
154
154
|
import { components } from "@/slices";
|
|
@@ -166,14 +166,14 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
166
166
|
|
|
167
167
|
return { props: { page } };
|
|
168
168
|
}
|
|
169
|
-
`}function T(e){let{typescript:t,appRouter:n,hasSrcDirectory:r}=e,
|
|
169
|
+
`}function T(e){let{typescript:t,appRouter:n,hasSrcDirectory:r}=e,a=`${r?`..`:`.`}/prismic.config.json`,o,s;return n?t?(o=i`
|
|
170
170
|
import {
|
|
171
171
|
createClient as baseCreateClient,
|
|
172
172
|
type ClientConfig,
|
|
173
173
|
} from "@prismicio/client";
|
|
174
174
|
import { enableAutoPreviews } from "@prismicio/next";
|
|
175
|
-
import prismicConfig from "${
|
|
176
|
-
`,
|
|
175
|
+
import prismicConfig from "${a}";
|
|
176
|
+
`,s=i`
|
|
177
177
|
/**
|
|
178
178
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
179
179
|
* query content from the Prismic API.
|
|
@@ -194,11 +194,11 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
194
194
|
|
|
195
195
|
return client;
|
|
196
196
|
};
|
|
197
|
-
`):(
|
|
197
|
+
`):(o=i`
|
|
198
198
|
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
199
199
|
import { enableAutoPreviews } from "@prismicio/next";
|
|
200
|
-
import prismicConfig from "${
|
|
201
|
-
`,
|
|
200
|
+
import prismicConfig from "${a}";
|
|
201
|
+
`,s=i`
|
|
202
202
|
/**
|
|
203
203
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
204
204
|
* query content from the Prismic API.
|
|
@@ -219,11 +219,11 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
219
219
|
|
|
220
220
|
return client;
|
|
221
221
|
};
|
|
222
|
-
`):t?(
|
|
222
|
+
`):t?(o=i`
|
|
223
223
|
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
224
224
|
import { enableAutoPreviews, type CreateClientConfig } from "@prismicio/next/pages";
|
|
225
|
-
import prismicConfig from "${
|
|
226
|
-
`,
|
|
225
|
+
import prismicConfig from "${a}";
|
|
226
|
+
`,s=i`
|
|
227
227
|
/**
|
|
228
228
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
229
229
|
* query content from the Prismic API.
|
|
@@ -240,11 +240,11 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
240
240
|
|
|
241
241
|
return client;
|
|
242
242
|
};
|
|
243
|
-
`):(
|
|
243
|
+
`):(o=i`
|
|
244
244
|
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
245
245
|
import { enableAutoPreviews } from "@prismicio/next/pages";
|
|
246
|
-
import prismicConfig from "${
|
|
247
|
-
`,
|
|
246
|
+
import prismicConfig from "${a}";
|
|
247
|
+
`,s=i`
|
|
248
248
|
/**
|
|
249
249
|
* Creates a Prismic client for the project's repository. The client is used to
|
|
250
250
|
* query content from the Prismic API.
|
|
@@ -261,25 +261,25 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
261
261
|
|
|
262
262
|
return client;
|
|
263
263
|
};
|
|
264
|
-
`),t?
|
|
265
|
-
${
|
|
264
|
+
`),t?i`
|
|
265
|
+
${o}
|
|
266
266
|
|
|
267
267
|
/**
|
|
268
268
|
* The project's Prismic repository name.
|
|
269
269
|
*/
|
|
270
270
|
export const repositoryName = prismicConfig.repositoryName;
|
|
271
271
|
|
|
272
|
-
${
|
|
273
|
-
`:
|
|
274
|
-
${
|
|
272
|
+
${s}
|
|
273
|
+
`:i`
|
|
274
|
+
${o}
|
|
275
275
|
|
|
276
276
|
/**
|
|
277
277
|
* The project's Prismic repository name.
|
|
278
278
|
*/
|
|
279
279
|
export const repositoryName = prismicConfig.repositoryName;
|
|
280
280
|
|
|
281
|
-
${
|
|
282
|
-
`}function E(e){let{typescript:t,appRouter:n}=e,r=
|
|
281
|
+
${s}
|
|
282
|
+
`}function E(e){let{typescript:t,appRouter:n}=e,r=i`
|
|
283
283
|
import { SliceSimulator, SliceSimulatorParams, getSlices } from "@prismicio/next";
|
|
284
284
|
import { SliceZone } from "@prismicio/react";
|
|
285
285
|
|
|
@@ -297,7 +297,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
297
297
|
</SliceSimulator>
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
|
-
`,i
|
|
300
|
+
`,a=i`
|
|
301
301
|
import { SliceSimulator, getSlices } from "@prismicio/next";
|
|
302
302
|
import { SliceZone } from "@prismicio/react";
|
|
303
303
|
|
|
@@ -313,7 +313,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
313
313
|
</SliceSimulator>
|
|
314
314
|
);
|
|
315
315
|
}
|
|
316
|
-
`,
|
|
316
|
+
`,o=i`
|
|
317
317
|
import { SliceSimulator } from "@prismicio/next/pages";
|
|
318
318
|
import { SliceZone } from "@prismicio/react";
|
|
319
319
|
|
|
@@ -326,7 +326,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
326
326
|
/>
|
|
327
327
|
);
|
|
328
328
|
}
|
|
329
|
-
`;return n?t?r:
|
|
329
|
+
`;return n?t?r:a:o}function D(e){let{typescript:t,appRouter:n}=e,r=i`
|
|
330
330
|
import { NextRequest } from "next/server";
|
|
331
331
|
import { redirectToPreviewURL } from "@prismicio/next";
|
|
332
332
|
|
|
@@ -337,7 +337,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
337
337
|
|
|
338
338
|
return await redirectToPreviewURL({ client, request });
|
|
339
339
|
}
|
|
340
|
-
`,i
|
|
340
|
+
`,a=i`
|
|
341
341
|
import { redirectToPreviewURL } from "@prismicio/next";
|
|
342
342
|
|
|
343
343
|
import { createClient } from "../../../prismicio";
|
|
@@ -347,7 +347,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
347
347
|
|
|
348
348
|
return await redirectToPreviewURL({ client, request });
|
|
349
349
|
}
|
|
350
|
-
`,
|
|
350
|
+
`,o=i`
|
|
351
351
|
import { NextApiRequest, NextApiResponse } from "next";
|
|
352
352
|
import { setPreviewData, redirectToPreviewURL } from "@prismicio/next/pages";
|
|
353
353
|
|
|
@@ -360,7 +360,7 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
360
360
|
|
|
361
361
|
return await redirectToPreviewURL({ req, res, client });
|
|
362
362
|
};
|
|
363
|
-
`,
|
|
363
|
+
`,s=i`
|
|
364
364
|
import { setPreviewData, redirectToPreviewURL } from "@prismicio/next/pages";
|
|
365
365
|
|
|
366
366
|
import { createClient } from "../../prismicio";
|
|
@@ -372,26 +372,26 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
372
372
|
|
|
373
373
|
return await redirectToPreviewURL({ req, res, client });
|
|
374
374
|
};
|
|
375
|
-
`;return n?t?r:
|
|
375
|
+
`;return n?t?r:a:t?o:s}function O(e){let{typescript:t,appRouter:n}=e,r=i`
|
|
376
376
|
import { exitPreview } from "@prismicio/next";
|
|
377
377
|
|
|
378
378
|
export function GET() {
|
|
379
379
|
return exitPreview();
|
|
380
380
|
}
|
|
381
|
-
`,i
|
|
381
|
+
`,a=i`
|
|
382
382
|
import { NextApiRequest, NextApiResponse } from "next";
|
|
383
383
|
import { exitPreview } from "@prismicio/next/pages";
|
|
384
384
|
|
|
385
385
|
export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
386
386
|
return exitPreview({ req, res });
|
|
387
387
|
}
|
|
388
|
-
`,
|
|
388
|
+
`,o=i`
|
|
389
389
|
import { exitPreview } from "@prismicio/next/pages";
|
|
390
390
|
|
|
391
391
|
export default function handler(req, res) {
|
|
392
392
|
return exitPreview({ req, res });
|
|
393
393
|
}
|
|
394
|
-
`;return n?r:t?
|
|
394
|
+
`;return n?r:t?a:o}function k(e){let{supportsCacheLife:t}=e;return i`
|
|
395
395
|
import { NextResponse } from "next/server";
|
|
396
396
|
import { revalidateTag } from "next/cache";
|
|
397
397
|
|
|
@@ -400,14 +400,14 @@ import{C as e,M as t,S as n,_ as r,i,l as a,o,r as s,s as c,t as l,y as u}from".
|
|
|
400
400
|
|
|
401
401
|
return NextResponse.json({ revalidated: true, now: Date.now() });
|
|
402
402
|
}
|
|
403
|
-
`}var A=class extends
|
|
403
|
+
`}var A=class extends c{id=`next`;async setupProject(){await h({"@prismicio/client":`^${await m(`@prismicio/client`)}`,"@prismicio/react":`^${await m(`@prismicio/react`)}`,"@prismicio/next":`^${await m(`@prismicio/next`)}`}),await F(),await P(),await N(),await M(),await j()}async onProjectInitialized(){let e=await u(),t=await _(),r=await v();await n({repo:e,token:t,host:r})||await o(`http://localhost:3000/slice-simulator`,{repo:e,token:t,host:r}),(await a({repo:e,token:t,host:r})).length===0&&await s({name:`Development`,websiteURL:`http://localhost:3000`,resolverPath:`/api/preview`},{repo:e,token:t,host:r})}async onSliceCreated(e,n){let i=t(e.name),a=new URL(i,p(n)),o=await B();await f(new URL(`index.${o}x`,p(a)),C({name:e.name,id:e.id,typescript:await r()}))}onSliceUpdated(){}onSliceDeleted(){}async onCustomTypeCreated(e){e.format===`page`&&await I(e)}onCustomTypeUpdated(){}onCustomTypeDeleted(){}async createSliceIndexFile(e){let n=(await this.getSlices()).filter(t=>t.library.href===e.href),r=n.map(n=>`import ${t(n.model.name)} from "./${x(b(e),b(n.directory))}";`),a=n.map(e=>{let n=t(e.model.name);return`${e.model.id}: ${n}`}),o=i`
|
|
404
404
|
// Code generated by Prismic. DO NOT EDIT.
|
|
405
405
|
|
|
406
406
|
${r.join(`
|
|
407
407
|
`)}
|
|
408
408
|
|
|
409
409
|
export const components = {
|
|
410
|
-
${
|
|
410
|
+
${a.join(`,
|
|
411
411
|
`)}
|
|
412
412
|
};
|
|
413
|
-
`,
|
|
413
|
+
`,s=`index.${await B()}`;await f(new URL(s,e),o)}async getDefaultSliceLibrary(){let t=await e(),n=await z();return new URL(n?`src/slices/`:`slices/`,t)}async getDefaultCustomTypeLibrary(){let t=await e();return new URL(`customtypes/`,t)}};async function j(){if(!await L())return;let e=await R(),t=await B(),n=new URL(`app/api/revalidate/route.${t}`,e);if(await d(n))return;let r=await V();await f(n,k({supportsCacheLife:Number.parseInt(r.split(`.`)[0])>=16}))}async function M(){let e=await L(),t=await R(),n=await B(),i=new URL(e?`app/api/exit-preview/route.${n}`:`pages/api/exit-preview.${n}`,t);await d(i)||await f(i,O({typescript:await r(),appRouter:e}))}async function N(){let e=await L(),t=await R(),n=await B(),i=new URL(e?`app/api/preview/route.${n}`:`pages/api/preview.${n}`,t);await d(i)||await f(i,D({typescript:await r(),appRouter:e}))}async function P(){let e=await L(),t=await R(),n=`${await B()}x`,i=new URL(e?`app/slice-simulator/page.${n}`:`pages/slice-simulator.${n}`,t);await d(i)||await f(i,E({typescript:await r(),appRouter:e}))}async function F(){let e=await B(),t=await R(),n=new URL(`prismicio.${e}`,t);await d(n)||await f(n,T({typescript:await r(),appRouter:await L(),hasSrcDirectory:await z()}))}async function I(e){let t=l(e).split(`/`).filter(Boolean).map(e=>e.startsWith(`:`)?`[${e.slice(1)}]`:e).join(`/`),n=await R(),i=`${await B()}x`,a=await L(),o=a?new URL(`app/${t}/page.${i}`,n):new URL(`pages/${t||`index`}.${i}`,n);await d(o)||await f(o,w({model:e,routePath:t,typescript:await r(),appRouter:a}))}async function L(){let e=await R();return await d(new URL(`app/`,e))}async function R(){let t=await e();return await z()?new URL(`src/`,t):t}async function z(){let t=await e();return d(new URL(`src/`,t))}async function B(){return await r()?`ts`:`js`}async function V(){let{version:e}=y(await g())(`next/package.json`);return e}export{A as NextJsAdapter};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as e,
|
|
1
|
+
import{C as e,N as t,O as n,T as r,a as i,b as a,c as o,i as s,s as c,t as l,u,v as d,w as f}from"./core-C9QC2jUZ.mjs";import{c as p,f as m,p as h}from"./request-DFL5MlKG.mjs";import{i as g,n as _}from"./packageJson-yTgvK-Vp.mjs";import{i as v,r as y}from"./auth-D5YibiqF.mjs";import{n as b,t as x}from"./builders-hKD4IrLX-DzjbepsH.mjs";import{readFile as S,rm as C}from"node:fs/promises";import{fileURLToPath as w}from"node:url";import{relative as T}from"node:path";function E(e){let{name:n,typescript:r}=e,i=t(n);return r?o`
|
|
2
2
|
<script setup lang="ts">
|
|
3
3
|
import type { Content } from "@prismicio/client";
|
|
4
4
|
|
|
@@ -19,7 +19,7 @@ import{C as e,D as t,M as n,S as r,_ as i,i as a,l as o,o as s,r as c,s as l,t a
|
|
|
19
19
|
<strong>You can edit this slice directly in your code editor.</strong>
|
|
20
20
|
</section>
|
|
21
21
|
</template>
|
|
22
|
-
`:
|
|
22
|
+
`:o`
|
|
23
23
|
<script setup>
|
|
24
24
|
// The array passed to \`getSliceComponentProps\` is purely optional.
|
|
25
25
|
// Consider it as a visual hint for you when templating your slice.
|
|
@@ -36,7 +36,7 @@ import{C as e,D as t,M as n,S as r,_ as i,i as a,l as o,o as s,r as c,s as l,t a
|
|
|
36
36
|
<strong>You can edit this slice directly in your code editor.</strong>
|
|
37
37
|
</section>
|
|
38
38
|
</template>
|
|
39
|
-
`}function D(e){let{model:t,typescript:n}=e,r=[`setup`];if(n&&r.push(`lang="ts"`),t.repeatable){let e=n?`route.params.uid as string`:`route.params.uid`;return
|
|
39
|
+
`}function D(e){let{model:t,typescript:n}=e,r=[`setup`];if(n&&r.push(`lang="ts"`),t.repeatable){let e=n?`route.params.uid as string`:`route.params.uid`;return o`
|
|
40
40
|
<script ${r.join(` `)}>
|
|
41
41
|
import { components } from "~/slices";
|
|
42
42
|
|
|
@@ -52,7 +52,7 @@ import{C as e,D as t,M as n,S as r,_ as i,i as a,l as o,o as s,r as c,s as l,t a
|
|
|
52
52
|
<SliceZone :slices="page?.data.slices ?? []" :components="components" />
|
|
53
53
|
</main>
|
|
54
54
|
</template>
|
|
55
|
-
`}return
|
|
55
|
+
`}return o`
|
|
56
56
|
<script ${r.join(` `)}>
|
|
57
57
|
import { components } from "~/slices";
|
|
58
58
|
|
|
@@ -67,7 +67,7 @@ import{C as e,D as t,M as n,S as r,_ as i,i as a,l as o,o as s,r as c,s as l,t a
|
|
|
67
67
|
<SliceZone :slices="page?.data.slices ?? []" :components="components" />
|
|
68
68
|
</main>
|
|
69
69
|
</template>
|
|
70
|
-
`}function O(e){let{typescript:t}=e,n=[`setup`];return t&&n.push(`lang="ts"`),
|
|
70
|
+
`}function O(e){let{typescript:t}=e,n=[`setup`];return t&&n.push(`lang="ts"`),o`
|
|
71
71
|
<script ${n.join(` `)}>
|
|
72
72
|
import { components } from "~/slices";
|
|
73
73
|
<\/script>
|
|
@@ -77,7 +77,7 @@ import{C as e,D as t,M as n,S as r,_ as i,i as a,l as o,o as s,r as c,s as l,t a
|
|
|
77
77
|
<SliceZone :slices="slices" :components="components" />
|
|
78
78
|
</SliceSimulator>
|
|
79
79
|
</template>
|
|
80
|
-
`}const k=`@nuxtjs/prismic`;var A=class extends
|
|
80
|
+
`}const k=`@nuxtjs/prismic`;var A=class extends u{id=`nuxt`;async setupProject(){await _({"@prismicio/client":`^${await g(`@prismicio/client`)}`,[k]:`^${await g(k)}`}),await M(),await P(),await F(),await I(this)}async onProjectInitialized(){let e=await f(),t=await v(),n=await y();await i({repo:e,token:t,host:n})||await c(`http://localhost:3000/slice-simulator`,{repo:e,token:t,host:n}),(await s({repo:e,token:t,host:n})).length===0&&await l({name:`Development`,websiteURL:`http://localhost:3000`,resolverPath:`/preview`},{repo:e,token:t,host:n})}async onSliceCreated(e,n){let r=t(e.name),i=new URL(r,h(n));await m(new URL(`index.vue`,h(i)),E({name:e.name,typescript:await a()}))}onSliceUpdated(){}onSliceDeleted(){}async onCustomTypeCreated(e){e.format===`page`&&await L(e)}onCustomTypeUpdated(){}onCustomTypeDeleted(){}async createSliceIndexFile(e){let t=o`
|
|
81
81
|
// Code generated by Prismic. DO NOT EDIT.
|
|
82
82
|
|
|
83
83
|
import { defineAsyncComponent } from "vue";
|
|
@@ -87,4 +87,4 @@ import{C as e,D as t,M as n,S as r,_ as i,i as a,l as o,o as s,r as c,s as l,t a
|
|
|
87
87
|
${(await this.getSlices()).filter(t=>t.library.href===e.href).map(t=>{let n=T(w(e),w(t.directory));return`${t.model.id}: defineAsyncComponent(() => import("./${n}/index.vue"))`}).join(`,
|
|
88
88
|
`)}
|
|
89
89
|
});
|
|
90
|
-
`,n=`index.${await R()}`;await
|
|
90
|
+
`,n=`index.${await R()}`;await m(new URL(n,e),t)}async getDefaultSliceLibrary(){let e=await j();return new URL(`slices/`,e)}async getDefaultCustomTypeLibrary(){let t=await e();return new URL(`customtypes/`,t)}};async function j(){let t=await e(),n=new URL(`app/`,t);if(await p(n))return n;let r=new URL(`src/`,t);return await p(r)?r:t}async function M(){let t=await e(),n=new URL(`nuxt.config.js`,t);if(await p(n)||(n=new URL(`nuxt.config.ts`,t)),!await p(n))return;let r=w(n),i=await x(r),a=i.exports.default.$type===`function-call`?i.exports.default.$args[0]:i.exports.default;(a.modules||[]).find(e=>typeof e==`string`?e===k:Array.isArray(e)?e[0]===k:!1)||(a.modules||=[],a.modules.push(k)),await b(i,r)}async function N(){let t=await e(),n=new URL(`app/pages/`,t),r=new URL(`src/pages/`,t),i=new URL(`pages/`,t);return await p(n)?n:await p(r)?r:await p(i)?i:new URL(`pages/`,await j())}async function P(){let e=await a(),t=await N(),n=new URL(`slice-simulator.vue`,t);await p(n)||await m(n,O({typescript:e}))}async function F(){let e=await j(),t=new URL(`app.vue`,e);if(!await p(t))return;let n=await S(t,`utf8`);if(!n.includes(`<NuxtWelcome`))return;let r=new URL(`pages/index.vue`,e);await p(r)||await m(r,n),await C(t)}async function I(t){let i=await e(),a=await p(new URL(`app/`,i)),o=await p(new URL(`src/`,i));if(!a&&!o)return;let s;try{s=await r()}catch{return}let c=s.libraries;!c||JSON.stringify(c)!==JSON.stringify([`./slices`])||(await t.getSlices()).length>0||await n({libraries:[a?`./app/slices`:`./src/slices`]})}async function L(e){let t=d(e).split(`/`).filter(Boolean).map(e=>e.startsWith(`:`)?`[${e.slice(1)}]`:e).join(`/`),n=await N(),r=new URL(`${t||`index`}.vue`,n);await p(r)||await m(r,D({model:e,typescript:await a()}))}async function R(){return await a()?`ts`:`js`}export{A as NuxtAdapter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`prismic`,t=`1.9.0`;export{t as n,e as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{E as e,O as t,T as n,c as r,k as i,l as a,o,u as s}from"./request-DFL5MlKG.mjs";import{readFile as c,writeFile as l}from"node:fs/promises";import{fileURLToPath as u}from"node:url";import{createRequire as d}from"module";import{delimiter as f,dirname as p,normalize as m,resolve as h}from"node:path";import{spawn as ee}from"node:child_process";import{cwd as te}from"node:process";import{PassThrough as ne}from"node:stream";import g from"node:readline";const _=/^(?:( )+|\t+)/,v=`space`;function y(e,t,n){return e&&t===v&&n===1}function b(e,t){let n=new Map,r=0,i,a;for(let o of e.split(/\n/g)){if(!o)continue;let e=o.match(_);if(e===null)r=0,i=``;else{let o=e[0].length,s=e[1]?v:`tab`;if(y(t,s,o))continue;s!==i&&(r=0),i=s;let c=1,l=0,u=o-r;if(r=o,u===0)c=0,l=1;else{let e=Math.abs(u);if(y(t,s,e))continue;a=x(s,e)}let d=n.get(a);n.set(a,d===void 0?[1,0]:[d[0]+c,d[1]+l])}}return n}function x(e,t){return(e===v?`s`:`t`)+String(t)}function re(e){return{type:e[0]===`s`?v:`tab`,amount:Number(e.slice(1))}}function ie(e){let t,n=0,r=0;for(let[i,[a,o]]of e)(a>n||a===n&&o>r)&&(n=a,r=o,t=i);return t}function ae(e,t){return(e===v?` `:` `).repeat(t)}function oe(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=b(e,!0);t.size===0&&(t=b(e,!1));let n=ie(t),r,i=0,a=``;return n!==void 0&&({type:r,amount:i}=re(n),a=ae(r,i)),{amount:i,type:r,indent:a}}var se=Object.create,S=Object.defineProperty,C=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,T=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),O=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=w(t),a=0,o=i.length,s;a<o;a++)s=i[a],!E.call(e,s)&&s!==n&&S(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=C(t,s))||r.enumerable});return e},k=(e,t,n)=>(n=e==null?{}:se(T(e)),O(t||!e||!e.__esModule?S(n,`default`,{value:e,enumerable:!0}):n,e)),A=d(import.meta.url);const j=/^path$/i,M={key:`PATH`,value:``};function N(e){for(let t in e){if(!Object.prototype.hasOwnProperty.call(e,t)||!j.test(t))continue;let n=e[t];return n?{key:t,value:n}:M}return M}function P(e,t){let n=t.value.split(f),r=e,i;do n.push(h(r,`node_modules`,`.bin`)),i=r,r=p(r);while(r!==i);return{key:t.key,value:n.join(f)}}function F(e,t){let n={...process.env,...t},r=P(e,N(n));return n[r.key]=r.value,n}const I=e=>{let t=e.length,n=new ne,r=()=>{--t===0&&n.emit(`end`)};for(let t of e)t.pipe(n,{end:!1}),t.on(`end`,r);return n};var L=D((e,t)=>{t.exports=a,a.sync=o;var n=A(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}}),R=D((e,t)=>{t.exports=r,r.sync=i;var n=A(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}}),z=D((e,t)=>{A(`fs`);var n=process.platform===`win32`||global.TESTING_WINDOWS?L():R();t.exports=r,r.sync=i;function r(e,t,i){if(typeof t==`function`&&(i=t,t={}),!i){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,i){r(e,t||{},function(e,t){e?i(e):n(t)})})}n(e,t||{},function(e,n){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,n=!1),i(e,n)})}function i(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}}),B=D((e,t)=>{let n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=A(`path`),i=n?`;`:`:`,a=z(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};t.exports=c,c.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{if(a.sync(n,{pathExt:c}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)}}),V=D((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n}),H=D((e,t)=>{let n=A(`path`),r=B(),i=V();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o}),U=D((e,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,`$1$1\\"`),e=e.replace(/(\\*)$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i}),W=D((e,t)=>{t.exports=/^#!(.*)/}),ce=D((e,t)=>{let n=W();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}}),G=D((e,t)=>{let n=A(`fs`),r=ce();function i(e){let t=Buffer.alloc(150),i;try{i=n.openSync(e,`r`),n.readSync(i,t,0,150,0),n.closeSync(i)}catch{}return r(t.toString())}t.exports=i}),le=D((e,t)=>{let n=A(`path`),r=H(),i=U(),a=G(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d}),ue=D((e,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t,`spawn`);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}}),de=k(D((e,t)=>{let n=A(`child_process`),r=le(),i=ue();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i})(),1),K=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(e,t){super(`Process exited with non-zero status (${e.exitCode})`),this.result=e,this.output=t}};const fe={timeout:void 0,persist:!1},pe={windowsHide:!0};function me(e,t){return{command:m(e),args:t??[]}}function he(e){let t=new AbortController;for(let n of e){if(n.aborted)return t.abort(),n;n.addEventListener(`abort`,()=>{t.abort(n.reason)},{signal:t.signal})}return t.signal}async function q(e){let t=``;for await(let n of e)t+=n.toString();return t}var ge=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(e,t,n){this._options={...fe,...n},this._command=e,this._args=t??[],this._processClosed=new Promise(e=>{this._resolveClose=e})}kill(e){return this._process?.kill(e)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(e,t,n){return _e(e,t,{...n,stdin:this})}async*[Symbol.asyncIterator](){let e=this._process;if(!e)return;let t=[];this._streamErr&&t.push(this._streamErr),this._streamOut&&t.push(this._streamOut);let n=I(t),r=g.createInterface({input:n});for await(let e of r)yield e.toString();if(await this._processClosed,e.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new K(this)}async _waitForOutput(){let e=this._process;if(!e)throw Error(`No process was started`);let[t,n]=await Promise.all([this._streamOut?q(this._streamOut):``,this._streamErr?q(this._streamErr):``]);if(await this._processClosed,this._options?.stdin&&await this._options.stdin,e.removeAllListeners(),this._thrownError)throw this._thrownError;let r={stderr:n,stdout:t,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new K(this,r);return r}then(e,t){return this._waitForOutput().then(e,t)}_streamOut;_streamErr;spawn(){let e=te(),t=this._options,n={...pe,...t.nodeOptions},r=[];this._resetState(),t.timeout!==void 0&&r.push(AbortSignal.timeout(t.timeout)),t.signal!==void 0&&r.push(t.signal),t.persist===!0&&(n.detached=!0),r.length>0&&(n.signal=he(r)),n.env=F(e,n.env);let{command:i,args:a}=me(this._command,this._args),o=(0,de._parse)(i,a,n),s=ee(o.command,o.args,o.options);if(s.stderr&&(this._streamErr=s.stderr),s.stdout&&(this._streamOut=s.stdout),this._process=s,s.once(`error`,this._onError),s.once(`close`,this._onClose),t.stdin!==void 0&&s.stdin&&t.stdin.process){let{stdout:e}=t.stdin.process;e&&e.pipe(s.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(e=>{this._resolveClose=e}),this._thrownError=void 0}_onError=e=>{if(e.name===`AbortError`&&(!(e.cause instanceof Error)||e.cause.name!==`TimeoutError`)){this._aborted=!0;return}this._thrownError=e};_onClose=()=>{this._resolveClose&&this._resolveClose()}};const J=(e,t,n)=>{let r=new ge(e,t,n);return r.spawn(),r},_e=J,ve=n({dependencies:e(t(i(),i())),devDependencies:e(t(i(),i())),peerDependencies:e(t(i(),i())),packageManager:e(i())});async function Y(){return await s(await X(),{schema:ve})}async function X(){let e=await a(`package.json`);if(!e)throw new Z;return e}var Z=class extends Error{name=`MissingPackageJson`;message=`Could not find a package.json file.`};async function ye(e){let t=await X(),n=await c(t,`utf8`),r=oe(n).indent||` `,i=JSON.parse(n);i.dependencies=Object.fromEntries(Object.entries({...i.dependencies,...e}).sort(([e],[t])=>e.localeCompare(t))),await l(t,JSON.stringify(i,null,r)+`
|
|
2
|
+
`)}async function be(e,t=`latest`){let{version:r}=await o(new URL(`${e}/${t}`,`https://registry.npmjs.org/`),{schema:n({version:i()})});return r}const Q={npm:[`npm`,`install`],yarn:[`yarn`,`install`],pnpm:[`pnpm`,`install`],bun:[`bun`,`install`]};async function xe(){let e=await X(),t=new URL(`.`,e),[n,...r]=Q[await Se()];await J(n,r,{nodeOptions:{cwd:u(t),stdio:`inherit`},throwOnError:!0})}const $={"bun.lock":`bun`,"bun.lockb":`bun`,"pnpm-lock.yaml":`pnpm`,"yarn.lock":`yarn`,"package-lock.json":`npm`};async function Se(){let e=await Ce();if(e)return e;let t=await X();for(let e in $){let n=$[e];if(await r(new URL(e,t)))return n}return`npm`}async function Ce(){try{let e=await Y();if(!e.packageManager)return;let t=e.packageManager.split(`@`)[0];return t in Q?t:void 0}catch{return}}export{xe as a,be as i,ye as n,Y as o,X as r,J as s,Z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{access as e,mkdir as t,readFile as n,writeFile as r}from"node:fs/promises";import{fileURLToPath as i,pathToFileURL as a}from"node:url";import{isAbsolute as o,relative as s}from"node:path";Object.freeze({status:`aborted`});function c(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var l=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};const u={};function d(e){return e&&Object.assign(u,e),u}function ee(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function te(e,t){return typeof t==`bigint`?t.toString():t}function ne(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function re(e){return e==null}function f(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}const ie=Symbol(`evaluating`);function p(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ie)return r===void 0&&(r=ie,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ae(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function oe(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}const m=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){if(h(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(h(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function se(e){return g(e)?{...e}:Array.isArray(e)?[...e]:e}const ce=new Set([`string`,`number`,`symbol`]);function le(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function _(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function v(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ue(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function de(e,t){if(!g(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _(e,oe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ae(this,`shape`,n),n}}))}function y(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function b(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function x(e){return typeof e==`string`?e:e?.message}function S(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=x(e.inst?._zod.def?.error?.(e))??x(t?.error?.(e))??x(n.customError?.(e))??x(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function fe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}const C=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,te,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},w=c(`$ZodError`,C),T=c(`$ZodError`,C,{Parent:Error}),E=(e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new l;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>S(e,a,d())));throw m(t,i?.callee),t}return o.value})(T),pe=(e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>S(e,a,d())));throw m(t,i?.callee),t}return o.value})(T),D=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new l;return a.issues.length?{success:!1,error:new(e??w)(a.issues.map(e=>S(e,i,d())))}:{success:!0,data:a.value}})(T),O=(e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>S(e,i,d())))}:{success:!0,data:a.value}})(T),me=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,he=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},k=/^-?\d+(?:\.\d+)?$/,ge=/^(?:true|false)$/i,A=c(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_e=c(`$ZodCheckMinLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!re(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=fe(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ve=c(`$ZodCheckStringFormat`,(e,t)=>{var n,r;A.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ye={major:4,minor:3,patch:6},j=c(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ye;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=y(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new l;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=y(e,t))});else{if(e.issues.length===t)continue;r||=y(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(y(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new l;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new l;return o.then(e=>t(e,r,a))}return t(o,r,a)}}p(e,`~standard`,()=>({validate:t=>{try{let n=D(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return O(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),M=c(`$ZodString`,(e,t)=>{j.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??he(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),N=c(`$ZodStringFormat`,(e,t)=>{ve.init(e,t),M.init(e,t)}),be=c(`$ZodURL`,(e,t)=>{N.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),xe=c(`$ZodNumber`,(e,t)=>{j.init(e,t),e._zod.pattern=e._zod.bag.pattern??k,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),P=c(`$ZodBoolean`,(e,t)=>{j.init(e,t),e._zod.pattern=ge,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Se=c(`$ZodUnknown`,(e,t)=>{j.init(e,t),e._zod.parse=e=>e});function F(e,t,n){e.issues.length&&t.issues.push(...b(n,e.issues)),t.value[n]=e.value}const Ce=c(`$ZodArray`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>F(t,n,e))):F(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function I(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...b(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function we(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ue(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Te(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>I(e,n,i,t,u))):I(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Ee=c(`$ZodObject`,(e,t)=>{if(j.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=ne(()=>we(t));p(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=h,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>I(n,t,e,s,r))):I(i,t,e,s,r)}return i?Te(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),De=c(`$ZodRecord`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!g(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...b(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...b(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&k.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>S(e,r,d())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...b(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...b(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Oe=c(`$ZodEnum`,(e,t)=>{j.init(e,t);let n=ee(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ce.has(typeof e)).map(e=>typeof e==`string`?le(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}});function L(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ke=c(`$ZodOptional`,(e,t)=>{j.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${f(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>L(t,e.value)):L(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ae=c(`$ZodNullable`,(e,t)=>{j.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${f(e.source)}|null)$`):void 0}),p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),je=c(`$ZodDefault`,(e,t)=>{j.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>R(e,t)):R(r,t)}});function R(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Me=c(`$ZodPipe`,(e,t)=>{j.init(e,t),p(e._zod,`values`,()=>t.in._zod.values),p(e._zod,`optin`,()=>t.in._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout),p(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>z(e,t.in,n)):z(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>z(e,t.out,n)):z(r,t.out,n)}});function z(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const B=c(`$ZodCodec`,(e,t)=>{j.init(e,t),p(e._zod,`values`,()=>t.in._zod.values),p(e._zod,`optin`,()=>t.in._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout),p(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t,n)):V(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t,n)):V(r,t,n)}}});function V(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>H(e,r,t.out,n)):H(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>H(e,r,t.in,n)):H(e,r,t.in,n)}}function H(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var U,Ne=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Pe(){return new Ne}(U=globalThis).__zod_globalRegistry??(U.__zod_globalRegistry=Pe()),globalThis.__zod_globalRegistry;function Fe(e,t){return new e({type:`string`,...v(t)})}function W(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...v(t)})}function Ie(e,t){return new e({type:`number`,checks:[],...v(t)})}function Le(e,t){return new e({type:`boolean`,...v(t)})}function Re(e){return new e({type:`unknown`})}function ze(e,t){return new _e({check:`min_length`,...v(t),minimum:e})}function Be(e,t){let n=v(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??B,c=e.Boolean??P,l=new s({type:`pipe`,in:new(e.String??M)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:o.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}const G=c(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);j.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>E(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>D(e,t,n),e.parseAsync=async(t,n)=>pe(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>O(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>_(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),K=c(`ZodMiniString`,(e,t)=>{M.init(e,t),G.init(e,t)});function Ve(e){return Fe(K,e)}const He=c(`ZodMiniStringFormat`,(e,t)=>{N.init(e,t),K.init(e,t)}),q=c(`ZodMiniURL`,(e,t)=>{be.init(e,t),He.init(e,t)});function Ue(e){return W(q,e)}function We(e){return W(q,{protocol:/^https?$/,hostname:me,...v(e)})}const Ge=c(`ZodMiniNumber`,(e,t)=>{xe.init(e,t),G.init(e,t)});function Ke(e){return Ie(Ge,e)}const J=c(`ZodMiniBoolean`,(e,t)=>{P.init(e,t),G.init(e,t)});function qe(e){return Le(J,e)}const Je=c(`ZodMiniUnknown`,(e,t)=>{Se.init(e,t),G.init(e,t)});function Ye(){return Re(Je)}const Xe=c(`ZodMiniArray`,(e,t)=>{Ce.init(e,t),G.init(e,t)});function Ze(e,t){return new Xe({type:`array`,element:e,...v(t)})}const Y=c(`ZodMiniObject`,(e,t)=>{Ee.init(e,t),G.init(e,t),p(e,`shape`,()=>t.shape)});function Qe(e,t){return new Y({type:`object`,shape:e??{},...v(t)})}function $e(e,t){return new Y({type:`object`,shape:e,catchall:Ye(),...v(t)})}function et(e,t){return de(e,t)}const X=c(`ZodMiniRecord`,(e,t)=>{De.init(e,t),G.init(e,t)});function tt(e,t,n){return new X({type:`record`,keyType:e,valueType:t,...v(n)})}function nt(e,t,n){let r=_(e);return r._zod.values=void 0,new X({type:`record`,keyType:r,valueType:t,...v(n)})}const rt=c(`ZodMiniEnum`,(e,t)=>{Oe.init(e,t),G.init(e,t),e.options=Object.values(t.entries)});function it(e,t){return new rt({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...v(t)})}const at=c(`ZodMiniOptional`,(e,t)=>{ke.init(e,t),G.init(e,t)});function ot(e){return new at({type:`optional`,innerType:e})}const st=c(`ZodMiniNullable`,(e,t)=>{Ae.init(e,t),G.init(e,t)});function ct(e){return new st({type:`nullable`,innerType:e})}const lt=c(`ZodMiniDefault`,(e,t)=>{je.init(e,t),G.init(e,t)});function ut(e,t){return new lt({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}const dt=c(`ZodMiniPipe`,(e,t)=>{Me.init(e,t),G.init(e,t)}),ft=c(`ZodMiniCodec`,(e,t)=>{dt.init(e,t),B.init(e,t)}),pt=(...e)=>Be({Codec:ft,Boolean:J,String:K},...e);function Z(e){let t=new URL(e);return t.pathname.endsWith(`/`)||(t.pathname+=`/`),t}function mt(e,t){return s(i(e),i(t))}function ht(e){let t=e.pathname.lastIndexOf(`.`);if(t!==-1)return e.pathname.slice(t+1).toLowerCase()||void 0}function gt(e,t){let n=s(i(e),i(t));return!(!n||n.startsWith(`..`)||o(n))}async function _t(t,n={}){let{start:r=a(process.cwd()),stop:i}=n,o=Z(r);for(;;){let n=new URL(t,o);try{return await e(n),n}catch{}if(typeof i==`string`){let t=new URL(i,o);try{await e(t);return}catch{}}else if(i instanceof URL&&i.href===o.href)return;let r=new URL(`..`,o);if(r.href===o.href)return;o=r}}async function vt(t){try{return await e(t),!0}catch{return!1}}async function yt(e,n){await t(new URL(`.`,e),{recursive:!0}),await r(e,n)}async function bt(e,t={}){let{schema:r}=t,i=await n(e,`utf8`),a=JSON.parse(i);return r?E(r,a):a}const xt={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`};async function St(e){if(e.protocol===`http:`||e.protocol===`https:`){let t=await fetch(e);if(!t.ok)throw Error(`Failed to download file from "${e.toString()}" (HTTP ${t.status}).`);return await t.blob()}if(e.protocol===`file:`){let t=await n(e),r=ht(e),i=r&&xt[r]||`application/octet-stream`;return new Blob([t],{type:i})}throw Error(`Unsupported file protocol: ${e.protocol}`)}function Ct(e){return JSON.stringify(e,null,2)}async function wt(e,t={}){let{credentials:n,...r}=t,i=new Headers(t.headers);if(i.has(`Accept`)||i.set(`Accept`,`application/json`),i.has(`User-Agent`)||i.set(`User-Agent`,`prismic-cli`),n){let e=[];for(let t in n)e.push(`${t}=${n[t]??``}`);i.set(`Cookie`,e.join(`; `))}!i.has(`Content-Type`)&&t.body&&i.set(`Content-Type`,`application/json`),t.body instanceof FormData&&i.delete(`Content-Type`);let a=i.get(`Content-Type`)===`application/json`?JSON.stringify(t.body):t.body,o=await fetch(e,{...r,body:a,headers:i}),s=await o.clone().json().catch(()=>o.clone().text());if(o.ok)return t.schema?E(t.schema,s):s;throw o.status===401?new $(o):o.status===403?new Dt(o):o.status===404?new Et(o):new Tt(o)}var Q=class extends Error{name=`RequestError`;response;constructor(e){super(`fetch failed: ${e.url}`),this.response=e}async text(){return this.response.clone().text()}async json(){return this.response.clone().json()}get status(){return this.response.status}get statusText(){return this.response.statusText}},Tt=class extends Q{name=`UnknownRequestError`},Et=class extends Q{name=`NotFoundRequestError`;constructor(e){super(e),this.message=``}},Dt=class extends Q{name=`ForbiddenRequestError`},$=class extends Q{name=`UnauthorizedRequestError`};export{Ue as A,Ke as C,tt as D,nt as E,E as M,w as N,Ve as O,ct as S,ot as T,Ze as _,wt as a,We as b,_t as c,yt as d,Z as f,it as g,ut as h,Tt as i,ze as j,pt as k,bt as l,mt as m,Et as n,Ct as o,gt as p,$ as r,vt as s,Dt as t,St as u,qe as v,Qe as w,$e as x,et as y};
|
|
1
|
+
import{access as e,mkdir as t,readFile as n,writeFile as r}from"node:fs/promises";import{fileURLToPath as i,pathToFileURL as a}from"node:url";import{isAbsolute as o,relative as s}from"node:path";Object.freeze({status:`aborted`});function c(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var l=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};const u={};function d(e){return e&&Object.assign(u,e),u}function ee(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function te(e,t){return typeof t==`bigint`?t.toString():t}function ne(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function re(e){return e==null}function f(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}const ie=Symbol(`evaluating`);function p(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ie)return r===void 0&&(r=ie,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ae(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function oe(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}const m=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){if(h(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(h(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function se(e){return g(e)?{...e}:Array.isArray(e)?[...e]:e}const ce=new Set([`string`,`number`,`symbol`]);function le(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function _(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function v(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ue(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function de(e,t){if(!g(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _(e,oe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ae(this,`shape`,n),n}}))}function y(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function b(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function x(e){return typeof e==`string`?e:e?.message}function S(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=x(e.inst?._zod.def?.error?.(e))??x(t?.error?.(e))??x(n.customError?.(e))??x(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function fe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}const C=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,te,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},w=c(`$ZodError`,C),T=c(`$ZodError`,C,{Parent:Error}),E=(e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new l;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>S(e,a,d())));throw m(t,i?.callee),t}return o.value})(T),pe=(e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>S(e,a,d())));throw m(t,i?.callee),t}return o.value})(T),D=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new l;return a.issues.length?{success:!1,error:new(e??w)(a.issues.map(e=>S(e,i,d())))}:{success:!0,data:a.value}})(T),O=(e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>S(e,i,d())))}:{success:!0,data:a.value}})(T),me=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,he=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},k=/^-?\d+(?:\.\d+)?$/,ge=/^(?:true|false)$/i,A=c(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_e=c(`$ZodCheckMinLength`,(e,t)=>{var n;A.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!re(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=fe(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ve=c(`$ZodCheckStringFormat`,(e,t)=>{var n,r;A.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ye={major:4,minor:3,patch:6},j=c(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ye;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=y(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new l;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=y(e,t))});else{if(e.issues.length===t)continue;r||=y(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(y(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new l;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new l;return o.then(e=>t(e,r,a))}return t(o,r,a)}}p(e,`~standard`,()=>({validate:t=>{try{let n=D(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return O(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),M=c(`$ZodString`,(e,t)=>{j.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??he(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),N=c(`$ZodStringFormat`,(e,t)=>{ve.init(e,t),M.init(e,t)}),be=c(`$ZodURL`,(e,t)=>{N.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),xe=c(`$ZodNumber`,(e,t)=>{j.init(e,t),e._zod.pattern=e._zod.bag.pattern??k,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),P=c(`$ZodBoolean`,(e,t)=>{j.init(e,t),e._zod.pattern=ge,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Se=c(`$ZodUnknown`,(e,t)=>{j.init(e,t),e._zod.parse=e=>e});function F(e,t,n){e.issues.length&&t.issues.push(...b(n,e.issues)),t.value[n]=e.value}const Ce=c(`$ZodArray`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>F(t,n,e))):F(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function I(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...b(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function we(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ue(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Te(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>I(e,n,i,t,u))):I(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Ee=c(`$ZodObject`,(e,t)=>{if(j.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=ne(()=>we(t));p(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=h,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>I(n,t,e,s,r))):I(i,t,e,s,r)}return i?Te(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),De=c(`$ZodRecord`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!g(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...b(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...b(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&k.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>S(e,r,d())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...b(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...b(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Oe=c(`$ZodEnum`,(e,t)=>{j.init(e,t);let n=ee(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ce.has(typeof e)).map(e=>typeof e==`string`?le(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}});function L(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ke=c(`$ZodOptional`,(e,t)=>{j.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${f(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>L(t,e.value)):L(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ae=c(`$ZodNullable`,(e,t)=>{j.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${f(e.source)}|null)$`):void 0}),p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),je=c(`$ZodDefault`,(e,t)=>{j.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>R(e,t)):R(r,t)}});function R(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Me=c(`$ZodPipe`,(e,t)=>{j.init(e,t),p(e._zod,`values`,()=>t.in._zod.values),p(e._zod,`optin`,()=>t.in._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout),p(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>z(e,t.in,n)):z(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>z(e,t.out,n)):z(r,t.out,n)}});function z(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const B=c(`$ZodCodec`,(e,t)=>{j.init(e,t),p(e._zod,`values`,()=>t.in._zod.values),p(e._zod,`optin`,()=>t.in._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout),p(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t,n)):V(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>V(e,t,n)):V(r,t,n)}}});function V(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>H(e,r,t.out,n)):H(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>H(e,r,t.in,n)):H(e,r,t.in,n)}}function H(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var U,Ne=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Pe(){return new Ne}(U=globalThis).__zod_globalRegistry??(U.__zod_globalRegistry=Pe()),globalThis.__zod_globalRegistry;function Fe(e,t){return new e({type:`string`,...v(t)})}function W(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...v(t)})}function Ie(e,t){return new e({type:`number`,checks:[],...v(t)})}function Le(e,t){return new e({type:`boolean`,...v(t)})}function Re(e){return new e({type:`unknown`})}function ze(e,t){return new _e({check:`min_length`,...v(t),minimum:e})}function Be(e,t){let n=v(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??B,c=e.Boolean??P,l=new s({type:`pipe`,in:new(e.String??M)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:o.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}const G=c(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);j.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>E(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>D(e,t,n),e.parseAsync=async(t,n)=>pe(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>O(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>_(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),K=c(`ZodMiniString`,(e,t)=>{M.init(e,t),G.init(e,t)});function Ve(e){return Fe(K,e)}const He=c(`ZodMiniStringFormat`,(e,t)=>{N.init(e,t),K.init(e,t)}),q=c(`ZodMiniURL`,(e,t)=>{be.init(e,t),He.init(e,t)});function Ue(e){return W(q,e)}function We(e){return W(q,{protocol:/^https?$/,hostname:me,...v(e)})}const Ge=c(`ZodMiniNumber`,(e,t)=>{xe.init(e,t),G.init(e,t)});function Ke(e){return Ie(Ge,e)}const J=c(`ZodMiniBoolean`,(e,t)=>{P.init(e,t),G.init(e,t)});function qe(e){return Le(J,e)}const Je=c(`ZodMiniUnknown`,(e,t)=>{Se.init(e,t),G.init(e,t)});function Ye(){return Re(Je)}const Xe=c(`ZodMiniArray`,(e,t)=>{Ce.init(e,t),G.init(e,t)});function Ze(e,t){return new Xe({type:`array`,element:e,...v(t)})}const Y=c(`ZodMiniObject`,(e,t)=>{Ee.init(e,t),G.init(e,t),p(e,`shape`,()=>t.shape)});function Qe(e,t){return new Y({type:`object`,shape:e??{},...v(t)})}function $e(e,t){return new Y({type:`object`,shape:e,catchall:Ye(),...v(t)})}function et(e,t){return de(e,t)}const X=c(`ZodMiniRecord`,(e,t)=>{De.init(e,t),G.init(e,t)});function tt(e,t,n){return new X({type:`record`,keyType:e,valueType:t,...v(n)})}function nt(e,t,n){let r=_(e);return r._zod.values=void 0,new X({type:`record`,keyType:r,valueType:t,...v(n)})}const rt=c(`ZodMiniEnum`,(e,t)=>{Oe.init(e,t),G.init(e,t),e.options=Object.values(t.entries)});function it(e,t){return new rt({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...v(t)})}const at=c(`ZodMiniOptional`,(e,t)=>{ke.init(e,t),G.init(e,t)});function ot(e){return new at({type:`optional`,innerType:e})}const st=c(`ZodMiniNullable`,(e,t)=>{Ae.init(e,t),G.init(e,t)});function ct(e){return new st({type:`nullable`,innerType:e})}const lt=c(`ZodMiniDefault`,(e,t)=>{je.init(e,t),G.init(e,t)});function ut(e,t){return new lt({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():se(t)}})}const dt=c(`ZodMiniPipe`,(e,t)=>{Me.init(e,t),G.init(e,t)}),ft=c(`ZodMiniCodec`,(e,t)=>{dt.init(e,t),B.init(e,t)}),pt=(...e)=>Be({Codec:ft,Boolean:J,String:K},...e);function Z(e){let t=new URL(e);return t.pathname.endsWith(`/`)||(t.pathname+=`/`),t}function mt(e,t){return s(i(e),i(t))}function ht(e){let t=e.pathname.lastIndexOf(`.`);if(t!==-1)return e.pathname.slice(t+1).toLowerCase()||void 0}function gt(e,t){let n=s(i(e),i(t));return!(!n||n.startsWith(`..`)||o(n))}async function _t(t,n={}){let{start:r=a(process.cwd()),stop:i}=n,o=Z(r);for(;;){let n=new URL(t,o);try{return await e(n),n}catch{}if(typeof i==`string`){let t=new URL(i,o);try{await e(t);return}catch{}}else if(i instanceof URL&&i.href===o.href)return;let r=new URL(`..`,o);if(r.href===o.href)return;o=r}}async function vt(t){try{return await e(t),!0}catch{return!1}}async function yt(e,n){await t(new URL(`.`,e),{recursive:!0}),await r(e,n)}async function bt(e,t={}){let{schema:r}=t,i=await n(e,`utf8`),a=JSON.parse(i);return r?E(r,a):a}const xt={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`};async function St(e){if(e.protocol===`http:`||e.protocol===`https:`){let t=await fetch(e);if(!t.ok)throw Error(`Failed to download file from "${e.toString()}" (HTTP ${t.status}).`);return await t.blob()}if(e.protocol===`file:`){let t=await n(e),r=ht(e),i=r&&xt[r]||`application/octet-stream`;return new Blob([t],{type:i})}throw Error(`Unsupported file protocol: ${e.protocol}`)}function Ct(e){return JSON.stringify(e,null,2)}async function wt(e,t={}){let{credentials:n,...r}=t,i=new Headers(t.headers);if(i.has(`Accept`)||i.set(`Accept`,`application/json`),i.has(`User-Agent`)||i.set(`User-Agent`,`prismic-cli`),n){let e=[];for(let t in n)e.push(`${t}=${n[t]??``}`);i.set(`Cookie`,e.join(`; `))}!i.has(`Content-Type`)&&t.body&&i.set(`Content-Type`,`application/json`),t.body instanceof FormData&&i.delete(`Content-Type`);let a=i.get(`Content-Type`)===`application/json`?JSON.stringify(t.body):t.body,o=await fetch(e,{...r,body:a,headers:i}),s=await o.clone().json().catch(()=>o.clone().text());if(o.ok)return t.schema?E(t.schema,s):s;throw o.status===400?new Et(o,s):o.status===401?new $(o):o.status===403?new Ot(o):o.status===404?new Dt(o):new Tt(o)}var Q=class extends Error{name=`RequestError`;response;constructor(e){super(`fetch failed: ${e.url}`),this.response=e}async text(){return this.response.clone().text()}async json(){return this.response.clone().json()}get status(){return this.response.status}get statusText(){return this.response.statusText}},Tt=class extends Q{name=`UnknownRequestError`},Et=class extends Q{name=`BadRequestError`;body;constructor(e,t){super(e),this.body=t}},Dt=class extends Q{name=`NotFoundRequestError`;constructor(e){super(e),this.message=``}},Ot=class extends Q{name=`ForbiddenRequestError`},$=class extends Q{name=`UnauthorizedRequestError`};export{pt as A,ct as C,nt as D,ot as E,ze as M,E as N,tt as O,w as P,$e as S,Qe as T,it as _,Tt as a,et as b,vt as c,St as d,yt as f,ut as g,mt as h,$ as i,Ue as j,Ve as k,_t as l,gt as m,Ot as n,wt as o,Z as p,Dt as r,Ct as s,Et as t,bt as u,Ze as v,Ke as w,We as x,qe as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./package-
|
|
1
|
+
import{n as e,t}from"./package-ln6JGWAi.mjs";import{fileURLToPath as n}from"node:url";import{spawn as r}from"node:child_process";const i=[],a=[],o=crypto.randomUUID();let s;async function c(e){let{writeKey:t}=e;process.on(`exit`,()=>d({writeKey:t}))}function l(n){s=n.userId,a.push({userId:n.userId,anonymousId:o,integrations:{Intercom:{user_hash:n.intercomHash}},context:{app:{name:t,version:e}},timestamp:new Date().toISOString()})}function u(n,r={}){let{properties:a,groupId:c}=r;i.push({event:n,properties:{nodeVersion:process.versions.node,...a},context:{app:{name:t,version:e},groupId:c},userId:s,anonymousId:o,timestamp:new Date().toISOString()})}function d(e){let{writeKey:t}=e;if(!(i.length===0&&a.length===0)){try{let e=Buffer.from(JSON.stringify({trackEvents:i.map(e=>({...e,userId:e.userId||s})),identifyEvents:a,writeKey:t})).toString(`base64`),o=n(new URL(`./subprocesses/sendSegmentEvents.mjs`,import.meta.url));r(process.execPath,[o,e],{detached:!0,stdio:`ignore`}).unref()}catch{}i.length=0,a.length=0}}async function f(e,t,n){let r={"Content-Type":`application/json`,Authorization:`Basic ${btoa(n+`:`)}`};await Promise.allSettled([...e.map(e=>fetch(`https://api.segment.io/v1/track`,{method:`POST`,headers:r,body:JSON.stringify(e)}).catch(()=>{})),...t.map(e=>fetch(`https://api.segment.io/v1/identify`,{method:`POST`,headers:r,body:JSON.stringify(e)}).catch(()=>{}))])}export{l as i,f as n,u as r,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"../auth-
|
|
1
|
+
import{o as e}from"../auth-D5YibiqF.mjs";try{await e()}catch{}export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"../segment-
|
|
1
|
+
import{n as e}from"../segment-BiyM1DAx.mjs";const{trackEvents:t,identifyEvents:n,writeKey:r}=JSON.parse(Buffer.from(process.argv[2],`base64`).toString());try{await e(t,n,r)}catch{}export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../packageJson-
|
|
1
|
+
import"../packageJson-yTgvK-Vp.mjs";import{n as e}from"../update-notifier-0ylnuuXF.mjs";const[t,n]=process.argv.slice(2);try{await e(t,new URL(n))}catch{}export{};
|