google-spreadsheet 5.0.0 → 5.0.2

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/dist/index.js CHANGED
@@ -1,2387 +1,8 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/errors/HTTPError.js
5
- var HTTPError = class extends Error {
6
- static {
7
- __name(this, "HTTPError");
8
- }
9
- response;
10
- request;
11
- options;
12
- constructor(response, request, options) {
13
- const code = response.status || response.status === 0 ? response.status : "";
14
- const title = response.statusText || "";
15
- const status = `${code} ${title}`.trim();
16
- const reason = status ? `status code ${status}` : "an unknown error";
17
- super(`Request failed with ${reason}: ${request.method} ${request.url}`);
18
- this.name = "HTTPError";
19
- this.response = response;
20
- this.request = request;
21
- this.options = options;
22
- }
23
- };
24
-
25
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/errors/TimeoutError.js
26
- var TimeoutError = class extends Error {
27
- static {
28
- __name(this, "TimeoutError");
29
- }
30
- request;
31
- constructor(request) {
32
- super(`Request timed out: ${request.method} ${request.url}`);
33
- this.name = "TimeoutError";
34
- this.request = request;
35
- }
36
- };
37
-
38
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/core/constants.js
39
- var supportsRequestStreams = (() => {
40
- let duplexAccessed = false;
41
- let hasContentType = false;
42
- const supportsReadableStream = typeof globalThis.ReadableStream === "function";
43
- const supportsRequest = typeof globalThis.Request === "function";
44
- if (supportsReadableStream && supportsRequest) {
45
- try {
46
- hasContentType = new globalThis.Request("https://empty.invalid", {
47
- body: new globalThis.ReadableStream(),
48
- method: "POST",
49
- // @ts-expect-error - Types are outdated.
50
- get duplex() {
51
- duplexAccessed = true;
52
- return "half";
53
- }
54
- }).headers.has("Content-Type");
55
- } catch (error) {
56
- if (error instanceof Error && error.message === "unsupported BodyInit type") {
57
- return false;
58
- }
59
- throw error;
60
- }
61
- }
62
- return duplexAccessed && !hasContentType;
63
- })();
64
- var supportsAbortController = typeof globalThis.AbortController === "function";
65
- var supportsAbortSignal = typeof globalThis.AbortSignal === "function" && typeof globalThis.AbortSignal.any === "function";
66
- var supportsResponseStreams = typeof globalThis.ReadableStream === "function";
67
- var supportsFormData = typeof globalThis.FormData === "function";
68
- var requestMethods = ["get", "post", "put", "patch", "head", "delete"];
69
- var validate = /* @__PURE__ */ __name(() => void 0, "validate");
70
- validate();
71
- var responseTypes = {
72
- json: "application/json",
73
- text: "text/*",
74
- formData: "multipart/form-data",
75
- arrayBuffer: "*/*",
76
- blob: "*/*"
77
- };
78
- var maxSafeTimeout = 2147483647;
79
- var usualFormBoundarySize = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length;
80
- var stop = Symbol("stop");
81
- var kyOptionKeys = {
82
- json: true,
83
- parseJson: true,
84
- stringifyJson: true,
85
- searchParams: true,
86
- prefixUrl: true,
87
- retry: true,
88
- timeout: true,
89
- hooks: true,
90
- throwHttpErrors: true,
91
- onDownloadProgress: true,
92
- onUploadProgress: true,
93
- fetch: true
94
- };
95
- var requestOptionsRegistry = {
96
- method: true,
97
- headers: true,
98
- body: true,
99
- mode: true,
100
- credentials: true,
101
- cache: true,
102
- redirect: true,
103
- referrer: true,
104
- referrerPolicy: true,
105
- integrity: true,
106
- keepalive: true,
107
- signal: true,
108
- window: true,
109
- dispatcher: true,
110
- duplex: true,
111
- priority: true
112
- };
113
-
114
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/utils/body.js
115
- var getBodySize = /* @__PURE__ */ __name((body) => {
116
- if (!body) {
117
- return 0;
118
- }
119
- if (body instanceof FormData) {
120
- let size = 0;
121
- for (const [key, value] of body) {
122
- size += usualFormBoundarySize;
123
- size += new TextEncoder().encode(`Content-Disposition: form-data; name="${key}"`).length;
124
- size += typeof value === "string" ? new TextEncoder().encode(value).length : value.size;
125
- }
126
- return size;
127
- }
128
- if (body instanceof Blob) {
129
- return body.size;
130
- }
131
- if (body instanceof ArrayBuffer) {
132
- return body.byteLength;
133
- }
134
- if (typeof body === "string") {
135
- return new TextEncoder().encode(body).length;
136
- }
137
- if (body instanceof URLSearchParams) {
138
- return new TextEncoder().encode(body.toString()).length;
139
- }
140
- if ("byteLength" in body) {
141
- return body.byteLength;
142
- }
143
- if (typeof body === "object" && body !== null) {
144
- try {
145
- const jsonString = JSON.stringify(body);
146
- return new TextEncoder().encode(jsonString).length;
147
- } catch {
148
- return 0;
149
- }
150
- }
151
- return 0;
152
- }, "getBodySize");
153
- var streamResponse = /* @__PURE__ */ __name((response, onDownloadProgress) => {
154
- const totalBytes = Number(response.headers.get("content-length")) || 0;
155
- let transferredBytes = 0;
156
- if (response.status === 204) {
157
- if (onDownloadProgress) {
158
- onDownloadProgress({ percent: 1, totalBytes, transferredBytes }, new Uint8Array());
159
- }
160
- return new Response(null, {
161
- status: response.status,
162
- statusText: response.statusText,
163
- headers: response.headers
164
- });
165
- }
166
- return new Response(new ReadableStream({
167
- async start(controller) {
168
- const reader = response.body.getReader();
169
- if (onDownloadProgress) {
170
- onDownloadProgress({ percent: 0, transferredBytes: 0, totalBytes }, new Uint8Array());
171
- }
172
- async function read() {
173
- const { done, value } = await reader.read();
174
- if (done) {
175
- controller.close();
176
- return;
177
- }
178
- if (onDownloadProgress) {
179
- transferredBytes += value.byteLength;
180
- const percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;
181
- onDownloadProgress({ percent, transferredBytes, totalBytes }, value);
182
- }
183
- controller.enqueue(value);
184
- await read();
185
- }
186
- __name(read, "read");
187
- await read();
188
- }
189
- }), {
190
- status: response.status,
191
- statusText: response.statusText,
192
- headers: response.headers
193
- });
194
- }, "streamResponse");
195
- var streamRequest = /* @__PURE__ */ __name((request, onUploadProgress) => {
196
- const totalBytes = getBodySize(request.body);
197
- let transferredBytes = 0;
198
- return new Request(request, {
199
- // @ts-expect-error - Types are outdated.
200
- duplex: "half",
201
- body: new ReadableStream({
202
- async start(controller) {
203
- const reader = request.body instanceof ReadableStream ? request.body.getReader() : new Response("").body.getReader();
204
- async function read() {
205
- const { done, value } = await reader.read();
206
- if (done) {
207
- if (onUploadProgress) {
208
- onUploadProgress({ percent: 1, transferredBytes, totalBytes: Math.max(totalBytes, transferredBytes) }, new Uint8Array());
209
- }
210
- controller.close();
211
- return;
212
- }
213
- transferredBytes += value.byteLength;
214
- let percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;
215
- if (totalBytes < transferredBytes || percent === 1) {
216
- percent = 0.99;
217
- }
218
- if (onUploadProgress) {
219
- onUploadProgress({ percent: Number(percent.toFixed(2)), transferredBytes, totalBytes }, value);
220
- }
221
- controller.enqueue(value);
222
- await read();
223
- }
224
- __name(read, "read");
225
- await read();
226
- }
227
- })
228
- });
229
- }, "streamRequest");
230
-
231
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/utils/is.js
232
- var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object", "isObject");
233
-
234
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/utils/merge.js
235
- var validateAndMerge = /* @__PURE__ */ __name((...sources) => {
236
- for (const source of sources) {
237
- if ((!isObject(source) || Array.isArray(source)) && source !== void 0) {
238
- throw new TypeError("The `options` argument must be an object");
239
- }
240
- }
241
- return deepMerge({}, ...sources);
242
- }, "validateAndMerge");
243
- var mergeHeaders = /* @__PURE__ */ __name((source1 = {}, source2 = {}) => {
244
- const result = new globalThis.Headers(source1);
245
- const isHeadersInstance = source2 instanceof globalThis.Headers;
246
- const source = new globalThis.Headers(source2);
247
- for (const [key, value] of source.entries()) {
248
- if (isHeadersInstance && value === "undefined" || value === void 0) {
249
- result.delete(key);
250
- } else {
251
- result.set(key, value);
252
- }
253
- }
254
- return result;
255
- }, "mergeHeaders");
256
- function newHookValue(original, incoming, property2) {
257
- return Object.hasOwn(incoming, property2) && incoming[property2] === void 0 ? [] : deepMerge(original[property2] ?? [], incoming[property2] ?? []);
258
- }
259
- __name(newHookValue, "newHookValue");
260
- var mergeHooks = /* @__PURE__ */ __name((original = {}, incoming = {}) => ({
261
- beforeRequest: newHookValue(original, incoming, "beforeRequest"),
262
- beforeRetry: newHookValue(original, incoming, "beforeRetry"),
263
- afterResponse: newHookValue(original, incoming, "afterResponse"),
264
- beforeError: newHookValue(original, incoming, "beforeError")
265
- }), "mergeHooks");
266
- var deepMerge = /* @__PURE__ */ __name((...sources) => {
267
- let returnValue = {};
268
- let headers = {};
269
- let hooks = {};
270
- for (const source of sources) {
271
- if (Array.isArray(source)) {
272
- if (!Array.isArray(returnValue)) {
273
- returnValue = [];
274
- }
275
- returnValue = [...returnValue, ...source];
276
- } else if (isObject(source)) {
277
- for (let [key, value] of Object.entries(source)) {
278
- if (isObject(value) && key in returnValue) {
279
- value = deepMerge(returnValue[key], value);
280
- }
281
- returnValue = { ...returnValue, [key]: value };
282
- }
283
- if (isObject(source.hooks)) {
284
- hooks = mergeHooks(hooks, source.hooks);
285
- returnValue.hooks = hooks;
286
- }
287
- if (isObject(source.headers)) {
288
- headers = mergeHeaders(headers, source.headers);
289
- returnValue.headers = headers;
290
- }
291
- }
292
- }
293
- return returnValue;
294
- }, "deepMerge");
295
-
296
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/utils/normalize.js
297
- var normalizeRequestMethod = /* @__PURE__ */ __name((input) => requestMethods.includes(input) ? input.toUpperCase() : input, "normalizeRequestMethod");
298
- var retryMethods = ["get", "put", "head", "delete", "options", "trace"];
299
- var retryStatusCodes = [408, 413, 429, 500, 502, 503, 504];
300
- var retryAfterStatusCodes = [413, 429, 503];
301
- var defaultRetryOptions = {
302
- limit: 2,
303
- methods: retryMethods,
304
- statusCodes: retryStatusCodes,
305
- afterStatusCodes: retryAfterStatusCodes,
306
- maxRetryAfter: Number.POSITIVE_INFINITY,
307
- backoffLimit: Number.POSITIVE_INFINITY,
308
- delay: /* @__PURE__ */ __name((attemptCount) => 0.3 * 2 ** (attemptCount - 1) * 1e3, "delay")
309
- };
310
- var normalizeRetryOptions = /* @__PURE__ */ __name((retry = {}) => {
311
- if (typeof retry === "number") {
312
- return {
313
- ...defaultRetryOptions,
314
- limit: retry
315
- };
316
- }
317
- if (retry.methods && !Array.isArray(retry.methods)) {
318
- throw new Error("retry.methods must be an array");
319
- }
320
- if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {
321
- throw new Error("retry.statusCodes must be an array");
322
- }
323
- return {
324
- ...defaultRetryOptions,
325
- ...retry
326
- };
327
- }, "normalizeRetryOptions");
328
-
329
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/utils/timeout.js
330
- async function timeout(request, init, abortController, options) {
331
- return new Promise((resolve, reject) => {
332
- const timeoutId = setTimeout(() => {
333
- if (abortController) {
334
- abortController.abort();
335
- }
336
- reject(new TimeoutError(request));
337
- }, options.timeout);
338
- void options.fetch(request, init).then(resolve).catch(reject).then(() => {
339
- clearTimeout(timeoutId);
340
- });
341
- });
342
- }
343
- __name(timeout, "timeout");
344
-
345
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/utils/delay.js
346
- async function delay(ms, { signal }) {
347
- return new Promise((resolve, reject) => {
348
- if (signal) {
349
- signal.throwIfAborted();
350
- signal.addEventListener("abort", abortHandler, { once: true });
351
- }
352
- function abortHandler() {
353
- clearTimeout(timeoutId);
354
- reject(signal.reason);
355
- }
356
- __name(abortHandler, "abortHandler");
357
- const timeoutId = setTimeout(() => {
358
- signal?.removeEventListener("abort", abortHandler);
359
- resolve();
360
- }, ms);
361
- });
362
- }
363
- __name(delay, "delay");
364
-
365
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/utils/options.js
366
- var findUnknownOptions = /* @__PURE__ */ __name((request, options) => {
367
- const unknownOptions = {};
368
- for (const key in options) {
369
- if (!(key in requestOptionsRegistry) && !(key in kyOptionKeys) && !(key in request)) {
370
- unknownOptions[key] = options[key];
371
- }
372
- }
373
- return unknownOptions;
374
- }, "findUnknownOptions");
375
-
376
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/core/Ky.js
377
- var Ky = class _Ky {
378
- static {
379
- __name(this, "Ky");
380
- }
381
- static create(input, options) {
382
- const ky2 = new _Ky(input, options);
383
- const function_ = /* @__PURE__ */ __name(async () => {
384
- if (typeof ky2._options.timeout === "number" && ky2._options.timeout > maxSafeTimeout) {
385
- throw new RangeError(`The \`timeout\` option cannot be greater than ${maxSafeTimeout}`);
386
- }
387
- await Promise.resolve();
388
- let response = await ky2._fetch();
389
- for (const hook of ky2._options.hooks.afterResponse) {
390
- const modifiedResponse = await hook(ky2.request, ky2._options, ky2._decorateResponse(response.clone()));
391
- if (modifiedResponse instanceof globalThis.Response) {
392
- response = modifiedResponse;
393
- }
394
- }
395
- ky2._decorateResponse(response);
396
- if (!response.ok && ky2._options.throwHttpErrors) {
397
- let error = new HTTPError(response, ky2.request, ky2._options);
398
- for (const hook of ky2._options.hooks.beforeError) {
399
- error = await hook(error);
400
- }
401
- throw error;
402
- }
403
- if (ky2._options.onDownloadProgress) {
404
- if (typeof ky2._options.onDownloadProgress !== "function") {
405
- throw new TypeError("The `onDownloadProgress` option must be a function");
406
- }
407
- if (!supportsResponseStreams) {
408
- throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
409
- }
410
- return streamResponse(response.clone(), ky2._options.onDownloadProgress);
411
- }
412
- return response;
413
- }, "function_");
414
- const isRetriableMethod = ky2._options.retry.methods.includes(ky2.request.method.toLowerCase());
415
- const result = (isRetriableMethod ? ky2._retry(function_) : function_()).finally(async () => {
416
- if (!ky2.request.bodyUsed) {
417
- await ky2.request.body?.cancel();
418
- }
419
- });
420
- for (const [type, mimeType] of Object.entries(responseTypes)) {
421
- result[type] = async () => {
422
- ky2.request.headers.set("accept", ky2.request.headers.get("accept") || mimeType);
423
- const response = await result;
424
- if (type === "json") {
425
- if (response.status === 204) {
426
- return "";
427
- }
428
- const arrayBuffer = await response.clone().arrayBuffer();
429
- const responseSize = arrayBuffer.byteLength;
430
- if (responseSize === 0) {
431
- return "";
432
- }
433
- if (options.parseJson) {
434
- return options.parseJson(await response.text());
435
- }
436
- }
437
- return response[type]();
438
- };
439
- }
440
- return result;
441
- }
442
- request;
443
- abortController;
444
- _retryCount = 0;
445
- _input;
446
- _options;
447
- // eslint-disable-next-line complexity
448
- constructor(input, options = {}) {
449
- this._input = input;
450
- this._options = {
451
- ...options,
452
- headers: mergeHeaders(this._input.headers, options.headers),
453
- hooks: mergeHooks({
454
- beforeRequest: [],
455
- beforeRetry: [],
456
- beforeError: [],
457
- afterResponse: []
458
- }, options.hooks),
459
- method: normalizeRequestMethod(options.method ?? this._input.method ?? "GET"),
460
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
461
- prefixUrl: String(options.prefixUrl || ""),
462
- retry: normalizeRetryOptions(options.retry),
463
- throwHttpErrors: options.throwHttpErrors !== false,
464
- timeout: options.timeout ?? 1e4,
465
- fetch: options.fetch ?? globalThis.fetch.bind(globalThis)
466
- };
467
- if (typeof this._input !== "string" && !(this._input instanceof URL || this._input instanceof globalThis.Request)) {
468
- throw new TypeError("`input` must be a string, URL, or Request");
469
- }
470
- if (this._options.prefixUrl && typeof this._input === "string") {
471
- if (this._input.startsWith("/")) {
472
- throw new Error("`input` must not begin with a slash when using `prefixUrl`");
473
- }
474
- if (!this._options.prefixUrl.endsWith("/")) {
475
- this._options.prefixUrl += "/";
476
- }
477
- this._input = this._options.prefixUrl + this._input;
478
- }
479
- if (supportsAbortController && supportsAbortSignal) {
480
- const originalSignal = this._options.signal ?? this._input.signal;
481
- this.abortController = new globalThis.AbortController();
482
- this._options.signal = originalSignal ? AbortSignal.any([originalSignal, this.abortController.signal]) : this.abortController.signal;
483
- }
484
- if (supportsRequestStreams) {
485
- this._options.duplex = "half";
486
- }
487
- if (this._options.json !== void 0) {
488
- this._options.body = this._options.stringifyJson?.(this._options.json) ?? JSON.stringify(this._options.json);
489
- this._options.headers.set("content-type", this._options.headers.get("content-type") ?? "application/json");
490
- }
491
- this.request = new globalThis.Request(this._input, this._options);
492
- if (this._options.searchParams) {
493
- const textSearchParams = typeof this._options.searchParams === "string" ? this._options.searchParams.replace(/^\?/, "") : new URLSearchParams(this._options.searchParams).toString();
494
- const searchParams = "?" + textSearchParams;
495
- const url = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, searchParams);
496
- if ((supportsFormData && this._options.body instanceof globalThis.FormData || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers["content-type"])) {
497
- this.request.headers.delete("content-type");
498
- }
499
- this.request = new globalThis.Request(new globalThis.Request(url, { ...this.request }), this._options);
500
- }
501
- if (this._options.onUploadProgress) {
502
- if (typeof this._options.onUploadProgress !== "function") {
503
- throw new TypeError("The `onUploadProgress` option must be a function");
504
- }
505
- if (!supportsRequestStreams) {
506
- throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");
507
- }
508
- const originalBody = this.request.body;
509
- if (originalBody) {
510
- this.request = streamRequest(this.request, this._options.onUploadProgress);
511
- }
512
- }
513
- }
514
- _calculateRetryDelay(error) {
515
- this._retryCount++;
516
- if (this._retryCount > this._options.retry.limit || error instanceof TimeoutError) {
517
- throw error;
518
- }
519
- if (error instanceof HTTPError) {
520
- if (!this._options.retry.statusCodes.includes(error.response.status)) {
521
- throw error;
522
- }
523
- const retryAfter = error.response.headers.get("Retry-After") ?? error.response.headers.get("RateLimit-Reset") ?? error.response.headers.get("X-RateLimit-Reset") ?? error.response.headers.get("X-Rate-Limit-Reset");
524
- if (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {
525
- let after = Number(retryAfter) * 1e3;
526
- if (Number.isNaN(after)) {
527
- after = Date.parse(retryAfter) - Date.now();
528
- } else if (after >= Date.parse("2024-01-01")) {
529
- after -= Date.now();
530
- }
531
- const max = this._options.retry.maxRetryAfter ?? after;
532
- return after < max ? after : max;
533
- }
534
- if (error.response.status === 413) {
535
- throw error;
536
- }
537
- }
538
- const retryDelay = this._options.retry.delay(this._retryCount);
539
- return Math.min(this._options.retry.backoffLimit, retryDelay);
540
- }
541
- _decorateResponse(response) {
542
- if (this._options.parseJson) {
543
- response.json = async () => this._options.parseJson(await response.text());
544
- }
545
- return response;
546
- }
547
- async _retry(function_) {
548
- try {
549
- return await function_();
550
- } catch (error) {
551
- const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);
552
- if (this._retryCount < 1) {
553
- throw error;
554
- }
555
- await delay(ms, { signal: this._options.signal });
556
- for (const hook of this._options.hooks.beforeRetry) {
557
- const hookResult = await hook({
558
- request: this.request,
559
- options: this._options,
560
- error,
561
- retryCount: this._retryCount
562
- });
563
- if (hookResult === stop) {
564
- return;
565
- }
566
- }
567
- return this._retry(function_);
568
- }
569
- }
570
- async _fetch() {
571
- for (const hook of this._options.hooks.beforeRequest) {
572
- const result = await hook(this.request, this._options);
573
- if (result instanceof Request) {
574
- this.request = result;
575
- break;
576
- }
577
- if (result instanceof Response) {
578
- return result;
579
- }
580
- }
581
- const nonRequestOptions = findUnknownOptions(this.request, this._options);
582
- const mainRequest = this.request;
583
- this.request = mainRequest.clone();
584
- if (this._options.timeout === false) {
585
- return this._options.fetch(mainRequest, nonRequestOptions);
586
- }
587
- return timeout(mainRequest, nonRequestOptions, this.abortController, this._options);
588
- }
589
- };
590
-
591
- // node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/index.js
592
- var createInstance = /* @__PURE__ */ __name((defaults) => {
593
- const ky2 = /* @__PURE__ */ __name((input, options) => Ky.create(input, validateAndMerge(defaults, options)), "ky");
594
- for (const method of requestMethods) {
595
- ky2[method] = (input, options) => Ky.create(input, validateAndMerge(defaults, options, { method }));
596
- }
597
- ky2.create = (newDefaults) => createInstance(validateAndMerge(newDefaults));
598
- ky2.extend = (newDefaults) => {
599
- if (typeof newDefaults === "function") {
600
- newDefaults = newDefaults(defaults ?? {});
601
- }
602
- return createInstance(validateAndMerge(defaults, newDefaults));
603
- };
604
- ky2.stop = stop;
605
- return ky2;
606
- }, "createInstance");
607
- var ky = createInstance();
608
- var distribution_default = ky;
609
-
610
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/predicate/isLength.mjs
611
- function isLength(value) {
612
- return Number.isSafeInteger(value) && value >= 0;
613
- }
614
- __name(isLength, "isLength");
615
-
616
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs
617
- function isArrayLike(value) {
618
- return value != null && typeof value !== "function" && isLength(value.length);
619
- }
620
- __name(isArrayLike, "isArrayLike");
621
-
622
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/array/compact.mjs
623
- function compact(arr) {
624
- const result = [];
625
- for (let i = 0; i < arr.length; i++) {
626
- const item = arr[i];
627
- if (item) {
628
- result.push(item);
629
- }
630
- }
631
- return result;
632
- }
633
- __name(compact, "compact");
634
-
635
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/compact.mjs
636
- function compact2(arr) {
637
- if (!isArrayLike(arr)) {
638
- return [];
639
- }
640
- return compact(Array.from(arr));
641
- }
642
- __name(compact2, "compact");
643
-
644
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/array/flatten.mjs
645
- function flatten(arr, depth = 1) {
646
- const result = [];
647
- const flooredDepth = Math.floor(depth);
648
- const recursive = /* @__PURE__ */ __name((arr2, currentDepth) => {
649
- for (let i = 0; i < arr2.length; i++) {
650
- const item = arr2[i];
651
- if (Array.isArray(item) && currentDepth < flooredDepth) {
652
- recursive(item, currentDepth + 1);
653
- } else {
654
- result.push(item);
655
- }
656
- }
657
- }, "recursive");
658
- recursive(arr, 0);
659
- return result;
660
- }
661
- __name(flatten, "flatten");
662
-
663
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/function/identity.mjs
664
- function identity(x) {
665
- return x;
666
- }
667
- __name(identity, "identity");
668
-
669
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
670
- function isUnsafeProperty(key) {
671
- return key === "__proto__";
672
- }
673
- __name(isUnsafeProperty, "isUnsafeProperty");
674
-
675
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs
676
- function isDeepKey(key) {
677
- switch (typeof key) {
678
- case "number":
679
- case "symbol": {
680
- return false;
681
- }
682
- case "string": {
683
- return key.includes(".") || key.includes("[") || key.includes("]");
684
- }
685
- }
686
- }
687
- __name(isDeepKey, "isDeepKey");
688
-
689
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/toKey.mjs
690
- function toKey(value) {
691
- if (typeof value === "string" || typeof value === "symbol") {
692
- return value;
693
- }
694
- if (Object.is(value?.valueOf?.(), -0)) {
695
- return "-0";
696
- }
697
- return String(value);
698
- }
699
- __name(toKey, "toKey");
700
-
701
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/util/toPath.mjs
702
- function toPath(deepKey) {
703
- const result = [];
704
- const length = deepKey.length;
705
- if (length === 0) {
706
- return result;
707
- }
708
- let index = 0;
709
- let key = "";
710
- let quoteChar = "";
711
- let bracket = false;
712
- if (deepKey.charCodeAt(0) === 46) {
713
- result.push("");
714
- index++;
715
- }
716
- while (index < length) {
717
- const char = deepKey[index];
718
- if (quoteChar) {
719
- if (char === "\\" && index + 1 < length) {
720
- index++;
721
- key += deepKey[index];
722
- } else if (char === quoteChar) {
723
- quoteChar = "";
724
- } else {
725
- key += char;
726
- }
727
- } else if (bracket) {
728
- if (char === '"' || char === "'") {
729
- quoteChar = char;
730
- } else if (char === "]") {
731
- bracket = false;
732
- result.push(key);
733
- key = "";
734
- } else {
735
- key += char;
736
- }
737
- } else {
738
- if (char === "[") {
739
- bracket = true;
740
- if (key) {
741
- result.push(key);
742
- key = "";
743
- }
744
- } else if (char === ".") {
745
- if (key) {
746
- result.push(key);
747
- key = "";
748
- }
749
- } else {
750
- key += char;
751
- }
752
- }
753
- index++;
754
- }
755
- if (key) {
756
- result.push(key);
757
- }
758
- return result;
759
- }
760
- __name(toPath, "toPath");
761
-
762
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/get.mjs
763
- function get(object, path, defaultValue) {
764
- if (object == null) {
765
- return defaultValue;
766
- }
767
- switch (typeof path) {
768
- case "string": {
769
- if (isUnsafeProperty(path)) {
770
- return defaultValue;
771
- }
772
- const result = object[path];
773
- if (result === void 0) {
774
- if (isDeepKey(path)) {
775
- return get(object, toPath(path), defaultValue);
776
- } else {
777
- return defaultValue;
778
- }
779
- }
780
- return result;
781
- }
782
- case "number":
783
- case "symbol": {
784
- if (typeof path === "number") {
785
- path = toKey(path);
786
- }
787
- const result = object[path];
788
- if (result === void 0) {
789
- return defaultValue;
790
- }
791
- return result;
792
- }
793
- default: {
794
- if (Array.isArray(path)) {
795
- return getWithPath(object, path, defaultValue);
796
- }
797
- if (Object.is(path?.valueOf(), -0)) {
798
- path = "-0";
799
- } else {
800
- path = String(path);
801
- }
802
- if (isUnsafeProperty(path)) {
803
- return defaultValue;
804
- }
805
- const result = object[path];
806
- if (result === void 0) {
807
- return defaultValue;
808
- }
809
- return result;
810
- }
811
- }
812
- }
813
- __name(get, "get");
814
- function getWithPath(object, path, defaultValue) {
815
- if (path.length === 0) {
816
- return defaultValue;
817
- }
818
- let current = object;
819
- for (let index = 0; index < path.length; index++) {
820
- if (current == null) {
821
- return defaultValue;
822
- }
823
- if (isUnsafeProperty(path[index])) {
824
- return defaultValue;
825
- }
826
- current = current[path[index]];
827
- }
828
- if (current === void 0) {
829
- return defaultValue;
830
- }
831
- return current;
832
- }
833
- __name(getWithPath, "getWithPath");
834
-
835
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/property.mjs
836
- function property(path) {
837
- return function(object) {
838
- return get(object, path);
839
- };
840
- }
841
- __name(property, "property");
842
-
843
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isObject.mjs
844
- function isObject2(value) {
845
- return value !== null && (typeof value === "object" || typeof value === "function");
846
- }
847
- __name(isObject2, "isObject");
848
-
849
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
850
- function isPrimitive(value) {
851
- return value == null || typeof value !== "object" && typeof value !== "function";
852
- }
853
- __name(isPrimitive, "isPrimitive");
854
-
855
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/util/eq.mjs
856
- function eq(value, other) {
857
- return value === other || Number.isNaN(value) && Number.isNaN(other);
858
- }
859
- __name(eq, "eq");
860
-
861
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.mjs
862
- function isMatchWith(target, source, compare) {
863
- if (typeof compare !== "function") {
864
- return isMatch(target, source);
865
- }
866
- return isMatchWithInternal(target, source, /* @__PURE__ */ __name(function doesMatch(objValue, srcValue, key, object, source2, stack) {
867
- const isEqual2 = compare(objValue, srcValue, key, object, source2, stack);
868
- if (isEqual2 !== void 0) {
869
- return Boolean(isEqual2);
870
- }
871
- return isMatchWithInternal(objValue, srcValue, doesMatch, stack);
872
- }, "doesMatch"), /* @__PURE__ */ new Map());
873
- }
874
- __name(isMatchWith, "isMatchWith");
875
- function isMatchWithInternal(target, source, compare, stack) {
876
- if (source === target) {
877
- return true;
878
- }
879
- switch (typeof source) {
880
- case "object": {
881
- return isObjectMatch(target, source, compare, stack);
882
- }
883
- case "function": {
884
- const sourceKeys = Object.keys(source);
885
- if (sourceKeys.length > 0) {
886
- return isMatchWithInternal(target, { ...source }, compare, stack);
887
- }
888
- return eq(target, source);
889
- }
890
- default: {
891
- if (!isObject2(target)) {
892
- return eq(target, source);
893
- }
894
- if (typeof source === "string") {
895
- return source === "";
896
- }
897
- return true;
898
- }
899
- }
900
- }
901
- __name(isMatchWithInternal, "isMatchWithInternal");
902
- function isObjectMatch(target, source, compare, stack) {
903
- if (source == null) {
904
- return true;
905
- }
906
- if (Array.isArray(source)) {
907
- return isArrayMatch(target, source, compare, stack);
908
- }
909
- if (source instanceof Map) {
910
- return isMapMatch(target, source, compare, stack);
911
- }
912
- if (source instanceof Set) {
913
- return isSetMatch(target, source, compare, stack);
914
- }
915
- const keys2 = Object.keys(source);
916
- if (target == null) {
917
- return keys2.length === 0;
918
- }
919
- if (keys2.length === 0) {
920
- return true;
921
- }
922
- if (stack && stack.has(source)) {
923
- return stack.get(source) === target;
924
- }
925
- if (stack) {
926
- stack.set(source, target);
927
- }
928
- try {
929
- for (let i = 0; i < keys2.length; i++) {
930
- const key = keys2[i];
931
- if (!isPrimitive(target) && !(key in target)) {
932
- return false;
933
- }
934
- if (source[key] === void 0 && target[key] !== void 0) {
935
- return false;
936
- }
937
- if (source[key] === null && target[key] !== null) {
938
- return false;
939
- }
940
- const isEqual2 = compare(target[key], source[key], key, target, source, stack);
941
- if (!isEqual2) {
942
- return false;
943
- }
944
- }
945
- return true;
946
- } finally {
947
- if (stack) {
948
- stack.delete(source);
949
- }
950
- }
951
- }
952
- __name(isObjectMatch, "isObjectMatch");
953
- function isMapMatch(target, source, compare, stack) {
954
- if (source.size === 0) {
955
- return true;
956
- }
957
- if (!(target instanceof Map)) {
958
- return false;
959
- }
960
- for (const [key, sourceValue] of source.entries()) {
961
- const targetValue = target.get(key);
962
- const isEqual2 = compare(targetValue, sourceValue, key, target, source, stack);
963
- if (isEqual2 === false) {
964
- return false;
965
- }
966
- }
967
- return true;
968
- }
969
- __name(isMapMatch, "isMapMatch");
970
- function isArrayMatch(target, source, compare, stack) {
971
- if (source.length === 0) {
972
- return true;
973
- }
974
- if (!Array.isArray(target)) {
975
- return false;
976
- }
977
- const countedIndex = /* @__PURE__ */ new Set();
978
- for (let i = 0; i < source.length; i++) {
979
- const sourceItem = source[i];
980
- let found = false;
981
- for (let j = 0; j < target.length; j++) {
982
- if (countedIndex.has(j)) {
983
- continue;
984
- }
985
- const targetItem = target[j];
986
- let matches2 = false;
987
- const isEqual2 = compare(targetItem, sourceItem, i, target, source, stack);
988
- if (isEqual2) {
989
- matches2 = true;
990
- }
991
- if (matches2) {
992
- countedIndex.add(j);
993
- found = true;
994
- break;
995
- }
996
- }
997
- if (!found) {
998
- return false;
999
- }
1000
- }
1001
- return true;
1002
- }
1003
- __name(isArrayMatch, "isArrayMatch");
1004
- function isSetMatch(target, source, compare, stack) {
1005
- if (source.size === 0) {
1006
- return true;
1007
- }
1008
- if (!(target instanceof Set)) {
1009
- return false;
1010
- }
1011
- return isArrayMatch([...target], [...source], compare, stack);
1012
- }
1013
- __name(isSetMatch, "isSetMatch");
1014
-
1015
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isMatch.mjs
1016
- function isMatch(target, source) {
1017
- return isMatchWith(target, source, () => void 0);
1018
- }
1019
- __name(isMatch, "isMatch");
1020
-
1021
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
1022
- function getSymbols(object) {
1023
- return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
1024
- }
1025
- __name(getSymbols, "getSymbols");
1026
-
1027
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
1028
- function getTag(value) {
1029
- if (value == null) {
1030
- return value === void 0 ? "[object Undefined]" : "[object Null]";
1031
- }
1032
- return Object.prototype.toString.call(value);
1033
- }
1034
- __name(getTag, "getTag");
1035
-
1036
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/tags.mjs
1037
- var regexpTag = "[object RegExp]";
1038
- var stringTag = "[object String]";
1039
- var numberTag = "[object Number]";
1040
- var booleanTag = "[object Boolean]";
1041
- var argumentsTag = "[object Arguments]";
1042
- var symbolTag = "[object Symbol]";
1043
- var dateTag = "[object Date]";
1044
- var mapTag = "[object Map]";
1045
- var setTag = "[object Set]";
1046
- var arrayTag = "[object Array]";
1047
- var functionTag = "[object Function]";
1048
- var arrayBufferTag = "[object ArrayBuffer]";
1049
- var objectTag = "[object Object]";
1050
- var errorTag = "[object Error]";
1051
- var dataViewTag = "[object DataView]";
1052
- var uint8ArrayTag = "[object Uint8Array]";
1053
- var uint8ClampedArrayTag = "[object Uint8ClampedArray]";
1054
- var uint16ArrayTag = "[object Uint16Array]";
1055
- var uint32ArrayTag = "[object Uint32Array]";
1056
- var bigUint64ArrayTag = "[object BigUint64Array]";
1057
- var int8ArrayTag = "[object Int8Array]";
1058
- var int16ArrayTag = "[object Int16Array]";
1059
- var int32ArrayTag = "[object Int32Array]";
1060
- var bigInt64ArrayTag = "[object BigInt64Array]";
1061
- var float32ArrayTag = "[object Float32Array]";
1062
- var float64ArrayTag = "[object Float64Array]";
1063
-
1064
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
1065
- function isTypedArray(x) {
1066
- return ArrayBuffer.isView(x) && !(x instanceof DataView);
1067
- }
1068
- __name(isTypedArray, "isTypedArray");
1069
-
1070
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/object/cloneDeepWith.mjs
1071
- function cloneDeepWith(obj, cloneValue) {
1072
- return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), cloneValue);
1073
- }
1074
- __name(cloneDeepWith, "cloneDeepWith");
1075
- function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @__PURE__ */ new Map(), cloneValue = void 0) {
1076
- const cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);
1077
- if (cloned != null) {
1078
- return cloned;
1079
- }
1080
- if (isPrimitive(valueToClone)) {
1081
- return valueToClone;
1082
- }
1083
- if (stack.has(valueToClone)) {
1084
- return stack.get(valueToClone);
1085
- }
1086
- if (Array.isArray(valueToClone)) {
1087
- const result = new Array(valueToClone.length);
1088
- stack.set(valueToClone, result);
1089
- for (let i = 0; i < valueToClone.length; i++) {
1090
- result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
1091
- }
1092
- if (Object.hasOwn(valueToClone, "index")) {
1093
- result.index = valueToClone.index;
1094
- }
1095
- if (Object.hasOwn(valueToClone, "input")) {
1096
- result.input = valueToClone.input;
1097
- }
1098
- return result;
1099
- }
1100
- if (valueToClone instanceof Date) {
1101
- return new Date(valueToClone.getTime());
1102
- }
1103
- if (valueToClone instanceof RegExp) {
1104
- const result = new RegExp(valueToClone.source, valueToClone.flags);
1105
- result.lastIndex = valueToClone.lastIndex;
1106
- return result;
1107
- }
1108
- if (valueToClone instanceof Map) {
1109
- const result = /* @__PURE__ */ new Map();
1110
- stack.set(valueToClone, result);
1111
- for (const [key, value] of valueToClone) {
1112
- result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));
1113
- }
1114
- return result;
1115
- }
1116
- if (valueToClone instanceof Set) {
1117
- const result = /* @__PURE__ */ new Set();
1118
- stack.set(valueToClone, result);
1119
- for (const value of valueToClone) {
1120
- result.add(cloneDeepWithImpl(value, void 0, objectToClone, stack, cloneValue));
1121
- }
1122
- return result;
1123
- }
1124
- if (typeof Buffer !== "undefined" && Buffer.isBuffer(valueToClone)) {
1125
- return valueToClone.subarray();
1126
- }
1127
- if (isTypedArray(valueToClone)) {
1128
- const result = new (Object.getPrototypeOf(valueToClone)).constructor(valueToClone.length);
1129
- stack.set(valueToClone, result);
1130
- for (let i = 0; i < valueToClone.length; i++) {
1131
- result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
1132
- }
1133
- return result;
1134
- }
1135
- if (valueToClone instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && valueToClone instanceof SharedArrayBuffer) {
1136
- return valueToClone.slice(0);
1137
- }
1138
- if (valueToClone instanceof DataView) {
1139
- const result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);
1140
- stack.set(valueToClone, result);
1141
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1142
- return result;
1143
- }
1144
- if (typeof File !== "undefined" && valueToClone instanceof File) {
1145
- const result = new File([valueToClone], valueToClone.name, {
1146
- type: valueToClone.type
1147
- });
1148
- stack.set(valueToClone, result);
1149
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1150
- return result;
1151
- }
1152
- if (valueToClone instanceof Blob) {
1153
- const result = new Blob([valueToClone], { type: valueToClone.type });
1154
- stack.set(valueToClone, result);
1155
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1156
- return result;
1157
- }
1158
- if (valueToClone instanceof Error) {
1159
- const result = new valueToClone.constructor();
1160
- stack.set(valueToClone, result);
1161
- result.message = valueToClone.message;
1162
- result.name = valueToClone.name;
1163
- result.stack = valueToClone.stack;
1164
- result.cause = valueToClone.cause;
1165
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1166
- return result;
1167
- }
1168
- if (typeof valueToClone === "object" && isCloneableObject(valueToClone)) {
1169
- const result = Object.create(Object.getPrototypeOf(valueToClone));
1170
- stack.set(valueToClone, result);
1171
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1172
- return result;
1173
- }
1174
- return valueToClone;
1175
- }
1176
- __name(cloneDeepWithImpl, "cloneDeepWithImpl");
1177
- function copyProperties(target, source, objectToClone = target, stack, cloneValue) {
1178
- const keys2 = [...Object.keys(source), ...getSymbols(source)];
1179
- for (let i = 0; i < keys2.length; i++) {
1180
- const key = keys2[i];
1181
- const descriptor = Object.getOwnPropertyDescriptor(target, key);
1182
- if (descriptor == null || descriptor.writable) {
1183
- target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue);
1184
- }
1185
- }
1186
- }
1187
- __name(copyProperties, "copyProperties");
1188
- function isCloneableObject(object) {
1189
- switch (getTag(object)) {
1190
- case argumentsTag:
1191
- case arrayTag:
1192
- case arrayBufferTag:
1193
- case dataViewTag:
1194
- case booleanTag:
1195
- case dateTag:
1196
- case float32ArrayTag:
1197
- case float64ArrayTag:
1198
- case int8ArrayTag:
1199
- case int16ArrayTag:
1200
- case int32ArrayTag:
1201
- case mapTag:
1202
- case numberTag:
1203
- case objectTag:
1204
- case regexpTag:
1205
- case setTag:
1206
- case stringTag:
1207
- case symbolTag:
1208
- case uint8ArrayTag:
1209
- case uint8ClampedArrayTag:
1210
- case uint16ArrayTag:
1211
- case uint32ArrayTag: {
1212
- return true;
1213
- }
1214
- default: {
1215
- return false;
1216
- }
1217
- }
1218
- }
1219
- __name(isCloneableObject, "isCloneableObject");
1220
-
1221
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/object/cloneDeep.mjs
1222
- function cloneDeep(obj) {
1223
- return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), void 0);
1224
- }
1225
- __name(cloneDeep, "cloneDeep");
1226
-
1227
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/matches.mjs
1228
- function matches(source) {
1229
- source = cloneDeep(source);
1230
- return (target) => {
1231
- return isMatch(target, source);
1232
- };
1233
- }
1234
- __name(matches, "matches");
1235
-
1236
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.mjs
1237
- function cloneDeepWith2(obj, customizer) {
1238
- return cloneDeepWith(obj, (value, key, object, stack) => {
1239
- const cloned = customizer?.(value, key, object, stack);
1240
- if (cloned != null) {
1241
- return cloned;
1242
- }
1243
- if (typeof obj !== "object") {
1244
- return void 0;
1245
- }
1246
- switch (Object.prototype.toString.call(obj)) {
1247
- case numberTag:
1248
- case stringTag:
1249
- case booleanTag: {
1250
- const result = new obj.constructor(obj?.valueOf());
1251
- copyProperties(result, obj);
1252
- return result;
1253
- }
1254
- case argumentsTag: {
1255
- const result = {};
1256
- copyProperties(result, obj);
1257
- result.length = obj.length;
1258
- result[Symbol.iterator] = obj[Symbol.iterator];
1259
- return result;
1260
- }
1261
- default: {
1262
- return void 0;
1263
- }
1264
- }
1265
- });
1266
- }
1267
- __name(cloneDeepWith2, "cloneDeepWith");
1268
-
1269
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/cloneDeep.mjs
1270
- function cloneDeep2(obj) {
1271
- return cloneDeepWith2(obj);
1272
- }
1273
- __name(cloneDeep2, "cloneDeep");
1274
-
1275
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs
1276
- var IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
1277
- function isIndex(value, length = Number.MAX_SAFE_INTEGER) {
1278
- switch (typeof value) {
1279
- case "number": {
1280
- return Number.isInteger(value) && value >= 0 && value < length;
1281
- }
1282
- case "symbol": {
1283
- return false;
1284
- }
1285
- case "string": {
1286
- return IS_UNSIGNED_INTEGER.test(value);
1287
- }
1288
- }
1289
- }
1290
- __name(isIndex, "isIndex");
1291
-
1292
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs
1293
- function isArguments(value) {
1294
- return value !== null && typeof value === "object" && getTag(value) === "[object Arguments]";
1295
- }
1296
- __name(isArguments, "isArguments");
1297
-
1298
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/has.mjs
1299
- function has(object, path) {
1300
- let resolvedPath;
1301
- if (Array.isArray(path)) {
1302
- resolvedPath = path;
1303
- } else if (typeof path === "string" && isDeepKey(path) && object?.[path] == null) {
1304
- resolvedPath = toPath(path);
1305
- } else {
1306
- resolvedPath = [path];
1307
- }
1308
- if (resolvedPath.length === 0) {
1309
- return false;
1310
- }
1311
- let current = object;
1312
- for (let i = 0; i < resolvedPath.length; i++) {
1313
- const key = resolvedPath[i];
1314
- if (current == null || !Object.hasOwn(current, key)) {
1315
- const isSparseIndex = (Array.isArray(current) || isArguments(current)) && isIndex(key) && key < current.length;
1316
- if (!isSparseIndex) {
1317
- return false;
1318
- }
1319
- }
1320
- current = current[key];
1321
- }
1322
- return true;
1323
- }
1324
- __name(has, "has");
1325
-
1326
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.mjs
1327
- function matchesProperty(property2, source) {
1328
- switch (typeof property2) {
1329
- case "object": {
1330
- if (Object.is(property2?.valueOf(), -0)) {
1331
- property2 = "-0";
1332
- }
1333
- break;
1334
- }
1335
- case "number": {
1336
- property2 = toKey(property2);
1337
- break;
1338
- }
1339
- }
1340
- source = cloneDeep2(source);
1341
- return function(target) {
1342
- const result = get(target, property2);
1343
- if (result === void 0) {
1344
- return has(target, property2);
1345
- }
1346
- if (source === void 0) {
1347
- return result === void 0;
1348
- }
1349
- return isMatch(result, source);
1350
- };
1351
- }
1352
- __name(matchesProperty, "matchesProperty");
1353
-
1354
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/util/iteratee.mjs
1355
- function iteratee(value) {
1356
- if (value == null) {
1357
- return identity;
1358
- }
1359
- switch (typeof value) {
1360
- case "function": {
1361
- return value;
1362
- }
1363
- case "object": {
1364
- if (Array.isArray(value) && value.length === 2) {
1365
- return matchesProperty(value[0], value[1]);
1366
- }
1367
- return matches(value);
1368
- }
1369
- case "string":
1370
- case "symbol":
1371
- case "number": {
1372
- return property(value);
1373
- }
1374
- }
1375
- }
1376
- __name(iteratee, "iteratee");
1377
-
1378
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.mjs
1379
- function isObjectLike(value) {
1380
- return typeof value === "object" && value !== null;
1381
- }
1382
- __name(isObjectLike, "isObjectLike");
1383
-
1384
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isSymbol.mjs
1385
- function isSymbol(value) {
1386
- return typeof value === "symbol" || value instanceof Symbol;
1387
- }
1388
- __name(isSymbol, "isSymbol");
1389
-
1390
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/util/toNumber.mjs
1391
- function toNumber(value) {
1392
- if (isSymbol(value)) {
1393
- return NaN;
1394
- }
1395
- return Number(value);
1396
- }
1397
- __name(toNumber, "toNumber");
1398
-
1399
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/util/toFinite.mjs
1400
- function toFinite(value) {
1401
- if (!value) {
1402
- return value === 0 ? value : 0;
1403
- }
1404
- value = toNumber(value);
1405
- if (value === Infinity || value === -Infinity) {
1406
- const sign = value < 0 ? -1 : 1;
1407
- return sign * Number.MAX_VALUE;
1408
- }
1409
- return value === value ? value : 0;
1410
- }
1411
- __name(toFinite, "toFinite");
1412
-
1413
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/util/toInteger.mjs
1414
- function toInteger(value) {
1415
- const finite = toFinite(value);
1416
- const remainder = finite % 1;
1417
- return remainder ? finite - remainder : finite;
1418
- }
1419
- __name(toInteger, "toInteger");
1420
-
1421
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/math/range.mjs
1422
- function range(start, end, step = 1) {
1423
- if (end == null) {
1424
- end = start;
1425
- start = 0;
1426
- }
1427
- if (!Number.isInteger(step) || step === 0) {
1428
- throw new Error(`The step value must be a non-zero integer.`);
1429
- }
1430
- const length = Math.max(Math.ceil((end - start) / step), 0);
1431
- const result = new Array(length);
1432
- for (let i = 0; i < length; i++) {
1433
- result[i] = start + i * step;
1434
- }
1435
- return result;
1436
- }
1437
- __name(range, "range");
1
+ import ky from 'ky';
2
+ import { values, isBoolean, isString, isFinite, isNil, keys, get, isEqual, unset, set, some, pickBy, each, flatten, compact, filter, isArray, map, isObject, times, isInteger, sortBy, keyBy, omit, find, groupBy } from 'es-toolkit/compat';
1438
3
 
1439
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/forEach.mjs
1440
- function forEach(collection, callback = identity) {
1441
- if (!collection) {
1442
- return collection;
1443
- }
1444
- const keys2 = isArrayLike(collection) || Array.isArray(collection) ? range(0, collection.length) : Object.keys(collection);
1445
- for (let i = 0; i < keys2.length; i++) {
1446
- const key = keys2[i];
1447
- const value = collection[key];
1448
- const result = callback(value, key, collection);
1449
- if (result === false) {
1450
- break;
1451
- }
1452
- }
1453
- return collection;
1454
- }
1455
- __name(forEach, "forEach");
1456
-
1457
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.mjs
1458
- function isIterateeCall(value, index, object) {
1459
- if (!isObject2(object)) {
1460
- return false;
1461
- }
1462
- if (typeof index === "number" && isArrayLike(object) && isIndex(index) && index < object.length || typeof index === "string" && index in object) {
1463
- return eq(object[index], value);
1464
- }
1465
- return false;
1466
- }
1467
- __name(isIterateeCall, "isIterateeCall");
1468
-
1469
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isString.mjs
1470
- function isString(value) {
1471
- return typeof value === "string" || value instanceof String;
1472
- }
1473
- __name(isString, "isString");
1474
-
1475
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/filter.mjs
1476
- function filter(source, predicate = identity) {
1477
- if (!source) {
1478
- return [];
1479
- }
1480
- predicate = iteratee(predicate);
1481
- if (!Array.isArray(source)) {
1482
- const result2 = [];
1483
- const keys2 = Object.keys(source);
1484
- const length2 = isArrayLike(source) ? source.length : keys2.length;
1485
- for (let i = 0; i < length2; i++) {
1486
- const key = keys2[i];
1487
- const value = source[key];
1488
- if (predicate(value, key, source)) {
1489
- result2.push(value);
1490
- }
1491
- }
1492
- return result2;
1493
- }
1494
- const result = [];
1495
- const length = source.length;
1496
- for (let i = 0; i < length; i++) {
1497
- const value = source[i];
1498
- if (predicate(value, i, source)) {
1499
- result.push(value);
1500
- }
1501
- }
1502
- return result;
1503
- }
1504
- __name(filter, "filter");
1505
-
1506
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/find.mjs
1507
- function find(source, _doesMatch = identity, fromIndex = 0) {
1508
- if (!source) {
1509
- return void 0;
1510
- }
1511
- if (fromIndex < 0) {
1512
- fromIndex = Math.max(source.length + fromIndex, 0);
1513
- }
1514
- const doesMatch = iteratee(_doesMatch);
1515
- if (typeof doesMatch === "function" && !Array.isArray(source)) {
1516
- const keys2 = Object.keys(source);
1517
- for (let i = fromIndex; i < keys2.length; i++) {
1518
- const key = keys2[i];
1519
- const value = source[key];
1520
- if (doesMatch(value, key, source)) {
1521
- return value;
1522
- }
1523
- }
1524
- return void 0;
1525
- }
1526
- const values2 = Array.isArray(source) ? source.slice(fromIndex) : Object.values(source).slice(fromIndex);
1527
- return values2.find(doesMatch);
1528
- }
1529
- __name(find, "find");
1530
-
1531
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/flatten.mjs
1532
- function flatten2(value, depth = 1) {
1533
- const result = [];
1534
- const flooredDepth = Math.floor(depth);
1535
- if (!isArrayLike(value)) {
1536
- return result;
1537
- }
1538
- const recursive = /* @__PURE__ */ __name((arr, currentDepth) => {
1539
- for (let i = 0; i < arr.length; i++) {
1540
- const item = arr[i];
1541
- if (currentDepth < flooredDepth && (Array.isArray(item) || Boolean(item?.[Symbol.isConcatSpreadable]) || item !== null && typeof item === "object" && Object.prototype.toString.call(item) === "[object Arguments]")) {
1542
- if (Array.isArray(item)) {
1543
- recursive(item, currentDepth + 1);
1544
- } else {
1545
- recursive(Array.from(item), currentDepth + 1);
1546
- }
1547
- } else {
1548
- result.push(item);
1549
- }
1550
- }
1551
- }, "recursive");
1552
- recursive(Array.from(value), 0);
1553
- return result;
1554
- }
1555
- __name(flatten2, "flatten");
1556
-
1557
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/map.mjs
1558
- function map(collection, _iteratee) {
1559
- if (!collection) {
1560
- return [];
1561
- }
1562
- const keys2 = isArrayLike(collection) || Array.isArray(collection) ? range(0, collection.length) : Object.keys(collection);
1563
- const iteratee$1 = iteratee(_iteratee ?? identity);
1564
- const result = new Array(keys2.length);
1565
- for (let i = 0; i < keys2.length; i++) {
1566
- const key = keys2[i];
1567
- const value = collection[key];
1568
- result[i] = iteratee$1(value, key, collection);
1569
- }
1570
- return result;
1571
- }
1572
- __name(map, "map");
1573
-
1574
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/array/groupBy.mjs
1575
- function groupBy(arr, getKeyFromItem) {
1576
- const result = {};
1577
- for (let i = 0; i < arr.length; i++) {
1578
- const item = arr[i];
1579
- const key = getKeyFromItem(item);
1580
- if (!Object.hasOwn(result, key)) {
1581
- result[key] = [];
1582
- }
1583
- result[key].push(item);
1584
- }
1585
- return result;
1586
- }
1587
- __name(groupBy, "groupBy");
1588
-
1589
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/groupBy.mjs
1590
- function groupBy2(source, _getKeyFromItem) {
1591
- if (source == null) {
1592
- return {};
1593
- }
1594
- const items = isArrayLike(source) ? Array.from(source) : Object.values(source);
1595
- const getKeyFromItem = iteratee(_getKeyFromItem ?? identity);
1596
- return groupBy(items, getKeyFromItem);
1597
- }
1598
- __name(groupBy2, "groupBy");
1599
-
1600
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/reduce.mjs
1601
- function reduce(collection, iteratee2 = identity, accumulator) {
1602
- if (!collection) {
1603
- return accumulator;
1604
- }
1605
- let keys2;
1606
- let startIndex = 0;
1607
- if (isArrayLike(collection)) {
1608
- keys2 = range(0, collection.length);
1609
- if (accumulator == null && collection.length > 0) {
1610
- accumulator = collection[0];
1611
- startIndex += 1;
1612
- }
1613
- } else {
1614
- keys2 = Object.keys(collection);
1615
- if (accumulator == null) {
1616
- accumulator = collection[keys2[0]];
1617
- startIndex += 1;
1618
- }
1619
- }
1620
- for (let i = startIndex; i < keys2.length; i++) {
1621
- const key = keys2[i];
1622
- const value = collection[key];
1623
- accumulator = iteratee2(accumulator, value, key, collection);
1624
- }
1625
- return accumulator;
1626
- }
1627
- __name(reduce, "reduce");
1628
-
1629
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/keyBy.mjs
1630
- function keyBy(collection, iteratee$1) {
1631
- if (!isArrayLike(collection) && !isObjectLike(collection)) {
1632
- return {};
1633
- }
1634
- const keyFn = iteratee(iteratee$1 ?? identity);
1635
- return reduce(collection, (result, value) => {
1636
- const key = keyFn(value);
1637
- result[key] = value;
1638
- return result;
1639
- }, {});
1640
- }
1641
- __name(keyBy, "keyBy");
1642
-
1643
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/compareValues.mjs
1644
- function getPriority(a) {
1645
- if (typeof a === "symbol") {
1646
- return 1;
1647
- }
1648
- if (a === null) {
1649
- return 2;
1650
- }
1651
- if (a === void 0) {
1652
- return 3;
1653
- }
1654
- if (a !== a) {
1655
- return 4;
1656
- }
1657
- return 0;
1658
- }
1659
- __name(getPriority, "getPriority");
1660
- var compareValues = /* @__PURE__ */ __name((a, b, order) => {
1661
- if (a !== b) {
1662
- const aPriority = getPriority(a);
1663
- const bPriority = getPriority(b);
1664
- if (aPriority === bPriority && aPriority === 0) {
1665
- if (a < b) {
1666
- return order === "desc" ? 1 : -1;
1667
- }
1668
- if (a > b) {
1669
- return order === "desc" ? -1 : 1;
1670
- }
1671
- }
1672
- return order === "desc" ? bPriority - aPriority : aPriority - bPriority;
1673
- }
1674
- return 0;
1675
- }, "compareValues");
1676
-
1677
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/isKey.mjs
1678
- var regexIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
1679
- var regexIsPlainProp = /^\w*$/;
1680
- function isKey(value, object) {
1681
- if (Array.isArray(value)) {
1682
- return false;
1683
- }
1684
- if (typeof value === "number" || typeof value === "boolean" || value == null || isSymbol(value)) {
1685
- return true;
1686
- }
1687
- return typeof value === "string" && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value)) || object != null && Object.hasOwn(object, value);
1688
- }
1689
- __name(isKey, "isKey");
1690
-
1691
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/orderBy.mjs
1692
- function orderBy(collection, criteria, orders, guard) {
1693
- if (collection == null) {
1694
- return [];
1695
- }
1696
- orders = guard ? void 0 : orders;
1697
- if (!Array.isArray(collection)) {
1698
- collection = Object.values(collection);
1699
- }
1700
- if (!Array.isArray(criteria)) {
1701
- criteria = criteria == null ? [null] : [criteria];
1702
- }
1703
- if (criteria.length === 0) {
1704
- criteria = [null];
1705
- }
1706
- if (!Array.isArray(orders)) {
1707
- orders = orders == null ? [] : [orders];
1708
- }
1709
- orders = orders.map((order) => String(order));
1710
- const getValueByNestedPath = /* @__PURE__ */ __name((object, path) => {
1711
- let target = object;
1712
- for (let i = 0; i < path.length && target != null; ++i) {
1713
- target = target[path[i]];
1714
- }
1715
- return target;
1716
- }, "getValueByNestedPath");
1717
- const getValueByCriterion = /* @__PURE__ */ __name((criterion, object) => {
1718
- if (object == null || criterion == null) {
1719
- return object;
1720
- }
1721
- if (typeof criterion === "object" && "key" in criterion) {
1722
- if (Object.hasOwn(object, criterion.key)) {
1723
- return object[criterion.key];
1724
- }
1725
- return getValueByNestedPath(object, criterion.path);
1726
- }
1727
- if (typeof criterion === "function") {
1728
- return criterion(object);
1729
- }
1730
- if (Array.isArray(criterion)) {
1731
- return getValueByNestedPath(object, criterion);
1732
- }
1733
- if (typeof object === "object") {
1734
- return object[criterion];
1735
- }
1736
- return object;
1737
- }, "getValueByCriterion");
1738
- const preparedCriteria = criteria.map((criterion) => {
1739
- if (Array.isArray(criterion) && criterion.length === 1) {
1740
- criterion = criterion[0];
1741
- }
1742
- if (criterion == null || typeof criterion === "function" || Array.isArray(criterion) || isKey(criterion)) {
1743
- return criterion;
1744
- }
1745
- return { key: criterion, path: toPath(criterion) };
1746
- });
1747
- const preparedCollection = collection.map((item) => ({
1748
- original: item,
1749
- criteria: preparedCriteria.map((criterion) => getValueByCriterion(criterion, item))
1750
- }));
1751
- return preparedCollection.slice().sort((a, b) => {
1752
- for (let i = 0; i < preparedCriteria.length; i++) {
1753
- const comparedResult = compareValues(a.criteria[i], b.criteria[i], orders[i]);
1754
- if (comparedResult !== 0) {
1755
- return comparedResult;
1756
- }
1757
- }
1758
- return 0;
1759
- }).map((item) => item.original);
1760
- }
1761
- __name(orderBy, "orderBy");
1762
-
1763
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/unset.mjs
1764
- function unset(obj, path) {
1765
- if (obj == null) {
1766
- return true;
1767
- }
1768
- switch (typeof path) {
1769
- case "symbol":
1770
- case "number":
1771
- case "object": {
1772
- if (Array.isArray(path)) {
1773
- return unsetWithPath(obj, path);
1774
- }
1775
- if (typeof path === "number") {
1776
- path = toKey(path);
1777
- } else if (typeof path === "object") {
1778
- if (Object.is(path?.valueOf(), -0)) {
1779
- path = "-0";
1780
- } else {
1781
- path = String(path);
1782
- }
1783
- }
1784
- if (isUnsafeProperty(path)) {
1785
- return false;
1786
- }
1787
- if (obj?.[path] === void 0) {
1788
- return true;
1789
- }
1790
- try {
1791
- delete obj[path];
1792
- return true;
1793
- } catch {
1794
- return false;
1795
- }
1796
- }
1797
- case "string": {
1798
- if (obj?.[path] === void 0 && isDeepKey(path)) {
1799
- return unsetWithPath(obj, toPath(path));
1800
- }
1801
- if (isUnsafeProperty(path)) {
1802
- return false;
1803
- }
1804
- try {
1805
- delete obj[path];
1806
- return true;
1807
- } catch {
1808
- return false;
1809
- }
1810
- }
1811
- }
1812
- }
1813
- __name(unset, "unset");
1814
- function unsetWithPath(obj, path) {
1815
- const parent = get(obj, path.slice(0, -1), obj);
1816
- const lastKey = path[path.length - 1];
1817
- if (parent?.[lastKey] === void 0) {
1818
- return true;
1819
- }
1820
- if (isUnsafeProperty(lastKey)) {
1821
- return false;
1822
- }
1823
- try {
1824
- delete parent[lastKey];
1825
- return true;
1826
- } catch {
1827
- return false;
1828
- }
1829
- }
1830
- __name(unsetWithPath, "unsetWithPath");
1831
-
1832
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isArray.mjs
1833
- function isArray(value) {
1834
- return Array.isArray(value);
1835
- }
1836
- __name(isArray, "isArray");
1837
-
1838
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/values.mjs
1839
- function values(object) {
1840
- if (object == null) {
1841
- return [];
1842
- }
1843
- return Object.values(object);
1844
- }
1845
- __name(values, "values");
1846
-
1847
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isNil.mjs
1848
- function isNil(x) {
1849
- return x == null;
1850
- }
1851
- __name(isNil, "isNil");
1852
-
1853
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/some.mjs
1854
- function some(source, predicate, guard) {
1855
- if (!source) {
1856
- return false;
1857
- }
1858
- if (guard != null) {
1859
- predicate = void 0;
1860
- }
1861
- if (!predicate) {
1862
- predicate = identity;
1863
- }
1864
- const values2 = Array.isArray(source) ? source : Object.values(source);
1865
- switch (typeof predicate) {
1866
- case "function": {
1867
- if (!Array.isArray(source)) {
1868
- const keys2 = Object.keys(source);
1869
- for (let i = 0; i < keys2.length; i++) {
1870
- const key = keys2[i];
1871
- const value = source[key];
1872
- if (predicate(value, key, source)) {
1873
- return true;
1874
- }
1875
- }
1876
- return false;
1877
- }
1878
- for (let i = 0; i < source.length; i++) {
1879
- if (predicate(source[i], i, source)) {
1880
- return true;
1881
- }
1882
- }
1883
- return false;
1884
- }
1885
- case "object": {
1886
- if (Array.isArray(predicate) && predicate.length === 2) {
1887
- const key = predicate[0];
1888
- const value = predicate[1];
1889
- const matchFunc = matchesProperty(key, value);
1890
- if (Array.isArray(source)) {
1891
- for (let i = 0; i < source.length; i++) {
1892
- if (matchFunc(source[i])) {
1893
- return true;
1894
- }
1895
- }
1896
- return false;
1897
- }
1898
- return values2.some(matchFunc);
1899
- } else {
1900
- const matchFunc = matches(predicate);
1901
- if (Array.isArray(source)) {
1902
- for (let i = 0; i < source.length; i++) {
1903
- if (matchFunc(source[i])) {
1904
- return true;
1905
- }
1906
- }
1907
- return false;
1908
- }
1909
- return values2.some(matchFunc);
1910
- }
1911
- }
1912
- case "number":
1913
- case "symbol":
1914
- case "string": {
1915
- const propFunc = property(predicate);
1916
- if (Array.isArray(source)) {
1917
- for (let i = 0; i < source.length; i++) {
1918
- if (propFunc(source[i])) {
1919
- return true;
1920
- }
1921
- }
1922
- return false;
1923
- }
1924
- return values2.some(propFunc);
1925
- }
1926
- }
1927
- }
1928
- __name(some, "some");
1929
-
1930
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/array/sortBy.mjs
1931
- function sortBy(collection, ...criteria) {
1932
- const length = criteria.length;
1933
- if (length > 1 && isIterateeCall(collection, criteria[0], criteria[1])) {
1934
- criteria = [];
1935
- } else if (length > 2 && isIterateeCall(criteria[0], criteria[1], criteria[2])) {
1936
- criteria = [criteria[0]];
1937
- }
1938
- return orderBy(collection, flatten(criteria), ["asc"]);
1939
- }
1940
- __name(sortBy, "sortBy");
1941
-
1942
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/function/identity.mjs
1943
- function identity2(x) {
1944
- return x;
1945
- }
1946
- __name(identity2, "identity");
1947
-
1948
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/assignValue.mjs
1949
- var assignValue = /* @__PURE__ */ __name((object, key, value) => {
1950
- const objValue = object[key];
1951
- if (!(Object.hasOwn(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
1952
- object[key] = value;
1953
- }
1954
- }, "assignValue");
1955
-
1956
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/updateWith.mjs
1957
- function updateWith(obj, path, updater, customizer) {
1958
- if (obj == null && !isObject2(obj)) {
1959
- return obj;
1960
- }
1961
- const resolvedPath = isKey(path, obj) ? [path] : Array.isArray(path) ? path : typeof path === "string" ? toPath(path) : [path];
1962
- let current = obj;
1963
- for (let i = 0; i < resolvedPath.length && current != null; i++) {
1964
- const key = toKey(resolvedPath[i]);
1965
- if (isUnsafeProperty(key)) {
1966
- continue;
1967
- }
1968
- let newValue;
1969
- if (i === resolvedPath.length - 1) {
1970
- newValue = updater(current[key]);
1971
- } else {
1972
- const objValue = current[key];
1973
- const customizerResult = customizer?.(objValue, key, obj);
1974
- newValue = customizerResult !== void 0 ? customizerResult : isObject2(objValue) ? objValue : isIndex(resolvedPath[i + 1]) ? [] : {};
1975
- }
1976
- assignValue(current, key, newValue);
1977
- current = current[key];
1978
- }
1979
- return obj;
1980
- }
1981
- __name(updateWith, "updateWith");
1982
-
1983
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/set.mjs
1984
- function set(obj, path, value) {
1985
- return updateWith(obj, path, () => value, () => void 0);
1986
- }
1987
- __name(set, "set");
1988
-
1989
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
1990
- function isPlainObject(value) {
1991
- if (!value || typeof value !== "object") {
1992
- return false;
1993
- }
1994
- const proto = Object.getPrototypeOf(value);
1995
- const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
1996
- if (!hasObjectPrototype) {
1997
- return false;
1998
- }
1999
- return Object.prototype.toString.call(value) === "[object Object]";
2000
- }
2001
- __name(isPlainObject, "isPlainObject");
2002
-
2003
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/predicate/isEqualWith.mjs
2004
- function isEqualWith(a, b, areValuesEqual) {
2005
- return isEqualWithImpl(a, b, void 0, void 0, void 0, void 0, areValuesEqual);
2006
- }
2007
- __name(isEqualWith, "isEqualWith");
2008
- function isEqualWithImpl(a, b, property2, aParent, bParent, stack, areValuesEqual) {
2009
- const result = areValuesEqual(a, b, property2, aParent, bParent, stack);
2010
- if (result !== void 0) {
2011
- return result;
2012
- }
2013
- if (typeof a === typeof b) {
2014
- switch (typeof a) {
2015
- case "bigint":
2016
- case "string":
2017
- case "boolean":
2018
- case "symbol":
2019
- case "undefined": {
2020
- return a === b;
2021
- }
2022
- case "number": {
2023
- return a === b || Object.is(a, b);
2024
- }
2025
- case "function": {
2026
- return a === b;
2027
- }
2028
- case "object": {
2029
- return areObjectsEqual(a, b, stack, areValuesEqual);
2030
- }
2031
- }
2032
- }
2033
- return areObjectsEqual(a, b, stack, areValuesEqual);
2034
- }
2035
- __name(isEqualWithImpl, "isEqualWithImpl");
2036
- function areObjectsEqual(a, b, stack, areValuesEqual) {
2037
- if (Object.is(a, b)) {
2038
- return true;
2039
- }
2040
- let aTag = getTag(a);
2041
- let bTag = getTag(b);
2042
- if (aTag === argumentsTag) {
2043
- aTag = objectTag;
2044
- }
2045
- if (bTag === argumentsTag) {
2046
- bTag = objectTag;
2047
- }
2048
- if (aTag !== bTag) {
2049
- return false;
2050
- }
2051
- switch (aTag) {
2052
- case stringTag:
2053
- return a.toString() === b.toString();
2054
- case numberTag: {
2055
- const x = a.valueOf();
2056
- const y = b.valueOf();
2057
- return eq(x, y);
2058
- }
2059
- case booleanTag:
2060
- case dateTag:
2061
- case symbolTag:
2062
- return Object.is(a.valueOf(), b.valueOf());
2063
- case regexpTag: {
2064
- return a.source === b.source && a.flags === b.flags;
2065
- }
2066
- case functionTag: {
2067
- return a === b;
2068
- }
2069
- }
2070
- stack = stack ?? /* @__PURE__ */ new Map();
2071
- const aStack = stack.get(a);
2072
- const bStack = stack.get(b);
2073
- if (aStack != null && bStack != null) {
2074
- return aStack === b;
2075
- }
2076
- stack.set(a, b);
2077
- stack.set(b, a);
2078
- try {
2079
- switch (aTag) {
2080
- case mapTag: {
2081
- if (a.size !== b.size) {
2082
- return false;
2083
- }
2084
- for (const [key, value] of a.entries()) {
2085
- if (!b.has(key) || !isEqualWithImpl(value, b.get(key), key, a, b, stack, areValuesEqual)) {
2086
- return false;
2087
- }
2088
- }
2089
- return true;
2090
- }
2091
- case setTag: {
2092
- if (a.size !== b.size) {
2093
- return false;
2094
- }
2095
- const aValues = Array.from(a.values());
2096
- const bValues = Array.from(b.values());
2097
- for (let i = 0; i < aValues.length; i++) {
2098
- const aValue = aValues[i];
2099
- const index = bValues.findIndex((bValue) => {
2100
- return isEqualWithImpl(aValue, bValue, void 0, a, b, stack, areValuesEqual);
2101
- });
2102
- if (index === -1) {
2103
- return false;
2104
- }
2105
- bValues.splice(index, 1);
2106
- }
2107
- return true;
2108
- }
2109
- case arrayTag:
2110
- case uint8ArrayTag:
2111
- case uint8ClampedArrayTag:
2112
- case uint16ArrayTag:
2113
- case uint32ArrayTag:
2114
- case bigUint64ArrayTag:
2115
- case int8ArrayTag:
2116
- case int16ArrayTag:
2117
- case int32ArrayTag:
2118
- case bigInt64ArrayTag:
2119
- case float32ArrayTag:
2120
- case float64ArrayTag: {
2121
- if (typeof Buffer !== "undefined" && Buffer.isBuffer(a) !== Buffer.isBuffer(b)) {
2122
- return false;
2123
- }
2124
- if (a.length !== b.length) {
2125
- return false;
2126
- }
2127
- for (let i = 0; i < a.length; i++) {
2128
- if (!isEqualWithImpl(a[i], b[i], i, a, b, stack, areValuesEqual)) {
2129
- return false;
2130
- }
2131
- }
2132
- return true;
2133
- }
2134
- case arrayBufferTag: {
2135
- if (a.byteLength !== b.byteLength) {
2136
- return false;
2137
- }
2138
- return areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
2139
- }
2140
- case dataViewTag: {
2141
- if (a.byteLength !== b.byteLength || a.byteOffset !== b.byteOffset) {
2142
- return false;
2143
- }
2144
- return areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
2145
- }
2146
- case errorTag: {
2147
- return a.name === b.name && a.message === b.message;
2148
- }
2149
- case objectTag: {
2150
- const areEqualInstances = areObjectsEqual(a.constructor, b.constructor, stack, areValuesEqual) || isPlainObject(a) && isPlainObject(b);
2151
- if (!areEqualInstances) {
2152
- return false;
2153
- }
2154
- const aKeys = [...Object.keys(a), ...getSymbols(a)];
2155
- const bKeys = [...Object.keys(b), ...getSymbols(b)];
2156
- if (aKeys.length !== bKeys.length) {
2157
- return false;
2158
- }
2159
- for (let i = 0; i < aKeys.length; i++) {
2160
- const propKey = aKeys[i];
2161
- const aProp = a[propKey];
2162
- if (!Object.hasOwn(b, propKey)) {
2163
- return false;
2164
- }
2165
- const bProp = b[propKey];
2166
- if (!isEqualWithImpl(aProp, bProp, propKey, a, b, stack, areValuesEqual)) {
2167
- return false;
2168
- }
2169
- }
2170
- return true;
2171
- }
2172
- default: {
2173
- return false;
2174
- }
2175
- }
2176
- } finally {
2177
- stack.delete(a);
2178
- stack.delete(b);
2179
- }
2180
- }
2181
- __name(areObjectsEqual, "areObjectsEqual");
2182
-
2183
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/function/noop.mjs
2184
- function noop() {
2185
- }
2186
- __name(noop, "noop");
2187
-
2188
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/predicate/isEqual.mjs
2189
- function isEqual(a, b) {
2190
- return isEqualWith(a, b, noop);
2191
- }
2192
- __name(isEqual, "isEqual");
2193
-
2194
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/predicate/isBuffer.mjs
2195
- function isBuffer(x) {
2196
- return typeof Buffer !== "undefined" && Buffer.isBuffer(x);
2197
- }
2198
- __name(isBuffer, "isBuffer");
2199
-
2200
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs
2201
- function isPrototype(value) {
2202
- const constructor = value?.constructor;
2203
- const prototype = typeof constructor === "function" ? constructor.prototype : Object.prototype;
2204
- return value === prototype;
2205
- }
2206
- __name(isPrototype, "isPrototype");
2207
-
2208
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.mjs
2209
- function isTypedArray2(x) {
2210
- return isTypedArray(x);
2211
- }
2212
- __name(isTypedArray2, "isTypedArray");
2213
-
2214
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/util/times.mjs
2215
- function times(n, getValue) {
2216
- n = toInteger(n);
2217
- if (n < 1 || !Number.isSafeInteger(n)) {
2218
- return [];
2219
- }
2220
- const result = new Array(n);
2221
- for (let i = 0; i < n; i++) {
2222
- result[i] = typeof getValue === "function" ? getValue(i) : i;
2223
- }
2224
- return result;
2225
- }
2226
- __name(times, "times");
2227
-
2228
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/keys.mjs
2229
- function keys(object) {
2230
- if (isArrayLike(object)) {
2231
- return arrayLikeKeys(object);
2232
- }
2233
- const result = Object.keys(Object(object));
2234
- if (!isPrototype(object)) {
2235
- return result;
2236
- }
2237
- return result.filter((key) => key !== "constructor");
2238
- }
2239
- __name(keys, "keys");
2240
- function arrayLikeKeys(object) {
2241
- const indices = times(object.length, (index) => `${index}`);
2242
- const filteredKeys = new Set(indices);
2243
- if (isBuffer(object)) {
2244
- filteredKeys.add("offset");
2245
- filteredKeys.add("parent");
2246
- }
2247
- if (isTypedArray2(object)) {
2248
- filteredKeys.add("buffer");
2249
- filteredKeys.add("byteLength");
2250
- filteredKeys.add("byteOffset");
2251
- }
2252
- return [...indices, ...Object.keys(object).filter((key) => !filteredKeys.has(key))];
2253
- }
2254
- __name(arrayLikeKeys, "arrayLikeKeys");
2255
-
2256
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/keysIn.mjs
2257
- function keysIn(object) {
2258
- if (object == null) {
2259
- return [];
2260
- }
2261
- switch (typeof object) {
2262
- case "object":
2263
- case "function": {
2264
- if (isArrayLike(object)) {
2265
- return arrayLikeKeysIn(object);
2266
- }
2267
- if (isPrototype(object)) {
2268
- return prototypeKeysIn(object);
2269
- }
2270
- return keysInImpl(object);
2271
- }
2272
- default: {
2273
- return keysInImpl(Object(object));
2274
- }
2275
- }
2276
- }
2277
- __name(keysIn, "keysIn");
2278
- function keysInImpl(object) {
2279
- const result = [];
2280
- for (const key in object) {
2281
- result.push(key);
2282
- }
2283
- return result;
2284
- }
2285
- __name(keysInImpl, "keysInImpl");
2286
- function prototypeKeysIn(object) {
2287
- const keys2 = keysInImpl(object);
2288
- return keys2.filter((key) => key !== "constructor");
2289
- }
2290
- __name(prototypeKeysIn, "prototypeKeysIn");
2291
- function arrayLikeKeysIn(object) {
2292
- const indices = times(object.length, (index) => `${index}`);
2293
- const filteredKeys = new Set(indices);
2294
- if (isBuffer(object)) {
2295
- filteredKeys.add("offset");
2296
- filteredKeys.add("parent");
2297
- }
2298
- if (isTypedArray2(object)) {
2299
- filteredKeys.add("buffer");
2300
- filteredKeys.add("byteLength");
2301
- filteredKeys.add("byteOffset");
2302
- }
2303
- return [...indices, ...keysInImpl(object).filter((key) => !filteredKeys.has(key))];
2304
- }
2305
- __name(arrayLikeKeysIn, "arrayLikeKeysIn");
2306
-
2307
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/omit.mjs
2308
- function omit(obj, ...keysArr) {
2309
- if (obj == null) {
2310
- return {};
2311
- }
2312
- const result = cloneDeep(obj);
2313
- for (let i = 0; i < keysArr.length; i++) {
2314
- let keys2 = keysArr[i];
2315
- switch (typeof keys2) {
2316
- case "object": {
2317
- if (!Array.isArray(keys2)) {
2318
- keys2 = Array.from(keys2);
2319
- }
2320
- for (let j = 0; j < keys2.length; j++) {
2321
- const key = keys2[j];
2322
- unset(result, key);
2323
- }
2324
- break;
2325
- }
2326
- case "string":
2327
- case "symbol":
2328
- case "number": {
2329
- unset(result, keys2);
2330
- break;
2331
- }
2332
- }
2333
- }
2334
- return result;
2335
- }
2336
- __name(omit, "omit");
2337
-
2338
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/_internal/getSymbolsIn.mjs
2339
- function getSymbolsIn(object) {
2340
- const result = [];
2341
- while (object) {
2342
- result.push(...getSymbols(object));
2343
- object = Object.getPrototypeOf(object);
2344
- }
2345
- return result;
2346
- }
2347
- __name(getSymbolsIn, "getSymbolsIn");
2348
-
2349
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/object/pickBy.mjs
2350
- function pickBy(obj, shouldPick) {
2351
- if (obj == null) {
2352
- return {};
2353
- }
2354
- const predicate = iteratee(shouldPick ?? identity2);
2355
- const result = {};
2356
- const keys2 = isArrayLike(obj) ? range(0, obj.length) : [...keysIn(obj), ...getSymbolsIn(obj)];
2357
- for (let i = 0; i < keys2.length; i++) {
2358
- const key = isSymbol(keys2[i]) ? keys2[i] : keys2[i].toString();
2359
- const value = obj[key];
2360
- if (predicate(value, key, obj)) {
2361
- result[key] = value;
2362
- }
2363
- }
2364
- return result;
2365
- }
2366
- __name(pickBy, "pickBy");
2367
-
2368
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isBoolean.mjs
2369
- function isBoolean(value) {
2370
- return typeof value === "boolean" || value instanceof Boolean;
2371
- }
2372
- __name(isBoolean, "isBoolean");
2373
-
2374
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isFinite.mjs
2375
- function isFinite(value) {
2376
- return Number.isFinite(value);
2377
- }
2378
- __name(isFinite, "isFinite");
2379
-
2380
- // node_modules/.pnpm/es-toolkit@1.39.8/node_modules/es-toolkit/dist/compat/predicate/isInteger.mjs
2381
- function isInteger(value) {
2382
- return Number.isInteger(value);
2383
- }
2384
- __name(isInteger, "isInteger");
4
+ var __defProp = Object.defineProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
2385
6
 
2386
7
  // src/lib/utils.ts
2387
8
  function getFieldMask(obj) {
@@ -2418,8 +39,8 @@ function letterToColumn(letter) {
2418
39
  }
2419
40
  __name(letterToColumn, "letterToColumn");
2420
41
  function checkForDuplicateHeaders(headers) {
2421
- const checkForDupes = groupBy2(headers);
2422
- forEach(checkForDupes, (grouped, header) => {
42
+ const checkForDupes = groupBy(headers);
43
+ each(checkForDupes, (grouped, header) => {
2423
44
  if (!header) return;
2424
45
  if (grouped.length > 1) {
2425
46
  throw new Error(`Duplicate header detected: "${header}". Please make sure all non-empty headers are unique`);
@@ -2918,17 +539,17 @@ var GoogleSpreadsheetWorksheet = class {
2918
539
  this._cells = [];
2919
540
  }
2920
541
  _fillCellData(dataRanges) {
2921
- forEach(dataRanges, (range2) => {
2922
- const startRow = range2.startRow || 0;
2923
- const startColumn = range2.startColumn || 0;
2924
- const numRows = range2.rowMetadata.length;
2925
- const numColumns = range2.columnMetadata.length;
542
+ each(dataRanges, (range) => {
543
+ const startRow = range.startRow || 0;
544
+ const startColumn = range.startColumn || 0;
545
+ const numRows = range.rowMetadata.length;
546
+ const numColumns = range.columnMetadata.length;
2926
547
  for (let i = 0; i < numRows; i++) {
2927
548
  const actualRow = startRow + i;
2928
549
  for (let j = 0; j < numColumns; j++) {
2929
550
  const actualColumn = startColumn + j;
2930
551
  if (!this._cells[actualRow]) this._cells[actualRow] = [];
2931
- const cellData = get(range2, `rowData[${i}].values[${j}]`);
552
+ const cellData = get(range, `rowData[${i}].values[${j}]`);
2932
553
  if (this._cells[actualRow][actualColumn]) {
2933
554
  this._cells[actualRow][actualColumn]._updateRawData(cellData);
2934
555
  } else {
@@ -2941,21 +562,21 @@ var GoogleSpreadsheetWorksheet = class {
2941
562
  }
2942
563
  }
2943
564
  }
2944
- for (let i = 0; i < range2.rowMetadata.length; i++) {
2945
- this._rowMetadata[startRow + i] = range2.rowMetadata[i];
565
+ for (let i = 0; i < range.rowMetadata.length; i++) {
566
+ this._rowMetadata[startRow + i] = range.rowMetadata[i];
2946
567
  }
2947
- for (let i = 0; i < range2.columnMetadata.length; i++) {
2948
- this._columnMetadata[startColumn + i] = range2.columnMetadata[i];
568
+ for (let i = 0; i < range.columnMetadata.length; i++) {
569
+ this._columnMetadata[startColumn + i] = range.columnMetadata[i];
2949
570
  }
2950
571
  });
2951
572
  }
2952
573
  // TODO: make this handle A1 ranges as well?
2953
- _addSheetIdToRange(range2) {
2954
- if (range2.sheetId && range2.sheetId !== this.sheetId) {
574
+ _addSheetIdToRange(range) {
575
+ if (range.sheetId && range.sheetId !== this.sheetId) {
2955
576
  throw new Error("Leave sheet ID blank or set to matching ID of this sheet");
2956
577
  }
2957
578
  return {
2958
- ...range2,
579
+ ...range,
2959
580
  sheetId: this.sheetId
2960
581
  };
2961
582
  }
@@ -3038,8 +659,8 @@ var GoogleSpreadsheetWorksheet = class {
3038
659
  }
3039
660
  // CELLS-BASED INTERACTIONS //////////////////////////////////////////////////////////////////////
3040
661
  get cellStats() {
3041
- let allCells = flatten2(this._cells);
3042
- allCells = compact2(allCells);
662
+ let allCells = flatten(this._cells);
663
+ allCells = compact(allCells);
3043
664
  return {
3044
665
  nonEmpty: filter(allCells, (c) => c.value).length,
3045
666
  loaded: allCells.length,
@@ -3071,7 +692,7 @@ var GoogleSpreadsheetWorksheet = class {
3071
692
  if (filter2.startsWith(this.a1SheetName)) return filter2;
3072
693
  return `${this.a1SheetName}!${filter2}`;
3073
694
  }
3074
- if (isObject2(filter2)) {
695
+ if (isObject(filter2)) {
3075
696
  const filterAny = filter2;
3076
697
  if (filterAny.sheetId && filterAny.sheetId !== this.sheetId) {
3077
698
  throw new Error("Leave sheet ID blank or set to matching ID of this sheet");
@@ -3083,7 +704,7 @@ var GoogleSpreadsheetWorksheet = class {
3083
704
  return this._spreadsheet.loadCells(filtersArrayWithSheetId);
3084
705
  }
3085
706
  async saveUpdatedCells() {
3086
- const cellsToSave = filter(flatten2(this._cells), { _isDirty: true });
707
+ const cellsToSave = filter(flatten(this._cells), { _isDirty: true });
3087
708
  if (cellsToSave.length) {
3088
709
  await this.saveCells(cellsToSave);
3089
710
  }
@@ -3091,7 +712,7 @@ var GoogleSpreadsheetWorksheet = class {
3091
712
  async saveCells(cellsToUpdate) {
3092
713
  const requests = map(cellsToUpdate, (cell) => cell._getUpdateRequest());
3093
714
  const responseRanges = map(cellsToUpdate, (c) => `${this.a1SheetName}!${c.a1Address}`);
3094
- if (!compact2(requests).length) {
715
+ if (!compact(requests).length) {
3095
716
  throw new Error("At least one cell must have something to update");
3096
717
  }
3097
718
  await this._spreadsheet._makeBatchUpdateRequest(requests, responseRanges);
@@ -3167,7 +788,7 @@ var GoogleSpreadsheetWorksheet = class {
3167
788
  throw new Error("No values in the header row - fill the first row with header values before trying to interact with rows");
3168
789
  }
3169
790
  this._headerValues = map(rows[0], (header) => header?.trim());
3170
- if (!compact2(this.headerValues).length) {
791
+ if (!compact(this.headerValues).length) {
3171
792
  throw new Error("All your header cells are blank - fill the first row with header values before trying to interact with rows");
3172
793
  }
3173
794
  checkForDuplicateHeaders(this.headerValues);
@@ -3179,7 +800,7 @@ var GoogleSpreadsheetWorksheet = class {
3179
800
  }
3180
801
  const trimmedHeaderValues = map(headerValues, (h) => h?.trim());
3181
802
  checkForDuplicateHeaders(trimmedHeaderValues);
3182
- if (!compact2(trimmedHeaderValues).length) {
803
+ if (!compact(trimmedHeaderValues).length) {
3183
804
  throw new Error("All your header cells are blank -");
3184
805
  }
3185
806
  if (headerRowIndex) this._headerRowIndex = headerRowIndex;
@@ -3213,11 +834,11 @@ var GoogleSpreadsheetWorksheet = class {
3213
834
  if (!isArray(rows)) throw new Error("You must pass in an array of row values to append");
3214
835
  await this._ensureHeaderRowLoaded();
3215
836
  const rowsAsArrays = [];
3216
- forEach(rows, (row) => {
837
+ each(rows, (row) => {
3217
838
  let rowAsArray;
3218
839
  if (isArray(row)) {
3219
840
  rowAsArray = row;
3220
- } else if (isObject2(row)) {
841
+ } else if (isObject(row)) {
3221
842
  rowAsArray = [];
3222
843
  for (let i = 0; i < this.headerValues.length; i++) {
3223
844
  const propName = this.headerValues[i];
@@ -3385,19 +1006,19 @@ var GoogleSpreadsheetWorksheet = class {
3385
1006
  * Merges all cells in the range
3386
1007
  * @see https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#MergeCellsRequest
3387
1008
  */
3388
- async mergeCells(range2, mergeType = "MERGE_ALL") {
1009
+ async mergeCells(range, mergeType = "MERGE_ALL") {
3389
1010
  await this._makeSingleUpdateRequest("mergeCells", {
3390
1011
  mergeType,
3391
- range: this._addSheetIdToRange(range2)
1012
+ range: this._addSheetIdToRange(range)
3392
1013
  });
3393
1014
  }
3394
1015
  /**
3395
1016
  * Unmerges cells in the given range
3396
1017
  * @see https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#UnmergeCellsRequest
3397
1018
  */
3398
- async unmergeCells(range2) {
1019
+ async unmergeCells(range) {
3399
1020
  await this._makeSingleUpdateRequest("unmergeCells", {
3400
- range: this._addSheetIdToRange(range2)
1021
+ range: this._addSheetIdToRange(range)
3401
1022
  });
3402
1023
  }
3403
1024
  async updateBorders() {
@@ -3438,7 +1059,7 @@ var GoogleSpreadsheetWorksheet = class {
3438
1059
  */
3439
1060
  async insertDimension(columnsOrRows, rangeIndexes, inheritFromBefore) {
3440
1061
  if (!columnsOrRows) throw new Error("You need to specify a dimension. i.e. COLUMNS|ROWS");
3441
- if (!isObject2(rangeIndexes)) throw new Error("`range` must be an object containing `startIndex` and `endIndex`");
1062
+ if (!isObject(rangeIndexes)) throw new Error("`range` must be an object containing `startIndex` and `endIndex`");
3442
1063
  if (!isInteger(rangeIndexes.startIndex) || rangeIndexes.startIndex < 0) throw new Error("range.startIndex must be an integer >=0");
3443
1064
  if (!isInteger(rangeIndexes.endIndex) || rangeIndexes.endIndex < 0) throw new Error("range.endIndex must be an integer >=0");
3444
1065
  if (rangeIndexes.endIndex <= rangeIndexes.startIndex) throw new Error("range.endIndex must be greater than range.startIndex");
@@ -3486,11 +1107,11 @@ var GoogleSpreadsheetWorksheet = class {
3486
1107
  * Sets (or unsets) a data validation rule to every cell in the range
3487
1108
  * @see https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#SetDataValidationRequest
3488
1109
  */
3489
- async setDataValidation(range2, rule) {
1110
+ async setDataValidation(range, rule) {
3490
1111
  return this._makeSingleUpdateRequest("setDataValidation", {
3491
1112
  range: {
3492
1113
  sheetId: this.sheetId,
3493
- ...range2
1114
+ ...range
3494
1115
  },
3495
1116
  ...rule && { rule }
3496
1117
  });
@@ -3556,8 +1177,8 @@ var GoogleSpreadsheetWorksheet = class {
3556
1177
  }
3557
1178
  /** clear data in the sheet - either the entire sheet or a specific range */
3558
1179
  async clear(a1Range) {
3559
- const range2 = a1Range ? `!${a1Range}` : "";
3560
- await this._spreadsheet.sheetsApi.post(`values/${this.encodedA1SheetName}${range2}:clear`);
1180
+ const range = a1Range ? `!${a1Range}` : "";
1181
+ await this._spreadsheet.sheetsApi.post(`values/${this.encodedA1SheetName}${range}:clear`);
3561
1182
  this.resetLocalCache(true);
3562
1183
  }
3563
1184
  async downloadAsCSV(returnStreamInsteadOfBuffer = false) {
@@ -3593,7 +1214,13 @@ __name(getAuthMode, "getAuthMode");
3593
1214
  async function getRequestAuthConfig(auth) {
3594
1215
  if ("getRequestHeaders" in auth) {
3595
1216
  const headers = await auth.getRequestHeaders();
3596
- return { headers };
1217
+ if ("entries" in headers) {
1218
+ return { headers: Object.fromEntries(headers.entries()) };
1219
+ }
1220
+ if (isObject(headers)) {
1221
+ return { headers };
1222
+ }
1223
+ throw new Error("unexpected headers returned from getRequestHeaders");
3597
1224
  }
3598
1225
  if ("apiKey" in auth && auth.apiKey) {
3599
1226
  return { searchParams: { key: auth.apiKey } };
@@ -3641,14 +1268,14 @@ var GoogleSpreadsheet = class _GoogleSpreadsheet {
3641
1268
  this.auth = auth;
3642
1269
  this._rawSheets = {};
3643
1270
  this._spreadsheetUrl = null;
3644
- this.sheetsApi = distribution_default.create({
1271
+ this.sheetsApi = ky.create({
3645
1272
  prefixUrl: `${SHEETS_API_BASE_URL}/${spreadsheetId}`,
3646
1273
  hooks: {
3647
1274
  beforeRequest: [(r) => this._setAuthRequestHook(r)],
3648
1275
  beforeError: [(e) => this._errorHook(e)]
3649
1276
  }
3650
1277
  });
3651
- this.driveApi = distribution_default.create({
1278
+ this.driveApi = ky.create({
3652
1279
  prefixUrl: `${DRIVE_API_BASE_URL}/${spreadsheetId}`,
3653
1280
  hooks: {
3654
1281
  beforeRequest: [(r) => this._setAuthRequestHook(r)],
@@ -3661,8 +1288,7 @@ var GoogleSpreadsheet = class _GoogleSpreadsheet {
3661
1288
  async _setAuthRequestHook(req) {
3662
1289
  const authConfig = await getRequestAuthConfig(this.auth);
3663
1290
  if (authConfig.headers) {
3664
- const headers = "entries" in authConfig.headers ? Object.fromEntries(authConfig.headers.entries()) : authConfig.headers;
3665
- Object.entries(headers).forEach(([key, val]) => {
1291
+ Object.entries(authConfig.headers).forEach(([key, val]) => {
3666
1292
  req.headers.set(key, String(val));
3667
1293
  });
3668
1294
  }
@@ -3709,7 +1335,7 @@ var GoogleSpreadsheet = class _GoogleSpreadsheet {
3709
1335
  });
3710
1336
  const data = await response.json();
3711
1337
  this._updateRawProperties(data.updatedSpreadsheet.properties);
3712
- forEach(data.updatedSpreadsheet.sheets, (s) => this._updateOrCreateSheet(s));
1338
+ each(data.updatedSpreadsheet.sheets, (s) => this._updateOrCreateSheet(s));
3713
1339
  return data.replies[0][requestType];
3714
1340
  }
3715
1341
  // TODO: review these types
@@ -3728,7 +1354,7 @@ var GoogleSpreadsheet = class _GoogleSpreadsheet {
3728
1354
  });
3729
1355
  const data = await response.json();
3730
1356
  this._updateRawProperties(data.updatedSpreadsheet.properties);
3731
- forEach(data.updatedSpreadsheet.sheets, (s) => this._updateOrCreateSheet(s));
1357
+ each(data.updatedSpreadsheet.sheets, (s) => this._updateOrCreateSheet(s));
3732
1358
  }
3733
1359
  /** @internal */
3734
1360
  _ensureInfoLoaded() {
@@ -3845,11 +1471,11 @@ var GoogleSpreadsheet = class _GoogleSpreadsheet {
3845
1471
  * create a new named range
3846
1472
  * @see https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#AddNamedRangeRequest
3847
1473
  */
3848
- async addNamedRange(name, range2, namedRangeId) {
1474
+ async addNamedRange(name, range, namedRangeId) {
3849
1475
  return this._makeSingleUpdateRequest("addNamedRange", {
3850
1476
  name,
3851
1477
  namedRangeId,
3852
- range: range2
1478
+ range
3853
1479
  });
3854
1480
  }
3855
1481
  /**
@@ -3868,7 +1494,7 @@ var GoogleSpreadsheet = class _GoogleSpreadsheet {
3868
1494
  if (isString(filter2)) {
3869
1495
  return readOnlyMode ? filter2 : { a1Range: filter2 };
3870
1496
  }
3871
- if (isObject2(filter2)) {
1497
+ if (isObject(filter2)) {
3872
1498
  if (readOnlyMode) {
3873
1499
  throw new Error("Only A1 ranges are supported when fetching cells with read-only access (using only an API key)");
3874
1500
  }
@@ -3898,7 +1524,7 @@ var GoogleSpreadsheet = class _GoogleSpreadsheet {
3898
1524
  });
3899
1525
  }
3900
1526
  const data = await result?.json();
3901
- forEach(data.sheets, (sheet) => {
1527
+ each(data.sheets, (sheet) => {
3902
1528
  this._updateOrCreateSheet(sheet);
3903
1529
  });
3904
1530
  }
@@ -4016,7 +1642,7 @@ var GoogleSpreadsheet = class _GoogleSpreadsheet {
4016
1642
  throw new Error("Cannot use api key only to create a new spreadsheet - it is only usable for read-only access of public docs");
4017
1643
  }
4018
1644
  const authConfig = await getRequestAuthConfig(auth);
4019
- const response = await distribution_default.post(SHEETS_API_BASE_URL, {
1645
+ const response = await ky.post(SHEETS_API_BASE_URL, {
4020
1646
  ...authConfig,
4021
1647
  // has the auth header
4022
1648
  json: {
@@ -4027,15 +1653,10 @@ var GoogleSpreadsheet = class _GoogleSpreadsheet {
4027
1653
  const newSpreadsheet = new _GoogleSpreadsheet(data.spreadsheetId, auth);
4028
1654
  newSpreadsheet._spreadsheetUrl = data.spreadsheetUrl;
4029
1655
  newSpreadsheet._rawProperties = data.properties;
4030
- forEach(data.sheets, (s) => newSpreadsheet._updateOrCreateSheet(s));
1656
+ each(data.sheets, (s) => newSpreadsheet._updateOrCreateSheet(s));
4031
1657
  return newSpreadsheet;
4032
1658
  }
4033
1659
  };
4034
- /*! Bundled license information:
4035
-
4036
- ky/distribution/index.js:
4037
- (*! MIT License © Sindre Sorhus *)
4038
- */
4039
1660
 
4040
1661
  export { GoogleSpreadsheet, GoogleSpreadsheetCell, GoogleSpreadsheetCellErrorValue, GoogleSpreadsheetRow, GoogleSpreadsheetWorksheet };
4041
1662
  //# sourceMappingURL=index.js.map