@storybook/react-native 9.0.0-beta.13 → 9.0.0-beta.15
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 +3643 -3
- package/dist/metro/withStorybook.js +2 -2
- package/package.json +19 -4
package/dist/index.js
CHANGED
|
@@ -4,6 +4,12 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __esm = (fn, res) => function __init() {
|
|
8
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
+
};
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
7
13
|
var __export = (target, all) => {
|
|
8
14
|
for (var name in all)
|
|
9
15
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -26,6 +32,3639 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
32
|
));
|
|
27
33
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
34
|
|
|
35
|
+
// ../../node_modules/ts-dedent/esm/index.js
|
|
36
|
+
var esm_exports = {};
|
|
37
|
+
__export(esm_exports, {
|
|
38
|
+
dedent: () => dedent,
|
|
39
|
+
default: () => esm_default
|
|
40
|
+
});
|
|
41
|
+
function dedent(templ) {
|
|
42
|
+
var values = [];
|
|
43
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
44
|
+
values[_i - 1] = arguments[_i];
|
|
45
|
+
}
|
|
46
|
+
var strings = Array.from(typeof templ === "string" ? [templ] : templ);
|
|
47
|
+
strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
48
|
+
var indentLengths = strings.reduce(function(arr, str) {
|
|
49
|
+
var matches = str.match(/\n([\t ]+|(?!\s).)/g);
|
|
50
|
+
if (matches) {
|
|
51
|
+
return arr.concat(matches.map(function(match) {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
return arr;
|
|
57
|
+
}, []);
|
|
58
|
+
if (indentLengths.length) {
|
|
59
|
+
var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g");
|
|
60
|
+
strings = strings.map(function(str) {
|
|
61
|
+
return str.replace(pattern_1, "\n");
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
strings[0] = strings[0].replace(/^\r?\n/, "");
|
|
65
|
+
var string = strings[0];
|
|
66
|
+
values.forEach(function(value, i) {
|
|
67
|
+
var endentations = string.match(/(?:^|\n)( *)$/);
|
|
68
|
+
var endentation = endentations ? endentations[1] : "";
|
|
69
|
+
var indentedValue = value;
|
|
70
|
+
if (typeof value === "string" && value.includes("\n")) {
|
|
71
|
+
indentedValue = String(value).split("\n").map(function(str, i2) {
|
|
72
|
+
return i2 === 0 ? str : "" + endentation + str;
|
|
73
|
+
}).join("\n");
|
|
74
|
+
}
|
|
75
|
+
string += indentedValue + strings[i + 1];
|
|
76
|
+
});
|
|
77
|
+
return string;
|
|
78
|
+
}
|
|
79
|
+
var esm_default;
|
|
80
|
+
var init_esm = __esm({
|
|
81
|
+
"../../node_modules/ts-dedent/esm/index.js"() {
|
|
82
|
+
esm_default = dedent;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// ../../node_modules/es-toolkit/dist/_chunk/randomInt-CF7bZK.js
|
|
87
|
+
var require_randomInt_CF7bZK = __commonJS({
|
|
88
|
+
"../../node_modules/es-toolkit/dist/_chunk/randomInt-CF7bZK.js"(exports) {
|
|
89
|
+
"use strict";
|
|
90
|
+
function random(minimum, maximum) {
|
|
91
|
+
if (maximum == null) {
|
|
92
|
+
maximum = minimum;
|
|
93
|
+
minimum = 0;
|
|
94
|
+
}
|
|
95
|
+
if (minimum >= maximum) {
|
|
96
|
+
throw new Error("Invalid input: The maximum value must be greater than the minimum value.");
|
|
97
|
+
}
|
|
98
|
+
return Math.random() * (maximum - minimum) + minimum;
|
|
99
|
+
}
|
|
100
|
+
function randomInt(minimum, maximum) {
|
|
101
|
+
return Math.floor(random(minimum, maximum));
|
|
102
|
+
}
|
|
103
|
+
exports.random = random;
|
|
104
|
+
exports.randomInt = randomInt;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// ../../node_modules/es-toolkit/dist/_chunk/zip-Cyyp17.js
|
|
109
|
+
var require_zip_Cyyp17 = __commonJS({
|
|
110
|
+
"../../node_modules/es-toolkit/dist/_chunk/zip-Cyyp17.js"(exports) {
|
|
111
|
+
"use strict";
|
|
112
|
+
var randomInt = require_randomInt_CF7bZK();
|
|
113
|
+
function chunk(arr, size) {
|
|
114
|
+
if (!Number.isInteger(size) || size <= 0) {
|
|
115
|
+
throw new Error("Size must be an integer greater than zero.");
|
|
116
|
+
}
|
|
117
|
+
const chunkLength = Math.ceil(arr.length / size);
|
|
118
|
+
const result = Array(chunkLength);
|
|
119
|
+
for (let index = 0; index < chunkLength; index++) {
|
|
120
|
+
const start2 = index * size;
|
|
121
|
+
const end = start2 + size;
|
|
122
|
+
result[index] = arr.slice(start2, end);
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
function compact(arr) {
|
|
127
|
+
const result = [];
|
|
128
|
+
for (let i = 0; i < arr.length; i++) {
|
|
129
|
+
const item = arr[i];
|
|
130
|
+
if (item) {
|
|
131
|
+
result.push(item);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
function difference(firstArr, secondArr) {
|
|
137
|
+
const secondSet = new Set(secondArr);
|
|
138
|
+
return firstArr.filter((item) => !secondSet.has(item));
|
|
139
|
+
}
|
|
140
|
+
function differenceBy(firstArr, secondArr, mapper) {
|
|
141
|
+
const mappedSecondSet = new Set(secondArr.map((item) => mapper(item)));
|
|
142
|
+
return firstArr.filter((item) => {
|
|
143
|
+
return !mappedSecondSet.has(mapper(item));
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function differenceWith(firstArr, secondArr, areItemsEqual) {
|
|
147
|
+
return firstArr.filter((firstItem) => {
|
|
148
|
+
return secondArr.every((secondItem) => {
|
|
149
|
+
return !areItemsEqual(firstItem, secondItem);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function drop(arr, itemsCount) {
|
|
154
|
+
itemsCount = Math.max(itemsCount, 0);
|
|
155
|
+
return arr.slice(itemsCount);
|
|
156
|
+
}
|
|
157
|
+
function dropRight(arr, itemsCount) {
|
|
158
|
+
itemsCount = Math.min(-itemsCount, 0);
|
|
159
|
+
if (itemsCount === 0) {
|
|
160
|
+
return arr.slice();
|
|
161
|
+
}
|
|
162
|
+
return arr.slice(0, itemsCount);
|
|
163
|
+
}
|
|
164
|
+
function dropRightWhile(arr, canContinueDropping) {
|
|
165
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
166
|
+
if (!canContinueDropping(arr[i], i, arr)) {
|
|
167
|
+
return arr.slice(0, i + 1);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return [];
|
|
171
|
+
}
|
|
172
|
+
function dropWhile(arr, canContinueDropping) {
|
|
173
|
+
const dropEndIndex = arr.findIndex((item, index, arr2) => !canContinueDropping(item, index, arr2));
|
|
174
|
+
if (dropEndIndex === -1) {
|
|
175
|
+
return [];
|
|
176
|
+
}
|
|
177
|
+
return arr.slice(dropEndIndex);
|
|
178
|
+
}
|
|
179
|
+
function fill(array, value, start2 = 0, end = array.length) {
|
|
180
|
+
const length = array.length;
|
|
181
|
+
const finalStart = Math.max(start2 >= 0 ? start2 : length + start2, 0);
|
|
182
|
+
const finalEnd = Math.min(end >= 0 ? end : length + end, length);
|
|
183
|
+
for (let i = finalStart; i < finalEnd; i++) {
|
|
184
|
+
array[i] = value;
|
|
185
|
+
}
|
|
186
|
+
return array;
|
|
187
|
+
}
|
|
188
|
+
function flatten(arr, depth = 1) {
|
|
189
|
+
const result = [];
|
|
190
|
+
const flooredDepth = Math.floor(depth);
|
|
191
|
+
const recursive = (arr2, currentDepth) => {
|
|
192
|
+
for (let i = 0; i < arr2.length; i++) {
|
|
193
|
+
const item = arr2[i];
|
|
194
|
+
if (Array.isArray(item) && currentDepth < flooredDepth) {
|
|
195
|
+
recursive(item, currentDepth + 1);
|
|
196
|
+
} else {
|
|
197
|
+
result.push(item);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
recursive(arr, 0);
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
function groupBy(arr, getKeyFromItem) {
|
|
205
|
+
const result = {};
|
|
206
|
+
for (let i = 0; i < arr.length; i++) {
|
|
207
|
+
const item = arr[i];
|
|
208
|
+
const key = getKeyFromItem(item);
|
|
209
|
+
if (!Object.hasOwn(result, key)) {
|
|
210
|
+
result[key] = [];
|
|
211
|
+
}
|
|
212
|
+
result[key].push(item);
|
|
213
|
+
}
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
function head(arr) {
|
|
217
|
+
return arr[0];
|
|
218
|
+
}
|
|
219
|
+
function initial(arr) {
|
|
220
|
+
return arr.slice(0, -1);
|
|
221
|
+
}
|
|
222
|
+
function intersection(firstArr, secondArr) {
|
|
223
|
+
const secondSet = new Set(secondArr);
|
|
224
|
+
return firstArr.filter((item) => {
|
|
225
|
+
return secondSet.has(item);
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function intersectionBy(firstArr, secondArr, mapper) {
|
|
229
|
+
const mappedSecondSet = new Set(secondArr.map(mapper));
|
|
230
|
+
return firstArr.filter((item) => mappedSecondSet.has(mapper(item)));
|
|
231
|
+
}
|
|
232
|
+
function intersectionWith(firstArr, secondArr, areItemsEqual) {
|
|
233
|
+
return firstArr.filter((firstItem) => {
|
|
234
|
+
return secondArr.some((secondItem) => {
|
|
235
|
+
return areItemsEqual(firstItem, secondItem);
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
function last(arr) {
|
|
240
|
+
return arr[arr.length - 1];
|
|
241
|
+
}
|
|
242
|
+
function maxBy(items, getValue) {
|
|
243
|
+
if (items.length === 0) {
|
|
244
|
+
return void 0;
|
|
245
|
+
}
|
|
246
|
+
let maxElement = items[0];
|
|
247
|
+
let max = getValue(maxElement);
|
|
248
|
+
for (let i = 1; i < items.length; i++) {
|
|
249
|
+
const element = items[i];
|
|
250
|
+
const value = getValue(element);
|
|
251
|
+
if (value > max) {
|
|
252
|
+
max = value;
|
|
253
|
+
maxElement = element;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return maxElement;
|
|
257
|
+
}
|
|
258
|
+
function minBy(items, getValue) {
|
|
259
|
+
if (items.length === 0) {
|
|
260
|
+
return void 0;
|
|
261
|
+
}
|
|
262
|
+
let minElement = items[0];
|
|
263
|
+
let min = getValue(minElement);
|
|
264
|
+
for (let i = 1; i < items.length; i++) {
|
|
265
|
+
const element = items[i];
|
|
266
|
+
const value = getValue(element);
|
|
267
|
+
if (value < min) {
|
|
268
|
+
min = value;
|
|
269
|
+
minElement = element;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return minElement;
|
|
273
|
+
}
|
|
274
|
+
function pull(arr, valuesToRemove) {
|
|
275
|
+
const valuesSet = new Set(valuesToRemove);
|
|
276
|
+
let resultIndex = 0;
|
|
277
|
+
for (let i = 0; i < arr.length; i++) {
|
|
278
|
+
if (valuesSet.has(arr[i])) {
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
if (!Object.hasOwn(arr, i)) {
|
|
282
|
+
delete arr[resultIndex++];
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
arr[resultIndex++] = arr[i];
|
|
286
|
+
}
|
|
287
|
+
arr.length = resultIndex;
|
|
288
|
+
return arr;
|
|
289
|
+
}
|
|
290
|
+
function remove(arr, shouldRemoveElement) {
|
|
291
|
+
const originalArr = arr.slice();
|
|
292
|
+
const removed = [];
|
|
293
|
+
let resultIndex = 0;
|
|
294
|
+
for (let i = 0; i < arr.length; i++) {
|
|
295
|
+
if (shouldRemoveElement(arr[i], i, originalArr)) {
|
|
296
|
+
removed.push(arr[i]);
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if (!Object.hasOwn(arr, i)) {
|
|
300
|
+
delete arr[resultIndex++];
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
arr[resultIndex++] = arr[i];
|
|
304
|
+
}
|
|
305
|
+
arr.length = resultIndex;
|
|
306
|
+
return removed;
|
|
307
|
+
}
|
|
308
|
+
function sample(arr) {
|
|
309
|
+
const randomIndex = Math.floor(Math.random() * arr.length);
|
|
310
|
+
return arr[randomIndex];
|
|
311
|
+
}
|
|
312
|
+
function sampleSize(array, size) {
|
|
313
|
+
if (size > array.length) {
|
|
314
|
+
throw new Error("Size must be less than or equal to the length of array.");
|
|
315
|
+
}
|
|
316
|
+
const result = new Array(size);
|
|
317
|
+
const selected = /* @__PURE__ */ new Set();
|
|
318
|
+
for (let step = array.length - size, resultIndex = 0; step < array.length; step++, resultIndex++) {
|
|
319
|
+
let index = randomInt.randomInt(0, step + 1);
|
|
320
|
+
if (selected.has(index)) {
|
|
321
|
+
index = step;
|
|
322
|
+
}
|
|
323
|
+
selected.add(index);
|
|
324
|
+
result[resultIndex] = array[index];
|
|
325
|
+
}
|
|
326
|
+
return result;
|
|
327
|
+
}
|
|
328
|
+
function shuffle(arr) {
|
|
329
|
+
const result = arr.slice();
|
|
330
|
+
for (let i = result.length - 1; i >= 1; i--) {
|
|
331
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
332
|
+
[result[i], result[j]] = [result[j], result[i]];
|
|
333
|
+
}
|
|
334
|
+
return result;
|
|
335
|
+
}
|
|
336
|
+
function tail(arr) {
|
|
337
|
+
return arr.slice(1);
|
|
338
|
+
}
|
|
339
|
+
function isSymbol(value) {
|
|
340
|
+
return typeof value === "symbol" || value instanceof Symbol;
|
|
341
|
+
}
|
|
342
|
+
function toNumber(value) {
|
|
343
|
+
if (isSymbol(value)) {
|
|
344
|
+
return NaN;
|
|
345
|
+
}
|
|
346
|
+
return Number(value);
|
|
347
|
+
}
|
|
348
|
+
function toFinite(value) {
|
|
349
|
+
if (!value) {
|
|
350
|
+
return value === 0 ? value : 0;
|
|
351
|
+
}
|
|
352
|
+
value = toNumber(value);
|
|
353
|
+
if (value === Infinity || value === -Infinity) {
|
|
354
|
+
const sign = value < 0 ? -1 : 1;
|
|
355
|
+
return sign * Number.MAX_VALUE;
|
|
356
|
+
}
|
|
357
|
+
return value === value ? value : 0;
|
|
358
|
+
}
|
|
359
|
+
function toInteger(value) {
|
|
360
|
+
const finite = toFinite(value);
|
|
361
|
+
const remainder = finite % 1;
|
|
362
|
+
return remainder ? finite - remainder : finite;
|
|
363
|
+
}
|
|
364
|
+
function take(arr, count, guard) {
|
|
365
|
+
count = guard || count === void 0 ? 1 : toInteger(count);
|
|
366
|
+
return arr.slice(0, count);
|
|
367
|
+
}
|
|
368
|
+
function takeRight(arr, count = 1, guard) {
|
|
369
|
+
count = guard || count === void 0 ? 1 : toInteger(count);
|
|
370
|
+
if (count <= 0 || arr == null || arr.length === 0) {
|
|
371
|
+
return [];
|
|
372
|
+
}
|
|
373
|
+
return arr.slice(-count);
|
|
374
|
+
}
|
|
375
|
+
function uniq(arr) {
|
|
376
|
+
return Array.from(new Set(arr));
|
|
377
|
+
}
|
|
378
|
+
function uniqBy(arr, mapper) {
|
|
379
|
+
const map = /* @__PURE__ */ new Map();
|
|
380
|
+
for (let i = 0; i < arr.length; i++) {
|
|
381
|
+
const item = arr[i];
|
|
382
|
+
const key = mapper(item);
|
|
383
|
+
if (!map.has(key)) {
|
|
384
|
+
map.set(key, item);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return Array.from(map.values());
|
|
388
|
+
}
|
|
389
|
+
function uniqWith(arr, areItemsEqual) {
|
|
390
|
+
const result = [];
|
|
391
|
+
for (let i = 0; i < arr.length; i++) {
|
|
392
|
+
const item = arr[i];
|
|
393
|
+
const isUniq = result.every((v) => !areItemsEqual(v, item));
|
|
394
|
+
if (isUniq) {
|
|
395
|
+
result.push(item);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return result;
|
|
399
|
+
}
|
|
400
|
+
function unzip(zipped) {
|
|
401
|
+
let maxLen = 0;
|
|
402
|
+
for (let i = 0; i < zipped.length; i++) {
|
|
403
|
+
if (zipped[i].length > maxLen) {
|
|
404
|
+
maxLen = zipped[i].length;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
const result = new Array(maxLen);
|
|
408
|
+
for (let i = 0; i < maxLen; i++) {
|
|
409
|
+
result[i] = new Array(zipped.length);
|
|
410
|
+
for (let j = 0; j < zipped.length; j++) {
|
|
411
|
+
result[i][j] = zipped[j][i];
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return result;
|
|
415
|
+
}
|
|
416
|
+
function windowed(arr, size, step = 1, { partialWindows = false } = {}) {
|
|
417
|
+
if (size <= 0 || !Number.isInteger(size)) {
|
|
418
|
+
throw new Error("Size must be a positive integer.");
|
|
419
|
+
}
|
|
420
|
+
if (step <= 0 || !Number.isInteger(step)) {
|
|
421
|
+
throw new Error("Step must be a positive integer.");
|
|
422
|
+
}
|
|
423
|
+
const result = [];
|
|
424
|
+
const end = partialWindows ? arr.length : arr.length - size + 1;
|
|
425
|
+
for (let i = 0; i < end; i += step) {
|
|
426
|
+
result.push(arr.slice(i, i + size));
|
|
427
|
+
}
|
|
428
|
+
return result;
|
|
429
|
+
}
|
|
430
|
+
function without(array, ...values) {
|
|
431
|
+
return difference(array, values);
|
|
432
|
+
}
|
|
433
|
+
function zip(...arrs) {
|
|
434
|
+
let rowCount = 0;
|
|
435
|
+
for (let i = 0; i < arrs.length; i++) {
|
|
436
|
+
if (arrs[i].length > rowCount) {
|
|
437
|
+
rowCount = arrs[i].length;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
const columnCount = arrs.length;
|
|
441
|
+
const result = Array(rowCount);
|
|
442
|
+
for (let i = 0; i < rowCount; ++i) {
|
|
443
|
+
const row = Array(columnCount);
|
|
444
|
+
for (let j = 0; j < columnCount; ++j) {
|
|
445
|
+
row[j] = arrs[j][i];
|
|
446
|
+
}
|
|
447
|
+
result[i] = row;
|
|
448
|
+
}
|
|
449
|
+
return result;
|
|
450
|
+
}
|
|
451
|
+
exports.chunk = chunk;
|
|
452
|
+
exports.compact = compact;
|
|
453
|
+
exports.difference = difference;
|
|
454
|
+
exports.differenceBy = differenceBy;
|
|
455
|
+
exports.differenceWith = differenceWith;
|
|
456
|
+
exports.drop = drop;
|
|
457
|
+
exports.dropRight = dropRight;
|
|
458
|
+
exports.dropRightWhile = dropRightWhile;
|
|
459
|
+
exports.dropWhile = dropWhile;
|
|
460
|
+
exports.fill = fill;
|
|
461
|
+
exports.flatten = flatten;
|
|
462
|
+
exports.groupBy = groupBy;
|
|
463
|
+
exports.head = head;
|
|
464
|
+
exports.initial = initial;
|
|
465
|
+
exports.intersection = intersection;
|
|
466
|
+
exports.intersectionBy = intersectionBy;
|
|
467
|
+
exports.intersectionWith = intersectionWith;
|
|
468
|
+
exports.isSymbol = isSymbol;
|
|
469
|
+
exports.last = last;
|
|
470
|
+
exports.maxBy = maxBy;
|
|
471
|
+
exports.minBy = minBy;
|
|
472
|
+
exports.pull = pull;
|
|
473
|
+
exports.remove = remove;
|
|
474
|
+
exports.sample = sample;
|
|
475
|
+
exports.sampleSize = sampleSize;
|
|
476
|
+
exports.shuffle = shuffle;
|
|
477
|
+
exports.tail = tail;
|
|
478
|
+
exports.take = take;
|
|
479
|
+
exports.takeRight = takeRight;
|
|
480
|
+
exports.toFinite = toFinite;
|
|
481
|
+
exports.toInteger = toInteger;
|
|
482
|
+
exports.toNumber = toNumber;
|
|
483
|
+
exports.uniq = uniq;
|
|
484
|
+
exports.uniqBy = uniqBy;
|
|
485
|
+
exports.uniqWith = uniqWith;
|
|
486
|
+
exports.unzip = unzip;
|
|
487
|
+
exports.windowed = windowed;
|
|
488
|
+
exports.without = without;
|
|
489
|
+
exports.zip = zip;
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
// ../../node_modules/es-toolkit/dist/array/index.js
|
|
494
|
+
var require_array = __commonJS({
|
|
495
|
+
"../../node_modules/es-toolkit/dist/array/index.js"(exports) {
|
|
496
|
+
"use strict";
|
|
497
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
498
|
+
var zip = require_zip_Cyyp17();
|
|
499
|
+
function at(arr, indices) {
|
|
500
|
+
const result = new Array(indices.length);
|
|
501
|
+
const length = arr.length;
|
|
502
|
+
for (let i = 0; i < indices.length; i++) {
|
|
503
|
+
let index = indices[i];
|
|
504
|
+
index = Number.isInteger(index) ? index : Math.trunc(index) || 0;
|
|
505
|
+
if (index < 0) {
|
|
506
|
+
index += length;
|
|
507
|
+
}
|
|
508
|
+
result[i] = arr[index];
|
|
509
|
+
}
|
|
510
|
+
return result;
|
|
511
|
+
}
|
|
512
|
+
function countBy(arr, mapper) {
|
|
513
|
+
const result = {};
|
|
514
|
+
for (let i = 0; i < arr.length; i++) {
|
|
515
|
+
const item = arr[i];
|
|
516
|
+
const key = mapper(item);
|
|
517
|
+
result[key] = (result[key] ?? 0) + 1;
|
|
518
|
+
}
|
|
519
|
+
return result;
|
|
520
|
+
}
|
|
521
|
+
function flatMap(arr, iteratee, depth = 1) {
|
|
522
|
+
return zip.flatten(arr.map((item) => iteratee(item)), depth);
|
|
523
|
+
}
|
|
524
|
+
function flattenDeep(arr) {
|
|
525
|
+
return zip.flatten(arr, Infinity);
|
|
526
|
+
}
|
|
527
|
+
function flatMapDeep(arr, iteratee) {
|
|
528
|
+
return flattenDeep(arr.map((item) => iteratee(item)));
|
|
529
|
+
}
|
|
530
|
+
function forEachRight(arr, callback) {
|
|
531
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
532
|
+
const element = arr[i];
|
|
533
|
+
callback(element, i, arr);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
function isSubset(superset, subset) {
|
|
537
|
+
return zip.difference(subset, superset).length === 0;
|
|
538
|
+
}
|
|
539
|
+
function isSubsetWith(superset, subset, areItemsEqual) {
|
|
540
|
+
return zip.differenceWith(subset, superset, areItemsEqual).length === 0;
|
|
541
|
+
}
|
|
542
|
+
function keyBy(arr, getKeyFromItem) {
|
|
543
|
+
const result = {};
|
|
544
|
+
for (let i = 0; i < arr.length; i++) {
|
|
545
|
+
const item = arr[i];
|
|
546
|
+
const key = getKeyFromItem(item);
|
|
547
|
+
result[key] = item;
|
|
548
|
+
}
|
|
549
|
+
return result;
|
|
550
|
+
}
|
|
551
|
+
function compareValues(a, b, order) {
|
|
552
|
+
if (a < b) {
|
|
553
|
+
return order === "asc" ? -1 : 1;
|
|
554
|
+
}
|
|
555
|
+
if (a > b) {
|
|
556
|
+
return order === "asc" ? 1 : -1;
|
|
557
|
+
}
|
|
558
|
+
return 0;
|
|
559
|
+
}
|
|
560
|
+
function orderBy(arr, criteria, orders) {
|
|
561
|
+
return arr.slice().sort((a, b) => {
|
|
562
|
+
const ordersLength = orders.length;
|
|
563
|
+
for (let i = 0; i < criteria.length; i++) {
|
|
564
|
+
const order = ordersLength > i ? orders[i] : orders[ordersLength - 1];
|
|
565
|
+
const criterion = criteria[i];
|
|
566
|
+
const criterionIsFunction = typeof criterion === "function";
|
|
567
|
+
const valueA = criterionIsFunction ? criterion(a) : a[criterion];
|
|
568
|
+
const valueB = criterionIsFunction ? criterion(b) : b[criterion];
|
|
569
|
+
const result = compareValues(valueA, valueB, order);
|
|
570
|
+
if (result !== 0) {
|
|
571
|
+
return result;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
return 0;
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
function partition(arr, isInTruthy) {
|
|
578
|
+
const truthy = [];
|
|
579
|
+
const falsy = [];
|
|
580
|
+
for (let i = 0; i < arr.length; i++) {
|
|
581
|
+
const item = arr[i];
|
|
582
|
+
if (isInTruthy(item)) {
|
|
583
|
+
truthy.push(item);
|
|
584
|
+
} else {
|
|
585
|
+
falsy.push(item);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
return [truthy, falsy];
|
|
589
|
+
}
|
|
590
|
+
function pullAt(arr, indicesToRemove) {
|
|
591
|
+
const removed = at(arr, indicesToRemove);
|
|
592
|
+
const indices = new Set(indicesToRemove.slice().sort((x, y) => y - x));
|
|
593
|
+
for (const index of indices) {
|
|
594
|
+
arr.splice(index, 1);
|
|
595
|
+
}
|
|
596
|
+
return removed;
|
|
597
|
+
}
|
|
598
|
+
function sortBy(arr, criteria) {
|
|
599
|
+
return orderBy(arr, criteria, ["asc"]);
|
|
600
|
+
}
|
|
601
|
+
function takeRightWhile(arr, shouldContinueTaking) {
|
|
602
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
603
|
+
if (!shouldContinueTaking(arr[i])) {
|
|
604
|
+
return arr.slice(i + 1);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
return arr.slice();
|
|
608
|
+
}
|
|
609
|
+
function takeWhile(arr, shouldContinueTaking) {
|
|
610
|
+
const result = [];
|
|
611
|
+
for (let i = 0; i < arr.length; i++) {
|
|
612
|
+
const item = arr[i];
|
|
613
|
+
if (!shouldContinueTaking(item)) {
|
|
614
|
+
break;
|
|
615
|
+
}
|
|
616
|
+
result.push(item);
|
|
617
|
+
}
|
|
618
|
+
return result;
|
|
619
|
+
}
|
|
620
|
+
function toFilled(arr, value, start2 = 0, end = arr.length) {
|
|
621
|
+
const length = arr.length;
|
|
622
|
+
const finalStart = Math.max(start2 >= 0 ? start2 : length + start2, 0);
|
|
623
|
+
const finalEnd = Math.min(end >= 0 ? end : length + end, length);
|
|
624
|
+
const newArr = arr.slice();
|
|
625
|
+
for (let i = finalStart; i < finalEnd; i++) {
|
|
626
|
+
newArr[i] = value;
|
|
627
|
+
}
|
|
628
|
+
return newArr;
|
|
629
|
+
}
|
|
630
|
+
function union(arr1, arr2) {
|
|
631
|
+
return zip.uniq(arr1.concat(arr2));
|
|
632
|
+
}
|
|
633
|
+
function unionBy(arr1, arr2, mapper) {
|
|
634
|
+
return zip.uniqBy(arr1.concat(arr2), mapper);
|
|
635
|
+
}
|
|
636
|
+
function unionWith(arr1, arr2, areItemsEqual) {
|
|
637
|
+
return zip.uniqWith(arr1.concat(arr2), areItemsEqual);
|
|
638
|
+
}
|
|
639
|
+
function unzipWith(target, iteratee) {
|
|
640
|
+
const maxLength = Math.max(...target.map((innerArray) => innerArray.length));
|
|
641
|
+
const result = new Array(maxLength);
|
|
642
|
+
for (let i = 0; i < maxLength; i++) {
|
|
643
|
+
const group = new Array(target.length);
|
|
644
|
+
for (let j = 0; j < target.length; j++) {
|
|
645
|
+
group[j] = target[j][i];
|
|
646
|
+
}
|
|
647
|
+
result[i] = iteratee(...group);
|
|
648
|
+
}
|
|
649
|
+
return result;
|
|
650
|
+
}
|
|
651
|
+
function xor(arr1, arr2) {
|
|
652
|
+
return zip.difference(union(arr1, arr2), zip.intersection(arr1, arr2));
|
|
653
|
+
}
|
|
654
|
+
function xorBy(arr1, arr2, mapper) {
|
|
655
|
+
const union2 = unionBy(arr1, arr2, mapper);
|
|
656
|
+
const intersection = zip.intersectionBy(arr1, arr2, mapper);
|
|
657
|
+
return zip.differenceBy(union2, intersection, mapper);
|
|
658
|
+
}
|
|
659
|
+
function xorWith(arr1, arr2, areElementsEqual) {
|
|
660
|
+
const union2 = unionWith(arr1, arr2, areElementsEqual);
|
|
661
|
+
const intersection = zip.intersectionWith(arr1, arr2, areElementsEqual);
|
|
662
|
+
return zip.differenceWith(union2, intersection, areElementsEqual);
|
|
663
|
+
}
|
|
664
|
+
function zipObject(keys, values) {
|
|
665
|
+
const result = {};
|
|
666
|
+
for (let i = 0; i < keys.length; i++) {
|
|
667
|
+
result[keys[i]] = values[i];
|
|
668
|
+
}
|
|
669
|
+
return result;
|
|
670
|
+
}
|
|
671
|
+
function zipWith(arr1, ...rest) {
|
|
672
|
+
const arrs = [arr1, ...rest.slice(0, -1)];
|
|
673
|
+
const combine = rest[rest.length - 1];
|
|
674
|
+
const maxIndex = Math.max(...arrs.map((arr) => arr.length));
|
|
675
|
+
const result = Array(maxIndex);
|
|
676
|
+
for (let i = 0; i < maxIndex; i++) {
|
|
677
|
+
const elements = arrs.map((arr) => arr[i]);
|
|
678
|
+
result[i] = combine(...elements);
|
|
679
|
+
}
|
|
680
|
+
return result;
|
|
681
|
+
}
|
|
682
|
+
exports.chunk = zip.chunk;
|
|
683
|
+
exports.compact = zip.compact;
|
|
684
|
+
exports.difference = zip.difference;
|
|
685
|
+
exports.differenceBy = zip.differenceBy;
|
|
686
|
+
exports.differenceWith = zip.differenceWith;
|
|
687
|
+
exports.drop = zip.drop;
|
|
688
|
+
exports.dropRight = zip.dropRight;
|
|
689
|
+
exports.dropRightWhile = zip.dropRightWhile;
|
|
690
|
+
exports.dropWhile = zip.dropWhile;
|
|
691
|
+
exports.fill = zip.fill;
|
|
692
|
+
exports.flatten = zip.flatten;
|
|
693
|
+
exports.groupBy = zip.groupBy;
|
|
694
|
+
exports.head = zip.head;
|
|
695
|
+
exports.initial = zip.initial;
|
|
696
|
+
exports.intersection = zip.intersection;
|
|
697
|
+
exports.intersectionBy = zip.intersectionBy;
|
|
698
|
+
exports.intersectionWith = zip.intersectionWith;
|
|
699
|
+
exports.last = zip.last;
|
|
700
|
+
exports.maxBy = zip.maxBy;
|
|
701
|
+
exports.minBy = zip.minBy;
|
|
702
|
+
exports.pull = zip.pull;
|
|
703
|
+
exports.remove = zip.remove;
|
|
704
|
+
exports.sample = zip.sample;
|
|
705
|
+
exports.sampleSize = zip.sampleSize;
|
|
706
|
+
exports.shuffle = zip.shuffle;
|
|
707
|
+
exports.tail = zip.tail;
|
|
708
|
+
exports.take = zip.take;
|
|
709
|
+
exports.takeRight = zip.takeRight;
|
|
710
|
+
exports.uniq = zip.uniq;
|
|
711
|
+
exports.uniqBy = zip.uniqBy;
|
|
712
|
+
exports.uniqWith = zip.uniqWith;
|
|
713
|
+
exports.unzip = zip.unzip;
|
|
714
|
+
exports.windowed = zip.windowed;
|
|
715
|
+
exports.without = zip.without;
|
|
716
|
+
exports.zip = zip.zip;
|
|
717
|
+
exports.at = at;
|
|
718
|
+
exports.countBy = countBy;
|
|
719
|
+
exports.flatMap = flatMap;
|
|
720
|
+
exports.flatMapDeep = flatMapDeep;
|
|
721
|
+
exports.flattenDeep = flattenDeep;
|
|
722
|
+
exports.forEachRight = forEachRight;
|
|
723
|
+
exports.isSubset = isSubset;
|
|
724
|
+
exports.isSubsetWith = isSubsetWith;
|
|
725
|
+
exports.keyBy = keyBy;
|
|
726
|
+
exports.orderBy = orderBy;
|
|
727
|
+
exports.partition = partition;
|
|
728
|
+
exports.pullAt = pullAt;
|
|
729
|
+
exports.sortBy = sortBy;
|
|
730
|
+
exports.takeRightWhile = takeRightWhile;
|
|
731
|
+
exports.takeWhile = takeWhile;
|
|
732
|
+
exports.toFilled = toFilled;
|
|
733
|
+
exports.union = union;
|
|
734
|
+
exports.unionBy = unionBy;
|
|
735
|
+
exports.unionWith = unionWith;
|
|
736
|
+
exports.unzipWith = unzipWith;
|
|
737
|
+
exports.xor = xor;
|
|
738
|
+
exports.xorBy = xorBy;
|
|
739
|
+
exports.xorWith = xorWith;
|
|
740
|
+
exports.zipObject = zipObject;
|
|
741
|
+
exports.zipWith = zipWith;
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
|
|
745
|
+
// ../../node_modules/es-toolkit/dist/_chunk/AbortError-Cg4ZQ1.js
|
|
746
|
+
var require_AbortError_Cg4ZQ1 = __commonJS({
|
|
747
|
+
"../../node_modules/es-toolkit/dist/_chunk/AbortError-Cg4ZQ1.js"(exports) {
|
|
748
|
+
"use strict";
|
|
749
|
+
var AbortError = class extends Error {
|
|
750
|
+
constructor(message = "The operation was aborted") {
|
|
751
|
+
super(message);
|
|
752
|
+
this.name = "AbortError";
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
exports.AbortError = AbortError;
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
|
|
759
|
+
// ../../node_modules/es-toolkit/dist/error/index.js
|
|
760
|
+
var require_error = __commonJS({
|
|
761
|
+
"../../node_modules/es-toolkit/dist/error/index.js"(exports) {
|
|
762
|
+
"use strict";
|
|
763
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
764
|
+
var AbortError = require_AbortError_Cg4ZQ1();
|
|
765
|
+
var TimeoutError = class extends Error {
|
|
766
|
+
constructor(message = "The operation was timed out") {
|
|
767
|
+
super(message);
|
|
768
|
+
this.name = "TimeoutError";
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
exports.AbortError = AbortError.AbortError;
|
|
772
|
+
exports.TimeoutError = TimeoutError;
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
|
|
776
|
+
// ../../node_modules/es-toolkit/dist/_chunk/unary-BVQ0iC.js
|
|
777
|
+
var require_unary_BVQ0iC = __commonJS({
|
|
778
|
+
"../../node_modules/es-toolkit/dist/_chunk/unary-BVQ0iC.js"(exports) {
|
|
779
|
+
"use strict";
|
|
780
|
+
function after(n, func) {
|
|
781
|
+
if (!Number.isInteger(n) || n < 0) {
|
|
782
|
+
throw new Error(`n must be a non-negative integer.`);
|
|
783
|
+
}
|
|
784
|
+
let counter = 0;
|
|
785
|
+
return (...args) => {
|
|
786
|
+
if (++counter >= n) {
|
|
787
|
+
return func(...args);
|
|
788
|
+
}
|
|
789
|
+
return void 0;
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
function ary(func, n) {
|
|
793
|
+
return function(...args) {
|
|
794
|
+
return func.apply(this, args.slice(0, n));
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
function debounce(func, debounceMs, { signal, edges } = {}) {
|
|
798
|
+
let pendingThis = void 0;
|
|
799
|
+
let pendingArgs = null;
|
|
800
|
+
const leading = edges != null && edges.includes("leading");
|
|
801
|
+
const trailing = edges == null || edges.includes("trailing");
|
|
802
|
+
const invoke = () => {
|
|
803
|
+
if (pendingArgs !== null) {
|
|
804
|
+
func.apply(pendingThis, pendingArgs);
|
|
805
|
+
pendingThis = void 0;
|
|
806
|
+
pendingArgs = null;
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
const onTimerEnd = () => {
|
|
810
|
+
if (trailing) {
|
|
811
|
+
invoke();
|
|
812
|
+
}
|
|
813
|
+
cancel();
|
|
814
|
+
};
|
|
815
|
+
let timeoutId = null;
|
|
816
|
+
const schedule = () => {
|
|
817
|
+
if (timeoutId != null) {
|
|
818
|
+
clearTimeout(timeoutId);
|
|
819
|
+
}
|
|
820
|
+
timeoutId = setTimeout(() => {
|
|
821
|
+
timeoutId = null;
|
|
822
|
+
onTimerEnd();
|
|
823
|
+
}, debounceMs);
|
|
824
|
+
};
|
|
825
|
+
const cancelTimer = () => {
|
|
826
|
+
if (timeoutId !== null) {
|
|
827
|
+
clearTimeout(timeoutId);
|
|
828
|
+
timeoutId = null;
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
const cancel = () => {
|
|
832
|
+
cancelTimer();
|
|
833
|
+
pendingThis = void 0;
|
|
834
|
+
pendingArgs = null;
|
|
835
|
+
};
|
|
836
|
+
const flush = () => {
|
|
837
|
+
cancelTimer();
|
|
838
|
+
invoke();
|
|
839
|
+
};
|
|
840
|
+
const debounced = function(...args) {
|
|
841
|
+
if (signal?.aborted) {
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
pendingThis = this;
|
|
845
|
+
pendingArgs = args;
|
|
846
|
+
const isFirstCall = timeoutId == null;
|
|
847
|
+
schedule();
|
|
848
|
+
if (leading && isFirstCall) {
|
|
849
|
+
invoke();
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
debounced.schedule = schedule;
|
|
853
|
+
debounced.cancel = cancel;
|
|
854
|
+
debounced.flush = flush;
|
|
855
|
+
signal?.addEventListener("abort", cancel, { once: true });
|
|
856
|
+
return debounced;
|
|
857
|
+
}
|
|
858
|
+
function flow(...funcs) {
|
|
859
|
+
return function(...args) {
|
|
860
|
+
let result = funcs.length ? funcs[0].apply(this, args) : args[0];
|
|
861
|
+
for (let i = 1; i < funcs.length; i++) {
|
|
862
|
+
result = funcs[i].call(this, result);
|
|
863
|
+
}
|
|
864
|
+
return result;
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
function flowRight(...funcs) {
|
|
868
|
+
return flow(...funcs.reverse());
|
|
869
|
+
}
|
|
870
|
+
function identity(x) {
|
|
871
|
+
return x;
|
|
872
|
+
}
|
|
873
|
+
function negate(func) {
|
|
874
|
+
return (...args) => !func(...args);
|
|
875
|
+
}
|
|
876
|
+
function once(func) {
|
|
877
|
+
let called = false;
|
|
878
|
+
let cache;
|
|
879
|
+
return function(...args) {
|
|
880
|
+
if (!called) {
|
|
881
|
+
called = true;
|
|
882
|
+
cache = func(...args);
|
|
883
|
+
}
|
|
884
|
+
return cache;
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
function partial(func, ...partialArgs) {
|
|
888
|
+
return partialImpl(func, placeholderSymbol$1, ...partialArgs);
|
|
889
|
+
}
|
|
890
|
+
function partialImpl(func, placeholder, ...partialArgs) {
|
|
891
|
+
const partialed = function(...providedArgs) {
|
|
892
|
+
let providedArgsIndex = 0;
|
|
893
|
+
const substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg);
|
|
894
|
+
const remainingArgs = providedArgs.slice(providedArgsIndex);
|
|
895
|
+
return func.apply(this, substitutedArgs.concat(remainingArgs));
|
|
896
|
+
};
|
|
897
|
+
if (func.prototype) {
|
|
898
|
+
partialed.prototype = Object.create(func.prototype);
|
|
899
|
+
}
|
|
900
|
+
return partialed;
|
|
901
|
+
}
|
|
902
|
+
var placeholderSymbol$1 = Symbol("partial.placeholder");
|
|
903
|
+
partial.placeholder = placeholderSymbol$1;
|
|
904
|
+
function partialRight(func, ...partialArgs) {
|
|
905
|
+
return partialRightImpl(func, placeholderSymbol, ...partialArgs);
|
|
906
|
+
}
|
|
907
|
+
function partialRightImpl(func, placeholder, ...partialArgs) {
|
|
908
|
+
const partialedRight = function(...providedArgs) {
|
|
909
|
+
const placeholderLength = partialArgs.filter((arg) => arg === placeholder).length;
|
|
910
|
+
const rangeLength = Math.max(providedArgs.length - placeholderLength, 0);
|
|
911
|
+
const remainingArgs = providedArgs.slice(0, rangeLength);
|
|
912
|
+
let providedArgsIndex = rangeLength;
|
|
913
|
+
const substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg);
|
|
914
|
+
return func.apply(this, remainingArgs.concat(substitutedArgs));
|
|
915
|
+
};
|
|
916
|
+
if (func.prototype) {
|
|
917
|
+
partialedRight.prototype = Object.create(func.prototype);
|
|
918
|
+
}
|
|
919
|
+
return partialedRight;
|
|
920
|
+
}
|
|
921
|
+
var placeholderSymbol = Symbol("partialRight.placeholder");
|
|
922
|
+
partialRight.placeholder = placeholderSymbol;
|
|
923
|
+
function rest(func, startIndex = func.length - 1) {
|
|
924
|
+
return function(...args) {
|
|
925
|
+
const rest2 = args.slice(startIndex);
|
|
926
|
+
const params = args.slice(0, startIndex);
|
|
927
|
+
while (params.length < startIndex) {
|
|
928
|
+
params.push(void 0);
|
|
929
|
+
}
|
|
930
|
+
return func.apply(this, [...params, rest2]);
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
function unary(func) {
|
|
934
|
+
return ary(func, 1);
|
|
935
|
+
}
|
|
936
|
+
exports.after = after;
|
|
937
|
+
exports.ary = ary;
|
|
938
|
+
exports.debounce = debounce;
|
|
939
|
+
exports.flow = flow;
|
|
940
|
+
exports.flowRight = flowRight;
|
|
941
|
+
exports.identity = identity;
|
|
942
|
+
exports.negate = negate;
|
|
943
|
+
exports.once = once;
|
|
944
|
+
exports.partial = partial;
|
|
945
|
+
exports.partialImpl = partialImpl;
|
|
946
|
+
exports.partialRight = partialRight;
|
|
947
|
+
exports.partialRightImpl = partialRightImpl;
|
|
948
|
+
exports.rest = rest;
|
|
949
|
+
exports.unary = unary;
|
|
950
|
+
}
|
|
951
|
+
});
|
|
952
|
+
|
|
953
|
+
// ../../node_modules/es-toolkit/dist/_chunk/noop-2IwLUk.js
|
|
954
|
+
var require_noop_2IwLUk = __commonJS({
|
|
955
|
+
"../../node_modules/es-toolkit/dist/_chunk/noop-2IwLUk.js"(exports) {
|
|
956
|
+
"use strict";
|
|
957
|
+
function noop() {
|
|
958
|
+
}
|
|
959
|
+
exports.noop = noop;
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
// ../../node_modules/es-toolkit/dist/_chunk/delay-_VMfFa.js
|
|
964
|
+
var require_delay_VMfFa = __commonJS({
|
|
965
|
+
"../../node_modules/es-toolkit/dist/_chunk/delay-_VMfFa.js"(exports) {
|
|
966
|
+
"use strict";
|
|
967
|
+
var AbortError = require_AbortError_Cg4ZQ1();
|
|
968
|
+
function delay(ms, { signal } = {}) {
|
|
969
|
+
return new Promise((resolve, reject) => {
|
|
970
|
+
const abortError = () => {
|
|
971
|
+
reject(new AbortError.AbortError());
|
|
972
|
+
};
|
|
973
|
+
const abortHandler = () => {
|
|
974
|
+
clearTimeout(timeoutId);
|
|
975
|
+
abortError();
|
|
976
|
+
};
|
|
977
|
+
if (signal?.aborted) {
|
|
978
|
+
return abortError();
|
|
979
|
+
}
|
|
980
|
+
const timeoutId = setTimeout(() => {
|
|
981
|
+
signal?.removeEventListener("abort", abortHandler);
|
|
982
|
+
resolve();
|
|
983
|
+
}, ms);
|
|
984
|
+
signal?.addEventListener("abort", abortHandler, { once: true });
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
exports.delay = delay;
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
|
|
991
|
+
// ../../node_modules/es-toolkit/dist/function/index.js
|
|
992
|
+
var require_function = __commonJS({
|
|
993
|
+
"../../node_modules/es-toolkit/dist/function/index.js"(exports) {
|
|
994
|
+
"use strict";
|
|
995
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
996
|
+
var unary = require_unary_BVQ0iC();
|
|
997
|
+
var noop = require_noop_2IwLUk();
|
|
998
|
+
var delay = require_delay_VMfFa();
|
|
999
|
+
async function asyncNoop() {
|
|
1000
|
+
}
|
|
1001
|
+
function before(n, func) {
|
|
1002
|
+
if (!Number.isInteger(n) || n < 0) {
|
|
1003
|
+
throw new Error("n must be a non-negative integer.");
|
|
1004
|
+
}
|
|
1005
|
+
let counter = 0;
|
|
1006
|
+
return (...args) => {
|
|
1007
|
+
if (++counter < n) {
|
|
1008
|
+
return func(...args);
|
|
1009
|
+
}
|
|
1010
|
+
return void 0;
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
function curry(func) {
|
|
1014
|
+
if (func.length === 0 || func.length === 1) {
|
|
1015
|
+
return func;
|
|
1016
|
+
}
|
|
1017
|
+
return function(arg) {
|
|
1018
|
+
return makeCurry(func, func.length, [arg]);
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
1021
|
+
function makeCurry(origin, argsLength, args) {
|
|
1022
|
+
if (args.length === argsLength) {
|
|
1023
|
+
return origin(...args);
|
|
1024
|
+
} else {
|
|
1025
|
+
const next = function(arg) {
|
|
1026
|
+
return makeCurry(origin, argsLength, [...args, arg]);
|
|
1027
|
+
};
|
|
1028
|
+
return next;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
function curryRight(func) {
|
|
1032
|
+
if (func.length === 0 || func.length === 1) {
|
|
1033
|
+
return func;
|
|
1034
|
+
}
|
|
1035
|
+
return function(arg) {
|
|
1036
|
+
return makeCurryRight(func, func.length, [arg]);
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
function makeCurryRight(origin, argsLength, args) {
|
|
1040
|
+
if (args.length === argsLength) {
|
|
1041
|
+
return origin(...args);
|
|
1042
|
+
} else {
|
|
1043
|
+
const next = function(arg) {
|
|
1044
|
+
return makeCurryRight(origin, argsLength, [arg, ...args]);
|
|
1045
|
+
};
|
|
1046
|
+
return next;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
function memoize(fn, options = {}) {
|
|
1050
|
+
const { cache = /* @__PURE__ */ new Map(), getCacheKey } = options;
|
|
1051
|
+
const memoizedFn = function(arg) {
|
|
1052
|
+
const key = getCacheKey ? getCacheKey(arg) : arg;
|
|
1053
|
+
if (cache.has(key)) {
|
|
1054
|
+
return cache.get(key);
|
|
1055
|
+
}
|
|
1056
|
+
const result = fn.call(this, arg);
|
|
1057
|
+
cache.set(key, result);
|
|
1058
|
+
return result;
|
|
1059
|
+
};
|
|
1060
|
+
memoizedFn.cache = cache;
|
|
1061
|
+
return memoizedFn;
|
|
1062
|
+
}
|
|
1063
|
+
var DEFAULT_DELAY = 0;
|
|
1064
|
+
var DEFAULT_RETRIES = Number.POSITIVE_INFINITY;
|
|
1065
|
+
async function retry(func, _options) {
|
|
1066
|
+
let delay$1;
|
|
1067
|
+
let retries;
|
|
1068
|
+
let signal;
|
|
1069
|
+
if (typeof _options === "number") {
|
|
1070
|
+
delay$1 = DEFAULT_DELAY;
|
|
1071
|
+
retries = _options;
|
|
1072
|
+
signal = void 0;
|
|
1073
|
+
} else {
|
|
1074
|
+
delay$1 = _options?.delay ?? DEFAULT_DELAY;
|
|
1075
|
+
retries = _options?.retries ?? DEFAULT_RETRIES;
|
|
1076
|
+
signal = _options?.signal;
|
|
1077
|
+
}
|
|
1078
|
+
let error;
|
|
1079
|
+
for (let attempts = 0; attempts < retries; attempts++) {
|
|
1080
|
+
if (signal?.aborted) {
|
|
1081
|
+
throw error ?? new Error(`The retry operation was aborted due to an abort signal.`);
|
|
1082
|
+
}
|
|
1083
|
+
try {
|
|
1084
|
+
return await func();
|
|
1085
|
+
} catch (err) {
|
|
1086
|
+
error = err;
|
|
1087
|
+
const currentDelay = typeof delay$1 === "function" ? delay$1(attempts) : delay$1;
|
|
1088
|
+
await delay.delay(currentDelay);
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
throw error;
|
|
1092
|
+
}
|
|
1093
|
+
function spread(func) {
|
|
1094
|
+
return function(argsArr) {
|
|
1095
|
+
return func.apply(this, argsArr);
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
function throttle(func, throttleMs, { signal, edges = ["leading", "trailing"] } = {}) {
|
|
1099
|
+
let pendingAt = null;
|
|
1100
|
+
const debounced = unary.debounce(func, throttleMs, { signal, edges });
|
|
1101
|
+
const throttled = function(...args) {
|
|
1102
|
+
if (pendingAt == null) {
|
|
1103
|
+
pendingAt = Date.now();
|
|
1104
|
+
} else {
|
|
1105
|
+
if (Date.now() - pendingAt >= throttleMs) {
|
|
1106
|
+
pendingAt = Date.now();
|
|
1107
|
+
debounced.cancel();
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
debounced(...args);
|
|
1111
|
+
};
|
|
1112
|
+
throttled.cancel = debounced.cancel;
|
|
1113
|
+
throttled.flush = debounced.flush;
|
|
1114
|
+
return throttled;
|
|
1115
|
+
}
|
|
1116
|
+
exports.after = unary.after;
|
|
1117
|
+
exports.ary = unary.ary;
|
|
1118
|
+
exports.debounce = unary.debounce;
|
|
1119
|
+
exports.flow = unary.flow;
|
|
1120
|
+
exports.flowRight = unary.flowRight;
|
|
1121
|
+
exports.identity = unary.identity;
|
|
1122
|
+
exports.negate = unary.negate;
|
|
1123
|
+
exports.once = unary.once;
|
|
1124
|
+
exports.partial = unary.partial;
|
|
1125
|
+
exports.partialRight = unary.partialRight;
|
|
1126
|
+
exports.rest = unary.rest;
|
|
1127
|
+
exports.unary = unary.unary;
|
|
1128
|
+
exports.noop = noop.noop;
|
|
1129
|
+
exports.asyncNoop = asyncNoop;
|
|
1130
|
+
exports.before = before;
|
|
1131
|
+
exports.curry = curry;
|
|
1132
|
+
exports.curryRight = curryRight;
|
|
1133
|
+
exports.memoize = memoize;
|
|
1134
|
+
exports.retry = retry;
|
|
1135
|
+
exports.spread = spread;
|
|
1136
|
+
exports.throttle = throttle;
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
1139
|
+
|
|
1140
|
+
// ../../node_modules/es-toolkit/dist/_chunk/range-DSpBDL.js
|
|
1141
|
+
var require_range_DSpBDL = __commonJS({
|
|
1142
|
+
"../../node_modules/es-toolkit/dist/_chunk/range-DSpBDL.js"(exports) {
|
|
1143
|
+
"use strict";
|
|
1144
|
+
function clamp(value, bound1, bound2) {
|
|
1145
|
+
if (bound2 == null) {
|
|
1146
|
+
return Math.min(value, bound1);
|
|
1147
|
+
}
|
|
1148
|
+
return Math.min(Math.max(value, bound1), bound2);
|
|
1149
|
+
}
|
|
1150
|
+
function inRange(value, minimum, maximum) {
|
|
1151
|
+
if (maximum == null) {
|
|
1152
|
+
maximum = minimum;
|
|
1153
|
+
minimum = 0;
|
|
1154
|
+
}
|
|
1155
|
+
if (minimum >= maximum) {
|
|
1156
|
+
throw new Error("The maximum value must be greater than the minimum value.");
|
|
1157
|
+
}
|
|
1158
|
+
return minimum <= value && value < maximum;
|
|
1159
|
+
}
|
|
1160
|
+
function sum(nums) {
|
|
1161
|
+
let result = 0;
|
|
1162
|
+
for (let i = 0; i < nums.length; i++) {
|
|
1163
|
+
result += nums[i];
|
|
1164
|
+
}
|
|
1165
|
+
return result;
|
|
1166
|
+
}
|
|
1167
|
+
function mean(nums) {
|
|
1168
|
+
return sum(nums) / nums.length;
|
|
1169
|
+
}
|
|
1170
|
+
function meanBy(items, getValue) {
|
|
1171
|
+
const nums = items.map((x) => getValue(x));
|
|
1172
|
+
return mean(nums);
|
|
1173
|
+
}
|
|
1174
|
+
function range(start2, end, step = 1) {
|
|
1175
|
+
if (end == null) {
|
|
1176
|
+
end = start2;
|
|
1177
|
+
start2 = 0;
|
|
1178
|
+
}
|
|
1179
|
+
if (!Number.isInteger(step) || step === 0) {
|
|
1180
|
+
throw new Error(`The step value must be a non-zero integer.`);
|
|
1181
|
+
}
|
|
1182
|
+
const length = Math.max(Math.ceil((end - start2) / step), 0);
|
|
1183
|
+
const result = new Array(length);
|
|
1184
|
+
for (let i = 0; i < length; i++) {
|
|
1185
|
+
result[i] = start2 + i * step;
|
|
1186
|
+
}
|
|
1187
|
+
return result;
|
|
1188
|
+
}
|
|
1189
|
+
exports.clamp = clamp;
|
|
1190
|
+
exports.inRange = inRange;
|
|
1191
|
+
exports.mean = mean;
|
|
1192
|
+
exports.meanBy = meanBy;
|
|
1193
|
+
exports.range = range;
|
|
1194
|
+
exports.sum = sum;
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
|
|
1198
|
+
// ../../node_modules/es-toolkit/dist/math/index.js
|
|
1199
|
+
var require_math = __commonJS({
|
|
1200
|
+
"../../node_modules/es-toolkit/dist/math/index.js"(exports) {
|
|
1201
|
+
"use strict";
|
|
1202
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1203
|
+
var range = require_range_DSpBDL();
|
|
1204
|
+
var randomInt = require_randomInt_CF7bZK();
|
|
1205
|
+
function median(nums) {
|
|
1206
|
+
if (nums.length === 0) {
|
|
1207
|
+
return NaN;
|
|
1208
|
+
}
|
|
1209
|
+
const sorted = nums.slice().sort((a, b) => a - b);
|
|
1210
|
+
const middleIndex = Math.floor(sorted.length / 2);
|
|
1211
|
+
if (sorted.length % 2 === 0) {
|
|
1212
|
+
return (sorted[middleIndex - 1] + sorted[middleIndex]) / 2;
|
|
1213
|
+
} else {
|
|
1214
|
+
return sorted[middleIndex];
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
function medianBy(items, getValue) {
|
|
1218
|
+
const nums = items.map((x) => getValue(x));
|
|
1219
|
+
return median(nums);
|
|
1220
|
+
}
|
|
1221
|
+
function rangeRight(start2, end, step = 1) {
|
|
1222
|
+
if (end == null) {
|
|
1223
|
+
end = start2;
|
|
1224
|
+
start2 = 0;
|
|
1225
|
+
}
|
|
1226
|
+
if (!Number.isInteger(step) || step === 0) {
|
|
1227
|
+
throw new Error(`The step value must be a non-zero integer.`);
|
|
1228
|
+
}
|
|
1229
|
+
const length = Math.max(Math.ceil((end - start2) / step), 0);
|
|
1230
|
+
const result = new Array(length);
|
|
1231
|
+
for (let i = 0; i < length; i++) {
|
|
1232
|
+
result[i] = start2 + (length - i - 1) * step;
|
|
1233
|
+
}
|
|
1234
|
+
return result;
|
|
1235
|
+
}
|
|
1236
|
+
function round(value, precision = 0) {
|
|
1237
|
+
if (!Number.isInteger(precision)) {
|
|
1238
|
+
throw new Error("Precision must be an integer.");
|
|
1239
|
+
}
|
|
1240
|
+
const multiplier = Math.pow(10, precision);
|
|
1241
|
+
return Math.round(value * multiplier) / multiplier;
|
|
1242
|
+
}
|
|
1243
|
+
function sumBy(items, getValue) {
|
|
1244
|
+
let result = 0;
|
|
1245
|
+
for (let i = 0; i < items.length; i++) {
|
|
1246
|
+
result += getValue(items[i]);
|
|
1247
|
+
}
|
|
1248
|
+
return result;
|
|
1249
|
+
}
|
|
1250
|
+
exports.clamp = range.clamp;
|
|
1251
|
+
exports.inRange = range.inRange;
|
|
1252
|
+
exports.mean = range.mean;
|
|
1253
|
+
exports.meanBy = range.meanBy;
|
|
1254
|
+
exports.range = range.range;
|
|
1255
|
+
exports.sum = range.sum;
|
|
1256
|
+
exports.random = randomInt.random;
|
|
1257
|
+
exports.randomInt = randomInt.randomInt;
|
|
1258
|
+
exports.median = median;
|
|
1259
|
+
exports.medianBy = medianBy;
|
|
1260
|
+
exports.rangeRight = rangeRight;
|
|
1261
|
+
exports.round = round;
|
|
1262
|
+
exports.sumBy = sumBy;
|
|
1263
|
+
}
|
|
1264
|
+
});
|
|
1265
|
+
|
|
1266
|
+
// ../../node_modules/es-toolkit/dist/_chunk/isPlainObject-Xaozpc.js
|
|
1267
|
+
var require_isPlainObject_Xaozpc = __commonJS({
|
|
1268
|
+
"../../node_modules/es-toolkit/dist/_chunk/isPlainObject-Xaozpc.js"(exports) {
|
|
1269
|
+
"use strict";
|
|
1270
|
+
function isPrimitive(value) {
|
|
1271
|
+
return value == null || typeof value !== "object" && typeof value !== "function";
|
|
1272
|
+
}
|
|
1273
|
+
function isTypedArray(x) {
|
|
1274
|
+
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
1275
|
+
}
|
|
1276
|
+
function getSymbols(object) {
|
|
1277
|
+
return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
|
|
1278
|
+
}
|
|
1279
|
+
function getTag(value) {
|
|
1280
|
+
if (value == null) {
|
|
1281
|
+
return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
1282
|
+
}
|
|
1283
|
+
return Object.prototype.toString.call(value);
|
|
1284
|
+
}
|
|
1285
|
+
var regexpTag = "[object RegExp]";
|
|
1286
|
+
var stringTag = "[object String]";
|
|
1287
|
+
var numberTag = "[object Number]";
|
|
1288
|
+
var booleanTag = "[object Boolean]";
|
|
1289
|
+
var argumentsTag = "[object Arguments]";
|
|
1290
|
+
var symbolTag = "[object Symbol]";
|
|
1291
|
+
var dateTag = "[object Date]";
|
|
1292
|
+
var mapTag = "[object Map]";
|
|
1293
|
+
var setTag = "[object Set]";
|
|
1294
|
+
var arrayTag = "[object Array]";
|
|
1295
|
+
var functionTag = "[object Function]";
|
|
1296
|
+
var arrayBufferTag = "[object ArrayBuffer]";
|
|
1297
|
+
var objectTag = "[object Object]";
|
|
1298
|
+
var errorTag = "[object Error]";
|
|
1299
|
+
var dataViewTag = "[object DataView]";
|
|
1300
|
+
var uint8ArrayTag = "[object Uint8Array]";
|
|
1301
|
+
var uint8ClampedArrayTag = "[object Uint8ClampedArray]";
|
|
1302
|
+
var uint16ArrayTag = "[object Uint16Array]";
|
|
1303
|
+
var uint32ArrayTag = "[object Uint32Array]";
|
|
1304
|
+
var bigUint64ArrayTag = "[object BigUint64Array]";
|
|
1305
|
+
var int8ArrayTag = "[object Int8Array]";
|
|
1306
|
+
var int16ArrayTag = "[object Int16Array]";
|
|
1307
|
+
var int32ArrayTag = "[object Int32Array]";
|
|
1308
|
+
var bigInt64ArrayTag = "[object BigInt64Array]";
|
|
1309
|
+
var float32ArrayTag = "[object Float32Array]";
|
|
1310
|
+
var float64ArrayTag = "[object Float64Array]";
|
|
1311
|
+
function isPlainObject(value) {
|
|
1312
|
+
if (!value || typeof value !== "object") {
|
|
1313
|
+
return false;
|
|
1314
|
+
}
|
|
1315
|
+
const proto = Object.getPrototypeOf(value);
|
|
1316
|
+
const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
|
|
1317
|
+
if (!hasObjectPrototype) {
|
|
1318
|
+
return false;
|
|
1319
|
+
}
|
|
1320
|
+
return Object.prototype.toString.call(value) === "[object Object]";
|
|
1321
|
+
}
|
|
1322
|
+
exports.argumentsTag = argumentsTag;
|
|
1323
|
+
exports.arrayBufferTag = arrayBufferTag;
|
|
1324
|
+
exports.arrayTag = arrayTag;
|
|
1325
|
+
exports.bigInt64ArrayTag = bigInt64ArrayTag;
|
|
1326
|
+
exports.bigUint64ArrayTag = bigUint64ArrayTag;
|
|
1327
|
+
exports.booleanTag = booleanTag;
|
|
1328
|
+
exports.dataViewTag = dataViewTag;
|
|
1329
|
+
exports.dateTag = dateTag;
|
|
1330
|
+
exports.errorTag = errorTag;
|
|
1331
|
+
exports.float32ArrayTag = float32ArrayTag;
|
|
1332
|
+
exports.float64ArrayTag = float64ArrayTag;
|
|
1333
|
+
exports.functionTag = functionTag;
|
|
1334
|
+
exports.getSymbols = getSymbols;
|
|
1335
|
+
exports.getTag = getTag;
|
|
1336
|
+
exports.int16ArrayTag = int16ArrayTag;
|
|
1337
|
+
exports.int32ArrayTag = int32ArrayTag;
|
|
1338
|
+
exports.int8ArrayTag = int8ArrayTag;
|
|
1339
|
+
exports.isPlainObject = isPlainObject;
|
|
1340
|
+
exports.isPrimitive = isPrimitive;
|
|
1341
|
+
exports.isTypedArray = isTypedArray;
|
|
1342
|
+
exports.mapTag = mapTag;
|
|
1343
|
+
exports.numberTag = numberTag;
|
|
1344
|
+
exports.objectTag = objectTag;
|
|
1345
|
+
exports.regexpTag = regexpTag;
|
|
1346
|
+
exports.setTag = setTag;
|
|
1347
|
+
exports.stringTag = stringTag;
|
|
1348
|
+
exports.symbolTag = symbolTag;
|
|
1349
|
+
exports.uint16ArrayTag = uint16ArrayTag;
|
|
1350
|
+
exports.uint32ArrayTag = uint32ArrayTag;
|
|
1351
|
+
exports.uint8ArrayTag = uint8ArrayTag;
|
|
1352
|
+
exports.uint8ClampedArrayTag = uint8ClampedArrayTag;
|
|
1353
|
+
}
|
|
1354
|
+
});
|
|
1355
|
+
|
|
1356
|
+
// ../../node_modules/es-toolkit/dist/_chunk/isPlainObject-DINLyA.js
|
|
1357
|
+
var require_isPlainObject_DINLyA = __commonJS({
|
|
1358
|
+
"../../node_modules/es-toolkit/dist/_chunk/isPlainObject-DINLyA.js"(exports) {
|
|
1359
|
+
"use strict";
|
|
1360
|
+
var isPlainObject$1 = require_isPlainObject_Xaozpc();
|
|
1361
|
+
function clone(obj) {
|
|
1362
|
+
if (isPlainObject$1.isPrimitive(obj)) {
|
|
1363
|
+
return obj;
|
|
1364
|
+
}
|
|
1365
|
+
if (Array.isArray(obj) || isPlainObject$1.isTypedArray(obj) || obj instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && obj instanceof SharedArrayBuffer) {
|
|
1366
|
+
return obj.slice(0);
|
|
1367
|
+
}
|
|
1368
|
+
const prototype = Object.getPrototypeOf(obj);
|
|
1369
|
+
const Constructor = prototype.constructor;
|
|
1370
|
+
if (obj instanceof Date || obj instanceof Map || obj instanceof Set) {
|
|
1371
|
+
return new Constructor(obj);
|
|
1372
|
+
}
|
|
1373
|
+
if (obj instanceof RegExp) {
|
|
1374
|
+
const newRegExp = new Constructor(obj);
|
|
1375
|
+
newRegExp.lastIndex = obj.lastIndex;
|
|
1376
|
+
return newRegExp;
|
|
1377
|
+
}
|
|
1378
|
+
if (obj instanceof DataView) {
|
|
1379
|
+
return new Constructor(obj.buffer.slice(0));
|
|
1380
|
+
}
|
|
1381
|
+
if (obj instanceof Error) {
|
|
1382
|
+
const newError = new Constructor(obj.message);
|
|
1383
|
+
newError.stack = obj.stack;
|
|
1384
|
+
newError.name = obj.name;
|
|
1385
|
+
newError.cause = obj.cause;
|
|
1386
|
+
return newError;
|
|
1387
|
+
}
|
|
1388
|
+
if (typeof File !== "undefined" && obj instanceof File) {
|
|
1389
|
+
const newFile = new Constructor([obj], obj.name, { type: obj.type, lastModified: obj.lastModified });
|
|
1390
|
+
return newFile;
|
|
1391
|
+
}
|
|
1392
|
+
if (typeof obj === "object") {
|
|
1393
|
+
const newObject = Object.create(prototype);
|
|
1394
|
+
return Object.assign(newObject, obj);
|
|
1395
|
+
}
|
|
1396
|
+
return obj;
|
|
1397
|
+
}
|
|
1398
|
+
function cloneDeepWith(obj, cloneValue) {
|
|
1399
|
+
return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), cloneValue);
|
|
1400
|
+
}
|
|
1401
|
+
function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @__PURE__ */ new Map(), cloneValue = void 0) {
|
|
1402
|
+
const cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);
|
|
1403
|
+
if (cloned != null) {
|
|
1404
|
+
return cloned;
|
|
1405
|
+
}
|
|
1406
|
+
if (isPlainObject$1.isPrimitive(valueToClone)) {
|
|
1407
|
+
return valueToClone;
|
|
1408
|
+
}
|
|
1409
|
+
if (stack.has(valueToClone)) {
|
|
1410
|
+
return stack.get(valueToClone);
|
|
1411
|
+
}
|
|
1412
|
+
if (Array.isArray(valueToClone)) {
|
|
1413
|
+
const result = new Array(valueToClone.length);
|
|
1414
|
+
stack.set(valueToClone, result);
|
|
1415
|
+
for (let i = 0; i < valueToClone.length; i++) {
|
|
1416
|
+
result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
|
|
1417
|
+
}
|
|
1418
|
+
if (Object.hasOwn(valueToClone, "index")) {
|
|
1419
|
+
result.index = valueToClone.index;
|
|
1420
|
+
}
|
|
1421
|
+
if (Object.hasOwn(valueToClone, "input")) {
|
|
1422
|
+
result.input = valueToClone.input;
|
|
1423
|
+
}
|
|
1424
|
+
return result;
|
|
1425
|
+
}
|
|
1426
|
+
if (valueToClone instanceof Date) {
|
|
1427
|
+
return new Date(valueToClone.getTime());
|
|
1428
|
+
}
|
|
1429
|
+
if (valueToClone instanceof RegExp) {
|
|
1430
|
+
const result = new RegExp(valueToClone.source, valueToClone.flags);
|
|
1431
|
+
result.lastIndex = valueToClone.lastIndex;
|
|
1432
|
+
return result;
|
|
1433
|
+
}
|
|
1434
|
+
if (valueToClone instanceof Map) {
|
|
1435
|
+
const result = /* @__PURE__ */ new Map();
|
|
1436
|
+
stack.set(valueToClone, result);
|
|
1437
|
+
for (const [key, value] of valueToClone) {
|
|
1438
|
+
result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));
|
|
1439
|
+
}
|
|
1440
|
+
return result;
|
|
1441
|
+
}
|
|
1442
|
+
if (valueToClone instanceof Set) {
|
|
1443
|
+
const result = /* @__PURE__ */ new Set();
|
|
1444
|
+
stack.set(valueToClone, result);
|
|
1445
|
+
for (const value of valueToClone) {
|
|
1446
|
+
result.add(cloneDeepWithImpl(value, void 0, objectToClone, stack, cloneValue));
|
|
1447
|
+
}
|
|
1448
|
+
return result;
|
|
1449
|
+
}
|
|
1450
|
+
if (typeof Buffer !== "undefined" && Buffer.isBuffer(valueToClone)) {
|
|
1451
|
+
return valueToClone.subarray();
|
|
1452
|
+
}
|
|
1453
|
+
if (isPlainObject$1.isTypedArray(valueToClone)) {
|
|
1454
|
+
const result = new (Object.getPrototypeOf(valueToClone)).constructor(valueToClone.length);
|
|
1455
|
+
stack.set(valueToClone, result);
|
|
1456
|
+
for (let i = 0; i < valueToClone.length; i++) {
|
|
1457
|
+
result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
|
|
1458
|
+
}
|
|
1459
|
+
return result;
|
|
1460
|
+
}
|
|
1461
|
+
if (valueToClone instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && valueToClone instanceof SharedArrayBuffer) {
|
|
1462
|
+
return valueToClone.slice(0);
|
|
1463
|
+
}
|
|
1464
|
+
if (valueToClone instanceof DataView) {
|
|
1465
|
+
const result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);
|
|
1466
|
+
stack.set(valueToClone, result);
|
|
1467
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
1468
|
+
return result;
|
|
1469
|
+
}
|
|
1470
|
+
if (typeof File !== "undefined" && valueToClone instanceof File) {
|
|
1471
|
+
const result = new File([valueToClone], valueToClone.name, {
|
|
1472
|
+
type: valueToClone.type
|
|
1473
|
+
});
|
|
1474
|
+
stack.set(valueToClone, result);
|
|
1475
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
1476
|
+
return result;
|
|
1477
|
+
}
|
|
1478
|
+
if (valueToClone instanceof Blob) {
|
|
1479
|
+
const result = new Blob([valueToClone], { type: valueToClone.type });
|
|
1480
|
+
stack.set(valueToClone, result);
|
|
1481
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
1482
|
+
return result;
|
|
1483
|
+
}
|
|
1484
|
+
if (valueToClone instanceof Error) {
|
|
1485
|
+
const result = new valueToClone.constructor();
|
|
1486
|
+
stack.set(valueToClone, result);
|
|
1487
|
+
result.message = valueToClone.message;
|
|
1488
|
+
result.name = valueToClone.name;
|
|
1489
|
+
result.stack = valueToClone.stack;
|
|
1490
|
+
result.cause = valueToClone.cause;
|
|
1491
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
1492
|
+
return result;
|
|
1493
|
+
}
|
|
1494
|
+
if (typeof valueToClone === "object" && isCloneableObject(valueToClone)) {
|
|
1495
|
+
const result = Object.create(Object.getPrototypeOf(valueToClone));
|
|
1496
|
+
stack.set(valueToClone, result);
|
|
1497
|
+
copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
|
|
1498
|
+
return result;
|
|
1499
|
+
}
|
|
1500
|
+
return valueToClone;
|
|
1501
|
+
}
|
|
1502
|
+
function copyProperties(target, source, objectToClone = target, stack, cloneValue) {
|
|
1503
|
+
const keys = [...Object.keys(source), ...isPlainObject$1.getSymbols(source)];
|
|
1504
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1505
|
+
const key = keys[i];
|
|
1506
|
+
const descriptor = Object.getOwnPropertyDescriptor(target, key);
|
|
1507
|
+
if (descriptor == null || descriptor.writable) {
|
|
1508
|
+
target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue);
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
function isCloneableObject(object) {
|
|
1513
|
+
switch (isPlainObject$1.getTag(object)) {
|
|
1514
|
+
case isPlainObject$1.argumentsTag:
|
|
1515
|
+
case isPlainObject$1.arrayTag:
|
|
1516
|
+
case isPlainObject$1.arrayBufferTag:
|
|
1517
|
+
case isPlainObject$1.dataViewTag:
|
|
1518
|
+
case isPlainObject$1.booleanTag:
|
|
1519
|
+
case isPlainObject$1.dateTag:
|
|
1520
|
+
case isPlainObject$1.float32ArrayTag:
|
|
1521
|
+
case isPlainObject$1.float64ArrayTag:
|
|
1522
|
+
case isPlainObject$1.int8ArrayTag:
|
|
1523
|
+
case isPlainObject$1.int16ArrayTag:
|
|
1524
|
+
case isPlainObject$1.int32ArrayTag:
|
|
1525
|
+
case isPlainObject$1.mapTag:
|
|
1526
|
+
case isPlainObject$1.numberTag:
|
|
1527
|
+
case isPlainObject$1.objectTag:
|
|
1528
|
+
case isPlainObject$1.regexpTag:
|
|
1529
|
+
case isPlainObject$1.setTag:
|
|
1530
|
+
case isPlainObject$1.stringTag:
|
|
1531
|
+
case isPlainObject$1.symbolTag:
|
|
1532
|
+
case isPlainObject$1.uint8ArrayTag:
|
|
1533
|
+
case isPlainObject$1.uint8ClampedArrayTag:
|
|
1534
|
+
case isPlainObject$1.uint16ArrayTag:
|
|
1535
|
+
case isPlainObject$1.uint32ArrayTag: {
|
|
1536
|
+
return true;
|
|
1537
|
+
}
|
|
1538
|
+
default: {
|
|
1539
|
+
return false;
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
function cloneDeep(obj) {
|
|
1544
|
+
return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), void 0);
|
|
1545
|
+
}
|
|
1546
|
+
function findKey(obj, predicate) {
|
|
1547
|
+
const keys = Object.keys(obj);
|
|
1548
|
+
return keys.find((key) => predicate(obj[key], key, obj));
|
|
1549
|
+
}
|
|
1550
|
+
function invert(obj) {
|
|
1551
|
+
const result = {};
|
|
1552
|
+
const keys = Object.keys(obj);
|
|
1553
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1554
|
+
const key = keys[i];
|
|
1555
|
+
const value = obj[key];
|
|
1556
|
+
result[value] = key;
|
|
1557
|
+
}
|
|
1558
|
+
return result;
|
|
1559
|
+
}
|
|
1560
|
+
function mapKeys(object, getNewKey) {
|
|
1561
|
+
const result = {};
|
|
1562
|
+
const keys = Object.keys(object);
|
|
1563
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1564
|
+
const key = keys[i];
|
|
1565
|
+
const value = object[key];
|
|
1566
|
+
result[getNewKey(value, key, object)] = value;
|
|
1567
|
+
}
|
|
1568
|
+
return result;
|
|
1569
|
+
}
|
|
1570
|
+
function mapValues(object, getNewValue) {
|
|
1571
|
+
const result = {};
|
|
1572
|
+
const keys = Object.keys(object);
|
|
1573
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1574
|
+
const key = keys[i];
|
|
1575
|
+
const value = object[key];
|
|
1576
|
+
result[key] = getNewValue(value, key, object);
|
|
1577
|
+
}
|
|
1578
|
+
return result;
|
|
1579
|
+
}
|
|
1580
|
+
function isObjectLike(value) {
|
|
1581
|
+
return typeof value === "object" && value !== null;
|
|
1582
|
+
}
|
|
1583
|
+
function isArray(value) {
|
|
1584
|
+
return Array.isArray(value);
|
|
1585
|
+
}
|
|
1586
|
+
function isPlainObject(object) {
|
|
1587
|
+
if (typeof object !== "object") {
|
|
1588
|
+
return false;
|
|
1589
|
+
}
|
|
1590
|
+
if (object == null) {
|
|
1591
|
+
return false;
|
|
1592
|
+
}
|
|
1593
|
+
if (Object.getPrototypeOf(object) === null) {
|
|
1594
|
+
return true;
|
|
1595
|
+
}
|
|
1596
|
+
if (Object.prototype.toString.call(object) !== "[object Object]") {
|
|
1597
|
+
const tag = object[Symbol.toStringTag];
|
|
1598
|
+
if (tag == null) {
|
|
1599
|
+
return false;
|
|
1600
|
+
}
|
|
1601
|
+
const isTagReadonly = !Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)?.writable;
|
|
1602
|
+
if (isTagReadonly) {
|
|
1603
|
+
return false;
|
|
1604
|
+
}
|
|
1605
|
+
return object.toString() === `[object ${tag}]`;
|
|
1606
|
+
}
|
|
1607
|
+
let proto = object;
|
|
1608
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
1609
|
+
proto = Object.getPrototypeOf(proto);
|
|
1610
|
+
}
|
|
1611
|
+
return Object.getPrototypeOf(object) === proto;
|
|
1612
|
+
}
|
|
1613
|
+
exports.clone = clone;
|
|
1614
|
+
exports.cloneDeep = cloneDeep;
|
|
1615
|
+
exports.cloneDeepWith = cloneDeepWith;
|
|
1616
|
+
exports.copyProperties = copyProperties;
|
|
1617
|
+
exports.findKey = findKey;
|
|
1618
|
+
exports.invert = invert;
|
|
1619
|
+
exports.isArray = isArray;
|
|
1620
|
+
exports.isObjectLike = isObjectLike;
|
|
1621
|
+
exports.isPlainObject = isPlainObject;
|
|
1622
|
+
exports.mapKeys = mapKeys;
|
|
1623
|
+
exports.mapValues = mapValues;
|
|
1624
|
+
}
|
|
1625
|
+
});
|
|
1626
|
+
|
|
1627
|
+
// ../../node_modules/es-toolkit/dist/_chunk/snakeCase-6cG1f4.js
|
|
1628
|
+
var require_snakeCase_6cG1f4 = __commonJS({
|
|
1629
|
+
"../../node_modules/es-toolkit/dist/_chunk/snakeCase-6cG1f4.js"(exports) {
|
|
1630
|
+
"use strict";
|
|
1631
|
+
function capitalize(str) {
|
|
1632
|
+
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
1633
|
+
}
|
|
1634
|
+
var CASE_SPLIT_PATTERN = /\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;
|
|
1635
|
+
function words(str) {
|
|
1636
|
+
return Array.from(str.match(CASE_SPLIT_PATTERN) ?? []);
|
|
1637
|
+
}
|
|
1638
|
+
function camelCase(str) {
|
|
1639
|
+
const words$1 = words(str);
|
|
1640
|
+
if (words$1.length === 0) {
|
|
1641
|
+
return "";
|
|
1642
|
+
}
|
|
1643
|
+
const [first, ...rest] = words$1;
|
|
1644
|
+
return `${first.toLowerCase()}${rest.map((word) => capitalize(word)).join("")}`;
|
|
1645
|
+
}
|
|
1646
|
+
function snakeCase(str) {
|
|
1647
|
+
const words$1 = words(str);
|
|
1648
|
+
return words$1.map((word) => word.toLowerCase()).join("_");
|
|
1649
|
+
}
|
|
1650
|
+
exports.camelCase = camelCase;
|
|
1651
|
+
exports.capitalize = capitalize;
|
|
1652
|
+
exports.snakeCase = snakeCase;
|
|
1653
|
+
exports.words = words;
|
|
1654
|
+
}
|
|
1655
|
+
});
|
|
1656
|
+
|
|
1657
|
+
// ../../node_modules/es-toolkit/dist/object/index.js
|
|
1658
|
+
var require_object = __commonJS({
|
|
1659
|
+
"../../node_modules/es-toolkit/dist/object/index.js"(exports) {
|
|
1660
|
+
"use strict";
|
|
1661
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1662
|
+
var isPlainObject = require_isPlainObject_DINLyA();
|
|
1663
|
+
var isPlainObject$1 = require_isPlainObject_Xaozpc();
|
|
1664
|
+
var snakeCase = require_snakeCase_6cG1f4();
|
|
1665
|
+
function flattenObject(object, { delimiter = "." } = {}) {
|
|
1666
|
+
return flattenObjectImpl(object, "", delimiter);
|
|
1667
|
+
}
|
|
1668
|
+
function flattenObjectImpl(object, prefix = "", delimiter = ".") {
|
|
1669
|
+
const result = {};
|
|
1670
|
+
const keys = Object.keys(object);
|
|
1671
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1672
|
+
const key = keys[i];
|
|
1673
|
+
const value = object[key];
|
|
1674
|
+
const prefixedKey = prefix ? `${prefix}${delimiter}${key}` : key;
|
|
1675
|
+
if (isPlainObject$1.isPlainObject(value) && Object.keys(value).length > 0) {
|
|
1676
|
+
Object.assign(result, flattenObjectImpl(value, prefixedKey, delimiter));
|
|
1677
|
+
continue;
|
|
1678
|
+
}
|
|
1679
|
+
if (Array.isArray(value)) {
|
|
1680
|
+
Object.assign(result, flattenObjectImpl(value, prefixedKey, delimiter));
|
|
1681
|
+
continue;
|
|
1682
|
+
}
|
|
1683
|
+
result[prefixedKey] = value;
|
|
1684
|
+
}
|
|
1685
|
+
return result;
|
|
1686
|
+
}
|
|
1687
|
+
function merge(target, source) {
|
|
1688
|
+
const sourceKeys = Object.keys(source);
|
|
1689
|
+
for (let i = 0; i < sourceKeys.length; i++) {
|
|
1690
|
+
const key = sourceKeys[i];
|
|
1691
|
+
const sourceValue = source[key];
|
|
1692
|
+
const targetValue = target[key];
|
|
1693
|
+
if (Array.isArray(sourceValue)) {
|
|
1694
|
+
if (Array.isArray(targetValue)) {
|
|
1695
|
+
target[key] = merge(targetValue, sourceValue);
|
|
1696
|
+
} else {
|
|
1697
|
+
target[key] = merge([], sourceValue);
|
|
1698
|
+
}
|
|
1699
|
+
} else if (isPlainObject$1.isPlainObject(sourceValue)) {
|
|
1700
|
+
if (isPlainObject$1.isPlainObject(targetValue)) {
|
|
1701
|
+
target[key] = merge(targetValue, sourceValue);
|
|
1702
|
+
} else {
|
|
1703
|
+
target[key] = merge({}, sourceValue);
|
|
1704
|
+
}
|
|
1705
|
+
} else if (targetValue === void 0 || sourceValue !== void 0) {
|
|
1706
|
+
target[key] = sourceValue;
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
return target;
|
|
1710
|
+
}
|
|
1711
|
+
function mergeWith(target, source, merge2) {
|
|
1712
|
+
const sourceKeys = Object.keys(source);
|
|
1713
|
+
for (let i = 0; i < sourceKeys.length; i++) {
|
|
1714
|
+
const key = sourceKeys[i];
|
|
1715
|
+
const sourceValue = source[key];
|
|
1716
|
+
const targetValue = target[key];
|
|
1717
|
+
const merged = merge2(targetValue, sourceValue, key, target, source);
|
|
1718
|
+
if (merged != null) {
|
|
1719
|
+
target[key] = merged;
|
|
1720
|
+
} else if (Array.isArray(sourceValue)) {
|
|
1721
|
+
target[key] = mergeWith(targetValue ?? [], sourceValue, merge2);
|
|
1722
|
+
} else if (isPlainObject.isObjectLike(targetValue) && isPlainObject.isObjectLike(sourceValue)) {
|
|
1723
|
+
target[key] = mergeWith(targetValue ?? {}, sourceValue, merge2);
|
|
1724
|
+
} else if (targetValue === void 0 || sourceValue !== void 0) {
|
|
1725
|
+
target[key] = sourceValue;
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
return target;
|
|
1729
|
+
}
|
|
1730
|
+
function omit(obj, keys) {
|
|
1731
|
+
const result = { ...obj };
|
|
1732
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1733
|
+
const key = keys[i];
|
|
1734
|
+
delete result[key];
|
|
1735
|
+
}
|
|
1736
|
+
return result;
|
|
1737
|
+
}
|
|
1738
|
+
function omitBy(obj, shouldOmit) {
|
|
1739
|
+
const result = {};
|
|
1740
|
+
const keys = Object.keys(obj);
|
|
1741
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1742
|
+
const key = keys[i];
|
|
1743
|
+
const value = obj[key];
|
|
1744
|
+
if (!shouldOmit(value, key)) {
|
|
1745
|
+
result[key] = value;
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
return result;
|
|
1749
|
+
}
|
|
1750
|
+
function pick(obj, keys) {
|
|
1751
|
+
const result = {};
|
|
1752
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1753
|
+
const key = keys[i];
|
|
1754
|
+
if (Object.hasOwn(obj, key)) {
|
|
1755
|
+
result[key] = obj[key];
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
return result;
|
|
1759
|
+
}
|
|
1760
|
+
function pickBy(obj, shouldPick) {
|
|
1761
|
+
const result = {};
|
|
1762
|
+
const keys = Object.keys(obj);
|
|
1763
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1764
|
+
const key = keys[i];
|
|
1765
|
+
const value = obj[key];
|
|
1766
|
+
if (shouldPick(value, key)) {
|
|
1767
|
+
result[key] = value;
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
return result;
|
|
1771
|
+
}
|
|
1772
|
+
function toCamelCaseKeys(obj) {
|
|
1773
|
+
if (isPlainObject.isArray(obj)) {
|
|
1774
|
+
return obj.map((item) => toCamelCaseKeys(item));
|
|
1775
|
+
}
|
|
1776
|
+
if (isPlainObject$1.isPlainObject(obj)) {
|
|
1777
|
+
const result = {};
|
|
1778
|
+
const keys = Object.keys(obj);
|
|
1779
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1780
|
+
const key = keys[i];
|
|
1781
|
+
const camelKey = snakeCase.camelCase(key);
|
|
1782
|
+
const camelCaseKeys = toCamelCaseKeys(obj[key]);
|
|
1783
|
+
result[camelKey] = camelCaseKeys;
|
|
1784
|
+
}
|
|
1785
|
+
return result;
|
|
1786
|
+
}
|
|
1787
|
+
return obj;
|
|
1788
|
+
}
|
|
1789
|
+
function toMerged(target, source) {
|
|
1790
|
+
return merge(isPlainObject.cloneDeep(target), source);
|
|
1791
|
+
}
|
|
1792
|
+
function toSnakeCaseKeys(obj) {
|
|
1793
|
+
if (isPlainObject.isArray(obj)) {
|
|
1794
|
+
return obj.map((item) => toSnakeCaseKeys(item));
|
|
1795
|
+
}
|
|
1796
|
+
if (isPlainObject.isPlainObject(obj)) {
|
|
1797
|
+
const result = {};
|
|
1798
|
+
const keys = Object.keys(obj);
|
|
1799
|
+
for (let i = 0; i < keys.length; i++) {
|
|
1800
|
+
const key = keys[i];
|
|
1801
|
+
const snakeKey = snakeCase.snakeCase(key);
|
|
1802
|
+
const snakeCaseKeys = toSnakeCaseKeys(obj[key]);
|
|
1803
|
+
result[snakeKey] = snakeCaseKeys;
|
|
1804
|
+
}
|
|
1805
|
+
return result;
|
|
1806
|
+
}
|
|
1807
|
+
return obj;
|
|
1808
|
+
}
|
|
1809
|
+
exports.clone = isPlainObject.clone;
|
|
1810
|
+
exports.cloneDeep = isPlainObject.cloneDeep;
|
|
1811
|
+
exports.cloneDeepWith = isPlainObject.cloneDeepWith;
|
|
1812
|
+
exports.findKey = isPlainObject.findKey;
|
|
1813
|
+
exports.invert = isPlainObject.invert;
|
|
1814
|
+
exports.mapKeys = isPlainObject.mapKeys;
|
|
1815
|
+
exports.mapValues = isPlainObject.mapValues;
|
|
1816
|
+
exports.flattenObject = flattenObject;
|
|
1817
|
+
exports.merge = merge;
|
|
1818
|
+
exports.mergeWith = mergeWith;
|
|
1819
|
+
exports.omit = omit;
|
|
1820
|
+
exports.omitBy = omitBy;
|
|
1821
|
+
exports.pick = pick;
|
|
1822
|
+
exports.pickBy = pickBy;
|
|
1823
|
+
exports.toCamelCaseKeys = toCamelCaseKeys;
|
|
1824
|
+
exports.toMerged = toMerged;
|
|
1825
|
+
exports.toSnakeCaseKeys = toSnakeCaseKeys;
|
|
1826
|
+
}
|
|
1827
|
+
});
|
|
1828
|
+
|
|
1829
|
+
// ../../node_modules/es-toolkit/dist/_chunk/isWeakSet-403Sh5.js
|
|
1830
|
+
var require_isWeakSet_403Sh5 = __commonJS({
|
|
1831
|
+
"../../node_modules/es-toolkit/dist/_chunk/isWeakSet-403Sh5.js"(exports) {
|
|
1832
|
+
"use strict";
|
|
1833
|
+
var isPlainObject = require_isPlainObject_Xaozpc();
|
|
1834
|
+
var noop = require_noop_2IwLUk();
|
|
1835
|
+
function isArrayBuffer(value) {
|
|
1836
|
+
return value instanceof ArrayBuffer;
|
|
1837
|
+
}
|
|
1838
|
+
function isBuffer(x) {
|
|
1839
|
+
return typeof Buffer !== "undefined" && Buffer.isBuffer(x);
|
|
1840
|
+
}
|
|
1841
|
+
function isDate(value) {
|
|
1842
|
+
return value instanceof Date;
|
|
1843
|
+
}
|
|
1844
|
+
function eq(value, other) {
|
|
1845
|
+
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
1846
|
+
}
|
|
1847
|
+
function isEqualWith(a, b, areValuesEqual) {
|
|
1848
|
+
return isEqualWithImpl(a, b, void 0, void 0, void 0, void 0, areValuesEqual);
|
|
1849
|
+
}
|
|
1850
|
+
function isEqualWithImpl(a, b, property, aParent, bParent, stack, areValuesEqual) {
|
|
1851
|
+
const result = areValuesEqual(a, b, property, aParent, bParent, stack);
|
|
1852
|
+
if (result !== void 0) {
|
|
1853
|
+
return result;
|
|
1854
|
+
}
|
|
1855
|
+
if (typeof a === typeof b) {
|
|
1856
|
+
switch (typeof a) {
|
|
1857
|
+
case "bigint":
|
|
1858
|
+
case "string":
|
|
1859
|
+
case "boolean":
|
|
1860
|
+
case "symbol":
|
|
1861
|
+
case "undefined": {
|
|
1862
|
+
return a === b;
|
|
1863
|
+
}
|
|
1864
|
+
case "number": {
|
|
1865
|
+
return a === b || Object.is(a, b);
|
|
1866
|
+
}
|
|
1867
|
+
case "function": {
|
|
1868
|
+
return a === b;
|
|
1869
|
+
}
|
|
1870
|
+
case "object": {
|
|
1871
|
+
return areObjectsEqual(a, b, stack, areValuesEqual);
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
return areObjectsEqual(a, b, stack, areValuesEqual);
|
|
1876
|
+
}
|
|
1877
|
+
function areObjectsEqual(a, b, stack, areValuesEqual) {
|
|
1878
|
+
if (Object.is(a, b)) {
|
|
1879
|
+
return true;
|
|
1880
|
+
}
|
|
1881
|
+
let aTag = isPlainObject.getTag(a);
|
|
1882
|
+
let bTag = isPlainObject.getTag(b);
|
|
1883
|
+
if (aTag === isPlainObject.argumentsTag) {
|
|
1884
|
+
aTag = isPlainObject.objectTag;
|
|
1885
|
+
}
|
|
1886
|
+
if (bTag === isPlainObject.argumentsTag) {
|
|
1887
|
+
bTag = isPlainObject.objectTag;
|
|
1888
|
+
}
|
|
1889
|
+
if (aTag !== bTag) {
|
|
1890
|
+
return false;
|
|
1891
|
+
}
|
|
1892
|
+
switch (aTag) {
|
|
1893
|
+
case isPlainObject.stringTag:
|
|
1894
|
+
return a.toString() === b.toString();
|
|
1895
|
+
case isPlainObject.numberTag: {
|
|
1896
|
+
const x = a.valueOf();
|
|
1897
|
+
const y = b.valueOf();
|
|
1898
|
+
return eq(x, y);
|
|
1899
|
+
}
|
|
1900
|
+
case isPlainObject.booleanTag:
|
|
1901
|
+
case isPlainObject.dateTag:
|
|
1902
|
+
case isPlainObject.symbolTag:
|
|
1903
|
+
return Object.is(a.valueOf(), b.valueOf());
|
|
1904
|
+
case isPlainObject.regexpTag: {
|
|
1905
|
+
return a.source === b.source && a.flags === b.flags;
|
|
1906
|
+
}
|
|
1907
|
+
case isPlainObject.functionTag: {
|
|
1908
|
+
return a === b;
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
stack = stack ?? /* @__PURE__ */ new Map();
|
|
1912
|
+
const aStack = stack.get(a);
|
|
1913
|
+
const bStack = stack.get(b);
|
|
1914
|
+
if (aStack != null && bStack != null) {
|
|
1915
|
+
return aStack === b;
|
|
1916
|
+
}
|
|
1917
|
+
stack.set(a, b);
|
|
1918
|
+
stack.set(b, a);
|
|
1919
|
+
try {
|
|
1920
|
+
switch (aTag) {
|
|
1921
|
+
case isPlainObject.mapTag: {
|
|
1922
|
+
if (a.size !== b.size) {
|
|
1923
|
+
return false;
|
|
1924
|
+
}
|
|
1925
|
+
for (const [key, value] of a.entries()) {
|
|
1926
|
+
if (!b.has(key) || !isEqualWithImpl(value, b.get(key), key, a, b, stack, areValuesEqual)) {
|
|
1927
|
+
return false;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
return true;
|
|
1931
|
+
}
|
|
1932
|
+
case isPlainObject.setTag: {
|
|
1933
|
+
if (a.size !== b.size) {
|
|
1934
|
+
return false;
|
|
1935
|
+
}
|
|
1936
|
+
const aValues = Array.from(a.values());
|
|
1937
|
+
const bValues = Array.from(b.values());
|
|
1938
|
+
for (let i = 0; i < aValues.length; i++) {
|
|
1939
|
+
const aValue = aValues[i];
|
|
1940
|
+
const index = bValues.findIndex((bValue) => {
|
|
1941
|
+
return isEqualWithImpl(aValue, bValue, void 0, a, b, stack, areValuesEqual);
|
|
1942
|
+
});
|
|
1943
|
+
if (index === -1) {
|
|
1944
|
+
return false;
|
|
1945
|
+
}
|
|
1946
|
+
bValues.splice(index, 1);
|
|
1947
|
+
}
|
|
1948
|
+
return true;
|
|
1949
|
+
}
|
|
1950
|
+
case isPlainObject.arrayTag:
|
|
1951
|
+
case isPlainObject.uint8ArrayTag:
|
|
1952
|
+
case isPlainObject.uint8ClampedArrayTag:
|
|
1953
|
+
case isPlainObject.uint16ArrayTag:
|
|
1954
|
+
case isPlainObject.uint32ArrayTag:
|
|
1955
|
+
case isPlainObject.bigUint64ArrayTag:
|
|
1956
|
+
case isPlainObject.int8ArrayTag:
|
|
1957
|
+
case isPlainObject.int16ArrayTag:
|
|
1958
|
+
case isPlainObject.int32ArrayTag:
|
|
1959
|
+
case isPlainObject.bigInt64ArrayTag:
|
|
1960
|
+
case isPlainObject.float32ArrayTag:
|
|
1961
|
+
case isPlainObject.float64ArrayTag: {
|
|
1962
|
+
if (typeof Buffer !== "undefined" && Buffer.isBuffer(a) !== Buffer.isBuffer(b)) {
|
|
1963
|
+
return false;
|
|
1964
|
+
}
|
|
1965
|
+
if (a.length !== b.length) {
|
|
1966
|
+
return false;
|
|
1967
|
+
}
|
|
1968
|
+
for (let i = 0; i < a.length; i++) {
|
|
1969
|
+
if (!isEqualWithImpl(a[i], b[i], i, a, b, stack, areValuesEqual)) {
|
|
1970
|
+
return false;
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
return true;
|
|
1974
|
+
}
|
|
1975
|
+
case isPlainObject.arrayBufferTag: {
|
|
1976
|
+
if (a.byteLength !== b.byteLength) {
|
|
1977
|
+
return false;
|
|
1978
|
+
}
|
|
1979
|
+
return areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
|
|
1980
|
+
}
|
|
1981
|
+
case isPlainObject.dataViewTag: {
|
|
1982
|
+
if (a.byteLength !== b.byteLength || a.byteOffset !== b.byteOffset) {
|
|
1983
|
+
return false;
|
|
1984
|
+
}
|
|
1985
|
+
return areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
|
|
1986
|
+
}
|
|
1987
|
+
case isPlainObject.errorTag: {
|
|
1988
|
+
return a.name === b.name && a.message === b.message;
|
|
1989
|
+
}
|
|
1990
|
+
case isPlainObject.objectTag: {
|
|
1991
|
+
const areEqualInstances = areObjectsEqual(a.constructor, b.constructor, stack, areValuesEqual) || isPlainObject.isPlainObject(a) && isPlainObject.isPlainObject(b);
|
|
1992
|
+
if (!areEqualInstances) {
|
|
1993
|
+
return false;
|
|
1994
|
+
}
|
|
1995
|
+
const aKeys = [...Object.keys(a), ...isPlainObject.getSymbols(a)];
|
|
1996
|
+
const bKeys = [...Object.keys(b), ...isPlainObject.getSymbols(b)];
|
|
1997
|
+
if (aKeys.length !== bKeys.length) {
|
|
1998
|
+
return false;
|
|
1999
|
+
}
|
|
2000
|
+
for (let i = 0; i < aKeys.length; i++) {
|
|
2001
|
+
const propKey = aKeys[i];
|
|
2002
|
+
const aProp = a[propKey];
|
|
2003
|
+
if (!Object.hasOwn(b, propKey)) {
|
|
2004
|
+
return false;
|
|
2005
|
+
}
|
|
2006
|
+
const bProp = b[propKey];
|
|
2007
|
+
if (!isEqualWithImpl(aProp, bProp, propKey, a, b, stack, areValuesEqual)) {
|
|
2008
|
+
return false;
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
return true;
|
|
2012
|
+
}
|
|
2013
|
+
default: {
|
|
2014
|
+
return false;
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
} finally {
|
|
2018
|
+
stack.delete(a);
|
|
2019
|
+
stack.delete(b);
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
function isEqual(a, b) {
|
|
2023
|
+
return isEqualWith(a, b, noop.noop);
|
|
2024
|
+
}
|
|
2025
|
+
function isFunction(value) {
|
|
2026
|
+
return typeof value === "function";
|
|
2027
|
+
}
|
|
2028
|
+
function isLength(value) {
|
|
2029
|
+
return Number.isSafeInteger(value) && value >= 0;
|
|
2030
|
+
}
|
|
2031
|
+
function isMap(value) {
|
|
2032
|
+
return value instanceof Map;
|
|
2033
|
+
}
|
|
2034
|
+
function isNil(x) {
|
|
2035
|
+
return x == null;
|
|
2036
|
+
}
|
|
2037
|
+
function isNull(x) {
|
|
2038
|
+
return x === null;
|
|
2039
|
+
}
|
|
2040
|
+
function isRegExp(value) {
|
|
2041
|
+
return value instanceof RegExp;
|
|
2042
|
+
}
|
|
2043
|
+
function isSet(value) {
|
|
2044
|
+
return value instanceof Set;
|
|
2045
|
+
}
|
|
2046
|
+
function isSymbol(value) {
|
|
2047
|
+
return typeof value === "symbol";
|
|
2048
|
+
}
|
|
2049
|
+
function isUndefined(x) {
|
|
2050
|
+
return x === void 0;
|
|
2051
|
+
}
|
|
2052
|
+
function isWeakMap(value) {
|
|
2053
|
+
return value instanceof WeakMap;
|
|
2054
|
+
}
|
|
2055
|
+
function isWeakSet(value) {
|
|
2056
|
+
return value instanceof WeakSet;
|
|
2057
|
+
}
|
|
2058
|
+
exports.eq = eq;
|
|
2059
|
+
exports.isArrayBuffer = isArrayBuffer;
|
|
2060
|
+
exports.isBuffer = isBuffer;
|
|
2061
|
+
exports.isDate = isDate;
|
|
2062
|
+
exports.isEqual = isEqual;
|
|
2063
|
+
exports.isEqualWith = isEqualWith;
|
|
2064
|
+
exports.isFunction = isFunction;
|
|
2065
|
+
exports.isLength = isLength;
|
|
2066
|
+
exports.isMap = isMap;
|
|
2067
|
+
exports.isNil = isNil;
|
|
2068
|
+
exports.isNull = isNull;
|
|
2069
|
+
exports.isRegExp = isRegExp;
|
|
2070
|
+
exports.isSet = isSet;
|
|
2071
|
+
exports.isSymbol = isSymbol;
|
|
2072
|
+
exports.isUndefined = isUndefined;
|
|
2073
|
+
exports.isWeakMap = isWeakMap;
|
|
2074
|
+
exports.isWeakSet = isWeakSet;
|
|
2075
|
+
}
|
|
2076
|
+
});
|
|
2077
|
+
|
|
2078
|
+
// ../../node_modules/es-toolkit/dist/predicate/index.js
|
|
2079
|
+
var require_predicate = __commonJS({
|
|
2080
|
+
"../../node_modules/es-toolkit/dist/predicate/index.js"(exports) {
|
|
2081
|
+
"use strict";
|
|
2082
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2083
|
+
var isWeakSet = require_isWeakSet_403Sh5();
|
|
2084
|
+
var isPlainObject = require_isPlainObject_Xaozpc();
|
|
2085
|
+
function isBlob(x) {
|
|
2086
|
+
if (typeof Blob === "undefined") {
|
|
2087
|
+
return false;
|
|
2088
|
+
}
|
|
2089
|
+
return x instanceof Blob;
|
|
2090
|
+
}
|
|
2091
|
+
function isBoolean(x) {
|
|
2092
|
+
return typeof x === "boolean";
|
|
2093
|
+
}
|
|
2094
|
+
function isBrowser() {
|
|
2095
|
+
return typeof window !== "undefined" && window?.document != null;
|
|
2096
|
+
}
|
|
2097
|
+
function isError(value) {
|
|
2098
|
+
return value instanceof Error;
|
|
2099
|
+
}
|
|
2100
|
+
function isFile(x) {
|
|
2101
|
+
if (typeof File === "undefined") {
|
|
2102
|
+
return false;
|
|
2103
|
+
}
|
|
2104
|
+
return isBlob(x) && x instanceof File;
|
|
2105
|
+
}
|
|
2106
|
+
function isJSON(value) {
|
|
2107
|
+
if (typeof value !== "string") {
|
|
2108
|
+
return false;
|
|
2109
|
+
}
|
|
2110
|
+
try {
|
|
2111
|
+
JSON.parse(value);
|
|
2112
|
+
return true;
|
|
2113
|
+
} catch {
|
|
2114
|
+
return false;
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
function isJSONValue(value) {
|
|
2118
|
+
switch (typeof value) {
|
|
2119
|
+
case "object": {
|
|
2120
|
+
return value === null || isJSONArray(value) || isJSONObject(value);
|
|
2121
|
+
}
|
|
2122
|
+
case "string":
|
|
2123
|
+
case "number":
|
|
2124
|
+
case "boolean": {
|
|
2125
|
+
return true;
|
|
2126
|
+
}
|
|
2127
|
+
default: {
|
|
2128
|
+
return false;
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
function isJSONArray(value) {
|
|
2133
|
+
if (!Array.isArray(value)) {
|
|
2134
|
+
return false;
|
|
2135
|
+
}
|
|
2136
|
+
return value.every((item) => isJSONValue(item));
|
|
2137
|
+
}
|
|
2138
|
+
function isJSONObject(obj) {
|
|
2139
|
+
if (!isPlainObject.isPlainObject(obj)) {
|
|
2140
|
+
return false;
|
|
2141
|
+
}
|
|
2142
|
+
const keys = Reflect.ownKeys(obj);
|
|
2143
|
+
for (let i = 0; i < keys.length; i++) {
|
|
2144
|
+
const key = keys[i];
|
|
2145
|
+
const value = obj[key];
|
|
2146
|
+
if (typeof key !== "string") {
|
|
2147
|
+
return false;
|
|
2148
|
+
}
|
|
2149
|
+
if (!isJSONValue(value)) {
|
|
2150
|
+
return false;
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
return true;
|
|
2154
|
+
}
|
|
2155
|
+
function isNode() {
|
|
2156
|
+
return typeof process !== "undefined" && process?.versions?.node != null;
|
|
2157
|
+
}
|
|
2158
|
+
function isNotNil(x) {
|
|
2159
|
+
return x != null;
|
|
2160
|
+
}
|
|
2161
|
+
function isPromise(value) {
|
|
2162
|
+
return value instanceof Promise;
|
|
2163
|
+
}
|
|
2164
|
+
function isString(value) {
|
|
2165
|
+
return typeof value === "string";
|
|
2166
|
+
}
|
|
2167
|
+
exports.isArrayBuffer = isWeakSet.isArrayBuffer;
|
|
2168
|
+
exports.isBuffer = isWeakSet.isBuffer;
|
|
2169
|
+
exports.isDate = isWeakSet.isDate;
|
|
2170
|
+
exports.isEqual = isWeakSet.isEqual;
|
|
2171
|
+
exports.isEqualWith = isWeakSet.isEqualWith;
|
|
2172
|
+
exports.isFunction = isWeakSet.isFunction;
|
|
2173
|
+
exports.isLength = isWeakSet.isLength;
|
|
2174
|
+
exports.isMap = isWeakSet.isMap;
|
|
2175
|
+
exports.isNil = isWeakSet.isNil;
|
|
2176
|
+
exports.isNull = isWeakSet.isNull;
|
|
2177
|
+
exports.isRegExp = isWeakSet.isRegExp;
|
|
2178
|
+
exports.isSet = isWeakSet.isSet;
|
|
2179
|
+
exports.isSymbol = isWeakSet.isSymbol;
|
|
2180
|
+
exports.isUndefined = isWeakSet.isUndefined;
|
|
2181
|
+
exports.isWeakMap = isWeakSet.isWeakMap;
|
|
2182
|
+
exports.isWeakSet = isWeakSet.isWeakSet;
|
|
2183
|
+
exports.isPlainObject = isPlainObject.isPlainObject;
|
|
2184
|
+
exports.isPrimitive = isPlainObject.isPrimitive;
|
|
2185
|
+
exports.isTypedArray = isPlainObject.isTypedArray;
|
|
2186
|
+
exports.isBlob = isBlob;
|
|
2187
|
+
exports.isBoolean = isBoolean;
|
|
2188
|
+
exports.isBrowser = isBrowser;
|
|
2189
|
+
exports.isError = isError;
|
|
2190
|
+
exports.isFile = isFile;
|
|
2191
|
+
exports.isJSON = isJSON;
|
|
2192
|
+
exports.isJSONArray = isJSONArray;
|
|
2193
|
+
exports.isJSONObject = isJSONObject;
|
|
2194
|
+
exports.isJSONValue = isJSONValue;
|
|
2195
|
+
exports.isNode = isNode;
|
|
2196
|
+
exports.isNotNil = isNotNil;
|
|
2197
|
+
exports.isPromise = isPromise;
|
|
2198
|
+
exports.isString = isString;
|
|
2199
|
+
}
|
|
2200
|
+
});
|
|
2201
|
+
|
|
2202
|
+
// ../../node_modules/es-toolkit/dist/promise/index.js
|
|
2203
|
+
var require_promise = __commonJS({
|
|
2204
|
+
"../../node_modules/es-toolkit/dist/promise/index.js"(exports) {
|
|
2205
|
+
"use strict";
|
|
2206
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2207
|
+
var delay = require_delay_VMfFa();
|
|
2208
|
+
var error_index = require_error();
|
|
2209
|
+
var Semaphore = class {
|
|
2210
|
+
capacity;
|
|
2211
|
+
available;
|
|
2212
|
+
deferredTasks = [];
|
|
2213
|
+
constructor(capacity) {
|
|
2214
|
+
this.capacity = capacity;
|
|
2215
|
+
this.available = capacity;
|
|
2216
|
+
}
|
|
2217
|
+
async acquire() {
|
|
2218
|
+
if (this.available > 0) {
|
|
2219
|
+
this.available--;
|
|
2220
|
+
return;
|
|
2221
|
+
}
|
|
2222
|
+
return new Promise((resolve) => {
|
|
2223
|
+
this.deferredTasks.push(resolve);
|
|
2224
|
+
});
|
|
2225
|
+
}
|
|
2226
|
+
release() {
|
|
2227
|
+
const deferredTask = this.deferredTasks.shift();
|
|
2228
|
+
if (deferredTask != null) {
|
|
2229
|
+
deferredTask();
|
|
2230
|
+
return;
|
|
2231
|
+
}
|
|
2232
|
+
if (this.available < this.capacity) {
|
|
2233
|
+
this.available++;
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
};
|
|
2237
|
+
var Mutex = class {
|
|
2238
|
+
semaphore = new Semaphore(1);
|
|
2239
|
+
get isLocked() {
|
|
2240
|
+
return this.semaphore.available === 0;
|
|
2241
|
+
}
|
|
2242
|
+
async acquire() {
|
|
2243
|
+
return this.semaphore.acquire();
|
|
2244
|
+
}
|
|
2245
|
+
release() {
|
|
2246
|
+
this.semaphore.release();
|
|
2247
|
+
}
|
|
2248
|
+
};
|
|
2249
|
+
async function timeout(ms) {
|
|
2250
|
+
await delay.delay(ms);
|
|
2251
|
+
throw new error_index.TimeoutError();
|
|
2252
|
+
}
|
|
2253
|
+
async function withTimeout(run, ms) {
|
|
2254
|
+
return Promise.race([run(), timeout(ms)]);
|
|
2255
|
+
}
|
|
2256
|
+
exports.delay = delay.delay;
|
|
2257
|
+
exports.Mutex = Mutex;
|
|
2258
|
+
exports.Semaphore = Semaphore;
|
|
2259
|
+
exports.timeout = timeout;
|
|
2260
|
+
exports.withTimeout = withTimeout;
|
|
2261
|
+
}
|
|
2262
|
+
});
|
|
2263
|
+
|
|
2264
|
+
// ../../node_modules/es-toolkit/dist/_chunk/upperFirst-Cx78bs.js
|
|
2265
|
+
var require_upperFirst_Cx78bs = __commonJS({
|
|
2266
|
+
"../../node_modules/es-toolkit/dist/_chunk/upperFirst-Cx78bs.js"(exports) {
|
|
2267
|
+
"use strict";
|
|
2268
|
+
var snakeCase = require_snakeCase_6cG1f4();
|
|
2269
|
+
var deburrMap = new Map(Object.entries({
|
|
2270
|
+
\u00C6: "Ae",
|
|
2271
|
+
\u00D0: "D",
|
|
2272
|
+
\u00D8: "O",
|
|
2273
|
+
\u00DE: "Th",
|
|
2274
|
+
\u00DF: "ss",
|
|
2275
|
+
\u00E6: "ae",
|
|
2276
|
+
\u00F0: "d",
|
|
2277
|
+
\u00F8: "o",
|
|
2278
|
+
\u00FE: "th",
|
|
2279
|
+
\u0110: "D",
|
|
2280
|
+
\u0111: "d",
|
|
2281
|
+
\u0126: "H",
|
|
2282
|
+
\u0127: "h",
|
|
2283
|
+
\u0131: "i",
|
|
2284
|
+
\u0132: "IJ",
|
|
2285
|
+
\u0133: "ij",
|
|
2286
|
+
\u0138: "k",
|
|
2287
|
+
\u013F: "L",
|
|
2288
|
+
\u0140: "l",
|
|
2289
|
+
\u0141: "L",
|
|
2290
|
+
\u0142: "l",
|
|
2291
|
+
\u0149: "'n",
|
|
2292
|
+
\u014A: "N",
|
|
2293
|
+
\u014B: "n",
|
|
2294
|
+
\u0152: "Oe",
|
|
2295
|
+
\u0153: "oe",
|
|
2296
|
+
\u0166: "T",
|
|
2297
|
+
\u0167: "t",
|
|
2298
|
+
\u017F: "s"
|
|
2299
|
+
}));
|
|
2300
|
+
function deburr(str) {
|
|
2301
|
+
str = str.normalize("NFD");
|
|
2302
|
+
let result = "";
|
|
2303
|
+
for (let i = 0; i < str.length; i++) {
|
|
2304
|
+
const char = str[i];
|
|
2305
|
+
if (char >= "\u0300" && char <= "\u036F" || char >= "\uFE20" && char <= "\uFE23") {
|
|
2306
|
+
continue;
|
|
2307
|
+
}
|
|
2308
|
+
result += deburrMap.get(char) ?? char;
|
|
2309
|
+
}
|
|
2310
|
+
return result;
|
|
2311
|
+
}
|
|
2312
|
+
var htmlEscapes = {
|
|
2313
|
+
"&": "&",
|
|
2314
|
+
"<": "<",
|
|
2315
|
+
">": ">",
|
|
2316
|
+
'"': """,
|
|
2317
|
+
"'": "'"
|
|
2318
|
+
};
|
|
2319
|
+
function escape(str) {
|
|
2320
|
+
return str.replace(/[&<>"']/g, (match) => htmlEscapes[match]);
|
|
2321
|
+
}
|
|
2322
|
+
function escapeRegExp(str) {
|
|
2323
|
+
return str.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
|
|
2324
|
+
}
|
|
2325
|
+
function kebabCase(str) {
|
|
2326
|
+
const words = snakeCase.words(str);
|
|
2327
|
+
return words.map((word) => word.toLowerCase()).join("-");
|
|
2328
|
+
}
|
|
2329
|
+
function lowerCase(str) {
|
|
2330
|
+
const words = snakeCase.words(str);
|
|
2331
|
+
return words.map((word) => word.toLowerCase()).join(" ");
|
|
2332
|
+
}
|
|
2333
|
+
function lowerFirst(str) {
|
|
2334
|
+
return str.substring(0, 1).toLowerCase() + str.substring(1);
|
|
2335
|
+
}
|
|
2336
|
+
function pad(str, length, chars = " ") {
|
|
2337
|
+
return str.padStart(Math.floor((length - str.length) / 2) + str.length, chars).padEnd(length, chars);
|
|
2338
|
+
}
|
|
2339
|
+
function trimEnd(str, chars) {
|
|
2340
|
+
if (chars === void 0) {
|
|
2341
|
+
return str.trimEnd();
|
|
2342
|
+
}
|
|
2343
|
+
let endIndex = str.length;
|
|
2344
|
+
switch (typeof chars) {
|
|
2345
|
+
case "string": {
|
|
2346
|
+
if (chars.length !== 1) {
|
|
2347
|
+
throw new Error(`The 'chars' parameter should be a single character string.`);
|
|
2348
|
+
}
|
|
2349
|
+
while (endIndex > 0 && str[endIndex - 1] === chars) {
|
|
2350
|
+
endIndex--;
|
|
2351
|
+
}
|
|
2352
|
+
break;
|
|
2353
|
+
}
|
|
2354
|
+
case "object": {
|
|
2355
|
+
while (endIndex > 0 && chars.includes(str[endIndex - 1])) {
|
|
2356
|
+
endIndex--;
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
return str.substring(0, endIndex);
|
|
2361
|
+
}
|
|
2362
|
+
function trimStart(str, chars) {
|
|
2363
|
+
if (chars === void 0) {
|
|
2364
|
+
return str.trimStart();
|
|
2365
|
+
}
|
|
2366
|
+
let startIndex = 0;
|
|
2367
|
+
switch (typeof chars) {
|
|
2368
|
+
case "string": {
|
|
2369
|
+
while (startIndex < str.length && str[startIndex] === chars) {
|
|
2370
|
+
startIndex++;
|
|
2371
|
+
}
|
|
2372
|
+
break;
|
|
2373
|
+
}
|
|
2374
|
+
case "object": {
|
|
2375
|
+
while (startIndex < str.length && chars.includes(str[startIndex])) {
|
|
2376
|
+
startIndex++;
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
return str.substring(startIndex);
|
|
2381
|
+
}
|
|
2382
|
+
function trim(str, chars) {
|
|
2383
|
+
if (chars === void 0) {
|
|
2384
|
+
return str.trim();
|
|
2385
|
+
}
|
|
2386
|
+
return trimStart(trimEnd(str, chars), chars);
|
|
2387
|
+
}
|
|
2388
|
+
var htmlUnescapes = {
|
|
2389
|
+
"&": "&",
|
|
2390
|
+
"<": "<",
|
|
2391
|
+
">": ">",
|
|
2392
|
+
""": '"',
|
|
2393
|
+
"'": "'"
|
|
2394
|
+
};
|
|
2395
|
+
function unescape(str) {
|
|
2396
|
+
return str.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g, (match) => htmlUnescapes[match] || "'");
|
|
2397
|
+
}
|
|
2398
|
+
function upperCase(str) {
|
|
2399
|
+
const words = snakeCase.words(str);
|
|
2400
|
+
let result = "";
|
|
2401
|
+
for (let i = 0; i < words.length; i++) {
|
|
2402
|
+
result += words[i].toUpperCase();
|
|
2403
|
+
if (i < words.length - 1) {
|
|
2404
|
+
result += " ";
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
return result;
|
|
2408
|
+
}
|
|
2409
|
+
function upperFirst(str) {
|
|
2410
|
+
return str.substring(0, 1).toUpperCase() + str.substring(1);
|
|
2411
|
+
}
|
|
2412
|
+
exports.deburr = deburr;
|
|
2413
|
+
exports.escape = escape;
|
|
2414
|
+
exports.escapeRegExp = escapeRegExp;
|
|
2415
|
+
exports.kebabCase = kebabCase;
|
|
2416
|
+
exports.lowerCase = lowerCase;
|
|
2417
|
+
exports.lowerFirst = lowerFirst;
|
|
2418
|
+
exports.pad = pad;
|
|
2419
|
+
exports.trim = trim;
|
|
2420
|
+
exports.trimEnd = trimEnd;
|
|
2421
|
+
exports.trimStart = trimStart;
|
|
2422
|
+
exports.unescape = unescape;
|
|
2423
|
+
exports.upperCase = upperCase;
|
|
2424
|
+
exports.upperFirst = upperFirst;
|
|
2425
|
+
}
|
|
2426
|
+
});
|
|
2427
|
+
|
|
2428
|
+
// ../../node_modules/es-toolkit/dist/string/index.js
|
|
2429
|
+
var require_string = __commonJS({
|
|
2430
|
+
"../../node_modules/es-toolkit/dist/string/index.js"(exports) {
|
|
2431
|
+
"use strict";
|
|
2432
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2433
|
+
var snakeCase = require_snakeCase_6cG1f4();
|
|
2434
|
+
var upperFirst = require_upperFirst_Cx78bs();
|
|
2435
|
+
function constantCase(str) {
|
|
2436
|
+
const words = snakeCase.words(str);
|
|
2437
|
+
return words.map((word) => word.toUpperCase()).join("_");
|
|
2438
|
+
}
|
|
2439
|
+
function pascalCase(str) {
|
|
2440
|
+
const words = snakeCase.words(str);
|
|
2441
|
+
return words.map((word) => snakeCase.capitalize(word)).join("");
|
|
2442
|
+
}
|
|
2443
|
+
function reverseString(value) {
|
|
2444
|
+
return [...value].reverse().join("");
|
|
2445
|
+
}
|
|
2446
|
+
function startCase(str) {
|
|
2447
|
+
const words = snakeCase.words(str.trim());
|
|
2448
|
+
let result = "";
|
|
2449
|
+
for (let i = 0; i < words.length; i++) {
|
|
2450
|
+
const word = words[i];
|
|
2451
|
+
if (result) {
|
|
2452
|
+
result += " ";
|
|
2453
|
+
}
|
|
2454
|
+
result += word[0].toUpperCase() + word.slice(1).toLowerCase();
|
|
2455
|
+
}
|
|
2456
|
+
return result;
|
|
2457
|
+
}
|
|
2458
|
+
exports.camelCase = snakeCase.camelCase;
|
|
2459
|
+
exports.capitalize = snakeCase.capitalize;
|
|
2460
|
+
exports.snakeCase = snakeCase.snakeCase;
|
|
2461
|
+
exports.words = snakeCase.words;
|
|
2462
|
+
exports.deburr = upperFirst.deburr;
|
|
2463
|
+
exports.escape = upperFirst.escape;
|
|
2464
|
+
exports.escapeRegExp = upperFirst.escapeRegExp;
|
|
2465
|
+
exports.kebabCase = upperFirst.kebabCase;
|
|
2466
|
+
exports.lowerCase = upperFirst.lowerCase;
|
|
2467
|
+
exports.lowerFirst = upperFirst.lowerFirst;
|
|
2468
|
+
exports.pad = upperFirst.pad;
|
|
2469
|
+
exports.trim = upperFirst.trim;
|
|
2470
|
+
exports.trimEnd = upperFirst.trimEnd;
|
|
2471
|
+
exports.trimStart = upperFirst.trimStart;
|
|
2472
|
+
exports.unescape = upperFirst.unescape;
|
|
2473
|
+
exports.upperCase = upperFirst.upperCase;
|
|
2474
|
+
exports.upperFirst = upperFirst.upperFirst;
|
|
2475
|
+
exports.constantCase = constantCase;
|
|
2476
|
+
exports.pascalCase = pascalCase;
|
|
2477
|
+
exports.reverseString = reverseString;
|
|
2478
|
+
exports.startCase = startCase;
|
|
2479
|
+
}
|
|
2480
|
+
});
|
|
2481
|
+
|
|
2482
|
+
// ../../node_modules/es-toolkit/dist/util/index.js
|
|
2483
|
+
var require_util = __commonJS({
|
|
2484
|
+
"../../node_modules/es-toolkit/dist/util/index.js"(exports) {
|
|
2485
|
+
"use strict";
|
|
2486
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2487
|
+
function attempt(func) {
|
|
2488
|
+
try {
|
|
2489
|
+
return [null, func()];
|
|
2490
|
+
} catch (error) {
|
|
2491
|
+
return [error, null];
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
async function attemptAsync(func) {
|
|
2495
|
+
try {
|
|
2496
|
+
const result = await func();
|
|
2497
|
+
return [null, result];
|
|
2498
|
+
} catch (error) {
|
|
2499
|
+
return [error, null];
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
function invariant(condition, message) {
|
|
2503
|
+
if (condition) {
|
|
2504
|
+
return;
|
|
2505
|
+
}
|
|
2506
|
+
if (typeof message === "string") {
|
|
2507
|
+
throw new Error(message);
|
|
2508
|
+
}
|
|
2509
|
+
throw message;
|
|
2510
|
+
}
|
|
2511
|
+
exports.assert = invariant;
|
|
2512
|
+
exports.attempt = attempt;
|
|
2513
|
+
exports.attemptAsync = attemptAsync;
|
|
2514
|
+
exports.invariant = invariant;
|
|
2515
|
+
}
|
|
2516
|
+
});
|
|
2517
|
+
|
|
2518
|
+
// ../../node_modules/es-toolkit/dist/index.js
|
|
2519
|
+
var require_dist = __commonJS({
|
|
2520
|
+
"../../node_modules/es-toolkit/dist/index.js"(exports) {
|
|
2521
|
+
"use strict";
|
|
2522
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2523
|
+
var array_index = require_array();
|
|
2524
|
+
var zip = require_zip_Cyyp17();
|
|
2525
|
+
var AbortError = require_AbortError_Cg4ZQ1();
|
|
2526
|
+
var error_index = require_error();
|
|
2527
|
+
var unary = require_unary_BVQ0iC();
|
|
2528
|
+
var function_index = require_function();
|
|
2529
|
+
var noop = require_noop_2IwLUk();
|
|
2530
|
+
var range = require_range_DSpBDL();
|
|
2531
|
+
var math_index = require_math();
|
|
2532
|
+
var randomInt = require_randomInt_CF7bZK();
|
|
2533
|
+
var isPlainObject = require_isPlainObject_DINLyA();
|
|
2534
|
+
var object_index = require_object();
|
|
2535
|
+
var isWeakSet = require_isWeakSet_403Sh5();
|
|
2536
|
+
var predicate_index = require_predicate();
|
|
2537
|
+
var isPlainObject$1 = require_isPlainObject_Xaozpc();
|
|
2538
|
+
var delay = require_delay_VMfFa();
|
|
2539
|
+
var promise_index = require_promise();
|
|
2540
|
+
var snakeCase = require_snakeCase_6cG1f4();
|
|
2541
|
+
var string_index = require_string();
|
|
2542
|
+
var upperFirst = require_upperFirst_Cx78bs();
|
|
2543
|
+
var util_index = require_util();
|
|
2544
|
+
exports.at = array_index.at;
|
|
2545
|
+
exports.countBy = array_index.countBy;
|
|
2546
|
+
exports.flatMap = array_index.flatMap;
|
|
2547
|
+
exports.flatMapDeep = array_index.flatMapDeep;
|
|
2548
|
+
exports.flattenDeep = array_index.flattenDeep;
|
|
2549
|
+
exports.forEachRight = array_index.forEachRight;
|
|
2550
|
+
exports.isSubset = array_index.isSubset;
|
|
2551
|
+
exports.isSubsetWith = array_index.isSubsetWith;
|
|
2552
|
+
exports.keyBy = array_index.keyBy;
|
|
2553
|
+
exports.orderBy = array_index.orderBy;
|
|
2554
|
+
exports.partition = array_index.partition;
|
|
2555
|
+
exports.pullAt = array_index.pullAt;
|
|
2556
|
+
exports.sortBy = array_index.sortBy;
|
|
2557
|
+
exports.takeRightWhile = array_index.takeRightWhile;
|
|
2558
|
+
exports.takeWhile = array_index.takeWhile;
|
|
2559
|
+
exports.toFilled = array_index.toFilled;
|
|
2560
|
+
exports.union = array_index.union;
|
|
2561
|
+
exports.unionBy = array_index.unionBy;
|
|
2562
|
+
exports.unionWith = array_index.unionWith;
|
|
2563
|
+
exports.unzipWith = array_index.unzipWith;
|
|
2564
|
+
exports.xor = array_index.xor;
|
|
2565
|
+
exports.xorBy = array_index.xorBy;
|
|
2566
|
+
exports.xorWith = array_index.xorWith;
|
|
2567
|
+
exports.zipObject = array_index.zipObject;
|
|
2568
|
+
exports.zipWith = array_index.zipWith;
|
|
2569
|
+
exports.chunk = zip.chunk;
|
|
2570
|
+
exports.compact = zip.compact;
|
|
2571
|
+
exports.difference = zip.difference;
|
|
2572
|
+
exports.differenceBy = zip.differenceBy;
|
|
2573
|
+
exports.differenceWith = zip.differenceWith;
|
|
2574
|
+
exports.drop = zip.drop;
|
|
2575
|
+
exports.dropRight = zip.dropRight;
|
|
2576
|
+
exports.dropRightWhile = zip.dropRightWhile;
|
|
2577
|
+
exports.dropWhile = zip.dropWhile;
|
|
2578
|
+
exports.fill = zip.fill;
|
|
2579
|
+
exports.flatten = zip.flatten;
|
|
2580
|
+
exports.groupBy = zip.groupBy;
|
|
2581
|
+
exports.head = zip.head;
|
|
2582
|
+
exports.initial = zip.initial;
|
|
2583
|
+
exports.intersection = zip.intersection;
|
|
2584
|
+
exports.intersectionBy = zip.intersectionBy;
|
|
2585
|
+
exports.intersectionWith = zip.intersectionWith;
|
|
2586
|
+
exports.last = zip.last;
|
|
2587
|
+
exports.maxBy = zip.maxBy;
|
|
2588
|
+
exports.minBy = zip.minBy;
|
|
2589
|
+
exports.pull = zip.pull;
|
|
2590
|
+
exports.remove = zip.remove;
|
|
2591
|
+
exports.sample = zip.sample;
|
|
2592
|
+
exports.sampleSize = zip.sampleSize;
|
|
2593
|
+
exports.shuffle = zip.shuffle;
|
|
2594
|
+
exports.tail = zip.tail;
|
|
2595
|
+
exports.take = zip.take;
|
|
2596
|
+
exports.takeRight = zip.takeRight;
|
|
2597
|
+
exports.uniq = zip.uniq;
|
|
2598
|
+
exports.uniqBy = zip.uniqBy;
|
|
2599
|
+
exports.uniqWith = zip.uniqWith;
|
|
2600
|
+
exports.unzip = zip.unzip;
|
|
2601
|
+
exports.windowed = zip.windowed;
|
|
2602
|
+
exports.without = zip.without;
|
|
2603
|
+
exports.zip = zip.zip;
|
|
2604
|
+
exports.AbortError = AbortError.AbortError;
|
|
2605
|
+
exports.TimeoutError = error_index.TimeoutError;
|
|
2606
|
+
exports.after = unary.after;
|
|
2607
|
+
exports.ary = unary.ary;
|
|
2608
|
+
exports.debounce = unary.debounce;
|
|
2609
|
+
exports.flow = unary.flow;
|
|
2610
|
+
exports.flowRight = unary.flowRight;
|
|
2611
|
+
exports.identity = unary.identity;
|
|
2612
|
+
exports.negate = unary.negate;
|
|
2613
|
+
exports.once = unary.once;
|
|
2614
|
+
exports.partial = unary.partial;
|
|
2615
|
+
exports.partialRight = unary.partialRight;
|
|
2616
|
+
exports.rest = unary.rest;
|
|
2617
|
+
exports.unary = unary.unary;
|
|
2618
|
+
exports.asyncNoop = function_index.asyncNoop;
|
|
2619
|
+
exports.before = function_index.before;
|
|
2620
|
+
exports.curry = function_index.curry;
|
|
2621
|
+
exports.curryRight = function_index.curryRight;
|
|
2622
|
+
exports.memoize = function_index.memoize;
|
|
2623
|
+
exports.retry = function_index.retry;
|
|
2624
|
+
exports.spread = function_index.spread;
|
|
2625
|
+
exports.throttle = function_index.throttle;
|
|
2626
|
+
exports.noop = noop.noop;
|
|
2627
|
+
exports.clamp = range.clamp;
|
|
2628
|
+
exports.inRange = range.inRange;
|
|
2629
|
+
exports.mean = range.mean;
|
|
2630
|
+
exports.meanBy = range.meanBy;
|
|
2631
|
+
exports.range = range.range;
|
|
2632
|
+
exports.sum = range.sum;
|
|
2633
|
+
exports.median = math_index.median;
|
|
2634
|
+
exports.medianBy = math_index.medianBy;
|
|
2635
|
+
exports.rangeRight = math_index.rangeRight;
|
|
2636
|
+
exports.round = math_index.round;
|
|
2637
|
+
exports.sumBy = math_index.sumBy;
|
|
2638
|
+
exports.random = randomInt.random;
|
|
2639
|
+
exports.randomInt = randomInt.randomInt;
|
|
2640
|
+
exports.clone = isPlainObject.clone;
|
|
2641
|
+
exports.cloneDeep = isPlainObject.cloneDeep;
|
|
2642
|
+
exports.cloneDeepWith = isPlainObject.cloneDeepWith;
|
|
2643
|
+
exports.findKey = isPlainObject.findKey;
|
|
2644
|
+
exports.invert = isPlainObject.invert;
|
|
2645
|
+
exports.mapKeys = isPlainObject.mapKeys;
|
|
2646
|
+
exports.mapValues = isPlainObject.mapValues;
|
|
2647
|
+
exports.flattenObject = object_index.flattenObject;
|
|
2648
|
+
exports.merge = object_index.merge;
|
|
2649
|
+
exports.mergeWith = object_index.mergeWith;
|
|
2650
|
+
exports.omit = object_index.omit;
|
|
2651
|
+
exports.omitBy = object_index.omitBy;
|
|
2652
|
+
exports.pick = object_index.pick;
|
|
2653
|
+
exports.pickBy = object_index.pickBy;
|
|
2654
|
+
exports.toCamelCaseKeys = object_index.toCamelCaseKeys;
|
|
2655
|
+
exports.toMerged = object_index.toMerged;
|
|
2656
|
+
exports.toSnakeCaseKeys = object_index.toSnakeCaseKeys;
|
|
2657
|
+
exports.isArrayBuffer = isWeakSet.isArrayBuffer;
|
|
2658
|
+
exports.isBuffer = isWeakSet.isBuffer;
|
|
2659
|
+
exports.isDate = isWeakSet.isDate;
|
|
2660
|
+
exports.isEqual = isWeakSet.isEqual;
|
|
2661
|
+
exports.isEqualWith = isWeakSet.isEqualWith;
|
|
2662
|
+
exports.isFunction = isWeakSet.isFunction;
|
|
2663
|
+
exports.isLength = isWeakSet.isLength;
|
|
2664
|
+
exports.isMap = isWeakSet.isMap;
|
|
2665
|
+
exports.isNil = isWeakSet.isNil;
|
|
2666
|
+
exports.isNull = isWeakSet.isNull;
|
|
2667
|
+
exports.isRegExp = isWeakSet.isRegExp;
|
|
2668
|
+
exports.isSet = isWeakSet.isSet;
|
|
2669
|
+
exports.isSymbol = isWeakSet.isSymbol;
|
|
2670
|
+
exports.isUndefined = isWeakSet.isUndefined;
|
|
2671
|
+
exports.isWeakMap = isWeakSet.isWeakMap;
|
|
2672
|
+
exports.isWeakSet = isWeakSet.isWeakSet;
|
|
2673
|
+
exports.isBlob = predicate_index.isBlob;
|
|
2674
|
+
exports.isBoolean = predicate_index.isBoolean;
|
|
2675
|
+
exports.isBrowser = predicate_index.isBrowser;
|
|
2676
|
+
exports.isError = predicate_index.isError;
|
|
2677
|
+
exports.isFile = predicate_index.isFile;
|
|
2678
|
+
exports.isJSON = predicate_index.isJSON;
|
|
2679
|
+
exports.isJSONArray = predicate_index.isJSONArray;
|
|
2680
|
+
exports.isJSONObject = predicate_index.isJSONObject;
|
|
2681
|
+
exports.isJSONValue = predicate_index.isJSONValue;
|
|
2682
|
+
exports.isNode = predicate_index.isNode;
|
|
2683
|
+
exports.isNotNil = predicate_index.isNotNil;
|
|
2684
|
+
exports.isPromise = predicate_index.isPromise;
|
|
2685
|
+
exports.isString = predicate_index.isString;
|
|
2686
|
+
exports.isPlainObject = isPlainObject$1.isPlainObject;
|
|
2687
|
+
exports.isPrimitive = isPlainObject$1.isPrimitive;
|
|
2688
|
+
exports.isTypedArray = isPlainObject$1.isTypedArray;
|
|
2689
|
+
exports.delay = delay.delay;
|
|
2690
|
+
exports.Mutex = promise_index.Mutex;
|
|
2691
|
+
exports.Semaphore = promise_index.Semaphore;
|
|
2692
|
+
exports.timeout = promise_index.timeout;
|
|
2693
|
+
exports.withTimeout = promise_index.withTimeout;
|
|
2694
|
+
exports.camelCase = snakeCase.camelCase;
|
|
2695
|
+
exports.capitalize = snakeCase.capitalize;
|
|
2696
|
+
exports.snakeCase = snakeCase.snakeCase;
|
|
2697
|
+
exports.words = snakeCase.words;
|
|
2698
|
+
exports.constantCase = string_index.constantCase;
|
|
2699
|
+
exports.pascalCase = string_index.pascalCase;
|
|
2700
|
+
exports.reverseString = string_index.reverseString;
|
|
2701
|
+
exports.startCase = string_index.startCase;
|
|
2702
|
+
exports.deburr = upperFirst.deburr;
|
|
2703
|
+
exports.escape = upperFirst.escape;
|
|
2704
|
+
exports.escapeRegExp = upperFirst.escapeRegExp;
|
|
2705
|
+
exports.kebabCase = upperFirst.kebabCase;
|
|
2706
|
+
exports.lowerCase = upperFirst.lowerCase;
|
|
2707
|
+
exports.lowerFirst = upperFirst.lowerFirst;
|
|
2708
|
+
exports.pad = upperFirst.pad;
|
|
2709
|
+
exports.trim = upperFirst.trim;
|
|
2710
|
+
exports.trimEnd = upperFirst.trimEnd;
|
|
2711
|
+
exports.trimStart = upperFirst.trimStart;
|
|
2712
|
+
exports.unescape = upperFirst.unescape;
|
|
2713
|
+
exports.upperCase = upperFirst.upperCase;
|
|
2714
|
+
exports.upperFirst = upperFirst.upperFirst;
|
|
2715
|
+
exports.assert = util_index.invariant;
|
|
2716
|
+
exports.attempt = util_index.attempt;
|
|
2717
|
+
exports.attemptAsync = util_index.attemptAsync;
|
|
2718
|
+
exports.invariant = util_index.invariant;
|
|
2719
|
+
}
|
|
2720
|
+
});
|
|
2721
|
+
|
|
2722
|
+
// ../../node_modules/map-or-similar/src/similar.js
|
|
2723
|
+
var require_similar = __commonJS({
|
|
2724
|
+
"../../node_modules/map-or-similar/src/similar.js"(exports, module2) {
|
|
2725
|
+
function Similar() {
|
|
2726
|
+
this.list = [];
|
|
2727
|
+
this.lastItem = void 0;
|
|
2728
|
+
this.size = 0;
|
|
2729
|
+
return this;
|
|
2730
|
+
}
|
|
2731
|
+
Similar.prototype.get = function(key) {
|
|
2732
|
+
var index;
|
|
2733
|
+
if (this.lastItem && this.isEqual(this.lastItem.key, key)) {
|
|
2734
|
+
return this.lastItem.val;
|
|
2735
|
+
}
|
|
2736
|
+
index = this.indexOf(key);
|
|
2737
|
+
if (index >= 0) {
|
|
2738
|
+
this.lastItem = this.list[index];
|
|
2739
|
+
return this.list[index].val;
|
|
2740
|
+
}
|
|
2741
|
+
return void 0;
|
|
2742
|
+
};
|
|
2743
|
+
Similar.prototype.set = function(key, val) {
|
|
2744
|
+
var index;
|
|
2745
|
+
if (this.lastItem && this.isEqual(this.lastItem.key, key)) {
|
|
2746
|
+
this.lastItem.val = val;
|
|
2747
|
+
return this;
|
|
2748
|
+
}
|
|
2749
|
+
index = this.indexOf(key);
|
|
2750
|
+
if (index >= 0) {
|
|
2751
|
+
this.lastItem = this.list[index];
|
|
2752
|
+
this.list[index].val = val;
|
|
2753
|
+
return this;
|
|
2754
|
+
}
|
|
2755
|
+
this.lastItem = { key, val };
|
|
2756
|
+
this.list.push(this.lastItem);
|
|
2757
|
+
this.size++;
|
|
2758
|
+
return this;
|
|
2759
|
+
};
|
|
2760
|
+
Similar.prototype.delete = function(key) {
|
|
2761
|
+
var index;
|
|
2762
|
+
if (this.lastItem && this.isEqual(this.lastItem.key, key)) {
|
|
2763
|
+
this.lastItem = void 0;
|
|
2764
|
+
}
|
|
2765
|
+
index = this.indexOf(key);
|
|
2766
|
+
if (index >= 0) {
|
|
2767
|
+
this.size--;
|
|
2768
|
+
return this.list.splice(index, 1)[0];
|
|
2769
|
+
}
|
|
2770
|
+
return void 0;
|
|
2771
|
+
};
|
|
2772
|
+
Similar.prototype.has = function(key) {
|
|
2773
|
+
var index;
|
|
2774
|
+
if (this.lastItem && this.isEqual(this.lastItem.key, key)) {
|
|
2775
|
+
return true;
|
|
2776
|
+
}
|
|
2777
|
+
index = this.indexOf(key);
|
|
2778
|
+
if (index >= 0) {
|
|
2779
|
+
this.lastItem = this.list[index];
|
|
2780
|
+
return true;
|
|
2781
|
+
}
|
|
2782
|
+
return false;
|
|
2783
|
+
};
|
|
2784
|
+
Similar.prototype.forEach = function(callback, thisArg) {
|
|
2785
|
+
var i;
|
|
2786
|
+
for (i = 0; i < this.size; i++) {
|
|
2787
|
+
callback.call(thisArg || this, this.list[i].val, this.list[i].key, this);
|
|
2788
|
+
}
|
|
2789
|
+
};
|
|
2790
|
+
Similar.prototype.indexOf = function(key) {
|
|
2791
|
+
var i;
|
|
2792
|
+
for (i = 0; i < this.size; i++) {
|
|
2793
|
+
if (this.isEqual(this.list[i].key, key)) {
|
|
2794
|
+
return i;
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
return -1;
|
|
2798
|
+
};
|
|
2799
|
+
Similar.prototype.isEqual = function(val1, val2) {
|
|
2800
|
+
return val1 === val2 || val1 !== val1 && val2 !== val2;
|
|
2801
|
+
};
|
|
2802
|
+
module2.exports = Similar;
|
|
2803
|
+
}
|
|
2804
|
+
});
|
|
2805
|
+
|
|
2806
|
+
// ../../node_modules/map-or-similar/src/map-or-similar.js
|
|
2807
|
+
var require_map_or_similar = __commonJS({
|
|
2808
|
+
"../../node_modules/map-or-similar/src/map-or-similar.js"(exports, module2) {
|
|
2809
|
+
module2.exports = function(forceSimilar) {
|
|
2810
|
+
if (typeof Map !== "function" || forceSimilar) {
|
|
2811
|
+
var Similar = require_similar();
|
|
2812
|
+
return new Similar();
|
|
2813
|
+
} else {
|
|
2814
|
+
return /* @__PURE__ */ new Map();
|
|
2815
|
+
}
|
|
2816
|
+
};
|
|
2817
|
+
}
|
|
2818
|
+
});
|
|
2819
|
+
|
|
2820
|
+
// ../../node_modules/memoizerific/src/memoizerific.js
|
|
2821
|
+
var require_memoizerific = __commonJS({
|
|
2822
|
+
"../../node_modules/memoizerific/src/memoizerific.js"(exports, module2) {
|
|
2823
|
+
var MapOrSimilar = require_map_or_similar();
|
|
2824
|
+
module2.exports = function(limit) {
|
|
2825
|
+
var cache = new MapOrSimilar(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"), lru = [];
|
|
2826
|
+
return function(fn) {
|
|
2827
|
+
var memoizerific = function() {
|
|
2828
|
+
var currentCache = cache, newMap, fnResult, argsLengthMinusOne = arguments.length - 1, lruPath = Array(argsLengthMinusOne + 1), isMemoized = true, i;
|
|
2829
|
+
if ((memoizerific.numArgs || memoizerific.numArgs === 0) && memoizerific.numArgs !== argsLengthMinusOne + 1) {
|
|
2830
|
+
throw new Error("Memoizerific functions should always be called with the same number of arguments");
|
|
2831
|
+
}
|
|
2832
|
+
for (i = 0; i < argsLengthMinusOne; i++) {
|
|
2833
|
+
lruPath[i] = {
|
|
2834
|
+
cacheItem: currentCache,
|
|
2835
|
+
arg: arguments[i]
|
|
2836
|
+
};
|
|
2837
|
+
if (currentCache.has(arguments[i])) {
|
|
2838
|
+
currentCache = currentCache.get(arguments[i]);
|
|
2839
|
+
continue;
|
|
2840
|
+
}
|
|
2841
|
+
isMemoized = false;
|
|
2842
|
+
newMap = new MapOrSimilar(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true");
|
|
2843
|
+
currentCache.set(arguments[i], newMap);
|
|
2844
|
+
currentCache = newMap;
|
|
2845
|
+
}
|
|
2846
|
+
if (isMemoized) {
|
|
2847
|
+
if (currentCache.has(arguments[argsLengthMinusOne])) {
|
|
2848
|
+
fnResult = currentCache.get(arguments[argsLengthMinusOne]);
|
|
2849
|
+
} else {
|
|
2850
|
+
isMemoized = false;
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
if (!isMemoized) {
|
|
2854
|
+
fnResult = fn.apply(null, arguments);
|
|
2855
|
+
currentCache.set(arguments[argsLengthMinusOne], fnResult);
|
|
2856
|
+
}
|
|
2857
|
+
if (limit > 0) {
|
|
2858
|
+
lruPath[argsLengthMinusOne] = {
|
|
2859
|
+
cacheItem: currentCache,
|
|
2860
|
+
arg: arguments[argsLengthMinusOne]
|
|
2861
|
+
};
|
|
2862
|
+
if (isMemoized) {
|
|
2863
|
+
moveToMostRecentLru(lru, lruPath);
|
|
2864
|
+
} else {
|
|
2865
|
+
lru.push(lruPath);
|
|
2866
|
+
}
|
|
2867
|
+
if (lru.length > limit) {
|
|
2868
|
+
removeCachedResult(lru.shift());
|
|
2869
|
+
}
|
|
2870
|
+
}
|
|
2871
|
+
memoizerific.wasMemoized = isMemoized;
|
|
2872
|
+
memoizerific.numArgs = argsLengthMinusOne + 1;
|
|
2873
|
+
return fnResult;
|
|
2874
|
+
};
|
|
2875
|
+
memoizerific.limit = limit;
|
|
2876
|
+
memoizerific.wasMemoized = false;
|
|
2877
|
+
memoizerific.cache = cache;
|
|
2878
|
+
memoizerific.lru = lru;
|
|
2879
|
+
return memoizerific;
|
|
2880
|
+
};
|
|
2881
|
+
};
|
|
2882
|
+
function moveToMostRecentLru(lru, lruPath) {
|
|
2883
|
+
var lruLen = lru.length, lruPathLen = lruPath.length, isMatch, i, ii;
|
|
2884
|
+
for (i = 0; i < lruLen; i++) {
|
|
2885
|
+
isMatch = true;
|
|
2886
|
+
for (ii = 0; ii < lruPathLen; ii++) {
|
|
2887
|
+
if (!isEqual(lru[i][ii].arg, lruPath[ii].arg)) {
|
|
2888
|
+
isMatch = false;
|
|
2889
|
+
break;
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
if (isMatch) {
|
|
2893
|
+
break;
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
lru.push(lru.splice(i, 1)[0]);
|
|
2897
|
+
}
|
|
2898
|
+
function removeCachedResult(removedLru) {
|
|
2899
|
+
var removedLruLen = removedLru.length, currentLru = removedLru[removedLruLen - 1], tmp, i;
|
|
2900
|
+
currentLru.cacheItem.delete(currentLru.arg);
|
|
2901
|
+
for (i = removedLruLen - 2; i >= 0; i--) {
|
|
2902
|
+
currentLru = removedLru[i];
|
|
2903
|
+
tmp = currentLru.cacheItem.get(currentLru.arg);
|
|
2904
|
+
if (!tmp || !tmp.size) {
|
|
2905
|
+
currentLru.cacheItem.delete(currentLru.arg);
|
|
2906
|
+
} else {
|
|
2907
|
+
break;
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
function isEqual(val1, val2) {
|
|
2912
|
+
return val1 === val2 || val1 !== val1 && val2 !== val2;
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
});
|
|
2916
|
+
|
|
2917
|
+
// ../react-native-ui-common/dist/index.js
|
|
2918
|
+
var require_dist2 = __commonJS({
|
|
2919
|
+
"../react-native-ui-common/dist/index.js"(exports, module2) {
|
|
2920
|
+
var __create2 = Object.create;
|
|
2921
|
+
var __defProp2 = Object.defineProperty;
|
|
2922
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
2923
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
2924
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
2925
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
2926
|
+
var __export2 = (target, all) => {
|
|
2927
|
+
for (var name in all)
|
|
2928
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
2929
|
+
};
|
|
2930
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
2931
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2932
|
+
for (let key of __getOwnPropNames2(from))
|
|
2933
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
2934
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
2935
|
+
}
|
|
2936
|
+
return to;
|
|
2937
|
+
};
|
|
2938
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
2939
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
2940
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
2941
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
2942
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
2943
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
2944
|
+
mod
|
|
2945
|
+
));
|
|
2946
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
2947
|
+
var src_exports2 = {};
|
|
2948
|
+
__export2(src_exports2, {
|
|
2949
|
+
Button: () => Button,
|
|
2950
|
+
ButtonIcon: () => ButtonIcon,
|
|
2951
|
+
ButtonText: () => ButtonText,
|
|
2952
|
+
IconButton: () => IconButton,
|
|
2953
|
+
LayoutProvider: () => LayoutProvider2,
|
|
2954
|
+
StorageProvider: () => StorageProvider2,
|
|
2955
|
+
createId: () => createId,
|
|
2956
|
+
cycle: () => cycle,
|
|
2957
|
+
get: () => get,
|
|
2958
|
+
getAncestorIds: () => getAncestorIds,
|
|
2959
|
+
getDescendantIds: () => getDescendantIds,
|
|
2960
|
+
getParent: () => getParent,
|
|
2961
|
+
getParents: () => getParents,
|
|
2962
|
+
getPath: () => getPath,
|
|
2963
|
+
getStateType: () => getStateType,
|
|
2964
|
+
intersect: () => intersect,
|
|
2965
|
+
isAncestor: () => isAncestor,
|
|
2966
|
+
isExpandType: () => isExpandType,
|
|
2967
|
+
isStoryHoistable: () => isStoryHoistable,
|
|
2968
|
+
merge: () => merge,
|
|
2969
|
+
noArrayMerge: () => noArrayMerge,
|
|
2970
|
+
prevent: () => prevent,
|
|
2971
|
+
removeNoiseFromName: () => removeNoiseFromName,
|
|
2972
|
+
searchItem: () => searchItem,
|
|
2973
|
+
transformStoryIndexToStoriesHash: () => transformStoryIndexToStoriesHash2,
|
|
2974
|
+
transformStoryIndexV2toV3: () => transformStoryIndexV2toV3,
|
|
2975
|
+
transformStoryIndexV3toV4: () => transformStoryIndexV3toV4,
|
|
2976
|
+
transformStoryIndexV4toV5: () => transformStoryIndexV4toV5,
|
|
2977
|
+
useExpanded: () => useExpanded,
|
|
2978
|
+
useLastViewed: () => useLastViewed,
|
|
2979
|
+
useLayout: () => useLayout,
|
|
2980
|
+
useStorage: () => useStorage,
|
|
2981
|
+
useStoreBooleanState: () => useStoreBooleanState,
|
|
2982
|
+
useStyle: () => useStyle
|
|
2983
|
+
});
|
|
2984
|
+
module2.exports = __toCommonJS2(src_exports2);
|
|
2985
|
+
var import_react_native_theming4 = require("@storybook/react-native-theming");
|
|
2986
|
+
var import_react5 = require("react");
|
|
2987
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
2988
|
+
var Button = (0, import_react5.forwardRef)(
|
|
2989
|
+
({
|
|
2990
|
+
Icon,
|
|
2991
|
+
animation = "none",
|
|
2992
|
+
size = "small",
|
|
2993
|
+
variant = "outline",
|
|
2994
|
+
padding = "medium",
|
|
2995
|
+
disabled = false,
|
|
2996
|
+
active = false,
|
|
2997
|
+
onPress,
|
|
2998
|
+
children,
|
|
2999
|
+
text,
|
|
3000
|
+
...props
|
|
3001
|
+
}, ref) => {
|
|
3002
|
+
const [isAnimating, setIsAnimating] = (0, import_react5.useState)(false);
|
|
3003
|
+
const handleClick = (event) => {
|
|
3004
|
+
if (onPress)
|
|
3005
|
+
onPress(event);
|
|
3006
|
+
if (animation === "none")
|
|
3007
|
+
return;
|
|
3008
|
+
setIsAnimating(true);
|
|
3009
|
+
};
|
|
3010
|
+
(0, import_react5.useEffect)(() => {
|
|
3011
|
+
const timer = setTimeout(() => {
|
|
3012
|
+
if (isAnimating)
|
|
3013
|
+
setIsAnimating(false);
|
|
3014
|
+
}, 1e3);
|
|
3015
|
+
return () => clearTimeout(timer);
|
|
3016
|
+
}, [isAnimating]);
|
|
3017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
3018
|
+
StyledButton,
|
|
3019
|
+
{
|
|
3020
|
+
ref,
|
|
3021
|
+
variant,
|
|
3022
|
+
size,
|
|
3023
|
+
padding,
|
|
3024
|
+
disabled,
|
|
3025
|
+
active,
|
|
3026
|
+
animating: isAnimating,
|
|
3027
|
+
animation,
|
|
3028
|
+
onPress: handleClick,
|
|
3029
|
+
...props,
|
|
3030
|
+
children: [
|
|
3031
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ButtonIcon, { Icon, variant, active }),
|
|
3032
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ButtonText, { variant, active, children: text }),
|
|
3033
|
+
children
|
|
3034
|
+
]
|
|
3035
|
+
}
|
|
3036
|
+
);
|
|
3037
|
+
}
|
|
3038
|
+
);
|
|
3039
|
+
Button.displayName = "Button";
|
|
3040
|
+
var StyledButton = import_react_native_theming4.styled.TouchableOpacity(({ theme: theme3, variant, size, disabled, active, padding }) => ({
|
|
3041
|
+
border: 0,
|
|
3042
|
+
// cursor: disabled ? 'not-allowed' : 'pointer',
|
|
3043
|
+
display: "flex",
|
|
3044
|
+
flexDirection: "row",
|
|
3045
|
+
gap: 6,
|
|
3046
|
+
alignItems: "center",
|
|
3047
|
+
justifyContent: "center",
|
|
3048
|
+
overflow: "hidden",
|
|
3049
|
+
paddingHorizontal: (() => {
|
|
3050
|
+
if (padding === "small" && size === "small")
|
|
3051
|
+
return 7;
|
|
3052
|
+
if (padding === "small" && size === "medium")
|
|
3053
|
+
return 9;
|
|
3054
|
+
if (size === "small")
|
|
3055
|
+
return 10;
|
|
3056
|
+
if (size === "medium")
|
|
3057
|
+
return 12;
|
|
3058
|
+
return 0;
|
|
3059
|
+
})(),
|
|
3060
|
+
paddingVertical: 0,
|
|
3061
|
+
height: size === "small" ? 28 : 32,
|
|
3062
|
+
position: "relative",
|
|
3063
|
+
transitionProperty: "background, box-shadow",
|
|
3064
|
+
transitionDuration: "150ms",
|
|
3065
|
+
transitionTimingFunction: "ease-out",
|
|
3066
|
+
whiteSpace: "nowrap",
|
|
3067
|
+
userSelect: "none",
|
|
3068
|
+
opacity: disabled ? 0.5 : 1,
|
|
3069
|
+
margin: 0,
|
|
3070
|
+
backgroundColor: (() => {
|
|
3071
|
+
if (variant === "solid")
|
|
3072
|
+
return theme3.color.secondary;
|
|
3073
|
+
if (variant === "outline")
|
|
3074
|
+
return theme3.button.background;
|
|
3075
|
+
if (variant === "ghost" && active)
|
|
3076
|
+
return theme3.background.hoverable;
|
|
3077
|
+
return "transparent";
|
|
3078
|
+
})(),
|
|
3079
|
+
boxShadow: variant === "outline" ? `${theme3.button.border} 0 0 0 1px inset` : "none",
|
|
3080
|
+
borderRadius: theme3.input.borderRadius,
|
|
3081
|
+
// Making sure that the button never shrinks below its minimum size
|
|
3082
|
+
flexShrink: 0
|
|
3083
|
+
}));
|
|
3084
|
+
var ButtonText = import_react_native_theming4.styled.Text(({ theme: theme3, variant, active }) => ({
|
|
3085
|
+
color: (() => {
|
|
3086
|
+
if (variant === "solid")
|
|
3087
|
+
return theme3.color.lightest;
|
|
3088
|
+
if (variant === "outline")
|
|
3089
|
+
return theme3.input.color;
|
|
3090
|
+
if (variant === "ghost" && active)
|
|
3091
|
+
return theme3.color.secondary;
|
|
3092
|
+
if (variant === "ghost")
|
|
3093
|
+
return theme3.color.mediumdark;
|
|
3094
|
+
return theme3.input.color;
|
|
3095
|
+
})(),
|
|
3096
|
+
flexDirection: "row",
|
|
3097
|
+
gap: 6,
|
|
3098
|
+
textAlign: "center",
|
|
3099
|
+
fontSize: theme3.typography.size.s1,
|
|
3100
|
+
fontWeight: theme3.typography.weight.bold
|
|
3101
|
+
}));
|
|
3102
|
+
var ButtonIcon = ({
|
|
3103
|
+
Icon,
|
|
3104
|
+
active,
|
|
3105
|
+
variant
|
|
3106
|
+
}) => {
|
|
3107
|
+
const theme3 = (0, import_react_native_theming4.useTheme)();
|
|
3108
|
+
const color = (0, import_react5.useMemo)(() => {
|
|
3109
|
+
if (variant === "solid")
|
|
3110
|
+
return theme3.color.lightest;
|
|
3111
|
+
if (variant === "outline")
|
|
3112
|
+
return theme3.input.color;
|
|
3113
|
+
if (variant === "ghost" && active)
|
|
3114
|
+
return theme3.color.secondary;
|
|
3115
|
+
if (variant === "ghost")
|
|
3116
|
+
return theme3.color.mediumdark;
|
|
3117
|
+
return theme3.input.color;
|
|
3118
|
+
}, [
|
|
3119
|
+
active,
|
|
3120
|
+
theme3.color.lightest,
|
|
3121
|
+
theme3.color.mediumdark,
|
|
3122
|
+
theme3.color.secondary,
|
|
3123
|
+
theme3.input.color,
|
|
3124
|
+
variant
|
|
3125
|
+
]);
|
|
3126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { color });
|
|
3127
|
+
};
|
|
3128
|
+
var import_react22 = require("react");
|
|
3129
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3130
|
+
var IconButton = (0, import_react22.forwardRef)(
|
|
3131
|
+
({ padding = "small", variant = "ghost", ...props }, ref) => {
|
|
3132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Button, { padding, variant, ref, ...props });
|
|
3133
|
+
}
|
|
3134
|
+
);
|
|
3135
|
+
IconButton.displayName = "IconButton";
|
|
3136
|
+
var import_react32 = require("react");
|
|
3137
|
+
var import_react_native5 = require("react-native");
|
|
3138
|
+
var BREAKPOINT = 1e3;
|
|
3139
|
+
var MEDIA_DESKTOP_BREAKPOINT = `@media (min-width: ${BREAKPOINT}px)`;
|
|
3140
|
+
var DEFAULT_REF_ID = "storybook_internal";
|
|
3141
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3142
|
+
var LayoutContext = (0, import_react32.createContext)({
|
|
3143
|
+
isDesktop: false,
|
|
3144
|
+
isMobile: true
|
|
3145
|
+
});
|
|
3146
|
+
var LayoutProvider2 = ({ children }) => {
|
|
3147
|
+
const { width } = (0, import_react_native5.useWindowDimensions)();
|
|
3148
|
+
const isDesktop = width >= BREAKPOINT;
|
|
3149
|
+
const isMobile = !isDesktop;
|
|
3150
|
+
const contextValue = (0, import_react32.useMemo)(
|
|
3151
|
+
() => ({
|
|
3152
|
+
isDesktop,
|
|
3153
|
+
isMobile
|
|
3154
|
+
}),
|
|
3155
|
+
[isDesktop, isMobile]
|
|
3156
|
+
);
|
|
3157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LayoutContext.Provider, { value: contextValue, children });
|
|
3158
|
+
};
|
|
3159
|
+
var useLayout = () => (0, import_react32.useContext)(LayoutContext);
|
|
3160
|
+
function isExpandType(x2) {
|
|
3161
|
+
return !!(x2 && x2.showAll);
|
|
3162
|
+
}
|
|
3163
|
+
var import_react42 = require("react");
|
|
3164
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3165
|
+
var StorageContext = (0, import_react42.createContext)({
|
|
3166
|
+
getItem: async () => null,
|
|
3167
|
+
setItem: async () => {
|
|
3168
|
+
}
|
|
3169
|
+
});
|
|
3170
|
+
var StorageProvider2 = ({
|
|
3171
|
+
storage,
|
|
3172
|
+
children
|
|
3173
|
+
}) => {
|
|
3174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(StorageContext.Provider, { value: storage, children });
|
|
3175
|
+
};
|
|
3176
|
+
var useStorage = () => (0, import_react42.useContext)(StorageContext);
|
|
3177
|
+
var C = Object.create;
|
|
3178
|
+
var u = Object.defineProperty;
|
|
3179
|
+
var B = Object.getOwnPropertyDescriptor;
|
|
3180
|
+
var F = Object.getOwnPropertyNames;
|
|
3181
|
+
var h = Object.getPrototypeOf;
|
|
3182
|
+
var w = Object.prototype.hasOwnProperty;
|
|
3183
|
+
var E = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
|
|
3184
|
+
var v = (r, e, n, t) => {
|
|
3185
|
+
if (e && typeof e == "object" || typeof e == "function")
|
|
3186
|
+
for (let a of F(e))
|
|
3187
|
+
!w.call(r, a) && a !== n && u(r, a, { get: () => e[a], enumerable: !(t = B(e, a)) || t.enumerable });
|
|
3188
|
+
return r;
|
|
3189
|
+
};
|
|
3190
|
+
var I = (r, e, n) => (n = r != null ? C(h(r)) : {}, v(e || !r || !r.__esModule ? u(n, "default", { value: r, enumerable: true }) : n, r));
|
|
3191
|
+
var x = E((T) => {
|
|
3192
|
+
Object.defineProperty(T, "__esModule", { value: true }), T.isEqual = function() {
|
|
3193
|
+
var r = Object.prototype.toString, e = Object.getPrototypeOf, n = Object.getOwnPropertySymbols ? function(t) {
|
|
3194
|
+
return Object.keys(t).concat(Object.getOwnPropertySymbols(t));
|
|
3195
|
+
} : Object.keys;
|
|
3196
|
+
return function(t, a) {
|
|
3197
|
+
return function i(o, s, p) {
|
|
3198
|
+
var g, y, d, c = r.call(o), b = r.call(s);
|
|
3199
|
+
if (o === s)
|
|
3200
|
+
return true;
|
|
3201
|
+
if (o == null || s == null)
|
|
3202
|
+
return false;
|
|
3203
|
+
if (p.indexOf(o) > -1 && p.indexOf(s) > -1)
|
|
3204
|
+
return true;
|
|
3205
|
+
if (p.push(o, s), c != b || (g = n(o), y = n(s), g.length != y.length || g.some(function(A) {
|
|
3206
|
+
return !i(o[A], s[A], p);
|
|
3207
|
+
})))
|
|
3208
|
+
return false;
|
|
3209
|
+
switch (c.slice(8, -1)) {
|
|
3210
|
+
case "Symbol":
|
|
3211
|
+
return o.valueOf() == s.valueOf();
|
|
3212
|
+
case "Date":
|
|
3213
|
+
case "Number":
|
|
3214
|
+
return +o == +s || +o != +o && +s != +s;
|
|
3215
|
+
case "RegExp":
|
|
3216
|
+
case "Function":
|
|
3217
|
+
case "String":
|
|
3218
|
+
case "Boolean":
|
|
3219
|
+
return "" + o == "" + s;
|
|
3220
|
+
case "Set":
|
|
3221
|
+
case "Map":
|
|
3222
|
+
g = o.entries(), y = s.entries();
|
|
3223
|
+
do
|
|
3224
|
+
if (!i((d = g.next()).value, y.next().value, p))
|
|
3225
|
+
return false;
|
|
3226
|
+
while (!d.done);
|
|
3227
|
+
return true;
|
|
3228
|
+
case "ArrayBuffer":
|
|
3229
|
+
o = new Uint8Array(o), s = new Uint8Array(s);
|
|
3230
|
+
case "DataView":
|
|
3231
|
+
o = new Uint8Array(o.buffer), s = new Uint8Array(s.buffer);
|
|
3232
|
+
case "Float32Array":
|
|
3233
|
+
case "Float64Array":
|
|
3234
|
+
case "Int8Array":
|
|
3235
|
+
case "Int16Array":
|
|
3236
|
+
case "Int32Array":
|
|
3237
|
+
case "Uint8Array":
|
|
3238
|
+
case "Uint16Array":
|
|
3239
|
+
case "Uint32Array":
|
|
3240
|
+
case "Uint8ClampedArray":
|
|
3241
|
+
case "Arguments":
|
|
3242
|
+
case "Array":
|
|
3243
|
+
if (o.length != s.length)
|
|
3244
|
+
return false;
|
|
3245
|
+
for (d = 0; d < o.length; d++)
|
|
3246
|
+
if ((d in o || d in s) && (d in o != d in s || !i(o[d], s[d], p)))
|
|
3247
|
+
return false;
|
|
3248
|
+
return true;
|
|
3249
|
+
case "Object":
|
|
3250
|
+
return i(e(o), e(s), p);
|
|
3251
|
+
default:
|
|
3252
|
+
return false;
|
|
3253
|
+
}
|
|
3254
|
+
}(t, a, []);
|
|
3255
|
+
};
|
|
3256
|
+
}();
|
|
3257
|
+
});
|
|
3258
|
+
var l = I(x());
|
|
3259
|
+
var O = (r) => r.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "-").replace(/-+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
|
|
3260
|
+
var import_ts_dedent = (init_esm(), __toCommonJS(esm_exports));
|
|
3261
|
+
var import_client_logger = require("storybook/internal/client-logger");
|
|
3262
|
+
var import_es_toolkit = require_dist();
|
|
3263
|
+
var intersect = (a, b) => {
|
|
3264
|
+
if (!Array.isArray(a) || !Array.isArray(b) || !a.length || !b.length) {
|
|
3265
|
+
return [];
|
|
3266
|
+
}
|
|
3267
|
+
return a.reduce((acc, aValue) => {
|
|
3268
|
+
if (b.includes(aValue)) {
|
|
3269
|
+
acc.push(aValue);
|
|
3270
|
+
}
|
|
3271
|
+
return acc;
|
|
3272
|
+
}, []);
|
|
3273
|
+
};
|
|
3274
|
+
var merge = (a, ...b) => {
|
|
3275
|
+
let target = {};
|
|
3276
|
+
target = (0, import_es_toolkit.mergeWith)(
|
|
3277
|
+
{},
|
|
3278
|
+
a,
|
|
3279
|
+
(objValue, srcValue) => {
|
|
3280
|
+
if (Array.isArray(srcValue) && Array.isArray(objValue)) {
|
|
3281
|
+
srcValue.forEach((s) => {
|
|
3282
|
+
const existing = objValue.find((o) => o === s || (0, import_es_toolkit.isEqual)(o, s));
|
|
3283
|
+
if (!existing) {
|
|
3284
|
+
objValue.push(s);
|
|
3285
|
+
}
|
|
3286
|
+
});
|
|
3287
|
+
return objValue;
|
|
3288
|
+
}
|
|
3289
|
+
if (Array.isArray(objValue)) {
|
|
3290
|
+
import_client_logger.logger.log(["the types mismatch, picking", objValue]);
|
|
3291
|
+
return objValue;
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
);
|
|
3295
|
+
for (const obj of b) {
|
|
3296
|
+
target = (0, import_es_toolkit.mergeWith)(target, obj, (objValue, srcValue) => {
|
|
3297
|
+
if (Array.isArray(srcValue) && Array.isArray(objValue)) {
|
|
3298
|
+
srcValue.forEach((s) => {
|
|
3299
|
+
const existing = objValue.find((o) => o === s || (0, import_es_toolkit.isEqual)(o, s));
|
|
3300
|
+
if (!existing) {
|
|
3301
|
+
objValue.push(s);
|
|
3302
|
+
}
|
|
3303
|
+
});
|
|
3304
|
+
return objValue;
|
|
3305
|
+
}
|
|
3306
|
+
if (Array.isArray(objValue)) {
|
|
3307
|
+
import_client_logger.logger.log(["the types mismatch, picking", objValue]);
|
|
3308
|
+
return objValue;
|
|
3309
|
+
}
|
|
3310
|
+
});
|
|
3311
|
+
}
|
|
3312
|
+
return target;
|
|
3313
|
+
};
|
|
3314
|
+
var noArrayMerge = (a, ...b) => {
|
|
3315
|
+
let target = {};
|
|
3316
|
+
target = (0, import_es_toolkit.mergeWith)(
|
|
3317
|
+
{},
|
|
3318
|
+
a,
|
|
3319
|
+
(objValue, srcValue) => {
|
|
3320
|
+
if (Array.isArray(srcValue)) {
|
|
3321
|
+
return srcValue;
|
|
3322
|
+
}
|
|
3323
|
+
}
|
|
3324
|
+
);
|
|
3325
|
+
for (const obj of b) {
|
|
3326
|
+
target = (0, import_es_toolkit.mergeWith)(target, obj, (objValue, srcValue) => {
|
|
3327
|
+
if (Array.isArray(srcValue)) {
|
|
3328
|
+
return srcValue;
|
|
3329
|
+
}
|
|
3330
|
+
});
|
|
3331
|
+
}
|
|
3332
|
+
return target;
|
|
3333
|
+
};
|
|
3334
|
+
var TITLE_PATH_SEPARATOR = /\s*\/\s*/;
|
|
3335
|
+
var transformStoryIndexToStoriesHash2 = (input, { provider, docsOptions, filters, allStatuses }) => {
|
|
3336
|
+
if (!input.v) {
|
|
3337
|
+
throw new Error("Composition: Missing stories.json version");
|
|
3338
|
+
}
|
|
3339
|
+
let index = input;
|
|
3340
|
+
index = index.v === 2 ? transformStoryIndexV2toV3(index) : index;
|
|
3341
|
+
index = index.v === 3 ? transformStoryIndexV3toV4(index) : index;
|
|
3342
|
+
index = index.v === 4 ? transformStoryIndexV4toV5(index) : index;
|
|
3343
|
+
index = index;
|
|
3344
|
+
const entryValues = Object.values(index.entries).filter((entry) => {
|
|
3345
|
+
let result = true;
|
|
3346
|
+
const storyStatuses = allStatuses[entry.id] ?? {};
|
|
3347
|
+
if (Object.values(storyStatuses).some(({ value }) => value === "status-value:error")) {
|
|
3348
|
+
return result;
|
|
3349
|
+
}
|
|
3350
|
+
Object.values(filters).forEach((filter) => {
|
|
3351
|
+
if (result === false) {
|
|
3352
|
+
return;
|
|
3353
|
+
}
|
|
3354
|
+
result = filter({ ...entry, statuses: storyStatuses });
|
|
3355
|
+
});
|
|
3356
|
+
return result;
|
|
3357
|
+
});
|
|
3358
|
+
const { sidebar = {} } = provider.getConfig();
|
|
3359
|
+
const { showRoots, collapsedRoots = [], renderLabel } = sidebar;
|
|
3360
|
+
const setShowRoots = typeof showRoots !== "undefined";
|
|
3361
|
+
const storiesHashOutOfOrder = entryValues.reduce((acc, item) => {
|
|
3362
|
+
if (docsOptions.docsMode && item.type !== "docs") {
|
|
3363
|
+
return acc;
|
|
3364
|
+
}
|
|
3365
|
+
const { title } = item;
|
|
3366
|
+
const groups = title.trim().split(TITLE_PATH_SEPARATOR);
|
|
3367
|
+
const root = (!setShowRoots || showRoots) && groups.length > 1 ? [groups.shift()] : [];
|
|
3368
|
+
const names = [...root, ...groups];
|
|
3369
|
+
const paths = names.reduce((list, name, idx) => {
|
|
3370
|
+
const parent = idx > 0 && list[idx - 1];
|
|
3371
|
+
const id = O(parent ? `${parent}-${name}` : name);
|
|
3372
|
+
if (name.trim() === "") {
|
|
3373
|
+
throw new Error(import_ts_dedent.dedent`Invalid title ${title} ending in slash.`);
|
|
3374
|
+
}
|
|
3375
|
+
if (parent === id) {
|
|
3376
|
+
throw new Error(
|
|
3377
|
+
import_ts_dedent.dedent`
|
|
3378
|
+
Invalid part '${name}', leading to id === parentId ('${id}'), inside title '${title}'
|
|
3379
|
+
|
|
3380
|
+
Did you create a path that uses the separator char accidentally, such as 'Vue <docs/>' where '/' is a separator char? See https://github.com/storybookjs/storybook/issues/6128
|
|
3381
|
+
`
|
|
3382
|
+
);
|
|
3383
|
+
}
|
|
3384
|
+
list.push(id);
|
|
3385
|
+
return list;
|
|
3386
|
+
}, []);
|
|
3387
|
+
paths.forEach((id, idx) => {
|
|
3388
|
+
const childId = paths[idx + 1] || item.id;
|
|
3389
|
+
if (root.length && idx === 0) {
|
|
3390
|
+
acc[id] = merge(acc[id] || {}, {
|
|
3391
|
+
type: "root",
|
|
3392
|
+
id,
|
|
3393
|
+
name: names[idx],
|
|
3394
|
+
tags: [],
|
|
3395
|
+
depth: idx,
|
|
3396
|
+
renderLabel,
|
|
3397
|
+
startCollapsed: collapsedRoots.includes(id),
|
|
3398
|
+
// Note that this will later get appended to the previous list of children (see below)
|
|
3399
|
+
children: [childId]
|
|
3400
|
+
});
|
|
3401
|
+
} else if ((!acc[id] || acc[id].type === "component") && idx === paths.length - 1) {
|
|
3402
|
+
acc[id] = merge(acc[id] || {}, {
|
|
3403
|
+
type: "component",
|
|
3404
|
+
id,
|
|
3405
|
+
name: names[idx],
|
|
3406
|
+
tags: [],
|
|
3407
|
+
parent: paths[idx - 1],
|
|
3408
|
+
depth: idx,
|
|
3409
|
+
renderLabel,
|
|
3410
|
+
...childId && {
|
|
3411
|
+
children: [childId]
|
|
3412
|
+
}
|
|
3413
|
+
});
|
|
3414
|
+
} else {
|
|
3415
|
+
acc[id] = merge(acc[id] || {}, {
|
|
3416
|
+
type: "group",
|
|
3417
|
+
id,
|
|
3418
|
+
name: names[idx],
|
|
3419
|
+
tags: [],
|
|
3420
|
+
parent: paths[idx - 1],
|
|
3421
|
+
depth: idx,
|
|
3422
|
+
renderLabel,
|
|
3423
|
+
...childId && {
|
|
3424
|
+
children: [childId]
|
|
3425
|
+
}
|
|
3426
|
+
});
|
|
3427
|
+
}
|
|
3428
|
+
});
|
|
3429
|
+
acc[item.id] = {
|
|
3430
|
+
type: "story",
|
|
3431
|
+
tags: [],
|
|
3432
|
+
...item,
|
|
3433
|
+
depth: paths.length,
|
|
3434
|
+
parent: paths[paths.length - 1],
|
|
3435
|
+
renderLabel,
|
|
3436
|
+
prepared: !!item.parameters
|
|
3437
|
+
};
|
|
3438
|
+
return acc;
|
|
3439
|
+
}, {});
|
|
3440
|
+
function addItem(acc, item) {
|
|
3441
|
+
if (acc[item.id]) {
|
|
3442
|
+
return acc;
|
|
3443
|
+
}
|
|
3444
|
+
acc[item.id] = item;
|
|
3445
|
+
if (item.type === "root" || item.type === "group" || item.type === "component") {
|
|
3446
|
+
item.children.forEach((childId) => addItem(acc, storiesHashOutOfOrder[childId]));
|
|
3447
|
+
item.tags = item.children.reduce((currentTags, childId) => {
|
|
3448
|
+
const child = acc[childId];
|
|
3449
|
+
return currentTags === null ? child.tags : intersect(currentTags, child.tags);
|
|
3450
|
+
}, null);
|
|
3451
|
+
}
|
|
3452
|
+
return acc;
|
|
3453
|
+
}
|
|
3454
|
+
const orphanHash = Object.values(storiesHashOutOfOrder).filter((i) => i.type !== "root" && !i.parent).reduce(addItem, {});
|
|
3455
|
+
return Object.values(storiesHashOutOfOrder).filter((i) => i.type === "root").reduce(addItem, orphanHash);
|
|
3456
|
+
};
|
|
3457
|
+
var transformStoryIndexV2toV3 = (index) => {
|
|
3458
|
+
return {
|
|
3459
|
+
v: 3,
|
|
3460
|
+
stories: Object.values(index.stories).reduce(
|
|
3461
|
+
(acc, entry) => {
|
|
3462
|
+
acc[entry.id] = {
|
|
3463
|
+
...entry,
|
|
3464
|
+
title: entry.kind,
|
|
3465
|
+
name: entry.name || entry.story,
|
|
3466
|
+
importPath: entry.parameters.fileName || ""
|
|
3467
|
+
};
|
|
3468
|
+
return acc;
|
|
3469
|
+
},
|
|
3470
|
+
{}
|
|
3471
|
+
)
|
|
3472
|
+
};
|
|
3473
|
+
};
|
|
3474
|
+
var transformStoryIndexV3toV4 = (index) => {
|
|
3475
|
+
const countByTitle = (0, import_es_toolkit.countBy)(Object.values(index.stories), (item) => item.title);
|
|
3476
|
+
return {
|
|
3477
|
+
v: 4,
|
|
3478
|
+
entries: Object.values(index.stories).reduce(
|
|
3479
|
+
(acc, entry) => {
|
|
3480
|
+
let type = "story";
|
|
3481
|
+
if (entry.parameters?.docsOnly || entry.name === "Page" && countByTitle[entry.title] === 1) {
|
|
3482
|
+
type = "docs";
|
|
3483
|
+
}
|
|
3484
|
+
acc[entry.id] = {
|
|
3485
|
+
type,
|
|
3486
|
+
...type === "docs" && { tags: ["stories-mdx"], storiesImports: [] },
|
|
3487
|
+
...entry
|
|
3488
|
+
};
|
|
3489
|
+
delete acc[entry.id].story;
|
|
3490
|
+
delete acc[entry.id].kind;
|
|
3491
|
+
return acc;
|
|
3492
|
+
},
|
|
3493
|
+
{}
|
|
3494
|
+
)
|
|
3495
|
+
};
|
|
3496
|
+
};
|
|
3497
|
+
var transformStoryIndexV4toV5 = (index) => {
|
|
3498
|
+
return {
|
|
3499
|
+
v: 5,
|
|
3500
|
+
entries: Object.values(index.entries).reduce(
|
|
3501
|
+
(acc, entry) => {
|
|
3502
|
+
acc[entry.id] = {
|
|
3503
|
+
...entry,
|
|
3504
|
+
tags: entry.tags ? ["dev", "test", ...entry.tags] : ["dev"]
|
|
3505
|
+
};
|
|
3506
|
+
return acc;
|
|
3507
|
+
},
|
|
3508
|
+
{}
|
|
3509
|
+
)
|
|
3510
|
+
};
|
|
3511
|
+
};
|
|
3512
|
+
var import_memoizerific = __toESM2(require_memoizerific());
|
|
3513
|
+
var createId = (itemId, refId) => !refId || refId === DEFAULT_REF_ID ? itemId : `${refId}_${itemId}`;
|
|
3514
|
+
var prevent = (e) => {
|
|
3515
|
+
e.preventDefault();
|
|
3516
|
+
return false;
|
|
3517
|
+
};
|
|
3518
|
+
var get = (0, import_memoizerific.default)(1e3)((id, dataset) => dataset[id]);
|
|
3519
|
+
var getParent = (0, import_memoizerific.default)(1e3)((id, dataset) => {
|
|
3520
|
+
const item = get(id, dataset);
|
|
3521
|
+
return item && item.type !== "root" ? get(item.parent, dataset) : void 0;
|
|
3522
|
+
});
|
|
3523
|
+
var getParents = (0, import_memoizerific.default)(1e3)((id, dataset) => {
|
|
3524
|
+
const parent = getParent(id, dataset);
|
|
3525
|
+
return parent ? [parent, ...getParents(parent.id, dataset)] : [];
|
|
3526
|
+
});
|
|
3527
|
+
var getAncestorIds = (0, import_memoizerific.default)(1e3)(
|
|
3528
|
+
(data, id) => getParents(id, data).map((item) => item.id)
|
|
3529
|
+
);
|
|
3530
|
+
var getDescendantIds = (0, import_memoizerific.default)(1e3)((data, id, skipLeafs) => {
|
|
3531
|
+
const entry = data[id];
|
|
3532
|
+
const children = entry.type === "story" || entry.type === "docs" ? [] : entry.children;
|
|
3533
|
+
return children.reduce((acc, childId) => {
|
|
3534
|
+
const child = data[childId];
|
|
3535
|
+
if (!child || skipLeafs && (child.type === "story" || child.type === "docs"))
|
|
3536
|
+
return acc;
|
|
3537
|
+
acc.push(childId, ...getDescendantIds(data, childId, skipLeafs));
|
|
3538
|
+
return acc;
|
|
3539
|
+
}, []);
|
|
3540
|
+
});
|
|
3541
|
+
function getPath(item, ref) {
|
|
3542
|
+
const parent = item.type !== "root" && item.parent ? ref.index[item.parent] : null;
|
|
3543
|
+
if (parent)
|
|
3544
|
+
return [...getPath(parent, ref), parent.name];
|
|
3545
|
+
return ref.id === DEFAULT_REF_ID ? [] : [ref.title || ref.id];
|
|
3546
|
+
}
|
|
3547
|
+
var searchItem = (item, ref) => {
|
|
3548
|
+
return { ...item, refId: ref.id, path: getPath(item, ref) };
|
|
3549
|
+
};
|
|
3550
|
+
function cycle(array, index, delta) {
|
|
3551
|
+
let next = index + delta % array.length;
|
|
3552
|
+
if (next < 0)
|
|
3553
|
+
next = array.length + next;
|
|
3554
|
+
if (next >= array.length)
|
|
3555
|
+
next -= array.length;
|
|
3556
|
+
return next;
|
|
3557
|
+
}
|
|
3558
|
+
var getStateType = (isLoading, isAuthRequired, isError, isEmpty) => {
|
|
3559
|
+
switch (true) {
|
|
3560
|
+
case isAuthRequired:
|
|
3561
|
+
return "auth";
|
|
3562
|
+
case isError:
|
|
3563
|
+
return "error";
|
|
3564
|
+
case isLoading:
|
|
3565
|
+
return "loading";
|
|
3566
|
+
case isEmpty:
|
|
3567
|
+
return "empty";
|
|
3568
|
+
default:
|
|
3569
|
+
return "ready";
|
|
3570
|
+
}
|
|
3571
|
+
};
|
|
3572
|
+
var isAncestor = (element, maybeAncestor) => {
|
|
3573
|
+
if (!element || !maybeAncestor)
|
|
3574
|
+
return false;
|
|
3575
|
+
if (element === maybeAncestor)
|
|
3576
|
+
return true;
|
|
3577
|
+
return isAncestor(element.parentElement, maybeAncestor);
|
|
3578
|
+
};
|
|
3579
|
+
var removeNoiseFromName = (storyName) => storyName.replaceAll(/(\s|-|_)/gi, "");
|
|
3580
|
+
var isStoryHoistable = (storyName, componentName) => removeNoiseFromName(storyName) === removeNoiseFromName(componentName);
|
|
3581
|
+
var import_react52 = require("react");
|
|
3582
|
+
var useStyle = (styleFactory, deps) => (
|
|
3583
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3584
|
+
(0, import_react52.useMemo)(styleFactory, deps)
|
|
3585
|
+
);
|
|
3586
|
+
var import_react6 = require("react");
|
|
3587
|
+
var initializeExpanded = ({
|
|
3588
|
+
initialExpanded,
|
|
3589
|
+
rootIds
|
|
3590
|
+
}) => {
|
|
3591
|
+
const highlightedAncestors = [];
|
|
3592
|
+
return [...rootIds, ...highlightedAncestors].reduce(
|
|
3593
|
+
(acc, id) => Object.assign(acc, { [id]: id in initialExpanded ? initialExpanded[id] : true }),
|
|
3594
|
+
{}
|
|
3595
|
+
);
|
|
3596
|
+
};
|
|
3597
|
+
var useExpanded = ({
|
|
3598
|
+
refId,
|
|
3599
|
+
data,
|
|
3600
|
+
initialExpanded,
|
|
3601
|
+
rootIds,
|
|
3602
|
+
selectedStoryId
|
|
3603
|
+
}) => {
|
|
3604
|
+
const [expanded, setExpanded] = (0, import_react6.useReducer)(
|
|
3605
|
+
(state, { ids, value }) => ids.reduce((acc, id) => Object.assign(acc, { [id]: value }), { ...state }),
|
|
3606
|
+
{ refId, data, rootIds, initialExpanded },
|
|
3607
|
+
initializeExpanded
|
|
3608
|
+
);
|
|
3609
|
+
const updateExpanded = (0, import_react6.useCallback)(({ ids, value }) => {
|
|
3610
|
+
setExpanded({ ids, value });
|
|
3611
|
+
}, []);
|
|
3612
|
+
(0, import_react6.useEffect)(() => {
|
|
3613
|
+
setExpanded({ ids: getAncestorIds(data, selectedStoryId), value: true });
|
|
3614
|
+
}, [data, selectedStoryId]);
|
|
3615
|
+
return [expanded, updateExpanded];
|
|
3616
|
+
};
|
|
3617
|
+
var import_react7 = require("react");
|
|
3618
|
+
var useLastViewed = (selection) => {
|
|
3619
|
+
const lastViewedRef = (0, import_react7.useRef)([]);
|
|
3620
|
+
const updateLastViewed = (0, import_react7.useCallback)(
|
|
3621
|
+
(story) => {
|
|
3622
|
+
const items = lastViewedRef.current;
|
|
3623
|
+
const index = items.findIndex(
|
|
3624
|
+
({ storyId, refId }) => storyId === story.storyId && refId === story.refId
|
|
3625
|
+
);
|
|
3626
|
+
if (index === 0)
|
|
3627
|
+
return;
|
|
3628
|
+
if (index === -1) {
|
|
3629
|
+
lastViewedRef.current = [story, ...items];
|
|
3630
|
+
} else {
|
|
3631
|
+
lastViewedRef.current = [story, ...items.slice(0, index), ...items.slice(index + 1)];
|
|
3632
|
+
}
|
|
3633
|
+
},
|
|
3634
|
+
[lastViewedRef]
|
|
3635
|
+
);
|
|
3636
|
+
(0, import_react7.useEffect)(() => {
|
|
3637
|
+
if (selection)
|
|
3638
|
+
updateLastViewed(selection);
|
|
3639
|
+
}, [selection]);
|
|
3640
|
+
return {
|
|
3641
|
+
getLastViewed: (0, import_react7.useCallback)(() => lastViewedRef.current, [lastViewedRef]),
|
|
3642
|
+
clearLastViewed: (0, import_react7.useCallback)(() => {
|
|
3643
|
+
lastViewedRef.current = lastViewedRef.current.slice(0, 1);
|
|
3644
|
+
}, [lastViewedRef])
|
|
3645
|
+
};
|
|
3646
|
+
};
|
|
3647
|
+
var import_react8 = require("react");
|
|
3648
|
+
var useStoreBooleanState = (key, defaultValue) => {
|
|
3649
|
+
const storage = useStorage();
|
|
3650
|
+
const [val, setVal] = (0, import_react8.useState)(defaultValue);
|
|
3651
|
+
(0, import_react8.useEffect)(() => {
|
|
3652
|
+
storage.getItem(key).then((newVal) => {
|
|
3653
|
+
if (newVal === null || newVal === void 0) {
|
|
3654
|
+
setVal(defaultValue);
|
|
3655
|
+
} else {
|
|
3656
|
+
setVal(newVal === "true");
|
|
3657
|
+
}
|
|
3658
|
+
});
|
|
3659
|
+
}, [key, storage, defaultValue]);
|
|
3660
|
+
(0, import_react8.useEffect)(() => {
|
|
3661
|
+
storage.setItem(key, val.toString());
|
|
3662
|
+
}, [key, storage, val]);
|
|
3663
|
+
return [val, setVal];
|
|
3664
|
+
};
|
|
3665
|
+
}
|
|
3666
|
+
});
|
|
3667
|
+
|
|
29
3668
|
// src/index.ts
|
|
30
3669
|
var src_exports = {};
|
|
31
3670
|
__export(src_exports, {
|
|
@@ -54,6 +3693,7 @@ var import_manager_api = require("storybook/internal/manager-api");
|
|
|
54
3693
|
var import_preview_api = require("storybook/internal/preview-api");
|
|
55
3694
|
var import_csf = require("@storybook/csf");
|
|
56
3695
|
var import_react_native_theming2 = require("@storybook/react-native-theming");
|
|
3696
|
+
var import_react_native_ui_common = __toESM(require_dist2());
|
|
57
3697
|
var import_react_native_ui = require("@storybook/react-native-ui");
|
|
58
3698
|
var import_dedent = __toESM(require("dedent"));
|
|
59
3699
|
var import_deepmerge = __toESM(require("deepmerge"));
|
|
@@ -1077,10 +4717,10 @@ var View3 = class {
|
|
|
1077
4717
|
if (!ready) {
|
|
1078
4718
|
return {};
|
|
1079
4719
|
}
|
|
1080
|
-
return (0,
|
|
4720
|
+
return (0, import_react_native_ui_common.transformStoryIndexToStoriesHash)(self._storyIndex, {
|
|
1081
4721
|
docsOptions: { docsMode: false, defaultName: "" },
|
|
1082
4722
|
filters: {},
|
|
1083
|
-
|
|
4723
|
+
allStatuses: {},
|
|
1084
4724
|
provider: {
|
|
1085
4725
|
handleAPI: () => ({}),
|
|
1086
4726
|
getConfig: () => ({})
|
|
@@ -1101,7 +4741,7 @@ var View3 = class {
|
|
|
1101
4741
|
);
|
|
1102
4742
|
}
|
|
1103
4743
|
if (onDeviceUI) {
|
|
1104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_theming2.ThemeProvider, { theme: appliedTheme, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_safe_area_context.SafeAreaProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_gesture_handler.GestureHandlerRootView, { style: { flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_bottom_sheet.BottomSheetModalProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_theming2.ThemeProvider, { theme: appliedTheme, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_safe_area_context.SafeAreaProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_gesture_handler.GestureHandlerRootView, { style: { flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_bottom_sheet.BottomSheetModalProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_ui_common.StorageProvider, { storage, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_ui_common.LayoutProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_ui.Layout, { storyHash, story, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StoryView_default, {}) }) }) }) }) }) }) });
|
|
1105
4745
|
} else if (CustomUIComponent) {
|
|
1106
4746
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1107
4747
|
CustomUIComponent,
|