@wise/dynamic-flow-client 3.6.1 → 3.7.0
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/build/main.js +925 -1309
- package/build/main.min.js +1 -1
- package/build/main.mjs +247 -631
- package/build/types/revamp/domain/components/StepDomainComponent.d.ts +7 -1
- package/build/types/revamp/renderers/step/BackButton.d.ts +3 -0
- package/build/types/revamp/renderers/stepComponentToProps.d.ts +1 -1
- package/build/types/revamp/renderers/types.d.ts +4 -1
- package/package.json +5 -5
package/build/main.mjs
CHANGED
|
@@ -34,9 +34,6 @@ var __objRest = (source, exclude) => {
|
|
|
34
34
|
}
|
|
35
35
|
return target;
|
|
36
36
|
};
|
|
37
|
-
var __esm = (fn, res) => function __init() {
|
|
38
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
39
|
-
};
|
|
40
37
|
var __commonJS = (cb, mod) => function __require() {
|
|
41
38
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
42
39
|
};
|
|
@@ -118,152 +115,6 @@ var require_classnames = __commonJS({
|
|
|
118
115
|
}
|
|
119
116
|
});
|
|
120
117
|
|
|
121
|
-
// ../../node_modules/.pnpm/clsx@2.0.0/node_modules/clsx/dist/clsx.mjs
|
|
122
|
-
function r(e) {
|
|
123
|
-
var t, f, n = "";
|
|
124
|
-
if ("string" == typeof e || "number" == typeof e)
|
|
125
|
-
n += e;
|
|
126
|
-
else if ("object" == typeof e)
|
|
127
|
-
if (Array.isArray(e))
|
|
128
|
-
for (t = 0; t < e.length; t++)
|
|
129
|
-
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
130
|
-
else
|
|
131
|
-
for (t in e)
|
|
132
|
-
e[t] && (n && (n += " "), n += t);
|
|
133
|
-
return n;
|
|
134
|
-
}
|
|
135
|
-
function clsx() {
|
|
136
|
-
for (var e, t, f = 0, n = ""; f < arguments.length; )
|
|
137
|
-
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
138
|
-
return n;
|
|
139
|
-
}
|
|
140
|
-
var init_clsx = __esm({
|
|
141
|
-
"../../node_modules/.pnpm/clsx@2.0.0/node_modules/clsx/dist/clsx.mjs"() {
|
|
142
|
-
"use strict";
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// ../../node_modules/.pnpm/@wise+art@2.10.0_@transferwise+neptune-css@14.9.6_@types+react@18.0.29_react-dom@18.2.0_react@18.2.0/node_modules/@wise/art/dist/index-d9418379.esm.js
|
|
147
|
-
import { useState as useState5, useEffect as useEffect3, forwardRef, Suspense, lazy } from "react";
|
|
148
|
-
import { jsx as jsx20, jsxs as jsxs6, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
149
|
-
var unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
|
|
150
|
-
var init_index_d9418379_esm = __esm({
|
|
151
|
-
"../../node_modules/.pnpm/@wise+art@2.10.0_@transferwise+neptune-css@14.9.6_@types+react@18.0.29_react-dom@18.2.0_react@18.2.0/node_modules/@wise/art/dist/index-d9418379.esm.js"() {
|
|
152
|
-
"use strict";
|
|
153
|
-
init_clsx();
|
|
154
|
-
unknownFlagName = "wise";
|
|
155
|
-
Flag = ({
|
|
156
|
-
code,
|
|
157
|
-
intrinsicSize = 64,
|
|
158
|
-
className = void 0
|
|
159
|
-
}) => {
|
|
160
|
-
const [fallback, setFallback] = useState5(null);
|
|
161
|
-
useEffect3(() => {
|
|
162
|
-
setFallback(null);
|
|
163
|
-
}, [code]);
|
|
164
|
-
const detailed = intrinsicSize >= 150;
|
|
165
|
-
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
166
|
-
return /* @__PURE__ */ jsx20("img", {
|
|
167
|
-
className: clsx(`wds-flag wds-flag-${name}`, className),
|
|
168
|
-
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
169
|
-
alt: "",
|
|
170
|
-
width: intrinsicSize,
|
|
171
|
-
height: intrinsicSize,
|
|
172
|
-
onError: () => {
|
|
173
|
-
setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
(function(Sizes2) {
|
|
178
|
-
Sizes2["SMALL"] = "small";
|
|
179
|
-
Sizes2["MEDIUM"] = "medium";
|
|
180
|
-
Sizes2["LARGE"] = "large";
|
|
181
|
-
})(Sizes || (Sizes = {}));
|
|
182
|
-
ImageSizes = {
|
|
183
|
-
[Sizes.SMALL]: 200,
|
|
184
|
-
[Sizes.MEDIUM]: 300,
|
|
185
|
-
[Sizes.LARGE]: 500
|
|
186
|
-
};
|
|
187
|
-
imageSizes = {
|
|
188
|
-
[Sizes.SMALL]: 200,
|
|
189
|
-
[Sizes.MEDIUM]: 300,
|
|
190
|
-
[Sizes.LARGE]: 500
|
|
191
|
-
};
|
|
192
|
-
(function(Assets2) {
|
|
193
|
-
Assets2["BELL"] = "bell";
|
|
194
|
-
Assets2["BRIEFCASE"] = "briefcase";
|
|
195
|
-
Assets2["BUSINESS_CARD"] = "business-card";
|
|
196
|
-
Assets2["CALENDAR"] = "calendar";
|
|
197
|
-
Assets2["CHECK_MARK"] = "check-mark";
|
|
198
|
-
Assets2["CLOSED_WINDOW"] = "closed-window";
|
|
199
|
-
Assets2["COIN_PILE_DOWN"] = "coin-pile-down";
|
|
200
|
-
Assets2["COIN_PILE_UP"] = "coin-pile-up";
|
|
201
|
-
Assets2["CONFETTI"] = "confetti";
|
|
202
|
-
Assets2["CONSTRUCTION_FENCE"] = "construction-fence";
|
|
203
|
-
Assets2["CONVERT"] = "convert";
|
|
204
|
-
Assets2["COOKIE"] = "cookie";
|
|
205
|
-
Assets2["DIGITAL_CARD_2"] = "digital-card-2";
|
|
206
|
-
Assets2["DIGITAL_CARD"] = "digital-card";
|
|
207
|
-
Assets2["DOCUMENTS"] = "documents";
|
|
208
|
-
Assets2["DOOR"] = "door";
|
|
209
|
-
Assets2["ECO_CARD"] = "eco-card";
|
|
210
|
-
Assets2["ELECTRIC_PLUG"] = "electric-plug";
|
|
211
|
-
Assets2["EMAIL_SUCCESS"] = "email-success";
|
|
212
|
-
Assets2["EMAIL"] = "email";
|
|
213
|
-
Assets2["EXCLAMATION_MARK"] = "exclamation-mark";
|
|
214
|
-
Assets2["FLAG"] = "flag";
|
|
215
|
-
Assets2["FLOWER"] = "flower";
|
|
216
|
-
Assets2["GEAR"] = "gear";
|
|
217
|
-
Assets2["GLOBE"] = "globe";
|
|
218
|
-
Assets2["GRAPH"] = "graph";
|
|
219
|
-
Assets2["HEART_2"] = "heart-2";
|
|
220
|
-
Assets2["HEART_3"] = "heart-3";
|
|
221
|
-
Assets2["HEART_4"] = "heart-4";
|
|
222
|
-
Assets2["HEART_5"] = "heart-5";
|
|
223
|
-
Assets2["HEART"] = "heart";
|
|
224
|
-
Assets2["HOUSE"] = "house";
|
|
225
|
-
Assets2["ID_CARD"] = "id-card";
|
|
226
|
-
Assets2["INFINITE"] = "infinite";
|
|
227
|
-
Assets2["INVITE_LETTER"] = "invite-letter";
|
|
228
|
-
Assets2["JARS"] = "jars";
|
|
229
|
-
Assets2["KEY"] = "key";
|
|
230
|
-
Assets2["LIGHT_BULB"] = "light-bulb";
|
|
231
|
-
Assets2["LOCK"] = "lock";
|
|
232
|
-
Assets2["MAGNIFYING_GLASS"] = "magnifying-glass";
|
|
233
|
-
Assets2["MAP"] = "map";
|
|
234
|
-
Assets2["MARBLE_CARD_BUSINESS"] = "marble-card-business";
|
|
235
|
-
Assets2["MARBLE_CARD"] = "marble-card";
|
|
236
|
-
Assets2["MARBLE"] = "marble";
|
|
237
|
-
Assets2["MEGAPHONE"] = "megaphone";
|
|
238
|
-
Assets2["MULTI_CURRENCY"] = "multi-currency";
|
|
239
|
-
Assets2["ONE_INVITE_LETTER_OPENED"] = "one-invite-letter-opened";
|
|
240
|
-
Assets2["PALM_TREE"] = "palm-tree";
|
|
241
|
-
Assets2["PERCENTAGE"] = "percentage";
|
|
242
|
-
Assets2["PERSONAL_CARD"] = "personal-card";
|
|
243
|
-
Assets2["PHONES"] = "phones";
|
|
244
|
-
Assets2["PIE_CHART"] = "pie-chart";
|
|
245
|
-
Assets2["PLANE_2"] = "plane-2";
|
|
246
|
-
Assets2["PLANE"] = "plane";
|
|
247
|
-
Assets2["PUZZLE_PIECES"] = "puzzle-pieces";
|
|
248
|
-
Assets2["QUESTION_MARK"] = "question-mark";
|
|
249
|
-
Assets2["RECEIVE"] = "receive";
|
|
250
|
-
Assets2["REMINDER_LETTER"] = "reminder-letter";
|
|
251
|
-
Assets2["SAND_TIMER"] = "sand-timer";
|
|
252
|
-
Assets2["SHOPPING_BAG"] = "shopping-bag";
|
|
253
|
-
Assets2["SKIP_AUTHENTICATION"] = "skip-authentication";
|
|
254
|
-
Assets2["SPEECH_BUBBLE"] = "speech-bubble";
|
|
255
|
-
Assets2["TOOL"] = "tool";
|
|
256
|
-
Assets2["TWO_INVITE_LETTERS_OPENED"] = "two-invite-letters-opened";
|
|
257
|
-
Assets2["WALLET"] = "wallet";
|
|
258
|
-
})(Assets || (Assets = {}));
|
|
259
|
-
(function(RenderMode2) {
|
|
260
|
-
RenderMode2[RenderMode2["INIT"] = 0] = "INIT";
|
|
261
|
-
RenderMode2[RenderMode2["FALLBACK"] = 1] = "FALLBACK";
|
|
262
|
-
RenderMode2[RenderMode2["ASSET_3D"] = 2] = "ASSET_3D";
|
|
263
|
-
})(RenderMode || (RenderMode = {}));
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
|
|
267
118
|
// ../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js
|
|
268
119
|
var require_screenfull = __commonJS({
|
|
269
120
|
"../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js"(exports, module) {
|
|
@@ -1787,212 +1638,124 @@ import { Alert } from "@transferwise/components";
|
|
|
1787
1638
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
1788
1639
|
import { Avatar, AvatarType } from "@transferwise/components";
|
|
1789
1640
|
|
|
1641
|
+
// ../../node_modules/.pnpm/@wise+art@2.7.0_react-dom@18.2.0_react@18.2.0/node_modules/@wise/art/dist/index.esm.js
|
|
1642
|
+
import { useState as useState3, useEffect as useEffect2, forwardRef } from "react";
|
|
1643
|
+
import { jsx as jsx6, jsxs, Fragment } from "react/jsx-runtime";
|
|
1644
|
+
var unknownFlagName = "wise";
|
|
1645
|
+
var Flag = ({
|
|
1646
|
+
code,
|
|
1647
|
+
intrinsicSize = 64
|
|
1648
|
+
}) => {
|
|
1649
|
+
const [fallback, setFallback] = useState3(null);
|
|
1650
|
+
useEffect2(() => {
|
|
1651
|
+
setFallback(null);
|
|
1652
|
+
}, [code]);
|
|
1653
|
+
const detailed = intrinsicSize >= 150;
|
|
1654
|
+
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
1655
|
+
return /* @__PURE__ */ jsx6("img", {
|
|
1656
|
+
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
1657
|
+
alt: "",
|
|
1658
|
+
width: intrinsicSize,
|
|
1659
|
+
height: intrinsicSize,
|
|
1660
|
+
onError: () => {
|
|
1661
|
+
setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
|
|
1662
|
+
}
|
|
1663
|
+
});
|
|
1664
|
+
};
|
|
1665
|
+
var Sizes;
|
|
1666
|
+
(function(Sizes2) {
|
|
1667
|
+
Sizes2["SMALL"] = "small";
|
|
1668
|
+
Sizes2["MEDIUM"] = "medium";
|
|
1669
|
+
Sizes2["LARGE"] = "large";
|
|
1670
|
+
})(Sizes || (Sizes = {}));
|
|
1671
|
+
var imageSizes = {
|
|
1672
|
+
[Sizes.SMALL]: 200,
|
|
1673
|
+
[Sizes.MEDIUM]: 300,
|
|
1674
|
+
[Sizes.LARGE]: 500
|
|
1675
|
+
};
|
|
1676
|
+
var Assets;
|
|
1677
|
+
(function(Assets2) {
|
|
1678
|
+
Assets2["BELL"] = "bell";
|
|
1679
|
+
Assets2["BRIEFCASE"] = "briefcase";
|
|
1680
|
+
Assets2["BUSINESS_CARD"] = "business-card";
|
|
1681
|
+
Assets2["CALENDAR"] = "calendar";
|
|
1682
|
+
Assets2["CHECK_MARK"] = "check-mark";
|
|
1683
|
+
Assets2["CLOSED_WINDOW"] = "closed-window";
|
|
1684
|
+
Assets2["COIN_PILE_DOWN"] = "coin-pile-down";
|
|
1685
|
+
Assets2["COIN_PILE_UP"] = "coin-pile-up";
|
|
1686
|
+
Assets2["CONFETTI"] = "confetti";
|
|
1687
|
+
Assets2["CONSTRUCTION_FENCE"] = "construction-fence";
|
|
1688
|
+
Assets2["CONVERT"] = "convert";
|
|
1689
|
+
Assets2["COOKIE"] = "cookie";
|
|
1690
|
+
Assets2["DIGITAL_CARD_2"] = "digital-card-2";
|
|
1691
|
+
Assets2["DIGITAL_CARD"] = "digital-card";
|
|
1692
|
+
Assets2["DOCUMENTS"] = "documents";
|
|
1693
|
+
Assets2["DOOR"] = "door";
|
|
1694
|
+
Assets2["ECO_CARD"] = "eco-card";
|
|
1695
|
+
Assets2["ELECTRIC_PLUG"] = "electric-plug";
|
|
1696
|
+
Assets2["EMAIL_SUCCESS"] = "email-success";
|
|
1697
|
+
Assets2["EMAIL"] = "email";
|
|
1698
|
+
Assets2["EXCLAMATION_MARK"] = "exclamation-mark";
|
|
1699
|
+
Assets2["FLAG"] = "flag";
|
|
1700
|
+
Assets2["FLOWER"] = "flower";
|
|
1701
|
+
Assets2["GEAR"] = "gear";
|
|
1702
|
+
Assets2["GLOBE"] = "globe";
|
|
1703
|
+
Assets2["GRAPH"] = "graph";
|
|
1704
|
+
Assets2["HEART_2"] = "heart-2";
|
|
1705
|
+
Assets2["HEART_3"] = "heart-3";
|
|
1706
|
+
Assets2["HEART_4"] = "heart-4";
|
|
1707
|
+
Assets2["HEART_5"] = "heart-5";
|
|
1708
|
+
Assets2["HEART"] = "heart";
|
|
1709
|
+
Assets2["HOUSE"] = "house";
|
|
1710
|
+
Assets2["ID_CARD"] = "id-card";
|
|
1711
|
+
Assets2["INFINITE"] = "infinite";
|
|
1712
|
+
Assets2["INVITE_LETTER"] = "invite-letter";
|
|
1713
|
+
Assets2["JARS"] = "jars";
|
|
1714
|
+
Assets2["KEY"] = "key";
|
|
1715
|
+
Assets2["LIGHT_BULB"] = "light-bulb";
|
|
1716
|
+
Assets2["LOCK"] = "lock";
|
|
1717
|
+
Assets2["MAGNIFYING_GLASS"] = "magnifying-glass";
|
|
1718
|
+
Assets2["MAP"] = "map";
|
|
1719
|
+
Assets2["MARBLE_CARD_BUSINESS"] = "marble-card-business";
|
|
1720
|
+
Assets2["MARBLE_CARD"] = "marble-card";
|
|
1721
|
+
Assets2["MARBLE"] = "marble";
|
|
1722
|
+
Assets2["MEGAPHONE"] = "megaphone";
|
|
1723
|
+
Assets2["MULTI_CURRENCY"] = "multi-currency";
|
|
1724
|
+
Assets2["ONE_INVITE_LETTER_OPENED"] = "one-invite-letter-opened";
|
|
1725
|
+
Assets2["PALM_TREE"] = "palm-tree";
|
|
1726
|
+
Assets2["PERCENTAGE"] = "percentage";
|
|
1727
|
+
Assets2["PERSONAL_CARD"] = "personal-card";
|
|
1728
|
+
Assets2["PHONES"] = "phones";
|
|
1729
|
+
Assets2["PIE_CHART"] = "pie-chart";
|
|
1730
|
+
Assets2["PLANE_2"] = "plane-2";
|
|
1731
|
+
Assets2["PLANE"] = "plane";
|
|
1732
|
+
Assets2["PUZZLE_PIECES"] = "puzzle-pieces";
|
|
1733
|
+
Assets2["QUESTION_MARK"] = "question-mark";
|
|
1734
|
+
Assets2["RECEIVE"] = "receive";
|
|
1735
|
+
Assets2["REMINDER_LETTER"] = "reminder-letter";
|
|
1736
|
+
Assets2["SAND_TIMER"] = "sand-timer";
|
|
1737
|
+
Assets2["SHOPPING_BAG"] = "shopping-bag";
|
|
1738
|
+
Assets2["SKIP_AUTHENTICATION"] = "skip-authentication";
|
|
1739
|
+
Assets2["SPEECH_BUBBLE"] = "speech-bubble";
|
|
1740
|
+
Assets2["TOOL"] = "tool";
|
|
1741
|
+
Assets2["TWO_INVITE_LETTERS_OPENED"] = "two-invite-letters-opened";
|
|
1742
|
+
Assets2["WALLET"] = "wallet";
|
|
1743
|
+
})(Assets || (Assets = {}));
|
|
1744
|
+
|
|
1790
1745
|
// src/legacy/layout/icon/FlagIcon.tsx
|
|
1791
|
-
import { jsx as
|
|
1792
|
-
var isFlagIcon = (name) =>
|
|
1793
|
-
var isCurrencyFlagIcon = (name) => currencyCodes.some((currencyCode) => name === `flag-${currencyCode}`);
|
|
1794
|
-
var isCountryFlagIcon = (name) => countryCodes.some((countryCode) => name === `flag-${countryCode}`);
|
|
1746
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1747
|
+
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
1795
1748
|
function FlagIcon({ name }) {
|
|
1796
1749
|
if (!isFlagIcon(name)) {
|
|
1797
1750
|
return null;
|
|
1798
1751
|
}
|
|
1799
1752
|
const code = name.substring(5);
|
|
1800
|
-
return /* @__PURE__ */
|
|
1801
|
-
"img",
|
|
1802
|
-
{
|
|
1803
|
-
src: `https://wise.com/web-art/assets/flags/${code}.svg`,
|
|
1804
|
-
alt: "",
|
|
1805
|
-
"data-testid": `img-flag-${code}`,
|
|
1806
|
-
width: "24px"
|
|
1807
|
-
}
|
|
1808
|
-
);
|
|
1753
|
+
return /* @__PURE__ */ jsx7(Flag, { intrinsicSize: 24, code });
|
|
1809
1754
|
}
|
|
1810
|
-
var currencyCodes = [
|
|
1811
|
-
"aed",
|
|
1812
|
-
"ars",
|
|
1813
|
-
"aud",
|
|
1814
|
-
"bdt",
|
|
1815
|
-
"bgn",
|
|
1816
|
-
"bhd",
|
|
1817
|
-
"bnd",
|
|
1818
|
-
"brl",
|
|
1819
|
-
"bwp",
|
|
1820
|
-
"cad",
|
|
1821
|
-
"chf",
|
|
1822
|
-
"clp",
|
|
1823
|
-
"cny",
|
|
1824
|
-
"cop",
|
|
1825
|
-
"crc",
|
|
1826
|
-
"czk",
|
|
1827
|
-
"dkk",
|
|
1828
|
-
"egp",
|
|
1829
|
-
"eur",
|
|
1830
|
-
"fjd",
|
|
1831
|
-
"gbp",
|
|
1832
|
-
"gel",
|
|
1833
|
-
"ghs",
|
|
1834
|
-
"gtq",
|
|
1835
|
-
"hkd",
|
|
1836
|
-
"hrk",
|
|
1837
|
-
"huf",
|
|
1838
|
-
"idr",
|
|
1839
|
-
"ils",
|
|
1840
|
-
"imp",
|
|
1841
|
-
"inr",
|
|
1842
|
-
"isk",
|
|
1843
|
-
"jmd",
|
|
1844
|
-
"jpy",
|
|
1845
|
-
"kes",
|
|
1846
|
-
"krw",
|
|
1847
|
-
"kwd",
|
|
1848
|
-
"lak",
|
|
1849
|
-
"lkr",
|
|
1850
|
-
"lsl",
|
|
1851
|
-
"mad",
|
|
1852
|
-
"mur",
|
|
1853
|
-
"mxn",
|
|
1854
|
-
"myr",
|
|
1855
|
-
"mzn",
|
|
1856
|
-
"nad",
|
|
1857
|
-
"ngn",
|
|
1858
|
-
"nok",
|
|
1859
|
-
"npr",
|
|
1860
|
-
"nzd",
|
|
1861
|
-
"omr",
|
|
1862
|
-
"pab",
|
|
1863
|
-
"pen",
|
|
1864
|
-
"php",
|
|
1865
|
-
"pkr",
|
|
1866
|
-
"pln",
|
|
1867
|
-
"qar",
|
|
1868
|
-
"ron",
|
|
1869
|
-
"rub",
|
|
1870
|
-
"sar",
|
|
1871
|
-
"sek",
|
|
1872
|
-
"sgd",
|
|
1873
|
-
"thb",
|
|
1874
|
-
"tmt",
|
|
1875
|
-
"try",
|
|
1876
|
-
"twd",
|
|
1877
|
-
"tzs",
|
|
1878
|
-
"uah",
|
|
1879
|
-
"ugx",
|
|
1880
|
-
"usd",
|
|
1881
|
-
"uyu",
|
|
1882
|
-
"vnd",
|
|
1883
|
-
"xof",
|
|
1884
|
-
"zar",
|
|
1885
|
-
"zmw"
|
|
1886
|
-
];
|
|
1887
|
-
var countryCodes = [
|
|
1888
|
-
"ad",
|
|
1889
|
-
"ae",
|
|
1890
|
-
"ar",
|
|
1891
|
-
"at",
|
|
1892
|
-
"au",
|
|
1893
|
-
"bd",
|
|
1894
|
-
"be",
|
|
1895
|
-
"bg",
|
|
1896
|
-
"bh",
|
|
1897
|
-
"bn",
|
|
1898
|
-
"br",
|
|
1899
|
-
"bw",
|
|
1900
|
-
"ca",
|
|
1901
|
-
"ch",
|
|
1902
|
-
"cl",
|
|
1903
|
-
"cn",
|
|
1904
|
-
"co",
|
|
1905
|
-
"cr",
|
|
1906
|
-
"cy",
|
|
1907
|
-
"cz",
|
|
1908
|
-
"de",
|
|
1909
|
-
"dk",
|
|
1910
|
-
"ee",
|
|
1911
|
-
"eg",
|
|
1912
|
-
"es",
|
|
1913
|
-
"eu",
|
|
1914
|
-
"fi",
|
|
1915
|
-
"fj",
|
|
1916
|
-
"fr",
|
|
1917
|
-
"gb",
|
|
1918
|
-
"ge",
|
|
1919
|
-
"gg",
|
|
1920
|
-
"gh",
|
|
1921
|
-
"gp",
|
|
1922
|
-
"gr",
|
|
1923
|
-
"gt",
|
|
1924
|
-
"hk",
|
|
1925
|
-
"hr",
|
|
1926
|
-
"hu",
|
|
1927
|
-
"id",
|
|
1928
|
-
"ie",
|
|
1929
|
-
"il",
|
|
1930
|
-
"im",
|
|
1931
|
-
"in",
|
|
1932
|
-
"is",
|
|
1933
|
-
"it",
|
|
1934
|
-
"je",
|
|
1935
|
-
"jm",
|
|
1936
|
-
"jp",
|
|
1937
|
-
"ke",
|
|
1938
|
-
"kr",
|
|
1939
|
-
"kw",
|
|
1940
|
-
"la",
|
|
1941
|
-
"li",
|
|
1942
|
-
"lk",
|
|
1943
|
-
"ls",
|
|
1944
|
-
"lt",
|
|
1945
|
-
"lu",
|
|
1946
|
-
"lv",
|
|
1947
|
-
"ma",
|
|
1948
|
-
"mc",
|
|
1949
|
-
"mt",
|
|
1950
|
-
"mu",
|
|
1951
|
-
"mx",
|
|
1952
|
-
"my",
|
|
1953
|
-
"mz",
|
|
1954
|
-
"na",
|
|
1955
|
-
"ng",
|
|
1956
|
-
"nl",
|
|
1957
|
-
"no",
|
|
1958
|
-
"np",
|
|
1959
|
-
"nz",
|
|
1960
|
-
"om",
|
|
1961
|
-
"pa",
|
|
1962
|
-
"pe",
|
|
1963
|
-
"ph",
|
|
1964
|
-
"pk",
|
|
1965
|
-
"pl",
|
|
1966
|
-
"pt",
|
|
1967
|
-
"qa",
|
|
1968
|
-
"ro",
|
|
1969
|
-
"ru",
|
|
1970
|
-
"sa",
|
|
1971
|
-
"se",
|
|
1972
|
-
"sg",
|
|
1973
|
-
"si",
|
|
1974
|
-
"sk",
|
|
1975
|
-
"sm",
|
|
1976
|
-
"th",
|
|
1977
|
-
"tm",
|
|
1978
|
-
"tr",
|
|
1979
|
-
"tw",
|
|
1980
|
-
"tz",
|
|
1981
|
-
"ua",
|
|
1982
|
-
"ug",
|
|
1983
|
-
"us",
|
|
1984
|
-
"uy",
|
|
1985
|
-
"va",
|
|
1986
|
-
"vn",
|
|
1987
|
-
"wi",
|
|
1988
|
-
"xo",
|
|
1989
|
-
"za",
|
|
1990
|
-
"zm"
|
|
1991
|
-
];
|
|
1992
1755
|
|
|
1993
1756
|
// src/legacy/layout/icon/NamedIcon.tsx
|
|
1994
1757
|
import * as icons from "@transferwise/icons";
|
|
1995
|
-
import { jsx as
|
|
1758
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1996
1759
|
var isNamedIcon = (name) => {
|
|
1997
1760
|
const iconName = toCapitalisedCamelCase(name);
|
|
1998
1761
|
return Object.keys(icons).includes(iconName);
|
|
@@ -2003,19 +1766,19 @@ function NamedIcon({ name }) {
|
|
|
2003
1766
|
}
|
|
2004
1767
|
const iconName = toCapitalisedCamelCase(name);
|
|
2005
1768
|
const Icon = icons[iconName];
|
|
2006
|
-
return /* @__PURE__ */
|
|
1769
|
+
return /* @__PURE__ */ jsx8(Icon, { size: 24 });
|
|
2007
1770
|
}
|
|
2008
1771
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
2009
1772
|
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
2010
1773
|
|
|
2011
1774
|
// src/legacy/layout/icon/DynamicIcon.tsx
|
|
2012
|
-
import { jsx as
|
|
1775
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
2013
1776
|
function DynamicIcon({ type }) {
|
|
2014
1777
|
if (isFlagIcon(type)) {
|
|
2015
|
-
return /* @__PURE__ */
|
|
1778
|
+
return /* @__PURE__ */ jsx9(FlagIcon, { name: type });
|
|
2016
1779
|
}
|
|
2017
1780
|
if (isNamedIcon(type)) {
|
|
2018
|
-
return /* @__PURE__ */
|
|
1781
|
+
return /* @__PURE__ */ jsx9(NamedIcon, { name: type });
|
|
2019
1782
|
}
|
|
2020
1783
|
return null;
|
|
2021
1784
|
}
|
|
@@ -2025,17 +1788,17 @@ function isValidIconName(name) {
|
|
|
2025
1788
|
var DynamicIcon_default = DynamicIcon;
|
|
2026
1789
|
|
|
2027
1790
|
// src/legacy/layout/utils/getNavigationOptionMedia.tsx
|
|
2028
|
-
import { jsx as
|
|
1791
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
2029
1792
|
var getNavigationOptionMedia = ({ icon, image }) => {
|
|
2030
1793
|
if (icon == null ? void 0 : icon.name) {
|
|
2031
|
-
return /* @__PURE__ */
|
|
1794
|
+
return /* @__PURE__ */ jsx10(Avatar, { type: AvatarType.ICON, children: /* @__PURE__ */ jsx10(DynamicIcon_default, { type: icon.name }) });
|
|
2032
1795
|
}
|
|
2033
1796
|
if (icon == null ? void 0 : icon.text) {
|
|
2034
|
-
return /* @__PURE__ */
|
|
1797
|
+
return /* @__PURE__ */ jsx10(Avatar, { type: AvatarType.INITIALS, children: icon.text });
|
|
2035
1798
|
}
|
|
2036
1799
|
if (image == null ? void 0 : image.url) {
|
|
2037
1800
|
const { url, text } = image;
|
|
2038
|
-
return /* @__PURE__ */
|
|
1801
|
+
return /* @__PURE__ */ jsx10("img", { src: url, alt: text });
|
|
2039
1802
|
}
|
|
2040
1803
|
return null;
|
|
2041
1804
|
};
|
|
@@ -2071,10 +1834,10 @@ var getTextAlignment = (align) => {
|
|
|
2071
1834
|
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
2072
1835
|
|
|
2073
1836
|
// src/legacy/layout/alert/DynamicAlert.tsx
|
|
2074
|
-
import { jsx as
|
|
1837
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2075
1838
|
var DynamicAlert = (props) => {
|
|
2076
1839
|
const alert = props.component;
|
|
2077
|
-
return /* @__PURE__ */
|
|
1840
|
+
return /* @__PURE__ */ jsx11(
|
|
2078
1841
|
Alert,
|
|
2079
1842
|
{
|
|
2080
1843
|
type: mapContextToAlertType(legacy_mapContext(alert.context)),
|
|
@@ -2107,12 +1870,12 @@ var mapContextToAlertType = (context) => {
|
|
|
2107
1870
|
var DynamicAlert_default = DynamicAlert;
|
|
2108
1871
|
|
|
2109
1872
|
// src/legacy/layout/box/DynamicBox.tsx
|
|
2110
|
-
import { jsx as
|
|
1873
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2111
1874
|
var DynamicBox = (props) => {
|
|
2112
1875
|
const box = props.component;
|
|
2113
1876
|
const margin = getMargin(box.margin || box.border ? "lg" : "xs");
|
|
2114
1877
|
if (!box.width || box.width === "xl") {
|
|
2115
|
-
return /* @__PURE__ */
|
|
1878
|
+
return /* @__PURE__ */ jsx12("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ jsx12(
|
|
2116
1879
|
DynamicLayout_default,
|
|
2117
1880
|
{
|
|
2118
1881
|
components: box.components,
|
|
@@ -2125,7 +1888,7 @@ var DynamicBox = (props) => {
|
|
|
2125
1888
|
}
|
|
2126
1889
|
) });
|
|
2127
1890
|
}
|
|
2128
|
-
return /* @__PURE__ */
|
|
1891
|
+
return /* @__PURE__ */ jsx12("div", { className: "row", children: /* @__PURE__ */ jsx12("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ jsx12("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ jsx12(
|
|
2129
1892
|
DynamicLayout_default,
|
|
2130
1893
|
{
|
|
2131
1894
|
components: box.components,
|
|
@@ -2209,7 +1972,7 @@ var getButtonSize = (size) => {
|
|
|
2209
1972
|
};
|
|
2210
1973
|
|
|
2211
1974
|
// src/legacy/layout/button/DynamicButton.tsx
|
|
2212
|
-
import { jsx as
|
|
1975
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2213
1976
|
function DynamicButton(props) {
|
|
2214
1977
|
var _a;
|
|
2215
1978
|
const { component, onAction } = props;
|
|
@@ -2218,7 +1981,7 @@ function DynamicButton(props) {
|
|
|
2218
1981
|
const priority = getButtonPriority(component);
|
|
2219
1982
|
const { loading } = useDynamicFlow();
|
|
2220
1983
|
const className = getMargin(component.margin || "md");
|
|
2221
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ jsx13(
|
|
2222
1985
|
Button,
|
|
2223
1986
|
{
|
|
2224
1987
|
size: getButtonSize(component.size),
|
|
@@ -2235,12 +1998,12 @@ function DynamicButton(props) {
|
|
|
2235
1998
|
var DynamicButton_default = DynamicButton;
|
|
2236
1999
|
|
|
2237
2000
|
// src/legacy/layout/columns/DynamicColumns.tsx
|
|
2238
|
-
import { jsx as
|
|
2001
|
+
import { jsx as jsx14, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2239
2002
|
var DynamicColumns = (props) => {
|
|
2240
2003
|
const columns = props.component;
|
|
2241
2004
|
const { leftWidth, rightWidth } = getWidth(columns.bias);
|
|
2242
|
-
return /* @__PURE__ */
|
|
2243
|
-
/* @__PURE__ */
|
|
2005
|
+
return /* @__PURE__ */ jsxs2("div", { className: `${getMargin(columns.margin || "xs")} row`, children: [
|
|
2006
|
+
/* @__PURE__ */ jsx14("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ jsx14(
|
|
2244
2007
|
DynamicLayout_default,
|
|
2245
2008
|
{
|
|
2246
2009
|
components: columns.left,
|
|
@@ -2252,7 +2015,7 @@ var DynamicColumns = (props) => {
|
|
|
2252
2015
|
onPersistAsync: props.onPersistAsync
|
|
2253
2016
|
}
|
|
2254
2017
|
) }),
|
|
2255
|
-
/* @__PURE__ */
|
|
2018
|
+
/* @__PURE__ */ jsx14("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ jsx14(
|
|
2256
2019
|
DynamicLayout_default,
|
|
2257
2020
|
{
|
|
2258
2021
|
components: columns.right,
|
|
@@ -2288,10 +2051,10 @@ var DynamicColumns_default = DynamicColumns;
|
|
|
2288
2051
|
|
|
2289
2052
|
// src/legacy/layout/decision/DynamicDecision.tsx
|
|
2290
2053
|
import { NavigationOption, NavigationOptionsList } from "@transferwise/components";
|
|
2291
|
-
import { jsx as
|
|
2054
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2292
2055
|
function DynamicDecision({ component, onAction }) {
|
|
2293
2056
|
const { loading } = useDynamicFlow();
|
|
2294
|
-
return /* @__PURE__ */
|
|
2057
|
+
return /* @__PURE__ */ jsx15("div", { className: getMargin(component.margin), children: /* @__PURE__ */ jsx15(NavigationOptionsList, { children: component.options.map((option) => /* @__PURE__ */ jsx15(
|
|
2295
2058
|
NavigationOption,
|
|
2296
2059
|
{
|
|
2297
2060
|
title: option.title,
|
|
@@ -2308,17 +2071,17 @@ function DynamicDecision({ component, onAction }) {
|
|
|
2308
2071
|
var DynamicDecision_default = DynamicDecision;
|
|
2309
2072
|
|
|
2310
2073
|
// src/legacy/layout/divider/DynamicDivider.tsx
|
|
2311
|
-
import { jsx as
|
|
2074
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2312
2075
|
var DynamicDivider = ({ component }) => {
|
|
2313
2076
|
const margin = getMargin(component.margin);
|
|
2314
2077
|
const className = `m-t-0 ${margin}`;
|
|
2315
|
-
return /* @__PURE__ */
|
|
2078
|
+
return /* @__PURE__ */ jsx16("hr", { className });
|
|
2316
2079
|
};
|
|
2317
2080
|
var DynamicDivider_default = DynamicDivider;
|
|
2318
2081
|
|
|
2319
2082
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
2320
2083
|
import { Button as Button2, Loader, Size as Size2 } from "@transferwise/components";
|
|
2321
|
-
import { useCallback as useCallback4, useEffect as
|
|
2084
|
+
import { useCallback as useCallback4, useEffect as useEffect3 } from "react";
|
|
2322
2085
|
import { useIntl } from "react-intl";
|
|
2323
2086
|
|
|
2324
2087
|
// src/legacy/layout/external/DynamicExternal.messages.ts
|
|
@@ -2332,7 +2095,7 @@ var DynamicExternal_messages_default = defineMessages2({
|
|
|
2332
2095
|
});
|
|
2333
2096
|
|
|
2334
2097
|
// src/legacy/layout/external/DynamicExternal.tsx
|
|
2335
|
-
import { Fragment, jsx as
|
|
2098
|
+
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2336
2099
|
var DynamicExternal = ({ component, onAction }) => {
|
|
2337
2100
|
const { requestUrl, responseHandlers, polling, retryTitle } = component;
|
|
2338
2101
|
const intl = useIntl();
|
|
@@ -2340,17 +2103,17 @@ var DynamicExternal = ({ component, onAction }) => {
|
|
|
2340
2103
|
() => window.open(requestUrl, "df-external-window"),
|
|
2341
2104
|
[requestUrl]
|
|
2342
2105
|
);
|
|
2343
|
-
|
|
2106
|
+
useEffect3(() => {
|
|
2344
2107
|
openExternalUrl();
|
|
2345
2108
|
}, [openExternalUrl]);
|
|
2346
2109
|
const pollingConfiguration = polling && responseHandlers ? __spreadProps(__spreadValues({}, polling), {
|
|
2347
2110
|
responseHandlers
|
|
2348
2111
|
}) : void 0;
|
|
2349
2112
|
useExternalStepPolling(pollingConfiguration, onAction);
|
|
2350
|
-
return /* @__PURE__ */
|
|
2351
|
-
/* @__PURE__ */
|
|
2352
|
-
/* @__PURE__ */
|
|
2353
|
-
/* @__PURE__ */
|
|
2113
|
+
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
2114
|
+
/* @__PURE__ */ jsx17(Loader, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
|
|
2115
|
+
/* @__PURE__ */ jsx17("br", {}),
|
|
2116
|
+
/* @__PURE__ */ jsx17(Button2, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
|
|
2354
2117
|
] });
|
|
2355
2118
|
};
|
|
2356
2119
|
var DynamicExternal_default = DynamicExternal;
|
|
@@ -2361,8 +2124,8 @@ import { useEffect as useEffect10 } from "react";
|
|
|
2361
2124
|
// src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
|
|
2362
2125
|
var import_classnames = __toESM(require_classnames());
|
|
2363
2126
|
import { Header } from "@transferwise/components";
|
|
2364
|
-
import { useState as
|
|
2365
|
-
import { Fragment as
|
|
2127
|
+
import { useState as useState4 } from "react";
|
|
2128
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2366
2129
|
var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
|
|
2367
2130
|
var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
|
|
2368
2131
|
var getSchemaColumnClasses = (width) => ({
|
|
@@ -2377,13 +2140,13 @@ function AllOfSchema(props) {
|
|
|
2377
2140
|
setModels(models);
|
|
2378
2141
|
props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
|
|
2379
2142
|
};
|
|
2380
|
-
const [models, setModels] =
|
|
2381
|
-
return /* @__PURE__ */
|
|
2382
|
-
props.schema.title && /* @__PURE__ */
|
|
2383
|
-
props.schema.description && /* @__PURE__ */
|
|
2384
|
-
/* @__PURE__ */
|
|
2143
|
+
const [models, setModels] = useState4(splitModel(props.model, props.schema.allOf));
|
|
2144
|
+
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
2145
|
+
props.schema.title && /* @__PURE__ */ jsx18(Header, { title: props.schema.title }),
|
|
2146
|
+
props.schema.description && /* @__PURE__ */ jsx18("p", { children: props.schema.description }),
|
|
2147
|
+
/* @__PURE__ */ jsx18("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
|
|
2385
2148
|
// eslint-disable-next-line react/no-array-index-key
|
|
2386
|
-
/* @__PURE__ */
|
|
2149
|
+
/* @__PURE__ */ jsx18("div", { className: (0, import_classnames.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ jsx18(
|
|
2387
2150
|
GenericSchema_default,
|
|
2388
2151
|
{
|
|
2389
2152
|
schema,
|
|
@@ -2412,7 +2175,7 @@ import {
|
|
|
2412
2175
|
Status,
|
|
2413
2176
|
UploadInput
|
|
2414
2177
|
} from "@transferwise/components";
|
|
2415
|
-
import { useMemo as useMemo6, useState as
|
|
2178
|
+
import { useMemo as useMemo6, useState as useState5 } from "react";
|
|
2416
2179
|
|
|
2417
2180
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
2418
2181
|
import { InlineAlert } from "@transferwise/components";
|
|
@@ -2490,7 +2253,7 @@ var validation_messages_default = defineMessages4({
|
|
|
2490
2253
|
});
|
|
2491
2254
|
|
|
2492
2255
|
// src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
|
|
2493
|
-
import { jsx as
|
|
2256
|
+
import { jsx as jsx19, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2494
2257
|
function ControlFeedback(props) {
|
|
2495
2258
|
var _a;
|
|
2496
2259
|
const defaultValidationMessages = useDefaultValidationMessages(props.schema);
|
|
@@ -2499,12 +2262,12 @@ function ControlFeedback(props) {
|
|
|
2499
2262
|
const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && Boolean((_a = props.validations) == null ? void 0 : _a.length);
|
|
2500
2263
|
const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
|
|
2501
2264
|
const hasInfoMessage = Boolean(props.infoMessage);
|
|
2502
|
-
return /* @__PURE__ */
|
|
2503
|
-
isErrorVisible ? /* @__PURE__ */
|
|
2504
|
-
isValidationVisible ? /* @__PURE__ */
|
|
2505
|
-
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */
|
|
2506
|
-
isDescriptionVisible && /* @__PURE__ */
|
|
2507
|
-
hasInfoMessage && /* @__PURE__ */
|
|
2265
|
+
return /* @__PURE__ */ jsxs5("div", { id: props.id, children: [
|
|
2266
|
+
isErrorVisible ? /* @__PURE__ */ jsx19(InlineAlert, { type: "error", children: props.errors }) : null,
|
|
2267
|
+
isValidationVisible ? /* @__PURE__ */ jsx19(InlineAlert, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ jsx19("div", { children: validationMessages[validation] }, validation)) }) : null,
|
|
2268
|
+
(isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ jsxs5(InlineAlert, { type: "info", children: [
|
|
2269
|
+
isDescriptionVisible && /* @__PURE__ */ jsx19("div", { children: props.schema.description }),
|
|
2270
|
+
hasInfoMessage && /* @__PURE__ */ jsx19("div", { children: props.infoMessage })
|
|
2508
2271
|
] })
|
|
2509
2272
|
] });
|
|
2510
2273
|
}
|
|
@@ -2650,15 +2413,15 @@ function useFormattedDefaultErrorMessages({
|
|
|
2650
2413
|
}
|
|
2651
2414
|
|
|
2652
2415
|
// src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
|
|
2653
|
-
import { jsx as
|
|
2416
|
+
import { jsx as jsx20, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2654
2417
|
function MultipleFileUploadSchema(props) {
|
|
2655
2418
|
var _a, _b;
|
|
2656
2419
|
const { onChange, schema } = props;
|
|
2657
2420
|
const onEvent = useEventDispatcher();
|
|
2658
2421
|
const defaultErrorMessages = useFormattedDefaultErrorMessages(schema);
|
|
2659
2422
|
const uid = useMemo6(() => schema.$id || generateRandomId(), [schema.$id]);
|
|
2660
|
-
const [inputChanged, setInputChanged] =
|
|
2661
|
-
const [files, setFiles] =
|
|
2423
|
+
const [inputChanged, setInputChanged] = useState5(false);
|
|
2424
|
+
const [files, setFiles] = useState5(() => convertFileIdsToComponentFileObjects(props.model || []));
|
|
2662
2425
|
const performPersistAsync = usePersistAsync(schema.items.persistAsync);
|
|
2663
2426
|
const fileSchemaDescriptor = schema.items.persistAsync.schema;
|
|
2664
2427
|
const isBlob = isBlobSchema(fileSchemaDescriptor);
|
|
@@ -2712,10 +2475,10 @@ function MultipleFileUploadSchema(props) {
|
|
|
2712
2475
|
onDeleteFile: () => Promise.resolve()
|
|
2713
2476
|
});
|
|
2714
2477
|
const feedbackId = `${uid}-feedback`;
|
|
2715
|
-
return /* @__PURE__ */
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
2478
|
+
return /* @__PURE__ */ jsxs6("div", { className: (0, import_classnames2.default)("form-group", { "has-error": showError }), children: [
|
|
2479
|
+
/* @__PURE__ */ jsx20("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
|
|
2480
|
+
/* @__PURE__ */ jsx20("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx20(UploadInput, __spreadValues({}, uploadInputProps)) }),
|
|
2481
|
+
/* @__PURE__ */ jsx20(
|
|
2719
2482
|
ControlFeedback_default,
|
|
2720
2483
|
{
|
|
2721
2484
|
id: feedbackId,
|
|
@@ -2763,14 +2526,6 @@ import { useIntl as useIntl4 } from "react-intl";
|
|
|
2763
2526
|
|
|
2764
2527
|
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
2765
2528
|
import { Avatar as Avatar2, AvatarType as AvatarType2 } from "@transferwise/components";
|
|
2766
|
-
|
|
2767
|
-
// ../../node_modules/.pnpm/@wise+art@2.10.0_@transferwise+neptune-css@14.9.6_@types+react@18.0.29_react-dom@18.2.0_react@18.2.0/node_modules/@wise/art/dist/index.esm.js
|
|
2768
|
-
init_index_d9418379_esm();
|
|
2769
|
-
init_clsx();
|
|
2770
|
-
import "react";
|
|
2771
|
-
import "react/jsx-runtime";
|
|
2772
|
-
|
|
2773
|
-
// src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
|
|
2774
2529
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2775
2530
|
var mapConstSchemaToOption = (schema, controlType) => {
|
|
2776
2531
|
switch (controlType) {
|
|
@@ -5586,7 +5341,7 @@ var addQueryParameter = (url, key, value) => {
|
|
|
5586
5341
|
|
|
5587
5342
|
// src/legacy/layout/search/DynamicSearch.tsx
|
|
5588
5343
|
var import_classnames9 = __toESM(require_classnames());
|
|
5589
|
-
import { Typeahead } from "@transferwise/components";
|
|
5344
|
+
import { Markdown as Markdown3, Typeahead } from "@transferwise/components";
|
|
5590
5345
|
import { jsx as jsx55, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5591
5346
|
var DEBOUNCE_TIME = 400;
|
|
5592
5347
|
function DynamicSearch({ component, onAction }) {
|
|
@@ -5632,7 +5387,15 @@ function DynamicSearch({ component, onAction }) {
|
|
|
5632
5387
|
name: "typeahead-input-name",
|
|
5633
5388
|
size: "md",
|
|
5634
5389
|
maxHeight: 100,
|
|
5635
|
-
footer: /* @__PURE__ */ jsx55(
|
|
5390
|
+
footer: /* @__PURE__ */ jsx55(
|
|
5391
|
+
TypeaheadFooter,
|
|
5392
|
+
{
|
|
5393
|
+
state: status,
|
|
5394
|
+
results,
|
|
5395
|
+
emptyMessage,
|
|
5396
|
+
onRetrySearch
|
|
5397
|
+
}
|
|
5398
|
+
),
|
|
5636
5399
|
multiple: false,
|
|
5637
5400
|
clearable: false,
|
|
5638
5401
|
addon: /* @__PURE__ */ jsx55(Search, { size: 24 }),
|
|
@@ -5669,10 +5432,11 @@ function mapResultToTypeaheadOption(result) {
|
|
|
5669
5432
|
function TypeaheadFooter({
|
|
5670
5433
|
results,
|
|
5671
5434
|
state,
|
|
5672
|
-
onRetrySearch
|
|
5435
|
+
onRetrySearch,
|
|
5436
|
+
emptyMessage
|
|
5673
5437
|
}) {
|
|
5674
5438
|
if (state === "success" && results.length === 0) {
|
|
5675
|
-
return /* @__PURE__ */ jsx55(
|
|
5439
|
+
return /* @__PURE__ */ jsx55(Markdown3, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
|
|
5676
5440
|
}
|
|
5677
5441
|
if (state === "error" && results.length === 0) {
|
|
5678
5442
|
return /* @__PURE__ */ jsx55("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx55(ErrorResult, { onRetrySearch }) });
|
|
@@ -8453,7 +8217,7 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
|
8453
8217
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
8454
8218
|
}
|
|
8455
8219
|
|
|
8456
|
-
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.
|
|
8220
|
+
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.27.0_@types+react@18.0.29_react@18.2.0/node_modules/@wise/forms/dist/index.mjs
|
|
8457
8221
|
var import_classnames11 = __toESM(require_classnames(), 1);
|
|
8458
8222
|
import { InlineAlert as InlineAlert2, Sentiment as Sentiment2, Input as Input2, TextArea } from "@transferwise/components";
|
|
8459
8223
|
import { createContext as createContext6, useContext as useContext7, forwardRef as forwardRef2 } from "react";
|
|
@@ -8520,7 +8284,7 @@ var Field = ({
|
|
|
8520
8284
|
};
|
|
8521
8285
|
|
|
8522
8286
|
// src/revamp/wise/renderers/components/Help.tsx
|
|
8523
|
-
import { Info as Info2, Markdown as
|
|
8287
|
+
import { Info as Info2, Markdown as Markdown4 } from "@transferwise/components";
|
|
8524
8288
|
import { useIntl as useIntl19 } from "react-intl";
|
|
8525
8289
|
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
8526
8290
|
function Help2({ help }) {
|
|
@@ -8529,7 +8293,7 @@ function Help2({ help }) {
|
|
|
8529
8293
|
Info2,
|
|
8530
8294
|
{
|
|
8531
8295
|
className: "m-l-1",
|
|
8532
|
-
content: /* @__PURE__ */ jsx76(
|
|
8296
|
+
content: /* @__PURE__ */ jsx76(Markdown4, { config: { link: { target: "_blank" } }, children: help }),
|
|
8533
8297
|
presentation: "POPOVER",
|
|
8534
8298
|
size: "sm",
|
|
8535
8299
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
@@ -8793,205 +8557,14 @@ import { NavigationOptionsList as NavigationOptionsList3, NavigationOption as Na
|
|
|
8793
8557
|
|
|
8794
8558
|
// src/revamp/wise/renderers/components/icon/FlagIcon.tsx
|
|
8795
8559
|
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
8796
|
-
var isFlagIcon2 = (name) =>
|
|
8797
|
-
var isCurrencyFlagIcon2 = (name) => currencyCodes2.some((currencyCode) => name === `flag-${currencyCode}`);
|
|
8798
|
-
var isCountryFlagIcon2 = (name) => countryCodes2.some((countryCode) => name === `flag-${countryCode}`);
|
|
8560
|
+
var isFlagIcon2 = (name) => name.startsWith("flag-");
|
|
8799
8561
|
function FlagIcon2({ name }) {
|
|
8800
8562
|
if (!isFlagIcon2(name)) {
|
|
8801
8563
|
return null;
|
|
8802
8564
|
}
|
|
8803
8565
|
const code = name.substring(5);
|
|
8804
|
-
return /* @__PURE__ */ jsx85(
|
|
8805
|
-
"img",
|
|
8806
|
-
{
|
|
8807
|
-
src: `https://wise.com/web-art/assets/flags/${code}.svg`,
|
|
8808
|
-
alt: "",
|
|
8809
|
-
"data-testid": `img-flag-${code}`
|
|
8810
|
-
}
|
|
8811
|
-
);
|
|
8566
|
+
return /* @__PURE__ */ jsx85(Flag, { code });
|
|
8812
8567
|
}
|
|
8813
|
-
var currencyCodes2 = [
|
|
8814
|
-
"aed",
|
|
8815
|
-
"ars",
|
|
8816
|
-
"aud",
|
|
8817
|
-
"bdt",
|
|
8818
|
-
"bgn",
|
|
8819
|
-
"bhd",
|
|
8820
|
-
"bnd",
|
|
8821
|
-
"brl",
|
|
8822
|
-
"bwp",
|
|
8823
|
-
"cad",
|
|
8824
|
-
"chf",
|
|
8825
|
-
"clp",
|
|
8826
|
-
"cny",
|
|
8827
|
-
"cop",
|
|
8828
|
-
"crc",
|
|
8829
|
-
"czk",
|
|
8830
|
-
"dkk",
|
|
8831
|
-
"egp",
|
|
8832
|
-
"eur",
|
|
8833
|
-
"fjd",
|
|
8834
|
-
"gbp",
|
|
8835
|
-
"gel",
|
|
8836
|
-
"ghs",
|
|
8837
|
-
"gtq",
|
|
8838
|
-
"hkd",
|
|
8839
|
-
"hrk",
|
|
8840
|
-
"huf",
|
|
8841
|
-
"idr",
|
|
8842
|
-
"ils",
|
|
8843
|
-
"imp",
|
|
8844
|
-
"inr",
|
|
8845
|
-
"isk",
|
|
8846
|
-
"jmd",
|
|
8847
|
-
"jpy",
|
|
8848
|
-
"kes",
|
|
8849
|
-
"krw",
|
|
8850
|
-
"kwd",
|
|
8851
|
-
"lak",
|
|
8852
|
-
"lkr",
|
|
8853
|
-
"lsl",
|
|
8854
|
-
"mad",
|
|
8855
|
-
"mur",
|
|
8856
|
-
"mxn",
|
|
8857
|
-
"myr",
|
|
8858
|
-
"mzn",
|
|
8859
|
-
"nad",
|
|
8860
|
-
"ngn",
|
|
8861
|
-
"nok",
|
|
8862
|
-
"npr",
|
|
8863
|
-
"nzd",
|
|
8864
|
-
"omr",
|
|
8865
|
-
"pab",
|
|
8866
|
-
"pen",
|
|
8867
|
-
"php",
|
|
8868
|
-
"pkr",
|
|
8869
|
-
"pln",
|
|
8870
|
-
"qar",
|
|
8871
|
-
"ron",
|
|
8872
|
-
"rub",
|
|
8873
|
-
"sar",
|
|
8874
|
-
"sek",
|
|
8875
|
-
"sgd",
|
|
8876
|
-
"thb",
|
|
8877
|
-
"tmt",
|
|
8878
|
-
"try",
|
|
8879
|
-
"twd",
|
|
8880
|
-
"tzs",
|
|
8881
|
-
"uah",
|
|
8882
|
-
"ugx",
|
|
8883
|
-
"usd",
|
|
8884
|
-
"uyu",
|
|
8885
|
-
"vnd",
|
|
8886
|
-
"xof",
|
|
8887
|
-
"zar",
|
|
8888
|
-
"zmw"
|
|
8889
|
-
];
|
|
8890
|
-
var countryCodes2 = [
|
|
8891
|
-
"ad",
|
|
8892
|
-
"ae",
|
|
8893
|
-
"ar",
|
|
8894
|
-
"at",
|
|
8895
|
-
"au",
|
|
8896
|
-
"bd",
|
|
8897
|
-
"be",
|
|
8898
|
-
"bg",
|
|
8899
|
-
"bh",
|
|
8900
|
-
"bn",
|
|
8901
|
-
"br",
|
|
8902
|
-
"bw",
|
|
8903
|
-
"ca",
|
|
8904
|
-
"ch",
|
|
8905
|
-
"cl",
|
|
8906
|
-
"cn",
|
|
8907
|
-
"co",
|
|
8908
|
-
"cr",
|
|
8909
|
-
"cy",
|
|
8910
|
-
"cz",
|
|
8911
|
-
"de",
|
|
8912
|
-
"dk",
|
|
8913
|
-
"ee",
|
|
8914
|
-
"eg",
|
|
8915
|
-
"es",
|
|
8916
|
-
"eu",
|
|
8917
|
-
"fi",
|
|
8918
|
-
"fj",
|
|
8919
|
-
"fr",
|
|
8920
|
-
"gb",
|
|
8921
|
-
"ge",
|
|
8922
|
-
"gg",
|
|
8923
|
-
"gh",
|
|
8924
|
-
"gp",
|
|
8925
|
-
"gr",
|
|
8926
|
-
"gt",
|
|
8927
|
-
"hk",
|
|
8928
|
-
"hr",
|
|
8929
|
-
"hu",
|
|
8930
|
-
"id",
|
|
8931
|
-
"ie",
|
|
8932
|
-
"il",
|
|
8933
|
-
"im",
|
|
8934
|
-
"in",
|
|
8935
|
-
"is",
|
|
8936
|
-
"it",
|
|
8937
|
-
"je",
|
|
8938
|
-
"jm",
|
|
8939
|
-
"jp",
|
|
8940
|
-
"ke",
|
|
8941
|
-
"kr",
|
|
8942
|
-
"kw",
|
|
8943
|
-
"la",
|
|
8944
|
-
"li",
|
|
8945
|
-
"lk",
|
|
8946
|
-
"ls",
|
|
8947
|
-
"lt",
|
|
8948
|
-
"lu",
|
|
8949
|
-
"lv",
|
|
8950
|
-
"ma",
|
|
8951
|
-
"mc",
|
|
8952
|
-
"mt",
|
|
8953
|
-
"mu",
|
|
8954
|
-
"mx",
|
|
8955
|
-
"my",
|
|
8956
|
-
"mz",
|
|
8957
|
-
"na",
|
|
8958
|
-
"ng",
|
|
8959
|
-
"nl",
|
|
8960
|
-
"no",
|
|
8961
|
-
"np",
|
|
8962
|
-
"nz",
|
|
8963
|
-
"om",
|
|
8964
|
-
"pa",
|
|
8965
|
-
"pe",
|
|
8966
|
-
"ph",
|
|
8967
|
-
"pk",
|
|
8968
|
-
"pl",
|
|
8969
|
-
"pt",
|
|
8970
|
-
"qa",
|
|
8971
|
-
"ro",
|
|
8972
|
-
"ru",
|
|
8973
|
-
"sa",
|
|
8974
|
-
"se",
|
|
8975
|
-
"sg",
|
|
8976
|
-
"si",
|
|
8977
|
-
"sk",
|
|
8978
|
-
"sm",
|
|
8979
|
-
"th",
|
|
8980
|
-
"tm",
|
|
8981
|
-
"tr",
|
|
8982
|
-
"tw",
|
|
8983
|
-
"tz",
|
|
8984
|
-
"ua",
|
|
8985
|
-
"ug",
|
|
8986
|
-
"us",
|
|
8987
|
-
"uy",
|
|
8988
|
-
"va",
|
|
8989
|
-
"vn",
|
|
8990
|
-
"wi",
|
|
8991
|
-
"xo",
|
|
8992
|
-
"za",
|
|
8993
|
-
"zm"
|
|
8994
|
-
];
|
|
8995
8568
|
|
|
8996
8569
|
// src/revamp/wise/renderers/components/icon/NamedIcon.tsx
|
|
8997
8570
|
import * as icons2 from "@transferwise/icons";
|
|
@@ -9282,11 +8855,11 @@ var LoadingIndicatorRenderer = {
|
|
|
9282
8855
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
9283
8856
|
|
|
9284
8857
|
// src/revamp/wise/renderers/MarkdownRenderer.tsx
|
|
9285
|
-
import { Markdown as
|
|
8858
|
+
import { Markdown as Markdown5 } from "@transferwise/components";
|
|
9286
8859
|
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
9287
8860
|
var MarkdownRenderer = {
|
|
9288
8861
|
canRenderType: "markdown",
|
|
9289
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ jsx98("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ jsx98(
|
|
8862
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ jsx98("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ jsx98(Markdown5, { config: { link: { target: "_blank" } }, children: content }) })
|
|
9290
8863
|
};
|
|
9291
8864
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
9292
8865
|
|
|
@@ -9619,7 +9192,7 @@ function ItemSummaryOption2({
|
|
|
9619
9192
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
9620
9193
|
|
|
9621
9194
|
// src/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
9622
|
-
import { Input as Input6, NavigationOption as NavigationOption7, NavigationOptionsList as NavigationOptionsList4 } from "@transferwise/components";
|
|
9195
|
+
import { Input as Input6, Markdown as Markdown6, NavigationOption as NavigationOption7, NavigationOptionsList as NavigationOptionsList4 } from "@transferwise/components";
|
|
9623
9196
|
|
|
9624
9197
|
// src/revamp/wise/renderers/SearchRenderer/ErrorResult.tsx
|
|
9625
9198
|
import { useIntl as useIntl22 } from "react-intl";
|
|
@@ -9695,7 +9268,7 @@ function SearchResultContent({
|
|
|
9695
9268
|
}
|
|
9696
9269
|
}
|
|
9697
9270
|
function EmptySearchResult({ state }) {
|
|
9698
|
-
return /* @__PURE__ */ jsx106(
|
|
9271
|
+
return /* @__PURE__ */ jsx106(Markdown6, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
9699
9272
|
}
|
|
9700
9273
|
function SearchResults2({
|
|
9701
9274
|
state
|
|
@@ -9722,7 +9295,7 @@ function SearchResults2({
|
|
|
9722
9295
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
9723
9296
|
|
|
9724
9297
|
// src/revamp/wise/renderers/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
9725
|
-
import { Typeahead as Typeahead2 } from "@transferwise/components";
|
|
9298
|
+
import { Markdown as Markdown7, Typeahead as Typeahead2 } from "@transferwise/components";
|
|
9726
9299
|
import { Search as Search2 } from "@transferwise/icons";
|
|
9727
9300
|
import { useState as useState32 } from "react";
|
|
9728
9301
|
import { jsx as jsx107, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
@@ -9785,7 +9358,7 @@ function mapResultToTypeaheadOption2(result) {
|
|
|
9785
9358
|
}
|
|
9786
9359
|
function TypeaheadFooter2({ state, isLoading }) {
|
|
9787
9360
|
if (state.type === "noResults") {
|
|
9788
|
-
return /* @__PURE__ */ jsx107(
|
|
9361
|
+
return /* @__PURE__ */ jsx107(Markdown7, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
9789
9362
|
}
|
|
9790
9363
|
if (state.type === "error") {
|
|
9791
9364
|
return /* @__PURE__ */ jsx107("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx107(ErrorResult2, { state }) });
|
|
@@ -17948,10 +17521,17 @@ var mapStepToComponent = (_a) => {
|
|
|
17948
17521
|
"displayStepTitle",
|
|
17949
17522
|
"trackEvent"
|
|
17950
17523
|
]);
|
|
17951
|
-
var _a2;
|
|
17524
|
+
var _a2, _b2;
|
|
17952
17525
|
const { httpClient, step, updateComponent } = restProps;
|
|
17953
|
-
const { id, external, key, layout = [], polling } = step;
|
|
17954
|
-
const
|
|
17526
|
+
const { id, navigation, external, key, layout = [], polling } = step;
|
|
17527
|
+
const backNavigation = (_a2 = navigation == null ? void 0 : navigation.back) != null ? _a2 : navigation == null ? void 0 : navigation.backButton;
|
|
17528
|
+
const back = backNavigation ? {
|
|
17529
|
+
title: backNavigation.title,
|
|
17530
|
+
onClick: () => {
|
|
17531
|
+
void restProps.onAction(__spreadProps(__spreadValues({}, backNavigation.action), { skipValidation: true }));
|
|
17532
|
+
}
|
|
17533
|
+
} : void 0;
|
|
17534
|
+
const refreshUrl = (_b2 = step.refreshUrl) != null ? _b2 : step.refreshFormUrl;
|
|
17955
17535
|
const stepId = id || key;
|
|
17956
17536
|
if (stepId === void 0) {
|
|
17957
17537
|
throw new Error("Step must have an id or a key");
|
|
@@ -17984,6 +17564,7 @@ var mapStepToComponent = (_a) => {
|
|
|
17984
17564
|
const stepComponent = createStepComponent({
|
|
17985
17565
|
uid,
|
|
17986
17566
|
components: [...additionalComponents, ...layoutComponents],
|
|
17567
|
+
back,
|
|
17987
17568
|
external,
|
|
17988
17569
|
loadingState,
|
|
17989
17570
|
stepPolling,
|
|
@@ -18086,9 +17667,17 @@ var executeSubmission = async (props) => {
|
|
|
18086
17667
|
return { type: "complete", result };
|
|
18087
17668
|
}
|
|
18088
17669
|
try {
|
|
17670
|
+
const makeRequestBody = () => {
|
|
17671
|
+
var _a;
|
|
17672
|
+
if (method === "GET") {
|
|
17673
|
+
return void 0;
|
|
17674
|
+
}
|
|
17675
|
+
const payload = mergeModels(model, (_a = action.data) != null ? _a : null);
|
|
17676
|
+
return payload !== null ? JSON.stringify(payload) : null;
|
|
17677
|
+
};
|
|
18089
17678
|
const response = await httpClient(url != null ? url : "", {
|
|
18090
17679
|
method,
|
|
18091
|
-
body:
|
|
17680
|
+
body: makeRequestBody(),
|
|
18092
17681
|
headers: { "Content-Type": "application/json" }
|
|
18093
17682
|
});
|
|
18094
17683
|
if (!response.ok) {
|
|
@@ -18147,8 +17736,9 @@ var CoreContainerRenderer = {
|
|
|
18147
17736
|
};
|
|
18148
17737
|
|
|
18149
17738
|
// src/revamp/renderers/stepComponentToProps.ts
|
|
18150
|
-
var stepComponentToProps = ({ external, loadingState, trackEvent }, children) => ({
|
|
17739
|
+
var stepComponentToProps = ({ back, external, loadingState, trackEvent }, children) => ({
|
|
18151
17740
|
type: "step",
|
|
17741
|
+
back,
|
|
18152
17742
|
external,
|
|
18153
17743
|
loadingState,
|
|
18154
17744
|
trackEvent,
|
|
@@ -18785,7 +18375,7 @@ import { useMemo as useMemo18 } from "react";
|
|
|
18785
18375
|
|
|
18786
18376
|
// src/revamp/renderers/step/ExternalConfirmationDialog.tsx
|
|
18787
18377
|
import { useIntl as useIntl23 } from "react-intl";
|
|
18788
|
-
import { Button as Button11, Markdown as
|
|
18378
|
+
import { Button as Button11, Markdown as Markdown8 } from "@transferwise/components";
|
|
18789
18379
|
import { jsx as jsx122, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
18790
18380
|
function ExternalConfirmationDialog({
|
|
18791
18381
|
external,
|
|
@@ -18794,7 +18384,7 @@ function ExternalConfirmationDialog({
|
|
|
18794
18384
|
const { formatMessage } = useIntl23();
|
|
18795
18385
|
return /* @__PURE__ */ jsx122("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs49("div", { className: "df-box-renderer-width-lg", children: [
|
|
18796
18386
|
/* @__PURE__ */ jsx122("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
18797
|
-
/* @__PURE__ */ jsx122(
|
|
18387
|
+
/* @__PURE__ */ jsx122(Markdown8, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin2(external.url) }) }),
|
|
18798
18388
|
/* @__PURE__ */ jsx122("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs49("div", { className: "df-box-renderer-width-lg", children: [
|
|
18799
18389
|
/* @__PURE__ */ jsx122(
|
|
18800
18390
|
Button11,
|
|
@@ -18838,20 +18428,47 @@ function useExternal2(url) {
|
|
|
18838
18428
|
return { requiresUserConfirmation, dismissConfirmation };
|
|
18839
18429
|
}
|
|
18840
18430
|
|
|
18431
|
+
// src/revamp/renderers/step/BackButton.tsx
|
|
18432
|
+
import { Avatar as Avatar7 } from "@transferwise/components";
|
|
18433
|
+
import { ArrowLeft as ArrowLeft2 } from "@transferwise/icons";
|
|
18434
|
+
import { jsx as jsx123, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
18435
|
+
function BackButton2({ title, onClick }) {
|
|
18436
|
+
return /* @__PURE__ */ jsxs50(
|
|
18437
|
+
"a",
|
|
18438
|
+
{
|
|
18439
|
+
href: "/",
|
|
18440
|
+
className: "df-back-btn",
|
|
18441
|
+
"aria-label": title,
|
|
18442
|
+
onClick: (event) => {
|
|
18443
|
+
event.preventDefault();
|
|
18444
|
+
onClick();
|
|
18445
|
+
},
|
|
18446
|
+
children: [
|
|
18447
|
+
/* @__PURE__ */ jsx123("span", { className: "sr-only", children: title }),
|
|
18448
|
+
/* @__PURE__ */ jsx123(Avatar7, { type: "icon", children: /* @__PURE__ */ jsx123(ArrowLeft2, { size: "24" }) })
|
|
18449
|
+
]
|
|
18450
|
+
}
|
|
18451
|
+
);
|
|
18452
|
+
}
|
|
18453
|
+
var BackButton_default2 = BackButton2;
|
|
18454
|
+
|
|
18841
18455
|
// src/revamp/renderers/step/StepRenderer.tsx
|
|
18842
|
-
import { jsx as
|
|
18456
|
+
import { jsx as jsx124, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
18843
18457
|
var StepRenderer = {
|
|
18844
18458
|
canRenderType: "step",
|
|
18845
18459
|
render: StepRendererComponent
|
|
18846
18460
|
};
|
|
18847
18461
|
function StepRendererComponent(props) {
|
|
18848
|
-
const { loadingState, external, trackEvent, children } = props;
|
|
18462
|
+
const { back, loadingState, external, trackEvent, children } = props;
|
|
18849
18463
|
const value = useMemo18(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
|
|
18850
18464
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal2(external == null ? void 0 : external.url);
|
|
18851
18465
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
18852
|
-
return /* @__PURE__ */
|
|
18466
|
+
return /* @__PURE__ */ jsx124(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
18853
18467
|
}
|
|
18854
|
-
return /* @__PURE__ */
|
|
18468
|
+
return /* @__PURE__ */ jsxs51(StepRendererContextProvider, { value, children: [
|
|
18469
|
+
back ? /* @__PURE__ */ jsx124(BackButton_default2, __spreadValues({}, back)) : null,
|
|
18470
|
+
children
|
|
18471
|
+
] });
|
|
18855
18472
|
}
|
|
18856
18473
|
|
|
18857
18474
|
// src/revamp/utils/findComponent.ts
|
|
@@ -18884,7 +18501,7 @@ function useStableCallback(handler) {
|
|
|
18884
18501
|
}
|
|
18885
18502
|
|
|
18886
18503
|
// src/revamp/DynamicFlowCore.tsx
|
|
18887
|
-
import { jsx as
|
|
18504
|
+
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
18888
18505
|
function DynamicFlowCore(props) {
|
|
18889
18506
|
const _a = props, { flowId, initialAction, initialStep, renderers: renderers2, displayStepTitle = true } = _a, rest = __objRest(_a, ["flowId", "initialAction", "initialStep", "renderers", "displayStepTitle"]);
|
|
18890
18507
|
const httpClient = useStableCallback(rest.httpClient);
|
|
@@ -18910,7 +18527,7 @@ function DynamicFlowCore(props) {
|
|
|
18910
18527
|
useEffect25(() => {
|
|
18911
18528
|
trackCoreEvent("Initiated");
|
|
18912
18529
|
if (!initialStep && initialAction) {
|
|
18913
|
-
void onAction(initialAction);
|
|
18530
|
+
void onAction(__spreadValues({ method: "GET" }, initialAction));
|
|
18914
18531
|
}
|
|
18915
18532
|
if (initialStep && !initialAction) {
|
|
18916
18533
|
initialiseWithStep(initialStep, null);
|
|
@@ -19003,14 +18620,13 @@ function DynamicFlowCore(props) {
|
|
|
19003
18620
|
[]
|
|
19004
18621
|
);
|
|
19005
18622
|
const onAction = useCallback11(async (action) => {
|
|
19006
|
-
var _a2, _b, _c
|
|
18623
|
+
var _a2, _b, _c;
|
|
19007
18624
|
try {
|
|
19008
18625
|
(_a2 = stepComponentRef.current) == null ? void 0 : _a2.setLoadingState("loading");
|
|
19009
18626
|
const model = (_c = await ((_b = stepComponentRef.current) == null ? void 0 : _b.getSubmittableValue())) != null ? _c : null;
|
|
19010
|
-
const payload = mergeModels(model, (_d = action.data) != null ? _d : null);
|
|
19011
18627
|
const command = await executeSubmission({
|
|
19012
18628
|
action,
|
|
19013
|
-
model
|
|
18629
|
+
model,
|
|
19014
18630
|
isInitial: stepRef.current === null,
|
|
19015
18631
|
httpClient,
|
|
19016
18632
|
trackEvent: trackCoreEvent
|
|
@@ -19088,11 +18704,11 @@ function DynamicFlowCore(props) {
|
|
|
19088
18704
|
() => getRenderFunction([CoreContainerRenderer, ...renderers2, StepRenderer]),
|
|
19089
18705
|
[renderers2]
|
|
19090
18706
|
);
|
|
19091
|
-
return /* @__PURE__ */
|
|
18707
|
+
return /* @__PURE__ */ jsx125(ErrorBoundary_default, { onError: closeWithError, children: stepComponent ? render(stepComponent) : null });
|
|
19092
18708
|
}
|
|
19093
18709
|
|
|
19094
18710
|
// src/revamp/DynamicFlowWise.tsx
|
|
19095
|
-
import { jsx as
|
|
18711
|
+
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
19096
18712
|
var renderers = getWiseRenderers();
|
|
19097
18713
|
function DynamicFlowWise(props) {
|
|
19098
18714
|
const { httpClient } = props;
|
|
@@ -19101,7 +18717,7 @@ function DynamicFlowWise(props) {
|
|
|
19101
18717
|
() => makeWiseHttpClient(httpClient, locale),
|
|
19102
18718
|
[httpClient, locale]
|
|
19103
18719
|
);
|
|
19104
|
-
return /* @__PURE__ */
|
|
18720
|
+
return /* @__PURE__ */ jsx126(HttpClientProvider, { httpClient: wiseHttpClient, children: /* @__PURE__ */ jsx126(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers })) });
|
|
19105
18721
|
}
|
|
19106
18722
|
var DynamicFlowWise_default = DynamicFlowWise;
|
|
19107
18723
|
var makeWiseHttpClient = (httpClient, locale) => async (input, init) => httpClient(
|