@shogun-sdk/swap 0.0.2-test.1 → 0.0.2-test.10

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/react.cjs CHANGED
@@ -1,13 +1,8 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
6
  var __export = (target, all) => {
12
7
  for (var name in all)
13
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -20,1446 +15,13 @@ var __copyProps = (to, from, except, desc) => {
20
15
  }
21
16
  return to;
22
17
  };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
31
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
19
 
33
- // ../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react.production.js
34
- var require_react_production = __commonJS({
35
- "../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react.production.js"(exports2) {
36
- "use strict";
37
- var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
38
- var REACT_PORTAL_TYPE = Symbol.for("react.portal");
39
- var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
40
- var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
41
- var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
42
- var REACT_CONSUMER_TYPE = Symbol.for("react.consumer");
43
- var REACT_CONTEXT_TYPE = Symbol.for("react.context");
44
- var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
45
- var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
46
- var REACT_MEMO_TYPE = Symbol.for("react.memo");
47
- var REACT_LAZY_TYPE = Symbol.for("react.lazy");
48
- var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
49
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
50
- function getIteratorFn(maybeIterable) {
51
- if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
52
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
53
- return "function" === typeof maybeIterable ? maybeIterable : null;
54
- }
55
- var ReactNoopUpdateQueue = {
56
- isMounted: function() {
57
- return false;
58
- },
59
- enqueueForceUpdate: function() {
60
- },
61
- enqueueReplaceState: function() {
62
- },
63
- enqueueSetState: function() {
64
- }
65
- };
66
- var assign = Object.assign;
67
- var emptyObject = {};
68
- function Component(props, context, updater) {
69
- this.props = props;
70
- this.context = context;
71
- this.refs = emptyObject;
72
- this.updater = updater || ReactNoopUpdateQueue;
73
- }
74
- Component.prototype.isReactComponent = {};
75
- Component.prototype.setState = function(partialState, callback) {
76
- if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
77
- throw Error(
78
- "takes an object of state variables to update or a function which returns an object of state variables."
79
- );
80
- this.updater.enqueueSetState(this, partialState, callback, "setState");
81
- };
82
- Component.prototype.forceUpdate = function(callback) {
83
- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
84
- };
85
- function ComponentDummy() {
86
- }
87
- ComponentDummy.prototype = Component.prototype;
88
- function PureComponent(props, context, updater) {
89
- this.props = props;
90
- this.context = context;
91
- this.refs = emptyObject;
92
- this.updater = updater || ReactNoopUpdateQueue;
93
- }
94
- var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
95
- pureComponentPrototype.constructor = PureComponent;
96
- assign(pureComponentPrototype, Component.prototype);
97
- pureComponentPrototype.isPureReactComponent = true;
98
- var isArrayImpl = Array.isArray;
99
- function noop() {
100
- }
101
- var ReactSharedInternals = { H: null, A: null, T: null, S: null };
102
- var hasOwnProperty = Object.prototype.hasOwnProperty;
103
- function ReactElement(type, key, props) {
104
- var refProp = props.ref;
105
- return {
106
- $$typeof: REACT_ELEMENT_TYPE,
107
- type,
108
- key,
109
- ref: void 0 !== refProp ? refProp : null,
110
- props
111
- };
112
- }
113
- function cloneAndReplaceKey(oldElement, newKey) {
114
- return ReactElement(oldElement.type, newKey, oldElement.props);
115
- }
116
- function isValidElement(object) {
117
- return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
118
- }
119
- function escape(key) {
120
- var escaperLookup = { "=": "=0", ":": "=2" };
121
- return "$" + key.replace(/[=:]/g, function(match) {
122
- return escaperLookup[match];
123
- });
124
- }
125
- var userProvidedKeyEscapeRegex = /\/+/g;
126
- function getElementKey(element, index) {
127
- return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
128
- }
129
- function resolveThenable(thenable) {
130
- switch (thenable.status) {
131
- case "fulfilled":
132
- return thenable.value;
133
- case "rejected":
134
- throw thenable.reason;
135
- default:
136
- switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
137
- function(fulfilledValue) {
138
- "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
139
- },
140
- function(error) {
141
- "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
142
- }
143
- )), thenable.status) {
144
- case "fulfilled":
145
- return thenable.value;
146
- case "rejected":
147
- throw thenable.reason;
148
- }
149
- }
150
- throw thenable;
151
- }
152
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
153
- var type = typeof children;
154
- if ("undefined" === type || "boolean" === type) children = null;
155
- var invokeCallback = false;
156
- if (null === children) invokeCallback = true;
157
- else
158
- switch (type) {
159
- case "bigint":
160
- case "string":
161
- case "number":
162
- invokeCallback = true;
163
- break;
164
- case "object":
165
- switch (children.$$typeof) {
166
- case REACT_ELEMENT_TYPE:
167
- case REACT_PORTAL_TYPE:
168
- invokeCallback = true;
169
- break;
170
- case REACT_LAZY_TYPE:
171
- return invokeCallback = children._init, mapIntoArray(
172
- invokeCallback(children._payload),
173
- array,
174
- escapedPrefix,
175
- nameSoFar,
176
- callback
177
- );
178
- }
179
- }
180
- if (invokeCallback)
181
- return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
182
- return c;
183
- })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
184
- callback,
185
- escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
186
- userProvidedKeyEscapeRegex,
187
- "$&/"
188
- ) + "/") + invokeCallback
189
- )), array.push(callback)), 1;
190
- invokeCallback = 0;
191
- var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
192
- if (isArrayImpl(children))
193
- for (var i = 0; i < children.length; i++)
194
- nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
195
- nameSoFar,
196
- array,
197
- escapedPrefix,
198
- type,
199
- callback
200
- );
201
- else if (i = getIteratorFn(children), "function" === typeof i)
202
- for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
203
- nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
204
- nameSoFar,
205
- array,
206
- escapedPrefix,
207
- type,
208
- callback
209
- );
210
- else if ("object" === type) {
211
- if ("function" === typeof children.then)
212
- return mapIntoArray(
213
- resolveThenable(children),
214
- array,
215
- escapedPrefix,
216
- nameSoFar,
217
- callback
218
- );
219
- array = String(children);
220
- throw Error(
221
- "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
222
- );
223
- }
224
- return invokeCallback;
225
- }
226
- function mapChildren(children, func, context) {
227
- if (null == children) return children;
228
- var result = [], count = 0;
229
- mapIntoArray(children, result, "", "", function(child) {
230
- return func.call(context, child, count++);
231
- });
232
- return result;
233
- }
234
- function lazyInitializer(payload) {
235
- if (-1 === payload._status) {
236
- var ctor = payload._result;
237
- ctor = ctor();
238
- ctor.then(
239
- function(moduleObject) {
240
- if (0 === payload._status || -1 === payload._status)
241
- payload._status = 1, payload._result = moduleObject;
242
- },
243
- function(error) {
244
- if (0 === payload._status || -1 === payload._status)
245
- payload._status = 2, payload._result = error;
246
- }
247
- );
248
- -1 === payload._status && (payload._status = 0, payload._result = ctor);
249
- }
250
- if (1 === payload._status) return payload._result.default;
251
- throw payload._result;
252
- }
253
- var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
254
- if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
255
- var event = new window.ErrorEvent("error", {
256
- bubbles: true,
257
- cancelable: true,
258
- message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
259
- error
260
- });
261
- if (!window.dispatchEvent(event)) return;
262
- } else if ("object" === typeof process && "function" === typeof process.emit) {
263
- process.emit("uncaughtException", error);
264
- return;
265
- }
266
- console.error(error);
267
- };
268
- var Children = {
269
- map: mapChildren,
270
- forEach: function(children, forEachFunc, forEachContext) {
271
- mapChildren(
272
- children,
273
- function() {
274
- forEachFunc.apply(this, arguments);
275
- },
276
- forEachContext
277
- );
278
- },
279
- count: function(children) {
280
- var n = 0;
281
- mapChildren(children, function() {
282
- n++;
283
- });
284
- return n;
285
- },
286
- toArray: function(children) {
287
- return mapChildren(children, function(child) {
288
- return child;
289
- }) || [];
290
- },
291
- only: function(children) {
292
- if (!isValidElement(children))
293
- throw Error(
294
- "React.Children.only expected to receive a single React element child."
295
- );
296
- return children;
297
- }
298
- };
299
- exports2.Activity = REACT_ACTIVITY_TYPE;
300
- exports2.Children = Children;
301
- exports2.Component = Component;
302
- exports2.Fragment = REACT_FRAGMENT_TYPE;
303
- exports2.Profiler = REACT_PROFILER_TYPE;
304
- exports2.PureComponent = PureComponent;
305
- exports2.StrictMode = REACT_STRICT_MODE_TYPE;
306
- exports2.Suspense = REACT_SUSPENSE_TYPE;
307
- exports2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
308
- exports2.__COMPILER_RUNTIME = {
309
- __proto__: null,
310
- c: function(size) {
311
- return ReactSharedInternals.H.useMemoCache(size);
312
- }
313
- };
314
- exports2.cache = function(fn) {
315
- return function() {
316
- return fn.apply(null, arguments);
317
- };
318
- };
319
- exports2.cacheSignal = function() {
320
- return null;
321
- };
322
- exports2.cloneElement = function(element, config, children) {
323
- if (null === element || void 0 === element)
324
- throw Error(
325
- "The argument must be a React element, but you passed " + element + "."
326
- );
327
- var props = assign({}, element.props), key = element.key;
328
- if (null != config)
329
- for (propName in void 0 !== config.key && (key = "" + config.key), config)
330
- !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
331
- var propName = arguments.length - 2;
332
- if (1 === propName) props.children = children;
333
- else if (1 < propName) {
334
- for (var childArray = Array(propName), i = 0; i < propName; i++)
335
- childArray[i] = arguments[i + 2];
336
- props.children = childArray;
337
- }
338
- return ReactElement(element.type, key, props);
339
- };
340
- exports2.createContext = function(defaultValue) {
341
- defaultValue = {
342
- $$typeof: REACT_CONTEXT_TYPE,
343
- _currentValue: defaultValue,
344
- _currentValue2: defaultValue,
345
- _threadCount: 0,
346
- Provider: null,
347
- Consumer: null
348
- };
349
- defaultValue.Provider = defaultValue;
350
- defaultValue.Consumer = {
351
- $$typeof: REACT_CONSUMER_TYPE,
352
- _context: defaultValue
353
- };
354
- return defaultValue;
355
- };
356
- exports2.createElement = function(type, config, children) {
357
- var propName, props = {}, key = null;
358
- if (null != config)
359
- for (propName in void 0 !== config.key && (key = "" + config.key), config)
360
- hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
361
- var childrenLength = arguments.length - 2;
362
- if (1 === childrenLength) props.children = children;
363
- else if (1 < childrenLength) {
364
- for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
365
- childArray[i] = arguments[i + 2];
366
- props.children = childArray;
367
- }
368
- if (type && type.defaultProps)
369
- for (propName in childrenLength = type.defaultProps, childrenLength)
370
- void 0 === props[propName] && (props[propName] = childrenLength[propName]);
371
- return ReactElement(type, key, props);
372
- };
373
- exports2.createRef = function() {
374
- return { current: null };
375
- };
376
- exports2.forwardRef = function(render) {
377
- return { $$typeof: REACT_FORWARD_REF_TYPE, render };
378
- };
379
- exports2.isValidElement = isValidElement;
380
- exports2.lazy = function(ctor) {
381
- return {
382
- $$typeof: REACT_LAZY_TYPE,
383
- _payload: { _status: -1, _result: ctor },
384
- _init: lazyInitializer
385
- };
386
- };
387
- exports2.memo = function(type, compare) {
388
- return {
389
- $$typeof: REACT_MEMO_TYPE,
390
- type,
391
- compare: void 0 === compare ? null : compare
392
- };
393
- };
394
- exports2.startTransition = function(scope) {
395
- var prevTransition = ReactSharedInternals.T, currentTransition = {};
396
- ReactSharedInternals.T = currentTransition;
397
- try {
398
- var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
399
- null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
400
- "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
401
- } catch (error) {
402
- reportGlobalError(error);
403
- } finally {
404
- null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
405
- }
406
- };
407
- exports2.unstable_useCacheRefresh = function() {
408
- return ReactSharedInternals.H.useCacheRefresh();
409
- };
410
- exports2.use = function(usable) {
411
- return ReactSharedInternals.H.use(usable);
412
- };
413
- exports2.useActionState = function(action, initialState, permalink) {
414
- return ReactSharedInternals.H.useActionState(action, initialState, permalink);
415
- };
416
- exports2.useCallback = function(callback, deps) {
417
- return ReactSharedInternals.H.useCallback(callback, deps);
418
- };
419
- exports2.useContext = function(Context) {
420
- return ReactSharedInternals.H.useContext(Context);
421
- };
422
- exports2.useDebugValue = function() {
423
- };
424
- exports2.useDeferredValue = function(value, initialValue) {
425
- return ReactSharedInternals.H.useDeferredValue(value, initialValue);
426
- };
427
- exports2.useEffect = function(create, deps) {
428
- return ReactSharedInternals.H.useEffect(create, deps);
429
- };
430
- exports2.useEffectEvent = function(callback) {
431
- return ReactSharedInternals.H.useEffectEvent(callback);
432
- };
433
- exports2.useId = function() {
434
- return ReactSharedInternals.H.useId();
435
- };
436
- exports2.useImperativeHandle = function(ref, create, deps) {
437
- return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
438
- };
439
- exports2.useInsertionEffect = function(create, deps) {
440
- return ReactSharedInternals.H.useInsertionEffect(create, deps);
441
- };
442
- exports2.useLayoutEffect = function(create, deps) {
443
- return ReactSharedInternals.H.useLayoutEffect(create, deps);
444
- };
445
- exports2.useMemo = function(create, deps) {
446
- return ReactSharedInternals.H.useMemo(create, deps);
447
- };
448
- exports2.useOptimistic = function(passthrough, reducer) {
449
- return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
450
- };
451
- exports2.useReducer = function(reducer, initialArg, init) {
452
- return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
453
- };
454
- exports2.useRef = function(initialValue) {
455
- return ReactSharedInternals.H.useRef(initialValue);
456
- };
457
- exports2.useState = function(initialState) {
458
- return ReactSharedInternals.H.useState(initialState);
459
- };
460
- exports2.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
461
- return ReactSharedInternals.H.useSyncExternalStore(
462
- subscribe,
463
- getSnapshot,
464
- getServerSnapshot
465
- );
466
- };
467
- exports2.useTransition = function() {
468
- return ReactSharedInternals.H.useTransition();
469
- };
470
- exports2.version = "19.2.0";
471
- }
472
- });
473
-
474
- // ../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react.development.js
475
- var require_react_development = __commonJS({
476
- "../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react.development.js"(exports2, module2) {
477
- "use strict";
478
- "production" !== process.env.NODE_ENV && function() {
479
- function defineDeprecationWarning(methodName, info) {
480
- Object.defineProperty(Component.prototype, methodName, {
481
- get: function() {
482
- console.warn(
483
- "%s(...) is deprecated in plain JavaScript React classes. %s",
484
- info[0],
485
- info[1]
486
- );
487
- }
488
- });
489
- }
490
- function getIteratorFn(maybeIterable) {
491
- if (null === maybeIterable || "object" !== typeof maybeIterable)
492
- return null;
493
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
494
- return "function" === typeof maybeIterable ? maybeIterable : null;
495
- }
496
- function warnNoop(publicInstance, callerName) {
497
- publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
498
- var warningKey = publicInstance + "." + callerName;
499
- didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
500
- "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.",
501
- callerName,
502
- publicInstance
503
- ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
504
- }
505
- function Component(props, context, updater) {
506
- this.props = props;
507
- this.context = context;
508
- this.refs = emptyObject;
509
- this.updater = updater || ReactNoopUpdateQueue;
510
- }
511
- function ComponentDummy() {
512
- }
513
- function PureComponent(props, context, updater) {
514
- this.props = props;
515
- this.context = context;
516
- this.refs = emptyObject;
517
- this.updater = updater || ReactNoopUpdateQueue;
518
- }
519
- function noop() {
520
- }
521
- function testStringCoercion(value) {
522
- return "" + value;
523
- }
524
- function checkKeyStringCoercion(value) {
525
- try {
526
- testStringCoercion(value);
527
- var JSCompiler_inline_result = false;
528
- } catch (e) {
529
- JSCompiler_inline_result = true;
530
- }
531
- if (JSCompiler_inline_result) {
532
- JSCompiler_inline_result = console;
533
- var JSCompiler_temp_const = JSCompiler_inline_result.error;
534
- var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
535
- JSCompiler_temp_const.call(
536
- JSCompiler_inline_result,
537
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
538
- JSCompiler_inline_result$jscomp$0
539
- );
540
- return testStringCoercion(value);
541
- }
542
- }
543
- function getComponentNameFromType(type) {
544
- if (null == type) return null;
545
- if ("function" === typeof type)
546
- return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
547
- if ("string" === typeof type) return type;
548
- switch (type) {
549
- case REACT_FRAGMENT_TYPE:
550
- return "Fragment";
551
- case REACT_PROFILER_TYPE:
552
- return "Profiler";
553
- case REACT_STRICT_MODE_TYPE:
554
- return "StrictMode";
555
- case REACT_SUSPENSE_TYPE:
556
- return "Suspense";
557
- case REACT_SUSPENSE_LIST_TYPE:
558
- return "SuspenseList";
559
- case REACT_ACTIVITY_TYPE:
560
- return "Activity";
561
- }
562
- if ("object" === typeof type)
563
- switch ("number" === typeof type.tag && console.error(
564
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
565
- ), type.$$typeof) {
566
- case REACT_PORTAL_TYPE:
567
- return "Portal";
568
- case REACT_CONTEXT_TYPE:
569
- return type.displayName || "Context";
570
- case REACT_CONSUMER_TYPE:
571
- return (type._context.displayName || "Context") + ".Consumer";
572
- case REACT_FORWARD_REF_TYPE:
573
- var innerType = type.render;
574
- type = type.displayName;
575
- type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
576
- return type;
577
- case REACT_MEMO_TYPE:
578
- return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
579
- case REACT_LAZY_TYPE:
580
- innerType = type._payload;
581
- type = type._init;
582
- try {
583
- return getComponentNameFromType(type(innerType));
584
- } catch (x) {
585
- }
586
- }
587
- return null;
588
- }
589
- function getTaskName(type) {
590
- if (type === REACT_FRAGMENT_TYPE) return "<>";
591
- if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
592
- return "<...>";
593
- try {
594
- var name = getComponentNameFromType(type);
595
- return name ? "<" + name + ">" : "<...>";
596
- } catch (x) {
597
- return "<...>";
598
- }
599
- }
600
- function getOwner() {
601
- var dispatcher = ReactSharedInternals.A;
602
- return null === dispatcher ? null : dispatcher.getOwner();
603
- }
604
- function UnknownOwner() {
605
- return Error("react-stack-top-frame");
606
- }
607
- function hasValidKey(config) {
608
- if (hasOwnProperty.call(config, "key")) {
609
- var getter = Object.getOwnPropertyDescriptor(config, "key").get;
610
- if (getter && getter.isReactWarning) return false;
611
- }
612
- return void 0 !== config.key;
613
- }
614
- function defineKeyPropWarningGetter(props, displayName) {
615
- function warnAboutAccessingKey() {
616
- specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
617
- "%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)",
618
- displayName
619
- ));
620
- }
621
- warnAboutAccessingKey.isReactWarning = true;
622
- Object.defineProperty(props, "key", {
623
- get: warnAboutAccessingKey,
624
- configurable: true
625
- });
626
- }
627
- function elementRefGetterWithDeprecationWarning() {
628
- var componentName = getComponentNameFromType(this.type);
629
- didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
630
- "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."
631
- ));
632
- componentName = this.props.ref;
633
- return void 0 !== componentName ? componentName : null;
634
- }
635
- function ReactElement(type, key, props, owner, debugStack, debugTask) {
636
- var refProp = props.ref;
637
- type = {
638
- $$typeof: REACT_ELEMENT_TYPE,
639
- type,
640
- key,
641
- props,
642
- _owner: owner
643
- };
644
- null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
645
- enumerable: false,
646
- get: elementRefGetterWithDeprecationWarning
647
- }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
648
- type._store = {};
649
- Object.defineProperty(type._store, "validated", {
650
- configurable: false,
651
- enumerable: false,
652
- writable: true,
653
- value: 0
654
- });
655
- Object.defineProperty(type, "_debugInfo", {
656
- configurable: false,
657
- enumerable: false,
658
- writable: true,
659
- value: null
660
- });
661
- Object.defineProperty(type, "_debugStack", {
662
- configurable: false,
663
- enumerable: false,
664
- writable: true,
665
- value: debugStack
666
- });
667
- Object.defineProperty(type, "_debugTask", {
668
- configurable: false,
669
- enumerable: false,
670
- writable: true,
671
- value: debugTask
672
- });
673
- Object.freeze && (Object.freeze(type.props), Object.freeze(type));
674
- return type;
675
- }
676
- function cloneAndReplaceKey(oldElement, newKey) {
677
- newKey = ReactElement(
678
- oldElement.type,
679
- newKey,
680
- oldElement.props,
681
- oldElement._owner,
682
- oldElement._debugStack,
683
- oldElement._debugTask
684
- );
685
- oldElement._store && (newKey._store.validated = oldElement._store.validated);
686
- return newKey;
687
- }
688
- function validateChildKeys(node) {
689
- isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
690
- }
691
- function isValidElement(object) {
692
- return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
693
- }
694
- function escape(key) {
695
- var escaperLookup = { "=": "=0", ":": "=2" };
696
- return "$" + key.replace(/[=:]/g, function(match) {
697
- return escaperLookup[match];
698
- });
699
- }
700
- function getElementKey(element, index) {
701
- return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
702
- }
703
- function resolveThenable(thenable) {
704
- switch (thenable.status) {
705
- case "fulfilled":
706
- return thenable.value;
707
- case "rejected":
708
- throw thenable.reason;
709
- default:
710
- switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
711
- function(fulfilledValue) {
712
- "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
713
- },
714
- function(error) {
715
- "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
716
- }
717
- )), thenable.status) {
718
- case "fulfilled":
719
- return thenable.value;
720
- case "rejected":
721
- throw thenable.reason;
722
- }
723
- }
724
- throw thenable;
725
- }
726
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
727
- var type = typeof children;
728
- if ("undefined" === type || "boolean" === type) children = null;
729
- var invokeCallback = false;
730
- if (null === children) invokeCallback = true;
731
- else
732
- switch (type) {
733
- case "bigint":
734
- case "string":
735
- case "number":
736
- invokeCallback = true;
737
- break;
738
- case "object":
739
- switch (children.$$typeof) {
740
- case REACT_ELEMENT_TYPE:
741
- case REACT_PORTAL_TYPE:
742
- invokeCallback = true;
743
- break;
744
- case REACT_LAZY_TYPE:
745
- return invokeCallback = children._init, mapIntoArray(
746
- invokeCallback(children._payload),
747
- array,
748
- escapedPrefix,
749
- nameSoFar,
750
- callback
751
- );
752
- }
753
- }
754
- if (invokeCallback) {
755
- invokeCallback = children;
756
- callback = callback(invokeCallback);
757
- var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
758
- isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
759
- return c;
760
- })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
761
- callback,
762
- escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
763
- userProvidedKeyEscapeRegex,
764
- "$&/"
765
- ) + "/") + childKey
766
- ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
767
- return 1;
768
- }
769
- invokeCallback = 0;
770
- childKey = "" === nameSoFar ? "." : nameSoFar + ":";
771
- if (isArrayImpl(children))
772
- for (var i = 0; i < children.length; i++)
773
- nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
774
- nameSoFar,
775
- array,
776
- escapedPrefix,
777
- type,
778
- callback
779
- );
780
- else if (i = getIteratorFn(children), "function" === typeof i)
781
- for (i === children.entries && (didWarnAboutMaps || console.warn(
782
- "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
783
- ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
784
- nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
785
- nameSoFar,
786
- array,
787
- escapedPrefix,
788
- type,
789
- callback
790
- );
791
- else if ("object" === type) {
792
- if ("function" === typeof children.then)
793
- return mapIntoArray(
794
- resolveThenable(children),
795
- array,
796
- escapedPrefix,
797
- nameSoFar,
798
- callback
799
- );
800
- array = String(children);
801
- throw Error(
802
- "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
803
- );
804
- }
805
- return invokeCallback;
806
- }
807
- function mapChildren(children, func, context) {
808
- if (null == children) return children;
809
- var result = [], count = 0;
810
- mapIntoArray(children, result, "", "", function(child) {
811
- return func.call(context, child, count++);
812
- });
813
- return result;
814
- }
815
- function lazyInitializer(payload) {
816
- if (-1 === payload._status) {
817
- var ioInfo = payload._ioInfo;
818
- null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
819
- ioInfo = payload._result;
820
- var thenable = ioInfo();
821
- thenable.then(
822
- function(moduleObject) {
823
- if (0 === payload._status || -1 === payload._status) {
824
- payload._status = 1;
825
- payload._result = moduleObject;
826
- var _ioInfo = payload._ioInfo;
827
- null != _ioInfo && (_ioInfo.end = performance.now());
828
- void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
829
- }
830
- },
831
- function(error) {
832
- if (0 === payload._status || -1 === payload._status) {
833
- payload._status = 2;
834
- payload._result = error;
835
- var _ioInfo2 = payload._ioInfo;
836
- null != _ioInfo2 && (_ioInfo2.end = performance.now());
837
- void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
838
- }
839
- }
840
- );
841
- ioInfo = payload._ioInfo;
842
- if (null != ioInfo) {
843
- ioInfo.value = thenable;
844
- var displayName = thenable.displayName;
845
- "string" === typeof displayName && (ioInfo.name = displayName);
846
- }
847
- -1 === payload._status && (payload._status = 0, payload._result = thenable);
848
- }
849
- if (1 === payload._status)
850
- return ioInfo = payload._result, void 0 === ioInfo && console.error(
851
- "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?",
852
- ioInfo
853
- ), "default" in ioInfo || console.error(
854
- "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
855
- ioInfo
856
- ), ioInfo.default;
857
- throw payload._result;
858
- }
859
- function resolveDispatcher() {
860
- var dispatcher = ReactSharedInternals.H;
861
- null === dispatcher && console.error(
862
- "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."
863
- );
864
- return dispatcher;
865
- }
866
- function releaseAsyncTransition() {
867
- ReactSharedInternals.asyncTransitions--;
868
- }
869
- function enqueueTask(task) {
870
- if (null === enqueueTaskImpl)
871
- try {
872
- var requireString = ("require" + Math.random()).slice(0, 7);
873
- enqueueTaskImpl = (module2 && module2[requireString]).call(
874
- module2,
875
- "timers"
876
- ).setImmediate;
877
- } catch (_err) {
878
- enqueueTaskImpl = function(callback) {
879
- false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
880
- "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."
881
- ));
882
- var channel = new MessageChannel();
883
- channel.port1.onmessage = callback;
884
- channel.port2.postMessage(void 0);
885
- };
886
- }
887
- return enqueueTaskImpl(task);
888
- }
889
- function aggregateErrors(errors) {
890
- return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
891
- }
892
- function popActScope(prevActQueue, prevActScopeDepth) {
893
- prevActScopeDepth !== actScopeDepth - 1 && console.error(
894
- "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
895
- );
896
- actScopeDepth = prevActScopeDepth;
897
- }
898
- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
899
- var queue = ReactSharedInternals.actQueue;
900
- if (null !== queue)
901
- if (0 !== queue.length)
902
- try {
903
- flushActQueue(queue);
904
- enqueueTask(function() {
905
- return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
906
- });
907
- return;
908
- } catch (error) {
909
- ReactSharedInternals.thrownErrors.push(error);
910
- }
911
- else ReactSharedInternals.actQueue = null;
912
- 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
913
- }
914
- function flushActQueue(queue) {
915
- if (!isFlushing) {
916
- isFlushing = true;
917
- var i = 0;
918
- try {
919
- for (; i < queue.length; i++) {
920
- var callback = queue[i];
921
- do {
922
- ReactSharedInternals.didUsePromise = false;
923
- var continuation = callback(false);
924
- if (null !== continuation) {
925
- if (ReactSharedInternals.didUsePromise) {
926
- queue[i] = callback;
927
- queue.splice(0, i);
928
- return;
929
- }
930
- callback = continuation;
931
- } else break;
932
- } while (1);
933
- }
934
- queue.length = 0;
935
- } catch (error) {
936
- queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
937
- } finally {
938
- isFlushing = false;
939
- }
940
- }
941
- }
942
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
943
- var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
944
- isMounted: function() {
945
- return false;
946
- },
947
- enqueueForceUpdate: function(publicInstance) {
948
- warnNoop(publicInstance, "forceUpdate");
949
- },
950
- enqueueReplaceState: function(publicInstance) {
951
- warnNoop(publicInstance, "replaceState");
952
- },
953
- enqueueSetState: function(publicInstance) {
954
- warnNoop(publicInstance, "setState");
955
- }
956
- }, assign = Object.assign, emptyObject = {};
957
- Object.freeze(emptyObject);
958
- Component.prototype.isReactComponent = {};
959
- Component.prototype.setState = function(partialState, callback) {
960
- if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
961
- throw Error(
962
- "takes an object of state variables to update or a function which returns an object of state variables."
963
- );
964
- this.updater.enqueueSetState(this, partialState, callback, "setState");
965
- };
966
- Component.prototype.forceUpdate = function(callback) {
967
- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
968
- };
969
- var deprecatedAPIs = {
970
- isMounted: [
971
- "isMounted",
972
- "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
973
- ],
974
- replaceState: [
975
- "replaceState",
976
- "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
977
- ]
978
- };
979
- for (fnName in deprecatedAPIs)
980
- deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
981
- ComponentDummy.prototype = Component.prototype;
982
- deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
983
- deprecatedAPIs.constructor = PureComponent;
984
- assign(deprecatedAPIs, Component.prototype);
985
- deprecatedAPIs.isPureReactComponent = true;
986
- var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
987
- H: null,
988
- A: null,
989
- T: null,
990
- S: null,
991
- actQueue: null,
992
- asyncTransitions: 0,
993
- isBatchingLegacy: false,
994
- didScheduleLegacyUpdate: false,
995
- didUsePromise: false,
996
- thrownErrors: [],
997
- getCurrentStack: null,
998
- recentlyCreatedOwnerStacks: 0
999
- }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
1000
- return null;
1001
- };
1002
- deprecatedAPIs = {
1003
- react_stack_bottom_frame: function(callStackForError) {
1004
- return callStackForError();
1005
- }
1006
- };
1007
- var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
1008
- var didWarnAboutElementRef = {};
1009
- var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
1010
- deprecatedAPIs,
1011
- UnknownOwner
1012
- )();
1013
- var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
1014
- var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
1015
- if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
1016
- var event = new window.ErrorEvent("error", {
1017
- bubbles: true,
1018
- cancelable: true,
1019
- message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
1020
- error
1021
- });
1022
- if (!window.dispatchEvent(event)) return;
1023
- } else if ("object" === typeof process && "function" === typeof process.emit) {
1024
- process.emit("uncaughtException", error);
1025
- return;
1026
- }
1027
- console.error(error);
1028
- }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
1029
- queueMicrotask(function() {
1030
- return queueMicrotask(callback);
1031
- });
1032
- } : enqueueTask;
1033
- deprecatedAPIs = Object.freeze({
1034
- __proto__: null,
1035
- c: function(size) {
1036
- return resolveDispatcher().useMemoCache(size);
1037
- }
1038
- });
1039
- var fnName = {
1040
- map: mapChildren,
1041
- forEach: function(children, forEachFunc, forEachContext) {
1042
- mapChildren(
1043
- children,
1044
- function() {
1045
- forEachFunc.apply(this, arguments);
1046
- },
1047
- forEachContext
1048
- );
1049
- },
1050
- count: function(children) {
1051
- var n = 0;
1052
- mapChildren(children, function() {
1053
- n++;
1054
- });
1055
- return n;
1056
- },
1057
- toArray: function(children) {
1058
- return mapChildren(children, function(child) {
1059
- return child;
1060
- }) || [];
1061
- },
1062
- only: function(children) {
1063
- if (!isValidElement(children))
1064
- throw Error(
1065
- "React.Children.only expected to receive a single React element child."
1066
- );
1067
- return children;
1068
- }
1069
- };
1070
- exports2.Activity = REACT_ACTIVITY_TYPE;
1071
- exports2.Children = fnName;
1072
- exports2.Component = Component;
1073
- exports2.Fragment = REACT_FRAGMENT_TYPE;
1074
- exports2.Profiler = REACT_PROFILER_TYPE;
1075
- exports2.PureComponent = PureComponent;
1076
- exports2.StrictMode = REACT_STRICT_MODE_TYPE;
1077
- exports2.Suspense = REACT_SUSPENSE_TYPE;
1078
- exports2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
1079
- exports2.__COMPILER_RUNTIME = deprecatedAPIs;
1080
- exports2.act = function(callback) {
1081
- var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
1082
- actScopeDepth++;
1083
- var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
1084
- try {
1085
- var result = callback();
1086
- } catch (error) {
1087
- ReactSharedInternals.thrownErrors.push(error);
1088
- }
1089
- if (0 < ReactSharedInternals.thrownErrors.length)
1090
- throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1091
- if (null !== result && "object" === typeof result && "function" === typeof result.then) {
1092
- var thenable = result;
1093
- queueSeveralMicrotasks(function() {
1094
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1095
- "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 () => ...);"
1096
- ));
1097
- });
1098
- return {
1099
- then: function(resolve, reject) {
1100
- didAwaitActCall = true;
1101
- thenable.then(
1102
- function(returnValue) {
1103
- popActScope(prevActQueue, prevActScopeDepth);
1104
- if (0 === prevActScopeDepth) {
1105
- try {
1106
- flushActQueue(queue), enqueueTask(function() {
1107
- return recursivelyFlushAsyncActWork(
1108
- returnValue,
1109
- resolve,
1110
- reject
1111
- );
1112
- });
1113
- } catch (error$0) {
1114
- ReactSharedInternals.thrownErrors.push(error$0);
1115
- }
1116
- if (0 < ReactSharedInternals.thrownErrors.length) {
1117
- var _thrownError = aggregateErrors(
1118
- ReactSharedInternals.thrownErrors
1119
- );
1120
- ReactSharedInternals.thrownErrors.length = 0;
1121
- reject(_thrownError);
1122
- }
1123
- } else resolve(returnValue);
1124
- },
1125
- function(error) {
1126
- popActScope(prevActQueue, prevActScopeDepth);
1127
- 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
1128
- ReactSharedInternals.thrownErrors
1129
- ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
1130
- }
1131
- );
1132
- }
1133
- };
1134
- }
1135
- var returnValue$jscomp$0 = result;
1136
- popActScope(prevActQueue, prevActScopeDepth);
1137
- 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
1138
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
1139
- "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(() => ...)"
1140
- ));
1141
- }), ReactSharedInternals.actQueue = null);
1142
- if (0 < ReactSharedInternals.thrownErrors.length)
1143
- throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
1144
- return {
1145
- then: function(resolve, reject) {
1146
- didAwaitActCall = true;
1147
- 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
1148
- return recursivelyFlushAsyncActWork(
1149
- returnValue$jscomp$0,
1150
- resolve,
1151
- reject
1152
- );
1153
- })) : resolve(returnValue$jscomp$0);
1154
- }
1155
- };
1156
- };
1157
- exports2.cache = function(fn) {
1158
- return function() {
1159
- return fn.apply(null, arguments);
1160
- };
1161
- };
1162
- exports2.cacheSignal = function() {
1163
- return null;
1164
- };
1165
- exports2.captureOwnerStack = function() {
1166
- var getCurrentStack = ReactSharedInternals.getCurrentStack;
1167
- return null === getCurrentStack ? null : getCurrentStack();
1168
- };
1169
- exports2.cloneElement = function(element, config, children) {
1170
- if (null === element || void 0 === element)
1171
- throw Error(
1172
- "The argument must be a React element, but you passed " + element + "."
1173
- );
1174
- var props = assign({}, element.props), key = element.key, owner = element._owner;
1175
- if (null != config) {
1176
- var JSCompiler_inline_result;
1177
- a: {
1178
- if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1179
- config,
1180
- "ref"
1181
- ).get) && JSCompiler_inline_result.isReactWarning) {
1182
- JSCompiler_inline_result = false;
1183
- break a;
1184
- }
1185
- JSCompiler_inline_result = void 0 !== config.ref;
1186
- }
1187
- JSCompiler_inline_result && (owner = getOwner());
1188
- hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
1189
- for (propName in config)
1190
- !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
1191
- }
1192
- var propName = arguments.length - 2;
1193
- if (1 === propName) props.children = children;
1194
- else if (1 < propName) {
1195
- JSCompiler_inline_result = Array(propName);
1196
- for (var i = 0; i < propName; i++)
1197
- JSCompiler_inline_result[i] = arguments[i + 2];
1198
- props.children = JSCompiler_inline_result;
1199
- }
1200
- props = ReactElement(
1201
- element.type,
1202
- key,
1203
- props,
1204
- owner,
1205
- element._debugStack,
1206
- element._debugTask
1207
- );
1208
- for (key = 2; key < arguments.length; key++)
1209
- validateChildKeys(arguments[key]);
1210
- return props;
1211
- };
1212
- exports2.createContext = function(defaultValue) {
1213
- defaultValue = {
1214
- $$typeof: REACT_CONTEXT_TYPE,
1215
- _currentValue: defaultValue,
1216
- _currentValue2: defaultValue,
1217
- _threadCount: 0,
1218
- Provider: null,
1219
- Consumer: null
1220
- };
1221
- defaultValue.Provider = defaultValue;
1222
- defaultValue.Consumer = {
1223
- $$typeof: REACT_CONSUMER_TYPE,
1224
- _context: defaultValue
1225
- };
1226
- defaultValue._currentRenderer = null;
1227
- defaultValue._currentRenderer2 = null;
1228
- return defaultValue;
1229
- };
1230
- exports2.createElement = function(type, config, children) {
1231
- for (var i = 2; i < arguments.length; i++)
1232
- validateChildKeys(arguments[i]);
1233
- i = {};
1234
- var key = null;
1235
- if (null != config)
1236
- for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
1237
- "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"
1238
- )), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
1239
- hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
1240
- var childrenLength = arguments.length - 2;
1241
- if (1 === childrenLength) i.children = children;
1242
- else if (1 < childrenLength) {
1243
- for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
1244
- childArray[_i] = arguments[_i + 2];
1245
- Object.freeze && Object.freeze(childArray);
1246
- i.children = childArray;
1247
- }
1248
- if (type && type.defaultProps)
1249
- for (propName in childrenLength = type.defaultProps, childrenLength)
1250
- void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1251
- key && defineKeyPropWarningGetter(
1252
- i,
1253
- "function" === typeof type ? type.displayName || type.name || "Unknown" : type
1254
- );
1255
- var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
1256
- return ReactElement(
1257
- type,
1258
- key,
1259
- i,
1260
- getOwner(),
1261
- propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
1262
- propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
1263
- );
1264
- };
1265
- exports2.createRef = function() {
1266
- var refObject = { current: null };
1267
- Object.seal(refObject);
1268
- return refObject;
1269
- };
1270
- exports2.forwardRef = function(render) {
1271
- null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
1272
- "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1273
- ) : "function" !== typeof render ? console.error(
1274
- "forwardRef requires a render function but was given %s.",
1275
- null === render ? "null" : typeof render
1276
- ) : 0 !== render.length && 2 !== render.length && console.error(
1277
- "forwardRef render functions accept exactly two parameters: props and ref. %s",
1278
- 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
1279
- );
1280
- null != render && null != render.defaultProps && console.error(
1281
- "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1282
- );
1283
- var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
1284
- Object.defineProperty(elementType, "displayName", {
1285
- enumerable: false,
1286
- configurable: true,
1287
- get: function() {
1288
- return ownName;
1289
- },
1290
- set: function(name) {
1291
- ownName = name;
1292
- render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
1293
- }
1294
- });
1295
- return elementType;
1296
- };
1297
- exports2.isValidElement = isValidElement;
1298
- exports2.lazy = function(ctor) {
1299
- ctor = { _status: -1, _result: ctor };
1300
- var lazyType = {
1301
- $$typeof: REACT_LAZY_TYPE,
1302
- _payload: ctor,
1303
- _init: lazyInitializer
1304
- }, ioInfo = {
1305
- name: "lazy",
1306
- start: -1,
1307
- end: -1,
1308
- value: null,
1309
- owner: null,
1310
- debugStack: Error("react-stack-top-frame"),
1311
- debugTask: console.createTask ? console.createTask("lazy()") : null
1312
- };
1313
- ctor._ioInfo = ioInfo;
1314
- lazyType._debugInfo = [{ awaited: ioInfo }];
1315
- return lazyType;
1316
- };
1317
- exports2.memo = function(type, compare) {
1318
- null == type && console.error(
1319
- "memo: The first argument must be a component. Instead received: %s",
1320
- null === type ? "null" : typeof type
1321
- );
1322
- compare = {
1323
- $$typeof: REACT_MEMO_TYPE,
1324
- type,
1325
- compare: void 0 === compare ? null : compare
1326
- };
1327
- var ownName;
1328
- Object.defineProperty(compare, "displayName", {
1329
- enumerable: false,
1330
- configurable: true,
1331
- get: function() {
1332
- return ownName;
1333
- },
1334
- set: function(name) {
1335
- ownName = name;
1336
- type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
1337
- }
1338
- });
1339
- return compare;
1340
- };
1341
- exports2.startTransition = function(scope) {
1342
- var prevTransition = ReactSharedInternals.T, currentTransition = {};
1343
- currentTransition._updatedFibers = /* @__PURE__ */ new Set();
1344
- ReactSharedInternals.T = currentTransition;
1345
- try {
1346
- var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
1347
- null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
1348
- "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
1349
- } catch (error) {
1350
- reportGlobalError(error);
1351
- } finally {
1352
- null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
1353
- "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."
1354
- )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
1355
- "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."
1356
- ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
1357
- }
1358
- };
1359
- exports2.unstable_useCacheRefresh = function() {
1360
- return resolveDispatcher().useCacheRefresh();
1361
- };
1362
- exports2.use = function(usable) {
1363
- return resolveDispatcher().use(usable);
1364
- };
1365
- exports2.useActionState = function(action, initialState, permalink) {
1366
- return resolveDispatcher().useActionState(
1367
- action,
1368
- initialState,
1369
- permalink
1370
- );
1371
- };
1372
- exports2.useCallback = function(callback, deps) {
1373
- return resolveDispatcher().useCallback(callback, deps);
1374
- };
1375
- exports2.useContext = function(Context) {
1376
- var dispatcher = resolveDispatcher();
1377
- Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
1378
- "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1379
- );
1380
- return dispatcher.useContext(Context);
1381
- };
1382
- exports2.useDebugValue = function(value, formatterFn) {
1383
- return resolveDispatcher().useDebugValue(value, formatterFn);
1384
- };
1385
- exports2.useDeferredValue = function(value, initialValue) {
1386
- return resolveDispatcher().useDeferredValue(value, initialValue);
1387
- };
1388
- exports2.useEffect = function(create, deps) {
1389
- null == create && console.warn(
1390
- "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1391
- );
1392
- return resolveDispatcher().useEffect(create, deps);
1393
- };
1394
- exports2.useEffectEvent = function(callback) {
1395
- return resolveDispatcher().useEffectEvent(callback);
1396
- };
1397
- exports2.useId = function() {
1398
- return resolveDispatcher().useId();
1399
- };
1400
- exports2.useImperativeHandle = function(ref, create, deps) {
1401
- return resolveDispatcher().useImperativeHandle(ref, create, deps);
1402
- };
1403
- exports2.useInsertionEffect = function(create, deps) {
1404
- null == create && console.warn(
1405
- "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1406
- );
1407
- return resolveDispatcher().useInsertionEffect(create, deps);
1408
- };
1409
- exports2.useLayoutEffect = function(create, deps) {
1410
- null == create && console.warn(
1411
- "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
1412
- );
1413
- return resolveDispatcher().useLayoutEffect(create, deps);
1414
- };
1415
- exports2.useMemo = function(create, deps) {
1416
- return resolveDispatcher().useMemo(create, deps);
1417
- };
1418
- exports2.useOptimistic = function(passthrough, reducer) {
1419
- return resolveDispatcher().useOptimistic(passthrough, reducer);
1420
- };
1421
- exports2.useReducer = function(reducer, initialArg, init) {
1422
- return resolveDispatcher().useReducer(reducer, initialArg, init);
1423
- };
1424
- exports2.useRef = function(initialValue) {
1425
- return resolveDispatcher().useRef(initialValue);
1426
- };
1427
- exports2.useState = function(initialState) {
1428
- return resolveDispatcher().useState(initialState);
1429
- };
1430
- exports2.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
1431
- return resolveDispatcher().useSyncExternalStore(
1432
- subscribe,
1433
- getSnapshot,
1434
- getServerSnapshot
1435
- );
1436
- };
1437
- exports2.useTransition = function() {
1438
- return resolveDispatcher().useTransition();
1439
- };
1440
- exports2.version = "19.2.0";
1441
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1442
- }();
1443
- }
1444
- });
1445
-
1446
- // ../../node_modules/.pnpm/react@19.2.0/node_modules/react/index.js
1447
- var require_react = __commonJS({
1448
- "../../node_modules/.pnpm/react@19.2.0/node_modules/react/index.js"(exports2, module2) {
1449
- "use strict";
1450
- if (process.env.NODE_ENV === "production") {
1451
- module2.exports = require_react_production();
1452
- } else {
1453
- module2.exports = require_react_development();
1454
- }
1455
- }
1456
- });
1457
-
1458
20
  // src/react/index.ts
1459
21
  var react_exports = {};
1460
22
  __export(react_exports, {
1461
- ChainID: () => import_intents_sdk10.ChainID,
1462
- isEvmChain: () => import_intents_sdk10.isEvmChain,
23
+ ChainID: () => import_intents_sdk11.ChainID,
24
+ isEvmChain: () => import_intents_sdk11.isEvmChain,
1463
25
  useBalances: () => useBalances,
1464
26
  useExecuteOrder: () => useExecuteOrder,
1465
27
  useQuote: () => useQuote,
@@ -1468,7 +30,7 @@ __export(react_exports, {
1468
30
  module.exports = __toCommonJS(react_exports);
1469
31
 
1470
32
  // src/react/useTokenList.ts
1471
- var import_react = __toESM(require_react(), 1);
33
+ var import_react = require("react");
1472
34
 
1473
35
  // src/core/token-list.ts
1474
36
  var import_intents_sdk = require("@shogun-sdk/intents-sdk");
@@ -1547,10 +109,10 @@ function useTokenList(params) {
1547
109
  }
1548
110
 
1549
111
  // src/react/useExecuteOrder.ts
1550
- var import_react2 = __toESM(require_react(), 1);
112
+ var import_react2 = require("react");
1551
113
 
1552
114
  // src/core/executeOrder/execute.ts
1553
- var import_intents_sdk7 = require("@shogun-sdk/intents-sdk");
115
+ var import_intents_sdk8 = require("@shogun-sdk/intents-sdk");
1554
116
  var import_viem3 = require("viem");
1555
117
 
1556
118
  // src/utils/address.ts
@@ -1715,7 +277,7 @@ var adaptViemWallet = (wallet) => {
1715
277
  };
1716
278
 
1717
279
  // src/core/executeOrder/handleEvmExecution.ts
1718
- var import_intents_sdk5 = require("@shogun-sdk/intents-sdk");
280
+ var import_intents_sdk6 = require("@shogun-sdk/intents-sdk");
1719
281
  var import_viem2 = require("viem");
1720
282
 
1721
283
  // src/core/executeOrder/normalizeNative.ts
@@ -1735,10 +297,12 @@ var DEFAULT_STAGE_MESSAGES = {
1735
297
  processing: "Preparing transaction for execution",
1736
298
  approving: "Approving token allowance",
1737
299
  approved: "Token approved successfully",
1738
- signing: "Signing order for submission",
1739
- submitting: "Submitting order to Auctioneer",
1740
- success: "Order executed successfully",
1741
- error: "Order execution failed"
300
+ signing: "Signing transaction for submission",
301
+ submitting: "Submitting transaction",
302
+ initiated: "Transaction initiated.",
303
+ success: "Transaction Executed successfully",
304
+ shogun_processing: "Shogun is processing your transaction",
305
+ error: "Transaction failed during submission"
1742
306
  };
1743
307
 
1744
308
  // src/core/executeOrder/buildOrder.ts
@@ -1777,6 +341,95 @@ async function buildOrder({
1777
341
  });
1778
342
  }
1779
343
 
344
+ // src/utils/pollOrderStatus.ts
345
+ var import_intents_sdk5 = require("@shogun-sdk/intents-sdk");
346
+ async function pollOrderStatus(jwt, orderId, options = {}) {
347
+ const { intervalMs = 2e3, timeoutMs = 3e5 } = options;
348
+ const startTime = Date.now();
349
+ return new Promise((resolve, reject) => {
350
+ const pollInterval = setInterval(async () => {
351
+ try {
352
+ if (Date.now() - startTime > timeoutMs) {
353
+ clearInterval(pollInterval);
354
+ return resolve("Timeout");
355
+ }
356
+ const res = await fetch(`${import_intents_sdk5.AUCTIONEER_URL}/user_intent`, {
357
+ method: "GET",
358
+ headers: {
359
+ Authorization: `Bearer ${jwt}`,
360
+ "Content-Type": "application/json"
361
+ }
362
+ });
363
+ if (!res.ok) {
364
+ clearInterval(pollInterval);
365
+ return reject(
366
+ new Error(`Failed to fetch orders: ${res.status} ${res.statusText}`)
367
+ );
368
+ }
369
+ const json = await res.json();
370
+ const data = json?.data ?? {};
371
+ const allOrders = [
372
+ ...data.crossChainDcaOrders ?? [],
373
+ ...data.crossChainLimitOrders ?? [],
374
+ ...data.singleChainDcaOrders ?? [],
375
+ ...data.singleChainLimitOrders ?? []
376
+ ];
377
+ const targetOrder = allOrders.find((o) => o.orderId === orderId);
378
+ if (!targetOrder) {
379
+ clearInterval(pollInterval);
380
+ return resolve("NotFound");
381
+ }
382
+ const { orderStatus } = targetOrder;
383
+ if (orderStatus === "Fulfilled" || orderStatus === "Cancelled" || orderStatus === "Outdated") {
384
+ clearInterval(pollInterval);
385
+ return resolve(orderStatus);
386
+ }
387
+ } catch (error) {
388
+ clearInterval(pollInterval);
389
+ return reject(error);
390
+ }
391
+ }, intervalMs);
392
+ });
393
+ }
394
+
395
+ // src/core/executeOrder/handleOrderPollingResult.ts
396
+ async function handleOrderPollingResult({
397
+ status,
398
+ orderId,
399
+ chainId,
400
+ update,
401
+ messageFor
402
+ }) {
403
+ switch (status) {
404
+ case "Fulfilled":
405
+ update("success", messageFor("success"));
406
+ return {
407
+ status: true,
408
+ orderId,
409
+ chainId,
410
+ finalStatus: status,
411
+ stage: "success"
412
+ };
413
+ case "Cancelled":
414
+ update("error", "Order was cancelled before fulfillment");
415
+ break;
416
+ case "Timeout":
417
+ update("error", "Order polling timed out");
418
+ break;
419
+ case "NotFound":
420
+ default:
421
+ update("error", "Order not found");
422
+ break;
423
+ }
424
+ return {
425
+ status: false,
426
+ orderId,
427
+ chainId,
428
+ finalStatus: status,
429
+ stage: "error"
430
+ };
431
+ }
432
+
1780
433
  // src/core/executeOrder/handleEvmExecution.ts
1781
434
  async function handleEvmExecution({
1782
435
  recipientAddress,
@@ -1805,18 +458,18 @@ async function handleEvmExecution({
1805
458
  from: accountAddress
1806
459
  });
1807
460
  }
1808
- update("approving", messageFor("approving"));
461
+ update("processing", messageFor("approving"));
1809
462
  await wallet.sendTransaction({
1810
463
  to: tokenIn,
1811
464
  data: (0, import_viem2.encodeFunctionData)({
1812
465
  abi: import_viem2.erc20Abi,
1813
466
  functionName: "approve",
1814
- args: [import_intents_sdk5.PERMIT2_ADDRESS[chainId], BigInt(quote.amountIn)]
467
+ args: [import_intents_sdk6.PERMIT2_ADDRESS[chainId], BigInt(quote.amountIn)]
1815
468
  }),
1816
469
  value: 0n,
1817
470
  from: accountAddress
1818
471
  });
1819
- update("approved", messageFor("approved"));
472
+ update("processing", messageFor("approved"));
1820
473
  const destination = recipientAddress ?? accountAddress;
1821
474
  const order = await buildOrder({
1822
475
  quote,
@@ -1825,23 +478,32 @@ async function handleEvmExecution({
1825
478
  deadline,
1826
479
  isSingleChain
1827
480
  });
1828
- update("signing", messageFor("signing"));
1829
- const { orderTypedData, nonce } = isSingleChain ? await (0, import_intents_sdk5.getEVMSingleChainOrderTypedData)(order) : await (0, import_intents_sdk5.getEVMCrossChainOrderTypedData)(order);
481
+ update("processing", messageFor("signing"));
482
+ const { orderTypedData, nonce } = isSingleChain ? await (0, import_intents_sdk6.getEVMSingleChainOrderTypedData)(order) : await (0, import_intents_sdk6.getEVMCrossChainOrderTypedData)(order);
1830
483
  if (!wallet.signTypedData) {
1831
484
  throw new Error("Wallet does not support EIP-712 signing");
1832
485
  }
1833
486
  const signature = await wallet.signTypedData(serializeBigIntsToStrings(orderTypedData));
1834
- update("submitting", messageFor("submitting"));
487
+ update("processing", messageFor("submitting"));
1835
488
  const res = await order.sendToAuctioneer({ signature, nonce: nonce.toString() });
1836
489
  if (!res.success) {
1837
490
  throw new Error("Auctioneer submission failed");
1838
491
  }
1839
- update("success", messageFor("success"));
1840
- return { status: true, txHash: res.data, chainId, stage: "success" };
492
+ update("initiated", messageFor("initiated"));
493
+ const { jwt, intentId: orderId } = res.data;
494
+ update("initiated", messageFor("shogun_processing"));
495
+ const status = await pollOrderStatus(jwt, orderId);
496
+ return await handleOrderPollingResult({
497
+ status,
498
+ orderId,
499
+ chainId,
500
+ update,
501
+ messageFor
502
+ });
1841
503
  }
1842
504
 
1843
505
  // src/core/executeOrder/handleSolanaExecution.ts
1844
- var import_intents_sdk6 = require("@shogun-sdk/intents-sdk");
506
+ var import_intents_sdk7 = require("@shogun-sdk/intents-sdk");
1845
507
  var import_web3 = require("@solana/web3.js");
1846
508
  async function handleSolanaExecution({
1847
509
  recipientAddress,
@@ -1871,10 +533,9 @@ async function handleSolanaExecution({
1871
533
  rpcUrl: wallet.rpcUrl
1872
534
  });
1873
535
  const transaction = import_web3.VersionedTransaction.deserialize(Uint8Array.from(txData.txBytes));
1874
- update("signing", messageFor("signing"));
1875
- console.log({ order });
1876
- const txSignature = await wallet.sendTransaction(transaction);
1877
- update("submitting", messageFor("submitting"));
536
+ update("processing", messageFor("signing"));
537
+ await wallet.sendTransaction(transaction);
538
+ update("processing", messageFor("submitting"));
1878
539
  const response = await submitToAuctioneer({
1879
540
  order,
1880
541
  isSingleChain,
@@ -1883,13 +544,17 @@ async function handleSolanaExecution({
1883
544
  if (!response.success) {
1884
545
  throw new Error("Auctioneer submission failed");
1885
546
  }
1886
- update("success", messageFor("success"));
1887
- return {
1888
- status: true,
1889
- txHash: txSignature,
1890
- chainId: import_intents_sdk6.ChainID.Solana,
1891
- stage: "success"
1892
- };
547
+ update("initiated", messageFor("initiated"));
548
+ const { jwt, intentId: orderId } = response.data;
549
+ update("initiated", messageFor("shogun_processing"));
550
+ const status = await pollOrderStatus(jwt, orderId);
551
+ return await handleOrderPollingResult({
552
+ status,
553
+ orderId,
554
+ chainId: SOLANA_CHAIN_ID,
555
+ update,
556
+ messageFor
557
+ });
1893
558
  }
1894
559
  async function getSolanaOrderInstructions({
1895
560
  order,
@@ -1897,11 +562,11 @@ async function getSolanaOrderInstructions({
1897
562
  rpcUrl
1898
563
  }) {
1899
564
  if (isSingleChain) {
1900
- return await (0, import_intents_sdk6.getSolanaSingleChainOrderInstructions)(order, {
565
+ return await (0, import_intents_sdk7.getSolanaSingleChainOrderInstructions)(order, {
1901
566
  rpcUrl
1902
567
  });
1903
568
  }
1904
- return await (0, import_intents_sdk6.getSolanaCrossChainOrderInstructions)(order, {
569
+ return await (0, import_intents_sdk7.getSolanaCrossChainOrderInstructions)(order, {
1905
570
  rpcUrl
1906
571
  });
1907
572
  }
@@ -1941,7 +606,7 @@ async function executeOrder({
1941
606
  const isSingleChain = tokenIn.chainId === tokenOut.chainId;
1942
607
  const chainId = Number(tokenIn.chainId);
1943
608
  update("processing", messageFor("processing"));
1944
- if ((0, import_intents_sdk7.isEvmChain)(chainId)) {
609
+ if ((0, import_intents_sdk8.isEvmChain)(chainId)) {
1945
610
  return await handleEvmExecution({
1946
611
  recipientAddress,
1947
612
  quote,
@@ -1953,7 +618,7 @@ async function executeOrder({
1953
618
  update
1954
619
  });
1955
620
  }
1956
- if (chainId === import_intents_sdk7.ChainID.Solana) {
621
+ if (chainId === import_intents_sdk8.ChainID.Solana) {
1957
622
  return await handleSolanaExecution({
1958
623
  recipientAddress,
1959
624
  quote,
@@ -2066,10 +731,10 @@ function useExecuteOrder() {
2066
731
  }
2067
732
 
2068
733
  // src/react/useQuote.ts
2069
- var import_react3 = __toESM(require_react(), 1);
734
+ var import_react3 = require("react");
2070
735
 
2071
736
  // src/core/getQuote.ts
2072
- var import_intents_sdk8 = require("@shogun-sdk/intents-sdk");
737
+ var import_intents_sdk9 = require("@shogun-sdk/intents-sdk");
2073
738
  var import_viem4 = require("viem");
2074
739
  async function getQuote(params) {
2075
740
  if (!params.tokenIn?.address || !params.tokenOut?.address) {
@@ -2082,29 +747,33 @@ async function getQuote(params) {
2082
747
  throw new Error("Amount must be greater than 0.");
2083
748
  }
2084
749
  const normalizedTokenIn = normalizeNative(params.sourceChainId, params.tokenIn.address);
2085
- const data = await import_intents_sdk8.QuoteProvider.getQuote({
750
+ const data = await import_intents_sdk9.QuoteProvider.getQuote({
2086
751
  sourceChainId: params.sourceChainId,
2087
752
  destChainId: params.destChainId,
2088
753
  tokenIn: normalizedTokenIn,
2089
754
  tokenOut: params.tokenOut.address,
2090
755
  amount: params.amount
2091
756
  });
2092
- const inputSlippage = params.slippage ?? 5;
2093
- const slippageDecimal = inputSlippage / 100;
2094
- const slippage = Math.min(Math.max(slippageDecimal, 0), 0.5);
757
+ console.log({ data });
758
+ const slippagePercent = Math.min(Math.max(params.slippage ?? 0.5, 0), 50);
2095
759
  let warning;
2096
- if (slippage > 0.1) {
2097
- warning = `\u26A0\uFE0F High slippage tolerance (${(slippage * 100).toFixed(2)}%) \u2014 price may vary significantly.`;
760
+ if (slippagePercent > 10) {
761
+ warning = `\u26A0\uFE0F High slippage tolerance (${slippagePercent.toFixed(2)}%) \u2014 price may vary significantly.`;
2098
762
  }
2099
- const estimatedAmountOut = BigInt(data.estimatedAmountOutReduced);
2100
- const slippageBps = BigInt(Math.round(slippage * 1e4));
763
+ const estimatedAmountOut = BigInt(data.estimatedAmountOut);
764
+ const slippageBps = BigInt(Math.round(slippagePercent * 100));
2101
765
  const estimatedAmountOutAfterSlippage = estimatedAmountOut * (10000n - slippageBps) / 10000n;
766
+ const pricePerTokenOutInUsd = data.estimatedAmountOutUsd / Number(data.estimatedAmountOut);
767
+ const amountOutUsdAfterSlippage = Number(estimatedAmountOutAfterSlippage) * pricePerTokenOutInUsd;
768
+ const minStablecoinsAmountValue = BigInt(data.estimatedAmountInAsMinStablecoinAmount);
769
+ const minStablecoinsAmountAfterSlippage = minStablecoinsAmountValue * (10000n - slippageBps) / 10000n;
2102
770
  const pricePerInputToken = estimatedAmountOut * 10n ** BigInt(params.tokenIn.decimals ?? 18) / BigInt(params.amount);
2103
771
  return {
2104
- amountOut: estimatedAmountOut,
2105
- amountOutUsd: data.estimatedAmountOutUsd,
772
+ amountOut: estimatedAmountOutAfterSlippage,
773
+ amountOutUsd: amountOutUsdAfterSlippage,
2106
774
  amountInUsd: data.amountInUsd,
2107
- minStablecoinsAmount: data.estimatedAmountInAsMinStablecoinAmount,
775
+ // Input USD stays the same
776
+ minStablecoinsAmount: minStablecoinsAmountAfterSlippage,
2108
777
  tokenIn: {
2109
778
  address: params.tokenIn.address,
2110
779
  decimals: params.tokenIn.decimals ?? 18,
@@ -2117,10 +786,11 @@ async function getQuote(params) {
2117
786
  },
2118
787
  amountIn: params.amount,
2119
788
  pricePerInputToken,
2120
- slippage,
789
+ slippage: slippagePercent,
2121
790
  internal: {
2122
791
  ...data,
2123
- estimatedAmountOutReduced: estimatedAmountOutAfterSlippage
792
+ estimatedAmountOutReduced: estimatedAmountOutAfterSlippage,
793
+ estimatedAmountOutUsdReduced: amountOutUsdAfterSlippage
2124
794
  },
2125
795
  warning
2126
796
  };
@@ -2136,87 +806,74 @@ function useQuote(params, options) {
2136
806
  const autoRefreshMs = options?.autoRefreshMs;
2137
807
  const abortRef = (0, import_react3.useRef)(null);
2138
808
  const debounceRef = (0, import_react3.useRef)(null);
2139
- const mountedRef = (0, import_react3.useRef)(true);
809
+ const mounted = (0, import_react3.useRef)(false);
810
+ const paramsKey = (0, import_react3.useMemo)(
811
+ () => params ? JSON.stringify(serializeBigIntsToStrings(params)) : null,
812
+ [params]
813
+ );
2140
814
  (0, import_react3.useEffect)(() => {
815
+ mounted.current = true;
2141
816
  return () => {
2142
- mountedRef.current = false;
817
+ mounted.current = false;
2143
818
  abortRef.current?.abort();
2144
819
  if (debounceRef.current) clearTimeout(debounceRef.current);
2145
820
  };
2146
821
  }, []);
2147
- const fetchQuote = (0, import_react3.useCallback)(
2148
- async (signal) => {
2149
- if (!params) return;
2150
- try {
2151
- setLoading(true);
2152
- setWarning(null);
2153
- const result = await getQuote({ ...params, signal });
2154
- if (!mountedRef.current) return;
2155
- setData((prev) => {
2156
- if (JSON.stringify(prev) === JSON.stringify(result)) return prev;
2157
- return result;
2158
- });
2159
- setWarning(result.warning ?? null);
2160
- setError(null);
2161
- } catch (err) {
2162
- if (err.name === "AbortError") return;
2163
- const e = err instanceof Error ? err : new Error(String(err));
2164
- if (mountedRef.current) setError(e);
2165
- } finally {
2166
- if (mountedRef.current) setLoading(false);
2167
- }
2168
- },
2169
- [params]
2170
- );
2171
- (0, import_react3.useEffect)(() => {
822
+ const fetchQuote = (0, import_react3.useCallback)(async () => {
2172
823
  if (!params) return;
824
+ try {
825
+ setLoading(true);
826
+ setWarning(null);
827
+ const result = await getQuote(params);
828
+ const serializeResult = serializeBigIntsToStrings(result);
829
+ if (!mounted.current) return;
830
+ setData((prev) => {
831
+ if (JSON.stringify(prev) === JSON.stringify(serializeResult)) return prev;
832
+ return serializeResult;
833
+ });
834
+ setWarning(result.warning ?? null);
835
+ setError(null);
836
+ } catch (err) {
837
+ if (err.name === "AbortError") return;
838
+ console.error("[useQuote] fetch error:", err);
839
+ if (mounted.current) setError(err instanceof Error ? err : new Error(String(err)));
840
+ } finally {
841
+ if (mounted.current) setLoading(false);
842
+ }
843
+ }, [paramsKey]);
844
+ (0, import_react3.useEffect)(() => {
845
+ if (!paramsKey) return;
2173
846
  if (debounceRef.current) clearTimeout(debounceRef.current);
2174
- abortRef.current?.abort();
2175
- const controller = new AbortController();
2176
- abortRef.current = controller;
2177
847
  debounceRef.current = setTimeout(() => {
2178
- fetchQuote(controller.signal);
848
+ fetchQuote();
2179
849
  }, debounceMs);
2180
850
  return () => {
2181
- controller.abort();
2182
851
  if (debounceRef.current) clearTimeout(debounceRef.current);
852
+ abortRef.current?.abort();
2183
853
  };
2184
- }, [
2185
- params?.tokenIn?.address,
2186
- params?.tokenOut?.address,
2187
- params?.sourceChainId,
2188
- params?.destChainId,
2189
- params?.amount,
2190
- debounceMs,
2191
- fetchQuote
2192
- ]);
854
+ }, [paramsKey, debounceMs, fetchQuote]);
2193
855
  (0, import_react3.useEffect)(() => {
2194
- if (!autoRefreshMs || !params) return;
856
+ if (!autoRefreshMs || !paramsKey) return;
2195
857
  const interval = setInterval(() => fetchQuote(), autoRefreshMs);
2196
858
  return () => clearInterval(interval);
2197
- }, [autoRefreshMs, params, fetchQuote]);
859
+ }, [autoRefreshMs, paramsKey, fetchQuote]);
2198
860
  return (0, import_react3.useMemo)(
2199
861
  () => ({
2200
- /** Latest quote data */
2201
862
  data,
2202
- /** Whether a fetch is ongoing */
2203
863
  loading,
2204
- /** Error (if any) */
2205
864
  error,
2206
- /** Warning (e.g. high slippage alert) */
2207
865
  warning,
2208
- /** Manual refetch */
2209
- refetch: () => fetchQuote()
866
+ refetch: fetchQuote
2210
867
  }),
2211
868
  [data, loading, error, warning, fetchQuote]
2212
869
  );
2213
870
  }
2214
871
 
2215
872
  // src/react/useBalances.ts
2216
- var import_react4 = __toESM(require_react(), 1);
873
+ var import_react4 = require("react");
2217
874
 
2218
875
  // src/core/getBalances.ts
2219
- var import_intents_sdk9 = require("@shogun-sdk/intents-sdk");
876
+ var import_intents_sdk10 = require("@shogun-sdk/intents-sdk");
2220
877
  async function getBalances(params, options) {
2221
878
  const { addresses, cursorEvm, cursorSvm } = params;
2222
879
  const { signal } = options ?? {};
@@ -2229,7 +886,7 @@ async function getBalances(params, options) {
2229
886
  cursorSvm
2230
887
  });
2231
888
  const start = performance.now();
2232
- const response = await fetch(`${import_intents_sdk9.TOKEN_SEARCH_API_BASE_URL}/tokens/balances`, {
889
+ const response = await fetch(`${import_intents_sdk10.TOKEN_SEARCH_API_BASE_URL}/tokens/balances`, {
2233
890
  method: "POST",
2234
891
  headers: {
2235
892
  accept: "application/json",
@@ -2328,7 +985,7 @@ function useBalances(params) {
2328
985
  }
2329
986
 
2330
987
  // src/react/index.ts
2331
- var import_intents_sdk10 = require("@shogun-sdk/intents-sdk");
988
+ var import_intents_sdk11 = require("@shogun-sdk/intents-sdk");
2332
989
  // Annotate the CommonJS export names for ESM import in node:
2333
990
  0 && (module.exports = {
2334
991
  ChainID,
@@ -2338,27 +995,3 @@ var import_intents_sdk10 = require("@shogun-sdk/intents-sdk");
2338
995
  useQuote,
2339
996
  useTokenList
2340
997
  });
2341
- /*! Bundled license information:
2342
-
2343
- react/cjs/react.production.js:
2344
- (**
2345
- * @license React
2346
- * react.production.js
2347
- *
2348
- * Copyright (c) Meta Platforms, Inc. and affiliates.
2349
- *
2350
- * This source code is licensed under the MIT license found in the
2351
- * LICENSE file in the root directory of this source tree.
2352
- *)
2353
-
2354
- react/cjs/react.development.js:
2355
- (**
2356
- * @license React
2357
- * react.development.js
2358
- *
2359
- * Copyright (c) Meta Platforms, Inc. and affiliates.
2360
- *
2361
- * This source code is licensed under the MIT license found in the
2362
- * LICENSE file in the root directory of this source tree.
2363
- *)
2364
- */