@adyen/kyc-components 3.58.2 → 3.59.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.
Files changed (38) hide show
  1. package/dist/es/{B4MFY5CR-CBLtiOPl.js → B4MFY5CR-DT1IN3Fl.js} +1 -1
  2. package/dist/es/DebugModal-C7PUDNlI.js +523 -0
  3. package/dist/es/{HO4MOOFI-CeXIExuC.js → HO4MOOFI-BYUilyom.js} +2 -2
  4. package/dist/es/{HUY7CZI3-luXydDA7.js → HUY7CZI3-BCSiY9T5.js} +2 -2
  5. package/dist/es/{Introduction-BVIDiOeK.js → Introduction-DIW5vd8c.js} +1 -1
  6. package/dist/es/adyen-kyc-components.es.js +2 -2
  7. package/dist/es/{css-BUQ-lDKy.js → css-B3bcTE7b.js} +1 -1
  8. package/dist/es/{index-Bx0rbc0C.js → index-CP8YzGVf.js} +958 -1178
  9. package/dist/es/{json-DpHF7B2M.js → json-BgrcnsOO.js} +1 -1
  10. package/dist/es/{plaintext-DgDFLkbp.js → plaintext-Kl2vsbEO.js} +1 -1
  11. package/dist/es/{yaml-B66s-9sv.js → yaml-C0rXP05J.js} +1 -1
  12. package/dist/style.css +60 -57
  13. package/dist/types/components/EFP/tasks/HighExposureDropin/HighExposureRegisteredAddress.d.ts +1 -1
  14. package/dist/types/components/EFP/tasks/HighExposureDropin/types.d.ts +0 -1
  15. package/dist/types/components/EmbeddedDropins/UpdateLegalEntityForHighExposure/utils.d.ts +1 -0
  16. package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/validate.d.ts +3 -1
  17. package/dist/types/components/Individual/forms/IndividualOnfido/BasicDetails/validate.d.ts +3 -0
  18. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.d.ts +5 -0
  19. package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.types.d.ts +2 -0
  20. package/dist/types/components/Individual/forms/IndividualOnfido/ManualIdUpload/ManualIdUpload.d.ts +1 -0
  21. package/dist/types/components/Shared/devex/DebugListener/DebugListener.d.ts +1 -0
  22. package/dist/types/components/Shared/fields/IdFieldTypeSelector/TaxIdNumberTypeSelector.d.ts +2 -1
  23. package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +4 -0
  24. package/dist/types/components/Shared/fields/TaxInformationField/TaxInformationField.d.ts +6 -0
  25. package/dist/types/components/Shared/forms/Address/Address.d.ts +1 -1
  26. package/dist/types/components/Shared/forms/Address/constants.d.ts +1 -1
  27. package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
  28. package/dist/types/core/models/identityOnfido.d.ts +33 -0
  29. package/dist/types/core/process-field-configurations.d.ts +1 -0
  30. package/dist/types/utils/entityStatusUtil.d.ts +1 -1
  31. package/package.json +1 -1
  32. package/dist/types/components/Shared/devex/DebugWrapper/DebugWrapper.d.ts +0 -5
  33. /package/dist/types/components/Shared/devex/{DebugWrapper → DebugListener}/DebugExperimentsAndSettings.d.ts +0 -0
  34. /package/dist/types/components/Shared/devex/{DebugWrapper → DebugListener}/DebugLegalEntityData.d.ts +0 -0
  35. /package/dist/types/components/Shared/devex/{DebugWrapper → DebugListener}/DebugMetadata.d.ts +0 -0
  36. /package/dist/types/components/Shared/devex/{DebugWrapper → DebugListener}/DebugModal.d.ts +0 -0
  37. /package/dist/types/components/Shared/devex/{DebugWrapper → DebugListener}/DebugTaskStatuses.d.ts +0 -0
  38. /package/dist/types/components/Shared/devex/{DebugWrapper → DebugListener}/debugInfo.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { h as createContext, i as createSignal, o as onMount, j as createEffect, e as createMemo, f as createComponent, P as Portal, k as Show, l as template, m as insert, n as createRenderEffect, p as className, q as clearDelegatedEvents, r as delegateEvents, s as useContext, v as onCleanup, w as sortFns, x as mutationSortFns, y as on, z as setAttribute, A as getSidedProp, C as use, D as createUniqueId, E as batch, F as getQueryStatusLabel, G as getMutationStatusColor, H as getQueryStatusColor, I as getQueryStatusColorByLabel, J as displayValue, K as For, M as convertRemToPixels, N as untrack, $ as $TRACK, O as useTransition, Q as spread, R as mergeProps, U as createRoot, V as serialize, W as Index, X as updateNestedDataByPath, Y as addEventListener, Z as stringify, _ as Match, a0 as Switch, a1 as deleteNestedDataByPath, a2 as splitProps, a3 as Dynamic, a4 as createComputed } from "./index-Bx0rbc0C.js";
4
+ import { z as createContext, A as createSignal, C as onMount, D as createEffect, x as createMemo, y as createComponent, P as Portal, F as Show, G as template, H as insert, J as createRenderEffect, K as className, N as clearDelegatedEvents, O as delegateEvents, Q as useContext, R as onCleanup, U as sortFns, V as mutationSortFns, W as on, X as setAttribute, Y as getSidedProp, Z as use, _ as createUniqueId, $ as batch, a0 as getQueryStatusLabel, a1 as getMutationStatusColor, a2 as getQueryStatusColor, a3 as getQueryStatusColorByLabel, a4 as displayValue, a5 as For, a6 as convertRemToPixels, a7 as untrack, a8 as $TRACK, a9 as useTransition, aa as spread, ab as mergeProps, ac as createRoot, ad as serialize, ae as Index, af as updateNestedDataByPath, ag as addEventListener, ah as stringify, ai as Match, aj as Switch, ak as deleteNestedDataByPath, al as splitProps, am as Dynamic, an as createComputed } from "./index-CP8YzGVf.js";
5
5
  var isNonNullable = (i2) => i2 != null;
6
6
  var filterNonNullable = (arr) => arr.filter(isNonNullable);
7
7
  function chain(callbacks) {
@@ -0,0 +1,523 @@
1
+ import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
2
+ import { useMemo, useState } from "preact/hooks";
3
+ import { B as Button, d as Tag, e as entriesOf, I as InputText, b as useI18nContext, s as splitTaskIdentifier, f as TaskItemStatus, h as useExperimentsContext, i as useSettingsContext, j as useGlobalStore, l as listToRecord, v as valuesOf, k as useTaskStatuses, M as Modal, m as ModalHeader, n as ModalContent, o as ModalFooter, p as createLogger, q as Icon, r as SettingNames, E as ExperimentNames } from "./index-CP8YzGVf.js";
4
+ const tabs = "adyen-kyc-tabs";
5
+ const styles$1 = {
6
+ tabs
7
+ };
8
+ const Tabs = ({ tabs: tabs2, activeTab, onChange }) => /* @__PURE__ */ jsx("div", { className: styles$1.tabs, children: tabs2.map(({ name, label, disabled }) => {
9
+ const buttonVariant = activeTab === name ? "secondary" : "tertiary";
10
+ return /* @__PURE__ */ jsx(
11
+ Button,
12
+ {
13
+ onClick: () => onChange(name),
14
+ variant: buttonVariant,
15
+ disabled,
16
+ children: label
17
+ },
18
+ name
19
+ );
20
+ }) });
21
+ const filterData = (data, searchTerm) => data.filter(({ key }) => key.toLowerCase().includes(searchTerm.toLowerCase()));
22
+ const sortData = (data) => [...data].sort(({ key: keyA }, { key: keyB }) => keyA.localeCompare(keyB));
23
+ const DebugTable = ({
24
+ data,
25
+ heading,
26
+ searchTerm,
27
+ tagPosition = "after",
28
+ sort = false
29
+ }) => {
30
+ const filteredData = useMemo(() => {
31
+ const filtered = searchTerm ? filterData(data, searchTerm) : data;
32
+ return sort ? sortData(filtered) : filtered;
33
+ }, [data, searchTerm]);
34
+ return /* @__PURE__ */ jsxs("div", { children: [
35
+ heading ? /* @__PURE__ */ jsx("h3", { children: heading }) : void 0,
36
+ filteredData.length === 0 ? /* @__PURE__ */ jsxs("p", { children: [
37
+ "No results found for ",
38
+ /* @__PURE__ */ jsx("strong", { children: searchTerm })
39
+ ] }) : /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsx("tbody", { children: filteredData.map(({ key, value, label, variant }) => /* @__PURE__ */ jsxs("tr", { children: [
40
+ tagPosition === "before" ? /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Tag, { variant: variant ?? "grey", children: value }) }) : void 0,
41
+ /* @__PURE__ */ jsxs("td", { children: [
42
+ /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: key }),
43
+ label && /* @__PURE__ */ jsx("span", { children: label })
44
+ ] }),
45
+ tagPosition === "after" ? /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Tag, { variant: variant ?? "grey", children: value }) }) : void 0
46
+ ] }, key)) }) })
47
+ ] });
48
+ };
49
+ const getSettingVariant = (value) => {
50
+ switch (value) {
51
+ case void 0:
52
+ return "orange";
53
+ case true:
54
+ return "green";
55
+ case false:
56
+ return "red";
57
+ default:
58
+ return "blue";
59
+ }
60
+ };
61
+ const DebugExperimentsAndSettings = ({
62
+ experiments,
63
+ settings
64
+ }) => {
65
+ const [searchTerm, setSearchTerm] = useState("");
66
+ const experimentRows = entriesOf(experiments).map(
67
+ ([experimentName, enabled]) => ({
68
+ key: `${experimentName}`,
69
+ value: enabled ? "Enabled" : "Disabled",
70
+ variant: enabled ? "green" : "red"
71
+ })
72
+ );
73
+ const settingRows = entriesOf(settings).map(([settingName, value]) => ({
74
+ key: settingName,
75
+ value: `${value}`,
76
+ variant: getSettingVariant(value)
77
+ }));
78
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
79
+ /* @__PURE__ */ jsx(
80
+ InputText,
81
+ {
82
+ name: "search",
83
+ value: searchTerm,
84
+ classNameModifiers: ["search"],
85
+ onInput: (e) => setSearchTerm(e.target.value),
86
+ placeholder: "Search for Experiments/Settings 🔎",
87
+ trimOnBlur: true,
88
+ spellCheck: false,
89
+ "aria-label": "Search experiments or settings",
90
+ "aria-invalid": false
91
+ }
92
+ ),
93
+ /* @__PURE__ */ jsx(
94
+ DebugTable,
95
+ {
96
+ tagPosition: "before",
97
+ data: experimentRows,
98
+ heading: "Experiments",
99
+ searchTerm,
100
+ sort: true
101
+ }
102
+ ),
103
+ /* @__PURE__ */ jsx(DebugTable, { data: settingRows, heading: "Settings", searchTerm, sort: true })
104
+ ] });
105
+ };
106
+ const getRanges = (search, element) => {
107
+ var _a;
108
+ const textNode = element.childNodes[0];
109
+ const content = (_a = textNode.textContent) == null ? void 0 : _a.toLowerCase();
110
+ if (!content)
111
+ return [];
112
+ const indexes = [];
113
+ const matches = [...content.matchAll(search)];
114
+ matches.forEach((match) => {
115
+ indexes.push({ s: match.index, e: match.index + match[0].length });
116
+ });
117
+ return indexes.map((index) => {
118
+ const range = new Range();
119
+ range.setStart(textNode, index.s);
120
+ range.setEnd(textNode, index.e);
121
+ return range;
122
+ });
123
+ };
124
+ const createHighlightFn = (name, highlight, el, scope) => {
125
+ return CSS.highlights.set(`${name}-${scope}`, new Highlight(...getRanges(highlight.regex, el)));
126
+ };
127
+ const createHighlightCss = (name, highlight, scope) => {
128
+ return `::highlight(${name}-${scope}) { color: var(${highlight.css}); }`;
129
+ };
130
+ const transformModule = (highlights, codeNode, scope) => {
131
+ return Object.entries(highlights).map(([name, definition]) => ({
132
+ apply: () => createHighlightFn(name, definition, codeNode, scope),
133
+ css: createHighlightCss(name, definition, scope)
134
+ }));
135
+ };
136
+ const supportedModules = ["plaintext", "json", "yaml", "css"];
137
+ const moduleMap = {
138
+ plaintext: () => import("./plaintext-Kl2vsbEO.js"),
139
+ json: () => import("./json-BgrcnsOO.js"),
140
+ yaml: () => import("./yaml-C0rXP05J.js"),
141
+ css: () => import("./css-B3bcTE7b.js")
142
+ };
143
+ const getModule = async (name) => {
144
+ if (!supportedModules.includes(name)) {
145
+ const plaintext = await moduleMap["plaintext"]();
146
+ return plaintext.default;
147
+ }
148
+ const module = await moduleMap[name]();
149
+ if (!module) {
150
+ const plaintext = await moduleMap["plaintext"]();
151
+ return plaintext.default;
152
+ }
153
+ return module.default;
154
+ };
155
+ const cssProps = {
156
+ text: "--mng-text",
157
+ background: "--mng-background",
158
+ string: "--mng-string",
159
+ key: "--mng-key",
160
+ number: "--mng-number",
161
+ boolean: "--mng-boolean",
162
+ null: "--mng-null",
163
+ comment: "--mng-comment",
164
+ curlyBrackets: "--mng-curly-brackets",
165
+ squareBrackets: "--mng-square-brackets",
166
+ keyword: "--mng-keyword",
167
+ dashes: "--mng-dashes"
168
+ };
169
+ const css = `
170
+ * {
171
+ box-sizing: border-box;
172
+ }
173
+ :host {
174
+ display: inline-grid;
175
+ white-space: pre-line;
176
+ }
177
+ pre {
178
+ width: 100%;
179
+ height: 100%;
180
+ padding: 1em;
181
+ margin: 0;
182
+ background-color: var(${cssProps.background});
183
+ color: var(${cssProps.text});
184
+ }
185
+ code {
186
+ width: 100%;
187
+ height: 100%;
188
+ display: inline-block;
189
+ outline: none;
190
+ white-space: pre-line;
191
+ }
192
+
193
+ :host {
194
+ ${cssProps.text}: #213547;
195
+ ${cssProps.background}: #f1f1f1;
196
+ ${cssProps.string}: #8b251e;
197
+ ${cssProps.key}: #c32b1d;
198
+ ${cssProps.number}: #4a845b;
199
+ ${cssProps.boolean}: #3716f5;
200
+ ${cssProps.null}: #3716f5;
201
+ ${cssProps.comment}: #4e862d;
202
+ ${cssProps.curlyBrackets}: #59913e;
203
+ ${cssProps.squareBrackets}: #59913e;
204
+ ${cssProps.keyword}: #666;
205
+ ${cssProps.dashes}: #444;
206
+ }
207
+
208
+ @media (prefers-color-scheme: dark) {
209
+ :host {
210
+ ${cssProps.text}: #f1f1f1;
211
+ ${cssProps.background}: #1f1f1f;
212
+ ${cssProps.string}: #ce916f;
213
+ ${cssProps.key}: #9cdcfe;
214
+ ${cssProps.number}: #b5cea8;
215
+ ${cssProps.boolean}: #569cd6;
216
+ ${cssProps.null}: #569cd6;
217
+ ${cssProps.comment}: #438a55;
218
+ ${cssProps.curlyBrackets}: #ffd708;
219
+ ${cssProps.squareBrackets}: #da70b9;
220
+ ${cssProps.keyword}: #dcdcaa;
221
+ ${cssProps.dashes}: #ddd;
222
+ }
223
+ }`;
224
+ let MonogonCode$1 = class MonogonCode extends HTMLElement {
225
+ constructor() {
226
+ super();
227
+ Object.defineProperty(this, "value", {
228
+ enumerable: true,
229
+ configurable: true,
230
+ writable: true,
231
+ value: ""
232
+ });
233
+ Object.defineProperty(this, "codeEl", {
234
+ enumerable: true,
235
+ configurable: true,
236
+ writable: true,
237
+ value: null
238
+ });
239
+ Object.defineProperty(this, "styleEl", {
240
+ enumerable: true,
241
+ configurable: true,
242
+ writable: true,
243
+ value: null
244
+ });
245
+ Object.defineProperty(this, "applyHighlights", {
246
+ enumerable: true,
247
+ configurable: true,
248
+ writable: true,
249
+ value: () => {
250
+ }
251
+ });
252
+ }
253
+ async connectedCallback() {
254
+ await this.prepare();
255
+ setTimeout(() => {
256
+ this.refresh();
257
+ }, 1);
258
+ }
259
+ async attributeChangedCallback(oldValue, newValue) {
260
+ if (oldValue !== newValue) {
261
+ await this.refresh();
262
+ }
263
+ }
264
+ async prepare() {
265
+ const shadow = this.shadowRoot || this.attachShadow({ mode: "open" });
266
+ shadow.innerHTML = "";
267
+ const themeStyleEl = document.createElement("style");
268
+ themeStyleEl.textContent = css;
269
+ shadow.appendChild(themeStyleEl);
270
+ const preEl = document.createElement("pre");
271
+ const codeEl = document.createElement("code");
272
+ codeEl.setAttribute("contenteditable", "plaintext-only");
273
+ codeEl.setAttribute("spellcheck", "false");
274
+ shadow.appendChild(preEl);
275
+ preEl.appendChild(codeEl);
276
+ codeEl.addEventListener("input", () => {
277
+ this.codeEl.normalize();
278
+ this.value = this.codeEl.textContent ?? "";
279
+ this.applyHighlights();
280
+ });
281
+ this.codeEl = codeEl;
282
+ this.styleEl = themeStyleEl;
283
+ }
284
+ async refresh() {
285
+ var _a;
286
+ if (!this.codeEl)
287
+ return;
288
+ const moduleName = this.getAttribute("lang") ?? "plaintext";
289
+ const module = await getModule(moduleName);
290
+ const content = this.getAttribute("content") ?? "";
291
+ this.value = content;
292
+ this.codeEl.textContent = module.format ? module.format(content) : content;
293
+ if (!((_a = this.codeEl.childNodes) == null ? void 0 : _a[0]))
294
+ return;
295
+ const littleHash = window.crypto.randomUUID().substring(0, 6);
296
+ const definitions = transformModule(module.definitions, this.codeEl, littleHash);
297
+ const moduleCss = definitions.map((m) => m.css).join(" ");
298
+ this.styleEl.textContent += `${moduleCss}`;
299
+ this.applyHighlights = () => {
300
+ definitions.forEach((highlight) => {
301
+ highlight.apply();
302
+ });
303
+ };
304
+ this.applyHighlights();
305
+ }
306
+ };
307
+ Object.defineProperty(MonogonCode$1, "observedAttributes", {
308
+ enumerable: true,
309
+ configurable: true,
310
+ writable: true,
311
+ value: ["content", "lang"]
312
+ });
313
+ if (!customElements.get("monogon-code"))
314
+ customElements.define("monogon-code", MonogonCode$1);
315
+ const MonogonCode2 = ({ content, lang }) => {
316
+ return /* @__PURE__ */ jsx("monogon-code", { content, lang });
317
+ };
318
+ const DebugLegalEntityData = ({ legalEntityData }) => {
319
+ var _a;
320
+ if (!legalEntityData) return /* @__PURE__ */ jsx(Fragment, {});
321
+ const { rootLegalEntity, rootLegalEntityType } = legalEntityData;
322
+ const uboDetails = ((_a = rootLegalEntity.entityAssociations) == null ? void 0 : _a.map(
323
+ ({ name, type, jobTitle }) => (
324
+ // If `name` is undefined, replace the tuple with `null` to easily filter it out later. Checking this to ensure that the 'data' for DebugTable always has a keyName.
325
+ name ? {
326
+ key: name,
327
+ value: `${type}`,
328
+ label: jobTitle,
329
+ variant: "blue"
330
+ } : null
331
+ )
332
+ ).filter(Boolean)) ?? [];
333
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
334
+ /* @__PURE__ */ jsxs("span", { children: [
335
+ "Root legal entity type: ",
336
+ /* @__PURE__ */ jsx(Tag, { children: rootLegalEntityType })
337
+ ] }),
338
+ uboDetails.length ? /* @__PURE__ */ jsx(DebugTable, { data: uboDetails, heading: "Decision Makers" }) : void 0,
339
+ rootLegalEntity ? /* @__PURE__ */ jsx(MonogonCode2, { lang: "json", content: JSON.stringify(rootLegalEntity, null, 2) }) : void 0
340
+ ] });
341
+ };
342
+ const DebugMetadata = ({
343
+ metadata: { sdkVersion, locale, rootLegalEntityId }
344
+ }) => {
345
+ const rows = [
346
+ { key: "SDK version", value: sdkVersion, variant: "green" },
347
+ { key: "Locale", value: locale, variant: "blue" },
348
+ { key: "Root legal entity ID", value: rootLegalEntityId, variant: "teal" }
349
+ ];
350
+ return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx(DebugTable, { data: rows }) });
351
+ };
352
+ const header = "adyen-kyc-header";
353
+ const taskName = "adyen-kyc-task-name";
354
+ const table = "adyen-kyc-table";
355
+ const styles = {
356
+ header,
357
+ taskName,
358
+ table
359
+ };
360
+ const DebugTaskStatuses = ({ taskStatuses }) => {
361
+ const { i18n } = useI18nContext();
362
+ return /* @__PURE__ */ jsxs("table", { className: styles.table, children: [
363
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: styles.header, children: [
364
+ /* @__PURE__ */ jsx("th", { children: i18n.get("task") }),
365
+ /* @__PURE__ */ jsx("th", { children: i18n.get("status") }),
366
+ /* @__PURE__ */ jsx("th", { children: i18n.get("reason") })
367
+ ] }) }),
368
+ /* @__PURE__ */ jsx("tbody", { children: entriesOf(taskStatuses).sort(([t1], [t2]) => t1.localeCompare(t2)).map(([task, status]) => {
369
+ const { taskType, id } = splitTaskIdentifier(task);
370
+ return /* @__PURE__ */ jsxs("tr", { children: [
371
+ /* @__PURE__ */ jsxs("td", { className: styles.taskName, children: [
372
+ taskType,
373
+ id ? `: ${id}` : ""
374
+ ] }),
375
+ status ? /* @__PURE__ */ jsxs(Fragment, { children: [
376
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(TaskItemStatus, { status: status.status }) }),
377
+ /* @__PURE__ */ jsxs("td", { children: [
378
+ i18n.get(status.reason),
379
+ /* @__PURE__ */ jsx(ExplainDetails, { status })
380
+ ] })
381
+ ] }) : /* @__PURE__ */ jsx(Fragment, {})
382
+ ] }, task);
383
+ }) })
384
+ ] });
385
+ };
386
+ const ExplainDetails = ({ status }) => {
387
+ const { reason, details } = status;
388
+ switch (reason) {
389
+ case "invalidInputError": {
390
+ const verificationError = details.verificationError;
391
+ const subErrors = verificationError.subErrors;
392
+ return /* @__PURE__ */ jsxs("div", { children: [
393
+ verificationError.code,
394
+ ": ",
395
+ verificationError.message,
396
+ subErrors ? /* @__PURE__ */ jsx("ul", { children: (verificationError.subErrors ?? []).map((subError) => /* @__PURE__ */ jsxs("li", { children: [
397
+ subError.code,
398
+ ": ",
399
+ subError.message
400
+ ] }, subError.code)) }) : /* @__PURE__ */ jsx(Fragment, {})
401
+ ] });
402
+ }
403
+ case "dataMissingError": {
404
+ const verificationError = details.verificationError;
405
+ const subErrors = verificationError.subErrors;
406
+ return /* @__PURE__ */ jsxs("div", { children: [
407
+ verificationError.code,
408
+ ": ",
409
+ verificationError.message,
410
+ subErrors ? /* @__PURE__ */ jsx("ul", { children: (verificationError.subErrors ?? []).map((subError) => /* @__PURE__ */ jsxs("li", { children: [
411
+ subError.code,
412
+ ": ",
413
+ subError.message
414
+ ] }, subError.code)) }) : /* @__PURE__ */ jsx(Fragment, {})
415
+ ] });
416
+ }
417
+ case "pendingCapabilities": {
418
+ const pendingCapabilities = details.pendingCapabilities;
419
+ return /* @__PURE__ */ jsx("ul", { children: pendingCapabilities.map((capabilityName) => /* @__PURE__ */ jsx("li", { children: capabilityName }, capabilityName)) });
420
+ }
421
+ }
422
+ };
423
+ const logger = createLogger("DebugModal");
424
+ const DebugModal = ({ onExit }) => {
425
+ const { isExperimentEnabled } = useExperimentsContext();
426
+ const { getSetting } = useSettingsContext();
427
+ const [debugInfoCopied, setDebugInfoCopied] = useState(false);
428
+ const { i18n } = useI18nContext();
429
+ const [tab, setTab] = useState("metadata");
430
+ const rootLegalEntity = useGlobalStore((store) => store.rootLegalEntity);
431
+ const metadata = {
432
+ sdkVersion: "3.59.0",
433
+ locale: i18n.locale,
434
+ rootLegalEntityId: rootLegalEntity.id
435
+ };
436
+ const experiments = listToRecord(valuesOf(ExperimentNames), isExperimentEnabled);
437
+ const settings = listToRecord(valuesOf(SettingNames), getSetting);
438
+ const taskStatuses = useTaskStatuses();
439
+ const legalEntityData = {
440
+ rootLegalEntity,
441
+ rootLegalEntityType: rootLegalEntity.type
442
+ };
443
+ const copyToClipboard = async () => {
444
+ const toCopy = {
445
+ metadata,
446
+ experiments,
447
+ settings,
448
+ taskStatuses,
449
+ legalEntityData
450
+ };
451
+ await window.navigator.clipboard.writeText(JSON.stringify(toCopy, null, 2));
452
+ setDebugInfoCopied(true);
453
+ setTimeout(() => {
454
+ setDebugInfoCopied(false);
455
+ }, 5e3);
456
+ };
457
+ return /* @__PURE__ */ jsxs(Modal, { size: "fullscreen", onClose: onExit, children: [
458
+ /* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__header", children: [
459
+ /* @__PURE__ */ jsx("h1", { children: "Debug" }),
460
+ " ",
461
+ /* @__PURE__ */ jsx(
462
+ Tabs,
463
+ {
464
+ activeTab: tab,
465
+ onChange: (tab2) => setTab(tab2),
466
+ tabs: [
467
+ {
468
+ name: "metadata",
469
+ label: "Metadata"
470
+ },
471
+ {
472
+ name: "experimentsSettings",
473
+ label: "Experiments & Settings"
474
+ },
475
+ {
476
+ name: "taskStatuses",
477
+ label: "Task Statuses"
478
+ },
479
+ {
480
+ name: "legalEntityData",
481
+ label: "Legal Entity Data"
482
+ }
483
+ ]
484
+ }
485
+ )
486
+ ] }) }),
487
+ /* @__PURE__ */ jsx(ModalContent, { children: /* @__PURE__ */ jsxs(Fragment, { children: [
488
+ /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__content", children: [
489
+ tab === "metadata" ? /* @__PURE__ */ jsx(DebugMetadata, { metadata }) : void 0,
490
+ tab === "taskStatuses" ? /* @__PURE__ */ jsx(DebugTaskStatuses, { taskStatuses }) : void 0,
491
+ tab === "experimentsSettings" ? /* @__PURE__ */ jsx(DebugExperimentsAndSettings, { experiments, settings }) : void 0,
492
+ tab === "legalEntityData" ? /* @__PURE__ */ jsx(DebugLegalEntityData, { legalEntityData }) : void 0
493
+ ] }),
494
+ " "
495
+ ] }) }),
496
+ /* @__PURE__ */ jsx(ModalFooter, { children: /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__footer", children: /* @__PURE__ */ jsxs("div", { children: [
497
+ /* @__PURE__ */ jsx(
498
+ Button,
499
+ {
500
+ icon: "document",
501
+ onClick: () => {
502
+ copyToClipboard().catch((error) => {
503
+ logger.error("Error copying to clipboard:", error);
504
+ });
505
+ },
506
+ children: "Copy debug info"
507
+ }
508
+ ),
509
+ debugInfoCopied ? /* @__PURE__ */ jsxs("span", { className: "adyen-kyc-debug-modal__footer--copy-status", children: [
510
+ /* @__PURE__ */ jsx(Icon, { name: "check" }),
511
+ " Copied!"
512
+ ] }) : void 0
513
+ ] }) }) })
514
+ ] });
515
+ };
516
+ const DebugModal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
517
+ __proto__: null,
518
+ DebugModal
519
+ }, Symbol.toStringTag, { value: "Module" }));
520
+ export {
521
+ DebugModal$1 as D,
522
+ cssProps as c
523
+ };
@@ -1,5 +1,5 @@
1
- import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, D as Devtools, Q as QueryDevtoolsContext } from "./B4MFY5CR-CBLtiOPl.js";
2
- import { d as getPreferredColorScheme, e as createMemo, f as createComponent } from "./index-Bx0rbc0C.js";
1
+ import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, D as Devtools, Q as QueryDevtoolsContext } from "./B4MFY5CR-DT1IN3Fl.js";
2
+ import { w as getPreferredColorScheme, x as createMemo, y as createComponent } from "./index-CP8YzGVf.js";
3
3
  var DevtoolsComponent = (props) => {
4
4
  const [localStore, setLocalStore] = createLocalStorage({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, b as ParentPanel, C as ContentView, Q as QueryDevtoolsContext } from "./B4MFY5CR-CBLtiOPl.js";
2
- import { d as getPreferredColorScheme, e as createMemo, f as createComponent } from "./index-Bx0rbc0C.js";
1
+ import { c as createLocalStorage, T as THEME_PREFERENCE, P as PiPProvider, a as ThemeContext, b as ParentPanel, C as ContentView, Q as QueryDevtoolsContext } from "./B4MFY5CR-DT1IN3Fl.js";
2
+ import { w as getPreferredColorScheme, x as createMemo, y as createComponent } from "./index-CP8YzGVf.js";
3
3
  var DevtoolsPanelComponent = (props) => {
4
4
  const [localStore, setLocalStore] = createLocalStorage({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,6 +1,6 @@
1
1
  import { jsxs, Fragment, jsx } from "preact/jsx-runtime";
2
2
  import { useMemo as useMemo$1, useState, useEffect } from "preact/hooks";
3
- import { T as TaskTypes, L as LegalEntityType, u as useCanSeeIntroduction, a as useLegalEntityType, t as toCapitalized, g as getTranslationKeysByPrefix, b as useI18nContext, c as userEvents, S as StepProgressIndicator, B as Button } from "./index-Bx0rbc0C.js";
3
+ import { T as TaskTypes, L as LegalEntityType, u as useCanSeeIntroduction, a as useLegalEntityType, t as toCapitalized, g as getTranslationKeysByPrefix, b as useI18nContext, c as userEvents, S as StepProgressIndicator, B as Button } from "./index-CP8YzGVf.js";
4
4
  import { useMemo } from "preact/compat";
5
5
  var IntroductionScreens = ((IntroductionScreens2) => {
6
6
  IntroductionScreens2["PROLOGUE"] = "PROLOGUE";
@@ -1,4 +1,4 @@
1
- import { a6 } from "./index-Bx0rbc0C.js";
1
+ import { ao } from "./index-CP8YzGVf.js";
2
2
  export {
3
- a6 as default
3
+ ao as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { a5 as cssProps } from "./index-Bx0rbc0C.js";
1
+ import { c as cssProps } from "./DebugModal-C7PUDNlI.js";
2
2
  const definitions = {
3
3
  any: { regex: /.*/g, css: cssProps.text },
4
4
  property: { regex: /(^|[\r\n])[^:]*:/g, css: cssProps.key },