@matchain/matchid-sdk-react 0.1.55-alpha.15 → 0.1.55-alpha.16
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/api.js +16431 -73
- package/dist/api.js.map +1 -1
- package/dist/api.mjs +2 -2
- package/dist/{chunk-ULDTUWGQ.mjs → chunk-HVCBDIGY.mjs} +2 -2
- package/dist/{chunk-BWGTZNIT.mjs → chunk-KYTL3LIF.mjs} +17138 -493
- package/dist/chunk-KYTL3LIF.mjs.map +1 -0
- package/dist/components.d.mts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/components.js +752 -959
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +485 -692
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/icon.d.mts +1 -1
- package/dist/icon.d.ts +1 -1
- package/dist/{index-QPdWAVPk.d.mts → index-BKSGbw7b.d.mts} +2 -2
- package/dist/{index-C14uKUDG.d.mts → index-BXbfmVoU.d.mts} +1 -1
- package/dist/{index-B80rDuha.d.ts → index-BtjgRcNJ.d.ts} +2 -2
- package/dist/{index-BBghnVDr.d.ts → index-C82WIWvx.d.ts} +4 -4
- package/dist/{index--EI6w9pi.d.mts → index-CHG4-0Z1.d.mts} +3 -3
- package/dist/{index-DGbpUvkd.d.ts → index-CsUEaGtM.d.ts} +1 -1
- package/dist/{index-Cl0JpAc1.d.ts → index-D1Ep9UMx.d.ts} +3 -3
- package/dist/{index-CHtFnnZk.d.mts → index-D7E317WV.d.mts} +4 -4
- package/dist/{index-hiCo96Vc.d.ts → index-DK7l3lsH.d.ts} +10 -7
- package/dist/{index-Dx4OFZhG.d.mts → index-YPRyEYt6.d.mts} +10 -7
- package/dist/index.d.mts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/index.js +471 -678
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/ui.d.mts +2 -3
- package/dist/ui.d.ts +2 -3
- package/dist/ui.js +299 -506
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-BWGTZNIT.mjs.map +0 -1
- package/dist/index.es-FMP4VX4N.mjs +0 -16847
- package/dist/index.es-FMP4VX4N.mjs.map +0 -1
- /package/dist/{chunk-ULDTUWGQ.mjs.map → chunk-HVCBDIGY.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -6,9 +6,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __esm = (fn, res) => function __init() {
|
|
10
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
|
-
};
|
|
12
9
|
var __commonJS = (cb, mod2) => function __require() {
|
|
13
10
|
return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
|
|
14
11
|
};
|
|
@@ -16376,496 +16373,6 @@ var require_lottie = __commonJS({
|
|
|
16376
16373
|
}
|
|
16377
16374
|
});
|
|
16378
16375
|
|
|
16379
|
-
// node_modules/lottie-react/build/index.es.js
|
|
16380
|
-
var index_es_exports = {};
|
|
16381
|
-
__export(index_es_exports, {
|
|
16382
|
-
LottiePlayer: () => import_lottie_web2.default,
|
|
16383
|
-
default: () => Lottie,
|
|
16384
|
-
useLottie: () => useLottie,
|
|
16385
|
-
useLottieInteractivity: () => useLottieInteractivity
|
|
16386
|
-
});
|
|
16387
|
-
function _arrayLikeToArray(r, a) {
|
|
16388
|
-
(null == a || a > r.length) && (a = r.length);
|
|
16389
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
16390
|
-
return n;
|
|
16391
|
-
}
|
|
16392
|
-
function _arrayWithHoles(r) {
|
|
16393
|
-
if (Array.isArray(r)) return r;
|
|
16394
|
-
}
|
|
16395
|
-
function _defineProperty(e, r, t) {
|
|
16396
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
16397
|
-
value: t,
|
|
16398
|
-
enumerable: true,
|
|
16399
|
-
configurable: true,
|
|
16400
|
-
writable: true
|
|
16401
|
-
}) : e[r] = t, e;
|
|
16402
|
-
}
|
|
16403
|
-
function _iterableToArrayLimit(r, l) {
|
|
16404
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
16405
|
-
if (null != t) {
|
|
16406
|
-
var e, n, i, u, a = [], f = true, o = false;
|
|
16407
|
-
try {
|
|
16408
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
16409
|
-
if (Object(t) !== t) return;
|
|
16410
|
-
f = false;
|
|
16411
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
16412
|
-
} catch (r2) {
|
|
16413
|
-
o = true, n = r2;
|
|
16414
|
-
} finally {
|
|
16415
|
-
try {
|
|
16416
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
16417
|
-
} finally {
|
|
16418
|
-
if (o) throw n;
|
|
16419
|
-
}
|
|
16420
|
-
}
|
|
16421
|
-
return a;
|
|
16422
|
-
}
|
|
16423
|
-
}
|
|
16424
|
-
function _nonIterableRest() {
|
|
16425
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
16426
|
-
}
|
|
16427
|
-
function ownKeys(e, r) {
|
|
16428
|
-
var t = Object.keys(e);
|
|
16429
|
-
if (Object.getOwnPropertySymbols) {
|
|
16430
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
16431
|
-
r && (o = o.filter(function(r2) {
|
|
16432
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
16433
|
-
})), t.push.apply(t, o);
|
|
16434
|
-
}
|
|
16435
|
-
return t;
|
|
16436
|
-
}
|
|
16437
|
-
function _objectSpread2(e) {
|
|
16438
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
16439
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
16440
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
16441
|
-
_defineProperty(e, r2, t[r2]);
|
|
16442
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
16443
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
16444
|
-
});
|
|
16445
|
-
}
|
|
16446
|
-
return e;
|
|
16447
|
-
}
|
|
16448
|
-
function _objectWithoutProperties(e, t) {
|
|
16449
|
-
if (null == e) return {};
|
|
16450
|
-
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
16451
|
-
if (Object.getOwnPropertySymbols) {
|
|
16452
|
-
var s = Object.getOwnPropertySymbols(e);
|
|
16453
|
-
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
16454
|
-
}
|
|
16455
|
-
return i;
|
|
16456
|
-
}
|
|
16457
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
16458
|
-
if (null == r) return {};
|
|
16459
|
-
var t = {};
|
|
16460
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
16461
|
-
if (e.includes(n)) continue;
|
|
16462
|
-
t[n] = r[n];
|
|
16463
|
-
}
|
|
16464
|
-
return t;
|
|
16465
|
-
}
|
|
16466
|
-
function _slicedToArray(r, e) {
|
|
16467
|
-
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
16468
|
-
}
|
|
16469
|
-
function _toPrimitive(t, r) {
|
|
16470
|
-
if ("object" != typeof t || !t) return t;
|
|
16471
|
-
var e = t[Symbol.toPrimitive];
|
|
16472
|
-
if (void 0 !== e) {
|
|
16473
|
-
var i = e.call(t, r || "default");
|
|
16474
|
-
if ("object" != typeof i) return i;
|
|
16475
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
16476
|
-
}
|
|
16477
|
-
return ("string" === r ? String : Number)(t);
|
|
16478
|
-
}
|
|
16479
|
-
function _toPropertyKey(t) {
|
|
16480
|
-
var i = _toPrimitive(t, "string");
|
|
16481
|
-
return "symbol" == typeof i ? i : i + "";
|
|
16482
|
-
}
|
|
16483
|
-
function _unsupportedIterableToArray(r, a) {
|
|
16484
|
-
if (r) {
|
|
16485
|
-
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
16486
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
16487
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
16488
|
-
}
|
|
16489
|
-
}
|
|
16490
|
-
function getContainerVisibility(container) {
|
|
16491
|
-
var _container$getBoundin = container.getBoundingClientRect(), top = _container$getBoundin.top, height2 = _container$getBoundin.height;
|
|
16492
|
-
var current = window.innerHeight - top;
|
|
16493
|
-
var max = window.innerHeight + height2;
|
|
16494
|
-
return current / max;
|
|
16495
|
-
}
|
|
16496
|
-
function getContainerCursorPosition(container, cursorX, cursorY) {
|
|
16497
|
-
var _container$getBoundin2 = container.getBoundingClientRect(), top = _container$getBoundin2.top, left = _container$getBoundin2.left, width2 = _container$getBoundin2.width, height2 = _container$getBoundin2.height;
|
|
16498
|
-
var x = (cursorX - left) / width2;
|
|
16499
|
-
var y = (cursorY - top) / height2;
|
|
16500
|
-
return {
|
|
16501
|
-
x,
|
|
16502
|
-
y
|
|
16503
|
-
};
|
|
16504
|
-
}
|
|
16505
|
-
var import_lottie_web, import_lottie_web2, import_react30, _excluded$1, useLottie, useInitInteractivity, useLottieInteractivity, _excluded, Lottie;
|
|
16506
|
-
var init_index_es = __esm({
|
|
16507
|
-
"node_modules/lottie-react/build/index.es.js"() {
|
|
16508
|
-
"use strict";
|
|
16509
|
-
import_lottie_web = __toESM(require_lottie());
|
|
16510
|
-
import_lottie_web2 = __toESM(require_lottie());
|
|
16511
|
-
import_react30 = __toESM(require("react"));
|
|
16512
|
-
_excluded$1 = ["animationData", "loop", "autoplay", "initialSegment", "onComplete", "onLoopComplete", "onEnterFrame", "onSegmentStart", "onConfigReady", "onDataReady", "onDataFailed", "onLoadedImages", "onDOMLoaded", "onDestroy", "lottieRef", "renderer", "name", "assetsPath", "rendererSettings"];
|
|
16513
|
-
useLottie = function useLottie2(props, style) {
|
|
16514
|
-
var animationData2 = props.animationData, loop = props.loop, autoplay = props.autoplay, initialSegment = props.initialSegment, onComplete = props.onComplete, onLoopComplete = props.onLoopComplete, onEnterFrame = props.onEnterFrame, onSegmentStart = props.onSegmentStart, onConfigReady = props.onConfigReady, onDataReady = props.onDataReady, onDataFailed = props.onDataFailed, onLoadedImages = props.onLoadedImages, onDOMLoaded = props.onDOMLoaded, onDestroy = props.onDestroy;
|
|
16515
|
-
props.lottieRef;
|
|
16516
|
-
props.renderer;
|
|
16517
|
-
props.name;
|
|
16518
|
-
props.assetsPath;
|
|
16519
|
-
props.rendererSettings;
|
|
16520
|
-
var rest = _objectWithoutProperties(props, _excluded$1);
|
|
16521
|
-
var _useState = (0, import_react30.useState)(false), _useState2 = _slicedToArray(_useState, 2), animationLoaded = _useState2[0], setAnimationLoaded = _useState2[1];
|
|
16522
|
-
var animationInstanceRef = (0, import_react30.useRef)();
|
|
16523
|
-
var animationContainer = (0, import_react30.useRef)(null);
|
|
16524
|
-
var play = function play2() {
|
|
16525
|
-
var _a;
|
|
16526
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
16527
|
-
};
|
|
16528
|
-
var stop = function stop2() {
|
|
16529
|
-
var _a;
|
|
16530
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
16531
|
-
};
|
|
16532
|
-
var pause = function pause2() {
|
|
16533
|
-
var _a;
|
|
16534
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
16535
|
-
};
|
|
16536
|
-
var setSpeed = function setSpeed2(speed) {
|
|
16537
|
-
var _a;
|
|
16538
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSpeed(speed);
|
|
16539
|
-
};
|
|
16540
|
-
var goToAndPlay = function goToAndPlay2(value2, isFrame) {
|
|
16541
|
-
var _a;
|
|
16542
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndPlay(value2, isFrame);
|
|
16543
|
-
};
|
|
16544
|
-
var goToAndStop = function goToAndStop2(value2, isFrame) {
|
|
16545
|
-
var _a;
|
|
16546
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndStop(value2, isFrame);
|
|
16547
|
-
};
|
|
16548
|
-
var setDirection = function setDirection2(direction) {
|
|
16549
|
-
var _a;
|
|
16550
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setDirection(direction);
|
|
16551
|
-
};
|
|
16552
|
-
var playSegments = function playSegments2(segments, forceFlag) {
|
|
16553
|
-
var _a;
|
|
16554
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.playSegments(segments, forceFlag);
|
|
16555
|
-
};
|
|
16556
|
-
var setSubframe = function setSubframe2(useSubFrames) {
|
|
16557
|
-
var _a;
|
|
16558
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSubframe(useSubFrames);
|
|
16559
|
-
};
|
|
16560
|
-
var getDuration = function getDuration2(inFrames) {
|
|
16561
|
-
var _a;
|
|
16562
|
-
return (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.getDuration(inFrames);
|
|
16563
|
-
};
|
|
16564
|
-
var destroy = function destroy2() {
|
|
16565
|
-
var _a;
|
|
16566
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
16567
|
-
animationInstanceRef.current = void 0;
|
|
16568
|
-
};
|
|
16569
|
-
var loadAnimation2 = function loadAnimation3() {
|
|
16570
|
-
var forcedConfigs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
16571
|
-
var _a;
|
|
16572
|
-
if (!animationContainer.current) {
|
|
16573
|
-
return;
|
|
16574
|
-
}
|
|
16575
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
16576
|
-
var config = _objectSpread2(_objectSpread2(_objectSpread2({}, props), forcedConfigs), {}, {
|
|
16577
|
-
container: animationContainer.current
|
|
16578
|
-
});
|
|
16579
|
-
animationInstanceRef.current = import_lottie_web.default.loadAnimation(config);
|
|
16580
|
-
setAnimationLoaded(!!animationInstanceRef.current);
|
|
16581
|
-
return function() {
|
|
16582
|
-
var _a2;
|
|
16583
|
-
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.destroy();
|
|
16584
|
-
animationInstanceRef.current = void 0;
|
|
16585
|
-
};
|
|
16586
|
-
};
|
|
16587
|
-
(0, import_react30.useEffect)(function() {
|
|
16588
|
-
var onUnmount = loadAnimation2();
|
|
16589
|
-
return function() {
|
|
16590
|
-
return onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
|
|
16591
|
-
};
|
|
16592
|
-
}, [animationData2, loop]);
|
|
16593
|
-
(0, import_react30.useEffect)(function() {
|
|
16594
|
-
if (!animationInstanceRef.current) {
|
|
16595
|
-
return;
|
|
16596
|
-
}
|
|
16597
|
-
animationInstanceRef.current.autoplay = !!autoplay;
|
|
16598
|
-
}, [autoplay]);
|
|
16599
|
-
(0, import_react30.useEffect)(function() {
|
|
16600
|
-
if (!animationInstanceRef.current) {
|
|
16601
|
-
return;
|
|
16602
|
-
}
|
|
16603
|
-
if (!initialSegment) {
|
|
16604
|
-
animationInstanceRef.current.resetSegments(true);
|
|
16605
|
-
return;
|
|
16606
|
-
}
|
|
16607
|
-
if (!Array.isArray(initialSegment) || !initialSegment.length) {
|
|
16608
|
-
return;
|
|
16609
|
-
}
|
|
16610
|
-
if (animationInstanceRef.current.currentRawFrame < initialSegment[0] || animationInstanceRef.current.currentRawFrame > initialSegment[1]) {
|
|
16611
|
-
animationInstanceRef.current.currentRawFrame = initialSegment[0];
|
|
16612
|
-
}
|
|
16613
|
-
animationInstanceRef.current.setSegment(initialSegment[0], initialSegment[1]);
|
|
16614
|
-
}, [initialSegment]);
|
|
16615
|
-
(0, import_react30.useEffect)(function() {
|
|
16616
|
-
var partialListeners = [{
|
|
16617
|
-
name: "complete",
|
|
16618
|
-
handler: onComplete
|
|
16619
|
-
}, {
|
|
16620
|
-
name: "loopComplete",
|
|
16621
|
-
handler: onLoopComplete
|
|
16622
|
-
}, {
|
|
16623
|
-
name: "enterFrame",
|
|
16624
|
-
handler: onEnterFrame
|
|
16625
|
-
}, {
|
|
16626
|
-
name: "segmentStart",
|
|
16627
|
-
handler: onSegmentStart
|
|
16628
|
-
}, {
|
|
16629
|
-
name: "config_ready",
|
|
16630
|
-
handler: onConfigReady
|
|
16631
|
-
}, {
|
|
16632
|
-
name: "data_ready",
|
|
16633
|
-
handler: onDataReady
|
|
16634
|
-
}, {
|
|
16635
|
-
name: "data_failed",
|
|
16636
|
-
handler: onDataFailed
|
|
16637
|
-
}, {
|
|
16638
|
-
name: "loaded_images",
|
|
16639
|
-
handler: onLoadedImages
|
|
16640
|
-
}, {
|
|
16641
|
-
name: "DOMLoaded",
|
|
16642
|
-
handler: onDOMLoaded
|
|
16643
|
-
}, {
|
|
16644
|
-
name: "destroy",
|
|
16645
|
-
handler: onDestroy
|
|
16646
|
-
}];
|
|
16647
|
-
var listeners = partialListeners.filter(function(listener) {
|
|
16648
|
-
return listener.handler != null;
|
|
16649
|
-
});
|
|
16650
|
-
if (!listeners.length) {
|
|
16651
|
-
return;
|
|
16652
|
-
}
|
|
16653
|
-
var deregisterList = listeners.map(
|
|
16654
|
-
/**
|
|
16655
|
-
* Handle the process of adding an event listener
|
|
16656
|
-
* @param {Listener} listener
|
|
16657
|
-
* @return {Function} Function that deregister the listener
|
|
16658
|
-
*/
|
|
16659
|
-
function(listener) {
|
|
16660
|
-
var _a;
|
|
16661
|
-
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(listener.name, listener.handler);
|
|
16662
|
-
return function() {
|
|
16663
|
-
var _a2;
|
|
16664
|
-
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener(listener.name, listener.handler);
|
|
16665
|
-
};
|
|
16666
|
-
}
|
|
16667
|
-
);
|
|
16668
|
-
return function() {
|
|
16669
|
-
deregisterList.forEach(function(deregister) {
|
|
16670
|
-
return deregister();
|
|
16671
|
-
});
|
|
16672
|
-
};
|
|
16673
|
-
}, [onComplete, onLoopComplete, onEnterFrame, onSegmentStart, onConfigReady, onDataReady, onDataFailed, onLoadedImages, onDOMLoaded, onDestroy]);
|
|
16674
|
-
var View = /* @__PURE__ */ import_react30.default.createElement("div", _objectSpread2({
|
|
16675
|
-
style,
|
|
16676
|
-
ref: animationContainer
|
|
16677
|
-
}, rest));
|
|
16678
|
-
return {
|
|
16679
|
-
View,
|
|
16680
|
-
play,
|
|
16681
|
-
stop,
|
|
16682
|
-
pause,
|
|
16683
|
-
setSpeed,
|
|
16684
|
-
goToAndStop,
|
|
16685
|
-
goToAndPlay,
|
|
16686
|
-
setDirection,
|
|
16687
|
-
playSegments,
|
|
16688
|
-
setSubframe,
|
|
16689
|
-
getDuration,
|
|
16690
|
-
destroy,
|
|
16691
|
-
animationContainerRef: animationContainer,
|
|
16692
|
-
animationLoaded,
|
|
16693
|
-
animationItem: animationInstanceRef.current
|
|
16694
|
-
};
|
|
16695
|
-
};
|
|
16696
|
-
useInitInteractivity = function useInitInteractivity2(_ref) {
|
|
16697
|
-
var wrapperRef = _ref.wrapperRef, animationItem = _ref.animationItem, mode = _ref.mode, actions = _ref.actions;
|
|
16698
|
-
(0, import_react30.useEffect)(function() {
|
|
16699
|
-
var wrapper = wrapperRef.current;
|
|
16700
|
-
if (!wrapper || !animationItem || !actions.length) {
|
|
16701
|
-
return;
|
|
16702
|
-
}
|
|
16703
|
-
animationItem.stop();
|
|
16704
|
-
var scrollModeHandler = function scrollModeHandler2() {
|
|
16705
|
-
var assignedSegment = null;
|
|
16706
|
-
var scrollHandler = function scrollHandler2() {
|
|
16707
|
-
var currentPercent = getContainerVisibility(wrapper);
|
|
16708
|
-
var action = actions.find(function(_ref2) {
|
|
16709
|
-
var visibility = _ref2.visibility;
|
|
16710
|
-
return visibility && currentPercent >= visibility[0] && currentPercent <= visibility[1];
|
|
16711
|
-
});
|
|
16712
|
-
if (!action) {
|
|
16713
|
-
return;
|
|
16714
|
-
}
|
|
16715
|
-
if (action.type === "seek" && action.visibility && action.frames.length === 2) {
|
|
16716
|
-
var frameToGo = action.frames[0] + Math.ceil((currentPercent - action.visibility[0]) / (action.visibility[1] - action.visibility[0]) * action.frames[1]);
|
|
16717
|
-
animationItem.goToAndStop(frameToGo - animationItem.firstFrame - 1, true);
|
|
16718
|
-
}
|
|
16719
|
-
if (action.type === "loop") {
|
|
16720
|
-
if (assignedSegment === null) {
|
|
16721
|
-
animationItem.playSegments(action.frames, true);
|
|
16722
|
-
assignedSegment = action.frames;
|
|
16723
|
-
} else {
|
|
16724
|
-
if (assignedSegment !== action.frames) {
|
|
16725
|
-
animationItem.playSegments(action.frames, true);
|
|
16726
|
-
assignedSegment = action.frames;
|
|
16727
|
-
} else if (animationItem.isPaused) {
|
|
16728
|
-
animationItem.playSegments(action.frames, true);
|
|
16729
|
-
assignedSegment = action.frames;
|
|
16730
|
-
}
|
|
16731
|
-
}
|
|
16732
|
-
}
|
|
16733
|
-
if (action.type === "play" && animationItem.isPaused) {
|
|
16734
|
-
animationItem.resetSegments(true);
|
|
16735
|
-
animationItem.play();
|
|
16736
|
-
}
|
|
16737
|
-
if (action.type === "stop") {
|
|
16738
|
-
animationItem.goToAndStop(action.frames[0] - animationItem.firstFrame - 1, true);
|
|
16739
|
-
}
|
|
16740
|
-
};
|
|
16741
|
-
document.addEventListener("scroll", scrollHandler);
|
|
16742
|
-
return function() {
|
|
16743
|
-
document.removeEventListener("scroll", scrollHandler);
|
|
16744
|
-
};
|
|
16745
|
-
};
|
|
16746
|
-
var cursorModeHandler = function cursorModeHandler2() {
|
|
16747
|
-
var handleCursor = function handleCursor2(_x, _y) {
|
|
16748
|
-
var x = _x;
|
|
16749
|
-
var y = _y;
|
|
16750
|
-
if (x !== -1 && y !== -1) {
|
|
16751
|
-
var pos = getContainerCursorPosition(wrapper, x, y);
|
|
16752
|
-
x = pos.x;
|
|
16753
|
-
y = pos.y;
|
|
16754
|
-
}
|
|
16755
|
-
var action = actions.find(function(_ref3) {
|
|
16756
|
-
var position2 = _ref3.position;
|
|
16757
|
-
if (position2 && Array.isArray(position2.x) && Array.isArray(position2.y)) {
|
|
16758
|
-
return x >= position2.x[0] && x <= position2.x[1] && y >= position2.y[0] && y <= position2.y[1];
|
|
16759
|
-
}
|
|
16760
|
-
if (position2 && !Number.isNaN(position2.x) && !Number.isNaN(position2.y)) {
|
|
16761
|
-
return x === position2.x && y === position2.y;
|
|
16762
|
-
}
|
|
16763
|
-
return false;
|
|
16764
|
-
});
|
|
16765
|
-
if (!action) {
|
|
16766
|
-
return;
|
|
16767
|
-
}
|
|
16768
|
-
if (action.type === "seek" && action.position && Array.isArray(action.position.x) && Array.isArray(action.position.y) && action.frames.length === 2) {
|
|
16769
|
-
var xPercent = (x - action.position.x[0]) / (action.position.x[1] - action.position.x[0]);
|
|
16770
|
-
var yPercent = (y - action.position.y[0]) / (action.position.y[1] - action.position.y[0]);
|
|
16771
|
-
animationItem.playSegments(action.frames, true);
|
|
16772
|
-
animationItem.goToAndStop(Math.ceil((xPercent + yPercent) / 2 * (action.frames[1] - action.frames[0])), true);
|
|
16773
|
-
}
|
|
16774
|
-
if (action.type === "loop") {
|
|
16775
|
-
animationItem.playSegments(action.frames, true);
|
|
16776
|
-
}
|
|
16777
|
-
if (action.type === "play") {
|
|
16778
|
-
if (animationItem.isPaused) {
|
|
16779
|
-
animationItem.resetSegments(false);
|
|
16780
|
-
}
|
|
16781
|
-
animationItem.playSegments(action.frames);
|
|
16782
|
-
}
|
|
16783
|
-
if (action.type === "stop") {
|
|
16784
|
-
animationItem.goToAndStop(action.frames[0], true);
|
|
16785
|
-
}
|
|
16786
|
-
};
|
|
16787
|
-
var mouseMoveHandler = function mouseMoveHandler2(ev) {
|
|
16788
|
-
handleCursor(ev.clientX, ev.clientY);
|
|
16789
|
-
};
|
|
16790
|
-
var mouseOutHandler = function mouseOutHandler2() {
|
|
16791
|
-
handleCursor(-1, -1);
|
|
16792
|
-
};
|
|
16793
|
-
wrapper.addEventListener("mousemove", mouseMoveHandler);
|
|
16794
|
-
wrapper.addEventListener("mouseout", mouseOutHandler);
|
|
16795
|
-
return function() {
|
|
16796
|
-
wrapper.removeEventListener("mousemove", mouseMoveHandler);
|
|
16797
|
-
wrapper.removeEventListener("mouseout", mouseOutHandler);
|
|
16798
|
-
};
|
|
16799
|
-
};
|
|
16800
|
-
switch (mode) {
|
|
16801
|
-
case "scroll":
|
|
16802
|
-
return scrollModeHandler();
|
|
16803
|
-
case "cursor":
|
|
16804
|
-
return cursorModeHandler();
|
|
16805
|
-
}
|
|
16806
|
-
}, [mode, animationItem]);
|
|
16807
|
-
};
|
|
16808
|
-
useLottieInteractivity = function useLottieInteractivity2(_ref4) {
|
|
16809
|
-
var actions = _ref4.actions, mode = _ref4.mode, lottieObj = _ref4.lottieObj;
|
|
16810
|
-
var animationItem = lottieObj.animationItem, View = lottieObj.View, animationContainerRef = lottieObj.animationContainerRef;
|
|
16811
|
-
useInitInteractivity({
|
|
16812
|
-
actions,
|
|
16813
|
-
animationItem,
|
|
16814
|
-
mode,
|
|
16815
|
-
wrapperRef: animationContainerRef
|
|
16816
|
-
});
|
|
16817
|
-
return View;
|
|
16818
|
-
};
|
|
16819
|
-
_excluded = ["style", "interactivity"];
|
|
16820
|
-
Lottie = function Lottie2(props) {
|
|
16821
|
-
var _a, _b, _c;
|
|
16822
|
-
var style = props.style, interactivity = props.interactivity, lottieProps = _objectWithoutProperties(props, _excluded);
|
|
16823
|
-
var _useLottie = useLottie(lottieProps, style), View = _useLottie.View, play = _useLottie.play, stop = _useLottie.stop, pause = _useLottie.pause, setSpeed = _useLottie.setSpeed, goToAndStop = _useLottie.goToAndStop, goToAndPlay = _useLottie.goToAndPlay, setDirection = _useLottie.setDirection, playSegments = _useLottie.playSegments, setSubframe = _useLottie.setSubframe, getDuration = _useLottie.getDuration, destroy = _useLottie.destroy, animationContainerRef = _useLottie.animationContainerRef, animationLoaded = _useLottie.animationLoaded, animationItem = _useLottie.animationItem;
|
|
16824
|
-
(0, import_react30.useEffect)(function() {
|
|
16825
|
-
if (props.lottieRef) {
|
|
16826
|
-
props.lottieRef.current = {
|
|
16827
|
-
play,
|
|
16828
|
-
stop,
|
|
16829
|
-
pause,
|
|
16830
|
-
setSpeed,
|
|
16831
|
-
goToAndPlay,
|
|
16832
|
-
goToAndStop,
|
|
16833
|
-
setDirection,
|
|
16834
|
-
playSegments,
|
|
16835
|
-
setSubframe,
|
|
16836
|
-
getDuration,
|
|
16837
|
-
destroy,
|
|
16838
|
-
animationContainerRef,
|
|
16839
|
-
animationLoaded,
|
|
16840
|
-
animationItem
|
|
16841
|
-
};
|
|
16842
|
-
}
|
|
16843
|
-
}, [(_a = props.lottieRef) === null || _a === void 0 ? void 0 : _a.current]);
|
|
16844
|
-
return useLottieInteractivity({
|
|
16845
|
-
lottieObj: {
|
|
16846
|
-
View,
|
|
16847
|
-
play,
|
|
16848
|
-
stop,
|
|
16849
|
-
pause,
|
|
16850
|
-
setSpeed,
|
|
16851
|
-
goToAndStop,
|
|
16852
|
-
goToAndPlay,
|
|
16853
|
-
setDirection,
|
|
16854
|
-
playSegments,
|
|
16855
|
-
setSubframe,
|
|
16856
|
-
getDuration,
|
|
16857
|
-
destroy,
|
|
16858
|
-
animationContainerRef,
|
|
16859
|
-
animationLoaded,
|
|
16860
|
-
animationItem
|
|
16861
|
-
},
|
|
16862
|
-
actions: (_b = interactivity === null || interactivity === void 0 ? void 0 : interactivity.actions) !== null && _b !== void 0 ? _b : [],
|
|
16863
|
-
mode: (_c = interactivity === null || interactivity === void 0 ? void 0 : interactivity.mode) !== null && _c !== void 0 ? _c : "scroll"
|
|
16864
|
-
});
|
|
16865
|
-
};
|
|
16866
|
-
}
|
|
16867
|
-
});
|
|
16868
|
-
|
|
16869
16376
|
// src/index.tsx
|
|
16870
16377
|
var src_exports = {};
|
|
16871
16378
|
__export(src_exports, {
|
|
@@ -16886,7 +16393,7 @@ __export(src_exports, {
|
|
|
16886
16393
|
module.exports = __toCommonJS(src_exports);
|
|
16887
16394
|
|
|
16888
16395
|
// src/MatchContext.tsx
|
|
16889
|
-
var
|
|
16396
|
+
var import_react43 = require("react");
|
|
16890
16397
|
|
|
16891
16398
|
// src/hooks/index.tsx
|
|
16892
16399
|
var hooks_exports = {};
|
|
@@ -19268,11 +18775,11 @@ var RecoveryType = /* @__PURE__ */ ((RecoveryType3) => {
|
|
|
19268
18775
|
// src/hooks/useWallet.tsx
|
|
19269
18776
|
var import_accounts = require("viem/accounts");
|
|
19270
18777
|
var import_viem8 = require("viem");
|
|
19271
|
-
var
|
|
18778
|
+
var import_react32 = require("react");
|
|
19272
18779
|
var import_viem9 = require("viem");
|
|
19273
18780
|
|
|
19274
18781
|
// src/context/ModalContext.tsx
|
|
19275
|
-
var
|
|
18782
|
+
var import_react31 = __toESM(require("react"));
|
|
19276
18783
|
var import_react_dom = require("react-dom");
|
|
19277
18784
|
|
|
19278
18785
|
// src/ui/index.ts
|
|
@@ -22799,39 +22306,328 @@ function Tabs(props) {
|
|
|
22799
22306
|
}) });
|
|
22800
22307
|
}
|
|
22801
22308
|
|
|
22309
|
+
// node_modules/lottie-react/build/index.es.js
|
|
22310
|
+
var import_lottie_web = __toESM(require_lottie());
|
|
22311
|
+
var import_lottie_web2 = __toESM(require_lottie());
|
|
22312
|
+
var import_react30 = __toESM(require("react"));
|
|
22313
|
+
function _arrayLikeToArray(r, a) {
|
|
22314
|
+
(null == a || a > r.length) && (a = r.length);
|
|
22315
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
22316
|
+
return n;
|
|
22317
|
+
}
|
|
22318
|
+
function _arrayWithHoles(r) {
|
|
22319
|
+
if (Array.isArray(r)) return r;
|
|
22320
|
+
}
|
|
22321
|
+
function _defineProperty(e, r, t) {
|
|
22322
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
22323
|
+
value: t,
|
|
22324
|
+
enumerable: true,
|
|
22325
|
+
configurable: true,
|
|
22326
|
+
writable: true
|
|
22327
|
+
}) : e[r] = t, e;
|
|
22328
|
+
}
|
|
22329
|
+
function _iterableToArrayLimit(r, l) {
|
|
22330
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
22331
|
+
if (null != t) {
|
|
22332
|
+
var e, n, i, u, a = [], f = true, o = false;
|
|
22333
|
+
try {
|
|
22334
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
22335
|
+
if (Object(t) !== t) return;
|
|
22336
|
+
f = false;
|
|
22337
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
22338
|
+
} catch (r2) {
|
|
22339
|
+
o = true, n = r2;
|
|
22340
|
+
} finally {
|
|
22341
|
+
try {
|
|
22342
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
22343
|
+
} finally {
|
|
22344
|
+
if (o) throw n;
|
|
22345
|
+
}
|
|
22346
|
+
}
|
|
22347
|
+
return a;
|
|
22348
|
+
}
|
|
22349
|
+
}
|
|
22350
|
+
function _nonIterableRest() {
|
|
22351
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
22352
|
+
}
|
|
22353
|
+
function ownKeys(e, r) {
|
|
22354
|
+
var t = Object.keys(e);
|
|
22355
|
+
if (Object.getOwnPropertySymbols) {
|
|
22356
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
22357
|
+
r && (o = o.filter(function(r2) {
|
|
22358
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
22359
|
+
})), t.push.apply(t, o);
|
|
22360
|
+
}
|
|
22361
|
+
return t;
|
|
22362
|
+
}
|
|
22363
|
+
function _objectSpread2(e) {
|
|
22364
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
22365
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
22366
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
22367
|
+
_defineProperty(e, r2, t[r2]);
|
|
22368
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
22369
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
22370
|
+
});
|
|
22371
|
+
}
|
|
22372
|
+
return e;
|
|
22373
|
+
}
|
|
22374
|
+
function _objectWithoutProperties(e, t) {
|
|
22375
|
+
if (null == e) return {};
|
|
22376
|
+
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
22377
|
+
if (Object.getOwnPropertySymbols) {
|
|
22378
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
22379
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
22380
|
+
}
|
|
22381
|
+
return i;
|
|
22382
|
+
}
|
|
22383
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
22384
|
+
if (null == r) return {};
|
|
22385
|
+
var t = {};
|
|
22386
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
22387
|
+
if (e.includes(n)) continue;
|
|
22388
|
+
t[n] = r[n];
|
|
22389
|
+
}
|
|
22390
|
+
return t;
|
|
22391
|
+
}
|
|
22392
|
+
function _slicedToArray(r, e) {
|
|
22393
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
22394
|
+
}
|
|
22395
|
+
function _toPrimitive(t, r) {
|
|
22396
|
+
if ("object" != typeof t || !t) return t;
|
|
22397
|
+
var e = t[Symbol.toPrimitive];
|
|
22398
|
+
if (void 0 !== e) {
|
|
22399
|
+
var i = e.call(t, r || "default");
|
|
22400
|
+
if ("object" != typeof i) return i;
|
|
22401
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
22402
|
+
}
|
|
22403
|
+
return ("string" === r ? String : Number)(t);
|
|
22404
|
+
}
|
|
22405
|
+
function _toPropertyKey(t) {
|
|
22406
|
+
var i = _toPrimitive(t, "string");
|
|
22407
|
+
return "symbol" == typeof i ? i : i + "";
|
|
22408
|
+
}
|
|
22409
|
+
function _unsupportedIterableToArray(r, a) {
|
|
22410
|
+
if (r) {
|
|
22411
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
22412
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
22413
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
22414
|
+
}
|
|
22415
|
+
}
|
|
22416
|
+
var _excluded$1 = ["animationData", "loop", "autoplay", "initialSegment", "onComplete", "onLoopComplete", "onEnterFrame", "onSegmentStart", "onConfigReady", "onDataReady", "onDataFailed", "onLoadedImages", "onDOMLoaded", "onDestroy", "lottieRef", "renderer", "name", "assetsPath", "rendererSettings"];
|
|
22417
|
+
var useLottie = function useLottie2(props, style) {
|
|
22418
|
+
var animationData2 = props.animationData, loop = props.loop, autoplay = props.autoplay, initialSegment = props.initialSegment, onComplete = props.onComplete, onLoopComplete = props.onLoopComplete, onEnterFrame = props.onEnterFrame, onSegmentStart = props.onSegmentStart, onConfigReady = props.onConfigReady, onDataReady = props.onDataReady, onDataFailed = props.onDataFailed, onLoadedImages = props.onLoadedImages, onDOMLoaded = props.onDOMLoaded, onDestroy = props.onDestroy;
|
|
22419
|
+
props.lottieRef;
|
|
22420
|
+
props.renderer;
|
|
22421
|
+
props.name;
|
|
22422
|
+
props.assetsPath;
|
|
22423
|
+
props.rendererSettings;
|
|
22424
|
+
var rest = _objectWithoutProperties(props, _excluded$1);
|
|
22425
|
+
var _useState = (0, import_react30.useState)(false), _useState2 = _slicedToArray(_useState, 2), animationLoaded = _useState2[0], setAnimationLoaded = _useState2[1];
|
|
22426
|
+
var animationInstanceRef = (0, import_react30.useRef)();
|
|
22427
|
+
var animationContainer = (0, import_react30.useRef)(null);
|
|
22428
|
+
var play = function play2() {
|
|
22429
|
+
var _a;
|
|
22430
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
22431
|
+
};
|
|
22432
|
+
var stop = function stop2() {
|
|
22433
|
+
var _a;
|
|
22434
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
22435
|
+
};
|
|
22436
|
+
var pause = function pause2() {
|
|
22437
|
+
var _a;
|
|
22438
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
22439
|
+
};
|
|
22440
|
+
var setSpeed = function setSpeed2(speed) {
|
|
22441
|
+
var _a;
|
|
22442
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSpeed(speed);
|
|
22443
|
+
};
|
|
22444
|
+
var goToAndPlay = function goToAndPlay2(value2, isFrame) {
|
|
22445
|
+
var _a;
|
|
22446
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndPlay(value2, isFrame);
|
|
22447
|
+
};
|
|
22448
|
+
var goToAndStop = function goToAndStop2(value2, isFrame) {
|
|
22449
|
+
var _a;
|
|
22450
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndStop(value2, isFrame);
|
|
22451
|
+
};
|
|
22452
|
+
var setDirection = function setDirection2(direction) {
|
|
22453
|
+
var _a;
|
|
22454
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setDirection(direction);
|
|
22455
|
+
};
|
|
22456
|
+
var playSegments = function playSegments2(segments, forceFlag) {
|
|
22457
|
+
var _a;
|
|
22458
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.playSegments(segments, forceFlag);
|
|
22459
|
+
};
|
|
22460
|
+
var setSubframe = function setSubframe2(useSubFrames) {
|
|
22461
|
+
var _a;
|
|
22462
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSubframe(useSubFrames);
|
|
22463
|
+
};
|
|
22464
|
+
var getDuration = function getDuration2(inFrames) {
|
|
22465
|
+
var _a;
|
|
22466
|
+
return (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.getDuration(inFrames);
|
|
22467
|
+
};
|
|
22468
|
+
var destroy = function destroy2() {
|
|
22469
|
+
var _a;
|
|
22470
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
22471
|
+
animationInstanceRef.current = void 0;
|
|
22472
|
+
};
|
|
22473
|
+
var loadAnimation2 = function loadAnimation3() {
|
|
22474
|
+
var forcedConfigs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
22475
|
+
var _a;
|
|
22476
|
+
if (!animationContainer.current) {
|
|
22477
|
+
return;
|
|
22478
|
+
}
|
|
22479
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
22480
|
+
var config = _objectSpread2(_objectSpread2(_objectSpread2({}, props), forcedConfigs), {}, {
|
|
22481
|
+
container: animationContainer.current
|
|
22482
|
+
});
|
|
22483
|
+
animationInstanceRef.current = import_lottie_web.default.loadAnimation(config);
|
|
22484
|
+
setAnimationLoaded(!!animationInstanceRef.current);
|
|
22485
|
+
return function() {
|
|
22486
|
+
var _a2;
|
|
22487
|
+
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.destroy();
|
|
22488
|
+
animationInstanceRef.current = void 0;
|
|
22489
|
+
};
|
|
22490
|
+
};
|
|
22491
|
+
(0, import_react30.useEffect)(function() {
|
|
22492
|
+
var onUnmount = loadAnimation2();
|
|
22493
|
+
return function() {
|
|
22494
|
+
return onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
|
|
22495
|
+
};
|
|
22496
|
+
}, [animationData2, loop]);
|
|
22497
|
+
(0, import_react30.useEffect)(function() {
|
|
22498
|
+
if (!animationInstanceRef.current) {
|
|
22499
|
+
return;
|
|
22500
|
+
}
|
|
22501
|
+
animationInstanceRef.current.autoplay = !!autoplay;
|
|
22502
|
+
}, [autoplay]);
|
|
22503
|
+
(0, import_react30.useEffect)(function() {
|
|
22504
|
+
if (!animationInstanceRef.current) {
|
|
22505
|
+
return;
|
|
22506
|
+
}
|
|
22507
|
+
if (!initialSegment) {
|
|
22508
|
+
animationInstanceRef.current.resetSegments(true);
|
|
22509
|
+
return;
|
|
22510
|
+
}
|
|
22511
|
+
if (!Array.isArray(initialSegment) || !initialSegment.length) {
|
|
22512
|
+
return;
|
|
22513
|
+
}
|
|
22514
|
+
if (animationInstanceRef.current.currentRawFrame < initialSegment[0] || animationInstanceRef.current.currentRawFrame > initialSegment[1]) {
|
|
22515
|
+
animationInstanceRef.current.currentRawFrame = initialSegment[0];
|
|
22516
|
+
}
|
|
22517
|
+
animationInstanceRef.current.setSegment(initialSegment[0], initialSegment[1]);
|
|
22518
|
+
}, [initialSegment]);
|
|
22519
|
+
(0, import_react30.useEffect)(function() {
|
|
22520
|
+
var partialListeners = [{
|
|
22521
|
+
name: "complete",
|
|
22522
|
+
handler: onComplete
|
|
22523
|
+
}, {
|
|
22524
|
+
name: "loopComplete",
|
|
22525
|
+
handler: onLoopComplete
|
|
22526
|
+
}, {
|
|
22527
|
+
name: "enterFrame",
|
|
22528
|
+
handler: onEnterFrame
|
|
22529
|
+
}, {
|
|
22530
|
+
name: "segmentStart",
|
|
22531
|
+
handler: onSegmentStart
|
|
22532
|
+
}, {
|
|
22533
|
+
name: "config_ready",
|
|
22534
|
+
handler: onConfigReady
|
|
22535
|
+
}, {
|
|
22536
|
+
name: "data_ready",
|
|
22537
|
+
handler: onDataReady
|
|
22538
|
+
}, {
|
|
22539
|
+
name: "data_failed",
|
|
22540
|
+
handler: onDataFailed
|
|
22541
|
+
}, {
|
|
22542
|
+
name: "loaded_images",
|
|
22543
|
+
handler: onLoadedImages
|
|
22544
|
+
}, {
|
|
22545
|
+
name: "DOMLoaded",
|
|
22546
|
+
handler: onDOMLoaded
|
|
22547
|
+
}, {
|
|
22548
|
+
name: "destroy",
|
|
22549
|
+
handler: onDestroy
|
|
22550
|
+
}];
|
|
22551
|
+
var listeners = partialListeners.filter(function(listener) {
|
|
22552
|
+
return listener.handler != null;
|
|
22553
|
+
});
|
|
22554
|
+
if (!listeners.length) {
|
|
22555
|
+
return;
|
|
22556
|
+
}
|
|
22557
|
+
var deregisterList = listeners.map(
|
|
22558
|
+
/**
|
|
22559
|
+
* Handle the process of adding an event listener
|
|
22560
|
+
* @param {Listener} listener
|
|
22561
|
+
* @return {Function} Function that deregister the listener
|
|
22562
|
+
*/
|
|
22563
|
+
function(listener) {
|
|
22564
|
+
var _a;
|
|
22565
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(listener.name, listener.handler);
|
|
22566
|
+
return function() {
|
|
22567
|
+
var _a2;
|
|
22568
|
+
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener(listener.name, listener.handler);
|
|
22569
|
+
};
|
|
22570
|
+
}
|
|
22571
|
+
);
|
|
22572
|
+
return function() {
|
|
22573
|
+
deregisterList.forEach(function(deregister) {
|
|
22574
|
+
return deregister();
|
|
22575
|
+
});
|
|
22576
|
+
};
|
|
22577
|
+
}, [onComplete, onLoopComplete, onEnterFrame, onSegmentStart, onConfigReady, onDataReady, onDataFailed, onLoadedImages, onDOMLoaded, onDestroy]);
|
|
22578
|
+
var View = /* @__PURE__ */ import_react30.default.createElement("div", _objectSpread2({
|
|
22579
|
+
style,
|
|
22580
|
+
ref: animationContainer
|
|
22581
|
+
}, rest));
|
|
22582
|
+
return {
|
|
22583
|
+
View,
|
|
22584
|
+
play,
|
|
22585
|
+
stop,
|
|
22586
|
+
pause,
|
|
22587
|
+
setSpeed,
|
|
22588
|
+
goToAndStop,
|
|
22589
|
+
goToAndPlay,
|
|
22590
|
+
setDirection,
|
|
22591
|
+
playSegments,
|
|
22592
|
+
setSubframe,
|
|
22593
|
+
getDuration,
|
|
22594
|
+
destroy,
|
|
22595
|
+
animationContainerRef: animationContainer,
|
|
22596
|
+
animationLoaded,
|
|
22597
|
+
animationItem: animationInstanceRef.current
|
|
22598
|
+
};
|
|
22599
|
+
};
|
|
22600
|
+
|
|
22802
22601
|
// src/ui/Lottie/index.tsx
|
|
22803
|
-
var import_react31 = require("react");
|
|
22804
|
-
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
22805
22602
|
var LazyLottie = (props) => {
|
|
22806
|
-
const
|
|
22807
|
-
|
|
22808
|
-
|
|
22809
|
-
|
|
22810
|
-
|
|
22811
|
-
},
|
|
22812
|
-
|
|
22813
|
-
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(LottieReact, { loop: true, autoplay: true, ...props });
|
|
22603
|
+
const options = {
|
|
22604
|
+
animationData: props.animationData,
|
|
22605
|
+
loop: true,
|
|
22606
|
+
autoplay: true
|
|
22607
|
+
};
|
|
22608
|
+
const { View } = useLottie(options, props.style);
|
|
22609
|
+
return View;
|
|
22814
22610
|
};
|
|
22815
22611
|
var Lottie_default = LazyLottie;
|
|
22816
22612
|
|
|
22817
22613
|
// src/context/ModalContext.tsx
|
|
22818
|
-
var
|
|
22819
|
-
var ModalContext = (0,
|
|
22614
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
22615
|
+
var ModalContext = (0, import_react31.createContext)(null);
|
|
22820
22616
|
function ModalProvider({ children }) {
|
|
22821
|
-
const [modalState, setModalState] = (0,
|
|
22617
|
+
const [modalState, setModalState] = (0, import_react31.useState)({
|
|
22822
22618
|
modals: [],
|
|
22823
22619
|
highestZIndex: 100
|
|
22824
22620
|
});
|
|
22825
|
-
const getNextIndex = (0,
|
|
22621
|
+
const getNextIndex = (0, import_react31.useCallback)(() => {
|
|
22826
22622
|
return Math.max(...modalState.modals.map((modal) => modal.index), 0) + 1 || 100;
|
|
22827
22623
|
}, [modalState]);
|
|
22828
|
-
const closeModal = (0,
|
|
22624
|
+
const closeModal = (0, import_react31.useCallback)((index2) => {
|
|
22829
22625
|
setModalState((prevState) => ({
|
|
22830
22626
|
modals: prevState.modals.filter((modal) => modal.index !== index2),
|
|
22831
22627
|
highestZIndex: prevState.highestZIndex
|
|
22832
22628
|
}));
|
|
22833
22629
|
}, []);
|
|
22834
|
-
const show = (0,
|
|
22630
|
+
const show = (0, import_react31.useCallback)((content2, index2) => {
|
|
22835
22631
|
setModalState((prevState) => {
|
|
22836
22632
|
const modalIndex = index2 !== void 0 ? index2 : getNextIndex();
|
|
22837
22633
|
const newZIndex = prevState.highestZIndex + 1;
|
|
@@ -22847,7 +22643,7 @@ function ModalProvider({ children }) {
|
|
|
22847
22643
|
};
|
|
22848
22644
|
});
|
|
22849
22645
|
}, [getNextIndex, closeModal]);
|
|
22850
|
-
const open = (0,
|
|
22646
|
+
const open = (0, import_react31.useCallback)((props) => {
|
|
22851
22647
|
setModalState((prevState) => {
|
|
22852
22648
|
const modalIndex = props.index !== void 0 ? props.index : getNextIndex();
|
|
22853
22649
|
const newZIndex = prevState.highestZIndex + 1;
|
|
@@ -22857,7 +22653,7 @@ function ModalProvider({ children }) {
|
|
|
22857
22653
|
index: modalIndex,
|
|
22858
22654
|
zIndex: newZIndex,
|
|
22859
22655
|
close: () => closeModal(modalIndex),
|
|
22860
|
-
content: ({ close, zIndex }) => /* @__PURE__ */ (0,
|
|
22656
|
+
content: ({ close, zIndex }) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ModalDrawer, { showClose: true, isOpen: true, onClose: close, title: props.title, zIndex, onBack: props.onBack, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(props.content, { close, zIndex }) })
|
|
22861
22657
|
}],
|
|
22862
22658
|
highestZIndex: newZIndex
|
|
22863
22659
|
};
|
|
@@ -22865,17 +22661,17 @@ function ModalProvider({ children }) {
|
|
|
22865
22661
|
}, [getNextIndex, closeModal]);
|
|
22866
22662
|
const modalElements = modalState.modals.sort((a, b) => b.zIndex - a.zIndex).map(
|
|
22867
22663
|
(modal) => modal.visible ? (0, import_react_dom.createPortal)(
|
|
22868
|
-
|
|
22664
|
+
import_react31.default.createElement(modal.content, { zIndex: modal.zIndex, close: modal.close }),
|
|
22869
22665
|
document.body
|
|
22870
22666
|
) : null
|
|
22871
22667
|
);
|
|
22872
|
-
return /* @__PURE__ */ (0,
|
|
22668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(ModalContext.Provider, { value: { show, open }, children: [
|
|
22873
22669
|
children,
|
|
22874
22670
|
modalElements
|
|
22875
22671
|
] });
|
|
22876
22672
|
}
|
|
22877
22673
|
function useModal() {
|
|
22878
|
-
const context = (0,
|
|
22674
|
+
const context = (0, import_react31.useContext)(ModalContext);
|
|
22879
22675
|
if (!context) {
|
|
22880
22676
|
throw new Error("useModal must be used within a ModalProvider");
|
|
22881
22677
|
}
|
|
@@ -22913,7 +22709,7 @@ var useTransactionStore = (0, import_zustand5.create)((0, import_middleware3.dev
|
|
|
22913
22709
|
var useTransactionStore_default = useTransactionStore;
|
|
22914
22710
|
|
|
22915
22711
|
// src/hooks/useWallet.tsx
|
|
22916
|
-
var
|
|
22712
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
22917
22713
|
var AppClientId = "react-sdk-" + getVersion();
|
|
22918
22714
|
function useWallet() {
|
|
22919
22715
|
const { address, wallet: walletConfig } = useLocalStore_default();
|
|
@@ -22964,7 +22760,7 @@ function useWallet() {
|
|
|
22964
22760
|
throw error;
|
|
22965
22761
|
}
|
|
22966
22762
|
};
|
|
22967
|
-
const evmAccount = (0,
|
|
22763
|
+
const evmAccount = (0, import_react32.useMemo)(() => {
|
|
22968
22764
|
try {
|
|
22969
22765
|
return address ? (0, import_accounts.toAccount)({
|
|
22970
22766
|
address,
|
|
@@ -23003,7 +22799,7 @@ function useWallet() {
|
|
|
23003
22799
|
return void 0;
|
|
23004
22800
|
}
|
|
23005
22801
|
}, [address]);
|
|
23006
|
-
(0,
|
|
22802
|
+
(0, import_react32.useEffect)(() => {
|
|
23007
22803
|
matchlog_default.log("qwe-evmAccount", evmAccount);
|
|
23008
22804
|
}, [evmAccount]);
|
|
23009
22805
|
const realCreateWalletClient = (parameters) => {
|
|
@@ -23087,12 +22883,12 @@ function useWallet() {
|
|
|
23087
22883
|
address: evmAccount.address
|
|
23088
22884
|
});
|
|
23089
22885
|
modal.show((props) => {
|
|
23090
|
-
return /* @__PURE__ */ (0,
|
|
22886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, hash: txHash, chain: _chain });
|
|
23091
22887
|
});
|
|
23092
22888
|
return txHash;
|
|
23093
22889
|
} catch (error) {
|
|
23094
22890
|
modal.show((props) => {
|
|
23095
|
-
return /* @__PURE__ */ (0,
|
|
22891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, error: typeof error == "string" ? error : error.details || error.message, chain: _chain });
|
|
23096
22892
|
});
|
|
23097
22893
|
throw error;
|
|
23098
22894
|
}
|
|
@@ -23146,14 +22942,14 @@ function useWallet() {
|
|
|
23146
22942
|
|
|
23147
22943
|
// src/hooks/useCopyClipboard.ts
|
|
23148
22944
|
var import_copy_to_clipboard = __toESM(require("copy-to-clipboard"));
|
|
23149
|
-
var
|
|
22945
|
+
var import_react33 = require("react");
|
|
23150
22946
|
function useCopyClipboard(timeout = 500) {
|
|
23151
|
-
const [isCopied, setIsCopied] = (0,
|
|
23152
|
-
const staticCopy = (0,
|
|
22947
|
+
const [isCopied, setIsCopied] = (0, import_react33.useState)(false);
|
|
22948
|
+
const staticCopy = (0, import_react33.useCallback)((text2) => {
|
|
23153
22949
|
const didCopy = (0, import_copy_to_clipboard.default)(text2);
|
|
23154
22950
|
setIsCopied(didCopy);
|
|
23155
22951
|
}, []);
|
|
23156
|
-
(0,
|
|
22952
|
+
(0, import_react33.useEffect)(() => {
|
|
23157
22953
|
if (isCopied) {
|
|
23158
22954
|
const hide = setTimeout(() => {
|
|
23159
22955
|
setIsCopied(false);
|
|
@@ -23168,49 +22964,49 @@ function useCopyClipboard(timeout = 500) {
|
|
|
23168
22964
|
}
|
|
23169
22965
|
|
|
23170
22966
|
// src/context/ToastContext.tsx
|
|
23171
|
-
var
|
|
22967
|
+
var import_react34 = require("react");
|
|
23172
22968
|
var import_react_dom2 = require("react-dom");
|
|
23173
|
-
var
|
|
23174
|
-
var ToastContext = (0,
|
|
22969
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
22970
|
+
var ToastContext = (0, import_react34.createContext)(null);
|
|
23175
22971
|
function ToastProvider({ children, zIndex = 299 }) {
|
|
23176
|
-
const [toasts, setToasts] = (0,
|
|
23177
|
-
const removeToast = (0,
|
|
22972
|
+
const [toasts, setToasts] = (0, import_react34.useState)([]);
|
|
22973
|
+
const removeToast = (0, import_react34.useCallback)((id) => {
|
|
23178
22974
|
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
23179
22975
|
}, []);
|
|
23180
|
-
const show = (0,
|
|
22976
|
+
const show = (0, import_react34.useCallback)(({ icon, timeout = 3e3, text: text2 }) => {
|
|
23181
22977
|
const id = Date.now() + Math.random();
|
|
23182
22978
|
setToasts((prev) => [...prev, { id, icon, text: text2 }]);
|
|
23183
22979
|
setTimeout(() => removeToast(id), timeout);
|
|
23184
22980
|
}, [removeToast]);
|
|
23185
|
-
const success = (0,
|
|
23186
|
-
show({ icon: /* @__PURE__ */ (0,
|
|
22981
|
+
const success = (0, import_react34.useCallback)((text2, timeout) => {
|
|
22982
|
+
show({ icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CheckRoundIcon, { color: "#2FCC00", size: 24 }), text: text2, timeout });
|
|
23187
22983
|
}, [show]);
|
|
23188
|
-
const error = (0,
|
|
23189
|
-
show({ icon: /* @__PURE__ */ (0,
|
|
22984
|
+
const error = (0, import_react34.useCallback)((text2, timeout) => {
|
|
22985
|
+
show({ icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ErrorRoundIcon, { size: 24 }), text: text2, timeout });
|
|
23190
22986
|
}, [show]);
|
|
23191
22987
|
const ToastComponent = (0, import_react_dom2.createPortal)(
|
|
23192
|
-
/* @__PURE__ */ (0,
|
|
22988
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "matchid-toast-box", style: {
|
|
23193
22989
|
zIndex
|
|
23194
|
-
}, children: toasts.reverse().map(({ id, icon, text: text2 }) => /* @__PURE__ */ (0,
|
|
22990
|
+
}, children: toasts.reverse().map(({ id, icon, text: text2 }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
23195
22991
|
"div",
|
|
23196
22992
|
{
|
|
23197
22993
|
className: "matchid-toast",
|
|
23198
22994
|
children: [
|
|
23199
|
-
icon && /* @__PURE__ */ (0,
|
|
23200
|
-
/* @__PURE__ */ (0,
|
|
22995
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { children: icon }),
|
|
22996
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { children: text2 })
|
|
23201
22997
|
]
|
|
23202
22998
|
},
|
|
23203
22999
|
id
|
|
23204
23000
|
)) }),
|
|
23205
23001
|
document.body
|
|
23206
23002
|
);
|
|
23207
|
-
return /* @__PURE__ */ (0,
|
|
23003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(ToastContext.Provider, { value: { show, success, error }, children: [
|
|
23208
23004
|
children,
|
|
23209
23005
|
ToastComponent
|
|
23210
23006
|
] });
|
|
23211
23007
|
}
|
|
23212
23008
|
function useToast() {
|
|
23213
|
-
const context = (0,
|
|
23009
|
+
const context = (0, import_react34.useContext)(ToastContext);
|
|
23214
23010
|
if (!context) {
|
|
23215
23011
|
throw new Error("useToast must be used within a ToastProvider");
|
|
23216
23012
|
}
|
|
@@ -23346,16 +23142,16 @@ function useWalletAssetListQuery({
|
|
|
23346
23142
|
}
|
|
23347
23143
|
|
|
23348
23144
|
// src/hooks/useMatchChain.tsx
|
|
23349
|
-
var
|
|
23145
|
+
var import_react35 = require("react");
|
|
23350
23146
|
var import_viem10 = require("viem");
|
|
23351
23147
|
var import_react_intl19 = require("react-intl");
|
|
23352
|
-
var
|
|
23148
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
23353
23149
|
function useMatchChain() {
|
|
23354
23150
|
const chainListQuery = useChainListQuery();
|
|
23355
23151
|
const modal = useModal();
|
|
23356
23152
|
const intl = (0, import_react_intl19.useIntl)();
|
|
23357
23153
|
const { chainId: storeChainId, setChainId } = useLocalStore_default();
|
|
23358
|
-
const chainId = (0,
|
|
23154
|
+
const chainId = (0, import_react35.useMemo)(() => {
|
|
23359
23155
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
23360
23156
|
return null;
|
|
23361
23157
|
}
|
|
@@ -23364,7 +23160,7 @@ function useMatchChain() {
|
|
|
23364
23160
|
}
|
|
23365
23161
|
return chainListQuery.data[0].id;
|
|
23366
23162
|
}, [storeChainId, chainListQuery.data]);
|
|
23367
|
-
const chain = (0,
|
|
23163
|
+
const chain = (0, import_react35.useMemo)(() => {
|
|
23368
23164
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
23369
23165
|
return null;
|
|
23370
23166
|
}
|
|
@@ -23378,30 +23174,30 @@ function useMatchChain() {
|
|
|
23378
23174
|
close
|
|
23379
23175
|
}) {
|
|
23380
23176
|
const { chainId: storeChainId2, setChainId: setChainId2 } = useLocalStore_default();
|
|
23381
|
-
const [selectedChainId, setSelectedChainId] = (0,
|
|
23177
|
+
const [selectedChainId, setSelectedChainId] = (0, import_react35.useState)(storeChainId2);
|
|
23382
23178
|
const isDownMd = useDownMd();
|
|
23383
|
-
return /* @__PURE__ */ (0,
|
|
23384
|
-
/* @__PURE__ */ (0,
|
|
23385
|
-
return /* @__PURE__ */ (0,
|
|
23179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: `matchid-change-network-box`, children: [
|
|
23180
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: `matchid-change-network-list`, children: chainListQuery.data?.map((item, index2) => {
|
|
23181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
23386
23182
|
"div",
|
|
23387
23183
|
{
|
|
23388
23184
|
onClick: () => setSelectedChainId(item.id),
|
|
23389
23185
|
className: `matchid-change-network-item ${selectedChainId == item.id ? "matchid-change-network-selected" : ""}`,
|
|
23390
23186
|
children: [
|
|
23391
|
-
/* @__PURE__ */ (0,
|
|
23392
|
-
/* @__PURE__ */ (0,
|
|
23393
|
-
/* @__PURE__ */ (0,
|
|
23187
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: `matchid-change-network-item-content`, children: [
|
|
23188
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("img", { src: item.iconUrl, className: `matchid-change-network-item-icon` }),
|
|
23189
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "matchid-change-network-item-name", children: item.name })
|
|
23394
23190
|
] }),
|
|
23395
|
-
/* @__PURE__ */ (0,
|
|
23191
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Radio, { checked: selectedChainId === item.id, size: isDownMd ? 18 : 24 })
|
|
23396
23192
|
]
|
|
23397
23193
|
},
|
|
23398
23194
|
index2
|
|
23399
23195
|
);
|
|
23400
23196
|
}) }),
|
|
23401
|
-
/* @__PURE__ */ (0,
|
|
23197
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Button, { size: "lg", highlight: true, onClick: () => {
|
|
23402
23198
|
setChainId2(selectedChainId || 0);
|
|
23403
23199
|
close();
|
|
23404
|
-
}, block: true, children: /* @__PURE__ */ (0,
|
|
23200
|
+
}, block: true, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react_intl19.FormattedMessage, { id: "confirm" }) })
|
|
23405
23201
|
] });
|
|
23406
23202
|
}
|
|
23407
23203
|
const showChangeNetwork = () => {
|
|
@@ -23410,7 +23206,7 @@ function useMatchChain() {
|
|
|
23410
23206
|
content: ChangeNetwork
|
|
23411
23207
|
});
|
|
23412
23208
|
};
|
|
23413
|
-
const publicClient = (0,
|
|
23209
|
+
const publicClient = (0, import_react35.useMemo)(() => {
|
|
23414
23210
|
if (!chain) {
|
|
23415
23211
|
return null;
|
|
23416
23212
|
}
|
|
@@ -23438,13 +23234,13 @@ function useMatchChain() {
|
|
|
23438
23234
|
|
|
23439
23235
|
// src/hooks/useMatchWallet.tsx
|
|
23440
23236
|
var import_react_qrcode = require("react-qrcode");
|
|
23441
|
-
var
|
|
23237
|
+
var import_react37 = require("react");
|
|
23442
23238
|
var import_react_query6 = require("@tanstack/react-query");
|
|
23443
23239
|
var import_viem13 = require("viem");
|
|
23444
23240
|
var import_react_intl21 = require("react-intl");
|
|
23445
23241
|
|
|
23446
23242
|
// src/components/ImportToken/index.tsx
|
|
23447
|
-
var
|
|
23243
|
+
var import_react36 = require("react");
|
|
23448
23244
|
var import_react_intl20 = require("react-intl");
|
|
23449
23245
|
var import_react_query5 = require("@tanstack/react-query");
|
|
23450
23246
|
var import_viem12 = require("viem");
|
|
@@ -23474,14 +23270,14 @@ function useIsContract({
|
|
|
23474
23270
|
}
|
|
23475
23271
|
|
|
23476
23272
|
// src/components/ImportToken/index.tsx
|
|
23477
|
-
var
|
|
23273
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
23478
23274
|
function ImportToken({ close }) {
|
|
23479
|
-
const [status, setStatus] = (0,
|
|
23275
|
+
const [status, setStatus] = (0, import_react36.useState)("");
|
|
23480
23276
|
const { token } = useUserInfo();
|
|
23481
|
-
const [address, setAddress] = (0,
|
|
23482
|
-
const [symbol, setSymbol] = (0,
|
|
23483
|
-
const [decimals, setDecimals] = (0,
|
|
23484
|
-
const [error, setError] = (0,
|
|
23277
|
+
const [address, setAddress] = (0, import_react36.useState)("");
|
|
23278
|
+
const [symbol, setSymbol] = (0, import_react36.useState)("");
|
|
23279
|
+
const [decimals, setDecimals] = (0, import_react36.useState)("");
|
|
23280
|
+
const [error, setError] = (0, import_react36.useState)({});
|
|
23485
23281
|
const { publicClient, chainId, chain } = useMatchChain();
|
|
23486
23282
|
const getContractInfo = async () => {
|
|
23487
23283
|
if (!publicClient) return;
|
|
@@ -23515,7 +23311,7 @@ function ImportToken({ close }) {
|
|
|
23515
23311
|
}
|
|
23516
23312
|
};
|
|
23517
23313
|
const intl = (0, import_react_intl20.useIntl)();
|
|
23518
|
-
(0,
|
|
23314
|
+
(0, import_react36.useEffect)(() => {
|
|
23519
23315
|
if (address.length === 42) {
|
|
23520
23316
|
const reg = /^0x[0-9a-fA-F]{40}$/;
|
|
23521
23317
|
if (!reg.test(address)) {
|
|
@@ -23534,7 +23330,7 @@ function ImportToken({ close }) {
|
|
|
23534
23330
|
}
|
|
23535
23331
|
}
|
|
23536
23332
|
}, [address, publicClient]);
|
|
23537
|
-
const [loading, setLoading] = (0,
|
|
23333
|
+
const [loading, setLoading] = (0, import_react36.useState)(false);
|
|
23538
23334
|
const toast = useToast();
|
|
23539
23335
|
const queryClient2 = (0, import_react_query5.useQueryClient)();
|
|
23540
23336
|
const onImport = async () => {
|
|
@@ -23562,7 +23358,7 @@ function ImportToken({ close }) {
|
|
|
23562
23358
|
setLoading(false);
|
|
23563
23359
|
}
|
|
23564
23360
|
};
|
|
23565
|
-
const canImport = (0,
|
|
23361
|
+
const canImport = (0, import_react36.useMemo)(() => {
|
|
23566
23362
|
if (!address) {
|
|
23567
23363
|
return false;
|
|
23568
23364
|
}
|
|
@@ -23585,22 +23381,22 @@ function ImportToken({ close }) {
|
|
|
23585
23381
|
enabled: canImport
|
|
23586
23382
|
});
|
|
23587
23383
|
if (status == "success" || status == "fail") {
|
|
23588
|
-
return /* @__PURE__ */ (0,
|
|
23589
|
-
/* @__PURE__ */ (0,
|
|
23590
|
-
/* @__PURE__ */ (0,
|
|
23384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: `matchid-import-token-result matchid-flex`, children: [
|
|
23385
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: `matchid-import-token-result-box matchid-flex`, children: [
|
|
23386
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: `matchid-import-token-result-img`, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Lottie_default, { animationData: status == "success" ? success_default : fail_default, style: {
|
|
23591
23387
|
width: "96px",
|
|
23592
23388
|
height: "96px"
|
|
23593
23389
|
} }) }),
|
|
23594
|
-
/* @__PURE__ */ (0,
|
|
23390
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: `matchid-import-token-result-text matchid-import-token-result-text-${status}`, children: status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl20.FormattedMessage, { id: "importSuccess" }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl20.FormattedMessage, { id: "importFail" }) })
|
|
23595
23391
|
] }),
|
|
23596
|
-
status == "success" ? /* @__PURE__ */ (0,
|
|
23392
|
+
status == "success" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { size: "lg", onClick: close, block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl20.FormattedMessage, { id: "close" }) }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { size: "lg", onClick: () => setStatus(""), block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl20.FormattedMessage, { id: "back" }) })
|
|
23597
23393
|
] });
|
|
23598
23394
|
}
|
|
23599
|
-
return /* @__PURE__ */ (0,
|
|
23600
|
-
/* @__PURE__ */ (0,
|
|
23601
|
-
/* @__PURE__ */ (0,
|
|
23395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: `matchid-import-token`, children: [
|
|
23396
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "matchid-import-token-form", children: [
|
|
23397
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Field, { label: intl.formatMessage({
|
|
23602
23398
|
id: "tokenSmartContract"
|
|
23603
|
-
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */ (0,
|
|
23399
|
+
}), error: error.address ? error.address : isContractQuery.isFetched && !isContractQuery.isLoading && !isContractQuery.data && canImport ? "Address isn't a contract address" : "", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23604
23400
|
Input,
|
|
23605
23401
|
{
|
|
23606
23402
|
placeholder: intl.formatMessage({
|
|
@@ -23611,9 +23407,9 @@ function ImportToken({ close }) {
|
|
|
23611
23407
|
maxLength: 42
|
|
23612
23408
|
}
|
|
23613
23409
|
) }),
|
|
23614
|
-
/* @__PURE__ */ (0,
|
|
23410
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Field, { label: intl.formatMessage({
|
|
23615
23411
|
id: "tokenSymbol"
|
|
23616
|
-
}), error: error.symbol, children: /* @__PURE__ */ (0,
|
|
23412
|
+
}), error: error.symbol, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23617
23413
|
Input,
|
|
23618
23414
|
{
|
|
23619
23415
|
placeholder: intl.formatMessage({
|
|
@@ -23624,9 +23420,9 @@ function ImportToken({ close }) {
|
|
|
23624
23420
|
maxLength: 16
|
|
23625
23421
|
}
|
|
23626
23422
|
) }),
|
|
23627
|
-
/* @__PURE__ */ (0,
|
|
23423
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Field, { label: intl.formatMessage({
|
|
23628
23424
|
id: "tokenDecimals"
|
|
23629
|
-
}), error: error.decimals, children: /* @__PURE__ */ (0,
|
|
23425
|
+
}), error: error.decimals, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23630
23426
|
Input,
|
|
23631
23427
|
{
|
|
23632
23428
|
placeholder: intl.formatMessage({
|
|
@@ -23638,7 +23434,7 @@ function ImportToken({ close }) {
|
|
|
23638
23434
|
}
|
|
23639
23435
|
) })
|
|
23640
23436
|
] }),
|
|
23641
|
-
/* @__PURE__ */ (0,
|
|
23437
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
23642
23438
|
Button,
|
|
23643
23439
|
{
|
|
23644
23440
|
size: "lg",
|
|
@@ -23647,14 +23443,14 @@ function ImportToken({ close }) {
|
|
|
23647
23443
|
loading: loading || isContractQuery.isLoading,
|
|
23648
23444
|
disabled: !canImport || !isContractQuery.data,
|
|
23649
23445
|
highlight: true,
|
|
23650
|
-
children: /* @__PURE__ */ (0,
|
|
23446
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl20.FormattedMessage, { id: "import" })
|
|
23651
23447
|
}
|
|
23652
23448
|
)
|
|
23653
23449
|
] });
|
|
23654
23450
|
}
|
|
23655
23451
|
|
|
23656
23452
|
// src/hooks/useMatchWallet.tsx
|
|
23657
|
-
var
|
|
23453
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
23658
23454
|
var ReceiveModal = () => {
|
|
23659
23455
|
const chain = useMatchChain();
|
|
23660
23456
|
const { address } = useWallet();
|
|
@@ -23668,10 +23464,10 @@ var ReceiveModal = () => {
|
|
|
23668
23464
|
}));
|
|
23669
23465
|
};
|
|
23670
23466
|
const chainLink = chain.explorerLink("address/" + address);
|
|
23671
|
-
return /* @__PURE__ */ (0,
|
|
23672
|
-
/* @__PURE__ */ (0,
|
|
23673
|
-
/* @__PURE__ */ (0,
|
|
23674
|
-
/* @__PURE__ */ (0,
|
|
23467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `matchid-receive-modal`, children: [
|
|
23468
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "matchid-receive-container", children: [
|
|
23469
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: `matchid-receive-text`, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_intl21.FormattedMessage, { id: "receiveQrcode" }) }),
|
|
23470
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: `matchid-qr-container`, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
23675
23471
|
import_react_qrcode.QRCode,
|
|
23676
23472
|
{
|
|
23677
23473
|
margin: "0",
|
|
@@ -23679,7 +23475,7 @@ var ReceiveModal = () => {
|
|
|
23679
23475
|
value: address
|
|
23680
23476
|
}
|
|
23681
23477
|
) }),
|
|
23682
|
-
/* @__PURE__ */ (0,
|
|
23478
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
23683
23479
|
"a",
|
|
23684
23480
|
{
|
|
23685
23481
|
href: chainLink,
|
|
@@ -23689,7 +23485,7 @@ var ReceiveModal = () => {
|
|
|
23689
23485
|
}
|
|
23690
23486
|
)
|
|
23691
23487
|
] }),
|
|
23692
|
-
/* @__PURE__ */ (0,
|
|
23488
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Button, { size: "lg", onClick: onCopy, block: true, highlight: true, disabled: copied, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
23693
23489
|
import_react_intl21.FormattedMessage,
|
|
23694
23490
|
{
|
|
23695
23491
|
id: "copyAddress"
|
|
@@ -23731,12 +23527,12 @@ function useMatchWallet() {
|
|
|
23731
23527
|
};
|
|
23732
23528
|
}
|
|
23733
23529
|
function useMatchWalletRecords() {
|
|
23734
|
-
const [hasMore, setHasMore] = (0,
|
|
23735
|
-
const [items, setItems] = (0,
|
|
23530
|
+
const [hasMore, setHasMore] = (0, import_react37.useState)(true);
|
|
23531
|
+
const [items, setItems] = (0, import_react37.useState)([]);
|
|
23736
23532
|
const { chainId, publicClient } = useMatchChain();
|
|
23737
23533
|
const { address } = useWallet();
|
|
23738
|
-
const hasMoreRef = (0,
|
|
23739
|
-
const nextPageParamsRef = (0,
|
|
23534
|
+
const hasMoreRef = (0, import_react37.useRef)(hasMore);
|
|
23535
|
+
const nextPageParamsRef = (0, import_react37.useRef)(void 0);
|
|
23740
23536
|
const { contracts, setContracts } = useContractStore_default();
|
|
23741
23537
|
const fetchMoreData = async () => {
|
|
23742
23538
|
const chainIdStr = chainId ? chainId.toString() : "";
|
|
@@ -23763,7 +23559,7 @@ function useMatchWalletRecords() {
|
|
|
23763
23559
|
hasMoreRef.current = true;
|
|
23764
23560
|
fetchMoreData();
|
|
23765
23561
|
};
|
|
23766
|
-
(0,
|
|
23562
|
+
(0, import_react37.useEffect)(() => {
|
|
23767
23563
|
if (chainId && address) {
|
|
23768
23564
|
onInit();
|
|
23769
23565
|
}
|
|
@@ -23819,7 +23615,7 @@ function useMatchWalletRecords() {
|
|
|
23819
23615
|
setContracts(contractMap);
|
|
23820
23616
|
}
|
|
23821
23617
|
};
|
|
23822
|
-
const list = (0,
|
|
23618
|
+
const list = (0, import_react37.useMemo)(() => {
|
|
23823
23619
|
const localTransactions = transactions[`${chainId}-${address}`] || [];
|
|
23824
23620
|
const removeList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
|
|
23825
23621
|
removeList.forEach((item) => {
|
|
@@ -23861,7 +23657,7 @@ function useMatchWalletAssets({
|
|
|
23861
23657
|
chainId: chainId || 0,
|
|
23862
23658
|
...assetListOptions
|
|
23863
23659
|
});
|
|
23864
|
-
const mergedAssets = (0,
|
|
23660
|
+
const mergedAssets = (0, import_react37.useMemo)(() => {
|
|
23865
23661
|
if (!assetListQuery.data && !importTokenQuery.data) return [];
|
|
23866
23662
|
const assetList = (assetListQuery.data || []).map((asset) => ({
|
|
23867
23663
|
...asset,
|
|
@@ -23948,7 +23744,7 @@ function useMatchWalletAssetList({
|
|
|
23948
23744
|
retry: 3
|
|
23949
23745
|
// Retry up to 3 times if failed
|
|
23950
23746
|
});
|
|
23951
|
-
const erc20Tokens = (0,
|
|
23747
|
+
const erc20Tokens = (0, import_react37.useMemo)(() => list.filter((asset) => asset.address !== NATIVE_TOKEN_ADDRESS), [list]);
|
|
23952
23748
|
const erc20BalanceQuery = (0, import_react_query6.useQuery)({
|
|
23953
23749
|
queryKey: ["erc20Balances", erc20Tokens.map((token) => token.address)],
|
|
23954
23750
|
queryFn: async () => {
|
|
@@ -23976,7 +23772,7 @@ function useMatchWalletAssetList({
|
|
|
23976
23772
|
// Refresh every 15 seconds
|
|
23977
23773
|
retry: 3
|
|
23978
23774
|
});
|
|
23979
|
-
const enrichedAssets = (0,
|
|
23775
|
+
const enrichedAssets = (0, import_react37.useMemo)(() => {
|
|
23980
23776
|
if (!list) return [];
|
|
23981
23777
|
const erc20Balances = erc20BalanceQuery.data || [];
|
|
23982
23778
|
return list.map((asset) => {
|
|
@@ -23998,7 +23794,7 @@ function useMatchWalletAssetList({
|
|
|
23998
23794
|
return { ...asset, balance, value: value2, balanceValue };
|
|
23999
23795
|
});
|
|
24000
23796
|
}, [list, nativeBalanceQuery.data, erc20BalanceQuery.data]);
|
|
24001
|
-
(0,
|
|
23797
|
+
(0, import_react37.useEffect)(() => {
|
|
24002
23798
|
const list2 = enrichedAssets.sort((a, b) => {
|
|
24003
23799
|
if (a.address === NATIVE_TOKEN_ADDRESS) return -1;
|
|
24004
23800
|
if (b.address === NATIVE_TOKEN_ADDRESS) return 1;
|
|
@@ -24023,14 +23819,14 @@ function useMatchWalletAssetList({
|
|
|
24023
23819
|
}
|
|
24024
23820
|
|
|
24025
23821
|
// src/hooks/useReceipt.tsx
|
|
24026
|
-
var
|
|
23822
|
+
var import_react38 = require("react");
|
|
24027
23823
|
var import_react_query7 = require("@tanstack/react-query");
|
|
24028
23824
|
var import_viem14 = require("viem");
|
|
24029
23825
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
24030
23826
|
var MAX_CACHE_SIZE = 500;
|
|
24031
23827
|
var STORAGE_KEY = "match_receipt_logs";
|
|
24032
23828
|
function useReceiptCache() {
|
|
24033
|
-
const [cache, setCache] = (0,
|
|
23829
|
+
const [cache, setCache] = (0, import_react38.useState)(/* @__PURE__ */ new Map());
|
|
24034
23830
|
const isLocalStorageAvailable = (() => {
|
|
24035
23831
|
try {
|
|
24036
23832
|
const testKey = "__test__";
|
|
@@ -24041,7 +23837,7 @@ function useReceiptCache() {
|
|
|
24041
23837
|
return false;
|
|
24042
23838
|
}
|
|
24043
23839
|
})();
|
|
24044
|
-
(0,
|
|
23840
|
+
(0, import_react38.useEffect)(() => {
|
|
24045
23841
|
if (isLocalStorageAvailable) {
|
|
24046
23842
|
try {
|
|
24047
23843
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -24060,7 +23856,7 @@ function useReceiptCache() {
|
|
|
24060
23856
|
}
|
|
24061
23857
|
}
|
|
24062
23858
|
}, []);
|
|
24063
|
-
const updateLocalStorage = (0,
|
|
23859
|
+
const updateLocalStorage = (0, import_react38.useCallback)((updatedCache) => {
|
|
24064
23860
|
if (isLocalStorageAvailable) {
|
|
24065
23861
|
try {
|
|
24066
23862
|
const storedData = localStorage.getItem(STORAGE_KEY);
|
|
@@ -24077,7 +23873,7 @@ function useReceiptCache() {
|
|
|
24077
23873
|
}
|
|
24078
23874
|
}
|
|
24079
23875
|
}, []);
|
|
24080
|
-
const set = (0,
|
|
23876
|
+
const set = (0, import_react38.useCallback)((key2, value2) => {
|
|
24081
23877
|
const now = Date.now();
|
|
24082
23878
|
const newCache = new Map(cache);
|
|
24083
23879
|
newCache.forEach((entry, k) => {
|
|
@@ -24095,7 +23891,7 @@ function useReceiptCache() {
|
|
|
24095
23891
|
setCache(newCache);
|
|
24096
23892
|
updateLocalStorage(newCache);
|
|
24097
23893
|
}, [cache, updateLocalStorage]);
|
|
24098
|
-
const get = (0,
|
|
23894
|
+
const get = (0, import_react38.useCallback)((key2) => {
|
|
24099
23895
|
const entry = cache.get(key2);
|
|
24100
23896
|
if (entry) {
|
|
24101
23897
|
if (Date.now() - entry.timestamp > CACHE_TTL) {
|
|
@@ -24109,7 +23905,7 @@ function useReceiptCache() {
|
|
|
24109
23905
|
}
|
|
24110
23906
|
return void 0;
|
|
24111
23907
|
}, [cache, updateLocalStorage]);
|
|
24112
|
-
const del = (0,
|
|
23908
|
+
const del = (0, import_react38.useCallback)((key2) => {
|
|
24113
23909
|
if (cache.has(key2)) {
|
|
24114
23910
|
const newCache = new Map(cache);
|
|
24115
23911
|
newCache.delete(key2);
|
|
@@ -24117,7 +23913,7 @@ function useReceiptCache() {
|
|
|
24117
23913
|
updateLocalStorage(newCache);
|
|
24118
23914
|
}
|
|
24119
23915
|
}, [cache, updateLocalStorage]);
|
|
24120
|
-
const clear = (0,
|
|
23916
|
+
const clear = (0, import_react38.useCallback)(() => {
|
|
24121
23917
|
setCache(/* @__PURE__ */ new Map());
|
|
24122
23918
|
if (isLocalStorageAvailable) {
|
|
24123
23919
|
localStorage.removeItem(STORAGE_KEY);
|
|
@@ -24132,7 +23928,7 @@ function useReceipt2({
|
|
|
24132
23928
|
const { list } = useMatchChain();
|
|
24133
23929
|
const cache = useReceiptCache();
|
|
24134
23930
|
const chain = list?.find((item) => item.id === chainId);
|
|
24135
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
23931
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react38.useState)(true);
|
|
24136
23932
|
const query = (0, import_react_query7.useQuery)({
|
|
24137
23933
|
queryKey: ["match-tx-receipt", hash, chain],
|
|
24138
23934
|
queryFn: async () => {
|
|
@@ -24158,7 +23954,7 @@ function useReceipt2({
|
|
|
24158
23954
|
},
|
|
24159
23955
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
24160
23956
|
});
|
|
24161
|
-
(0,
|
|
23957
|
+
(0, import_react38.useEffect)(() => {
|
|
24162
23958
|
if (query.data) {
|
|
24163
23959
|
setShouldRefetch(false);
|
|
24164
23960
|
}
|
|
@@ -24167,14 +23963,14 @@ function useReceipt2({
|
|
|
24167
23963
|
}
|
|
24168
23964
|
|
|
24169
23965
|
// src/hooks/useTransaction.tsx
|
|
24170
|
-
var
|
|
23966
|
+
var import_react39 = require("react");
|
|
24171
23967
|
var import_react_query8 = require("@tanstack/react-query");
|
|
24172
23968
|
var import_viem15 = require("viem");
|
|
24173
23969
|
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
24174
23970
|
var MAX_CACHE_SIZE2 = 500;
|
|
24175
23971
|
var STORAGE_KEY2 = "match_transaction_logs";
|
|
24176
23972
|
function useTransactionCache() {
|
|
24177
|
-
const [cache, setCache] = (0,
|
|
23973
|
+
const [cache, setCache] = (0, import_react39.useState)(/* @__PURE__ */ new Map());
|
|
24178
23974
|
const isLocalStorageAvailable = (() => {
|
|
24179
23975
|
try {
|
|
24180
23976
|
const testKey = "__test__";
|
|
@@ -24185,7 +23981,7 @@ function useTransactionCache() {
|
|
|
24185
23981
|
return false;
|
|
24186
23982
|
}
|
|
24187
23983
|
})();
|
|
24188
|
-
(0,
|
|
23984
|
+
(0, import_react39.useEffect)(() => {
|
|
24189
23985
|
if (isLocalStorageAvailable) {
|
|
24190
23986
|
try {
|
|
24191
23987
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -24204,7 +24000,7 @@ function useTransactionCache() {
|
|
|
24204
24000
|
}
|
|
24205
24001
|
}
|
|
24206
24002
|
}, []);
|
|
24207
|
-
const updateLocalStorage = (0,
|
|
24003
|
+
const updateLocalStorage = (0, import_react39.useCallback)((updatedCache) => {
|
|
24208
24004
|
if (isLocalStorageAvailable) {
|
|
24209
24005
|
try {
|
|
24210
24006
|
const storedData = localStorage.getItem(STORAGE_KEY2);
|
|
@@ -24221,7 +24017,7 @@ function useTransactionCache() {
|
|
|
24221
24017
|
}
|
|
24222
24018
|
}
|
|
24223
24019
|
}, []);
|
|
24224
|
-
const set = (0,
|
|
24020
|
+
const set = (0, import_react39.useCallback)((key2, value2) => {
|
|
24225
24021
|
const now = Date.now();
|
|
24226
24022
|
const newCache = new Map(cache);
|
|
24227
24023
|
newCache.forEach((entry, k) => {
|
|
@@ -24239,7 +24035,7 @@ function useTransactionCache() {
|
|
|
24239
24035
|
setCache(newCache);
|
|
24240
24036
|
updateLocalStorage(newCache);
|
|
24241
24037
|
}, [cache, updateLocalStorage]);
|
|
24242
|
-
const get = (0,
|
|
24038
|
+
const get = (0, import_react39.useCallback)((key2) => {
|
|
24243
24039
|
const entry = cache.get(key2);
|
|
24244
24040
|
if (entry) {
|
|
24245
24041
|
if (Date.now() - entry.timestamp > CACHE_TTL2) {
|
|
@@ -24253,7 +24049,7 @@ function useTransactionCache() {
|
|
|
24253
24049
|
}
|
|
24254
24050
|
return void 0;
|
|
24255
24051
|
}, [cache, updateLocalStorage]);
|
|
24256
|
-
const del = (0,
|
|
24052
|
+
const del = (0, import_react39.useCallback)((key2) => {
|
|
24257
24053
|
if (cache.has(key2)) {
|
|
24258
24054
|
const newCache = new Map(cache);
|
|
24259
24055
|
newCache.delete(key2);
|
|
@@ -24261,7 +24057,7 @@ function useTransactionCache() {
|
|
|
24261
24057
|
updateLocalStorage(newCache);
|
|
24262
24058
|
}
|
|
24263
24059
|
}, [cache, updateLocalStorage]);
|
|
24264
|
-
const clear = (0,
|
|
24060
|
+
const clear = (0, import_react39.useCallback)(() => {
|
|
24265
24061
|
setCache(/* @__PURE__ */ new Map());
|
|
24266
24062
|
if (isLocalStorageAvailable) {
|
|
24267
24063
|
localStorage.removeItem(STORAGE_KEY2);
|
|
@@ -24276,7 +24072,7 @@ function useTransaction({
|
|
|
24276
24072
|
const { list } = useMatchChain();
|
|
24277
24073
|
const cache = useTransactionCache();
|
|
24278
24074
|
const chain = list?.find((item) => item.id === chainId);
|
|
24279
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
24075
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react39.useState)(true);
|
|
24280
24076
|
const query = (0, import_react_query8.useQuery)({
|
|
24281
24077
|
queryKey: ["match-tx-transaction", hash, chain],
|
|
24282
24078
|
queryFn: async () => {
|
|
@@ -24302,7 +24098,7 @@ function useTransaction({
|
|
|
24302
24098
|
},
|
|
24303
24099
|
refetchInterval: shouldRefetch ? 1e4 : false
|
|
24304
24100
|
});
|
|
24305
|
-
(0,
|
|
24101
|
+
(0, import_react39.useEffect)(() => {
|
|
24306
24102
|
if (query.data) {
|
|
24307
24103
|
setShouldRefetch(false);
|
|
24308
24104
|
}
|
|
@@ -24311,9 +24107,9 @@ function useTransaction({
|
|
|
24311
24107
|
}
|
|
24312
24108
|
|
|
24313
24109
|
// src/components/CEXBindModal/index.tsx
|
|
24314
|
-
var
|
|
24110
|
+
var import_react40 = require("react");
|
|
24315
24111
|
var import_react_intl22 = require("react-intl");
|
|
24316
|
-
var
|
|
24112
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
24317
24113
|
function CEXBindModal({
|
|
24318
24114
|
onClose,
|
|
24319
24115
|
type,
|
|
@@ -24322,16 +24118,16 @@ function CEXBindModal({
|
|
|
24322
24118
|
}) {
|
|
24323
24119
|
const intl = (0, import_react_intl22.useIntl)();
|
|
24324
24120
|
const { events } = useMatch();
|
|
24325
|
-
const [APIPassphrase, setAPIPassphrase] = (0,
|
|
24121
|
+
const [APIPassphrase, setAPIPassphrase] = (0, import_react40.useState)("");
|
|
24326
24122
|
const { refreshOverview } = useUserInfo();
|
|
24327
|
-
const [loading, setLoading] = (0,
|
|
24328
|
-
const [key2, setKey] = (0,
|
|
24329
|
-
const [secret, setSecret] = (0,
|
|
24330
|
-
const [error, setError] = (0,
|
|
24331
|
-
const needPassphrase = (0,
|
|
24123
|
+
const [loading, setLoading] = (0, import_react40.useState)(false);
|
|
24124
|
+
const [key2, setKey] = (0, import_react40.useState)("");
|
|
24125
|
+
const [secret, setSecret] = (0, import_react40.useState)("");
|
|
24126
|
+
const [error, setError] = (0, import_react40.useState)("");
|
|
24127
|
+
const needPassphrase = (0, import_react40.useMemo)(() => {
|
|
24332
24128
|
return ["bitget", "okx"].includes(type.toLowerCase());
|
|
24333
24129
|
}, [type]);
|
|
24334
|
-
(0,
|
|
24130
|
+
(0, import_react40.useEffect)(() => {
|
|
24335
24131
|
if (isOpen) {
|
|
24336
24132
|
setSecret("");
|
|
24337
24133
|
setKey("");
|
|
@@ -24368,20 +24164,20 @@ function CEXBindModal({
|
|
|
24368
24164
|
setLoading(false);
|
|
24369
24165
|
}
|
|
24370
24166
|
};
|
|
24371
|
-
return /* @__PURE__ */ (0,
|
|
24167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(ModalWithHeader, { showClose: true, isOpen, onClose, title: intl.formatMessage({
|
|
24372
24168
|
id: "CEXBindTitle"
|
|
24373
24169
|
}, {
|
|
24374
24170
|
type
|
|
24375
|
-
}), ...props, children: /* @__PURE__ */ (0,
|
|
24376
|
-
/* @__PURE__ */ (0,
|
|
24377
|
-
/* @__PURE__ */ (0,
|
|
24378
|
-
/* @__PURE__ */ (0,
|
|
24379
|
-
/* @__PURE__ */ (0,
|
|
24380
|
-
/* @__PURE__ */ (0,
|
|
24171
|
+
}), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "matchid-cex-modal", children: [
|
|
24172
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { children: [
|
|
24173
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_intl22.FormattedMessage, { id: "CEXBindAttention" }) }),
|
|
24174
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_intl22.FormattedMessage, { id: "CEXBindTips1" }) }),
|
|
24175
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_intl22.FormattedMessage, { id: "CEXBindTips2" }) }),
|
|
24176
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_intl22.FormattedMessage, { id: "CEXBindTips3" }) })
|
|
24381
24177
|
] }),
|
|
24382
|
-
/* @__PURE__ */ (0,
|
|
24178
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Field, { label: intl.formatMessage({
|
|
24383
24179
|
id: "CEXBindApiKey"
|
|
24384
|
-
}), children: /* @__PURE__ */ (0,
|
|
24180
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
24385
24181
|
Input,
|
|
24386
24182
|
{
|
|
24387
24183
|
value: key2,
|
|
@@ -24389,9 +24185,9 @@ function CEXBindModal({
|
|
|
24389
24185
|
placeholder: "**** **** ****"
|
|
24390
24186
|
}
|
|
24391
24187
|
) }),
|
|
24392
|
-
/* @__PURE__ */ (0,
|
|
24188
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Field, { label: intl.formatMessage({
|
|
24393
24189
|
id: "CEXBindApiSecretKey"
|
|
24394
|
-
}), error: !needPassphrase && error, children: /* @__PURE__ */ (0,
|
|
24190
|
+
}), error: !needPassphrase && error, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
24395
24191
|
Input,
|
|
24396
24192
|
{
|
|
24397
24193
|
value: secret,
|
|
@@ -24399,9 +24195,9 @@ function CEXBindModal({
|
|
|
24399
24195
|
placeholder: "**** **** ****"
|
|
24400
24196
|
}
|
|
24401
24197
|
) }),
|
|
24402
|
-
needPassphrase && /* @__PURE__ */ (0,
|
|
24198
|
+
needPassphrase && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Field, { error, label: intl.formatMessage({
|
|
24403
24199
|
id: "CEXBindApiPassphrase"
|
|
24404
|
-
}), children: /* @__PURE__ */ (0,
|
|
24200
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
24405
24201
|
Input,
|
|
24406
24202
|
{
|
|
24407
24203
|
value: APIPassphrase,
|
|
@@ -24409,7 +24205,7 @@ function CEXBindModal({
|
|
|
24409
24205
|
placeholder: "**** **** ****"
|
|
24410
24206
|
}
|
|
24411
24207
|
) }),
|
|
24412
|
-
/* @__PURE__ */ (0,
|
|
24208
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
24413
24209
|
Button,
|
|
24414
24210
|
{
|
|
24415
24211
|
onClick: SubmitApi,
|
|
@@ -24417,7 +24213,7 @@ function CEXBindModal({
|
|
|
24417
24213
|
block: true,
|
|
24418
24214
|
loading,
|
|
24419
24215
|
disabled: !key2 || !secret,
|
|
24420
|
-
children: /* @__PURE__ */ (0,
|
|
24216
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_intl22.FormattedMessage, { id: "continue" })
|
|
24421
24217
|
}
|
|
24422
24218
|
)
|
|
24423
24219
|
] }) });
|
|
@@ -24425,7 +24221,7 @@ function CEXBindModal({
|
|
|
24425
24221
|
|
|
24426
24222
|
// src/context/BusinessProvider.tsx
|
|
24427
24223
|
var import_react_query9 = require("@tanstack/react-query");
|
|
24428
|
-
var
|
|
24224
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
24429
24225
|
function BusinessProvider({ children }) {
|
|
24430
24226
|
const { overview, token } = useUserInfo();
|
|
24431
24227
|
const { type: EVMType, isOpen: EVMIsOpen, close: EVMClose } = useEVMModalStore();
|
|
@@ -24459,8 +24255,8 @@ function BusinessProvider({ children }) {
|
|
|
24459
24255
|
enabled: !!tgAppAuthCode,
|
|
24460
24256
|
refetchInterval: 1e3 * 5
|
|
24461
24257
|
});
|
|
24462
|
-
return /* @__PURE__ */ (0,
|
|
24463
|
-
/* @__PURE__ */ (0,
|
|
24258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
|
|
24259
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
24464
24260
|
EVMModal,
|
|
24465
24261
|
{
|
|
24466
24262
|
isOpen: EVMIsOpen && (EVMType == "login" && !overview && !token || EVMType == "bind" && !!token && !!overview),
|
|
@@ -24470,7 +24266,7 @@ function BusinessProvider({ children }) {
|
|
|
24470
24266
|
zIndex: 199
|
|
24471
24267
|
}
|
|
24472
24268
|
),
|
|
24473
|
-
/* @__PURE__ */ (0,
|
|
24269
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
24474
24270
|
TRONModal,
|
|
24475
24271
|
{
|
|
24476
24272
|
isOpen: TRONIsOpen && (TRONType == "login" && !overview && !token || TRONType == "bind" && !!token && !!overview),
|
|
@@ -24480,7 +24276,7 @@ function BusinessProvider({ children }) {
|
|
|
24480
24276
|
zIndex: 199
|
|
24481
24277
|
}
|
|
24482
24278
|
),
|
|
24483
|
-
/* @__PURE__ */ (0,
|
|
24279
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
24484
24280
|
TONModal,
|
|
24485
24281
|
{
|
|
24486
24282
|
isOpen: TONIsOpen && (TONType == "login" && !overview && !token || TONType == "bind" && !!token && !!overview),
|
|
@@ -24490,7 +24286,7 @@ function BusinessProvider({ children }) {
|
|
|
24490
24286
|
zIndex: 199
|
|
24491
24287
|
}
|
|
24492
24288
|
),
|
|
24493
|
-
/* @__PURE__ */ (0,
|
|
24289
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
24494
24290
|
BTCModal,
|
|
24495
24291
|
{
|
|
24496
24292
|
isOpen: BTCIsOpen && (BTCType == "login" && !overview && !token || BTCType == "bind" && !!token && !!overview),
|
|
@@ -24500,7 +24296,7 @@ function BusinessProvider({ children }) {
|
|
|
24500
24296
|
zIndex: 199
|
|
24501
24297
|
}
|
|
24502
24298
|
),
|
|
24503
|
-
/* @__PURE__ */ (0,
|
|
24299
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
24504
24300
|
CEXBindModal,
|
|
24505
24301
|
{
|
|
24506
24302
|
isOpen: CEXIsOpen && (!!token && !!overview),
|
|
@@ -24509,7 +24305,7 @@ function BusinessProvider({ children }) {
|
|
|
24509
24305
|
zIndex: 199
|
|
24510
24306
|
}
|
|
24511
24307
|
),
|
|
24512
|
-
/* @__PURE__ */ (0,
|
|
24308
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
24513
24309
|
WalletModal,
|
|
24514
24310
|
{
|
|
24515
24311
|
isOpen: WalletModalStore.isOpen && (WalletModalStore.type == "login" && !overview && !token || WalletModalStore.type == "bind" && !!token && !!overview),
|
|
@@ -24524,14 +24320,14 @@ function BusinessProvider({ children }) {
|
|
|
24524
24320
|
}
|
|
24525
24321
|
|
|
24526
24322
|
// src/context/index.tsx
|
|
24527
|
-
var
|
|
24323
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
24528
24324
|
var Providers = ({ children }) => {
|
|
24529
|
-
return /* @__PURE__ */ (0,
|
|
24325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ToastProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ModalProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(BusinessProvider, { children }) }) });
|
|
24530
24326
|
};
|
|
24531
24327
|
var context_default = Providers;
|
|
24532
24328
|
|
|
24533
24329
|
// src/hooks/useWalletInit.ts
|
|
24534
|
-
var
|
|
24330
|
+
var import_react41 = require("react");
|
|
24535
24331
|
|
|
24536
24332
|
// src/utils/wallet.ts
|
|
24537
24333
|
var sendMessage = ({ method, data: data2, resolve, reject, timeout }) => {
|
|
@@ -24564,11 +24360,11 @@ function useWalletInit({
|
|
|
24564
24360
|
}) {
|
|
24565
24361
|
const { endpoints, token, setWallet, appid, refreshOverview } = useLocalStore_default();
|
|
24566
24362
|
const { setWalletReady, walletReady } = useStore_default();
|
|
24567
|
-
const iframeReadyRef = (0,
|
|
24568
|
-
(0,
|
|
24363
|
+
const iframeReadyRef = (0, import_react41.useRef)(walletReady);
|
|
24364
|
+
(0, import_react41.useEffect)(() => {
|
|
24569
24365
|
setWallet(config);
|
|
24570
24366
|
}, [config]);
|
|
24571
|
-
(0,
|
|
24367
|
+
(0, import_react41.useEffect)(() => {
|
|
24572
24368
|
matchlog_default.log("sdk.mpc.status", walletReady, iframeReadyRef.current);
|
|
24573
24369
|
iframeReadyRef.current = walletReady;
|
|
24574
24370
|
if (iframeReadyRef.current) {
|
|
@@ -24585,7 +24381,7 @@ function useWalletInit({
|
|
|
24585
24381
|
onReady();
|
|
24586
24382
|
}
|
|
24587
24383
|
}, [walletReady]);
|
|
24588
|
-
(0,
|
|
24384
|
+
(0, import_react41.useEffect)(() => {
|
|
24589
24385
|
if (!endpoints.auth || !appid || !token || !config) {
|
|
24590
24386
|
const existingIframe = getWalletIframe();
|
|
24591
24387
|
if (existingIframe) {
|
|
@@ -24685,7 +24481,7 @@ function useWalletInit({
|
|
|
24685
24481
|
}
|
|
24686
24482
|
}
|
|
24687
24483
|
}, [endpoints.auth, appid, token, config]);
|
|
24688
|
-
(0,
|
|
24484
|
+
(0, import_react41.useEffect)(() => {
|
|
24689
24485
|
const messageHandle = async (e) => {
|
|
24690
24486
|
if (e.origin !== endpoints.auth.substring(0, endpoints.auth.length - 1)) {
|
|
24691
24487
|
return;
|
|
@@ -24766,7 +24562,7 @@ function useWalletInit({
|
|
|
24766
24562
|
}
|
|
24767
24563
|
|
|
24768
24564
|
// src/hooks/useInit.tsx
|
|
24769
|
-
var
|
|
24565
|
+
var import_react42 = require("react");
|
|
24770
24566
|
function useInit({
|
|
24771
24567
|
theme,
|
|
24772
24568
|
appid,
|
|
@@ -24786,24 +24582,24 @@ function useInit({
|
|
|
24786
24582
|
locale: realLocale
|
|
24787
24583
|
} = useLocalStore_default();
|
|
24788
24584
|
const walletModalStore = useWalletModalStore();
|
|
24789
|
-
const overviewLoadingRef = (0,
|
|
24585
|
+
const overviewLoadingRef = (0, import_react42.useRef)(false);
|
|
24790
24586
|
const searchParams = new URLSearchParams(window.location.search);
|
|
24791
24587
|
const matchToken = searchParams.get("matchToken");
|
|
24792
24588
|
const matchidt = searchParams.get("matchidt");
|
|
24793
24589
|
const realEndpoints = endpoints || env_default.endpoints;
|
|
24794
|
-
(0,
|
|
24590
|
+
(0, import_react42.useEffect)(() => {
|
|
24795
24591
|
setTheme(theme);
|
|
24796
24592
|
}, [theme]);
|
|
24797
|
-
(0,
|
|
24593
|
+
(0, import_react42.useEffect)(() => {
|
|
24798
24594
|
setAppid(appid);
|
|
24799
24595
|
}, [appid]);
|
|
24800
|
-
(0,
|
|
24596
|
+
(0, import_react42.useEffect)(() => {
|
|
24801
24597
|
setEndpoints(realEndpoints);
|
|
24802
24598
|
}, [realEndpoints]);
|
|
24803
|
-
(0,
|
|
24599
|
+
(0, import_react42.useEffect)(() => {
|
|
24804
24600
|
setLocale(locale || "en");
|
|
24805
24601
|
}, [locale]);
|
|
24806
|
-
(0,
|
|
24602
|
+
(0, import_react42.useEffect)(() => {
|
|
24807
24603
|
if (matchToken) {
|
|
24808
24604
|
const tokenData = JSON.parse(atob(matchToken));
|
|
24809
24605
|
if (tokenData && tokenData.mid && tokenData.token) {
|
|
@@ -24814,7 +24610,7 @@ function useInit({
|
|
|
24814
24610
|
}
|
|
24815
24611
|
}
|
|
24816
24612
|
}, [matchToken]);
|
|
24817
|
-
(0,
|
|
24613
|
+
(0, import_react42.useEffect)(() => {
|
|
24818
24614
|
if (matchidt) {
|
|
24819
24615
|
const tokenData = decodeURIComponent(matchidt);
|
|
24820
24616
|
const data2 = JSON.parse(decodeBase64(tokenData));
|
|
@@ -24844,7 +24640,7 @@ function useInit({
|
|
|
24844
24640
|
}
|
|
24845
24641
|
}
|
|
24846
24642
|
}, [matchidt]);
|
|
24847
|
-
(0,
|
|
24643
|
+
(0, import_react42.useEffect)(() => {
|
|
24848
24644
|
const onLoginMessage = (event) => {
|
|
24849
24645
|
const res = event.data;
|
|
24850
24646
|
if (res.event === "login" && res.data && (res.data.token || res.data.token_type && res.data.access_token)) {
|
|
@@ -24881,7 +24677,7 @@ function useInit({
|
|
|
24881
24677
|
overviewLoadingRef.current = false;
|
|
24882
24678
|
}
|
|
24883
24679
|
};
|
|
24884
|
-
(0,
|
|
24680
|
+
(0, import_react42.useEffect)(() => {
|
|
24885
24681
|
if (token) {
|
|
24886
24682
|
loadOverview();
|
|
24887
24683
|
}
|
|
@@ -25788,7 +25584,7 @@ var matchTest = /* @__PURE__ */ (0, import_viem17.defineChain)({
|
|
|
25788
25584
|
|
|
25789
25585
|
// src/MatchContext.tsx
|
|
25790
25586
|
var import_wagmi3 = require("wagmi");
|
|
25791
|
-
var
|
|
25587
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
25792
25588
|
var queryClient = new import_react_query10.QueryClient();
|
|
25793
25589
|
var wagmiConfig = (0, import_rainbowkit2.getDefaultConfig)({
|
|
25794
25590
|
appName: "MatchID",
|
|
@@ -25807,7 +25603,7 @@ var wagmiConfig = (0, import_rainbowkit2.getDefaultConfig)({
|
|
|
25807
25603
|
],
|
|
25808
25604
|
chains: [import_chains.mainnet, import_chains.polygon, import_chains.optimism, import_chains.arbitrum, import_chains.base, matchMain, matchTest, import_chains.bsc]
|
|
25809
25605
|
});
|
|
25810
|
-
var MatchContext = (0,
|
|
25606
|
+
var MatchContext = (0, import_react43.createContext)(void 0);
|
|
25811
25607
|
var MatchProvider = ({
|
|
25812
25608
|
children,
|
|
25813
25609
|
appid,
|
|
@@ -25827,7 +25623,7 @@ var MatchProvider = ({
|
|
|
25827
25623
|
useWalletInit({
|
|
25828
25624
|
config: wallet
|
|
25829
25625
|
});
|
|
25830
|
-
return /* @__PURE__ */ (0,
|
|
25626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_intl23.IntlProvider, { locale: realLocale, messages: messages[realLocale], children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_wagmi3.WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_query10.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_rainbowkit2.RainbowKitProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
25831
25627
|
MatchContext.Provider,
|
|
25832
25628
|
{
|
|
25833
25629
|
value: {
|
|
@@ -25838,12 +25634,12 @@ var MatchProvider = ({
|
|
|
25838
25634
|
theme,
|
|
25839
25635
|
locale: realLocale
|
|
25840
25636
|
},
|
|
25841
|
-
children: /* @__PURE__ */ (0,
|
|
25637
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(context_default, { children })
|
|
25842
25638
|
}
|
|
25843
25639
|
) }) }) }) });
|
|
25844
25640
|
};
|
|
25845
25641
|
var useMatch = () => {
|
|
25846
|
-
const context = (0,
|
|
25642
|
+
const context = (0, import_react43.useContext)(MatchContext);
|
|
25847
25643
|
if (context === void 0) {
|
|
25848
25644
|
throw new Error("useMatch must be used within a MatchProvider");
|
|
25849
25645
|
}
|
|
@@ -25962,8 +25758,5 @@ lottie-web/build/player/lottie.js:
|
|
|
25962
25758
|
Contributions by leeoniya.
|
|
25963
25759
|
License: MIT, header required.
|
|
25964
25760
|
*)
|
|
25965
|
-
|
|
25966
|
-
lottie-react/build/index.es.js:
|
|
25967
|
-
(*! goToAndStop must be relative to the start of the current segment *)
|
|
25968
25761
|
*/
|
|
25969
25762
|
//# sourceMappingURL=index.js.map
|