@ryuzaki13/react-foundation-lib 2.1.3 → 2.1.5

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,30 +1,31 @@
1
- import { z as e } from "zod";
2
- import { createHash as t } from "node:crypto";
3
- import { lstat as n, mkdir as r, readFile as i, readdir as a, realpath as o, rename as s, rm as c, stat as l, unlink as u, writeFile as d } from "node:fs/promises";
4
- import f from "node:path";
1
+ import { t as e } from "../chunks/buildIdentity-uQE5d9pd.js";
2
+ import { z as t } from "zod";
3
+ import { createHash as n } from "node:crypto";
4
+ import { lstat as r, mkdir as i, readFile as a, readdir as o, realpath as s, rename as c, rm as l, stat as u, unlink as d, writeFile as f } from "node:fs/promises";
5
+ import p from "node:path";
5
6
  //#region \0rolldown/runtime.js
6
- var p = Object.create, m = Object.defineProperty, h = Object.getOwnPropertyDescriptor, g = Object.getOwnPropertyNames, _ = Object.getPrototypeOf, v = Object.prototype.hasOwnProperty, ee = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), te = (e, t, n, r) => {
7
- if (t && typeof t == "object" || typeof t == "function") for (var i = g(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !v.call(e, s) && s !== n && m(e, s, {
7
+ var m = Object.create, h = Object.defineProperty, g = Object.getOwnPropertyDescriptor, _ = Object.getOwnPropertyNames, v = Object.getPrototypeOf, y = Object.prototype.hasOwnProperty, ee = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), te = (e, t, n, r) => {
8
+ if (t && typeof t == "object" || typeof t == "function") for (var i = _(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !y.call(e, s) && s !== n && h(e, s, {
8
9
  get: ((e) => t[e]).bind(null, s),
9
- enumerable: !(r = h(t, s)) || r.enumerable
10
+ enumerable: !(r = g(t, s)) || r.enumerable
10
11
  });
11
12
  return e;
12
- }, ne = (e, t, n) => (n = e == null ? {} : p(_(e)), te(t || !e || !e.__esModule || !v.call(e, "default") ? m(n, "default", {
13
+ }, ne = (e, t, n) => (n = e == null ? {} : m(v(e)), te(t || !e || !e.__esModule || !y.call(e, "default") ? h(n, "default", {
13
14
  value: e,
14
15
  enumerable: !0
15
- }) : n, e)), re = 1, y = /^[0-9a-f]{40}$/, ie = 2097152, b = 33554432, x = 268435456, ae = 83808e5, S = /^[a-z0-9]+(?:[.-][a-z0-9]+)*$/, oe = /^[0-9a-f]{64}$/;
16
+ }) : n, e)), re = 1, ie = 2097152, b = 33554432, x = 268435456, ae = 83808e5, S = /^[a-z0-9]+(?:[.-][a-z0-9]+)*$/, oe = /^[0-9a-f]{64}$/;
16
17
  function C(e) {
17
18
  return !e || e.startsWith("/") || e.includes("\\") || e.includes("\0") ? !1 : e.split("/").every((e) => e !== "" && e !== "." && e !== "..");
18
19
  }
19
20
  function se(e, t) {
20
21
  return e.includes("\\") || e.includes("\0") || e.includes("?") || e.includes("#") ? !1 : t === "client" ? e.startsWith("/") && C(e.slice(1)) : e.startsWith("server/") && C(e);
21
22
  }
22
- var ce = e.object({
23
- kind: e.enum(["client", "server"]),
24
- bundle: e.string().max(1024),
25
- map: e.string().max(1024),
26
- sha256: e.string().regex(oe),
27
- size: e.number().int().positive().max(b)
23
+ var ce = t.object({
24
+ kind: t.enum(["client", "server"]),
25
+ bundle: t.string().max(1024),
26
+ map: t.string().max(1024),
27
+ sha256: t.string().regex(oe),
28
+ size: t.number().int().positive().max(b)
28
29
  }).strict().superRefine((e, t) => {
29
30
  se(e.bundle, e.kind) || t.addIssue({
30
31
  code: "custom",
@@ -35,12 +36,12 @@ var ce = e.object({
35
36
  path: ["map"],
36
37
  message: "Map path должен оставаться внутри kind-каталога."
37
38
  });
38
- }), le = e.object({
39
- version: e.literal(1),
40
- application: e.string().min(1).max(128).regex(S),
41
- buildId: e.string().regex(y),
42
- createdUtc: e.iso.datetime({ offset: !0 }),
43
- entries: e.array(ce).max(1e4)
39
+ }), le = t.object({
40
+ version: t.literal(1),
41
+ application: t.string().min(1).max(128).regex(S),
42
+ buildId: t.string().regex(e),
43
+ createdUtc: t.iso.datetime({ offset: !0 }),
44
+ entries: t.array(ce).max(1e4)
44
45
  }).strict().superRefine((e, t) => {
45
46
  let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = 0;
46
47
  for (let [a, o] of e.entries.entries()) n.has(o.bundle) && t.addIssue({
@@ -73,8 +74,8 @@ function ue(e) {
73
74
  function w(e) {
74
75
  return typeof e == "string" && e.length <= 128 && S.test(e);
75
76
  }
76
- function T(e) {
77
- return typeof e == "string" && y.test(e);
77
+ function T(t) {
78
+ return typeof t == "string" && e.test(t);
78
79
  }
79
80
  //#endregion
80
81
  //#region src/error-report-source-maps/artifact.ts
@@ -87,23 +88,23 @@ function de(e) {
87
88
  return e instanceof Error && "code" in e && e.code === "ENOENT";
88
89
  }
89
90
  function D(e, t) {
90
- let n = f.relative(e, t);
91
- return n !== "" && !n.startsWith("..") && !f.isAbsolute(n);
92
- }
93
- async function O(e, t, r) {
94
- let a = await n(e);
95
- if (!a.isFile() || a.isSymbolicLink() || a.size <= 0 || a.size > r) throw new E();
96
- let s = await o(e);
97
- if (!D(t, s)) throw new E();
98
- let c = await i(s);
99
- if (c.byteLength !== a.size) throw new E();
91
+ let n = p.relative(e, t);
92
+ return n !== "" && !n.startsWith("..") && !p.isAbsolute(n);
93
+ }
94
+ async function O(e, t, n) {
95
+ let i = await r(e);
96
+ if (!i.isFile() || i.isSymbolicLink() || i.size <= 0 || i.size > n) throw new E();
97
+ let o = await s(e);
98
+ if (!D(t, o)) throw new E();
99
+ let c = await a(o);
100
+ if (c.byteLength !== i.size) throw new E();
100
101
  return c;
101
102
  }
102
103
  async function k(e, t, n) {
103
104
  if (!w(t) || !T(n)) throw new E();
104
105
  let r, i;
105
106
  try {
106
- r = await o(f.resolve(e)), i = await o(f.join(r, t, n));
107
+ r = await s(p.resolve(e)), i = await s(p.join(r, t, n));
107
108
  } catch (e) {
108
109
  if (de(e)) return null;
109
110
  throw new E();
@@ -111,18 +112,18 @@ async function k(e, t, n) {
111
112
  if (!D(r, i)) throw new E();
112
113
  let a;
113
114
  try {
114
- a = await O(f.join(i, "manifest.json"), i, ie);
115
+ a = await O(p.join(i, "manifest.json"), i, ie);
115
116
  } catch (e) {
116
117
  if (de(e)) return null;
117
118
  throw e instanceof E ? e : new E();
118
119
  }
119
- let s;
120
+ let o;
120
121
  try {
121
- s = JSON.parse(a.toString("utf8"));
122
+ o = JSON.parse(a.toString("utf8"));
122
123
  } catch {
123
124
  throw new E();
124
125
  }
125
- let c = ue(s);
126
+ let c = ue(o);
126
127
  if (!c || c.application !== t || c.buildId !== n) throw new E();
127
128
  return {
128
129
  buildDirectory: i,
@@ -130,10 +131,10 @@ async function k(e, t, n) {
130
131
  entriesByBundle: new Map(c.entries.map((e) => [e.bundle, e]))
131
132
  };
132
133
  }
133
- async function A(e, n) {
134
+ async function A(e, t) {
134
135
  try {
135
- let r = await O(f.join(e.buildDirectory, n.map), e.buildDirectory, n.size);
136
- if (r.byteLength !== n.size || t("sha256").update(r).digest("hex") !== n.sha256) throw new E();
136
+ let r = await O(p.join(e.buildDirectory, t.map), e.buildDirectory, t.size);
137
+ if (r.byteLength !== t.size || n("sha256").update(r).digest("hex") !== t.sha256) throw new E();
137
138
  return r.toString("utf8");
138
139
  } catch (e) {
139
140
  throw e instanceof E ? e : new E();
@@ -142,45 +143,45 @@ async function A(e, n) {
142
143
  //#endregion
143
144
  //#region src/error-report-source-maps/archive.ts
144
145
  var fe = 864e5;
145
- async function pe(e, t, n, i) {
146
- let a = f.join(f.resolve(t), n), o = f.join(a, i), l = f.join(a, `.${i}.tmp-${process.pid}`);
147
- await r(a, { recursive: !0 }), await c(l, {
146
+ async function pe(e, t, n, r) {
147
+ let a = p.join(p.resolve(t), n), o = p.join(a, r), s = p.join(a, `.${r}.tmp-${process.pid}`);
148
+ await i(a, { recursive: !0 }), await l(s, {
148
149
  force: !0,
149
150
  recursive: !0
150
- }), await r(l, { recursive: !1 });
151
+ }), await i(s, { recursive: !1 });
151
152
  try {
152
153
  for (let t of e.manifest.entries) {
153
- let n = await A(e, t), i = f.join(l, t.map);
154
- await r(f.dirname(i), { recursive: !0 }), await d(i, n, {
154
+ let n = await A(e, t), r = p.join(s, t.map);
155
+ await i(p.dirname(r), { recursive: !0 }), await f(r, n, {
155
156
  encoding: "utf8",
156
157
  flag: "wx"
157
158
  });
158
159
  }
159
- await d(f.join(l, "manifest.json"), `${JSON.stringify(e.manifest, null, 2)}\n`, {
160
+ await f(p.join(s, "manifest.json"), `${JSON.stringify(e.manifest, null, 2)}\n`, {
160
161
  encoding: "utf8",
161
162
  flag: "wx"
162
- }), await s(l, o);
163
+ }), await c(s, o);
163
164
  } catch (e) {
164
- if (await c(l, {
165
+ if (await l(s, {
165
166
  force: !0,
166
167
  recursive: !0
167
- }), !await k(t, n, i).catch(() => null)) throw e;
168
+ }), !await k(t, n, r).catch(() => null)) throw e;
168
169
  }
169
170
  }
170
171
  async function j(e) {
171
172
  if (!T(e.buildId)) return;
172
- await r(e.archiveRoot, { recursive: !0 });
173
+ await i(e.archiveRoot, { recursive: !0 });
173
174
  let t = await k(e.archiveRoot, e.application, e.buildId), n = e.seedRoot ? await k(e.seedRoot, e.application, e.buildId) : null;
174
175
  if (t && n && JSON.stringify(t.manifest.entries) !== JSON.stringify(n.manifest.entries)) throw Error("Persistent source-map artifact не совпадает с image seed для того же build ID.");
175
176
  !t && n && await pe(n, e.archiveRoot, e.application, e.buildId);
176
- let i = f.join(f.resolve(e.archiveRoot), e.application);
177
- await r(i, { recursive: !0 });
178
- let o = (e.now ?? (() => /* @__PURE__ */ new Date()))().getTime();
179
- for (let t of await a(i, { withFileTypes: !0 })) if (!(!t.isDirectory() || !T(t.name) || t.name === e.buildId)) try {
177
+ let r = p.join(p.resolve(e.archiveRoot), e.application);
178
+ await i(r, { recursive: !0 });
179
+ let a = (e.now ?? (() => /* @__PURE__ */ new Date()))().getTime();
180
+ for (let t of await o(r, { withFileTypes: !0 })) if (!(!t.isDirectory() || !T(t.name) || t.name === e.buildId)) try {
180
181
  let n = await k(e.archiveRoot, e.application, t.name);
181
182
  if (!n) continue;
182
183
  let r = Date.parse(n.manifest.createdUtc);
183
- Number.isFinite(r) && r + 83808e5 <= o && await c(n.buildDirectory, { recursive: !0 });
184
+ Number.isFinite(r) && r + 83808e5 <= a && await l(n.buildDirectory, { recursive: !0 });
184
185
  } catch {}
185
186
  }
186
187
  function me(e) {
@@ -191,19 +192,19 @@ function me(e) {
191
192
  }
192
193
  //#endregion
193
194
  //#region src/error-report-source-maps/package.ts
194
- var he = /(?:\/\*[#@]\s*sourceMappingURL=[^*]*\*\/|\/\/[#@]\s*sourceMappingURL=.*)$/gm, M = /\.(?:css|html|js|mjs)$/, ge = /"(\/[^"\n]+\.map)"\s*:\s*\{/, N = ".private-source-maps-staging/client";
195
- async function P(e, t = /* @__PURE__ */ new Set()) {
195
+ var he = /(?:\/\*[#@]\s*sourceMappingURL=[^*]*\*\/|\/\/[#@]\s*sourceMappingURL=.*)$/gm, M = /\.(?:css|html|js|mjs)$/, ge = /"(\/[^"\n]+\.map)"\s*:\s*\{/, _e = ".private-source-maps-staging/client";
196
+ async function N(e, t = /* @__PURE__ */ new Set()) {
196
197
  let n = [];
197
- for (let r of await a(e, { withFileTypes: !0 })) {
198
- let i = f.join(e, r.name);
199
- if (!t.has(f.resolve(i))) {
198
+ for (let r of await o(e, { withFileTypes: !0 })) {
199
+ let i = p.join(e, r.name);
200
+ if (!t.has(p.resolve(i))) {
200
201
  if (r.isSymbolicLink()) throw Error(`Build output содержит недопустимую symbolic link: ${i}`);
201
- r.isDirectory() ? n.push(...await P(i, t)) : r.isFile() && n.push(i);
202
+ r.isDirectory() ? n.push(...await N(i, t)) : r.isFile() && n.push(i);
202
203
  }
203
204
  }
204
205
  return n.sort((e, t) => e.localeCompare(t));
205
206
  }
206
- function _e(e, t) {
207
+ function ve(e, t) {
207
208
  if (e.byteLength === 0 || e.byteLength > 33554432) throw Error(`Source map выходит за предел ${b} bytes: ${t}`);
208
209
  let n;
209
210
  try {
@@ -216,102 +217,105 @@ function _e(e, t) {
216
217
  if (!Array.isArray(r)) throw Error(`Source map не содержит список sources: ${t}`);
217
218
  if (i !== void 0 && (!Array.isArray(i) || i.length !== r.length)) throw Error(`Source map содержит неполный sourcesContent: ${t}`);
218
219
  }
219
- function ve(e, t) {
220
- let n = f.join(e, "public"), r = f.join(e, "server"), i = f.join(e, N), a = f.relative(n, t);
221
- if (a && !a.startsWith("..") && !f.isAbsolute(a)) {
222
- let e = a.split(f.sep).join("/");
220
+ function ye(e, t, n) {
221
+ let r = p.join(e, "public"), i = p.join(e, "server"), a = p.relative(r, n);
222
+ if (a && !a.startsWith("..") && !p.isAbsolute(a)) {
223
+ let e = a.split(p.sep).join("/");
223
224
  return {
224
225
  kind: "client",
225
226
  bundle: `/${e.slice(0, -4)}`,
226
227
  map: `client/${e}`
227
228
  };
228
229
  }
229
- let o = f.relative(i, t);
230
- if (o && !o.startsWith("..") && !f.isAbsolute(o)) {
231
- let e = o.split(f.sep).join("/");
230
+ let o = p.relative(t, n);
231
+ if (o && !o.startsWith("..") && !p.isAbsolute(o)) {
232
+ let e = o.split(p.sep).join("/");
232
233
  return {
233
234
  kind: "client",
234
235
  bundle: `/${e.slice(0, -4)}`,
235
236
  map: `client/${e}`
236
237
  };
237
238
  }
238
- let s = f.relative(r, t);
239
- if (s && !s.startsWith("..") && !f.isAbsolute(s)) {
240
- let e = s.split(f.sep).join("/");
239
+ let s = p.relative(i, n);
240
+ if (s && !s.startsWith("..") && !p.isAbsolute(s)) {
241
+ let e = s.split(p.sep).join("/");
241
242
  return {
242
243
  kind: "server",
243
244
  bundle: `server/${e.slice(0, -4)}`,
244
245
  map: `server/${e}`
245
246
  };
246
247
  }
247
- throw Error(`Source map находится вне public/server output: ${t}`);
248
+ throw Error(`Source map находится вне public/server output: ${n}`);
248
249
  }
249
- async function F(e) {
250
- let t = await i(e, "utf8"), n = t.replace(he, "");
251
- n !== t && await d(e, n, "utf8");
252
- }
253
- async function ye(e, t = {}) {
254
- let n = f.resolve(e), i = f.resolve(t.publicRoot ?? f.join(n, "public")), a = f.join(n, N), o = await P(i), c = o.filter((e) => e.endsWith(".map"));
255
- for (let e of c) {
256
- let t = f.relative(i, e), n = f.join(a, t);
257
- await r(f.dirname(n), { recursive: !0 }), await s(e, n);
250
+ async function P(e) {
251
+ let t = await a(e, "utf8"), n = t.replace(he, "");
252
+ n !== t && await f(e, n, "utf8");
253
+ }
254
+ async function be(e, t = {}) {
255
+ let n = p.resolve(e), r = p.resolve(t.publicRoot ?? p.join(n, "public")), a = p.resolve(t.clientSourceMapStagingRoot ?? p.join(n, ".private-source-maps-staging/client")), o = await N(r), s = o.filter((e) => e.endsWith(".map"));
256
+ for (let e of s) {
257
+ let t = p.relative(r, e), n = p.join(a, t);
258
+ await i(p.dirname(n), { recursive: !0 }), await c(e, n);
258
259
  }
259
- for (let e of o) !e.endsWith(".map") && M.test(e) && await F(e);
260
- return c.length;
260
+ for (let e of o) !e.endsWith(".map") && M.test(e) && await P(e);
261
+ return s.length;
261
262
  }
262
- async function I(e) {
263
- let t = await i(e, "utf8"), n = ge.exec(t)?.[1];
263
+ async function F(e) {
264
+ let t = await a(e, "utf8"), n = ge.exec(t)?.[1];
264
265
  if (n) throw Error(`Nitro static asset manifest содержит source map: ${n}`);
265
266
  }
266
- async function L(e) {
267
- for (let t of await P(e)) {
267
+ async function I(e) {
268
+ for (let t of await N(e)) {
268
269
  if (t.endsWith(".map")) throw Error(`Public output содержит source map: ${t}`);
269
- if (M.test(t) && (await i(t, "utf8")).includes("sourceMappingURL")) throw Error(`Public output содержит sourceMappingURL: ${t}`);
270
+ if (M.test(t) && (await a(t, "utf8")).includes("sourceMappingURL")) throw Error(`Public output содержит sourceMappingURL: ${t}`);
270
271
  }
271
272
  }
272
- async function be(e) {
273
+ async function xe(e) {
273
274
  if (!w(e.application) || !T(e.buildId)) throw Error("Application или build ID private source-map artifact недопустим.");
274
- let n = f.resolve(e.outputRoot), a = f.resolve(e.artifactRoot), o = f.join(a, e.application, e.buildId), p = `${o}.tmp-${process.pid}`, m = await P(n, /* @__PURE__ */ new Set([f.resolve(n, "server/node_modules")])), h = m.filter((e) => e.endsWith(".map"));
275
- if (h.length === 0) throw Error("Production build не создал private source maps.");
276
- await c(p, {
275
+ let t = p.resolve(e.outputRoot), r = p.resolve(e.artifactRoot), o = p.resolve(e.clientSourceMapStagingRoot ?? p.join(t, ".private-source-maps-staging/client")), s = p.join(r, e.application, e.buildId), m = `${s}.tmp-${process.pid}`, h = await N(t, /* @__PURE__ */ new Set([p.resolve(t, "server/node_modules")])), g = (() => {
276
+ let e = p.relative(t, o);
277
+ return e === "" || !e.startsWith("..") && !p.isAbsolute(e);
278
+ })() ? [] : await N(o), _ = [...h, ...g].filter((e) => e.endsWith(".map"));
279
+ if (_.length === 0) throw Error("Production build не создал private source maps.");
280
+ await l(m, {
277
281
  force: !0,
278
282
  recursive: !0
279
- }), await r(p, { recursive: !0 });
280
- let g = [], _ = 0;
283
+ }), await i(m, { recursive: !0 });
284
+ let v = [], y = 0;
281
285
  try {
282
- for (let e of h) {
283
- let a = await i(e);
284
- if (_e(a, e), _ += a.byteLength, _ > 268435456) throw Error(`Private source-map artifact превышает ${x} bytes.`);
285
- let o = ve(n, e), s = f.join(p, o.map);
286
- await r(f.dirname(s), { recursive: !0 }), await d(s, a, { flag: "wx" }), g.push({
287
- ...o,
288
- sha256: t("sha256").update(a).digest("hex"),
289
- size: a.byteLength
286
+ for (let e of _) {
287
+ let r = await a(e);
288
+ if (ve(r, e), y += r.byteLength, y > 268435456) throw Error(`Private source-map artifact превышает ${x} bytes.`);
289
+ let s = ye(t, o, e), c = p.join(m, s.map);
290
+ await i(p.dirname(c), { recursive: !0 }), await f(c, r, { flag: "wx" }), v.push({
291
+ ...s,
292
+ sha256: n("sha256").update(r).digest("hex"),
293
+ size: r.byteLength
290
294
  });
291
295
  }
292
- if (!g.some((e) => e.kind === "client")) throw Error("Private source-map artifact не содержит client maps.");
293
- if (!g.some((e) => e.kind === "server")) throw Error("Private source-map artifact не содержит server maps.");
294
- g.sort((e, t) => e.bundle.localeCompare(t.bundle));
295
- let a = {
296
+ if (!v.some((e) => e.kind === "client")) throw Error("Private source-map artifact не содержит client maps.");
297
+ if (!v.some((e) => e.kind === "server")) throw Error("Private source-map artifact не содержит server maps.");
298
+ v.sort((e, t) => e.bundle.localeCompare(t.bundle));
299
+ let r = {
296
300
  version: 1,
297
301
  application: e.application,
298
302
  buildId: e.buildId,
299
303
  createdUtc: e.createdUtc ?? (/* @__PURE__ */ new Date()).toISOString(),
300
- entries: g
304
+ entries: v
301
305
  };
302
- await d(f.join(p, "manifest.json"), `${JSON.stringify(a, null, 2)}\n`, {
306
+ await f(p.join(m, "manifest.json"), `${JSON.stringify(r, null, 2)}\n`, {
303
307
  encoding: "utf8",
304
308
  flag: "wx"
305
- }), await c(o, {
309
+ }), await l(s, {
306
310
  force: !0,
307
311
  recursive: !0
308
- }), await r(f.dirname(o), { recursive: !0 }), await s(p, o);
309
- for (let e of h) await u(e);
310
- for (let e of m) !e.endsWith(".map") && M.test(e) && await F(e);
311
- if (await L(f.join(n, "public")), await I(f.join(n, "server/index.mjs")), !(await l(f.join(o, "manifest.json"))).isFile()) throw Error("Private source-map manifest не был создан.");
312
- return a;
312
+ }), await i(p.dirname(s), { recursive: !0 }), await c(m, s);
313
+ for (let e of _) await d(e);
314
+ for (let e of h) !e.endsWith(".map") && M.test(e) && await P(e);
315
+ if (await I(p.join(t, "public")), await F(p.join(t, "server/index.mjs")), !(await u(p.join(s, "manifest.json"))).isFile()) throw Error("Private source-map manifest не был создан.");
316
+ return r;
313
317
  } catch (e) {
314
- throw await c(p, {
318
+ throw await l(m, {
315
319
  force: !0,
316
320
  recursive: !0
317
321
  }), e;
@@ -319,23 +323,23 @@ async function be(e) {
319
323
  }
320
324
  //#endregion
321
325
  //#region node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
322
- var xe = 44, R = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Se = /* @__PURE__ */ new Uint8Array(64), z = /* @__PURE__ */ new Uint8Array(128);
323
- for (let e = 0; e < R.length; e++) {
324
- let t = R.charCodeAt(e);
325
- Se[e] = t, z[t] = e;
326
+ var Se = 44, L = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ce = /* @__PURE__ */ new Uint8Array(64), R = /* @__PURE__ */ new Uint8Array(128);
327
+ for (let e = 0; e < L.length; e++) {
328
+ let t = L.charCodeAt(e);
329
+ Ce[e] = t, R[t] = e;
326
330
  }
327
- function B(e, t) {
331
+ function z(e, t) {
328
332
  let n = 0, r = 0, i = 0;
329
333
  do
330
- i = z[e.next()], n |= (i & 31) << r, r += 5;
334
+ i = R[e.next()], n |= (i & 31) << r, r += 5;
331
335
  while (i & 32);
332
336
  let a = n & 1;
333
337
  return n >>>= 1, a && (n = -2147483648 | -n), t + n;
334
338
  }
335
- function V(e, t) {
336
- return e.pos >= t ? !1 : e.peek() !== xe;
339
+ function B(e, t) {
340
+ return e.pos >= t ? !1 : e.peek() !== Se;
337
341
  }
338
- var Ce = class {
342
+ var we = class {
339
343
  constructor(e) {
340
344
  this.pos = 0, this.buffer = e;
341
345
  }
@@ -350,13 +354,13 @@ var Ce = class {
350
354
  return r === -1 ? t.length : r;
351
355
  }
352
356
  };
353
- function we(e) {
354
- let { length: t } = e, n = new Ce(e), r = [], i = 0, a = 0, o = 0, s = 0, c = 0;
357
+ function Te(e) {
358
+ let { length: t } = e, n = new we(e), r = [], i = 0, a = 0, o = 0, s = 0, c = 0;
355
359
  do {
356
360
  let e = n.indexOf(";"), t = [], l = !0, u = 0;
357
361
  for (i = 0; n.pos < e;) {
358
362
  let r;
359
- i = B(n, i), i < u && (l = !1), u = i, V(n, e) ? (a = B(n, a), o = B(n, o), s = B(n, s), V(n, e) ? (c = B(n, c), r = [
363
+ i = z(n, i), i < u && (l = !1), u = i, B(n, e) ? (a = z(n, a), o = z(n, o), s = z(n, s), B(n, e) ? (c = z(n, c), r = [
360
364
  i,
361
365
  a,
362
366
  o,
@@ -369,19 +373,19 @@ function we(e) {
369
373
  s
370
374
  ]) : r = [i], t.push(r), n.pos++;
371
375
  }
372
- l || Te(t), r.push(t), n.pos = e + 1;
376
+ l || Ee(t), r.push(t), n.pos = e + 1;
373
377
  } while (n.pos <= t);
374
378
  return r;
375
379
  }
376
- function Te(e) {
377
- e.sort(Ee);
380
+ function Ee(e) {
381
+ e.sort(De);
378
382
  }
379
- function Ee(e, t) {
383
+ function De(e, t) {
380
384
  return e[0] - t[0];
381
385
  }
382
386
  //#endregion
383
387
  //#region node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
384
- var De = /* @__PURE__ */ ne((/* @__PURE__ */ ee(((e, t) => {
388
+ var Oe = /* @__PURE__ */ ne((/* @__PURE__ */ ee(((e, t) => {
385
389
  (function(n, r) {
386
390
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self, n.resolveURI = r());
387
391
  })(e, (function() {
@@ -494,77 +498,77 @@ var De = /* @__PURE__ */ ne((/* @__PURE__ */ ee(((e, t) => {
494
498
  return h;
495
499
  }));
496
500
  })))(), 1);
497
- function Oe(e) {
501
+ function ke(e) {
498
502
  if (!e) return "";
499
503
  let t = e.lastIndexOf("/");
500
504
  return e.slice(0, t + 1);
501
505
  }
502
- function ke(e, t) {
503
- let n = Oe(e), r = t ? t + "/" : "";
504
- return (e) => (0, De.default)(r + (e || ""), n);
505
- }
506
- var H = 0, U = 1, W = 2, G = 3, K = 4;
507
506
  function Ae(e, t) {
508
- let n = q(e, 0);
507
+ let n = ke(e), r = t ? t + "/" : "";
508
+ return (e) => (0, Oe.default)(r + (e || ""), n);
509
+ }
510
+ var V = 0, H = 1, U = 2, W = 3, G = 4;
511
+ function je(e, t) {
512
+ let n = K(e, 0);
509
513
  if (n === e.length) return e;
510
514
  t || (e = e.slice());
511
- for (let r = n; r < e.length; r = q(e, r + 1)) e[r] = Me(e[r], t);
515
+ for (let r = n; r < e.length; r = K(e, r + 1)) e[r] = Ne(e[r], t);
512
516
  return e;
513
517
  }
514
- function q(e, t) {
515
- for (let n = t; n < e.length; n++) if (!je(e[n])) return n;
518
+ function K(e, t) {
519
+ for (let n = t; n < e.length; n++) if (!Me(e[n])) return n;
516
520
  return e.length;
517
521
  }
518
- function je(e) {
519
- for (let t = 1; t < e.length; t++) if (e[t][H] < e[t - 1][H]) return !1;
522
+ function Me(e) {
523
+ for (let t = 1; t < e.length; t++) if (e[t][V] < e[t - 1][V]) return !1;
520
524
  return !0;
521
525
  }
522
- function Me(e, t) {
523
- return t || (e = e.slice()), e.sort(Ne);
524
- }
525
526
  function Ne(e, t) {
526
- return e[H] - t[H];
527
+ return t || (e = e.slice()), e.sort(Pe);
528
+ }
529
+ function Pe(e, t) {
530
+ return e[V] - t[V];
527
531
  }
528
- var J = !1;
529
- function Pe(e, t, n, r) {
532
+ var q = !1;
533
+ function Fe(e, t, n, r) {
530
534
  for (; n <= r;) {
531
- let i = n + (r - n >> 1), a = e[i][H] - t;
532
- if (a === 0) return J = !0, i;
535
+ let i = n + (r - n >> 1), a = e[i][V] - t;
536
+ if (a === 0) return q = !0, i;
533
537
  a < 0 ? n = i + 1 : r = i - 1;
534
538
  }
535
- return J = !1, n - 1;
539
+ return q = !1, n - 1;
536
540
  }
537
- function Fe(e, t, n) {
538
- for (let r = n + 1; r < e.length && e[r][H] === t; n = r++);
541
+ function Ie(e, t, n) {
542
+ for (let r = n + 1; r < e.length && e[r][V] === t; n = r++);
539
543
  return n;
540
544
  }
541
- function Ie(e, t, n) {
542
- for (let r = n - 1; r >= 0 && e[r][H] === t; n = r--);
545
+ function Le(e, t, n) {
546
+ for (let r = n - 1; r >= 0 && e[r][V] === t; n = r--);
543
547
  return n;
544
548
  }
545
- function Le() {
549
+ function Re() {
546
550
  return {
547
551
  lastKey: -1,
548
552
  lastNeedle: -1,
549
553
  lastIndex: -1
550
554
  };
551
555
  }
552
- function Re(e, t, n, r) {
556
+ function ze(e, t, n, r) {
553
557
  let { lastKey: i, lastNeedle: a, lastIndex: o } = n, s = 0, c = e.length - 1;
554
558
  if (r === i) {
555
- if (t === a) return J = o !== -1 && e[o][H] === t, o;
559
+ if (t === a) return q = o !== -1 && e[o][V] === t, o;
556
560
  t >= a ? s = o === -1 ? 0 : o : c = o;
557
561
  }
558
- return n.lastKey = r, n.lastNeedle = t, n.lastIndex = Pe(e, t, s, c);
562
+ return n.lastKey = r, n.lastNeedle = t, n.lastIndex = Fe(e, t, s, c);
559
563
  }
560
- function Y(e) {
564
+ function J(e) {
561
565
  return typeof e == "string" ? JSON.parse(e) : e;
562
566
  }
563
- var ze = function(e, t) {
564
- let n = Y(e);
567
+ var Be = function(e, t) {
568
+ let n = J(e);
565
569
  if (!("sections" in n)) return new Z(n, t);
566
570
  let r = [], i = [], a = [], o = [], s = [];
567
- return Be(n, t, r, i, a, o, s, 0, 0, Infinity, Infinity), Ye({
571
+ return Y(n, t, r, i, a, o, s, 0, 0, Infinity, Infinity), Ye({
568
572
  version: 3,
569
573
  file: n.file,
570
574
  names: o,
@@ -574,7 +578,7 @@ var ze = function(e, t) {
574
578
  ignoreList: s
575
579
  });
576
580
  };
577
- function Be(e, t, n, r, i, a, o, s, c, l, u) {
581
+ function Y(e, t, n, r, i, a, o, s, c, l, u) {
578
582
  let { sections: d } = e;
579
583
  for (let e = 0; e < d.length; e++) {
580
584
  let { map: f, offset: p } = d[e], m = l, h = u;
@@ -586,8 +590,8 @@ function Be(e, t, n, r, i, a, o, s, c, l, u) {
586
590
  }
587
591
  }
588
592
  function Ve(e, t, n, r, i, a, o, s, c, l, u) {
589
- let d = Y(e);
590
- if ("sections" in d) return Be(...arguments);
593
+ let d = J(e);
594
+ if ("sections" in d) return Y(...arguments);
591
595
  let f = new Z(d, t), p = r.length, m = a.length, h = Ge(f), { resolvedSources: g, sourcesContent: _, ignoreList: v } = f;
592
596
  if (X(r, g), X(a, f.names), _) X(i, _);
593
597
  else for (let e = 0; e < g.length; e++) i.push(null);
@@ -597,13 +601,13 @@ function Ve(e, t, n, r, i, a, o, s, c, l, u) {
597
601
  if (t > l) return;
598
602
  let r = He(n, t), i = e === 0 ? c : 0, a = h[e];
599
603
  for (let e = 0; e < a.length; e++) {
600
- let n = a[e], o = i + n[H];
604
+ let n = a[e], o = i + n[V];
601
605
  if (t === l && o >= u) return;
602
606
  if (n.length === 1) {
603
607
  r.push([o]);
604
608
  continue;
605
609
  }
606
- let s = p + n[U], c = n[W], d = n[G];
610
+ let s = p + n[H], c = n[U], d = n[W];
607
611
  r.push(n.length === 4 ? [
608
612
  o,
609
613
  s,
@@ -614,7 +618,7 @@ function Ve(e, t, n, r, i, a, o, s, c, l, u) {
614
618
  s,
615
619
  c,
616
620
  d,
617
- m + n[K]
621
+ m + n[G]
618
622
  ]);
619
623
  }
620
624
  }
@@ -630,16 +634,16 @@ var Ue = "`line` must be greater than 0 (lines start at line 1)", We = "`column`
630
634
  constructor(e, t) {
631
635
  let n = typeof e == "string";
632
636
  if (!n && e._decodedMemo) return e;
633
- let r = Y(e), { version: i, file: a, names: o, sourceRoot: s, sources: c, sourcesContent: l } = r;
637
+ let r = J(e), { version: i, file: a, names: o, sourceRoot: s, sources: c, sourcesContent: l } = r;
634
638
  this.version = i, this.file = a, this.names = o || [], this.sourceRoot = s, this.sources = c, this.sourcesContent = l, this.ignoreList = r.ignoreList || r.x_google_ignoreList || void 0;
635
- let u = ke(t, s);
639
+ let u = Ae(t, s);
636
640
  this.resolvedSources = c.map(u);
637
641
  let { mappings: d } = r;
638
642
  if (typeof d == "string") this._encoded = d, this._decoded = void 0;
639
- else if (Array.isArray(d)) this._encoded = void 0, this._decoded = Ae(d, n);
643
+ else if (Array.isArray(d)) this._encoded = void 0, this._decoded = je(d, n);
640
644
  else if (r.sections) throw Error("TraceMap passed sectioned source map, please use FlattenMap export instead");
641
645
  else throw Error(`invalid source map: ${JSON.stringify(r)}`);
642
- this._decodedMemo = Le(), this._bySources = void 0, this._bySourceMemos = void 0;
646
+ this._decodedMemo = Re(), this._bySources = void 0, this._bySourceMemos = void 0;
643
647
  }
644
648
  };
645
649
  function Q(e) {
@@ -647,7 +651,7 @@ function Q(e) {
647
651
  }
648
652
  function Ge(e) {
649
653
  var t;
650
- return (t = Q(e))._decoded || (t._decoded = we(Q(e)._encoded));
654
+ return (t = Q(e))._decoded || (t._decoded = Te(Q(e)._encoded));
651
655
  }
652
656
  function Ke(e, t) {
653
657
  let { line: n, column: r, bias: i } = t;
@@ -660,7 +664,7 @@ function Ke(e, t) {
660
664
  let c = o[s];
661
665
  if (c.length === 1) return $(null, null, null, null);
662
666
  let { names: l, resolvedSources: u } = e;
663
- return $(u[c[U]], c[W] + 1, c[G], c.length === 5 ? l[c[K]] : null);
667
+ return $(u[c[H]], c[U] + 1, c[W], c.length === 5 ? l[c[G]] : null);
664
668
  }
665
669
  function qe(e, t) {
666
670
  let { sources: n, resolvedSources: r } = e, i = n.indexOf(t);
@@ -697,8 +701,8 @@ function $(e, t, n, r) {
697
701
  };
698
702
  }
699
703
  function Ze(e, t, n, r, i) {
700
- let a = Re(e, r, t, n);
701
- return J ? a = (i === -1 ? Fe : Ie)(e, r, a) : i === -1 && a++, a === -1 || a === e.length ? -1 : a;
704
+ let a = ze(e, r, t, n);
705
+ return q ? a = (i === -1 ? Ie : Le)(e, r, a) : i === -1 && a++, a === -1 || a === e.length ? -1 : a;
702
706
  }
703
707
  //#endregion
704
708
  //#region src/error-report-source-maps/symbolicate.ts
@@ -823,7 +827,7 @@ async function pt(e, t, n, r = {}) {
823
827
  continue;
824
828
  }
825
829
  let r = c.get(t.map);
826
- r || (r = new ze(await A(n, t), t.map), c.set(t.map, r));
830
+ r || (r = new Be(await A(n, t), t.map), c.set(t.map, r));
827
831
  let a = Ke(r, {
828
832
  line: e.line,
829
833
  column: e.column - 1
@@ -872,6 +876,6 @@ async function pt(e, t, n, r = {}) {
872
876
  }
873
877
  }
874
878
  //#endregion
875
- export { y as ERROR_REPORT_BUILD_ID_PATTERN, x as PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES, ae as PRIVATE_SOURCE_MAP_ARTIFACT_RETENTION_MS, ie as PRIVATE_SOURCE_MAP_MANIFEST_MAX_BYTES, re as PRIVATE_SOURCE_MAP_MANIFEST_VERSION, b as PRIVATE_SOURCE_MAP_MAX_BYTES, E as PrivateSourceMapArtifactError, N as STAGED_CLIENT_SOURCE_MAP_DIRECTORY, I as assertNoNitroSourceMapManifestLeaks, L as assertNoPublicSourceMapLeaks, T as isErrorReportBuildId, w as isPrivateSourceMapApplicationId, k as loadPrivateSourceMapArtifact, j as maintainPrivateSourceMapArchive, be as packageErrorReportSourceMaps, ue as parsePrivateSourceMapManifest, A as readPrivateSourceMap, ye as stageClientSourceMapsForNitro, me as startPrivateSourceMapArchiveMaintenance, pt as symbolicateErrorReportStack };
879
+ export { e as ERROR_REPORT_BUILD_ID_PATTERN, x as PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES, ae as PRIVATE_SOURCE_MAP_ARTIFACT_RETENTION_MS, ie as PRIVATE_SOURCE_MAP_MANIFEST_MAX_BYTES, re as PRIVATE_SOURCE_MAP_MANIFEST_VERSION, b as PRIVATE_SOURCE_MAP_MAX_BYTES, E as PrivateSourceMapArtifactError, _e as STAGED_CLIENT_SOURCE_MAP_DIRECTORY, F as assertNoNitroSourceMapManifestLeaks, I as assertNoPublicSourceMapLeaks, T as isErrorReportBuildId, w as isPrivateSourceMapApplicationId, k as loadPrivateSourceMapArtifact, j as maintainPrivateSourceMapArchive, xe as packageErrorReportSourceMaps, ue as parsePrivateSourceMapManifest, A as readPrivateSourceMap, be as stageClientSourceMapsForNitro, me as startPrivateSourceMapArchiveMaintenance, pt as symbolicateErrorReportStack };
876
880
 
877
881
  //# sourceMappingURL=index.js.map