@incajs/cli 0.0.21 → 0.0.23

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.
Files changed (69) hide show
  1. package/README.md +5 -6
  2. package/dist/chunks/_format-CFy6_BQd.js +1 -0
  3. package/dist/chunks/defaults-DfHXv1fN.js +1 -0
  4. package/dist/chunks/dist-B-B_PlmU.js +1 -0
  5. package/dist/chunks/dist-BTWvruNB.js +1 -0
  6. package/dist/chunks/json5-BcF68iGq.js +14 -0
  7. package/dist/chunks/jsonc-DJWoCi14.js +4 -0
  8. package/dist/chunks/ohash-DUMW2FP0.js +1 -0
  9. package/dist/chunks/rolldown-runtime-DT7IzrpZ.js +1 -0
  10. package/dist/chunks/toml-n3nLqi2g.js +5 -0
  11. package/dist/chunks/types-Dz2aIWaI.d.ts +84 -0
  12. package/dist/chunks/yaml-DtBxpt6z.js +38 -0
  13. package/dist/{cli.d.mts → cli.d.ts} +1 -1
  14. package/dist/cli.js +22 -2181
  15. package/dist/config.d.ts +35 -0
  16. package/dist/config.js +1 -5
  17. package/dist/index.d.ts +27 -0
  18. package/dist/index.js +1 -0
  19. package/dist/vite-runtime.d.ts +28 -0
  20. package/dist/vite-runtime.js +7 -1179
  21. package/package.json +8 -26
  22. package/dist/adapterCore.d.mts +0 -11
  23. package/dist/build.d.mts +0 -28
  24. package/dist/chunks/__vite-optional-peer-dep_dotenv_c12-CxKvRg9-.js +0 -3
  25. package/dist/chunks/__vite-optional-peer-dep_giget_c12-BYcrHYBM.js +0 -5
  26. package/dist/chunks/__vite-optional-peer-dep_jiti_c12-DZVJNj6v.js +0 -5
  27. package/dist/chunks/_format-BKs7bsc4.js +0 -98
  28. package/dist/chunks/defaults-Ct95BSBl.js +0 -23
  29. package/dist/chunks/dist-C64iuQVW.js +0 -730
  30. package/dist/chunks/dist-DrnNGO2a.js +0 -114
  31. package/dist/chunks/json5-RapVXICN.js +0 -711
  32. package/dist/chunks/jsonc-BDHXk_1o.js +0 -40
  33. package/dist/chunks/ohash-Cc4pJh84.js +0 -231
  34. package/dist/chunks/rolldown-runtime-Dy4uBu1J.js +0 -11
  35. package/dist/chunks/toml-CgS7wGvD.js +0 -416
  36. package/dist/chunks/yaml-U_oPOIGK.js +0 -2123
  37. package/dist/config/defaults.d.mts +0 -45
  38. package/dist/config/index.d.mts +0 -18
  39. package/dist/config/loader.d.mts +0 -82
  40. package/dist/config/types.d.mts +0 -73
  41. package/dist/defaultBundler.d.mts +0 -7
  42. package/dist/dev-client/hostBin.d.mts +0 -15
  43. package/dist/dev-client/hostClient.d.mts +0 -70
  44. package/dist/dev-client/hostError.d.mts +0 -6
  45. package/dist/dev-client/index.d.mts +0 -4
  46. package/dist/dev-client/protocol.d.mts +0 -39
  47. package/dist/dev.d.mts +0 -45
  48. package/dist/devLock.d.mts +0 -11
  49. package/dist/entry.d.mts +0 -23
  50. package/dist/error.d.mts +0 -15
  51. package/dist/index.d.mts +0 -1
  52. package/dist/log.d.mts +0 -36
  53. package/dist/macosApp.d.mts +0 -47
  54. package/dist/package.d.mts +0 -50
  55. package/dist/plist.d.mts +0 -4
  56. package/dist/printConfig.d.mts +0 -20
  57. package/dist/retryOnEdit.d.mts +0 -32
  58. package/dist/types.d.mts +0 -136
  59. package/dist/vite/build.d.mts +0 -6
  60. package/dist/vite/captureOutput.d.mts +0 -17
  61. package/dist/vite/config.d.mts +0 -45
  62. package/dist/vite/createBundler.d.mts +0 -7
  63. package/dist/vite/emitConfig.d.mts +0 -17
  64. package/dist/vite/hmr.d.mts +0 -37
  65. package/dist/vite/index.d.mts +0 -1
  66. package/dist/vite/logger.d.mts +0 -8
  67. package/dist/vite/unsupported.d.mts +0 -24
  68. package/dist/vite/watch.d.mts +0 -7
  69. package/dist/watchForEdit.d.mts +0 -27
@@ -1,40 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { n as t, t as n } from "./_format-BKs7bsc4.js";
3
- //#region ../../node_modules/.pnpm/confbox@0.3.1/node_modules/confbox/dist/_chunks/libs/strip-json-comments.mjs
4
- var r = Symbol("singleComment"), i = Symbol("multiComment"), a = () => "", o = (e, t, n) => e.slice(t, n).replace(/[^ \t\r\n]/g, " "), s = (e, t) => {
5
- let n = t - 1, r = 0;
6
- for (; e[n] === "\\";) --n, r += 1;
7
- return !!(r % 2);
8
- };
9
- function c(e, { whitespace: t = !0, trailingCommas: n = !1 } = {}) {
10
- if (typeof e != "string") throw TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof e}\``);
11
- let c = t ? o : a, l = !1, u = !1, d = 0, f = "", p = "", m = -1;
12
- for (let t = 0; t < e.length; t++) {
13
- let a = e[t], o = e[t + 1];
14
- if (!u && a === "\"" && (s(e, t) || (l = !l)), !l) {
15
- if (!u && a + o === "//") f += e.slice(d, t), d = t, u = r, t++;
16
- else if (u === r && a + o === "\r\n") {
17
- t++, u = !1, f += c(e, d, t), d = t;
18
- continue;
19
- } else if (u === r && a === "\n") u = !1, f += c(e, d, t), d = t;
20
- else if (!u && a + o === "/*") {
21
- f += e.slice(d, t), d = t, u = i, t++;
22
- continue;
23
- } else if (u === i && a + o === "*/") {
24
- t++, u = !1, f += c(e, d, t + 1), d = t + 1;
25
- continue;
26
- } else n && !u && (m === -1 ? a === "," && (p += f + e.slice(d, t), f = "", d = t, m = t) : a === "}" || a === "]" ? (f += e.slice(d, t), p += c(f, 0, 1) + f.slice(1), f = "", d = t, m = -1) : a !== " " && a !== " " && a !== "\r" && a !== "\n" && (f += e.slice(d, t), d = t, m = -1));
27
- }
28
- }
29
- let h = u === r ? c(e, d) : e.slice(d);
30
- return p + f + h;
31
- }
32
- //#endregion
33
- //#region ../../node_modules/.pnpm/confbox@0.3.1/node_modules/confbox/dist/jsonc.mjs
34
- var l = /* @__PURE__ */ e({ parseJSONC: () => u });
35
- function u(e, r) {
36
- let i = JSON.parse(c(n(e), { trailingCommas: r?.allowTrailingComma }));
37
- return t(e, i, r), i;
38
- }
39
- //#endregion
40
- export { l as n, u as t };
@@ -1,231 +0,0 @@
1
- import { createHash as e } from "node:crypto";
2
- //#region ../../node_modules/.pnpm/c12@4.0.0-rc.2_magicast@0.5.4/node_modules/c12/dist/_chunks/libs/ohash.mjs
3
- var t = Object.defineProperty, n = (e, n) => {
4
- let r = {};
5
- for (var i in e) t(r, i, {
6
- get: e[i],
7
- enumerable: !0
8
- });
9
- return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
10
- };
11
- function r(e) {
12
- return typeof e == "string" ? `'${e}'` : new s().serialize(e);
13
- }
14
- var i = " _-,;:!?.'\"()[]{}@*/\\&#%`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz", a = /*@__PURE__*/ (function() {
15
- let e = /* @__PURE__ */ new Uint8Array(128);
16
- for (let t = 0; t < 69; t++) e[i.charCodeAt(t)] = t + 1;
17
- for (let t = 65; t <= 90; t++) e[t] = e[t + 32];
18
- return e;
19
- })();
20
- function o(e, t) {
21
- if (e === t) return 0;
22
- let n = Math.min(e.length, t.length), r = 0;
23
- for (let i = 0; i < n; i++) {
24
- let n = e.charCodeAt(i), o = t.charCodeAt(i);
25
- if (n === o) continue;
26
- let s = n < 128 && a[n] ? a[n] : n + 128, c = o < 128 && a[o] ? a[o] : o + 128;
27
- if (s !== c) return s < c ? -1 : 1;
28
- r === 0 && (r = n > o ? -1 : 1);
29
- }
30
- return e.length === t.length ? r : e.length < t.length ? -1 : 1;
31
- }
32
- var s = /*@__PURE__*/ (function() {
33
- class e {
34
- #e = /* @__PURE__ */ new Map();
35
- compare(e, t) {
36
- let n = typeof e, r = typeof t;
37
- return n === "string" && r === "string" ? o(e, t) : n === "number" && r === "number" ? e - t : o(this.serialize(e, !0), this.serialize(t, !0));
38
- }
39
- serialize(e, t) {
40
- if (e === null) return "null";
41
- switch (typeof e) {
42
- case "string": return t ? e : `'${e}'`;
43
- case "bigint": return `${e}n`;
44
- case "object": return this.$object(e);
45
- case "function": return this.$function(e);
46
- }
47
- return String(e);
48
- }
49
- serializeObject(e) {
50
- let t = Object.prototype.toString.call(e);
51
- if (t !== "[object Object]") return this.serializeBuiltInType(t.length < 10 ? `unknown:${t}` : t.slice(8, -1), e);
52
- let n = e.constructor, r = n === Object || n === void 0 ? "" : n.name;
53
- if (r !== "" && globalThis[r] === n) return this.serializeBuiltInType(r, e);
54
- if ("toJSON" in e && typeof e.toJSON == "function") {
55
- let t = e.toJSON();
56
- return r + (typeof t == "object" && t ? this.$object(t) : `(${this.serialize(t)})`);
57
- }
58
- let i = Object.keys(e).sort(o), a = `${r}{`;
59
- for (let t = 0; t < i.length; t++) {
60
- let n = i[t];
61
- a += `${n}:${this.serialize(e[n])}`, t < i.length - 1 && (a += ",");
62
- }
63
- return a + "}";
64
- }
65
- serializeBuiltInType(e, t) {
66
- let n = this["$" + e];
67
- if (n) return n.call(this, t);
68
- if (typeof t.entries == "function") return this.serializeObjectEntries(e, t.entries());
69
- throw Error(`Cannot serialize ${e}`);
70
- }
71
- serializeObjectEntries(e, t) {
72
- let n = Array.from(t).sort((e, t) => this.compare(e[0], t[0])), r = `${e}{`;
73
- for (let e = 0; e < n.length; e++) {
74
- let [t, i] = n[e];
75
- r += `${this.serialize(t, !0)}:${this.serialize(i)}`, e < n.length - 1 && (r += ",");
76
- }
77
- return r + "}";
78
- }
79
- $object(e) {
80
- let t = this.#e.get(e);
81
- return t === void 0 && (this.#e.set(e, `#${this.#e.size}`), t = this.serializeObject(e), this.#e.set(e, t)), t;
82
- }
83
- $function(e) {
84
- let t = Function.prototype.toString.call(e);
85
- return t.slice(-15) === "[native code] }" ? `${e.name || ""}()[native]` : `${e.name}(${e.length})${t.replace(/\s*\n\s*/g, "")}`;
86
- }
87
- $Array(e) {
88
- let t = "[";
89
- for (let n = 0; n < e.length; n++) t += this.serialize(e[n]), n < e.length - 1 && (t += ",");
90
- return t + "]";
91
- }
92
- $Date(e) {
93
- try {
94
- return `Date(${e.toISOString()})`;
95
- } catch {
96
- return "Date(null)";
97
- }
98
- }
99
- $ArrayBuffer(e) {
100
- return `ArrayBuffer[${new Uint8Array(e).join(",")}]`;
101
- }
102
- $Set(e) {
103
- return `Set${this.$Array(Array.from(e).sort((e, t) => this.compare(e, t)))}`;
104
- }
105
- $Map(e) {
106
- return this.serializeObjectEntries("Map", e.entries());
107
- }
108
- }
109
- for (let t of [
110
- "Error",
111
- "RegExp",
112
- "URL"
113
- ]) e.prototype["$" + t] = function(e) {
114
- return `${t}(${e})`;
115
- };
116
- for (let t of [
117
- "Int8Array",
118
- "Uint8Array",
119
- "Uint8ClampedArray",
120
- "Int16Array",
121
- "Uint16Array",
122
- "Int32Array",
123
- "Uint32Array",
124
- "Float32Array",
125
- "Float64Array"
126
- ]) e.prototype["$" + t] = function(e) {
127
- return `${t}[${e.join(",")}]`;
128
- };
129
- for (let t of ["BigInt64Array", "BigUint64Array"]) e.prototype["$" + t] = function(e) {
130
- return `${t}[${e.join("n,")}${e.length > 0 ? "n" : ""}]`;
131
- };
132
- return e;
133
- })(), c = globalThis.process?.getBuiltinModule?.("crypto")?.hash, l = "sha256", u = "base64url";
134
- function d(t) {
135
- if (c) return c(l, t, u);
136
- let n = e(l).update(t);
137
- return globalThis.process?.versions?.webcontainer ? n.digest().toString(u) : n.digest(u);
138
- }
139
- var f = /* @__PURE__ */ n({ digest: () => d }), p = /* @__PURE__ */ n({ diff: () => h }), m = "__proto__";
140
- function h(e, t) {
141
- let n = [];
142
- return g(e, t, "", n), n;
143
- }
144
- function g(e, t, n, r) {
145
- if (e === t) return;
146
- let i = typeof e != "object" || !e, a = typeof t != "object" || !t;
147
- if (!i && !a) {
148
- let i = _(e), a = _(t);
149
- for (let [e, t] of i) {
150
- let i = n ? `${n}.${e}` : e;
151
- a.has(e) ? g(t, a.get(e), i, r) : r.push(new S(i, "removed", void 0, b(t, i)));
152
- }
153
- for (let [e, t] of a) {
154
- if (i.has(e)) continue;
155
- let a = n ? `${n}.${e}` : e;
156
- r.push(new S(a, "added", b(t, a)));
157
- }
158
- return;
159
- }
160
- if (v(e, i) || v(t, a)) return;
161
- let o = y(e, n, i), s = y(t, n, a);
162
- o.hash !== s.hash && r.push(new S(n, "changed", s, o));
163
- }
164
- function _(e) {
165
- let t = /* @__PURE__ */ new Map();
166
- for (let n in e) n !== m && t.set(n, e[n]);
167
- return t;
168
- }
169
- function v(e, t) {
170
- if (t) return !1;
171
- for (let t in e) if (t !== m) return !0;
172
- return !1;
173
- }
174
- function y(e, t, n) {
175
- return n ? new C(t, e, x(e)) : new C(t, e, "{}", Object.create(null));
176
- }
177
- function b(e, t = "") {
178
- if (typeof e != "object" || !e) return new C(t, e, x(e));
179
- let n = Object.create(null), r = [];
180
- for (let i in e) {
181
- if (i === m) continue;
182
- let a = b(e[i], t ? `${t}.${i}` : i);
183
- n[i] = a, r.push(a.hash);
184
- }
185
- return new C(t, e, `{${r.join(":")}}`, n);
186
- }
187
- function x(e) {
188
- switch (typeof e) {
189
- case "string": return `'${e}'`;
190
- case "number":
191
- case "boolean": return "" + e;
192
- case "bigint": return `${e}n`;
193
- default: return r(e);
194
- }
195
- }
196
- var S = class {
197
- key;
198
- type;
199
- newValue;
200
- oldValue;
201
- constructor(e, t, n, r) {
202
- this.key = e, this.type = t, this.newValue = n, this.oldValue = r;
203
- }
204
- toString() {
205
- return this.toJSON();
206
- }
207
- toJSON() {
208
- switch (this.type) {
209
- case "added": return `Added \`${this.key}\``;
210
- case "removed": return `Removed \`${this.key}\``;
211
- case "changed": return `Changed \`${this.key}\` from \`${this.oldValue?.toString() || "-"}\` to \`${this.newValue?.toString()}\``;
212
- }
213
- }
214
- }, C = class {
215
- key;
216
- value;
217
- hash;
218
- props;
219
- constructor(e, t, n, r) {
220
- this.key = e, this.value = t, this.hash = n, this.props = r;
221
- }
222
- toString() {
223
- return this.props ? `{${Object.keys(this.props).join(",")}}` : JSON.stringify(this.value);
224
- }
225
- toJSON() {
226
- let e = this.key || ".";
227
- return this.props ? `${e}({${Object.keys(this.props).join(",")}})` : `${e}(${this.value})`;
228
- }
229
- };
230
- //#endregion
231
- export { f as dist_exports, p as utils_exports };
@@ -1,11 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var e = Object.defineProperty, t = (t, n) => {
3
- let r = {};
4
- for (var i in t) e(r, i, {
5
- get: t[i],
6
- enumerable: !0
7
- });
8
- return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
9
- };
10
- //#endregion
11
- export { t };
@@ -1,416 +0,0 @@
1
- import { n as e, t } from "./_format-BKs7bsc4.js";
2
- //#region ../../node_modules/.pnpm/confbox@0.3.1/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs
3
- var n = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i, r = class e extends Date {
4
- #e = !1;
5
- #t = !1;
6
- #n = null;
7
- constructor(e) {
8
- let t = !0, r = !0, i = "Z";
9
- if (typeof e == "string") {
10
- let a = e.match(n);
11
- a ? (a[1] || (t = !1, e = `0000-01-01T${e}`), r = !!a[2], r && e[10] === " " && (e = e.replace(" ", "T")), a[2] && +a[2] > 23 ? e = "" : (i = a[3] || null, e = e.toUpperCase(), !i && r && (e += "Z"))) : e = "";
12
- }
13
- super(e), isNaN(this.getTime()) || (this.#e = t, this.#t = r, this.#n = i);
14
- }
15
- isDateTime() {
16
- return this.#e && this.#t;
17
- }
18
- isLocal() {
19
- return !this.#e || !this.#t || !this.#n;
20
- }
21
- isDate() {
22
- return this.#e && !this.#t;
23
- }
24
- isTime() {
25
- return this.#t && !this.#e;
26
- }
27
- isValid() {
28
- return this.#e || this.#t;
29
- }
30
- toISOString() {
31
- let e = super.toISOString();
32
- if (this.isDate()) return e.slice(0, 10);
33
- if (this.isTime()) return e.slice(11, 23);
34
- if (this.#n === null) return e.slice(0, -1);
35
- if (this.#n === "Z") return e;
36
- let t = this.#n.slice(1, 3) * 60 + +this.#n.slice(4, 6);
37
- return t = this.#n[0] === "-" ? t : -t, (/* @__PURE__ */ new Date(this.getTime() - t * 6e4)).toISOString().slice(0, -1) + this.#n;
38
- }
39
- static wrapAsOffsetDateTime(t, n = "Z") {
40
- let r = new e(t);
41
- return r.#n = n, r;
42
- }
43
- static wrapAsLocalDateTime(t) {
44
- let n = new e(t);
45
- return n.#n = null, n;
46
- }
47
- static wrapAsLocalDate(t) {
48
- let n = new e(t);
49
- return n.#t = !1, n.#n = null, n;
50
- }
51
- static wrapAsLocalTime(t) {
52
- let n = new e(t);
53
- return n.#e = !1, n.#n = null, n;
54
- }
55
- };
56
- function i(e, t) {
57
- let n = e.slice(0, t).split(/\r\n|\n|\r/g);
58
- return [n.length, n.pop().length + 1];
59
- }
60
- function a(e, t, n) {
61
- let r = e.split(/\r\n|\n|\r/g), i = "", a = (Math.log10(t + 1) | 0) + 1;
62
- for (let e = t - 1; e <= t + 1; e++) {
63
- let o = r[e - 1];
64
- o && (i += e.toString().padEnd(a, " "), i += ": ", i += o, i += "\n", e === t && (i += " ".repeat(a + n + 2), i += "^\n"));
65
- }
66
- return i;
67
- }
68
- var o = class extends Error {
69
- line;
70
- column;
71
- codeblock;
72
- constructor(e, t) {
73
- let [n, r] = i(t.toml, t.ptr), o = a(t.toml, n, r);
74
- super(`Invalid TOML document: ${e}\n\n${o}`, t), this.line = n, this.column = r, this.codeblock = o;
75
- }
76
- };
77
- function s(e, t = 0) {
78
- let n = e.indexOf("\n", t);
79
- return e.charCodeAt(n - 1) === 13 && n--, n;
80
- }
81
- function c(e) {
82
- for (; e.p < e.s.length; e.p++) {
83
- let t = e.s.charCodeAt(e.p);
84
- if (t === 10) break;
85
- if (t === 13 && e.s.charCodeAt(e.p + 1) === 10) {
86
- e.p++;
87
- break;
88
- }
89
- if (t < 32 && t !== 9 || t === 127) throw new o("control characters are not allowed in comments", {
90
- toml: e.s,
91
- ptr: e.p
92
- });
93
- }
94
- }
95
- function l(e, t, n) {
96
- let r;
97
- for (;;) {
98
- for (; (r = e.s.charCodeAt(e.p)) === 32 || r === 9 || !t && (r === 10 || r === 13 && e.s.charCodeAt(e.p + 1) === 10);) e.p++;
99
- if (n || r !== 35) break;
100
- c(e);
101
- }
102
- }
103
- function u(e, t, n) {
104
- let r = e.p;
105
- if (!n) r = s(e.s, r), e.p = r < 0 ? e.s.length : r;
106
- else {
107
- for (; e.p < e.s.length; e.p++) {
108
- let r = e.s.charCodeAt(e.p);
109
- if (r === 35) c(e);
110
- else if (r === n || r === t) return;
111
- }
112
- throw new o("cannot find end of structure", {
113
- toml: e.s,
114
- ptr: r
115
- });
116
- }
117
- }
118
- var d = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/, f = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/, p = /^[+-]?0[0-9_]/;
119
- function m(e) {
120
- let t = e.p, n = e.s.charCodeAt(e.p++), r = n, i = n === 39, a = n === e.s.charCodeAt(e.p) && n === e.s.charCodeAt(e.p + 1);
121
- a && ((n = e.s.charCodeAt(e.p += 2)) === 10 ? e.p++ : n === 13 && e.s.charCodeAt(e.p + 1) === 10 && (e.p += 2));
122
- let s = "", c = e.p, l = 0;
123
- for (; e.p < e.s.length; e.p++) if (n = e.s.charCodeAt(e.p), a && (n === 10 || n === 13 && e.s.charCodeAt(e.p + 1) === 10)) l &&= 3;
124
- else if (n < 32 && n !== 9 || n === 127) throw new o("control characters are not allowed in strings", {
125
- toml: e.s,
126
- ptr: e.p
127
- });
128
- else if ((!l || l === 3) && n === r && (!a || e.s.charCodeAt(e.p + 1) === r && e.s.charCodeAt(e.p + 2) === r)) return a && (e.s.charCodeAt(e.p + 3) === r && e.p++, e.s.charCodeAt(e.p + 3) === r && e.p++), l || (s += e.s.slice(c, e.p)), e.p += a ? 3 : 1, s;
129
- else if (!l) !i && n === 92 && (s += e.s.slice(c, c = e.p), l = 1);
130
- else if (l === 1) {
131
- if (n === 120 || n === 117 || n === 85) {
132
- let t = 0, r = n === 120 ? 2 : n === 117 ? 4 : 8;
133
- for (let n = 0; n < r; n++, e.p++) {
134
- let n = e.s.charCodeAt(e.p + 1), r = n >= 48 && n <= 57 ? n - 48 : n >= 65 && n <= 70 ? n - 65 + 10 : n >= 97 && n <= 102 ? n - 97 + 10 : -1;
135
- if (r < 0) throw new o("invalid non-hex character in unicode escape", {
136
- toml: e.s,
137
- ptr: e.p + 1
138
- });
139
- t = t << 4 | r;
140
- }
141
- if (t < 0 || t > 1114111 || t >= 55296 && t <= 57343) throw new o("invalid unicode escape", {
142
- toml: e.s,
143
- ptr: e.p
144
- });
145
- s += String.fromCodePoint(t), c = e.p + 1, l = 0;
146
- } else if (n === 32 || n === 9) l = 2;
147
- else {
148
- if (n === 98) s += "\b";
149
- else if (n === 116) s += " ";
150
- else if (n === 110) s += "\n";
151
- else if (n === 102) s += "\f";
152
- else if (n === 114) s += "\r";
153
- else if (n === 101) s += "\x1B";
154
- else if (n === 34) s += "\"";
155
- else if (n === 92) s += "\\";
156
- else throw new o("unrecognized escape sequence", {
157
- toml: e.s,
158
- ptr: e.p
159
- });
160
- c = e.p + 1, l = 0;
161
- }
162
- } else if (n !== 32 && n !== 9) {
163
- if (l === 2) throw new o("invalid escape: only line-ending whitespace may be escaped", {
164
- toml: e.s,
165
- ptr: c
166
- });
167
- l = +(!i && n === 92), c = e.p;
168
- }
169
- throw new o("unfinished string", {
170
- toml: e.s,
171
- ptr: t
172
- });
173
- }
174
- function h(e, t, n) {
175
- let r = e.s.slice(t, n), i = r.indexOf("#");
176
- return i > 0 && (c({
177
- s: r,
178
- p: i,
179
- d: 0
180
- }), r = r.slice(0, i)), r.trimEnd();
181
- }
182
- function g(e, t, n) {
183
- let i = e.p, a = {
184
- toml: e.s,
185
- ptr: i
186
- };
187
- u(e, 44, n);
188
- let s = h(e, i, e.p);
189
- if (!s) throw new o("incomplete declaration: value expected", a);
190
- if (s === "-inf") return -1 / 0;
191
- if (s === "inf" || s === "+inf") return 1 / 0;
192
- if (s === "nan" || s === "+nan" || s === "-nan") return NaN;
193
- if (s === "-0") return t ? 0n : 0;
194
- let c = d.test(s);
195
- if (c || f.test(s)) {
196
- if (p.test(s)) throw new o("leading zeroes are not allowed", a);
197
- s = s.replace(/_/g, "");
198
- let e = +s;
199
- if (isNaN(e)) throw new o("invalid number", a);
200
- if (c) {
201
- if ((c = !Number.isSafeInteger(e)) && !t) throw new o("integer value cannot be represented losslessly", a);
202
- (c || t === !0) && (e = BigInt(s));
203
- }
204
- return e;
205
- }
206
- let l = new r(s);
207
- if (!l.isValid()) throw new o("invalid value", a);
208
- return l;
209
- }
210
- function _(e, t, n) {
211
- let r = e.p, i = e.s.charCodeAt(r);
212
- if (i === 91 || i === 123) {
213
- if (!e.d--) throw new o("document contains excessively nested structures. aborting.", {
214
- toml: e.s,
215
- ptr: r
216
- });
217
- let t = i === 91 ? x(e, n) : b(e, n);
218
- return e.d++, t;
219
- }
220
- if (i === 34 || i === 39) return m(e);
221
- if (i === 116) {
222
- if (e.s.charCodeAt(++e.p) !== 114 || e.s.charCodeAt(++e.p) !== 117 || e.s.charCodeAt(++e.p) !== 101) throw new o("invalid value", {
223
- toml: e.s,
224
- ptr: r
225
- });
226
- return e.p++, !0;
227
- }
228
- if (i === 102) {
229
- if (e.s.charCodeAt(++e.p) !== 97 || e.s.charCodeAt(++e.p) !== 108 || e.s.charCodeAt(++e.p) !== 115 || e.s.charCodeAt(++e.p) !== 101) throw new o("invalid value", {
230
- toml: e.s,
231
- ptr: r
232
- });
233
- return e.p++, !1;
234
- }
235
- return g(e, n, t);
236
- }
237
- var v = /^[a-zA-Z0-9-_]+[ \t]*$/;
238
- function y(e, t = "=") {
239
- let n = e.p, r = n - 1, i = [], a = e.s.indexOf(t, n);
240
- if (a < 0) throw new o("incomplete key-value: cannot find end of key", {
241
- toml: e.s,
242
- ptr: n
243
- });
244
- do {
245
- let c = e.s.charCodeAt(e.p = ++r);
246
- if (c !== 32 && c !== 9) {
247
- if (c === 34 || c === 39) {
248
- if (c === e.s.charCodeAt(e.p + 1) && c === e.s.charCodeAt(e.p + 2)) throw new o("multiline strings are not allowed in keys", {
249
- toml: e.s,
250
- ptr: e.p
251
- });
252
- let l = m(e);
253
- r = e.s.indexOf(".", e.p);
254
- let u = e.s.slice(e.p, r < 0 || r > a ? a : r), d = s(u);
255
- if (d > -1) throw new o("newlines are not allowed in keys", {
256
- toml: e.s,
257
- ptr: d
258
- });
259
- if (u.trimStart()) throw new o("found extra tokens after the string part", {
260
- toml: e.s,
261
- ptr: e.p
262
- });
263
- if (a < e.p && (a = e.s.indexOf(t, e.p), a < 0)) throw new o("incomplete key-value: cannot find end of key", {
264
- toml: e.s,
265
- ptr: n
266
- });
267
- i.push(l);
268
- } else {
269
- r = e.s.indexOf(".", e.p);
270
- let t = e.s.slice(e.p, r < 0 || r > a ? a : r);
271
- if (!v.test(t)) throw new o("only letter, numbers, dashes and underscores are allowed in keys", {
272
- toml: e.s,
273
- ptr: e.p
274
- });
275
- i.push(t.trimEnd());
276
- }
277
- }
278
- } while (r + 1 && r < a);
279
- return e.p = a + 1, l(e, !0, !0), i;
280
- }
281
- function b(e, t) {
282
- let n = {}, r = /* @__PURE__ */ new Set(), i;
283
- for (e.p++; e.p < e.s.length;) {
284
- if (l(e), (i = e.s.charCodeAt(e.p)) === 125) return e.p++, n;
285
- let a, s = n, c = !1, u = e.p, d = y(e);
286
- for (let t = 0; t < d.length; t++) {
287
- if (t && (s = c ? s[a] : s[a] = {}), a = d[t], (c = Object.hasOwn(s, a)) && (typeof s[a] != "object" || r.has(s[a]))) throw new o("trying to redefine an already defined value", {
288
- toml: e.s,
289
- ptr: u
290
- });
291
- !c && a === "__proto__" && Object.defineProperty(s, a, {
292
- enumerable: !0,
293
- configurable: !0,
294
- writable: !0
295
- });
296
- }
297
- if (c) throw new o("trying to redefine an already defined value", {
298
- toml: e.s,
299
- ptr: e.p
300
- });
301
- let f = _(e, 125, t);
302
- if (r.add(s[a] = f), l(e), (i = e.s.charCodeAt(e.p++)) === 125) return n;
303
- if (i !== 44) throw new o("expected comma or end of structure", {
304
- toml: e.s,
305
- ptr: e.p - 1
306
- });
307
- }
308
- throw new o("unfinished table encountered", {
309
- toml: e.s,
310
- ptr: e.p
311
- });
312
- }
313
- function x(e, t) {
314
- let n = [], r;
315
- for (e.p++; e.p < e.s.length;) {
316
- if (l(e), (r = e.s.charCodeAt(e.p)) === 93) return e.p++, n;
317
- if (n.push(_(e, 93, t)), l(e), (r = e.s.charCodeAt(e.p++)) === 93) return n;
318
- if (r !== 44) throw new o("expected comma or end of structure", {
319
- toml: e.s,
320
- ptr: e.p - 1
321
- });
322
- }
323
- throw new o("unfinished array encountered", {
324
- toml: e.s,
325
- ptr: e.p
326
- });
327
- }
328
- function S(e, t, n, r) {
329
- let i = t, a = n, o, s = !1, c;
330
- for (let t = 0; t < e.length; t++) {
331
- if (t) {
332
- if (i = s ? i[o] : i[o] = {}, a = (c = a[o]).c, r === 0 && (c.t === 1 || c.t === 2)) return null;
333
- if (c.t === 2) {
334
- let e = i.length - 1;
335
- i = i[e], a = a[e].c;
336
- }
337
- }
338
- if (o = e[t], (s = Object.hasOwn(i, o)) && a[o]?.t === 0 && a[o]?.d) return null;
339
- s || (o === "__proto__" && (Object.defineProperty(i, o, {
340
- enumerable: !0,
341
- configurable: !0,
342
- writable: !0
343
- }), Object.defineProperty(a, o, {
344
- enumerable: !0,
345
- configurable: !0,
346
- writable: !0
347
- })), a[o] = {
348
- t: t < e.length - 1 && r === 2 ? 3 : r,
349
- d: !1,
350
- i: 0,
351
- c: {}
352
- });
353
- }
354
- if (c = a[o], c.t !== r && (r !== 1 || c.t !== 3) || (r === 2 && (c.d || (c.d = !0, i[o] = []), i[o].push(i = {}), c.c[c.i++] = c = {
355
- t: 1,
356
- d: !1,
357
- i: 0,
358
- c: {}
359
- }), c.d)) return null;
360
- if (c.d = !0, r === 1) i = s ? i[o] : i[o] = {};
361
- else if (r === 0 && s) return null;
362
- return [
363
- o,
364
- i,
365
- c.c
366
- ];
367
- }
368
- function C(e, { maxDepth: t = 1e3, integersAsBigInt: n } = {}) {
369
- let r = {
370
- s: e,
371
- p: 0,
372
- d: t
373
- }, i = {}, a = {}, s, c = i, u = a;
374
- for (l(r); r.p < e.length;) {
375
- if (e.charCodeAt(r.p) === 91) {
376
- let t = e.charCodeAt(++r.p) === 91;
377
- s = r.p += +t;
378
- let n = y(r, "]");
379
- if (t) {
380
- if (e.charCodeAt(r.p - 1) !== 93) throw new o("expected end of table declaration", {
381
- toml: e,
382
- ptr: r.p - 1
383
- });
384
- r.p++;
385
- }
386
- let l = S(n, i, a, t ? 2 : 1);
387
- if (!l) throw new o("trying to redefine an already defined table or value", {
388
- toml: e,
389
- ptr: s
390
- });
391
- u = l[2], c = l[1];
392
- } else {
393
- s = r.p;
394
- let t = S(y(r), c, u, 0);
395
- if (!t) throw new o("trying to redefine an already defined table or value", {
396
- toml: e,
397
- ptr: s
398
- });
399
- t[1][t[0]] = _(r, void 0, n);
400
- }
401
- if (l(r, !0), r.p < e.length && (s = e.charCodeAt(r.p)) !== 10 && s !== 13) throw new o("each key-value declaration must be followed by an end-of-line", {
402
- toml: e,
403
- ptr: r.p
404
- });
405
- l(r);
406
- }
407
- return i;
408
- }
409
- //#endregion
410
- //#region ../../node_modules/.pnpm/confbox@0.3.1/node_modules/confbox/dist/toml.mjs
411
- function w(n) {
412
- let r = C(t(n));
413
- return e(n, r, { preserveIndentation: !1 }), r;
414
- }
415
- //#endregion
416
- export { w as parseTOML };