@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/components.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_react10, _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_react10 = __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_react10.useState)(false), _useState2 = _slicedToArray(_useState, 2), animationLoaded = _useState2[0], setAnimationLoaded = _useState2[1];
|
|
16522
|
-
var animationInstanceRef = (0, import_react10.useRef)();
|
|
16523
|
-
var animationContainer = (0, import_react10.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_react10.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_react10.useEffect)(function() {
|
|
16594
|
-
if (!animationInstanceRef.current) {
|
|
16595
|
-
return;
|
|
16596
|
-
}
|
|
16597
|
-
animationInstanceRef.current.autoplay = !!autoplay;
|
|
16598
|
-
}, [autoplay]);
|
|
16599
|
-
(0, import_react10.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_react10.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_react10.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_react10.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_react10.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/components/index.tsx
|
|
16870
16377
|
var components_exports = {};
|
|
16871
16378
|
__export(components_exports, {
|
|
@@ -16896,7 +16403,7 @@ __export(components_exports, {
|
|
|
16896
16403
|
module.exports = __toCommonJS(components_exports);
|
|
16897
16404
|
|
|
16898
16405
|
// src/components/EmailModal/index.tsx
|
|
16899
|
-
var
|
|
16406
|
+
var import_react26 = require("react");
|
|
16900
16407
|
|
|
16901
16408
|
// src/ui/Modal/index.tsx
|
|
16902
16409
|
var import_react3 = require("react");
|
|
@@ -18734,10 +18241,10 @@ var localStore = useLocalStore;
|
|
|
18734
18241
|
var useLocalStore_default = useLocalStore;
|
|
18735
18242
|
|
|
18736
18243
|
// src/hooks/useUserInfo.tsx
|
|
18737
|
-
var
|
|
18244
|
+
var import_react24 = require("react");
|
|
18738
18245
|
|
|
18739
18246
|
// src/MatchContext.tsx
|
|
18740
|
-
var
|
|
18247
|
+
var import_react23 = require("react");
|
|
18741
18248
|
|
|
18742
18249
|
// src/hooks/useMatchEvents.ts
|
|
18743
18250
|
var import_react6 = require("react");
|
|
@@ -18788,11 +18295,11 @@ var useStore_default = useStore;
|
|
|
18788
18295
|
// src/hooks/useWallet.tsx
|
|
18789
18296
|
var import_accounts = require("viem/accounts");
|
|
18790
18297
|
var import_viem3 = require("viem");
|
|
18791
|
-
var
|
|
18298
|
+
var import_react12 = require("react");
|
|
18792
18299
|
var import_viem4 = require("viem");
|
|
18793
18300
|
|
|
18794
18301
|
// src/context/ModalContext.tsx
|
|
18795
|
-
var
|
|
18302
|
+
var import_react11 = __toESM(require("react"));
|
|
18796
18303
|
var import_react_dom = require("react-dom");
|
|
18797
18304
|
|
|
18798
18305
|
// src/ui/Drawer/index.tsx
|
|
@@ -19093,49 +18600,338 @@ var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
|
19093
18600
|
// src/ui/Tabs/index.tsx
|
|
19094
18601
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
19095
18602
|
|
|
19096
|
-
//
|
|
19097
|
-
var
|
|
19098
|
-
var
|
|
19099
|
-
var
|
|
19100
|
-
|
|
19101
|
-
(
|
|
19102
|
-
|
|
19103
|
-
|
|
19104
|
-
});
|
|
19105
|
-
}, []);
|
|
19106
|
-
if (!LottieReact) return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { children: "Loading..." });
|
|
19107
|
-
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(LottieReact, { loop: true, autoplay: true, ...props });
|
|
19108
|
-
};
|
|
19109
|
-
var Lottie_default = LazyLottie;
|
|
19110
|
-
|
|
19111
|
-
// src/context/ModalContext.tsx
|
|
19112
|
-
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
19113
|
-
var ModalContext = (0, import_react12.createContext)(null);
|
|
19114
|
-
function useModal() {
|
|
19115
|
-
const context = (0, import_react12.useContext)(ModalContext);
|
|
19116
|
-
if (!context) {
|
|
19117
|
-
throw new Error("useModal must be used within a ModalProvider");
|
|
19118
|
-
}
|
|
19119
|
-
return context;
|
|
18603
|
+
// node_modules/lottie-react/build/index.es.js
|
|
18604
|
+
var import_lottie_web = __toESM(require_lottie());
|
|
18605
|
+
var import_lottie_web2 = __toESM(require_lottie());
|
|
18606
|
+
var import_react10 = __toESM(require("react"));
|
|
18607
|
+
function _arrayLikeToArray(r, a) {
|
|
18608
|
+
(null == a || a > r.length) && (a = r.length);
|
|
18609
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
18610
|
+
return n;
|
|
19120
18611
|
}
|
|
19121
|
-
|
|
19122
|
-
|
|
19123
|
-
|
|
19124
|
-
|
|
19125
|
-
|
|
19126
|
-
|
|
19127
|
-
|
|
19128
|
-
|
|
19129
|
-
|
|
19130
|
-
|
|
19131
|
-
|
|
19132
|
-
|
|
19133
|
-
|
|
19134
|
-
|
|
19135
|
-
|
|
19136
|
-
|
|
19137
|
-
|
|
19138
|
-
|
|
18612
|
+
function _arrayWithHoles(r) {
|
|
18613
|
+
if (Array.isArray(r)) return r;
|
|
18614
|
+
}
|
|
18615
|
+
function _defineProperty(e, r, t) {
|
|
18616
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
18617
|
+
value: t,
|
|
18618
|
+
enumerable: true,
|
|
18619
|
+
configurable: true,
|
|
18620
|
+
writable: true
|
|
18621
|
+
}) : e[r] = t, e;
|
|
18622
|
+
}
|
|
18623
|
+
function _iterableToArrayLimit(r, l) {
|
|
18624
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
18625
|
+
if (null != t) {
|
|
18626
|
+
var e, n, i, u, a = [], f = true, o = false;
|
|
18627
|
+
try {
|
|
18628
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
18629
|
+
if (Object(t) !== t) return;
|
|
18630
|
+
f = false;
|
|
18631
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
18632
|
+
} catch (r2) {
|
|
18633
|
+
o = true, n = r2;
|
|
18634
|
+
} finally {
|
|
18635
|
+
try {
|
|
18636
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
18637
|
+
} finally {
|
|
18638
|
+
if (o) throw n;
|
|
18639
|
+
}
|
|
18640
|
+
}
|
|
18641
|
+
return a;
|
|
18642
|
+
}
|
|
18643
|
+
}
|
|
18644
|
+
function _nonIterableRest() {
|
|
18645
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
18646
|
+
}
|
|
18647
|
+
function ownKeys(e, r) {
|
|
18648
|
+
var t = Object.keys(e);
|
|
18649
|
+
if (Object.getOwnPropertySymbols) {
|
|
18650
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
18651
|
+
r && (o = o.filter(function(r2) {
|
|
18652
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
18653
|
+
})), t.push.apply(t, o);
|
|
18654
|
+
}
|
|
18655
|
+
return t;
|
|
18656
|
+
}
|
|
18657
|
+
function _objectSpread2(e) {
|
|
18658
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
18659
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
18660
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
18661
|
+
_defineProperty(e, r2, t[r2]);
|
|
18662
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
18663
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
18664
|
+
});
|
|
18665
|
+
}
|
|
18666
|
+
return e;
|
|
18667
|
+
}
|
|
18668
|
+
function _objectWithoutProperties(e, t) {
|
|
18669
|
+
if (null == e) return {};
|
|
18670
|
+
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
18671
|
+
if (Object.getOwnPropertySymbols) {
|
|
18672
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
18673
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
18674
|
+
}
|
|
18675
|
+
return i;
|
|
18676
|
+
}
|
|
18677
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
18678
|
+
if (null == r) return {};
|
|
18679
|
+
var t = {};
|
|
18680
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
18681
|
+
if (e.includes(n)) continue;
|
|
18682
|
+
t[n] = r[n];
|
|
18683
|
+
}
|
|
18684
|
+
return t;
|
|
18685
|
+
}
|
|
18686
|
+
function _slicedToArray(r, e) {
|
|
18687
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
18688
|
+
}
|
|
18689
|
+
function _toPrimitive(t, r) {
|
|
18690
|
+
if ("object" != typeof t || !t) return t;
|
|
18691
|
+
var e = t[Symbol.toPrimitive];
|
|
18692
|
+
if (void 0 !== e) {
|
|
18693
|
+
var i = e.call(t, r || "default");
|
|
18694
|
+
if ("object" != typeof i) return i;
|
|
18695
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
18696
|
+
}
|
|
18697
|
+
return ("string" === r ? String : Number)(t);
|
|
18698
|
+
}
|
|
18699
|
+
function _toPropertyKey(t) {
|
|
18700
|
+
var i = _toPrimitive(t, "string");
|
|
18701
|
+
return "symbol" == typeof i ? i : i + "";
|
|
18702
|
+
}
|
|
18703
|
+
function _unsupportedIterableToArray(r, a) {
|
|
18704
|
+
if (r) {
|
|
18705
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
18706
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
18707
|
+
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;
|
|
18708
|
+
}
|
|
18709
|
+
}
|
|
18710
|
+
var _excluded$1 = ["animationData", "loop", "autoplay", "initialSegment", "onComplete", "onLoopComplete", "onEnterFrame", "onSegmentStart", "onConfigReady", "onDataReady", "onDataFailed", "onLoadedImages", "onDOMLoaded", "onDestroy", "lottieRef", "renderer", "name", "assetsPath", "rendererSettings"];
|
|
18711
|
+
var useLottie = function useLottie2(props, style) {
|
|
18712
|
+
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;
|
|
18713
|
+
props.lottieRef;
|
|
18714
|
+
props.renderer;
|
|
18715
|
+
props.name;
|
|
18716
|
+
props.assetsPath;
|
|
18717
|
+
props.rendererSettings;
|
|
18718
|
+
var rest = _objectWithoutProperties(props, _excluded$1);
|
|
18719
|
+
var _useState = (0, import_react10.useState)(false), _useState2 = _slicedToArray(_useState, 2), animationLoaded = _useState2[0], setAnimationLoaded = _useState2[1];
|
|
18720
|
+
var animationInstanceRef = (0, import_react10.useRef)();
|
|
18721
|
+
var animationContainer = (0, import_react10.useRef)(null);
|
|
18722
|
+
var play = function play2() {
|
|
18723
|
+
var _a;
|
|
18724
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
18725
|
+
};
|
|
18726
|
+
var stop = function stop2() {
|
|
18727
|
+
var _a;
|
|
18728
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
18729
|
+
};
|
|
18730
|
+
var pause = function pause2() {
|
|
18731
|
+
var _a;
|
|
18732
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
18733
|
+
};
|
|
18734
|
+
var setSpeed = function setSpeed2(speed) {
|
|
18735
|
+
var _a;
|
|
18736
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSpeed(speed);
|
|
18737
|
+
};
|
|
18738
|
+
var goToAndPlay = function goToAndPlay2(value2, isFrame) {
|
|
18739
|
+
var _a;
|
|
18740
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndPlay(value2, isFrame);
|
|
18741
|
+
};
|
|
18742
|
+
var goToAndStop = function goToAndStop2(value2, isFrame) {
|
|
18743
|
+
var _a;
|
|
18744
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.goToAndStop(value2, isFrame);
|
|
18745
|
+
};
|
|
18746
|
+
var setDirection = function setDirection2(direction) {
|
|
18747
|
+
var _a;
|
|
18748
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setDirection(direction);
|
|
18749
|
+
};
|
|
18750
|
+
var playSegments = function playSegments2(segments, forceFlag) {
|
|
18751
|
+
var _a;
|
|
18752
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.playSegments(segments, forceFlag);
|
|
18753
|
+
};
|
|
18754
|
+
var setSubframe = function setSubframe2(useSubFrames) {
|
|
18755
|
+
var _a;
|
|
18756
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setSubframe(useSubFrames);
|
|
18757
|
+
};
|
|
18758
|
+
var getDuration = function getDuration2(inFrames) {
|
|
18759
|
+
var _a;
|
|
18760
|
+
return (_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.getDuration(inFrames);
|
|
18761
|
+
};
|
|
18762
|
+
var destroy = function destroy2() {
|
|
18763
|
+
var _a;
|
|
18764
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
18765
|
+
animationInstanceRef.current = void 0;
|
|
18766
|
+
};
|
|
18767
|
+
var loadAnimation2 = function loadAnimation3() {
|
|
18768
|
+
var forcedConfigs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
18769
|
+
var _a;
|
|
18770
|
+
if (!animationContainer.current) {
|
|
18771
|
+
return;
|
|
18772
|
+
}
|
|
18773
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
18774
|
+
var config = _objectSpread2(_objectSpread2(_objectSpread2({}, props), forcedConfigs), {}, {
|
|
18775
|
+
container: animationContainer.current
|
|
18776
|
+
});
|
|
18777
|
+
animationInstanceRef.current = import_lottie_web.default.loadAnimation(config);
|
|
18778
|
+
setAnimationLoaded(!!animationInstanceRef.current);
|
|
18779
|
+
return function() {
|
|
18780
|
+
var _a2;
|
|
18781
|
+
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.destroy();
|
|
18782
|
+
animationInstanceRef.current = void 0;
|
|
18783
|
+
};
|
|
18784
|
+
};
|
|
18785
|
+
(0, import_react10.useEffect)(function() {
|
|
18786
|
+
var onUnmount = loadAnimation2();
|
|
18787
|
+
return function() {
|
|
18788
|
+
return onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
|
|
18789
|
+
};
|
|
18790
|
+
}, [animationData2, loop]);
|
|
18791
|
+
(0, import_react10.useEffect)(function() {
|
|
18792
|
+
if (!animationInstanceRef.current) {
|
|
18793
|
+
return;
|
|
18794
|
+
}
|
|
18795
|
+
animationInstanceRef.current.autoplay = !!autoplay;
|
|
18796
|
+
}, [autoplay]);
|
|
18797
|
+
(0, import_react10.useEffect)(function() {
|
|
18798
|
+
if (!animationInstanceRef.current) {
|
|
18799
|
+
return;
|
|
18800
|
+
}
|
|
18801
|
+
if (!initialSegment) {
|
|
18802
|
+
animationInstanceRef.current.resetSegments(true);
|
|
18803
|
+
return;
|
|
18804
|
+
}
|
|
18805
|
+
if (!Array.isArray(initialSegment) || !initialSegment.length) {
|
|
18806
|
+
return;
|
|
18807
|
+
}
|
|
18808
|
+
if (animationInstanceRef.current.currentRawFrame < initialSegment[0] || animationInstanceRef.current.currentRawFrame > initialSegment[1]) {
|
|
18809
|
+
animationInstanceRef.current.currentRawFrame = initialSegment[0];
|
|
18810
|
+
}
|
|
18811
|
+
animationInstanceRef.current.setSegment(initialSegment[0], initialSegment[1]);
|
|
18812
|
+
}, [initialSegment]);
|
|
18813
|
+
(0, import_react10.useEffect)(function() {
|
|
18814
|
+
var partialListeners = [{
|
|
18815
|
+
name: "complete",
|
|
18816
|
+
handler: onComplete
|
|
18817
|
+
}, {
|
|
18818
|
+
name: "loopComplete",
|
|
18819
|
+
handler: onLoopComplete
|
|
18820
|
+
}, {
|
|
18821
|
+
name: "enterFrame",
|
|
18822
|
+
handler: onEnterFrame
|
|
18823
|
+
}, {
|
|
18824
|
+
name: "segmentStart",
|
|
18825
|
+
handler: onSegmentStart
|
|
18826
|
+
}, {
|
|
18827
|
+
name: "config_ready",
|
|
18828
|
+
handler: onConfigReady
|
|
18829
|
+
}, {
|
|
18830
|
+
name: "data_ready",
|
|
18831
|
+
handler: onDataReady
|
|
18832
|
+
}, {
|
|
18833
|
+
name: "data_failed",
|
|
18834
|
+
handler: onDataFailed
|
|
18835
|
+
}, {
|
|
18836
|
+
name: "loaded_images",
|
|
18837
|
+
handler: onLoadedImages
|
|
18838
|
+
}, {
|
|
18839
|
+
name: "DOMLoaded",
|
|
18840
|
+
handler: onDOMLoaded
|
|
18841
|
+
}, {
|
|
18842
|
+
name: "destroy",
|
|
18843
|
+
handler: onDestroy
|
|
18844
|
+
}];
|
|
18845
|
+
var listeners = partialListeners.filter(function(listener) {
|
|
18846
|
+
return listener.handler != null;
|
|
18847
|
+
});
|
|
18848
|
+
if (!listeners.length) {
|
|
18849
|
+
return;
|
|
18850
|
+
}
|
|
18851
|
+
var deregisterList = listeners.map(
|
|
18852
|
+
/**
|
|
18853
|
+
* Handle the process of adding an event listener
|
|
18854
|
+
* @param {Listener} listener
|
|
18855
|
+
* @return {Function} Function that deregister the listener
|
|
18856
|
+
*/
|
|
18857
|
+
function(listener) {
|
|
18858
|
+
var _a;
|
|
18859
|
+
(_a = animationInstanceRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(listener.name, listener.handler);
|
|
18860
|
+
return function() {
|
|
18861
|
+
var _a2;
|
|
18862
|
+
(_a2 = animationInstanceRef.current) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener(listener.name, listener.handler);
|
|
18863
|
+
};
|
|
18864
|
+
}
|
|
18865
|
+
);
|
|
18866
|
+
return function() {
|
|
18867
|
+
deregisterList.forEach(function(deregister) {
|
|
18868
|
+
return deregister();
|
|
18869
|
+
});
|
|
18870
|
+
};
|
|
18871
|
+
}, [onComplete, onLoopComplete, onEnterFrame, onSegmentStart, onConfigReady, onDataReady, onDataFailed, onLoadedImages, onDOMLoaded, onDestroy]);
|
|
18872
|
+
var View = /* @__PURE__ */ import_react10.default.createElement("div", _objectSpread2({
|
|
18873
|
+
style,
|
|
18874
|
+
ref: animationContainer
|
|
18875
|
+
}, rest));
|
|
18876
|
+
return {
|
|
18877
|
+
View,
|
|
18878
|
+
play,
|
|
18879
|
+
stop,
|
|
18880
|
+
pause,
|
|
18881
|
+
setSpeed,
|
|
18882
|
+
goToAndStop,
|
|
18883
|
+
goToAndPlay,
|
|
18884
|
+
setDirection,
|
|
18885
|
+
playSegments,
|
|
18886
|
+
setSubframe,
|
|
18887
|
+
getDuration,
|
|
18888
|
+
destroy,
|
|
18889
|
+
animationContainerRef: animationContainer,
|
|
18890
|
+
animationLoaded,
|
|
18891
|
+
animationItem: animationInstanceRef.current
|
|
18892
|
+
};
|
|
18893
|
+
};
|
|
18894
|
+
|
|
18895
|
+
// src/ui/Lottie/index.tsx
|
|
18896
|
+
var LazyLottie = (props) => {
|
|
18897
|
+
const options = {
|
|
18898
|
+
animationData: props.animationData,
|
|
18899
|
+
loop: true,
|
|
18900
|
+
autoplay: true
|
|
18901
|
+
};
|
|
18902
|
+
const { View } = useLottie(options, props.style);
|
|
18903
|
+
return View;
|
|
18904
|
+
};
|
|
18905
|
+
var Lottie_default = LazyLottie;
|
|
18906
|
+
|
|
18907
|
+
// src/context/ModalContext.tsx
|
|
18908
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
18909
|
+
var ModalContext = (0, import_react11.createContext)(null);
|
|
18910
|
+
function useModal() {
|
|
18911
|
+
const context = (0, import_react11.useContext)(ModalContext);
|
|
18912
|
+
if (!context) {
|
|
18913
|
+
throw new Error("useModal must be used within a ModalProvider");
|
|
18914
|
+
}
|
|
18915
|
+
return context;
|
|
18916
|
+
}
|
|
18917
|
+
|
|
18918
|
+
// src/store/useTransactionStore.ts
|
|
18919
|
+
var import_zustand3 = require("zustand");
|
|
18920
|
+
var import_middleware2 = require("zustand/middleware");
|
|
18921
|
+
var persistedState2 = (0, import_middleware2.persist)(
|
|
18922
|
+
(set, get) => ({
|
|
18923
|
+
transactions: {},
|
|
18924
|
+
addTransaction: (data2) => {
|
|
18925
|
+
set((state) => {
|
|
18926
|
+
const updatedTransactions = {
|
|
18927
|
+
...state.transactions,
|
|
18928
|
+
[`${data2.chainId}-${data2.address}`]: [data2.info, ...state.transactions[`${data2.chainId}-${data2.address}`] || []]
|
|
18929
|
+
};
|
|
18930
|
+
return { transactions: updatedTransactions };
|
|
18931
|
+
});
|
|
18932
|
+
},
|
|
18933
|
+
removeTransaction: (data2) => {
|
|
18934
|
+
set((state) => {
|
|
19139
18935
|
const updatedTransactions = {
|
|
19140
18936
|
...state.transactions,
|
|
19141
18937
|
[`${data2.chainId}-${data2.address}`]: (state.transactions[`${data2.chainId}-${data2.address}`] || []).filter((tx) => tx.hash !== data2.hash)
|
|
@@ -19150,7 +18946,7 @@ var useTransactionStore = (0, import_zustand3.create)((0, import_middleware2.dev
|
|
|
19150
18946
|
var useTransactionStore_default = useTransactionStore;
|
|
19151
18947
|
|
|
19152
18948
|
// src/hooks/useWallet.tsx
|
|
19153
|
-
var
|
|
18949
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
19154
18950
|
var AppClientId = "react-sdk-" + getVersion();
|
|
19155
18951
|
function useWallet() {
|
|
19156
18952
|
const { address, wallet: walletConfig } = useLocalStore_default();
|
|
@@ -19201,7 +18997,7 @@ function useWallet() {
|
|
|
19201
18997
|
throw error;
|
|
19202
18998
|
}
|
|
19203
18999
|
};
|
|
19204
|
-
const evmAccount = (0,
|
|
19000
|
+
const evmAccount = (0, import_react12.useMemo)(() => {
|
|
19205
19001
|
try {
|
|
19206
19002
|
return address ? (0, import_accounts.toAccount)({
|
|
19207
19003
|
address,
|
|
@@ -19240,7 +19036,7 @@ function useWallet() {
|
|
|
19240
19036
|
return void 0;
|
|
19241
19037
|
}
|
|
19242
19038
|
}, [address]);
|
|
19243
|
-
(0,
|
|
19039
|
+
(0, import_react12.useEffect)(() => {
|
|
19244
19040
|
matchlog_default.log("qwe-evmAccount", evmAccount);
|
|
19245
19041
|
}, [evmAccount]);
|
|
19246
19042
|
const realCreateWalletClient = (parameters) => {
|
|
@@ -19324,12 +19120,12 @@ function useWallet() {
|
|
|
19324
19120
|
address: evmAccount.address
|
|
19325
19121
|
});
|
|
19326
19122
|
modal.show((props) => {
|
|
19327
|
-
return /* @__PURE__ */ (0,
|
|
19123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, hash: txHash, chain: _chain });
|
|
19328
19124
|
});
|
|
19329
19125
|
return txHash;
|
|
19330
19126
|
} catch (error) {
|
|
19331
19127
|
modal.show((props) => {
|
|
19332
|
-
return /* @__PURE__ */ (0,
|
|
19128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(HashPanel_default, { isOpen: true, onClose: props.close, zIndex: props.zIndex, error: typeof error == "string" ? error : error.details || error.message, chain: _chain });
|
|
19333
19129
|
});
|
|
19334
19130
|
throw error;
|
|
19335
19131
|
}
|
|
@@ -19383,14 +19179,14 @@ function useWallet() {
|
|
|
19383
19179
|
|
|
19384
19180
|
// src/hooks/useCopyClipboard.ts
|
|
19385
19181
|
var import_copy_to_clipboard = __toESM(require("copy-to-clipboard"));
|
|
19386
|
-
var
|
|
19182
|
+
var import_react13 = require("react");
|
|
19387
19183
|
function useCopyClipboard(timeout = 500) {
|
|
19388
|
-
const [isCopied, setIsCopied] = (0,
|
|
19389
|
-
const staticCopy = (0,
|
|
19184
|
+
const [isCopied, setIsCopied] = (0, import_react13.useState)(false);
|
|
19185
|
+
const staticCopy = (0, import_react13.useCallback)((text2) => {
|
|
19390
19186
|
const didCopy = (0, import_copy_to_clipboard.default)(text2);
|
|
19391
19187
|
setIsCopied(didCopy);
|
|
19392
19188
|
}, []);
|
|
19393
|
-
(0,
|
|
19189
|
+
(0, import_react13.useEffect)(() => {
|
|
19394
19190
|
if (isCopied) {
|
|
19395
19191
|
const hide = setTimeout(() => {
|
|
19396
19192
|
setIsCopied(false);
|
|
@@ -19405,10 +19201,10 @@ function useCopyClipboard(timeout = 500) {
|
|
|
19405
19201
|
}
|
|
19406
19202
|
|
|
19407
19203
|
// src/context/ToastContext.tsx
|
|
19408
|
-
var
|
|
19204
|
+
var import_react14 = require("react");
|
|
19409
19205
|
var import_react_dom2 = require("react-dom");
|
|
19410
|
-
var
|
|
19411
|
-
var ToastContext = (0,
|
|
19206
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
19207
|
+
var ToastContext = (0, import_react14.createContext)(null);
|
|
19412
19208
|
|
|
19413
19209
|
// src/hooks/api/wallet.ts
|
|
19414
19210
|
var import_react_query2 = require("@tanstack/react-query");
|
|
@@ -19466,16 +19262,16 @@ function useImportTokenListQuery({
|
|
|
19466
19262
|
}
|
|
19467
19263
|
|
|
19468
19264
|
// src/hooks/useMatchChain.tsx
|
|
19469
|
-
var
|
|
19265
|
+
var import_react15 = require("react");
|
|
19470
19266
|
var import_viem5 = require("viem");
|
|
19471
19267
|
var import_react_intl3 = require("react-intl");
|
|
19472
|
-
var
|
|
19268
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
19473
19269
|
function useMatchChain() {
|
|
19474
19270
|
const chainListQuery = useChainListQuery();
|
|
19475
19271
|
const modal = useModal();
|
|
19476
19272
|
const intl = (0, import_react_intl3.useIntl)();
|
|
19477
19273
|
const { chainId: storeChainId, setChainId } = useLocalStore_default();
|
|
19478
|
-
const chainId = (0,
|
|
19274
|
+
const chainId = (0, import_react15.useMemo)(() => {
|
|
19479
19275
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
19480
19276
|
return null;
|
|
19481
19277
|
}
|
|
@@ -19484,7 +19280,7 @@ function useMatchChain() {
|
|
|
19484
19280
|
}
|
|
19485
19281
|
return chainListQuery.data[0].id;
|
|
19486
19282
|
}, [storeChainId, chainListQuery.data]);
|
|
19487
|
-
const chain = (0,
|
|
19283
|
+
const chain = (0, import_react15.useMemo)(() => {
|
|
19488
19284
|
if (!chainListQuery.data || !chainListQuery.data.length) {
|
|
19489
19285
|
return null;
|
|
19490
19286
|
}
|
|
@@ -19498,30 +19294,30 @@ function useMatchChain() {
|
|
|
19498
19294
|
close
|
|
19499
19295
|
}) {
|
|
19500
19296
|
const { chainId: storeChainId2, setChainId: setChainId2 } = useLocalStore_default();
|
|
19501
|
-
const [selectedChainId, setSelectedChainId] = (0,
|
|
19297
|
+
const [selectedChainId, setSelectedChainId] = (0, import_react15.useState)(storeChainId2);
|
|
19502
19298
|
const isDownMd = useDownMd();
|
|
19503
|
-
return /* @__PURE__ */ (0,
|
|
19504
|
-
/* @__PURE__ */ (0,
|
|
19505
|
-
return /* @__PURE__ */ (0,
|
|
19299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: `matchid-change-network-box`, children: [
|
|
19300
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: `matchid-change-network-list`, children: chainListQuery.data?.map((item, index2) => {
|
|
19301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
19506
19302
|
"div",
|
|
19507
19303
|
{
|
|
19508
19304
|
onClick: () => setSelectedChainId(item.id),
|
|
19509
19305
|
className: `matchid-change-network-item ${selectedChainId == item.id ? "matchid-change-network-selected" : ""}`,
|
|
19510
19306
|
children: [
|
|
19511
|
-
/* @__PURE__ */ (0,
|
|
19512
|
-
/* @__PURE__ */ (0,
|
|
19513
|
-
/* @__PURE__ */ (0,
|
|
19307
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: `matchid-change-network-item-content`, children: [
|
|
19308
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("img", { src: item.iconUrl, className: `matchid-change-network-item-icon` }),
|
|
19309
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "matchid-change-network-item-name", children: item.name })
|
|
19514
19310
|
] }),
|
|
19515
|
-
/* @__PURE__ */ (0,
|
|
19311
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Radio, { checked: selectedChainId === item.id, size: isDownMd ? 18 : 24 })
|
|
19516
19312
|
]
|
|
19517
19313
|
},
|
|
19518
19314
|
index2
|
|
19519
19315
|
);
|
|
19520
19316
|
}) }),
|
|
19521
|
-
/* @__PURE__ */ (0,
|
|
19317
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Button, { size: "lg", highlight: true, onClick: () => {
|
|
19522
19318
|
setChainId2(selectedChainId || 0);
|
|
19523
19319
|
close();
|
|
19524
|
-
}, block: true, children: /* @__PURE__ */ (0,
|
|
19320
|
+
}, block: true, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react_intl3.FormattedMessage, { id: "confirm" }) })
|
|
19525
19321
|
] });
|
|
19526
19322
|
}
|
|
19527
19323
|
const showChangeNetwork = () => {
|
|
@@ -19530,7 +19326,7 @@ function useMatchChain() {
|
|
|
19530
19326
|
content: ChangeNetwork
|
|
19531
19327
|
});
|
|
19532
19328
|
};
|
|
19533
|
-
const publicClient = (0,
|
|
19329
|
+
const publicClient = (0, import_react15.useMemo)(() => {
|
|
19534
19330
|
if (!chain) {
|
|
19535
19331
|
return null;
|
|
19536
19332
|
}
|
|
@@ -19558,7 +19354,7 @@ function useMatchChain() {
|
|
|
19558
19354
|
|
|
19559
19355
|
// src/hooks/useMatchWallet.tsx
|
|
19560
19356
|
var import_react_qrcode = require("react-qrcode");
|
|
19561
|
-
var
|
|
19357
|
+
var import_react17 = require("react");
|
|
19562
19358
|
var import_react_query5 = require("@tanstack/react-query");
|
|
19563
19359
|
|
|
19564
19360
|
// src/config/index.tsx
|
|
@@ -19629,7 +19425,7 @@ var useContractStore_default = useContractStore;
|
|
|
19629
19425
|
var import_react_intl5 = require("react-intl");
|
|
19630
19426
|
|
|
19631
19427
|
// src/components/ImportToken/index.tsx
|
|
19632
|
-
var
|
|
19428
|
+
var import_react16 = require("react");
|
|
19633
19429
|
var import_react_intl4 = require("react-intl");
|
|
19634
19430
|
var import_react_query4 = require("@tanstack/react-query");
|
|
19635
19431
|
var import_viem7 = require("viem");
|
|
@@ -19639,17 +19435,17 @@ var import_viem6 = require("viem");
|
|
|
19639
19435
|
var import_react_query3 = require("@tanstack/react-query");
|
|
19640
19436
|
|
|
19641
19437
|
// src/components/ImportToken/index.tsx
|
|
19642
|
-
var
|
|
19438
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
19643
19439
|
|
|
19644
19440
|
// src/hooks/useMatchWallet.tsx
|
|
19645
|
-
var
|
|
19441
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
19646
19442
|
function useMatchWalletRecords() {
|
|
19647
|
-
const [hasMore, setHasMore] = (0,
|
|
19648
|
-
const [items, setItems] = (0,
|
|
19443
|
+
const [hasMore, setHasMore] = (0, import_react17.useState)(true);
|
|
19444
|
+
const [items, setItems] = (0, import_react17.useState)([]);
|
|
19649
19445
|
const { chainId, publicClient } = useMatchChain();
|
|
19650
19446
|
const { address } = useWallet();
|
|
19651
|
-
const hasMoreRef = (0,
|
|
19652
|
-
const nextPageParamsRef = (0,
|
|
19447
|
+
const hasMoreRef = (0, import_react17.useRef)(hasMore);
|
|
19448
|
+
const nextPageParamsRef = (0, import_react17.useRef)(void 0);
|
|
19653
19449
|
const { contracts, setContracts } = useContractStore_default();
|
|
19654
19450
|
const fetchMoreData = async () => {
|
|
19655
19451
|
const chainIdStr = chainId ? chainId.toString() : "";
|
|
@@ -19676,7 +19472,7 @@ function useMatchWalletRecords() {
|
|
|
19676
19472
|
hasMoreRef.current = true;
|
|
19677
19473
|
fetchMoreData();
|
|
19678
19474
|
};
|
|
19679
|
-
(0,
|
|
19475
|
+
(0, import_react17.useEffect)(() => {
|
|
19680
19476
|
if (chainId && address) {
|
|
19681
19477
|
onInit();
|
|
19682
19478
|
}
|
|
@@ -19732,7 +19528,7 @@ function useMatchWalletRecords() {
|
|
|
19732
19528
|
setContracts(contractMap);
|
|
19733
19529
|
}
|
|
19734
19530
|
};
|
|
19735
|
-
const list = (0,
|
|
19531
|
+
const list = (0, import_react17.useMemo)(() => {
|
|
19736
19532
|
const localTransactions = transactions[`${chainId}-${address}`] || [];
|
|
19737
19533
|
const removeList = localTransactions.filter((n) => items.findIndex((m) => m.hash == n.hash) >= 0);
|
|
19738
19534
|
removeList.forEach((item) => {
|
|
@@ -19774,7 +19570,7 @@ function useMatchWalletAssets({
|
|
|
19774
19570
|
chainId: chainId || 0,
|
|
19775
19571
|
...assetListOptions
|
|
19776
19572
|
});
|
|
19777
|
-
const mergedAssets = (0,
|
|
19573
|
+
const mergedAssets = (0, import_react17.useMemo)(() => {
|
|
19778
19574
|
if (!assetListQuery.data && !importTokenQuery.data) return [];
|
|
19779
19575
|
const assetList = (assetListQuery.data || []).map((asset) => ({
|
|
19780
19576
|
...asset,
|
|
@@ -19861,7 +19657,7 @@ function useMatchWalletAssetList({
|
|
|
19861
19657
|
retry: 3
|
|
19862
19658
|
// Retry up to 3 times if failed
|
|
19863
19659
|
});
|
|
19864
|
-
const erc20Tokens = (0,
|
|
19660
|
+
const erc20Tokens = (0, import_react17.useMemo)(() => list.filter((asset) => asset.address !== NATIVE_TOKEN_ADDRESS), [list]);
|
|
19865
19661
|
const erc20BalanceQuery = (0, import_react_query5.useQuery)({
|
|
19866
19662
|
queryKey: ["erc20Balances", erc20Tokens.map((token) => token.address)],
|
|
19867
19663
|
queryFn: async () => {
|
|
@@ -19889,7 +19685,7 @@ function useMatchWalletAssetList({
|
|
|
19889
19685
|
// Refresh every 15 seconds
|
|
19890
19686
|
retry: 3
|
|
19891
19687
|
});
|
|
19892
|
-
const enrichedAssets = (0,
|
|
19688
|
+
const enrichedAssets = (0, import_react17.useMemo)(() => {
|
|
19893
19689
|
if (!list) return [];
|
|
19894
19690
|
const erc20Balances = erc20BalanceQuery.data || [];
|
|
19895
19691
|
return list.map((asset) => {
|
|
@@ -19911,7 +19707,7 @@ function useMatchWalletAssetList({
|
|
|
19911
19707
|
return { ...asset, balance, value: value2, balanceValue };
|
|
19912
19708
|
});
|
|
19913
19709
|
}, [list, nativeBalanceQuery.data, erc20BalanceQuery.data]);
|
|
19914
|
-
(0,
|
|
19710
|
+
(0, import_react17.useEffect)(() => {
|
|
19915
19711
|
const list2 = enrichedAssets.sort((a, b) => {
|
|
19916
19712
|
if (a.address === NATIVE_TOKEN_ADDRESS) return -1;
|
|
19917
19713
|
if (b.address === NATIVE_TOKEN_ADDRESS) return 1;
|
|
@@ -19936,13 +19732,13 @@ function useMatchWalletAssetList({
|
|
|
19936
19732
|
}
|
|
19937
19733
|
|
|
19938
19734
|
// src/hooks/useReceipt.tsx
|
|
19939
|
-
var
|
|
19735
|
+
var import_react18 = require("react");
|
|
19940
19736
|
var import_react_query6 = require("@tanstack/react-query");
|
|
19941
19737
|
var import_viem9 = require("viem");
|
|
19942
19738
|
var CACHE_TTL = 86400 * 30 * 1e3;
|
|
19943
19739
|
|
|
19944
19740
|
// src/hooks/useTransaction.tsx
|
|
19945
|
-
var
|
|
19741
|
+
var import_react19 = require("react");
|
|
19946
19742
|
var import_react_query7 = require("@tanstack/react-query");
|
|
19947
19743
|
var import_viem10 = require("viem");
|
|
19948
19744
|
var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
@@ -19951,39 +19747,39 @@ var CACHE_TTL2 = 86400 * 30 * 1e3;
|
|
|
19951
19747
|
var import_zustand5 = require("zustand");
|
|
19952
19748
|
|
|
19953
19749
|
// src/hooks/useConfig.tsx
|
|
19954
|
-
var
|
|
19750
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
19955
19751
|
var DEFAULT_WALLET_METHODS = ["evm", "sol", "btc", "tron", "ton"];
|
|
19956
19752
|
var WALLET_METHODS = ["evm", "sol", "btc", "tron", "ton"];
|
|
19957
19753
|
function useWalletConfig() {
|
|
19958
19754
|
const isDownMd = useDownMd();
|
|
19959
19755
|
const walletMap = {
|
|
19960
19756
|
evm: {
|
|
19961
|
-
icon: /* @__PURE__ */ (0,
|
|
19962
|
-
activeIcon: /* @__PURE__ */ (0,
|
|
19757
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(EVMDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
19758
|
+
activeIcon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(EVMLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
19963
19759
|
name: "EVM",
|
|
19964
19760
|
method: "evm"
|
|
19965
19761
|
},
|
|
19966
19762
|
sol: {
|
|
19967
|
-
icon: /* @__PURE__ */ (0,
|
|
19968
|
-
activeIcon: /* @__PURE__ */ (0,
|
|
19763
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SOLDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
19764
|
+
activeIcon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SOLLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
19969
19765
|
name: "SOL",
|
|
19970
19766
|
method: "sol"
|
|
19971
19767
|
},
|
|
19972
19768
|
btc: {
|
|
19973
|
-
icon: /* @__PURE__ */ (0,
|
|
19974
|
-
activeIcon: /* @__PURE__ */ (0,
|
|
19769
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(BTCDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
19770
|
+
activeIcon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(BTCLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
19975
19771
|
name: "BTC",
|
|
19976
19772
|
method: "btc"
|
|
19977
19773
|
},
|
|
19978
19774
|
tron: {
|
|
19979
|
-
icon: /* @__PURE__ */ (0,
|
|
19980
|
-
activeIcon: /* @__PURE__ */ (0,
|
|
19775
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TRXDarkIcon, { size: isDownMd ? 36 : 40 }),
|
|
19776
|
+
activeIcon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TRXLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
19981
19777
|
name: "TRON",
|
|
19982
19778
|
method: "tron"
|
|
19983
19779
|
},
|
|
19984
19780
|
ton: {
|
|
19985
|
-
icon: /* @__PURE__ */ (0,
|
|
19986
|
-
activeIcon: /* @__PURE__ */ (0,
|
|
19781
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TonLightIcon, { size: isDownMd ? 36 : 40 }),
|
|
19782
|
+
activeIcon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TonLightIcon2, { size: isDownMd ? 36 : 40 }),
|
|
19987
19783
|
name: "TON",
|
|
19988
19784
|
method: "ton"
|
|
19989
19785
|
}
|
|
@@ -20033,23 +19829,23 @@ var useWalletModalStore = (0, import_zustand5.create)((set) => ({
|
|
|
20033
19829
|
}));
|
|
20034
19830
|
|
|
20035
19831
|
// src/components/CEXBindModal/index.tsx
|
|
20036
|
-
var
|
|
19832
|
+
var import_react20 = require("react");
|
|
20037
19833
|
var import_react_intl6 = require("react-intl");
|
|
20038
|
-
var
|
|
19834
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
20039
19835
|
|
|
20040
19836
|
// src/context/BusinessProvider.tsx
|
|
20041
19837
|
var import_react_query8 = require("@tanstack/react-query");
|
|
20042
|
-
var
|
|
19838
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
20043
19839
|
|
|
20044
19840
|
// src/context/index.tsx
|
|
20045
|
-
var
|
|
19841
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
20046
19842
|
|
|
20047
19843
|
// src/hooks/useWalletInit.ts
|
|
20048
|
-
var
|
|
19844
|
+
var import_react21 = require("react");
|
|
20049
19845
|
var AppClientId2 = getAppClientId();
|
|
20050
19846
|
|
|
20051
19847
|
// src/hooks/useInit.tsx
|
|
20052
|
-
var
|
|
19848
|
+
var import_react22 = require("react");
|
|
20053
19849
|
|
|
20054
19850
|
// src/MatchContext.tsx
|
|
20055
19851
|
var import_react_query9 = require("@tanstack/react-query");
|
|
@@ -20122,7 +19918,7 @@ var matchTest = /* @__PURE__ */ (0, import_viem12.defineChain)({
|
|
|
20122
19918
|
|
|
20123
19919
|
// src/MatchContext.tsx
|
|
20124
19920
|
var import_wagmi = require("wagmi");
|
|
20125
|
-
var
|
|
19921
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
20126
19922
|
var queryClient = new import_react_query9.QueryClient();
|
|
20127
19923
|
var wagmiConfig = (0, import_rainbowkit.getDefaultConfig)({
|
|
20128
19924
|
appName: "MatchID",
|
|
@@ -20141,9 +19937,9 @@ var wagmiConfig = (0, import_rainbowkit.getDefaultConfig)({
|
|
|
20141
19937
|
],
|
|
20142
19938
|
chains: [import_chains.mainnet, import_chains.polygon, import_chains.optimism, import_chains.arbitrum, import_chains.base, matchMain, matchTest, import_chains.bsc]
|
|
20143
19939
|
});
|
|
20144
|
-
var MatchContext = (0,
|
|
19940
|
+
var MatchContext = (0, import_react23.createContext)(void 0);
|
|
20145
19941
|
var useMatch = () => {
|
|
20146
|
-
const context = (0,
|
|
19942
|
+
const context = (0, import_react23.useContext)(MatchContext);
|
|
20147
19943
|
if (context === void 0) {
|
|
20148
19944
|
throw new Error("useMatch must be used within a MatchProvider");
|
|
20149
19945
|
}
|
|
@@ -20177,7 +19973,7 @@ function useUserInfo() {
|
|
|
20177
19973
|
const getRedirectUri = () => {
|
|
20178
19974
|
return encodeURIComponent(window.location.href);
|
|
20179
19975
|
};
|
|
20180
|
-
const isLogin = (0,
|
|
19976
|
+
const isLogin = (0, import_react24.useMemo)(() => !!token && !!overview, [token, overview]);
|
|
20181
19977
|
const logout = async () => {
|
|
20182
19978
|
try {
|
|
20183
19979
|
await toLogoutApi();
|
|
@@ -20448,23 +20244,23 @@ function useUserInfo() {
|
|
|
20448
20244
|
}
|
|
20449
20245
|
|
|
20450
20246
|
// src/components/EmailModal/StepVerify.tsx
|
|
20451
|
-
var
|
|
20247
|
+
var import_react25 = require("react");
|
|
20452
20248
|
var import_react_intl8 = require("react-intl");
|
|
20453
|
-
var
|
|
20249
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
20454
20250
|
function StepVerify(props) {
|
|
20455
20251
|
const intl = (0, import_react_intl8.useIntl)();
|
|
20456
20252
|
const { getLoginEmailCode, loginByEmail } = useUserInfo();
|
|
20457
|
-
const [error, setError] = (0,
|
|
20458
|
-
const [code, setCode] = (0,
|
|
20459
|
-
const [sending, setSending] = (0,
|
|
20460
|
-
const [submitting, setSubmitting] = (0,
|
|
20461
|
-
const sendTimeRef = (0,
|
|
20462
|
-
const [sendBtnText, setSendBtnText] = (0,
|
|
20253
|
+
const [error, setError] = (0, import_react25.useState)("");
|
|
20254
|
+
const [code, setCode] = (0, import_react25.useState)("");
|
|
20255
|
+
const [sending, setSending] = (0, import_react25.useState)(false);
|
|
20256
|
+
const [submitting, setSubmitting] = (0, import_react25.useState)(false);
|
|
20257
|
+
const sendTimeRef = (0, import_react25.useRef)(0);
|
|
20258
|
+
const [sendBtnText, setSendBtnText] = (0, import_react25.useState)(intl.formatMessage({
|
|
20463
20259
|
id: "send"
|
|
20464
20260
|
}));
|
|
20465
20261
|
const intervalTime = EMAIL_INTERVAL;
|
|
20466
20262
|
const codeLength = EMAIL_CODE_LENGTH;
|
|
20467
|
-
const intervalRef = (0,
|
|
20263
|
+
const intervalRef = (0, import_react25.useRef)(null);
|
|
20468
20264
|
const isDownMd = useDownMd();
|
|
20469
20265
|
const onSend = async () => {
|
|
20470
20266
|
if (sendTimeRef.current > 0) {
|
|
@@ -20495,7 +20291,7 @@ function StepVerify(props) {
|
|
|
20495
20291
|
setSending(false);
|
|
20496
20292
|
}
|
|
20497
20293
|
};
|
|
20498
|
-
(0,
|
|
20294
|
+
(0, import_react25.useEffect)(() => {
|
|
20499
20295
|
onSend();
|
|
20500
20296
|
return () => {
|
|
20501
20297
|
if (intervalRef.current) {
|
|
@@ -20503,7 +20299,7 @@ function StepVerify(props) {
|
|
|
20503
20299
|
}
|
|
20504
20300
|
};
|
|
20505
20301
|
}, []);
|
|
20506
|
-
const canContinue = (0,
|
|
20302
|
+
const canContinue = (0, import_react25.useMemo)(() => {
|
|
20507
20303
|
return code.length === codeLength;
|
|
20508
20304
|
}, [code]);
|
|
20509
20305
|
const onContinue = async () => {
|
|
@@ -20527,17 +20323,17 @@ function StepVerify(props) {
|
|
|
20527
20323
|
setSubmitting(false);
|
|
20528
20324
|
}
|
|
20529
20325
|
};
|
|
20530
|
-
return /* @__PURE__ */ (0,
|
|
20531
|
-
/* @__PURE__ */ (0,
|
|
20532
|
-
/* @__PURE__ */ (0,
|
|
20533
|
-
/* @__PURE__ */ (0,
|
|
20534
|
-
/* @__PURE__ */ (0,
|
|
20535
|
-
/* @__PURE__ */ (0,
|
|
20326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "matchid-email-verify-box", children: [
|
|
20327
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "matchid-email-verify-header", children: [
|
|
20328
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "matchid-email-verify-header-icon", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(EmailLineIcon, { size: isDownMd ? 19 : 24 }) }),
|
|
20329
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "matchid-email-verify-header-content", children: [
|
|
20330
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "matchid-email-verify-header-value", children: props.email }),
|
|
20331
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "matchid-email-verify-header-tips", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_intl8.FormattedMessage, { id: "sendEmailTips" }) })
|
|
20536
20332
|
] })
|
|
20537
20333
|
] }),
|
|
20538
|
-
/* @__PURE__ */ (0,
|
|
20334
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Field, { label: intl.formatMessage({
|
|
20539
20335
|
id: "verificationCode"
|
|
20540
|
-
}), error, children: /* @__PURE__ */ (0,
|
|
20336
|
+
}), error, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
20541
20337
|
Input,
|
|
20542
20338
|
{
|
|
20543
20339
|
placeholder: intl.formatMessage({
|
|
@@ -20547,7 +20343,7 @@ function StepVerify(props) {
|
|
|
20547
20343
|
maxLength: codeLength,
|
|
20548
20344
|
onChange: (e) => setCode(e.target.value),
|
|
20549
20345
|
value: code,
|
|
20550
|
-
after: /* @__PURE__ */ (0,
|
|
20346
|
+
after: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
20551
20347
|
Button,
|
|
20552
20348
|
{
|
|
20553
20349
|
highlight: true,
|
|
@@ -20566,13 +20362,13 @@ function StepVerify(props) {
|
|
|
20566
20362
|
)
|
|
20567
20363
|
}
|
|
20568
20364
|
) }),
|
|
20569
|
-
/* @__PURE__ */ (0,
|
|
20365
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Button, { disabled: !canContinue, loading: submitting, highlight: true, block: true, size: "lg", onClick: onContinue, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react_intl8.FormattedMessage, { id: "continue" }) })
|
|
20570
20366
|
] });
|
|
20571
20367
|
}
|
|
20572
20368
|
|
|
20573
20369
|
// src/components/EmailModal/index.tsx
|
|
20574
20370
|
var import_react_intl9 = require("react-intl");
|
|
20575
|
-
var
|
|
20371
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
20576
20372
|
function EmailModal({
|
|
20577
20373
|
isOpen = false,
|
|
20578
20374
|
width: width2 = 480,
|
|
@@ -20580,16 +20376,16 @@ function EmailModal({
|
|
|
20580
20376
|
onBack,
|
|
20581
20377
|
onLogin
|
|
20582
20378
|
}) {
|
|
20583
|
-
const [step, setStep] = (0,
|
|
20584
|
-
const [emailVal, setEmailVal] = (0,
|
|
20379
|
+
const [step, setStep] = (0, import_react26.useState)("input");
|
|
20380
|
+
const [emailVal, setEmailVal] = (0, import_react26.useState)("");
|
|
20585
20381
|
const intl = (0, import_react_intl9.useIntl)();
|
|
20586
|
-
(0,
|
|
20382
|
+
(0, import_react26.useEffect)(() => {
|
|
20587
20383
|
if (!isOpen) {
|
|
20588
20384
|
setStep("input");
|
|
20589
20385
|
setEmailVal("");
|
|
20590
20386
|
}
|
|
20591
20387
|
}, [isOpen]);
|
|
20592
|
-
return /* @__PURE__ */ (0,
|
|
20388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
20593
20389
|
ModalWithHeader,
|
|
20594
20390
|
{
|
|
20595
20391
|
isOpen,
|
|
@@ -20599,16 +20395,16 @@ function EmailModal({
|
|
|
20599
20395
|
id: "email"
|
|
20600
20396
|
}),
|
|
20601
20397
|
onBack: step == "verify" ? () => setStep("input") : onBack,
|
|
20602
|
-
children: step === "input" ? /* @__PURE__ */ (0,
|
|
20398
|
+
children: step === "input" ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(StepEmail, { email: emailVal, onContinue: (email) => {
|
|
20603
20399
|
setEmailVal(email);
|
|
20604
20400
|
setStep("verify");
|
|
20605
|
-
} }) : /* @__PURE__ */ (0,
|
|
20401
|
+
} }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(StepVerify, { email: emailVal, onSuccess: onLogin })
|
|
20606
20402
|
}
|
|
20607
20403
|
);
|
|
20608
20404
|
}
|
|
20609
20405
|
|
|
20610
20406
|
// src/components/LoginBox/index.tsx
|
|
20611
|
-
var
|
|
20407
|
+
var import_react27 = require("react");
|
|
20612
20408
|
var import_react_intl10 = require("react-intl");
|
|
20613
20409
|
|
|
20614
20410
|
// src/hooks/useAppConfig.ts
|
|
@@ -20632,7 +20428,7 @@ function useAppConfig() {
|
|
|
20632
20428
|
}
|
|
20633
20429
|
|
|
20634
20430
|
// src/components/LoginBox/index.tsx
|
|
20635
|
-
var
|
|
20431
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
20636
20432
|
var RecommendItem = ({
|
|
20637
20433
|
icon,
|
|
20638
20434
|
name: name2,
|
|
@@ -20641,20 +20437,20 @@ var RecommendItem = ({
|
|
|
20641
20437
|
children,
|
|
20642
20438
|
footer
|
|
20643
20439
|
}) => {
|
|
20644
|
-
return /* @__PURE__ */ (0,
|
|
20645
|
-
/* @__PURE__ */ (0,
|
|
20646
|
-
/* @__PURE__ */ (0,
|
|
20647
|
-
/* @__PURE__ */ (0,
|
|
20648
|
-
/* @__PURE__ */ (0,
|
|
20440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "matchid-login-recommend-method", children: [
|
|
20441
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "matchid-login-recommend-method-item", onClick, children: [
|
|
20442
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "matchid-login-recommend-method-content", children: [
|
|
20443
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "matchid-login-recommend-method-icon", children: icon }),
|
|
20444
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "matchid-login-recommend-method-name", children: name2 })
|
|
20649
20445
|
] }),
|
|
20650
|
-
footer ? footer : children ? /* @__PURE__ */ (0,
|
|
20446
|
+
footer ? footer : children ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
20651
20447
|
ArrowDownIcon,
|
|
20652
20448
|
{
|
|
20653
20449
|
className: `matchid-login-recommend-method-arrow ${showChildren ? "matchid-login-recommend-method-arrow-active" : ""}`,
|
|
20654
20450
|
size: 20,
|
|
20655
20451
|
color: "var(--matchid-arrow-color)"
|
|
20656
20452
|
}
|
|
20657
|
-
) : /* @__PURE__ */ (0,
|
|
20453
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
20658
20454
|
ArrowRightIcon,
|
|
20659
20455
|
{
|
|
20660
20456
|
className: "matchid-login-recommend-method-arrow",
|
|
@@ -20663,7 +20459,7 @@ var RecommendItem = ({
|
|
|
20663
20459
|
}
|
|
20664
20460
|
)
|
|
20665
20461
|
] }),
|
|
20666
|
-
children && /* @__PURE__ */ (0,
|
|
20462
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
20667
20463
|
"div",
|
|
20668
20464
|
{
|
|
20669
20465
|
className: `matchid-login-recommend-method-popover ${showChildren ? "matchid-login-recommend-method-popover-active" : ""}`,
|
|
@@ -20679,7 +20475,7 @@ function LoginBox({
|
|
|
20679
20475
|
inModal = false
|
|
20680
20476
|
}) {
|
|
20681
20477
|
const config = useAppConfig();
|
|
20682
|
-
const methodConfig = (0,
|
|
20478
|
+
const methodConfig = (0, import_react27.useMemo)(() => {
|
|
20683
20479
|
if (recommendMethods || methods || walletMethods) {
|
|
20684
20480
|
return {
|
|
20685
20481
|
recommendMethods: recommendMethods ? recommendMethods : walletMethods ? ["wallet"] : [],
|
|
@@ -20721,82 +20517,82 @@ function LoginBox({
|
|
|
20721
20517
|
walletMethods: walletMethodList
|
|
20722
20518
|
};
|
|
20723
20519
|
}, [config.platform, recommendMethods, methods, walletMethods]);
|
|
20724
|
-
const [emailOpen, setEmailOpen] = (0,
|
|
20520
|
+
const [emailOpen, setEmailOpen] = (0, import_react27.useState)(false);
|
|
20725
20521
|
const { login } = useUserInfo();
|
|
20726
|
-
const [showWallet, setShowWallet] = (0,
|
|
20522
|
+
const [showWallet, setShowWallet] = (0, import_react27.useState)(false);
|
|
20727
20523
|
const intl = (0, import_react_intl10.useIntl)();
|
|
20728
20524
|
const isDownMd = useDownMd();
|
|
20729
20525
|
const methodMap = {
|
|
20730
20526
|
wallet: {
|
|
20731
|
-
icon: /* @__PURE__ */ (0,
|
|
20527
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(WalletIcon, { size: isDownMd ? 36 : 40 }),
|
|
20732
20528
|
name: intl.formatMessage({ id: "wallet" }),
|
|
20733
20529
|
onClick: () => setShowWallet(!showWallet),
|
|
20734
20530
|
type: "wallet"
|
|
20735
20531
|
},
|
|
20736
20532
|
email: {
|
|
20737
|
-
icon: /* @__PURE__ */ (0,
|
|
20533
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(EmailIcon, { size: isDownMd ? 36 : 40 }),
|
|
20738
20534
|
name: intl.formatMessage({ id: "email" }),
|
|
20739
20535
|
onClick: () => {
|
|
20740
20536
|
setEmailOpen(true);
|
|
20741
20537
|
}
|
|
20742
20538
|
},
|
|
20743
20539
|
google: {
|
|
20744
|
-
icon: /* @__PURE__ */ (0,
|
|
20540
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(GoogleIcon, { size: isDownMd ? 36 : 40 }),
|
|
20745
20541
|
name: "Google",
|
|
20746
20542
|
onClick: () => login("google")
|
|
20747
20543
|
},
|
|
20748
20544
|
twitter: {
|
|
20749
|
-
icon: /* @__PURE__ */ (0,
|
|
20545
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(XIcon, { size: isDownMd ? 36 : 40 }),
|
|
20750
20546
|
name: "X",
|
|
20751
20547
|
onClick: () => login("twitter")
|
|
20752
20548
|
},
|
|
20753
20549
|
telegram: {
|
|
20754
|
-
icon: /* @__PURE__ */ (0,
|
|
20550
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(TelegramIcon, { size: isDownMd ? 36 : 40 }),
|
|
20755
20551
|
name: "Telegram",
|
|
20756
20552
|
onClick: () => login("telegram")
|
|
20757
20553
|
},
|
|
20758
20554
|
github: {
|
|
20759
|
-
icon: /* @__PURE__ */ (0,
|
|
20555
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(GithubIcon, { size: isDownMd ? 36 : 40 }),
|
|
20760
20556
|
name: "Github",
|
|
20761
20557
|
onClick: () => login("github")
|
|
20762
20558
|
},
|
|
20763
20559
|
discord: {
|
|
20764
|
-
icon: /* @__PURE__ */ (0,
|
|
20560
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(DiscordIcon, { size: isDownMd ? 36 : 40 }),
|
|
20765
20561
|
name: "Discord",
|
|
20766
20562
|
onClick: () => login("discord")
|
|
20767
20563
|
},
|
|
20768
20564
|
linkedin: {
|
|
20769
|
-
icon: /* @__PURE__ */ (0,
|
|
20565
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(LinkedinIcon, { size: isDownMd ? 36 : 40 }),
|
|
20770
20566
|
name: "LinkedIn",
|
|
20771
20567
|
onClick: () => login("linkedin")
|
|
20772
20568
|
},
|
|
20773
20569
|
facebook: {
|
|
20774
|
-
icon: /* @__PURE__ */ (0,
|
|
20570
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(FacebookIcon, { size: isDownMd ? 36 : 40 }),
|
|
20775
20571
|
name: "Facebook",
|
|
20776
20572
|
onClick: () => login("facebook")
|
|
20777
20573
|
},
|
|
20778
20574
|
youtube: {
|
|
20779
|
-
icon: /* @__PURE__ */ (0,
|
|
20575
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(YoutubeIcon, { size: isDownMd ? 36 : 40 }),
|
|
20780
20576
|
name: "Youtube",
|
|
20781
20577
|
onClick: () => login("youtube")
|
|
20782
20578
|
}
|
|
20783
20579
|
};
|
|
20784
20580
|
const { walletMap } = useWalletConfig();
|
|
20785
|
-
return /* @__PURE__ */ (0,
|
|
20786
|
-
(!inModal || !emailOpen) && /* @__PURE__ */ (0,
|
|
20787
|
-
/* @__PURE__ */ (0,
|
|
20788
|
-
return /* @__PURE__ */ (0,
|
|
20581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
20582
|
+
(!inModal || !emailOpen) && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "matchid-login-box", children: [
|
|
20583
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "matchid-login-recommend-list", children: methodConfig.recommendMethods.map((m) => {
|
|
20584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
20789
20585
|
RecommendItem,
|
|
20790
20586
|
{
|
|
20791
20587
|
icon: methodMap[m]?.icon,
|
|
20792
20588
|
name: methodMap[m]?.name,
|
|
20793
20589
|
onClick: methodMap[m]?.onClick,
|
|
20794
20590
|
showChildren: m == "wallet" && showWallet,
|
|
20795
|
-
children: m == "wallet" && /* @__PURE__ */ (0,
|
|
20796
|
-
/* @__PURE__ */ (0,
|
|
20797
|
-
/* @__PURE__ */ (0,
|
|
20591
|
+
children: m == "wallet" && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
20592
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "matchid-login-recommend-wallet-divider" }),
|
|
20593
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "matchid-login-recommend-wallet-list", children: methodConfig.walletMethods.map((n) => {
|
|
20798
20594
|
const m2 = walletMap[n];
|
|
20799
|
-
return /* @__PURE__ */ (0,
|
|
20595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
20800
20596
|
"div",
|
|
20801
20597
|
{
|
|
20802
20598
|
className: "matchid-login-recommend-wallet-item",
|
|
@@ -20804,16 +20600,16 @@ function LoginBox({
|
|
|
20804
20600
|
login(m2.method);
|
|
20805
20601
|
},
|
|
20806
20602
|
children: [
|
|
20807
|
-
/* @__PURE__ */ (0,
|
|
20808
|
-
/* @__PURE__ */ (0,
|
|
20809
|
-
/* @__PURE__ */ (0,
|
|
20603
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "matchid-login-recommend-wallet-item-content", children: [
|
|
20604
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "matchid-login-recommend-wallet-item-icon", children: m2.icon }),
|
|
20605
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
20810
20606
|
"div",
|
|
20811
20607
|
{
|
|
20812
20608
|
className: "matchid-login-recommend-wallet-item-hover-icon",
|
|
20813
20609
|
children: m2.activeIcon
|
|
20814
20610
|
}
|
|
20815
20611
|
),
|
|
20816
|
-
/* @__PURE__ */ (0,
|
|
20612
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
20817
20613
|
"span",
|
|
20818
20614
|
{
|
|
20819
20615
|
className: "matchid-login-recommend-wallet-item-name",
|
|
@@ -20821,7 +20617,7 @@ function LoginBox({
|
|
|
20821
20617
|
}
|
|
20822
20618
|
)
|
|
20823
20619
|
] }),
|
|
20824
|
-
/* @__PURE__ */ (0,
|
|
20620
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
20825
20621
|
ArrowRightIcon,
|
|
20826
20622
|
{
|
|
20827
20623
|
className: "matchid-login-recommend-wallet-item-arrow",
|
|
@@ -20839,10 +20635,10 @@ function LoginBox({
|
|
|
20839
20635
|
m
|
|
20840
20636
|
);
|
|
20841
20637
|
}) }),
|
|
20842
|
-
methodConfig.methods.length > 0 && /* @__PURE__ */ (0,
|
|
20843
|
-
/* @__PURE__ */ (0,
|
|
20844
|
-
/* @__PURE__ */ (0,
|
|
20845
|
-
return /* @__PURE__ */ (0,
|
|
20638
|
+
methodConfig.methods.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "matchid-login-other", children: [
|
|
20639
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "matchid-login-other-text", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react_intl10.FormattedMessage, { id: "otherLoginMethods" }) }),
|
|
20640
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "matchid-login-method-box", children: methodConfig.methods.map((m) => {
|
|
20641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
20846
20642
|
"div",
|
|
20847
20643
|
{
|
|
20848
20644
|
className: "matchid-login-method-item",
|
|
@@ -20855,7 +20651,7 @@ function LoginBox({
|
|
|
20855
20651
|
}) })
|
|
20856
20652
|
] })
|
|
20857
20653
|
] }),
|
|
20858
|
-
/* @__PURE__ */ (0,
|
|
20654
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
20859
20655
|
EmailModal,
|
|
20860
20656
|
{
|
|
20861
20657
|
isOpen: emailOpen,
|
|
@@ -20871,56 +20667,56 @@ function LoginBox({
|
|
|
20871
20667
|
}
|
|
20872
20668
|
|
|
20873
20669
|
// src/components/LoginButton/index.tsx
|
|
20874
|
-
var
|
|
20670
|
+
var import_react29 = require("react");
|
|
20875
20671
|
|
|
20876
20672
|
// src/components/LoginPanel/index.tsx
|
|
20877
20673
|
var import_react_intl11 = require("react-intl");
|
|
20878
|
-
var
|
|
20674
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
20879
20675
|
function LoginPanel({
|
|
20880
20676
|
header,
|
|
20881
20677
|
onClose,
|
|
20882
20678
|
...props
|
|
20883
20679
|
}) {
|
|
20884
20680
|
const isDownMd = useDownMd();
|
|
20885
|
-
return /* @__PURE__ */ (0,
|
|
20886
|
-
header ? header : /* @__PURE__ */ (0,
|
|
20887
|
-
/* @__PURE__ */ (0,
|
|
20888
|
-
/* @__PURE__ */ (0,
|
|
20889
|
-
/* @__PURE__ */ (0,
|
|
20681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "matchid-login-panel", children: [
|
|
20682
|
+
header ? header : /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "matchid-login-panel-header", children: [
|
|
20683
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "matchid-login-panel-header-content", children: [
|
|
20684
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "matchid-login-panel-header-title", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react_intl11.FormattedMessage, { id: "loginTitle" }) }),
|
|
20685
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "matchid-login-panel-header-subtilte", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react_intl11.FormattedMessage, { id: "loginTips" }) })
|
|
20890
20686
|
] }),
|
|
20891
|
-
onClose && /* @__PURE__ */ (0,
|
|
20687
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "matchid-login-panel-header-close", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(CloseRoundIcon, { size: isDownMd ? 24 : 30 }) })
|
|
20892
20688
|
] }),
|
|
20893
|
-
/* @__PURE__ */ (0,
|
|
20894
|
-
/* @__PURE__ */ (0,
|
|
20689
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "matchid-login-panel-divide" }),
|
|
20690
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "matchid-login-panel-box", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(LoginBox, { ...props }) })
|
|
20895
20691
|
] });
|
|
20896
20692
|
}
|
|
20897
20693
|
|
|
20898
20694
|
// src/components/LoginModal/index.tsx
|
|
20899
|
-
var
|
|
20695
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
20900
20696
|
function LoginModal({
|
|
20901
20697
|
isOpen = false,
|
|
20902
20698
|
width: width2 = 480,
|
|
20903
20699
|
...props
|
|
20904
20700
|
}) {
|
|
20905
20701
|
const { isLogin } = useUserInfo();
|
|
20906
|
-
return /* @__PURE__ */ (0,
|
|
20702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
20907
20703
|
Modal,
|
|
20908
20704
|
{
|
|
20909
20705
|
isOpen: isOpen && !isLogin,
|
|
20910
20706
|
width: width2,
|
|
20911
|
-
children: /* @__PURE__ */ (0,
|
|
20707
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(LoginPanel, { ...props, inModal: true })
|
|
20912
20708
|
}
|
|
20913
20709
|
);
|
|
20914
20710
|
}
|
|
20915
20711
|
|
|
20916
20712
|
// src/components/UserPopover/index.tsx
|
|
20917
|
-
var
|
|
20713
|
+
var import_react28 = require("react");
|
|
20918
20714
|
|
|
20919
20715
|
// src/assets/icon/ProfileIcon.tsx
|
|
20920
|
-
var
|
|
20716
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
20921
20717
|
function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
20922
|
-
return /* @__PURE__ */ (0,
|
|
20923
|
-
/* @__PURE__ */ (0,
|
|
20718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
20719
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
20924
20720
|
"path",
|
|
20925
20721
|
{
|
|
20926
20722
|
fillRule: "evenodd",
|
|
@@ -20929,7 +20725,7 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
20929
20725
|
fill: color
|
|
20930
20726
|
}
|
|
20931
20727
|
),
|
|
20932
|
-
/* @__PURE__ */ (0,
|
|
20728
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
20933
20729
|
"path",
|
|
20934
20730
|
{
|
|
20935
20731
|
fillRule: "evenodd",
|
|
@@ -20943,10 +20739,10 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
20943
20739
|
|
|
20944
20740
|
// src/components/UserPopover/index.tsx
|
|
20945
20741
|
var import_react_intl12 = require("react-intl");
|
|
20946
|
-
var
|
|
20742
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
20947
20743
|
function UserContent() {
|
|
20948
20744
|
const { logout, address, username } = useUserInfo();
|
|
20949
|
-
const [logouting, setLogouting] = (0,
|
|
20745
|
+
const [logouting, setLogouting] = (0, import_react28.useState)(false);
|
|
20950
20746
|
const onLogout = async () => {
|
|
20951
20747
|
if (logouting) return;
|
|
20952
20748
|
try {
|
|
@@ -20964,34 +20760,34 @@ function UserContent() {
|
|
|
20964
20760
|
rightIcon,
|
|
20965
20761
|
onClick
|
|
20966
20762
|
}) => {
|
|
20967
|
-
return /* @__PURE__ */ (0,
|
|
20968
|
-
/* @__PURE__ */ (0,
|
|
20763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "matchid-user-popover-item", onClick, children: [
|
|
20764
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: `matchid-user-popover-item-content`, children: [
|
|
20969
20765
|
icon,
|
|
20970
|
-
/* @__PURE__ */ (0,
|
|
20766
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "matchid-user-popover-item-text", children })
|
|
20971
20767
|
] }),
|
|
20972
20768
|
rightIcon
|
|
20973
20769
|
] });
|
|
20974
20770
|
};
|
|
20975
20771
|
const UserDivider = () => {
|
|
20976
|
-
return /* @__PURE__ */ (0,
|
|
20772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: `matchid-user-popover-divider` });
|
|
20977
20773
|
};
|
|
20978
|
-
const [usernameOpen, setUsernameOpen] = (0,
|
|
20774
|
+
const [usernameOpen, setUsernameOpen] = (0, import_react28.useState)(false);
|
|
20979
20775
|
const [copied, setCopied] = useCopyClipboard();
|
|
20980
20776
|
const intl = (0, import_react_intl12.useIntl)();
|
|
20981
|
-
return /* @__PURE__ */ (0,
|
|
20982
|
-
/* @__PURE__ */ (0,
|
|
20983
|
-
/* @__PURE__ */ (0,
|
|
20777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "matchid-user-popover-content", children: [
|
|
20778
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "matchid-user-popover-list", children: [
|
|
20779
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(UserItem, { onClick: () => {
|
|
20984
20780
|
setCopied(address);
|
|
20985
|
-
}, icon: copied ? /* @__PURE__ */ (0,
|
|
20986
|
-
/* @__PURE__ */ (0,
|
|
20987
|
-
/* @__PURE__ */ (0,
|
|
20781
|
+
}, icon: copied ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(CheckIcon, { size: 20, color: "#0ecb81" }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(CopyIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(CheckIcon, { size: 20, color: "var(--icon-color)" }), children: truncateAddress(address) }),
|
|
20782
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(UserDivider, {}),
|
|
20783
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(UserItem, { onClick: () => {
|
|
20988
20784
|
setUsernameOpen(true);
|
|
20989
|
-
}, icon: /* @__PURE__ */ (0,
|
|
20785
|
+
}, icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(ProfileIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(ArrowRightIcon, { size: 20, color: "var(--icon-color)" }), children: username || intl.formatMessage({
|
|
20990
20786
|
id: "setUsername"
|
|
20991
20787
|
}) })
|
|
20992
20788
|
] }),
|
|
20993
|
-
/* @__PURE__ */ (0,
|
|
20994
|
-
/* @__PURE__ */ (0,
|
|
20789
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Button, { onClick: onLogout, loading: logouting, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react_intl12.FormattedMessage, { id: "disconnect" }) }),
|
|
20790
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(UsernameModal, { isOpen: usernameOpen, onClose: () => {
|
|
20995
20791
|
setUsernameOpen(false);
|
|
20996
20792
|
}, onSuccess: () => {
|
|
20997
20793
|
setUsernameOpen(false);
|
|
@@ -21002,12 +20798,12 @@ function UserPopover({
|
|
|
21002
20798
|
children,
|
|
21003
20799
|
...props
|
|
21004
20800
|
}) {
|
|
21005
|
-
return /* @__PURE__ */ (0,
|
|
20801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Popover, { ...props, content: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(UserContent, {}), children });
|
|
21006
20802
|
}
|
|
21007
20803
|
|
|
21008
20804
|
// src/components/LoginButton/index.tsx
|
|
21009
20805
|
var import_react_intl13 = require("react-intl");
|
|
21010
|
-
var
|
|
20806
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
21011
20807
|
function LoginButton({
|
|
21012
20808
|
loginRender,
|
|
21013
20809
|
methods,
|
|
@@ -21021,10 +20817,10 @@ function LoginButton({
|
|
|
21021
20817
|
}) {
|
|
21022
20818
|
const intl = (0, import_react_intl13.useIntl)();
|
|
21023
20819
|
const { isLogin, username } = useUserInfo();
|
|
21024
|
-
const [loginOpen, setLoginOpen] = (0,
|
|
20820
|
+
const [loginOpen, setLoginOpen] = (0, import_react29.useState)(false);
|
|
21025
20821
|
if (!isLogin) {
|
|
21026
|
-
return /* @__PURE__ */ (0,
|
|
21027
|
-
/* @__PURE__ */ (0,
|
|
20822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
20823
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
21028
20824
|
LoginModal,
|
|
21029
20825
|
{
|
|
21030
20826
|
methods,
|
|
@@ -21034,32 +20830,32 @@ function LoginButton({
|
|
|
21034
20830
|
onClose: () => setLoginOpen(false)
|
|
21035
20831
|
}
|
|
21036
20832
|
),
|
|
21037
|
-
/* @__PURE__ */ (0,
|
|
21038
|
-
/* @__PURE__ */ (0,
|
|
21039
|
-
/* @__PURE__ */ (0,
|
|
20833
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Button, { className: "matchid-unlogin-btn", ...props, highlight: true, onClick: () => setLoginOpen(true), children: [
|
|
20834
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(UnLoginIcon_default, {}),
|
|
20835
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl13.FormattedMessage, { id: "login" }) })
|
|
21040
20836
|
] })
|
|
21041
20837
|
] });
|
|
21042
20838
|
}
|
|
21043
|
-
return loginRender ? /* @__PURE__ */ (0,
|
|
21044
|
-
/* @__PURE__ */ (0,
|
|
21045
|
-
/* @__PURE__ */ (0,
|
|
20839
|
+
return loginRender ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_jsx_runtime85.Fragment, { children: loginRender }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(UserPopover, { position: popoverPosition, type: popoverType, gap: popoverGap, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Button, { onClick: onLoginClick, className: "matchid-login-btn", ...props, children: [
|
|
20840
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(LoginIcon_default, {}),
|
|
20841
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: username ? truncateAddress(username) : "MatchID " + intl.formatMessage({
|
|
21046
20842
|
id: "user"
|
|
21047
20843
|
}) })
|
|
21048
20844
|
] }) });
|
|
21049
20845
|
}
|
|
21050
20846
|
|
|
21051
20847
|
// src/components/UsernameModal/index.tsx
|
|
21052
|
-
var
|
|
20848
|
+
var import_react30 = require("react");
|
|
21053
20849
|
var import_react_intl14 = require("react-intl");
|
|
21054
|
-
var
|
|
20850
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
21055
20851
|
var ValidItem = ({
|
|
21056
20852
|
success = false,
|
|
21057
20853
|
text: text2
|
|
21058
20854
|
}) => {
|
|
21059
20855
|
const isDownMd = useDownMd();
|
|
21060
|
-
return /* @__PURE__ */ (0,
|
|
21061
|
-
success ? /* @__PURE__ */ (0,
|
|
21062
|
-
/* @__PURE__ */ (0,
|
|
20856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: `matchid-valid-status-item matchid-valid-status-${success ? "success" : "error"}`, children: [
|
|
20857
|
+
success ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(CheckRoundIcon, { size: isDownMd ? 12 : 16 }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(InfoLineIcon, { size: isDownMd ? 12 : 16 }),
|
|
20858
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { children: text2 })
|
|
21063
20859
|
] });
|
|
21064
20860
|
};
|
|
21065
20861
|
function UsernameModal({
|
|
@@ -21070,23 +20866,23 @@ function UsernameModal({
|
|
|
21070
20866
|
}) {
|
|
21071
20867
|
const { username, refreshOverview } = useUserInfo();
|
|
21072
20868
|
const { isLogin } = useUserInfo();
|
|
21073
|
-
const [val2, setVal] = (0,
|
|
21074
|
-
const [error, setError] = (0,
|
|
20869
|
+
const [val2, setVal] = (0, import_react30.useState)(username);
|
|
20870
|
+
const [error, setError] = (0, import_react30.useState)("");
|
|
21075
20871
|
const isDownMd = useDownMd();
|
|
21076
|
-
(0,
|
|
20872
|
+
(0, import_react30.useEffect)(() => {
|
|
21077
20873
|
if (isOpen) {
|
|
21078
20874
|
setVal(username);
|
|
21079
20875
|
setError("");
|
|
21080
20876
|
}
|
|
21081
20877
|
}, [isOpen]);
|
|
21082
|
-
const isValid = (0,
|
|
20878
|
+
const isValid = (0, import_react30.useMemo)(() => {
|
|
21083
20879
|
return isValidUsername(val2);
|
|
21084
20880
|
}, [val2]);
|
|
21085
|
-
const isLength = (0,
|
|
20881
|
+
const isLength = (0, import_react30.useMemo)(() => {
|
|
21086
20882
|
return val2.length >= 2 && val2.length <= 32;
|
|
21087
20883
|
}, [val2]);
|
|
21088
20884
|
const isSafe = isValid && isLength;
|
|
21089
|
-
const [isSubmitting, setIsSubmitting] = (0,
|
|
20885
|
+
const [isSubmitting, setIsSubmitting] = (0, import_react30.useState)(false);
|
|
21090
20886
|
const onSubmit = async () => {
|
|
21091
20887
|
if (isSubmitting) return;
|
|
21092
20888
|
try {
|
|
@@ -21107,12 +20903,12 @@ function UsernameModal({
|
|
|
21107
20903
|
}
|
|
21108
20904
|
};
|
|
21109
20905
|
const intl = (0, import_react_intl14.useIntl)();
|
|
21110
|
-
return /* @__PURE__ */ (0,
|
|
20906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ModalWithHeader, { isOpen: isOpen && isLogin, ...props, title: title || intl.formatMessage({
|
|
21111
20907
|
id: username ? "editUsernameTitle" : "setUsernameTitle"
|
|
21112
|
-
}), children: /* @__PURE__ */ (0,
|
|
21113
|
-
/* @__PURE__ */ (0,
|
|
20908
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "matchid-username-box", children: [
|
|
20909
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Field, { label: intl.formatMessage({
|
|
21114
20910
|
id: "username"
|
|
21115
|
-
}), error, children: /* @__PURE__ */ (0,
|
|
20911
|
+
}), error, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
21116
20912
|
Input,
|
|
21117
20913
|
{
|
|
21118
20914
|
placeholder: intl.formatMessage({
|
|
@@ -21125,8 +20921,8 @@ function UsernameModal({
|
|
|
21125
20921
|
value: val2
|
|
21126
20922
|
}
|
|
21127
20923
|
) }),
|
|
21128
|
-
/* @__PURE__ */ (0,
|
|
21129
|
-
/* @__PURE__ */ (0,
|
|
20924
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "matchid-valid", children: [
|
|
20925
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
21130
20926
|
ValidItem,
|
|
21131
20927
|
{
|
|
21132
20928
|
success: isValid,
|
|
@@ -21135,25 +20931,25 @@ function UsernameModal({
|
|
|
21135
20931
|
})
|
|
21136
20932
|
}
|
|
21137
20933
|
),
|
|
21138
|
-
/* @__PURE__ */ (0,
|
|
20934
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ValidItem, { success: isLength, text: intl.formatMessage({
|
|
21139
20935
|
id: "usernameLengthError"
|
|
21140
20936
|
}) })
|
|
21141
20937
|
] }),
|
|
21142
|
-
/* @__PURE__ */ (0,
|
|
20938
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Button, { disabled: !isSafe, loading: isSubmitting, style: {
|
|
21143
20939
|
marginTop: isDownMd ? "36px" : "64px"
|
|
21144
|
-
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ (0,
|
|
21145
|
-
/* @__PURE__ */ (0,
|
|
20940
|
+
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react_intl14.FormattedMessage, { id: "confirm" }) }),
|
|
20941
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Button, { style: {
|
|
21146
20942
|
marginTop: isDownMd ? "12px" : "24px"
|
|
21147
|
-
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ (0,
|
|
20943
|
+
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react_intl14.FormattedMessage, { id: "cancel" }) })
|
|
21148
20944
|
] }) });
|
|
21149
20945
|
}
|
|
21150
20946
|
|
|
21151
20947
|
// src/components/EVMModal/index.tsx
|
|
21152
|
-
var
|
|
20948
|
+
var import_react33 = require("react");
|
|
21153
20949
|
var import_react_intl15 = require("react-intl");
|
|
21154
20950
|
|
|
21155
20951
|
// src/components/WalletModalContent/index.tsx
|
|
21156
|
-
var
|
|
20952
|
+
var import_react31 = require("react");
|
|
21157
20953
|
|
|
21158
20954
|
// src/assets/wallet.ts
|
|
21159
20955
|
var walletErrorImage = error_default;
|
|
@@ -21163,7 +20959,7 @@ var walletConnectImage = wallet_default;
|
|
|
21163
20959
|
var walletSigningImage = signing_default;
|
|
21164
20960
|
|
|
21165
20961
|
// src/components/WalletModalContent/index.tsx
|
|
21166
|
-
var
|
|
20962
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
21167
20963
|
function WalletModalContent({
|
|
21168
20964
|
status,
|
|
21169
20965
|
error,
|
|
@@ -21174,7 +20970,7 @@ function WalletModalContent({
|
|
|
21174
20970
|
address,
|
|
21175
20971
|
connected
|
|
21176
20972
|
}) {
|
|
21177
|
-
const pageData = (0,
|
|
20973
|
+
const pageData = (0, import_react31.useMemo)(() => {
|
|
21178
20974
|
if (status == "success") {
|
|
21179
20975
|
return {
|
|
21180
20976
|
btnText: "Disconnect Wallet",
|
|
@@ -21233,15 +21029,15 @@ function WalletModalContent({
|
|
|
21233
21029
|
statusImage: walletConnectImage
|
|
21234
21030
|
};
|
|
21235
21031
|
}, [visible, connected, status, error, address]);
|
|
21236
|
-
return /* @__PURE__ */ (0,
|
|
21237
|
-
/* @__PURE__ */ (0,
|
|
21238
|
-
/* @__PURE__ */ (0,
|
|
21032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: `matchid-wallet-box`, children: [
|
|
21033
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: `matchid-wallet-content`, children: [
|
|
21034
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
21239
21035
|
width: 128,
|
|
21240
21036
|
height: 128
|
|
21241
21037
|
} }),
|
|
21242
|
-
/* @__PURE__ */ (0,
|
|
21038
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: pageData.isError ? "matchid-error" : "", children: pageData.text })
|
|
21243
21039
|
] }),
|
|
21244
|
-
/* @__PURE__ */ (0,
|
|
21040
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
21245
21041
|
Button,
|
|
21246
21042
|
{
|
|
21247
21043
|
block: true,
|
|
@@ -21255,8 +21051,8 @@ function WalletModalContent({
|
|
|
21255
21051
|
] }) });
|
|
21256
21052
|
}
|
|
21257
21053
|
function WalletModalContentV2(props) {
|
|
21258
|
-
const [submitting, setSubmitting] = (0,
|
|
21259
|
-
const pageData = (0,
|
|
21054
|
+
const [submitting, setSubmitting] = (0, import_react31.useState)(false);
|
|
21055
|
+
const pageData = (0, import_react31.useMemo)(() => {
|
|
21260
21056
|
const { status } = props;
|
|
21261
21057
|
if (status == "success") {
|
|
21262
21058
|
return {
|
|
@@ -21317,15 +21113,15 @@ function WalletModalContentV2(props) {
|
|
|
21317
21113
|
statusImage: walletConnectImage
|
|
21318
21114
|
};
|
|
21319
21115
|
}, [props, submitting]);
|
|
21320
|
-
return /* @__PURE__ */ (0,
|
|
21321
|
-
/* @__PURE__ */ (0,
|
|
21322
|
-
/* @__PURE__ */ (0,
|
|
21116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: `matchid-wallet-box`, children: [
|
|
21117
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: `matchid-wallet-content`, children: [
|
|
21118
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
21323
21119
|
width: 128,
|
|
21324
21120
|
height: 128
|
|
21325
21121
|
} }),
|
|
21326
|
-
/* @__PURE__ */ (0,
|
|
21122
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: props.status == "error" ? "matchid-error" : "", children: pageData.text })
|
|
21327
21123
|
] }),
|
|
21328
|
-
/* @__PURE__ */ (0,
|
|
21124
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
21329
21125
|
Button,
|
|
21330
21126
|
{
|
|
21331
21127
|
block: true,
|
|
@@ -21344,14 +21140,14 @@ var import_rainbowkit2 = require("@rainbow-me/rainbowkit");
|
|
|
21344
21140
|
var import_wagmi3 = require("wagmi");
|
|
21345
21141
|
|
|
21346
21142
|
// src/hooks/useWalletBox.ts
|
|
21347
|
-
var
|
|
21143
|
+
var import_react32 = require("react");
|
|
21348
21144
|
function useWalletBox({
|
|
21349
21145
|
onInit
|
|
21350
21146
|
}) {
|
|
21351
|
-
const [status, setStateStatus] = (0,
|
|
21352
|
-
const [error, setError] = (0,
|
|
21353
|
-
const statusRef = (0,
|
|
21354
|
-
const [nonce, setNonce] = (0,
|
|
21147
|
+
const [status, setStateStatus] = (0, import_react32.useState)("start");
|
|
21148
|
+
const [error, setError] = (0, import_react32.useState)("");
|
|
21149
|
+
const statusRef = (0, import_react32.useRef)(status);
|
|
21150
|
+
const [nonce, setNonce] = (0, import_react32.useState)();
|
|
21355
21151
|
const setStatus = (status2) => {
|
|
21356
21152
|
statusRef.current = status2;
|
|
21357
21153
|
setStateStatus(status2);
|
|
@@ -21360,7 +21156,7 @@ function useWalletBox({
|
|
|
21360
21156
|
setError("");
|
|
21361
21157
|
setNonce(null);
|
|
21362
21158
|
};
|
|
21363
|
-
(0,
|
|
21159
|
+
(0, import_react32.useEffect)(() => {
|
|
21364
21160
|
init();
|
|
21365
21161
|
onInit({
|
|
21366
21162
|
setStatus
|
|
@@ -21607,7 +21403,7 @@ async function getEthersSigner(config, { chainId } = {}) {
|
|
|
21607
21403
|
// src/components/EVMModal/index.tsx
|
|
21608
21404
|
var import_siwe = require("siwe");
|
|
21609
21405
|
var import_styles = require("@rainbow-me/rainbowkit/styles.css");
|
|
21610
|
-
var
|
|
21406
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
21611
21407
|
function WalletContent({
|
|
21612
21408
|
onSuccess,
|
|
21613
21409
|
type
|
|
@@ -21618,16 +21414,16 @@ function WalletContent({
|
|
|
21618
21414
|
const { disconnectAsync } = (0, import_wagmi3.useDisconnect)({ config });
|
|
21619
21415
|
const chainId = (0, import_wagmi3.useChainId)();
|
|
21620
21416
|
const { events, login } = useMatch();
|
|
21621
|
-
const [inited, setInited] = (0,
|
|
21417
|
+
const [inited, setInited] = (0, import_react33.useState)(false);
|
|
21622
21418
|
const { status, setStatus, error, setError, statusRef, nonce, setNonce, init } = useWalletBox({
|
|
21623
21419
|
onInit: async ({ setStatus: setStatus2 }) => {
|
|
21624
21420
|
setStatus2("start");
|
|
21625
21421
|
}
|
|
21626
21422
|
});
|
|
21627
|
-
(0,
|
|
21423
|
+
(0, import_react33.useEffect)(() => {
|
|
21628
21424
|
matchlog_default.log(`status=${status}`, `connectModalOpen=${connectModalOpen}`, `address=${address}`, `isConnected=${isConnected}`);
|
|
21629
21425
|
}, [status, connectModalOpen, isConnected, address]);
|
|
21630
|
-
(0,
|
|
21426
|
+
(0, import_react33.useEffect)(() => {
|
|
21631
21427
|
if (connectModalOpen) {
|
|
21632
21428
|
setStatus("connecting");
|
|
21633
21429
|
return;
|
|
@@ -21640,7 +21436,7 @@ function WalletContent({
|
|
|
21640
21436
|
setStatus("start");
|
|
21641
21437
|
}
|
|
21642
21438
|
}, [connectModalOpen, address]);
|
|
21643
|
-
(0,
|
|
21439
|
+
(0, import_react33.useEffect)(() => {
|
|
21644
21440
|
if (openConnectModal && !isConnected && !inited) {
|
|
21645
21441
|
openConnectModal && openConnectModal();
|
|
21646
21442
|
setInited(true);
|
|
@@ -21667,7 +21463,7 @@ function WalletContent({
|
|
|
21667
21463
|
setError(error2.message);
|
|
21668
21464
|
}
|
|
21669
21465
|
};
|
|
21670
|
-
const signature = (0,
|
|
21466
|
+
const signature = (0, import_react33.useCallback)(async () => {
|
|
21671
21467
|
if (!nonce || status != "nonce") {
|
|
21672
21468
|
return;
|
|
21673
21469
|
}
|
|
@@ -21723,7 +21519,7 @@ function WalletContent({
|
|
|
21723
21519
|
setError(error2.reason || error2.message);
|
|
21724
21520
|
}
|
|
21725
21521
|
}, [nonce, status, address]);
|
|
21726
|
-
(0,
|
|
21522
|
+
(0, import_react33.useEffect)(() => {
|
|
21727
21523
|
if (signature) {
|
|
21728
21524
|
signature();
|
|
21729
21525
|
}
|
|
@@ -21765,7 +21561,7 @@ function WalletContent({
|
|
|
21765
21561
|
setNonce(void 0);
|
|
21766
21562
|
setStatus("start");
|
|
21767
21563
|
};
|
|
21768
|
-
return /* @__PURE__ */ (0,
|
|
21564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
21769
21565
|
WalletModalContentV2,
|
|
21770
21566
|
{
|
|
21771
21567
|
status,
|
|
@@ -21783,18 +21579,18 @@ function EVMConnectModal({
|
|
|
21783
21579
|
...props
|
|
21784
21580
|
}) {
|
|
21785
21581
|
const intl = (0, import_react_intl15.useIntl)();
|
|
21786
|
-
return /* @__PURE__ */ (0,
|
|
21582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
21787
21583
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
21788
21584
|
}, {
|
|
21789
21585
|
name: "EVM"
|
|
21790
|
-
}), children: /* @__PURE__ */ (0,
|
|
21586
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(WalletContent, { onSuccess, type }) });
|
|
21791
21587
|
}
|
|
21792
21588
|
function EVMModal(props) {
|
|
21793
|
-
return props.isOpen && /* @__PURE__ */ (0,
|
|
21589
|
+
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(EVMConnectModal, { ...props });
|
|
21794
21590
|
}
|
|
21795
21591
|
|
|
21796
21592
|
// src/components/TRONModal/index.tsx
|
|
21797
|
-
var
|
|
21593
|
+
var import_react35 = __toESM(require("react"));
|
|
21798
21594
|
var import_react_intl16 = require("react-intl");
|
|
21799
21595
|
|
|
21800
21596
|
// src/lib/tron/TronLinkAdapter.ts
|
|
@@ -21828,7 +21624,7 @@ var TronLinkAdapter = class {
|
|
|
21828
21624
|
};
|
|
21829
21625
|
|
|
21830
21626
|
// src/hooks/useTRONWallet.ts
|
|
21831
|
-
var
|
|
21627
|
+
var import_react34 = require("react");
|
|
21832
21628
|
|
|
21833
21629
|
// src/lib/tron/BitgetAdapter.ts
|
|
21834
21630
|
var BitgetAdapter = class {
|
|
@@ -21873,9 +21669,9 @@ var OKXAdapter = class {
|
|
|
21873
21669
|
// src/hooks/useTRONWallet.ts
|
|
21874
21670
|
var useTRONWallet = () => {
|
|
21875
21671
|
const wallets = [new TronLinkAdapter(), new BitgetAdapter(), new OKXAdapter()];
|
|
21876
|
-
const [installedWallets, setInstalledWallets] = (0,
|
|
21877
|
-
const [address, setAddress] = (0,
|
|
21878
|
-
(0,
|
|
21672
|
+
const [installedWallets, setInstalledWallets] = (0, import_react34.useState)([]);
|
|
21673
|
+
const [address, setAddress] = (0, import_react34.useState)(null);
|
|
21674
|
+
(0, import_react34.useEffect)(() => {
|
|
21879
21675
|
const getInstalled = async () => {
|
|
21880
21676
|
const installed = await Promise.all(wallets.map((wallet2) => wallet2.isInstalled().then((isInstalled) => ({
|
|
21881
21677
|
wallet: wallet2,
|
|
@@ -21885,11 +21681,11 @@ var useTRONWallet = () => {
|
|
|
21885
21681
|
};
|
|
21886
21682
|
getInstalled();
|
|
21887
21683
|
}, []);
|
|
21888
|
-
const [wallet, chooseWallet] = (0,
|
|
21684
|
+
const [wallet, chooseWallet] = (0, import_react34.useState)(null);
|
|
21889
21685
|
const onConnect = async () => {
|
|
21890
21686
|
setAddress(await wallet.connect());
|
|
21891
21687
|
};
|
|
21892
|
-
(0,
|
|
21688
|
+
(0, import_react34.useEffect)(() => {
|
|
21893
21689
|
if (!wallet) {
|
|
21894
21690
|
setAddress(null);
|
|
21895
21691
|
}
|
|
@@ -21905,7 +21701,7 @@ var useTRONWallet = () => {
|
|
|
21905
21701
|
};
|
|
21906
21702
|
|
|
21907
21703
|
// src/components/TRONModal/index.tsx
|
|
21908
|
-
var
|
|
21704
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
21909
21705
|
function TRONConnectModal({
|
|
21910
21706
|
type = "login",
|
|
21911
21707
|
onSuccess,
|
|
@@ -21915,15 +21711,15 @@ function TRONConnectModal({
|
|
|
21915
21711
|
const intl = (0, import_react_intl16.useIntl)();
|
|
21916
21712
|
const { wallets, installedWallets, chooseWallet, wallet, address, onConnect } = useTRONWallet();
|
|
21917
21713
|
const iconMaps = {
|
|
21918
|
-
tronlink: /* @__PURE__ */ (0,
|
|
21919
|
-
bitget: /* @__PURE__ */ (0,
|
|
21920
|
-
okx: /* @__PURE__ */ (0,
|
|
21714
|
+
tronlink: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TronLinkIcon, { size: isDownMd ? 36 : 40 }),
|
|
21715
|
+
bitget: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(BitgetIcon, { size: isDownMd ? 36 : 40 }),
|
|
21716
|
+
okx: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(OKXIcon, { size: isDownMd ? 36 : 40 })
|
|
21921
21717
|
};
|
|
21922
21718
|
const { events, login } = useMatch();
|
|
21923
|
-
const [status, setStatus] = (0,
|
|
21924
|
-
const statusRef =
|
|
21925
|
-
const [error, setError] = (0,
|
|
21926
|
-
const connected = (0,
|
|
21719
|
+
const [status, setStatus] = (0, import_react35.useState)("");
|
|
21720
|
+
const statusRef = import_react35.default.useRef(status);
|
|
21721
|
+
const [error, setError] = (0, import_react35.useState)("");
|
|
21722
|
+
const connected = (0, import_react35.useMemo)(() => {
|
|
21927
21723
|
return !!address;
|
|
21928
21724
|
}, [address]);
|
|
21929
21725
|
const disconnect = async () => {
|
|
@@ -21991,7 +21787,7 @@ function TRONConnectModal({
|
|
|
21991
21787
|
statusRef.current = "";
|
|
21992
21788
|
}
|
|
21993
21789
|
};
|
|
21994
|
-
(0,
|
|
21790
|
+
(0, import_react35.useEffect)(() => {
|
|
21995
21791
|
if (wallet) {
|
|
21996
21792
|
console.log("onConnect");
|
|
21997
21793
|
onConnect();
|
|
@@ -21999,21 +21795,21 @@ function TRONConnectModal({
|
|
|
21999
21795
|
setStatus("");
|
|
22000
21796
|
}
|
|
22001
21797
|
}, [wallet]);
|
|
22002
|
-
(0,
|
|
21798
|
+
(0, import_react35.useEffect)(() => {
|
|
22003
21799
|
if (address) {
|
|
22004
21800
|
toLoginInWallet();
|
|
22005
21801
|
}
|
|
22006
21802
|
}, [address]);
|
|
22007
|
-
(0,
|
|
21803
|
+
(0, import_react35.useEffect)(() => {
|
|
22008
21804
|
if (!props.isOpen) {
|
|
22009
21805
|
disconnect();
|
|
22010
21806
|
}
|
|
22011
21807
|
}, [props.isOpen]);
|
|
22012
|
-
return /* @__PURE__ */ (0,
|
|
21808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
22013
21809
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
22014
21810
|
}, {
|
|
22015
21811
|
name: "TRON"
|
|
22016
|
-
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ (0,
|
|
21812
|
+
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
22017
21813
|
WalletModalContent,
|
|
22018
21814
|
{
|
|
22019
21815
|
error,
|
|
@@ -22026,9 +21822,9 @@ function TRONConnectModal({
|
|
|
22026
21822
|
setVisible: () => {
|
|
22027
21823
|
}
|
|
22028
21824
|
}
|
|
22029
|
-
) : /* @__PURE__ */ (0,
|
|
21825
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "matchid-login-box", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "matchid-login-recommend-list", children: [
|
|
22030
21826
|
installedWallets.map((wallet2) => {
|
|
22031
|
-
return /* @__PURE__ */ (0,
|
|
21827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
22032
21828
|
RecommendItem,
|
|
22033
21829
|
{
|
|
22034
21830
|
icon: iconMaps[wallet2.walletKey],
|
|
@@ -22041,14 +21837,14 @@ function TRONConnectModal({
|
|
|
22041
21837
|
);
|
|
22042
21838
|
}),
|
|
22043
21839
|
wallets.filter((wallet2) => !installedWallets.find((installedWallet) => installedWallet.walletKey == wallet2.walletKey)).map((wallet2) => {
|
|
22044
|
-
return /* @__PURE__ */ (0,
|
|
21840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
22045
21841
|
RecommendItem,
|
|
22046
21842
|
{
|
|
22047
21843
|
icon: iconMaps[wallet2.walletKey],
|
|
22048
21844
|
name: wallet2.name,
|
|
22049
21845
|
onClick: () => {
|
|
22050
21846
|
},
|
|
22051
|
-
footer: /* @__PURE__ */ (0,
|
|
21847
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Button, { size: "sm", onClick: () => {
|
|
22052
21848
|
window.open(wallet2.website);
|
|
22053
21849
|
}, children: "Install" })
|
|
22054
21850
|
},
|
|
@@ -22058,28 +21854,28 @@ function TRONConnectModal({
|
|
|
22058
21854
|
] }) }) });
|
|
22059
21855
|
}
|
|
22060
21856
|
function TRONModal(props) {
|
|
22061
|
-
return props.isOpen && /* @__PURE__ */ (0,
|
|
21857
|
+
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TRONConnectModal, { ...props, type: props.type });
|
|
22062
21858
|
}
|
|
22063
21859
|
|
|
22064
21860
|
// src/components/TONModal/index.tsx
|
|
22065
|
-
var
|
|
21861
|
+
var import_react36 = __toESM(require("react"));
|
|
22066
21862
|
var import_react_intl17 = require("react-intl");
|
|
22067
21863
|
var import_ui_react = require("@tonconnect/ui-react");
|
|
22068
|
-
var
|
|
21864
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
22069
21865
|
function WalletContent2({
|
|
22070
21866
|
onSuccess,
|
|
22071
21867
|
type
|
|
22072
21868
|
}) {
|
|
22073
21869
|
const { events, login } = useMatch();
|
|
22074
|
-
const [connected, setConnected] = (0,
|
|
21870
|
+
const [connected, setConnected] = (0, import_react36.useState)(false);
|
|
22075
21871
|
const wallet = (0, import_ui_react.useTonWallet)();
|
|
22076
21872
|
const userFriendlyAddress = (0, import_ui_react.useTonAddress)();
|
|
22077
21873
|
const [tonConnectUI] = (0, import_ui_react.useTonConnectUI)();
|
|
22078
21874
|
const { state, open, close } = (0, import_ui_react.useTonConnectModal)();
|
|
22079
|
-
const [status, setStatus] = (0,
|
|
22080
|
-
const statusRef =
|
|
22081
|
-
const [error, setError] = (0,
|
|
22082
|
-
(0,
|
|
21875
|
+
const [status, setStatus] = (0, import_react36.useState)("");
|
|
21876
|
+
const statusRef = import_react36.default.useRef(status);
|
|
21877
|
+
const [error, setError] = (0, import_react36.useState)("");
|
|
21878
|
+
(0, import_react36.useEffect)(() => {
|
|
22083
21879
|
const init = async () => {
|
|
22084
21880
|
if (tonConnectUI.connected) {
|
|
22085
21881
|
await tonConnectUI.disconnect();
|
|
@@ -22152,7 +21948,7 @@ function WalletContent2({
|
|
|
22152
21948
|
}
|
|
22153
21949
|
});
|
|
22154
21950
|
}, []);
|
|
22155
|
-
(0,
|
|
21951
|
+
(0, import_react36.useEffect)(() => {
|
|
22156
21952
|
if (wallet) {
|
|
22157
21953
|
setConnected(true);
|
|
22158
21954
|
console.log("Wallet connected:", wallet);
|
|
@@ -22163,7 +21959,7 @@ function WalletContent2({
|
|
|
22163
21959
|
setStatus("");
|
|
22164
21960
|
}
|
|
22165
21961
|
}, [wallet]);
|
|
22166
|
-
(0,
|
|
21962
|
+
(0, import_react36.useEffect)(() => {
|
|
22167
21963
|
console.log({
|
|
22168
21964
|
state,
|
|
22169
21965
|
wallet
|
|
@@ -22192,7 +21988,7 @@ function WalletContent2({
|
|
|
22192
21988
|
}
|
|
22193
21989
|
}
|
|
22194
21990
|
}, [state]);
|
|
22195
|
-
return /* @__PURE__ */ (0,
|
|
21991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
22196
21992
|
WalletModalContent,
|
|
22197
21993
|
{
|
|
22198
21994
|
connected,
|
|
@@ -22226,24 +22022,24 @@ function TONConnectModal({
|
|
|
22226
22022
|
const intl = (0, import_react_intl17.useIntl)();
|
|
22227
22023
|
const { endpoints, appid } = useLocalStore_default();
|
|
22228
22024
|
const manifestUrl = `${endpoints.back}api/v1/wallet/ton?appid=${appid}&url=` + encodeURIComponent(window.location.origin);
|
|
22229
|
-
return /* @__PURE__ */ (0,
|
|
22025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
22230
22026
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
22231
22027
|
}, {
|
|
22232
22028
|
name: "TON"
|
|
22233
|
-
}), children: /* @__PURE__ */ (0,
|
|
22029
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
22234
22030
|
import_ui_react.TonConnectUIProvider,
|
|
22235
22031
|
{
|
|
22236
22032
|
manifestUrl,
|
|
22237
|
-
children: /* @__PURE__ */ (0,
|
|
22033
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(WalletContent2, { onSuccess, type })
|
|
22238
22034
|
}
|
|
22239
22035
|
) });
|
|
22240
22036
|
}
|
|
22241
22037
|
function TONModal(props) {
|
|
22242
|
-
return props.isOpen && /* @__PURE__ */ (0,
|
|
22038
|
+
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(TONConnectModal, { ...props });
|
|
22243
22039
|
}
|
|
22244
22040
|
|
|
22245
22041
|
// src/components/BTCModal/index.tsx
|
|
22246
|
-
var
|
|
22042
|
+
var import_react38 = __toESM(require("react"));
|
|
22247
22043
|
var import_react_intl18 = require("react-intl");
|
|
22248
22044
|
|
|
22249
22045
|
// src/lib/btc/UnisatAdapter.ts
|
|
@@ -22392,7 +22188,7 @@ var LeatherAdapter = class {
|
|
|
22392
22188
|
};
|
|
22393
22189
|
|
|
22394
22190
|
// src/hooks/useBTCWallet.ts
|
|
22395
|
-
var
|
|
22191
|
+
var import_react37 = require("react");
|
|
22396
22192
|
|
|
22397
22193
|
// src/lib/btc/PhantomAdapter.ts
|
|
22398
22194
|
var PhantomAdapter = class {
|
|
@@ -22430,9 +22226,9 @@ var PhantomAdapter = class {
|
|
|
22430
22226
|
// src/hooks/useBTCWallet.ts
|
|
22431
22227
|
var useBTCWallet = () => {
|
|
22432
22228
|
const wallets = [new UnisatAdapter(), new XverseAdapter(), new LeatherAdapter(), new PhantomAdapter()];
|
|
22433
|
-
const [installedWallets, setInstalledWallets] = (0,
|
|
22434
|
-
const [address, setAddress] = (0,
|
|
22435
|
-
(0,
|
|
22229
|
+
const [installedWallets, setInstalledWallets] = (0, import_react37.useState)([]);
|
|
22230
|
+
const [address, setAddress] = (0, import_react37.useState)(null);
|
|
22231
|
+
(0, import_react37.useEffect)(() => {
|
|
22436
22232
|
const getInstalled = async () => {
|
|
22437
22233
|
const installed = await Promise.all(wallets.map((wallet2) => wallet2.isInstalled().then((isInstalled) => ({
|
|
22438
22234
|
wallet: wallet2,
|
|
@@ -22442,11 +22238,11 @@ var useBTCWallet = () => {
|
|
|
22442
22238
|
};
|
|
22443
22239
|
getInstalled();
|
|
22444
22240
|
}, []);
|
|
22445
|
-
const [wallet, chooseWallet] = (0,
|
|
22241
|
+
const [wallet, chooseWallet] = (0, import_react37.useState)(null);
|
|
22446
22242
|
const onConnect = async () => {
|
|
22447
22243
|
setAddress(await wallet.connect());
|
|
22448
22244
|
};
|
|
22449
|
-
(0,
|
|
22245
|
+
(0, import_react37.useEffect)(() => {
|
|
22450
22246
|
if (!wallet) {
|
|
22451
22247
|
setAddress(null);
|
|
22452
22248
|
}
|
|
@@ -22462,7 +22258,7 @@ var useBTCWallet = () => {
|
|
|
22462
22258
|
};
|
|
22463
22259
|
|
|
22464
22260
|
// src/components/BTCModal/index.tsx
|
|
22465
|
-
var
|
|
22261
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
22466
22262
|
function BTCConnectModal({
|
|
22467
22263
|
type = "login",
|
|
22468
22264
|
onSuccess,
|
|
@@ -22472,16 +22268,16 @@ function BTCConnectModal({
|
|
|
22472
22268
|
const intl = (0, import_react_intl18.useIntl)();
|
|
22473
22269
|
const { wallets, installedWallets, chooseWallet, wallet, address, onConnect } = useBTCWallet();
|
|
22474
22270
|
const iconMaps = {
|
|
22475
|
-
leather: /* @__PURE__ */ (0,
|
|
22476
|
-
unisat: /* @__PURE__ */ (0,
|
|
22477
|
-
xverse: /* @__PURE__ */ (0,
|
|
22478
|
-
phantom: /* @__PURE__ */ (0,
|
|
22271
|
+
leather: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(LeatherIcon, { size: isDownMd ? 36 : 40 }),
|
|
22272
|
+
unisat: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(UnisatIcon, { size: isDownMd ? 36 : 40 }),
|
|
22273
|
+
xverse: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(XverseIcon, { size: isDownMd ? 36 : 40 }),
|
|
22274
|
+
phantom: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(PhantomIcon, { size: isDownMd ? 36 : 40 })
|
|
22479
22275
|
};
|
|
22480
22276
|
const { events, login } = useMatch();
|
|
22481
|
-
const [status, setStatus] = (0,
|
|
22482
|
-
const statusRef =
|
|
22483
|
-
const [error, setError] = (0,
|
|
22484
|
-
const connected = (0,
|
|
22277
|
+
const [status, setStatus] = (0, import_react38.useState)("");
|
|
22278
|
+
const statusRef = import_react38.default.useRef(status);
|
|
22279
|
+
const [error, setError] = (0, import_react38.useState)("");
|
|
22280
|
+
const connected = (0, import_react38.useMemo)(() => {
|
|
22485
22281
|
return !!address;
|
|
22486
22282
|
}, [address]);
|
|
22487
22283
|
const disconnect = async () => {
|
|
@@ -22545,7 +22341,7 @@ function BTCConnectModal({
|
|
|
22545
22341
|
statusRef.current = "";
|
|
22546
22342
|
}
|
|
22547
22343
|
};
|
|
22548
|
-
(0,
|
|
22344
|
+
(0, import_react38.useEffect)(() => {
|
|
22549
22345
|
if (wallet) {
|
|
22550
22346
|
console.log("onConnect");
|
|
22551
22347
|
try {
|
|
@@ -22558,12 +22354,12 @@ function BTCConnectModal({
|
|
|
22558
22354
|
setStatus("");
|
|
22559
22355
|
}
|
|
22560
22356
|
}, [wallet]);
|
|
22561
|
-
(0,
|
|
22357
|
+
(0, import_react38.useEffect)(() => {
|
|
22562
22358
|
if (address) {
|
|
22563
22359
|
toLoginInWallet();
|
|
22564
22360
|
}
|
|
22565
22361
|
}, [address]);
|
|
22566
|
-
(0,
|
|
22362
|
+
(0, import_react38.useEffect)(() => {
|
|
22567
22363
|
if (!props.isOpen) {
|
|
22568
22364
|
disconnect();
|
|
22569
22365
|
}
|
|
@@ -22575,11 +22371,11 @@ function BTCConnectModal({
|
|
|
22575
22371
|
statusRef.current = "";
|
|
22576
22372
|
setError("");
|
|
22577
22373
|
};
|
|
22578
|
-
return /* @__PURE__ */ (0,
|
|
22374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
22579
22375
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
22580
22376
|
}, {
|
|
22581
22377
|
name: "BTC"
|
|
22582
|
-
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ (0,
|
|
22378
|
+
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
22583
22379
|
WalletModalContent,
|
|
22584
22380
|
{
|
|
22585
22381
|
error,
|
|
@@ -22592,9 +22388,9 @@ function BTCConnectModal({
|
|
|
22592
22388
|
setVisible: () => {
|
|
22593
22389
|
}
|
|
22594
22390
|
}
|
|
22595
|
-
) : /* @__PURE__ */ (0,
|
|
22391
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "matchid-login-box", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "matchid-login-recommend-list", children: [
|
|
22596
22392
|
installedWallets.map((wallet2) => {
|
|
22597
|
-
return /* @__PURE__ */ (0,
|
|
22393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
22598
22394
|
RecommendItem,
|
|
22599
22395
|
{
|
|
22600
22396
|
icon: iconMaps[wallet2.walletKey],
|
|
@@ -22607,14 +22403,14 @@ function BTCConnectModal({
|
|
|
22607
22403
|
);
|
|
22608
22404
|
}),
|
|
22609
22405
|
wallets.filter((wallet2) => !installedWallets.find((installedWallet) => installedWallet.walletKey == wallet2.walletKey)).map((wallet2) => {
|
|
22610
|
-
return /* @__PURE__ */ (0,
|
|
22406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
22611
22407
|
RecommendItem,
|
|
22612
22408
|
{
|
|
22613
22409
|
icon: iconMaps[wallet2.walletKey],
|
|
22614
22410
|
name: wallet2.name,
|
|
22615
22411
|
onClick: () => {
|
|
22616
22412
|
},
|
|
22617
|
-
footer: /* @__PURE__ */ (0,
|
|
22413
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Button, { size: "sm", onClick: () => {
|
|
22618
22414
|
window.open(wallet2.website);
|
|
22619
22415
|
}, children: "Install" })
|
|
22620
22416
|
},
|
|
@@ -22624,13 +22420,13 @@ function BTCConnectModal({
|
|
|
22624
22420
|
] }) }) });
|
|
22625
22421
|
}
|
|
22626
22422
|
function BTCModal(props) {
|
|
22627
|
-
return props.isOpen && /* @__PURE__ */ (0,
|
|
22423
|
+
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(BTCConnectModal, { ...props });
|
|
22628
22424
|
}
|
|
22629
22425
|
|
|
22630
22426
|
// src/components/WalletModal/index.tsx
|
|
22631
|
-
var
|
|
22427
|
+
var import_react39 = require("react");
|
|
22632
22428
|
var import_react_intl19 = require("react-intl");
|
|
22633
|
-
var
|
|
22429
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
22634
22430
|
function WalletConnectModal({
|
|
22635
22431
|
type,
|
|
22636
22432
|
methods: _methods,
|
|
@@ -22640,7 +22436,7 @@ function WalletConnectModal({
|
|
|
22640
22436
|
const { walletMap } = useWalletConfig();
|
|
22641
22437
|
const { bind, login } = useUserInfo();
|
|
22642
22438
|
const config = useAppConfig();
|
|
22643
|
-
const methods = (0,
|
|
22439
|
+
const methods = (0, import_react39.useMemo)(() => {
|
|
22644
22440
|
if (_methods) return _methods;
|
|
22645
22441
|
if (!config.platform) {
|
|
22646
22442
|
return [];
|
|
@@ -22648,13 +22444,13 @@ function WalletConnectModal({
|
|
|
22648
22444
|
const platform = config.platform.map((p) => p.toLowerCase());
|
|
22649
22445
|
return WALLET_METHODS.filter((m) => platform.includes(m));
|
|
22650
22446
|
}, [config.platform, _methods]);
|
|
22651
|
-
return /* @__PURE__ */ (0,
|
|
22447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
22652
22448
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
22653
22449
|
}, {
|
|
22654
22450
|
name: ""
|
|
22655
|
-
}), children: /* @__PURE__ */ (0,
|
|
22451
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "matchid-login-box", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "matchid-login-recommend-list", children: methods.map((method, index2) => {
|
|
22656
22452
|
const m = walletMap[method];
|
|
22657
|
-
return /* @__PURE__ */ (0,
|
|
22453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
22658
22454
|
RecommendItem,
|
|
22659
22455
|
{
|
|
22660
22456
|
icon: m?.icon,
|
|
@@ -22668,21 +22464,21 @@ function WalletConnectModal({
|
|
|
22668
22464
|
}) }) }) });
|
|
22669
22465
|
}
|
|
22670
22466
|
function WalletModal(props) {
|
|
22671
|
-
return props.isOpen && /* @__PURE__ */ (0,
|
|
22467
|
+
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(WalletConnectModal, { ...props });
|
|
22672
22468
|
}
|
|
22673
22469
|
|
|
22674
22470
|
// src/components/AlphaAvatar/index.tsx
|
|
22675
|
-
var
|
|
22676
|
-
var
|
|
22471
|
+
var import_react40 = require("react");
|
|
22472
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
22677
22473
|
function AlphaAvatar2({ name: name2, size = 40, className = "" }) {
|
|
22678
|
-
const [avatar, setAvatar] = (0,
|
|
22679
|
-
(0,
|
|
22474
|
+
const [avatar, setAvatar] = (0, import_react40.useState)(void 0);
|
|
22475
|
+
(0, import_react40.useEffect)(() => {
|
|
22680
22476
|
if (name2) {
|
|
22681
22477
|
const char = name2[0].toUpperCase();
|
|
22682
22478
|
setAvatar(char);
|
|
22683
22479
|
}
|
|
22684
22480
|
}, [name2]);
|
|
22685
|
-
return /* @__PURE__ */ (0,
|
|
22481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: `matchid-alpha-avatar ${className}`, style: {
|
|
22686
22482
|
width: size,
|
|
22687
22483
|
height: size,
|
|
22688
22484
|
fontSize: Math.ceil(size / 2)
|
|
@@ -22690,7 +22486,7 @@ function AlphaAvatar2({ name: name2, size = 40, className = "" }) {
|
|
|
22690
22486
|
}
|
|
22691
22487
|
|
|
22692
22488
|
// src/components/WalletAsset/index.tsx
|
|
22693
|
-
var
|
|
22489
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
22694
22490
|
function WalletAsset({
|
|
22695
22491
|
onAssetClick,
|
|
22696
22492
|
matchWalletAssetsOptions
|
|
@@ -22700,7 +22496,7 @@ function WalletAsset({
|
|
|
22700
22496
|
list: walletAssets.mergedAssets
|
|
22701
22497
|
});
|
|
22702
22498
|
const { list } = useMatchChain();
|
|
22703
|
-
return /* @__PURE__ */ (0,
|
|
22499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "matchid-wallet-asset-list", children: matchWalletAssetList.list.map((n, index2) => {
|
|
22704
22500
|
const clickFunc = onAssetClick && onAssetClick(n);
|
|
22705
22501
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
22706
22502
|
const getFooterColor = () => {
|
|
@@ -22715,11 +22511,11 @@ function WalletAsset({
|
|
|
22715
22511
|
}
|
|
22716
22512
|
return "";
|
|
22717
22513
|
};
|
|
22718
|
-
return /* @__PURE__ */ (0,
|
|
22514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `matchid-wallet-asset-item`, onClick: clickFunc, style: {
|
|
22719
22515
|
cursor: clickFunc ? "pointer" : "default"
|
|
22720
22516
|
}, children: [
|
|
22721
|
-
/* @__PURE__ */ (0,
|
|
22722
|
-
n.icon ? /* @__PURE__ */ (0,
|
|
22517
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "matchid-wallet-asset-logo", title: n.symbol || n.name || "", children: [
|
|
22518
|
+
n.icon ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("img", { src: n.icon, alt: n.symbol, className: `matchid-wallet-asset-icon` }) : /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22723
22519
|
AlphaAvatar2,
|
|
22724
22520
|
{
|
|
22725
22521
|
className: `matchid-wallet-asset-icon`,
|
|
@@ -22727,12 +22523,12 @@ function WalletAsset({
|
|
|
22727
22523
|
name: n.symbol || n.name || ""
|
|
22728
22524
|
}
|
|
22729
22525
|
),
|
|
22730
|
-
chain?.iconUrl && /* @__PURE__ */ (0,
|
|
22526
|
+
chain?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-wallet-asset-chain` })
|
|
22731
22527
|
] }),
|
|
22732
|
-
/* @__PURE__ */ (0,
|
|
22733
|
-
/* @__PURE__ */ (0,
|
|
22734
|
-
"price" in n && /* @__PURE__ */ (0,
|
|
22735
|
-
/* @__PURE__ */ (0,
|
|
22528
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `matchid-wallet-asset-info`, children: [
|
|
22529
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: `matchid-wallet-asset-name`, children: n.symbol }),
|
|
22530
|
+
"price" in n && /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `matchid-wallet-asset-content`, children: [
|
|
22531
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "matchid-wallet-asset-price", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22736
22532
|
NumberFormatter,
|
|
22737
22533
|
{
|
|
22738
22534
|
value: n.price,
|
|
@@ -22740,7 +22536,7 @@ function WalletAsset({
|
|
|
22740
22536
|
tFixNum: 2
|
|
22741
22537
|
}
|
|
22742
22538
|
) }),
|
|
22743
|
-
/* @__PURE__ */ (0,
|
|
22539
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "matchid-wallet-asset-value", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22744
22540
|
NumberFormatter,
|
|
22745
22541
|
{
|
|
22746
22542
|
value: n.value,
|
|
@@ -22749,15 +22545,15 @@ function WalletAsset({
|
|
|
22749
22545
|
}
|
|
22750
22546
|
) })
|
|
22751
22547
|
] }),
|
|
22752
|
-
/* @__PURE__ */ (0,
|
|
22753
|
-
/* @__PURE__ */ (0,
|
|
22548
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `matchid-wallet-asset-footer`, children: [
|
|
22549
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: `matchid-wallet-asset-balance`, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22754
22550
|
NumberFormatter,
|
|
22755
22551
|
{
|
|
22756
22552
|
value: n.balance,
|
|
22757
22553
|
tFixNum: 3
|
|
22758
22554
|
}
|
|
22759
22555
|
) }),
|
|
22760
|
-
"price_change_24h" in n && /* @__PURE__ */ (0,
|
|
22556
|
+
"price_change_24h" in n && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: `matchid-wallet-asset-change ${getFooterColor()}`, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
22761
22557
|
NumberFormatter,
|
|
22762
22558
|
{
|
|
22763
22559
|
prefix: `${(n?.price_change_24h || 0) < 0 ? "-" : "+"} `,
|
|
@@ -22773,10 +22569,10 @@ function WalletAsset({
|
|
|
22773
22569
|
}
|
|
22774
22570
|
|
|
22775
22571
|
// src/components/TokenSend/index.tsx
|
|
22776
|
-
var
|
|
22572
|
+
var import_react41 = require("react");
|
|
22777
22573
|
var import_viem15 = require("viem");
|
|
22778
22574
|
var import_react_intl20 = require("react-intl");
|
|
22779
|
-
var
|
|
22575
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
22780
22576
|
function Input2({
|
|
22781
22577
|
onChange,
|
|
22782
22578
|
placeholder,
|
|
@@ -22786,8 +22582,8 @@ function Input2({
|
|
|
22786
22582
|
error,
|
|
22787
22583
|
size = "df"
|
|
22788
22584
|
}) {
|
|
22789
|
-
return /* @__PURE__ */ (0,
|
|
22790
|
-
/* @__PURE__ */ (0,
|
|
22585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: `matchid-token-input-box ${"matchid-token-input-" + size}`, children: [
|
|
22586
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
22791
22587
|
"input",
|
|
22792
22588
|
{
|
|
22793
22589
|
placeholder,
|
|
@@ -22798,7 +22594,7 @@ function Input2({
|
|
|
22798
22594
|
className: `matchid-token-input ${error ? "matchid-token-input-error" : ""}`
|
|
22799
22595
|
}
|
|
22800
22596
|
),
|
|
22801
|
-
error && /* @__PURE__ */ (0,
|
|
22597
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "matchid-token-input-error-text", children: error })
|
|
22802
22598
|
] });
|
|
22803
22599
|
}
|
|
22804
22600
|
function TokenSend({
|
|
@@ -22811,22 +22607,22 @@ function TokenSend({
|
|
|
22811
22607
|
const intl = (0, import_react_intl20.useIntl)();
|
|
22812
22608
|
const { createWalletClient: createWalletClient2 } = useWallet();
|
|
22813
22609
|
const isNative = token.address.toLowerCase() == NATIVE_TOKEN_ADDRESS;
|
|
22814
|
-
const chain = (0,
|
|
22610
|
+
const chain = (0, import_react41.useMemo)(() => {
|
|
22815
22611
|
return chainList?.find((m) => m.id.toString() === token.chain_id);
|
|
22816
22612
|
}, [chainList, token.chain_id]);
|
|
22817
|
-
const walletClient = (0,
|
|
22613
|
+
const walletClient = (0, import_react41.useMemo)(() => {
|
|
22818
22614
|
return createWalletClient2({
|
|
22819
22615
|
// @ts-ignore
|
|
22820
22616
|
chain: (0, import_viem15.defineChain)(chain),
|
|
22821
22617
|
transport: (0, import_viem15.http)()
|
|
22822
22618
|
});
|
|
22823
22619
|
}, [chain]);
|
|
22824
|
-
const [amount, setAmount] = (0,
|
|
22825
|
-
const [address, setAddress] = (0,
|
|
22826
|
-
const [loading, setLoading] = (0,
|
|
22827
|
-
const [sending, setSending] = (0,
|
|
22828
|
-
const [txError, setTxError] = (0,
|
|
22829
|
-
const transaction = (0,
|
|
22620
|
+
const [amount, setAmount] = (0, import_react41.useState)("");
|
|
22621
|
+
const [address, setAddress] = (0, import_react41.useState)("");
|
|
22622
|
+
const [loading, setLoading] = (0, import_react41.useState)(false);
|
|
22623
|
+
const [sending, setSending] = (0, import_react41.useState)(false);
|
|
22624
|
+
const [txError, setTxError] = (0, import_react41.useState)("");
|
|
22625
|
+
const transaction = (0, import_react41.useMemo)(() => {
|
|
22830
22626
|
const reg = /^0x[a-fA-F0-9]{40}$/;
|
|
22831
22627
|
if (!amount || !address || !reg.test(address)) {
|
|
22832
22628
|
return;
|
|
@@ -22857,7 +22653,7 @@ function TokenSend({
|
|
|
22857
22653
|
setLoading(false);
|
|
22858
22654
|
}
|
|
22859
22655
|
};
|
|
22860
|
-
const error = (0,
|
|
22656
|
+
const error = (0, import_react41.useMemo)(() => {
|
|
22861
22657
|
setTxError("");
|
|
22862
22658
|
let amountError = "";
|
|
22863
22659
|
let addressError = "";
|
|
@@ -22900,7 +22696,7 @@ function TokenSend({
|
|
|
22900
22696
|
setAmount(value2);
|
|
22901
22697
|
}
|
|
22902
22698
|
};
|
|
22903
|
-
const canSend = (0,
|
|
22699
|
+
const canSend = (0, import_react41.useMemo)(() => {
|
|
22904
22700
|
return !error.amount && !error.address && amount && address;
|
|
22905
22701
|
}, [error]);
|
|
22906
22702
|
const onNext = async () => {
|
|
@@ -22910,7 +22706,7 @@ function TokenSend({
|
|
|
22910
22706
|
}
|
|
22911
22707
|
onClose();
|
|
22912
22708
|
};
|
|
22913
|
-
(0,
|
|
22709
|
+
(0, import_react41.useEffect)(() => {
|
|
22914
22710
|
const receiveMessage = (event) => {
|
|
22915
22711
|
if (event.data) {
|
|
22916
22712
|
if (event.data.source == "match-wallet") {
|
|
@@ -22926,24 +22722,24 @@ function TokenSend({
|
|
|
22926
22722
|
window.removeEventListener("message", receiveMessage);
|
|
22927
22723
|
};
|
|
22928
22724
|
}, []);
|
|
22929
|
-
return /* @__PURE__ */ (0,
|
|
22930
|
-
/* @__PURE__ */ (0,
|
|
22931
|
-
/* @__PURE__ */ (0,
|
|
22932
|
-
/* @__PURE__ */ (0,
|
|
22933
|
-
/* @__PURE__ */ (0,
|
|
22934
|
-
/* @__PURE__ */ (0,
|
|
22935
|
-
token.icon ? /* @__PURE__ */ (0,
|
|
22725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(ModalDrawer, { isOpen: true, onClose, zIndex, title: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_intl20.FormattedMessage, { id: "send" }), onBack, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: `matchid-token-send-box`, children: [
|
|
22726
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "matchid-token-send-content", children: [
|
|
22727
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: `matchid-token-amount-content`, children: [
|
|
22728
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: `matchid-token-amount-header`, children: [
|
|
22729
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: `matchid-token-amount-title`, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_intl20.FormattedMessage, { id: "amount" }) }),
|
|
22730
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: `matchid-token-amount-chain`, children: [
|
|
22731
|
+
token.icon ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
22936
22732
|
"img",
|
|
22937
22733
|
{
|
|
22938
22734
|
src: token?.icon,
|
|
22939
22735
|
alt: token?.symbol,
|
|
22940
22736
|
className: `matchid-token-amount-chain-icon`
|
|
22941
22737
|
}
|
|
22942
|
-
) : /* @__PURE__ */ (0,
|
|
22943
|
-
/* @__PURE__ */ (0,
|
|
22738
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(AlphaAvatar, { name: token.symbol || token.name || "", size: 16 }),
|
|
22739
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { children: token?.symbol })
|
|
22944
22740
|
] })
|
|
22945
22741
|
] }),
|
|
22946
|
-
/* @__PURE__ */ (0,
|
|
22742
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
22947
22743
|
Input2,
|
|
22948
22744
|
{
|
|
22949
22745
|
type: "text",
|
|
@@ -22956,18 +22752,18 @@ function TokenSend({
|
|
|
22956
22752
|
error: error.amount || txError
|
|
22957
22753
|
}
|
|
22958
22754
|
),
|
|
22959
|
-
/* @__PURE__ */ (0,
|
|
22960
|
-
/* @__PURE__ */ (0,
|
|
22961
|
-
/* @__PURE__ */ (0,
|
|
22755
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: `matchid-token-amount-footer`, children: [
|
|
22756
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: `matchid-token-amount-title`, children: [
|
|
22757
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_intl20.FormattedMessage, { id: "balance" }),
|
|
22962
22758
|
":"
|
|
22963
22759
|
] }),
|
|
22964
|
-
/* @__PURE__ */ (0,
|
|
22760
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: `matchid-token-amount-value`, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(NumberFormatter, { value: token.balance, tFixNum: 10, suffix: " " + token.symbol }) })
|
|
22965
22761
|
] }),
|
|
22966
|
-
/* @__PURE__ */ (0,
|
|
22762
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TransferIcon, { className: "matchid-token-amount-transfer" })
|
|
22967
22763
|
] }),
|
|
22968
|
-
/* @__PURE__ */ (0,
|
|
22969
|
-
/* @__PURE__ */ (0,
|
|
22970
|
-
/* @__PURE__ */ (0,
|
|
22764
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: `matchid-token-address-content`, children: [
|
|
22765
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: `matchid-token-address-header`, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: `matchid-token-address-title`, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_intl20.FormattedMessage, { id: "receiveTitle" }) }) }),
|
|
22766
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
22971
22767
|
Input2,
|
|
22972
22768
|
{
|
|
22973
22769
|
type: "text",
|
|
@@ -22983,7 +22779,7 @@ function TokenSend({
|
|
|
22983
22779
|
)
|
|
22984
22780
|
] })
|
|
22985
22781
|
] }),
|
|
22986
|
-
/* @__PURE__ */ (0,
|
|
22782
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
22987
22783
|
Button,
|
|
22988
22784
|
{
|
|
22989
22785
|
size: "lg",
|
|
@@ -22992,7 +22788,7 @@ function TokenSend({
|
|
|
22992
22788
|
disabled: !canSend || !!txError,
|
|
22993
22789
|
onClick: onNext,
|
|
22994
22790
|
loading: loading || sending,
|
|
22995
|
-
children: /* @__PURE__ */ (0,
|
|
22791
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_intl20.FormattedMessage, { id: "next" })
|
|
22996
22792
|
}
|
|
22997
22793
|
)
|
|
22998
22794
|
] }) });
|
|
@@ -23000,7 +22796,7 @@ function TokenSend({
|
|
|
23000
22796
|
|
|
23001
22797
|
// src/components/TokenDetail/index.tsx
|
|
23002
22798
|
var import_react_intl21 = require("react-intl");
|
|
23003
|
-
var
|
|
22799
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
23004
22800
|
function TokenDetail({
|
|
23005
22801
|
onClose,
|
|
23006
22802
|
token
|
|
@@ -23010,41 +22806,41 @@ function TokenDetail({
|
|
|
23010
22806
|
const chain = chainList?.find((m) => m.id.toString() === token.chain_id);
|
|
23011
22807
|
const onSend = () => {
|
|
23012
22808
|
modal.show((props) => {
|
|
23013
|
-
return /* @__PURE__ */ (0,
|
|
22809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TokenSend, { onClose: () => {
|
|
23014
22810
|
props.close();
|
|
23015
22811
|
onClose();
|
|
23016
22812
|
}, onBack: props.close, zIndex: props.zIndex, token });
|
|
23017
22813
|
});
|
|
23018
22814
|
};
|
|
23019
22815
|
const intl = (0, import_react_intl21.useIntl)();
|
|
23020
|
-
return /* @__PURE__ */ (0,
|
|
22816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ModalDrawer, { isOpen: true, title: intl.formatMessage({
|
|
23021
22817
|
id: "tokenDetails"
|
|
23022
|
-
}), onClose, children: /* @__PURE__ */ (0,
|
|
23023
|
-
/* @__PURE__ */ (0,
|
|
23024
|
-
/* @__PURE__ */ (0,
|
|
23025
|
-
/* @__PURE__ */ (0,
|
|
23026
|
-
token.icon ? /* @__PURE__ */ (0,
|
|
23027
|
-
chain?.iconUrl && /* @__PURE__ */ (0,
|
|
22818
|
+
}), onClose, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: `matchid-token-detail`, children: [
|
|
22819
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: `matchid-token-main`, children: [
|
|
22820
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: `matchid-token-info`, children: [
|
|
22821
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: `matchid-token-logo`, children: [
|
|
22822
|
+
token.icon ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("img", { src: token.icon, alt: token.symbol, className: `matchid-token-icon` }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(AlphaAvatar, { className: `matchid-token-icon`, size: 48, name: token.symbol || token.name || "" }),
|
|
22823
|
+
chain?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-token-chain` })
|
|
23028
22824
|
] }),
|
|
23029
|
-
/* @__PURE__ */ (0,
|
|
23030
|
-
/* @__PURE__ */ (0,
|
|
22825
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: `matchid-token-name`, children: [
|
|
22826
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(NumberFormatter, { value: token.balance, tFixNum: 10 }),
|
|
23031
22827
|
" ",
|
|
23032
22828
|
token.symbol
|
|
23033
22829
|
] })
|
|
23034
22830
|
] }),
|
|
23035
|
-
token.address.toLowerCase() != NATIVE_TOKEN_ADDRESS && /* @__PURE__ */ (0,
|
|
23036
|
-
/* @__PURE__ */ (0,
|
|
23037
|
-
/* @__PURE__ */ (0,
|
|
22831
|
+
token.address.toLowerCase() != NATIVE_TOKEN_ADDRESS && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: `matchid-token-contract`, children: [
|
|
22832
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "matchid-token-contract-title", children: "Contract address" }),
|
|
22833
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "matchid-token-contract-address", children: token.address })
|
|
23038
22834
|
] })
|
|
23039
22835
|
] }),
|
|
23040
|
-
/* @__PURE__ */ (0,
|
|
22836
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Button, { size: "lg", block: true, highlight: true, onClick: onSend, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react_intl21.FormattedMessage, { id: "send" }) })
|
|
23041
22837
|
] }) });
|
|
23042
22838
|
}
|
|
23043
22839
|
|
|
23044
22840
|
// src/components/TokenSendList/index.tsx
|
|
23045
|
-
var
|
|
22841
|
+
var import_react42 = require("react");
|
|
23046
22842
|
var import_react_intl22 = require("react-intl");
|
|
23047
|
-
var
|
|
22843
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
23048
22844
|
function TokenSendList({ close }) {
|
|
23049
22845
|
const isDownMd = useDownMd();
|
|
23050
22846
|
const walletAssets = useMatchWalletAssets();
|
|
@@ -23052,20 +22848,20 @@ function TokenSendList({ close }) {
|
|
|
23052
22848
|
list: walletAssets.mergedAssets
|
|
23053
22849
|
});
|
|
23054
22850
|
const { list } = useMatchChain();
|
|
23055
|
-
const [checked, setChecked] = (0,
|
|
22851
|
+
const [checked, setChecked] = (0, import_react42.useState)();
|
|
23056
22852
|
const modal = useModal();
|
|
23057
22853
|
const onNext = () => {
|
|
23058
22854
|
checked && modal.show((props) => {
|
|
23059
|
-
return /* @__PURE__ */ (0,
|
|
22855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TokenSend, { onClose: () => {
|
|
23060
22856
|
props.close();
|
|
23061
22857
|
close();
|
|
23062
22858
|
}, onBack: props.close, zIndex: props.zIndex, token: checked });
|
|
23063
22859
|
});
|
|
23064
22860
|
};
|
|
23065
|
-
return /* @__PURE__ */ (0,
|
|
23066
|
-
/* @__PURE__ */ (0,
|
|
22861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "matchid-token-send-list-box", children: [
|
|
22862
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "matchid-token-send-list", children: matchWalletAssetList.list.map((n, index2) => {
|
|
23067
22863
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
23068
|
-
return /* @__PURE__ */ (0,
|
|
22864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
23069
22865
|
"div",
|
|
23070
22866
|
{
|
|
23071
22867
|
className: `matchid-token-send-item ${checked?.address == n.address ? "matchid-token-send-chekced" : ""}`,
|
|
@@ -23073,10 +22869,10 @@ function TokenSendList({ close }) {
|
|
|
23073
22869
|
setChecked(n);
|
|
23074
22870
|
},
|
|
23075
22871
|
children: [
|
|
23076
|
-
/* @__PURE__ */ (0,
|
|
23077
|
-
/* @__PURE__ */ (0,
|
|
23078
|
-
/* @__PURE__ */ (0,
|
|
23079
|
-
n.icon ? /* @__PURE__ */ (0,
|
|
22872
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Radio, { checked: checked?.address == n.address, size: isDownMd ? 18 : 24 }),
|
|
22873
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "matchid-token-send-content", children: [
|
|
22874
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "matchid-token-send-logo", children: [
|
|
22875
|
+
n.icon ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("img", { src: n.icon, alt: n.symbol, className: `matchid-token-send-icon` }) : /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
23080
22876
|
AlphaAvatar2,
|
|
23081
22877
|
{
|
|
23082
22878
|
className: `matchid-token-send-icon`,
|
|
@@ -23084,7 +22880,7 @@ function TokenSendList({ close }) {
|
|
|
23084
22880
|
name: n.symbol || n.name || ""
|
|
23085
22881
|
}
|
|
23086
22882
|
),
|
|
23087
|
-
chain?.iconUrl && /* @__PURE__ */ (0,
|
|
22883
|
+
chain?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
23088
22884
|
"img",
|
|
23089
22885
|
{
|
|
23090
22886
|
src: chain.iconUrl,
|
|
@@ -23093,9 +22889,9 @@ function TokenSendList({ close }) {
|
|
|
23093
22889
|
}
|
|
23094
22890
|
)
|
|
23095
22891
|
] }),
|
|
23096
|
-
/* @__PURE__ */ (0,
|
|
23097
|
-
/* @__PURE__ */ (0,
|
|
23098
|
-
/* @__PURE__ */ (0,
|
|
22892
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: `matchid-token-send-info`, children: [
|
|
22893
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: `matchid-token-send-name`, children: n.symbol }),
|
|
22894
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: `matchid-token-send-balance`, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(NumberFormatter, { value: n.balance, tFixNum: 3 }) })
|
|
23099
22895
|
] })
|
|
23100
22896
|
] })
|
|
23101
22897
|
]
|
|
@@ -23103,24 +22899,24 @@ function TokenSendList({ close }) {
|
|
|
23103
22899
|
index2
|
|
23104
22900
|
);
|
|
23105
22901
|
}) }),
|
|
23106
|
-
/* @__PURE__ */ (0,
|
|
22902
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Button, { size: "lg", highlight: true, block: true, disabled: !checked, onClick: onNext, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react_intl22.FormattedMessage, { id: "next" }) })
|
|
23107
22903
|
] });
|
|
23108
22904
|
}
|
|
23109
22905
|
|
|
23110
22906
|
// src/components/TransactionList/index.tsx
|
|
23111
22907
|
var import_react_infinite_scroll_component = __toESM(require("react-infinite-scroll-component"));
|
|
23112
|
-
var
|
|
22908
|
+
var import_react43 = require("react");
|
|
23113
22909
|
var import_viem16 = require("viem");
|
|
23114
22910
|
var import_viem17 = require("viem");
|
|
23115
22911
|
var import_react_intl23 = require("react-intl");
|
|
23116
|
-
var
|
|
22912
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
23117
22913
|
var Item = ({ data: data2 }) => {
|
|
23118
22914
|
const { address } = useWallet();
|
|
23119
22915
|
const isOut = data2.from.toLowerCase() == address.toLowerCase();
|
|
23120
22916
|
const { chain, chainId, explorerLink, formatUnits: chainFormatUnits } = useMatchChain();
|
|
23121
22917
|
const { contracts } = useContractStore_default();
|
|
23122
|
-
const [shouldRefetch, setShouldRefetch] = (0,
|
|
23123
|
-
const transferType = (0,
|
|
22918
|
+
const [shouldRefetch, setShouldRefetch] = (0, import_react43.useState)(true);
|
|
22919
|
+
const transferType = (0, import_react43.useMemo)(() => {
|
|
23124
22920
|
const methodId = data2.input.substring(2, 10);
|
|
23125
22921
|
if (methodId == "095ea7b3") {
|
|
23126
22922
|
return "erc20_approve";
|
|
@@ -23130,7 +22926,7 @@ var Item = ({ data: data2 }) => {
|
|
|
23130
22926
|
}
|
|
23131
22927
|
return "unknown";
|
|
23132
22928
|
}, [data2.input]);
|
|
23133
|
-
const to = (0,
|
|
22929
|
+
const to = (0, import_react43.useMemo)(() => {
|
|
23134
22930
|
if (!isOut) {
|
|
23135
22931
|
return data2.from;
|
|
23136
22932
|
}
|
|
@@ -23143,7 +22939,7 @@ var Item = ({ data: data2 }) => {
|
|
|
23143
22939
|
}
|
|
23144
22940
|
return data2.to;
|
|
23145
22941
|
}, [data2.input, transferType, data2.to, isOut]);
|
|
23146
|
-
const amount = (0,
|
|
22942
|
+
const amount = (0, import_react43.useMemo)(() => {
|
|
23147
22943
|
if (transferType == "erc20_transfer") {
|
|
23148
22944
|
const decodeData = (0, import_viem16.decodeFunctionData)({
|
|
23149
22945
|
abi: import_viem17.erc20Abi,
|
|
@@ -23161,7 +22957,7 @@ var Item = ({ data: data2 }) => {
|
|
|
23161
22957
|
refetchInterval: shouldRefetch ? 3e3 : false,
|
|
23162
22958
|
enabled: shouldRefetch && data2.source == "local"
|
|
23163
22959
|
});
|
|
23164
|
-
const status = (0,
|
|
22960
|
+
const status = (0, import_react43.useMemo)(() => {
|
|
23165
22961
|
if (data2.source == "matchain") {
|
|
23166
22962
|
switch (data2.extra.status) {
|
|
23167
22963
|
case "ok":
|
|
@@ -23188,30 +22984,30 @@ var Item = ({ data: data2 }) => {
|
|
|
23188
22984
|
}
|
|
23189
22985
|
return "loading";
|
|
23190
22986
|
}, [data2.extra?.status, data2.source, hashQuery.data]);
|
|
23191
|
-
(0,
|
|
22987
|
+
(0, import_react43.useEffect)(() => {
|
|
23192
22988
|
if (data2.hash) {
|
|
23193
22989
|
setShouldRefetch(status == "loading");
|
|
23194
22990
|
}
|
|
23195
22991
|
}, [status, data2.hash]);
|
|
23196
|
-
const symbol = (0,
|
|
22992
|
+
const symbol = (0, import_react43.useMemo)(() => {
|
|
23197
22993
|
if (transferType == "erc20_transfer") {
|
|
23198
22994
|
const contract = contracts[`${chainId}-${data2.to.toLowerCase()}`];
|
|
23199
22995
|
return contract?.symbol || contract?.name || "unknown";
|
|
23200
22996
|
}
|
|
23201
22997
|
return chain?.nativeCurrency.symbol || chain?.nativeCurrency.name;
|
|
23202
22998
|
}, [transferType, chain, contracts, chainId, data2.to]);
|
|
23203
|
-
return /* @__PURE__ */ (0,
|
|
22999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
23204
23000
|
"a",
|
|
23205
23001
|
{
|
|
23206
23002
|
href: explorerLink(`tx/${data2.hash}`),
|
|
23207
23003
|
target: "_blank",
|
|
23208
23004
|
className: `matchid-transaction-item`,
|
|
23209
23005
|
children: [
|
|
23210
|
-
/* @__PURE__ */ (0,
|
|
23211
|
-
/* @__PURE__ */ (0,
|
|
23212
|
-
/* @__PURE__ */ (0,
|
|
23213
|
-
/* @__PURE__ */ (0,
|
|
23214
|
-
/* @__PURE__ */ (0,
|
|
23006
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: `matchid-transacton-item-container`, children: [
|
|
23007
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "matchid-transaction-item-icon", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(ArrowSendIcon, { className: !isOut ? "rotate-180" : "" }) }),
|
|
23008
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: `matchid-transaction-item-details`, children: [
|
|
23009
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: `matchid-transaction-item-address`, children: formatAddress(to, 6, 4) }),
|
|
23010
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
23215
23011
|
"div",
|
|
23216
23012
|
{
|
|
23217
23013
|
className: `matchid-transaction-item-timestamp`,
|
|
@@ -23220,11 +23016,11 @@ var Item = ({ data: data2 }) => {
|
|
|
23220
23016
|
)
|
|
23221
23017
|
] })
|
|
23222
23018
|
] }),
|
|
23223
|
-
/* @__PURE__ */ (0,
|
|
23224
|
-
/* @__PURE__ */ (0,
|
|
23225
|
-
status == "loading" && /* @__PURE__ */ (0,
|
|
23226
|
-
status == "success" && /* @__PURE__ */ (0,
|
|
23227
|
-
status == "error" && /* @__PURE__ */ (0,
|
|
23019
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: `matchid-transaction-item-amount ${"matchid-transaction-item-" + status}`, children: [
|
|
23020
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(NumberFormatter, { value: amount, tFixNum: 6, prefix: isOut ? "-" : "+", suffix: " " + symbol }),
|
|
23021
|
+
status == "loading" && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(LoadingIcon_default, { color: "#000000", size: 16, rotate: true }),
|
|
23022
|
+
status == "success" && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(CheckRoundIcon, { size: 16 }),
|
|
23023
|
+
status == "error" && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(InfoRoundIcon, { size: 16 })
|
|
23228
23024
|
] })
|
|
23229
23025
|
]
|
|
23230
23026
|
}
|
|
@@ -23234,19 +23030,19 @@ function TransactionList({
|
|
|
23234
23030
|
scrollableTarget
|
|
23235
23031
|
}) {
|
|
23236
23032
|
const { fetchMoreData, hasMore, items } = useMatchWalletRecords();
|
|
23237
|
-
return /* @__PURE__ */ (0,
|
|
23033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
23238
23034
|
import_react_infinite_scroll_component.default,
|
|
23239
23035
|
{
|
|
23240
23036
|
scrollableTarget,
|
|
23241
23037
|
dataLength: items.length,
|
|
23242
23038
|
next: fetchMoreData,
|
|
23243
23039
|
hasMore,
|
|
23244
|
-
loader: /* @__PURE__ */ (0,
|
|
23245
|
-
/* @__PURE__ */ (0,
|
|
23040
|
+
loader: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "matchid-list-nomore", children: [
|
|
23041
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(LoadingIcon_default, { rotate: true, size: 16, color: "black" }),
|
|
23246
23042
|
"Loading..."
|
|
23247
23043
|
] }),
|
|
23248
|
-
endMessage: items.length > 0 ? /* @__PURE__ */ (0,
|
|
23249
|
-
children: items.length == 0 && !hasMore ? /* @__PURE__ */ (0,
|
|
23044
|
+
endMessage: items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: `matchid-list-nomore`, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_intl23.FormattedMessage, { id: "noMoreRecords" }) }) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: `matchid-list-nomore`, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react_intl23.FormattedMessage, { id: "noRecords" }) }),
|
|
23045
|
+
children: items.length == 0 && !hasMore ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "mt-[150px]" }) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: `matchid-transaction-list`, children: items.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Item, { data: item }, index2)) })
|
|
23250
23046
|
}
|
|
23251
23047
|
);
|
|
23252
23048
|
}
|
|
@@ -23287,8 +23083,5 @@ lottie-web/build/player/lottie.js:
|
|
|
23287
23083
|
Contributions by leeoniya.
|
|
23288
23084
|
License: MIT, header required.
|
|
23289
23085
|
*)
|
|
23290
|
-
|
|
23291
|
-
lottie-react/build/index.es.js:
|
|
23292
|
-
(*! goToAndStop must be relative to the start of the current segment *)
|
|
23293
23086
|
*/
|
|
23294
23087
|
//# sourceMappingURL=components.js.map
|