nitro-nightly 4.0.0-20251010-091516-7cafddba → 4.0.0-20251030-121649-98b56dfe

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 (252) hide show
  1. package/dist/_build/common.mjs +763 -0
  2. package/dist/_build/rolldown.mjs +216 -0
  3. package/dist/_build/rollup.mjs +359 -0
  4. package/dist/_build/vite.build.mjs +67 -0
  5. package/dist/_build/vite.plugin.mjs +747 -0
  6. package/dist/_chunks/B-7HiF0V.mjs +1303 -0
  7. package/dist/_chunks/B3asVbT4.mjs +151 -0
  8. package/dist/_chunks/B5ooyfLk.mjs +372 -0
  9. package/dist/_chunks/DXMHy5ca.mjs +43 -0
  10. package/dist/_dev.d.mts +12 -0
  11. package/dist/_dev.mjs +675 -0
  12. package/dist/_libs/acorn.mjs +5034 -0
  13. package/dist/_libs/c12.mjs +2798 -0
  14. package/dist/_libs/chokidar.mjs +1560 -0
  15. package/dist/_libs/citty.mjs +333 -0
  16. package/dist/_libs/commondir.mjs +22 -0
  17. package/dist/_libs/compatx.mjs +46 -0
  18. package/dist/_libs/confbox.mjs +2920 -0
  19. package/dist/_libs/debug.mjs +848 -0
  20. package/dist/_libs/deepmerge.mjs +86 -0
  21. package/dist/_libs/depd.mjs +314 -0
  22. package/dist/_libs/dot-prop.mjs +138 -0
  23. package/dist/_libs/duplexer.mjs +71 -0
  24. package/dist/_libs/ee-first.mjs +68 -0
  25. package/dist/_libs/encodeurl.mjs +49 -0
  26. package/dist/_libs/escape-html.mjs +58 -0
  27. package/dist/_libs/escape-string-regexp.mjs +8 -0
  28. package/dist/_libs/estree-walker.mjs +330 -0
  29. package/dist/_libs/etag.mjs +75 -0
  30. package/dist/_libs/fdir.mjs +514 -0
  31. package/dist/_libs/fresh.mjs +85 -0
  32. package/dist/_libs/function-bind.mjs +63 -0
  33. package/dist/_libs/gen-mapping.mjs +612 -0
  34. package/dist/_libs/giget.mjs +19076 -0
  35. package/dist/_libs/gzip-size.mjs +21 -0
  36. package/dist/_libs/hasown.mjs +14 -0
  37. package/dist/_libs/http-errors.mjs +436 -0
  38. package/dist/_libs/httpxy.mjs +410 -0
  39. package/dist/_libs/is-core-module.mjs +220 -0
  40. package/dist/_libs/is-module.mjs +13 -0
  41. package/dist/_libs/is-reference.mjs +32 -0
  42. package/dist/_libs/js-tokens.mjs +382 -0
  43. package/dist/_libs/klona.mjs +90 -0
  44. package/dist/_libs/knitwork.mjs +124 -0
  45. package/dist/_libs/local-pkg.mjs +1686 -0
  46. package/dist/_libs/magic-string.mjs +939 -0
  47. package/dist/_libs/mime-db.mjs +7642 -0
  48. package/dist/_libs/mime-types.mjs +162 -0
  49. package/dist/_libs/mime.mjs +1391 -0
  50. package/dist/_libs/node-fetch-native.mjs +173 -0
  51. package/dist/_libs/on-finished.mjs +170 -0
  52. package/dist/_libs/parseurl.mjs +103 -0
  53. package/dist/_libs/path-parse.mjs +47 -0
  54. package/dist/_libs/pathe.mjs +41 -0
  55. package/dist/_libs/picomatch.mjs +1673 -0
  56. package/dist/_libs/plugin-alias.mjs +64 -0
  57. package/dist/_libs/plugin-commonjs.mjs +1489 -0
  58. package/dist/_libs/plugin-inject.mjs +135 -0
  59. package/dist/_libs/plugin-json.mjs +36 -0
  60. package/dist/_libs/plugin-node-resolve.mjs +1553 -0
  61. package/dist/_libs/plugin-replace.mjs +104 -0
  62. package/dist/_libs/pretty-bytes.mjs +116 -0
  63. package/dist/_libs/range-parser.mjs +102 -0
  64. package/dist/_libs/remapping.mjs +117 -0
  65. package/dist/_libs/rou3.mjs +311 -0
  66. package/dist/_libs/send.mjs +857 -0
  67. package/dist/_libs/serve-static.mjs +124 -0
  68. package/dist/_libs/std-env.mjs +158 -0
  69. package/dist/_libs/strip-literal.mjs +51 -0
  70. package/dist/_libs/tinyglobby.mjs +292 -0
  71. package/dist/_libs/ultrahtml.mjs +138 -0
  72. package/dist/_libs/unimport.mjs +3520 -0
  73. package/dist/_libs/untyped.mjs +271 -0
  74. package/dist/_libs/unwasm.mjs +5825 -0
  75. package/dist/_libs/vite-plugin-fullstack.mjs +561 -0
  76. package/dist/_presets.mjs +1723 -0
  77. package/dist/builder.d.mts +54 -0
  78. package/dist/builder.mjs +45 -0
  79. package/dist/cli/_chunks/build.mjs +43 -0
  80. package/dist/cli/_chunks/common.mjs +15 -0
  81. package/dist/cli/_chunks/detect-acorn.mjs +12 -0
  82. package/dist/cli/_chunks/dev.mjs +79 -0
  83. package/dist/cli/_chunks/dist.mjs +3 -0
  84. package/dist/cli/_chunks/dist2.mjs +4 -0
  85. package/dist/cli/_chunks/esm.mjs +3 -0
  86. package/dist/cli/_chunks/json5.mjs +4 -0
  87. package/dist/cli/_chunks/jsonc.mjs +4 -0
  88. package/dist/cli/_chunks/list.mjs +27 -0
  89. package/dist/cli/_chunks/multipart-parser.mjs +6 -0
  90. package/dist/cli/_chunks/prepare.mjs +19 -0
  91. package/dist/cli/_chunks/run.mjs +55 -0
  92. package/dist/cli/_chunks/task.mjs +16 -0
  93. package/dist/cli/_chunks/toml.mjs +4 -0
  94. package/dist/cli/_chunks/yaml.mjs +4 -0
  95. package/dist/cli/index.d.mts +1 -1
  96. package/dist/cli/index.mjs +20 -476
  97. package/dist/node_modules/@speed-highlight/core/dist/index.js +1 -1
  98. package/dist/node_modules/@speed-highlight/core/dist/terminal.js +1 -1
  99. package/dist/node_modules/@speed-highlight/core/package.json +7 -3
  100. package/dist/node_modules/cookie-es/dist/index.mjs +262 -0
  101. package/dist/node_modules/cookie-es/package.json +37 -0
  102. package/dist/node_modules/hookable/dist/index.mjs +243 -266
  103. package/dist/node_modules/hookable/package.json +29 -26
  104. package/dist/node_modules/rendu/dist/index.mjs +380 -0
  105. package/dist/node_modules/rendu/package.json +47 -0
  106. package/dist/presets/_nitro/runtime/nitro-dev.d.mts +1 -0
  107. package/dist/presets/_nitro/runtime/nitro-dev.mjs +44 -38
  108. package/dist/presets/_nitro/runtime/nitro-prerenderer.d.mts +2 -2
  109. package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +9 -12
  110. package/dist/presets/_nitro/runtime/service-worker.d.mts +1 -0
  111. package/dist/presets/_nitro/runtime/service-worker.mjs +14 -11
  112. package/dist/presets/aws-amplify/runtime/aws-amplify.d.mts +1 -0
  113. package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +6 -5
  114. package/dist/presets/aws-lambda/runtime/_utils.d.mts +8 -13
  115. package/dist/presets/aws-lambda/runtime/_utils.mjs +95 -81
  116. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.d.mts +1 -2
  117. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +25 -27
  118. package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +7 -7
  119. package/dist/presets/azure/runtime/_utils.mjs +43 -43
  120. package/dist/presets/azure/runtime/azure-swa.d.mts +2 -2
  121. package/dist/presets/azure/runtime/azure-swa.mjs +22 -21
  122. package/dist/presets/bun/runtime/bun.d.mts +1 -0
  123. package/dist/presets/bun/runtime/bun.mjs +18 -17
  124. package/dist/presets/cloudflare/runtime/_module-handler.d.mts +10 -7
  125. package/dist/presets/cloudflare/runtime/_module-handler.mjs +79 -87
  126. package/dist/presets/cloudflare/runtime/cloudflare-durable.d.mts +6 -14
  127. package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +55 -61
  128. package/dist/presets/cloudflare/runtime/cloudflare-module.d.mts +1 -7
  129. package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +12 -14
  130. package/dist/presets/cloudflare/runtime/cloudflare-pages.d.mts +12 -12
  131. package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +35 -39
  132. package/dist/presets/cloudflare/runtime/plugin.dev.d.mts +2 -2
  133. package/dist/presets/cloudflare/runtime/plugin.dev.mjs +89 -82
  134. package/dist/presets/cloudflare/runtime/shims/workers.dev.mjs +27 -0
  135. package/dist/presets/deno/runtime/deno-deploy.d.mts +1 -0
  136. package/dist/presets/deno/runtime/deno-deploy.mjs +12 -11
  137. package/dist/presets/deno/runtime/deno-server.d.mts +2 -1
  138. package/dist/presets/deno/runtime/deno-server.mjs +31 -39
  139. package/dist/presets/netlify/runtime/netlify-edge.d.mts +2 -1
  140. package/dist/presets/netlify/runtime/netlify-edge.mjs +14 -11
  141. package/dist/presets/netlify/runtime/netlify.mjs +11 -17
  142. package/dist/presets/node/runtime/node-cluster.mjs +49 -48
  143. package/dist/presets/node/runtime/node-middleware.d.mts +3 -2
  144. package/dist/presets/node/runtime/node-middleware.mjs +7 -6
  145. package/dist/presets/node/runtime/node-server.mjs +34 -24
  146. package/dist/presets/standard/runtime/server.d.mts +1 -3
  147. package/dist/presets/standard/runtime/server.mjs +1 -3
  148. package/dist/presets/stormkit/runtime/stormkit.d.mts +13 -13
  149. package/dist/presets/stormkit/runtime/stormkit.mjs +20 -20
  150. package/dist/presets/vercel/runtime/vercel.d.mts +3 -3
  151. package/dist/presets/vercel/runtime/vercel.mjs +15 -14
  152. package/dist/presets/winterjs/runtime/winterjs.d.mts +2 -0
  153. package/dist/presets/winterjs/runtime/winterjs.mjs +72 -68
  154. package/dist/presets/zeabur/runtime/zeabur.d.mts +1 -1
  155. package/dist/runtime/index.d.mts +13 -2
  156. package/dist/runtime/index.mjs +13 -8
  157. package/dist/runtime/internal/app.d.mts +3 -1
  158. package/dist/runtime/internal/app.mjs +179 -140
  159. package/dist/runtime/internal/cache.d.mts +10 -4
  160. package/dist/runtime/internal/cache.mjs +247 -216
  161. package/dist/runtime/internal/context.d.mts +9 -9
  162. package/dist/runtime/internal/context.mjs +17 -10
  163. package/dist/runtime/internal/database.mjs +8 -10
  164. package/dist/runtime/internal/error/dev.d.mts +5 -4
  165. package/dist/runtime/internal/error/dev.mjs +106 -105
  166. package/dist/runtime/internal/error/prod.d.mts +5 -4
  167. package/dist/runtime/internal/error/prod.mjs +51 -59
  168. package/dist/runtime/internal/error/utils.d.mts +4 -4
  169. package/dist/runtime/internal/error/utils.mjs +1 -1
  170. package/dist/runtime/internal/index.d.mts +2 -0
  171. package/dist/runtime/internal/index.mjs +2 -0
  172. package/dist/runtime/internal/lib/http-graceful-shutdown.d.mts +14 -14
  173. package/dist/runtime/internal/lib/http-graceful-shutdown.mjs +248 -209
  174. package/dist/runtime/internal/meta.d.mts +1 -1
  175. package/dist/runtime/internal/meta.mjs +1 -1
  176. package/dist/runtime/internal/plugin.d.mts +2 -2
  177. package/dist/runtime/internal/plugin.mjs +1 -1
  178. package/dist/runtime/internal/renderer.mjs +40 -32
  179. package/dist/runtime/internal/route-rules.d.mts +8 -8
  180. package/dist/runtime/internal/route-rules.mjs +53 -51
  181. package/dist/runtime/internal/routes/dev-tasks.d.mts +1 -2
  182. package/dist/runtime/internal/routes/dev-tasks.mjs +15 -17
  183. package/dist/runtime/internal/routes/openapi.d.mts +1 -0
  184. package/dist/runtime/internal/routes/openapi.mjs +81 -87
  185. package/dist/runtime/internal/routes/renderer-template.d.mts +1 -1
  186. package/dist/runtime/internal/routes/renderer-template.dev.d.mts +1 -2
  187. package/dist/runtime/internal/routes/renderer-template.dev.mjs +10 -17
  188. package/dist/runtime/internal/routes/renderer-template.mjs +1 -1
  189. package/dist/runtime/internal/routes/scalar.d.mts +1 -0
  190. package/dist/runtime/internal/routes/scalar.mjs +22 -23
  191. package/dist/runtime/internal/routes/swagger.d.mts +1 -0
  192. package/dist/runtime/internal/routes/swagger.mjs +9 -11
  193. package/dist/runtime/internal/runtime-config.d.mts +4 -4
  194. package/dist/runtime/internal/runtime-config.mjs +40 -35
  195. package/dist/runtime/internal/shutdown.d.mts +2 -8
  196. package/dist/runtime/internal/shutdown.mjs +32 -30
  197. package/dist/runtime/internal/static.mjs +63 -74
  198. package/dist/runtime/internal/storage.mjs +2 -2
  199. package/dist/runtime/internal/task.d.mts +6 -6
  200. package/dist/runtime/internal/task.mjs +56 -60
  201. package/dist/runtime/internal/utils.d.mts +1 -1
  202. package/dist/runtime/internal/utils.mjs +4 -10
  203. package/dist/types/index.d.mts +2594 -2286
  204. package/dist/types/index.mjs +1 -1
  205. package/dist/vite.d.mts +56 -47
  206. package/dist/vite.mjs +55 -68
  207. package/lib/index.d.mts +1 -0
  208. package/lib/index.mjs +1 -0
  209. package/lib/runtime/meta.mjs +35 -0
  210. package/package.json +49 -50
  211. package/dist/_chunks/app.mjs +0 -19797
  212. package/dist/_chunks/build.mjs +0 -84
  213. package/dist/_chunks/build2.mjs +0 -318
  214. package/dist/_chunks/build3.mjs +0 -6452
  215. package/dist/_chunks/detect-acorn.mjs +0 -503
  216. package/dist/_chunks/index.mjs +0 -22242
  217. package/dist/_chunks/index2.mjs +0 -297
  218. package/dist/_chunks/index3.mjs +0 -1058
  219. package/dist/_chunks/index4.mjs +0 -1206
  220. package/dist/_chunks/info.mjs +0 -11157
  221. package/dist/_chunks/json5.mjs +0 -68
  222. package/dist/_chunks/jsonc.mjs +0 -51
  223. package/dist/_chunks/pathe.M-eThtNZ.mjs +0 -204
  224. package/dist/_chunks/plugin.mjs +0 -960
  225. package/dist/_chunks/server.mjs +0 -254
  226. package/dist/_chunks/snapshot.mjs +0 -284
  227. package/dist/_chunks/toml.mjs +0 -259
  228. package/dist/_chunks/yaml.mjs +0 -86
  229. package/dist/cli/build.mjs +0 -54
  230. package/dist/cli/common.mjs +0 -13
  231. package/dist/cli/dev.mjs +0 -95
  232. package/dist/cli/index2.mjs +0 -17
  233. package/dist/cli/list.mjs +0 -34
  234. package/dist/cli/prepare.mjs +0 -24
  235. package/dist/cli/run.mjs +0 -60
  236. package/dist/index.d.mts +0 -52
  237. package/dist/index.mjs +0 -55
  238. package/dist/node_modules/klona/dist/index.mjs +0 -81
  239. package/dist/node_modules/klona/full/index.mjs +0 -53
  240. package/dist/node_modules/klona/package.json +0 -74
  241. package/dist/node_modules/std-env/dist/index.mjs +0 -1
  242. package/dist/node_modules/std-env/package.json +0 -46
  243. package/dist/presets.mjs +0 -2460
  244. package/dist/runtime/internal/debug.d.mts +0 -2
  245. package/dist/runtime/internal/debug.mjs +0 -5
  246. package/dist/runtime/internal/empty.d.mts +0 -0
  247. package/dist/runtime/internal/vite/dev-entry.d.mts +0 -1
  248. package/dist/runtime/internal/vite/dev-worker.d.mts +0 -1
  249. package/dist/runtime/internal/vite/prod-setup.d.mts +0 -4
  250. package/dist/runtime/internal/vite/ssr-renderer.d.mts +0 -4
  251. package/lib/runtime-meta.mjs +0 -38
  252. /package/lib/{runtime-meta.d.mts → runtime/meta.d.mts} +0 -0
@@ -0,0 +1,612 @@
1
+ //#region node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
2
+ var comma = ",".charCodeAt(0);
3
+ var semicolon = ";".charCodeAt(0);
4
+ var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
5
+ var intToChar = new Uint8Array(64);
6
+ var charToInt = new Uint8Array(128);
7
+ for (let i = 0; i < chars.length; i++) {
8
+ const c = chars.charCodeAt(i);
9
+ intToChar[i] = c;
10
+ charToInt[c] = i;
11
+ }
12
+ function decodeInteger(reader, relative) {
13
+ let value = 0;
14
+ let shift = 0;
15
+ let integer = 0;
16
+ do {
17
+ integer = charToInt[reader.next()];
18
+ value |= (integer & 31) << shift;
19
+ shift += 5;
20
+ } while (integer & 32);
21
+ const shouldNegate = value & 1;
22
+ value >>>= 1;
23
+ if (shouldNegate) value = -2147483648 | -value;
24
+ return relative + value;
25
+ }
26
+ function encodeInteger(builder, num, relative) {
27
+ let delta = num - relative;
28
+ delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
29
+ do {
30
+ let clamped = delta & 31;
31
+ delta >>>= 5;
32
+ if (delta > 0) clamped |= 32;
33
+ builder.write(intToChar[clamped]);
34
+ } while (delta > 0);
35
+ return num;
36
+ }
37
+ function hasMoreVlq(reader, max) {
38
+ if (reader.pos >= max) return false;
39
+ return reader.peek() !== comma;
40
+ }
41
+ var bufLength = 1024 * 16;
42
+ var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
43
+ return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
44
+ } } : { decode(buf) {
45
+ let out = "";
46
+ for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
47
+ return out;
48
+ } };
49
+ var StringWriter = class {
50
+ constructor() {
51
+ this.pos = 0;
52
+ this.out = "";
53
+ this.buffer = new Uint8Array(bufLength);
54
+ }
55
+ write(v) {
56
+ const { buffer } = this;
57
+ buffer[this.pos++] = v;
58
+ if (this.pos === bufLength) {
59
+ this.out += td.decode(buffer);
60
+ this.pos = 0;
61
+ }
62
+ }
63
+ flush() {
64
+ const { buffer, out, pos } = this;
65
+ return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
66
+ }
67
+ };
68
+ var StringReader = class {
69
+ constructor(buffer) {
70
+ this.pos = 0;
71
+ this.buffer = buffer;
72
+ }
73
+ next() {
74
+ return this.buffer.charCodeAt(this.pos++);
75
+ }
76
+ peek() {
77
+ return this.buffer.charCodeAt(this.pos);
78
+ }
79
+ indexOf(char) {
80
+ const { buffer, pos } = this;
81
+ const idx = buffer.indexOf(char, pos);
82
+ return idx === -1 ? buffer.length : idx;
83
+ }
84
+ };
85
+ function decode(mappings) {
86
+ const { length } = mappings;
87
+ const reader = new StringReader(mappings);
88
+ const decoded = [];
89
+ let genColumn = 0;
90
+ let sourcesIndex = 0;
91
+ let sourceLine = 0;
92
+ let sourceColumn = 0;
93
+ let namesIndex = 0;
94
+ do {
95
+ const semi = reader.indexOf(";");
96
+ const line = [];
97
+ let sorted = true;
98
+ let lastCol = 0;
99
+ genColumn = 0;
100
+ while (reader.pos < semi) {
101
+ let seg;
102
+ genColumn = decodeInteger(reader, genColumn);
103
+ if (genColumn < lastCol) sorted = false;
104
+ lastCol = genColumn;
105
+ if (hasMoreVlq(reader, semi)) {
106
+ sourcesIndex = decodeInteger(reader, sourcesIndex);
107
+ sourceLine = decodeInteger(reader, sourceLine);
108
+ sourceColumn = decodeInteger(reader, sourceColumn);
109
+ if (hasMoreVlq(reader, semi)) {
110
+ namesIndex = decodeInteger(reader, namesIndex);
111
+ seg = [
112
+ genColumn,
113
+ sourcesIndex,
114
+ sourceLine,
115
+ sourceColumn,
116
+ namesIndex
117
+ ];
118
+ } else seg = [
119
+ genColumn,
120
+ sourcesIndex,
121
+ sourceLine,
122
+ sourceColumn
123
+ ];
124
+ } else seg = [genColumn];
125
+ line.push(seg);
126
+ reader.pos++;
127
+ }
128
+ if (!sorted) sort(line);
129
+ decoded.push(line);
130
+ reader.pos = semi + 1;
131
+ } while (reader.pos <= length);
132
+ return decoded;
133
+ }
134
+ function sort(line) {
135
+ line.sort(sortComparator$1);
136
+ }
137
+ function sortComparator$1(a, b) {
138
+ return a[0] - b[0];
139
+ }
140
+ function encode(decoded) {
141
+ const writer = new StringWriter();
142
+ let sourcesIndex = 0;
143
+ let sourceLine = 0;
144
+ let sourceColumn = 0;
145
+ let namesIndex = 0;
146
+ for (let i = 0; i < decoded.length; i++) {
147
+ const line = decoded[i];
148
+ if (i > 0) writer.write(semicolon);
149
+ if (line.length === 0) continue;
150
+ let genColumn = 0;
151
+ for (let j = 0; j < line.length; j++) {
152
+ const segment = line[j];
153
+ if (j > 0) writer.write(comma);
154
+ genColumn = encodeInteger(writer, segment[0], genColumn);
155
+ if (segment.length === 1) continue;
156
+ sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
157
+ sourceLine = encodeInteger(writer, segment[2], sourceLine);
158
+ sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
159
+ if (segment.length === 4) continue;
160
+ namesIndex = encodeInteger(writer, segment[4], namesIndex);
161
+ }
162
+ }
163
+ return writer.flush();
164
+ }
165
+
166
+ //#endregion
167
+ //#region node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
168
+ const schemeRegex = /^[\w+.-]+:\/\//;
169
+ /**
170
+ * Matches the parts of a URL:
171
+ * 1. Scheme, including ":", guaranteed.
172
+ * 2. User/password, including "@", optional.
173
+ * 3. Host, guaranteed.
174
+ * 4. Port, including ":", optional.
175
+ * 5. Path, including "/", optional.
176
+ * 6. Query, including "?", optional.
177
+ * 7. Hash, including "#", optional.
178
+ */
179
+ const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
180
+ /**
181
+ * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
182
+ * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
183
+ *
184
+ * 1. Host, optional.
185
+ * 2. Path, which may include "/", guaranteed.
186
+ * 3. Query, including "?", optional.
187
+ * 4. Hash, including "#", optional.
188
+ */
189
+ const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
190
+ function isAbsoluteUrl(input) {
191
+ return schemeRegex.test(input);
192
+ }
193
+ function isSchemeRelativeUrl(input) {
194
+ return input.startsWith("//");
195
+ }
196
+ function isAbsolutePath(input) {
197
+ return input.startsWith("/");
198
+ }
199
+ function isFileUrl(input) {
200
+ return input.startsWith("file:");
201
+ }
202
+ function isRelative(input) {
203
+ return /^[.?#]/.test(input);
204
+ }
205
+ function parseAbsoluteUrl(input) {
206
+ const match = urlRegex.exec(input);
207
+ return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || "");
208
+ }
209
+ function parseFileUrl(input) {
210
+ const match = fileRegex.exec(input);
211
+ const path = match[2];
212
+ return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path) ? path : "/" + path, match[3] || "", match[4] || "");
213
+ }
214
+ function makeUrl(scheme, user, host, port, path, query, hash) {
215
+ return {
216
+ scheme,
217
+ user,
218
+ host,
219
+ port,
220
+ path,
221
+ query,
222
+ hash,
223
+ type: 7
224
+ };
225
+ }
226
+ function parseUrl(input) {
227
+ if (isSchemeRelativeUrl(input)) {
228
+ const url$1 = parseAbsoluteUrl("http:" + input);
229
+ url$1.scheme = "";
230
+ url$1.type = 6;
231
+ return url$1;
232
+ }
233
+ if (isAbsolutePath(input)) {
234
+ const url$1 = parseAbsoluteUrl("http://foo.com" + input);
235
+ url$1.scheme = "";
236
+ url$1.host = "";
237
+ url$1.type = 5;
238
+ return url$1;
239
+ }
240
+ if (isFileUrl(input)) return parseFileUrl(input);
241
+ if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);
242
+ const url = parseAbsoluteUrl("http://foo.com/" + input);
243
+ url.scheme = "";
244
+ url.host = "";
245
+ url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
246
+ return url;
247
+ }
248
+ function stripPathFilename(path) {
249
+ if (path.endsWith("/..")) return path;
250
+ const index = path.lastIndexOf("/");
251
+ return path.slice(0, index + 1);
252
+ }
253
+ function mergePaths(url, base) {
254
+ normalizePath(base, base.type);
255
+ if (url.path === "/") url.path = base.path;
256
+ else url.path = stripPathFilename(base.path) + url.path;
257
+ }
258
+ /**
259
+ * The path can have empty directories "//", unneeded parents "foo/..", or current directory
260
+ * "foo/.". We need to normalize to a standard representation.
261
+ */
262
+ function normalizePath(url, type) {
263
+ const rel = type <= 4;
264
+ const pieces = url.path.split("/");
265
+ let pointer = 1;
266
+ let positive = 0;
267
+ let addTrailingSlash = false;
268
+ for (let i = 1; i < pieces.length; i++) {
269
+ const piece = pieces[i];
270
+ if (!piece) {
271
+ addTrailingSlash = true;
272
+ continue;
273
+ }
274
+ addTrailingSlash = false;
275
+ if (piece === ".") continue;
276
+ if (piece === "..") {
277
+ if (positive) {
278
+ addTrailingSlash = true;
279
+ positive--;
280
+ pointer--;
281
+ } else if (rel) pieces[pointer++] = piece;
282
+ continue;
283
+ }
284
+ pieces[pointer++] = piece;
285
+ positive++;
286
+ }
287
+ let path = "";
288
+ for (let i = 1; i < pointer; i++) path += "/" + pieces[i];
289
+ if (!path || addTrailingSlash && !path.endsWith("/..")) path += "/";
290
+ url.path = path;
291
+ }
292
+ /**
293
+ * Attempts to resolve `input` URL/path relative to `base`.
294
+ */
295
+ function resolve(input, base) {
296
+ if (!input && !base) return "";
297
+ const url = parseUrl(input);
298
+ let inputType = url.type;
299
+ if (base && inputType !== 7) {
300
+ const baseUrl = parseUrl(base);
301
+ const baseType = baseUrl.type;
302
+ switch (inputType) {
303
+ case 1: url.hash = baseUrl.hash;
304
+ case 2: url.query = baseUrl.query;
305
+ case 3:
306
+ case 4: mergePaths(url, baseUrl);
307
+ case 5:
308
+ url.user = baseUrl.user;
309
+ url.host = baseUrl.host;
310
+ url.port = baseUrl.port;
311
+ case 6: url.scheme = baseUrl.scheme;
312
+ }
313
+ if (baseType > inputType) inputType = baseType;
314
+ }
315
+ normalizePath(url, inputType);
316
+ const queryHash = url.query + url.hash;
317
+ switch (inputType) {
318
+ case 2:
319
+ case 3: return queryHash;
320
+ case 4: {
321
+ const path = url.path.slice(1);
322
+ if (!path) return queryHash || ".";
323
+ if (isRelative(base || input) && !isRelative(path)) return "./" + path + queryHash;
324
+ return path + queryHash;
325
+ }
326
+ case 5: return url.path + queryHash;
327
+ default: return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
328
+ }
329
+ }
330
+
331
+ //#endregion
332
+ //#region node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
333
+ function stripFilename(path) {
334
+ if (!path) return "";
335
+ const index = path.lastIndexOf("/");
336
+ return path.slice(0, index + 1);
337
+ }
338
+ function resolver(mapUrl, sourceRoot) {
339
+ const from = stripFilename(mapUrl);
340
+ const prefix = sourceRoot ? sourceRoot + "/" : "";
341
+ return (source) => resolve(prefix + (source || ""), from);
342
+ }
343
+ var COLUMN$1 = 0;
344
+ function maybeSort(mappings, owned) {
345
+ const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
346
+ if (unsortedIndex === mappings.length) return mappings;
347
+ if (!owned) mappings = mappings.slice();
348
+ for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) mappings[i] = sortSegments(mappings[i], owned);
349
+ return mappings;
350
+ }
351
+ function nextUnsortedSegmentLine(mappings, start) {
352
+ for (let i = start; i < mappings.length; i++) if (!isSorted(mappings[i])) return i;
353
+ return mappings.length;
354
+ }
355
+ function isSorted(line) {
356
+ for (let j = 1; j < line.length; j++) if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) return false;
357
+ return true;
358
+ }
359
+ function sortSegments(line, owned) {
360
+ if (!owned) line = line.slice();
361
+ return line.sort(sortComparator);
362
+ }
363
+ function sortComparator(a, b) {
364
+ return a[COLUMN$1] - b[COLUMN$1];
365
+ }
366
+ var found = false;
367
+ function binarySearch(haystack, needle, low, high) {
368
+ while (low <= high) {
369
+ const mid = low + (high - low >> 1);
370
+ const cmp = haystack[mid][COLUMN$1] - needle;
371
+ if (cmp === 0) {
372
+ found = true;
373
+ return mid;
374
+ }
375
+ if (cmp < 0) low = mid + 1;
376
+ else high = mid - 1;
377
+ }
378
+ found = false;
379
+ return low - 1;
380
+ }
381
+ function upperBound(haystack, needle, index) {
382
+ for (let i = index + 1; i < haystack.length; index = i++) if (haystack[i][COLUMN$1] !== needle) break;
383
+ return index;
384
+ }
385
+ function lowerBound(haystack, needle, index) {
386
+ for (let i = index - 1; i >= 0; index = i--) if (haystack[i][COLUMN$1] !== needle) break;
387
+ return index;
388
+ }
389
+ function memoizedState() {
390
+ return {
391
+ lastKey: -1,
392
+ lastNeedle: -1,
393
+ lastIndex: -1
394
+ };
395
+ }
396
+ function memoizedBinarySearch(haystack, needle, state, key) {
397
+ const { lastKey, lastNeedle, lastIndex } = state;
398
+ let low = 0;
399
+ let high = haystack.length - 1;
400
+ if (key === lastKey) {
401
+ if (needle === lastNeedle) {
402
+ found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle;
403
+ return lastIndex;
404
+ }
405
+ if (needle >= lastNeedle) low = lastIndex === -1 ? 0 : lastIndex;
406
+ else high = lastIndex;
407
+ }
408
+ state.lastKey = key;
409
+ state.lastNeedle = needle;
410
+ return state.lastIndex = binarySearch(haystack, needle, low, high);
411
+ }
412
+ function parse(map) {
413
+ return typeof map === "string" ? JSON.parse(map) : map;
414
+ }
415
+ var LEAST_UPPER_BOUND = -1;
416
+ var GREATEST_LOWER_BOUND = 1;
417
+ var TraceMap = class {
418
+ constructor(map, mapUrl) {
419
+ const isString = typeof map === "string";
420
+ if (!isString && map._decodedMemo) return map;
421
+ const parsed = parse(map);
422
+ const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
423
+ this.version = version;
424
+ this.file = file;
425
+ this.names = names || [];
426
+ this.sourceRoot = sourceRoot;
427
+ this.sources = sources;
428
+ this.sourcesContent = sourcesContent;
429
+ this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
430
+ const resolve$1 = resolver(mapUrl, sourceRoot);
431
+ this.resolvedSources = sources.map(resolve$1);
432
+ const { mappings } = parsed;
433
+ if (typeof mappings === "string") {
434
+ this._encoded = mappings;
435
+ this._decoded = void 0;
436
+ } else if (Array.isArray(mappings)) {
437
+ this._encoded = void 0;
438
+ this._decoded = maybeSort(mappings, isString);
439
+ } else if (parsed.sections) throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);
440
+ else throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
441
+ this._decodedMemo = memoizedState();
442
+ this._bySources = void 0;
443
+ this._bySourceMemos = void 0;
444
+ }
445
+ };
446
+ function cast$1(map) {
447
+ return map;
448
+ }
449
+ function decodedMappings(map) {
450
+ var _a;
451
+ return (_a = cast$1(map))._decoded || (_a._decoded = decode(cast$1(map)._encoded));
452
+ }
453
+ function traceSegment(map, line, column) {
454
+ const decoded = decodedMappings(map);
455
+ if (line >= decoded.length) return null;
456
+ const segments = decoded[line];
457
+ const index = traceSegmentInternal(segments, cast$1(map)._decodedMemo, line, column, GREATEST_LOWER_BOUND);
458
+ return index === -1 ? null : segments[index];
459
+ }
460
+ function traceSegmentInternal(segments, memo, line, column, bias) {
461
+ let index = memoizedBinarySearch(segments, column, memo, line);
462
+ if (found) index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
463
+ else if (bias === LEAST_UPPER_BOUND) index++;
464
+ if (index === -1 || index === segments.length) return -1;
465
+ return index;
466
+ }
467
+
468
+ //#endregion
469
+ //#region node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
470
+ var SetArray = class {
471
+ constructor() {
472
+ this._indexes = { __proto__: null };
473
+ this.array = [];
474
+ }
475
+ };
476
+ function cast(set) {
477
+ return set;
478
+ }
479
+ function get(setarr, key) {
480
+ return cast(setarr)._indexes[key];
481
+ }
482
+ function put(setarr, key) {
483
+ const index = get(setarr, key);
484
+ if (index !== void 0) return index;
485
+ const { array, _indexes: indexes } = cast(setarr);
486
+ return indexes[key] = array.push(key) - 1;
487
+ }
488
+ function remove(setarr, key) {
489
+ const index = get(setarr, key);
490
+ if (index === void 0) return;
491
+ const { array, _indexes: indexes } = cast(setarr);
492
+ for (let i = index + 1; i < array.length; i++) {
493
+ const k = array[i];
494
+ array[i - 1] = k;
495
+ indexes[k]--;
496
+ }
497
+ indexes[key] = void 0;
498
+ array.pop();
499
+ }
500
+ var COLUMN = 0;
501
+ var SOURCES_INDEX = 1;
502
+ var SOURCE_LINE = 2;
503
+ var SOURCE_COLUMN = 3;
504
+ var NAMES_INDEX = 4;
505
+ var NO_NAME = -1;
506
+ var GenMapping = class {
507
+ constructor({ file, sourceRoot } = {}) {
508
+ this._names = new SetArray();
509
+ this._sources = new SetArray();
510
+ this._sourcesContent = [];
511
+ this._mappings = [];
512
+ this.file = file;
513
+ this.sourceRoot = sourceRoot;
514
+ this._ignoreList = new SetArray();
515
+ }
516
+ };
517
+ function cast2(map) {
518
+ return map;
519
+ }
520
+ var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
521
+ return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content);
522
+ };
523
+ function setSourceContent(map, source, content) {
524
+ const { _sources: sources, _sourcesContent: sourcesContent } = cast2(map);
525
+ const index = put(sources, source);
526
+ sourcesContent[index] = content;
527
+ }
528
+ function setIgnore(map, source, ignore = true) {
529
+ const { _sources: sources, _sourcesContent: sourcesContent, _ignoreList: ignoreList } = cast2(map);
530
+ const index = put(sources, source);
531
+ if (index === sourcesContent.length) sourcesContent[index] = null;
532
+ if (ignore) put(ignoreList, index);
533
+ else remove(ignoreList, index);
534
+ }
535
+ function toDecodedMap(map) {
536
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList } = cast2(map);
537
+ removeEmptyFinalLines(mappings);
538
+ return {
539
+ version: 3,
540
+ file: map.file || void 0,
541
+ names: names.array,
542
+ sourceRoot: map.sourceRoot || void 0,
543
+ sources: sources.array,
544
+ sourcesContent,
545
+ mappings,
546
+ ignoreList: ignoreList.array
547
+ };
548
+ }
549
+ function toEncodedMap(map) {
550
+ const decoded = toDecodedMap(map);
551
+ return Object.assign({}, decoded, { mappings: encode(decoded.mappings) });
552
+ }
553
+ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
554
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = cast2(map);
555
+ const line = getIndex(mappings, genLine);
556
+ const index = getColumnIndex(line, genColumn);
557
+ if (!source) {
558
+ if (skipable && skipSourceless(line, index)) return;
559
+ return insert(line, index, [genColumn]);
560
+ }
561
+ assert(sourceLine);
562
+ assert(sourceColumn);
563
+ const sourcesIndex = put(sources, source);
564
+ const namesIndex = name ? put(names, name) : NO_NAME;
565
+ if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
566
+ if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) return;
567
+ return insert(line, index, name ? [
568
+ genColumn,
569
+ sourcesIndex,
570
+ sourceLine,
571
+ sourceColumn,
572
+ namesIndex
573
+ ] : [
574
+ genColumn,
575
+ sourcesIndex,
576
+ sourceLine,
577
+ sourceColumn
578
+ ]);
579
+ }
580
+ function assert(_val) {}
581
+ function getIndex(arr, index) {
582
+ for (let i = arr.length; i <= index; i++) arr[i] = [];
583
+ return arr[index];
584
+ }
585
+ function getColumnIndex(line, genColumn) {
586
+ let index = line.length;
587
+ for (let i = index - 1; i >= 0; index = i--) if (genColumn >= line[i][COLUMN]) break;
588
+ return index;
589
+ }
590
+ function insert(array, index, value) {
591
+ for (let i = array.length; i > index; i--) array[i] = array[i - 1];
592
+ array[index] = value;
593
+ }
594
+ function removeEmptyFinalLines(mappings) {
595
+ const { length } = mappings;
596
+ let len = length;
597
+ for (let i = len - 1; i >= 0; len = i, i--) if (mappings[i].length > 0) break;
598
+ if (len < length) mappings.length = len;
599
+ }
600
+ function skipSourceless(line, index) {
601
+ if (index === 0) return true;
602
+ return line[index - 1].length === 1;
603
+ }
604
+ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
605
+ if (index === 0) return false;
606
+ const prev = line[index - 1];
607
+ if (prev.length === 1) return false;
608
+ return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
609
+ }
610
+
611
+ //#endregion
612
+ export { toDecodedMap as a, decodedMappings as c, setSourceContent as i, traceSegment as l, maybeAddSegment as n, toEncodedMap as o, setIgnore as r, TraceMap as s, GenMapping as t, encode as u };