@txgw/payout-components 0.5.0 → 0.5.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/{PdfViewer-CkCbEMbk.js → PdfViewer-BSKAHB-3.js} +4 -4
- package/dist/{PdfViewer-QGWa2XRE.js → PdfViewer-D1e7l2HR.js} +1 -1
- package/dist/{beneficiary-form-C7OkBCa1.js → beneficiary-form-CwXw0_MQ.js} +2 -2
- package/dist/index.js +38 -35
- package/dist/{mi18n-react.esm-kvYTdScN.js → mi18n-react.esm-DCefZ2Je.js} +8 -36
- package/package.json +1 -1
- package/dist/en-zI0pyZ-j.js +0 -9
- /package/dist/{__vite-browser-external-C1LsZvBw.js → __vite-browser-external-gYOOXead.js} +0 -0
|
@@ -3346,16 +3346,16 @@ if (isNodeJS) {
|
|
|
3346
3346
|
(async () => {
|
|
3347
3347
|
let t = await import(
|
|
3348
3348
|
/*webpackIgnore: true*/
|
|
3349
|
-
"./__vite-browser-external-
|
|
3349
|
+
"./__vite-browser-external-gYOOXead.js"
|
|
3350
3350
|
).then(__toDynamicImportESM(1)), n = await import(
|
|
3351
3351
|
/*webpackIgnore: true*/
|
|
3352
|
-
"./__vite-browser-external-
|
|
3352
|
+
"./__vite-browser-external-gYOOXead.js"
|
|
3353
3353
|
).then(__toDynamicImportESM(1)), i = await import(
|
|
3354
3354
|
/*webpackIgnore: true*/
|
|
3355
|
-
"./__vite-browser-external-
|
|
3355
|
+
"./__vite-browser-external-gYOOXead.js"
|
|
3356
3356
|
).then(__toDynamicImportESM(1)), a = await import(
|
|
3357
3357
|
/*webpackIgnore: true*/
|
|
3358
|
-
"./__vite-browser-external-
|
|
3358
|
+
"./__vite-browser-external-gYOOXead.js"
|
|
3359
3359
|
).then(__toDynamicImportESM(1));
|
|
3360
3360
|
return new Map(Object.entries({
|
|
3361
3361
|
fs: t,
|
|
@@ -6,7 +6,7 @@ import "./isEqual-B1XgbWvm.js";
|
|
|
6
6
|
import { Pi as resolveVariableAndFilter, Pn as autobind, ft as ScopedContext, it as Renderer, on as isApiOutdated, st as getGlobalOptions, yi as getVariable } from "./esm-D2d3zkde.js";
|
|
7
7
|
import "./react-dom-BvyPBEWo.js";
|
|
8
8
|
var import_react = /* @__PURE__ */ __toESM(require_react()), PdfView = import_react.lazy(function() {
|
|
9
|
-
return import("./PdfViewer-
|
|
9
|
+
return import("./PdfViewer-BSKAHB-3.js");
|
|
10
10
|
}), PdfViewer = function(e) {
|
|
11
11
|
__extends(c, e);
|
|
12
12
|
function c(c) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as __toESM, t as __commonJSMin } from "./chunk-BztcrWZM.js";
|
|
2
2
|
import { t as require_react } from "./react-D5VzucMe.js";
|
|
3
|
-
import { n as useTranslate, t as Mi18nProvider } from "./mi18n-react.esm-
|
|
3
|
+
import { n as useTranslate, t as Mi18nProvider } from "./mi18n-react.esm-DCefZ2Je.js";
|
|
4
4
|
import { a as __generator, c as __rest, i as __extends, n as __awaiter, o as __metadata, r as __decorate, s as __read, t as __assign, u as __spreadArray } from "./tslib.es6-DJiA3ePV.js";
|
|
5
5
|
import "./function-Dbcnxw2H.js";
|
|
6
6
|
import { t as require_isEqual } from "./isEqual-B1XgbWvm.js";
|
|
@@ -1667,7 +1667,7 @@ addSchemaFilter(function(e, t, n) {
|
|
|
1667
1667
|
}), registerRenderer({
|
|
1668
1668
|
type: "pdf-viewer",
|
|
1669
1669
|
getComponent: function() {
|
|
1670
|
-
return import("./PdfViewer-
|
|
1670
|
+
return import("./PdfViewer-D1e7l2HR.js");
|
|
1671
1671
|
}
|
|
1672
1672
|
}), registerRenderer({
|
|
1673
1673
|
type: "amis",
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { o as __toDynamicImportESM } from "./chunk-BztcrWZM.js";
|
|
2
2
|
import "./react-D5VzucMe.js";
|
|
3
|
-
import { a as LanguageDetector, c as getLanguageFromStorage, i as FormatSimple, o as LanguageStorage, r as
|
|
3
|
+
import { a as LanguageDetector, c as getLanguageFromStorage, i as FormatSimple, o as LanguageStorage, r as CdnBackend, s as Mi18n } from "./mi18n-react.esm-DCefZ2Je.js";
|
|
4
4
|
function mitt_default(e) {
|
|
5
5
|
return {
|
|
6
6
|
all: e ||= /* @__PURE__ */ new Map(),
|
|
7
|
-
on: function(
|
|
8
|
-
var
|
|
9
|
-
|
|
7
|
+
on: function(u, d) {
|
|
8
|
+
var f = e.get(u);
|
|
9
|
+
f ? f.push(d) : e.set(u, [d]);
|
|
10
10
|
},
|
|
11
|
-
off: function(
|
|
12
|
-
var
|
|
13
|
-
|
|
11
|
+
off: function(u, d) {
|
|
12
|
+
var f = e.get(u);
|
|
13
|
+
f && (d ? f.splice(f.indexOf(d) >>> 0, 1) : e.set(u, []));
|
|
14
14
|
},
|
|
15
|
-
emit: function(
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
e(
|
|
19
|
-
}), (
|
|
20
|
-
e(
|
|
15
|
+
emit: function(u, d) {
|
|
16
|
+
var f = e.get(u);
|
|
17
|
+
f && f.slice().map(function(e) {
|
|
18
|
+
e(d);
|
|
19
|
+
}), (f = e.get("*")) && f.slice().map(function(e) {
|
|
20
|
+
e(u, d);
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
};
|
|
@@ -29,41 +29,44 @@ var SDKComponent = class {
|
|
|
29
29
|
root;
|
|
30
30
|
emitter;
|
|
31
31
|
mi18n;
|
|
32
|
-
constructor(e,
|
|
33
|
-
this.loader = e, this.options =
|
|
32
|
+
constructor(e, u, d) {
|
|
33
|
+
this.loader = e, this.options = u, this.emitter = mitt_default(), this.mi18n = d, this.root = null;
|
|
34
34
|
}
|
|
35
|
-
async mount(
|
|
35
|
+
async mount(u) {
|
|
36
36
|
if (this.mounted) return;
|
|
37
|
-
let
|
|
38
|
-
|
|
37
|
+
let d = await this.loader(), f = d.default ?? d, p = await import("./react-DkmrFaDK.js").then(__toDynamicImportESM(1)), m = (await import("./client-EDjTjI3l.js").then(__toDynamicImportESM(1))).createRoot(u);
|
|
38
|
+
m.render(p.createElement(f, {
|
|
39
39
|
...this.options,
|
|
40
40
|
emitter: this.emitter,
|
|
41
41
|
mi18n: this.mi18n
|
|
42
|
-
})), this.root =
|
|
42
|
+
})), this.root = m, this.mounted = !0;
|
|
43
43
|
}
|
|
44
44
|
unmount() {
|
|
45
45
|
this.root &&= (this.root.unmount(), null), this.mounted = !1;
|
|
46
46
|
}
|
|
47
|
-
on(e,
|
|
48
|
-
return this.emitter.on(e,
|
|
47
|
+
on(e, u) {
|
|
48
|
+
return this.emitter.on(e, u);
|
|
49
49
|
}
|
|
50
|
-
off(e,
|
|
51
|
-
return this.emitter.off(e,
|
|
50
|
+
off(e, u) {
|
|
51
|
+
return this.emitter.off(e, u);
|
|
52
52
|
}
|
|
53
53
|
isMounted() {
|
|
54
54
|
return this.mounted;
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
const ElementsMap = { beneficiaryForm: () => import("./beneficiary-form-
|
|
58
|
-
var PROD_OPTIONS = { staticData: { en: () => import("./en-zI0pyZ-j.js") } };
|
|
57
|
+
const ElementsMap = { beneficiaryForm: () => import("./beneficiary-form-CwXw0_MQ.js") };
|
|
59
58
|
function createMi18n(e) {
|
|
60
|
-
return Mi18n().use(FormatSimple()).use(LanguageDetector()).use(LanguageStorage()).use(
|
|
59
|
+
return Mi18n().use(FormatSimple()).use(LanguageDetector()).use(LanguageStorage()).use(CdnBackend({
|
|
60
|
+
env: "release",
|
|
61
|
+
pathTemplate: `/i18n/project-export/{env}/{projectId}/{language}.json?t=${Date.now()}`
|
|
62
|
+
})).init({
|
|
61
63
|
language: getLanguageFromStorage() || e,
|
|
62
64
|
defaultLanguage: e,
|
|
63
65
|
fallbackLanguage: "en",
|
|
64
66
|
availableLanguages: ["en"],
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
apiUrl: "https://admin.midasbuy.com/i18n/api",
|
|
68
|
+
apiKey: "********************",
|
|
69
|
+
projectId: 358
|
|
67
70
|
});
|
|
68
71
|
}
|
|
69
72
|
var SDKComponentsManager = class {
|
|
@@ -73,21 +76,21 @@ var SDKComponentsManager = class {
|
|
|
73
76
|
constructor(e) {
|
|
74
77
|
this.options = e, this.mi18n = createMi18n(this.options?.locale || "en");
|
|
75
78
|
}
|
|
76
|
-
createElement(e,
|
|
79
|
+
createElement(e, u) {
|
|
77
80
|
if (!this.options) throw Error("[payout-sdk] options are not initialized");
|
|
78
|
-
let
|
|
79
|
-
if (!
|
|
80
|
-
return this.components[e] || (this.components[e] = new SDKComponent(
|
|
81
|
+
let d = ElementsMap[e];
|
|
82
|
+
if (!d) throw Error(`[payout-sdk] component ${e} not found`);
|
|
83
|
+
return this.components[e] || (this.components[e] = new SDKComponent(d, {
|
|
81
84
|
...this.options,
|
|
82
|
-
...
|
|
85
|
+
...u
|
|
83
86
|
}, this.mi18n)), this.components[e];
|
|
84
87
|
}
|
|
85
88
|
}, manager = null;
|
|
86
89
|
function init(e) {
|
|
87
90
|
manager = new SDKComponentsManager(e);
|
|
88
91
|
}
|
|
89
|
-
function createElement(e,
|
|
92
|
+
function createElement(e, u) {
|
|
90
93
|
if (!manager) throw Error("[payout-sdk] SDK is not initialized");
|
|
91
|
-
return manager.createElement(e,
|
|
94
|
+
return manager.createElement(e, u);
|
|
92
95
|
}
|
|
93
96
|
export { createElement, init };
|
|
@@ -906,47 +906,19 @@ function throwIfSSR(e) {
|
|
|
906
906
|
if (isSSR()) throw Error(`${e}: Can't run on the server`);
|
|
907
907
|
}
|
|
908
908
|
RegExp(`([${["", ""].join("")}]{9})+`, "gu");
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
}
|
|
915
|
-
function arrayBufferToString(e) {
|
|
916
|
-
let S = new Uint8Array(e), C = S.length, w = "", T = 2 ** 16 - 1;
|
|
917
|
-
for (let e = 0; e < C; e += T) e + T > C && (T = C - e), w += String.fromCharCode.apply(null, S.subarray(e, e + T));
|
|
918
|
-
return w;
|
|
919
|
-
}
|
|
920
|
-
function base32Decode(e) {
|
|
921
|
-
e = e.toUpperCase();
|
|
922
|
-
let S = e.length, C = 0, w = 0, T = 0, E = new Uint8Array(S * 5 / 8 | 0);
|
|
923
|
-
for (let D = 0; D < S; D++) w = w << 5 | readChar(e[D]), C += 5, C >= 8 && (E[T++] = w >>> C - 8 & 255, C -= 8);
|
|
924
|
-
return arrayBufferToString(E.buffer);
|
|
925
|
-
}
|
|
926
|
-
function getProjectIdFromApiKey(e) {
|
|
927
|
-
if (e) try {
|
|
928
|
-
let [S, C] = e.split("_");
|
|
929
|
-
if (S === "tgpak") {
|
|
930
|
-
let [e] = base32Decode(C).split("_");
|
|
931
|
-
return Number(e);
|
|
932
|
-
}
|
|
933
|
-
} catch {
|
|
934
|
-
console.warn("Mi18n: Api key can't be parsed");
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
function createDevBackend() {
|
|
938
|
-
return { getRecord({ apiUrl: e, apiKey: S, projectId: C, language: w, fetch: T, namespace: E }) {
|
|
939
|
-
let D = getProjectIdFromApiKey(S) ?? C, O = D === void 0 ? `${e}/v2/projects/translations/${w}` : `${e}/v2/projects/${D}/translations/${w}`;
|
|
940
|
-
return E && (O += `?ns=${E}`), T(O, { headers: {
|
|
941
|
-
"X-API-Key": S || "",
|
|
909
|
+
function createCdnBackend(e) {
|
|
910
|
+
let S = e?.host || "pagedoo.midasbuy.com", C = e?.pathTemplate || "/i18n/project-export/{env}/{projectId}/{language}.json", w = e?.env || "release";
|
|
911
|
+
return { getRecord({ language: e, fetch: T, projectId: E, apiKey: D }) {
|
|
912
|
+
return T(`https://${S}${C.replace("{projectId}", `${E}`).replace("{language}", e).replace("{env}", w)}`, { headers: {
|
|
913
|
+
"X-API-Key": D || "",
|
|
942
914
|
"Content-Type": "application/json"
|
|
943
915
|
} }).then((e) => {
|
|
944
|
-
if (e.ok) return e.json()
|
|
916
|
+
if (e.ok) return e.json();
|
|
945
917
|
throw Error(e.statusText);
|
|
946
918
|
});
|
|
947
919
|
} };
|
|
948
920
|
}
|
|
949
|
-
var
|
|
921
|
+
var CdnBackend = (e) => (S, C) => (C.setDevBackend(createCdnBackend(e)), S);
|
|
950
922
|
function listen(e, S) {
|
|
951
923
|
let C = (C) => {
|
|
952
924
|
e.includes(C.data?.type) && S(C.data?.data);
|
|
@@ -1155,4 +1127,4 @@ var useMi18nContext = () => {
|
|
|
1155
1127
|
isLoading: w
|
|
1156
1128
|
};
|
|
1157
1129
|
};
|
|
1158
|
-
export { LanguageDetector as a, getLanguageFromStorage as c, FormatSimple as i, useTranslate as n, LanguageStorage as o,
|
|
1130
|
+
export { LanguageDetector as a, getLanguageFromStorage as c, FormatSimple as i, useTranslate as n, LanguageStorage as o, CdnBackend as r, Mi18n as s, Mi18nProvider as t };
|
package/package.json
CHANGED
package/dist/en-zI0pyZ-j.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const en = { beneficiaryForm: {
|
|
2
|
-
title: "Bank Details",
|
|
3
|
-
regionInputLabel: "Bank Location",
|
|
4
|
-
payoutTypeInputLabel: "Bank account type",
|
|
5
|
-
currencyInputLabel: "Account currency",
|
|
6
|
-
paymentMethodInputLabel: "Transfer method"
|
|
7
|
-
} };
|
|
8
|
-
var en_default = { en };
|
|
9
|
-
export { en_default as default, en };
|
|
File without changes
|