@qidcloud/sdk 1.1.0 → 1.2.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.
package/dist/index.js CHANGED
@@ -1,5 +1,2249 @@
1
- import { QidCloud } from './QidCloud';
2
- import UnifiedStorage from './storage';
3
- import * as PQC from './crypto/pqc';
4
- export { QidCloud, QidCloud as PQAuth, UnifiedStorage, PQC };
5
- export default QidCloud;
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var axios = require('axios');
6
+ var socket_ioClient = require('socket.io-client');
7
+
8
+ class AuthModule {
9
+ sdk;
10
+ socket = null;
11
+ constructor(sdk) {
12
+ this.sdk = sdk;
13
+ }
14
+ /**
15
+ * Initialize a new handshake session for QR login
16
+ */
17
+ async createSession() {
18
+ const resp = await this.sdk.api.post('/api/initiate-generic');
19
+ const { sessionId, nonce } = resp.data;
20
+ // Construct QR data
21
+ const qrData = `qid: handshake:${sessionId}:${nonce} `;
22
+ return {
23
+ sessionId,
24
+ qrData,
25
+ expiresAt: Date.now() + 120000 // 2 minutes
26
+ };
27
+ }
28
+ /**
29
+ * Listen for authorization events for a specific session
30
+ */
31
+ listen(sessionId, onAuthorized, onDenied) {
32
+ if (!this.socket) {
33
+ const baseUrl = this.sdk.getConfig().baseUrl || 'https://api.qidcloud.com';
34
+ this.socket = socket_ioClient.io(baseUrl);
35
+ }
36
+ this.socket.emit('join', sessionId);
37
+ this.socket.on('authenticated', (token) => {
38
+ onAuthorized(token);
39
+ });
40
+ this.socket.on('identity_authorized', (data) => {
41
+ // Some backend routes wrap the token in an object
42
+ const token = typeof data === 'string' ? data : data.token;
43
+ onAuthorized(token);
44
+ });
45
+ this.socket.on('identity_denied', (data) => {
46
+ if (onDenied)
47
+ onDenied(data.message || 'Authorization denied');
48
+ });
49
+ }
50
+ /**
51
+ * Stop listening and disconnect socket
52
+ */
53
+ disconnect() {
54
+ if (this.socket) {
55
+ this.socket.disconnect();
56
+ this.socket = null;
57
+ }
58
+ }
59
+ /**
60
+ * Fetch user profile using a session token
61
+ */
62
+ async getProfile(token) {
63
+ const resp = await this.sdk.api.get('/api/me', {
64
+ headers: {
65
+ 'Authorization': `Bearer ${token}`
66
+ }
67
+ });
68
+ return resp.data;
69
+ }
70
+ }
71
+
72
+ class DbModule {
73
+ sdk;
74
+ constructor(sdk) {
75
+ this.sdk = sdk;
76
+ }
77
+ /**
78
+ * Execute a SQL query against the project's enclave database
79
+ * @param sql The SQL query string
80
+ * @param params Parameterized values for the query
81
+ * @param userToken Optional session token for user-scoped access
82
+ */
83
+ async query(sql, params = [], userToken) {
84
+ const headers = {};
85
+ if (userToken) {
86
+ headers['Authorization'] = `Bearer ${userToken}`;
87
+ }
88
+ const resp = await this.sdk.api.post('/api/db/query', { sql, params }, { headers });
89
+ return resp.data;
90
+ }
91
+ /**
92
+ * Initialize the project's enclave database schema
93
+ * Useful for first-time project setup
94
+ */
95
+ async setup(userToken) {
96
+ const headers = {};
97
+ if (userToken) {
98
+ headers['Authorization'] = `Bearer ${userToken}`;
99
+ }
100
+ const resp = await this.sdk.api.post('/api/db/setup', {}, { headers });
101
+ return resp.data;
102
+ }
103
+ }
104
+
105
+ class EdgeModule {
106
+ sdk;
107
+ constructor(sdk) {
108
+ this.sdk = sdk;
109
+ }
110
+ /**
111
+ * Invoke a serverless edge function
112
+ * @param name Name of the function to invoke
113
+ * @param params Arguments passed to the function
114
+ * @param userToken Optional session token for user-scoped access
115
+ */
116
+ async invoke(name, params = {}, userToken) {
117
+ const headers = {};
118
+ if (userToken) {
119
+ headers['Authorization'] = `Bearer ${userToken}`;
120
+ }
121
+ const resp = await this.sdk.api.post('/api/edge/invoke', { name, params }, { headers });
122
+ return resp.data;
123
+ }
124
+ /**
125
+ * List all functions in the project enclave
126
+ */
127
+ async list() {
128
+ const resp = await this.sdk.api.get('/api/edge/list');
129
+ return resp.data;
130
+ }
131
+ /**
132
+ * Get logs for a specific function
133
+ * @param name Function name
134
+ * @param userToken Optional session token
135
+ */
136
+ async getLogs(name, userToken) {
137
+ const headers = {};
138
+ if (userToken)
139
+ headers['Authorization'] = `Bearer ${userToken}`;
140
+ const resp = await this.sdk.api.get(`/api/edge/${name}/logs`, { headers });
141
+ return resp.data;
142
+ }
143
+ /**
144
+ * Get project-wide enclave logs
145
+ */
146
+ async getProjectLogs(userToken) {
147
+ const headers = {};
148
+ if (userToken)
149
+ headers['Authorization'] = `Bearer ${userToken}`;
150
+ const resp = await this.sdk.api.get('/api/edge/logs/project', { headers });
151
+ return resp.data;
152
+ }
153
+ /**
154
+ * Delete a function from the enclave
155
+ */
156
+ async delete(name, userToken) {
157
+ const headers = {};
158
+ if (userToken)
159
+ headers['Authorization'] = `Bearer ${userToken}`;
160
+ const resp = await this.sdk.api.delete(`/api/edge/${name}`, { headers });
161
+ return resp.data;
162
+ }
163
+ }
164
+
165
+ class VaultModule {
166
+ sdk;
167
+ constructor(sdk) {
168
+ this.sdk = sdk;
169
+ }
170
+ /**
171
+ * Upload a file to the project's secure enclave storage
172
+ * @param file The file data (Buffer or Blob)
173
+ * @param fileName Name of the file
174
+ * @param metadata Optional E2EE metadata or custom tags
175
+ * @param userToken Session token for user-scoped storage
176
+ */
177
+ async upload(file, fileName, metadata = {}, userToken) {
178
+ const formData = new FormData();
179
+ formData.append('file', file, fileName);
180
+ formData.append('metadata', JSON.stringify(metadata));
181
+ const headers = {
182
+ 'Content-Type': 'multipart/form-data'
183
+ };
184
+ if (userToken) {
185
+ headers['Authorization'] = `Bearer ${userToken}`;
186
+ }
187
+ const resp = await this.sdk.api.post('/api/storage/upload', formData, { headers });
188
+ return resp.data;
189
+ }
190
+ /**
191
+ * List files in the project enclave
192
+ * @param userToken Session token for user-scoped storage
193
+ */
194
+ async list(userToken) {
195
+ const headers = {};
196
+ if (userToken) {
197
+ headers['Authorization'] = `Bearer ${userToken}`;
198
+ }
199
+ const resp = await this.sdk.api.get('/api/storage/list', { headers });
200
+ return resp.data;
201
+ }
202
+ /**
203
+ * Download a file from storage
204
+ * @param fileId Unique ID of the file
205
+ * @param userToken Session token for user-scoped storage
206
+ */
207
+ async download(fileId, userToken) {
208
+ const headers = {};
209
+ if (userToken) {
210
+ headers['Authorization'] = `Bearer ${userToken}`;
211
+ }
212
+ const resp = await this.sdk.api.get(`/api/storage/${fileId}`, {
213
+ headers,
214
+ responseType: 'arraybuffer'
215
+ });
216
+ return resp.data;
217
+ }
218
+ /**
219
+ * Delete a file from storage
220
+ * @param fileId Unique ID of the file
221
+ * @param userToken Session token for user-scoped storage
222
+ */
223
+ async delete(fileId, userToken) {
224
+ const headers = {};
225
+ if (userToken) {
226
+ headers['Authorization'] = `Bearer ${userToken}`;
227
+ }
228
+ const resp = await this.sdk.api.delete(`/api/storage/${fileId}`, { headers });
229
+ return resp.data;
230
+ }
231
+ }
232
+
233
+ class LogsModule {
234
+ sdk;
235
+ constructor(sdk) {
236
+ this.sdk = sdk;
237
+ }
238
+ /**
239
+ * Write a custom application log to the project enclave
240
+ * @param message The log message
241
+ * @param source The source of the log (e.g. 'auth-service', 'frontend')
242
+ * @param level Log level (info, warn, error)
243
+ * @param metadata Structured data for searching/filtering
244
+ */
245
+ async write(message, source = 'app', level = 'info', metadata = {}) {
246
+ const resp = await this.sdk.api.post('/api/logs', { message, source, level, metadata });
247
+ return resp.data;
248
+ }
249
+ /**
250
+ * Retrieve application logs for the project
251
+ * @param query Filters (limit, level, etc.)
252
+ */
253
+ async fetch(query = {}) {
254
+ const resp = await this.sdk.api.get('/api/logs', { params: query });
255
+ return resp.data;
256
+ }
257
+ }
258
+
259
+ function getDefaultExportFromCjs (x) {
260
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
261
+ }
262
+
263
+ var react = {exports: {}};
264
+
265
+ var react_production = {};
266
+
267
+ /**
268
+ * @license React
269
+ * react.production.js
270
+ *
271
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
272
+ *
273
+ * This source code is licensed under the MIT license found in the
274
+ * LICENSE file in the root directory of this source tree.
275
+ */
276
+
277
+ var hasRequiredReact_production;
278
+
279
+ function requireReact_production () {
280
+ if (hasRequiredReact_production) return react_production;
281
+ hasRequiredReact_production = 1;
282
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
283
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
284
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
285
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
286
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
287
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
288
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
289
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
290
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
291
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
292
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
293
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
294
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
295
+ function getIteratorFn(maybeIterable) {
296
+ if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
297
+ maybeIterable =
298
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
299
+ maybeIterable["@@iterator"];
300
+ return "function" === typeof maybeIterable ? maybeIterable : null;
301
+ }
302
+ var ReactNoopUpdateQueue = {
303
+ isMounted: function () {
304
+ return false;
305
+ },
306
+ enqueueForceUpdate: function () {},
307
+ enqueueReplaceState: function () {},
308
+ enqueueSetState: function () {}
309
+ },
310
+ assign = Object.assign,
311
+ emptyObject = {};
312
+ function Component(props, context, updater) {
313
+ this.props = props;
314
+ this.context = context;
315
+ this.refs = emptyObject;
316
+ this.updater = updater || ReactNoopUpdateQueue;
317
+ }
318
+ Component.prototype.isReactComponent = {};
319
+ Component.prototype.setState = function (partialState, callback) {
320
+ if (
321
+ "object" !== typeof partialState &&
322
+ "function" !== typeof partialState &&
323
+ null != partialState
324
+ )
325
+ throw Error(
326
+ "takes an object of state variables to update or a function which returns an object of state variables."
327
+ );
328
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
329
+ };
330
+ Component.prototype.forceUpdate = function (callback) {
331
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
332
+ };
333
+ function ComponentDummy() {}
334
+ ComponentDummy.prototype = Component.prototype;
335
+ function PureComponent(props, context, updater) {
336
+ this.props = props;
337
+ this.context = context;
338
+ this.refs = emptyObject;
339
+ this.updater = updater || ReactNoopUpdateQueue;
340
+ }
341
+ var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
342
+ pureComponentPrototype.constructor = PureComponent;
343
+ assign(pureComponentPrototype, Component.prototype);
344
+ pureComponentPrototype.isPureReactComponent = true;
345
+ var isArrayImpl = Array.isArray;
346
+ function noop() {}
347
+ var ReactSharedInternals = { H: null, A: null, T: null, S: null },
348
+ hasOwnProperty = Object.prototype.hasOwnProperty;
349
+ function ReactElement(type, key, props) {
350
+ var refProp = props.ref;
351
+ return {
352
+ $$typeof: REACT_ELEMENT_TYPE,
353
+ type: type,
354
+ key: key,
355
+ ref: void 0 !== refProp ? refProp : null,
356
+ props: props
357
+ };
358
+ }
359
+ function cloneAndReplaceKey(oldElement, newKey) {
360
+ return ReactElement(oldElement.type, newKey, oldElement.props);
361
+ }
362
+ function isValidElement(object) {
363
+ return (
364
+ "object" === typeof object &&
365
+ null !== object &&
366
+ object.$$typeof === REACT_ELEMENT_TYPE
367
+ );
368
+ }
369
+ function escape(key) {
370
+ var escaperLookup = { "=": "=0", ":": "=2" };
371
+ return (
372
+ "$" +
373
+ key.replace(/[=:]/g, function (match) {
374
+ return escaperLookup[match];
375
+ })
376
+ );
377
+ }
378
+ var userProvidedKeyEscapeRegex = /\/+/g;
379
+ function getElementKey(element, index) {
380
+ return "object" === typeof element && null !== element && null != element.key
381
+ ? escape("" + element.key)
382
+ : index.toString(36);
383
+ }
384
+ function resolveThenable(thenable) {
385
+ switch (thenable.status) {
386
+ case "fulfilled":
387
+ return thenable.value;
388
+ case "rejected":
389
+ throw thenable.reason;
390
+ default:
391
+ switch (
392
+ ("string" === typeof thenable.status
393
+ ? thenable.then(noop, noop)
394
+ : ((thenable.status = "pending"),
395
+ thenable.then(
396
+ function (fulfilledValue) {
397
+ "pending" === thenable.status &&
398
+ ((thenable.status = "fulfilled"),
399
+ (thenable.value = fulfilledValue));
400
+ },
401
+ function (error) {
402
+ "pending" === thenable.status &&
403
+ ((thenable.status = "rejected"), (thenable.reason = error));
404
+ }
405
+ )),
406
+ thenable.status)
407
+ ) {
408
+ case "fulfilled":
409
+ return thenable.value;
410
+ case "rejected":
411
+ throw thenable.reason;
412
+ }
413
+ }
414
+ throw thenable;
415
+ }
416
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
417
+ var type = typeof children;
418
+ if ("undefined" === type || "boolean" === type) children = null;
419
+ var invokeCallback = false;
420
+ if (null === children) invokeCallback = true;
421
+ else
422
+ switch (type) {
423
+ case "bigint":
424
+ case "string":
425
+ case "number":
426
+ invokeCallback = true;
427
+ break;
428
+ case "object":
429
+ switch (children.$$typeof) {
430
+ case REACT_ELEMENT_TYPE:
431
+ case REACT_PORTAL_TYPE:
432
+ invokeCallback = true;
433
+ break;
434
+ case REACT_LAZY_TYPE:
435
+ return (
436
+ (invokeCallback = children._init),
437
+ mapIntoArray(
438
+ invokeCallback(children._payload),
439
+ array,
440
+ escapedPrefix,
441
+ nameSoFar,
442
+ callback
443
+ )
444
+ );
445
+ }
446
+ }
447
+ if (invokeCallback)
448
+ return (
449
+ (callback = callback(children)),
450
+ (invokeCallback =
451
+ "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar),
452
+ isArrayImpl(callback)
453
+ ? ((escapedPrefix = ""),
454
+ null != invokeCallback &&
455
+ (escapedPrefix =
456
+ invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
457
+ mapIntoArray(callback, array, escapedPrefix, "", function (c) {
458
+ return c;
459
+ }))
460
+ : null != callback &&
461
+ (isValidElement(callback) &&
462
+ (callback = cloneAndReplaceKey(
463
+ callback,
464
+ escapedPrefix +
465
+ (null == callback.key ||
466
+ (children && children.key === callback.key)
467
+ ? ""
468
+ : ("" + callback.key).replace(
469
+ userProvidedKeyEscapeRegex,
470
+ "$&/"
471
+ ) + "/") +
472
+ invokeCallback
473
+ )),
474
+ array.push(callback)),
475
+ 1
476
+ );
477
+ invokeCallback = 0;
478
+ var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
479
+ if (isArrayImpl(children))
480
+ for (var i = 0; i < children.length; i++)
481
+ (nameSoFar = children[i]),
482
+ (type = nextNamePrefix + getElementKey(nameSoFar, i)),
483
+ (invokeCallback += mapIntoArray(
484
+ nameSoFar,
485
+ array,
486
+ escapedPrefix,
487
+ type,
488
+ callback
489
+ ));
490
+ else if (((i = getIteratorFn(children)), "function" === typeof i))
491
+ for (
492
+ children = i.call(children), i = 0;
493
+ !(nameSoFar = children.next()).done;
494
+
495
+ )
496
+ (nameSoFar = nameSoFar.value),
497
+ (type = nextNamePrefix + getElementKey(nameSoFar, i++)),
498
+ (invokeCallback += mapIntoArray(
499
+ nameSoFar,
500
+ array,
501
+ escapedPrefix,
502
+ type,
503
+ callback
504
+ ));
505
+ else if ("object" === type) {
506
+ if ("function" === typeof children.then)
507
+ return mapIntoArray(
508
+ resolveThenable(children),
509
+ array,
510
+ escapedPrefix,
511
+ nameSoFar,
512
+ callback
513
+ );
514
+ array = String(children);
515
+ throw Error(
516
+ "Objects are not valid as a React child (found: " +
517
+ ("[object Object]" === array
518
+ ? "object with keys {" + Object.keys(children).join(", ") + "}"
519
+ : array) +
520
+ "). If you meant to render a collection of children, use an array instead."
521
+ );
522
+ }
523
+ return invokeCallback;
524
+ }
525
+ function mapChildren(children, func, context) {
526
+ if (null == children) return children;
527
+ var result = [],
528
+ count = 0;
529
+ mapIntoArray(children, result, "", "", function (child) {
530
+ return func.call(context, child, count++);
531
+ });
532
+ return result;
533
+ }
534
+ function lazyInitializer(payload) {
535
+ if (-1 === payload._status) {
536
+ var ctor = payload._result;
537
+ ctor = ctor();
538
+ ctor.then(
539
+ function (moduleObject) {
540
+ if (0 === payload._status || -1 === payload._status)
541
+ (payload._status = 1), (payload._result = moduleObject);
542
+ },
543
+ function (error) {
544
+ if (0 === payload._status || -1 === payload._status)
545
+ (payload._status = 2), (payload._result = error);
546
+ }
547
+ );
548
+ -1 === payload._status && ((payload._status = 0), (payload._result = ctor));
549
+ }
550
+ if (1 === payload._status) return payload._result.default;
551
+ throw payload._result;
552
+ }
553
+ var reportGlobalError =
554
+ "function" === typeof reportError
555
+ ? reportError
556
+ : function (error) {
557
+ if (
558
+ "object" === typeof window &&
559
+ "function" === typeof window.ErrorEvent
560
+ ) {
561
+ var event = new window.ErrorEvent("error", {
562
+ bubbles: true,
563
+ cancelable: true,
564
+ message:
565
+ "object" === typeof error &&
566
+ null !== error &&
567
+ "string" === typeof error.message
568
+ ? String(error.message)
569
+ : String(error),
570
+ error: error
571
+ });
572
+ if (!window.dispatchEvent(event)) return;
573
+ } else if (
574
+ "object" === typeof process &&
575
+ "function" === typeof process.emit
576
+ ) {
577
+ process.emit("uncaughtException", error);
578
+ return;
579
+ }
580
+ console.error(error);
581
+ },
582
+ Children = {
583
+ map: mapChildren,
584
+ forEach: function (children, forEachFunc, forEachContext) {
585
+ mapChildren(
586
+ children,
587
+ function () {
588
+ forEachFunc.apply(this, arguments);
589
+ },
590
+ forEachContext
591
+ );
592
+ },
593
+ count: function (children) {
594
+ var n = 0;
595
+ mapChildren(children, function () {
596
+ n++;
597
+ });
598
+ return n;
599
+ },
600
+ toArray: function (children) {
601
+ return (
602
+ mapChildren(children, function (child) {
603
+ return child;
604
+ }) || []
605
+ );
606
+ },
607
+ only: function (children) {
608
+ if (!isValidElement(children))
609
+ throw Error(
610
+ "React.Children.only expected to receive a single React element child."
611
+ );
612
+ return children;
613
+ }
614
+ };
615
+ react_production.Activity = REACT_ACTIVITY_TYPE;
616
+ react_production.Children = Children;
617
+ react_production.Component = Component;
618
+ react_production.Fragment = REACT_FRAGMENT_TYPE;
619
+ react_production.Profiler = REACT_PROFILER_TYPE;
620
+ react_production.PureComponent = PureComponent;
621
+ react_production.StrictMode = REACT_STRICT_MODE_TYPE;
622
+ react_production.Suspense = REACT_SUSPENSE_TYPE;
623
+ react_production.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
624
+ ReactSharedInternals;
625
+ react_production.__COMPILER_RUNTIME = {
626
+ __proto__: null,
627
+ c: function (size) {
628
+ return ReactSharedInternals.H.useMemoCache(size);
629
+ }
630
+ };
631
+ react_production.cache = function (fn) {
632
+ return function () {
633
+ return fn.apply(null, arguments);
634
+ };
635
+ };
636
+ react_production.cacheSignal = function () {
637
+ return null;
638
+ };
639
+ react_production.cloneElement = function (element, config, children) {
640
+ if (null === element || void 0 === element)
641
+ throw Error(
642
+ "The argument must be a React element, but you passed " + element + "."
643
+ );
644
+ var props = assign({}, element.props),
645
+ key = element.key;
646
+ if (null != config)
647
+ for (propName in (void 0 !== config.key && (key = "" + config.key), config))
648
+ !hasOwnProperty.call(config, propName) ||
649
+ "key" === propName ||
650
+ "__self" === propName ||
651
+ "__source" === propName ||
652
+ ("ref" === propName && void 0 === config.ref) ||
653
+ (props[propName] = config[propName]);
654
+ var propName = arguments.length - 2;
655
+ if (1 === propName) props.children = children;
656
+ else if (1 < propName) {
657
+ for (var childArray = Array(propName), i = 0; i < propName; i++)
658
+ childArray[i] = arguments[i + 2];
659
+ props.children = childArray;
660
+ }
661
+ return ReactElement(element.type, key, props);
662
+ };
663
+ react_production.createContext = function (defaultValue) {
664
+ defaultValue = {
665
+ $$typeof: REACT_CONTEXT_TYPE,
666
+ _currentValue: defaultValue,
667
+ _currentValue2: defaultValue,
668
+ _threadCount: 0,
669
+ Provider: null,
670
+ Consumer: null
671
+ };
672
+ defaultValue.Provider = defaultValue;
673
+ defaultValue.Consumer = {
674
+ $$typeof: REACT_CONSUMER_TYPE,
675
+ _context: defaultValue
676
+ };
677
+ return defaultValue;
678
+ };
679
+ react_production.createElement = function (type, config, children) {
680
+ var propName,
681
+ props = {},
682
+ key = null;
683
+ if (null != config)
684
+ for (propName in (void 0 !== config.key && (key = "" + config.key), config))
685
+ hasOwnProperty.call(config, propName) &&
686
+ "key" !== propName &&
687
+ "__self" !== propName &&
688
+ "__source" !== propName &&
689
+ (props[propName] = config[propName]);
690
+ var childrenLength = arguments.length - 2;
691
+ if (1 === childrenLength) props.children = children;
692
+ else if (1 < childrenLength) {
693
+ for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
694
+ childArray[i] = arguments[i + 2];
695
+ props.children = childArray;
696
+ }
697
+ if (type && type.defaultProps)
698
+ for (propName in ((childrenLength = type.defaultProps), childrenLength))
699
+ void 0 === props[propName] &&
700
+ (props[propName] = childrenLength[propName]);
701
+ return ReactElement(type, key, props);
702
+ };
703
+ react_production.createRef = function () {
704
+ return { current: null };
705
+ };
706
+ react_production.forwardRef = function (render) {
707
+ return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
708
+ };
709
+ react_production.isValidElement = isValidElement;
710
+ react_production.lazy = function (ctor) {
711
+ return {
712
+ $$typeof: REACT_LAZY_TYPE,
713
+ _payload: { _status: -1, _result: ctor },
714
+ _init: lazyInitializer
715
+ };
716
+ };
717
+ react_production.memo = function (type, compare) {
718
+ return {
719
+ $$typeof: REACT_MEMO_TYPE,
720
+ type: type,
721
+ compare: void 0 === compare ? null : compare
722
+ };
723
+ };
724
+ react_production.startTransition = function (scope) {
725
+ var prevTransition = ReactSharedInternals.T,
726
+ currentTransition = {};
727
+ ReactSharedInternals.T = currentTransition;
728
+ try {
729
+ var returnValue = scope(),
730
+ onStartTransitionFinish = ReactSharedInternals.S;
731
+ null !== onStartTransitionFinish &&
732
+ onStartTransitionFinish(currentTransition, returnValue);
733
+ "object" === typeof returnValue &&
734
+ null !== returnValue &&
735
+ "function" === typeof returnValue.then &&
736
+ returnValue.then(noop, reportGlobalError);
737
+ } catch (error) {
738
+ reportGlobalError(error);
739
+ } finally {
740
+ null !== prevTransition &&
741
+ null !== currentTransition.types &&
742
+ (prevTransition.types = currentTransition.types),
743
+ (ReactSharedInternals.T = prevTransition);
744
+ }
745
+ };
746
+ react_production.unstable_useCacheRefresh = function () {
747
+ return ReactSharedInternals.H.useCacheRefresh();
748
+ };
749
+ react_production.use = function (usable) {
750
+ return ReactSharedInternals.H.use(usable);
751
+ };
752
+ react_production.useActionState = function (action, initialState, permalink) {
753
+ return ReactSharedInternals.H.useActionState(action, initialState, permalink);
754
+ };
755
+ react_production.useCallback = function (callback, deps) {
756
+ return ReactSharedInternals.H.useCallback(callback, deps);
757
+ };
758
+ react_production.useContext = function (Context) {
759
+ return ReactSharedInternals.H.useContext(Context);
760
+ };
761
+ react_production.useDebugValue = function () {};
762
+ react_production.useDeferredValue = function (value, initialValue) {
763
+ return ReactSharedInternals.H.useDeferredValue(value, initialValue);
764
+ };
765
+ react_production.useEffect = function (create, deps) {
766
+ return ReactSharedInternals.H.useEffect(create, deps);
767
+ };
768
+ react_production.useEffectEvent = function (callback) {
769
+ return ReactSharedInternals.H.useEffectEvent(callback);
770
+ };
771
+ react_production.useId = function () {
772
+ return ReactSharedInternals.H.useId();
773
+ };
774
+ react_production.useImperativeHandle = function (ref, create, deps) {
775
+ return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
776
+ };
777
+ react_production.useInsertionEffect = function (create, deps) {
778
+ return ReactSharedInternals.H.useInsertionEffect(create, deps);
779
+ };
780
+ react_production.useLayoutEffect = function (create, deps) {
781
+ return ReactSharedInternals.H.useLayoutEffect(create, deps);
782
+ };
783
+ react_production.useMemo = function (create, deps) {
784
+ return ReactSharedInternals.H.useMemo(create, deps);
785
+ };
786
+ react_production.useOptimistic = function (passthrough, reducer) {
787
+ return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
788
+ };
789
+ react_production.useReducer = function (reducer, initialArg, init) {
790
+ return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
791
+ };
792
+ react_production.useRef = function (initialValue) {
793
+ return ReactSharedInternals.H.useRef(initialValue);
794
+ };
795
+ react_production.useState = function (initialState) {
796
+ return ReactSharedInternals.H.useState(initialState);
797
+ };
798
+ react_production.useSyncExternalStore = function (
799
+ subscribe,
800
+ getSnapshot,
801
+ getServerSnapshot
802
+ ) {
803
+ return ReactSharedInternals.H.useSyncExternalStore(
804
+ subscribe,
805
+ getSnapshot,
806
+ getServerSnapshot
807
+ );
808
+ };
809
+ react_production.useTransition = function () {
810
+ return ReactSharedInternals.H.useTransition();
811
+ };
812
+ react_production.version = "19.2.4";
813
+ return react_production;
814
+ }
815
+
816
+ var react_development = {exports: {}};
817
+
818
+ /**
819
+ * @license React
820
+ * react.development.js
821
+ *
822
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
823
+ *
824
+ * This source code is licensed under the MIT license found in the
825
+ * LICENSE file in the root directory of this source tree.
826
+ */
827
+ react_development.exports;
828
+
829
+ var hasRequiredReact_development;
830
+
831
+ function requireReact_development () {
832
+ if (hasRequiredReact_development) return react_development.exports;
833
+ hasRequiredReact_development = 1;
834
+ (function (module, exports$1) {
835
+ "production" !== process.env.NODE_ENV &&
836
+ (function () {
837
+ function defineDeprecationWarning(methodName, info) {
838
+ Object.defineProperty(Component.prototype, methodName, {
839
+ get: function () {
840
+ console.warn(
841
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
842
+ info[0],
843
+ info[1]
844
+ );
845
+ }
846
+ });
847
+ }
848
+ function getIteratorFn(maybeIterable) {
849
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
850
+ return null;
851
+ maybeIterable =
852
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
853
+ maybeIterable["@@iterator"];
854
+ return "function" === typeof maybeIterable ? maybeIterable : null;
855
+ }
856
+ function warnNoop(publicInstance, callerName) {
857
+ publicInstance =
858
+ ((publicInstance = publicInstance.constructor) &&
859
+ (publicInstance.displayName || publicInstance.name)) ||
860
+ "ReactClass";
861
+ var warningKey = publicInstance + "." + callerName;
862
+ didWarnStateUpdateForUnmountedComponent[warningKey] ||
863
+ (console.error(
864
+ "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.",
865
+ callerName,
866
+ publicInstance
867
+ ),
868
+ (didWarnStateUpdateForUnmountedComponent[warningKey] = true));
869
+ }
870
+ function Component(props, context, updater) {
871
+ this.props = props;
872
+ this.context = context;
873
+ this.refs = emptyObject;
874
+ this.updater = updater || ReactNoopUpdateQueue;
875
+ }
876
+ function ComponentDummy() {}
877
+ function PureComponent(props, context, updater) {
878
+ this.props = props;
879
+ this.context = context;
880
+ this.refs = emptyObject;
881
+ this.updater = updater || ReactNoopUpdateQueue;
882
+ }
883
+ function noop() {}
884
+ function testStringCoercion(value) {
885
+ return "" + value;
886
+ }
887
+ function checkKeyStringCoercion(value) {
888
+ try {
889
+ testStringCoercion(value);
890
+ var JSCompiler_inline_result = !1;
891
+ } catch (e) {
892
+ JSCompiler_inline_result = true;
893
+ }
894
+ if (JSCompiler_inline_result) {
895
+ JSCompiler_inline_result = console;
896
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
897
+ var JSCompiler_inline_result$jscomp$0 =
898
+ ("function" === typeof Symbol &&
899
+ Symbol.toStringTag &&
900
+ value[Symbol.toStringTag]) ||
901
+ value.constructor.name ||
902
+ "Object";
903
+ JSCompiler_temp_const.call(
904
+ JSCompiler_inline_result,
905
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
906
+ JSCompiler_inline_result$jscomp$0
907
+ );
908
+ return testStringCoercion(value);
909
+ }
910
+ }
911
+ function getComponentNameFromType(type) {
912
+ if (null == type) return null;
913
+ if ("function" === typeof type)
914
+ return type.$$typeof === REACT_CLIENT_REFERENCE
915
+ ? null
916
+ : type.displayName || type.name || null;
917
+ if ("string" === typeof type) return type;
918
+ switch (type) {
919
+ case REACT_FRAGMENT_TYPE:
920
+ return "Fragment";
921
+ case REACT_PROFILER_TYPE:
922
+ return "Profiler";
923
+ case REACT_STRICT_MODE_TYPE:
924
+ return "StrictMode";
925
+ case REACT_SUSPENSE_TYPE:
926
+ return "Suspense";
927
+ case REACT_SUSPENSE_LIST_TYPE:
928
+ return "SuspenseList";
929
+ case REACT_ACTIVITY_TYPE:
930
+ return "Activity";
931
+ }
932
+ if ("object" === typeof type)
933
+ switch (
934
+ ("number" === typeof type.tag &&
935
+ console.error(
936
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
937
+ ),
938
+ type.$$typeof)
939
+ ) {
940
+ case REACT_PORTAL_TYPE:
941
+ return "Portal";
942
+ case REACT_CONTEXT_TYPE:
943
+ return type.displayName || "Context";
944
+ case REACT_CONSUMER_TYPE:
945
+ return (type._context.displayName || "Context") + ".Consumer";
946
+ case REACT_FORWARD_REF_TYPE:
947
+ var innerType = type.render;
948
+ type = type.displayName;
949
+ type ||
950
+ ((type = innerType.displayName || innerType.name || ""),
951
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
952
+ return type;
953
+ case REACT_MEMO_TYPE:
954
+ return (
955
+ (innerType = type.displayName || null),
956
+ null !== innerType
957
+ ? innerType
958
+ : getComponentNameFromType(type.type) || "Memo"
959
+ );
960
+ case REACT_LAZY_TYPE:
961
+ innerType = type._payload;
962
+ type = type._init;
963
+ try {
964
+ return getComponentNameFromType(type(innerType));
965
+ } catch (x) {}
966
+ }
967
+ return null;
968
+ }
969
+ function getTaskName(type) {
970
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
971
+ if (
972
+ "object" === typeof type &&
973
+ null !== type &&
974
+ type.$$typeof === REACT_LAZY_TYPE
975
+ )
976
+ return "<...>";
977
+ try {
978
+ var name = getComponentNameFromType(type);
979
+ return name ? "<" + name + ">" : "<...>";
980
+ } catch (x) {
981
+ return "<...>";
982
+ }
983
+ }
984
+ function getOwner() {
985
+ var dispatcher = ReactSharedInternals.A;
986
+ return null === dispatcher ? null : dispatcher.getOwner();
987
+ }
988
+ function UnknownOwner() {
989
+ return Error("react-stack-top-frame");
990
+ }
991
+ function hasValidKey(config) {
992
+ if (hasOwnProperty.call(config, "key")) {
993
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
994
+ if (getter && getter.isReactWarning) return false;
995
+ }
996
+ return void 0 !== config.key;
997
+ }
998
+ function defineKeyPropWarningGetter(props, displayName) {
999
+ function warnAboutAccessingKey() {
1000
+ specialPropKeyWarningShown ||
1001
+ ((specialPropKeyWarningShown = true),
1002
+ console.error(
1003
+ "%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)",
1004
+ displayName
1005
+ ));
1006
+ }
1007
+ warnAboutAccessingKey.isReactWarning = true;
1008
+ Object.defineProperty(props, "key", {
1009
+ get: warnAboutAccessingKey,
1010
+ configurable: true
1011
+ });
1012
+ }
1013
+ function elementRefGetterWithDeprecationWarning() {
1014
+ var componentName = getComponentNameFromType(this.type);
1015
+ didWarnAboutElementRef[componentName] ||
1016
+ ((didWarnAboutElementRef[componentName] = true),
1017
+ console.error(
1018
+ "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."
1019
+ ));
1020
+ componentName = this.props.ref;
1021
+ return void 0 !== componentName ? componentName : null;
1022
+ }
1023
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
1024
+ var refProp = props.ref;
1025
+ type = {
1026
+ $$typeof: REACT_ELEMENT_TYPE,
1027
+ type: type,
1028
+ key: key,
1029
+ props: props,
1030
+ _owner: owner
1031
+ };
1032
+ null !== (void 0 !== refProp ? refProp : null)
1033
+ ? Object.defineProperty(type, "ref", {
1034
+ enumerable: false,
1035
+ get: elementRefGetterWithDeprecationWarning
1036
+ })
1037
+ : Object.defineProperty(type, "ref", { enumerable: false, value: null });
1038
+ type._store = {};
1039
+ Object.defineProperty(type._store, "validated", {
1040
+ configurable: false,
1041
+ enumerable: false,
1042
+ writable: true,
1043
+ value: 0
1044
+ });
1045
+ Object.defineProperty(type, "_debugInfo", {
1046
+ configurable: false,
1047
+ enumerable: false,
1048
+ writable: true,
1049
+ value: null
1050
+ });
1051
+ Object.defineProperty(type, "_debugStack", {
1052
+ configurable: false,
1053
+ enumerable: false,
1054
+ writable: true,
1055
+ value: debugStack
1056
+ });
1057
+ Object.defineProperty(type, "_debugTask", {
1058
+ configurable: false,
1059
+ enumerable: false,
1060
+ writable: true,
1061
+ value: debugTask
1062
+ });
1063
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
1064
+ return type;
1065
+ }
1066
+ function cloneAndReplaceKey(oldElement, newKey) {
1067
+ newKey = ReactElement(
1068
+ oldElement.type,
1069
+ newKey,
1070
+ oldElement.props,
1071
+ oldElement._owner,
1072
+ oldElement._debugStack,
1073
+ oldElement._debugTask
1074
+ );
1075
+ oldElement._store &&
1076
+ (newKey._store.validated = oldElement._store.validated);
1077
+ return newKey;
1078
+ }
1079
+ function validateChildKeys(node) {
1080
+ isValidElement(node)
1081
+ ? node._store && (node._store.validated = 1)
1082
+ : "object" === typeof node &&
1083
+ null !== node &&
1084
+ node.$$typeof === REACT_LAZY_TYPE &&
1085
+ ("fulfilled" === node._payload.status
1086
+ ? isValidElement(node._payload.value) &&
1087
+ node._payload.value._store &&
1088
+ (node._payload.value._store.validated = 1)
1089
+ : node._store && (node._store.validated = 1));
1090
+ }
1091
+ function isValidElement(object) {
1092
+ return (
1093
+ "object" === typeof object &&
1094
+ null !== object &&
1095
+ object.$$typeof === REACT_ELEMENT_TYPE
1096
+ );
1097
+ }
1098
+ function escape(key) {
1099
+ var escaperLookup = { "=": "=0", ":": "=2" };
1100
+ return (
1101
+ "$" +
1102
+ key.replace(/[=:]/g, function (match) {
1103
+ return escaperLookup[match];
1104
+ })
1105
+ );
1106
+ }
1107
+ function getElementKey(element, index) {
1108
+ return "object" === typeof element &&
1109
+ null !== element &&
1110
+ null != element.key
1111
+ ? (checkKeyStringCoercion(element.key), escape("" + element.key))
1112
+ : index.toString(36);
1113
+ }
1114
+ function resolveThenable(thenable) {
1115
+ switch (thenable.status) {
1116
+ case "fulfilled":
1117
+ return thenable.value;
1118
+ case "rejected":
1119
+ throw thenable.reason;
1120
+ default:
1121
+ switch (
1122
+ ("string" === typeof thenable.status
1123
+ ? thenable.then(noop, noop)
1124
+ : ((thenable.status = "pending"),
1125
+ thenable.then(
1126
+ function (fulfilledValue) {
1127
+ "pending" === thenable.status &&
1128
+ ((thenable.status = "fulfilled"),
1129
+ (thenable.value = fulfilledValue));
1130
+ },
1131
+ function (error) {
1132
+ "pending" === thenable.status &&
1133
+ ((thenable.status = "rejected"),
1134
+ (thenable.reason = error));
1135
+ }
1136
+ )),
1137
+ thenable.status)
1138
+ ) {
1139
+ case "fulfilled":
1140
+ return thenable.value;
1141
+ case "rejected":
1142
+ throw thenable.reason;
1143
+ }
1144
+ }
1145
+ throw thenable;
1146
+ }
1147
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1148
+ var type = typeof children;
1149
+ if ("undefined" === type || "boolean" === type) children = null;
1150
+ var invokeCallback = false;
1151
+ if (null === children) invokeCallback = true;
1152
+ else
1153
+ switch (type) {
1154
+ case "bigint":
1155
+ case "string":
1156
+ case "number":
1157
+ invokeCallback = true;
1158
+ break;
1159
+ case "object":
1160
+ switch (children.$$typeof) {
1161
+ case REACT_ELEMENT_TYPE:
1162
+ case REACT_PORTAL_TYPE:
1163
+ invokeCallback = true;
1164
+ break;
1165
+ case REACT_LAZY_TYPE:
1166
+ return (
1167
+ (invokeCallback = children._init),
1168
+ mapIntoArray(
1169
+ invokeCallback(children._payload),
1170
+ array,
1171
+ escapedPrefix,
1172
+ nameSoFar,
1173
+ callback
1174
+ )
1175
+ );
1176
+ }
1177
+ }
1178
+ if (invokeCallback) {
1179
+ invokeCallback = children;
1180
+ callback = callback(invokeCallback);
1181
+ var childKey =
1182
+ "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
1183
+ isArrayImpl(callback)
1184
+ ? ((escapedPrefix = ""),
1185
+ null != childKey &&
1186
+ (escapedPrefix =
1187
+ childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
1188
+ mapIntoArray(callback, array, escapedPrefix, "", function (c) {
1189
+ return c;
1190
+ }))
1191
+ : null != callback &&
1192
+ (isValidElement(callback) &&
1193
+ (null != callback.key &&
1194
+ ((invokeCallback && invokeCallback.key === callback.key) ||
1195
+ checkKeyStringCoercion(callback.key)),
1196
+ (escapedPrefix = cloneAndReplaceKey(
1197
+ callback,
1198
+ escapedPrefix +
1199
+ (null == callback.key ||
1200
+ (invokeCallback && invokeCallback.key === callback.key)
1201
+ ? ""
1202
+ : ("" + callback.key).replace(
1203
+ userProvidedKeyEscapeRegex,
1204
+ "$&/"
1205
+ ) + "/") +
1206
+ childKey
1207
+ )),
1208
+ "" !== nameSoFar &&
1209
+ null != invokeCallback &&
1210
+ isValidElement(invokeCallback) &&
1211
+ null == invokeCallback.key &&
1212
+ invokeCallback._store &&
1213
+ !invokeCallback._store.validated &&
1214
+ (escapedPrefix._store.validated = 2),
1215
+ (callback = escapedPrefix)),
1216
+ array.push(callback));
1217
+ return 1;
1218
+ }
1219
+ invokeCallback = 0;
1220
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
1221
+ if (isArrayImpl(children))
1222
+ for (var i = 0; i < children.length; i++)
1223
+ (nameSoFar = children[i]),
1224
+ (type = childKey + getElementKey(nameSoFar, i)),
1225
+ (invokeCallback += mapIntoArray(
1226
+ nameSoFar,
1227
+ array,
1228
+ escapedPrefix,
1229
+ type,
1230
+ callback
1231
+ ));
1232
+ else if (((i = getIteratorFn(children)), "function" === typeof i))
1233
+ for (
1234
+ i === children.entries &&
1235
+ (didWarnAboutMaps ||
1236
+ console.warn(
1237
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
1238
+ ),
1239
+ (didWarnAboutMaps = true)),
1240
+ children = i.call(children),
1241
+ i = 0;
1242
+ !(nameSoFar = children.next()).done;
1243
+
1244
+ )
1245
+ (nameSoFar = nameSoFar.value),
1246
+ (type = childKey + getElementKey(nameSoFar, i++)),
1247
+ (invokeCallback += mapIntoArray(
1248
+ nameSoFar,
1249
+ array,
1250
+ escapedPrefix,
1251
+ type,
1252
+ callback
1253
+ ));
1254
+ else if ("object" === type) {
1255
+ if ("function" === typeof children.then)
1256
+ return mapIntoArray(
1257
+ resolveThenable(children),
1258
+ array,
1259
+ escapedPrefix,
1260
+ nameSoFar,
1261
+ callback
1262
+ );
1263
+ array = String(children);
1264
+ throw Error(
1265
+ "Objects are not valid as a React child (found: " +
1266
+ ("[object Object]" === array
1267
+ ? "object with keys {" + Object.keys(children).join(", ") + "}"
1268
+ : array) +
1269
+ "). If you meant to render a collection of children, use an array instead."
1270
+ );
1271
+ }
1272
+ return invokeCallback;
1273
+ }
1274
+ function mapChildren(children, func, context) {
1275
+ if (null == children) return children;
1276
+ var result = [],
1277
+ count = 0;
1278
+ mapIntoArray(children, result, "", "", function (child) {
1279
+ return func.call(context, child, count++);
1280
+ });
1281
+ return result;
1282
+ }
1283
+ function lazyInitializer(payload) {
1284
+ if (-1 === payload._status) {
1285
+ var ioInfo = payload._ioInfo;
1286
+ null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
1287
+ ioInfo = payload._result;
1288
+ var thenable = ioInfo();
1289
+ thenable.then(
1290
+ function (moduleObject) {
1291
+ if (0 === payload._status || -1 === payload._status) {
1292
+ payload._status = 1;
1293
+ payload._result = moduleObject;
1294
+ var _ioInfo = payload._ioInfo;
1295
+ null != _ioInfo && (_ioInfo.end = performance.now());
1296
+ void 0 === thenable.status &&
1297
+ ((thenable.status = "fulfilled"),
1298
+ (thenable.value = moduleObject));
1299
+ }
1300
+ },
1301
+ function (error) {
1302
+ if (0 === payload._status || -1 === payload._status) {
1303
+ payload._status = 2;
1304
+ payload._result = error;
1305
+ var _ioInfo2 = payload._ioInfo;
1306
+ null != _ioInfo2 && (_ioInfo2.end = performance.now());
1307
+ void 0 === thenable.status &&
1308
+ ((thenable.status = "rejected"), (thenable.reason = error));
1309
+ }
1310
+ }
1311
+ );
1312
+ ioInfo = payload._ioInfo;
1313
+ if (null != ioInfo) {
1314
+ ioInfo.value = thenable;
1315
+ var displayName = thenable.displayName;
1316
+ "string" === typeof displayName && (ioInfo.name = displayName);
1317
+ }
1318
+ -1 === payload._status &&
1319
+ ((payload._status = 0), (payload._result = thenable));
1320
+ }
1321
+ if (1 === payload._status)
1322
+ return (
1323
+ (ioInfo = payload._result),
1324
+ void 0 === ioInfo &&
1325
+ console.error(
1326
+ "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?",
1327
+ ioInfo
1328
+ ),
1329
+ "default" in ioInfo ||
1330
+ console.error(
1331
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
1332
+ ioInfo
1333
+ ),
1334
+ ioInfo.default
1335
+ );
1336
+ throw payload._result;
1337
+ }
1338
+ function resolveDispatcher() {
1339
+ var dispatcher = ReactSharedInternals.H;
1340
+ null === dispatcher &&
1341
+ console.error(
1342
+ "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."
1343
+ );
1344
+ return dispatcher;
1345
+ }
1346
+ function releaseAsyncTransition() {
1347
+ ReactSharedInternals.asyncTransitions--;
1348
+ }
1349
+ function enqueueTask(task) {
1350
+ if (null === enqueueTaskImpl)
1351
+ try {
1352
+ var requireString = ("require" + Math.random()).slice(0, 7);
1353
+ enqueueTaskImpl = (module && module[requireString]).call(
1354
+ module,
1355
+ "timers"
1356
+ ).setImmediate;
1357
+ } catch (_err) {
1358
+ enqueueTaskImpl = function (callback) {
1359
+ false === didWarnAboutMessageChannel &&
1360
+ ((didWarnAboutMessageChannel = true),
1361
+ "undefined" === typeof MessageChannel &&
1362
+ console.error(
1363
+ "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."
1364
+ ));
1365
+ var channel = new MessageChannel();
1366
+ channel.port1.onmessage = callback;
1367
+ channel.port2.postMessage(void 0);
1368
+ };
1369
+ }
1370
+ return enqueueTaskImpl(task);
1371
+ }
1372
+ function aggregateErrors(errors) {
1373
+ return 1 < errors.length && "function" === typeof AggregateError
1374
+ ? new AggregateError(errors)
1375
+ : errors[0];
1376
+ }
1377
+ function popActScope(prevActQueue, prevActScopeDepth) {
1378
+ prevActScopeDepth !== actScopeDepth - 1 &&
1379
+ console.error(
1380
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
1381
+ );
1382
+ actScopeDepth = prevActScopeDepth;
1383
+ }
1384
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
1385
+ var queue = ReactSharedInternals.actQueue;
1386
+ if (null !== queue)
1387
+ if (0 !== queue.length)
1388
+ try {
1389
+ flushActQueue(queue);
1390
+ enqueueTask(function () {
1391
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
1392
+ });
1393
+ return;
1394
+ } catch (error) {
1395
+ ReactSharedInternals.thrownErrors.push(error);
1396
+ }
1397
+ else ReactSharedInternals.actQueue = null;
1398
+ 0 < ReactSharedInternals.thrownErrors.length
1399
+ ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)),
1400
+ (ReactSharedInternals.thrownErrors.length = 0),
1401
+ reject(queue))
1402
+ : resolve(returnValue);
1403
+ }
1404
+ function flushActQueue(queue) {
1405
+ if (!isFlushing) {
1406
+ isFlushing = true;
1407
+ var i = 0;
1408
+ try {
1409
+ for (; i < queue.length; i++) {
1410
+ var callback = queue[i];
1411
+ do {
1412
+ ReactSharedInternals.didUsePromise = !1;
1413
+ var continuation = callback(!1);
1414
+ if (null !== continuation) {
1415
+ if (ReactSharedInternals.didUsePromise) {
1416
+ queue[i] = callback;
1417
+ queue.splice(0, i);
1418
+ return;
1419
+ }
1420
+ callback = continuation;
1421
+ } else break;
1422
+ } while (1);
1423
+ }
1424
+ queue.length = 0;
1425
+ } catch (error) {
1426
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
1427
+ } finally {
1428
+ isFlushing = false;
1429
+ }
1430
+ }
1431
+ }
1432
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1433
+ "function" ===
1434
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
1435
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1436
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
1437
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
1438
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
1439
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
1440
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
1441
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
1442
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
1443
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
1444
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
1445
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
1446
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
1447
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
1448
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
1449
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
1450
+ didWarnStateUpdateForUnmountedComponent = {},
1451
+ ReactNoopUpdateQueue = {
1452
+ isMounted: function () {
1453
+ return false;
1454
+ },
1455
+ enqueueForceUpdate: function (publicInstance) {
1456
+ warnNoop(publicInstance, "forceUpdate");
1457
+ },
1458
+ enqueueReplaceState: function (publicInstance) {
1459
+ warnNoop(publicInstance, "replaceState");
1460
+ },
1461
+ enqueueSetState: function (publicInstance) {
1462
+ warnNoop(publicInstance, "setState");
1463
+ }
1464
+ },
1465
+ assign = Object.assign,
1466
+ emptyObject = {};
1467
+ Object.freeze(emptyObject);
1468
+ Component.prototype.isReactComponent = {};
1469
+ Component.prototype.setState = function (partialState, callback) {
1470
+ if (
1471
+ "object" !== typeof partialState &&
1472
+ "function" !== typeof partialState &&
1473
+ null != partialState
1474
+ )
1475
+ throw Error(
1476
+ "takes an object of state variables to update or a function which returns an object of state variables."
1477
+ );
1478
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
1479
+ };
1480
+ Component.prototype.forceUpdate = function (callback) {
1481
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
1482
+ };
1483
+ var deprecatedAPIs = {
1484
+ isMounted: [
1485
+ "isMounted",
1486
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
1487
+ ],
1488
+ replaceState: [
1489
+ "replaceState",
1490
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
1491
+ ]
1492
+ };
1493
+ for (fnName in deprecatedAPIs)
1494
+ deprecatedAPIs.hasOwnProperty(fnName) &&
1495
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1496
+ ComponentDummy.prototype = Component.prototype;
1497
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
1498
+ deprecatedAPIs.constructor = PureComponent;
1499
+ assign(deprecatedAPIs, Component.prototype);
1500
+ deprecatedAPIs.isPureReactComponent = true;
1501
+ var isArrayImpl = Array.isArray,
1502
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
1503
+ ReactSharedInternals = {
1504
+ H: null,
1505
+ A: null,
1506
+ T: null,
1507
+ S: null,
1508
+ actQueue: null,
1509
+ asyncTransitions: 0,
1510
+ isBatchingLegacy: false,
1511
+ didScheduleLegacyUpdate: false,
1512
+ didUsePromise: false,
1513
+ thrownErrors: [],
1514
+ getCurrentStack: null,
1515
+ recentlyCreatedOwnerStacks: 0
1516
+ },
1517
+ hasOwnProperty = Object.prototype.hasOwnProperty,
1518
+ createTask = console.createTask
1519
+ ? console.createTask
1520
+ : function () {
1521
+ return null;
1522
+ };
1523
+ deprecatedAPIs = {
1524
+ react_stack_bottom_frame: function (callStackForError) {
1525
+ return callStackForError();
1526
+ }
1527
+ };
1528
+ var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1529
+ var didWarnAboutElementRef = {};
1530
+ var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1531
+ deprecatedAPIs,
1532
+ UnknownOwner
1533
+ )();
1534
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1535
+ var didWarnAboutMaps = false,
1536
+ userProvidedKeyEscapeRegex = /\/+/g,
1537
+ reportGlobalError =
1538
+ "function" === typeof reportError
1539
+ ? reportError
1540
+ : function (error) {
1541
+ if (
1542
+ "object" === typeof window &&
1543
+ "function" === typeof window.ErrorEvent
1544
+ ) {
1545
+ var event = new window.ErrorEvent("error", {
1546
+ bubbles: true,
1547
+ cancelable: true,
1548
+ message:
1549
+ "object" === typeof error &&
1550
+ null !== error &&
1551
+ "string" === typeof error.message
1552
+ ? String(error.message)
1553
+ : String(error),
1554
+ error: error
1555
+ });
1556
+ if (!window.dispatchEvent(event)) return;
1557
+ } else if (
1558
+ "object" === typeof process &&
1559
+ "function" === typeof process.emit
1560
+ ) {
1561
+ process.emit("uncaughtException", error);
1562
+ return;
1563
+ }
1564
+ console.error(error);
1565
+ },
1566
+ didWarnAboutMessageChannel = false,
1567
+ enqueueTaskImpl = null,
1568
+ actScopeDepth = 0,
1569
+ didWarnNoAwaitAct = false,
1570
+ isFlushing = false,
1571
+ queueSeveralMicrotasks =
1572
+ "function" === typeof queueMicrotask
1573
+ ? function (callback) {
1574
+ queueMicrotask(function () {
1575
+ return queueMicrotask(callback);
1576
+ });
1577
+ }
1578
+ : enqueueTask;
1579
+ deprecatedAPIs = Object.freeze({
1580
+ __proto__: null,
1581
+ c: function (size) {
1582
+ return resolveDispatcher().useMemoCache(size);
1583
+ }
1584
+ });
1585
+ var fnName = {
1586
+ map: mapChildren,
1587
+ forEach: function (children, forEachFunc, forEachContext) {
1588
+ mapChildren(
1589
+ children,
1590
+ function () {
1591
+ forEachFunc.apply(this, arguments);
1592
+ },
1593
+ forEachContext
1594
+ );
1595
+ },
1596
+ count: function (children) {
1597
+ var n = 0;
1598
+ mapChildren(children, function () {
1599
+ n++;
1600
+ });
1601
+ return n;
1602
+ },
1603
+ toArray: function (children) {
1604
+ return (
1605
+ mapChildren(children, function (child) {
1606
+ return child;
1607
+ }) || []
1608
+ );
1609
+ },
1610
+ only: function (children) {
1611
+ if (!isValidElement(children))
1612
+ throw Error(
1613
+ "React.Children.only expected to receive a single React element child."
1614
+ );
1615
+ return children;
1616
+ }
1617
+ };
1618
+ exports$1.Activity = REACT_ACTIVITY_TYPE;
1619
+ exports$1.Children = fnName;
1620
+ exports$1.Component = Component;
1621
+ exports$1.Fragment = REACT_FRAGMENT_TYPE;
1622
+ exports$1.Profiler = REACT_PROFILER_TYPE;
1623
+ exports$1.PureComponent = PureComponent;
1624
+ exports$1.StrictMode = REACT_STRICT_MODE_TYPE;
1625
+ exports$1.Suspense = REACT_SUSPENSE_TYPE;
1626
+ exports$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
1627
+ ReactSharedInternals;
1628
+ exports$1.__COMPILER_RUNTIME = deprecatedAPIs;
1629
+ exports$1.act = function (callback) {
1630
+ var prevActQueue = ReactSharedInternals.actQueue,
1631
+ prevActScopeDepth = actScopeDepth;
1632
+ actScopeDepth++;
1633
+ var queue = (ReactSharedInternals.actQueue =
1634
+ null !== prevActQueue ? prevActQueue : []),
1635
+ didAwaitActCall = false;
1636
+ try {
1637
+ var result = callback();
1638
+ } catch (error) {
1639
+ ReactSharedInternals.thrownErrors.push(error);
1640
+ }
1641
+ if (0 < ReactSharedInternals.thrownErrors.length)
1642
+ throw (
1643
+ (popActScope(prevActQueue, prevActScopeDepth),
1644
+ (callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1645
+ (ReactSharedInternals.thrownErrors.length = 0),
1646
+ callback)
1647
+ );
1648
+ if (
1649
+ null !== result &&
1650
+ "object" === typeof result &&
1651
+ "function" === typeof result.then
1652
+ ) {
1653
+ var thenable = result;
1654
+ queueSeveralMicrotasks(function () {
1655
+ didAwaitActCall ||
1656
+ didWarnNoAwaitAct ||
1657
+ ((didWarnNoAwaitAct = true),
1658
+ console.error(
1659
+ "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 () => ...);"
1660
+ ));
1661
+ });
1662
+ return {
1663
+ then: function (resolve, reject) {
1664
+ didAwaitActCall = true;
1665
+ thenable.then(
1666
+ function (returnValue) {
1667
+ popActScope(prevActQueue, prevActScopeDepth);
1668
+ if (0 === prevActScopeDepth) {
1669
+ try {
1670
+ flushActQueue(queue),
1671
+ enqueueTask(function () {
1672
+ return recursivelyFlushAsyncActWork(
1673
+ returnValue,
1674
+ resolve,
1675
+ reject
1676
+ );
1677
+ });
1678
+ } catch (error$0) {
1679
+ ReactSharedInternals.thrownErrors.push(error$0);
1680
+ }
1681
+ if (0 < ReactSharedInternals.thrownErrors.length) {
1682
+ var _thrownError = aggregateErrors(
1683
+ ReactSharedInternals.thrownErrors
1684
+ );
1685
+ ReactSharedInternals.thrownErrors.length = 0;
1686
+ reject(_thrownError);
1687
+ }
1688
+ } else resolve(returnValue);
1689
+ },
1690
+ function (error) {
1691
+ popActScope(prevActQueue, prevActScopeDepth);
1692
+ 0 < ReactSharedInternals.thrownErrors.length
1693
+ ? ((error = aggregateErrors(
1694
+ ReactSharedInternals.thrownErrors
1695
+ )),
1696
+ (ReactSharedInternals.thrownErrors.length = 0),
1697
+ reject(error))
1698
+ : reject(error);
1699
+ }
1700
+ );
1701
+ }
1702
+ };
1703
+ }
1704
+ var returnValue$jscomp$0 = result;
1705
+ popActScope(prevActQueue, prevActScopeDepth);
1706
+ 0 === prevActScopeDepth &&
1707
+ (flushActQueue(queue),
1708
+ 0 !== queue.length &&
1709
+ queueSeveralMicrotasks(function () {
1710
+ didAwaitActCall ||
1711
+ didWarnNoAwaitAct ||
1712
+ ((didWarnNoAwaitAct = true),
1713
+ console.error(
1714
+ "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(() => ...)"
1715
+ ));
1716
+ }),
1717
+ (ReactSharedInternals.actQueue = null));
1718
+ if (0 < ReactSharedInternals.thrownErrors.length)
1719
+ throw (
1720
+ ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1721
+ (ReactSharedInternals.thrownErrors.length = 0),
1722
+ callback)
1723
+ );
1724
+ return {
1725
+ then: function (resolve, reject) {
1726
+ didAwaitActCall = true;
1727
+ 0 === prevActScopeDepth
1728
+ ? ((ReactSharedInternals.actQueue = queue),
1729
+ enqueueTask(function () {
1730
+ return recursivelyFlushAsyncActWork(
1731
+ returnValue$jscomp$0,
1732
+ resolve,
1733
+ reject
1734
+ );
1735
+ }))
1736
+ : resolve(returnValue$jscomp$0);
1737
+ }
1738
+ };
1739
+ };
1740
+ exports$1.cache = function (fn) {
1741
+ return function () {
1742
+ return fn.apply(null, arguments);
1743
+ };
1744
+ };
1745
+ exports$1.cacheSignal = function () {
1746
+ return null;
1747
+ };
1748
+ exports$1.captureOwnerStack = function () {
1749
+ var getCurrentStack = ReactSharedInternals.getCurrentStack;
1750
+ return null === getCurrentStack ? null : getCurrentStack();
1751
+ };
1752
+ exports$1.cloneElement = function (element, config, children) {
1753
+ if (null === element || void 0 === element)
1754
+ throw Error(
1755
+ "The argument must be a React element, but you passed " +
1756
+ element +
1757
+ "."
1758
+ );
1759
+ var props = assign({}, element.props),
1760
+ key = element.key,
1761
+ owner = element._owner;
1762
+ if (null != config) {
1763
+ var JSCompiler_inline_result;
1764
+ a: {
1765
+ if (
1766
+ hasOwnProperty.call(config, "ref") &&
1767
+ (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1768
+ config,
1769
+ "ref"
1770
+ ).get) &&
1771
+ JSCompiler_inline_result.isReactWarning
1772
+ ) {
1773
+ JSCompiler_inline_result = false;
1774
+ break a;
1775
+ }
1776
+ JSCompiler_inline_result = void 0 !== config.ref;
1777
+ }
1778
+ JSCompiler_inline_result && (owner = getOwner());
1779
+ hasValidKey(config) &&
1780
+ (checkKeyStringCoercion(config.key), (key = "" + config.key));
1781
+ for (propName in config)
1782
+ !hasOwnProperty.call(config, propName) ||
1783
+ "key" === propName ||
1784
+ "__self" === propName ||
1785
+ "__source" === propName ||
1786
+ ("ref" === propName && void 0 === config.ref) ||
1787
+ (props[propName] = config[propName]);
1788
+ }
1789
+ var propName = arguments.length - 2;
1790
+ if (1 === propName) props.children = children;
1791
+ else if (1 < propName) {
1792
+ JSCompiler_inline_result = Array(propName);
1793
+ for (var i = 0; i < propName; i++)
1794
+ JSCompiler_inline_result[i] = arguments[i + 2];
1795
+ props.children = JSCompiler_inline_result;
1796
+ }
1797
+ props = ReactElement(
1798
+ element.type,
1799
+ key,
1800
+ props,
1801
+ owner,
1802
+ element._debugStack,
1803
+ element._debugTask
1804
+ );
1805
+ for (key = 2; key < arguments.length; key++)
1806
+ validateChildKeys(arguments[key]);
1807
+ return props;
1808
+ };
1809
+ exports$1.createContext = function (defaultValue) {
1810
+ defaultValue = {
1811
+ $$typeof: REACT_CONTEXT_TYPE,
1812
+ _currentValue: defaultValue,
1813
+ _currentValue2: defaultValue,
1814
+ _threadCount: 0,
1815
+ Provider: null,
1816
+ Consumer: null
1817
+ };
1818
+ defaultValue.Provider = defaultValue;
1819
+ defaultValue.Consumer = {
1820
+ $$typeof: REACT_CONSUMER_TYPE,
1821
+ _context: defaultValue
1822
+ };
1823
+ defaultValue._currentRenderer = null;
1824
+ defaultValue._currentRenderer2 = null;
1825
+ return defaultValue;
1826
+ };
1827
+ exports$1.createElement = function (type, config, children) {
1828
+ for (var i = 2; i < arguments.length; i++)
1829
+ validateChildKeys(arguments[i]);
1830
+ i = {};
1831
+ var key = null;
1832
+ if (null != config)
1833
+ for (propName in (didWarnAboutOldJSXRuntime ||
1834
+ !("__self" in config) ||
1835
+ "key" in config ||
1836
+ ((didWarnAboutOldJSXRuntime = true),
1837
+ console.warn(
1838
+ "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"
1839
+ )),
1840
+ hasValidKey(config) &&
1841
+ (checkKeyStringCoercion(config.key), (key = "" + config.key)),
1842
+ config))
1843
+ hasOwnProperty.call(config, propName) &&
1844
+ "key" !== propName &&
1845
+ "__self" !== propName &&
1846
+ "__source" !== propName &&
1847
+ (i[propName] = config[propName]);
1848
+ var childrenLength = arguments.length - 2;
1849
+ if (1 === childrenLength) i.children = children;
1850
+ else if (1 < childrenLength) {
1851
+ for (
1852
+ var childArray = Array(childrenLength), _i = 0;
1853
+ _i < childrenLength;
1854
+ _i++
1855
+ )
1856
+ childArray[_i] = arguments[_i + 2];
1857
+ Object.freeze && Object.freeze(childArray);
1858
+ i.children = childArray;
1859
+ }
1860
+ if (type && type.defaultProps)
1861
+ for (propName in ((childrenLength = type.defaultProps), childrenLength))
1862
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1863
+ key &&
1864
+ defineKeyPropWarningGetter(
1865
+ i,
1866
+ "function" === typeof type
1867
+ ? type.displayName || type.name || "Unknown"
1868
+ : type
1869
+ );
1870
+ var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1871
+ return ReactElement(
1872
+ type,
1873
+ key,
1874
+ i,
1875
+ getOwner(),
1876
+ propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1877
+ propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1878
+ );
1879
+ };
1880
+ exports$1.createRef = function () {
1881
+ var refObject = { current: null };
1882
+ Object.seal(refObject);
1883
+ return refObject;
1884
+ };
1885
+ exports$1.forwardRef = function (render) {
1886
+ null != render && render.$$typeof === REACT_MEMO_TYPE
1887
+ ? console.error(
1888
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1889
+ )
1890
+ : "function" !== typeof render
1891
+ ? console.error(
1892
+ "forwardRef requires a render function but was given %s.",
1893
+ null === render ? "null" : typeof render
1894
+ )
1895
+ : 0 !== render.length &&
1896
+ 2 !== render.length &&
1897
+ console.error(
1898
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1899
+ 1 === render.length
1900
+ ? "Did you forget to use the ref parameter?"
1901
+ : "Any additional parameter will be undefined."
1902
+ );
1903
+ null != render &&
1904
+ null != render.defaultProps &&
1905
+ console.error(
1906
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1907
+ );
1908
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },
1909
+ ownName;
1910
+ Object.defineProperty(elementType, "displayName", {
1911
+ enumerable: false,
1912
+ configurable: true,
1913
+ get: function () {
1914
+ return ownName;
1915
+ },
1916
+ set: function (name) {
1917
+ ownName = name;
1918
+ render.name ||
1919
+ render.displayName ||
1920
+ (Object.defineProperty(render, "name", { value: name }),
1921
+ (render.displayName = name));
1922
+ }
1923
+ });
1924
+ return elementType;
1925
+ };
1926
+ exports$1.isValidElement = isValidElement;
1927
+ exports$1.lazy = function (ctor) {
1928
+ ctor = { _status: -1, _result: ctor };
1929
+ var lazyType = {
1930
+ $$typeof: REACT_LAZY_TYPE,
1931
+ _payload: ctor,
1932
+ _init: lazyInitializer
1933
+ },
1934
+ ioInfo = {
1935
+ name: "lazy",
1936
+ start: -1,
1937
+ end: -1,
1938
+ value: null,
1939
+ owner: null,
1940
+ debugStack: Error("react-stack-top-frame"),
1941
+ debugTask: console.createTask ? console.createTask("lazy()") : null
1942
+ };
1943
+ ctor._ioInfo = ioInfo;
1944
+ lazyType._debugInfo = [{ awaited: ioInfo }];
1945
+ return lazyType;
1946
+ };
1947
+ exports$1.memo = function (type, compare) {
1948
+ null == type &&
1949
+ console.error(
1950
+ "memo: The first argument must be a component. Instead received: %s",
1951
+ null === type ? "null" : typeof type
1952
+ );
1953
+ compare = {
1954
+ $$typeof: REACT_MEMO_TYPE,
1955
+ type: type,
1956
+ compare: void 0 === compare ? null : compare
1957
+ };
1958
+ var ownName;
1959
+ Object.defineProperty(compare, "displayName", {
1960
+ enumerable: false,
1961
+ configurable: true,
1962
+ get: function () {
1963
+ return ownName;
1964
+ },
1965
+ set: function (name) {
1966
+ ownName = name;
1967
+ type.name ||
1968
+ type.displayName ||
1969
+ (Object.defineProperty(type, "name", { value: name }),
1970
+ (type.displayName = name));
1971
+ }
1972
+ });
1973
+ return compare;
1974
+ };
1975
+ exports$1.startTransition = function (scope) {
1976
+ var prevTransition = ReactSharedInternals.T,
1977
+ currentTransition = {};
1978
+ currentTransition._updatedFibers = new Set();
1979
+ ReactSharedInternals.T = currentTransition;
1980
+ try {
1981
+ var returnValue = scope(),
1982
+ onStartTransitionFinish = ReactSharedInternals.S;
1983
+ null !== onStartTransitionFinish &&
1984
+ onStartTransitionFinish(currentTransition, returnValue);
1985
+ "object" === typeof returnValue &&
1986
+ null !== returnValue &&
1987
+ "function" === typeof returnValue.then &&
1988
+ (ReactSharedInternals.asyncTransitions++,
1989
+ returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
1990
+ returnValue.then(noop, reportGlobalError));
1991
+ } catch (error) {
1992
+ reportGlobalError(error);
1993
+ } finally {
1994
+ null === prevTransition &&
1995
+ currentTransition._updatedFibers &&
1996
+ ((scope = currentTransition._updatedFibers.size),
1997
+ currentTransition._updatedFibers.clear(),
1998
+ 10 < scope &&
1999
+ console.warn(
2000
+ "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."
2001
+ )),
2002
+ null !== prevTransition &&
2003
+ null !== currentTransition.types &&
2004
+ (null !== prevTransition.types &&
2005
+ prevTransition.types !== currentTransition.types &&
2006
+ console.error(
2007
+ "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."
2008
+ ),
2009
+ (prevTransition.types = currentTransition.types)),
2010
+ (ReactSharedInternals.T = prevTransition);
2011
+ }
2012
+ };
2013
+ exports$1.unstable_useCacheRefresh = function () {
2014
+ return resolveDispatcher().useCacheRefresh();
2015
+ };
2016
+ exports$1.use = function (usable) {
2017
+ return resolveDispatcher().use(usable);
2018
+ };
2019
+ exports$1.useActionState = function (action, initialState, permalink) {
2020
+ return resolveDispatcher().useActionState(
2021
+ action,
2022
+ initialState,
2023
+ permalink
2024
+ );
2025
+ };
2026
+ exports$1.useCallback = function (callback, deps) {
2027
+ return resolveDispatcher().useCallback(callback, deps);
2028
+ };
2029
+ exports$1.useContext = function (Context) {
2030
+ var dispatcher = resolveDispatcher();
2031
+ Context.$$typeof === REACT_CONSUMER_TYPE &&
2032
+ console.error(
2033
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
2034
+ );
2035
+ return dispatcher.useContext(Context);
2036
+ };
2037
+ exports$1.useDebugValue = function (value, formatterFn) {
2038
+ return resolveDispatcher().useDebugValue(value, formatterFn);
2039
+ };
2040
+ exports$1.useDeferredValue = function (value, initialValue) {
2041
+ return resolveDispatcher().useDeferredValue(value, initialValue);
2042
+ };
2043
+ exports$1.useEffect = function (create, deps) {
2044
+ null == create &&
2045
+ console.warn(
2046
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2047
+ );
2048
+ return resolveDispatcher().useEffect(create, deps);
2049
+ };
2050
+ exports$1.useEffectEvent = function (callback) {
2051
+ return resolveDispatcher().useEffectEvent(callback);
2052
+ };
2053
+ exports$1.useId = function () {
2054
+ return resolveDispatcher().useId();
2055
+ };
2056
+ exports$1.useImperativeHandle = function (ref, create, deps) {
2057
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
2058
+ };
2059
+ exports$1.useInsertionEffect = function (create, deps) {
2060
+ null == create &&
2061
+ console.warn(
2062
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2063
+ );
2064
+ return resolveDispatcher().useInsertionEffect(create, deps);
2065
+ };
2066
+ exports$1.useLayoutEffect = function (create, deps) {
2067
+ null == create &&
2068
+ console.warn(
2069
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2070
+ );
2071
+ return resolveDispatcher().useLayoutEffect(create, deps);
2072
+ };
2073
+ exports$1.useMemo = function (create, deps) {
2074
+ return resolveDispatcher().useMemo(create, deps);
2075
+ };
2076
+ exports$1.useOptimistic = function (passthrough, reducer) {
2077
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
2078
+ };
2079
+ exports$1.useReducer = function (reducer, initialArg, init) {
2080
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
2081
+ };
2082
+ exports$1.useRef = function (initialValue) {
2083
+ return resolveDispatcher().useRef(initialValue);
2084
+ };
2085
+ exports$1.useState = function (initialState) {
2086
+ return resolveDispatcher().useState(initialState);
2087
+ };
2088
+ exports$1.useSyncExternalStore = function (
2089
+ subscribe,
2090
+ getSnapshot,
2091
+ getServerSnapshot
2092
+ ) {
2093
+ return resolveDispatcher().useSyncExternalStore(
2094
+ subscribe,
2095
+ getSnapshot,
2096
+ getServerSnapshot
2097
+ );
2098
+ };
2099
+ exports$1.useTransition = function () {
2100
+ return resolveDispatcher().useTransition();
2101
+ };
2102
+ exports$1.version = "19.2.4";
2103
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2104
+ "function" ===
2105
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
2106
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2107
+ })();
2108
+ } (react_development, react_development.exports));
2109
+ return react_development.exports;
2110
+ }
2111
+
2112
+ var hasRequiredReact;
2113
+
2114
+ function requireReact () {
2115
+ if (hasRequiredReact) return react.exports;
2116
+ hasRequiredReact = 1;
2117
+
2118
+ if (process.env.NODE_ENV === 'production') {
2119
+ react.exports = requireReact_production();
2120
+ } else {
2121
+ react.exports = requireReact_development();
2122
+ }
2123
+ return react.exports;
2124
+ }
2125
+
2126
+ var reactExports = requireReact();
2127
+ var React = /*@__PURE__*/getDefaultExportFromCjs(reactExports);
2128
+
2129
+ const QidSignInButton = ({ sdk, onSuccess, onError, className, buttonText = 'Login with QidCloud' }) => {
2130
+ const [modalOpen, setModalOpen] = reactExports.useState(false);
2131
+ const [qrData, setQrData] = reactExports.useState(null);
2132
+ const [loading, setLoading] = reactExports.useState(false);
2133
+ const startLogin = async () => {
2134
+ setLoading(true);
2135
+ try {
2136
+ const session = await sdk.auth.createSession();
2137
+ setQrData(session.qrData);
2138
+ setModalOpen(true);
2139
+ sdk.auth.listen(session.sessionId, async (token) => {
2140
+ const user = await sdk.auth.getProfile(token);
2141
+ setModalOpen(false);
2142
+ onSuccess(user, token);
2143
+ }, (err) => {
2144
+ if (onError)
2145
+ onError(err);
2146
+ setModalOpen(false);
2147
+ });
2148
+ }
2149
+ catch (err) {
2150
+ if (onError)
2151
+ onError(err.message || 'Failed to initiate login');
2152
+ }
2153
+ finally {
2154
+ setLoading(false);
2155
+ }
2156
+ };
2157
+ return (React.createElement(React.Fragment, null,
2158
+ React.createElement("button", { onClick: startLogin, disabled: loading, className: className || 'qid-signin-btn', style: {
2159
+ backgroundColor: '#00e5ff',
2160
+ color: '#000',
2161
+ padding: '10px 20px',
2162
+ borderRadius: '8px',
2163
+ border: 'none',
2164
+ fontWeight: 'bold',
2165
+ cursor: 'pointer',
2166
+ display: 'flex',
2167
+ alignItems: 'center',
2168
+ gap: '10px'
2169
+ } }, loading ? 'Initializing...' : buttonText),
2170
+ modalOpen && (React.createElement("div", { className: "qid-modal-overlay", style: {
2171
+ position: 'fixed',
2172
+ top: 0, left: 0, right: 0, bottom: 0,
2173
+ backgroundColor: 'rgba(0,0,0,0.8)',
2174
+ display: 'flex',
2175
+ justifyContent: 'center',
2176
+ alignItems: 'center',
2177
+ zIndex: 9999
2178
+ } },
2179
+ React.createElement("div", { className: "qid-modal-content", style: {
2180
+ backgroundColor: '#1a1a1a',
2181
+ padding: '30px',
2182
+ borderRadius: '16px',
2183
+ textAlign: 'center',
2184
+ color: '#fff',
2185
+ maxWidth: '400px',
2186
+ width: '90%'
2187
+ } },
2188
+ React.createElement("h2", { style: { marginBottom: '10px' } }, "Identity Handshake"),
2189
+ React.createElement("p", { style: { marginBottom: '20px', fontSize: '14px', color: '#ccc' } }, "Open your QidCloud Mobile App and scan this PQC-secured QR code."),
2190
+ React.createElement("div", { style: {
2191
+ backgroundColor: '#fff',
2192
+ padding: '10px',
2193
+ display: 'inline-block',
2194
+ borderRadius: '8px',
2195
+ marginBottom: '20px'
2196
+ } },
2197
+ React.createElement("div", { style: { color: '#000', fontSize: '12px', wordBreak: 'break-all', width: '200px' } },
2198
+ "QR: ",
2199
+ qrData)),
2200
+ React.createElement("button", { onClick: () => setModalOpen(false), style: {
2201
+ display: 'block',
2202
+ width: '100%',
2203
+ padding: '10px',
2204
+ backgroundColor: '#333',
2205
+ color: '#fff',
2206
+ border: 'none',
2207
+ borderRadius: '8px',
2208
+ cursor: 'pointer'
2209
+ } }, "Cancel"))))));
2210
+ };
2211
+
2212
+ class QidCloud {
2213
+ config;
2214
+ api;
2215
+ auth;
2216
+ db;
2217
+ edge;
2218
+ vault;
2219
+ logs;
2220
+ constructor(config) {
2221
+ this.config = {
2222
+ baseUrl: 'https://api.qidcloud.com',
2223
+ ...config,
2224
+ };
2225
+ this.api = axios.create({
2226
+ baseURL: this.config.baseUrl,
2227
+ headers: {
2228
+ 'x-api-key': this.config.apiKey,
2229
+ 'Content-Type': 'application/json',
2230
+ },
2231
+ });
2232
+ this.auth = new AuthModule(this);
2233
+ this.db = new DbModule(this);
2234
+ this.edge = new EdgeModule(this);
2235
+ this.vault = new VaultModule(this);
2236
+ this.logs = new LogsModule(this);
2237
+ }
2238
+ /**
2239
+ * Get the current project configuration
2240
+ */
2241
+ getConfig() {
2242
+ return { ...this.config };
2243
+ }
2244
+ }
2245
+
2246
+ exports.QidCloud = QidCloud;
2247
+ exports.QidSignInButton = QidSignInButton;
2248
+ exports.default = QidCloud;
2249
+ //# sourceMappingURL=index.js.map