@walkeros/web-source-cmp-usercentrics 3.4.2 → 4.0.0-next-1777463920154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.d.mts +15 -7
- package/dist/dev.d.ts +15 -7
- package/dist/examples/index.d.mts +15 -7
- package/dist/examples/index.d.ts +15 -7
- package/dist/index.browser.js +1 -1
- package/dist/index.d.mts +16 -8
- package/dist/index.d.ts +16 -8
- package/dist/index.es5.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +1 -1
- package/package.json +3 -3
package/dist/dev.d.mts
CHANGED
|
@@ -2,6 +2,14 @@ import { WalkerOS, Elb, Logger, Flow, Trigger } from '@walkeros/core';
|
|
|
2
2
|
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
3
3
|
import { z } from '@walkeros/core/dev';
|
|
4
4
|
|
|
5
|
+
declare module '@walkeros/core' {
|
|
6
|
+
interface SourceMap {
|
|
7
|
+
usercentrics: {
|
|
8
|
+
type: 'usercentrics';
|
|
9
|
+
platform?: 'web';
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
5
13
|
/**
|
|
6
14
|
* Usercentrics consent event detail structure.
|
|
7
15
|
*
|
|
@@ -28,7 +36,7 @@ declare global {
|
|
|
28
36
|
}
|
|
29
37
|
/**
|
|
30
38
|
* Usercentrics V2 service info shape returned by `UC_UI.getServicesBaseInfo()`.
|
|
31
|
-
* Only the fields we use are typed
|
|
39
|
+
* Only the fields we use are typed - minimal surface, not a full V2 API mirror.
|
|
32
40
|
*/
|
|
33
41
|
interface UsercentricsV2Service {
|
|
34
42
|
/** Category slug: 'essential' | 'functional' | 'marketing' | custom */
|
|
@@ -55,14 +63,14 @@ interface UsercentricsV2Api {
|
|
|
55
63
|
*/
|
|
56
64
|
type UsercentricsV3CategoryState = 'ALL_ACCEPTED' | 'ALL_DENIED' | 'SOME_ACCEPTED' | 'NO_STATE' | string;
|
|
57
65
|
/**
|
|
58
|
-
* Minimal V3 CategoryData
|
|
66
|
+
* Minimal V3 CategoryData - only fields the adapter reads.
|
|
59
67
|
*/
|
|
60
68
|
interface UsercentricsV3CategoryData {
|
|
61
69
|
state: UsercentricsV3CategoryState;
|
|
62
70
|
name: string;
|
|
63
71
|
}
|
|
64
72
|
/**
|
|
65
|
-
* Minimal V3 ConsentData
|
|
73
|
+
* Minimal V3 ConsentData - only the `type` field is used to distinguish
|
|
66
74
|
* explicit vs implicit consent. Other fields (status, version, etc.) exist on
|
|
67
75
|
* the real SDK but are not read by this adapter.
|
|
68
76
|
*/
|
|
@@ -70,7 +78,7 @@ interface UsercentricsV3ConsentData {
|
|
|
70
78
|
type: 'EXPLICIT' | 'IMPLICIT' | string;
|
|
71
79
|
}
|
|
72
80
|
/**
|
|
73
|
-
* Minimal V3 ConsentDetails
|
|
81
|
+
* Minimal V3 ConsentDetails - only the fields the adapter reads.
|
|
74
82
|
* The real SDK also exposes `services`, but the adapter currently operates
|
|
75
83
|
* at category level only.
|
|
76
84
|
*/
|
|
@@ -81,7 +89,7 @@ interface UsercentricsV3ConsentDetails {
|
|
|
81
89
|
/**
|
|
82
90
|
* Usercentrics V3 window API (`window.__ucCmp`).
|
|
83
91
|
*
|
|
84
|
-
* Only the methods this adapter calls are typed
|
|
92
|
+
* Only the methods this adapter calls are typed - the real SDK surface is
|
|
85
93
|
* much wider but we intentionally keep this narrow.
|
|
86
94
|
*/
|
|
87
95
|
interface UsercentricsV3Api {
|
|
@@ -100,13 +108,13 @@ declare global {
|
|
|
100
108
|
interface Window {
|
|
101
109
|
/**
|
|
102
110
|
* Usercentrics V2 CMP API. Attached once the V2 Browser SDK is
|
|
103
|
-
* initialized. Optional because the SDK loads asynchronously
|
|
111
|
+
* initialized. Optional because the SDK loads asynchronously - guard
|
|
104
112
|
* with a truthiness check before access.
|
|
105
113
|
*/
|
|
106
114
|
UC_UI?: UsercentricsV2Api;
|
|
107
115
|
/**
|
|
108
116
|
* Usercentrics V3 CMP API. Attached once the V3 Browser SDK is
|
|
109
|
-
* initialized. Optional because the SDK loads asynchronously
|
|
117
|
+
* initialized. Optional because the SDK loads asynchronously - guard
|
|
110
118
|
* with a truthiness check before access.
|
|
111
119
|
*/
|
|
112
120
|
__ucCmp?: UsercentricsV3Api;
|
package/dist/dev.d.ts
CHANGED
|
@@ -2,6 +2,14 @@ import { WalkerOS, Elb, Logger, Flow, Trigger } from '@walkeros/core';
|
|
|
2
2
|
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
3
3
|
import { z } from '@walkeros/core/dev';
|
|
4
4
|
|
|
5
|
+
declare module '@walkeros/core' {
|
|
6
|
+
interface SourceMap {
|
|
7
|
+
usercentrics: {
|
|
8
|
+
type: 'usercentrics';
|
|
9
|
+
platform?: 'web';
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
5
13
|
/**
|
|
6
14
|
* Usercentrics consent event detail structure.
|
|
7
15
|
*
|
|
@@ -28,7 +36,7 @@ declare global {
|
|
|
28
36
|
}
|
|
29
37
|
/**
|
|
30
38
|
* Usercentrics V2 service info shape returned by `UC_UI.getServicesBaseInfo()`.
|
|
31
|
-
* Only the fields we use are typed
|
|
39
|
+
* Only the fields we use are typed - minimal surface, not a full V2 API mirror.
|
|
32
40
|
*/
|
|
33
41
|
interface UsercentricsV2Service {
|
|
34
42
|
/** Category slug: 'essential' | 'functional' | 'marketing' | custom */
|
|
@@ -55,14 +63,14 @@ interface UsercentricsV2Api {
|
|
|
55
63
|
*/
|
|
56
64
|
type UsercentricsV3CategoryState = 'ALL_ACCEPTED' | 'ALL_DENIED' | 'SOME_ACCEPTED' | 'NO_STATE' | string;
|
|
57
65
|
/**
|
|
58
|
-
* Minimal V3 CategoryData
|
|
66
|
+
* Minimal V3 CategoryData - only fields the adapter reads.
|
|
59
67
|
*/
|
|
60
68
|
interface UsercentricsV3CategoryData {
|
|
61
69
|
state: UsercentricsV3CategoryState;
|
|
62
70
|
name: string;
|
|
63
71
|
}
|
|
64
72
|
/**
|
|
65
|
-
* Minimal V3 ConsentData
|
|
73
|
+
* Minimal V3 ConsentData - only the `type` field is used to distinguish
|
|
66
74
|
* explicit vs implicit consent. Other fields (status, version, etc.) exist on
|
|
67
75
|
* the real SDK but are not read by this adapter.
|
|
68
76
|
*/
|
|
@@ -70,7 +78,7 @@ interface UsercentricsV3ConsentData {
|
|
|
70
78
|
type: 'EXPLICIT' | 'IMPLICIT' | string;
|
|
71
79
|
}
|
|
72
80
|
/**
|
|
73
|
-
* Minimal V3 ConsentDetails
|
|
81
|
+
* Minimal V3 ConsentDetails - only the fields the adapter reads.
|
|
74
82
|
* The real SDK also exposes `services`, but the adapter currently operates
|
|
75
83
|
* at category level only.
|
|
76
84
|
*/
|
|
@@ -81,7 +89,7 @@ interface UsercentricsV3ConsentDetails {
|
|
|
81
89
|
/**
|
|
82
90
|
* Usercentrics V3 window API (`window.__ucCmp`).
|
|
83
91
|
*
|
|
84
|
-
* Only the methods this adapter calls are typed
|
|
92
|
+
* Only the methods this adapter calls are typed - the real SDK surface is
|
|
85
93
|
* much wider but we intentionally keep this narrow.
|
|
86
94
|
*/
|
|
87
95
|
interface UsercentricsV3Api {
|
|
@@ -100,13 +108,13 @@ declare global {
|
|
|
100
108
|
interface Window {
|
|
101
109
|
/**
|
|
102
110
|
* Usercentrics V2 CMP API. Attached once the V2 Browser SDK is
|
|
103
|
-
* initialized. Optional because the SDK loads asynchronously
|
|
111
|
+
* initialized. Optional because the SDK loads asynchronously - guard
|
|
104
112
|
* with a truthiness check before access.
|
|
105
113
|
*/
|
|
106
114
|
UC_UI?: UsercentricsV2Api;
|
|
107
115
|
/**
|
|
108
116
|
* Usercentrics V3 CMP API. Attached once the V3 Browser SDK is
|
|
109
|
-
* initialized. Optional because the SDK loads asynchronously
|
|
117
|
+
* initialized. Optional because the SDK loads asynchronously - guard
|
|
110
118
|
* with a truthiness check before access.
|
|
111
119
|
*/
|
|
112
120
|
__ucCmp?: UsercentricsV3Api;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { WalkerOS, Elb, Logger, Flow, Trigger } from '@walkeros/core';
|
|
2
2
|
|
|
3
|
+
declare module '@walkeros/core' {
|
|
4
|
+
interface SourceMap {
|
|
5
|
+
usercentrics: {
|
|
6
|
+
type: 'usercentrics';
|
|
7
|
+
platform?: 'web';
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
3
11
|
/**
|
|
4
12
|
* Usercentrics consent event detail structure.
|
|
5
13
|
*
|
|
@@ -26,7 +34,7 @@ declare global {
|
|
|
26
34
|
}
|
|
27
35
|
/**
|
|
28
36
|
* Usercentrics V2 service info shape returned by `UC_UI.getServicesBaseInfo()`.
|
|
29
|
-
* Only the fields we use are typed
|
|
37
|
+
* Only the fields we use are typed - minimal surface, not a full V2 API mirror.
|
|
30
38
|
*/
|
|
31
39
|
interface UsercentricsV2Service {
|
|
32
40
|
/** Category slug: 'essential' | 'functional' | 'marketing' | custom */
|
|
@@ -53,14 +61,14 @@ interface UsercentricsV2Api {
|
|
|
53
61
|
*/
|
|
54
62
|
type UsercentricsV3CategoryState = 'ALL_ACCEPTED' | 'ALL_DENIED' | 'SOME_ACCEPTED' | 'NO_STATE' | string;
|
|
55
63
|
/**
|
|
56
|
-
* Minimal V3 CategoryData
|
|
64
|
+
* Minimal V3 CategoryData - only fields the adapter reads.
|
|
57
65
|
*/
|
|
58
66
|
interface UsercentricsV3CategoryData {
|
|
59
67
|
state: UsercentricsV3CategoryState;
|
|
60
68
|
name: string;
|
|
61
69
|
}
|
|
62
70
|
/**
|
|
63
|
-
* Minimal V3 ConsentData
|
|
71
|
+
* Minimal V3 ConsentData - only the `type` field is used to distinguish
|
|
64
72
|
* explicit vs implicit consent. Other fields (status, version, etc.) exist on
|
|
65
73
|
* the real SDK but are not read by this adapter.
|
|
66
74
|
*/
|
|
@@ -68,7 +76,7 @@ interface UsercentricsV3ConsentData {
|
|
|
68
76
|
type: 'EXPLICIT' | 'IMPLICIT' | string;
|
|
69
77
|
}
|
|
70
78
|
/**
|
|
71
|
-
* Minimal V3 ConsentDetails
|
|
79
|
+
* Minimal V3 ConsentDetails - only the fields the adapter reads.
|
|
72
80
|
* The real SDK also exposes `services`, but the adapter currently operates
|
|
73
81
|
* at category level only.
|
|
74
82
|
*/
|
|
@@ -79,7 +87,7 @@ interface UsercentricsV3ConsentDetails {
|
|
|
79
87
|
/**
|
|
80
88
|
* Usercentrics V3 window API (`window.__ucCmp`).
|
|
81
89
|
*
|
|
82
|
-
* Only the methods this adapter calls are typed
|
|
90
|
+
* Only the methods this adapter calls are typed - the real SDK surface is
|
|
83
91
|
* much wider but we intentionally keep this narrow.
|
|
84
92
|
*/
|
|
85
93
|
interface UsercentricsV3Api {
|
|
@@ -98,13 +106,13 @@ declare global {
|
|
|
98
106
|
interface Window {
|
|
99
107
|
/**
|
|
100
108
|
* Usercentrics V2 CMP API. Attached once the V2 Browser SDK is
|
|
101
|
-
* initialized. Optional because the SDK loads asynchronously
|
|
109
|
+
* initialized. Optional because the SDK loads asynchronously - guard
|
|
102
110
|
* with a truthiness check before access.
|
|
103
111
|
*/
|
|
104
112
|
UC_UI?: UsercentricsV2Api;
|
|
105
113
|
/**
|
|
106
114
|
* Usercentrics V3 CMP API. Attached once the V3 Browser SDK is
|
|
107
|
-
* initialized. Optional because the SDK loads asynchronously
|
|
115
|
+
* initialized. Optional because the SDK loads asynchronously - guard
|
|
108
116
|
* with a truthiness check before access.
|
|
109
117
|
*/
|
|
110
118
|
__ucCmp?: UsercentricsV3Api;
|
package/dist/examples/index.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { WalkerOS, Elb, Logger, Flow, Trigger } from '@walkeros/core';
|
|
2
2
|
|
|
3
|
+
declare module '@walkeros/core' {
|
|
4
|
+
interface SourceMap {
|
|
5
|
+
usercentrics: {
|
|
6
|
+
type: 'usercentrics';
|
|
7
|
+
platform?: 'web';
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
3
11
|
/**
|
|
4
12
|
* Usercentrics consent event detail structure.
|
|
5
13
|
*
|
|
@@ -26,7 +34,7 @@ declare global {
|
|
|
26
34
|
}
|
|
27
35
|
/**
|
|
28
36
|
* Usercentrics V2 service info shape returned by `UC_UI.getServicesBaseInfo()`.
|
|
29
|
-
* Only the fields we use are typed
|
|
37
|
+
* Only the fields we use are typed - minimal surface, not a full V2 API mirror.
|
|
30
38
|
*/
|
|
31
39
|
interface UsercentricsV2Service {
|
|
32
40
|
/** Category slug: 'essential' | 'functional' | 'marketing' | custom */
|
|
@@ -53,14 +61,14 @@ interface UsercentricsV2Api {
|
|
|
53
61
|
*/
|
|
54
62
|
type UsercentricsV3CategoryState = 'ALL_ACCEPTED' | 'ALL_DENIED' | 'SOME_ACCEPTED' | 'NO_STATE' | string;
|
|
55
63
|
/**
|
|
56
|
-
* Minimal V3 CategoryData
|
|
64
|
+
* Minimal V3 CategoryData - only fields the adapter reads.
|
|
57
65
|
*/
|
|
58
66
|
interface UsercentricsV3CategoryData {
|
|
59
67
|
state: UsercentricsV3CategoryState;
|
|
60
68
|
name: string;
|
|
61
69
|
}
|
|
62
70
|
/**
|
|
63
|
-
* Minimal V3 ConsentData
|
|
71
|
+
* Minimal V3 ConsentData - only the `type` field is used to distinguish
|
|
64
72
|
* explicit vs implicit consent. Other fields (status, version, etc.) exist on
|
|
65
73
|
* the real SDK but are not read by this adapter.
|
|
66
74
|
*/
|
|
@@ -68,7 +76,7 @@ interface UsercentricsV3ConsentData {
|
|
|
68
76
|
type: 'EXPLICIT' | 'IMPLICIT' | string;
|
|
69
77
|
}
|
|
70
78
|
/**
|
|
71
|
-
* Minimal V3 ConsentDetails
|
|
79
|
+
* Minimal V3 ConsentDetails - only the fields the adapter reads.
|
|
72
80
|
* The real SDK also exposes `services`, but the adapter currently operates
|
|
73
81
|
* at category level only.
|
|
74
82
|
*/
|
|
@@ -79,7 +87,7 @@ interface UsercentricsV3ConsentDetails {
|
|
|
79
87
|
/**
|
|
80
88
|
* Usercentrics V3 window API (`window.__ucCmp`).
|
|
81
89
|
*
|
|
82
|
-
* Only the methods this adapter calls are typed
|
|
90
|
+
* Only the methods this adapter calls are typed - the real SDK surface is
|
|
83
91
|
* much wider but we intentionally keep this narrow.
|
|
84
92
|
*/
|
|
85
93
|
interface UsercentricsV3Api {
|
|
@@ -98,13 +106,13 @@ declare global {
|
|
|
98
106
|
interface Window {
|
|
99
107
|
/**
|
|
100
108
|
* Usercentrics V2 CMP API. Attached once the V2 Browser SDK is
|
|
101
|
-
* initialized. Optional because the SDK loads asynchronously
|
|
109
|
+
* initialized. Optional because the SDK loads asynchronously - guard
|
|
102
110
|
* with a truthiness check before access.
|
|
103
111
|
*/
|
|
104
112
|
UC_UI?: UsercentricsV2Api;
|
|
105
113
|
/**
|
|
106
114
|
* Usercentrics V3 CMP API. Attached once the V3 Browser SDK is
|
|
107
|
-
* initialized. Optional because the SDK loads asynchronously
|
|
115
|
+
* initialized. Optional because the SDK loads asynchronously - guard
|
|
108
116
|
* with a truthiness check before access.
|
|
109
117
|
*/
|
|
110
118
|
__ucCmp?: UsercentricsV3Api;
|
package/dist/index.browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var SourceUsercentrics=(()=>{var e=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r=(n,t)=>{for(var o in t)e(n,o,{get:t[o],enumerable:!0})},s={};r(s,{SourceUsercentrics:()=>d,createMockElbFn:()=>E,createTrigger:()=>We,default:()=>Je,fullConsent:()=>p,fullConsentCustomMapped:()=>A,fullConsentMapped:()=>k,fullConsentUpperCase:()=>h,implicitConsent:()=>m,minimalConsent:()=>y,minimalConsentMapped:()=>O,nonConsentEvent:()=>w,noopLogger:()=>_,partialConsent:()=>v,partialConsentMapped:()=>j,serviceLevelConsent:()=>b,serviceLevelMapped:()=>C,sourceUsercentrics:()=>ze,step:()=>S,trigger:()=>Fe});var i=["action","event","type","ucCategory"];function a(e,n,t){e[n]=(void 0===e[n]||Boolean(e[n]))&&t}function c(e,n){const t={};var o;return e.ucCategory&&(o=e.ucCategory,Object.values(o).every(e=>"boolean"==typeof e))?Object.entries(e.ucCategory).forEach(([e,o])=>{var r,s;if("boolean"!=typeof o)return;const i=null!=(s=null==(r=n.categoryMap)?void 0:r[e])?s:e;a(t,i,o)}):(e.ucCategory&&Object.entries(e.ucCategory).forEach(([e,o])=>{var r,s;if("boolean"==typeof o){const i=null!=(s=null==(r=n.categoryMap)?void 0:r[e])?s:e;a(t,i,o)}}),Object.entries(e).forEach(([e,n])=>{if(i.includes(e))return;if("boolean"!=typeof n)return;const o=e.toLowerCase().replace(/ /g,"_");a(t,o,n)})),t}function u(e){const n={};return e.forEach(e=>{var t,o;const r=e.categorySlug,s=null!=(o=null==(t=e.consent)?void 0:t.status)&&o;n[r]=(void 0===n[r]||n[r])&&s}),n}function l(e){var n,t;const{window:o,elb:r,settings:s,logger:i}=e,a=null!=(n=s.eventName)?n:"ucEvent",l=e=>{var n;if(i.debug("event received",e),"consent_status"!==e.event)return;if(s.explicitOnly&&"explicit"!==(null==(n=e.type)?void 0:n.toLowerCase()))return;const t=c(e,s);Object.keys(t).length>0&&r("walker consent",t)},f=e=>{const n=e;n.detail&&l(n.detail)};o.addEventListener(a,f);const g=o.UC_UI;if((null==(t=null==g?void 0:g.isInitialized)?void 0:t.call(g))&&g.getServicesBaseInfo){const e=g.getServicesBaseInfo();e.length>0&&l(function(e){return{event:"consent_status",type:"implicit",ucCategory:u(e)}}(e))}return()=>{o.removeEventListener(a,f)}}var f=new Set(["ACCEPT_ALL","DENY_ALL","SAVE"]);async function g(e){var n;const{window:t,elb:o,settings:r,logger:s}=e,i=null!=(n=r.v3EventName)?n:"UC_UI_CMP_EVENT",a=async e=>{const n=function(e){const n={};return Object.entries(e.categories).forEach(([e,t])=>{n[e]="ALL_ACCEPTED"===t.state}),{event:"consent_status",type:"EXPLICIT"===e.consent.type?"explicit":"implicit",ucCategory:n}}(await e.getConsentDetails());if(s.debug("event received",n),r.explicitOnly&&"explicit"!==n.type)return;const t=c(n,r);Object.keys(t).length>0&&o("walker consent",t)},u=e=>{const n=t.__ucCmp;if(!n)return;const o=e.detail;o&&"CMP"===o.source&&o.type&&f.has(o.type)&&a(n).catch(()=>{})};t.addEventListener(i,u);const l=t.__ucCmp;if(l)try{await l.isInitialized()&&await a(l)}catch(e){s.warn("v3 static consent read failed",e)}return()=>{t.removeEventListener(i,u)}}var d={},p={event:"consent_status",type:"explicit",action:"onAcceptAllServices",ucCategory:{essential:!0,functional:!0,marketing:!0},"Google Analytics":!0,"Google Ads Remarketing":!0},v={event:"consent_status",type:"explicit",action:"onUpdateServices",ucCategory:{essential:!0,functional:!0,marketing:!1},"Google Analytics":!0,"Google Ads Remarketing":!1},y={event:"consent_status",type:"explicit",action:"onDenyAllServices",ucCategory:{essential:!0,functional:!1,marketing:!1},"Google Analytics":!1,"Google Ads Remarketing":!1},m={event:"consent_status",type:"implicit",ucCategory:{essential:!0,functional:!1,marketing:!1},"Google Analytics":!1,"Google Ads Remarketing":!1},h={event:"consent_status",type:"EXPLICIT",action:"onAcceptAllServices",ucCategory:{essential:!0,functional:!0,marketing:!0}},b={event:"consent_status",type:"explicit",action:"onUpdateServices",ucCategory:{essential:!0,functional:"partial",marketing:"partial"},"Google Analytics":!0,"Google Ads Remarketing":!1,Hotjar:!0},w={event:"other_event",type:"explicit"},k={essential:!0,functional:!0,marketing:!0},j={essential:!0,functional:!0,marketing:!1},O={essential:!0,functional:!1,marketing:!1},A={functional:!0,marketing:!0},C={essential:!0,google_analytics:!0,google_ads_remarketing:!1,hotjar:!0},x=()=>{},E=()=>()=>Promise.resolve({ok:!0}),_={error:x,warn:x,info:x,debug:x,throw:e=>{throw"string"==typeof e?new Error(e):e},json:x,scope:()=>_},S={};r(S,{categoryMapOverride:()=>$,customEventName:()=>q,fullConsent:()=>P,minimalConsent:()=>D});var P={title:"Full consent",description:"A Usercentrics onAcceptAllServices event emits a walker consent command with essential, functional, and marketing granted.",trigger:{type:"consent"},in:{event:"consent_status",type:"explicit",action:"onAcceptAllServices",ucCategory:{essential:!0,functional:!0,marketing:!0}},out:[["elb","walker consent",{essential:!0,functional:!0,marketing:!0}]]},D={title:"Minimal consent",description:"A Usercentrics onDenyAllServices event emits a walker consent command with only essential granted.",trigger:{type:"consent"},in:{event:"consent_status",type:"explicit",action:"onDenyAllServices",ucCategory:{essential:!0,functional:!1,marketing:!1}},out:[["elb","walker consent",{essential:!0,functional:!1,marketing:!1}]]},$={title:"Category map override",description:"Custom categoryMap remaps essential to functional and functional to analytics",trigger:{type:"consent"},in:{event:"consent_status",type:"explicit",ucCategory:{essential:!0,functional:!0,marketing:!1}},mapping:{categoryMap:{essential:"functional",functional:"analytics"}},out:[["elb","walker consent",{functional:!0,analytics:!0,marketing:!1}]]},q={title:"Custom event name",description:"Using UC_SDK_EVENT instead of ucEvent for Usercentrics SDK v2",trigger:{type:"consent",options:{eventName:"UC_SDK_EVENT"}},in:{event:"consent_status",type:"explicit",ucCategory:{essential:!0,functional:!0,marketing:!0}},mapping:{eventName:"UC_SDK_EVENT"},out:[["elb","walker consent",{essential:!0,functional:!0,marketing:!0}]]},M=Object.defineProperty;((e,n)=>{for(var t in n)M(e,t,{get:n[t],enumerable:!0})})({},{Level:()=>N});var I,N=((I=N||{})[I.ERROR=0]="ERROR",I[I.WARN=1]="WARN",I[I.INFO=2]="INFO",I[I.DEBUG=3]="DEBUG",I);function R(e){return{_meta:{hops:0,path:[e]}}}var U={merge:!0,shallow:!0,extend:!0};function T(e,n={},t={}){t={...U,...t};const o=Object.entries(n).reduce((n,[o,r])=>{const s=e[o];return t.merge&&Array.isArray(s)&&Array.isArray(r)?n[o]=r.reduce((e,n)=>e.includes(n)?e:[...e,n],[...s]):(t.extend||o in e)&&(n[o]=r),n},{});return t.shallow?{...e,...o}:(Object.assign(e,o),e)}function L(e){return Array.isArray(e)}function G(e){return void 0!==e}function H(e){return"function"==typeof e}function V(e){return"object"==typeof e&&null!==e&&!L(e)&&"[object Object]"===Object.prototype.toString.call(e)}function B(e){return"string"==typeof e}function K(e,n=new WeakMap){if("object"!=typeof e||null===e)return e;if(n.has(e))return n.get(e);const t=Object.prototype.toString.call(e);if("[object Object]"===t){const t={};n.set(e,t);for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=K(e[o],n));return t}if("[object Array]"===t){const t=[];return n.set(e,t),e.forEach(e=>{t.push(K(e,n))}),t}if("[object Date]"===t)return new Date(e.getTime());if("[object RegExp]"===t){const n=e;return new RegExp(n.source,n.flags)}return e}function W(e,n="",t){const o=n.split(".");let r=e;for(let e=0;e<o.length;e++){const n=o[e];if("*"===n&&L(r)){const n=o.slice(e+1).join("."),s=[];for(const e of r){const o=W(e,n,t);s.push(o)}return s}if(r=r instanceof Object?r[n]:void 0,void 0===r)break}return G(r)?r:t}function F(e,n,t){if(!V(e))return e;const o=K(e),r=n.split(".");let s=o;for(let e=0;e<r.length;e++){const n=r[e];e===r.length-1?s[n]=t:(n in s&&"object"==typeof s[n]&&null!==s[n]||(s[n]={}),s=s[n])}return o}var z={data:e=>e.data,globals:e=>e.globals,context:e=>e.context,user:e=>e.user,source:e=>e.source,version:e=>e.version,event:e=>({entity:e.entity,action:e.action,id:e.id,timestamp:e.timestamp,name:e.name,trigger:e.trigger,group:e.group,count:e.count,timing:e.timing})};function J(e,n={},t={}){const o={...n,...t},r={};let s=!e||0===Object.keys(e).length;return Object.keys(o).forEach(n=>{o[n]&&(r[n]=!0,e&&e[n]&&(s=!0))}),!!s&&r}function X(e=6,n){if(n){const t=n.length;let o="";for(let r=0;r<e;r++)o+=n[Math.random()*t|0];return o}let t="";for(let n=36;t.length<e;)t+=(Math.random()*n|0).toString(n);return t}function Y(e,n=1e3,t=!1){let o,r=null,s=!1;return(...i)=>new Promise(a=>{const c=t&&!s;r&&clearTimeout(r),r=setTimeout(()=>{r=null,t&&!s||(o=e(...i),a(o))},n),c&&(s=!0,o=e(...i),a(o))})}function Q(e){return{message:e.message,name:e.name,stack:e.stack,cause:e.cause}}function Z(e,n){let t,o={};return e instanceof Error?(t=e.message,o.error=Q(e)):t=e,void 0!==n&&(n instanceof Error?o.error=Q(n):"object"==typeof n&&null!==n?(o={...o,...n},"error"in o&&o.error instanceof Error&&(o.error=Q(o.error))):o.value=n),{message:t,context:o}}var ee=(e,n,t,o)=>{const r=`${N[e]}${o.length>0?` [${o.join(":")}]`:""}`,s=Object.keys(t).length>0,i=0===e?console.error:1===e?console.warn:console.log;s?i(r,n,t):i(r,n)};function ne(e={}){return te({level:void 0!==e.level?(n=e.level,"string"==typeof n?N[n]:n):0,handler:e.handler,jsonHandler:e.jsonHandler,scope:[]});var n}function te(e){const{level:n,handler:t,jsonHandler:o,scope:r}=e,s=(e,o,s)=>{if(e<=n){const n=Z(o,s);t?t(e,n.message,n.context,r,ee):ee(e,n.message,n.context,r)}};return{error:(e,n)=>s(0,e,n),warn:(e,n)=>s(1,e,n),info:(e,n)=>s(2,e,n),debug:(e,n)=>s(3,e,n),throw:(e,n)=>{const o=Z(e,n);throw t?t(0,o.message,o.context,r,ee):ee(0,o.message,o.context,r),new Error(o.message)},json:e=>{o?o(e):console.log(JSON.stringify(e,null,2))},scope:e=>te({level:n,handler:t,jsonHandler:o,scope:[...r,e]})}}function oe(e){return function(e){return"boolean"==typeof e}(e)||B(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!G(e)||L(e)&&e.every(oe)||V(e)&&Object.values(e).every(oe)}function re(e){return oe(e)?e:void 0}function se(e,n,t){return function(...o){try{return e(...o)}catch(e){if(!n)return;return n(e)}finally{null==t||t()}}}function ie(e,n,t){return async function(...o){try{return await e(...o)}catch(e){if(!n)return;return await n(e)}finally{await(null==t?void 0:t())}}}async function ae(e,n={},t={}){var o;if(!G(e))return;const r=V(e)&&e.consent||t.consent||(null==(o=t.collector)?void 0:o.consent),s=L(n)?n:[n];for(const n of s){const o=await ie(ce)(e,n,{...t,consent:r});if(G(o))return o}}async function ce(e,n,t={}){const{collector:o,consent:r}=t;return(L(n)?n:[n]).reduce(async(n,s)=>{const i=await n;if(i)return i;const a=B(s)?{key:s}:s;if(!Object.keys(a).length)return;const{condition:c,consent:u,fn:l,key:f,loop:g,map:d,set:p,validate:v,value:y}=a;if(c&&!await ie(c)(e,s,o))return;if(u&&!J(u,r))return y;let m=G(y)?y:e;if(l&&(m=await ie(l)(e,s,t)),f&&(m=W(e,f,y)),g){const[n,o]=g,r="this"===n?[e]:await ae(e,n,t);L(r)&&(m=(await Promise.all(r.map(e=>ae(e,o,t)))).filter(G))}else d?m=await Object.entries(d).reduce(async(n,[o,r])=>{const s=await n,i=await ae(e,r,t);return G(i)&&(s[o]=i),s},Promise.resolve({})):p&&(m=await Promise.all(p.map(n=>ce(e,n,t))));v&&!await ie(v)(m)&&(m=void 0);const h=re(m);return G(h)?h:re(y)},Promise.resolve(void 0))}async function ue(e,n,t){var o;n.policy&&await Promise.all(Object.entries(n.policy).map(async([n,o])=>{const r=await ae(e,o,{collector:t});e=F(e,n,r)}));const{eventMapping:r,mappingKey:s}=await async function(e,n){var t;const[o,r]=(e.name||"").split(" ");if(!n||!o||!r)return{};let s,i="",a=o,c=r;const u=n=>{if(n)return(n=L(n)?n:[n]).find(n=>!n.condition||n.condition(e))};n[a]||(a="*");const l=n[a];return l&&(l[c]||(c="*"),s=u(l[c])),s||(a="*",c="*",s=u(null==(t=n[a])?void 0:t[c])),s&&(i=`${a} ${c}`),{eventMapping:s,mappingKey:i}}(e,n.mapping);(null==r?void 0:r.policy)&&await Promise.all(Object.entries(r.policy).map(async([n,o])=>{const r=await ae(e,o,{collector:t});e=F(e,n,r)}));let i=n.data&&await ae(e,n.data,{collector:t});const a=Boolean(null==r?void 0:r.skip);if(r){if(r.ignore)return{event:e,data:i,mapping:r,mappingKey:s,ignore:!0,skip:a};if(r.name&&(e.name=r.name),r.data){const n=r.data&&await ae(e,r.data,{collector:t});i=V(i)&&V(n)?T(i,n):n}}const c=null!=(o=null==r?void 0:r.include)?o:n.include;if(c&&c.length>0){const n=function(e,n){const t={},o=n.includes("all")?Object.keys(z):n;for(const n of o){const o=z[n];if(!o)continue;const r=o(e);if(V(r))for(const[e,o]of Object.entries(r)){if(void 0===o)continue;const r="context"===n&&Array.isArray(o)?o[0]:o;t[`${n}_${e}`]=r}}return t}(e,c);Object.keys(n).length>0&&(i=V(i)?T(n,i):null!=i?i:n)}return{event:e,data:i,mapping:r,mappingKey:s,ignore:!1,skip:a}}function le(e,n,t,o){return function(...r){let s;const i="pre"+n,a="post"+n,c=t[i],u=t[a],l=(e,n)=>{o?o.warn(e,{error:n}):console.warn(e,n)};if(c)try{s=c({fn:e},...r)}catch(n){l(`Hook ${String(i)} failed, falling back to original function`,n),s=e(...r)}else s=e(...r);if(u)try{s=u({fn:e,result:s},...r)}catch(e){l(`Hook ${String(a)} failed, keeping original result`,e)}return s}}function fe(e){if("*"===e)return()=>!0;if("and"in e){const n=e.and.map(fe);return e=>n.every(n=>n(e))}if("or"in e){const n=e.or.map(fe);return e=>n.some(n=>n(e))}return function(e){const{key:n,operator:t,value:o,not:r}=e,s=function(e,n){switch(e){case"eq":return e=>String(null!=e?e:"")===n;case"contains":return e=>String(null!=e?e:"").includes(n);case"prefix":return e=>String(null!=e?e:"").startsWith(n);case"suffix":return e=>String(null!=e?e:"").endsWith(n);case"regex":{const e=new RegExp(n);return n=>e.test(String(null!=n?n:""))}case"gt":{const e=Number(n);return n=>Number(n)>e}case"lt":{const e=Number(n);return n=>Number(n)<e}case"exists":return e=>null!=e}}(t,o);return e=>{const t=W(e,n),o=s(t);return r?!o:o}}(e)}function ge(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]&&"match"in e[0]}function de(e){if(null!=e){if("string"==typeof e)return{type:"static",value:e};if(Array.isArray(e)){if(0===e.length)return;return ge(e)?{type:"routes",routes:e.map(e=>({match:fe(e.match),next:de(e.next)}))}:{type:"chain",value:e}}}}function pe(e,n={}){if(e){if("static"===e.type)return e.value;if("chain"===e.type)return e.value;for(const t of e.routes)if(t.match(n))return pe(t.next,n)}}function ve(e,n){const t={ingest:null!=e?e:{}};return void 0!==n&&(t.event=n),t}function ye(e){var n;return{full:null!=(n=e.full)&&n,storeId:e.store,rules:e.rules.map(e=>({match:fe(e.match),key:e.key,ttl:e.ttl,update:e.update}))}}function me(e,n,t,o){const r=e.rules.find(e=>e.match(t));if(!r)return null;const s=r.key.map(e=>{var n;return String(null!=(n=W(t,e))?n:"")});if(s.every(e=>""===e))return null;const i=`${o}:${s.join(":")}`,a=n.get(i);return void 0!==a?{status:"HIT",key:i,value:a,rule:r}:{status:"MISS",key:i,rule:r}}function he(e,n,t,o){e.set(n,t,1e3*o)}async function be(e,n,t){if(!n)return e;let o=e;for(const[e,r]of Object.entries(n))o=F(o,e,await ae(t,r));return o}var we={Action:"action",Actions:"actions",Config:"config",Consent:"consent",Context:"context",Custom:"custom",Destination:"destination",Elb:"elb",Globals:"globals",Hook:"hook",Init:"init",Link:"link",On:"on",Prefix:"data-elb",Ready:"ready",Run:"run",Session:"session",Shutdown:"shutdown",User:"user",Walker:"walker"};function ke(e,n){return e.storeId&&n.stores[e.storeId]?n.stores[e.storeId]:n.stores.__cache}function je(e){var n;const t={};for(const[o,r]of Object.entries(e)){const e=null==(n=r.config)?void 0:n.next;e&&!ge(e)?t[o]={next:e}:t[o]={}}return t}function Oe(e,n){const t=e.config||{},o=e[n];return void 0!==o?{config:{...t,[n]:o},chainValue:o}:{config:t,chainValue:void 0}}function Ae(e,n={}){if(!e)return[];if(Array.isArray(e))return e;const t=[],o=new Set;let r=e;for(;r&&n[r]&&!o.has(r);){o.add(r),t.push(r);const e=n[r].next;if(Array.isArray(e)){t.push(...e);break}r=e}return t}async function Ce(e,n,t){if(n.init&&!n.config.init){const o=n.type||"unknown",r=e.logger.scope(`transformer:${o}`),s={collector:e,logger:r,id:t,ingest:R(t),config:n.config,env:_e(n.config.env)};r.debug("init");const i=await le(n.init,"TransformerInit",e.hooks,e.logger)(s);if(!1===i)return!1;n.config={...i||n.config,env:(null==i?void 0:i.env)||n.config.env,init:!0},r.debug("init done")}return!0}async function xe(e,n,t,o,r,s){const i=n.type||"unknown",a=e.logger.scope(`transformer:${i}`),c={collector:e,logger:a,id:t,ingest:r,config:n.config,env:{..._e(n.config.env),...s?{respond:s}:{}}};a.debug("push",{event:o.name});const u=await le(n.push,"TransformerPush",e.hooks,e.logger)(o,c);return a.debug("push done"),u}async function Ee(e,n,t,o,r,s,i){var a,c,u,l,f,g;i&&(null==r?void 0:r._meta)&&(r._meta.chainPath=i);let d=o,p=s;for(const o of t){const s=n[o];if(!s){e.logger.warn(`Transformer not found: ${o}`);continue}if(r&&r._meta&&r._meta.path.length>256)return e.logger.error(`Max path length exceeded at ${o}`),{event:null,respond:p};if(r&&r._meta&&(r._meta.hops++,r._meta.path.push(o)),!await ie(Ce)(e,s,o))return e.logger.error(`Transformer init failed: ${o}`),{event:null,respond:p};if(i&&void 0!==(null==(c=null==(a=s.config)?void 0:a.chainMocks)?void 0:c[i])){const n=s.config.chainMocks[i];e.logger.scope(`transformer:${s.type||"unknown"}`).debug("chainMock",{chain:i}),d=n;continue}if(void 0!==(null==(u=s.config)?void 0:u.mock)){e.logger.scope(`transformer:${s.type||"unknown"}`).debug("mock"),d=s.config.mock;continue}if(null==(l=s.config)?void 0:l.disabled)continue;const v=null==(f=s.config)?void 0:f.cache,y=v?ye(v):void 0,m=y?ke(y,e):void 0;let h;if(y&&m){const e=me(y,m,ve(r,d),`t:${o}`);if("HIT"===(null==e?void 0:e.status)&&e.value){if(d=e.value,y.full)return{event:d,respond:p};continue}"MISS"===(null==e?void 0:e.status)&&(h={key:e.key,ttl:e.rule.ttl})}const b=s.config.before;if(b){const t=Ae("string"==typeof b||Array.isArray(b)&&!ge(b)?b:pe(de(b),ve(r,d))||void 0,je(n));if(t.length>0){const o=await Ee(e,n,t,d,r,p,i);if(null===o.event)return{event:null,respond:null!=(g=o.respond)?g:p};o.respond&&(p=o.respond),d=Array.isArray(o.event)?o.event[0]:o.event}}const w=await ie(xe,n=>(e.logger.scope(`transformer:${s.type||"unknown"}`).error("Push failed",{error:n}),!1))(e,s,o,d,r,p);if(!1===w)return{event:null,respond:p};if(Array.isArray(w)){const s=t.slice(t.indexOf(o)+1),a=await Promise.all(w.map(async t=>{const o=t.event||d,a=r?{...r,_meta:{...r._meta,path:[...r._meta.path]}}:R("unknown");if(t.next){let r=t.next;if(ge(t.next)){r=pe(de(t.next),ve(a,o))}if(r){const t=Ae(r,je(n));if(t.length>0)return Ee(e,n,t,o,a,p,i)}return{event:o,respond:p}}return s.length>0?Ee(e,n,s,o,a,p,i):{event:o,respond:p}}));let c=p;const u=[];for(const e of a.flat())if(null!==e)if(e&&"object"==typeof e&&"event"in e){const n=e;if(n.respond&&(c=n.respond),null===n.event)continue;Array.isArray(n.event)?u.push(...n.event):u.push(n.event)}else u.push(e);return 0===u.length?{event:null,respond:c}:1===u.length?{event:u[0],respond:c}:{event:u,respond:c}}if(w&&"object"==typeof w){const{event:t,respond:o,next:s}=w;if(o&&(p=o),s){let o=s;if(ge(s)){if(o=pe(de(s),ve(r,d)),!o){t&&(d=t);continue}}const a=Ae(o,je(n));return a.length>0?Ee(e,n,a,t||d,r,p,i):(e.logger.warn(`Branch target not found: ${JSON.stringify(s)}`),{event:null,respond:p})}t&&(d=t)}if(h&&m&&he(m,h.key,d,h.ttl),(!w||"object"==typeof w&&!w.next)&&s.config.next&&ge(s.config.next)){const t=pe(de(s.config.next),ve(r,d));if(t){const o=Ae(t,je(n));if(o.length>0)return Ee(e,n,o,d,r,p,i)}return{event:d,respond:p}}}return{event:d,respond:p}}function _e(e){return e&&V(e)?e:{}}async function Se(e,n,t){var o;const{code:r,config:s={},env:i={},primary:a,next:c,before:u,cache:l}=t;let f,g=R(n);const d=l?ye({...l,full:null==(o=l.full)||o}):void 0,p=de(c),v=Array.isArray(c)&&ge(c)||!p?void 0:Ae(pe(p),je(e.transformers)),y=de(u),m=Array.isArray(u)&&ge(u)||!y?void 0:Ae(pe(y),je(e.transformers)),h=e.logger.scope("source").scope(n),b={push:async(t,o={})=>{let r,i=t;const a=null!=m?m:y?Ae(pe(y,ve(g)),je(e.transformers)):[];if(a.length>0&&e.transformers&&Object.keys(e.transformers).length>0){const t=await Ee(e,e.transformers,a,i,g,f,`source.${n}.before`);if(null===t.event)return{ok:!0};t.respond&&(f=t.respond),i=Array.isArray(t.event)?t.event[0]:t.event}if(d){const t=ke(d,e);if(t){const e=ve(g),o=me(d,t,e,`s:${n}`);if(o){if("HIT"===o.status&&void 0!==o.value&&d.full){let n=o.value;return o.rule.update&&(n=await be(n,o.rule.update,{...e,cache:{status:"HIT"}})),null==f||f(n),{ok:!0}}if("MISS"===o.status&&d.full&&f){const n=f,s=o.rule.update,i={...e,cache:{status:"MISS"}},a=o.key,c=o.rule.ttl;f=e=>{he(t,a,e,c),s?r=(async()=>{const t=await be(e,s,i);n(t)})():n(e)}}"MISS"!==o.status||d.full||he(t,o.key,!0,o.rule.ttl)}}}const c=null!=v?v:p?Ae(pe(p,ve(g)),je(e.transformers)):[],u=await e.push(i,{...o,id:n,ingest:g,respond:f,mapping:s,preChain:c});return r&&await r,u},command:e.command,sources:e.sources,elb:e.sources.elb.push,logger:h,...i},w={collector:e,logger:h,id:n,config:s,env:b,setIngest:async t=>{if(!s.ingest)return void(g=R(n));const o=await ae(t,s.ingest,{collector:e}),r=R(n);g={...r,...o,_meta:r._meta}},setRespond:e=>{f=e}},k=await ie(r)(w);if(!k)return;const j=k.type||"unknown",O=e.logger.scope(j).scope(n);return b.logger=O,a&&(k.config={...k.config,primary:a}),k}function Pe(e,n,t,o,r){if(!n.on)return;const s=n.type||"unknown",i=e.logger.scope(s).scope("on").scope(o),a={collector:e,logger:i,id:t,config:n.config,data:r,env:Te(n.env,n.config.env)};se(n.on)(o,a)}function De(e,n,t,o){let r;switch(n){case we.Consent:r=o||e.consent;break;case we.Session:r=e.session;break;case we.User:r=o||e.user;break;case we.Custom:r=o||e.custom;break;case we.Globals:r=o||e.globals;break;case we.Config:r=o||e.config;break;case we.Ready:case we.Run:default:r=void 0}if(t.length)switch(n){case we.Consent:!function(e,n,t){const o=t||e.consent;n.forEach(n=>{Object.keys(o).filter(e=>e in n).forEach(t=>{se(n[t])(e,o)})})}(e,t,o);break;case we.Ready:case we.Run:i=t,(s=e).allowed&&i.forEach(e=>{se(e)(s)});break;case we.Session:!function(e,n){e.session&&n.forEach(n=>{se(n)(e,e.session)})}(e,t);break;default:t.forEach(n=>{"function"==typeof n&&se(n)(e,r)})}var s,i}function $e(e,n,t,o){if(!e)return[];if(n){const e=pe(n,ve(o));return e?Ae(e,je(t)):[]}return Ae(e,je(t))}async function qe(e,n,t){const{code:o,config:r={},env:s={},before:i,next:a,cache:c}=n;if(!H(o.push))return Re({ok:!1,failed:{invalid:{type:"invalid",error:"Destination code must have a push method"}}});const u=t||r||{init:!1};let l=i?{...u,before:i}:{...u};a&&(l={...l,next:a}),c&&(l={...l,cache:c});const f={...o,config:l,env:Te(o.env,s)};let g=f.config.id;if(!g)do{g=X(5,"abcdefghijklmnopqrstuvwxyz")}while(e.destinations[g]);return e.destinations[g]=f,!1!==f.config.queue&&(f.queuePush=[...e.queue]),Me(e,void 0,{},{[g]:f})}async function Me(e,n,t={},o){const{allowed:r,consent:s,globals:i,user:a}=e;if(!r)return Re({ok:!1});n&&(e.queue.push(n),e.status.in++),o||(o=e.destinations);const c=await Promise.all(Object.entries(o||{}).map(async([o,r])=>{var c,u,l;if(r.config.disabled)return{id:o,destination:r,skipped:!0};let f=(r.queuePush||[]).map(e=>({...e,consent:s}));r.queuePush=[],n&&f.push(K(n));const g=t.ingest?{...t.ingest,_meta:{...t.ingest._meta,path:[...t.ingest._meta.path]}}:R("unknown");if(!f.length&&!(null==(c=r.queueOn)?void 0:c.length))return{id:o,destination:r,skipped:!0};if(!f.length&&(null==(u=r.queueOn)?void 0:u.length)){const n=await ie(Ie)(e,r,o);return{id:o,destination:r,skipped:!n}}const d=[],p=f.filter(e=>{const n=J(r.config.consent,s,e.consent);return!n||(e.consent=n,d.push(e),!1)});if(r.queuePush.push(...p),!d.length)return{id:o,destination:r,queue:f};if(!await ie(Ie)(e,r,o))return{id:o,destination:r,queue:f};let v,y;r.dlq||(r.dlq=[]);const m=r.config.before,h=$e(m,m&&ge(m)?de(m):void 0,e.transformers,g),b=r.config.next,w=b&&ge(b)?de(b):void 0,k=null==(l=r.config)?void 0:l.cache,j=k?ye(k):void 0,O=j?ke(j,e):void 0;let A=0;return await Promise.all(d.map(async n=>{let s;if(n.globals=T(i,n.globals),n.user=T(a,n.user),(null==j?void 0:j.full)&&O){const e=ve(g,n),t=me(j,O,e,`d:${o}`);if("HIT"===(null==t?void 0:t.status))return n;"MISS"===(null==t?void 0:t.status)&&(s={key:t.key,ttl:t.rule.ttl})}let c=n,u=t.respond;if(h.length>0&&e.transformers&&Object.keys(e.transformers).length>0){const r=await Ee(e,e.transformers,h,n,g,t.respond,`destination.${o}.before`);if(null===r.event)return n;r.respond&&(u=r.respond),c=Array.isArray(r.event)?r.event[0]:r.event}if(j&&!j.full&&O){const e=ve(g,c),t=me(j,O,e,`d:${o}`);if("HIT"===(null==t?void 0:t.status))return n;"MISS"===(null==t?void 0:t.status)&&(s={key:t.key,ttl:t.rule.ttl})}const l=Date.now();let f=!1;const d=await ie(Ne,n=>{const t=r.type||"unknown";e.logger.scope(t).error("Push failed",{error:n,event:c.name}),v=n,f=!0,r.dlq.push([c,n])})(e,r,o,c,g,u);if(A+=Date.now()-l,s&&O&&void 0===r.config.mock&&he(O,s.key,null==d||d,s.ttl),void 0!==d&&(y=d),!f&&b){void 0!==d&&(g._response=d);const n=$e(b,w,e.transformers,g);if(n.length>0&&e.transformers&&Object.keys(e.transformers).length>0){const t=await Ee(e,e.transformers,n,c,g,u,`destination.${o}.next`);t.respond&&(u=t.respond)}}return n})),{id:o,destination:r,error:v,response:y,totalDuration:A}})),u={},l={},f={};for(const n of c){if(n.skipped)continue;const t={type:n.destination.type||"unknown",data:n.response};e.status.destinations[n.id]||(e.status.destinations[n.id]={count:0,failed:0,duration:0});const o=e.status.destinations[n.id],r=Date.now();n.error?(t.error=n.error,f[n.id]=t,o.failed++,o.lastAt=r,o.duration+=n.totalDuration||0,e.status.failed++):n.queue&&n.queue.length?l[n.id]=t:(u[n.id]=t,o.count++,o.lastAt=r,o.duration+=n.totalDuration||0,e.status.out++)}return Re({event:n,...Object.keys(u).length&&{done:u},...Object.keys(l).length&&{queued:l},...Object.keys(f).length&&{failed:f}})}async function Ie(e,n,t){var o;if(n.init&&!n.config.init){const r=n.type||"unknown",s=e.logger.scope(r),i={collector:e,logger:s,id:t,config:n.config,env:Te(n.env,n.config.env)};s.debug("init");const a=await le(n.init,"DestinationInit",e.hooks,e.logger)(i);if(!1===a)return a;if(n.config={...a||n.config,init:!0},null==(o=n.queueOn)?void 0:o.length){const o=n.queueOn;n.queueOn=[];for(const{type:r,data:s}of o)Pe(e,n,t,r,s)}s.debug("init done")}return!0}async function Ne(e,n,t,o,r,s){const{config:i}=n,a=await ue(o,i,e);if(a.ignore)return!1;const c=n.type||"unknown",u=e.logger.scope(c),l={collector:e,logger:u,id:t,config:i,data:a.data,rule:a.mapping,ingest:r,env:{...Te(n.env,i.env),...s?{respond:s}:{}}};if(void 0!==i.mock)return u.debug("mock",{event:a.event.name}),i.mock;const f=a.mapping,g=a.mappingKey||"* *";if(!(null==f?void 0:f.batch)||!n.pushBatch||void 0!==i.mock){u.debug("push",{event:a.event.name});const t=await le(n.push,"DestinationPush",e.hooks,e.logger)(a.event,l);return u.debug("push done"),t}{if(n.batches=n.batches||{},!n.batches[g]){const o={key:g,events:[],data:[]};n.batches[g]={batched:o,batchFn:Y(()=>{const o=n.batches[g].batched,a={collector:e,logger:u,id:t,config:i,data:void 0,rule:f,ingest:r,env:{...Te(n.env,i.env),...s?{respond:s}:{}}};u.debug("push batch",{events:o.events.length}),le(n.pushBatch,"DestinationPushBatch",e.hooks,e.logger)(o,a),u.debug("push batch done"),o.events=[],o.data=[]},f.batch)}}const o=n.batches[g];o.batched.events.push(a.event),G(a.data)&&o.batched.data.push(a.data),o.batchFn()}return!0}function Re(e){return{ok:!(null==e?void 0:e.failed),...e}}function Ue(e){const{code:n,config:t={},env:o={},cache:r}=e,{config:s}=Oe(e,"before"),{config:i}=Oe({...e,config:s},"next"),a={...n.config,...t,...i};r&&(a.cache=r);const c=Te(n.env,o);return{...n,config:a,env:c}}function Te(e,n){return e||n?n?e&&V(e)&&V(n)?{...e,...n}:n:e:{}}async function Le(e,n,t){const o=Object.entries(e).map(async([e,o])=>{var r;const s=o.destroy;if(!s)return;const i=o.type||"unknown",a=t.scope(i),c={id:e,config:o.config,env:null!=(r=o.env)?r:{},logger:a};try{await Promise.race([s(c),new Promise((t,o)=>setTimeout(()=>o(new Error(`${n} '${e}' destroy timed out`)),5e3))])}catch(t){a.error(`${n} '${e}' destroy failed: ${t}`)}});await Promise.allSettled(o)}async function Ge(e,n,t,o){let r,s,i=!1;switch(n){case we.Config:V(t)&&(T(e.config,t,{shallow:!1}),s=t,i=!0);break;case we.Consent:if(V(t)){const{update:n}=function(e,n){const t={};return Object.entries(n).forEach(([e,n])=>{t[e]=!!n}),e.consent=T(e.consent,t),{update:t}}(e,t);s=n,i=!0}break;case we.Custom:V(t)&&(e.custom=T(e.custom,t),s=t,i=!0);break;case we.Destination:V(t)&&("code"in t&&V(t.code)?r=await qe(e,t,o):H(t.push)&&(r=await qe(e,{code:t},o)));break;case we.Globals:V(t)&&(e.globals=T(e.globals,t),s=t,i=!0);break;case we.On:B(t)&&await async function(e,n,t){const o=e.on,r=o[n]||[],s=L(t)?t:[t];s.forEach(e=>{r.push(e)}),o[n]=r,De(e,n,s)}(e,t,o);break;case we.Ready:i=!0;break;case we.Run:r=await async function(e,n){return e.allowed=!0,e.count=0,e.group=X(),e.timing=Date.now(),n&&(n.consent&&(e.consent=T(e.consent,n.consent)),n.user&&(e.user=T(e.user,n.user)),n.globals&&(e.globals=T(e.config.globalsStatic||{},n.globals)),n.custom&&(e.custom=T(e.custom,n.custom))),Object.values(e.destinations).forEach(e=>{e.queuePush=[]}),e.queue=[],e.round++,await Me(e)}(e,t),i=!0;break;case we.Session:i=!0;break;case we.Shutdown:await async function(e){const n=e.logger;await Le(e.sources,"source",n),await Le(e.destinations,"destination",n),await Le(e.transformers,"transformer",n),await Le(e.stores,"store",n)}(e);break;case we.User:V(t)&&(T(e.user,t,{shallow:!1}),s=t,i=!0)}return i&&(await async function(e,n,t,o){let r,s=t||[];switch(t||(s=e.on[n]||[]),n){case we.Consent:r=o||e.consent;break;case we.Session:r=e.session;break;case we.User:r=o||e.user;break;case we.Custom:r=o||e.custom;break;case we.Globals:r=o||e.globals;break;case we.Config:r=o||e.config;break;case we.Ready:case we.Run:default:r=void 0}let i=!1;for(const t of Object.values(e.sources))t.on&&!1===await ie(t.on)(n,r)&&(i=!0);return Object.entries(e.destinations).forEach(([t,o])=>{if(o.on){if(!o.config.init)return o.queueOn=o.queueOn||[],void o.queueOn.push({type:n,data:r});Pe(e,o,t,n,r)}}),(Object.keys(e.pending.sources).length>0||Object.keys(e.pending.destinations).length>0)&&await async function(e,n){var t,o;for(const[o,r]of Object.entries(e.pending.sources)){if(!e.pending.sources[o]||e.sources[o])continue;const s=null==(t=r.config)?void 0:t.require;if(!s)continue;const i=s.indexOf(n);if(-1===i)continue;if(s.splice(i,1),s.length>0)continue;delete e.pending.sources[o];const a=await Se(e,o,r);a&&(e.sources[o]=a)}for(const[t,r]of Object.entries(e.pending.destinations)){if(!e.pending.destinations[t]||e.destinations[t])continue;const s=null==(o=r.config)?void 0:o.require;if(!s)continue;const i=s.indexOf(n);if(-1===i)continue;if(s.splice(i,1),s.length>0)continue;delete e.pending.destinations[t];const a=Ue(r);!1!==a.config.queue&&(a.queuePush=[...e.queue]),e.destinations[t]=a}}(e,n),De(e,n,s,o),!i}(e,n,void 0,s),r=await Me(e)),r||Re({ok:!0})}function He(e,n){if(!n.name)throw new Error("Event name is required");const[t,o]=n.name.split(" ");if(!t||!o)throw new Error("Event name is invalid");++e.count;const{timestamp:r=Date.now(),group:s=e.group,count:i=e.count}=n,{name:a=`${t} ${o}`,data:c={},context:u={},globals:l=e.globals,custom:f={},user:g=e.user,nested:d=[],consent:p=e.consent,id:v=`${r}-${s}-${i}`,trigger:y="",entity:m=t,action:h=o,timing:b=0,version:w={source:e.version,tagging:e.config.tagging||0},source:k={type:"collector",id:"",previous_id:""}}=n;return{name:a,data:c,context:u,globals:l,custom:f,user:g,nested:d,consent:p,id:v,trigger:y,entity:m,action:h,timestamp:r,timing:b,group:s,count:i,version:w,source:k}}async function Ve(e){var n,t;const o=T({globalsStatic:{},sessionStatic:{},tagging:0,run:!0},e,{merge:!1,extend:!1}),r=ne({level:null==(n=e.logger)?void 0:n.level,handler:null==(t=e.logger)?void 0:t.handler}),s={...o.globalsStatic,...e.globals},i={allowed:!1,config:o,consent:e.consent||{},count:0,custom:e.custom||{},destinations:{},transformers:{},stores:{},globals:s,group:"",hooks:e.hooks||{},logger:r,on:{},queue:[],round:0,session:void 0,status:{startedAt:Date.now(),in:0,out:0,failed:0,sources:{},destinations:{}},timing:Date.now(),user:e.user||{},version:"3.4.2",sources:{},pending:{sources:{},destinations:{}},push:void 0,command:void 0};var a,c;i.push=function(e,n){return le(async(t,o={})=>await ie(async()=>{var r;const s=Date.now(),{id:i,ingest:a,respond:c,mapping:u,preChain:l,include:f,exclude:g}=o;let d=c,p=t;const v=f||g?function(e,n,t){let o=e;return n&&(o=Object.fromEntries(Object.entries(o).filter(([e])=>n.includes(e)))),t&&(o=Object.fromEntries(Object.entries(o).filter(([e])=>!t.includes(e)))),o}(e.destinations,f,g):void 0,y=null!=a?a:R(i||"unknown");if(u){const n=await ue(p,u,e);if(n.ignore)return Re({ok:!0});if(u.consent&&!J(u.consent,e.consent,n.event.consent))return Re({ok:!0});p=n.event}if((null==l?void 0:l.length)&&e.transformers&&Object.keys(e.transformers).length>0){const t=await Ee(e,e.transformers,l,p,y,d,i?`source.${i}.next`:void 0);if(null===t.event)return Re({ok:!0});if(t.respond&&(d=t.respond),Array.isArray(t.event)){const o=await Promise.all(t.event.map(async t=>{const o=n(t),r=He(e,o);return Me(e,r,{id:i,ingest:y,respond:d},v)}));if(i){e.status.sources[i]||(e.status.sources[i]={count:0,duration:0});const n=e.status.sources[i];n.count+=t.event.length,n.lastAt=Date.now(),n.duration+=Date.now()-s}return null!=(r=o[0])?r:Re({ok:!0})}p=t.event}const m=n(p),h=He(e,m),b=await Me(e,h,{id:i,ingest:y,respond:d},v);if(i){e.status.sources[i]||(e.status.sources[i]={count:0,duration:0});const n=e.status.sources[i];n.count++,n.lastAt=Date.now(),n.duration+=Date.now()-s}return b},()=>Re({ok:!1}))(),"Push",e.hooks,e.logger)}(i,e=>({timing:Math.round((Date.now()-i.timing)/10)/100,source:{type:"collector",id:"",previous_id:""},...e})),i.command=(c=Ge,le(async(e,n,t)=>await ie(async()=>await c(a,e,n,t),()=>Re({ok:!1}))(),"Command",(a=i).hooks,a.logger));const u=e.stores||{};if(i.stores=await async function(e,n={}){const t={};for(const[o,r]of Object.entries(n)){const{code:n,config:s={},env:i={}}=r,a=e.logger.scope("store").scope(o),c={collector:e,logger:a,id:o,config:s,env:i},u=await n(c),l=u.get,f=u.set,g=u.delete;u.get=le(l,"StoreGet",e.hooks,e.logger),u.set=le(f,"StoreSet",e.hooks,e.logger),u.delete=le(g,"StoreDelete",e.hooks,e.logger),t[o]=u}return t}(i,u),function(e,n,t){const o=new Map;for(const[t,r]of Object.entries(e))n[t]&&o.set(r,n[t]);if(0!==o.size)for(const e of[t.transformers,t.destinations,t.sources])if(e)for(const n of Object.values(e))r(n.env);function r(e){if(e)for(const[n,t]of Object.entries(e))if("object"==typeof t&&null!==t){const r=o.get(t);r&&(e[n]=r)}}}(u,i.stores,e),!i.stores.__cache){const e=new Map;i.stores.__cache={type:"memory",config:{},get:n=>{const t=e.get(n);if(t){if(!(t.expires&&Date.now()>t.expires))return t.value;e.delete(n)}},set:(n,t,o)=>{e.set(n,{value:t,expires:o?Date.now()+o:void 0})},delete:n=>{e.delete(n)}}}return i.destinations=await async function(e,n={}){var t,o;const r={};for(const[s,i]of Object.entries(n))(null==(o=null==(t=i.config)?void 0:t.require)?void 0:o.length)?e.pending.destinations[s]=i:r[s]=Ue(i);return r}(i,e.destinations||{}),i.transformers=await async function(e,n={}){const t={};for(const[o,r]of Object.entries(n)){const{code:n,env:s={}}=r,{config:i}=Oe(r,"before"),{config:a}=Oe({...r,config:i},"next"),c=Object.keys(s).length>0?{...a,env:s}:a,{cache:u}=r,l=u?{...c,cache:u}:c,f=e.logger.scope("transformer").scope(o),g={collector:e,logger:f,id:o,ingest:R(o),config:l,env:s},d=await n(g);t[o]=d}return t}(i,e.transformers||{}),i}async function Be(e){e=e||{};const n=await Ve(e),t=(o=n,{type:"elb",config:{},push:async(e,n,t,r,s,i)=>{if("string"==typeof e&&e.startsWith("walker ")){const r=e.replace("walker ","");return o.command(r,n,t)}let a;if("string"==typeof e)a={name:e},n&&"object"==typeof n&&!Array.isArray(n)&&(a.data=n);else{if(!e||"object"!=typeof e)return Re({ok:!1});a=e,n&&"object"==typeof n&&!Array.isArray(n)&&(a.data={...a.data||{},...n})}return r&&"object"==typeof r&&(a.context=r),s&&Array.isArray(s)&&(a.nested=s),i&&"object"==typeof i&&(a.custom=i),o.push(a)}});var o;n.sources.elb=t;const r=await async function(e,n={}){const t={};for(const[o,r]of Object.entries(n)){const{config:n={}}=r;if(n.require&&n.require.length>0){e.pending.sources[o]=r;continue}const s=await Se(e,o,r);s&&(t[o]=s)}return t}(n,e.sources||{});Object.assign(n.sources,r);const{consent:s,user:i,globals:a,custom:c}=e;s&&await n.command("consent",s),i&&await n.command("user",i),a&&Object.assign(n.globals,a),c&&Object.assign(n.custom,c),n.config.run&&await n.command("run");let u=t.push;const l=Object.values(n.sources).filter(e=>"elb"!==e.type),f=l.find(e=>e.config.primary);return f?u=f.push:l.length>0&&(u=l[0].push),{collector:n,elb:u}}var Ke,We=async e=>{let n;return{get flow(){return n},trigger:(t,o)=>async t=>{var r;if(!n){const t=await Be({...e,run:null==(r=e.run)||r});n={collector:t.collector,elb:t.elb}}const s=(null==o?void 0:o.eventName)||"ucEvent";window.dispatchEvent(new CustomEvent(s,{detail:t}))}}},Fe=(e,n)=>{if(e&&"object"==typeof e)return()=>{n.window.dispatchEvent(new CustomEvent("ucEvent",{detail:e}))}},ze=async e=>{var n,t,o,r,s,i,a,c,u,f,d,p;const{config:v,env:y}=e,{elb:m,logger:h}=y,b=null!=(n=y.window)?n:void 0!==globalThis.window?globalThis.window:void 0,w={eventName:null!=(o=null==(t=null==v?void 0:v.settings)?void 0:t.eventName)?o:"ucEvent",categoryMap:null!=(s=null==(r=null==v?void 0:v.settings)?void 0:r.categoryMap)?s:{},explicitOnly:null==(a=null==(i=null==v?void 0:v.settings)?void 0:i.explicitOnly)||a,apiVersion:null!=(u=null==(c=null==v?void 0:v.settings)?void 0:c.apiVersion)?u:"auto",v3EventName:null!=(d=null==(f=null==v?void 0:v.settings)?void 0:f.v3EventName)?d:"UC_UI_CMP_EVENT"},k={settings:w},j=[];if(b){const e={window:b,elb:m,settings:w,logger:h},n=null!=(p=w.apiVersion)?p:"auto";"v2"===n?j.push(l(e)):"v3"===n||b.__ucCmp?j.push(await g(e)):b.UC_UI?j.push(l(e)):(j.push(l(e)),j.push(await g(e)))}return{type:"usercentrics",config:k,push:m,destroy:async()=>{j.forEach(e=>e())}}},Je=ze;return Ke=s,((r,s,i,a)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let c of t(s))o.call(r,c)||c===i||e(r,c,{get:()=>s[c],enumerable:!(a=n(s,c))||a.enumerable});return r})(e({},"__esModule",{value:!0}),Ke)})();
|
|
1
|
+
"use strict";var SourceUsercentrics=(()=>{var e=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r=(n,t)=>{for(var o in t)e(n,o,{get:t[o],enumerable:!0})},s={};r(s,{SourceUsercentrics:()=>d,createMockElbFn:()=>E,createTrigger:()=>Fe,default:()=>Xe,fullConsent:()=>p,fullConsentCustomMapped:()=>A,fullConsentMapped:()=>k,fullConsentUpperCase:()=>h,implicitConsent:()=>m,minimalConsent:()=>y,minimalConsentMapped:()=>O,nonConsentEvent:()=>w,noopLogger:()=>_,partialConsent:()=>v,partialConsentMapped:()=>j,serviceLevelConsent:()=>b,serviceLevelMapped:()=>C,sourceUsercentrics:()=>Je,step:()=>S,trigger:()=>ze});var i=["action","event","type","ucCategory"];function a(e,n,t){e[n]=(void 0===e[n]||Boolean(e[n]))&&t}function c(e,n){const t={};var o;return e.ucCategory&&(o=e.ucCategory,Object.values(o).every(e=>"boolean"==typeof e))?Object.entries(e.ucCategory).forEach(([e,o])=>{var r,s;if("boolean"!=typeof o)return;const i=null!=(s=null==(r=n.categoryMap)?void 0:r[e])?s:e;a(t,i,o)}):(e.ucCategory&&Object.entries(e.ucCategory).forEach(([e,o])=>{var r,s;if("boolean"==typeof o){const i=null!=(s=null==(r=n.categoryMap)?void 0:r[e])?s:e;a(t,i,o)}}),Object.entries(e).forEach(([e,n])=>{if(i.includes(e))return;if("boolean"!=typeof n)return;const o=e.toLowerCase().replace(/ /g,"_");a(t,o,n)})),t}function l(e){const n={};return e.forEach(e=>{var t,o;const r=e.categorySlug,s=null!=(o=null==(t=e.consent)?void 0:t.status)&&o;n[r]=(void 0===n[r]||n[r])&&s}),n}function u(e){var n,t;const{window:o,elb:r,settings:s,logger:i}=e,a=null!=(n=s.eventName)?n:"ucEvent",u=e=>{var n;if(i.debug("event received",e),"consent_status"!==e.event)return;if(s.explicitOnly&&"explicit"!==(null==(n=e.type)?void 0:n.toLowerCase()))return;const t=c(e,s);Object.keys(t).length>0&&r("walker consent",t)},f=e=>{const n=e;n.detail&&u(n.detail)};o.addEventListener(a,f);const g=o.UC_UI;if((null==(t=null==g?void 0:g.isInitialized)?void 0:t.call(g))&&g.getServicesBaseInfo){const e=g.getServicesBaseInfo();e.length>0&&u(function(e){return{event:"consent_status",type:"implicit",ucCategory:l(e)}}(e))}return()=>{o.removeEventListener(a,f)}}var f=new Set(["ACCEPT_ALL","DENY_ALL","SAVE"]);async function g(e){var n;const{window:t,elb:o,settings:r,logger:s}=e,i=null!=(n=r.v3EventName)?n:"UC_UI_CMP_EVENT",a=async e=>{const n=function(e){const n={};return Object.entries(e.categories).forEach(([e,t])=>{n[e]="ALL_ACCEPTED"===t.state}),{event:"consent_status",type:"EXPLICIT"===e.consent.type?"explicit":"implicit",ucCategory:n}}(await e.getConsentDetails());if(s.debug("event received",n),r.explicitOnly&&"explicit"!==n.type)return;const t=c(n,r);Object.keys(t).length>0&&o("walker consent",t)},l=e=>{const n=t.__ucCmp;if(!n)return;const o=e.detail;o&&"CMP"===o.source&&o.type&&f.has(o.type)&&a(n).catch(()=>{})};t.addEventListener(i,l);const u=t.__ucCmp;if(u)try{await u.isInitialized()&&await a(u)}catch(e){s.warn("v3 static consent read failed",e)}return()=>{t.removeEventListener(i,l)}}var d={},p={event:"consent_status",type:"explicit",action:"onAcceptAllServices",ucCategory:{essential:!0,functional:!0,marketing:!0},"Google Analytics":!0,"Google Ads Remarketing":!0},v={event:"consent_status",type:"explicit",action:"onUpdateServices",ucCategory:{essential:!0,functional:!0,marketing:!1},"Google Analytics":!0,"Google Ads Remarketing":!1},y={event:"consent_status",type:"explicit",action:"onDenyAllServices",ucCategory:{essential:!0,functional:!1,marketing:!1},"Google Analytics":!1,"Google Ads Remarketing":!1},m={event:"consent_status",type:"implicit",ucCategory:{essential:!0,functional:!1,marketing:!1},"Google Analytics":!1,"Google Ads Remarketing":!1},h={event:"consent_status",type:"EXPLICIT",action:"onAcceptAllServices",ucCategory:{essential:!0,functional:!0,marketing:!0}},b={event:"consent_status",type:"explicit",action:"onUpdateServices",ucCategory:{essential:!0,functional:"partial",marketing:"partial"},"Google Analytics":!0,"Google Ads Remarketing":!1,Hotjar:!0},w={event:"other_event",type:"explicit"},k={essential:!0,functional:!0,marketing:!0},j={essential:!0,functional:!0,marketing:!1},O={essential:!0,functional:!1,marketing:!1},A={functional:!0,marketing:!0},C={essential:!0,google_analytics:!0,google_ads_remarketing:!1,hotjar:!0},x=()=>{},E=()=>()=>Promise.resolve({ok:!0}),_={error:x,warn:x,info:x,debug:x,throw:e=>{throw"string"==typeof e?new Error(e):e},json:x,scope:()=>_},S={};r(S,{categoryMapOverride:()=>M,customEventName:()=>q,fullConsent:()=>P,minimalConsent:()=>D});var P={title:"Full consent",description:"A Usercentrics onAcceptAllServices event emits a walker consent command with essential, functional, and marketing granted.",trigger:{type:"consent"},in:{event:"consent_status",type:"explicit",action:"onAcceptAllServices",ucCategory:{essential:!0,functional:!0,marketing:!0}},out:[["elb","walker consent",{essential:!0,functional:!0,marketing:!0}]]},D={title:"Minimal consent",description:"A Usercentrics onDenyAllServices event emits a walker consent command with only essential granted.",trigger:{type:"consent"},in:{event:"consent_status",type:"explicit",action:"onDenyAllServices",ucCategory:{essential:!0,functional:!1,marketing:!1}},out:[["elb","walker consent",{essential:!0,functional:!1,marketing:!1}]]},M={title:"Category map override",description:"Custom categoryMap remaps essential to functional and functional to analytics",trigger:{type:"consent"},in:{event:"consent_status",type:"explicit",ucCategory:{essential:!0,functional:!0,marketing:!1}},mapping:{categoryMap:{essential:"functional",functional:"analytics"}},out:[["elb","walker consent",{functional:!0,analytics:!0,marketing:!1}]]},q={title:"Custom event name",description:"Using UC_SDK_EVENT instead of ucEvent for Usercentrics SDK v2",trigger:{type:"consent",options:{eventName:"UC_SDK_EVENT"}},in:{event:"consent_status",type:"explicit",ucCategory:{essential:!0,functional:!0,marketing:!0}},mapping:{eventName:"UC_SDK_EVENT"},out:[["elb","walker consent",{essential:!0,functional:!0,marketing:!0}]]},I=Object.defineProperty;((e,n)=>{for(var t in n)I(e,t,{get:n[t],enumerable:!0})})({},{Level:()=>N});var $,N=(($=N||{})[$.ERROR=0]="ERROR",$[$.WARN=1]="WARN",$[$.INFO=2]="INFO",$[$.DEBUG=3]="DEBUG",$);function R(e){return{_meta:{hops:0,path:[e]}}}var U={merge:!0,shallow:!0,extend:!0};function T(e,n={},t={}){t={...U,...t};const o=Object.entries(n).reduce((n,[o,r])=>{const s=e[o];return t.merge&&Array.isArray(s)&&Array.isArray(r)?n[o]=r.reduce((e,n)=>e.includes(n)?e:[...e,n],[...s]):(t.extend||o in e)&&(n[o]=r),n},{});return t.shallow?{...e,...o}:(Object.assign(e,o),e)}function L(e){return Array.isArray(e)}function G(e){return void 0!==e}function H(e){return"function"==typeof e}function V(e){return"object"==typeof e&&null!==e&&!L(e)&&"[object Object]"===Object.prototype.toString.call(e)}function B(e){return"string"==typeof e}function K(e,n=new WeakMap){if("object"!=typeof e||null===e)return e;if(n.has(e))return n.get(e);const t=Object.prototype.toString.call(e);if("[object Object]"===t){const t={};n.set(e,t);for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=K(e[o],n));return t}if("[object Array]"===t){const t=[];return n.set(e,t),e.forEach(e=>{t.push(K(e,n))}),t}if("[object Date]"===t)return new Date(e.getTime());if("[object RegExp]"===t){const n=e;return new RegExp(n.source,n.flags)}return e}function W(e,n="",t){const o=n.split(".");let r=e;for(let e=0;e<o.length;e++){const n=o[e];if("*"===n&&L(r)){const n=o.slice(e+1).join("."),s=[];for(const e of r){const o=W(e,n,t);s.push(o)}return s}if(r=r instanceof Object?r[n]:void 0,void 0===r)break}return G(r)?r:t}function F(e,n,t){if(!V(e))return e;const o=K(e),r=n.split(".");let s=o;for(let e=0;e<r.length;e++){const n=r[e];e===r.length-1?s[n]=t:(n in s&&"object"==typeof s[n]&&null!==s[n]||(s[n]={}),s=s[n])}return o}var z={data:e=>e.data,globals:e=>e.globals,context:e=>e.context,user:e=>e.user,source:e=>e.source,event:e=>({entity:e.entity,action:e.action,id:e.id,timestamp:e.timestamp,name:e.name,trigger:e.trigger,timing:e.timing})};function J(e,n={},t={}){const o={...n,...t},r={};let s=!e||0===Object.keys(e).length;return Object.keys(o).forEach(n=>{o[n]&&(r[n]=!0,e&&e[n]&&(s=!0))}),!!s&&r}function X(){let e="";for(let n=0;n<16;n++)e+=(16*Math.random()|0).toString(16);return e}function Y(e=6,n){if(n){const t=n.length;let o="";for(let r=0;r<e;r++)o+=n[Math.random()*t|0];return o}let t="";for(let n=36;t.length<e;)t+=(Math.random()*n|0).toString(n);return t}function Q(e,n=1e3,t=!1){let o,r=null,s=!1;return(...i)=>new Promise(a=>{const c=t&&!s;r&&clearTimeout(r),r=setTimeout(()=>{r=null,t&&!s||(o=e(...i),a(o))},n),c&&(s=!0,o=e(...i),a(o))})}function Z(e){return{message:e.message,name:e.name,stack:e.stack,cause:e.cause}}function ee(e,n){let t,o={};return e instanceof Error?(t=e.message,o.error=Z(e)):t=e,void 0!==n&&(n instanceof Error?o.error=Z(n):"object"==typeof n&&null!==n?(o={...o,...n},"error"in o&&o.error instanceof Error&&(o.error=Z(o.error))):o.value=n),{message:t,context:o}}var ne=(e,n,t,o)=>{const r=`${N[e]}${o.length>0?` [${o.join(":")}]`:""}`,s=Object.keys(t).length>0,i=0===e?console.error:1===e?console.warn:console.log;s?i(r,n,t):i(r,n)};function te(e={}){return oe({level:void 0!==e.level?(n=e.level,"string"==typeof n?N[n]:n):0,handler:e.handler,jsonHandler:e.jsonHandler,scope:[]});var n}function oe(e){const{level:n,handler:t,jsonHandler:o,scope:r}=e,s=(e,o,s)=>{if(e<=n){const n=ee(o,s);t?t(e,n.message,n.context,r,ne):ne(e,n.message,n.context,r)}};return{error:(e,n)=>s(0,e,n),warn:(e,n)=>s(1,e,n),info:(e,n)=>s(2,e,n),debug:(e,n)=>s(3,e,n),throw:(e,n)=>{const o=ee(e,n);throw t?t(0,o.message,o.context,r,ne):ne(0,o.message,o.context,r),new Error(o.message)},json:e=>{o?o(e):console.log(JSON.stringify(e,null,2))},scope:e=>oe({level:n,handler:t,jsonHandler:o,scope:[...r,e]})}}function re(e){return function(e){return"boolean"==typeof e}(e)||B(e)||function(e){return"number"==typeof e&&!Number.isNaN(e)}(e)||!G(e)||L(e)&&e.every(re)||V(e)&&Object.values(e).every(re)}function se(e){return re(e)?e:void 0}function ie(e,n,t){return function(...o){try{return e(...o)}catch(e){if(!n)return;return n(e)}finally{null==t||t()}}}function ae(e,n,t){return async function(...o){try{return await e(...o)}catch(e){if(!n)return;return await n(e)}finally{await(null==t?void 0:t())}}}async function ce(e,n={},t={}){var o;if(!G(e))return;const r=V(e)&&e.consent||t.consent||(null==(o=t.collector)?void 0:o.consent),s=L(n)?n:[n];for(const n of s){const o=await ae(le)(e,n,{...t,consent:r});if(G(o))return o}}async function le(e,n,t={}){const{collector:o,consent:r}=t;return(L(n)?n:[n]).reduce(async(n,s)=>{const i=await n;if(i)return i;const a=B(s)?{key:s}:s;if(!Object.keys(a).length)return;const{condition:c,consent:l,fn:u,key:f,loop:g,map:d,set:p,validate:v,value:y}=a;if(c&&!await ae(c)(e,s,o))return;if(l&&!J(l,r))return y;let m=G(y)?y:e;if(u&&(m=await ae(u)(e,s,t)),f&&(m=W(e,f,y)),g){const[n,o]=g,r="this"===n?[e]:await ce(e,n,t);L(r)&&(m=(await Promise.all(r.map(e=>ce(e,o,t)))).filter(G))}else d?m=await Object.entries(d).reduce(async(n,[o,r])=>{const s=await n,i=await ce(e,r,t);return G(i)&&(s[o]=i),s},Promise.resolve({})):p&&(m=await Promise.all(p.map(n=>le(e,n,t))));v&&!await ae(v)(m)&&(m=void 0);const h=se(m);return G(h)?h:se(y)},Promise.resolve(void 0))}async function ue(e,n,t){var o;n.policy&&await Promise.all(Object.entries(n.policy).map(async([n,o])=>{const r=await ce(e,o,{collector:t});e=F(e,n,r)}));const{eventMapping:r,mappingKey:s}=await async function(e,n){var t;const[o,r]=(e.name||"").split(" ");if(!n||!o||!r)return{};let s,i="",a=o,c=r;const l=n=>{if(n)return(n=L(n)?n:[n]).find(n=>!n.condition||n.condition(e))};n[a]||(a="*");const u=n[a];return u&&(u[c]||(c="*"),s=l(u[c])),s||(a="*",c="*",s=l(null==(t=n[a])?void 0:t[c])),s&&(i=`${a} ${c}`),{eventMapping:s,mappingKey:i}}(e,n.mapping);(null==r?void 0:r.policy)&&await Promise.all(Object.entries(r.policy).map(async([n,o])=>{const r=await ce(e,o,{collector:t});e=F(e,n,r)}));let i=n.data&&await ce(e,n.data,{collector:t});const a=Boolean(null==r?void 0:r.silent);if(r){if(r.ignore)return{event:e,data:i,mapping:r,mappingKey:s,ignore:!0,silent:a};if(r.name&&(e.name=r.name),r.data){const n=r.data&&await ce(e,r.data,{collector:t});i=V(i)&&V(n)?T(i,n):n}}const c=null!=(o=null==r?void 0:r.include)?o:n.include;if(c&&c.length>0){const n=function(e,n){const t={},o=n.includes("all")?Object.keys(z):n;for(const n of o){const o=z[n];if(!o)continue;const r=o(e);if(V(r))for(const[e,o]of Object.entries(r)){if(void 0===o)continue;const r="context"===n&&Array.isArray(o)?o[0]:o;t[`${n}_${e}`]=r}}return t}(e,c);Object.keys(n).length>0&&(i=V(i)?T(n,i):null!=i?i:n)}return{event:e,data:i,mapping:r,mappingKey:s,ignore:!1,silent:a}}function fe(e,n,t,o){return function(...r){let s;const i="pre"+n,a="post"+n,c=t[i],l=t[a],u=(e,n)=>{o?o.warn(e,{error:n}):console.warn(e,n)};if(c)try{s=c({fn:e},...r)}catch(n){u(`Hook ${String(i)} failed, falling back to original function`,n),s=e(...r)}else s=e(...r);if(l)try{s=l({fn:e,result:s},...r)}catch(e){u(`Hook ${String(a)} failed, keeping original result`,e)}return s}}function ge(e){if("*"===e)return()=>!0;if("and"in e){const n=e.and.map(ge);return e=>n.every(n=>n(e))}if("or"in e){const n=e.or.map(ge);return e=>n.some(n=>n(e))}return function(e){const{key:n,operator:t,value:o,not:r}=e,s=function(e,n){switch(e){case"eq":return e=>String(null!=e?e:"")===n;case"contains":return e=>String(null!=e?e:"").includes(n);case"prefix":return e=>String(null!=e?e:"").startsWith(n);case"suffix":return e=>String(null!=e?e:"").endsWith(n);case"regex":{const e=new RegExp(n);return n=>e.test(String(null!=n?n:""))}case"gt":{const e=Number(n);return n=>Number(n)>e}case"lt":{const e=Number(n);return n=>Number(n)<e}case"exists":return e=>null!=e}}(t,o);return e=>{const t=W(e,n),o=s(t);return r?!o:o}}(e)}function de(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]&&"match"in e[0]}function pe(e){if(null!=e){if("string"==typeof e)return{type:"static",value:e};if(Array.isArray(e)){if(0===e.length)return;return de(e)?{type:"routes",routes:e.map(e=>({match:ge(e.match),next:pe(e.next)}))}:{type:"chain",value:e}}}}function ve(e,n={}){if(e){if("static"===e.type)return e.value;if("chain"===e.type)return e.value;for(const t of e.routes)if(t.match(n))return ve(t.next,n)}}function ye(e,n){const t={ingest:null!=e?e:{}};return void 0!==n&&(t.event=n),t}function me(e){var n;return{full:null!=(n=e.full)&&n,storeId:e.store,rules:e.rules.map(e=>({match:ge(e.match),key:e.key,ttl:e.ttl,update:e.update}))}}function he(e,n,t,o){const r=e.rules.find(e=>e.match(t));if(!r)return null;const s=r.key.map(e=>{var n;return String(null!=(n=W(t,e))?n:"")});if(s.every(e=>""===e))return null;const i=`${o}:${s.join(":")}`,a=n.get(i);return void 0!==a?{status:"HIT",key:i,value:a,rule:r}:{status:"MISS",key:i,rule:r}}function be(e,n,t,o){e.set(n,t,1e3*o)}async function we(e,n,t){if(!n)return e;let o=e;for(const[e,r]of Object.entries(n))o=F(o,e,await ce(t,r));return o}var ke={Action:"action",Actions:"actions",Config:"config",Consent:"consent",Context:"context",Custom:"custom",Destination:"destination",Elb:"elb",Globals:"globals",Hook:"hook",Init:"init",Link:"link",On:"on",Prefix:"data-elb",Ready:"ready",Run:"run",Session:"session",Shutdown:"shutdown",User:"user",Walker:"walker"};function je(e,n){return e.storeId&&n.stores[e.storeId]?n.stores[e.storeId]:n.stores.__cache}function Oe(e){var n;const t={};for(const[o,r]of Object.entries(e)){const e=null==(n=r.config)?void 0:n.next;e&&!de(e)?t[o]={next:e}:t[o]={}}return t}function Ae(e,n){const t=e.config||{},o=e[n];return void 0!==o?{config:{...t,[n]:o},chainValue:o}:{config:t,chainValue:void 0}}function Ce(e,n={}){if(!e)return[];if(Array.isArray(e))return e;const t=[],o=new Set;let r=e;for(;r&&n[r]&&!o.has(r);){o.add(r),t.push(r);const e=n[r].next;if(Array.isArray(e)){t.push(...e);break}r=e}return t}async function xe(e,n,t){if(n.init&&!n.config.init){const o=n.type||"unknown",r=e.logger.scope(`transformer:${o}`),s={collector:e,logger:r,id:t,ingest:R(t),config:n.config,env:Se(n.config.env)};r.debug("init");const i=await fe(n.init,"TransformerInit",e.hooks,e.logger)(s);if(!1===i)return!1;n.config={...i||n.config,env:(null==i?void 0:i.env)||n.config.env,init:!0},r.debug("init done")}return!0}async function Ee(e,n,t,o,r,s){const i=n.type||"unknown",a=e.logger.scope(`transformer:${i}`),c={collector:e,logger:a,id:t,ingest:r,config:n.config,env:{...Se(n.config.env),...s?{respond:s}:{}}};a.debug("push",{event:o.name});const l=await fe(n.push,"TransformerPush",e.hooks,e.logger)(o,c);return a.debug("push done"),l}async function _e(e,n,t,o,r,s,i){var a,c,l,u,f,g;i&&(null==r?void 0:r._meta)&&(r._meta.chainPath=i);let d=o,p=s;for(const o of t){const s=n[o];if(!s){e.logger.warn(`Transformer not found: ${o}`);continue}if(r&&r._meta&&r._meta.path.length>256)return e.logger.error(`Max path length exceeded at ${o}`),{event:null,respond:p};if(r&&r._meta&&(r._meta.hops++,r._meta.path.push(o)),!await ae(xe)(e,s,o))return e.logger.error(`Transformer init failed: ${o}`),{event:null,respond:p};if(i&&void 0!==(null==(c=null==(a=s.config)?void 0:a.chainMocks)?void 0:c[i])){const n=s.config.chainMocks[i];e.logger.scope(`transformer:${s.type||"unknown"}`).debug("chainMock",{chain:i}),d=n;continue}if(void 0!==(null==(l=s.config)?void 0:l.mock)){e.logger.scope(`transformer:${s.type||"unknown"}`).debug("mock"),d=s.config.mock;continue}if(null==(u=s.config)?void 0:u.disabled)continue;const v=null==(f=s.config)?void 0:f.cache,y=v?me(v):void 0,m=y?je(y,e):void 0;let h;if(y&&m){const e=he(y,m,ye(r,d),`t:${o}`);if("HIT"===(null==e?void 0:e.status)&&e.value){if(d=e.value,y.full)return{event:d,respond:p};continue}"MISS"===(null==e?void 0:e.status)&&(h={key:e.key,ttl:e.rule.ttl})}const b=s.config.before;if(b){const t=Ce("string"==typeof b||Array.isArray(b)&&!de(b)?b:ve(pe(b),ye(r,d))||void 0,Oe(n));if(t.length>0){const o=await _e(e,n,t,d,r,p,i);if(null===o.event)return{event:null,respond:null!=(g=o.respond)?g:p};o.respond&&(p=o.respond),d=Array.isArray(o.event)?o.event[0]:o.event}}const w=await ae(Ee,n=>(e.logger.scope(`transformer:${s.type||"unknown"}`).error("Push failed",{error:n}),!1))(e,s,o,d,r,p);if(!1===w)return{event:null,respond:p};if(Array.isArray(w)){const s=t.slice(t.indexOf(o)+1),a=await Promise.all(w.map(async t=>{const o=t.event||d,a=r?{...r,_meta:{...r._meta,path:[...r._meta.path]}}:R("unknown");if(t.next){let r=t.next;if(de(t.next)){r=ve(pe(t.next),ye(a,o))}if(r){const t=Ce(r,Oe(n));if(t.length>0)return _e(e,n,t,o,a,p,i)}return{event:o,respond:p}}return s.length>0?_e(e,n,s,o,a,p,i):{event:o,respond:p}}));let c=p;const l=[];for(const e of a.flat())if(null!==e)if(e&&"object"==typeof e&&"event"in e){const n=e;if(n.respond&&(c=n.respond),null===n.event)continue;Array.isArray(n.event)?l.push(...n.event):l.push(n.event)}else l.push(e);return 0===l.length?{event:null,respond:c}:1===l.length?{event:l[0],respond:c}:{event:l,respond:c}}if(w&&"object"==typeof w){const{event:t,respond:o,next:s}=w;if(o&&(p=o),s){let o=s;if(de(s)){if(o=ve(pe(s),ye(r,d)),!o){t&&(d=t);continue}}const a=Ce(o,Oe(n));return a.length>0?_e(e,n,a,t||d,r,p,i):(e.logger.warn(`Branch target not found: ${JSON.stringify(s)}`),{event:null,respond:p})}t&&(d=t)}if(h&&m&&be(m,h.key,d,h.ttl),(!w||"object"==typeof w&&!w.next)&&s.config.next&&de(s.config.next)){const t=ve(pe(s.config.next),ye(r,d));if(t){const o=Ce(t,Oe(n));if(o.length>0)return _e(e,n,o,d,r,p,i)}return{event:d,respond:p}}}return{event:d,respond:p}}function Se(e){return e&&V(e)?e:{}}async function Pe(e,n,t){var o;const{code:r,config:s={},env:i={},primary:a,next:c,before:l,cache:u}=t;let f,g=R(n);const d=u?me({...u,full:null==(o=u.full)||o}):void 0,p=pe(c),v=Array.isArray(c)&&de(c)||!p?void 0:Ce(ve(p),Oe(e.transformers)),y=pe(l),m=Array.isArray(l)&&de(l)||!y?void 0:Ce(ve(y),Oe(e.transformers)),h=e.logger.scope("source").scope(n),b={push:async(t,o={})=>{let r,i=t;const a=null!=m?m:y?Ce(ve(y,ye(g)),Oe(e.transformers)):[];if(a.length>0&&e.transformers&&Object.keys(e.transformers).length>0){const t=await _e(e,e.transformers,a,i,g,f,`source.${n}.before`);if(null===t.event)return{ok:!0};t.respond&&(f=t.respond),i=Array.isArray(t.event)?t.event[0]:t.event}if(d){const t=je(d,e);if(t){const e=ye(g),o=he(d,t,e,`s:${n}`);if(o){if("HIT"===o.status&&void 0!==o.value&&d.full){let n=o.value;return o.rule.update&&(n=await we(n,o.rule.update,{...e,cache:{status:"HIT"}})),null==f||f(n),{ok:!0}}if("MISS"===o.status&&d.full&&f){const n=f,s=o.rule.update,i={...e,cache:{status:"MISS"}},a=o.key,c=o.rule.ttl;f=e=>{be(t,a,e,c),s?r=(async()=>{const t=await we(e,s,i);n(t)})():n(e)}}"MISS"!==o.status||d.full||be(t,o.key,!0,o.rule.ttl)}}}const c=null!=v?v:p?Ce(ve(p,ye(g)),Oe(e.transformers)):[],l=await e.push(i,{...o,id:n,ingest:g,respond:f,mapping:s,preChain:c});return r&&await r,l},command:e.command,sources:e.sources,elb:e.sources.elb.push,logger:h,...i},w={collector:e,logger:h,id:n,config:s,env:b,setIngest:async t=>{if(!s.ingest)return void(g=R(n));const o=await ce(t,s.ingest,{collector:e}),r=R(n);g={...r,...o,_meta:r._meta}},setRespond:e=>{f=e}},k=await ae(r)(w);if(!k)return;const j=k.type||"unknown",O=e.logger.scope(j).scope(n);return b.logger=O,a&&(k.config={...k.config,primary:a}),k}function De(e,n,t,o,r){if(!n.on)return;const s=n.type||"unknown",i=e.logger.scope(s).scope("on").scope(o),a={collector:e,logger:i,id:t,config:n.config,data:r,env:Le(n.env,n.config.env)};ie(n.on)(o,a)}function Me(e,n,t,o){let r;switch(n){case ke.Consent:r=o||e.consent;break;case ke.Session:r=e.session;break;case ke.User:r=o||e.user;break;case ke.Custom:r=o||e.custom;break;case ke.Globals:r=o||e.globals;break;case ke.Config:r=o||e.config;break;case ke.Ready:case ke.Run:default:r=void 0}if(t.length)switch(n){case ke.Consent:!function(e,n,t){const o=t||e.consent;n.forEach(n=>{Object.keys(o).filter(e=>e in n).forEach(t=>{ie(n[t])(e,o)})})}(e,t,o);break;case ke.Ready:case ke.Run:i=t,(s=e).allowed&&i.forEach(e=>{ie(e)(s)});break;case ke.Session:!function(e,n){e.session&&n.forEach(n=>{ie(n)(e,e.session)})}(e,t);break;default:t.forEach(n=>{"function"==typeof n&&ie(n)(e,r)})}var s,i}function qe(e,n,t,o){if(!e)return[];if(n){const e=ve(n,ye(o));return e?Ce(e,Oe(t)):[]}return Ce(e,Oe(t))}async function Ie(e,n,t){const{code:o,config:r={},env:s={},before:i,next:a,cache:c}=n;if(!H(o.push))return Ue({ok:!1,failed:{invalid:{type:"invalid",error:"Destination code must have a push method"}}});const l=t||r||{init:!1};let u=i?{...l,before:i}:{...l};a&&(u={...u,next:a}),c&&(u={...u,cache:c});const f={...o,config:u,env:Le(o.env,s)};let g=f.config.id;if(!g)do{g=Y(5,"abcdefghijklmnopqrstuvwxyz")}while(e.destinations[g]);return e.destinations[g]=f,!1!==f.config.queue&&(f.queuePush=[...e.queue]),$e(e,void 0,{},{[g]:f})}async function $e(e,n,t={},o){const{allowed:r,consent:s,globals:i,user:a}=e;if(!r)return Ue({ok:!1});n&&(e.queue.push(n),e.status.in++),o||(o=e.destinations);const c=await Promise.all(Object.entries(o||{}).map(async([o,r])=>{var c,l,u;if(r.config.disabled)return{id:o,destination:r,skipped:!0};let f=(r.queuePush||[]).map(e=>({...e,consent:s}));r.queuePush=[],n&&f.push(K(n));const g=t.ingest?{...t.ingest,_meta:{...t.ingest._meta,path:[...t.ingest._meta.path]}}:R("unknown");if(!f.length&&!(null==(c=r.queueOn)?void 0:c.length))return{id:o,destination:r,skipped:!0};if(!f.length&&(null==(l=r.queueOn)?void 0:l.length)){const n=await ae(Ne)(e,r,o);return{id:o,destination:r,skipped:!n}}const d=[],p=f.filter(e=>{const n=J(r.config.consent,s,e.consent);return!n||(e.consent=n,d.push(e),!1)});if(r.queuePush.push(...p),!d.length)return{id:o,destination:r,queue:f};if(!await ae(Ne)(e,r,o))return{id:o,destination:r,queue:f};let v,y;r.dlq||(r.dlq=[]);const m=r.config.before,h=qe(m,m&&de(m)?pe(m):void 0,e.transformers,g),b=r.config.next,w=b&&de(b)?pe(b):void 0,k=null==(u=r.config)?void 0:u.cache,j=k?me(k):void 0,O=j?je(j,e):void 0;let A=0;return await Promise.all(d.map(async n=>{let s;if(n.globals=T(i,n.globals),n.user=T(a,n.user),(null==j?void 0:j.full)&&O){const e=ye(g,n),t=he(j,O,e,`d:${o}`);if("HIT"===(null==t?void 0:t.status))return n;"MISS"===(null==t?void 0:t.status)&&(s={key:t.key,ttl:t.rule.ttl})}let c=n,l=t.respond;if(h.length>0&&e.transformers&&Object.keys(e.transformers).length>0){const r=await _e(e,e.transformers,h,n,g,t.respond,`destination.${o}.before`);if(null===r.event)return n;r.respond&&(l=r.respond),c=Array.isArray(r.event)?r.event[0]:r.event}if(j&&!j.full&&O){const e=ye(g,c),t=he(j,O,e,`d:${o}`);if("HIT"===(null==t?void 0:t.status))return n;"MISS"===(null==t?void 0:t.status)&&(s={key:t.key,ttl:t.rule.ttl})}const u=Date.now();let f=!1;const d=await ae(Re,n=>{const t=r.type||"unknown";e.logger.scope(t).error("Push failed",{error:n,event:c.name}),v=n,f=!0,r.dlq.push([c,n])})(e,r,o,c,g,l);if(A+=Date.now()-u,s&&O&&void 0===r.config.mock&&be(O,s.key,null==d||d,s.ttl),void 0!==d&&(y=d),!f&&b){void 0!==d&&(g._response=d);const n=qe(b,w,e.transformers,g);if(n.length>0&&e.transformers&&Object.keys(e.transformers).length>0){const t=await _e(e,e.transformers,n,c,g,l,`destination.${o}.next`);t.respond&&(l=t.respond)}}return n})),{id:o,destination:r,error:v,response:y,totalDuration:A}})),l={},u={},f={};for(const n of c){if(n.skipped)continue;const t={type:n.destination.type||"unknown",data:n.response};e.status.destinations[n.id]||(e.status.destinations[n.id]={count:0,failed:0,duration:0});const o=e.status.destinations[n.id],r=Date.now();n.error?(t.error=n.error,f[n.id]=t,o.failed++,o.lastAt=r,o.duration+=n.totalDuration||0,e.status.failed++):n.queue&&n.queue.length?u[n.id]=t:(l[n.id]=t,o.count++,o.lastAt=r,o.duration+=n.totalDuration||0,e.status.out++)}return Ue({event:n,...Object.keys(l).length&&{done:l},...Object.keys(u).length&&{queued:u},...Object.keys(f).length&&{failed:f}})}async function Ne(e,n,t){var o;if(n.init&&!n.config.init){const r=n.type||"unknown",s=e.logger.scope(r),i={collector:e,logger:s,id:t,config:n.config,env:Le(n.env,n.config.env)};s.debug("init");const a=await fe(n.init,"DestinationInit",e.hooks,e.logger)(i);if(!1===a)return a;if(n.config={...a||n.config,init:!0},null==(o=n.queueOn)?void 0:o.length){const o=n.queueOn;n.queueOn=[];for(const{type:r,data:s}of o)De(e,n,t,r,s)}s.debug("init done")}return!0}async function Re(e,n,t,o,r,s){const{config:i}=n,a=await ue(o,i,e);if(a.ignore)return!1;const c=n.type||"unknown",l=e.logger.scope(c),u={collector:e,logger:l,id:t,config:i,data:a.data,rule:a.mapping,ingest:r,env:{...Le(n.env,i.env),...s?{respond:s}:{}}};if(void 0!==i.mock)return l.debug("mock",{event:a.event.name}),i.mock;const f=a.mapping,g=a.mappingKey||"* *";if(!(null==f?void 0:f.batch)||!n.pushBatch||void 0!==i.mock){l.debug("push",{event:a.event.name});const t=await fe(n.push,"DestinationPush",e.hooks,e.logger)(a.event,u);return l.debug("push done"),t}{if(n.batches=n.batches||{},!n.batches[g]){const o={key:g,events:[],data:[]};n.batches[g]={batched:o,batchFn:Q(()=>{const o=n.batches[g].batched,a={collector:e,logger:l,id:t,config:i,data:void 0,rule:f,ingest:r,env:{...Le(n.env,i.env),...s?{respond:s}:{}}};l.debug("push batch",{events:o.events.length}),fe(n.pushBatch,"DestinationPushBatch",e.hooks,e.logger)(o,a),l.debug("push batch done"),o.events=[],o.data=[]},f.batch)}}const o=n.batches[g];o.batched.events.push(a.event),G(a.data)&&o.batched.data.push(a.data),o.batchFn()}return!0}function Ue(e){return{ok:!(null==e?void 0:e.failed),...e}}function Te(e){const{code:n,config:t={},env:o={},cache:r}=e,{config:s}=Ae(e,"before"),{config:i}=Ae({...e,config:s},"next"),a={...n.config,...t,...i};r&&(a.cache=r);const c=Le(n.env,o);return{...n,config:a,env:c}}function Le(e,n){return e||n?n?e&&V(e)&&V(n)?{...e,...n}:n:e:{}}async function Ge(e,n,t){const o=Object.entries(e).map(async([e,o])=>{var r;const s=o.destroy;if(!s)return;const i=o.type||"unknown",a=t.scope(i),c={id:e,config:o.config,env:null!=(r=o.env)?r:{},logger:a};try{await Promise.race([s(c),new Promise((t,o)=>setTimeout(()=>o(new Error(`${n} '${e}' destroy timed out`)),5e3))])}catch(t){a.error(`${n} '${e}' destroy failed: ${t}`)}});await Promise.allSettled(o)}async function He(e,n,t,o){let r,s,i=!1;switch(n){case ke.Config:V(t)&&(T(e.config,t,{shallow:!1}),s=t,i=!0);break;case ke.Consent:if(V(t)){const{update:n}=function(e,n){const t={};return Object.entries(n).forEach(([e,n])=>{t[e]=!!n}),e.consent=T(e.consent,t),{update:t}}(e,t);s=n,i=!0}break;case ke.Custom:V(t)&&(e.custom=T(e.custom,t),s=t,i=!0);break;case ke.Destination:V(t)&&("code"in t&&V(t.code)?r=await Ie(e,t,o):H(t.push)&&(r=await Ie(e,{code:t},o)));break;case ke.Globals:V(t)&&(e.globals=T(e.globals,t),s=t,i=!0);break;case ke.On:B(t)&&await async function(e,n,t){const o=e.on,r=o[n]||[],s=L(t)?t:[t];s.forEach(e=>{r.push(e)}),o[n]=r,Me(e,n,s)}(e,t,o);break;case ke.Ready:i=!0;break;case ke.Run:r=await async function(e,n){return e.allowed=!0,e.timing=Date.now(),n&&(n.consent&&(e.consent=T(e.consent,n.consent)),n.user&&(e.user=T(e.user,n.user)),n.globals&&(e.globals=T(e.config.globalsStatic||{},n.globals)),n.custom&&(e.custom=T(e.custom,n.custom))),Object.values(e.destinations).forEach(e=>{e.queuePush=[]}),e.queue=[],e.round++,await $e(e)}(e,t),i=!0;break;case ke.Session:i=!0;break;case ke.Shutdown:await async function(e){const n=e.logger;await Ge(e.sources,"source",n),await Ge(e.destinations,"destination",n),await Ge(e.transformers,"transformer",n),await Ge(e.stores,"store",n)}(e);break;case ke.User:V(t)&&(T(e.user,t,{shallow:!1}),s=t,i=!0)}return i&&(await async function(e,n,t,o){let r,s=t||[];switch(t||(s=e.on[n]||[]),n){case ke.Consent:r=o||e.consent;break;case ke.Session:r=e.session;break;case ke.User:r=o||e.user;break;case ke.Custom:r=o||e.custom;break;case ke.Globals:r=o||e.globals;break;case ke.Config:r=o||e.config;break;case ke.Ready:case ke.Run:default:r=void 0}let i=!1;for(const t of Object.values(e.sources))t.on&&!1===await ae(t.on)(n,r)&&(i=!0);return Object.entries(e.destinations).forEach(([t,o])=>{if(o.on){if(!o.config.init)return o.queueOn=o.queueOn||[],void o.queueOn.push({type:n,data:r});De(e,o,t,n,r)}}),(Object.keys(e.pending.sources).length>0||Object.keys(e.pending.destinations).length>0)&&await async function(e,n){var t,o;for(const[o,r]of Object.entries(e.pending.sources)){if(!e.pending.sources[o]||e.sources[o])continue;const s=null==(t=r.config)?void 0:t.require;if(!s)continue;const i=s.indexOf(n);if(-1===i)continue;if(s.splice(i,1),s.length>0)continue;delete e.pending.sources[o];const a=await Pe(e,o,r);a&&(e.sources[o]=a)}for(const[t,r]of Object.entries(e.pending.destinations)){if(!e.pending.destinations[t]||e.destinations[t])continue;const s=null==(o=r.config)?void 0:o.require;if(!s)continue;const i=s.indexOf(n);if(-1===i)continue;if(s.splice(i,1),s.length>0)continue;delete e.pending.destinations[t];const a=Te(r);!1!==a.config.queue&&(a.queuePush=[...e.queue]),e.destinations[t]=a}}(e,n),Me(e,n,s,o),!i}(e,n,void 0,s),r=await $e(e)),r||Ue({ok:!0})}function Ve(e,n){if(!n.name)throw new Error("Event name is required");const[t,o]=n.name.split(" ");if(!t||!o)throw new Error("Event name is invalid");const{timestamp:r=Date.now(),name:s=`${t} ${o}`,data:i={},context:a={},globals:c=e.globals,custom:l={},user:u=e.user,nested:f=[],consent:g=e.consent,id:d=X(),trigger:p="",entity:v=t,action:y=o,timing:m=0,source:h={type:"collector",schema:"4"}}=n;return{name:s,data:i,context:a,globals:c,custom:l,user:u,nested:f,consent:g,id:d,trigger:p,entity:v,action:y,timestamp:r,timing:m,source:h}}async function Be(e){var n,t;const o=T({globalsStatic:{},sessionStatic:{},run:!0},e,{merge:!1,extend:!1}),r=te({level:null==(n=e.logger)?void 0:n.level,handler:null==(t=e.logger)?void 0:t.handler}),s={...o.globalsStatic,...e.globals},i={allowed:!1,config:o,consent:e.consent||{},custom:e.custom||{},destinations:{},transformers:{},stores:{},globals:s,hooks:e.hooks||{},logger:r,on:{},queue:[],round:0,session:void 0,status:{startedAt:Date.now(),in:0,out:0,failed:0,sources:{},destinations:{}},timing:Date.now(),user:e.user||{},sources:{},pending:{sources:{},destinations:{}},push:void 0,command:void 0};var a,c;i.push=function(e,n){return fe(async(t,o={})=>await ae(async()=>{var r;const s=Date.now(),{id:i,ingest:a,respond:c,mapping:l,preChain:u,include:f,exclude:g}=o;let d=c,p=t;const v=f||g?function(e,n,t){let o=e;return n&&(o=Object.fromEntries(Object.entries(o).filter(([e])=>n.includes(e)))),t&&(o=Object.fromEntries(Object.entries(o).filter(([e])=>!t.includes(e)))),o}(e.destinations,f,g):void 0,y=null!=a?a:R(i||"unknown");if(l){const n=await ue(p,l,e);if(n.ignore)return Ue({ok:!0});if(l.consent&&!J(l.consent,e.consent,n.event.consent))return Ue({ok:!0});p=n.event}if((null==u?void 0:u.length)&&e.transformers&&Object.keys(e.transformers).length>0){const t=await _e(e,e.transformers,u,p,y,d,i?`source.${i}.next`:void 0);if(null===t.event)return Ue({ok:!0});if(t.respond&&(d=t.respond),Array.isArray(t.event)){const o=await Promise.all(t.event.map(async t=>{const o=n(t),r=Ve(e,o);return $e(e,r,{id:i,ingest:y,respond:d},v)}));if(i){e.status.sources[i]||(e.status.sources[i]={count:0,duration:0});const n=e.status.sources[i];n.count+=t.event.length,n.lastAt=Date.now(),n.duration+=Date.now()-s}return null!=(r=o[0])?r:Ue({ok:!0})}p=t.event}const m=n(p),h=Ve(e,m),b=await $e(e,h,{id:i,ingest:y,respond:d},v);if(i){e.status.sources[i]||(e.status.sources[i]={count:0,duration:0});const n=e.status.sources[i];n.count++,n.lastAt=Date.now(),n.duration+=Date.now()-s}return b},()=>Ue({ok:!1}))(),"Push",e.hooks,e.logger)}(i,e=>({timing:Math.round((Date.now()-i.timing)/10)/100,source:{type:"collector",schema:"4",version:"4.0.0-next-1777463920154"},...e})),i.command=(c=He,fe(async(e,n,t)=>await ae(async()=>await c(a,e,n,t),()=>Ue({ok:!1}))(),"Command",(a=i).hooks,a.logger));const l=e.stores||{};if(i.stores=await async function(e,n={}){const t={};for(const[o,r]of Object.entries(n)){const{code:n,config:s={},env:i={}}=r,a=e.logger.scope("store").scope(o),c={collector:e,logger:a,id:o,config:s,env:i},l=await n(c),u=l.get,f=l.set,g=l.delete;l.get=fe(u,"StoreGet",e.hooks,e.logger),l.set=fe(f,"StoreSet",e.hooks,e.logger),l.delete=fe(g,"StoreDelete",e.hooks,e.logger),t[o]=l}return t}(i,l),function(e,n,t){const o=new Map;for(const[t,r]of Object.entries(e))n[t]&&o.set(r,n[t]);if(0!==o.size)for(const e of[t.transformers,t.destinations,t.sources])if(e)for(const n of Object.values(e))r(n.env);function r(e){if(e)for(const[n,t]of Object.entries(e))if("object"==typeof t&&null!==t){const r=o.get(t);r&&(e[n]=r)}}}(l,i.stores,e),!i.stores.__cache){const e=new Map;i.stores.__cache={type:"memory",config:{},get:n=>{const t=e.get(n);if(t){if(!(t.expires&&Date.now()>t.expires))return t.value;e.delete(n)}},set:(n,t,o)=>{e.set(n,{value:t,expires:o?Date.now()+o:void 0})},delete:n=>{e.delete(n)}}}return i.destinations=await async function(e,n={}){var t,o;const r={};for(const[s,i]of Object.entries(n))(null==(o=null==(t=i.config)?void 0:t.require)?void 0:o.length)?e.pending.destinations[s]=i:r[s]=Te(i);return r}(i,e.destinations||{}),i.transformers=await async function(e,n={}){const t={};for(const[o,r]of Object.entries(n)){const{code:n,env:s={}}=r,{config:i}=Ae(r,"before"),{config:a}=Ae({...r,config:i},"next"),c=Object.keys(s).length>0?{...a,env:s}:a,{cache:l}=r,u=l?{...c,cache:l}:c,f=e.logger.scope("transformer").scope(o),g={collector:e,logger:f,id:o,ingest:R(o),config:u,env:s},d=await n(g);t[o]=d}return t}(i,e.transformers||{}),i}async function Ke(e){e=e||{};const n=await Be(e),t=(o=n,{type:"elb",config:{},push:async(e,n,t,r,s,i)=>{if("string"==typeof e&&e.startsWith("walker ")){const r=e.replace("walker ","");return o.command(r,n,t)}let a;if("string"==typeof e)a={name:e},n&&"object"==typeof n&&!Array.isArray(n)&&(a.data=n);else{if(!e||"object"!=typeof e)return Ue({ok:!1});a=e,n&&"object"==typeof n&&!Array.isArray(n)&&(a.data={...a.data||{},...n})}return r&&"object"==typeof r&&(a.context=r),s&&Array.isArray(s)&&(a.nested=s),i&&"object"==typeof i&&(a.custom=i),o.push(a)}});var o;n.sources.elb=t;const r=await async function(e,n={}){const t={};for(const[o,r]of Object.entries(n)){const{config:n={}}=r;if(n.require&&n.require.length>0){e.pending.sources[o]=r;continue}const s=await Pe(e,o,r);s&&(t[o]=s)}return t}(n,e.sources||{});Object.assign(n.sources,r);const{consent:s,user:i,globals:a,custom:c}=e;s&&await n.command("consent",s),i&&await n.command("user",i),a&&Object.assign(n.globals,a),c&&Object.assign(n.custom,c),n.config.run&&await n.command("run");let l=t.push;const u=Object.values(n.sources).filter(e=>"elb"!==e.type),f=u.find(e=>e.config.primary);return f?l=f.push:u.length>0&&(l=u[0].push),{collector:n,elb:l}}var We,Fe=async e=>{let n;return{get flow(){return n},trigger:(t,o)=>async t=>{var r;if(!n){const t=await Ke({...e,run:null==(r=e.run)||r});n={collector:t.collector,elb:t.elb}}const s=(null==o?void 0:o.eventName)||"ucEvent";window.dispatchEvent(new CustomEvent(s,{detail:t}))}}},ze=(e,n)=>{if(e&&"object"==typeof e)return()=>{n.window.dispatchEvent(new CustomEvent("ucEvent",{detail:e}))}},Je=async e=>{var n,t,o,r,s,i,a,c,l,f,d,p;const{config:v,env:y}=e,{elb:m,logger:h}=y,b=null!=(n=y.window)?n:void 0!==globalThis.window?globalThis.window:void 0,w={eventName:null!=(o=null==(t=null==v?void 0:v.settings)?void 0:t.eventName)?o:"ucEvent",categoryMap:null!=(s=null==(r=null==v?void 0:v.settings)?void 0:r.categoryMap)?s:{},explicitOnly:null==(a=null==(i=null==v?void 0:v.settings)?void 0:i.explicitOnly)||a,apiVersion:null!=(l=null==(c=null==v?void 0:v.settings)?void 0:c.apiVersion)?l:"auto",v3EventName:null!=(d=null==(f=null==v?void 0:v.settings)?void 0:f.v3EventName)?d:"UC_UI_CMP_EVENT"},k={settings:w},j=[];if(b){const e={window:b,elb:m,settings:w,logger:h},n=null!=(p=w.apiVersion)?p:"auto";"v2"===n?j.push(u(e)):"v3"===n||b.__ucCmp?j.push(await g(e)):b.UC_UI?j.push(u(e)):(j.push(u(e)),j.push(await g(e)))}return{type:"usercentrics",config:k,push:m,destroy:async()=>{j.forEach(e=>e())}}},Xe=Je;return We=s,((r,s,i,a)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let c of t(s))o.call(r,c)||c===i||e(r,c,{get:()=>s[c],enumerable:!(a=n(s,c))||a.enumerable});return r})(e({},"__esModule",{value:!0}),We)})();
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { Source, Elb, WalkerOS, Logger, Flow, Trigger } from '@walkeros/core';
|
|
2
2
|
|
|
3
|
+
declare module '@walkeros/core' {
|
|
4
|
+
interface SourceMap {
|
|
5
|
+
usercentrics: {
|
|
6
|
+
type: 'usercentrics';
|
|
7
|
+
platform?: 'web';
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
3
11
|
/**
|
|
4
12
|
* Usercentrics consent event detail structure.
|
|
5
13
|
*
|
|
@@ -26,7 +34,7 @@ declare global {
|
|
|
26
34
|
}
|
|
27
35
|
/**
|
|
28
36
|
* Usercentrics V2 service info shape returned by `UC_UI.getServicesBaseInfo()`.
|
|
29
|
-
* Only the fields we use are typed
|
|
37
|
+
* Only the fields we use are typed - minimal surface, not a full V2 API mirror.
|
|
30
38
|
*/
|
|
31
39
|
interface UsercentricsV2Service {
|
|
32
40
|
/** Category slug: 'essential' | 'functional' | 'marketing' | custom */
|
|
@@ -53,14 +61,14 @@ interface UsercentricsV2Api {
|
|
|
53
61
|
*/
|
|
54
62
|
type UsercentricsV3CategoryState = 'ALL_ACCEPTED' | 'ALL_DENIED' | 'SOME_ACCEPTED' | 'NO_STATE' | string;
|
|
55
63
|
/**
|
|
56
|
-
* Minimal V3 CategoryData
|
|
64
|
+
* Minimal V3 CategoryData - only fields the adapter reads.
|
|
57
65
|
*/
|
|
58
66
|
interface UsercentricsV3CategoryData {
|
|
59
67
|
state: UsercentricsV3CategoryState;
|
|
60
68
|
name: string;
|
|
61
69
|
}
|
|
62
70
|
/**
|
|
63
|
-
* Minimal V3 ConsentData
|
|
71
|
+
* Minimal V3 ConsentData - only the `type` field is used to distinguish
|
|
64
72
|
* explicit vs implicit consent. Other fields (status, version, etc.) exist on
|
|
65
73
|
* the real SDK but are not read by this adapter.
|
|
66
74
|
*/
|
|
@@ -68,7 +76,7 @@ interface UsercentricsV3ConsentData {
|
|
|
68
76
|
type: 'EXPLICIT' | 'IMPLICIT' | string;
|
|
69
77
|
}
|
|
70
78
|
/**
|
|
71
|
-
* Minimal V3 ConsentDetails
|
|
79
|
+
* Minimal V3 ConsentDetails - only the fields the adapter reads.
|
|
72
80
|
* The real SDK also exposes `services`, but the adapter currently operates
|
|
73
81
|
* at category level only.
|
|
74
82
|
*/
|
|
@@ -79,7 +87,7 @@ interface UsercentricsV3ConsentDetails {
|
|
|
79
87
|
/**
|
|
80
88
|
* Usercentrics V3 window API (`window.__ucCmp`).
|
|
81
89
|
*
|
|
82
|
-
* Only the methods this adapter calls are typed
|
|
90
|
+
* Only the methods this adapter calls are typed - the real SDK surface is
|
|
83
91
|
* much wider but we intentionally keep this narrow.
|
|
84
92
|
*/
|
|
85
93
|
interface UsercentricsV3Api {
|
|
@@ -98,13 +106,13 @@ declare global {
|
|
|
98
106
|
interface Window {
|
|
99
107
|
/**
|
|
100
108
|
* Usercentrics V2 CMP API. Attached once the V2 Browser SDK is
|
|
101
|
-
* initialized. Optional because the SDK loads asynchronously
|
|
109
|
+
* initialized. Optional because the SDK loads asynchronously - guard
|
|
102
110
|
* with a truthiness check before access.
|
|
103
111
|
*/
|
|
104
112
|
UC_UI?: UsercentricsV2Api;
|
|
105
113
|
/**
|
|
106
114
|
* Usercentrics V3 CMP API. Attached once the V3 Browser SDK is
|
|
107
|
-
* initialized. Optional because the SDK loads asynchronously
|
|
115
|
+
* initialized. Optional because the SDK loads asynchronously - guard
|
|
108
116
|
* with a truthiness check before access.
|
|
109
117
|
*/
|
|
110
118
|
__ucCmp?: UsercentricsV3Api;
|
|
@@ -156,7 +164,7 @@ interface Settings {
|
|
|
156
164
|
* V3 window event name to listen for consent changes.
|
|
157
165
|
*
|
|
158
166
|
* Usercentrics V3 hardcodes its built-in event names (`UC_UI_CMP_EVENT`,
|
|
159
|
-
* `UC_UI_INITIALIZED`, `UC_UI_VIEW_CHANGED`, `UC_CONSENT`)
|
|
167
|
+
* `UC_UI_INITIALIZED`, `UC_UI_VIEW_CHANGED`, `UC_CONSENT`) - they cannot be
|
|
160
168
|
* renamed. However, the Usercentrics admin dashboard (Implementation >
|
|
161
169
|
* Data Layer & Events) lets admins configure an ADDITIONAL custom window
|
|
162
170
|
* event. Use this setting to point at that custom event name if
|