@wise/dynamic-flow-client-internal 4.27.0-experimental-330f0c5 → 4.27.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.
@@ -1,1241 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
-
33
- // ../renderers/src/AlertRenderer.tsx
34
- import { Alert } from "@transferwise/components";
35
-
36
- // ../renderers/src/utils/layout-utils.ts
37
- var getMargin = (size) => {
38
- switch (size) {
39
- case "xs":
40
- return "m-b-0";
41
- case "sm":
42
- return "m-b-1";
43
- case "md":
44
- return "m-b-2";
45
- case "lg":
46
- return "m-b-3";
47
- case "xl":
48
- return "m-b-5";
49
- default:
50
- return "";
51
- }
52
- };
53
-
54
- // ../renderers/src/AlertRenderer.tsx
55
- import { jsx } from "react/jsx-runtime";
56
-
57
- // ../renderers/src/BoxRenderer.tsx
58
- import classNames from "classnames";
59
- import { jsx as jsx2 } from "react/jsx-runtime";
60
-
61
- // ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
62
- import { Button, InlineAlert } from "@transferwise/components";
63
- import { useIntl } from "react-intl";
64
-
65
- // ../renderers/src/messages/loading-button.messages.ts
66
- import { defineMessages } from "react-intl";
67
- var loading_button_messages_default = defineMessages({
68
- buttonLoadingMessage: {
69
- id: "df.wise.ButtonLayout.buttonLoadingMessage",
70
- defaultMessage: "This might take a few seconds",
71
- description: "Message displayed below a button when it is in a loading state."
72
- }
73
- });
74
-
75
- // ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
76
- import { useEffect, useState } from "react";
77
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
78
-
79
- // ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
80
- import { Button as Button2 } from "@transferwise/components";
81
- import { useEffect as useEffect2, useState as useState2 } from "react";
82
-
83
- // ../renderers/src/ButtonRenderer/mapButtonSize.tsx
84
- var mapButtonSize = (size) => {
85
- if (!size) {
86
- return void 0;
87
- }
88
- switch (size) {
89
- case "xs":
90
- case "sm":
91
- return "sm";
92
- case "lg":
93
- case "xl":
94
- return "lg";
95
- case "md":
96
- default:
97
- return "md";
98
- }
99
- };
100
-
101
- // ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
102
- import { jsx as jsx4 } from "react/jsx-runtime";
103
-
104
- // ../renderers/src/components/FieldInput.tsx
105
- import { Field } from "@transferwise/components";
106
-
107
- // ../renderers/src/components/Help.tsx
108
- import { Info, Markdown } from "@transferwise/components";
109
- import { useIntl as useIntl2 } from "react-intl";
110
-
111
- // ../renderers/src/messages/help.messages.ts
112
- import { defineMessages as defineMessages2 } from "react-intl";
113
- var help_messages_default = defineMessages2({
114
- helpAria: {
115
- id: "df.wise.Help.ariaLabel",
116
- defaultMessage: "Click here for more info.",
117
- description: "Aria label for help."
118
- }
119
- });
120
-
121
- // ../renderers/src/components/Help.tsx
122
- import { jsx as jsx5 } from "react/jsx-runtime";
123
-
124
- // ../renderers/src/components/LabelContentWithHelp.tsx
125
- import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
126
-
127
- // ../renderers/src/components/FieldInput.tsx
128
- import { jsx as jsx7 } from "react/jsx-runtime";
129
-
130
- // ../renderers/src/CheckboxInputRenderer.tsx
131
- import { Checkbox, ListItem } from "@transferwise/components";
132
-
133
- // ../renderers/src/utils/UrnFlag.tsx
134
- import { Flag } from "@wise/art";
135
- import { jsx as jsx8 } from "react/jsx-runtime";
136
- var countryUrnPrefix = "urn:wise:countries:";
137
- var currencyUrnPrefix = "urn:wise:currencies:";
138
- var isUrnFlag = (uri) => uri.startsWith(countryUrnPrefix) || uri.startsWith(currencyUrnPrefix);
139
- function UrnFlag({ size, urn }) {
140
- return /* @__PURE__ */ jsx8(Flag, { code: getCode(urn), intrinsicSize: size });
141
- }
142
- var getCode = (urn) => {
143
- return urn.replace(countryUrnPrefix, "").replace(currencyUrnPrefix, "").replace(":image", "").split("?")[0];
144
- };
145
-
146
- // ../renderers/src/components/icon/FlagIcon.tsx
147
- import { Flag as Flag2 } from "@wise/art";
148
- import { jsx as jsx9 } from "react/jsx-runtime";
149
- var isFlagIcon = (name) => name.startsWith("flag-");
150
- function FlagIcon({ name }) {
151
- if (!isFlagIcon(name)) {
152
- return null;
153
- }
154
- const code = name.substring(5);
155
- return /* @__PURE__ */ jsx9(Flag2, { code, intrinsicSize: 24 });
156
- }
157
-
158
- // ../renderers/src/components/icon/NamedIcon.tsx
159
- import * as icons from "@transferwise/icons";
160
- import { jsx as jsx10 } from "react/jsx-runtime";
161
- var isNamedIcon = (name) => {
162
- const iconName = toCapitalisedCamelCase(name);
163
- return Object.keys(icons).includes(iconName);
164
- };
165
- function NamedIcon({ name }) {
166
- if (!isNamedIcon(name)) {
167
- return null;
168
- }
169
- const iconName = toCapitalisedCamelCase(name);
170
- const Icon = icons[iconName];
171
- return /* @__PURE__ */ jsx10(Icon, { size: 24 });
172
- }
173
- var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
174
- var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
175
-
176
- // ../renderers/src/components/icon/DynamicIcon.tsx
177
- import { jsx as jsx11 } from "react/jsx-runtime";
178
- function DynamicIcon({ name }) {
179
- if (isFlagIcon(name)) {
180
- return /* @__PURE__ */ jsx11(FlagIcon, { name });
181
- }
182
- if (isNamedIcon(name)) {
183
- return /* @__PURE__ */ jsx11(NamedIcon, { name });
184
- }
185
- return null;
186
- }
187
- function isValidIconName(name) {
188
- return isNamedIcon(name) || isFlagIcon(name);
189
- }
190
- function isValidIconUrn(uri) {
191
- if (!uri.startsWith("urn:wise:icons:")) {
192
- return false;
193
- }
194
- const name = uri.replace("urn:wise:icons:", "").split("?")[0];
195
- return isValidIconName(name);
196
- }
197
- var DynamicIcon_default = DynamicIcon;
198
-
199
- // ../renderers/src/components/Media/stringToURN.ts
200
- var stringToURN = (uri) => {
201
- var _a, _b, _c;
202
- const [nameWithRQComponents, _] = uri.split("#");
203
- const [nameWithRComponent, qComponent] = nameWithRQComponents.split("?=");
204
- const [name, rComponent] = (_a = nameWithRComponent == null ? void 0 : nameWithRComponent.split("?+")) != null ? _a : ["", ""];
205
- const rComponents = rComponent ? (_b = decodeURIComponent(rComponent)) == null ? void 0 : _b.split("&").map((c) => c.split("=")).map(([a, b]) => [a, b]) : void 0;
206
- const qComponents = qComponent ? (_c = decodeURIComponent(qComponent)) == null ? void 0 : _c.split("&").map((c) => c.split("=")).map(([a, b]) => [a, b]) : void 0;
207
- return {
208
- name,
209
- rComponents,
210
- qComponents
211
- };
212
- };
213
-
214
- // ../renderers/src/components/Media/resolveMediaFromUri.tsx
215
- import { jsx as jsx12 } from "react/jsx-runtime";
216
- var resolveMediaFromUri = (uri, size) => {
217
- var _a, _b;
218
- const { name, qComponents = [] } = stringToURN(uri);
219
- if (isValidIconUrn(name)) {
220
- const icon = /* @__PURE__ */ jsx12(DynamicIcon_default, { name: name.replace("urn:wise:icons:", "") });
221
- return {
222
- icon,
223
- backgroundColor: formatColor((_a = qComponents.find(([key]) => key === "background-color")) == null ? void 0 : _a[1])
224
- };
225
- }
226
- if (isUrnFlag(name)) {
227
- return {
228
- asset: /* @__PURE__ */ jsx12(UrnFlag, { urn: name, size })
229
- };
230
- }
231
- if (name.startsWith("data:text/plain,")) {
232
- const text = decodeURI(name.replace("data:text/plain,", ""));
233
- return {
234
- asset: text,
235
- backgroundColor: formatColor((_b = qComponents.find(([key]) => key === "background-color")) == null ? void 0 : _b[1])
236
- };
237
- }
238
- if (!uri.startsWith("urn:")) {
239
- return { asset: /* @__PURE__ */ jsx12("img", { src: uri, alt: "", width: `${size}px` }) };
240
- }
241
- return { asset: void 0 };
242
- };
243
- var formatColor = (color) => {
244
- if (!color) {
245
- return void 0;
246
- }
247
- if (color.startsWith("#")) {
248
- return color;
249
- }
250
- return `var(--color-${color.replace(/^base-|brand-/, "")})`;
251
- };
252
-
253
- // ../renderers/src/components/Media/AvatarMedia.tsx
254
- import { AvatarLayout, AvatarView } from "@transferwise/components";
255
- import { jsx as jsx13 } from "react/jsx-runtime";
256
- var AvatarMedia = ({
257
- accessibilityDescription,
258
- content,
259
- size
260
- }) => {
261
- const getRenderableAvatar = (avatar) => {
262
- if (avatar.type === "text") {
263
- return { asset: avatar.text };
264
- }
265
- return __spreadProps(__spreadValues({}, resolveMediaFromUri(avatar.uri, size)), {
266
- badge: avatar.badgeUri ? resolveMediaFromUri(avatar.badgeUri, 16) : void 0
267
- });
268
- };
269
- const avatars = content.map(getRenderableAvatar);
270
- if (avatars.length === 1) {
271
- const { badge, backgroundColor, asset, icon } = avatars[0];
272
- if (!asset && !icon) {
273
- return null;
274
- }
275
- return /* @__PURE__ */ jsx13(
276
- AvatarView,
277
- {
278
- "aria-label": accessibilityDescription,
279
- size,
280
- badge: badge ? __spreadProps(__spreadValues({}, badge), {
281
- type: "reference"
282
- }) : void 0,
283
- style: { backgroundColor },
284
- children: icon != null ? icon : asset
285
- }
286
- );
287
- }
288
- const avatarsWithoutBadges = avatars.filter(({ asset }) => asset).slice(0, 2).map((_a) => {
289
- var _b = _a, { badge } = _b, rest = __objRest(_b, ["badge"]);
290
- return __spreadValues({}, rest);
291
- });
292
- return /* @__PURE__ */ jsx13(
293
- AvatarLayout,
294
- {
295
- "aria-label": accessibilityDescription,
296
- size,
297
- orientation: "diagonal",
298
- avatars: avatarsWithoutBadges
299
- }
300
- );
301
- };
302
-
303
- // ../renderers/src/utils/image-utils.tsx
304
- import { AvatarView as AvatarView2 } from "@transferwise/components";
305
- import { jsx as jsx14 } from "react/jsx-runtime";
306
- var getBadgedMedia = (iconNode, imageNode, size) => {
307
- if (iconNode && imageNode) {
308
- if (imageNode && iconNode) {
309
- return /* @__PURE__ */ jsx14(AvatarView2, { size, badge: { asset: iconNode, type: "reference" }, children: imageNode });
310
- }
311
- }
312
- return null;
313
- };
314
- var getIconNode = (icon) => {
315
- if (icon) {
316
- if ("name" in icon) {
317
- return /* @__PURE__ */ jsx14(DynamicIcon_default, { name: icon.name });
318
- }
319
- if (icon.text) {
320
- return icon.text;
321
- }
322
- }
323
- return null;
324
- };
325
- var getImageNode = (image, size) => {
326
- if (image) {
327
- const { accessibilityDescription, uri } = image;
328
- if (!uri.startsWith("urn:")) {
329
- return /* @__PURE__ */ jsx14("img", { src: uri, alt: accessibilityDescription, width: `${size}px` });
330
- }
331
- if (isUrnFlag(uri)) {
332
- return /* @__PURE__ */ jsx14(UrnFlag, { urn: uri, accessibilityDescription, size });
333
- }
334
- }
335
- return null;
336
- };
337
-
338
- // ../renderers/src/components/Media/LegacyMedia.tsx
339
- import { AvatarView as AvatarView3 } from "@transferwise/components";
340
- import { jsx as jsx15 } from "react/jsx-runtime";
341
- var LegacyMedia = ({ image, icon, preferAvatar, size }) => {
342
- const imageNode = getImageNode(image, size);
343
- const iconNode = getIconNode(icon);
344
- const badge = getBadgedMedia(iconNode, imageNode, size);
345
- if (badge) {
346
- return badge;
347
- }
348
- if (imageNode) {
349
- return preferAvatar ? /* @__PURE__ */ jsx15(AvatarView3, { children: imageNode }) : imageNode;
350
- }
351
- if (iconNode && icon) {
352
- if ("text" in icon || size === 48) {
353
- return /* @__PURE__ */ jsx15(AvatarView3, { size, children: iconNode });
354
- }
355
- return iconNode;
356
- }
357
- return null;
358
- };
359
-
360
- // ../renderers/src/components/Media/Media.tsx
361
- import { jsx as jsx16 } from "react/jsx-runtime";
362
- var Media = ({ media, preferAvatar = false, size }) => {
363
- switch (media == null ? void 0 : media.type) {
364
- case "avatar":
365
- return /* @__PURE__ */ jsx16(AvatarMedia, __spreadProps(__spreadValues({}, media), { size }));
366
- case "image": {
367
- const { asset, icon } = resolveMediaFromUri(media.uri, size);
368
- return icon != null ? icon : asset;
369
- }
370
- case "legacy": {
371
- return /* @__PURE__ */ jsx16(LegacyMedia, __spreadProps(__spreadValues({}, media), { preferAvatar, size }));
372
- }
373
- default:
374
- return null;
375
- }
376
- };
377
-
378
- // ../renderers/src/components/Media/OptionMedia.tsx
379
- import { jsx as jsx17 } from "react/jsx-runtime";
380
- var mediaSize = 48;
381
- function OptionMedia(props) {
382
- return /* @__PURE__ */ jsx17(Media, __spreadProps(__spreadValues({}, props), { size: mediaSize }));
383
- }
384
-
385
- // ../renderers/src/components/Media/getInlineMedia.tsx
386
- import { jsx as jsx18 } from "react/jsx-runtime";
387
-
388
- // ../renderers/src/NewListItem/getMedia.tsx
389
- import { jsx as jsx19 } from "react/jsx-runtime";
390
- var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ jsx19(OptionMedia, { media, preferAvatar }) : void 0;
391
-
392
- // ../renderers/src/CheckboxInputRenderer.tsx
393
- import { jsx as jsx20 } from "react/jsx-runtime";
394
-
395
- // ../renderers/src/ColumnsRenderer.tsx
396
- import classNames2 from "classnames";
397
- import { jsx as jsx21, jsxs as jsxs3 } from "react/jsx-runtime";
398
-
399
- // ../renderers/src/components/VariableDateInput.tsx
400
- import { DateInput, DateLookup } from "@transferwise/components";
401
- import { jsx as jsx22 } from "react/jsx-runtime";
402
-
403
- // ../renderers/src/DateInputRenderer.tsx
404
- import { jsx as jsx23 } from "react/jsx-runtime";
405
-
406
- // ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
407
- import { NavigationOption, NavigationOptionsList } from "@transferwise/components";
408
-
409
- // ../renderers/src/DecisionRenderer/DecisionList.tsx
410
- import { Header as Header2, SearchInput } from "@transferwise/components";
411
-
412
- // ../renderers/src/DecisionRenderer/GroupedList.tsx
413
- import { Header, Section } from "@transferwise/components";
414
- import { useIntl as useIntl3 } from "react-intl";
415
-
416
- // ../renderers/src/messages/decision.messages.ts
417
- import { defineMessages as defineMessages3 } from "react-intl";
418
- var decision_messages_default = defineMessages3({
419
- all: {
420
- id: "df.wise.Decision.all",
421
- defaultMessage: "All",
422
- description: "Label for the group of options that encompasses all options"
423
- },
424
- popular: {
425
- id: "df.wise.Decision.popular",
426
- defaultMessage: "Popular",
427
- description: "Label for the group of options that are tagged as popular"
428
- },
429
- recent: {
430
- id: "df.wise.Decision.recent",
431
- defaultMessage: "Recent",
432
- description: "Label for the group of options that are tagged as recent"
433
- },
434
- currenciesWithAccountDetails: {
435
- id: "df.wise.Decision.currenciesWithAccountDetails",
436
- defaultMessage: "Currencies with account details",
437
- description: "Label for the group of options that are tagged as currencies with account details"
438
- },
439
- filterPlaceholder: {
440
- id: "df.wise.Decision.filterPlaceholder",
441
- defaultMessage: "Start typing to search",
442
- description: "Placeholder for the filter input"
443
- },
444
- results: {
445
- id: "df.wise.Decision.results",
446
- defaultMessage: "Search results",
447
- description: "Label for the results section"
448
- },
449
- noResults: {
450
- id: "df.wise.Decision.noResults",
451
- defaultMessage: "No results",
452
- description: "Message for if there are no results"
453
- }
454
- });
455
-
456
- // ../renderers/src/DecisionRenderer/GroupedList.tsx
457
- import { Fragment, jsx as jsx24, jsxs as jsxs4 } from "react/jsx-runtime";
458
- var OPTION_GROUPS = {
459
- popular: "popular",
460
- recent: "recent",
461
- currencyWithAccountDetails: "currencies-with-account-details"
462
- };
463
- var GroupedList = (_a) => {
464
- var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
465
- const { formatMessage } = useIntl3();
466
- const { options } = rest;
467
- const popularOptions = options.filter((option) => option.tag === OPTION_GROUPS.popular);
468
- const recentOptions = options.filter((option) => option.tag === OPTION_GROUPS.recent);
469
- const currencyWithAccountDetailsOptions = options.filter(
470
- (option) => option.tag === OPTION_GROUPS.currencyWithAccountDetails
471
- );
472
- return /* @__PURE__ */ jsxs4(Fragment, { children: [
473
- popularOptions.length > 0 ? /* @__PURE__ */ jsxs4(Section, { children: [
474
- /* @__PURE__ */ jsx24(Header, { as: "h2", title: formatMessage(decision_messages_default.popular) }),
475
- renderDecisionList2(__spreadProps(__spreadValues({}, rest), { options: popularOptions }))
476
- ] }) : null,
477
- recentOptions.length > 0 ? /* @__PURE__ */ jsxs4(Section, { children: [
478
- /* @__PURE__ */ jsx24(Header, { as: "h2", title: formatMessage(decision_messages_default.recent) }),
479
- renderDecisionList2(__spreadProps(__spreadValues({}, rest), { options: recentOptions }))
480
- ] }) : null,
481
- currencyWithAccountDetailsOptions.length > 0 ? /* @__PURE__ */ jsxs4(Section, { children: [
482
- /* @__PURE__ */ jsx24(Header, { as: "h2", title: formatMessage(decision_messages_default.currenciesWithAccountDetails) }),
483
- renderDecisionList2(__spreadProps(__spreadValues({}, rest), { options: currencyWithAccountDetailsOptions }))
484
- ] }) : null,
485
- /* @__PURE__ */ jsxs4(Section, { children: [
486
- /* @__PURE__ */ jsx24(Header, { as: "h2", title: formatMessage(decision_messages_default.all) }),
487
- renderDecisionList2(rest)
488
- ] })
489
- ] });
490
- };
491
- var isGroupedDecision = (options) => {
492
- const possibleGroups = Object.values(OPTION_GROUPS);
493
- return options.some(({ tag }) => tag && possibleGroups.includes(tag));
494
- };
495
-
496
- // ../renderers/src/DecisionRenderer/DecisionList.tsx
497
- import { useIntl as useIntl4 } from "react-intl";
498
- import { useState as useState3 } from "react";
499
-
500
- // ../renderers/src/DecisionRenderer/filter-and-sort-decision-options.ts
501
- function filterAndSortDecisionOptions(selectOptions, query) {
502
- const upperQuery = query.toUpperCase().trim();
503
- const filteredItems = selectOptions.filter((option) => {
504
- var _a, _b, _c, _d;
505
- const searchableWords = [
506
- option.title,
507
- option.description,
508
- option.additionalText,
509
- (_a = option.supportingValues) == null ? void 0 : _a.value,
510
- (_b = option.supportingValues) == null ? void 0 : _b.subvalue,
511
- ...(_c = option.keywords) != null ? _c : []
512
- ];
513
- return (_d = searchableWords.some((word) => word == null ? void 0 : word.toUpperCase().includes(upperQuery))) != null ? _d : false;
514
- });
515
- return [...filteredItems].sort((a, b) => {
516
- const aTitleUpper = a.title.toUpperCase();
517
- const bTitleUpper = b.title.toUpperCase();
518
- const aTitleStarts = aTitleUpper.startsWith(upperQuery);
519
- const bTitleStarts = bTitleUpper.startsWith(upperQuery);
520
- if (aTitleStarts && !bTitleStarts) {
521
- return -1;
522
- }
523
- if (!aTitleStarts && bTitleStarts) {
524
- return 1;
525
- }
526
- const aWordStarts = aTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
527
- const bWordStarts = bTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
528
- if (aWordStarts && !bWordStarts) {
529
- return -1;
530
- }
531
- if (!aWordStarts && bWordStarts) {
532
- return 1;
533
- }
534
- return a.title.localeCompare(b.title);
535
- });
536
- }
537
-
538
- // ../renderers/src/DecisionRenderer/DecisionList.tsx
539
- import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs5 } from "react/jsx-runtime";
540
- var DecisionWrapper = (props) => {
541
- return /* @__PURE__ */ jsxs5("div", { className: getMargin(props.margin), children: [
542
- props.title && /* @__PURE__ */ jsx25(Header2, { as: "h2", title: props.title }),
543
- props.control === "filtered" ? /* @__PURE__ */ jsx25(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx25(UnfilteredDecisionList, __spreadValues({}, props))
544
- ] });
545
- };
546
- var UnfilteredDecisionList = (_a) => {
547
- var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
548
- return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx25(GroupedList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
549
- };
550
- var FilteredDecisionList = (props) => {
551
- const { formatMessage } = useIntl4();
552
- const [query, setQuery] = useState3("");
553
- const { control, options, renderDecisionList: renderDecisionList2 } = props;
554
- const filteredOptions = filterAndSortDecisionOptions(options, query);
555
- const isGrouped = isGroupedDecision(options);
556
- return /* @__PURE__ */ jsxs5(Fragment2, { children: [
557
- /* @__PURE__ */ jsx25(
558
- SearchInput,
559
- {
560
- placeholder: formatMessage(decision_messages_default.filterPlaceholder),
561
- value: query,
562
- onChange: (e) => {
563
- var _a;
564
- return setQuery((_a = e.target.value) != null ? _a : "");
565
- }
566
- }
567
- ),
568
- isGrouped && query.length === 0 ? /* @__PURE__ */ jsx25(GroupedList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
569
- query.length > 0 && /* @__PURE__ */ jsx25(Header2, { as: "h2", title: formatMessage(decision_messages_default.results), className: "m-t-4" }),
570
- filteredOptions.length > 0 ? renderDecisionList2({
571
- control,
572
- className: query.length === 0 ? "m-t-3" : "",
573
- options: filteredOptions
574
- }) : /* @__PURE__ */ jsx25("p", { children: formatMessage(decision_messages_default.noResults) })
575
- ] })
576
- ] });
577
- };
578
-
579
- // ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
580
- import { jsx as jsx26 } from "react/jsx-runtime";
581
-
582
- // ../renderers/src/DividerRenderer.tsx
583
- import { Divider } from "@transferwise/components";
584
- import { jsx as jsx27 } from "react/jsx-runtime";
585
-
586
- // ../renderers/src/ExternalConfirmationRenderer.tsx
587
- import { Button as Button3, Markdown as Markdown2, Modal } from "@transferwise/components";
588
-
589
- // ../renderers/src/messages/external-confirmation.messages.ts
590
- import { defineMessages as defineMessages4 } from "react-intl";
591
- var external_confirmation_messages_default = defineMessages4({
592
- title: {
593
- id: "df.wise.ExternalConfirmation.title",
594
- defaultMessage: "Please confirm",
595
- description: "Heading for the confirmation screen."
596
- },
597
- description: {
598
- id: "df.wise.ExternalConfirmation.description",
599
- defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.",
600
- description: "Description for the confirmation screen."
601
- },
602
- open: {
603
- id: "df.wise.ExternalConfirmation.open",
604
- defaultMessage: "Open in new tab",
605
- description: "Button text confirming opening a new browser tab."
606
- },
607
- cancel: {
608
- id: "df.wise.ExternalConfirmation.cancel",
609
- defaultMessage: "Cancel",
610
- description: "Button text rejecting opening a new browser tab."
611
- }
612
- });
613
-
614
- // ../renderers/src/ExternalConfirmationRenderer.tsx
615
- import { useIntl as useIntl5 } from "react-intl";
616
- import { useEffect as useEffect3 } from "react";
617
- import { Fragment as Fragment3, jsx as jsx28, jsxs as jsxs6 } from "react/jsx-runtime";
618
-
619
- // ../renderers/src/FormRenderer.tsx
620
- import { jsx as jsx29 } from "react/jsx-runtime";
621
-
622
- // ../renderers/src/FormSectionRenderer.tsx
623
- import { Header as Header3 } from "@transferwise/components";
624
- import { jsx as jsx30, jsxs as jsxs7 } from "react/jsx-runtime";
625
-
626
- // ../renderers/src/HeadingRenderer.tsx
627
- import { Display, Title } from "@transferwise/components";
628
- import { jsx as jsx31 } from "react/jsx-runtime";
629
-
630
- // ../renderers/src/ImageRenderer/UrlImage.tsx
631
- import { Image } from "@transferwise/components";
632
- import { useEffect as useEffect4, useState as useState4 } from "react";
633
- import { jsx as jsx32 } from "react/jsx-runtime";
634
-
635
- // ../renderers/src/ImageRenderer/UrnFlagImage.tsx
636
- import { jsx as jsx33 } from "react/jsx-runtime";
637
-
638
- // ../renderers/src/ImageRenderer/UrnIllustration.tsx
639
- import {
640
- Illustration,
641
- isIllustrationSupport3D
642
- } from "@wise/art";
643
- import { useState as useState5 } from "react";
644
-
645
- // ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
646
- import { Illustration3D } from "@wise/art";
647
- import { Component } from "react";
648
- import { jsx as jsx34 } from "react/jsx-runtime";
649
-
650
- // ../renderers/src/ImageRenderer/UrnIllustration.tsx
651
- import { jsx as jsx35 } from "react/jsx-runtime";
652
-
653
- // ../renderers/src/ImageRenderer/UrnImage.tsx
654
- import { jsx as jsx36 } from "react/jsx-runtime";
655
-
656
- // ../renderers/src/ImageRenderer/ImageRenderer.tsx
657
- import { jsx as jsx37 } from "react/jsx-runtime";
658
-
659
- // ../renderers/src/InstructionsRenderer.tsx
660
- import { Header as Header4, InstructionsList } from "@transferwise/components";
661
- import { jsx as jsx38, jsxs as jsxs8 } from "react/jsx-runtime";
662
-
663
- // ../renderers/src/IntegerInputRenderer.tsx
664
- import { Input, InputGroup } from "@transferwise/components";
665
- import { jsx as jsx39 } from "react/jsx-runtime";
666
-
667
- // ../renderers/src/ListRenderer.tsx
668
- import { Body, Header as Header5 } from "@transferwise/components";
669
- import classNames3 from "classnames";
670
- import { jsx as jsx40, jsxs as jsxs9 } from "react/jsx-runtime";
671
-
672
- // ../renderers/src/LoadingIndicatorRenderer.tsx
673
- import { Loader } from "@transferwise/components";
674
- import { jsx as jsx41 } from "react/jsx-runtime";
675
-
676
- // ../renderers/src/MarkdownRenderer.tsx
677
- import { Markdown as Markdown3 } from "@transferwise/components";
678
- import { jsx as jsx42 } from "react/jsx-runtime";
679
-
680
- // ../renderers/src/ModalLayoutRenderer.tsx
681
- import { Button as Button4, Modal as Modal2 } from "@transferwise/components";
682
- import { useState as useState6 } from "react";
683
- import { jsx as jsx43, jsxs as jsxs10 } from "react/jsx-runtime";
684
-
685
- // ../renderers/src/ModalRenderer.tsx
686
- import { Modal as Modal3 } from "@transferwise/components";
687
- import { jsx as jsx44 } from "react/jsx-runtime";
688
-
689
- // ../renderers/src/MultiSelectInputRenderer.tsx
690
- import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
691
- import { useState as useState7 } from "react";
692
- import { useIntl as useIntl6 } from "react-intl";
693
-
694
- // ../renderers/src/messages/multi-select.messages.ts
695
- import { defineMessages as defineMessages5 } from "react-intl";
696
- var multi_select_messages_default = defineMessages5({
697
- summary: {
698
- id: "df.wise.MultiSelect.summary",
699
- defaultMessage: "{first} and {count} more",
700
- description: "A summary of the multiple items selected. Showing the title of the first selected item, and the number of other items that have been selected."
701
- }
702
- });
703
-
704
- // ../renderers/src/MultiSelectInputRenderer.tsx
705
- import { jsx as jsx45 } from "react/jsx-runtime";
706
-
707
- // ../renderers/src/MultiUploadInputRenderer.tsx
708
- import { UploadInput } from "@transferwise/components";
709
-
710
- // ../renderers/src/components/UploadFieldInput.tsx
711
- import { InlineAlert as InlineAlert2 } from "@transferwise/components";
712
- import classNames4 from "classnames";
713
- import { jsx as jsx46, jsxs as jsxs11 } from "react/jsx-runtime";
714
-
715
- // ../renderers/src/MultiUploadInputRenderer.tsx
716
- import { jsx as jsx47 } from "react/jsx-runtime";
717
-
718
- // ../renderers/src/NumberInputRenderer.tsx
719
- import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
720
- import { jsx as jsx48 } from "react/jsx-runtime";
721
-
722
- // ../renderers/src/ParagraphRenderer.tsx
723
- import { useIntl as useIntl7 } from "react-intl";
724
-
725
- // ../renderers/src/hooks/useSnackBarIfAvailable.ts
726
- import { SnackbarContext } from "@transferwise/components";
727
- import { useContext } from "react";
728
-
729
- // ../renderers/src/ParagraphRenderer.tsx
730
- import { Button as Button5, Input as Input3 } from "@transferwise/components";
731
- import classNames5 from "classnames";
732
-
733
- // ../renderers/src/messages/paragraph.messages.ts
734
- import { defineMessages as defineMessages6 } from "react-intl";
735
- var paragraph_messages_default = defineMessages6({
736
- copy: {
737
- id: "df.wise.DynamicParagraph.copy",
738
- defaultMessage: "Copy",
739
- description: "Copy to clipboard button label."
740
- },
741
- copied: {
742
- id: "df.wise.DynamicParagraph.copied",
743
- defaultMessage: "Copied to clipboard",
744
- description: "Appears in a snackbar when the copy operation succeeds."
745
- }
746
- });
747
-
748
- // ../renderers/src/ParagraphRenderer.tsx
749
- import { jsx as jsx49, jsxs as jsxs12 } from "react/jsx-runtime";
750
-
751
- // ../renderers/src/RepeatableRenderer.tsx
752
- import { Button as Button6, Header as Header6, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption as NavigationOption2 } from "@transferwise/components";
753
- import { Plus } from "@transferwise/icons";
754
- import classNames6 from "classnames";
755
- import { useState as useState8 } from "react";
756
- import { useIntl as useIntl8 } from "react-intl";
757
-
758
- // ../renderers/src/messages/repeatable.messages.ts
759
- import { defineMessages as defineMessages7 } from "react-intl";
760
- var repeatable_messages_default = defineMessages7({
761
- addItemTitle: {
762
- id: "df.wise.ArraySchema.addItemTitle",
763
- defaultMessage: "Add Item",
764
- description: "Label on the button used to open a form to add an item"
765
- },
766
- addItem: {
767
- id: "df.wise.ArraySchema.addItem",
768
- defaultMessage: "Save",
769
- description: "Label on the add button used to submit a form that adds an item"
770
- },
771
- editItem: {
772
- id: "df.wise.ArraySchema.editItem",
773
- defaultMessage: "Save",
774
- description: "Label on the edit button used to submit a form that edits an item"
775
- },
776
- removeItem: {
777
- id: "df.wise.ArraySchema.removeItem",
778
- defaultMessage: "Remove",
779
- description: "Label on the remove button used to confirm deletion of an item"
780
- }
781
- });
782
-
783
- // ../renderers/src/RepeatableRenderer.tsx
784
- import { Fragment as Fragment4, jsx as jsx50, jsxs as jsxs13 } from "react/jsx-runtime";
785
-
786
- // ../renderers/src/ReviewRenderer.tsx
787
- import { DefinitionList } from "@transferwise/components";
788
-
789
- // ../renderers/src/components/Header.tsx
790
- import { Header as DSHeader } from "@transferwise/components";
791
- import { jsx as jsx51 } from "react/jsx-runtime";
792
- var Header7 = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx51(DSHeader, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
793
- var getHeaderAction = (callToAction) => {
794
- if (!callToAction) {
795
- return void 0;
796
- }
797
- const { accessibilityDescription, href, title, onClick } = callToAction;
798
- return href ? {
799
- "aria-label": accessibilityDescription,
800
- text: title,
801
- href,
802
- target: "_blank"
803
- } : {
804
- "aria-label": accessibilityDescription,
805
- text: title,
806
- onClick: (event) => {
807
- event.preventDefault();
808
- onClick();
809
- }
810
- };
811
- };
812
-
813
- // ../renderers/src/ReviewRenderer.tsx
814
- import { Fragment as Fragment5, jsx as jsx52, jsxs as jsxs14 } from "react/jsx-runtime";
815
-
816
- // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
817
- import { Input as Input4, Markdown as Markdown4, NavigationOption as NavigationOption3, NavigationOptionsList as NavigationOptionsList2 } from "@transferwise/components";
818
- import { useState as useState9 } from "react";
819
- import { useIntl as useIntl10 } from "react-intl";
820
-
821
- // ../renderers/src/messages/search.messages.ts
822
- import { defineMessages as defineMessages8 } from "react-intl";
823
- var search_messages_default = defineMessages8({
824
- loading: {
825
- id: "df.wise.SearchLayout.loading",
826
- defaultMessage: "Loading...",
827
- description: "A message shown to the user while their search is being processed, before results appear."
828
- }
829
- });
830
-
831
- // ../renderers/src/SearchRenderer/ErrorResult.tsx
832
- import { useIntl as useIntl9 } from "react-intl";
833
-
834
- // ../renderers/src/messages/generic-error.messages.ts
835
- import { defineMessages as defineMessages9 } from "react-intl";
836
- var generic_error_messages_default = defineMessages9({
837
- genericErrorRetryHint: {
838
- id: "df.wise.PersistAsyncSchema.genericError",
839
- defaultMessage: "Something went wrong, please try again.",
840
- description: "Generic error message for persist async schema"
841
- },
842
- genericError: {
843
- id: "df.wise.ErrorBoundary.errorAlert",
844
- defaultMessage: "Something went wrong.",
845
- description: "Generic error message for when something has gone wrong."
846
- },
847
- retry: {
848
- id: "df.wise.ErrorBoundary.retry",
849
- defaultMessage: "Retry",
850
- description: "Usually this follows the generic error and contains a link."
851
- }
852
- });
853
-
854
- // ../renderers/src/SearchRenderer/ErrorResult.tsx
855
- import { Link } from "@transferwise/components";
856
- import { jsx as jsx53, jsxs as jsxs15 } from "react/jsx-runtime";
857
-
858
- // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
859
- import { Fragment as Fragment6, jsx as jsx54, jsxs as jsxs16 } from "react/jsx-runtime";
860
-
861
- // ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
862
- import { Markdown as Markdown5, Typeahead } from "@transferwise/components";
863
- import { Search } from "@transferwise/icons";
864
- import { useState as useState10 } from "react";
865
- import { useIntl as useIntl11 } from "react-intl";
866
- import { jsx as jsx55 } from "react/jsx-runtime";
867
-
868
- // ../renderers/src/SearchRenderer/SearchRenderer.tsx
869
- import { jsx as jsx56 } from "react/jsx-runtime";
870
-
871
- // ../renderers/src/SectionRenderer.tsx
872
- import { Header as Header8 } from "@transferwise/components";
873
- import { jsx as jsx57, jsxs as jsxs17 } from "react/jsx-runtime";
874
-
875
- // ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
876
- import { RadioGroup } from "@transferwise/components";
877
- import { Fragment as Fragment7, jsx as jsx58, jsxs as jsxs18 } from "react/jsx-runtime";
878
-
879
- // ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
880
- import { Tabs } from "@transferwise/components";
881
- import { useEffect as useEffect5 } from "react";
882
- import { Fragment as Fragment8, jsx as jsx59, jsxs as jsxs19 } from "react/jsx-runtime";
883
-
884
- // ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
885
- import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
886
- import { Fragment as Fragment9, jsx as jsx60, jsxs as jsxs20 } from "react/jsx-runtime";
887
-
888
- // ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
889
- import { useEffect as useEffect6 } from "react";
890
- import { SegmentedControl } from "@transferwise/components";
891
- import { Fragment as Fragment10, jsx as jsx61, jsxs as jsxs21 } from "react/jsx-runtime";
892
-
893
- // ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
894
- import { jsx as jsx62 } from "react/jsx-runtime";
895
-
896
- // ../renderers/src/StatusListRenderer.tsx
897
- import { Header as Header9, Summary } from "@transferwise/components";
898
- import { jsx as jsx63, jsxs as jsxs22 } from "react/jsx-runtime";
899
-
900
- // ../renderers/src/utils/useCustomTheme.ts
901
- import { useTheme } from "@wise/components-theming";
902
- import { useEffect as useEffect7, useMemo } from "react";
903
-
904
- // ../renderers/src/step/topbar/BackButton.tsx
905
- import { IconButton } from "@transferwise/components";
906
- import { ArrowLeft } from "@transferwise/icons";
907
- import { jsx as jsx64, jsxs as jsxs23 } from "react/jsx-runtime";
908
-
909
- // ../renderers/src/step/topbar/Toolbar.tsx
910
- import { Button as Button7, IconButton as IconButton2 } from "@transferwise/components";
911
- import { jsx as jsx65, jsxs as jsxs24 } from "react/jsx-runtime";
912
-
913
- // ../renderers/src/step/topbar/TopBar.tsx
914
- import { jsx as jsx66, jsxs as jsxs25 } from "react/jsx-runtime";
915
-
916
- // ../renderers/src/step/SplashCelebrationStepRenderer.tsx
917
- import { jsx as jsx67, jsxs as jsxs26 } from "react/jsx-runtime";
918
-
919
- // ../renderers/src/step/SplashStepRenderer.tsx
920
- import { jsx as jsx68, jsxs as jsxs27 } from "react/jsx-runtime";
921
-
922
- // ../renderers/src/step/StepRenderer.tsx
923
- import { Alert as Alert2, Title as Title2 } from "@transferwise/components";
924
- import { Fragment as Fragment11, jsx as jsx69, jsxs as jsxs28 } from "react/jsx-runtime";
925
-
926
- // ../renderers/src/TabsRenderer.tsx
927
- import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
928
- import { useState as useState11 } from "react";
929
- import { jsx as jsx70, jsxs as jsxs29 } from "react/jsx-runtime";
930
-
931
- // ../renderers/src/TextInputRenderer.tsx
932
- import { InputGroup as InputGroup3 } from "@transferwise/components";
933
-
934
- // ../renderers/src/components/VariableTextInput.tsx
935
- import {
936
- Input as Input5,
937
- InputWithDisplayFormat,
938
- PhoneNumberInput,
939
- TextArea,
940
- TextareaWithDisplayFormat
941
- } from "@transferwise/components";
942
- import { jsx as jsx71 } from "react/jsx-runtime";
943
-
944
- // ../renderers/src/TextInputRenderer.tsx
945
- import { jsx as jsx72 } from "react/jsx-runtime";
946
-
947
- // ../renderers/src/UploadInputRenderer.tsx
948
- import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
949
- import { jsx as jsx73 } from "react/jsx-runtime";
950
-
951
- // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
952
- import { ListItem as ListItem4 } from "@transferwise/components";
953
-
954
- // ../renderers/src/NewListItem/getInlineAlert.tsx
955
- import { ListItem as ListItem2 } from "@transferwise/components";
956
- import { jsx as jsx74 } from "react/jsx-runtime";
957
- var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ jsx74(ListItem2.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
958
-
959
- // ../renderers/src/NewListItem/getAdditionalInfo.tsx
960
- import { ListItem as ListItem3 } from "@transferwise/components";
961
- import { jsx as jsx75 } from "react/jsx-runtime";
962
- var getAdditionalInfo = (additionalInfo) => {
963
- if (!additionalInfo) {
964
- return void 0;
965
- }
966
- const { href, text, onClick } = additionalInfo;
967
- if (href || onClick) {
968
- return /* @__PURE__ */ jsx75(
969
- ListItem3.AdditionalInfo,
970
- {
971
- action: {
972
- label: text,
973
- href,
974
- onClick,
975
- target: "_blank"
976
- }
977
- }
978
- );
979
- }
980
- return /* @__PURE__ */ jsx75(ListItem3.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
981
- };
982
-
983
- // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
984
- import { Fragment as Fragment12, jsx as jsx76 } from "react/jsx-runtime";
985
- var DecisionRenderer = {
986
- canRenderType: "decision",
987
- render: (props) => /* @__PURE__ */ jsx76(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
988
- };
989
- var renderDecisionList = ({ options, control }) => {
990
- return /* @__PURE__ */ jsx76(Fragment12, { children: options.map((option) => {
991
- const {
992
- description,
993
- disabled,
994
- media,
995
- title: itemTitle,
996
- tag,
997
- href,
998
- additionalText,
999
- inlineAlert,
1000
- supportingValues,
1001
- onClick
1002
- } = option;
1003
- return /* @__PURE__ */ jsx76(
1004
- ListItem4,
1005
- {
1006
- title: itemTitle,
1007
- subtitle: description,
1008
- spotlight: control === "spotlight" ? tag === "spotlight-active" ? "active" : "inactive" : void 0,
1009
- disabled,
1010
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
1011
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
1012
- media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
1013
- prompt: getInlineAlert(inlineAlert),
1014
- additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
1015
- control: href ? /* @__PURE__ */ jsx76(ListItem4.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ jsx76(ListItem4.Navigation, { onClick })
1016
- },
1017
- JSON.stringify(option)
1018
- );
1019
- }) });
1020
- };
1021
- var NewDecisionRenderer_default = DecisionRenderer;
1022
-
1023
- // ../renderers/src/NewListItem/NewListRenderer.tsx
1024
- import { ListItem as ListItem5 } from "@transferwise/components";
1025
- import { jsx as jsx77, jsxs as jsxs30 } from "react/jsx-runtime";
1026
- var ListRenderer = {
1027
- canRenderType: "list",
1028
- render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ jsxs30("div", { className: getMargin(margin), children: [
1029
- /* @__PURE__ */ jsx77(Header7, { title, callToAction }),
1030
- items.map((item) => {
1031
- const {
1032
- title: itemTitle,
1033
- description,
1034
- supportingValues,
1035
- media,
1036
- tag,
1037
- additionalInfo,
1038
- inlineAlert
1039
- } = item;
1040
- return /* @__PURE__ */ jsx77(
1041
- ListItem5,
1042
- {
1043
- title: itemTitle,
1044
- subtitle: description,
1045
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
1046
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
1047
- media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
1048
- prompt: getInlineAlert(inlineAlert),
1049
- additionalInfo: getAdditionalInfo(additionalInfo)
1050
- },
1051
- itemTitle
1052
- );
1053
- })
1054
- ] })
1055
- };
1056
- var NewListRenderer_default = ListRenderer;
1057
-
1058
- // ../renderers/src/NewListItem/NewReviewRenderer.tsx
1059
- import { ListItem as ListItem6, Popover } from "@transferwise/components";
1060
- import { QuestionMarkCircle } from "@transferwise/icons";
1061
- import { jsx as jsx78, jsxs as jsxs31 } from "react/jsx-runtime";
1062
- var IGNORED_CONTROLS = [
1063
- "horizontal",
1064
- "horizontal-end-aligned",
1065
- "horizontal-start-aligned",
1066
- "vertical-two-column"
1067
- ];
1068
- var ReviewRenderer = {
1069
- canRenderType: "review",
1070
- canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
1071
- render: ({ callToAction, control, margin, fields, title }) => /* @__PURE__ */ jsxs31("div", { className: getMargin(margin), children: [
1072
- /* @__PURE__ */ jsx78(Header7, { title, callToAction }),
1073
- fields.map((field) => {
1074
- var _a;
1075
- const {
1076
- label,
1077
- value,
1078
- media,
1079
- tag,
1080
- additionalInfo,
1081
- inlineAlert,
1082
- help,
1083
- callToAction: itemCallToAction
1084
- } = field;
1085
- return /* @__PURE__ */ jsx78(
1086
- ListItem6,
1087
- {
1088
- title: value,
1089
- subtitle: label,
1090
- inverted: true,
1091
- media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
1092
- control: (_a = getCTAControl(itemCallToAction)) != null ? _a : getHelpControl(help),
1093
- prompt: getInlineAlert(inlineAlert),
1094
- additionalInfo: getAdditionalInfo(additionalInfo)
1095
- },
1096
- JSON.stringify(field)
1097
- );
1098
- })
1099
- ] })
1100
- };
1101
- var getCTAControl = (callToAction) => {
1102
- if (!callToAction) {
1103
- return void 0;
1104
- }
1105
- const { accessibilityDescription, href, title, onClick } = callToAction;
1106
- if (href) {
1107
- return /* @__PURE__ */ jsx78(ListItem6.Button, { href, partiallyInteractive: true, "aria-description": accessibilityDescription, children: title });
1108
- }
1109
- return /* @__PURE__ */ jsx78(
1110
- ListItem6.Button,
1111
- {
1112
- "aria-description": accessibilityDescription,
1113
- partiallyInteractive: true,
1114
- onClick,
1115
- children: title
1116
- }
1117
- );
1118
- };
1119
- var getHelpControl = (help) => {
1120
- if (!help) {
1121
- return void 0;
1122
- }
1123
- return /* @__PURE__ */ jsx78(Popover, { content: help, children: /* @__PURE__ */ jsx78(ListItem6.IconButton, { partiallyInteractive: true, children: /* @__PURE__ */ jsx78(QuestionMarkCircle, {}) }) });
1124
- };
1125
- var NewReviewRenderer_default = ReviewRenderer;
1126
-
1127
- // ../renderers/src/NewListItem/NewStatusListRenderer.tsx
1128
- import { AvatarView as AvatarView4, Header as Header10, ListItem as ListItem7 } from "@transferwise/components";
1129
- import { jsx as jsx79, jsxs as jsxs32 } from "react/jsx-runtime";
1130
- var NewStatusListRenderer = {
1131
- canRenderType: "status-list",
1132
- render: ({ margin, items, title }) => /* @__PURE__ */ jsxs32("div", { className: getMargin(margin), children: [
1133
- title ? /* @__PURE__ */ jsx79(Header10, { title, className: "m-b-2" }) : null,
1134
- items.map((item) => {
1135
- const { callToAction, description, icon, status, title: itemTitle } = item;
1136
- return /* @__PURE__ */ jsx79(
1137
- ListItem7,
1138
- {
1139
- title: itemTitle,
1140
- subtitle: description,
1141
- media: icon && "name" in icon ? /* @__PURE__ */ jsx79(AvatarView4, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ jsx79(DynamicIcon_default, { name: icon.name }) }) : void 0,
1142
- additionalInfo: callToAction ? /* @__PURE__ */ jsx79(
1143
- ListItem7.AdditionalInfo,
1144
- {
1145
- action: {
1146
- href: callToAction.href,
1147
- onClick: callToAction.href ? void 0 : callToAction.onClick,
1148
- label: callToAction.title,
1149
- target: "_blank"
1150
- }
1151
- }
1152
- ) : void 0
1153
- },
1154
- JSON.stringify(item)
1155
- );
1156
- })
1157
- ] })
1158
- };
1159
- var mapStatus = (status) => {
1160
- switch (status) {
1161
- case "done":
1162
- return "positive";
1163
- case "pending":
1164
- return "pending";
1165
- default:
1166
- return void 0;
1167
- }
1168
- };
1169
- var NewStatusListRenderer_default = NewStatusListRenderer;
1170
-
1171
- // ../renderers/src/ButtonRenderer/ButtonRendererV2.tsx
1172
- import { Button as Button8 } from "@transferwise/components";
1173
-
1174
- // ../renderers/src/utils/isButtonPriority.ts
1175
- var validPriorities = ["primary", "secondary", "secondary-neutral", "tertiary"];
1176
- var isButtonPriority = (control) => validPriorities.includes(control);
1177
-
1178
- // ../renderers/src/ButtonRenderer/ButtonRendererV2.tsx
1179
- import { useEffect as useEffect8, useState as useState12 } from "react";
1180
- import { jsx as jsx80 } from "react/jsx-runtime";
1181
- var ButtonRendererV2 = {
1182
- canRenderType: "button",
1183
- render: ButtonComponent
1184
- };
1185
- function ButtonComponent(props) {
1186
- const { control, context, disabled, margin, title, size, stepLoadingState, onClick } = props;
1187
- const [spinny, setSpinny] = useState12(false);
1188
- useEffect8(() => {
1189
- if (stepLoadingState === "idle") {
1190
- setSpinny(false);
1191
- }
1192
- }, [stepLoadingState]);
1193
- const loading = spinny && stepLoadingState !== "idle";
1194
- return /* @__PURE__ */ jsx80(
1195
- Button8,
1196
- {
1197
- v2: true,
1198
- block: true,
1199
- className: getMargin(margin),
1200
- disabled,
1201
- priority: getPriority(control),
1202
- loading,
1203
- size: mapButtonSize(size),
1204
- sentiment: getSentiment(context),
1205
- onClick: () => {
1206
- setSpinny(true);
1207
- onClick();
1208
- },
1209
- children: title
1210
- }
1211
- );
1212
- }
1213
- var getSentiment = (context) => context === "negative" ? "negative" : "default";
1214
- var getPriority = (control) => control && isButtonPriority(control) ? control : "secondary";
1215
-
1216
- // ../renderers/src/ProgressRenderer.tsx
1217
- import { ProgressBar } from "@transferwise/components";
1218
- import { jsx as jsx81 } from "react/jsx-runtime";
1219
-
1220
- // ../renderers/src/getWiseRenderers.ts
1221
- var getListItemRenderers = () => [
1222
- NewDecisionRenderer_default,
1223
- NewListRenderer_default,
1224
- NewReviewRenderer_default,
1225
- NewStatusListRenderer_default
1226
- ];
1227
- var getButtonV2Renderers = () => [ButtonRendererV2];
1228
-
1229
- // src/dynamicFlow/renderers.ts
1230
- var Header11 = Header7;
1231
- var Media2 = Media;
1232
- var getMargin2 = getMargin;
1233
- var getListItemRenderers2 = getListItemRenderers;
1234
- var getButtonV2Renderers2 = getButtonV2Renderers;
1235
- export {
1236
- Header11 as Header,
1237
- Media2 as Media,
1238
- getButtonV2Renderers2 as getButtonV2Renderers,
1239
- getListItemRenderers2 as getListItemRenderers,
1240
- getMargin2 as getMargin
1241
- };