@txgw/payout-components 0.1.7 → 0.2.1
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/{amis-bclZq1Od.js → amis-CjYQbrSm.js} +26 -26
- package/dist/component-beneficiary-form-DIpi8Ma-.js +370 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.js +7 -7
- package/dist/{vendor-C7cpyYhi.js → vendor-fKhExfo_.js} +61941 -60584
- package/package.json +2 -1
- package/dist/component-beneficiary-form-BFa6ZStw.js +0 -326
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __extends, l as __assign, n as __values, o as hooks, u as upperFirst, q as padStart, r as capitalize, t as escape, v as truncate, w as uniqBy, x as uniqWith, y as isEqual, z as get, A as isPlainObject, B as __awaiter, C as __generator, D as __read, E as __spreadArray, F as toFixed, G as groupBy, H as uniq, I as transform, J as template, K as isEmpty$2, L as startsWith, M as endsWith, N as isString, O as isObject$1, P as qs, Q as merge, S as isNaN$1, T as matchSorter, U as isNumber, V as isObservableArray, W as isObservable, X as compile, Y as last, Z as isAlive, $ as find, a0 as findIndex$1, a1 as types, a2 as getEnv, a3 as destroy, a4 as React__default, a5 as observer, a6 as reactDomExports, a7 as __decorate, a8 as observable, a9 as __metadata, aa as action, ab as reactExports, ac as cx, ad as autorun, ae as __rest, af as omit, ag as cloneDeep, ah as memoize, ai as findLastIndex, aj as flow, ak as debounce, al as throttle, am as flatten, an as pick, ao as toPairs, ap as getParent, aq as sortBy, ar as FileSaver_minExports, as as isEqualWith, at as reaction, au as addDisposer, av as setLivelinessChecking, aw as hoistNonReactStatic, ax as values, ay as InView, az as map, aA as kebabCase, aB as ReactDOM, aC as useRootClose, aD as Portal, aE as chunk, aF as mapValues, aG as camelCase, aH as uncontrollable$1, aI as toJS, aJ as CSSTransition, aK as difference$1, aL as reactIsExports, aM as keycode, aN as ENTERING, aO as ENTERED, aP as EXITING, aQ as Transition, aR as cjsExports, aS as EXITED, aT as isFunction, aU as Downshift$1, aV as extend, aW as each, aX as Sortable, aY as propTypesExports, aZ as comparer, a_ as range$1, a$ as keys, b0 as index$2, b1 as forEach, b2 as times, b3 as isInteger, b4 as intersectionWith, b5 as unionWith, b6 as includes, b7 as getMiniDecimal, b8 as InputNumber$1, b9 as getNumberPrecision, ba as chain, bb as intersection, bc as useForm, bd as FormProvider, be as Controller$1, bf as intersectionBy, bg as compact, bh as Circle, bi as useFieldArray, bj as useFormContext, bk as useFormState, bl as Draggable, bm as Item$1, bn as SubMenu$2, bo as MenuItemGroup, bp as Divider$2, bq as ExportMenu, br as SmoothSignature, bs as xor, bt as hotkeys, bu as getSnapshot, bv as observer$1, bw as useInView, bx as Dropzone, by as isNil, bz as accepts, bA as ErrorCode, bB as tinymce, bC as Froala, bD as omitBy, bE as pickBy, bF as partition, bG as inRange, bH as clone, bI as union, bJ as cjsExports$1, bK as assign, bL as libExports, bM as num2str, bN as update, bO as d, bP as SketchPicker, bQ as GithubPicker, bR as JsBarcode, bS as markdownIt, bT as libExports$1, bU as Document, bV as Page$2, bW as __webpack_exports__GlobalWorkerOptions } from "./vendor-
|
|
1
|
+
import { _ as __extends, l as __assign, n as __values, o as hooks, u as upperFirst, q as padStart, r as capitalize, t as escape, v as truncate, w as uniqBy, x as uniqWith, y as isEqual, z as get, A as isPlainObject, B as __awaiter, C as __generator, D as __read, E as __spreadArray, F as toFixed, G as groupBy, H as uniq, I as transform, J as template, K as isEmpty$2, L as startsWith, M as endsWith, N as isString, O as isObject$1, P as qs, Q as merge, S as isNaN$1, T as matchSorter, U as isNumber, V as isObservableArray, W as isObservable, X as compile, Y as last, Z as isAlive, $ as find, a0 as findIndex$1, a1 as types, a2 as getEnv, a3 as destroy, a4 as React__default, a5 as observer, a6 as reactDomExports, a7 as __decorate, a8 as observable, a9 as __metadata, aa as action, ab as reactExports, ac as cx, ad as autorun, ae as __rest, af as omit, ag as cloneDeep, ah as memoize, ai as findLastIndex, aj as flow, ak as debounce, al as throttle, am as flatten, an as pick, ao as toPairs, ap as getParent, aq as sortBy, ar as FileSaver_minExports, as as isEqualWith, at as reaction, au as addDisposer, av as setLivelinessChecking, aw as hoistNonReactStatic, ax as values, ay as InView, az as map, aA as kebabCase, aB as ReactDOM, aC as useRootClose, aD as Portal, aE as chunk, aF as mapValues, aG as camelCase, aH as uncontrollable$1, aI as toJS, aJ as CSSTransition, aK as difference$1, aL as reactIsExports, aM as keycode, aN as ENTERING, aO as ENTERED, aP as EXITING, aQ as Transition, aR as cjsExports, aS as EXITED, aT as isFunction, aU as Downshift$1, aV as extend, aW as each, aX as Sortable, aY as propTypesExports, aZ as comparer, a_ as range$1, a$ as keys, b0 as index$2, b1 as forEach, b2 as times, b3 as isInteger, b4 as intersectionWith, b5 as unionWith, b6 as includes, b7 as getMiniDecimal, b8 as InputNumber$1, b9 as getNumberPrecision, ba as chain, bb as intersection, bc as useForm, bd as FormProvider, be as Controller$1, bf as intersectionBy, bg as compact, bh as Circle, bi as useFieldArray, bj as useFormContext, bk as useFormState, bl as Draggable, bm as Item$1, bn as SubMenu$2, bo as MenuItemGroup, bp as Divider$2, bq as ExportMenu, br as SmoothSignature, bs as xor, bt as hotkeys, bu as getSnapshot, bv as observer$1, bw as useInView, bx as Dropzone, by as isNil, bz as accepts, bA as ErrorCode, bB as tinymce, bC as Froala, bD as omitBy, bE as pickBy, bF as partition, bG as inRange, bH as clone, bI as union, bJ as cjsExports$1, bK as assign, bL as libExports, bM as num2str, bN as update, bO as d, bP as SketchPicker, bQ as GithubPicker, bR as JsBarcode, bS as markdownIt, bT as libExports$1, bU as Document, bV as Page$2, bW as __webpack_exports__GlobalWorkerOptions } from "./vendor-fKhExfo_.js";
|
|
2
2
|
var FormulaEvalError = (
|
|
3
3
|
/** @class */
|
|
4
4
|
(function(i) {
|
|
@@ -5245,7 +5245,7 @@ function position(i, a) {
|
|
|
5245
5245
|
});
|
|
5246
5246
|
}
|
|
5247
5247
|
var JsonView$1 = React__default.lazy(function() {
|
|
5248
|
-
return import("./vendor-
|
|
5248
|
+
return import("./vendor-fKhExfo_.js").then((i) => i.m).then(importLazyComponent);
|
|
5249
5249
|
});
|
|
5250
5250
|
(function() {
|
|
5251
5251
|
function i() {
|
|
@@ -9808,7 +9808,7 @@ var Column$2 = types.model("Column", {
|
|
|
9808
9808
|
];
|
|
9809
9809
|
Array.isArray(O.data) ? R = O.data : R = O.data.rows || O.data.items, F.label = 2;
|
|
9810
9810
|
case 2:
|
|
9811
|
-
return import("./vendor-
|
|
9811
|
+
return import("./vendor-fKhExfo_.js").then((k) => k.p).then(function(k) {
|
|
9812
9812
|
var M, D, P = [];
|
|
9813
9813
|
try {
|
|
9814
9814
|
for (var L = __values(R), U = L.next(); !U.done; U = L.next()) {
|
|
@@ -27143,7 +27143,7 @@ var Editor$1 = (
|
|
|
27143
27143
|
return this.container;
|
|
27144
27144
|
}, a.prototype.loadMonaco = function() {
|
|
27145
27145
|
var e = this;
|
|
27146
|
-
window.__amis_monaco_editor_locale = this.props.locale, import("./vendor-
|
|
27146
|
+
window.__amis_monaco_editor_locale = this.props.locale, import("./vendor-fKhExfo_.js").then((t) => t.c5).then(function(t) {
|
|
27147
27147
|
return e.initMonaco(t);
|
|
27148
27148
|
});
|
|
27149
27149
|
}, a.prototype.initMonaco = function(e) {
|
|
@@ -36057,17 +36057,17 @@ var FuncList$1 = themeable(FuncList), CodeMirrorEditor = (
|
|
|
36057
36057
|
return __generator(this, function(u) {
|
|
36058
36058
|
switch (u.label) {
|
|
36059
36059
|
case 0:
|
|
36060
|
-
return [4, import("./vendor-
|
|
36060
|
+
return [4, import("./vendor-fKhExfo_.js").then((c) => c.a)];
|
|
36061
36061
|
case 1:
|
|
36062
|
-
return s = u.sent().default, [4, import("./vendor-
|
|
36062
|
+
return s = u.sent().default, [4, import("./vendor-fKhExfo_.js").then((c) => c.j)];
|
|
36063
36063
|
case 2:
|
|
36064
|
-
return u.sent(), [4, import("./vendor-
|
|
36064
|
+
return u.sent(), [4, import("./vendor-fKhExfo_.js").then((c) => c.h)];
|
|
36065
36065
|
case 3:
|
|
36066
|
-
return u.sent(), [4, import("./vendor-
|
|
36066
|
+
return u.sent(), [4, import("./vendor-fKhExfo_.js").then((c) => c.s)];
|
|
36067
36067
|
case 4:
|
|
36068
|
-
return u.sent(), [4, import("./vendor-
|
|
36068
|
+
return u.sent(), [4, import("./vendor-fKhExfo_.js").then((c) => c.b)];
|
|
36069
36069
|
case 5:
|
|
36070
|
-
return u.sent(), [4, import("./vendor-
|
|
36070
|
+
return u.sent(), [4, import("./vendor-fKhExfo_.js").then((c) => c.d)];
|
|
36071
36071
|
case 6:
|
|
36072
36072
|
return u.sent(), this.unmounted ? [
|
|
36073
36073
|
2
|
|
@@ -49447,7 +49447,7 @@ var VCell = observer$1(function(a) {
|
|
|
49447
49447
|
return l ? s("exportExcel", __assign(__assign({ label: o("CRUD.exportExcel") }, e), { type: "button" }), {
|
|
49448
49448
|
loading: r.exportExcelLoading,
|
|
49449
49449
|
onAction: function() {
|
|
49450
|
-
r.update({ exportExcelLoading: !0 }), import("./vendor-
|
|
49450
|
+
r.update({ exportExcelLoading: !0 }), import("./vendor-fKhExfo_.js").then((u) => u.e).then(function(u) {
|
|
49451
49451
|
return __awaiter(t, void 0, void 0, function() {
|
|
49452
49452
|
var c, p;
|
|
49453
49453
|
return __generator(this, function(f) {
|
|
@@ -49480,7 +49480,7 @@ var VCell = observer$1(function(a) {
|
|
|
49480
49480
|
var t = this, n = this.props, r = n.store, o = n.translate, s = n.render, l = r.filteredColumns || [];
|
|
49481
49481
|
return l ? s("exportExcelTemplate", __assign(__assign({ label: o("CRUD.exportExcelTemplate") }, e), { type: "button" }), {
|
|
49482
49482
|
onAction: function() {
|
|
49483
|
-
import("./vendor-
|
|
49483
|
+
import("./vendor-fKhExfo_.js").then((u) => u.e).then(function(u) {
|
|
49484
49484
|
return __awaiter(t, void 0, void 0, function() {
|
|
49485
49485
|
var c, p;
|
|
49486
49486
|
return __generator(this, function(f) {
|
|
@@ -52761,7 +52761,7 @@ const Image$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
52761
52761
|
imagePlaceholder
|
|
52762
52762
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
52763
52763
|
var Cropper = React__default.lazy(function() {
|
|
52764
|
-
return import("./vendor-
|
|
52764
|
+
return import("./vendor-fKhExfo_.js").then((i) => i.c6);
|
|
52765
52765
|
}), preventEvent = function(i) {
|
|
52766
52766
|
return i.stopPropagation();
|
|
52767
52767
|
};
|
|
@@ -73715,7 +73715,7 @@ var ExcelControl = (
|
|
|
73715
73715
|
}, v.readAsArrayBuffer(e);
|
|
73716
73716
|
})];
|
|
73717
73717
|
case 2:
|
|
73718
|
-
return r = f.sent(), o = e.name.toLowerCase().endsWith(".xls"), s = void 0, o ? [4, import("./vendor-
|
|
73718
|
+
return r = f.sent(), o = e.name.toLowerCase().endsWith(".xls"), s = void 0, o ? [4, import("./vendor-fKhExfo_.js").then((h) => h.c7)] : [3, 4];
|
|
73719
73719
|
case 3:
|
|
73720
73720
|
return l = f.sent(), u = l.read(new Uint8Array(r), {
|
|
73721
73721
|
cellDates: !0
|
|
@@ -73747,7 +73747,7 @@ var ExcelControl = (
|
|
|
73747
73747
|
case 0:
|
|
73748
73748
|
n = this.props, r = n.allSheets, o = n.parseImage, s = n.plainText, l = n.translate, v.label = 1;
|
|
73749
73749
|
case 1:
|
|
73750
|
-
return v.trys.push([1, 4, , 5]), [4, import("./vendor-
|
|
73750
|
+
return v.trys.push([1, 4, , 5]), [4, import("./vendor-fKhExfo_.js").then((_) => _.e)];
|
|
73751
73751
|
case 2:
|
|
73752
73752
|
return u = v.sent().default, this.ExcelJS = u, c = new u.Workbook(), p = typeof e == "string" ? new Uint8Array(e.split("").map(function(_) {
|
|
73753
73753
|
return _.charCodeAt(0);
|
|
@@ -80704,7 +80704,7 @@ const Status = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
80704
80704
|
StatusFieldRenderer
|
|
80705
80705
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
80706
80706
|
var JsonView = React__default.lazy(function() {
|
|
80707
|
-
return import("./vendor-
|
|
80707
|
+
return import("./vendor-fKhExfo_.js").then((i) => i.m).then(importLazyComponent);
|
|
80708
80708
|
}), JSONField = (
|
|
80709
80709
|
/** @class */
|
|
80710
80710
|
(function(i) {
|
|
@@ -81664,14 +81664,14 @@ var Chart = (
|
|
|
81664
81664
|
r.data;
|
|
81665
81665
|
var p = this.props, f = p.mapURL, h = p.mapName, m = this.props.onChartMount || this.onChartMount;
|
|
81666
81666
|
e ? Promise.all([
|
|
81667
|
-
import("./vendor-
|
|
81668
|
-
import("./vendor-
|
|
81667
|
+
import("./vendor-fKhExfo_.js").then((v) => v.c8),
|
|
81668
|
+
import("./vendor-fKhExfo_.js").then((v) => v.i),
|
|
81669
81669
|
// @ts-ignore 官方没提供 type
|
|
81670
|
-
import("./vendor-
|
|
81670
|
+
import("./vendor-fKhExfo_.js").then((v) => v.c9),
|
|
81671
81671
|
// @ts-ignore 官方没提供 type
|
|
81672
|
-
import("./vendor-
|
|
81672
|
+
import("./vendor-fKhExfo_.js").then((v) => v.ca),
|
|
81673
81673
|
// @ts-ignore 官方没提供 type
|
|
81674
|
-
import("./vendor-
|
|
81674
|
+
import("./vendor-fKhExfo_.js").then((v) => v.f)
|
|
81675
81675
|
]).then(function(v) {
|
|
81676
81676
|
var _ = __read(v, 2), g = _[0], b = _[1];
|
|
81677
81677
|
return __awaiter(t, void 0, void 0, function() {
|
|
@@ -82628,7 +82628,7 @@ var str2seconds = function(i) {
|
|
|
82628
82628
|
this.mpegtsPlayer && (this.mpegtsPlayer.destroy(), (t = (e = this.props).setError) === null || t === void 0 || t.call(e, ""));
|
|
82629
82629
|
}, a.prototype.initFlv = function(e) {
|
|
82630
82630
|
var t = this, n = e.video, r = e.manager, o = e.src, s = e.isLive, l = e.config, u = e.actions, c = e.setError, p = e.autoPlay;
|
|
82631
|
-
import("./vendor-
|
|
82631
|
+
import("./vendor-fKhExfo_.js").then((f) => f.g).then(function(f) {
|
|
82632
82632
|
n = n || r.video && r.video.video;
|
|
82633
82633
|
var h = f.createPlayer({
|
|
82634
82634
|
type: "flv",
|
|
@@ -82688,7 +82688,7 @@ var str2seconds = function(i) {
|
|
|
82688
82688
|
}));
|
|
82689
82689
|
}, a.prototype.initHls = function(e) {
|
|
82690
82690
|
var t = this, n = e.video, r = e.manager, o = e.src, s = e.autoPlay, l = e.actions;
|
|
82691
|
-
import("./vendor-
|
|
82691
|
+
import("./vendor-fKhExfo_.js").then((u) => u.k).then(function(u) {
|
|
82692
82692
|
var c = u.default;
|
|
82693
82693
|
if (c.isSupported()) {
|
|
82694
82694
|
n = n || r.video && r.video.video;
|
|
@@ -86122,7 +86122,7 @@ var Code = (
|
|
|
86122
86122
|
return anyChanged(a.propsList, this.props, e) || this.resolveLanguage(this.props) !== this.resolveLanguage(e) || getPropValue(this.props) !== getPropValue(e);
|
|
86123
86123
|
}, a.prototype.componentDidMount = function() {
|
|
86124
86124
|
var e = this;
|
|
86125
|
-
import("./vendor-
|
|
86125
|
+
import("./vendor-fKhExfo_.js").then((t) => t.c5).then(function(t) {
|
|
86126
86126
|
return e.handleMonaco(t);
|
|
86127
86127
|
});
|
|
86128
86128
|
}, a.prototype.componentDidUpdate = function(e) {
|
|
@@ -88141,7 +88141,7 @@ var OfficeViewer = (
|
|
|
88141
88141
|
return __awaiter(this, void 0, void 0, function() {
|
|
88142
88142
|
var e, t, n = this;
|
|
88143
88143
|
return __generator(this, function(r) {
|
|
88144
|
-
return e = this.props, e.wordOptions, e.excelOptions, e.env, e.src, e.data, t = e.display, e.translate, this.document ? (import("./vendor-
|
|
88144
|
+
return e = this.props, e.wordOptions, e.excelOptions, e.env, e.src, e.data, t = e.display, e.translate, this.document ? (import("./vendor-fKhExfo_.js").then((o) => o.cb).then(function(o) {
|
|
88145
88145
|
return __awaiter(n, void 0, void 0, function() {
|
|
88146
88146
|
var s, l, u;
|
|
88147
88147
|
return __generator(this, function(c) {
|
|
@@ -88179,7 +88179,7 @@ var OfficeViewer = (
|
|
|
88179
88179
|
var l = new FileReader();
|
|
88180
88180
|
l.onload = function(u) {
|
|
88181
88181
|
var c = l.result;
|
|
88182
|
-
import("./vendor-
|
|
88182
|
+
import("./vendor-fKhExfo_.js").then((p) => p.cb).then(function(p) {
|
|
88183
88183
|
return __awaiter(e, void 0, void 0, function() {
|
|
88184
88184
|
var f, h, m;
|
|
88185
88185
|
return __generator(this, function(v) {
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import { bX as d, bY as B, ab as c, bZ as N, b_ as F, b$ as q, c0 as z, c1 as $, c2 as D, c3 as J } from "./vendor-fKhExfo_.js";
|
|
2
|
+
import { t as Y, d as K, r as M, T as W } from "./amis-CjYQbrSm.js";
|
|
3
|
+
const Q = "bankDetails";
|
|
4
|
+
async function b(t, n, o, u = 1) {
|
|
5
|
+
if (u < 0)
|
|
6
|
+
throw new Error("[payout-sdk] fetchWithAuth retries exceeded");
|
|
7
|
+
const { headers: s, authCode: m, domain: l, codeVerifier: y } = o, p = localStorage.getItem("access_token");
|
|
8
|
+
if (p)
|
|
9
|
+
n.access_token = p;
|
|
10
|
+
else {
|
|
11
|
+
const e = await j(
|
|
12
|
+
m,
|
|
13
|
+
l,
|
|
14
|
+
y
|
|
15
|
+
);
|
|
16
|
+
if (!e.access_token || !e.refresh_token)
|
|
17
|
+
throw localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), new Error(
|
|
18
|
+
"[payout-sdk] getAccessToken failed, check authCode validity"
|
|
19
|
+
);
|
|
20
|
+
n.access_token = e.access_token, localStorage.setItem("access_token", e.access_token), localStorage.setItem("refresh_token", e.refresh_token);
|
|
21
|
+
}
|
|
22
|
+
const g = await fetch(t, {
|
|
23
|
+
...o,
|
|
24
|
+
body: JSON.stringify(n),
|
|
25
|
+
headers: {
|
|
26
|
+
...s,
|
|
27
|
+
"Content-Type": "application/json"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
if (g.status === 400) {
|
|
31
|
+
const e = await g.json();
|
|
32
|
+
if (e.name != "INTERNAL_ERROR")
|
|
33
|
+
throw Y.error(`${e.name}: ${e.message}`), new Error(`[payout-sdk] ${e.name}: ${e.message}`);
|
|
34
|
+
const k = localStorage.getItem("refresh_token");
|
|
35
|
+
if (k) {
|
|
36
|
+
const _ = await U(
|
|
37
|
+
k,
|
|
38
|
+
l
|
|
39
|
+
);
|
|
40
|
+
if (!_.access_token || !_.refresh_token)
|
|
41
|
+
localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token");
|
|
42
|
+
else
|
|
43
|
+
return localStorage.setItem(
|
|
44
|
+
"refresh_token",
|
|
45
|
+
_.refresh_token
|
|
46
|
+
), localStorage.setItem("access_token", _.access_token), b(t, n, o, --u);
|
|
47
|
+
}
|
|
48
|
+
const f = await j(
|
|
49
|
+
m,
|
|
50
|
+
l,
|
|
51
|
+
y
|
|
52
|
+
);
|
|
53
|
+
if (!f.access_token || !f.refresh_token)
|
|
54
|
+
throw new Error(
|
|
55
|
+
"[payout-sdk] getAccessToken failed, check authCode validity"
|
|
56
|
+
);
|
|
57
|
+
return localStorage.setItem("refresh_token", f.refresh_token), localStorage.setItem("access_token", f.access_token), b(t, n, o, --u);
|
|
58
|
+
}
|
|
59
|
+
return g;
|
|
60
|
+
}
|
|
61
|
+
async function j(t, n, o) {
|
|
62
|
+
const u = {
|
|
63
|
+
authorization_code: t,
|
|
64
|
+
code_verifier: o
|
|
65
|
+
};
|
|
66
|
+
return await (await fetch(`${n}/v1/payout/auth/token`, {
|
|
67
|
+
method: "POST",
|
|
68
|
+
body: JSON.stringify(u),
|
|
69
|
+
headers: {
|
|
70
|
+
"Content-Type": "application/json"
|
|
71
|
+
}
|
|
72
|
+
})).json();
|
|
73
|
+
}
|
|
74
|
+
async function U(t, n) {
|
|
75
|
+
const o = {
|
|
76
|
+
refresh_token: t
|
|
77
|
+
};
|
|
78
|
+
return await (await fetch(`${n}/v1/payout/auth/token/refresh`, {
|
|
79
|
+
method: "POST",
|
|
80
|
+
body: JSON.stringify(o),
|
|
81
|
+
headers: {
|
|
82
|
+
"Content-Type": "application/json"
|
|
83
|
+
}
|
|
84
|
+
})).json();
|
|
85
|
+
}
|
|
86
|
+
function E(t) {
|
|
87
|
+
return t && t.startsWith("zh") ? "zh_CN" : "en_US";
|
|
88
|
+
}
|
|
89
|
+
async function H(t, n, o) {
|
|
90
|
+
return (await (await b(
|
|
91
|
+
"/v1/payout/beneficiary/token/countryinfos",
|
|
92
|
+
{},
|
|
93
|
+
{
|
|
94
|
+
method: "POST",
|
|
95
|
+
authCode: t,
|
|
96
|
+
domain: n,
|
|
97
|
+
codeVerifier: o
|
|
98
|
+
}
|
|
99
|
+
)).json()).country_infos || [];
|
|
100
|
+
}
|
|
101
|
+
async function X(t, n, o, u) {
|
|
102
|
+
return await (await b(
|
|
103
|
+
"/v1/payout/beneficiary/token/paymentmethodinfos",
|
|
104
|
+
{
|
|
105
|
+
region_code: t
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
method: "POST",
|
|
109
|
+
authCode: n,
|
|
110
|
+
domain: o,
|
|
111
|
+
codeVerifier: u
|
|
112
|
+
}
|
|
113
|
+
)).json();
|
|
114
|
+
}
|
|
115
|
+
function Z({ inputPayoutType: t, inputCurrency: n }, o, u, s) {
|
|
116
|
+
const m = [];
|
|
117
|
+
for (const l of Object.values(o.countries)) {
|
|
118
|
+
const y = l.payoutTypes?.[t]?.currencies;
|
|
119
|
+
if (y)
|
|
120
|
+
for (const [p, g] of Object.entries(y))
|
|
121
|
+
p === n && m.push(g);
|
|
122
|
+
}
|
|
123
|
+
if (m.length !== 0)
|
|
124
|
+
return {
|
|
125
|
+
type: "list-select",
|
|
126
|
+
name: "inputPaymentMethod",
|
|
127
|
+
label: u("paymentMethodInputLabel", "Transfer method"),
|
|
128
|
+
options: m.map((l) => ({
|
|
129
|
+
value: l.payment_method,
|
|
130
|
+
body: /* @__PURE__ */ d.jsxs("div", { children: [
|
|
131
|
+
/* @__PURE__ */ d.jsx("span", { className: "flex font-bold", children: l.display_name }),
|
|
132
|
+
/* @__PURE__ */ d.jsx("span", { className: "flex mt-1", children: l.description })
|
|
133
|
+
] })
|
|
134
|
+
})),
|
|
135
|
+
value: s?.payment_method
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
async function G({
|
|
139
|
+
inputRegionCode: t,
|
|
140
|
+
inputCurrency: n,
|
|
141
|
+
inputPaymentMethod: o
|
|
142
|
+
}, u, s, m) {
|
|
143
|
+
const p = await (await b(
|
|
144
|
+
"/v1/payout/beneficiary/form/schema/token/query",
|
|
145
|
+
{
|
|
146
|
+
payment_method: o,
|
|
147
|
+
region: t,
|
|
148
|
+
currency: n,
|
|
149
|
+
local_clearing_system: "",
|
|
150
|
+
version: "v1",
|
|
151
|
+
entity_type: "ENTITY_TYPE_PERSONAL"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
method: "POST",
|
|
155
|
+
authCode: u,
|
|
156
|
+
domain: s,
|
|
157
|
+
codeVerifier: m
|
|
158
|
+
}
|
|
159
|
+
)).json();
|
|
160
|
+
return JSON.parse(
|
|
161
|
+
p.beneficiary_schema.amis_page.replace(/Area Code/g, "AREA_CODE")
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
function V({
|
|
165
|
+
authCode: t,
|
|
166
|
+
domain: n,
|
|
167
|
+
codeVerifier: o,
|
|
168
|
+
emitter: u,
|
|
169
|
+
defaultValues: s,
|
|
170
|
+
customizations: m,
|
|
171
|
+
locale: l
|
|
172
|
+
}) {
|
|
173
|
+
const { t: y } = B("beneficiaryForm"), [p, g] = c.useState([]), [e, k] = c.useState(), [f, _] = c.useState(), [S, C] = c.useState(), [T, O] = c.useState(), v = c.useMemo(() => !m?.layout?.find(
|
|
174
|
+
(r) => r.name === Q
|
|
175
|
+
)?.hidden, [m?.layout]), I = c.useCallback(
|
|
176
|
+
(a) => {
|
|
177
|
+
const r = a.body.findIndex(
|
|
178
|
+
(h) => h.type === "form"
|
|
179
|
+
), i = a.body[r];
|
|
180
|
+
a.body[r].onFinished = (h) => {
|
|
181
|
+
const L = K(i.api.data, h, void 0, !0);
|
|
182
|
+
u.emit("submit", L.value);
|
|
183
|
+
}, O(a);
|
|
184
|
+
},
|
|
185
|
+
[u]
|
|
186
|
+
), w = c.useMemo(() => {
|
|
187
|
+
const a = /* @__PURE__ */ new Set();
|
|
188
|
+
return p.filter(
|
|
189
|
+
(i) => i.country_number && !a.has(i.country_number) && a.add(i.country_number)
|
|
190
|
+
).map((i) => ({
|
|
191
|
+
label: i.country_name_standard || i.country_name,
|
|
192
|
+
value: i.country_code
|
|
193
|
+
})).sort((i, h) => i.label.localeCompare(h.label));
|
|
194
|
+
}, [p]), [P, x] = c.useState();
|
|
195
|
+
c.useEffect(() => {
|
|
196
|
+
if (!e?.inputRegionCode || !e?.inputPayoutType) return;
|
|
197
|
+
const a = e.inputRegionCode;
|
|
198
|
+
X(a, t, n, o).then(
|
|
199
|
+
(r) => {
|
|
200
|
+
_(r);
|
|
201
|
+
const i = Object.keys(
|
|
202
|
+
r.countries?.[a].payoutTypes?.[e.inputPayoutType]?.currencies
|
|
203
|
+
);
|
|
204
|
+
i && i.length > 0 && x(
|
|
205
|
+
i.map((h) => ({
|
|
206
|
+
label: h,
|
|
207
|
+
value: h
|
|
208
|
+
}))
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}, [
|
|
213
|
+
t,
|
|
214
|
+
o,
|
|
215
|
+
n,
|
|
216
|
+
e?.inputPayoutType,
|
|
217
|
+
e?.inputRegionCode
|
|
218
|
+
]);
|
|
219
|
+
const R = c.useMemo(() => Array.from(
|
|
220
|
+
new Set(p.map((r) => r.currency_code))
|
|
221
|
+
).map((r) => ({
|
|
222
|
+
label: r,
|
|
223
|
+
value: r
|
|
224
|
+
})).filter((r) => !!r.label && r.label !== "-").sort((r, i) => r.label.localeCompare(i.label)), [p]);
|
|
225
|
+
c.useEffect(() => {
|
|
226
|
+
if (!f || !e) return;
|
|
227
|
+
const a = Z(
|
|
228
|
+
{
|
|
229
|
+
inputPayoutType: e.inputPayoutType,
|
|
230
|
+
inputCurrency: e.inputCurrency
|
|
231
|
+
},
|
|
232
|
+
f,
|
|
233
|
+
y,
|
|
234
|
+
s
|
|
235
|
+
);
|
|
236
|
+
C(a);
|
|
237
|
+
}, [s, e, f, y]), c.useEffect(() => {
|
|
238
|
+
p.length !== 0 && S && e?.inputPaymentMethod && e?.inputRegionCode && e?.inputCurrency && G(
|
|
239
|
+
{
|
|
240
|
+
inputPaymentMethod: e.inputPaymentMethod,
|
|
241
|
+
inputRegionCode: e.inputRegionCode,
|
|
242
|
+
inputCurrency: e.inputCurrency
|
|
243
|
+
},
|
|
244
|
+
t,
|
|
245
|
+
n,
|
|
246
|
+
o
|
|
247
|
+
).then((a) => a && I(a));
|
|
248
|
+
}, [
|
|
249
|
+
p,
|
|
250
|
+
S,
|
|
251
|
+
t,
|
|
252
|
+
n,
|
|
253
|
+
o,
|
|
254
|
+
e?.inputPaymentMethod,
|
|
255
|
+
e?.inputRegionCode,
|
|
256
|
+
e?.inputCurrency,
|
|
257
|
+
I
|
|
258
|
+
]), c.useEffect(() => {
|
|
259
|
+
e?.inputCurrency || C(void 0);
|
|
260
|
+
}, [e?.inputCurrency]), c.useEffect(() => {
|
|
261
|
+
s && k({
|
|
262
|
+
inputPayoutType: s.payout_type || "B2P",
|
|
263
|
+
inputPaymentMethod: s.payment_method,
|
|
264
|
+
inputRegionCode: s.region_code,
|
|
265
|
+
inputCurrency: s.currency
|
|
266
|
+
});
|
|
267
|
+
}, [s]);
|
|
268
|
+
const A = c.useMemo(
|
|
269
|
+
() => ({
|
|
270
|
+
type: "page",
|
|
271
|
+
visible: v,
|
|
272
|
+
body: {
|
|
273
|
+
type: "spinner",
|
|
274
|
+
show: p.length === 0,
|
|
275
|
+
overlay: !0,
|
|
276
|
+
body: [
|
|
277
|
+
{
|
|
278
|
+
type: "form",
|
|
279
|
+
title: y("title", "Bank Details"),
|
|
280
|
+
submitText: "",
|
|
281
|
+
onChange: (a) => {
|
|
282
|
+
k(a);
|
|
283
|
+
},
|
|
284
|
+
body: [
|
|
285
|
+
{
|
|
286
|
+
label: y("regionInputLabel", "Bank Location"),
|
|
287
|
+
type: "input-text",
|
|
288
|
+
creatable: !1,
|
|
289
|
+
name: "inputRegionCode",
|
|
290
|
+
options: w,
|
|
291
|
+
value: s?.region_code
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
label: y("payoutTypeInputLabel", "Bank account type"),
|
|
295
|
+
type: "radios",
|
|
296
|
+
name: "inputPayoutType",
|
|
297
|
+
selectFirst: !0,
|
|
298
|
+
options: [
|
|
299
|
+
{
|
|
300
|
+
label: "Individual",
|
|
301
|
+
value: "B2P"
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
value: s?.payout_type
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
label: y("currencyInputLabel", "Account currency"),
|
|
308
|
+
type: "input-text",
|
|
309
|
+
creatable: !1,
|
|
310
|
+
name: "inputCurrency",
|
|
311
|
+
options: P || R,
|
|
312
|
+
value: s?.currency
|
|
313
|
+
},
|
|
314
|
+
S
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
}),
|
|
320
|
+
[
|
|
321
|
+
v,
|
|
322
|
+
p.length,
|
|
323
|
+
y,
|
|
324
|
+
w,
|
|
325
|
+
s?.region_code,
|
|
326
|
+
s?.payout_type,
|
|
327
|
+
s?.currency,
|
|
328
|
+
P,
|
|
329
|
+
R,
|
|
330
|
+
S
|
|
331
|
+
]
|
|
332
|
+
);
|
|
333
|
+
return c.useEffect(() => {
|
|
334
|
+
async function a() {
|
|
335
|
+
const r = await H(
|
|
336
|
+
t,
|
|
337
|
+
n,
|
|
338
|
+
o
|
|
339
|
+
);
|
|
340
|
+
g(r);
|
|
341
|
+
}
|
|
342
|
+
a();
|
|
343
|
+
}, [t, o, n]), /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
344
|
+
/* @__PURE__ */ d.jsx(W, {}),
|
|
345
|
+
M(A, {
|
|
346
|
+
locale: E(l)
|
|
347
|
+
}),
|
|
348
|
+
T && M(T, {
|
|
349
|
+
locale: E(l)
|
|
350
|
+
})
|
|
351
|
+
] });
|
|
352
|
+
}
|
|
353
|
+
function ne(t) {
|
|
354
|
+
const { locale: n = "en" } = t, o = c.useMemo(
|
|
355
|
+
() => N().use(F()).use(q()).use(z()).use($()).init({
|
|
356
|
+
language: D() || n,
|
|
357
|
+
defaultLanguage: n,
|
|
358
|
+
fallbackLanguage: "en",
|
|
359
|
+
availableLanguages: ["en", "zh-Hant", "ar", "ja", "th", "tr", "zh"],
|
|
360
|
+
apiUrl: "https://admin.midasbuy.com/i18n/api",
|
|
361
|
+
apiKey: "tgpak_gm2tqxzygnpvsokipayuqz2yhb4hszcvkzsq",
|
|
362
|
+
projectId: 181
|
|
363
|
+
}),
|
|
364
|
+
[n]
|
|
365
|
+
);
|
|
366
|
+
return /* @__PURE__ */ d.jsx(J, { mi18n: o, fallback: "Loading...", children: /* @__PURE__ */ d.jsx(V, { ...t }) });
|
|
367
|
+
}
|
|
368
|
+
export {
|
|
369
|
+
ne as default
|
|
370
|
+
};
|