@adyen/kyc-components 2.60.0 → 2.61.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.
Files changed (39) hide show
  1. package/dist/es/adyen-kyc-components.es.js +535 -420
  2. package/dist/types/components/BasicInformation/types.d.ts +1 -1
  3. package/dist/types/components/BusinessDetails/types.d.ts +1 -1
  4. package/dist/types/components/DecisionMakers/component/DecisionMakersComponent.d.ts +1 -1
  5. package/dist/types/components/Dropins/BusinessDetailsDropin/components/BusinessDetailsDropinComponent.d.ts +1 -1
  6. package/dist/types/components/Dropins/BusinessDetailsDropin/types.d.ts +1 -1
  7. package/dist/types/components/Dropins/CompanyDropin/components/CompanyDropinComponent.d.ts +1 -1
  8. package/dist/types/components/Dropins/FormWrapper/FormWrapper.d.ts +1 -1
  9. package/dist/types/components/Dropins/IndividualDropin/components/IndividualDropinComponent.d.ts +1 -1
  10. package/dist/types/components/Dropins/PayoutDetailsDropin/components/PayoutDetailsDropinComponent.d.ts +1 -1
  11. package/dist/types/components/Dropins/PciDropin/components/PciDropinComponent.d.ts +1 -1
  12. package/dist/types/components/Dropins/ServiceAgreementDropinComponent/components/ServiceAgreementDropinComponent.d.ts +1 -1
  13. package/dist/types/components/Dropins/SolePropDropin/components/SolePropDropinComponent.d.ts +1 -1
  14. package/dist/types/components/Dropins/TrustDropin/components/TrustDropinComponent.d.ts +1 -1
  15. package/dist/types/components/Dropins/types.d.ts +1 -4
  16. package/dist/types/components/EmbeddedDropins/UpdateLegalEntityForHighExposure/UpdateLegalEntityForHighExposure.d.ts +1 -1
  17. package/dist/types/components/Introduction/Introduction.d.ts +1 -1
  18. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/DriversLicense.d.ts +1 -1
  19. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityNZ/component/DriversLicense.d.ts +1 -1
  20. package/dist/types/components/RegistrationAddress/types.d.ts +1 -1
  21. package/dist/types/components/TaskList/component/TaskListComponent.d.ts +1 -1
  22. package/dist/types/components/TaskList/types.d.ts +0 -3
  23. package/dist/types/components/internal/ContextGuidance/types.d.ts +1 -1
  24. package/dist/types/components/internal/FormFields/Checkbox/Checkbox.d.ts +2 -1
  25. package/dist/types/components/internal/FormFields/Dropzone/FilePicker.d.ts +2 -1
  26. package/dist/types/components/internal/FormFields/Dropzone/types.d.ts +2 -0
  27. package/dist/types/components/internal/FormFields/InputBase.d.ts +1 -0
  28. package/dist/types/components/internal/FormFields/RadioGroup/RadioGroup.d.ts +2 -1
  29. package/dist/types/components/internal/FormFields/RadioGroupCard/RadioCardSelect.d.ts +2 -1
  30. package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
  31. package/dist/types/components/internal/FormFields/Select/components/SelectButton.d.ts +1 -1
  32. package/dist/types/components/internal/FormFields/Select/types.d.ts +3 -0
  33. package/dist/types/core/analytics.d.ts +19 -0
  34. package/dist/types/core/hooks/useFormComposer.d.ts +1 -1
  35. package/dist/types/core/models/api/analytics.d.ts +1 -0
  36. package/dist/types/core/user-events.d.ts +36 -8
  37. package/dist/types/core/utils.d.ts +0 -22
  38. package/dist/types/utils/trackNavigation.d.ts +3 -5
  39. package/package.json +1 -1
@@ -1,16 +1,119 @@
1
1
  import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
2
2
  import { useContext, useState, useCallback, useEffect, useMemo, useReducer, useId, useRef, useLayoutEffect } from "preact/hooks";
3
+ import { debounce as debounce$1 } from "lodash-es";
3
4
  import { createContext, isValidElement, createElement, render } from "preact";
4
5
  import DOMPurify from "isomorphic-dompurify";
5
6
  import cx from "classnames";
6
7
  import { lazy, Suspense, forwardRef, memo, useMemo as useMemo$1 } from "preact/compat";
7
- import debounce$1 from "lodash-es/debounce";
8
+ import debounce$2 from "lodash-es/debounce";
8
9
  import isISIN from "validator/es/lib/isISIN.js";
9
10
  import { Onfido } from "onfido-sdk-ui";
10
11
  import OpenBankingSDK from "@adyen/openbankingsdk";
11
12
  import { jsxs as jsxs$1, jsx as jsx$1 } from "preact/compat/jsx-runtime";
12
13
  import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
13
14
  import AdyenDocumentViewer from "@adyen/adyen-document-viewer";
15
+ class UserEvents {
16
+ constructor() {
17
+ this.queue = [];
18
+ this.subscriptions = /* @__PURE__ */ new Set();
19
+ this.updateSharedEventProperties = (props) => {
20
+ this.sharedEventProperties = { ...this.sharedEventProperties, ...props };
21
+ };
22
+ this.baseTrackingPayload = {
23
+ category: "onboarding",
24
+ subCategory: "hosted onboarding",
25
+ countryCode: void 0,
26
+ capabilities: void 0,
27
+ legalEntityId: void 0,
28
+ task: void 0
29
+ };
30
+ this.sharedEventProperties = {};
31
+ }
32
+ add(...args) {
33
+ this.queue.push(...args);
34
+ }
35
+ notifySubscribers() {
36
+ while (this.queue.length > 0) {
37
+ const lastEvent = this.queue.pop();
38
+ this.subscriptions.forEach((callback) => callback(lastEvent));
39
+ }
40
+ }
41
+ /**
42
+ * Adds an analytics event.
43
+ */
44
+ addEvent(eventName, properties) {
45
+ const completeEvent = { ...this.baseTrackingPayload, ...properties };
46
+ this.add({ type: "add_event", name: eventName, properties: { ...completeEvent } });
47
+ this.notifySubscribers();
48
+ }
49
+ /**
50
+ * Starts a timer for an event to measure the time it takes for an event to occur. Time is ended when `addEvent` is executed with the same key
51
+ */
52
+ startEvent(eventName) {
53
+ this.add({ type: "start_event", name: eventName });
54
+ this.notifySubscribers();
55
+ }
56
+ /**
57
+ * Adds an event with context specific to field-related events
58
+ */
59
+ addFieldEvent(eventName, properties) {
60
+ this.addEvent(eventName, {
61
+ actionLevel: "field",
62
+ page: this.sharedEventProperties.page,
63
+ ...properties
64
+ });
65
+ }
66
+ /**
67
+ * Subscribes a callback to analytics events. It gets called every time
68
+ * one of the above public methods get called, and the event data is passed back as an array.
69
+ * The callback must have a single argument which is an array of [eventName, eventPayload?].
70
+ * @example
71
+ * ```js
72
+ * const callback = ([eventName, eventPayload]) => console.log(eventName, eventPayload);
73
+ * this.subscribe(callback);
74
+ *
75
+ * const exampleEventPayload = { count: 1, segmentation: { foo: 'bar' } };
76
+ * this.addEvent('exampleEventDidOccur', exampleEventPayload);
77
+ *
78
+ * // `callback` will get called with `['exampleEventDidOccur', exampleEventPayload]`
79
+ * ```
80
+ */
81
+ subscribe(callback) {
82
+ this.subscriptions.add(callback);
83
+ }
84
+ /** Sets params that are sent on every event */
85
+ updateBaseTrackingPayload(baseTrackingPayload) {
86
+ this.baseTrackingPayload = { ...this.baseTrackingPayload, ...baseTrackingPayload };
87
+ }
88
+ /**
89
+ * Removes a subscribed callback
90
+ */
91
+ unsubscribe(callback) {
92
+ if (this.subscriptions.has(callback)) {
93
+ this.subscriptions.delete(callback);
94
+ }
95
+ }
96
+ }
97
+ const userEvents = new UserEvents();
98
+ const getAssociatedLeAnalyticsPayload = ({
99
+ task,
100
+ associatedLegalEntity,
101
+ associatedLegalEntityOrg
102
+ }) => ({
103
+ task,
104
+ ...associatedLegalEntity ? {
105
+ associatedLegalEntityId: associatedLegalEntity == null ? void 0 : associatedLegalEntity.id,
106
+ associatedLegalEntityType: associatedLegalEntity == null ? void 0 : associatedLegalEntity.type
107
+ } : {},
108
+ ...associatedLegalEntityOrg ? {
109
+ associatedLegalEntityOrgId: associatedLegalEntityOrg == null ? void 0 : associatedLegalEntityOrg.id,
110
+ associatedLegalEntityOrgType: associatedLegalEntityOrg == null ? void 0 : associatedLegalEntityOrg.type
111
+ } : {}
112
+ });
113
+ const debouncedInputEvent$1 = debounce$1(
114
+ (properties) => userEvents.addFieldEvent("Interacted with form field", properties),
115
+ 500
116
+ );
14
117
  const ConfigurationApiContext = createContext(void 0);
15
118
  const useConfigurationApi = () => {
16
119
  const configurationApi = useContext(ConfigurationApiContext);
@@ -3639,6 +3742,16 @@ const Field = ({
3639
3742
  passedValue: focused,
3640
3743
  skipUpdate: focused === void 0
3641
3744
  });
3745
+ useEffect(() => {
3746
+ if (!errorMessage) return;
3747
+ const returnValue = typeof errorMessage === "string" && errorMessage || "invalid";
3748
+ userEvents.addFieldEvent("Encountered error", {
3749
+ actionType: "input",
3750
+ field: label,
3751
+ returnType: "validation",
3752
+ returnValue
3753
+ });
3754
+ }, [label, errorMessage]);
3642
3755
  return /* @__PURE__ */ jsx(
3643
3756
  "div",
3644
3757
  {
@@ -3766,6 +3879,7 @@ function SelectButtonElement({
3766
3879
  return /* @__PURE__ */ jsx("button", { ...props, ref: toggleButtonRef, type: "button" });
3767
3880
  }
3768
3881
  function SelectButton({
3882
+ name,
3769
3883
  active,
3770
3884
  readonly,
3771
3885
  showList,
@@ -3783,14 +3897,25 @@ function SelectButton({
3783
3897
  isMulti,
3784
3898
  id,
3785
3899
  isSearch,
3786
- hideSearchIcon = false,
3787
3900
  loading,
3788
- textFilter
3901
+ hideSearchIcon = false,
3902
+ textFilter,
3903
+ enableTracking = false
3789
3904
  }) {
3790
- const title = (active == null ? void 0 : active.length) ? active.map(({ name }) => name).join(",") : placeholder;
3905
+ const title = (active == null ? void 0 : active.length) ? active.map(({ name: name2 }) => name2).join(",") : placeholder;
3906
+ const handleSelect = (e, callback) => {
3907
+ if (enableTracking) {
3908
+ userEvents.addFieldEvent("Interacted with form field", {
3909
+ actionType: "focus",
3910
+ field: name
3911
+ });
3912
+ }
3913
+ callback(e);
3914
+ };
3791
3915
  return /* @__PURE__ */ jsx(
3792
3916
  SelectButtonElement,
3793
3917
  {
3918
+ name,
3794
3919
  "aria-disabled": readonly,
3795
3920
  "aria-expanded": showList,
3796
3921
  "aria-haspopup": "listbox",
@@ -3803,8 +3928,8 @@ function SelectButton({
3803
3928
  "adyen-kyc-dropdown-button-search": isSearch
3804
3929
  }),
3805
3930
  filterable,
3806
- onClick: !readonly ? toggleList : void 0,
3807
- onKeyDown: !readonly ? onButtonKeyDown : void 0,
3931
+ onClick: !readonly ? (e) => handleSelect(e, toggleList) : void 0,
3932
+ onKeyDown: !readonly ? (e) => handleSelect(e, onButtonKeyDown) : void 0,
3808
3933
  role: filterable || isMulti ? "button" : void 0,
3809
3934
  tabIndex: 0,
3810
3935
  title,
@@ -3907,8 +4032,20 @@ function Checkbox({
3907
4032
  helper,
3908
4033
  checked,
3909
4034
  disabled,
4035
+ enableTracking = false,
3910
4036
  ...props
3911
4037
  }) {
4038
+ const field = typeof label === "string" ? label : props.name;
4039
+ const handleChange = (newValue) => {
4040
+ if (enableTracking) {
4041
+ userEvents.addFieldEvent("Interacted with form field", {
4042
+ actionType: "input",
4043
+ field,
4044
+ returnValue: String(newValue)
4045
+ });
4046
+ }
4047
+ onChange(newValue);
4048
+ };
3912
4049
  return /* @__PURE__ */ jsxs("label", { className: "adyen-kyc-checkbox", children: [
3913
4050
  /* @__PURE__ */ jsx(
3914
4051
  "input",
@@ -3925,7 +4062,7 @@ function Checkbox({
3925
4062
  type: "checkbox",
3926
4063
  onClick: (event) => {
3927
4064
  event.stopPropagation();
3928
- onChange(!checked);
4065
+ handleChange(!checked);
3929
4066
  }
3930
4067
  }
3931
4068
  ),
@@ -4137,7 +4274,8 @@ const Select = ({
4137
4274
  getSearchItem,
4138
4275
  searchText,
4139
4276
  onSearchTextChange,
4140
- showSearchList
4277
+ showSearchList,
4278
+ enableTracking = false
4141
4279
  }) => {
4142
4280
  const filterInputRef = useRef(null);
4143
4281
  const selectContainerRef = useRef(null);
@@ -4149,7 +4287,7 @@ const Select = ({
4149
4287
  const active = items.filter((i) => !isMulti ? i.id === selected : selected == null ? void 0 : selected.includes(i.id)) || [];
4150
4288
  const [isShowListAbove, setIsShowListAbove] = useState(false);
4151
4289
  const [scrollParent, setScrollParent] = useState(null);
4152
- const debouncedOnSearch = useCallback(debounce$1(onSearch, 500), [onSearch]);
4290
+ const debouncedOnSearch = useCallback(debounce$2(onSearch, 500), [onSearch]);
4153
4291
  const closeList = () => {
4154
4292
  if (!onSearchTextChange) setTextFilter(null);
4155
4293
  setIsShowList(false);
@@ -4175,17 +4313,28 @@ const Select = ({
4175
4313
  const hideList = () => {
4176
4314
  setIsShowList(false);
4177
4315
  };
4178
- const handleSelect = (selectedItem) => {
4179
- if (readonly) return;
4180
- if (isMulti) {
4181
- const isAlreadySelected = active.find((item) => item.id === selectedItem.id);
4182
- const newActiveItems = isAlreadySelected ? [...active.filter((i) => i.id !== selectedItem.id).map((i) => i.id)] : [...active.map((i) => i.id), selectedItem.id];
4183
- onChange({ target: { value: newActiveItems, name } });
4184
- } else {
4185
- closeList();
4186
- onChange({ target: { value: selectedItem.id, name } });
4187
- }
4188
- };
4316
+ const handleSelect = useCallback(
4317
+ (selectedItem) => {
4318
+ if (readonly) return;
4319
+ if (isMulti) {
4320
+ const isAlreadySelected = active.find((item) => item.id === selectedItem.id);
4321
+ const newActiveItems = isAlreadySelected ? [...active.filter((i) => i.id !== selectedItem.id).map((i) => i.id)] : [...active.map((i) => i.id), selectedItem.id];
4322
+ onChange({ target: { value: newActiveItems, name } });
4323
+ } else {
4324
+ const handleOnChange = onChange;
4325
+ closeList();
4326
+ handleOnChange({ target: { value: selectedItem.id, name } });
4327
+ }
4328
+ if (enableTracking) {
4329
+ userEvents.addFieldEvent("Interacted with form field", {
4330
+ actionType: "select",
4331
+ field: name
4332
+ });
4333
+ }
4334
+ if (showSearchList) setIsShowList(showSearchList);
4335
+ },
4336
+ [active, closeList, isMulti, name, onChange, readonly, showSearchList, enableTracking]
4337
+ );
4189
4338
  const handleButtonKeyDown = (e) => {
4190
4339
  var _a;
4191
4340
  if (e.key === KEYBOARD_KEYS.enter && filterable && isShowList && textFilter) {
@@ -4246,18 +4395,24 @@ const Select = ({
4246
4395
  break;
4247
4396
  }
4248
4397
  };
4249
- const handleTextFilter = (e) => {
4250
- const { value } = e.target;
4251
- if (isSearch && value.length > 2) {
4252
- debouncedOnSearch(value);
4253
- }
4254
- if (onSearchTextChange) {
4255
- onSearchTextChange == null ? void 0 : onSearchTextChange(value);
4256
- setTextFilter(value);
4257
- } else {
4258
- setTextFilter(value.toLowerCase());
4259
- }
4260
- };
4398
+ const handleTextFilter = useCallback(
4399
+ (e) => {
4400
+ const { value } = e.target;
4401
+ if (enableTracking) {
4402
+ debouncedInputEvent$1({ actionType: "input", field: name });
4403
+ }
4404
+ if (isSearch && value.length > 2) {
4405
+ debouncedOnSearch(value);
4406
+ }
4407
+ if (onSearchTextChange) {
4408
+ onSearchTextChange == null ? void 0 : onSearchTextChange(value);
4409
+ setTextFilter(value);
4410
+ } else {
4411
+ setTextFilter(value.toLowerCase());
4412
+ }
4413
+ },
4414
+ [debouncedOnSearch, isSearch, onSearchTextChange, enableTracking, name]
4415
+ );
4261
4416
  const toggleList = (e) => {
4262
4417
  e.preventDefault();
4263
4418
  if (isShowList) {
@@ -4309,6 +4464,7 @@ const Select = ({
4309
4464
  SelectButton,
4310
4465
  {
4311
4466
  id: uniqueId ?? null,
4467
+ name,
4312
4468
  active,
4313
4469
  filterInputRef,
4314
4470
  filterable,
@@ -4328,7 +4484,8 @@ const Select = ({
4328
4484
  isSearch,
4329
4485
  hideSearchIcon: !!onSearchTextChange,
4330
4486
  loading,
4331
- textFilter
4487
+ textFilter,
4488
+ enableTracking
4332
4489
  }
4333
4490
  ),
4334
4491
  /* @__PURE__ */ jsx(
@@ -4853,15 +5010,24 @@ const useForwardedRef = (forwardedRef) => {
4853
5010
  };
4854
5011
  const convertFullToHalf = (str) => str.replace(/[!-~]/g, (r) => String.fromCharCode(r.charCodeAt(0) - 65248));
4855
5012
  const InputBase = forwardRef((props, ref) => {
4856
- const { classNameModifiers = [], uniqueId, ...passedProps } = props;
4857
- const { isInvalid, isValid, type = "text", disabled } = props;
5013
+ const { classNameModifiers = [], uniqueId, enableTracking = false, ...passedProps } = props;
5014
+ const { isInvalid, isValid, type = "text", disabled, name } = props;
4858
5015
  const handleInput = (e) => {
4859
5016
  var _a;
5017
+ if (enableTracking) {
5018
+ debouncedInputEvent$1({ actionType: "input", field: name });
5019
+ }
4860
5020
  e.target.value = convertFullToHalf(e.target.value);
4861
5021
  (_a = props.onInput) == null ? void 0 : _a.call(props, e);
4862
5022
  };
4863
5023
  const handleBlur = (e) => {
4864
5024
  var _a, _b;
5025
+ if (enableTracking) {
5026
+ userEvents.addFieldEvent("Interacted with form field", {
5027
+ actionType: "blur",
5028
+ field: name
5029
+ });
5030
+ }
4865
5031
  (_a = props.onBlurHandler) == null ? void 0 : _a.call(props, e);
4866
5032
  if (props.trimOnBlur) {
4867
5033
  e.target.value = e.target.value.trim();
@@ -4870,6 +5036,12 @@ const InputBase = forwardRef((props, ref) => {
4870
5036
  };
4871
5037
  const handleFocus = (e) => {
4872
5038
  var _a;
5039
+ if (enableTracking) {
5040
+ userEvents.addFieldEvent("Interacted with form field", {
5041
+ actionType: "focus",
5042
+ field: name
5043
+ });
5044
+ }
4873
5045
  (_a = props.onFocusHandler) == null ? void 0 : _a.call(props, e);
4874
5046
  };
4875
5047
  const inputClassNames = cx(
@@ -4887,6 +5059,7 @@ const InputBase = forwardRef((props, ref) => {
4887
5059
  "input",
4888
5060
  {
4889
5061
  ...passedProps,
5062
+ name,
4890
5063
  "aria-disabled": disabled,
4891
5064
  "aria-invalid": !isValid,
4892
5065
  "aria-required": passedProps.required,
@@ -7594,9 +7767,20 @@ function RadioGroup({
7594
7767
  disabled = false,
7595
7768
  horizontal = false,
7596
7769
  showContentOnlyOnSelected = false,
7597
- className
7770
+ className,
7771
+ enableTracking = false
7598
7772
  }) {
7599
7773
  const { i18n } = useI18nContext();
7774
+ const handleChange = (id) => {
7775
+ if (enableTracking) {
7776
+ userEvents.addFieldEvent("Interacted with form field", {
7777
+ actionType: "input",
7778
+ field: name,
7779
+ returnValue: value
7780
+ });
7781
+ }
7782
+ onChange(id);
7783
+ };
7600
7784
  return /* @__PURE__ */ jsx(
7601
7785
  "div",
7602
7786
  {
@@ -7617,7 +7801,7 @@ function RadioGroup({
7617
7801
  groupName: name,
7618
7802
  checked: isSelected,
7619
7803
  disabled,
7620
- onClick: () => onChange(item.id)
7804
+ onClick: () => handleChange(item.id)
7621
7805
  },
7622
7806
  item.id
7623
7807
  );
@@ -7970,74 +8154,6 @@ function BusinessRegistrationNumberField({
7970
8154
  )
7971
8155
  ] });
7972
8156
  }
7973
- class UserEvents {
7974
- constructor() {
7975
- this.queue = [];
7976
- this.subscriptions = /* @__PURE__ */ new Set();
7977
- this.baseTrackingPayload = {
7978
- category: "onboarding",
7979
- subCategory: "hosted onboarding",
7980
- countryCode: void 0,
7981
- capabilities: void 0,
7982
- legalEntityId: void 0
7983
- };
7984
- }
7985
- add(...args) {
7986
- this.queue.push(...args);
7987
- }
7988
- notifySubscribers() {
7989
- while (this.queue.length > 0) {
7990
- const lastEvent = this.queue.pop();
7991
- this.subscriptions.forEach((callback) => callback(lastEvent));
7992
- }
7993
- }
7994
- /**
7995
- * Adds an analytics event. Optionally can include a payload.
7996
- */
7997
- addEvent(eventName, properties) {
7998
- const completeEvent = { ...this.baseTrackingPayload, ...properties };
7999
- this.add({ type: "add_event", name: eventName, properties: { ...completeEvent } });
8000
- this.notifySubscribers();
8001
- }
8002
- /**
8003
- * Starts a timer for an event to measure the time it takes for an event to occur. Time is ended when `addEvent` is executed with the same key
8004
- */
8005
- startEvent(eventName) {
8006
- this.add({ type: "start_event", name: eventName });
8007
- this.notifySubscribers();
8008
- }
8009
- /**
8010
- * Subscribes a callback to analytics events. It gets called every time
8011
- * one of the above public methods get called, and the event data is passed back as an array.
8012
- * The callback must have a single argument which is an array of [eventName, eventPayload?].
8013
- * @example
8014
- * ```js
8015
- * const callback = ([eventName, eventPayload]) => console.log(eventName, eventPayload);
8016
- * this.subscribe(callback);
8017
- *
8018
- * const exampleEventPayload = { count: 1, segmentation: { foo: 'bar' } };
8019
- * this.addEvent('exampleEventDidOccur', exampleEventPayload);
8020
- *
8021
- * // `callback` will get called with `['exampleEventDidOccur', exampleEventPayload]`
8022
- * ```
8023
- */
8024
- subscribe(callback) {
8025
- this.subscriptions.add(callback);
8026
- }
8027
- /** Sets params that are sent on every event */
8028
- updateBaseTrackingPayload(baseTrackingPayload) {
8029
- this.baseTrackingPayload = { ...this.baseTrackingPayload, ...baseTrackingPayload };
8030
- }
8031
- /**
8032
- * Removes a subscribed callback
8033
- */
8034
- unsubscribe(callback) {
8035
- if (this.subscriptions.has(callback)) {
8036
- this.subscriptions.delete(callback);
8037
- }
8038
- }
8039
- }
8040
- const userEvents = new UserEvents();
8041
8157
  function ContextGuidance({
8042
8158
  page,
8043
8159
  title,
@@ -10895,7 +11011,7 @@ const isExistingFile = (file) => "existing" in file && file.existing;
10895
11011
  const isNewlyUploadedFile = (file) => !isExistingFile(file);
10896
11012
  function DropzoneFile(props) {
10897
11013
  var _a;
10898
- const { file, errorMessage, onDelete } = props;
11014
+ const { label, file, errorMessage, onDelete } = props;
10899
11015
  const { i18n } = useI18nContext();
10900
11016
  let documentIcon;
10901
11017
  const formatSize = (bytes) => {
@@ -10912,6 +11028,15 @@ function DropzoneFile(props) {
10912
11028
  default:
10913
11029
  documentIcon = "document";
10914
11030
  }
11031
+ useEffect(() => {
11032
+ if (!errorMessage) return;
11033
+ userEvents.addFieldEvent("Encountered error", {
11034
+ actionType: "change",
11035
+ field: label || "dropzone",
11036
+ returnType: "validation",
11037
+ returnValue: errorMessage
11038
+ });
11039
+ }, [label, errorMessage]);
10915
11040
  return /* @__PURE__ */ jsxs(
10916
11041
  "div",
10917
11042
  {
@@ -11024,7 +11149,8 @@ function Dropzone(props) {
11024
11149
  isOptional,
11025
11150
  maxNumberOfFiles = defaultFileValidationOptions.maxNumberOfFiles,
11026
11151
  maxSize = defaultFileValidationOptions.maxSize,
11027
- allowedFileTypes = defaultFileValidationOptions.allowedFileTypes
11152
+ allowedFileTypes = defaultFileValidationOptions.allowedFileTypes,
11153
+ enableTracking = false
11028
11154
  } = props;
11029
11155
  const { i18n } = useI18nContext();
11030
11156
  const fileInput = useRef(null);
@@ -11099,6 +11225,12 @@ function Dropzone(props) {
11099
11225
  };
11100
11226
  const handleFileChange = (e) => updateFiles(e.target);
11101
11227
  const updateFiles = ({ files }) => {
11228
+ if (enableTracking) {
11229
+ userEvents.addFieldEvent("Interacted with form field", {
11230
+ actionType: "change",
11231
+ field: label || "file picker"
11232
+ });
11233
+ }
11102
11234
  const currentFiles = (data == null ? void 0 : data[name]) || [];
11103
11235
  handleChangeFor(name, "input")([...currentFiles, ...files]);
11104
11236
  };
@@ -11134,6 +11266,7 @@ function Dropzone(props) {
11134
11266
  return /* @__PURE__ */ jsx(
11135
11267
  DropzoneFile,
11136
11268
  {
11269
+ label,
11137
11270
  file,
11138
11271
  onDelete: () => handleFileDelete(file),
11139
11272
  errorMessage: (_a2 = errors == null ? void 0 : errors[name]) == null ? void 0 : _a2.errorMessage
@@ -11183,6 +11316,10 @@ function Dropzone(props) {
11183
11316
  ] });
11184
11317
  }
11185
11318
  const logger$z = createLogger("TextArea");
11319
+ const debouncedInputEvent = debounce$2(
11320
+ (properties) => userEvents.addFieldEvent("Interacted with form field", properties),
11321
+ 500
11322
+ );
11186
11323
  function TextArea(props) {
11187
11324
  const { classNameModifiers, uniqueId, ...passedProps } = props;
11188
11325
  const {
@@ -11192,7 +11329,9 @@ function TextArea(props) {
11192
11329
  readonly = null,
11193
11330
  spellCheck,
11194
11331
  disabled,
11195
- maxLength
11332
+ maxLength,
11333
+ enableTracking = false,
11334
+ name
11196
11335
  } = props;
11197
11336
  const { i18n } = useI18nContext();
11198
11337
  const [value, setValue] = useState("");
@@ -11201,12 +11340,24 @@ function TextArea(props) {
11201
11340
  }
11202
11341
  const handleInput = (e) => {
11203
11342
  var _a;
11343
+ if (enableTracking) {
11344
+ debouncedInputEvent({
11345
+ actionType: "input",
11346
+ field: name
11347
+ });
11348
+ }
11204
11349
  e.target.value = convertFullToHalf(e.target.value);
11205
11350
  setValue(e.target.value);
11206
11351
  (_a = props == null ? void 0 : props.onInput) == null ? void 0 : _a.call(props, e);
11207
11352
  };
11208
11353
  const handleBlur = (e) => {
11209
11354
  var _a, _b;
11355
+ if (enableTracking) {
11356
+ userEvents.addFieldEvent("Interacted with form field", {
11357
+ actionType: "blur",
11358
+ field: name
11359
+ });
11360
+ }
11210
11361
  (_a = props == null ? void 0 : props.onBlurHandler) == null ? void 0 : _a.call(props, e);
11211
11362
  if (props.trimOnBlur) {
11212
11363
  e.target.value = e.target.value.trim();
@@ -11215,6 +11366,12 @@ function TextArea(props) {
11215
11366
  };
11216
11367
  const handleFocus = (e) => {
11217
11368
  var _a;
11369
+ if (enableTracking) {
11370
+ userEvents.addFieldEvent("Interacted with form field", {
11371
+ actionType: "focus",
11372
+ field: name
11373
+ });
11374
+ }
11218
11375
  (_a = props == null ? void 0 : props.onFocusHandler) == null ? void 0 : _a.call(props, e);
11219
11376
  };
11220
11377
  const inputClassNames = cx(
@@ -15675,27 +15832,40 @@ const RadioCardSelect = ({
15675
15832
  renderOptionBody,
15676
15833
  renderOptionFooter,
15677
15834
  isOptionDisabled,
15678
- floatingRadio
15679
- }) => /* @__PURE__ */ jsx("div", { className: className ?? "adyen-kyc-radio-group-card", children: options.map((option) => /* @__PURE__ */ jsx(
15680
- RadioCard,
15681
- {
15682
- optionId: optionId(option),
15683
- optionName: optionName(option),
15684
- optionDescription: optionDescription == null ? void 0 : optionDescription(option),
15685
- optionSubtitle: optionSubtitle == null ? void 0 : optionSubtitle(option),
15686
- isInvalid,
15687
- isSelected: selected === option,
15688
- onSelect: () => onSelect(option),
15689
- name,
15690
- classNames: optionClassNames == null ? void 0 : optionClassNames(option),
15691
- icon: renderOptionIcon == null ? void 0 : renderOptionIcon(option),
15692
- body: renderOptionBody == null ? void 0 : renderOptionBody(option),
15693
- footer: renderOptionFooter == null ? void 0 : renderOptionFooter(option),
15694
- disabled: isOptionDisabled == null ? void 0 : isOptionDisabled(option),
15695
- floatingRadio
15696
- },
15697
- optionId(option)
15698
- )) });
15835
+ floatingRadio,
15836
+ enableTracking = false
15837
+ }) => {
15838
+ const handleSelect = (option) => {
15839
+ if (enableTracking) {
15840
+ userEvents.addFieldEvent("Interacted with form field", {
15841
+ actionType: "input",
15842
+ field: name,
15843
+ returnValue: typeof option === "string" ? option : void 0
15844
+ });
15845
+ }
15846
+ onSelect(option);
15847
+ };
15848
+ return /* @__PURE__ */ jsx("div", { className: className ?? "adyen-kyc-radio-group-card", children: options.map((option) => /* @__PURE__ */ jsx(
15849
+ RadioCard,
15850
+ {
15851
+ optionId: optionId(option),
15852
+ optionName: optionName(option),
15853
+ optionDescription: optionDescription == null ? void 0 : optionDescription(option),
15854
+ optionSubtitle: optionSubtitle == null ? void 0 : optionSubtitle(option),
15855
+ isInvalid,
15856
+ isSelected: selected === option,
15857
+ onSelect: () => handleSelect(option),
15858
+ name,
15859
+ classNames: optionClassNames == null ? void 0 : optionClassNames(option),
15860
+ icon: renderOptionIcon == null ? void 0 : renderOptionIcon(option),
15861
+ body: renderOptionBody == null ? void 0 : renderOptionBody(option),
15862
+ footer: renderOptionFooter == null ? void 0 : renderOptionFooter(option),
15863
+ disabled: isOptionDisabled == null ? void 0 : isOptionDisabled(option),
15864
+ floatingRadio
15865
+ },
15866
+ optionId(option)
15867
+ )) });
15868
+ };
15699
15869
  const idVerificationMethodsMetadata = {
15700
15870
  instantVerification: {
15701
15871
  name: "instantVerification",
@@ -15855,47 +16025,6 @@ var TrustedFieldsProvider = /* @__PURE__ */ ((TrustedFieldsProvider2) => {
15855
16025
  TrustedFieldsProvider2["KOMPANY"] = "kompany";
15856
16026
  return TrustedFieldsProvider2;
15857
16027
  })(TrustedFieldsProvider || {});
15858
- function getBaseTrackingPayload({
15859
- trackingConfig = {
15860
- topLevelLegalEntity: {}
15861
- },
15862
- parentLegalEntity,
15863
- legalEntity,
15864
- task
15865
- }) {
15866
- const { topLevelLegalEntity } = trackingConfig;
15867
- const baseTrackingPayload = {
15868
- task,
15869
- entityType: topLevelLegalEntity == null ? void 0 : topLevelLegalEntity.type,
15870
- topLevelLegalEntityId: topLevelLegalEntity == null ? void 0 : topLevelLegalEntity.id,
15871
- topLevelLegalEntityType: topLevelLegalEntity == null ? void 0 : topLevelLegalEntity.type
15872
- };
15873
- if (parentLegalEntity) {
15874
- baseTrackingPayload.parentLegalEntityId = parentLegalEntity.id;
15875
- baseTrackingPayload.parentLegalEntityType = parentLegalEntity.type;
15876
- }
15877
- if (legalEntity) {
15878
- baseTrackingPayload.legalEntityId = legalEntity.id;
15879
- baseTrackingPayload.entityType = legalEntity.type;
15880
- }
15881
- return baseTrackingPayload;
15882
- }
15883
- const removeOldDataBySchema = (dataSubmitted, savedLegalEntityData) => {
15884
- Object.keys(savedLegalEntityData).forEach((formId) => {
15885
- if (savedLegalEntityData[formId]) {
15886
- Object.keys(savedLegalEntityData[formId]).forEach((key) => {
15887
- if (dataSubmitted[formId][key] === void 0) {
15888
- if (Array.isArray(savedLegalEntityData[formId][key])) {
15889
- dataSubmitted[formId][key] = [];
15890
- } else {
15891
- dataSubmitted[formId][key] = "";
15892
- }
15893
- }
15894
- });
15895
- }
15896
- });
15897
- return dataSubmitted;
15898
- };
15899
16028
  const getLegalEntityCountry = (legalEntityResponse) => legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? legalEntityResponse.individual.residentialAddress.country : legalEntityResponse.organization.registeredAddress.country;
15900
16029
  const getAgeToday = (birthdate) => {
15901
16030
  const today = /* @__PURE__ */ new Date();
@@ -18264,11 +18393,9 @@ function PersonalDetailsComponent(props) {
18264
18393
  }
18265
18394
  };
18266
18395
  const alertProps = getAlertProps();
18267
- const baseTrackingPayload = getBaseTrackingPayload({
18268
- trackingConfig: {
18269
- topLevelLegalEntity: props.parentLegalEntity
18270
- },
18271
- task: props.taskType
18396
+ const baseTrackingPayload = getAssociatedLeAnalyticsPayload({
18397
+ task: props.taskType,
18398
+ ...isDecisionMakerTask ? { associatedLegalEntity: props.parentLegalEntity } : {}
18272
18399
  });
18273
18400
  return /* @__PURE__ */ jsxs(LoaderWrapper, { status, formOpacityWhenLoading: 0.3, loaderSize: "large", children: [
18274
18401
  /* @__PURE__ */ jsx(StateContextSetter, { owner: PERSONAL_DETAILS, stateRef }),
@@ -19012,6 +19139,7 @@ function FilePicker({
19012
19139
  multiple = false,
19013
19140
  label,
19014
19141
  iconPrefix = "generic-document",
19142
+ enableTracking = false,
19015
19143
  // file validation options
19016
19144
  allowedFileTypes,
19017
19145
  maxSize,
@@ -19053,6 +19181,12 @@ function FilePicker({
19053
19181
  if (fileInput2.files) addFiles(fileInput2.files);
19054
19182
  };
19055
19183
  const addFiles = (newFiles) => {
19184
+ if (enableTracking) {
19185
+ userEvents.addFieldEvent("Interacted with form field", {
19186
+ actionType: "change",
19187
+ field: label || "dropzone"
19188
+ });
19189
+ }
19056
19190
  setFiles([...newFiles, ...files]);
19057
19191
  };
19058
19192
  const allowedFileTypesString = allowedFileTypes.join(", ");
@@ -19069,6 +19203,7 @@ function FilePicker({
19069
19203
  files.map((file) => /* @__PURE__ */ jsx(
19070
19204
  DropzoneFile,
19071
19205
  {
19206
+ label,
19072
19207
  file,
19073
19208
  onDelete: () => handleFileDelete(file),
19074
19209
  errorMessage,
@@ -21768,12 +21903,6 @@ function PayoutVerificationMethod(props) {
21768
21903
  const { dataset: countries } = useDataset(datasetIdentifier.country);
21769
21904
  const bankCountryName = ((_b = countries.find((country2) => country2.id === data.bankCountry)) == null ? void 0 : _b.name) ?? data.bankCountry;
21770
21905
  const allowedBankCountries = getAllowedBankCountries(country);
21771
- const baseTrackingPayload = getBaseTrackingPayload({
21772
- trackingConfig: {
21773
- topLevelLegalEntity: legalEntityResponse
21774
- },
21775
- task: TaskTypes.PAYOUT
21776
- });
21777
21906
  const countryField = /* @__PURE__ */ jsx(
21778
21907
  CountryField,
21779
21908
  {
@@ -21913,7 +22042,7 @@ function PayoutVerificationMethod(props) {
21913
22042
  /* @__PURE__ */ jsx(Typography, { children: i18n.get("adyenWillOnlyGetTemporaryAccess") }),
21914
22043
  /* @__PURE__ */ jsx(Link, { href: "https://www.adyen.com/policies-and-disclaimer/privacy-policy", external: true, children: /* @__PURE__ */ jsx(Typography, { variant: "caption", children: i18n.get("learnMore") }) })
21915
22044
  ] }),
21916
- baseTrackingPayload
22045
+ baseTrackingPayload: { task: TaskTypes.PAYOUT }
21917
22046
  }
21918
22047
  ) : void 0
21919
22048
  ] });
@@ -23924,16 +24053,15 @@ const trackNavigation = ({
23924
24053
  fromForm,
23925
24054
  toForm,
23926
24055
  component,
23927
- baseTrackingPayload,
23928
- i18n
24056
+ baseTrackingPayload
23929
24057
  }) => {
23930
24058
  userEvents.addEvent("Clicked button", {
23931
24059
  ...baseTrackingPayload,
23932
24060
  actionLevel: "page",
23933
24061
  actionType: "navigate",
23934
- page: i18n.get(fromForm),
24062
+ page: fromForm,
23935
24063
  label: component,
23936
- toPage: i18n.get(toForm)
24064
+ toPage: toForm
23937
24065
  });
23938
24066
  };
23939
24067
  const useHideButton = (condition, setHideState) => {
@@ -23989,6 +24117,9 @@ const useFormComposer = ({
23989
24117
  (activeForm2) => forms.find(({ formId }) => formId === activeForm2.formId) ?? activeForm2
23990
24118
  );
23991
24119
  }, [forms]);
24120
+ useEffect(() => {
24121
+ userEvents.updateSharedEventProperties({ page: activeForm.formHeading || activeForm.formId });
24122
+ }, [activeForm]);
23992
24123
  useEffect(() => {
23993
24124
  if (hasAlreadyNavigatedForm) return;
23994
24125
  const openingStep = getOpeningStep(forms, problems == null ? void 0 : problems.remediationActions);
@@ -24001,7 +24132,7 @@ const useFormComposer = ({
24001
24132
  ...baseTrackingPayload,
24002
24133
  actionLevel: "page",
24003
24134
  actionType: "next",
24004
- page: i18n.get(formName)
24135
+ page: formName
24005
24136
  });
24006
24137
  };
24007
24138
  const gotoFormByFormIndex = (nextFormIndex) => {
@@ -24044,8 +24175,7 @@ const useFormComposer = ({
24044
24175
  fromForm: activeForm.formName,
24045
24176
  toForm: forms[toFormIndex].formName,
24046
24177
  component: "ActionBar",
24047
- baseTrackingPayload,
24048
- i18n
24178
+ baseTrackingPayload
24049
24179
  });
24050
24180
  trackSectionCompletion(activeForm.formName);
24051
24181
  };
@@ -24060,8 +24190,7 @@ const useFormComposer = ({
24060
24190
  fromForm: fromForm.formName,
24061
24191
  toForm: toForm.formName,
24062
24192
  component: "ActionBar",
24063
- baseTrackingPayload,
24064
- i18n
24193
+ baseTrackingPayload
24065
24194
  });
24066
24195
  }
24067
24196
  };
@@ -27624,10 +27753,25 @@ const FormWrapper = ({
27624
27753
  ExperimentNames.ShowExtraTaxExemptionReasons
27625
27754
  );
27626
27755
  const showTaxExemptedLegalCaption = showExtraTaxExemptionReasons && ((_a = summaryData.companyRegistrationDetails) == null ? void 0 : _a.vatAbsenceReason) && ["companyDetails", "businessDetails"].includes(taskName);
27756
+ const handleTrackNavigation = useCallback(
27757
+ ({
27758
+ fromForm,
27759
+ toForm,
27760
+ component
27761
+ }) => {
27762
+ trackNavigation({
27763
+ fromForm,
27764
+ toForm,
27765
+ component,
27766
+ baseTrackingPayload
27767
+ });
27768
+ },
27769
+ [baseTrackingPayload]
27770
+ );
27627
27771
  const summaryContent = /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
27628
27772
  Summary,
27629
27773
  {
27630
- trackNavigation: (payload) => trackNavigation({ ...payload, i18n, baseTrackingPayload }),
27774
+ trackNavigation: handleTrackNavigation,
27631
27775
  data: summaryData,
27632
27776
  omittedKeys,
27633
27777
  omittedForms,
@@ -27717,7 +27861,7 @@ const FormWrapper = ({
27717
27861
  gotoForm: gotoFormByFormIndex,
27718
27862
  validateForm,
27719
27863
  taskName,
27720
- trackNavigation: ({ fromForm, toForm, component }) => trackNavigation({ fromForm, toForm, component, baseTrackingPayload, i18n }),
27864
+ trackNavigation: handleTrackNavigation,
27721
27865
  verificationErrors: problems == null ? void 0 : problems.verificationErrors
27722
27866
  }
27723
27867
  )
@@ -27747,6 +27891,22 @@ const validateErrorCode = (error, errorCode) => error && "errorCode" in error &&
27747
27891
  const isValidationError = (error) => validateErrorCode(error, API_VALIDATION_ERROR_CODE);
27748
27892
  const isIdDocumentUploadError = (error) => validateErrorCode(error, ID_DOCUMENT_UPLOAD_ERROR_CODE);
27749
27893
  const isBankStatementUploadError = (error) => validateErrorCode(error, BANK_STATEMENT_UPLOAD_ERROR_CODE);
27894
+ const removeOldDataBySchema = (dataSubmitted, savedLegalEntityData) => {
27895
+ Object.keys(savedLegalEntityData).forEach((formId) => {
27896
+ if (savedLegalEntityData[formId]) {
27897
+ Object.keys(savedLegalEntityData[formId]).forEach((key) => {
27898
+ if (dataSubmitted[formId][key] === void 0) {
27899
+ if (Array.isArray(savedLegalEntityData[formId][key])) {
27900
+ dataSubmitted[formId][key] = [];
27901
+ } else {
27902
+ dataSubmitted[formId][key] = "";
27903
+ }
27904
+ }
27905
+ });
27906
+ }
27907
+ });
27908
+ return dataSubmitted;
27909
+ };
27750
27910
  const processValidationErrors = (validationError, dropinTask, keyMappings) => {
27751
27911
  if ((validationError == null ? void 0 : validationError.invalidFields) && (validationError == null ? void 0 : validationError.invalidFields.length) > 0) {
27752
27912
  return validationError == null ? void 0 : validationError.invalidFields.reduce((acc, invalidField) => {
@@ -28101,7 +28261,6 @@ function BusinessDetailsDropinComponent({
28101
28261
  legalEntityResponse,
28102
28262
  isTargetLegalEntityType,
28103
28263
  parentLegalEntity,
28104
- trackingConfig,
28105
28264
  capabilities,
28106
28265
  taskName,
28107
28266
  hideDropinLayout,
@@ -28127,17 +28286,20 @@ function BusinessDetailsDropinComponent({
28127
28286
  const {
28128
28287
  state: { currentState }
28129
28288
  } = useStateContext();
28289
+ const baseTrackingPayload = useMemo(
28290
+ () => getAssociatedLeAnalyticsPayload({
28291
+ task: taskType,
28292
+ associatedLegalEntity: parentLegalEntity
28293
+ }),
28294
+ [parentLegalEntity, taskType]
28295
+ );
28130
28296
  useEffect(() => {
28131
28297
  onChange == null ? void 0 : onChange(currentState);
28132
28298
  }, [currentState, onChange]);
28133
28299
  useEffect(() => {
28300
+ userEvents.updateBaseTrackingPayload({ task: taskType });
28134
28301
  userEvents.addEvent("Landed on page", {
28135
- ...getBaseTrackingPayload({
28136
- trackingConfig,
28137
- parentLegalEntity,
28138
- legalEntity: legalEntityResponse,
28139
- task: taskType
28140
- }),
28302
+ ...baseTrackingPayload,
28141
28303
  actionLevel: "task",
28142
28304
  actionType: "start"
28143
28305
  });
@@ -28183,15 +28345,6 @@ function BusinessDetailsDropinComponent({
28183
28345
  );
28184
28346
  const [showCompanyStructure, setShowCompanyStructure] = useState(currentCountry !== "US");
28185
28347
  const [showBusinessSelection, setShowBusinessSelection] = useState(false);
28186
- const baseTrackingPayload = useMemo(
28187
- () => getBaseTrackingPayload({
28188
- trackingConfig,
28189
- parentLegalEntity,
28190
- legalEntity: legalEntityResponse,
28191
- task: taskType
28192
- }),
28193
- [legalEntityResponse, parentLegalEntity, taskType, trackingConfig]
28194
- );
28195
28348
  const getConfigurationData = useCallback(
28196
28349
  () => getConfiguration2({
28197
28350
  legalEntityType: LegalEntityType.ORGANIZATION,
@@ -28472,11 +28625,17 @@ function BusinessDetailsDropinComponent({
28472
28625
  ]
28473
28626
  );
28474
28627
  const nextClick = useCallback(() => {
28475
- var _a2;
28628
+ var _a2, _b2;
28476
28629
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return handleNextClick();
28630
+ const toFormName = (_a2 = forms[forms.findIndex((form) => form.formId === activeForm.formId) + 1]) == null ? void 0 : _a2.formName;
28477
28631
  switch (activeForm.formId) {
28478
28632
  case "basicInformation":
28479
- if (((_a2 = currentState.validityByForm) == null ? void 0 : _a2.basicInformation) && !isBusinessSelection && !verifiedBusiness) {
28633
+ if (((_b2 = currentState.validityByForm) == null ? void 0 : _b2.basicInformation) && !isBusinessSelection && !verifiedBusiness) {
28634
+ trackNavigation({
28635
+ fromForm: activeForm.formName,
28636
+ toForm: toFormName || "home",
28637
+ component: "next"
28638
+ });
28480
28639
  findBusiness(currentState.data.basicInformation);
28481
28640
  setShowBusinessSelection(true);
28482
28641
  break;
@@ -28488,17 +28647,24 @@ function BusinessDetailsDropinComponent({
28488
28647
  }, [
28489
28648
  currentCountry,
28490
28649
  handleNextClick,
28650
+ forms,
28491
28651
  activeForm.formId,
28492
- verifiedBusiness,
28652
+ activeForm.formName,
28493
28653
  (_e = currentState.validityByForm) == null ? void 0 : _e.basicInformation,
28494
28654
  currentState.data.basicInformation,
28495
28655
  isBusinessSelection,
28656
+ verifiedBusiness,
28496
28657
  findBusiness
28497
28658
  ]);
28498
28659
  const backClick = useCallback(() => {
28499
28660
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) return handleBackClick == null ? void 0 : handleBackClick();
28500
28661
  switch (activeForm.formId) {
28501
28662
  case "basicInformation": {
28663
+ trackNavigation({
28664
+ fromForm: activeForm.formName,
28665
+ toForm: "basicDetails",
28666
+ component: "back"
28667
+ });
28502
28668
  return showBusinessSelection ? setShowBusinessSelection(false) : void 0;
28503
28669
  }
28504
28670
  case "companyStructure": {
@@ -28523,6 +28689,8 @@ function BusinessDetailsDropinComponent({
28523
28689
  }
28524
28690
  }, [
28525
28691
  activeForm.formId,
28692
+ activeForm.formName,
28693
+ i18n,
28526
28694
  country,
28527
28695
  handleBackClick,
28528
28696
  searching,
@@ -28530,6 +28698,14 @@ function BusinessDetailsDropinComponent({
28530
28698
  showBusinessSelection,
28531
28699
  verifiedBusiness
28532
28700
  ]);
28701
+ const homeClick = () => {
28702
+ trackNavigation({
28703
+ fromForm: activeForm.formName,
28704
+ toForm: "home",
28705
+ component: "home"
28706
+ });
28707
+ handleHomeClick == null ? void 0 : handleHomeClick();
28708
+ };
28533
28709
  const proceedToManualDataEntry = useCallback(async () => {
28534
28710
  await clearTrustedBusinessData().then(() => setShowCompanyStructure(true));
28535
28711
  }, [clearTrustedBusinessData]);
@@ -28575,7 +28751,7 @@ function BusinessDetailsDropinComponent({
28575
28751
  backButtonLabel: i18n.get("goBack"),
28576
28752
  handleNextClick: nextClick,
28577
28753
  handleBackClick: backClick,
28578
- handleHomeClick,
28754
+ handleHomeClick: homeClick,
28579
28755
  children: /* @__PURE__ */ jsx(
28580
28756
  BusinessDetailsComponent,
28581
28757
  {
@@ -28654,7 +28830,6 @@ function CompanyDropinComponent({
28654
28830
  capabilities,
28655
28831
  homeButtonLabel,
28656
28832
  taskType = TaskTypes.COMPANY,
28657
- trackingConfig,
28658
28833
  associationDetail,
28659
28834
  parentLegalEntity,
28660
28835
  legalEntityResponse,
@@ -28679,6 +28854,7 @@ function CompanyDropinComponent({
28679
28854
  const { i18n } = useI18nContext();
28680
28855
  const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
28681
28856
  const dataFromResponse = mapLegalEntityToCompany(legalEntityResponse);
28857
+ const isTrustMemberCompany = taskType === TaskTypes.TRUST_MEMBER_COMPANY;
28682
28858
  const { getConfiguration: getConfiguration2 } = useConfigurationApi();
28683
28859
  const [data, setData] = useState(dataFromResponse);
28684
28860
  const [problems, setProblems] = useState(propProblems);
@@ -28687,13 +28863,15 @@ function CompanyDropinComponent({
28687
28863
  );
28688
28864
  const [loadingStatus, setLoadingStatus] = useState("success");
28689
28865
  const formRef = useRef(null);
28690
- const baseTrackingPayload = getBaseTrackingPayload({
28691
- trackingConfig,
28692
- parentLegalEntity,
28693
- legalEntity: legalEntityResponse,
28694
- task: taskType
28866
+ const baseTrackingPayload = getAssociatedLeAnalyticsPayload({
28867
+ task: taskType,
28868
+ ...isTrustMemberCompany ? {
28869
+ associatedLegalEntity: legalEntityResponse,
28870
+ associatedLegalEntityOrg: parentLegalEntity
28871
+ } : {}
28695
28872
  });
28696
28873
  useEffect(() => {
28874
+ userEvents.updateBaseTrackingPayload({ task: taskType });
28697
28875
  userEvents.addEvent("Landed on page", {
28698
28876
  ...baseTrackingPayload,
28699
28877
  actionLevel: "task",
@@ -28791,7 +28969,7 @@ function CompanyDropinComponent({
28791
28969
  };
28792
28970
  const attachAssociationToParentLegalEntity = async ({ legalEntity }) => {
28793
28971
  var _a2;
28794
- if (taskType === TaskTypes.TRUST_MEMBER_COMPANY) {
28972
+ if (isTrustMemberCompany) {
28795
28973
  const existingEntityAssociations = getOwnEntityAssociations(parentLegalEntity);
28796
28974
  const existingRoles = (_a2 = existingEntityAssociations == null ? void 0 : existingEntityAssociations.filter((ea) => ea.legalEntityId === parentLegalEntity.id)) == null ? void 0 : _a2.map(({ type }) => type);
28797
28975
  const newRoles = associationDetail == null ? void 0 : associationDetail.roles;
@@ -29933,13 +30111,8 @@ const BusinessTypeSelection = ({
29933
30111
  )
29934
30112
  );
29935
30113
  }, [data.businessType, data.legalArrangement, currentStep]);
29936
- const baseTrackingPayload = getBaseTrackingPayload({
29937
- legalEntity: legalEntityResponse,
29938
- task: TaskTypes.BUSINESS_TYPE_SELECTION
29939
- });
29940
30114
  useEffect(() => {
29941
30115
  userEvents.addEvent("Landed on page", {
29942
- ...baseTrackingPayload,
29943
30116
  actionLevel: "task",
29944
30117
  actionType: "start"
29945
30118
  });
@@ -29984,7 +30157,6 @@ const BusinessTypeSelection = ({
29984
30157
  };
29985
30158
  const updateLegalEntityAndSelectAccountHolder = async () => {
29986
30159
  const trackingPayload = {
29987
- ...baseTrackingPayload,
29988
30160
  actionLevel: "task",
29989
30161
  actionType: "submit"
29990
30162
  };
@@ -30599,8 +30771,6 @@ const EntityGuidanceStatus = ({
30599
30771
  ] });
30600
30772
  };
30601
30773
  const DecisionMakersComponent = ({
30602
- trackingConfig,
30603
- parentLegalEntity,
30604
30774
  legalEntityResponse,
30605
30775
  capabilityProblems,
30606
30776
  onNavigateToIndividual,
@@ -30617,7 +30787,9 @@ const DecisionMakersComponent = ({
30617
30787
  const decisionMakers = getOwnDecisionMakers(legalEntityResponse);
30618
30788
  const registeredCountry = (_b = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.registeredAddress) == null ? void 0 : _b.country;
30619
30789
  const availableDecisionMakers = getAvailableDecisionMakerRoleTypes(registeredCountry);
30620
- const homeButtonLabel = i18n.get("saveAndGoToOverview");
30790
+ const translationKeys = {
30791
+ home: "saveAndGoToOverview"
30792
+ };
30621
30793
  const { remediationMessages } = useDataMissingRemediations({
30622
30794
  legalEntityId: legalEntityResponse.id,
30623
30795
  problems: capabilityProblems
@@ -30640,17 +30812,27 @@ const DecisionMakersComponent = ({
30640
30812
  }, {});
30641
30813
  const uniqueDecisionMakers = mappedDecisionMakers ? Object.values(mappedDecisionMakers) : [];
30642
30814
  const showWarning = Boolean(remediationMessages.DECISION_MAKER && uniqueDecisionMakers.length);
30815
+ useEffect(() => {
30816
+ if (showWarning) {
30817
+ userEvents.addEvent("Encountered error", {
30818
+ task: TaskTypes.DECISION_MAKER_OVERVIEW,
30819
+ actionLevel: "task",
30820
+ actionType: "alert",
30821
+ label: remediationMessages.DECISION_MAKER
30822
+ });
30823
+ }
30824
+ }, [remediationMessages.DECISION_MAKER, showWarning]);
30643
30825
  const uniqueDecisionMakersPerType = (roleType) => uniqueDecisionMakers.filter(({ types }) => types.includes(roleType)).length;
30644
30826
  const allowedDecisionMakerTypes = getAllowedDecisionMakerRoles(
30645
30827
  legalEntityResponse,
30646
30828
  TaskTypes.DECISION_MAKER
30647
30829
  );
30648
30830
  const haveMaxDecisionMakers = allowedDecisionMakerTypes.length === 0;
30649
- const baseTrackingPayload = getBaseTrackingPayload({
30650
- trackingConfig,
30651
- parentLegalEntity,
30652
- legalEntity: legalEntityResponse,
30653
- task: TaskTypes.DECISION_MAKER_OVERVIEW
30831
+ const getDecisionMakerTrackingParams = (decisionMaker) => ({
30832
+ task: TaskTypes.DECISION_MAKER_OVERVIEW,
30833
+ associatedLegalEntityId: decisionMaker.reference,
30834
+ associatedLegalEntityType: decisionMaker.legalEntityType,
30835
+ roles: decisionMaker.types
30654
30836
  });
30655
30837
  const addDecisionMakerOnClick = (e) => {
30656
30838
  e.stopPropagation();
@@ -30659,12 +30841,9 @@ const DecisionMakersComponent = ({
30659
30841
  const editDecisionMaker = (decisionMaker) => {
30660
30842
  onNavigateToIndividual(decisionMaker.reference);
30661
30843
  userEvents.addEvent("Clicked button", {
30662
- ...baseTrackingPayload,
30844
+ ...getDecisionMakerTrackingParams(decisionMaker),
30663
30845
  actionLevel: "task",
30664
- actionType: "edit",
30665
- legalEntityId: decisionMaker.reference,
30666
- entityType: decisionMaker.legalEntityType,
30667
- roles: decisionMaker.types
30846
+ actionType: "edit"
30668
30847
  });
30669
30848
  };
30670
30849
  const deleteDecisionMaker = async (decisionMaker) => {
@@ -30680,12 +30859,9 @@ const DecisionMakersComponent = ({
30680
30859
  (curr) => curr.legalEntityId !== decisionMaker.reference
30681
30860
  );
30682
30861
  userEvents.addEvent("Clicked button", {
30683
- ...baseTrackingPayload,
30862
+ ...getDecisionMakerTrackingParams(decisionMaker),
30684
30863
  actionLevel: "task",
30685
30864
  actionType: "remove",
30686
- legalEntityId: decisionMaker.reference,
30687
- entityType: decisionMaker.legalEntityType,
30688
- roles: decisionMaker.types,
30689
30865
  remainingDecisionMakers
30690
30866
  });
30691
30867
  showToast({ type: "success", label: i18n.get("successFullyRemovedDecisionMaker") });
@@ -30734,7 +30910,7 @@ const DecisionMakersComponent = ({
30734
30910
  )) }),
30735
30911
  titleId: "whatIsTheDifferenceBetweenTheseRoles",
30736
30912
  contentId: "differenceBetweenAnOwnerControllingPersonAndSignatory",
30737
- baseTrackingPayload
30913
+ baseTrackingPayload: { task: TaskTypes.DECISION_MAKER_OVERVIEW }
30738
30914
  }
30739
30915
  ),
30740
30916
  showWarning && /* @__PURE__ */ jsx(
@@ -30779,15 +30955,15 @@ const DecisionMakersComponent = ({
30779
30955
  {
30780
30956
  onHome: () => {
30781
30957
  userEvents.addEvent("Clicked button", {
30782
- ...baseTrackingPayload,
30958
+ task: TaskTypes.DECISION_MAKER_OVERVIEW,
30783
30959
  actionLevel: "task",
30784
30960
  actionType: "back",
30785
- label: homeButtonLabel,
30961
+ label: translationKeys.home,
30786
30962
  noOfDecisionMakers: decisionMakers.length
30787
30963
  });
30788
30964
  navigateBackToTaskList();
30789
30965
  },
30790
- homeButtonLabel
30966
+ homeButtonLabel: i18n.get(translationKeys.home)
30791
30967
  }
30792
30968
  )
30793
30969
  ] })
@@ -30958,20 +31134,13 @@ const Introduction = ({
30958
31134
  const { i18n } = useI18nContext();
30959
31135
  const introductionScreens = useIntroductionScreens({ legalEntity, tasks });
30960
31136
  const [activeIndex, setActiveIndex] = useState(0);
30961
- const baseTrackingPayload = getBaseTrackingPayload({
30962
- trackingConfig: { topLevelLegalEntity: legalEntity },
30963
- legalEntity,
30964
- task: TaskTypes.INTRODUCTION
30965
- });
30966
31137
  const pageEventDetails = {
30967
- ...baseTrackingPayload,
30968
31138
  actionLevel: "page",
30969
31139
  page: (introductionScreens == null ? void 0 : introductionScreens.length) ? introductionScreens[activeIndex] : void 0
30970
31140
  };
30971
31141
  useEffect(() => {
30972
31142
  if (introductionScreens == null ? void 0 : introductionScreens.length) {
30973
31143
  userEvents.addEvent("Landed on page", {
30974
- ...baseTrackingPayload,
30975
31144
  actionLevel: "task",
30976
31145
  actionType: "start"
30977
31146
  });
@@ -30979,11 +31148,11 @@ const Introduction = ({
30979
31148
  onExitIntroduction();
30980
31149
  }
30981
31150
  }, [introductionScreens]);
30982
- const buttonLabels = {
30983
- skip: i18n.get("goToOverviewFromIntroduction"),
30984
- back: i18n.get("back"),
30985
- next: i18n.get("next"),
30986
- start: i18n.get("start")
31151
+ const translationKeys = {
31152
+ skip: "goToOverviewFromIntroduction",
31153
+ back: "back",
31154
+ next: "next",
31155
+ start: "start"
30987
31156
  };
30988
31157
  return (introductionScreens == null ? void 0 : introductionScreens.length) ? /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-introduction", children: [
30989
31158
  /* @__PURE__ */ jsx(
@@ -30996,12 +31165,12 @@ const Introduction = ({
30996
31165
  /* @__PURE__ */ jsx("div", { className: "adyen-kyc-introduction__skip", children: /* @__PURE__ */ jsx(
30997
31166
  Button,
30998
31167
  {
30999
- label: buttonLabels.skip,
31168
+ label: i18n.get(translationKeys.skip),
31000
31169
  onClick: () => {
31001
31170
  userEvents.addEvent("Clicked button", {
31002
31171
  ...pageEventDetails,
31003
31172
  actionType: "skip",
31004
- label: buttonLabels.skip
31173
+ label: translationKeys.skip
31005
31174
  });
31006
31175
  onExitIntroduction();
31007
31176
  },
@@ -31023,12 +31192,12 @@ const Introduction = ({
31023
31192
  Button,
31024
31193
  {
31025
31194
  disabled: activeIndex === 0,
31026
- label: buttonLabels.back,
31195
+ label: i18n.get(translationKeys.back),
31027
31196
  onClick: () => {
31028
31197
  userEvents.addEvent("Clicked button", {
31029
31198
  ...pageEventDetails,
31030
31199
  actionType: "back",
31031
- label: buttonLabels.back
31200
+ label: translationKeys.back
31032
31201
  });
31033
31202
  setActiveIndex((currentValue) => currentValue - 1);
31034
31203
  },
@@ -31039,13 +31208,12 @@ const Introduction = ({
31039
31208
  activeIndex + 1 === introductionScreens.length ? /* @__PURE__ */ jsx(
31040
31209
  Button,
31041
31210
  {
31042
- label: buttonLabels.start,
31211
+ label: i18n.get(translationKeys.start),
31043
31212
  onClick: () => {
31044
31213
  userEvents.addEvent("Success", {
31045
- ...baseTrackingPayload,
31046
31214
  actionLevel: "task",
31047
31215
  actionType: "start",
31048
- label: buttonLabels.start
31216
+ label: translationKeys.start
31049
31217
  });
31050
31218
  onExitIntroduction();
31051
31219
  },
@@ -31054,12 +31222,12 @@ const Introduction = ({
31054
31222
  ) : /* @__PURE__ */ jsx(
31055
31223
  Button,
31056
31224
  {
31057
- label: buttonLabels.next,
31225
+ label: i18n.get(translationKeys.next),
31058
31226
  onClick: () => {
31059
31227
  userEvents.addEvent("Clicked button", {
31060
31228
  ...pageEventDetails,
31061
31229
  actionType: "next",
31062
- label: buttonLabels.next
31230
+ label: translationKeys.next
31063
31231
  });
31064
31232
  setActiveIndex((currentValue) => currentValue + 1);
31065
31233
  },
@@ -31597,7 +31765,6 @@ const LEGAL_ENTITY_BASE_TASKS = [
31597
31765
  const CONTRACT_TASKS = [TaskTypes.SERVICE_AGREEMENT, TaskTypes.PCI_DSS];
31598
31766
  function TaskListComponent({
31599
31767
  tasks,
31600
- trackingConfig,
31601
31768
  onNavigateToTask,
31602
31769
  legalEntityResponse,
31603
31770
  capabilityProblems,
@@ -31672,16 +31839,22 @@ function TaskListComponent({
31672
31839
  const payoutTaskDescriptionKey = isReview ? "payoutAccountsDescriptionReview" : "payoutAccountsDescription";
31673
31840
  const onEditBusinessSetupClick = () => {
31674
31841
  userEvents.addEvent("Clicked button", {
31675
- ...getBaseTrackingPayload({
31676
- trackingConfig,
31677
- legalEntity: legalEntityResponse,
31678
- task: TaskTypes.TASKS_OVERVIEW
31679
- }),
31842
+ task: TaskTypes.TASKS_OVERVIEW,
31680
31843
  actionLevel: "task",
31681
31844
  actionType: "edit"
31682
31845
  });
31683
31846
  onNavigateToTask(TaskTypes.BUSINESS_TYPE_SELECTION);
31684
31847
  };
31848
+ useEffect(() => {
31849
+ if (showDecisionMakersWarning) {
31850
+ userEvents.addEvent("Encountered error", {
31851
+ task: TaskTypes.TASKS_OVERVIEW,
31852
+ actionLevel: "task",
31853
+ actionType: "alert",
31854
+ label: remediationMessages.DECISION_MAKER
31855
+ });
31856
+ }
31857
+ }, [showDecisionMakersWarning]);
31685
31858
  return /* @__PURE__ */ jsxs("div", { className: "adyen-task-list__container", children: [
31686
31859
  canSeeIntroduction && /* @__PURE__ */ jsx("div", { className: "adyen-task-list__nav", children: /* @__PURE__ */ jsx(
31687
31860
  Button,
@@ -32388,7 +32561,6 @@ function IndividualDropinComponent({
32388
32561
  handleGetIdVerificationStartCheck,
32389
32562
  handleOpenSingpassAuthorizationLink,
32390
32563
  taskType = TaskTypes.INDIVIDUAL,
32391
- trackingConfig,
32392
32564
  parentLegalEntity,
32393
32565
  legalEntityResponse,
32394
32566
  taskName,
@@ -32446,13 +32618,18 @@ function IndividualDropinComponent({
32446
32618
  accountHolder,
32447
32619
  handleOpenSingpassAuthorizationLink
32448
32620
  });
32449
- const baseTrackingPayload = getBaseTrackingPayload({
32450
- trackingConfig,
32451
- parentLegalEntity,
32452
- legalEntity: legalEntityResponse,
32453
- task: taskType
32621
+ const baseTrackingPayload = getAssociatedLeAnalyticsPayload({
32622
+ task: taskType,
32623
+ ...taskType === TaskTypes.INDIVIDUAL ? {} : taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER ? {
32624
+ associatedLegalEntity: legalEntityResponse,
32625
+ associatedLegalEntityOrg: parentLegalEntity
32626
+ } : {
32627
+ // i.e. legal arrangement, decision maker, or trust member individual
32628
+ associatedLegalEntity: legalEntityResponse
32629
+ }
32454
32630
  });
32455
32631
  useEffect(() => {
32632
+ userEvents.updateBaseTrackingPayload({ task: taskType });
32456
32633
  userEvents.addEvent("Landed on page", {
32457
32634
  ...baseTrackingPayload,
32458
32635
  actionLevel: "task",
@@ -33074,7 +33251,6 @@ function PayoutDetailsDropinComponent({
33074
33251
  handleGetBankVerificationVendors,
33075
33252
  legalEntityResponse,
33076
33253
  associatedLegalArrangement,
33077
- trackingConfig,
33078
33254
  accountHolder,
33079
33255
  problems: propProblems,
33080
33256
  onSubmit: externalOnSubmit,
@@ -33146,13 +33322,9 @@ function PayoutDetailsDropinComponent({
33146
33322
  propProblems || ((transferInstrument == null ? void 0 : transferInstrument.id) ? (_c = (_b = getCapabilityProblems(legalEntityResponse, bankAccountCountry)) == null ? void 0 : _b.BankAccount) == null ? void 0 : _c[transferInstrument.id] : void 0)
33147
33323
  );
33148
33324
  const existingBankAccountFormat = transferInstrument ? ((_d = existingPayoutDetails == null ? void 0 : existingPayoutDetails.payoutAccountDetails) == null ? void 0 : _d.iban) ? "iban" : "local" : void 0;
33149
- const baseTrackingPayload = getBaseTrackingPayload({
33150
- trackingConfig,
33151
- task: taskType
33152
- });
33153
33325
  useEffect(() => {
33326
+ userEvents.updateBaseTrackingPayload({ task: taskType });
33154
33327
  userEvents.addEvent("Landed on page", {
33155
- ...baseTrackingPayload,
33156
33328
  actionLevel: "task",
33157
33329
  actionType: "start"
33158
33330
  });
@@ -33281,7 +33453,6 @@ function PayoutDetailsDropinComponent({
33281
33453
  documents2.forEach((document2) => {
33282
33454
  var _a2;
33283
33455
  userEvents.addEvent("Success", {
33284
- ...baseTrackingPayload,
33285
33456
  actionLevel: "task",
33286
33457
  actionType: "upload",
33287
33458
  documentType: document2.type,
@@ -33318,7 +33489,6 @@ function PayoutDetailsDropinComponent({
33318
33489
  );
33319
33490
  }
33320
33491
  const baseTracking = {
33321
- ...baseTrackingPayload,
33322
33492
  actionLevel: "task",
33323
33493
  actionType: "submit",
33324
33494
  documentType: DocumentType.BANK_STATEMENT,
@@ -33434,7 +33604,7 @@ function PayoutDetailsDropinComponent({
33434
33604
  nextButtonLabel
33435
33605
  } = useFormComposer({
33436
33606
  problems,
33437
- baseTrackingPayload,
33607
+ baseTrackingPayload: {},
33438
33608
  forms,
33439
33609
  submitButtonLabel,
33440
33610
  externalBackClick,
@@ -33475,7 +33645,7 @@ function PayoutDetailsDropinComponent({
33475
33645
  loadingStatus,
33476
33646
  forms,
33477
33647
  onSubmit,
33478
- baseTrackingPayload,
33648
+ baseTrackingPayload: {},
33479
33649
  gotoFormByFormIndex,
33480
33650
  nextButtonLabel,
33481
33651
  homeButtonLabel,
@@ -33553,21 +33723,17 @@ function PciDropinComponent({
33553
33723
  pciTemplateResponse,
33554
33724
  handleHomeClick,
33555
33725
  handleSign,
33556
- taskType = TaskTypes.PCI_DSS,
33557
- trackingConfig
33726
+ taskType = TaskTypes.PCI_DSS
33558
33727
  }) {
33559
33728
  var _a, _b, _c, _d;
33560
33729
  const { i18n } = useI18nContext();
33561
33730
  const { showToast } = useToastContext();
33562
- const baseTrackingPayload = getBaseTrackingPayload({
33563
- trackingConfig,
33564
- legalEntity: legalEntityResponse,
33565
- task: taskType
33566
- });
33567
33731
  const [loadingStatus, setLoadingStatus] = useState();
33568
33732
  const hasExpired = useHasExpired();
33569
- const signButtonLabel = i18n.get("sign");
33570
- const homeButtonLabel = i18n.get("goToOverview");
33733
+ const translationKeys = {
33734
+ sign: "sign",
33735
+ home: "goToOverview"
33736
+ };
33571
33737
  const { handleChangeFor, triggerValidation, data, valid, isValid, errors } = useForm({
33572
33738
  schema: PciFields,
33573
33739
  rules: pciValidationRules
@@ -33595,10 +33761,9 @@ function PciDropinComponent({
33595
33761
  const handleSignClick = async () => {
33596
33762
  if (loadingStatus === "loading") return;
33597
33763
  const baseTracking = {
33598
- ...baseTrackingPayload,
33599
33764
  actionLevel: "task",
33600
33765
  actionType: "sign",
33601
- label: signButtonLabel
33766
+ label: translationKeys.sign
33602
33767
  };
33603
33768
  userEvents.addEvent("Clicked button", baseTracking);
33604
33769
  triggerValidation();
@@ -33629,24 +33794,22 @@ function PciDropinComponent({
33629
33794
  };
33630
33795
  const goHome = () => {
33631
33796
  userEvents.addEvent("Clicked button", {
33632
- ...baseTrackingPayload,
33633
33797
  actionLevel: "task",
33634
33798
  actionType: "back",
33635
- label: homeButtonLabel
33799
+ label: translationKeys.home
33636
33800
  });
33637
33801
  handleHomeClick();
33638
33802
  };
33639
33803
  const handleExpandSection = (title) => {
33640
33804
  userEvents.addEvent("Clicked accordion", {
33641
- ...baseTrackingPayload,
33642
33805
  actionLevel: "task",
33643
33806
  actionType: "open",
33644
33807
  label: title
33645
33808
  });
33646
33809
  };
33647
33810
  useEffect(() => {
33811
+ userEvents.updateBaseTrackingPayload({ task: taskType });
33648
33812
  userEvents.addEvent("Landed on page", {
33649
- ...baseTrackingPayload,
33650
33813
  actionLevel: "task",
33651
33814
  actionType: "start"
33652
33815
  });
@@ -33707,9 +33870,9 @@ function PciDropinComponent({
33707
33870
  ActionBar,
33708
33871
  {
33709
33872
  onHome: goHome,
33710
- homeButtonLabel,
33873
+ homeButtonLabel: i18n.get(translationKeys.home),
33711
33874
  onNext: handleSignClick,
33712
- nextButtonLabel: signButtonLabel
33875
+ nextButtonLabel: i18n.get(translationKeys.sign)
33713
33876
  }
33714
33877
  );
33715
33878
  return /* @__PURE__ */ jsx(DropinLayout, { content, footer });
@@ -34551,21 +34714,14 @@ function ServiceAgreementDropinComponent({
34551
34714
  handleHomeClick,
34552
34715
  handleAddSigner,
34553
34716
  handleSign,
34554
- taskType,
34555
34717
  serviceAgreementTypes,
34556
- serviceAgreementAcceptanceInfos,
34557
- trackingConfig
34718
+ serviceAgreementAcceptanceInfos
34558
34719
  }) {
34559
34720
  var _a, _b;
34560
34721
  const { i18n } = useI18nContext();
34561
34722
  const { showToast } = useToastContext();
34562
34723
  const { isExperimentEnabled } = useExperimentsContext();
34563
34724
  const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
34564
- const baseTrackingPayload = getBaseTrackingPayload({
34565
- trackingConfig,
34566
- legalEntity: legalEntityResponse,
34567
- task: taskType
34568
- });
34569
34725
  const [loadingStatus, setLoadingStatus] = useState();
34570
34726
  const signedForms = serviceAgreementAcceptanceInfos.map((serviceAgreementAcceptanceInfo) => ({
34571
34727
  formId: serviceAgreementAcceptanceInfo.id,
@@ -34587,8 +34743,10 @@ function ServiceAgreementDropinComponent({
34587
34743
  const [activeForm, setActiveForm] = useState(forms[activeFormIndex]);
34588
34744
  const canSign = (serviceAgreementTypes == null ? void 0 : serviceAgreementTypes.includes(activeForm == null ? void 0 : activeForm.serviceAgreementType)) && !(activeForm == null ? void 0 : activeForm.acceptanceId);
34589
34745
  const showSignedAlert = !!(activeForm == null ? void 0 : activeForm.acceptanceId);
34590
- const homeButtonLabel = i18n.get("goToOverview");
34591
- const nextButtonLabel = i18n.get(canSign ? "sign" : "next");
34746
+ const translationKeys = {
34747
+ home: "goToOverview",
34748
+ next: canSign ? "sign" : "next"
34749
+ };
34592
34750
  const handleServiceAgreementIsNotAvailableInThatLanguage = useCallback(() => {
34593
34751
  showToast({
34594
34752
  label: i18n.get("failedToGetServiceAgreementInSelectedLanguageFallbackToEn"),
@@ -34630,11 +34788,10 @@ function ServiceAgreementDropinComponent({
34630
34788
  const signers = getSigners();
34631
34789
  const handleSignClick = async () => {
34632
34790
  const baseTracking = {
34633
- ...baseTrackingPayload,
34634
34791
  actionLevel: "task",
34635
34792
  actionType: "sign"
34636
34793
  };
34637
- userEvents.addEvent("Clicked button", { ...baseTracking, label: nextButtonLabel });
34794
+ userEvents.addEvent("Clicked button", { ...baseTracking, label: translationKeys.next });
34638
34795
  triggerValidation();
34639
34796
  if (loadingStatus === "loading" || !serviceAgreement || !data.signer) return;
34640
34797
  if (isValid) {
@@ -34668,16 +34825,14 @@ function ServiceAgreementDropinComponent({
34668
34825
  };
34669
34826
  const goHome = () => {
34670
34827
  userEvents.addEvent("Clicked button", {
34671
- ...baseTrackingPayload,
34672
34828
  actionLevel: "task",
34673
34829
  actionType: "back",
34674
- label: homeButtonLabel
34830
+ label: translationKeys.home
34675
34831
  });
34676
34832
  handleHomeClick();
34677
34833
  };
34678
34834
  const handleExpandSection = (title) => {
34679
34835
  userEvents.addEvent("Clicked accordion", {
34680
- ...baseTrackingPayload,
34681
34836
  actionLevel: "task",
34682
34837
  actionType: "open",
34683
34838
  label: title
@@ -34689,7 +34844,6 @@ function ServiceAgreementDropinComponent({
34689
34844
  }, [serviceAgreementAcceptanceInfos]);
34690
34845
  useEffect(() => {
34691
34846
  userEvents.addEvent("Landed on page", {
34692
- ...baseTrackingPayload,
34693
34847
  actionLevel: "task",
34694
34848
  actionType: "start"
34695
34849
  });
@@ -34880,9 +35034,9 @@ function ServiceAgreementDropinComponent({
34880
35034
  ActionBar,
34881
35035
  {
34882
35036
  onHome: goHome,
34883
- homeButtonLabel,
35037
+ homeButtonLabel: i18n.get(translationKeys.home),
34884
35038
  onNext: canSign ? handleSignClick : () => gotoForm(activeFormIndex + 1),
34885
- nextButtonLabel,
35039
+ nextButtonLabel: i18n.get(translationKeys.next),
34886
35040
  nextButtonDisabled: forms.length === 0 || !canSign && activeFormIndex === forms.length - 1,
34887
35041
  onBack: () => gotoForm(activeFormIndex - 1),
34888
35042
  hideBackButton: activeFormIndex === 0,
@@ -34958,7 +35112,6 @@ function SolePropDropinComponent({
34958
35112
  onSubmit: onExternalSubmit,
34959
35113
  onChange,
34960
35114
  taskType,
34961
- trackingConfig,
34962
35115
  handleHomeClick,
34963
35116
  handleCreateDocument,
34964
35117
  handleGetDocument,
@@ -34992,11 +35145,9 @@ function SolePropDropinComponent({
34992
35145
  const dataFromResponse = getDataWithDefaultAddress(legalEntityResponse, parentLegalEntity);
34993
35146
  const [data, setData] = useState(dataFromResponse);
34994
35147
  const country = ((_b = (_a = currentState.data) == null ? void 0 : _a.solePropNameAndCountry) == null ? void 0 : _b.country) || ((_c = dataFromResponse == null ? void 0 : dataFromResponse.solePropRegistrationAddress) == null ? void 0 : _c.registrationAddress.country) || externalCountry;
34995
- const baseTrackingPayload = getBaseTrackingPayload({
34996
- trackingConfig,
34997
- parentLegalEntity,
34998
- legalEntity: legalEntityResponse,
34999
- task: taskType
35148
+ const baseTrackingPayload = getAssociatedLeAnalyticsPayload({
35149
+ task: taskType,
35150
+ associatedLegalEntity: legalEntityResponse
35000
35151
  });
35001
35152
  const getConfigurationData = useCallback(
35002
35153
  () => getConfiguration2({
@@ -35075,6 +35226,7 @@ function SolePropDropinComponent({
35075
35226
  };
35076
35227
  useEffect(() => {
35077
35228
  var _a2;
35229
+ userEvents.updateBaseTrackingPayload({ task: taskType });
35078
35230
  const documentIds = ((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.map((documentReference) => documentReference.id)) || [];
35079
35231
  try {
35080
35232
  if (documentIds.length) {
@@ -35281,7 +35433,6 @@ function TrustDropinComponent({
35281
35433
  handleUpdateDocument,
35282
35434
  handleAddressSearch,
35283
35435
  handleFindAddress,
35284
- trackingConfig,
35285
35436
  taskType,
35286
35437
  problems: problemsProp,
35287
35438
  onSubmit: externalOnSubmit,
@@ -35360,6 +35511,7 @@ function TrustDropinComponent({
35360
35511
  }, [derivedProps, formValidity, problems]);
35361
35512
  useEffect(() => {
35362
35513
  var _a2;
35514
+ userEvents.updateBaseTrackingPayload({ task: taskType });
35363
35515
  const documentIds = ((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.map((documentReference) => documentReference.id)) || [];
35364
35516
  try {
35365
35517
  if (documentIds.length) {
@@ -35501,11 +35653,9 @@ function TrustDropinComponent({
35501
35653
  const value = getProp(data2, detail);
35502
35654
  return !isEmpty$1(value);
35503
35655
  });
35504
- const baseTrackingPayload = getBaseTrackingPayload({
35505
- trackingConfig,
35506
- parentLegalEntity,
35507
- legalEntity: legalEntityResponse,
35508
- task: taskType
35656
+ const baseTrackingPayload = getAssociatedLeAnalyticsPayload({
35657
+ task: taskType,
35658
+ associatedLegalEntity: legalEntityResponse
35509
35659
  });
35510
35660
  const {
35511
35661
  handleNextClick,
@@ -35592,6 +35742,13 @@ const useNavigation = ({
35592
35742
  const shouldShowSingpassSelection = isEligibleForSingpass && !hasSeenSingpassSelection;
35593
35743
  const [taskHistory, setTaskHistory] = useState(["default"]);
35594
35744
  const actualTasks = taskHistory.filter((task) => task !== "default");
35745
+ const handleNavigation = useCallback(
35746
+ (task) => {
35747
+ userEvents.updateBaseTrackingPayload({ task });
35748
+ onNavigate == null ? void 0 : onNavigate(task);
35749
+ },
35750
+ [onNavigate]
35751
+ );
35595
35752
  const navigateTo = useCallback(
35596
35753
  (task, deletePreviousHistory = false) => {
35597
35754
  const pushNewTask = () => setTaskHistory((taskHistory2) => deletePreviousHistory ? [task] : [...taskHistory2, task]);
@@ -35599,10 +35756,10 @@ const useNavigation = ({
35599
35756
  setTimeout(pushNewTask);
35600
35757
  } else {
35601
35758
  pushNewTask();
35602
- onNavigate == null ? void 0 : onNavigate(task);
35759
+ handleNavigation(task);
35603
35760
  }
35604
35761
  },
35605
- [onNavigate]
35762
+ [handleNavigation]
35606
35763
  );
35607
35764
  const navigateBack = useCallback(
35608
35765
  (stepCount = 1) => {
@@ -35613,13 +35770,14 @@ const useNavigation = ({
35613
35770
  }
35614
35771
  if (prevTask === TaskTypes.TASKS_OVERVIEW) {
35615
35772
  setTaskHistory([TaskTypes.TASKS_OVERVIEW]);
35616
- onNavigate == null ? void 0 : onNavigate(TaskTypes.TASKS_OVERVIEW);
35773
+ handleNavigation == null ? void 0 : handleNavigation(TaskTypes.TASKS_OVERVIEW);
35617
35774
  return;
35618
35775
  }
35619
35776
  setTaskHistory(taskHistory.slice(0, -1 * stepCount));
35620
- onNavigate == null ? void 0 : onNavigate(prevTask);
35777
+ handleNavigation == null ? void 0 : handleNavigation(prevTask);
35778
+ userEvents.updateBaseTrackingPayload({ task: prevTask });
35621
35779
  },
35622
- [taskHistory, onNavigate]
35780
+ [taskHistory, handleNavigation]
35623
35781
  );
35624
35782
  useEffect(() => {
35625
35783
  if (!window.history.state) window.history.pushState({}, "");
@@ -35908,6 +36066,7 @@ function DropinComposerComponent({
35908
36066
  if (legalEntity) {
35909
36067
  userEvents.updateBaseTrackingPayload({
35910
36068
  legalEntityId: legalEntity.id,
36069
+ entityType: legalEntity.type,
35911
36070
  capabilities: Object.keys(legalEntity.capabilities),
35912
36071
  countryCode: getLegalEntityCountry(legalEntity)
35913
36072
  });
@@ -36196,13 +36355,7 @@ function DropinComposerComponent({
36196
36355
  showToast({ label: i18n.get("failedToDownloadPci"), type: "error" });
36197
36356
  } finally {
36198
36357
  userEvents.addEvent("Clicked button", {
36199
- ...getBaseTrackingPayload({
36200
- trackingConfig: {
36201
- topLevelLegalEntity: legalEntityResponse
36202
- },
36203
- legalEntity: rootLegalEntity,
36204
- task: TaskTypes.PCI_DSS
36205
- }),
36358
+ task: TaskTypes.PCI_DSS,
36206
36359
  actionLevel: "task",
36207
36360
  actionType: "download"
36208
36361
  });
@@ -36210,12 +36363,6 @@ function DropinComposerComponent({
36210
36363
  };
36211
36364
  useEffect(() => {
36212
36365
  userEvents.addEvent("Landed on page", {
36213
- ...getBaseTrackingPayload({
36214
- trackingConfig: {
36215
- topLevelLegalEntity: rootLegalEntity
36216
- },
36217
- task: TaskTypes.TASKS_OVERVIEW
36218
- }),
36219
36366
  actionLevel: "journey",
36220
36367
  actionType: "start"
36221
36368
  });
@@ -36339,7 +36486,6 @@ function DropinComposerComponent({
36339
36486
  return /* @__PURE__ */ jsx(
36340
36487
  TaskListComponent,
36341
36488
  {
36342
- trackingConfig: { topLevelLegalEntity: legalEntityResponse },
36343
36489
  onNavigateToTask,
36344
36490
  tasks,
36345
36491
  legalEntityResponse: rootLegalEntity,
@@ -36358,9 +36504,6 @@ function DropinComposerComponent({
36358
36504
  return /* @__PURE__ */ jsx(
36359
36505
  DecisionMakersComponent,
36360
36506
  {
36361
- trackingConfig: {
36362
- topLevelLegalEntity: legalEntityResponse
36363
- },
36364
36507
  parentLegalEntity: associatedLegalEntityParent,
36365
36508
  legalEntityResponse: rootLegalEntity,
36366
36509
  onNavigateToIndividual: (legalEntityId) => onNavigateToDecisionMakerIndividual(TaskTypes.DECISION_MAKER, legalEntityId),
@@ -36375,9 +36518,6 @@ function DropinComposerComponent({
36375
36518
  return /* @__PURE__ */ jsx(
36376
36519
  IndividualDropinComponent,
36377
36520
  {
36378
- trackingConfig: {
36379
- topLevelLegalEntity: legalEntityResponse
36380
- },
36381
36521
  taskType: TaskTypes.INDIVIDUAL,
36382
36522
  taskName: hasTrust ? "individualTrusteeDetails" : "individualDetails",
36383
36523
  parentLegalEntity: null,
@@ -36422,9 +36562,6 @@ function DropinComposerComponent({
36422
36562
  return /* @__PURE__ */ jsx(
36423
36563
  IndividualDropinComponent,
36424
36564
  {
36425
- trackingConfig: {
36426
- topLevelLegalEntity: legalEntityResponse
36427
- },
36428
36565
  taskType: TaskTypes.DECISION_MAKER,
36429
36566
  parentLegalEntity: associatedLegalEntityParent,
36430
36567
  legalEntityResponse: associatedLegalEntity,
@@ -36454,9 +36591,6 @@ function DropinComposerComponent({
36454
36591
  return /* @__PURE__ */ jsx(
36455
36592
  IndividualDropinComponent,
36456
36593
  {
36457
- trackingConfig: {
36458
- topLevelLegalEntity: legalEntityResponse
36459
- },
36460
36594
  taskType: TaskTypes.TRUST_MEMBER_COMPANY_OWNER,
36461
36595
  parentLegalEntity: associatedLegalEntityParent,
36462
36596
  legalEntityResponse: associatedLegalEntity,
@@ -36485,9 +36619,6 @@ function DropinComposerComponent({
36485
36619
  return /* @__PURE__ */ jsx(
36486
36620
  IndividualDropinComponent,
36487
36621
  {
36488
- trackingConfig: {
36489
- topLevelLegalEntity: legalEntityResponse
36490
- },
36491
36622
  taskType: TaskTypes.TRUST_MEMBER_INDIVIDUAL,
36492
36623
  parentLegalEntity: associatedLegalArrangement,
36493
36624
  legalEntityResponse: associatedLegalEntity,
@@ -36516,9 +36647,6 @@ function DropinComposerComponent({
36516
36647
  CompanyDropinComponent,
36517
36648
  {
36518
36649
  ...args,
36519
- trackingConfig: {
36520
- topLevelLegalEntity: legalEntityResponse
36521
- },
36522
36650
  taskType: TaskTypes.COMPANY,
36523
36651
  taskName: hasTrust ? "companyTrusteeDetails" : "companyDetails",
36524
36652
  legalEntityResponse: rootLegalEntity,
@@ -36545,9 +36673,6 @@ function DropinComposerComponent({
36545
36673
  BusinessDetailsDropinComponent,
36546
36674
  {
36547
36675
  ...args,
36548
- trackingConfig: {
36549
- topLevelLegalEntity: legalEntityResponse
36550
- },
36551
36676
  taskType: TaskTypes.BUSINESS_DETAILS,
36552
36677
  taskName: hasTrust ? "businessTrusteeDetails" : "businessDetails",
36553
36678
  legalEntityResponse: rootLegalEntity,
@@ -36583,9 +36708,6 @@ function DropinComposerComponent({
36583
36708
  CompanyDropinComponent,
36584
36709
  {
36585
36710
  ...args,
36586
- trackingConfig: {
36587
- topLevelLegalEntity: legalEntityResponse
36588
- },
36589
36711
  taskType: TaskTypes.TRUST_MEMBER_COMPANY,
36590
36712
  parentLegalEntity: associatedLegalArrangement,
36591
36713
  legalEntityResponse: associatedLegalEntity,
@@ -36606,7 +36728,6 @@ function DropinComposerComponent({
36606
36728
  return /* @__PURE__ */ jsx(
36607
36729
  PayoutDetailsDropinComponent,
36608
36730
  {
36609
- trackingConfig: { topLevelLegalEntity: legalEntityResponse },
36610
36731
  taskType: currentTask,
36611
36732
  taskName: currentTask === TaskTypes.PAYIN ? "payinDetails" : "payoutDetails",
36612
36733
  problems: (_f = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _f[transferInstrument == null ? void 0 : transferInstrument.id],
@@ -36635,9 +36756,6 @@ function DropinComposerComponent({
36635
36756
  TrustDropinComponent,
36636
36757
  {
36637
36758
  ...args,
36638
- trackingConfig: {
36639
- topLevelLegalEntity: legalEntityResponse
36640
- },
36641
36759
  taskType: TaskTypes.TRUST,
36642
36760
  problems: (_g = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _g[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
36643
36761
  parentLegalEntity: rootLegalEntity,
@@ -36700,7 +36818,6 @@ function DropinComposerComponent({
36700
36818
  {
36701
36819
  legalEntityResponse: rootLegalEntity,
36702
36820
  pciTemplateResponse,
36703
- trackingConfig: { topLevelLegalEntity: legalEntityResponse },
36704
36821
  taskType: TaskTypes.PCI_DSS,
36705
36822
  handleHomeClick: navigateBack,
36706
36823
  handleSign: async (...params) => {
@@ -36733,7 +36850,6 @@ function DropinComposerComponent({
36733
36850
  ServiceAgreementDropinComponent,
36734
36851
  {
36735
36852
  legalEntityResponse: rootLegalEntity,
36736
- trackingConfig: { topLevelLegalEntity: legalEntityResponse },
36737
36853
  taskType: TaskTypes.SERVICE_AGREEMENT,
36738
36854
  serviceAgreementTypes,
36739
36855
  serviceAgreementAcceptanceInfos: serviceAgreementAcceptanceInfosWithNames,
@@ -36771,9 +36887,6 @@ function DropinComposerComponent({
36771
36887
  return /* @__PURE__ */ jsx(
36772
36888
  IndividualDropinComponent,
36773
36889
  {
36774
- trackingConfig: {
36775
- topLevelLegalEntity: legalEntityResponse
36776
- },
36777
36890
  taskName: "legalRepresentative",
36778
36891
  taskType: TaskTypes.LEGAL_REPRESENTATIVE_DETAILS,
36779
36892
  parentLegalEntity: rootLegalEntity,
@@ -38807,7 +38920,6 @@ function UpdateLegalEntityForHighExposure({
38807
38920
  parentLegalEntity,
38808
38921
  capabilities,
38809
38922
  country,
38810
- trackingConfig,
38811
38923
  problems: problemsProp,
38812
38924
  onSubmit: externalOnSubmit,
38813
38925
  onChange,
@@ -38941,10 +39053,8 @@ function UpdateLegalEntityForHighExposure({
38941
39053
  const value = getProp(data2, detail);
38942
39054
  return !isEmpty$1(value);
38943
39055
  });
38944
- const baseTrackingPayload = getBaseTrackingPayload({
38945
- trackingConfig,
38946
- parentLegalEntity,
38947
- legalEntity
39056
+ const baseTrackingPayload = getAssociatedLeAnalyticsPayload({
39057
+ associatedLegalEntity: parentLegalEntity
38948
39058
  });
38949
39059
  const {
38950
39060
  handleNextClick,
@@ -39244,33 +39354,38 @@ const useAnalytics = async ({
39244
39354
  const { i18n } = useI18nContext();
39245
39355
  const { isEmbeddedDropin, loadingContext: base } = useAuthContext();
39246
39356
  const loadingContext = `${base}api/${COMPONENTS_API_VERSION}/`;
39247
- (async () => {
39248
- if (isEmbeddedDropin) {
39249
- try {
39250
- const sessionData = {
39251
- sdkVersion,
39252
- componentName,
39253
- userAgent: navigator.userAgent,
39254
- legalEntityId
39255
- };
39256
- const sessionResponse = await getAnalyticsSession(loadingContext, sessionData);
39257
- if (!(sessionResponse == null ? void 0 : sessionResponse.id)) {
39258
- throw Error("Analytics session Id not received");
39357
+ useEffect(() => {
39358
+ (async () => {
39359
+ const sessionData = {
39360
+ sdkVersion,
39361
+ componentName,
39362
+ userAgent: navigator.userAgent,
39363
+ legalEntityId,
39364
+ locale: i18n.locale
39365
+ };
39366
+ if (isEmbeddedDropin) {
39367
+ try {
39368
+ const sessionResponse = await getAnalyticsSession(loadingContext, sessionData);
39369
+ if (!(sessionResponse == null ? void 0 : sessionResponse.id)) {
39370
+ throw Error("Analytics session Id not received");
39371
+ }
39372
+ userEvents.subscribe((data) => {
39373
+ const eventItem = convertToEmbeddedEvent(data, sessionData);
39374
+ pushEvents(loadingContext, sessionResponse.id, eventItem);
39375
+ });
39376
+ } catch (e) {
39377
+ console.error("Failed to initiate analytics for component", e);
39259
39378
  }
39379
+ } else if (onUserEvent) {
39260
39380
  userEvents.subscribe((data) => {
39261
- const eventItem = convertToEmbeddedEvent(data, sessionData);
39262
- if (eventItem.eventData) {
39263
- eventItem.eventData.locale = i18n.locale;
39264
- }
39265
- pushEvents(loadingContext, sessionResponse.id, eventItem);
39381
+ onUserEvent({
39382
+ ...data,
39383
+ properties: { ...data.properties || {}, ...sessionData }
39384
+ });
39266
39385
  });
39267
- } catch (e) {
39268
- console.error("Failed to initiate analytics for component", e);
39269
39386
  }
39270
- } else if (onUserEvent) {
39271
- userEvents.subscribe(onUserEvent);
39272
- }
39273
- })();
39387
+ })();
39388
+ }, []);
39274
39389
  };
39275
39390
  const logger$8 = createLogger("loadCountries");
39276
39391
  const countriesImports = /* @__PURE__ */ Object.assign({ "./de-DE.json": () => import("./de-DE-Cx8Uim1K.js"), "./el-GR.json": () => import("./el-GR-B7_JR3z5.js"), "./en-US.json": () => import("./en-US-CkdCbOCX.js"), "./es-ES.json": () => import("./es-ES-NBv3HHhn.js"), "./fr-FR.json": () => import("./fr-FR-DdSVMVsp.js"), "./it-IT.json": () => import("./it-IT-Bwdk3zuj.js"), "./ja-JP.json": () => import("./ja-JP-Bsvzm8zu.js"), "./nl-NL.json": () => import("./nl-NL-DofKaNkk.js"), "./pt-PT.json": () => import("./pt-PT-DFEvMD1M.js"), "./ru-RU.json": () => import("./ru-RU-PiM0ZI5h.js"), "./sv-SE.json": () => import("./sv-SE-C0GoLwTg.js"), "./zh-CN.json": () => import("./zh-CN-DJs6Hct-.js"), "./zh-TW.json": () => import("./zh-TW-BWhLbns8.js") });
@@ -39566,7 +39681,7 @@ const ConfigurationApiProvider = ({
39566
39681
  }) => {
39567
39682
  const authContext = useAuthContext();
39568
39683
  const { isEmbeddedDropin, loadingContext } = authContext;
39569
- const sdkVersion = "2.60.0";
39684
+ const sdkVersion = "2.61.1";
39570
39685
  useAnalytics({
39571
39686
  onUserEvent,
39572
39687
  legalEntityId: rootLegalEntityId,
@@ -40239,7 +40354,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
40239
40354
  };
40240
40355
  const copyToClipboard = async () => {
40241
40356
  const toCopy = {
40242
- sdkVersion: "2.60.0",
40357
+ sdkVersion: "2.61.1",
40243
40358
  experiments: Object.fromEntries(allExperimentsWithValues),
40244
40359
  settings: Object.fromEntries(allSettingsWithValues)
40245
40360
  };
@@ -40304,7 +40419,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
40304
40419
  /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
40305
40420
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
40306
40421
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
40307
- /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.60.0" })
40422
+ /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.61.1" })
40308
40423
  ] }) }),
40309
40424
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
40310
40425
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),