@tonyclaw/agent-inspector 4.0.7 → 4.0.9

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 (119) hide show
  1. package/.output/backend/nitro.json +1 -1
  2. package/.output/cli.js +915 -25970
  3. package/.output/server/_chunks/ssr-renderer.mjs +1 -38
  4. package/.output/server/_libs/@opentelemetry/semantic-conventions+[...].mjs +1 -2658
  5. package/.output/server/_libs/agent-base.mjs +2 -234
  6. package/.output/server/_libs/ajv-formats.mjs +1 -330
  7. package/.output/server/_libs/ajv.mjs +8 -6080
  8. package/.output/server/_libs/anthropic-ai__sdk.mjs +19 -6021
  9. package/.output/server/_libs/atomically.mjs +1 -155
  10. package/.output/server/_libs/base64-js.mjs +1 -102
  11. package/.output/server/_libs/bignumber.js.mjs +1 -1353
  12. package/.output/server/_libs/buffer-equal-constant-time.mjs +1 -38
  13. package/.output/server/_libs/conf.mjs +1 -635
  14. package/.output/server/_libs/cookie-es.mjs +1 -44
  15. package/.output/server/_libs/core-util-is.mjs +1 -75
  16. package/.output/server/_libs/data-uri-to-buffer.mjs +1 -39
  17. package/.output/server/_libs/debounce-fn.mjs +1 -69
  18. package/.output/server/_libs/debug.mjs +5 -547
  19. package/.output/server/_libs/dot-prop.mjs +1 -265
  20. package/.output/server/_libs/ecdsa-sig-formatter.mjs +1 -162
  21. package/.output/server/_libs/env-paths.mjs +1 -57
  22. package/.output/server/_libs/extend.mjs +1 -94
  23. package/.output/server/_libs/fast-deep-equal.mjs +1 -38
  24. package/.output/server/_libs/fast-uri.mjs +1 -812
  25. package/.output/server/_libs/fetch-blob.mjs +1 -287
  26. package/.output/server/_libs/formdata-polyfill.mjs +9 -86
  27. package/.output/server/_libs/gaxios.mjs +5 -926
  28. package/.output/server/_libs/gcp-metadata.mjs +1 -322
  29. package/.output/server/_libs/google-auth-library.mjs +16 -6339
  30. package/.output/server/_libs/google-logging-utils.mjs +1 -385
  31. package/.output/server/_libs/google__genai.mjs +13 -18034
  32. package/.output/server/_libs/h3-v2.mjs +2 -287
  33. package/.output/server/_libs/h3.mjs +2 -408
  34. package/.output/server/_libs/has-flag.mjs +1 -16
  35. package/.output/server/_libs/https-proxy-agent.mjs +7 -280
  36. package/.output/server/_libs/immediate.mjs +1 -74
  37. package/.output/server/_libs/inherits.mjs +1 -50
  38. package/.output/server/_libs/isarray.mjs +1 -14
  39. package/.output/server/_libs/isbot.mjs +1 -20
  40. package/.output/server/_libs/json-bigint.mjs +8 -413
  41. package/.output/server/_libs/json-schema-traverse.mjs +1 -91
  42. package/.output/server/_libs/jszip.mjs +2 -3051
  43. package/.output/server/_libs/jwa.mjs +3 -233
  44. package/.output/server/_libs/jws.mjs +1 -298
  45. package/.output/server/_libs/lie.mjs +1 -273
  46. package/.output/server/_libs/mariozechner__pi-agent-core.mjs +1 -824
  47. package/.output/server/_libs/mariozechner__pi-ai.mjs +34 -22887
  48. package/.output/server/_libs/mimic-function.mjs +2 -47
  49. package/.output/server/_libs/mistralai__mistralai.mjs +7 -32045
  50. package/.output/server/_libs/modelcontextprotocol__core.mjs +1 -1121
  51. package/.output/server/_libs/modelcontextprotocol__server.mjs +13 -13205
  52. package/.output/server/_libs/ms.mjs +1 -120
  53. package/.output/server/_libs/node-domexception.mjs +1 -17
  54. package/.output/server/_libs/node-fetch.mjs +4 -1578
  55. package/.output/server/_libs/ohash.mjs +1 -1
  56. package/.output/server/_libs/openai.mjs +23 -6766
  57. package/.output/server/_libs/opentelemetry__api.mjs +1 -1678
  58. package/.output/server/_libs/p-retry.mjs +1 -87
  59. package/.output/server/_libs/pako.mjs +1 -4223
  60. package/.output/server/_libs/partial-json.mjs +2 -244
  61. package/.output/server/_libs/process-nextick-args.mjs +1 -48
  62. package/.output/server/_libs/react-dom.mjs +62 -10778
  63. package/.output/server/_libs/react.mjs +1 -519
  64. package/.output/server/_libs/readable-stream.mjs +1 -1518
  65. package/.output/server/_libs/retry.mjs +1 -236
  66. package/.output/server/_libs/rou3.mjs +1 -14
  67. package/.output/server/_libs/safe-buffer.mjs +1 -126
  68. package/.output/server/_libs/semver.mjs +1 -1938
  69. package/.output/server/_libs/seroval-plugins.mjs +1 -58
  70. package/.output/server/_libs/seroval.mjs +3 -1775
  71. package/.output/server/_libs/setimmediate.mjs +1 -152
  72. package/.output/server/_libs/srvx.mjs +4 -1390
  73. package/.output/server/_libs/stubborn-fs.mjs +1 -91
  74. package/.output/server/_libs/stubborn-utils.mjs +1 -66
  75. package/.output/server/_libs/supports-color.mjs +1 -108
  76. package/.output/server/_libs/tanstack__history.mjs +1 -230
  77. package/.output/server/_libs/tanstack__react-router.mjs +1 -848
  78. package/.output/server/_libs/tanstack__react-store.mjs +1 -1
  79. package/.output/server/_libs/tanstack__router-core.mjs +1 -4839
  80. package/.output/server/_libs/typebox.mjs +3 -6596
  81. package/.output/server/_libs/ufo.mjs +1 -54
  82. package/.output/server/_libs/uint8array-extras.mjs +1 -69
  83. package/.output/server/_libs/util-deprecate.mjs +1 -12
  84. package/.output/server/_libs/web-streams-polyfill.mjs +1 -4282
  85. package/.output/server/_libs/when-exit.mjs +1 -53
  86. package/.output/server/_libs/ws.mjs +7 -3715
  87. package/.output/server/_libs/zod-to-json-schema.mjs +5 -1207
  88. package/.output/server/_libs/zod.mjs +59 -9958
  89. package/.output/server/_ssr/empty-plugin-adapters-C3Q1xu4u.mjs +1 -0
  90. package/.output/server/_ssr/index.mjs +2 -1512
  91. package/.output/server/_ssr/publicBasePathContext--TAQS2_5.mjs +1 -0
  92. package/.output/server/_ssr/router-zSWaME0l.mjs +341 -0
  93. package/.output/server/_ssr/start-PDVGOqUN.mjs +1 -0
  94. package/.output/server/_tanstack-start-manifest_v-D7cKwKzM.mjs +1 -0
  95. package/.output/server/index.mjs +1 -320
  96. package/.output/ui/assets/{CompareDrawer-fWsmegqc.js → CompareDrawer-C6KvvPtJ.js} +1 -1
  97. package/.output/ui/assets/{InspectorPet-Z9XIA0t8.js → InspectorPet-CSH6OAhB.js} +1 -1
  98. package/.output/ui/assets/{ProxyViewerContainer-DhIB_ZAU.js → ProxyViewerContainer-vPd7g0Xn.js} +4 -4
  99. package/.output/ui/assets/{ReplayDialog-w_3PENIi.js → ReplayDialog-DbXUcT39.js} +1 -1
  100. package/.output/ui/assets/{RequestAnatomy-Dix0D4G6.js → RequestAnatomy-BWOCIN7J.js} +1 -1
  101. package/.output/ui/assets/{ResponseView-BtlbxW2o.js → ResponseView-BqDbTzFs.js} +1 -1
  102. package/.output/ui/assets/{StreamingChunkSequence-BqNQJASb.js → StreamingChunkSequence-UHl2g6w6.js} +1 -1
  103. package/.output/ui/assets/{_sessionId-DPiw4uu2.js → _sessionId-B2S61lDJ.js} +1 -1
  104. package/.output/ui/assets/{_sessionId-Bo9J8C5J.js → _sessionId-CS6hqj8-.js} +1 -1
  105. package/.output/ui/assets/{index-BL5id77_.js → index-C6V66rNI.js} +1 -1
  106. package/.output/ui/assets/{index-icwV1YtX.js → index-DY5xBYHr.js} +1 -1
  107. package/.output/ui/assets/{index-Wd6TK76x.js → index-DgyIeqyV.js} +2 -2
  108. package/.output/ui/assets/{index-CWSVfojK.js → index-HLs5jTyi.js} +1 -1
  109. package/.output/ui/assets/{json-viewer-Cpr3uw1I.js → json-viewer-i5LcN8e7.js} +1 -1
  110. package/.output/ui/assets/{jszip.min-Cncg6JOi.js → jszip.min-yNpb9qnf.js} +1 -1
  111. package/.output/ui/index.html +1 -1
  112. package/.output/workers/logFinalizer.worker.js +41 -17739
  113. package/.output/workers/sessionWorkerEntry.js +41 -17735
  114. package/package.json +7 -7
  115. package/.output/server/_ssr/empty-plugin-adapters-BFgPZ6_d.mjs +0 -6
  116. package/.output/server/_ssr/publicBasePathContext-IH2ilOfu.mjs +0 -176
  117. package/.output/server/_ssr/router-weYHAqCb.mjs +0 -27177
  118. package/.output/server/_ssr/start-COQu_AgD.mjs +0 -57
  119. package/.output/server/_tanstack-start-manifest_v-ClTaMkEj.mjs +0 -4
@@ -1,287 +1 @@
1
- import { promises } from "node:fs";
2
- import "node:path";
3
- import "./node-domexception.mjs";
4
- import { r as requirePonyfill_es2018 } from "./web-streams-polyfill.mjs";
5
- var streams = {};
6
- var hasRequiredStreams;
7
- function requireStreams() {
8
- if (hasRequiredStreams) return streams;
9
- hasRequiredStreams = 1;
10
- const POOL_SIZE2 = 65536;
11
- if (!globalThis.ReadableStream) {
12
- try {
13
- const process = require("node:process");
14
- const { emitWarning } = process;
15
- try {
16
- process.emitWarning = () => {
17
- };
18
- Object.assign(globalThis, require("node:stream/web"));
19
- process.emitWarning = emitWarning;
20
- } catch (error) {
21
- process.emitWarning = emitWarning;
22
- throw error;
23
- }
24
- } catch (error) {
25
- Object.assign(globalThis, requirePonyfill_es2018());
26
- }
27
- }
28
- try {
29
- const { Blob: Blob3 } = require("buffer");
30
- if (Blob3 && !Blob3.prototype.stream) {
31
- Blob3.prototype.stream = function name(params) {
32
- let position = 0;
33
- const blob = this;
34
- return new ReadableStream({
35
- type: "bytes",
36
- async pull(ctrl) {
37
- const chunk = blob.slice(position, Math.min(blob.size, position + POOL_SIZE2));
38
- const buffer = await chunk.arrayBuffer();
39
- position += buffer.byteLength;
40
- ctrl.enqueue(new Uint8Array(buffer));
41
- if (position === blob.size) {
42
- ctrl.close();
43
- }
44
- }
45
- });
46
- };
47
- }
48
- } catch (error) {
49
- }
50
- return streams;
51
- }
52
- requireStreams();
53
- const POOL_SIZE = 65536;
54
- async function* toIterator(parts, clone = true) {
55
- for (const part of parts) {
56
- if ("stream" in part) {
57
- yield* (
58
- /** @type {AsyncIterableIterator<Uint8Array>} */
59
- part.stream()
60
- );
61
- } else if (ArrayBuffer.isView(part)) {
62
- if (clone) {
63
- let position = part.byteOffset;
64
- const end = part.byteOffset + part.byteLength;
65
- while (position !== end) {
66
- const size = Math.min(end - position, POOL_SIZE);
67
- const chunk = part.buffer.slice(position, position + size);
68
- position += chunk.byteLength;
69
- yield new Uint8Array(chunk);
70
- }
71
- } else {
72
- yield part;
73
- }
74
- } else {
75
- let position = 0, b = (
76
- /** @type {Blob} */
77
- part
78
- );
79
- while (position !== b.size) {
80
- const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE));
81
- const buffer = await chunk.arrayBuffer();
82
- position += buffer.byteLength;
83
- yield new Uint8Array(buffer);
84
- }
85
- }
86
- }
87
- }
88
- const _Blob = class Blob {
89
- /** @type {Array.<(Blob|Uint8Array)>} */
90
- #parts = [];
91
- #type = "";
92
- #size = 0;
93
- #endings = "transparent";
94
- /**
95
- * The Blob() constructor returns a new Blob object. The content
96
- * of the blob consists of the concatenation of the values given
97
- * in the parameter array.
98
- *
99
- * @param {*} blobParts
100
- * @param {{ type?: string, endings?: string }} [options]
101
- */
102
- constructor(blobParts = [], options = {}) {
103
- if (typeof blobParts !== "object" || blobParts === null) {
104
- throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");
105
- }
106
- if (typeof blobParts[Symbol.iterator] !== "function") {
107
- throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");
108
- }
109
- if (typeof options !== "object" && typeof options !== "function") {
110
- throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");
111
- }
112
- if (options === null) options = {};
113
- const encoder = new TextEncoder();
114
- for (const element of blobParts) {
115
- let part;
116
- if (ArrayBuffer.isView(element)) {
117
- part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength));
118
- } else if (element instanceof ArrayBuffer) {
119
- part = new Uint8Array(element.slice(0));
120
- } else if (element instanceof Blob) {
121
- part = element;
122
- } else {
123
- part = encoder.encode(`${element}`);
124
- }
125
- this.#size += ArrayBuffer.isView(part) ? part.byteLength : part.size;
126
- this.#parts.push(part);
127
- }
128
- this.#endings = `${options.endings === void 0 ? "transparent" : options.endings}`;
129
- const type = options.type === void 0 ? "" : String(options.type);
130
- this.#type = /^[\x20-\x7E]*$/.test(type) ? type : "";
131
- }
132
- /**
133
- * The Blob interface's size property returns the
134
- * size of the Blob in bytes.
135
- */
136
- get size() {
137
- return this.#size;
138
- }
139
- /**
140
- * The type property of a Blob object returns the MIME type of the file.
141
- */
142
- get type() {
143
- return this.#type;
144
- }
145
- /**
146
- * The text() method in the Blob interface returns a Promise
147
- * that resolves with a string containing the contents of
148
- * the blob, interpreted as UTF-8.
149
- *
150
- * @return {Promise<string>}
151
- */
152
- async text() {
153
- const decoder = new TextDecoder();
154
- let str = "";
155
- for await (const part of toIterator(this.#parts, false)) {
156
- str += decoder.decode(part, { stream: true });
157
- }
158
- str += decoder.decode();
159
- return str;
160
- }
161
- /**
162
- * The arrayBuffer() method in the Blob interface returns a
163
- * Promise that resolves with the contents of the blob as
164
- * binary data contained in an ArrayBuffer.
165
- *
166
- * @return {Promise<ArrayBuffer>}
167
- */
168
- async arrayBuffer() {
169
- const data = new Uint8Array(this.size);
170
- let offset = 0;
171
- for await (const chunk of toIterator(this.#parts, false)) {
172
- data.set(chunk, offset);
173
- offset += chunk.length;
174
- }
175
- return data.buffer;
176
- }
177
- stream() {
178
- const it = toIterator(this.#parts, true);
179
- return new globalThis.ReadableStream({
180
- // @ts-ignore
181
- type: "bytes",
182
- async pull(ctrl) {
183
- const chunk = await it.next();
184
- chunk.done ? ctrl.close() : ctrl.enqueue(chunk.value);
185
- },
186
- async cancel() {
187
- await it.return();
188
- }
189
- });
190
- }
191
- /**
192
- * The Blob interface's slice() method creates and returns a
193
- * new Blob object which contains data from a subset of the
194
- * blob on which it's called.
195
- *
196
- * @param {number} [start]
197
- * @param {number} [end]
198
- * @param {string} [type]
199
- */
200
- slice(start = 0, end = this.size, type = "") {
201
- const { size } = this;
202
- let relativeStart = start < 0 ? Math.max(size + start, 0) : Math.min(start, size);
203
- let relativeEnd = end < 0 ? Math.max(size + end, 0) : Math.min(end, size);
204
- const span = Math.max(relativeEnd - relativeStart, 0);
205
- const parts = this.#parts;
206
- const blobParts = [];
207
- let added = 0;
208
- for (const part of parts) {
209
- if (added >= span) {
210
- break;
211
- }
212
- const size2 = ArrayBuffer.isView(part) ? part.byteLength : part.size;
213
- if (relativeStart && size2 <= relativeStart) {
214
- relativeStart -= size2;
215
- relativeEnd -= size2;
216
- } else {
217
- let chunk;
218
- if (ArrayBuffer.isView(part)) {
219
- chunk = part.subarray(relativeStart, Math.min(size2, relativeEnd));
220
- added += chunk.byteLength;
221
- } else {
222
- chunk = part.slice(relativeStart, Math.min(size2, relativeEnd));
223
- added += chunk.size;
224
- }
225
- relativeEnd -= size2;
226
- blobParts.push(chunk);
227
- relativeStart = 0;
228
- }
229
- }
230
- const blob = new Blob([], { type: String(type).toLowerCase() });
231
- blob.#size = span;
232
- blob.#parts = blobParts;
233
- return blob;
234
- }
235
- get [Symbol.toStringTag]() {
236
- return "Blob";
237
- }
238
- static [Symbol.hasInstance](object) {
239
- return object && typeof object === "object" && typeof object.constructor === "function" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]);
240
- }
241
- };
242
- Object.defineProperties(_Blob.prototype, {
243
- size: { enumerable: true },
244
- type: { enumerable: true },
245
- slice: { enumerable: true }
246
- });
247
- const Blob2 = _Blob;
248
- const _File = class File extends Blob2 {
249
- #lastModified = 0;
250
- #name = "";
251
- /**
252
- * @param {*[]} fileBits
253
- * @param {string} fileName
254
- * @param {{lastModified?: number, type?: string}} options
255
- */
256
- // @ts-ignore
257
- constructor(fileBits, fileName, options = {}) {
258
- if (arguments.length < 2) {
259
- throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);
260
- }
261
- super(fileBits, options);
262
- if (options === null) options = {};
263
- const lastModified = options.lastModified === void 0 ? Date.now() : Number(options.lastModified);
264
- if (!Number.isNaN(lastModified)) {
265
- this.#lastModified = lastModified;
266
- }
267
- this.#name = String(fileName);
268
- }
269
- get name() {
270
- return this.#name;
271
- }
272
- get lastModified() {
273
- return this.#lastModified;
274
- }
275
- get [Symbol.toStringTag]() {
276
- return "File";
277
- }
278
- static [Symbol.hasInstance](object) {
279
- return !!object && object instanceof Blob2 && /^(File)$/.test(object[Symbol.toStringTag]);
280
- }
281
- };
282
- const File2 = _File;
283
- const { stat } = promises;
284
- export {
285
- Blob2 as B,
286
- File2 as F
287
- };
1
+ import{promises as T}from"node:fs";import"node:path";import"./node-domexception.mjs";import{r as z}from"./web-streams-polyfill.mjs";var p={},g;function M(){if(g)return p;g=1;const l=65536;if(!globalThis.ReadableStream)try{const e=require("node:process"),{emitWarning:t}=e;try{e.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),e.emitWarning=t}catch(r){throw e.emitWarning=t,r}}catch{Object.assign(globalThis,z())}try{const{Blob:e}=require("buffer");e&&!e.prototype.stream&&(e.prototype.stream=function(r){let s=0;const n=this;return new ReadableStream({type:"bytes",async pull(i){const f=await n.slice(s,Math.min(n.size,s+l)).arrayBuffer();s+=f.byteLength,i.enqueue(new Uint8Array(f)),s===n.size&&i.close()}})})}catch{}return p}M();const w=65536;async function*m(l,e=!0){for(const t of l)if("stream"in t)yield*t.stream();else if(ArrayBuffer.isView(t))if(e){let r=t.byteOffset;const s=t.byteOffset+t.byteLength;for(;r!==s;){const n=Math.min(s-r,w),i=t.buffer.slice(r,r+n);r+=i.byteLength,yield new Uint8Array(i)}}else yield t;else{let r=0,s=t;for(;r!==s.size;){const i=await s.slice(r,Math.min(s.size,r+w)).arrayBuffer();r+=i.byteLength,yield new Uint8Array(i)}}}const B=class b{#e=[];#t="";#r=0;#n="transparent";constructor(e=[],t={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof t!="object"&&typeof t!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");t===null&&(t={});const r=new TextEncoder;for(const n of e){let i;ArrayBuffer.isView(n)?i=new Uint8Array(n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)):n instanceof ArrayBuffer?i=new Uint8Array(n.slice(0)):n instanceof b?i=n:i=r.encode(`${n}`),this.#r+=ArrayBuffer.isView(i)?i.byteLength:i.size,this.#e.push(i)}this.#n=`${t.endings===void 0?"transparent":t.endings}`;const s=t.type===void 0?"":String(t.type);this.#t=/^[\x20-\x7E]*$/.test(s)?s:""}get size(){return this.#r}get type(){return this.#t}async text(){const e=new TextDecoder;let t="";for await(const r of m(this.#e,!1))t+=e.decode(r,{stream:!0});return t+=e.decode(),t}async arrayBuffer(){const e=new Uint8Array(this.size);let t=0;for await(const r of m(this.#e,!1))e.set(r,t),t+=r.length;return e.buffer}stream(){const e=m(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(t){const r=await e.next();r.done?t.close():t.enqueue(r.value)},async cancel(){await e.return()}})}slice(e=0,t=this.size,r=""){const{size:s}=this;let n=e<0?Math.max(s+e,0):Math.min(e,s),i=t<0?Math.max(s+t,0):Math.min(t,s);const u=Math.max(i-n,0),f=this.#e,d=[];let y=0;for(const a of f){if(y>=u)break;const o=ArrayBuffer.isView(a)?a.byteLength:a.size;if(n&&o<=n)n-=o,i-=o;else{let c;ArrayBuffer.isView(a)?(c=a.subarray(n,Math.min(o,i)),y+=c.byteLength):(c=a.slice(n,Math.min(o,i)),y+=c.size),i-=o,d.push(c),n=0}}const h=new b([],{type:String(r).toLowerCase()});return h.#r=u,h.#e=d,h}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}};Object.defineProperties(B.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});const S=B,A=class extends S{#e=0;#t="";constructor(e,t,r={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,r),r===null&&(r={});const s=r.lastModified===void 0?Date.now():Number(r.lastModified);Number.isNaN(s)||(this.#e=s),this.#t=String(t)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof S&&/^(File)$/.test(e[Symbol.toStringTag])}},v=A,{stat:k}=T;export{S as B,v as F};
@@ -1,88 +1,11 @@
1
- import { B as Blob, F as File } from "./fetch-blob.mjs";
2
- var { toStringTag: t, iterator: i, hasInstance: h } = Symbol, r = Math.random, m = "append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","), f = (a, b, c) => (a += "", /^(Blob|File)$/.test(b && b[t]) ? [(c = c !== void 0 ? c + "" : b[t] == "File" ? b.name : "blob", a), b.name !== c || b[t] == "blob" ? new File([b], c, b) : b] : [a, b + ""]), e = (c, f2) => (f2 ? c : c.replace(/\r?\n|\r/g, "\r\n")).replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), x = (n, a, e2) => {
3
- if (a.length < e2) {
4
- throw new TypeError(`Failed to execute '${n}' on 'FormData': ${e2} arguments required, but only ${a.length} present.`);
5
- }
6
- };
7
- const FormData = class FormData2 {
8
- #d = [];
9
- constructor(...a) {
10
- if (a.length) throw new TypeError(`Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.`);
11
- }
12
- get [t]() {
13
- return "FormData";
14
- }
15
- [i]() {
16
- return this.entries();
17
- }
18
- static [h](o) {
19
- return o && typeof o === "object" && o[t] === "FormData" && !m.some((m2) => typeof o[m2] != "function");
20
- }
21
- append(...a) {
22
- x("append", arguments, 2);
23
- this.#d.push(f(...a));
24
- }
25
- delete(a) {
26
- x("delete", arguments, 1);
27
- a += "";
28
- this.#d = this.#d.filter(([b]) => b !== a);
29
- }
30
- get(a) {
31
- x("get", arguments, 1);
32
- a += "";
33
- for (var b = this.#d, l = b.length, c = 0; c < l; c++) if (b[c][0] === a) return b[c][1];
34
- return null;
35
- }
36
- getAll(a, b) {
37
- x("getAll", arguments, 1);
38
- b = [];
39
- a += "";
40
- this.#d.forEach((c) => c[0] === a && b.push(c[1]));
41
- return b;
42
- }
43
- has(a) {
44
- x("has", arguments, 1);
45
- a += "";
46
- return this.#d.some((b) => b[0] === a);
47
- }
48
- forEach(a, b) {
49
- x("forEach", arguments, 1);
50
- for (var [c, d] of this) a.call(b, d, c, this);
51
- }
52
- set(...a) {
53
- x("set", arguments, 2);
54
- var b = [], c = true;
55
- a = f(...a);
56
- this.#d.forEach((d) => {
57
- d[0] === a[0] ? c && (c = !b.push(a)) : b.push(d);
58
- });
59
- c && b.push(a);
60
- this.#d = b;
61
- }
62
- *entries() {
63
- yield* this.#d;
64
- }
65
- *keys() {
66
- for (var [a] of this) yield a;
67
- }
68
- *values() {
69
- for (var [, a] of this) yield a;
70
- }
71
- };
72
- function formDataToBlob(F, B = Blob) {
73
- var b = `${r()}${r()}`.replace(/\./g, "").slice(-28).padStart(32, "-"), c = [], p = `--${b}\r
74
- Content-Disposition: form-data; name="`;
75
- F.forEach((v, n) => typeof v == "string" ? c.push(p + e(n) + `"\r
1
+ import{B as m,F as f}from"./fetch-blob.mjs";var{toStringTag:i,iterator:g,hasInstance:c}=Symbol,h=Math.random,d="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),u=(a,e,t)=>(a+="",/^(Blob|File)$/.test(e&&e[i])?[(t=t!==void 0?t+"":e[i]=="File"?e.name:"blob",a),e.name!==t||e[i]=="blob"?new f([e],t,e):e]:[a,e+""]),l=(a,e)=>(e?a:a.replace(/\r?\n|\r/g,`\r
2
+ `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),s=(a,e,t)=>{if(e.length<t)throw new TypeError(`Failed to execute '${a}' on 'FormData': ${t} arguments required, but only ${e.length} present.`)};const F=class{#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[i](){return"FormData"}[g](){return this.entries()}static[c](e){return e&&typeof e=="object"&&e[i]==="FormData"&&!d.some(t=>typeof e[t]!="function")}append(...e){s("append",arguments,2),this.#e.push(u(...e))}delete(e){s("delete",arguments,1),e+="",this.#e=this.#e.filter(([t])=>t!==e)}get(e){s("get",arguments,1),e+="";for(var t=this.#e,r=t.length,n=0;n<r;n++)if(t[n][0]===e)return t[n][1];return null}getAll(e,t){return s("getAll",arguments,1),t=[],e+="",this.#e.forEach(r=>r[0]===e&&t.push(r[1])),t}has(e){return s("has",arguments,1),e+="",this.#e.some(t=>t[0]===e)}forEach(e,t){s("forEach",arguments,1);for(var[r,n]of this)e.call(t,n,r,this)}set(...e){s("set",arguments,2);var t=[],r=!0;e=u(...e),this.#e.forEach(n=>{n[0]===e[0]?r&&(r=!t.push(e)):t.push(n)}),r&&t.push(e),this.#e=t}*entries(){yield*this.#e}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}};function D(a,e=m){var t=`${h()}${h()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),r=[],n=`--${t}\r
3
+ Content-Disposition: form-data; name="`;return a.forEach((o,p)=>typeof o=="string"?r.push(n+l(p)+`"\r
76
4
  \r
77
- ${v.replace(new RegExp("\\r(?!\\n)|(?<!\\r)\\n", "g"), "\r\n")}\r
78
- `) : c.push(p + e(n) + `"; filename="${e(v.name, 1)}"\r
79
- Content-Type: ${v.type || "application/octet-stream"}\r
5
+ ${o.replace(new RegExp("\\r(?!\\n)|(?<!\\r)\\n","g"),`\r
6
+ `)}\r
7
+ `):r.push(n+l(p)+`"; filename="${l(o.name,1)}"\r
8
+ Content-Type: ${o.type||"application/octet-stream"}\r
80
9
  \r
81
- `, v, "\r\n"));
82
- c.push(`--${b}--`);
83
- return new B(c, { type: "multipart/form-data; boundary=" + b });
84
- }
85
- export {
86
- FormData as F,
87
- formDataToBlob as f
88
- };
10
+ `,o,`\r
11
+ `)),r.push(`--${t}--`),new e(r,{type:"multipart/form-data; boundary="+t})}export{F,D as f};