pompelmi 0.17.0 → 0.19.0

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.
@@ -0,0 +1,2340 @@
1
+ 'use strict';
2
+
3
+ function toScanFn(s) {
4
+ return (typeof s === "function" ? s : s.scan);
5
+ }
6
+ function composeScanners(...scanners) {
7
+ return async (input, ctx) => {
8
+ const all = [];
9
+ for (const s of scanners) {
10
+ try {
11
+ const out = await toScanFn(s)(input, ctx);
12
+ if (Array.isArray(out))
13
+ all.push(...out);
14
+ }
15
+ catch {
16
+ // ignore individual scanner failures
17
+ }
18
+ }
19
+ return all;
20
+ };
21
+ }
22
+ function createPresetScanner(_preset, _opts = {}) {
23
+ // TODO: wire to real preset registry
24
+ return async (_input, _ctx) => {
25
+ return [];
26
+ };
27
+ }
28
+
29
+ /** Mappa veloce estensione -> mime (basic) */
30
+ function guessMimeByExt(name) {
31
+ if (!name)
32
+ return;
33
+ const ext = name.toLowerCase().split('.').pop();
34
+ switch (ext) {
35
+ case 'zip': return 'application/zip';
36
+ case 'png': return 'image/png';
37
+ case 'jpg':
38
+ case 'jpeg': return 'image/jpeg';
39
+ case 'pdf': return 'application/pdf';
40
+ case 'txt': return 'text/plain';
41
+ default: return;
42
+ }
43
+ }
44
+ /** Heuristica semplice per verdetto */
45
+ function computeVerdict(matches) {
46
+ if (!matches.length)
47
+ return 'clean';
48
+ // se la regola contiene 'zip_' lo marchiamo "suspicious"
49
+ const anyHigh = matches.some(m => (m.tags ?? []).includes('critical') || (m.tags ?? []).includes('high'));
50
+ return anyHigh ? 'malicious' : 'suspicious';
51
+ }
52
+ /** Converte i Match (heuristics) in YaraMatch-like per uniformare l'output */
53
+ function toYaraMatches(ms) {
54
+ return ms.map(m => ({
55
+ rule: m.rule,
56
+ namespace: 'heuristics',
57
+ tags: ['heuristics'].concat(m.severity ? [m.severity] : []),
58
+ meta: m.meta,
59
+ }));
60
+ }
61
+ /** Scan di bytes (browser/node) usando preset (default: zip-basic) */
62
+ async function scanBytes(input, opts = {}) {
63
+ const t0 = Date.now();
64
+ opts.preset ?? 'zip-basic';
65
+ const ctx = {
66
+ ...opts.ctx,
67
+ mimeType: opts.ctx?.mimeType ?? guessMimeByExt(opts.ctx?.filename),
68
+ size: opts.ctx?.size ?? input.byteLength,
69
+ };
70
+ const scanFn = createPresetScanner();
71
+ const matchesH = await (typeof scanFn === "function" ? scanFn : scanFn.scan)(input, ctx);
72
+ const matches = toYaraMatches(matchesH);
73
+ const verdict = computeVerdict(matches);
74
+ const durationMs = Date.now() - t0;
75
+ return {
76
+ ok: verdict === 'clean',
77
+ verdict,
78
+ matches,
79
+ reasons: matches.map(m => m.rule),
80
+ file: { name: ctx.filename, mimeType: ctx.mimeType, size: ctx.size },
81
+ durationMs,
82
+ engine: 'heuristics',
83
+ truncated: false,
84
+ timedOut: false,
85
+ };
86
+ }
87
+ /** Scan di un file su disco (Node). Import dinamico per non vincolare il bundle browser. */
88
+ async function scanFile(filePath, opts = {}) {
89
+ const [{ readFile, stat }, path] = await Promise.all([
90
+ import('fs/promises'),
91
+ import('path'),
92
+ ]);
93
+ const [buf, st] = await Promise.all([readFile(filePath), stat(filePath)]);
94
+ const ctx = {
95
+ filename: path.basename(filePath),
96
+ mimeType: guessMimeByExt(filePath),
97
+ size: st.size,
98
+ };
99
+ return scanBytes(new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength), { ...opts, ctx });
100
+ }
101
+ /** Scan multipli File (browser) usando scanBytes + preset di default */
102
+ async function scanFiles(files, opts = {}) {
103
+ const list = Array.from(files);
104
+ const out = [];
105
+ for (const f of list) {
106
+ const buf = new Uint8Array(await f.arrayBuffer());
107
+ const rep = await scanBytes(buf, {
108
+ ...opts,
109
+ ctx: { filename: f.name, mimeType: f.type || guessMimeByExt(f.name), size: f.size },
110
+ });
111
+ out.push(rep);
112
+ }
113
+ return out;
114
+ }
115
+
116
+ /**
117
+ * Validates a File by MIME type and size (max 5 MB).
118
+ */
119
+ function validateFile(file) {
120
+ const maxSize = 5 * 1024 * 1024;
121
+ const allowedTypes = ['text/plain', 'application/json', 'text/csv'];
122
+ if (!allowedTypes.includes(file.type)) {
123
+ return { valid: false, error: 'Unsupported file type' };
124
+ }
125
+ if (file.size > maxSize) {
126
+ return { valid: false, error: 'File too large (max 5 MB)' };
127
+ }
128
+ return { valid: true };
129
+ }
130
+
131
+ var react = {exports: {}};
132
+
133
+ var react_production = {};
134
+
135
+ /**
136
+ * @license React
137
+ * react.production.js
138
+ *
139
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
140
+ *
141
+ * This source code is licensed under the MIT license found in the
142
+ * LICENSE file in the root directory of this source tree.
143
+ */
144
+
145
+ var hasRequiredReact_production;
146
+
147
+ function requireReact_production () {
148
+ if (hasRequiredReact_production) return react_production;
149
+ hasRequiredReact_production = 1;
150
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
151
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
152
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
153
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
154
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
155
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
156
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
157
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
158
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
159
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
160
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
161
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
162
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
163
+ function getIteratorFn(maybeIterable) {
164
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
165
+ maybeIterable =
166
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
167
+ maybeIterable["@@iterator"];
168
+ return "function" === typeof maybeIterable ? maybeIterable : null;
169
+ }
170
+ var ReactNoopUpdateQueue = {
171
+ isMounted: function () {
172
+ return false;
173
+ },
174
+ enqueueForceUpdate: function () {},
175
+ enqueueReplaceState: function () {},
176
+ enqueueSetState: function () {}
177
+ },
178
+ assign = Object.assign,
179
+ emptyObject = {};
180
+ function Component(props, context, updater) {
181
+ this.props = props;
182
+ this.context = context;
183
+ this.refs = emptyObject;
184
+ this.updater = updater || ReactNoopUpdateQueue;
185
+ }
186
+ Component.prototype.isReactComponent = {};
187
+ Component.prototype.setState = function (partialState, callback) {
188
+ if (
189
+ "object" !== typeof partialState &&
190
+ "function" !== typeof partialState &&
191
+ null != partialState
192
+ )
193
+ throw Error(
194
+ "takes an object of state variables to update or a function which returns an object of state variables."
195
+ );
196
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
197
+ };
198
+ Component.prototype.forceUpdate = function (callback) {
199
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
200
+ };
201
+ function ComponentDummy() {}
202
+ ComponentDummy.prototype = Component.prototype;
203
+ function PureComponent(props, context, updater) {
204
+ this.props = props;
205
+ this.context = context;
206
+ this.refs = emptyObject;
207
+ this.updater = updater || ReactNoopUpdateQueue;
208
+ }
209
+ var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
210
+ pureComponentPrototype.constructor = PureComponent;
211
+ assign(pureComponentPrototype, Component.prototype);
212
+ pureComponentPrototype.isPureReactComponent = true;
213
+ var isArrayImpl = Array.isArray;
214
+ function noop() {}
215
+ var ReactSharedInternals = { H: null, A: null, T: null, S: null },
216
+ hasOwnProperty = Object.prototype.hasOwnProperty;
217
+ function ReactElement(type, key, props) {
218
+ var refProp = props.ref;
219
+ return {
220
+ $$typeof: REACT_ELEMENT_TYPE,
221
+ type: type,
222
+ key: key,
223
+ ref: void 0 !== refProp ? refProp : null,
224
+ props: props
225
+ };
226
+ }
227
+ function cloneAndReplaceKey(oldElement, newKey) {
228
+ return ReactElement(oldElement.type, newKey, oldElement.props);
229
+ }
230
+ function isValidElement(object) {
231
+ return (
232
+ "object" === typeof object &&
233
+ null !== object &&
234
+ object.$$typeof === REACT_ELEMENT_TYPE
235
+ );
236
+ }
237
+ function escape(key) {
238
+ var escaperLookup = { "=": "=0", ":": "=2" };
239
+ return (
240
+ "$" +
241
+ key.replace(/[=:]/g, function (match) {
242
+ return escaperLookup[match];
243
+ })
244
+ );
245
+ }
246
+ var userProvidedKeyEscapeRegex = /\/+/g;
247
+ function getElementKey(element, index) {
248
+ return "object" === typeof element && null !== element && null != element.key
249
+ ? escape("" + element.key)
250
+ : index.toString(36);
251
+ }
252
+ function resolveThenable(thenable) {
253
+ switch (thenable.status) {
254
+ case "fulfilled":
255
+ return thenable.value;
256
+ case "rejected":
257
+ throw thenable.reason;
258
+ default:
259
+ switch (
260
+ ("string" === typeof thenable.status
261
+ ? thenable.then(noop, noop)
262
+ : ((thenable.status = "pending"),
263
+ thenable.then(
264
+ function (fulfilledValue) {
265
+ "pending" === thenable.status &&
266
+ ((thenable.status = "fulfilled"),
267
+ (thenable.value = fulfilledValue));
268
+ },
269
+ function (error) {
270
+ "pending" === thenable.status &&
271
+ ((thenable.status = "rejected"), (thenable.reason = error));
272
+ }
273
+ )),
274
+ thenable.status)
275
+ ) {
276
+ case "fulfilled":
277
+ return thenable.value;
278
+ case "rejected":
279
+ throw thenable.reason;
280
+ }
281
+ }
282
+ throw thenable;
283
+ }
284
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
285
+ var type = typeof children;
286
+ if ("undefined" === type || "boolean" === type) children = null;
287
+ var invokeCallback = false;
288
+ if (null === children) invokeCallback = true;
289
+ else
290
+ switch (type) {
291
+ case "bigint":
292
+ case "string":
293
+ case "number":
294
+ invokeCallback = true;
295
+ break;
296
+ case "object":
297
+ switch (children.$$typeof) {
298
+ case REACT_ELEMENT_TYPE:
299
+ case REACT_PORTAL_TYPE:
300
+ invokeCallback = true;
301
+ break;
302
+ case REACT_LAZY_TYPE:
303
+ return (
304
+ (invokeCallback = children._init),
305
+ mapIntoArray(
306
+ invokeCallback(children._payload),
307
+ array,
308
+ escapedPrefix,
309
+ nameSoFar,
310
+ callback
311
+ )
312
+ );
313
+ }
314
+ }
315
+ if (invokeCallback)
316
+ return (
317
+ (callback = callback(children)),
318
+ (invokeCallback =
319
+ "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar),
320
+ isArrayImpl(callback)
321
+ ? ((escapedPrefix = ""),
322
+ null != invokeCallback &&
323
+ (escapedPrefix =
324
+ invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
325
+ mapIntoArray(callback, array, escapedPrefix, "", function (c) {
326
+ return c;
327
+ }))
328
+ : null != callback &&
329
+ (isValidElement(callback) &&
330
+ (callback = cloneAndReplaceKey(
331
+ callback,
332
+ escapedPrefix +
333
+ (null == callback.key ||
334
+ (children && children.key === callback.key)
335
+ ? ""
336
+ : ("" + callback.key).replace(
337
+ userProvidedKeyEscapeRegex,
338
+ "$&/"
339
+ ) + "/") +
340
+ invokeCallback
341
+ )),
342
+ array.push(callback)),
343
+ 1
344
+ );
345
+ invokeCallback = 0;
346
+ var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
347
+ if (isArrayImpl(children))
348
+ for (var i = 0; i < children.length; i++)
349
+ (nameSoFar = children[i]),
350
+ (type = nextNamePrefix + getElementKey(nameSoFar, i)),
351
+ (invokeCallback += mapIntoArray(
352
+ nameSoFar,
353
+ array,
354
+ escapedPrefix,
355
+ type,
356
+ callback
357
+ ));
358
+ else if (((i = getIteratorFn(children)), "function" === typeof i))
359
+ for (
360
+ children = i.call(children), i = 0;
361
+ !(nameSoFar = children.next()).done;
362
+
363
+ )
364
+ (nameSoFar = nameSoFar.value),
365
+ (type = nextNamePrefix + getElementKey(nameSoFar, i++)),
366
+ (invokeCallback += mapIntoArray(
367
+ nameSoFar,
368
+ array,
369
+ escapedPrefix,
370
+ type,
371
+ callback
372
+ ));
373
+ else if ("object" === type) {
374
+ if ("function" === typeof children.then)
375
+ return mapIntoArray(
376
+ resolveThenable(children),
377
+ array,
378
+ escapedPrefix,
379
+ nameSoFar,
380
+ callback
381
+ );
382
+ array = String(children);
383
+ throw Error(
384
+ "Objects are not valid as a React child (found: " +
385
+ ("[object Object]" === array
386
+ ? "object with keys {" + Object.keys(children).join(", ") + "}"
387
+ : array) +
388
+ "). If you meant to render a collection of children, use an array instead."
389
+ );
390
+ }
391
+ return invokeCallback;
392
+ }
393
+ function mapChildren(children, func, context) {
394
+ if (null == children) return children;
395
+ var result = [],
396
+ count = 0;
397
+ mapIntoArray(children, result, "", "", function (child) {
398
+ return func.call(context, child, count++);
399
+ });
400
+ return result;
401
+ }
402
+ function lazyInitializer(payload) {
403
+ if (-1 === payload._status) {
404
+ var ctor = payload._result;
405
+ ctor = ctor();
406
+ ctor.then(
407
+ function (moduleObject) {
408
+ if (0 === payload._status || -1 === payload._status)
409
+ (payload._status = 1), (payload._result = moduleObject);
410
+ },
411
+ function (error) {
412
+ if (0 === payload._status || -1 === payload._status)
413
+ (payload._status = 2), (payload._result = error);
414
+ }
415
+ );
416
+ -1 === payload._status && ((payload._status = 0), (payload._result = ctor));
417
+ }
418
+ if (1 === payload._status) return payload._result.default;
419
+ throw payload._result;
420
+ }
421
+ var reportGlobalError =
422
+ "function" === typeof reportError
423
+ ? reportError
424
+ : function (error) {
425
+ if (
426
+ "object" === typeof window &&
427
+ "function" === typeof window.ErrorEvent
428
+ ) {
429
+ var event = new window.ErrorEvent("error", {
430
+ bubbles: true,
431
+ cancelable: true,
432
+ message:
433
+ "object" === typeof error &&
434
+ null !== error &&
435
+ "string" === typeof error.message
436
+ ? String(error.message)
437
+ : String(error),
438
+ error: error
439
+ });
440
+ if (!window.dispatchEvent(event)) return;
441
+ } else if (
442
+ "object" === typeof process &&
443
+ "function" === typeof process.emit
444
+ ) {
445
+ process.emit("uncaughtException", error);
446
+ return;
447
+ }
448
+ console.error(error);
449
+ },
450
+ Children = {
451
+ map: mapChildren,
452
+ forEach: function (children, forEachFunc, forEachContext) {
453
+ mapChildren(
454
+ children,
455
+ function () {
456
+ forEachFunc.apply(this, arguments);
457
+ },
458
+ forEachContext
459
+ );
460
+ },
461
+ count: function (children) {
462
+ var n = 0;
463
+ mapChildren(children, function () {
464
+ n++;
465
+ });
466
+ return n;
467
+ },
468
+ toArray: function (children) {
469
+ return (
470
+ mapChildren(children, function (child) {
471
+ return child;
472
+ }) || []
473
+ );
474
+ },
475
+ only: function (children) {
476
+ if (!isValidElement(children))
477
+ throw Error(
478
+ "React.Children.only expected to receive a single React element child."
479
+ );
480
+ return children;
481
+ }
482
+ };
483
+ react_production.Activity = REACT_ACTIVITY_TYPE;
484
+ react_production.Children = Children;
485
+ react_production.Component = Component;
486
+ react_production.Fragment = REACT_FRAGMENT_TYPE;
487
+ react_production.Profiler = REACT_PROFILER_TYPE;
488
+ react_production.PureComponent = PureComponent;
489
+ react_production.StrictMode = REACT_STRICT_MODE_TYPE;
490
+ react_production.Suspense = REACT_SUSPENSE_TYPE;
491
+ react_production.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
492
+ ReactSharedInternals;
493
+ react_production.__COMPILER_RUNTIME = {
494
+ __proto__: null,
495
+ c: function (size) {
496
+ return ReactSharedInternals.H.useMemoCache(size);
497
+ }
498
+ };
499
+ react_production.cache = function (fn) {
500
+ return function () {
501
+ return fn.apply(null, arguments);
502
+ };
503
+ };
504
+ react_production.cacheSignal = function () {
505
+ return null;
506
+ };
507
+ react_production.cloneElement = function (element, config, children) {
508
+ if (null === element || void 0 === element)
509
+ throw Error(
510
+ "The argument must be a React element, but you passed " + element + "."
511
+ );
512
+ var props = assign({}, element.props),
513
+ key = element.key;
514
+ if (null != config)
515
+ for (propName in (void 0 !== config.key && (key = "" + config.key), config))
516
+ !hasOwnProperty.call(config, propName) ||
517
+ "key" === propName ||
518
+ "__self" === propName ||
519
+ "__source" === propName ||
520
+ ("ref" === propName && void 0 === config.ref) ||
521
+ (props[propName] = config[propName]);
522
+ var propName = arguments.length - 2;
523
+ if (1 === propName) props.children = children;
524
+ else if (1 < propName) {
525
+ for (var childArray = Array(propName), i = 0; i < propName; i++)
526
+ childArray[i] = arguments[i + 2];
527
+ props.children = childArray;
528
+ }
529
+ return ReactElement(element.type, key, props);
530
+ };
531
+ react_production.createContext = function (defaultValue) {
532
+ defaultValue = {
533
+ $$typeof: REACT_CONTEXT_TYPE,
534
+ _currentValue: defaultValue,
535
+ _currentValue2: defaultValue,
536
+ _threadCount: 0,
537
+ Provider: null,
538
+ Consumer: null
539
+ };
540
+ defaultValue.Provider = defaultValue;
541
+ defaultValue.Consumer = {
542
+ $$typeof: REACT_CONSUMER_TYPE,
543
+ _context: defaultValue
544
+ };
545
+ return defaultValue;
546
+ };
547
+ react_production.createElement = function (type, config, children) {
548
+ var propName,
549
+ props = {},
550
+ key = null;
551
+ if (null != config)
552
+ for (propName in (void 0 !== config.key && (key = "" + config.key), config))
553
+ hasOwnProperty.call(config, propName) &&
554
+ "key" !== propName &&
555
+ "__self" !== propName &&
556
+ "__source" !== propName &&
557
+ (props[propName] = config[propName]);
558
+ var childrenLength = arguments.length - 2;
559
+ if (1 === childrenLength) props.children = children;
560
+ else if (1 < childrenLength) {
561
+ for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
562
+ childArray[i] = arguments[i + 2];
563
+ props.children = childArray;
564
+ }
565
+ if (type && type.defaultProps)
566
+ for (propName in ((childrenLength = type.defaultProps), childrenLength))
567
+ void 0 === props[propName] &&
568
+ (props[propName] = childrenLength[propName]);
569
+ return ReactElement(type, key, props);
570
+ };
571
+ react_production.createRef = function () {
572
+ return { current: null };
573
+ };
574
+ react_production.forwardRef = function (render) {
575
+ return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
576
+ };
577
+ react_production.isValidElement = isValidElement;
578
+ react_production.lazy = function (ctor) {
579
+ return {
580
+ $$typeof: REACT_LAZY_TYPE,
581
+ _payload: { _status: -1, _result: ctor },
582
+ _init: lazyInitializer
583
+ };
584
+ };
585
+ react_production.memo = function (type, compare) {
586
+ return {
587
+ $$typeof: REACT_MEMO_TYPE,
588
+ type: type,
589
+ compare: void 0 === compare ? null : compare
590
+ };
591
+ };
592
+ react_production.startTransition = function (scope) {
593
+ var prevTransition = ReactSharedInternals.T,
594
+ currentTransition = {};
595
+ ReactSharedInternals.T = currentTransition;
596
+ try {
597
+ var returnValue = scope(),
598
+ onStartTransitionFinish = ReactSharedInternals.S;
599
+ null !== onStartTransitionFinish &&
600
+ onStartTransitionFinish(currentTransition, returnValue);
601
+ "object" === typeof returnValue &&
602
+ null !== returnValue &&
603
+ "function" === typeof returnValue.then &&
604
+ returnValue.then(noop, reportGlobalError);
605
+ } catch (error) {
606
+ reportGlobalError(error);
607
+ } finally {
608
+ null !== prevTransition &&
609
+ null !== currentTransition.types &&
610
+ (prevTransition.types = currentTransition.types),
611
+ (ReactSharedInternals.T = prevTransition);
612
+ }
613
+ };
614
+ react_production.unstable_useCacheRefresh = function () {
615
+ return ReactSharedInternals.H.useCacheRefresh();
616
+ };
617
+ react_production.use = function (usable) {
618
+ return ReactSharedInternals.H.use(usable);
619
+ };
620
+ react_production.useActionState = function (action, initialState, permalink) {
621
+ return ReactSharedInternals.H.useActionState(action, initialState, permalink);
622
+ };
623
+ react_production.useCallback = function (callback, deps) {
624
+ return ReactSharedInternals.H.useCallback(callback, deps);
625
+ };
626
+ react_production.useContext = function (Context) {
627
+ return ReactSharedInternals.H.useContext(Context);
628
+ };
629
+ react_production.useDebugValue = function () {};
630
+ react_production.useDeferredValue = function (value, initialValue) {
631
+ return ReactSharedInternals.H.useDeferredValue(value, initialValue);
632
+ };
633
+ react_production.useEffect = function (create, deps) {
634
+ return ReactSharedInternals.H.useEffect(create, deps);
635
+ };
636
+ react_production.useEffectEvent = function (callback) {
637
+ return ReactSharedInternals.H.useEffectEvent(callback);
638
+ };
639
+ react_production.useId = function () {
640
+ return ReactSharedInternals.H.useId();
641
+ };
642
+ react_production.useImperativeHandle = function (ref, create, deps) {
643
+ return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
644
+ };
645
+ react_production.useInsertionEffect = function (create, deps) {
646
+ return ReactSharedInternals.H.useInsertionEffect(create, deps);
647
+ };
648
+ react_production.useLayoutEffect = function (create, deps) {
649
+ return ReactSharedInternals.H.useLayoutEffect(create, deps);
650
+ };
651
+ react_production.useMemo = function (create, deps) {
652
+ return ReactSharedInternals.H.useMemo(create, deps);
653
+ };
654
+ react_production.useOptimistic = function (passthrough, reducer) {
655
+ return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
656
+ };
657
+ react_production.useReducer = function (reducer, initialArg, init) {
658
+ return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
659
+ };
660
+ react_production.useRef = function (initialValue) {
661
+ return ReactSharedInternals.H.useRef(initialValue);
662
+ };
663
+ react_production.useState = function (initialState) {
664
+ return ReactSharedInternals.H.useState(initialState);
665
+ };
666
+ react_production.useSyncExternalStore = function (
667
+ subscribe,
668
+ getSnapshot,
669
+ getServerSnapshot
670
+ ) {
671
+ return ReactSharedInternals.H.useSyncExternalStore(
672
+ subscribe,
673
+ getSnapshot,
674
+ getServerSnapshot
675
+ );
676
+ };
677
+ react_production.useTransition = function () {
678
+ return ReactSharedInternals.H.useTransition();
679
+ };
680
+ react_production.version = "19.2.0";
681
+ return react_production;
682
+ }
683
+
684
+ var react_development = {exports: {}};
685
+
686
+ /**
687
+ * @license React
688
+ * react.development.js
689
+ *
690
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
691
+ *
692
+ * This source code is licensed under the MIT license found in the
693
+ * LICENSE file in the root directory of this source tree.
694
+ */
695
+ react_development.exports;
696
+
697
+ var hasRequiredReact_development;
698
+
699
+ function requireReact_development () {
700
+ if (hasRequiredReact_development) return react_development.exports;
701
+ hasRequiredReact_development = 1;
702
+ (function (module, exports) {
703
+ "production" !== process.env.NODE_ENV &&
704
+ (function () {
705
+ function defineDeprecationWarning(methodName, info) {
706
+ Object.defineProperty(Component.prototype, methodName, {
707
+ get: function () {
708
+ console.warn(
709
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
710
+ info[0],
711
+ info[1]
712
+ );
713
+ }
714
+ });
715
+ }
716
+ function getIteratorFn(maybeIterable) {
717
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
718
+ return null;
719
+ maybeIterable =
720
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
721
+ maybeIterable["@@iterator"];
722
+ return "function" === typeof maybeIterable ? maybeIterable : null;
723
+ }
724
+ function warnNoop(publicInstance, callerName) {
725
+ publicInstance =
726
+ ((publicInstance = publicInstance.constructor) &&
727
+ (publicInstance.displayName || publicInstance.name)) ||
728
+ "ReactClass";
729
+ var warningKey = publicInstance + "." + callerName;
730
+ didWarnStateUpdateForUnmountedComponent[warningKey] ||
731
+ (console.error(
732
+ "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
733
+ callerName,
734
+ publicInstance
735
+ ),
736
+ (didWarnStateUpdateForUnmountedComponent[warningKey] = true));
737
+ }
738
+ function Component(props, context, updater) {
739
+ this.props = props;
740
+ this.context = context;
741
+ this.refs = emptyObject;
742
+ this.updater = updater || ReactNoopUpdateQueue;
743
+ }
744
+ function ComponentDummy() {}
745
+ function PureComponent(props, context, updater) {
746
+ this.props = props;
747
+ this.context = context;
748
+ this.refs = emptyObject;
749
+ this.updater = updater || ReactNoopUpdateQueue;
750
+ }
751
+ function noop() {}
752
+ function testStringCoercion(value) {
753
+ return "" + value;
754
+ }
755
+ function checkKeyStringCoercion(value) {
756
+ try {
757
+ testStringCoercion(value);
758
+ var JSCompiler_inline_result = !1;
759
+ } catch (e) {
760
+ JSCompiler_inline_result = true;
761
+ }
762
+ if (JSCompiler_inline_result) {
763
+ JSCompiler_inline_result = console;
764
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
765
+ var JSCompiler_inline_result$jscomp$0 =
766
+ ("function" === typeof Symbol &&
767
+ Symbol.toStringTag &&
768
+ value[Symbol.toStringTag]) ||
769
+ value.constructor.name ||
770
+ "Object";
771
+ JSCompiler_temp_const.call(
772
+ JSCompiler_inline_result,
773
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
774
+ JSCompiler_inline_result$jscomp$0
775
+ );
776
+ return testStringCoercion(value);
777
+ }
778
+ }
779
+ function getComponentNameFromType(type) {
780
+ if (null == type) return null;
781
+ if ("function" === typeof type)
782
+ return type.$$typeof === REACT_CLIENT_REFERENCE
783
+ ? null
784
+ : type.displayName || type.name || null;
785
+ if ("string" === typeof type) return type;
786
+ switch (type) {
787
+ case REACT_FRAGMENT_TYPE:
788
+ return "Fragment";
789
+ case REACT_PROFILER_TYPE:
790
+ return "Profiler";
791
+ case REACT_STRICT_MODE_TYPE:
792
+ return "StrictMode";
793
+ case REACT_SUSPENSE_TYPE:
794
+ return "Suspense";
795
+ case REACT_SUSPENSE_LIST_TYPE:
796
+ return "SuspenseList";
797
+ case REACT_ACTIVITY_TYPE:
798
+ return "Activity";
799
+ }
800
+ if ("object" === typeof type)
801
+ switch (
802
+ ("number" === typeof type.tag &&
803
+ console.error(
804
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
805
+ ),
806
+ type.$$typeof)
807
+ ) {
808
+ case REACT_PORTAL_TYPE:
809
+ return "Portal";
810
+ case REACT_CONTEXT_TYPE:
811
+ return type.displayName || "Context";
812
+ case REACT_CONSUMER_TYPE:
813
+ return (type._context.displayName || "Context") + ".Consumer";
814
+ case REACT_FORWARD_REF_TYPE:
815
+ var innerType = type.render;
816
+ type = type.displayName;
817
+ type ||
818
+ ((type = innerType.displayName || innerType.name || ""),
819
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
820
+ return type;
821
+ case REACT_MEMO_TYPE:
822
+ return (
823
+ (innerType = type.displayName || null),
824
+ null !== innerType
825
+ ? innerType
826
+ : getComponentNameFromType(type.type) || "Memo"
827
+ );
828
+ case REACT_LAZY_TYPE:
829
+ innerType = type._payload;
830
+ type = type._init;
831
+ try {
832
+ return getComponentNameFromType(type(innerType));
833
+ } catch (x) {}
834
+ }
835
+ return null;
836
+ }
837
+ function getTaskName(type) {
838
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
839
+ if (
840
+ "object" === typeof type &&
841
+ null !== type &&
842
+ type.$$typeof === REACT_LAZY_TYPE
843
+ )
844
+ return "<...>";
845
+ try {
846
+ var name = getComponentNameFromType(type);
847
+ return name ? "<" + name + ">" : "<...>";
848
+ } catch (x) {
849
+ return "<...>";
850
+ }
851
+ }
852
+ function getOwner() {
853
+ var dispatcher = ReactSharedInternals.A;
854
+ return null === dispatcher ? null : dispatcher.getOwner();
855
+ }
856
+ function UnknownOwner() {
857
+ return Error("react-stack-top-frame");
858
+ }
859
+ function hasValidKey(config) {
860
+ if (hasOwnProperty.call(config, "key")) {
861
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
862
+ if (getter && getter.isReactWarning) return false;
863
+ }
864
+ return void 0 !== config.key;
865
+ }
866
+ function defineKeyPropWarningGetter(props, displayName) {
867
+ function warnAboutAccessingKey() {
868
+ specialPropKeyWarningShown ||
869
+ ((specialPropKeyWarningShown = true),
870
+ console.error(
871
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
872
+ displayName
873
+ ));
874
+ }
875
+ warnAboutAccessingKey.isReactWarning = true;
876
+ Object.defineProperty(props, "key", {
877
+ get: warnAboutAccessingKey,
878
+ configurable: true
879
+ });
880
+ }
881
+ function elementRefGetterWithDeprecationWarning() {
882
+ var componentName = getComponentNameFromType(this.type);
883
+ didWarnAboutElementRef[componentName] ||
884
+ ((didWarnAboutElementRef[componentName] = true),
885
+ console.error(
886
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
887
+ ));
888
+ componentName = this.props.ref;
889
+ return void 0 !== componentName ? componentName : null;
890
+ }
891
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
892
+ var refProp = props.ref;
893
+ type = {
894
+ $$typeof: REACT_ELEMENT_TYPE,
895
+ type: type,
896
+ key: key,
897
+ props: props,
898
+ _owner: owner
899
+ };
900
+ null !== (void 0 !== refProp ? refProp : null)
901
+ ? Object.defineProperty(type, "ref", {
902
+ enumerable: false,
903
+ get: elementRefGetterWithDeprecationWarning
904
+ })
905
+ : Object.defineProperty(type, "ref", { enumerable: false, value: null });
906
+ type._store = {};
907
+ Object.defineProperty(type._store, "validated", {
908
+ configurable: false,
909
+ enumerable: false,
910
+ writable: true,
911
+ value: 0
912
+ });
913
+ Object.defineProperty(type, "_debugInfo", {
914
+ configurable: false,
915
+ enumerable: false,
916
+ writable: true,
917
+ value: null
918
+ });
919
+ Object.defineProperty(type, "_debugStack", {
920
+ configurable: false,
921
+ enumerable: false,
922
+ writable: true,
923
+ value: debugStack
924
+ });
925
+ Object.defineProperty(type, "_debugTask", {
926
+ configurable: false,
927
+ enumerable: false,
928
+ writable: true,
929
+ value: debugTask
930
+ });
931
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
932
+ return type;
933
+ }
934
+ function cloneAndReplaceKey(oldElement, newKey) {
935
+ newKey = ReactElement(
936
+ oldElement.type,
937
+ newKey,
938
+ oldElement.props,
939
+ oldElement._owner,
940
+ oldElement._debugStack,
941
+ oldElement._debugTask
942
+ );
943
+ oldElement._store &&
944
+ (newKey._store.validated = oldElement._store.validated);
945
+ return newKey;
946
+ }
947
+ function validateChildKeys(node) {
948
+ isValidElement(node)
949
+ ? node._store && (node._store.validated = 1)
950
+ : "object" === typeof node &&
951
+ null !== node &&
952
+ node.$$typeof === REACT_LAZY_TYPE &&
953
+ ("fulfilled" === node._payload.status
954
+ ? isValidElement(node._payload.value) &&
955
+ node._payload.value._store &&
956
+ (node._payload.value._store.validated = 1)
957
+ : node._store && (node._store.validated = 1));
958
+ }
959
+ function isValidElement(object) {
960
+ return (
961
+ "object" === typeof object &&
962
+ null !== object &&
963
+ object.$$typeof === REACT_ELEMENT_TYPE
964
+ );
965
+ }
966
+ function escape(key) {
967
+ var escaperLookup = { "=": "=0", ":": "=2" };
968
+ return (
969
+ "$" +
970
+ key.replace(/[=:]/g, function (match) {
971
+ return escaperLookup[match];
972
+ })
973
+ );
974
+ }
975
+ function getElementKey(element, index) {
976
+ return "object" === typeof element &&
977
+ null !== element &&
978
+ null != element.key
979
+ ? (checkKeyStringCoercion(element.key), escape("" + element.key))
980
+ : index.toString(36);
981
+ }
982
+ function resolveThenable(thenable) {
983
+ switch (thenable.status) {
984
+ case "fulfilled":
985
+ return thenable.value;
986
+ case "rejected":
987
+ throw thenable.reason;
988
+ default:
989
+ switch (
990
+ ("string" === typeof thenable.status
991
+ ? thenable.then(noop, noop)
992
+ : ((thenable.status = "pending"),
993
+ thenable.then(
994
+ function (fulfilledValue) {
995
+ "pending" === thenable.status &&
996
+ ((thenable.status = "fulfilled"),
997
+ (thenable.value = fulfilledValue));
998
+ },
999
+ function (error) {
1000
+ "pending" === thenable.status &&
1001
+ ((thenable.status = "rejected"),
1002
+ (thenable.reason = error));
1003
+ }
1004
+ )),
1005
+ thenable.status)
1006
+ ) {
1007
+ case "fulfilled":
1008
+ return thenable.value;
1009
+ case "rejected":
1010
+ throw thenable.reason;
1011
+ }
1012
+ }
1013
+ throw thenable;
1014
+ }
1015
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1016
+ var type = typeof children;
1017
+ if ("undefined" === type || "boolean" === type) children = null;
1018
+ var invokeCallback = false;
1019
+ if (null === children) invokeCallback = true;
1020
+ else
1021
+ switch (type) {
1022
+ case "bigint":
1023
+ case "string":
1024
+ case "number":
1025
+ invokeCallback = true;
1026
+ break;
1027
+ case "object":
1028
+ switch (children.$$typeof) {
1029
+ case REACT_ELEMENT_TYPE:
1030
+ case REACT_PORTAL_TYPE:
1031
+ invokeCallback = true;
1032
+ break;
1033
+ case REACT_LAZY_TYPE:
1034
+ return (
1035
+ (invokeCallback = children._init),
1036
+ mapIntoArray(
1037
+ invokeCallback(children._payload),
1038
+ array,
1039
+ escapedPrefix,
1040
+ nameSoFar,
1041
+ callback
1042
+ )
1043
+ );
1044
+ }
1045
+ }
1046
+ if (invokeCallback) {
1047
+ invokeCallback = children;
1048
+ callback = callback(invokeCallback);
1049
+ var childKey =
1050
+ "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
1051
+ isArrayImpl(callback)
1052
+ ? ((escapedPrefix = ""),
1053
+ null != childKey &&
1054
+ (escapedPrefix =
1055
+ childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
1056
+ mapIntoArray(callback, array, escapedPrefix, "", function (c) {
1057
+ return c;
1058
+ }))
1059
+ : null != callback &&
1060
+ (isValidElement(callback) &&
1061
+ (null != callback.key &&
1062
+ ((invokeCallback && invokeCallback.key === callback.key) ||
1063
+ checkKeyStringCoercion(callback.key)),
1064
+ (escapedPrefix = cloneAndReplaceKey(
1065
+ callback,
1066
+ escapedPrefix +
1067
+ (null == callback.key ||
1068
+ (invokeCallback && invokeCallback.key === callback.key)
1069
+ ? ""
1070
+ : ("" + callback.key).replace(
1071
+ userProvidedKeyEscapeRegex,
1072
+ "$&/"
1073
+ ) + "/") +
1074
+ childKey
1075
+ )),
1076
+ "" !== nameSoFar &&
1077
+ null != invokeCallback &&
1078
+ isValidElement(invokeCallback) &&
1079
+ null == invokeCallback.key &&
1080
+ invokeCallback._store &&
1081
+ !invokeCallback._store.validated &&
1082
+ (escapedPrefix._store.validated = 2),
1083
+ (callback = escapedPrefix)),
1084
+ array.push(callback));
1085
+ return 1;
1086
+ }
1087
+ invokeCallback = 0;
1088
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
1089
+ if (isArrayImpl(children))
1090
+ for (var i = 0; i < children.length; i++)
1091
+ (nameSoFar = children[i]),
1092
+ (type = childKey + getElementKey(nameSoFar, i)),
1093
+ (invokeCallback += mapIntoArray(
1094
+ nameSoFar,
1095
+ array,
1096
+ escapedPrefix,
1097
+ type,
1098
+ callback
1099
+ ));
1100
+ else if (((i = getIteratorFn(children)), "function" === typeof i))
1101
+ for (
1102
+ i === children.entries &&
1103
+ (didWarnAboutMaps ||
1104
+ console.warn(
1105
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
1106
+ ),
1107
+ (didWarnAboutMaps = true)),
1108
+ children = i.call(children),
1109
+ i = 0;
1110
+ !(nameSoFar = children.next()).done;
1111
+
1112
+ )
1113
+ (nameSoFar = nameSoFar.value),
1114
+ (type = childKey + getElementKey(nameSoFar, i++)),
1115
+ (invokeCallback += mapIntoArray(
1116
+ nameSoFar,
1117
+ array,
1118
+ escapedPrefix,
1119
+ type,
1120
+ callback
1121
+ ));
1122
+ else if ("object" === type) {
1123
+ if ("function" === typeof children.then)
1124
+ return mapIntoArray(
1125
+ resolveThenable(children),
1126
+ array,
1127
+ escapedPrefix,
1128
+ nameSoFar,
1129
+ callback
1130
+ );
1131
+ array = String(children);
1132
+ throw Error(
1133
+ "Objects are not valid as a React child (found: " +
1134
+ ("[object Object]" === array
1135
+ ? "object with keys {" + Object.keys(children).join(", ") + "}"
1136
+ : array) +
1137
+ "). If you meant to render a collection of children, use an array instead."
1138
+ );
1139
+ }
1140
+ return invokeCallback;
1141
+ }
1142
+ function mapChildren(children, func, context) {
1143
+ if (null == children) return children;
1144
+ var result = [],
1145
+ count = 0;
1146
+ mapIntoArray(children, result, "", "", function (child) {
1147
+ return func.call(context, child, count++);
1148
+ });
1149
+ return result;
1150
+ }
1151
+ function lazyInitializer(payload) {
1152
+ if (-1 === payload._status) {
1153
+ var ioInfo = payload._ioInfo;
1154
+ null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
1155
+ ioInfo = payload._result;
1156
+ var thenable = ioInfo();
1157
+ thenable.then(
1158
+ function (moduleObject) {
1159
+ if (0 === payload._status || -1 === payload._status) {
1160
+ payload._status = 1;
1161
+ payload._result = moduleObject;
1162
+ var _ioInfo = payload._ioInfo;
1163
+ null != _ioInfo && (_ioInfo.end = performance.now());
1164
+ void 0 === thenable.status &&
1165
+ ((thenable.status = "fulfilled"),
1166
+ (thenable.value = moduleObject));
1167
+ }
1168
+ },
1169
+ function (error) {
1170
+ if (0 === payload._status || -1 === payload._status) {
1171
+ payload._status = 2;
1172
+ payload._result = error;
1173
+ var _ioInfo2 = payload._ioInfo;
1174
+ null != _ioInfo2 && (_ioInfo2.end = performance.now());
1175
+ void 0 === thenable.status &&
1176
+ ((thenable.status = "rejected"), (thenable.reason = error));
1177
+ }
1178
+ }
1179
+ );
1180
+ ioInfo = payload._ioInfo;
1181
+ if (null != ioInfo) {
1182
+ ioInfo.value = thenable;
1183
+ var displayName = thenable.displayName;
1184
+ "string" === typeof displayName && (ioInfo.name = displayName);
1185
+ }
1186
+ -1 === payload._status &&
1187
+ ((payload._status = 0), (payload._result = thenable));
1188
+ }
1189
+ if (1 === payload._status)
1190
+ return (
1191
+ (ioInfo = payload._result),
1192
+ void 0 === ioInfo &&
1193
+ console.error(
1194
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
1195
+ ioInfo
1196
+ ),
1197
+ "default" in ioInfo ||
1198
+ console.error(
1199
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
1200
+ ioInfo
1201
+ ),
1202
+ ioInfo.default
1203
+ );
1204
+ throw payload._result;
1205
+ }
1206
+ function resolveDispatcher() {
1207
+ var dispatcher = ReactSharedInternals.H;
1208
+ null === dispatcher &&
1209
+ console.error(
1210
+ "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
1211
+ );
1212
+ return dispatcher;
1213
+ }
1214
+ function releaseAsyncTransition() {
1215
+ ReactSharedInternals.asyncTransitions--;
1216
+ }
1217
+ function enqueueTask(task) {
1218
+ if (null === enqueueTaskImpl)
1219
+ try {
1220
+ var requireString = ("require" + Math.random()).slice(0, 7);
1221
+ enqueueTaskImpl = (module && module[requireString]).call(
1222
+ module,
1223
+ "timers"
1224
+ ).setImmediate;
1225
+ } catch (_err) {
1226
+ enqueueTaskImpl = function (callback) {
1227
+ false === didWarnAboutMessageChannel &&
1228
+ ((didWarnAboutMessageChannel = true),
1229
+ "undefined" === typeof MessageChannel &&
1230
+ console.error(
1231
+ "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
1232
+ ));
1233
+ var channel = new MessageChannel();
1234
+ channel.port1.onmessage = callback;
1235
+ channel.port2.postMessage(void 0);
1236
+ };
1237
+ }
1238
+ return enqueueTaskImpl(task);
1239
+ }
1240
+ function aggregateErrors(errors) {
1241
+ return 1 < errors.length && "function" === typeof AggregateError
1242
+ ? new AggregateError(errors)
1243
+ : errors[0];
1244
+ }
1245
+ function popActScope(prevActQueue, prevActScopeDepth) {
1246
+ prevActScopeDepth !== actScopeDepth - 1 &&
1247
+ console.error(
1248
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
1249
+ );
1250
+ actScopeDepth = prevActScopeDepth;
1251
+ }
1252
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
1253
+ var queue = ReactSharedInternals.actQueue;
1254
+ if (null !== queue)
1255
+ if (0 !== queue.length)
1256
+ try {
1257
+ flushActQueue(queue);
1258
+ enqueueTask(function () {
1259
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
1260
+ });
1261
+ return;
1262
+ } catch (error) {
1263
+ ReactSharedInternals.thrownErrors.push(error);
1264
+ }
1265
+ else ReactSharedInternals.actQueue = null;
1266
+ 0 < ReactSharedInternals.thrownErrors.length
1267
+ ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)),
1268
+ (ReactSharedInternals.thrownErrors.length = 0),
1269
+ reject(queue))
1270
+ : resolve(returnValue);
1271
+ }
1272
+ function flushActQueue(queue) {
1273
+ if (!isFlushing) {
1274
+ isFlushing = true;
1275
+ var i = 0;
1276
+ try {
1277
+ for (; i < queue.length; i++) {
1278
+ var callback = queue[i];
1279
+ do {
1280
+ ReactSharedInternals.didUsePromise = !1;
1281
+ var continuation = callback(!1);
1282
+ if (null !== continuation) {
1283
+ if (ReactSharedInternals.didUsePromise) {
1284
+ queue[i] = callback;
1285
+ queue.splice(0, i);
1286
+ return;
1287
+ }
1288
+ callback = continuation;
1289
+ } else break;
1290
+ } while (1);
1291
+ }
1292
+ queue.length = 0;
1293
+ } catch (error) {
1294
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
1295
+ } finally {
1296
+ isFlushing = false;
1297
+ }
1298
+ }
1299
+ }
1300
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1301
+ "function" ===
1302
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
1303
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1304
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
1305
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
1306
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
1307
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
1308
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
1309
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
1310
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
1311
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
1312
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
1313
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
1314
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
1315
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
1316
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
1317
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
1318
+ didWarnStateUpdateForUnmountedComponent = {},
1319
+ ReactNoopUpdateQueue = {
1320
+ isMounted: function () {
1321
+ return false;
1322
+ },
1323
+ enqueueForceUpdate: function (publicInstance) {
1324
+ warnNoop(publicInstance, "forceUpdate");
1325
+ },
1326
+ enqueueReplaceState: function (publicInstance) {
1327
+ warnNoop(publicInstance, "replaceState");
1328
+ },
1329
+ enqueueSetState: function (publicInstance) {
1330
+ warnNoop(publicInstance, "setState");
1331
+ }
1332
+ },
1333
+ assign = Object.assign,
1334
+ emptyObject = {};
1335
+ Object.freeze(emptyObject);
1336
+ Component.prototype.isReactComponent = {};
1337
+ Component.prototype.setState = function (partialState, callback) {
1338
+ if (
1339
+ "object" !== typeof partialState &&
1340
+ "function" !== typeof partialState &&
1341
+ null != partialState
1342
+ )
1343
+ throw Error(
1344
+ "takes an object of state variables to update or a function which returns an object of state variables."
1345
+ );
1346
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
1347
+ };
1348
+ Component.prototype.forceUpdate = function (callback) {
1349
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
1350
+ };
1351
+ var deprecatedAPIs = {
1352
+ isMounted: [
1353
+ "isMounted",
1354
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
1355
+ ],
1356
+ replaceState: [
1357
+ "replaceState",
1358
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
1359
+ ]
1360
+ };
1361
+ for (fnName in deprecatedAPIs)
1362
+ deprecatedAPIs.hasOwnProperty(fnName) &&
1363
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1364
+ ComponentDummy.prototype = Component.prototype;
1365
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
1366
+ deprecatedAPIs.constructor = PureComponent;
1367
+ assign(deprecatedAPIs, Component.prototype);
1368
+ deprecatedAPIs.isPureReactComponent = true;
1369
+ var isArrayImpl = Array.isArray,
1370
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
1371
+ ReactSharedInternals = {
1372
+ H: null,
1373
+ A: null,
1374
+ T: null,
1375
+ S: null,
1376
+ actQueue: null,
1377
+ asyncTransitions: 0,
1378
+ isBatchingLegacy: false,
1379
+ didScheduleLegacyUpdate: false,
1380
+ didUsePromise: false,
1381
+ thrownErrors: [],
1382
+ getCurrentStack: null,
1383
+ recentlyCreatedOwnerStacks: 0
1384
+ },
1385
+ hasOwnProperty = Object.prototype.hasOwnProperty,
1386
+ createTask = console.createTask
1387
+ ? console.createTask
1388
+ : function () {
1389
+ return null;
1390
+ };
1391
+ deprecatedAPIs = {
1392
+ react_stack_bottom_frame: function (callStackForError) {
1393
+ return callStackForError();
1394
+ }
1395
+ };
1396
+ var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1397
+ var didWarnAboutElementRef = {};
1398
+ var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1399
+ deprecatedAPIs,
1400
+ UnknownOwner
1401
+ )();
1402
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1403
+ var didWarnAboutMaps = false,
1404
+ userProvidedKeyEscapeRegex = /\/+/g,
1405
+ reportGlobalError =
1406
+ "function" === typeof reportError
1407
+ ? reportError
1408
+ : function (error) {
1409
+ if (
1410
+ "object" === typeof window &&
1411
+ "function" === typeof window.ErrorEvent
1412
+ ) {
1413
+ var event = new window.ErrorEvent("error", {
1414
+ bubbles: true,
1415
+ cancelable: true,
1416
+ message:
1417
+ "object" === typeof error &&
1418
+ null !== error &&
1419
+ "string" === typeof error.message
1420
+ ? String(error.message)
1421
+ : String(error),
1422
+ error: error
1423
+ });
1424
+ if (!window.dispatchEvent(event)) return;
1425
+ } else if (
1426
+ "object" === typeof process &&
1427
+ "function" === typeof process.emit
1428
+ ) {
1429
+ process.emit("uncaughtException", error);
1430
+ return;
1431
+ }
1432
+ console.error(error);
1433
+ },
1434
+ didWarnAboutMessageChannel = false,
1435
+ enqueueTaskImpl = null,
1436
+ actScopeDepth = 0,
1437
+ didWarnNoAwaitAct = false,
1438
+ isFlushing = false,
1439
+ queueSeveralMicrotasks =
1440
+ "function" === typeof queueMicrotask
1441
+ ? function (callback) {
1442
+ queueMicrotask(function () {
1443
+ return queueMicrotask(callback);
1444
+ });
1445
+ }
1446
+ : enqueueTask;
1447
+ deprecatedAPIs = Object.freeze({
1448
+ __proto__: null,
1449
+ c: function (size) {
1450
+ return resolveDispatcher().useMemoCache(size);
1451
+ }
1452
+ });
1453
+ var fnName = {
1454
+ map: mapChildren,
1455
+ forEach: function (children, forEachFunc, forEachContext) {
1456
+ mapChildren(
1457
+ children,
1458
+ function () {
1459
+ forEachFunc.apply(this, arguments);
1460
+ },
1461
+ forEachContext
1462
+ );
1463
+ },
1464
+ count: function (children) {
1465
+ var n = 0;
1466
+ mapChildren(children, function () {
1467
+ n++;
1468
+ });
1469
+ return n;
1470
+ },
1471
+ toArray: function (children) {
1472
+ return (
1473
+ mapChildren(children, function (child) {
1474
+ return child;
1475
+ }) || []
1476
+ );
1477
+ },
1478
+ only: function (children) {
1479
+ if (!isValidElement(children))
1480
+ throw Error(
1481
+ "React.Children.only expected to receive a single React element child."
1482
+ );
1483
+ return children;
1484
+ }
1485
+ };
1486
+ exports.Activity = REACT_ACTIVITY_TYPE;
1487
+ exports.Children = fnName;
1488
+ exports.Component = Component;
1489
+ exports.Fragment = REACT_FRAGMENT_TYPE;
1490
+ exports.Profiler = REACT_PROFILER_TYPE;
1491
+ exports.PureComponent = PureComponent;
1492
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
1493
+ exports.Suspense = REACT_SUSPENSE_TYPE;
1494
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
1495
+ ReactSharedInternals;
1496
+ exports.__COMPILER_RUNTIME = deprecatedAPIs;
1497
+ exports.act = function (callback) {
1498
+ var prevActQueue = ReactSharedInternals.actQueue,
1499
+ prevActScopeDepth = actScopeDepth;
1500
+ actScopeDepth++;
1501
+ var queue = (ReactSharedInternals.actQueue =
1502
+ null !== prevActQueue ? prevActQueue : []),
1503
+ didAwaitActCall = false;
1504
+ try {
1505
+ var result = callback();
1506
+ } catch (error) {
1507
+ ReactSharedInternals.thrownErrors.push(error);
1508
+ }
1509
+ if (0 < ReactSharedInternals.thrownErrors.length)
1510
+ throw (
1511
+ (popActScope(prevActQueue, prevActScopeDepth),
1512
+ (callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1513
+ (ReactSharedInternals.thrownErrors.length = 0),
1514
+ callback)
1515
+ );
1516
+ if (
1517
+ null !== result &&
1518
+ "object" === typeof result &&
1519
+ "function" === typeof result.then
1520
+ ) {
1521
+ var thenable = result;
1522
+ queueSeveralMicrotasks(function () {
1523
+ didAwaitActCall ||
1524
+ didWarnNoAwaitAct ||
1525
+ ((didWarnNoAwaitAct = true),
1526
+ console.error(
1527
+ "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
1528
+ ));
1529
+ });
1530
+ return {
1531
+ then: function (resolve, reject) {
1532
+ didAwaitActCall = true;
1533
+ thenable.then(
1534
+ function (returnValue) {
1535
+ popActScope(prevActQueue, prevActScopeDepth);
1536
+ if (0 === prevActScopeDepth) {
1537
+ try {
1538
+ flushActQueue(queue),
1539
+ enqueueTask(function () {
1540
+ return recursivelyFlushAsyncActWork(
1541
+ returnValue,
1542
+ resolve,
1543
+ reject
1544
+ );
1545
+ });
1546
+ } catch (error$0) {
1547
+ ReactSharedInternals.thrownErrors.push(error$0);
1548
+ }
1549
+ if (0 < ReactSharedInternals.thrownErrors.length) {
1550
+ var _thrownError = aggregateErrors(
1551
+ ReactSharedInternals.thrownErrors
1552
+ );
1553
+ ReactSharedInternals.thrownErrors.length = 0;
1554
+ reject(_thrownError);
1555
+ }
1556
+ } else resolve(returnValue);
1557
+ },
1558
+ function (error) {
1559
+ popActScope(prevActQueue, prevActScopeDepth);
1560
+ 0 < ReactSharedInternals.thrownErrors.length
1561
+ ? ((error = aggregateErrors(
1562
+ ReactSharedInternals.thrownErrors
1563
+ )),
1564
+ (ReactSharedInternals.thrownErrors.length = 0),
1565
+ reject(error))
1566
+ : reject(error);
1567
+ }
1568
+ );
1569
+ }
1570
+ };
1571
+ }
1572
+ var returnValue$jscomp$0 = result;
1573
+ popActScope(prevActQueue, prevActScopeDepth);
1574
+ 0 === prevActScopeDepth &&
1575
+ (flushActQueue(queue),
1576
+ 0 !== queue.length &&
1577
+ queueSeveralMicrotasks(function () {
1578
+ didAwaitActCall ||
1579
+ didWarnNoAwaitAct ||
1580
+ ((didWarnNoAwaitAct = true),
1581
+ console.error(
1582
+ "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
1583
+ ));
1584
+ }),
1585
+ (ReactSharedInternals.actQueue = null));
1586
+ if (0 < ReactSharedInternals.thrownErrors.length)
1587
+ throw (
1588
+ ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1589
+ (ReactSharedInternals.thrownErrors.length = 0),
1590
+ callback)
1591
+ );
1592
+ return {
1593
+ then: function (resolve, reject) {
1594
+ didAwaitActCall = true;
1595
+ 0 === prevActScopeDepth
1596
+ ? ((ReactSharedInternals.actQueue = queue),
1597
+ enqueueTask(function () {
1598
+ return recursivelyFlushAsyncActWork(
1599
+ returnValue$jscomp$0,
1600
+ resolve,
1601
+ reject
1602
+ );
1603
+ }))
1604
+ : resolve(returnValue$jscomp$0);
1605
+ }
1606
+ };
1607
+ };
1608
+ exports.cache = function (fn) {
1609
+ return function () {
1610
+ return fn.apply(null, arguments);
1611
+ };
1612
+ };
1613
+ exports.cacheSignal = function () {
1614
+ return null;
1615
+ };
1616
+ exports.captureOwnerStack = function () {
1617
+ var getCurrentStack = ReactSharedInternals.getCurrentStack;
1618
+ return null === getCurrentStack ? null : getCurrentStack();
1619
+ };
1620
+ exports.cloneElement = function (element, config, children) {
1621
+ if (null === element || void 0 === element)
1622
+ throw Error(
1623
+ "The argument must be a React element, but you passed " +
1624
+ element +
1625
+ "."
1626
+ );
1627
+ var props = assign({}, element.props),
1628
+ key = element.key,
1629
+ owner = element._owner;
1630
+ if (null != config) {
1631
+ var JSCompiler_inline_result;
1632
+ a: {
1633
+ if (
1634
+ hasOwnProperty.call(config, "ref") &&
1635
+ (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1636
+ config,
1637
+ "ref"
1638
+ ).get) &&
1639
+ JSCompiler_inline_result.isReactWarning
1640
+ ) {
1641
+ JSCompiler_inline_result = false;
1642
+ break a;
1643
+ }
1644
+ JSCompiler_inline_result = void 0 !== config.ref;
1645
+ }
1646
+ JSCompiler_inline_result && (owner = getOwner());
1647
+ hasValidKey(config) &&
1648
+ (checkKeyStringCoercion(config.key), (key = "" + config.key));
1649
+ for (propName in config)
1650
+ !hasOwnProperty.call(config, propName) ||
1651
+ "key" === propName ||
1652
+ "__self" === propName ||
1653
+ "__source" === propName ||
1654
+ ("ref" === propName && void 0 === config.ref) ||
1655
+ (props[propName] = config[propName]);
1656
+ }
1657
+ var propName = arguments.length - 2;
1658
+ if (1 === propName) props.children = children;
1659
+ else if (1 < propName) {
1660
+ JSCompiler_inline_result = Array(propName);
1661
+ for (var i = 0; i < propName; i++)
1662
+ JSCompiler_inline_result[i] = arguments[i + 2];
1663
+ props.children = JSCompiler_inline_result;
1664
+ }
1665
+ props = ReactElement(
1666
+ element.type,
1667
+ key,
1668
+ props,
1669
+ owner,
1670
+ element._debugStack,
1671
+ element._debugTask
1672
+ );
1673
+ for (key = 2; key < arguments.length; key++)
1674
+ validateChildKeys(arguments[key]);
1675
+ return props;
1676
+ };
1677
+ exports.createContext = function (defaultValue) {
1678
+ defaultValue = {
1679
+ $$typeof: REACT_CONTEXT_TYPE,
1680
+ _currentValue: defaultValue,
1681
+ _currentValue2: defaultValue,
1682
+ _threadCount: 0,
1683
+ Provider: null,
1684
+ Consumer: null
1685
+ };
1686
+ defaultValue.Provider = defaultValue;
1687
+ defaultValue.Consumer = {
1688
+ $$typeof: REACT_CONSUMER_TYPE,
1689
+ _context: defaultValue
1690
+ };
1691
+ defaultValue._currentRenderer = null;
1692
+ defaultValue._currentRenderer2 = null;
1693
+ return defaultValue;
1694
+ };
1695
+ exports.createElement = function (type, config, children) {
1696
+ for (var i = 2; i < arguments.length; i++)
1697
+ validateChildKeys(arguments[i]);
1698
+ i = {};
1699
+ var key = null;
1700
+ if (null != config)
1701
+ for (propName in (didWarnAboutOldJSXRuntime ||
1702
+ !("__self" in config) ||
1703
+ "key" in config ||
1704
+ ((didWarnAboutOldJSXRuntime = true),
1705
+ console.warn(
1706
+ "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
1707
+ )),
1708
+ hasValidKey(config) &&
1709
+ (checkKeyStringCoercion(config.key), (key = "" + config.key)),
1710
+ config))
1711
+ hasOwnProperty.call(config, propName) &&
1712
+ "key" !== propName &&
1713
+ "__self" !== propName &&
1714
+ "__source" !== propName &&
1715
+ (i[propName] = config[propName]);
1716
+ var childrenLength = arguments.length - 2;
1717
+ if (1 === childrenLength) i.children = children;
1718
+ else if (1 < childrenLength) {
1719
+ for (
1720
+ var childArray = Array(childrenLength), _i = 0;
1721
+ _i < childrenLength;
1722
+ _i++
1723
+ )
1724
+ childArray[_i] = arguments[_i + 2];
1725
+ Object.freeze && Object.freeze(childArray);
1726
+ i.children = childArray;
1727
+ }
1728
+ if (type && type.defaultProps)
1729
+ for (propName in ((childrenLength = type.defaultProps), childrenLength))
1730
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1731
+ key &&
1732
+ defineKeyPropWarningGetter(
1733
+ i,
1734
+ "function" === typeof type
1735
+ ? type.displayName || type.name || "Unknown"
1736
+ : type
1737
+ );
1738
+ var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1739
+ return ReactElement(
1740
+ type,
1741
+ key,
1742
+ i,
1743
+ getOwner(),
1744
+ propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1745
+ propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1746
+ );
1747
+ };
1748
+ exports.createRef = function () {
1749
+ var refObject = { current: null };
1750
+ Object.seal(refObject);
1751
+ return refObject;
1752
+ };
1753
+ exports.forwardRef = function (render) {
1754
+ null != render && render.$$typeof === REACT_MEMO_TYPE
1755
+ ? console.error(
1756
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1757
+ )
1758
+ : "function" !== typeof render
1759
+ ? console.error(
1760
+ "forwardRef requires a render function but was given %s.",
1761
+ null === render ? "null" : typeof render
1762
+ )
1763
+ : 0 !== render.length &&
1764
+ 2 !== render.length &&
1765
+ console.error(
1766
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1767
+ 1 === render.length
1768
+ ? "Did you forget to use the ref parameter?"
1769
+ : "Any additional parameter will be undefined."
1770
+ );
1771
+ null != render &&
1772
+ null != render.defaultProps &&
1773
+ console.error(
1774
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1775
+ );
1776
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },
1777
+ ownName;
1778
+ Object.defineProperty(elementType, "displayName", {
1779
+ enumerable: false,
1780
+ configurable: true,
1781
+ get: function () {
1782
+ return ownName;
1783
+ },
1784
+ set: function (name) {
1785
+ ownName = name;
1786
+ render.name ||
1787
+ render.displayName ||
1788
+ (Object.defineProperty(render, "name", { value: name }),
1789
+ (render.displayName = name));
1790
+ }
1791
+ });
1792
+ return elementType;
1793
+ };
1794
+ exports.isValidElement = isValidElement;
1795
+ exports.lazy = function (ctor) {
1796
+ ctor = { _status: -1, _result: ctor };
1797
+ var lazyType = {
1798
+ $$typeof: REACT_LAZY_TYPE,
1799
+ _payload: ctor,
1800
+ _init: lazyInitializer
1801
+ },
1802
+ ioInfo = {
1803
+ name: "lazy",
1804
+ start: -1,
1805
+ end: -1,
1806
+ value: null,
1807
+ owner: null,
1808
+ debugStack: Error("react-stack-top-frame"),
1809
+ debugTask: console.createTask ? console.createTask("lazy()") : null
1810
+ };
1811
+ ctor._ioInfo = ioInfo;
1812
+ lazyType._debugInfo = [{ awaited: ioInfo }];
1813
+ return lazyType;
1814
+ };
1815
+ exports.memo = function (type, compare) {
1816
+ null == type &&
1817
+ console.error(
1818
+ "memo: The first argument must be a component. Instead received: %s",
1819
+ null === type ? "null" : typeof type
1820
+ );
1821
+ compare = {
1822
+ $$typeof: REACT_MEMO_TYPE,
1823
+ type: type,
1824
+ compare: void 0 === compare ? null : compare
1825
+ };
1826
+ var ownName;
1827
+ Object.defineProperty(compare, "displayName", {
1828
+ enumerable: false,
1829
+ configurable: true,
1830
+ get: function () {
1831
+ return ownName;
1832
+ },
1833
+ set: function (name) {
1834
+ ownName = name;
1835
+ type.name ||
1836
+ type.displayName ||
1837
+ (Object.defineProperty(type, "name", { value: name }),
1838
+ (type.displayName = name));
1839
+ }
1840
+ });
1841
+ return compare;
1842
+ };
1843
+ exports.startTransition = function (scope) {
1844
+ var prevTransition = ReactSharedInternals.T,
1845
+ currentTransition = {};
1846
+ currentTransition._updatedFibers = new Set();
1847
+ ReactSharedInternals.T = currentTransition;
1848
+ try {
1849
+ var returnValue = scope(),
1850
+ onStartTransitionFinish = ReactSharedInternals.S;
1851
+ null !== onStartTransitionFinish &&
1852
+ onStartTransitionFinish(currentTransition, returnValue);
1853
+ "object" === typeof returnValue &&
1854
+ null !== returnValue &&
1855
+ "function" === typeof returnValue.then &&
1856
+ (ReactSharedInternals.asyncTransitions++,
1857
+ returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
1858
+ returnValue.then(noop, reportGlobalError));
1859
+ } catch (error) {
1860
+ reportGlobalError(error);
1861
+ } finally {
1862
+ null === prevTransition &&
1863
+ currentTransition._updatedFibers &&
1864
+ ((scope = currentTransition._updatedFibers.size),
1865
+ currentTransition._updatedFibers.clear(),
1866
+ 10 < scope &&
1867
+ console.warn(
1868
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
1869
+ )),
1870
+ null !== prevTransition &&
1871
+ null !== currentTransition.types &&
1872
+ (null !== prevTransition.types &&
1873
+ prevTransition.types !== currentTransition.types &&
1874
+ console.error(
1875
+ "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
1876
+ ),
1877
+ (prevTransition.types = currentTransition.types)),
1878
+ (ReactSharedInternals.T = prevTransition);
1879
+ }
1880
+ };
1881
+ exports.unstable_useCacheRefresh = function () {
1882
+ return resolveDispatcher().useCacheRefresh();
1883
+ };
1884
+ exports.use = function (usable) {
1885
+ return resolveDispatcher().use(usable);
1886
+ };
1887
+ exports.useActionState = function (action, initialState, permalink) {
1888
+ return resolveDispatcher().useActionState(
1889
+ action,
1890
+ initialState,
1891
+ permalink
1892
+ );
1893
+ };
1894
+ exports.useCallback = function (callback, deps) {
1895
+ return resolveDispatcher().useCallback(callback, deps);
1896
+ };
1897
+ exports.useContext = function (Context) {
1898
+ var dispatcher = resolveDispatcher();
1899
+ Context.$$typeof === REACT_CONSUMER_TYPE &&
1900
+ console.error(
1901
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1902
+ );
1903
+ return dispatcher.useContext(Context);
1904
+ };
1905
+ exports.useDebugValue = function (value, formatterFn) {
1906
+ return resolveDispatcher().useDebugValue(value, formatterFn);
1907
+ };
1908
+ exports.useDeferredValue = function (value, initialValue) {
1909
+ return resolveDispatcher().useDeferredValue(value, initialValue);
1910
+ };
1911
+ exports.useEffect = function (create, deps) {
1912
+ null == create &&
1913
+ console.warn(
1914
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1915
+ );
1916
+ return resolveDispatcher().useEffect(create, deps);
1917
+ };
1918
+ exports.useEffectEvent = function (callback) {
1919
+ return resolveDispatcher().useEffectEvent(callback);
1920
+ };
1921
+ exports.useId = function () {
1922
+ return resolveDispatcher().useId();
1923
+ };
1924
+ exports.useImperativeHandle = function (ref, create, deps) {
1925
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
1926
+ };
1927
+ exports.useInsertionEffect = function (create, deps) {
1928
+ null == create &&
1929
+ console.warn(
1930
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1931
+ );
1932
+ return resolveDispatcher().useInsertionEffect(create, deps);
1933
+ };
1934
+ exports.useLayoutEffect = function (create, deps) {
1935
+ null == create &&
1936
+ console.warn(
1937
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1938
+ );
1939
+ return resolveDispatcher().useLayoutEffect(create, deps);
1940
+ };
1941
+ exports.useMemo = function (create, deps) {
1942
+ return resolveDispatcher().useMemo(create, deps);
1943
+ };
1944
+ exports.useOptimistic = function (passthrough, reducer) {
1945
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
1946
+ };
1947
+ exports.useReducer = function (reducer, initialArg, init) {
1948
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
1949
+ };
1950
+ exports.useRef = function (initialValue) {
1951
+ return resolveDispatcher().useRef(initialValue);
1952
+ };
1953
+ exports.useState = function (initialState) {
1954
+ return resolveDispatcher().useState(initialState);
1955
+ };
1956
+ exports.useSyncExternalStore = function (
1957
+ subscribe,
1958
+ getSnapshot,
1959
+ getServerSnapshot
1960
+ ) {
1961
+ return resolveDispatcher().useSyncExternalStore(
1962
+ subscribe,
1963
+ getSnapshot,
1964
+ getServerSnapshot
1965
+ );
1966
+ };
1967
+ exports.useTransition = function () {
1968
+ return resolveDispatcher().useTransition();
1969
+ };
1970
+ exports.version = "19.2.0";
1971
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1972
+ "function" ===
1973
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
1974
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1975
+ })();
1976
+ } (react_development, react_development.exports));
1977
+ return react_development.exports;
1978
+ }
1979
+
1980
+ var hasRequiredReact;
1981
+
1982
+ function requireReact () {
1983
+ if (hasRequiredReact) return react.exports;
1984
+ hasRequiredReact = 1;
1985
+
1986
+ if (process.env.NODE_ENV === 'production') {
1987
+ react.exports = requireReact_production();
1988
+ } else {
1989
+ react.exports = requireReact_development();
1990
+ }
1991
+ return react.exports;
1992
+ }
1993
+
1994
+ var reactExports = requireReact();
1995
+
1996
+ /**
1997
+ * React Hook: handles <input type="file" onChange> with validation + scanning.
1998
+ */
1999
+ function useFileScanner() {
2000
+ const [results, setResults] = reactExports.useState([]);
2001
+ const [errors, setErrors] = reactExports.useState([]);
2002
+ const onChange = reactExports.useCallback(async (e) => {
2003
+ const fileList = Array.from(e.target.files || []);
2004
+ const good = [];
2005
+ const bad = [];
2006
+ for (const file of fileList) {
2007
+ const { valid, error } = validateFile(file);
2008
+ if (valid)
2009
+ good.push(file);
2010
+ else
2011
+ bad.push({ file, error: error });
2012
+ }
2013
+ setErrors(bad);
2014
+ if (good.length) {
2015
+ const scanned = await scanFiles(good);
2016
+ setResults(scanned.map((r, i) => ({ file: good[i], report: r })));
2017
+ }
2018
+ else {
2019
+ setResults([]);
2020
+ }
2021
+ }, []);
2022
+ return { results, errors, onChange };
2023
+ }
2024
+
2025
+ async function createRemoteEngine(opts) {
2026
+ const { endpoint, headers = {}, rulesField = 'rules', fileField = 'file', mode = 'multipart', rulesAsBase64 = false, } = opts;
2027
+ const engine = {
2028
+ async compile(rulesSource) {
2029
+ return {
2030
+ async scan(data) {
2031
+ const fetchFn = globalThis.fetch;
2032
+ if (!fetchFn)
2033
+ throw new Error('[remote-yara] fetch non disponibile in questo ambiente');
2034
+ let res;
2035
+ if (mode === 'multipart') {
2036
+ const FormDataCtor = globalThis.FormData;
2037
+ const BlobCtor = globalThis.Blob;
2038
+ if (!FormDataCtor || !BlobCtor) {
2039
+ throw new Error('[remote-yara] FormData/Blob non disponibili (usa json-base64 oppure esegui in browser)');
2040
+ }
2041
+ const form = new FormDataCtor();
2042
+ form.set(rulesField, new BlobCtor([rulesSource], { type: 'text/plain' }), 'rules.yar');
2043
+ form.set(fileField, new BlobCtor([data], { type: 'application/octet-stream' }), 'sample.bin');
2044
+ res = await fetchFn(endpoint, { method: 'POST', body: form, headers });
2045
+ }
2046
+ else {
2047
+ const b64 = base64FromBytes(data);
2048
+ const payload = { [fileField]: b64 };
2049
+ if (rulesAsBase64) {
2050
+ payload['rulesB64'] = base64FromString(rulesSource);
2051
+ }
2052
+ else {
2053
+ payload[rulesField] = rulesSource;
2054
+ }
2055
+ res = await fetchFn(endpoint, {
2056
+ method: 'POST',
2057
+ headers: { 'Content-Type': 'application/json', ...headers },
2058
+ body: JSON.stringify(payload),
2059
+ });
2060
+ }
2061
+ if (!res.ok) {
2062
+ throw new Error(`[remote-yara] HTTP ${res.status} ${res.statusText}`);
2063
+ }
2064
+ const json = await res.json().catch(() => null);
2065
+ const arr = Array.isArray(json) ? json : (json?.matches ?? []);
2066
+ return (arr ?? []).map((m) => ({
2067
+ rule: m.rule ?? m.ruleIdentifier ?? 'unknown',
2068
+ tags: m.tags ?? [],
2069
+ }));
2070
+ },
2071
+ };
2072
+ },
2073
+ };
2074
+ return engine;
2075
+ }
2076
+ // Helpers
2077
+ function base64FromBytes(bytes) {
2078
+ // usa btoa se disponibile (browser); altrimenti fallback manuale
2079
+ const btoaFn = globalThis.btoa;
2080
+ let bin = '';
2081
+ for (let i = 0; i < bytes.byteLength; i++)
2082
+ bin += String.fromCharCode(bytes[i]);
2083
+ return btoaFn ? btoaFn(bin) : Buffer.from(bin, 'binary').toString('base64');
2084
+ }
2085
+ function base64FromString(s) {
2086
+ const btoaFn = globalThis.btoa;
2087
+ return btoaFn ? btoaFn(s) : Buffer.from(s, 'utf8').toString('base64');
2088
+ }
2089
+
2090
+ // src/scan/remote.ts
2091
+ /**
2092
+ * Scansiona una lista di File nel browser usando il motore remoto via HTTP.
2093
+ * Non richiede WASM né dipendenze native sul client.
2094
+ */
2095
+ async function scanFilesWithRemoteYara(files, rulesSource, remote) {
2096
+ const engine = await createRemoteEngine(remote);
2097
+ const compiled = await engine.compile(rulesSource);
2098
+ const results = [];
2099
+ for (const file of files) {
2100
+ try {
2101
+ const bytes = new Uint8Array(await file.arrayBuffer());
2102
+ const matches = await compiled.scan(bytes);
2103
+ results.push({ file, matches });
2104
+ }
2105
+ catch (err) {
2106
+ console.warn('[remote-yara] scan error for', file.name, err);
2107
+ results.push({ file, matches: [], error: String(err?.message ?? err) });
2108
+ }
2109
+ }
2110
+ return results;
2111
+ }
2112
+
2113
+ function mapMatchesToVerdict(matches = []) {
2114
+ if (!matches.length)
2115
+ return 'clean';
2116
+ const malHints = ['trojan', 'ransom', 'worm', 'spy', 'rootkit', 'keylog', 'botnet'];
2117
+ const tagSet = new Set(matches.flatMap(m => (m.tags ?? []).map(t => t.toLowerCase())));
2118
+ const nameHit = (r) => malHints.some(h => r.toLowerCase().includes(h));
2119
+ const isMal = matches.some(m => nameHit(m.rule)) || tagSet.has('malware') || tagSet.has('critical');
2120
+ return isMal ? 'malicious' : 'suspicious';
2121
+ }
2122
+
2123
+ function hasAsciiToken(buf, token) {
2124
+ // Use latin1 so we can safely search binary
2125
+ return buf.indexOf(token, 0, 'latin1') !== -1;
2126
+ }
2127
+ function startsWith(buf, bytes) {
2128
+ if (buf.length < bytes.length)
2129
+ return false;
2130
+ for (let i = 0; i < bytes.length; i++)
2131
+ if (buf[i] !== bytes[i])
2132
+ return false;
2133
+ return true;
2134
+ }
2135
+ function isPDF(buf) {
2136
+ // %PDF-
2137
+ return startsWith(buf, [0x25, 0x50, 0x44, 0x46, 0x2d]);
2138
+ }
2139
+ function isOleCfb(buf) {
2140
+ // D0 CF 11 E0 A1 B1 1A E1
2141
+ const sig = [0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1];
2142
+ return startsWith(buf, sig);
2143
+ }
2144
+ function isZipLike$1(buf) {
2145
+ // PK\x03\x04
2146
+ return startsWith(buf, [0x50, 0x4b, 0x03, 0x04]);
2147
+ }
2148
+ function isPeExecutable(buf) {
2149
+ // "MZ"
2150
+ return startsWith(buf, [0x4d, 0x5a]);
2151
+ }
2152
+ /** OOXML macro hint via filename token in ZIP container */
2153
+ function hasOoxmlMacros(buf) {
2154
+ if (!isZipLike$1(buf))
2155
+ return false;
2156
+ return hasAsciiToken(buf, 'vbaProject.bin');
2157
+ }
2158
+ /** PDF risky features (/JavaScript, /OpenAction, /AA, /Launch) */
2159
+ function pdfRiskTokens(buf) {
2160
+ const tokens = ['/JavaScript', '/OpenAction', '/AA', '/Launch'];
2161
+ return tokens.filter(t => hasAsciiToken(buf, t));
2162
+ }
2163
+ const CommonHeuristicsScanner = {
2164
+ async scan(input) {
2165
+ const buf = Buffer.from(input);
2166
+ const matches = [];
2167
+ // Office macros (OLE / OOXML)
2168
+ if (isOleCfb(buf)) {
2169
+ matches.push({ rule: 'office_ole_container', severity: 'suspicious' });
2170
+ }
2171
+ if (hasOoxmlMacros(buf)) {
2172
+ matches.push({ rule: 'office_ooxml_macros', severity: 'suspicious' });
2173
+ }
2174
+ // PDF risky tokens
2175
+ if (isPDF(buf)) {
2176
+ const toks = pdfRiskTokens(buf);
2177
+ if (toks.length) {
2178
+ matches.push({
2179
+ rule: 'pdf_risky_actions',
2180
+ severity: 'suspicious',
2181
+ meta: { tokens: toks }
2182
+ });
2183
+ }
2184
+ }
2185
+ // Executable header
2186
+ if (isPeExecutable(buf)) {
2187
+ matches.push({ rule: 'pe_executable_signature', severity: 'suspicious' });
2188
+ }
2189
+ return matches;
2190
+ }
2191
+ };
2192
+
2193
+ const SIG_CEN = 0x02014b50;
2194
+ const DEFAULTS = {
2195
+ maxEntries: 1000,
2196
+ maxTotalUncompressedBytes: 500 * 1024 * 1024,
2197
+ maxEntryNameLength: 255,
2198
+ maxCompressionRatio: 1000,
2199
+ eocdSearchWindow: 70000,
2200
+ };
2201
+ function r16(buf, off) {
2202
+ return buf.readUInt16LE(off);
2203
+ }
2204
+ function r32(buf, off) {
2205
+ return buf.readUInt32LE(off);
2206
+ }
2207
+ function isZipLike(buf) {
2208
+ // local file header at start is common
2209
+ return buf.length >= 4 && buf[0] === 0x50 && buf[1] === 0x4b && buf[2] === 0x03 && buf[3] === 0x04;
2210
+ }
2211
+ function lastIndexOfEOCD(buf, window) {
2212
+ const sig = Buffer.from([0x50, 0x4b, 0x05, 0x06]);
2213
+ const start = Math.max(0, buf.length - window);
2214
+ const idx = buf.lastIndexOf(sig, Math.min(buf.length - sig.length, buf.length - 1));
2215
+ return idx >= start ? idx : -1;
2216
+ }
2217
+ function hasTraversal(name) {
2218
+ return name.includes('../') || name.includes('..\\') || name.startsWith('/') || /^[A-Za-z]:/.test(name);
2219
+ }
2220
+ function createZipBombGuard(opts = {}) {
2221
+ const cfg = { ...DEFAULTS, ...opts };
2222
+ return {
2223
+ async scan(input) {
2224
+ const buf = Buffer.from(input);
2225
+ const matches = [];
2226
+ if (!isZipLike(buf))
2227
+ return matches;
2228
+ // Find EOCD near the end
2229
+ const eocdPos = lastIndexOfEOCD(buf, cfg.eocdSearchWindow);
2230
+ if (eocdPos < 0 || eocdPos + 22 > buf.length) {
2231
+ // ZIP but no EOCD — malformed or polyglot → suspicious
2232
+ matches.push({ rule: 'zip_eocd_not_found', severity: 'medium' });
2233
+ return matches;
2234
+ }
2235
+ const totalEntries = r16(buf, eocdPos + 10);
2236
+ const cdSize = r32(buf, eocdPos + 12);
2237
+ const cdOffset = r32(buf, eocdPos + 16);
2238
+ // Bounds check
2239
+ if (cdOffset + cdSize > buf.length) {
2240
+ matches.push({ rule: 'zip_cd_out_of_bounds', severity: 'medium' });
2241
+ return matches;
2242
+ }
2243
+ // Iterate central directory entries
2244
+ let ptr = cdOffset;
2245
+ let seen = 0;
2246
+ let sumComp = 0;
2247
+ let sumUnc = 0;
2248
+ while (ptr + 46 <= cdOffset + cdSize && seen < totalEntries) {
2249
+ const sig = r32(buf, ptr);
2250
+ if (sig !== SIG_CEN)
2251
+ break; // stop if structure breaks
2252
+ const compSize = r32(buf, ptr + 20);
2253
+ const uncSize = r32(buf, ptr + 24);
2254
+ const fnLen = r16(buf, ptr + 28);
2255
+ const exLen = r16(buf, ptr + 30);
2256
+ const cmLen = r16(buf, ptr + 32);
2257
+ const nameStart = ptr + 46;
2258
+ const nameEnd = nameStart + fnLen;
2259
+ if (nameEnd > buf.length)
2260
+ break;
2261
+ const name = buf.toString('utf8', nameStart, nameEnd);
2262
+ sumComp += compSize;
2263
+ sumUnc += uncSize;
2264
+ seen++;
2265
+ if (name.length > cfg.maxEntryNameLength) {
2266
+ matches.push({ rule: 'zip_entry_name_too_long', severity: 'medium', meta: { name, length: name.length } });
2267
+ }
2268
+ if (hasTraversal(name)) {
2269
+ matches.push({ rule: 'zip_path_traversal_entry', severity: 'medium', meta: { name } });
2270
+ }
2271
+ // move to next entry
2272
+ ptr = nameEnd + exLen + cmLen;
2273
+ }
2274
+ if (seen !== totalEntries) {
2275
+ // central dir truncated/odd, still report what we found
2276
+ matches.push({ rule: 'zip_cd_truncated', severity: 'medium', meta: { seen, totalEntries } });
2277
+ }
2278
+ // Heuristics thresholds
2279
+ if (seen > cfg.maxEntries) {
2280
+ matches.push({ rule: 'zip_too_many_entries', severity: 'medium', meta: { seen, limit: cfg.maxEntries } });
2281
+ }
2282
+ if (sumUnc > cfg.maxTotalUncompressedBytes) {
2283
+ matches.push({
2284
+ rule: 'zip_total_uncompressed_too_large',
2285
+ severity: 'medium',
2286
+ meta: { totalUncompressed: sumUnc, limit: cfg.maxTotalUncompressedBytes }
2287
+ });
2288
+ }
2289
+ if (sumComp === 0 && sumUnc > 0) {
2290
+ matches.push({ rule: 'zip_suspicious_ratio', severity: 'medium', meta: { ratio: Infinity } });
2291
+ }
2292
+ else if (sumComp > 0) {
2293
+ const ratio = sumUnc / Math.max(1, sumComp);
2294
+ if (ratio >= cfg.maxCompressionRatio) {
2295
+ matches.push({ rule: 'zip_suspicious_ratio', severity: 'medium', meta: { ratio, limit: cfg.maxCompressionRatio } });
2296
+ }
2297
+ }
2298
+ return matches;
2299
+ }
2300
+ };
2301
+ }
2302
+
2303
+ const MB = 1024 * 1024;
2304
+ const DEFAULT_POLICY = {
2305
+ includeExtensions: ['zip', 'png', 'jpg', 'jpeg', 'pdf'],
2306
+ allowedMimeTypes: ['application/zip', 'image/png', 'image/jpeg', 'application/pdf', 'text/plain'],
2307
+ maxFileSizeBytes: 20 * MB,
2308
+ timeoutMs: 5000,
2309
+ concurrency: 4,
2310
+ failClosed: true
2311
+ };
2312
+ function definePolicy(input = {}) {
2313
+ const p = { ...DEFAULT_POLICY, ...input };
2314
+ if (!Array.isArray(p.includeExtensions))
2315
+ throw new TypeError('includeExtensions must be string[]');
2316
+ if (!Array.isArray(p.allowedMimeTypes))
2317
+ throw new TypeError('allowedMimeTypes must be string[]');
2318
+ if (!(Number.isFinite(p.maxFileSizeBytes) && p.maxFileSizeBytes > 0))
2319
+ throw new TypeError('maxFileSizeBytes must be > 0');
2320
+ if (!(Number.isFinite(p.timeoutMs) && p.timeoutMs > 0))
2321
+ throw new TypeError('timeoutMs must be > 0');
2322
+ if (!(Number.isInteger(p.concurrency) && p.concurrency > 0))
2323
+ throw new TypeError('concurrency must be > 0');
2324
+ return p;
2325
+ }
2326
+
2327
+ exports.CommonHeuristicsScanner = CommonHeuristicsScanner;
2328
+ exports.DEFAULT_POLICY = DEFAULT_POLICY;
2329
+ exports.composeScanners = composeScanners;
2330
+ exports.createPresetScanner = createPresetScanner;
2331
+ exports.createZipBombGuard = createZipBombGuard;
2332
+ exports.definePolicy = definePolicy;
2333
+ exports.mapMatchesToVerdict = mapMatchesToVerdict;
2334
+ exports.scanBytes = scanBytes;
2335
+ exports.scanFile = scanFile;
2336
+ exports.scanFiles = scanFiles;
2337
+ exports.scanFilesWithRemoteYara = scanFilesWithRemoteYara;
2338
+ exports.useFileScanner = useFileScanner;
2339
+ exports.validateFile = validateFile;
2340
+ //# sourceMappingURL=pompelmi.cjs.map