@ryuzaki13/react-foundation-lib 2.1.4 → 2.2.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,46 +1,47 @@
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 { ERROR_REPORT_BUILD_ID_PATTERN as e } from "../error-report-build/index.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, y = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), ee = (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
- }, te = (e, t, n) => (n = e == null ? {} : p(_(e)), ee(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)), ne = 1, b = /^[0-9a-f]{40}$/, re = 2097152, x = 33554432, S = 268435456, ie = 83808e5, C = /^[a-z0-9]+(?:[.-][a-z0-9]+)*$/, ae = /^[0-9a-f]{64}$/;
16
- function w(e) {
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}$/;
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
- function oe(e, t) {
20
- return e.includes("\\") || e.includes("\0") || e.includes("?") || e.includes("#") ? !1 : t === "client" ? e.startsWith("/") && w(e.slice(1)) : e.startsWith("server/") && w(e);
20
+ function se(e, t) {
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 se = 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(ae),
27
- size: e.number().int().positive().max(x)
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
- oe(e.bundle, e.kind) || t.addIssue({
30
+ se(e.bundle, e.kind) || t.addIssue({
30
31
  code: "custom",
31
32
  path: ["bundle"],
32
33
  message: "Bundle path должен быть нормализован."
33
- }), (!w(e.map) || !e.map.startsWith(`${e.kind}/`) || !e.map.endsWith(".map")) && t.addIssue({
34
+ }), (!C(e.map) || !e.map.startsWith(`${e.kind}/`) || !e.map.endsWith(".map")) && t.addIssue({
34
35
  code: "custom",
35
36
  path: ["map"],
36
37
  message: "Map path должен оставаться внутри kind-каталога."
37
38
  });
38
- }), ce = e.object({
39
- version: e.literal(1),
40
- application: e.string().min(1).max(128).regex(C),
41
- buildId: e.string().regex(b),
42
- createdUtc: e.iso.datetime({ offset: !0 }),
43
- entries: e.array(se).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({
@@ -66,145 +67,145 @@ var se = e.object({
66
67
  message: "Private source-map artifact превышает общий предел."
67
68
  });
68
69
  });
69
- function le(e) {
70
- let t = ce.safeParse(e);
70
+ function ue(e) {
71
+ let t = le.safeParse(e);
71
72
  return t.success ? t.data : null;
72
73
  }
73
- function T(e) {
74
- return typeof e == "string" && e.length <= 128 && C.test(e);
74
+ function w(e) {
75
+ return typeof e == "string" && e.length <= 128 && S.test(e);
75
76
  }
76
- function E(e) {
77
- return typeof e == "string" && b.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
81
- var D = class extends Error {
82
+ var E = class extends Error {
82
83
  constructor() {
83
84
  super("Private source-map artifact не прошёл проверку целостности."), this.name = "PrivateSourceMapArtifactError";
84
85
  }
85
86
  };
86
- function ue(e) {
87
+ function de(e) {
87
88
  return e instanceof Error && "code" in e && e.code === "ENOENT";
88
89
  }
89
- function O(e, t) {
90
- let n = f.relative(e, t);
91
- return n !== "" && !n.startsWith("..") && !f.isAbsolute(n);
92
- }
93
- async function k(e, t, r) {
94
- let a = await n(e);
95
- if (!a.isFile() || a.isSymbolicLink() || a.size <= 0 || a.size > r) throw new D();
96
- let s = await o(e);
97
- if (!O(t, s)) throw new D();
98
- let c = await i(s);
99
- if (c.byteLength !== a.size) throw new D();
90
+ function D(e, t) {
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
- async function A(e, t, n) {
103
- if (!T(t) || !E(n)) throw new D();
103
+ async function k(e, t, n) {
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
- if (ue(e)) return null;
109
- throw new D();
109
+ if (de(e)) return null;
110
+ throw new E();
110
111
  }
111
- if (!O(r, i)) throw new D();
112
+ if (!D(r, i)) throw new E();
112
113
  let a;
113
114
  try {
114
- a = await k(f.join(i, "manifest.json"), i, re);
115
+ a = await O(p.join(i, "manifest.json"), i, ie);
115
116
  } catch (e) {
116
- if (ue(e)) return null;
117
- throw e instanceof D ? e : new D();
117
+ if (de(e)) return null;
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
- throw new D();
124
+ throw new E();
124
125
  }
125
- let c = le(s);
126
- if (!c || c.application !== t || c.buildId !== n) throw new D();
126
+ let c = ue(o);
127
+ if (!c || c.application !== t || c.buildId !== n) throw new E();
127
128
  return {
128
129
  buildDirectory: i,
129
130
  manifest: c,
130
131
  entriesByBundle: new Map(c.entries.map((e) => [e.bundle, e]))
131
132
  };
132
133
  }
133
- async function j(e, n) {
134
+ async function A(e, t) {
134
135
  try {
135
- let r = await k(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 D();
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
- throw e instanceof D ? e : new D();
140
+ throw e instanceof E ? e : new E();
140
141
  }
141
142
  }
142
143
  //#endregion
143
144
  //#region src/error-report-source-maps/archive.ts
144
- var de = 864e5;
145
- async function fe(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, {
145
+ var fe = 864e5;
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 j(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 A(t, n, i).catch(() => null)) throw e;
168
+ }), !await k(t, n, r).catch(() => null)) throw e;
168
169
  }
169
170
  }
170
- async function M(e) {
171
- if (!E(e.buildId)) return;
172
- await r(e.archiveRoot, { recursive: !0 });
173
- let t = await A(e.archiveRoot, e.application, e.buildId), n = e.seedRoot ? await A(e.seedRoot, e.application, e.buildId) : null;
171
+ async function j(e) {
172
+ if (!T(e.buildId)) return;
173
+ await i(e.archiveRoot, { recursive: !0 });
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
- !t && n && await fe(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() || !E(t.name) || t.name === e.buildId)) try {
180
- let n = await A(e.archiveRoot, e.application, t.name);
176
+ !t && n && await pe(n, e.archiveRoot, e.application, e.buildId);
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 {
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
- function pe(e) {
187
- let t = () => void M(e).catch((t) => e.onError?.(t));
187
+ function me(e) {
188
+ let t = () => void j(e).catch((t) => e.onError?.(t));
188
189
  t();
189
- let n = setInterval(t, de);
190
+ let n = setInterval(t, fe);
190
191
  return n.unref(), () => clearInterval(n);
191
192
  }
192
193
  //#endregion
193
194
  //#region src/error-report-source-maps/package.ts
194
- var me = /(?:\/\*[#@]\s*sourceMappingURL=[^*]*\*\/|\/\/[#@]\s*sourceMappingURL=.*)$/gm, N = /\.(?:css|html|js|mjs)$/, he = /"(\/[^"\n]+\.map)"\s*:\s*\{/, ge = ".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
- if (e.byteLength === 0 || e.byteLength > 33554432) throw Error(`Source map выходит за предел ${x} bytes: ${t}`);
207
+ function ve(e, t) {
208
+ if (e.byteLength === 0 || e.byteLength > 33554432) throw Error(`Source map выходит за предел ${b} bytes: ${t}`);
208
209
  let n;
209
210
  try {
210
211
  n = JSON.parse(e.toString("utf8"));
@@ -216,28 +217,28 @@ 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, n) {
220
- let r = f.join(e, "public"), i = f.join(e, "server"), a = f.relative(r, n);
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(t, n);
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(i, n);
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)}`,
@@ -246,75 +247,75 @@ function ve(e, t, n) {
246
247
  }
247
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(me, "");
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.resolve(t.clientSourceMapStagingRoot ?? f.join(n, ".private-source-maps-staging/client")), 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") && N.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 = he.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 (N.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
- if (!T(e.application) || !E(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.resolve(e.clientSourceMapStagingRoot ?? f.join(n, ".private-source-maps-staging/client")), p = f.join(a, e.application, e.buildId), m = `${p}.tmp-${process.pid}`, h = await P(n, /* @__PURE__ */ new Set([f.resolve(n, "server/node_modules")])), g = (() => {
275
- let e = f.relative(n, o);
276
- return e === "" || !e.startsWith("..") && !f.isAbsolute(e);
277
- })() ? [] : await P(o), _ = [...h, ...g].filter((e) => e.endsWith(".map"));
273
+ async function xe(e) {
274
+ if (!w(e.application) || !T(e.buildId)) throw Error("Application или build ID private source-map artifact недопустим.");
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"));
278
279
  if (_.length === 0) throw Error("Production build не создал private source maps.");
279
- await c(m, {
280
+ await l(m, {
280
281
  force: !0,
281
282
  recursive: !0
282
- }), await r(m, { recursive: !0 });
283
+ }), await i(m, { recursive: !0 });
283
284
  let v = [], y = 0;
284
285
  try {
285
286
  for (let e of _) {
286
- let a = await i(e);
287
- if (_e(a, e), y += a.byteLength, y > 268435456) throw Error(`Private source-map artifact превышает ${S} bytes.`);
288
- let s = ve(n, o, e), c = f.join(m, s.map);
289
- await r(f.dirname(c), { recursive: !0 }), await d(c, a, { flag: "wx" }), v.push({
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({
290
291
  ...s,
291
- sha256: t("sha256").update(a).digest("hex"),
292
- size: a.byteLength
292
+ sha256: n("sha256").update(r).digest("hex"),
293
+ size: r.byteLength
293
294
  });
294
295
  }
295
296
  if (!v.some((e) => e.kind === "client")) throw Error("Private source-map artifact не содержит client maps.");
296
297
  if (!v.some((e) => e.kind === "server")) throw Error("Private source-map artifact не содержит server maps.");
297
298
  v.sort((e, t) => e.bundle.localeCompare(t.bundle));
298
- let a = {
299
+ let r = {
299
300
  version: 1,
300
301
  application: e.application,
301
302
  buildId: e.buildId,
302
303
  createdUtc: e.createdUtc ?? (/* @__PURE__ */ new Date()).toISOString(),
303
304
  entries: v
304
305
  };
305
- await d(f.join(m, "manifest.json"), `${JSON.stringify(a, null, 2)}\n`, {
306
+ await f(p.join(m, "manifest.json"), `${JSON.stringify(r, null, 2)}\n`, {
306
307
  encoding: "utf8",
307
308
  flag: "wx"
308
- }), await c(p, {
309
+ }), await l(s, {
309
310
  force: !0,
310
311
  recursive: !0
311
- }), await r(f.dirname(p), { recursive: !0 }), await s(m, p);
312
- for (let e of _) await u(e);
313
- for (let e of h) !e.endsWith(".map") && N.test(e) && await F(e);
314
- if (await L(f.join(n, "public")), await I(f.join(n, "server/index.mjs")), !(await l(f.join(p, "manifest.json"))).isFile()) throw Error("Private source-map manifest не был создан.");
315
- 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;
316
317
  } catch (e) {
317
- throw await c(m, {
318
+ throw await l(m, {
318
319
  force: !0,
319
320
  recursive: !0
320
321
  }), e;
@@ -322,23 +323,23 @@ async function be(e) {
322
323
  }
323
324
  //#endregion
324
325
  //#region node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
325
- var xe = 44, R = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Se = /* @__PURE__ */ new Uint8Array(64), z = /* @__PURE__ */ new Uint8Array(128);
326
- for (let e = 0; e < R.length; e++) {
327
- let t = R.charCodeAt(e);
328
- 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;
329
330
  }
330
- function B(e, t) {
331
+ function z(e, t) {
331
332
  let n = 0, r = 0, i = 0;
332
333
  do
333
- i = z[e.next()], n |= (i & 31) << r, r += 5;
334
+ i = R[e.next()], n |= (i & 31) << r, r += 5;
334
335
  while (i & 32);
335
336
  let a = n & 1;
336
337
  return n >>>= 1, a && (n = -2147483648 | -n), t + n;
337
338
  }
338
- function V(e, t) {
339
- return e.pos >= t ? !1 : e.peek() !== xe;
339
+ function B(e, t) {
340
+ return e.pos >= t ? !1 : e.peek() !== Se;
340
341
  }
341
- var Ce = class {
342
+ var we = class {
342
343
  constructor(e) {
343
344
  this.pos = 0, this.buffer = e;
344
345
  }
@@ -353,13 +354,13 @@ var Ce = class {
353
354
  return r === -1 ? t.length : r;
354
355
  }
355
356
  };
356
- function we(e) {
357
- 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;
358
359
  do {
359
360
  let e = n.indexOf(";"), t = [], l = !0, u = 0;
360
361
  for (i = 0; n.pos < e;) {
361
362
  let r;
362
- 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 = [
363
364
  i,
364
365
  a,
365
366
  o,
@@ -372,19 +373,19 @@ function we(e) {
372
373
  s
373
374
  ]) : r = [i], t.push(r), n.pos++;
374
375
  }
375
- l || Te(t), r.push(t), n.pos = e + 1;
376
+ l || Ee(t), r.push(t), n.pos = e + 1;
376
377
  } while (n.pos <= t);
377
378
  return r;
378
379
  }
379
- function Te(e) {
380
- e.sort(Ee);
380
+ function Ee(e) {
381
+ e.sort(De);
381
382
  }
382
- function Ee(e, t) {
383
+ function De(e, t) {
383
384
  return e[0] - t[0];
384
385
  }
385
386
  //#endregion
386
387
  //#region node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
387
- var De = /* @__PURE__ */ te((/* @__PURE__ */ y(((e, t) => {
388
+ var Oe = /* @__PURE__ */ ne((/* @__PURE__ */ ee(((e, t) => {
388
389
  (function(n, r) {
389
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());
390
391
  })(e, (function() {
@@ -497,77 +498,77 @@ var De = /* @__PURE__ */ te((/* @__PURE__ */ y(((e, t) => {
497
498
  return h;
498
499
  }));
499
500
  })))(), 1);
500
- function Oe(e) {
501
+ function ke(e) {
501
502
  if (!e) return "";
502
503
  let t = e.lastIndexOf("/");
503
504
  return e.slice(0, t + 1);
504
505
  }
505
- function ke(e, t) {
506
- let n = Oe(e), r = t ? t + "/" : "";
507
- return (e) => (0, De.default)(r + (e || ""), n);
508
- }
509
- var H = 0, U = 1, W = 2, G = 3, K = 4;
510
506
  function Ae(e, t) {
511
- 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);
512
513
  if (n === e.length) return e;
513
514
  t || (e = e.slice());
514
- 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);
515
516
  return e;
516
517
  }
517
- function q(e, t) {
518
- 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;
519
520
  return e.length;
520
521
  }
521
- function je(e) {
522
- 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;
523
524
  return !0;
524
525
  }
525
- function Me(e, t) {
526
- return t || (e = e.slice()), e.sort(Ne);
527
- }
528
526
  function Ne(e, t) {
529
- 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];
530
531
  }
531
- var J = !1;
532
- function Pe(e, t, n, r) {
532
+ var q = !1;
533
+ function Fe(e, t, n, r) {
533
534
  for (; n <= r;) {
534
- let i = n + (r - n >> 1), a = e[i][H] - t;
535
- 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;
536
537
  a < 0 ? n = i + 1 : r = i - 1;
537
538
  }
538
- return J = !1, n - 1;
539
+ return q = !1, n - 1;
539
540
  }
540
- function Fe(e, t, n) {
541
- 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++);
542
543
  return n;
543
544
  }
544
- function Ie(e, t, n) {
545
- 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--);
546
547
  return n;
547
548
  }
548
- function Le() {
549
+ function Re() {
549
550
  return {
550
551
  lastKey: -1,
551
552
  lastNeedle: -1,
552
553
  lastIndex: -1
553
554
  };
554
555
  }
555
- function Re(e, t, n, r) {
556
+ function ze(e, t, n, r) {
556
557
  let { lastKey: i, lastNeedle: a, lastIndex: o } = n, s = 0, c = e.length - 1;
557
558
  if (r === i) {
558
- 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;
559
560
  t >= a ? s = o === -1 ? 0 : o : c = o;
560
561
  }
561
- 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);
562
563
  }
563
- function Y(e) {
564
+ function J(e) {
564
565
  return typeof e == "string" ? JSON.parse(e) : e;
565
566
  }
566
- var ze = function(e, t) {
567
- let n = Y(e);
567
+ var Be = function(e, t) {
568
+ let n = J(e);
568
569
  if (!("sections" in n)) return new Z(n, t);
569
570
  let r = [], i = [], a = [], o = [], s = [];
570
- 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({
571
572
  version: 3,
572
573
  file: n.file,
573
574
  names: o,
@@ -577,7 +578,7 @@ var ze = function(e, t) {
577
578
  ignoreList: s
578
579
  });
579
580
  };
580
- 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) {
581
582
  let { sections: d } = e;
582
583
  for (let e = 0; e < d.length; e++) {
583
584
  let { map: f, offset: p } = d[e], m = l, h = u;
@@ -589,8 +590,8 @@ function Be(e, t, n, r, i, a, o, s, c, l, u) {
589
590
  }
590
591
  }
591
592
  function Ve(e, t, n, r, i, a, o, s, c, l, u) {
592
- let d = Y(e);
593
- if ("sections" in d) return Be(...arguments);
593
+ let d = J(e);
594
+ if ("sections" in d) return Y(...arguments);
594
595
  let f = new Z(d, t), p = r.length, m = a.length, h = Ge(f), { resolvedSources: g, sourcesContent: _, ignoreList: v } = f;
595
596
  if (X(r, g), X(a, f.names), _) X(i, _);
596
597
  else for (let e = 0; e < g.length; e++) i.push(null);
@@ -600,13 +601,13 @@ function Ve(e, t, n, r, i, a, o, s, c, l, u) {
600
601
  if (t > l) return;
601
602
  let r = He(n, t), i = e === 0 ? c : 0, a = h[e];
602
603
  for (let e = 0; e < a.length; e++) {
603
- let n = a[e], o = i + n[H];
604
+ let n = a[e], o = i + n[V];
604
605
  if (t === l && o >= u) return;
605
606
  if (n.length === 1) {
606
607
  r.push([o]);
607
608
  continue;
608
609
  }
609
- let s = p + n[U], c = n[W], d = n[G];
610
+ let s = p + n[H], c = n[U], d = n[W];
610
611
  r.push(n.length === 4 ? [
611
612
  o,
612
613
  s,
@@ -617,7 +618,7 @@ function Ve(e, t, n, r, i, a, o, s, c, l, u) {
617
618
  s,
618
619
  c,
619
620
  d,
620
- m + n[K]
621
+ m + n[G]
621
622
  ]);
622
623
  }
623
624
  }
@@ -633,16 +634,16 @@ var Ue = "`line` must be greater than 0 (lines start at line 1)", We = "`column`
633
634
  constructor(e, t) {
634
635
  let n = typeof e == "string";
635
636
  if (!n && e._decodedMemo) return e;
636
- 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;
637
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;
638
- let u = ke(t, s);
639
+ let u = Ae(t, s);
639
640
  this.resolvedSources = c.map(u);
640
641
  let { mappings: d } = r;
641
642
  if (typeof d == "string") this._encoded = d, this._decoded = void 0;
642
- 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);
643
644
  else if (r.sections) throw Error("TraceMap passed sectioned source map, please use FlattenMap export instead");
644
645
  else throw Error(`invalid source map: ${JSON.stringify(r)}`);
645
- this._decodedMemo = Le(), this._bySources = void 0, this._bySourceMemos = void 0;
646
+ this._decodedMemo = Re(), this._bySources = void 0, this._bySourceMemos = void 0;
646
647
  }
647
648
  };
648
649
  function Q(e) {
@@ -650,7 +651,7 @@ function Q(e) {
650
651
  }
651
652
  function Ge(e) {
652
653
  var t;
653
- return (t = Q(e))._decoded || (t._decoded = we(Q(e)._encoded));
654
+ return (t = Q(e))._decoded || (t._decoded = Te(Q(e)._encoded));
654
655
  }
655
656
  function Ke(e, t) {
656
657
  let { line: n, column: r, bias: i } = t;
@@ -663,7 +664,7 @@ function Ke(e, t) {
663
664
  let c = o[s];
664
665
  if (c.length === 1) return $(null, null, null, null);
665
666
  let { names: l, resolvedSources: u } = e;
666
- 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);
667
668
  }
668
669
  function qe(e, t) {
669
670
  let { sources: n, resolvedSources: r } = e, i = n.indexOf(t);
@@ -700,8 +701,8 @@ function $(e, t, n, r) {
700
701
  };
701
702
  }
702
703
  function Ze(e, t, n, r, i) {
703
- let a = Re(e, r, t, n);
704
- 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;
705
706
  }
706
707
  //#endregion
707
708
  //#region src/error-report-source-maps/symbolicate.ts
@@ -785,7 +786,7 @@ function ut(e, t) {
785
786
  }
786
787
  async function dt(e, t, n) {
787
788
  for (let r of e) {
788
- let e = await A(r, t, n);
789
+ let e = await k(r, t, n);
789
790
  if (e) return e;
790
791
  }
791
792
  return null;
@@ -826,7 +827,7 @@ async function pt(e, t, n, r = {}) {
826
827
  continue;
827
828
  }
828
829
  let r = c.get(t.map);
829
- r || (r = new ze(await j(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));
830
831
  let a = Ke(r, {
831
832
  line: e.line,
832
833
  column: e.column - 1
@@ -875,6 +876,6 @@ async function pt(e, t, n, r = {}) {
875
876
  }
876
877
  }
877
878
  //#endregion
878
- export { b as ERROR_REPORT_BUILD_ID_PATTERN, S as PRIVATE_SOURCE_MAP_ARTIFACT_MAX_BYTES, ie as PRIVATE_SOURCE_MAP_ARTIFACT_RETENTION_MS, re as PRIVATE_SOURCE_MAP_MANIFEST_MAX_BYTES, ne as PRIVATE_SOURCE_MAP_MANIFEST_VERSION, x as PRIVATE_SOURCE_MAP_MAX_BYTES, D as PrivateSourceMapArtifactError, ge as STAGED_CLIENT_SOURCE_MAP_DIRECTORY, I as assertNoNitroSourceMapManifestLeaks, L as assertNoPublicSourceMapLeaks, E as isErrorReportBuildId, T as isPrivateSourceMapApplicationId, A as loadPrivateSourceMapArtifact, M as maintainPrivateSourceMapArchive, be as packageErrorReportSourceMaps, le as parsePrivateSourceMapManifest, j as readPrivateSourceMap, ye as stageClientSourceMapsForNitro, pe 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 };
879
880
 
880
881
  //# sourceMappingURL=index.js.map