@incajs/cli 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/adapter/types.d.mts +58 -0
- package/dist/adapter/vite/emitConfig.d.mts +6 -0
- package/dist/adapter/vite/hmr.d.mts +7 -0
- package/dist/adapter/vite/index.d.mts +1 -0
- package/dist/adapter/vite/logger.d.mts +4 -3
- package/dist/cli.js +414 -200
- package/dist/config/loader.d.mts +2 -1
- package/dist/dev-client/hostClient.d.mts +9 -2
- package/dist/dev-client/protocol.d.mts +2 -1
- package/dist/dev.d.mts +5 -0
- package/dist/hmr-runtime.js +1129 -0
- package/dist/log.d.mts +4 -2
- package/package.json +8 -6
|
@@ -0,0 +1,1129 @@
|
|
|
1
|
+
globalThis.TextDecoder === void 0 && (globalThis.TextDecoder = class {
|
|
2
|
+
decode(e) {
|
|
3
|
+
let t = "";
|
|
4
|
+
for (let n of e) t += String.fromCharCode(n);
|
|
5
|
+
return t;
|
|
6
|
+
}
|
|
7
|
+
}), globalThis.URL === void 0 && (globalThis.URL = class {
|
|
8
|
+
href;
|
|
9
|
+
constructor(e) {
|
|
10
|
+
this.href = e;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region ../../node_modules/.pnpm/vite@8.3.0_@types+node@26.6.2/node_modules/vite/dist/node/module-runner.js
|
|
15
|
+
var e = "sourceMa";
|
|
16
|
+
e += "ppingURL";
|
|
17
|
+
var t = typeof process < "u" && process.platform === "win32";
|
|
18
|
+
function n(e) {
|
|
19
|
+
return e.startsWith("/@id/") ? e.slice(5).replace("__x00__", "\0") : e;
|
|
20
|
+
}
|
|
21
|
+
var r = /\\/g;
|
|
22
|
+
function i(e) {
|
|
23
|
+
return e.replace(r, "/");
|
|
24
|
+
}
|
|
25
|
+
var a = /[?#].*$/;
|
|
26
|
+
function o(e) {
|
|
27
|
+
return e.replace(a, "");
|
|
28
|
+
}
|
|
29
|
+
function s(e) {
|
|
30
|
+
return !e || typeof e != "object" && typeof e != "function";
|
|
31
|
+
}
|
|
32
|
+
var c = async function() {}.constructor, l;
|
|
33
|
+
function u() {
|
|
34
|
+
if (l === void 0) {
|
|
35
|
+
let e = "/*code*/", t = new c("a", "b", e).toString();
|
|
36
|
+
l = t.slice(0, t.indexOf(e)).split("\n").length - 1;
|
|
37
|
+
}
|
|
38
|
+
return l;
|
|
39
|
+
}
|
|
40
|
+
function d() {
|
|
41
|
+
let e, t;
|
|
42
|
+
return {
|
|
43
|
+
promise: new Promise((n, r) => {
|
|
44
|
+
e = n, t = r;
|
|
45
|
+
}),
|
|
46
|
+
resolve: e,
|
|
47
|
+
reject: t
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
var f = 44, p = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", m = /* @__PURE__ */ new Uint8Array(64), h = /* @__PURE__ */ new Uint8Array(128);
|
|
51
|
+
for (let e = 0; e < p.length; e++) {
|
|
52
|
+
let t = p.charCodeAt(e);
|
|
53
|
+
m[e] = t, h[t] = e;
|
|
54
|
+
}
|
|
55
|
+
function g(e, t) {
|
|
56
|
+
let n = 0, r = 0, i = 0;
|
|
57
|
+
do
|
|
58
|
+
i = h[e.next()], n |= (i & 31) << r, r += 5;
|
|
59
|
+
while (i & 32);
|
|
60
|
+
let a = n & 1;
|
|
61
|
+
return n >>>= 1, a && (n = -2147483648 | -n), t + n;
|
|
62
|
+
}
|
|
63
|
+
function _(e, t) {
|
|
64
|
+
return e.pos >= t ? !1 : e.peek() !== f;
|
|
65
|
+
}
|
|
66
|
+
var ee = class {
|
|
67
|
+
constructor(e) {
|
|
68
|
+
this.pos = 0, this.buffer = e;
|
|
69
|
+
}
|
|
70
|
+
next() {
|
|
71
|
+
return this.buffer.charCodeAt(this.pos++);
|
|
72
|
+
}
|
|
73
|
+
peek() {
|
|
74
|
+
return this.buffer.charCodeAt(this.pos);
|
|
75
|
+
}
|
|
76
|
+
indexOf(e) {
|
|
77
|
+
let { buffer: t, pos: n } = this, r = t.indexOf(e, n);
|
|
78
|
+
return r === -1 ? t.length : r;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
function te(e) {
|
|
82
|
+
let { length: t } = e, n = new ee(e), r = [], i = 0, a = 0, o = 0, s = 0, c = 0;
|
|
83
|
+
do {
|
|
84
|
+
let e = n.indexOf(";"), t = [], l = !0, u = 0;
|
|
85
|
+
for (i = 0; n.pos < e;) {
|
|
86
|
+
let r;
|
|
87
|
+
i = g(n, i), i < u && (l = !1), u = i, _(n, e) ? (a = g(n, a), o = g(n, o), s = g(n, s), _(n, e) ? (c = g(n, c), r = [
|
|
88
|
+
i,
|
|
89
|
+
a,
|
|
90
|
+
o,
|
|
91
|
+
s,
|
|
92
|
+
c
|
|
93
|
+
]) : r = [
|
|
94
|
+
i,
|
|
95
|
+
a,
|
|
96
|
+
o,
|
|
97
|
+
s
|
|
98
|
+
]) : r = [i], t.push(r), n.pos++;
|
|
99
|
+
}
|
|
100
|
+
l || ne(t), r.push(t), n.pos = e + 1;
|
|
101
|
+
} while (n.pos <= t);
|
|
102
|
+
return r;
|
|
103
|
+
}
|
|
104
|
+
function ne(e) {
|
|
105
|
+
e.sort(re);
|
|
106
|
+
}
|
|
107
|
+
function re(e, t) {
|
|
108
|
+
return e[0] - t[0];
|
|
109
|
+
}
|
|
110
|
+
var v = 0, ie = 1, ae = 2, oe = 3, se = 4, y = !1;
|
|
111
|
+
function ce(e, t, n, r) {
|
|
112
|
+
for (; n <= r;) {
|
|
113
|
+
let i = n + (r - n >> 1), a = e[i][v] - t;
|
|
114
|
+
if (a === 0) return y = !0, i;
|
|
115
|
+
a < 0 ? n = i + 1 : r = i - 1;
|
|
116
|
+
}
|
|
117
|
+
return y = !1, n - 1;
|
|
118
|
+
}
|
|
119
|
+
function le(e, t, n) {
|
|
120
|
+
for (let r = n + 1; r < e.length && e[r][v] === t; n = r++);
|
|
121
|
+
return n;
|
|
122
|
+
}
|
|
123
|
+
function ue(e, t, n) {
|
|
124
|
+
for (let r = n - 1; r >= 0 && e[r][v] === t; n = r--);
|
|
125
|
+
return n;
|
|
126
|
+
}
|
|
127
|
+
function de(e, t, n, r) {
|
|
128
|
+
let { lastKey: i, lastNeedle: a, lastIndex: o } = n, s = 0, c = e.length - 1;
|
|
129
|
+
if (r === i) {
|
|
130
|
+
if (t === a) return y = o !== -1 && e[o][v] === t, o;
|
|
131
|
+
t >= a ? s = o === -1 ? 0 : o : c = o;
|
|
132
|
+
}
|
|
133
|
+
return n.lastKey = r, n.lastNeedle = t, n.lastIndex = ce(e, t, s, c);
|
|
134
|
+
}
|
|
135
|
+
var fe = "`line` must be greater than 0 (lines start at line 1)", pe = "`column` must be greater than or equal to 0 (columns start at column 0)";
|
|
136
|
+
function b(e) {
|
|
137
|
+
return e;
|
|
138
|
+
}
|
|
139
|
+
function me(e) {
|
|
140
|
+
var t;
|
|
141
|
+
return (t = b(e))._decoded || (t._decoded = te(b(e)._encoded));
|
|
142
|
+
}
|
|
143
|
+
function he(e, t) {
|
|
144
|
+
let { line: n, column: r, bias: i } = t;
|
|
145
|
+
if (n--, n < 0) throw Error(fe);
|
|
146
|
+
if (r < 0) throw Error(pe);
|
|
147
|
+
let a = me(e);
|
|
148
|
+
if (n >= a.length) return x(null, null, null, null);
|
|
149
|
+
let o = a[n], s = ge(o, b(e)._decodedMemo, n, r, i || 1);
|
|
150
|
+
if (s === -1) return x(null, null, null, null);
|
|
151
|
+
let c = o[s];
|
|
152
|
+
if (c.length === 1) return x(null, null, null, null);
|
|
153
|
+
let { names: l, resolvedSources: u } = e;
|
|
154
|
+
return x(u[c[ie]], c[ae] + 1, c[oe], c.length === 5 ? l[c[se]] : null);
|
|
155
|
+
}
|
|
156
|
+
function x(e, t, n, r) {
|
|
157
|
+
return {
|
|
158
|
+
source: e,
|
|
159
|
+
line: t,
|
|
160
|
+
column: n,
|
|
161
|
+
name: r
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function ge(e, t, n, r, i) {
|
|
165
|
+
let a = de(e, r, t, n);
|
|
166
|
+
return y ? a = (i === -1 ? le : ue)(e, r, a) : i === -1 && a++, a === -1 || a === e.length ? -1 : a;
|
|
167
|
+
}
|
|
168
|
+
var _e = /^[A-Za-z]:\//;
|
|
169
|
+
function S(e = "") {
|
|
170
|
+
return e && e.replace(/\\/g, "/").replace(_e, (e) => e.toUpperCase());
|
|
171
|
+
}
|
|
172
|
+
var ve = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, ye = /^[A-Za-z]:$/;
|
|
173
|
+
function be() {
|
|
174
|
+
return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
|
|
175
|
+
}
|
|
176
|
+
var xe = function(...e) {
|
|
177
|
+
e = e.map((e) => S(e));
|
|
178
|
+
let t = "", n = !1;
|
|
179
|
+
for (let r = e.length - 1; r >= -1 && !n; r--) {
|
|
180
|
+
let i = r >= 0 ? e[r] : be();
|
|
181
|
+
!i || i.length === 0 || (t = `${i}/${t}`, n = C(i));
|
|
182
|
+
}
|
|
183
|
+
return t = Se(t, !n), n && !C(t) ? `/${t}` : t.length > 0 ? t : ".";
|
|
184
|
+
};
|
|
185
|
+
function Se(e, t) {
|
|
186
|
+
let n = "", r = 0, i = -1, a = 0, o = null;
|
|
187
|
+
for (let s = 0; s <= e.length; ++s) {
|
|
188
|
+
if (s < e.length) o = e[s];
|
|
189
|
+
else if (o === "/") break;
|
|
190
|
+
else o = "/";
|
|
191
|
+
if (o === "/") {
|
|
192
|
+
if (i !== s - 1 && a !== 1) {
|
|
193
|
+
if (a === 2) {
|
|
194
|
+
if (n.length < 2 || r !== 2 || n[n.length - 1] !== "." || n[n.length - 2] !== ".") {
|
|
195
|
+
if (n.length > 2) {
|
|
196
|
+
let e = n.lastIndexOf("/");
|
|
197
|
+
e === -1 ? (n = "", r = 0) : (n = n.slice(0, e), r = n.length - 1 - n.lastIndexOf("/")), i = s, a = 0;
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
if (n.length > 0) {
|
|
201
|
+
n = "", r = 0, i = s, a = 0;
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
t && (n += n.length > 0 ? "/.." : "..", r = 2);
|
|
206
|
+
} else n.length > 0 ? n += `/${e.slice(i + 1, s)}` : n = e.slice(i + 1, s), r = s - i - 1;
|
|
207
|
+
}
|
|
208
|
+
i = s, a = 0;
|
|
209
|
+
} else o === "." && a !== -1 ? ++a : a = -1;
|
|
210
|
+
}
|
|
211
|
+
return n;
|
|
212
|
+
}
|
|
213
|
+
var C = function(e) {
|
|
214
|
+
return ve.test(e);
|
|
215
|
+
}, Ce = function(e) {
|
|
216
|
+
let t = S(e).replace(/\/$/, "").split("/").slice(0, -1);
|
|
217
|
+
return t.length === 1 && ye.test(t[0]) && (t[0] += "/"), t.join("/") || (C(e) ? "/" : ".");
|
|
218
|
+
}, we = new TextDecoder(), w = (() => {
|
|
219
|
+
let e = typeof Buffer == "function" ? Buffer : void 0;
|
|
220
|
+
return e && typeof e.from == "function" ? (t) => e.from(t, "base64").toString("utf-8") : (e) => we.decode(Uint8Array.from(atob(e), (e) => e.charCodeAt(0)));
|
|
221
|
+
})(), Te = /%/g, Ee = /\\/g, De = /\n/g, Oe = /\r/g, ke = /\t/g, Ae = /\?/g, je = /#/g;
|
|
222
|
+
function Me(e) {
|
|
223
|
+
return e.includes("%") && (e = e.replace(Te, "%25")), !t && e.includes("\\") && (e = e.replace(Ee, "%5C")), e.includes("\n") && (e = e.replace(De, "%0A")), e.includes("\r") && (e = e.replace(Oe, "%0D")), e.includes(" ") && (e = e.replace(ke, "%09")), e;
|
|
224
|
+
}
|
|
225
|
+
var T = Ce, E = xe;
|
|
226
|
+
function D(e) {
|
|
227
|
+
let n = E(e), r = e.charCodeAt(e.length - 1);
|
|
228
|
+
return (r === 47 || t && r === 92) && n.at(-1) !== "/" && (n += "/"), n = Me(n), n.includes("?") && (n = n.replace(Ae, "%3F")), n.includes("#") && (n = n.replace(je, "%23")), new URL(`file://${n}`).href;
|
|
229
|
+
}
|
|
230
|
+
function O(e) {
|
|
231
|
+
return e.replace(/\//g, "\\");
|
|
232
|
+
}
|
|
233
|
+
var k = class {
|
|
234
|
+
map;
|
|
235
|
+
_encoded;
|
|
236
|
+
_decoded;
|
|
237
|
+
_decodedMemo;
|
|
238
|
+
url;
|
|
239
|
+
file;
|
|
240
|
+
version;
|
|
241
|
+
names = [];
|
|
242
|
+
resolvedSources;
|
|
243
|
+
constructor(e, t) {
|
|
244
|
+
this.map = e;
|
|
245
|
+
let { mappings: n, names: r, sources: i } = e;
|
|
246
|
+
this.version = e.version, this.names = r || [], this._encoded = n || "", this._decodedMemo = Ne(), this.url = t, this.file = t;
|
|
247
|
+
let a = T(t);
|
|
248
|
+
this.resolvedSources = (i || []).map((e) => E(a, e || ""));
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
function Ne() {
|
|
252
|
+
return {
|
|
253
|
+
lastKey: -1,
|
|
254
|
+
lastNeedle: -1,
|
|
255
|
+
lastIndex: -1
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
function Pe(e, t) {
|
|
259
|
+
let n = he(e, t);
|
|
260
|
+
return n.column == null ? null : n;
|
|
261
|
+
}
|
|
262
|
+
var Fe = RegExp(`//# ${e}=data:application/json;base64,(.+)`), Ie = class {
|
|
263
|
+
id;
|
|
264
|
+
url;
|
|
265
|
+
importers = /* @__PURE__ */ new Set();
|
|
266
|
+
imports = /* @__PURE__ */ new Set();
|
|
267
|
+
evaluated = !1;
|
|
268
|
+
meta;
|
|
269
|
+
promise;
|
|
270
|
+
exports;
|
|
271
|
+
file;
|
|
272
|
+
map;
|
|
273
|
+
constructor(e, t) {
|
|
274
|
+
this.id = e, this.url = t, this.file = o(e);
|
|
275
|
+
}
|
|
276
|
+
}, Le = class {
|
|
277
|
+
idToModuleMap = /* @__PURE__ */ new Map();
|
|
278
|
+
fileToModulesMap = /* @__PURE__ */ new Map();
|
|
279
|
+
urlToIdModuleMap = /* @__PURE__ */ new Map();
|
|
280
|
+
getModuleById(e) {
|
|
281
|
+
return this.idToModuleMap.get(e);
|
|
282
|
+
}
|
|
283
|
+
getModulesByFile(e) {
|
|
284
|
+
return this.fileToModulesMap.get(e);
|
|
285
|
+
}
|
|
286
|
+
getModuleByUrl(e) {
|
|
287
|
+
return this.urlToIdModuleMap.get(n(e));
|
|
288
|
+
}
|
|
289
|
+
ensureModule(e, t) {
|
|
290
|
+
if (e = ze(e), this.idToModuleMap.has(e)) {
|
|
291
|
+
let n = this.idToModuleMap.get(e);
|
|
292
|
+
return this.urlToIdModuleMap.set(t, n), n;
|
|
293
|
+
}
|
|
294
|
+
let n = new Ie(e, t);
|
|
295
|
+
this.idToModuleMap.set(e, n), this.urlToIdModuleMap.set(t, n);
|
|
296
|
+
let r = this.fileToModulesMap.get(n.file) || /* @__PURE__ */ new Set();
|
|
297
|
+
return r.add(n), this.fileToModulesMap.set(n.file, r), n;
|
|
298
|
+
}
|
|
299
|
+
invalidateModule(e) {
|
|
300
|
+
e.evaluated = !1, e.meta = void 0, e.map = void 0, e.promise = void 0, e.exports = void 0, e.imports.clear();
|
|
301
|
+
}
|
|
302
|
+
getModuleSourceMapById(t) {
|
|
303
|
+
let n = this.getModuleById(t);
|
|
304
|
+
if (!n) return null;
|
|
305
|
+
if (n.map) return n.map;
|
|
306
|
+
if (!n.meta || !("code" in n.meta)) return null;
|
|
307
|
+
let r = `//# ${e}=data:application/json;base64,`, i = n.meta.code.lastIndexOf(r);
|
|
308
|
+
if (i === -1) return null;
|
|
309
|
+
let a = Fe.exec(n.meta.code.slice(i))?.[1];
|
|
310
|
+
return a ? (n.map = new k(JSON.parse(w(a)), n.file), n.map) : null;
|
|
311
|
+
}
|
|
312
|
+
clear() {
|
|
313
|
+
this.idToModuleMap.clear(), this.fileToModulesMap.clear(), this.urlToIdModuleMap.clear();
|
|
314
|
+
}
|
|
315
|
+
}, Re = /* @__PURE__ */ new Set([
|
|
316
|
+
"node:sea",
|
|
317
|
+
"node:sqlite",
|
|
318
|
+
"node:test",
|
|
319
|
+
"node:test/reporters"
|
|
320
|
+
]);
|
|
321
|
+
function ze(e) {
|
|
322
|
+
return Re.has(e) ? e : i(e).replace(/^\/@fs\//, t ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/").replace(/^file:\/+/, t ? "" : "/");
|
|
323
|
+
}
|
|
324
|
+
function Be(e) {
|
|
325
|
+
let t = new Set(e.filter((e) => typeof e == "string")), n = e.filter((e) => typeof e != "string");
|
|
326
|
+
return (e) => t.has(e) || n.some((t) => t.test(e));
|
|
327
|
+
}
|
|
328
|
+
var Ve = class {
|
|
329
|
+
hmrClient;
|
|
330
|
+
ownerPath;
|
|
331
|
+
newListeners;
|
|
332
|
+
constructor(e, t) {
|
|
333
|
+
this.hmrClient = e, this.ownerPath = t, e.dataMap.has(t) || e.dataMap.set(t, {});
|
|
334
|
+
let n = e.hotModulesMap.get(t);
|
|
335
|
+
n && (n.callbacks = []);
|
|
336
|
+
let r = e.ctxToListenersMap.get(t);
|
|
337
|
+
if (r) for (let [t, n] of r) {
|
|
338
|
+
let r = e.customListenersMap.get(t);
|
|
339
|
+
r && e.customListenersMap.set(t, r.filter((e) => !n.includes(e)));
|
|
340
|
+
}
|
|
341
|
+
this.newListeners = /* @__PURE__ */ new Map(), e.ctxToListenersMap.set(t, this.newListeners);
|
|
342
|
+
}
|
|
343
|
+
get data() {
|
|
344
|
+
return this.hmrClient.dataMap.get(this.ownerPath);
|
|
345
|
+
}
|
|
346
|
+
accept(e, t) {
|
|
347
|
+
if (typeof e == "function" || !e) this.acceptDeps([this.ownerPath], ([t]) => e?.(t));
|
|
348
|
+
else if (typeof e == "string") this.acceptDeps([e], ([e]) => t?.(e));
|
|
349
|
+
else if (Array.isArray(e)) this.acceptDeps(e, t);
|
|
350
|
+
else throw Error("invalid hot.accept() usage.");
|
|
351
|
+
}
|
|
352
|
+
acceptExports(e, t) {
|
|
353
|
+
this.acceptDeps([this.ownerPath], ([e]) => t?.(e));
|
|
354
|
+
}
|
|
355
|
+
dispose(e) {
|
|
356
|
+
this.hmrClient.disposeMap.set(this.ownerPath, e);
|
|
357
|
+
}
|
|
358
|
+
prune(e) {
|
|
359
|
+
this.hmrClient.pruneMap.set(this.ownerPath, e);
|
|
360
|
+
}
|
|
361
|
+
decline() {}
|
|
362
|
+
invalidate(e) {
|
|
363
|
+
let t = this.hmrClient.currentFirstInvalidatedBy ?? this.ownerPath;
|
|
364
|
+
this.hmrClient.notifyListeners("vite:invalidate", {
|
|
365
|
+
path: this.ownerPath,
|
|
366
|
+
message: e,
|
|
367
|
+
firstInvalidatedBy: t
|
|
368
|
+
}), this.send("vite:invalidate", {
|
|
369
|
+
path: this.ownerPath,
|
|
370
|
+
message: e,
|
|
371
|
+
firstInvalidatedBy: t
|
|
372
|
+
}), this.hmrClient.logger.debug(`invalidate ${this.ownerPath}${e ? `: ${e}` : ""}`);
|
|
373
|
+
}
|
|
374
|
+
on(e, t) {
|
|
375
|
+
let n = (n) => {
|
|
376
|
+
let r = n.get(e) || [];
|
|
377
|
+
r.push(t), n.set(e, r);
|
|
378
|
+
};
|
|
379
|
+
n(this.hmrClient.customListenersMap), n(this.newListeners);
|
|
380
|
+
}
|
|
381
|
+
off(e, t) {
|
|
382
|
+
let n = (n) => {
|
|
383
|
+
let r = n.get(e);
|
|
384
|
+
if (r === void 0) return;
|
|
385
|
+
let i = r.filter((e) => e !== t);
|
|
386
|
+
if (i.length === 0) {
|
|
387
|
+
n.delete(e);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
n.set(e, i);
|
|
391
|
+
};
|
|
392
|
+
n(this.hmrClient.customListenersMap), n(this.newListeners);
|
|
393
|
+
}
|
|
394
|
+
send(e, t) {
|
|
395
|
+
this.hmrClient.send({
|
|
396
|
+
type: "custom",
|
|
397
|
+
event: e,
|
|
398
|
+
data: t
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
acceptDeps(e, t = () => {}) {
|
|
402
|
+
let n = this.hmrClient.hotModulesMap.get(this.ownerPath) || {
|
|
403
|
+
id: this.ownerPath,
|
|
404
|
+
callbacks: []
|
|
405
|
+
};
|
|
406
|
+
n.callbacks.push({
|
|
407
|
+
deps: e,
|
|
408
|
+
fn: t
|
|
409
|
+
}), this.hmrClient.hotModulesMap.set(this.ownerPath, n);
|
|
410
|
+
}
|
|
411
|
+
}, He = class {
|
|
412
|
+
logger;
|
|
413
|
+
transport;
|
|
414
|
+
importUpdatedModule;
|
|
415
|
+
hotModulesMap = /* @__PURE__ */ new Map();
|
|
416
|
+
disposeMap = /* @__PURE__ */ new Map();
|
|
417
|
+
pruneMap = /* @__PURE__ */ new Map();
|
|
418
|
+
dataMap = /* @__PURE__ */ new Map();
|
|
419
|
+
customListenersMap = /* @__PURE__ */ new Map();
|
|
420
|
+
ctxToListenersMap = /* @__PURE__ */ new Map();
|
|
421
|
+
currentFirstInvalidatedBy;
|
|
422
|
+
constructor(e, t, n) {
|
|
423
|
+
this.logger = e, this.transport = t, this.importUpdatedModule = n;
|
|
424
|
+
}
|
|
425
|
+
async notifyListeners(e, t) {
|
|
426
|
+
let n = this.customListenersMap.get(e);
|
|
427
|
+
n && await Promise.allSettled(n.map((e) => e(t)));
|
|
428
|
+
}
|
|
429
|
+
send(e) {
|
|
430
|
+
this.transport.send(e).catch((e) => {
|
|
431
|
+
this.logger.error(e);
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
clear() {
|
|
435
|
+
this.hotModulesMap.clear(), this.disposeMap.clear(), this.pruneMap.clear(), this.dataMap.clear(), this.customListenersMap.clear(), this.ctxToListenersMap.clear();
|
|
436
|
+
}
|
|
437
|
+
async prunePaths(e) {
|
|
438
|
+
try {
|
|
439
|
+
await Promise.all(e.map((e) => {
|
|
440
|
+
let t = this.disposeMap.get(e);
|
|
441
|
+
if (t) return t(this.dataMap.get(e));
|
|
442
|
+
})), await Promise.all(e.map((e) => {
|
|
443
|
+
let t = this.pruneMap.get(e);
|
|
444
|
+
if (t) return t(this.dataMap.get(e));
|
|
445
|
+
}));
|
|
446
|
+
} finally {
|
|
447
|
+
e.forEach((e) => this.dataMap.delete(e));
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
warnFailedUpdate(e, t) {
|
|
451
|
+
(!(e instanceof Error) || !e.message.includes("fetch")) && this.logger.error(e), this.logger.error(`Failed to reload ${t}. This could be due to syntax errors or importing non-existent modules. (see errors above)`);
|
|
452
|
+
}
|
|
453
|
+
updateQueue = [];
|
|
454
|
+
pendingUpdateQueue = !1;
|
|
455
|
+
async queueUpdate(e) {
|
|
456
|
+
if (this.updateQueue.push(this.fetchUpdate(e)), !this.pendingUpdateQueue) {
|
|
457
|
+
this.pendingUpdateQueue = !0, await Promise.resolve(), this.pendingUpdateQueue = !1;
|
|
458
|
+
let e = [...this.updateQueue];
|
|
459
|
+
this.updateQueue = [], (await Promise.all(e)).forEach((e) => e && e());
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
async fetchUpdate(e) {
|
|
463
|
+
let { path: t, acceptedPath: n, firstInvalidatedBy: r } = e, i = this.hotModulesMap.get(t);
|
|
464
|
+
if (!i) return;
|
|
465
|
+
let a, o = t === n, s = i.callbacks.filter(({ deps: e }) => e.includes(n));
|
|
466
|
+
if (o || s.length > 0) {
|
|
467
|
+
let t = this.disposeMap.get(n);
|
|
468
|
+
t && await t(this.dataMap.get(n));
|
|
469
|
+
try {
|
|
470
|
+
a = await this.importUpdatedModule(e);
|
|
471
|
+
} catch (e) {
|
|
472
|
+
this.warnFailedUpdate(e, n);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return () => {
|
|
476
|
+
try {
|
|
477
|
+
this.currentFirstInvalidatedBy = r;
|
|
478
|
+
for (let { deps: e, fn: t } of s) t(e.map((e) => e === n ? a : void 0));
|
|
479
|
+
let e = o ? t : `${n} via ${t}`;
|
|
480
|
+
this.logger.debug(`hot updated: ${e}`);
|
|
481
|
+
} finally {
|
|
482
|
+
this.currentFirstInvalidatedBy = void 0;
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
}, Ue = (e = 21) => {
|
|
487
|
+
let t = "", n = e | 0;
|
|
488
|
+
for (; n-- > 0;) t += "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[Math.random() * 64 | 0];
|
|
489
|
+
return t;
|
|
490
|
+
};
|
|
491
|
+
function A(e) {
|
|
492
|
+
let t = Error(e.message || "Unknown invoke error");
|
|
493
|
+
return Object.assign(t, e, { runnerError: /* @__PURE__ */ Error("RunnerError") }), t;
|
|
494
|
+
}
|
|
495
|
+
var We = (e) => {
|
|
496
|
+
if (e.invoke) return {
|
|
497
|
+
...e,
|
|
498
|
+
async invoke(t, n) {
|
|
499
|
+
let r = await e.invoke({
|
|
500
|
+
type: "custom",
|
|
501
|
+
event: "vite:invoke",
|
|
502
|
+
data: {
|
|
503
|
+
id: "send",
|
|
504
|
+
name: t,
|
|
505
|
+
data: n
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
if ("error" in r) throw A(r.error);
|
|
509
|
+
return r.result;
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
if (!e.send || !e.connect) throw Error("transport must implement send and connect when invoke is not implemented");
|
|
513
|
+
let t = /* @__PURE__ */ new Map();
|
|
514
|
+
return {
|
|
515
|
+
...e,
|
|
516
|
+
connect({ onMessage: n, onDisconnection: r }) {
|
|
517
|
+
return e.connect({
|
|
518
|
+
onMessage(e) {
|
|
519
|
+
if (e.type === "custom" && e.event === "vite:invoke") {
|
|
520
|
+
let n = e.data;
|
|
521
|
+
if (n.id.startsWith("response:")) {
|
|
522
|
+
let e = n.id.slice(9), r = t.get(e);
|
|
523
|
+
if (!r) return;
|
|
524
|
+
r.timeoutId && clearTimeout(r.timeoutId), t.delete(e);
|
|
525
|
+
let { error: i, result: a } = n.data;
|
|
526
|
+
i ? r.reject(i) : r.resolve(a);
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
n(e);
|
|
531
|
+
},
|
|
532
|
+
onDisconnection: r
|
|
533
|
+
});
|
|
534
|
+
},
|
|
535
|
+
disconnect() {
|
|
536
|
+
return t.forEach((e) => {
|
|
537
|
+
e.reject(/* @__PURE__ */ Error(`transport was disconnected, cannot call ${JSON.stringify(e.name)}`));
|
|
538
|
+
}), t.clear(), e.disconnect?.();
|
|
539
|
+
},
|
|
540
|
+
send(t) {
|
|
541
|
+
return e.send(t);
|
|
542
|
+
},
|
|
543
|
+
async invoke(n, r) {
|
|
544
|
+
let i = Ue(), a = {
|
|
545
|
+
type: "custom",
|
|
546
|
+
event: "vite:invoke",
|
|
547
|
+
data: {
|
|
548
|
+
name: n,
|
|
549
|
+
id: `send:${i}`,
|
|
550
|
+
data: r
|
|
551
|
+
}
|
|
552
|
+
}, o = e.send(a), { promise: s, resolve: c, reject: l } = d(), u = e.timeout ?? 6e4, f;
|
|
553
|
+
u > 0 && (f = setTimeout(() => {
|
|
554
|
+
t.delete(i), l(/* @__PURE__ */ Error(`transport invoke timed out after ${u}ms (data: ${JSON.stringify(a)})`));
|
|
555
|
+
}, u), f?.unref?.()), t.set(i, {
|
|
556
|
+
resolve: c,
|
|
557
|
+
reject: l,
|
|
558
|
+
name: n,
|
|
559
|
+
timeoutId: f
|
|
560
|
+
}), o && o.catch((e) => {
|
|
561
|
+
clearTimeout(f), t.delete(i), l(e);
|
|
562
|
+
});
|
|
563
|
+
try {
|
|
564
|
+
return await s;
|
|
565
|
+
} catch (e) {
|
|
566
|
+
throw A(e);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
}, Ge = (e) => {
|
|
571
|
+
let t = We(e), n = !t.connect, r;
|
|
572
|
+
return {
|
|
573
|
+
...e,
|
|
574
|
+
...t.connect ? { async connect(e) {
|
|
575
|
+
if (n) return;
|
|
576
|
+
if (r) {
|
|
577
|
+
await r;
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
let i = t.connect({
|
|
581
|
+
onMessage: e ?? (() => {}),
|
|
582
|
+
onDisconnection() {
|
|
583
|
+
n = !1;
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
i && (r = i, await r, r = void 0), n = !0;
|
|
587
|
+
} } : {},
|
|
588
|
+
...t.disconnect ? { async disconnect() {
|
|
589
|
+
n && (r && await r, n = !1, await t.disconnect());
|
|
590
|
+
} } : {},
|
|
591
|
+
async send(e) {
|
|
592
|
+
if (t.send) {
|
|
593
|
+
if (!n) {
|
|
594
|
+
if (r) await r;
|
|
595
|
+
else throw new j("send was called before connect");
|
|
596
|
+
}
|
|
597
|
+
await t.send(e);
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
async invoke(e, i) {
|
|
601
|
+
if (!n) {
|
|
602
|
+
if (r) await r;
|
|
603
|
+
else throw new j("invoke was called before connect");
|
|
604
|
+
}
|
|
605
|
+
return t.invoke(e, i);
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
}, j = class extends Error {
|
|
609
|
+
constructor(e) {
|
|
610
|
+
super(e), this.name = "SendBeforeConnectError";
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
function Ke(e, t, n, r) {
|
|
614
|
+
if (!r?.isDynamicImport && r?.importedNames?.length) {
|
|
615
|
+
let i = r.importedNames.filter((t) => !(t in e));
|
|
616
|
+
if (i.length) {
|
|
617
|
+
let e = i.at(-1);
|
|
618
|
+
throw SyntaxError(n === "module" ? `[vite] The requested module '${t}' does not provide an export named '${e}'` : `\
|
|
619
|
+
[vite] Named export '${e}' not found. The requested module '${t}' is a CommonJS module, which may not support all module.exports as named exports.
|
|
620
|
+
CommonJS modules can always be imported via the default export, for example using:
|
|
621
|
+
|
|
622
|
+
import pkg from '${t}';
|
|
623
|
+
const {${i.join(", ")}} = pkg;
|
|
624
|
+
`);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
var M = "__vite_ssr_exports__", N = "__vite_ssr_import__", P = "__vite_ssr_dynamic_import__", F = "__vite_ssr_exportAll__", I = "__vite_ssr_exportName__", L = "__vite_ssr_import_meta__", R = "vite-module-runner:import-meta-resolve/v1/";
|
|
629
|
+
`${JSON.stringify(R)}${JSON.stringify(R)}`;
|
|
630
|
+
var qe = new Proxy({}, { get(e, t) {
|
|
631
|
+
throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(t)}" instead.`);
|
|
632
|
+
} });
|
|
633
|
+
function Je(e) {
|
|
634
|
+
let n = D(e), r = e, i = T(e);
|
|
635
|
+
return {
|
|
636
|
+
filename: t ? O(r) : r,
|
|
637
|
+
dirname: t ? O(i) : i,
|
|
638
|
+
url: n,
|
|
639
|
+
env: qe,
|
|
640
|
+
resolve(e, t) {
|
|
641
|
+
throw Error("[module runner] \"import.meta.resolve\" is not supported.");
|
|
642
|
+
},
|
|
643
|
+
glob() {
|
|
644
|
+
throw Error("[module runner] \"import.meta.glob\" is statically replaced during file transformation. Make sure to reference it by the full name.");
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
var z = class {
|
|
649
|
+
startOffset = u() + 1;
|
|
650
|
+
async runInlinedModule(e, t) {
|
|
651
|
+
await new c(M, L, N, P, F, I, "\"use strict\";\n" + t)(e[M], e[L], e[N], e[P], e[F], e[I]), Object.seal(e[M]);
|
|
652
|
+
}
|
|
653
|
+
runExternalModule(e) {
|
|
654
|
+
return import(e);
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
function Ye(e) {
|
|
658
|
+
let t = new Xe();
|
|
659
|
+
return (n) => t.enqueue(() => e(n));
|
|
660
|
+
}
|
|
661
|
+
var Xe = class {
|
|
662
|
+
queue = [];
|
|
663
|
+
pending = !1;
|
|
664
|
+
enqueue(e) {
|
|
665
|
+
return new Promise((t, n) => {
|
|
666
|
+
this.queue.push({
|
|
667
|
+
promise: e,
|
|
668
|
+
resolve: t,
|
|
669
|
+
reject: n
|
|
670
|
+
}), this.dequeue();
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
dequeue() {
|
|
674
|
+
if (this.pending) return !1;
|
|
675
|
+
let e = this.queue.shift();
|
|
676
|
+
return e ? (this.pending = !0, e.promise().then(e.resolve).catch(e.reject).finally(() => {
|
|
677
|
+
this.pending = !1, this.dequeue();
|
|
678
|
+
}), !0) : !1;
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
function Ze(e) {
|
|
682
|
+
return Ye(async (t) => {
|
|
683
|
+
let n = e.hmrClient;
|
|
684
|
+
if (n && !e.isClosed()) switch (t.type) {
|
|
685
|
+
case "connected":
|
|
686
|
+
n.logger.debug("connected.");
|
|
687
|
+
break;
|
|
688
|
+
case "update":
|
|
689
|
+
await n.notifyListeners("vite:beforeUpdate", t), await Promise.all(t.updates.map(async (e) => {
|
|
690
|
+
if (e.type === "js-update") return n.queueUpdate(e);
|
|
691
|
+
n.logger.error("css hmr is not supported in runner mode.");
|
|
692
|
+
})), await n.notifyListeners("vite:afterUpdate", t);
|
|
693
|
+
break;
|
|
694
|
+
case "custom":
|
|
695
|
+
await n.notifyListeners(t.event, t.data);
|
|
696
|
+
break;
|
|
697
|
+
case "full-reload": {
|
|
698
|
+
let { triggeredBy: r } = t, a = r ? B(e, Qe(e, i(r))) : $e(e);
|
|
699
|
+
if (!a.size) break;
|
|
700
|
+
n.logger.debug("program reload"), await n.notifyListeners("vite:beforeFullReload", t), e.evaluatedModules.clear();
|
|
701
|
+
for (let t of a) {
|
|
702
|
+
if (e.isClosed()) break;
|
|
703
|
+
try {
|
|
704
|
+
await e.import(t);
|
|
705
|
+
} catch (t) {
|
|
706
|
+
if (e.isClosed()) break;
|
|
707
|
+
t.code !== "ERR_OUTDATED_OPTIMIZED_DEP" && n.logger.error(`An error happened during full reload\n${t.message}\n${t.stack}`);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
break;
|
|
711
|
+
}
|
|
712
|
+
case "prune":
|
|
713
|
+
await n.notifyListeners("vite:beforePrune", t), await n.prunePaths(t.paths);
|
|
714
|
+
break;
|
|
715
|
+
case "error": {
|
|
716
|
+
await n.notifyListeners("vite:error", t);
|
|
717
|
+
let e = t.err;
|
|
718
|
+
n.logger.error(`Internal Server Error\n${e.message}\n${e.stack}`);
|
|
719
|
+
break;
|
|
720
|
+
}
|
|
721
|
+
case "ping": break;
|
|
722
|
+
case "bundled-dev-update": break;
|
|
723
|
+
default: return t;
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
function Qe(e, t) {
|
|
728
|
+
let n = e.evaluatedModules.getModulesByFile(t);
|
|
729
|
+
return n ? [...n].map((e) => e.id) : [];
|
|
730
|
+
}
|
|
731
|
+
function B(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
732
|
+
for (let i of t) {
|
|
733
|
+
if (n.has(i)) continue;
|
|
734
|
+
n.add(i);
|
|
735
|
+
let t = e.evaluatedModules.getModuleById(i);
|
|
736
|
+
if (t) {
|
|
737
|
+
if (!t.importers.size) {
|
|
738
|
+
r.add(t.url);
|
|
739
|
+
continue;
|
|
740
|
+
}
|
|
741
|
+
for (let i of t.importers) B(e, [i], n, r);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
return r;
|
|
745
|
+
}
|
|
746
|
+
function $e(e, t = /* @__PURE__ */ new Set()) {
|
|
747
|
+
for (let n of e.evaluatedModules.idToModuleMap.values()) n.importers.size || t.add(n.url);
|
|
748
|
+
return t;
|
|
749
|
+
}
|
|
750
|
+
var V = () => {}, et = {
|
|
751
|
+
debug: V,
|
|
752
|
+
error: V
|
|
753
|
+
}, tt = {
|
|
754
|
+
debug: (...e) => console.log("[vite]", ...e),
|
|
755
|
+
error: (e) => console.log("[vite]", e)
|
|
756
|
+
}, H = {}, U = {}, W = /* @__PURE__ */ new Set(), G = /* @__PURE__ */ new Set(), K = /* @__PURE__ */ new Set(), q = (e) => ((...t) => {
|
|
757
|
+
for (let n of e) {
|
|
758
|
+
let e = n(...t);
|
|
759
|
+
if (e) return e;
|
|
760
|
+
}
|
|
761
|
+
return null;
|
|
762
|
+
}), nt = q(G), rt = q(K), J = !1, it = Error.prepareStackTrace;
|
|
763
|
+
function at(e, t) {
|
|
764
|
+
W.delete(e.evaluatedModules), t.retrieveFile && G.delete(t.retrieveFile), t.retrieveSourceMap && K.delete(t.retrieveSourceMap), W.size === 0 && (Error.prepareStackTrace = it, J = !1);
|
|
765
|
+
}
|
|
766
|
+
function ot(e, t = {}) {
|
|
767
|
+
return J ||= (Error.prepareStackTrace = pt, !0), W.add(e.evaluatedModules), t.retrieveFile && G.add(t.retrieveFile), t.retrieveSourceMap && K.add(t.retrieveSourceMap), () => at(e, t);
|
|
768
|
+
}
|
|
769
|
+
function Y(e, t) {
|
|
770
|
+
if (!e) return t;
|
|
771
|
+
let n = T(i(e)), r = /^\w+:\/\/[^/]*/.exec(n), a = r ? r[0] : "", o = n.slice(a.length);
|
|
772
|
+
return a && /^\/\w:/.test(o) ? (a += "/", a + i(E(o, t))) : a + E(o, t);
|
|
773
|
+
}
|
|
774
|
+
function st(e) {
|
|
775
|
+
for (let t of W) {
|
|
776
|
+
let n = t.getModuleSourceMapById(e.source);
|
|
777
|
+
if (n) return {
|
|
778
|
+
url: e.source,
|
|
779
|
+
map: n,
|
|
780
|
+
vite: !0
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
return null;
|
|
784
|
+
}
|
|
785
|
+
function X(e) {
|
|
786
|
+
if (e in U) return U[e];
|
|
787
|
+
let t = nt(e);
|
|
788
|
+
return typeof t == "string" ? (U[e] = t, t) : null;
|
|
789
|
+
}
|
|
790
|
+
function ct(e) {
|
|
791
|
+
let t = X(e);
|
|
792
|
+
if (!t) return null;
|
|
793
|
+
let n = /\/\/[@#]\s*sourceMappingURL=([^\s'"]+)\s*$|\/\*[@#]\s*sourceMappingURL=[^\s*'"]+\s*\*\/\s*$/gm, r, i;
|
|
794
|
+
for (; i = n.exec(t);) r = i;
|
|
795
|
+
return r ? r[1] : null;
|
|
796
|
+
}
|
|
797
|
+
var lt = /^data:application\/json[^,]+base64,/;
|
|
798
|
+
function ut(e) {
|
|
799
|
+
let t = rt(e);
|
|
800
|
+
if (t) return t;
|
|
801
|
+
let n = ct(e);
|
|
802
|
+
if (!n) return null;
|
|
803
|
+
let r;
|
|
804
|
+
return lt.test(n) ? (r = w(n.slice(n.indexOf(",") + 1)), n = e) : (n = Y(e, n), r = X(n)), r ? {
|
|
805
|
+
url: n,
|
|
806
|
+
map: r
|
|
807
|
+
} : null;
|
|
808
|
+
}
|
|
809
|
+
function Z(e) {
|
|
810
|
+
if (!e.source) return e;
|
|
811
|
+
let t = st(e);
|
|
812
|
+
if (t ||= H[e.source], !t) {
|
|
813
|
+
let n = ut(e.source);
|
|
814
|
+
if (n && n.map) {
|
|
815
|
+
let r = n.url;
|
|
816
|
+
t = H[e.source] = {
|
|
817
|
+
url: r,
|
|
818
|
+
map: new k(typeof n.map == "string" ? JSON.parse(n.map) : n.map, r)
|
|
819
|
+
};
|
|
820
|
+
let i = t.map?.map.sourcesContent;
|
|
821
|
+
t.map && i && t.map.resolvedSources.forEach((e, t) => {
|
|
822
|
+
let n = i[t];
|
|
823
|
+
if (n && e && r) {
|
|
824
|
+
let t = Y(r, e);
|
|
825
|
+
U[t] = n;
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
} else t = H[e.source] = {
|
|
829
|
+
url: null,
|
|
830
|
+
map: null
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
if (t.map && t.url) {
|
|
834
|
+
let n = Pe(t.map, e);
|
|
835
|
+
if (n && n.source != null) return n.source = Y(t.url, n.source), t.vite && (n._vite = !0), n;
|
|
836
|
+
}
|
|
837
|
+
return e;
|
|
838
|
+
}
|
|
839
|
+
function Q(e) {
|
|
840
|
+
let t = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(e);
|
|
841
|
+
if (t) {
|
|
842
|
+
let e = Z({
|
|
843
|
+
name: null,
|
|
844
|
+
source: t[2],
|
|
845
|
+
line: +t[3],
|
|
846
|
+
column: t[4] - 1
|
|
847
|
+
});
|
|
848
|
+
return `eval at ${t[1]} (${e.source}:${e.line}:${e.column + 1})`;
|
|
849
|
+
}
|
|
850
|
+
return t = /^eval at ([^(]+) \((.+)\)$/.exec(e), t ? `eval at ${t[1]} (${Q(t[2])})` : e;
|
|
851
|
+
}
|
|
852
|
+
function dt() {
|
|
853
|
+
let e, t = "";
|
|
854
|
+
if (this.isNative()) t = "native";
|
|
855
|
+
else {
|
|
856
|
+
e = this.getScriptNameOrSourceURL(), !e && this.isEval() && (t = this.getEvalOrigin(), t += ", "), t += e || "<anonymous>";
|
|
857
|
+
let n = this.getLineNumber();
|
|
858
|
+
if (n != null) {
|
|
859
|
+
t += `:${n}`;
|
|
860
|
+
let e = this.getColumnNumber();
|
|
861
|
+
e && (t += `:${e}`);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
let n = "", r = this.getFunctionName(), i = !0, a = this.isConstructor();
|
|
865
|
+
if (this.isToplevel() || a) a ? n += `new ${r || "<anonymous>"}` : r ? n += r : (n += t, i = !1);
|
|
866
|
+
else {
|
|
867
|
+
let e = this.getTypeName();
|
|
868
|
+
e === "[object Object]" && (e = "null");
|
|
869
|
+
let t = this.getMethodName();
|
|
870
|
+
r ? (e && r.indexOf(e) !== 0 && (n += `${e}.`), n += r, t && r.indexOf(`.${t}`) !== r.length - t.length - 1 && (n += ` [as ${t}]`)) : n += `${e}.${t || "<anonymous>"}`;
|
|
871
|
+
}
|
|
872
|
+
return i && (n += ` (${t})`), n;
|
|
873
|
+
}
|
|
874
|
+
function $(e) {
|
|
875
|
+
let t = Object.create(null);
|
|
876
|
+
return Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((n) => {
|
|
877
|
+
let r = n;
|
|
878
|
+
t[r] = /^(?:is|get)/.test(n) ? function() {
|
|
879
|
+
return e[r].call(e);
|
|
880
|
+
} : e[r];
|
|
881
|
+
}), t.toString = dt, t;
|
|
882
|
+
}
|
|
883
|
+
function ft(e, t) {
|
|
884
|
+
if (t === void 0 && (t = {
|
|
885
|
+
nextPosition: null,
|
|
886
|
+
curPosition: null
|
|
887
|
+
}), e.isNative()) return t.curPosition = null, e;
|
|
888
|
+
let n = e.getFileName() || e.getScriptNameOrSourceURL();
|
|
889
|
+
if (n) {
|
|
890
|
+
let r = Z({
|
|
891
|
+
name: null,
|
|
892
|
+
source: n,
|
|
893
|
+
line: e.getLineNumber() ?? 0,
|
|
894
|
+
column: (e.getColumnNumber() ?? 1) - 1
|
|
895
|
+
});
|
|
896
|
+
t.curPosition = r, e = $(e);
|
|
897
|
+
let i = e.getFunctionName;
|
|
898
|
+
return e.getFunctionName = function() {
|
|
899
|
+
let e = t.nextPosition == null ? i() : t.nextPosition.name || i();
|
|
900
|
+
return e === "eval" && "_vite" in r ? null : e;
|
|
901
|
+
}, e.getFileName = function() {
|
|
902
|
+
return r.source ?? null;
|
|
903
|
+
}, e.getLineNumber = function() {
|
|
904
|
+
return r.line;
|
|
905
|
+
}, e.getColumnNumber = function() {
|
|
906
|
+
return r.column + 1;
|
|
907
|
+
}, e.getScriptNameOrSourceURL = function() {
|
|
908
|
+
return r.source;
|
|
909
|
+
}, e;
|
|
910
|
+
}
|
|
911
|
+
let r = e.isEval() && e.getEvalOrigin();
|
|
912
|
+
return r ? (r = Q(r), e = $(e), e.getEvalOrigin = function() {
|
|
913
|
+
return r || void 0;
|
|
914
|
+
}, e) : e;
|
|
915
|
+
}
|
|
916
|
+
function pt(e, t) {
|
|
917
|
+
let n = `${e.name || "Error"}: ${e.message || ""}`, r = {
|
|
918
|
+
nextPosition: null,
|
|
919
|
+
curPosition: null
|
|
920
|
+
}, i = [];
|
|
921
|
+
for (let e = t.length - 1; e >= 0; e--) i.push(`\n at ${ft(t[e], r)}`), r.nextPosition = r.curPosition;
|
|
922
|
+
return r.curPosition = r.nextPosition = null, n + i.reverse().join("");
|
|
923
|
+
}
|
|
924
|
+
function mt(e) {
|
|
925
|
+
if (e.options.sourcemapInterceptor === "node") {
|
|
926
|
+
if (typeof process > "u") throw TypeError("Cannot use \"sourcemapInterceptor: 'node'\" because global \"process\" variable is not available.");
|
|
927
|
+
if (typeof process.setSourceMapsEnabled != "function") throw TypeError("Cannot use \"sourcemapInterceptor: 'node'\" because \"process.setSourceMapsEnabled\" function is not available. Please use Node >= 16.6.0.");
|
|
928
|
+
let e = process.sourceMapsEnabled ?? !1;
|
|
929
|
+
return process.setSourceMapsEnabled(!0), () => !e && process.setSourceMapsEnabled(!1);
|
|
930
|
+
}
|
|
931
|
+
return ot(e, typeof e.options.sourcemapInterceptor == "object" ? e.options.sourcemapInterceptor : void 0);
|
|
932
|
+
}
|
|
933
|
+
var ht = class {
|
|
934
|
+
options;
|
|
935
|
+
evaluator;
|
|
936
|
+
debug;
|
|
937
|
+
evaluatedModules;
|
|
938
|
+
hmrClient;
|
|
939
|
+
transport;
|
|
940
|
+
resetSourceMapSupport;
|
|
941
|
+
concurrentModuleNodePromises = /* @__PURE__ */ new Map();
|
|
942
|
+
isBuiltin;
|
|
943
|
+
builtinsPromise;
|
|
944
|
+
closed = !1;
|
|
945
|
+
constructor(e, t = new z(), n) {
|
|
946
|
+
if (this.options = e, this.evaluator = t, this.debug = n, this.evaluatedModules = e.evaluatedModules ?? new Le(), this.transport = Ge(e.transport), e.hmr !== !1) {
|
|
947
|
+
let t = e.hmr ?? !0, n = t === !0 || t.logger === void 0 ? tt : t.logger === !1 ? et : t.logger;
|
|
948
|
+
if (this.hmrClient = new He(n, this.transport, ({ acceptedPath: e }) => this.import(e)), !this.transport.connect) throw Error("HMR is not supported by this runner transport, but `hmr` option was set to true");
|
|
949
|
+
this.transport.connect(Ze(this));
|
|
950
|
+
} else this.transport.connect?.();
|
|
951
|
+
e.sourcemapInterceptor !== !1 && (this.resetSourceMapSupport = mt(this));
|
|
952
|
+
}
|
|
953
|
+
async import(e) {
|
|
954
|
+
let t = await this.cachedModule(e);
|
|
955
|
+
return await this.cachedRequest(e, t);
|
|
956
|
+
}
|
|
957
|
+
clearCache() {
|
|
958
|
+
this.evaluatedModules.clear(), this.hmrClient?.clear();
|
|
959
|
+
}
|
|
960
|
+
async close() {
|
|
961
|
+
this.resetSourceMapSupport?.(), this.clearCache(), this.hmrClient = void 0, this.closed = !0, await this.transport.disconnect?.();
|
|
962
|
+
}
|
|
963
|
+
isClosed() {
|
|
964
|
+
return this.closed;
|
|
965
|
+
}
|
|
966
|
+
processImport(e, t, n) {
|
|
967
|
+
if (!("externalize" in t)) return e;
|
|
968
|
+
let { url: r, type: i } = t;
|
|
969
|
+
return i !== "module" && i !== "commonjs" || Ke(e, r, i, n), e;
|
|
970
|
+
}
|
|
971
|
+
isCircularRequest(e, t, n = /* @__PURE__ */ new Set()) {
|
|
972
|
+
if (n.has(e.id)) return !1;
|
|
973
|
+
n.add(e.id);
|
|
974
|
+
for (let r of e.imports) {
|
|
975
|
+
let e = this.evaluatedModules.getModuleById(r);
|
|
976
|
+
if (e?.promise && !e.evaluated && (t.includes(r) || this.isCircularRequest(e, t, n))) return !0;
|
|
977
|
+
}
|
|
978
|
+
return !1;
|
|
979
|
+
}
|
|
980
|
+
async cachedRequest(e, t, n = [], r) {
|
|
981
|
+
let i = t.meta, a = i.id, o = n.at(-1);
|
|
982
|
+
if (o && t.importers.add(o), t.evaluated && t.promise) return this.processImport(await t.promise, i, r);
|
|
983
|
+
if (t.promise) return t.exports && (n.includes(a) || this.isCircularRequest(t, n)) ? this.processImport(t.exports, i, r) : this.processImport(await t.promise, i, r);
|
|
984
|
+
let s;
|
|
985
|
+
this.debug && (s = setTimeout(() => {
|
|
986
|
+
this.debug(`[module runner] module ${a} takes over 2s to load.\n${`stack:\n${[...n, a].reverse().map((e) => ` - ${e}`).join("\n")}`}`);
|
|
987
|
+
}, 2e3));
|
|
988
|
+
try {
|
|
989
|
+
let a = this.directRequest(e, t, n);
|
|
990
|
+
return t.promise = a, t.evaluated = !1, this.processImport(await a, i, r);
|
|
991
|
+
} finally {
|
|
992
|
+
t.evaluated = !0, s && clearTimeout(s);
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
async cachedModule(e, t) {
|
|
996
|
+
let n = this.concurrentModuleNodePromises.get(e);
|
|
997
|
+
if (n) this.debug?.("[module runner] using cached module info for", e);
|
|
998
|
+
else {
|
|
999
|
+
let r = this.evaluatedModules.getModuleByUrl(e);
|
|
1000
|
+
n = this.getModuleInformation(e, t, r).finally(() => {
|
|
1001
|
+
this.concurrentModuleNodePromises.delete(e);
|
|
1002
|
+
}), this.concurrentModuleNodePromises.set(e, n);
|
|
1003
|
+
}
|
|
1004
|
+
return n;
|
|
1005
|
+
}
|
|
1006
|
+
ensureBuiltins() {
|
|
1007
|
+
if (!this.isBuiltin) return this.builtinsPromise ??= (async () => {
|
|
1008
|
+
try {
|
|
1009
|
+
this.debug?.("[module runner] fetching builtins from server");
|
|
1010
|
+
let e = (await this.transport.invoke("getBuiltins", [])).map((e) => typeof e == "object" && e && "type" in e ? e.type === "string" ? e.value : new RegExp(e.source, e.flags) : e);
|
|
1011
|
+
this.isBuiltin = Be(e), this.debug?.("[module runner] builtins loaded:", e);
|
|
1012
|
+
} finally {
|
|
1013
|
+
this.builtinsPromise = void 0;
|
|
1014
|
+
}
|
|
1015
|
+
})(), this.builtinsPromise;
|
|
1016
|
+
}
|
|
1017
|
+
async getModuleInformation(e, t, n) {
|
|
1018
|
+
if (this.closed) throw Error("Vite module runner has been closed.");
|
|
1019
|
+
await this.ensureBuiltins(), this.debug?.("[module runner] fetching", e);
|
|
1020
|
+
let r = !!(typeof n == "object" && n.meta), i = e.startsWith("data:") || this.isBuiltin?.(e) ? {
|
|
1021
|
+
externalize: e,
|
|
1022
|
+
type: "builtin"
|
|
1023
|
+
} : await this.transport.invoke("fetchModule", [
|
|
1024
|
+
e,
|
|
1025
|
+
t,
|
|
1026
|
+
{
|
|
1027
|
+
cached: r,
|
|
1028
|
+
startOffset: this.evaluator.startOffset
|
|
1029
|
+
}
|
|
1030
|
+
]);
|
|
1031
|
+
if ("cache" in i) {
|
|
1032
|
+
if (!n || !n.meta) throw Error(`Module "${e}" was mistakenly invalidated during fetch phase.`);
|
|
1033
|
+
return n;
|
|
1034
|
+
}
|
|
1035
|
+
let a = "externalize" in i ? i.externalize : i.id, o = "url" in i ? i.url : e, s = this.evaluatedModules.ensureModule(a, o);
|
|
1036
|
+
return "invalidate" in i && i.invalidate && this.evaluatedModules.invalidateModule(s), i.url = o, i.id = a, s.meta = i, s;
|
|
1037
|
+
}
|
|
1038
|
+
async directRequest(e, t, n) {
|
|
1039
|
+
let r = t.meta, i = r.id, a = [...n, i], s = async (e, n) => {
|
|
1040
|
+
let o = "file" in r && r.file || i, s = await this.cachedModule(e, o);
|
|
1041
|
+
return s.importers.add(i), t.imports.add(s.id), this.cachedRequest(e, s, a, n);
|
|
1042
|
+
}, c = async (t) => (t = String(t), t[0] === "." && (t = E(T(e), t)), s(t, { isDynamicImport: !0 }));
|
|
1043
|
+
if ("externalize" in r) {
|
|
1044
|
+
let { externalize: e } = r;
|
|
1045
|
+
this.debug?.("[module runner] externalizing", e);
|
|
1046
|
+
let n = await this.evaluator.runExternalModule(e);
|
|
1047
|
+
return t.exports = n, n;
|
|
1048
|
+
}
|
|
1049
|
+
let { code: l, file: u } = r;
|
|
1050
|
+
if (l == null) {
|
|
1051
|
+
let t = a[a.length - 2];
|
|
1052
|
+
throw Error(`[module runner] Failed to load "${e}"${t ? ` imported from ${t}` : ""}`);
|
|
1053
|
+
}
|
|
1054
|
+
let d = this.options.createImportMeta ?? Je, f = o(u || i), p = D(f), m = await d(f), h = Object.create(null);
|
|
1055
|
+
Object.defineProperty(h, Symbol.toStringTag, {
|
|
1056
|
+
value: "Module",
|
|
1057
|
+
enumerable: !1,
|
|
1058
|
+
configurable: !1
|
|
1059
|
+
}), t.exports = h;
|
|
1060
|
+
let g;
|
|
1061
|
+
this.hmrClient && Object.defineProperty(m, "hot", {
|
|
1062
|
+
enumerable: !0,
|
|
1063
|
+
get: () => {
|
|
1064
|
+
if (!this.hmrClient) throw Error("[module runner] HMR client was closed.");
|
|
1065
|
+
return this.debug?.("[module runner] creating hmr context for", t.url), g ||= new Ve(this.hmrClient, t.url), g;
|
|
1066
|
+
},
|
|
1067
|
+
set: (e) => {
|
|
1068
|
+
g = e;
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
let _ = {
|
|
1072
|
+
[N]: s,
|
|
1073
|
+
[P]: c,
|
|
1074
|
+
[M]: h,
|
|
1075
|
+
[F]: (e) => gt(h, e),
|
|
1076
|
+
[I]: (e, t) => Object.defineProperty(h, e, {
|
|
1077
|
+
enumerable: !0,
|
|
1078
|
+
configurable: !0,
|
|
1079
|
+
get: t
|
|
1080
|
+
}),
|
|
1081
|
+
[L]: m
|
|
1082
|
+
};
|
|
1083
|
+
return this.debug?.("[module runner] executing", p), await this.evaluator.runInlinedModule(_, l, t), h;
|
|
1084
|
+
}
|
|
1085
|
+
};
|
|
1086
|
+
function gt(e, t) {
|
|
1087
|
+
if (e !== t && !(s(t) || Array.isArray(t) || t instanceof Promise)) {
|
|
1088
|
+
for (let n in t) if (n !== "default" && n !== "__esModule" && !(n in e)) try {
|
|
1089
|
+
Object.defineProperty(e, n, {
|
|
1090
|
+
enumerable: !0,
|
|
1091
|
+
configurable: !0,
|
|
1092
|
+
get: () => t[n]
|
|
1093
|
+
});
|
|
1094
|
+
} catch {}
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
//#endregion
|
|
1098
|
+
//#region src/adapter/vite/runtime/index.mts
|
|
1099
|
+
function _t() {
|
|
1100
|
+
return {
|
|
1101
|
+
connect({ onMessage: e }) {
|
|
1102
|
+
let t = globalThis.__inca_dev__;
|
|
1103
|
+
if (!t) throw Error("__inca_dev__ is not installed — this build is not a dev build");
|
|
1104
|
+
t.receive = (t, n) => {
|
|
1105
|
+
t === "vite" && e(JSON.parse(n));
|
|
1106
|
+
};
|
|
1107
|
+
},
|
|
1108
|
+
send(e) {
|
|
1109
|
+
let t = globalThis.__inca_dev__;
|
|
1110
|
+
if (!t) throw Error("__inca_dev__ is not installed — this build is not a dev build");
|
|
1111
|
+
t.send("vite", JSON.stringify(e));
|
|
1112
|
+
}
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
function vt(e) {
|
|
1116
|
+
return new ht({
|
|
1117
|
+
transport: {
|
|
1118
|
+
..._t(),
|
|
1119
|
+
timeout: 0
|
|
1120
|
+
},
|
|
1121
|
+
hmr: { logger: {
|
|
1122
|
+
debug: () => {},
|
|
1123
|
+
error: () => {}
|
|
1124
|
+
} },
|
|
1125
|
+
sourcemapInterceptor: !1
|
|
1126
|
+
}, new z()).import(e);
|
|
1127
|
+
}
|
|
1128
|
+
//#endregion
|
|
1129
|
+
export { _t as createIncaDevTransport, vt as start };
|