prismic 1.12.2 → 1.13.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.
@@ -1,4 +1,4 @@
1
- import{C as e,M 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-BD03UynO.mjs";import{c as d,f,p}from"./request-Dtd3MvMj.mjs";import{i as m,n as h,r as g}from"./packageJson-DuN38oFo.mjs";import{i as _,r as v}from"./auth-t8Ao2K5y.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`
1
+ import{D as e,M as t,S as n,a as r,c as i,g as a,i as o,s,t as c,v as l,x as u}from"./core-Dw_6KGNJ.mjs";import{c as d,f,p}from"./request-CjjxiLJy.mjs";import{i as m,n as h,r as g}from"./packageJson-BSh_AvfX.mjs";import{r as _}from"./auth-C3-3mBIR.mjs";import{createRequire as v}from"node:module";import{fileURLToPath as y}from"node:url";import{relative as b}from"node:path";const x=e`
2
2
  return (
3
3
  <section
4
4
  data-slice-type={slice.slice_type}
@@ -9,7 +9,7 @@ import{C as e,M 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 a
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:a}=e,o=t(n),s=t(r),c=i`
12
+ `;function S(n){let{name:r,id:i,typescript:a}=n,o=t(r),s=t(i),c=e`
13
13
  import { FC } from "react";
14
14
  import { Content } from "@prismicio/client";
15
15
  import { SliceComponentProps } from "@prismicio/react";
@@ -20,63 +20,63 @@ import{C as e,M 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 a
20
20
  export type ${o}Props = SliceComponentProps<Content.${s}Slice>;
21
21
 
22
22
  /**
23
- * Component for "${n}" Slices.
23
+ * Component for "${r}" Slices.
24
24
  */
25
25
  const ${o}: FC<${o}Props> = ({ slice }) => {
26
- ${S}
26
+ ${x}
27
27
  };
28
28
 
29
29
  export default ${o}
30
- `,l=i`
30
+ `,l=e`
31
31
  /**
32
32
  * @typedef {import("@prismicio/client").Content.${s}Slice} ${o}Slice
33
33
  * @typedef {import("@prismicio/react").SliceComponentProps<${o}Slice>} ${o}Props
34
34
  * @type {import("react").FC<${o}Props>}
35
35
  */
36
36
  const ${o} = ({ slice }) => {
37
- ${S}
37
+ ${x}
38
38
  };
39
39
 
40
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`
41
+ `;return a?c:l}function C(t){let{model:n,routePath:r,typescript:i,appRouter:a}=t;return a?n.repeatable?i?e`
42
42
  import { SliceZone } from "@prismicio/react";
43
43
  import { createClient } from "@/prismicio";
44
44
  import { components } from "@/slices";
45
45
 
46
- export default async function Page({ params }: PageProps<"/${n}">) {
46
+ export default async function Page({ params }: PageProps<"/${r}">) {
47
47
  const { uid } = await params;
48
48
  const client = createClient();
49
- const page = await client.getByUID("${t.id}", uid);
49
+ const page = await client.getByUID("${n.id}", uid);
50
50
 
51
51
  return <SliceZone slices={page.data.slices} components={components} />;
52
52
  }
53
- `:i`
53
+ `:e`
54
54
  import { SliceZone } from "@prismicio/react";
55
55
  import { createClient } from "@/prismicio";
56
56
  import { components } from "@/slices";
57
57
 
58
58
  /**
59
- * @type {PageProps<"/${n}">}
59
+ * @type {PageProps<"/${r}">}
60
60
  */
61
61
  export default async function Page({ params }) {
62
62
  const { uid } = await params;
63
63
  const client = createClient();
64
- const page = await client.getByUID("${t.id}", uid);
64
+ const page = await client.getByUID("${n.id}", uid);
65
65
 
66
66
  return <SliceZone slices={page.data.slices} components={components} />;
67
67
  }
68
- `:i`
68
+ `:e`
69
69
  import { SliceZone } from "@prismicio/react";
70
70
  import { createClient } from "@/prismicio";
71
71
  import { components } from "@/slices";
72
72
 
73
73
  export default async function Page() {
74
74
  const client = createClient();
75
- const page = await client.getSingle("${t.id}");
75
+ const page = await client.getSingle("${n.id}");
76
76
 
77
77
  return <SliceZone slices={page.data.slices} components={components} />;
78
78
  }
79
- `:t.repeatable?r?i`
79
+ `:n.repeatable?i?e`
80
80
  import type { InferGetStaticPropsType, GetStaticPropsContext } from "next";
81
81
  import { SliceZone } from "@prismicio/react";
82
82
  import { createClient } from "@/prismicio";
@@ -86,7 +86,7 @@ import{C as e,M 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 a
86
86
 
87
87
  export async function getStaticProps({ params, previewData }: GetStaticPropsContext<Params>) {
88
88
  const client = createClient({ previewData });
89
- const page = await client.getByUID("${t.id}", params.uid);
89
+ const page = await client.getByUID("${n.id}", params.uid);
90
90
 
91
91
  return { props: { page } };
92
92
  }
@@ -97,14 +97,14 @@ import{C as e,M 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 a
97
97
 
98
98
  export async function getStaticPaths() {
99
99
  const client = createClient();
100
- const pages = await client.getAllByType("${t.id}");
100
+ const pages = await client.getAllByType("${n.id}");
101
101
 
102
102
  return {
103
103
  paths: pages.map((page) => ({ params: { uid: page.uid } })),
104
104
  fallback: false,
105
105
  };
106
106
  }
107
- `:i`
107
+ `:e`
108
108
  import { SliceZone } from "@prismicio/react";
109
109
  import { createClient } from "@/prismicio";
110
110
  import { components } from "@/slices";
@@ -118,21 +118,21 @@ import{C as e,M 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 a
118
118
 
119
119
  export async function getStaticProps({ params, previewData }) {
120
120
  const client = createClient({ previewData });
121
- const page = await client.getByUID("${t.id}", params.uid);
121
+ const page = await client.getByUID("${n.id}", params.uid);
122
122
 
123
123
  return { props: { page } };
124
124
  }
125
125
 
126
126
  export async function getStaticPaths() {
127
127
  const client = createClient();
128
- const pages = await client.getAllByType("${t.id}");
128
+ const pages = await client.getAllByType("${n.id}");
129
129
 
130
130
  return {
131
131
  paths: pages.map((page) => ({ params: { uid: page.uid } })),
132
132
  fallback: false,
133
133
  };
134
134
  }
135
- `:r?i`
135
+ `:i?e`
136
136
  import type { InferGetStaticPropsType, GetStaticPropsContext } from "next";
137
137
  import { SliceZone } from "@prismicio/react";
138
138
  import { createClient } from "@/prismicio";
@@ -140,7 +140,7 @@ import{C as e,M 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 a
140
140
 
141
141
  export async function getStaticProps({ previewData }: GetStaticPropsContext) {
142
142
  const client = createClient({ previewData });
143
- const page = await client.getSingle("${t.id}");
143
+ const page = await client.getSingle("${n.id}");
144
144
 
145
145
  return { props: { page } };
146
146
  }
@@ -148,7 +148,7 @@ import{C as e,M 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 a
148
148
  export default function Page({ page }: InferGetStaticPropsType<typeof getStaticProps>) {
149
149
  return <SliceZone slices={page.data.slices} components={components} />;
150
150
  }
151
- `:i`
151
+ `:e`
152
152
  import { SliceZone } from "@prismicio/react";
153
153
  import { createClient } from "@/prismicio";
154
154
  import { components } from "@/slices";
@@ -162,18 +162,18 @@ import{C as e,M 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 a
162
162
 
163
163
  export async function getStaticProps({ previewData }) {
164
164
  const client = createClient({ previewData });
165
- const page = await client.getSingle("${t.id}");
165
+ const page = await client.getSingle("${n.id}");
166
166
 
167
167
  return { props: { page } };
168
168
  }
169
- `}function T(e){let{typescript:t,appRouter:n,hasSrcDirectory:r}=e,a=`${r?`..`:`.`}/prismic.config.json`,o,s;return n?t?(o=i`
169
+ `}function w(t){let{typescript:n,appRouter:r,hasSrcDirectory:i}=t,a=`${i?`..`:`.`}/prismic.config.json`,o,s;return r?n?(o=e`
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
175
  import prismicConfig from "${a}";
176
- `,s=i`
176
+ `,s=e`
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,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 a
194
194
 
195
195
  return client;
196
196
  };
197
- `):(o=i`
197
+ `):(o=e`
198
198
  import { createClient as baseCreateClient } from "@prismicio/client";
199
199
  import { enableAutoPreviews } from "@prismicio/next";
200
200
  import prismicConfig from "${a}";
201
- `,s=i`
201
+ `,s=e`
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,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 a
219
219
 
220
220
  return client;
221
221
  };
222
- `):t?(o=i`
222
+ `):n?(o=e`
223
223
  import { createClient as baseCreateClient } from "@prismicio/client";
224
224
  import { enableAutoPreviews, type CreateClientConfig } from "@prismicio/next/pages";
225
225
  import prismicConfig from "${a}";
226
- `,s=i`
226
+ `,s=e`
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,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 a
240
240
 
241
241
  return client;
242
242
  };
243
- `):(o=i`
243
+ `):(o=e`
244
244
  import { createClient as baseCreateClient } from "@prismicio/client";
245
245
  import { enableAutoPreviews } from "@prismicio/next/pages";
246
246
  import prismicConfig from "${a}";
247
- `,s=i`
247
+ `,s=e`
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,7 +261,7 @@ import{C as e,M 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 a
261
261
 
262
262
  return client;
263
263
  };
264
- `),t?i`
264
+ `),n?e`
265
265
  ${o}
266
266
 
267
267
  /**
@@ -270,7 +270,7 @@ import{C as e,M 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 a
270
270
  export const repositoryName = prismicConfig.repositoryName;
271
271
 
272
272
  ${s}
273
- `:i`
273
+ `:e`
274
274
  ${o}
275
275
 
276
276
  /**
@@ -279,7 +279,7 @@ import{C as e,M 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 a
279
279
  export const repositoryName = prismicConfig.repositoryName;
280
280
 
281
281
  ${s}
282
- `}function E(e){let{typescript:t,appRouter:n}=e,r=i`
282
+ `}function T(t){let{typescript:n,appRouter:r}=t,i=e`
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,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 a
297
297
  </SliceSimulator>
298
298
  );
299
299
  }
300
- `,a=i`
300
+ `,a=e`
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,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 a
313
313
  </SliceSimulator>
314
314
  );
315
315
  }
316
- `,o=i`
316
+ `,o=e`
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,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 a
326
326
  />
327
327
  );
328
328
  }
329
- `;return n?t?r:a:o}function D(e){let{typescript:t,appRouter:n}=e,r=i`
329
+ `;return r?n?i:a:o}function E(t){let{typescript:n,appRouter:r}=t,i=e`
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,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 a
337
337
 
338
338
  return await redirectToPreviewURL({ client, request });
339
339
  }
340
- `,a=i`
340
+ `,a=e`
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,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 a
347
347
 
348
348
  return await redirectToPreviewURL({ client, request });
349
349
  }
350
- `,o=i`
350
+ `,o=e`
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,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 a
360
360
 
361
361
  return await redirectToPreviewURL({ req, res, client });
362
362
  };
363
- `,s=i`
363
+ `,s=e`
364
364
  import { setPreviewData, redirectToPreviewURL } from "@prismicio/next/pages";
365
365
 
366
366
  import { createClient } from "../../prismicio";
@@ -372,42 +372,42 @@ import{C as e,M 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 a
372
372
 
373
373
  return await redirectToPreviewURL({ req, res, client });
374
374
  };
375
- `;return n?t?r:a:t?o:s}function O(e){let{typescript:t,appRouter:n}=e,r=i`
375
+ `;return r?n?i:a:n?o:s}function D(t){let{typescript:n,appRouter:r}=t,i=e`
376
376
  import { exitPreview } from "@prismicio/next";
377
377
 
378
378
  export function GET() {
379
379
  return exitPreview();
380
380
  }
381
- `,a=i`
381
+ `,a=e`
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
- `,o=i`
388
+ `,o=e`
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?a:o}function k(e){let{supportsCacheLife:t}=e;return i`
394
+ `;return r?i:n?a:o}function O(t){let{supportsCacheLife:n}=t;return e`
395
395
  import { NextResponse } from "next/server";
396
396
  import { revalidateTag } from "next/cache";
397
397
 
398
398
  export async function POST() {
399
- revalidateTag("prismic"${t?`, "max"`:``});
399
+ revalidateTag("prismic"${n?`, "max"`:``});
400
400
 
401
401
  return NextResponse.json({ revalidated: true, now: Date.now() });
402
402
  }
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`
403
+ `}var k=class extends i{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 P(),await N(),await M(),await j(),await A()}async onProjectInitialized(){let e=await n(),{token:t,host:i}=await _();await r({repo:e,token:t,host:i})||await s(`http://localhost:3000/slice-simulator`,{repo:e,token:t,host:i}),(await o({repo:e,token:t,host:i})).length===0&&await c({name:`Development`,websiteURL:`http://localhost:3000`,resolverPath:`/api/preview`},{repo:e,token:t,host:i})}async onSliceCreated(e,n){let r=t(e.name),i=new URL(r,p(n)),a=await z();await f(new URL(`index.${a}x`,p(i)),S({name:e.name,id:e.id,typescript:await l()}))}onSliceUpdated(){}onSliceDeleted(){}async onCustomTypeCreated(e){e.format===`page`&&await F(e)}onCustomTypeUpdated(){}onCustomTypeDeleted(){}async createSliceIndexFile(n){let r=(await this.getSlices()).filter(e=>e.library.href===n.href),i=r.map(e=>`import ${t(e.model.name)} from "./${b(y(n),y(e.directory))}";`),a=r.map(e=>{let n=t(e.model.name);return`${e.model.id}: ${n}`}),o=e`
404
404
  // Code generated by Prismic. DO NOT EDIT.
405
405
 
406
- ${r.join(`
406
+ ${i.join(`
407
407
  `)}
408
408
 
409
409
  export const components = {
410
410
  ${a.join(`,
411
411
  `)}
412
412
  };
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};
413
+ `,s=`index.${await z()}`;await f(new URL(s,n),o)}async getDefaultSliceLibrary(){let e=await u(),t=await R();return new URL(t?`src/slices/`:`slices/`,e)}async getDefaultCustomTypeLibrary(){let e=await u();return new URL(`customtypes/`,e)}};async function A(){if(!await I())return;let e=await L(),t=await z(),n=new URL(`app/api/revalidate/route.${t}`,e);if(await d(n))return;let r=await B();await f(n,O({supportsCacheLife:Number.parseInt(r.split(`.`)[0])>=16}))}async function j(){let e=await I(),t=await L(),n=await z(),r=new URL(e?`app/api/exit-preview/route.${n}`:`pages/api/exit-preview.${n}`,t);await d(r)||await f(r,D({typescript:await l(),appRouter:e}))}async function M(){let e=await I(),t=await L(),n=await z(),r=new URL(e?`app/api/preview/route.${n}`:`pages/api/preview.${n}`,t);await d(r)||await f(r,E({typescript:await l(),appRouter:e}))}async function N(){let e=await I(),t=await L(),n=`${await z()}x`,r=new URL(e?`app/slice-simulator/page.${n}`:`pages/slice-simulator.${n}`,t);await d(r)||await f(r,T({typescript:await l(),appRouter:e}))}async function P(){let e=await z(),t=await L(),n=new URL(`prismicio.${e}`,t);await d(n)||await f(n,w({typescript:await l(),appRouter:await I(),hasSrcDirectory:await R()}))}async function F(e){let t=a(e).split(`/`).filter(Boolean).map(e=>e.startsWith(`:`)?`[${e.slice(1)}]`:e).join(`/`),n=await L(),r=`${await z()}x`,i=await I(),o=i?new URL(`app/${t}/page.${r}`,n):new URL(`pages/${t||`index`}.${r}`,n);await d(o)||await f(o,C({model:e,routePath:t,typescript:await l(),appRouter:i}))}async function I(){let e=await L();return await d(new URL(`app/`,e))}async function L(){let e=await u();return await R()?new URL(`src/`,e):e}async function R(){let e=await u();return d(new URL(`src/`,e))}async function z(){return await l()?`ts`:`js`}async function B(){let{version:e}=v(await g())(`next/package.json`);return e}export{k as NextJsAdapter};
@@ -0,0 +1,90 @@
1
+ import{C as e,D as t,E as n,M as r,S as i,a,c as o,g as s,i as c,s as l,t as u,v as d,x as f}from"./core-Dw_6KGNJ.mjs";import{c as p,f as m,p as h}from"./request-CjjxiLJy.mjs";import{i as g,n as _}from"./packageJson-BSh_AvfX.mjs";import{r as v}from"./auth-C3-3mBIR.mjs";import{n as y,t as b}from"./builders-hKD4IrLX-CRl2dnPu.mjs";import{readFile as x,rm as S}from"node:fs/promises";import{fileURLToPath as C}from"node:url";import{relative as w}from"node:path";function T(e){let{name:n,typescript:i}=e,a=r(n);return i?t`
2
+ <script setup lang="ts">
3
+ import type { Content } from "@prismicio/client";
4
+
5
+ // The array passed to \`getSliceComponentProps\` is purely optional.
6
+ // Consider it as a visual hint for you when templating your slice.
7
+ defineProps(getSliceComponentProps<Content.${a}Slice>(
8
+ ["slice", "index", "slices", "context"]
9
+ ));
10
+ <\/script>
11
+
12
+ <template>
13
+ <section
14
+ :data-slice-type="slice.slice_type"
15
+ :data-slice-variation="slice.variation"
16
+ >
17
+ Placeholder component for {{ slice.slice_type }} (variation: {{ slice.variation }}) slices.
18
+ <br />
19
+ <strong>You can edit this slice directly in your code editor.</strong>
20
+ </section>
21
+ </template>
22
+ `:t`
23
+ <script setup>
24
+ // The array passed to \`getSliceComponentProps\` is purely optional.
25
+ // Consider it as a visual hint for you when templating your slice.
26
+ defineProps(getSliceComponentProps(["slice", "index", "slices", "context"]));
27
+ <\/script>
28
+
29
+ <template>
30
+ <section
31
+ :data-slice-type="slice.slice_type"
32
+ :data-slice-variation="slice.variation"
33
+ >
34
+ Placeholder component for {{ slice.slice_type }} (variation: {{ slice.variation }}) slices.
35
+ <br />
36
+ <strong>You can edit this slice directly in your code editor.</strong>
37
+ </section>
38
+ </template>
39
+ `}function E(e){let{model:n,typescript:r}=e,i=[`setup`];if(r&&i.push(`lang="ts"`),n.repeatable){let e=r?`route.params.uid as string`:`route.params.uid`;return t`
40
+ <script ${i.join(` `)}>
41
+ import { components } from "~/slices";
42
+
43
+ const prismic = usePrismic();
44
+ const route = useRoute();
45
+ const { data: page } = await useAsyncData(${e}, () =>
46
+ prismic.client.getByUID("${n.id}", ${e}),
47
+ );
48
+ <\/script>
49
+
50
+ <template>
51
+ <main>
52
+ <SliceZone :slices="page?.data.slices ?? []" :components="components" />
53
+ </main>
54
+ </template>
55
+ `}return t`
56
+ <script ${i.join(` `)}>
57
+ import { components } from "~/slices";
58
+
59
+ const prismic = usePrismic();
60
+ const { data: page } = await useAsyncData("${n.id}", () =>
61
+ prismic.client.getSingle("${n.id}"),
62
+ );
63
+ <\/script>
64
+
65
+ <template>
66
+ <main>
67
+ <SliceZone :slices="page?.data.slices ?? []" :components="components" />
68
+ </main>
69
+ </template>
70
+ `}function D(e){let{typescript:n}=e,r=[`setup`];return n&&r.push(`lang="ts"`),t`
71
+ <script ${r.join(` `)}>
72
+ import { components } from "~/slices";
73
+ <\/script>
74
+
75
+ <template>
76
+ <SliceSimulator #default="{ slices }">
77
+ <SliceZone :slices="slices" :components="components" />
78
+ </SliceSimulator>
79
+ </template>
80
+ `}const O=`@nuxtjs/prismic`;var k=class extends o{id=`nuxt`;async setupProject(){await _({"@prismicio/client":`^${await g(`@prismicio/client`)}`,[O]:`^${await g(O)}`}),await j(),await N(),await P(),await F(this)}async onProjectInitialized(){let e=await i(),{token:t,host:n}=await v();await a({repo:e,token:t,host:n})||await l(`http://localhost:3000/slice-simulator`,{repo:e,token:t,host:n}),(await c({repo:e,token:t,host:n})).length===0&&await u({name:`Development`,websiteURL:`http://localhost:3000`,resolverPath:`/preview`},{repo:e,token:t,host:n})}async onSliceCreated(e,t){let n=r(e.name),i=new URL(n,h(t));await m(new URL(`index.vue`,h(i)),T({name:e.name,typescript:await d()}))}onSliceUpdated(){}onSliceDeleted(){}async onCustomTypeCreated(e){e.format===`page`&&await I(e)}onCustomTypeUpdated(){}onCustomTypeDeleted(){}async createSliceIndexFile(e){let n=t`
81
+ // Code generated by Prismic. DO NOT EDIT.
82
+
83
+ import { defineAsyncComponent } from "vue";
84
+ import { defineSliceZoneComponents } from "@prismicio/vue";
85
+
86
+ export const components = defineSliceZoneComponents({
87
+ ${(await this.getSlices()).filter(t=>t.library.href===e.href).map(t=>{let n=w(C(e),C(t.directory));return`${t.model.id}: defineAsyncComponent(() => import("./${n}/index.vue"))`}).join(`,
88
+ `)}
89
+ });
90
+ `,r=`index.${await L()}`;await m(new URL(r,e),n)}async getDefaultSliceLibrary(){let e=await A();return new URL(`slices/`,e)}async getDefaultCustomTypeLibrary(){let e=await f();return new URL(`customtypes/`,e)}};async function A(){let e=await f(),t=new URL(`app/`,e);if(await p(t))return t;let n=new URL(`src/`,e);return await p(n)?n:e}async function j(){let e=await f(),t=new URL(`nuxt.config.js`,e);if(await p(t)||(t=new URL(`nuxt.config.ts`,e)),!await p(t))return;let n=C(t),r=await b(n),i=r.exports.default.$type===`function-call`?r.exports.default.$args[0]:r.exports.default;(i.modules||[]).find(e=>typeof e==`string`?e===O:Array.isArray(e)?e[0]===O:!1)||(i.modules||=[],i.modules.push(O)),await y(r,n)}async function M(){let e=await f(),t=new URL(`app/pages/`,e),n=new URL(`src/pages/`,e),r=new URL(`pages/`,e);return await p(t)?t:await p(n)?n:await p(r)?r:new URL(`pages/`,await A())}async function N(){let e=await d(),t=await M(),n=new URL(`slice-simulator.vue`,t);await p(n)||await m(n,D({typescript:e}))}async function P(){let e=await A(),t=new URL(`app.vue`,e);if(!await p(t))return;let n=await x(t,`utf8`);if(!n.includes(`<NuxtWelcome`))return;let r=new URL(`pages/index.vue`,e);await p(r)||await m(r,n),await S(t)}async function F(t){let r=await f(),i=await p(new URL(`app/`,r)),a=await p(new URL(`src/`,r));if(!i&&!a)return;let o;try{o=await e()}catch{return}let s=o.libraries;!s||JSON.stringify(s)!==JSON.stringify([`./slices`])||(await t.getSlices()).length>0||await n({libraries:[i?`./app/slices`:`./src/slices`]})}async function I(e){let t=s(e).split(`/`).filter(Boolean).map(e=>e.startsWith(`:`)?`[${e.slice(1)}]`:e).join(`/`),n=await M(),r=new URL(`${t||`index`}.vue`,n);await p(r)||await m(r,E({model:e,typescript:await d()}))}async function L(){return await d()?`ts`:`js`}export{k as NuxtAdapter};
@@ -0,0 +1 @@
1
+ var e=`prismic`,t=`1.13.0`;export{t as n,e as t};
@@ -1,3 +1,3 @@
1
- import{D as e,E as t,O as n,T as r,c as i,l as a,o,u as s}from"./request-Dtd3MvMj.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 ee,normalize as p,resolve as m}from"node:path";import{spawn as te}from"node:child_process";import{cwd as ne}from"node:process";import{PassThrough as re}from"node:stream";import h from"node:readline";const g=/^(?:( )+|\t+)/,_=`space`;function v(e,t,n){return e&&t===_&&n===1}function y(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(g);if(e===null)r=0,i=``;else{let o=e[0].length,s=e[1]?_:`tab`;if(v(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(v(t,s,e))continue;a=ie(s,e)}let d=n.get(a);n.set(a,d===void 0?[1,0]:[d[0]+c,d[1]+l])}}return n}function ie(e,t){return(e===_?`s`:`t`)+String(t)}function b(e){return{type:e[0]===`s`?_:`tab`,amount:Number(e.slice(1))}}function ae(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 oe(e,t){return(e===_?` `:` `).repeat(t)}function x(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=y(e,!0);t.size===0&&(t=y(e,!1));let n=ae(t),r,i=0,a=``;return n!==void 0&&({type:r,amount:i}=b(n),a=oe(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(m(r,`node_modules`,`.bin`)),i=r,r=ee(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 re,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=/^#!(.*)/}),G=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}}),ce=D((e,t)=>{let n=A(`fs`),r=G();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=ce(),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:p(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=h.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=ne(),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=te(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=r({dependencies:t(e(n(),n())),devDependencies:t(e(n(),n())),peerDependencies:t(e(n(),n())),packageManager:t(n())});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=x(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)+`
1
+ import{D as e,E as t,O as n,T as r,c as i,l as a,o,u as s}from"./request-CjjxiLJy.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 ee,normalize as p,resolve as m}from"node:path";import{spawn as te}from"node:child_process";import{cwd as ne}from"node:process";import{PassThrough as re}from"node:stream";import h from"node:readline";const g=/^(?:( )+|\t+)/,_=`space`;function v(e,t,n){return e&&t===_&&n===1}function y(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(g);if(e===null)r=0,i=``;else{let o=e[0].length,s=e[1]?_:`tab`;if(v(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(v(t,s,e))continue;a=ie(s,e)}let d=n.get(a);n.set(a,d===void 0?[1,0]:[d[0]+c,d[1]+l])}}return n}function ie(e,t){return(e===_?`s`:`t`)+String(t)}function b(e){return{type:e[0]===`s`?_:`tab`,amount:Number(e.slice(1))}}function ae(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 oe(e,t){return(e===_?` `:` `).repeat(t)}function x(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=y(e,!0);t.size===0&&(t=y(e,!1));let n=ae(t),r,i=0,a=``;return n!==void 0&&({type:r,amount:i}=b(n),a=oe(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(m(r,`node_modules`,`.bin`)),i=r,r=ee(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 re,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=/^#!(.*)/}),G=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}}),ce=D((e,t)=>{let n=A(`fs`),r=G();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=ce(),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:p(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=h.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=ne(),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=te(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=r({dependencies:t(e(n(),n())),devDependencies:t(e(n(),n())),peerDependencies:t(e(n(),n())),packageManager:t(n())});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=x(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
2
  `)}async function be(e){let t=await X(),n=await c(t,`utf8`),r=x(n).indent||` `,i=JSON.parse(n);for(let t of[`dependencies`,`devDependencies`,`peerDependencies`])if(i[t])for(let n of e)delete i[t][n];await l(t,JSON.stringify(i,null,r)+`
3
3
  `)}async function xe(e,t=`latest`){let{version:i}=await o(new URL(`${e}/${t}`,`https://registry.npmjs.org/`),{schema:r({version:n()})});return i}const Q={npm:[`npm`,`install`],yarn:[`yarn`,`install`],pnpm:[`pnpm`,`install`],bun:[`bun`,`install`]};async function Se(){let e=await X(),t=new URL(`.`,e),[n,...r]=Q[await Ce()];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 Ce(){let e=await we();if(e)return e;let t=await X();for(let e in $){let n=$[e];if(await i(new URL(e,t)))return n}return`npm`}async function we(){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{Se as a,J as c,xe as i,ye as n,Y as o,X as r,be as s,Z as t};
@@ -0,0 +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 f(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 ee(e,t){return typeof t==`bigint`?t.toString():t}function te(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function ne(e){return e==null}function p(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}const m=Symbol(`evaluating`);function h(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==m)return r===void 0&&(r=m,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function re(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ie(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}const ae=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _(e){if(g(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(g(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function oe(e){return _(e)?{...e}:Array.isArray(e)?[...e]:e}const se=new Set([`string`,`number`,`symbol`]);function ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function v(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function y(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 le(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function ue(e,t){if(!_(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 v(e,ie(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return re(this,`shape`,n),n}}))}function b(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 x(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function S(e){return typeof e==`string`?e:e?.message}function C(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=S(e.inst?._zod.def?.error?.(e))??S(t?.error?.(e))??S(n.customError?.(e))??S(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function de(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}const w=(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,ee,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},fe=c(`$ZodError`,w),T=c(`$ZodError`,w,{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=>C(e,a,d())));throw ae(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=>C(e,a,d())));throw ae(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??fe)(a.issues.map(e=>C(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=>C(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!ne(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=de(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=b(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||=b(e,t))});else{if(e.issues.length===t)continue;r||=b(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(b(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)}}h(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(...x(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(...x(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=le(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=te(()=>we(t));h(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=g,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}});function L(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!b(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>C(e,r,d())))}),t)}const De=c(`$ZodUnion`,(e,t)=>{j.init(e,t),h(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),h(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),h(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),h(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>p(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>L(t,i,e,a)):L(s,i,e,a)}}),Oe=c(`$ZodRecord`,(e,t)=>{j.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!_(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(...x(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...x(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=>C(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(...x(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...x(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),ke=c(`$ZodEnum`,(e,t)=>{j.init(e,t);let n=f(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>se.has(typeof e)).map(e=>typeof e==`string`?ce(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 R(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ae=c(`$ZodOptional`,(e,t)=>{j.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,h(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),h(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${p(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=>R(t,e.value)):R(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),je=c(`$ZodNullable`,(e,t)=>{j.init(e,t),h(e._zod,`optin`,()=>t.innerType._zod.optin),h(e._zod,`optout`,()=>t.innerType._zod.optout),h(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${p(e.source)}|null)$`):void 0}),h(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)}),Me=c(`$ZodDefault`,(e,t)=>{j.init(e,t),e._zod.optin=`optional`,h(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=>z(e,t)):z(r,t)}});function z(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ne=c(`$ZodPipe`,(e,t)=>{j.init(e,t),h(e._zod,`values`,()=>t.in._zod.values),h(e._zod,`optin`,()=>t.in._zod.optin),h(e._zod,`optout`,()=>t.out._zod.optout),h(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=>B(e,t.in,n)):B(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>B(e,t.out,n)):B(r,t.out,n)}});function B(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const V=c(`$ZodCodec`,(e,t)=>{j.init(e,t),h(e._zod,`values`,()=>t.in._zod.values),h(e._zod,`optin`,()=>t.in._zod.optin),h(e._zod,`optout`,()=>t.out._zod.optout),h(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=>H(e,t,n)):H(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t,n)):H(r,t,n)}}});function H(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=>U(e,r,t.out,n)):U(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>U(e,r,t.in,n)):U(e,r,t.in,n)}}function U(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var W,Pe=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 Fe(){return new Pe}(W=globalThis).__zod_globalRegistry??(W.__zod_globalRegistry=Fe()),globalThis.__zod_globalRegistry;function Ie(e,t){return new e({type:`string`,...y(t)})}function G(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...y(t)})}function Le(e,t){return new e({type:`number`,checks:[],...y(t)})}function Re(e,t){return new e({type:`boolean`,...y(t)})}function ze(e){return new e({type:`unknown`})}function Be(e,t){return new _e({check:`min_length`,...y(t),minimum:e})}function Ve(e,t){let n=y(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??V,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 K=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)=>v(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),q=c(`ZodMiniString`,(e,t)=>{M.init(e,t),K.init(e,t)});function He(e){return Ie(q,e)}const Ue=c(`ZodMiniStringFormat`,(e,t)=>{N.init(e,t),q.init(e,t)}),J=c(`ZodMiniURL`,(e,t)=>{be.init(e,t),Ue.init(e,t)});function We(e){return G(J,e)}function Ge(e){return G(J,{protocol:/^https?$/,hostname:me,...y(e)})}const Ke=c(`ZodMiniNumber`,(e,t)=>{xe.init(e,t),K.init(e,t)});function qe(e){return Le(Ke,e)}const Y=c(`ZodMiniBoolean`,(e,t)=>{P.init(e,t),K.init(e,t)});function Je(e){return Re(Y,e)}const Ye=c(`ZodMiniUnknown`,(e,t)=>{Se.init(e,t),K.init(e,t)});function Xe(){return ze(Ye)}const Ze=c(`ZodMiniArray`,(e,t)=>{Ce.init(e,t),K.init(e,t)});function Qe(e,t){return new Ze({type:`array`,element:e,...y(t)})}const X=c(`ZodMiniObject`,(e,t)=>{Ee.init(e,t),K.init(e,t),h(e,`shape`,()=>t.shape)});function $e(e,t){return new X({type:`object`,shape:e??{},...y(t)})}function et(e,t){return new X({type:`object`,shape:e,catchall:Xe(),...y(t)})}function tt(e,t){return ue(e,t)}const nt=c(`ZodMiniUnion`,(e,t)=>{De.init(e,t),K.init(e,t)});function rt(e,t){return new nt({type:`union`,options:e,...y(t)})}const it=c(`ZodMiniRecord`,(e,t)=>{Oe.init(e,t),K.init(e,t)});function at(e,t,n){return new it({type:`record`,keyType:e,valueType:t,...y(n)})}const ot=c(`ZodMiniEnum`,(e,t)=>{ke.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function st(e,t){return new ot({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...y(t)})}const ct=c(`ZodMiniOptional`,(e,t)=>{Ae.init(e,t),K.init(e,t)});function lt(e){return new ct({type:`optional`,innerType:e})}const ut=c(`ZodMiniNullable`,(e,t)=>{je.init(e,t),K.init(e,t)});function dt(e){return new ut({type:`nullable`,innerType:e})}const ft=c(`ZodMiniDefault`,(e,t)=>{Me.init(e,t),K.init(e,t)});function pt(e,t){return new ft({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():oe(t)}})}const mt=c(`ZodMiniPipe`,(e,t)=>{Ne.init(e,t),K.init(e,t)}),ht=c(`ZodMiniCodec`,(e,t)=>{mt.init(e,t),V.init(e,t)}),gt=(...e)=>Ve({Codec:ht,Boolean:Y,String:q},...e);function Z(e){let t=new URL(e);return t.pathname.endsWith(`/`)||(t.pathname+=`/`),t}function _t(e,t){return s(i(e),i(t))}function vt(e){let t=e.pathname.lastIndexOf(`.`);if(t!==-1)return e.pathname.slice(t+1).toLowerCase()||void 0}function yt(e,t){let n=s(i(e),i(t));return!(!n||n.startsWith(`..`)||o(n))}async function bt(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 xt(t){try{return await e(t),!0}catch{return!1}}async function St(e,n){await t(new URL(`.`,e),{recursive:!0}),await r(e,n)}async function Ct(e,t={}){let{schema:r}=t,i=await n(e,`utf8`),a=JSON.parse(i);return r?E(r,a):a}const wt={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`};async function Tt(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=vt(e),i=r&&wt[r]||`application/octet-stream`;return new Blob([t],{type:i})}throw Error(`Unsupported file protocol: ${e.protocol}`)}function Et(e){return JSON.stringify(e,null,2)}async function Dt(e,t={}){let{credentials:n,json:r,notFoundMessage:i,unknownErrorMessage:a,schema:o,...s}=t,c=new Headers(t.headers);if(c.has(`Accept`)||c.set(`Accept`,`application/json`),c.has(`User-Agent`)||c.set(`User-Agent`,`prismic-cli`),n){let e=[];for(let t in n)e.push(`${t}=${n[t]??``}`);c.set(`Cookie`,e.join(`; `))}`json`in t&&!c.has(`Content-Type`)&&c.set(`Content-Type`,`application/json`);let l=`json`in t?JSON.stringify(r):t.body,u=await fetch(e,{...s,body:l,headers:c}),d=await u.text(),f;if(d)try{f=JSON.parse(d)}catch{f=d}if(u.ok)return o?E(o,f):f;switch(u.status){case 400:throw new kt(u,f,d);case 401:throw new $(u,f,d);case 403:throw new jt(u,f,d);case 404:throw new At(u,f,d,i);default:throw new Ot(u,f,d,a)}}var Q=class extends Error{name=`RequestError`;response;body;#e;constructor(e,t,n,r){super(r),this.response=e,this.body=t,this.#e=n}async text(){return this.#e}async json(){return JSON.parse(this.#e)}get status(){return this.response.status}get statusText(){return this.response.statusText}},Ot=class extends Q{name=`UnknownRequestError`;constructor(e,t,n,r=``){super(e,t,n,r)}},kt=class extends Q{name=`BadRequestError`},At=class extends Q{name=`NotFoundRequestError`;constructor(e,t,n,r=`The requested resource was not found.`){super(e,t,n,r)}},jt=class extends Q{name=`ForbiddenRequestError`},$=class extends Q{name=`UnauthorizedRequestError`};export{rt as A,dt as C,at as D,lt as E,Be as M,E as N,He as O,et as S,$e as T,st as _,Ot as a,tt as b,xt as c,Tt as d,St as f,pt as g,_t as h,$ as i,We as j,gt as k,bt as l,yt as m,jt as n,Dt as o,Z as p,At as r,Et as s,kt as t,Ct as u,Qe as v,qe as w,Ge as x,Je as y};
@@ -1 +1 @@
1
- import{n as e,t}from"./package-BjwqjdUX.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
+ import{n as e,t}from"./package-BC19m0br.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-t8Ao2K5y.mjs";try{await e()}catch{}export{};
1
+ import{a as e}from"../auth-C3-3mBIR.mjs";try{await e()}catch{}export{};
@@ -1 +1 @@
1
- import{n as e}from"../segment-B_xOU1OD.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
+ import{n as e}from"../segment-CYA7QtOz.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-DuN38oFo.mjs";import{n as e}from"../update-notifier-Bw7s9h27.mjs";const[t,n]=process.argv.slice(2);try{await e(t,new URL(n))}catch{}export{};
1
+ import"../packageJson-BSh_AvfX.mjs";import{n as e}from"../update-notifier-bz-r6ZLF.mjs";const[t,n]=process.argv.slice(2);try{await e(t,new URL(n))}catch{}export{};