@everymatrix/player-user-consents 1.31.2 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-28f85617.js → index-e77a2edf.js} +37 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/player-user-consents.cjs.entry.js +112 -27
- package/dist/cjs/player-user-consents.cjs.js +2 -2
- package/dist/collection/components/player-user-consents/player-user-consents.css +12 -2
- package/dist/collection/components/player-user-consents/player-user-consents.js +61 -58
- package/dist/collection/utils/utils.js +83 -3
- package/dist/components/player-user-consents.js +113 -28
- package/dist/esm/{index-6f67dd59.js → index-b34076ff.js} +37 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/player-user-consents.entry.js +112 -27
- package/dist/esm/player-user-consents.js +2 -2
- package/dist/player-user-consents/p-6a20deb9.entry.js +1 -0
- package/dist/player-user-consents/p-b1139724.js +1 -0
- package/dist/player-user-consents/player-user-consents.esm.js +1 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/player-user-consents/.stencil/packages/player-user-consents/stencil.config.d.ts +2 -0
- package/dist/types/components/player-user-consents/player-user-consents.d.ts +13 -10
- package/dist/types/components.d.ts +12 -12
- package/dist/types/utils/utils.d.ts +2 -1
- package/package.json +1 -1
- package/dist/player-user-consents/p-0dbe810e.entry.js +0 -1
- package/dist/player-user-consents/p-cf852ecd.js +0 -1
- package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/player-user-consents/.stencil/packages/player-user-consents/stencil.config.d.ts +0 -2
|
@@ -1,6 +1,90 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
+
const TRANSLATIONS = {
|
|
5
|
+
en: {
|
|
6
|
+
termsandconditions1: "I accept the ",
|
|
7
|
+
termsandconditions2: ", I have read and understood the ",
|
|
8
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
9
|
+
tc: "Terms and Conditions",
|
|
10
|
+
privacy: "Privacy Policy",
|
|
11
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
12
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
13
|
+
},
|
|
14
|
+
ro: {
|
|
15
|
+
termsandconditions1: "I accept the ",
|
|
16
|
+
termsandconditions2: ", I have read and understood the ",
|
|
17
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
18
|
+
tc: "Terms and Conditions",
|
|
19
|
+
privacy: "Privacy Policy",
|
|
20
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
21
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
22
|
+
},
|
|
23
|
+
hr: {
|
|
24
|
+
termsandconditions1: "I accept the ",
|
|
25
|
+
termsandconditions2: ", I have read and understood the ",
|
|
26
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
27
|
+
tc: "Terms and Conditions",
|
|
28
|
+
privacy: "Privacy Policy",
|
|
29
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
30
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
31
|
+
},
|
|
32
|
+
fr: {
|
|
33
|
+
termsandconditions1: "I accept the ",
|
|
34
|
+
termsandconditions2: ", I have read and understood the ",
|
|
35
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
36
|
+
tc: "Terms and Conditions",
|
|
37
|
+
privacy: "Privacy Policy",
|
|
38
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
39
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
40
|
+
},
|
|
41
|
+
cs: {
|
|
42
|
+
termsandconditions1: "I accept the ",
|
|
43
|
+
termsandconditions2: ", I have read and understood the ",
|
|
44
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
45
|
+
tc: "Terms and Conditions",
|
|
46
|
+
privacy: "Privacy Policy",
|
|
47
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
48
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
49
|
+
},
|
|
50
|
+
de: {
|
|
51
|
+
termsandconditions1: "I accept the ",
|
|
52
|
+
termsandconditions2: ", I have read and understood the ",
|
|
53
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
54
|
+
tc: "Terms and Conditions",
|
|
55
|
+
privacy: "Privacy Policy",
|
|
56
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
57
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
const getTranslations = (url) => {
|
|
61
|
+
// fetch url, get the data, replace the TRANSLATIONS content
|
|
62
|
+
return new Promise((resolve) => {
|
|
63
|
+
fetch(url)
|
|
64
|
+
.then((res) => res.json())
|
|
65
|
+
.then((data) => {
|
|
66
|
+
Object.keys(data).forEach((item) => {
|
|
67
|
+
for (let key in data[item]) {
|
|
68
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
resolve(true);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
const translate = (key, customLang, values) => {
|
|
76
|
+
const lang = customLang;
|
|
77
|
+
let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
|
|
78
|
+
if (values !== undefined) {
|
|
79
|
+
for (const [key, value] of Object.entries(values.values)) {
|
|
80
|
+
const regex = new RegExp(`{${key}}`, 'g');
|
|
81
|
+
translation = translation.replace(regex, value);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return translation;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const playerUserConsentsCss = ":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:#f00;font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emfe-w-color-primary);font-weight:bold}";
|
|
4
88
|
|
|
5
89
|
const PlayerUserConsents$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
90
|
constructor() {
|
|
@@ -8,6 +92,10 @@ const PlayerUserConsents$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
|
8
92
|
this.__registerHost();
|
|
9
93
|
this.__attachShadow();
|
|
10
94
|
this.userLegislationConsent = createEvent(this, "userLegislationConsent", 7);
|
|
95
|
+
/**
|
|
96
|
+
* Language
|
|
97
|
+
*/
|
|
98
|
+
this.lang = 'en';
|
|
11
99
|
/**
|
|
12
100
|
* 'true' when parent expects component to emit it's current value
|
|
13
101
|
*/
|
|
@@ -24,44 +112,34 @@ const PlayerUserConsents$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
|
24
112
|
* the title of the consent to be displayed
|
|
25
113
|
*/
|
|
26
114
|
this.consentTitle = '';
|
|
27
|
-
/**
|
|
28
|
-
* link to the t&c page
|
|
29
|
-
*/
|
|
30
|
-
this.tcLink = '#';
|
|
31
|
-
/**
|
|
32
|
-
* link to privacy policy page
|
|
33
|
-
*/
|
|
34
|
-
this.privacyLink = '#';
|
|
35
115
|
/**
|
|
36
116
|
* Client custom styling via inline style
|
|
37
117
|
*/
|
|
38
118
|
this.clientStyling = '';
|
|
119
|
+
/**
|
|
120
|
+
* Translation url
|
|
121
|
+
*/
|
|
122
|
+
this.translationUrl = '';
|
|
39
123
|
/**
|
|
40
124
|
* the text content to be rendered by the component. Determined at runtime
|
|
41
125
|
*/
|
|
42
126
|
this.textContent = '';
|
|
43
127
|
this.limitStylingAppends = false;
|
|
44
|
-
|
|
45
|
-
this.
|
|
46
|
-
termsandconditions1: "I accept the ",
|
|
47
|
-
termsandconditions2: ", I have read and understood the ",
|
|
48
|
-
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
49
|
-
tc: "Terms and Conditions",
|
|
50
|
-
privacy: "Privacy Policy",
|
|
51
|
-
sms: "I consent to receive marketing communication via SMS.",
|
|
52
|
-
emailmarketing: "I consent to receive marketing communication via Email."
|
|
53
|
-
};
|
|
128
|
+
this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
|
|
129
|
+
this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
|
|
54
130
|
this.setClientStyling = () => {
|
|
55
131
|
let sheet = document.createElement('style');
|
|
56
132
|
sheet.innerHTML = this.clientStyling;
|
|
57
133
|
this.stylingContainer.prepend(sheet);
|
|
58
134
|
};
|
|
59
135
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
136
|
+
handleNewTranslations() {
|
|
137
|
+
getTranslations(this.translationUrl);
|
|
138
|
+
}
|
|
139
|
+
async componentWillLoad() {
|
|
140
|
+
if (this.translationUrl.length > 2) {
|
|
141
|
+
await getTranslations(this.translationUrl);
|
|
142
|
+
}
|
|
65
143
|
}
|
|
66
144
|
userLegislationConsentHandler() {
|
|
67
145
|
this.userLegislationConsent.emit({
|
|
@@ -78,22 +156,29 @@ const PlayerUserConsents$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
|
|
|
78
156
|
}
|
|
79
157
|
// end custom styling area
|
|
80
158
|
}
|
|
159
|
+
determineTextContent() {
|
|
160
|
+
return this.consentType === 'termsandconditions' ?
|
|
161
|
+
h("p", null, translate('termsandconditions1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('tc', this.lang)), translate('termsandconditions2', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacy', this.lang)), translate('termsandconditions3', this.lang))
|
|
162
|
+
: h("p", null, translate('consentType', this.lang));
|
|
163
|
+
}
|
|
81
164
|
render() {
|
|
82
165
|
if (this.queried) {
|
|
83
166
|
this.userLegislationConsentHandler();
|
|
84
167
|
}
|
|
85
|
-
this.
|
|
86
|
-
return (h("div", { ref: el => this.stylingContainer = el }, h("p", { class: "ConsentTitle" }, this.consentTitle), h("label", { class: "userConsent", htmlFor: "userConsent" }, h("input", { ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.textContent, this.mandatory && h("span", { class: "MandatoryItem" }, "*"))));
|
|
168
|
+
return (h("div", { ref: el => this.stylingContainer = el }, h("p", { class: "ConsentTitle" }, this.consentTitle), h("label", { class: "UserConsent", htmlFor: "userConsent" }, h("input", { ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.determineTextContent(), this.mandatory && h("span", { class: "MandatoryItem" }, "*"))));
|
|
87
169
|
}
|
|
170
|
+
static get watchers() { return {
|
|
171
|
+
"translationUrl": ["handleNewTranslations"]
|
|
172
|
+
}; }
|
|
88
173
|
static get style() { return playerUserConsentsCss; }
|
|
89
174
|
}, [1, "player-user-consents", {
|
|
175
|
+
"lang": [1537],
|
|
90
176
|
"queried": [516],
|
|
91
177
|
"consentType": [513, "consent-type"],
|
|
92
178
|
"mandatory": [516],
|
|
93
179
|
"consentTitle": [513, "consent-title"],
|
|
94
|
-
"tcLink": [513, "tc-link"],
|
|
95
|
-
"privacyLink": [513, "privacy-link"],
|
|
96
180
|
"clientStyling": [1, "client-styling"],
|
|
181
|
+
"translationUrl": [513, "translation-url"],
|
|
97
182
|
"textContent": [32],
|
|
98
183
|
"limitStylingAppends": [32]
|
|
99
184
|
}]);
|
|
@@ -569,6 +569,11 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
569
569
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
570
570
|
const instance = hostRef.$lazyInstance$ ;
|
|
571
571
|
let promise;
|
|
572
|
+
if (isInitialLoad) {
|
|
573
|
+
{
|
|
574
|
+
promise = safeCall(instance, 'componentWillLoad');
|
|
575
|
+
}
|
|
576
|
+
}
|
|
572
577
|
endSchedule();
|
|
573
578
|
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
574
579
|
};
|
|
@@ -745,6 +750,7 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
|
|
|
745
750
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
746
751
|
// check our new property value against our internal value
|
|
747
752
|
const hostRef = getHostRef(ref);
|
|
753
|
+
const elm = hostRef.$hostElement$ ;
|
|
748
754
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
749
755
|
const flags = hostRef.$flags$;
|
|
750
756
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -757,6 +763,22 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
757
763
|
// set our new value!
|
|
758
764
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
759
765
|
if (instance) {
|
|
766
|
+
// get an array of method names of watch functions to call
|
|
767
|
+
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
768
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
769
|
+
if (watchMethods) {
|
|
770
|
+
// this instance is watching for when this property changed
|
|
771
|
+
watchMethods.map((watchMethodName) => {
|
|
772
|
+
try {
|
|
773
|
+
// fire off each of the watch methods that are watching this property
|
|
774
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
775
|
+
}
|
|
776
|
+
catch (e) {
|
|
777
|
+
consoleError(e, elm);
|
|
778
|
+
}
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
}
|
|
760
782
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
761
783
|
// looks like this value actually changed, so we've got work to do!
|
|
762
784
|
// but only if we've already rendered, otherwise just chill out
|
|
@@ -769,6 +791,9 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
769
791
|
};
|
|
770
792
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
771
793
|
if (cmpMeta.$members$) {
|
|
794
|
+
if (Cstr.watchers) {
|
|
795
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
796
|
+
}
|
|
772
797
|
// It's better to have a const than two Object.entries()
|
|
773
798
|
const members = Object.entries(cmpMeta.$members$);
|
|
774
799
|
const prototype = Cstr.prototype;
|
|
@@ -876,6 +901,12 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
876
901
|
endLoad();
|
|
877
902
|
}
|
|
878
903
|
if (!Cstr.isProxied) {
|
|
904
|
+
// we've never proxied this Constructor before
|
|
905
|
+
// let's add the getters/setters to its prototype before
|
|
906
|
+
// the first time we create an instance of the implementation
|
|
907
|
+
{
|
|
908
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
909
|
+
}
|
|
879
910
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
880
911
|
Cstr.isProxied = true;
|
|
881
912
|
}
|
|
@@ -899,6 +930,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
899
930
|
{
|
|
900
931
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
901
932
|
}
|
|
933
|
+
{
|
|
934
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
935
|
+
}
|
|
902
936
|
endNewInstance();
|
|
903
937
|
}
|
|
904
938
|
if (Cstr.style) {
|
|
@@ -1001,6 +1035,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1001
1035
|
{
|
|
1002
1036
|
cmpMeta.$attrsToReflect$ = [];
|
|
1003
1037
|
}
|
|
1038
|
+
{
|
|
1039
|
+
cmpMeta.$watchers$ = {};
|
|
1040
|
+
}
|
|
1004
1041
|
const tagName = cmpMeta.$tagName$;
|
|
1005
1042
|
const HostElement = class extends HTMLElement {
|
|
1006
1043
|
// StencilLazyHost
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-b34076ff.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["player-user-consents",[[1,"player-user-consents",{"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"
|
|
13
|
+
return bootstrapLazy([["player-user-consents",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1,11 +1,99 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-b34076ff.js';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
+
const TRANSLATIONS = {
|
|
5
|
+
en: {
|
|
6
|
+
termsandconditions1: "I accept the ",
|
|
7
|
+
termsandconditions2: ", I have read and understood the ",
|
|
8
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
9
|
+
tc: "Terms and Conditions",
|
|
10
|
+
privacy: "Privacy Policy",
|
|
11
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
12
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
13
|
+
},
|
|
14
|
+
ro: {
|
|
15
|
+
termsandconditions1: "I accept the ",
|
|
16
|
+
termsandconditions2: ", I have read and understood the ",
|
|
17
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
18
|
+
tc: "Terms and Conditions",
|
|
19
|
+
privacy: "Privacy Policy",
|
|
20
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
21
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
22
|
+
},
|
|
23
|
+
hr: {
|
|
24
|
+
termsandconditions1: "I accept the ",
|
|
25
|
+
termsandconditions2: ", I have read and understood the ",
|
|
26
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
27
|
+
tc: "Terms and Conditions",
|
|
28
|
+
privacy: "Privacy Policy",
|
|
29
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
30
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
31
|
+
},
|
|
32
|
+
fr: {
|
|
33
|
+
termsandconditions1: "I accept the ",
|
|
34
|
+
termsandconditions2: ", I have read and understood the ",
|
|
35
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
36
|
+
tc: "Terms and Conditions",
|
|
37
|
+
privacy: "Privacy Policy",
|
|
38
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
39
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
40
|
+
},
|
|
41
|
+
cs: {
|
|
42
|
+
termsandconditions1: "I accept the ",
|
|
43
|
+
termsandconditions2: ", I have read and understood the ",
|
|
44
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
45
|
+
tc: "Terms and Conditions",
|
|
46
|
+
privacy: "Privacy Policy",
|
|
47
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
48
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
49
|
+
},
|
|
50
|
+
de: {
|
|
51
|
+
termsandconditions1: "I accept the ",
|
|
52
|
+
termsandconditions2: ", I have read and understood the ",
|
|
53
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
54
|
+
tc: "Terms and Conditions",
|
|
55
|
+
privacy: "Privacy Policy",
|
|
56
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
57
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
const getTranslations = (url) => {
|
|
61
|
+
// fetch url, get the data, replace the TRANSLATIONS content
|
|
62
|
+
return new Promise((resolve) => {
|
|
63
|
+
fetch(url)
|
|
64
|
+
.then((res) => res.json())
|
|
65
|
+
.then((data) => {
|
|
66
|
+
Object.keys(data).forEach((item) => {
|
|
67
|
+
for (let key in data[item]) {
|
|
68
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
resolve(true);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
const translate = (key, customLang, values) => {
|
|
76
|
+
const lang = customLang;
|
|
77
|
+
let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
|
|
78
|
+
if (values !== undefined) {
|
|
79
|
+
for (const [key, value] of Object.entries(values.values)) {
|
|
80
|
+
const regex = new RegExp(`{${key}}`, 'g');
|
|
81
|
+
translation = translation.replace(regex, value);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return translation;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const playerUserConsentsCss = ":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:#f00;font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emfe-w-color-primary);font-weight:bold}";
|
|
4
88
|
|
|
5
89
|
const PlayerUserConsents = class {
|
|
6
90
|
constructor(hostRef) {
|
|
7
91
|
registerInstance(this, hostRef);
|
|
8
92
|
this.userLegislationConsent = createEvent(this, "userLegislationConsent", 7);
|
|
93
|
+
/**
|
|
94
|
+
* Language
|
|
95
|
+
*/
|
|
96
|
+
this.lang = 'en';
|
|
9
97
|
/**
|
|
10
98
|
* 'true' when parent expects component to emit it's current value
|
|
11
99
|
*/
|
|
@@ -22,44 +110,34 @@ const PlayerUserConsents = class {
|
|
|
22
110
|
* the title of the consent to be displayed
|
|
23
111
|
*/
|
|
24
112
|
this.consentTitle = '';
|
|
25
|
-
/**
|
|
26
|
-
* link to the t&c page
|
|
27
|
-
*/
|
|
28
|
-
this.tcLink = '#';
|
|
29
|
-
/**
|
|
30
|
-
* link to privacy policy page
|
|
31
|
-
*/
|
|
32
|
-
this.privacyLink = '#';
|
|
33
113
|
/**
|
|
34
114
|
* Client custom styling via inline style
|
|
35
115
|
*/
|
|
36
116
|
this.clientStyling = '';
|
|
117
|
+
/**
|
|
118
|
+
* Translation url
|
|
119
|
+
*/
|
|
120
|
+
this.translationUrl = '';
|
|
37
121
|
/**
|
|
38
122
|
* the text content to be rendered by the component. Determined at runtime
|
|
39
123
|
*/
|
|
40
124
|
this.textContent = '';
|
|
41
125
|
this.limitStylingAppends = false;
|
|
42
|
-
|
|
43
|
-
this.
|
|
44
|
-
termsandconditions1: "I accept the ",
|
|
45
|
-
termsandconditions2: ", I have read and understood the ",
|
|
46
|
-
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
47
|
-
tc: "Terms and Conditions",
|
|
48
|
-
privacy: "Privacy Policy",
|
|
49
|
-
sms: "I consent to receive marketing communication via SMS.",
|
|
50
|
-
emailmarketing: "I consent to receive marketing communication via Email."
|
|
51
|
-
};
|
|
126
|
+
this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
|
|
127
|
+
this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
|
|
52
128
|
this.setClientStyling = () => {
|
|
53
129
|
let sheet = document.createElement('style');
|
|
54
130
|
sheet.innerHTML = this.clientStyling;
|
|
55
131
|
this.stylingContainer.prepend(sheet);
|
|
56
132
|
};
|
|
57
133
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
134
|
+
handleNewTranslations() {
|
|
135
|
+
getTranslations(this.translationUrl);
|
|
136
|
+
}
|
|
137
|
+
async componentWillLoad() {
|
|
138
|
+
if (this.translationUrl.length > 2) {
|
|
139
|
+
await getTranslations(this.translationUrl);
|
|
140
|
+
}
|
|
63
141
|
}
|
|
64
142
|
userLegislationConsentHandler() {
|
|
65
143
|
this.userLegislationConsent.emit({
|
|
@@ -76,13 +154,20 @@ const PlayerUserConsents = class {
|
|
|
76
154
|
}
|
|
77
155
|
// end custom styling area
|
|
78
156
|
}
|
|
157
|
+
determineTextContent() {
|
|
158
|
+
return this.consentType === 'termsandconditions' ?
|
|
159
|
+
h("p", null, translate('termsandconditions1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('tc', this.lang)), translate('termsandconditions2', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacy', this.lang)), translate('termsandconditions3', this.lang))
|
|
160
|
+
: h("p", null, translate('consentType', this.lang));
|
|
161
|
+
}
|
|
79
162
|
render() {
|
|
80
163
|
if (this.queried) {
|
|
81
164
|
this.userLegislationConsentHandler();
|
|
82
165
|
}
|
|
83
|
-
this.
|
|
84
|
-
return (h("div", { ref: el => this.stylingContainer = el }, h("p", { class: "ConsentTitle" }, this.consentTitle), h("label", { class: "userConsent", htmlFor: "userConsent" }, h("input", { ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.textContent, this.mandatory && h("span", { class: "MandatoryItem" }, "*"))));
|
|
166
|
+
return (h("div", { ref: el => this.stylingContainer = el }, h("p", { class: "ConsentTitle" }, this.consentTitle), h("label", { class: "UserConsent", htmlFor: "userConsent" }, h("input", { ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.determineTextContent(), this.mandatory && h("span", { class: "MandatoryItem" }, "*"))));
|
|
85
167
|
}
|
|
168
|
+
static get watchers() { return {
|
|
169
|
+
"translationUrl": ["handleNewTranslations"]
|
|
170
|
+
}; }
|
|
86
171
|
};
|
|
87
172
|
PlayerUserConsents.style = playerUserConsentsCss;
|
|
88
173
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-b34076ff.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["player-user-consents",[[1,"player-user-consents",{"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"
|
|
16
|
+
return bootstrapLazy([["player-user-consents",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
|
|
17
17
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as n,h as i}from"./p-b1139724.js";const e={en:{termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},ro:{termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},hr:{termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},fr:{termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},cs:{termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},de:{termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."}},s=t=>new Promise((n=>{fetch(t).then((t=>t.json())).then((t=>{Object.keys(t).forEach((n=>{for(let i in t[n])e[n][i]=t[n][i]})),n(!0)}))})),o=(t,n,i)=>{let s=e[void 0!==n?n:"en"][t];if(void 0!==i)for(const[t,n]of Object.entries(i.values)){const i=new RegExp(`{${t}}`,"g");s=s.replace(i,n)}return s},a=class{constructor(i){t(this,i),this.userLegislationConsent=n(this,"userLegislationConsent",7),this.lang="en",this.queried=!1,this.consentType="",this.mandatory=!1,this.consentTitle="",this.clientStyling="",this.translationUrl="",this.textContent="",this.limitStylingAppends=!1,this.goToTermsAndConditions=()=>window.postMessage({type:"GoToTermsAndConditions"}),this.goToPrivacyPolicy=()=>window.postMessage({type:"GoToPrivacyPolicy"}),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)}}handleNewTranslations(){s(this.translationUrl)}async componentWillLoad(){this.translationUrl.length>2&&await s(this.translationUrl)}userLegislationConsentHandler(){this.userLegislationConsent.emit({type:this.consentType,value:this.checkboxInput.checked})}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}determineTextContent(){return"termsandconditions"===this.consentType?i("p",null,o("termsandconditions1",this.lang),i("span",{class:"ConsentLink",onClick:this.goToTermsAndConditions},o("tc",this.lang)),o("termsandconditions2",this.lang),i("span",{class:"ConsentLink",onClick:this.goToPrivacyPolicy},o("privacy",this.lang)),o("termsandconditions3",this.lang)):i("p",null,o("consentType",this.lang))}render(){return this.queried&&this.userLegislationConsentHandler(),i("div",{ref:t=>this.stylingContainer=t},i("p",{class:"ConsentTitle"},this.consentTitle),i("label",{class:"UserConsent",htmlFor:"userConsent"},i("input",{ref:t=>this.checkboxInput=t,id:"userConsent",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),this.determineTextContent(),this.mandatory&&i("span",{class:"MandatoryItem"},"*")))}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};a.style=":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:#f00;font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emfe-w-color-primary);font-weight:bold}";export{a as player_user_consents}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),i=new WeakMap,u=e=>"sc-"+e.o,a={},f=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!f(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?d(null,l):l),o=s)};if(c(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const i=d(e,null);return i.u=t,r.length>0&&(i.$=r),i},d=(e,t)=>({t:0,h:e,i:t,m:null,$:null,u:null}),h={},y=(e,t,n,s,r,c)=>{if(n!==s){let i=_(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=p(n),o=p(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("ref"===t)s&&s(e);else if(i||"o"!==t[0]||"n"!==t[1]){const l=f(s);if((i||l&&null!==s)&&!r)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?i=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&c||r)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):_(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},m=/\s/,p=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.m.nodeType&&t.m.host?t.m.host:t.m,o=e&&e.u||a,r=t.u||a;for(l in o)l in r||y(s,l,o[l],void 0,n,t.t);for(l in r)y(s,l,o[l],r[l],n,t.t)},w=(t,n,l)=>{let o,r,c=n.$[l],i=0;if(null!==c.i)o=c.m=s.createTextNode(c.i);else if(o=c.m=s.createElement(c.h),b(null,c,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),c.$)for(i=0;i<c.$.length;++i)r=w(t,c,i),r&&o.appendChild(r);return o},S=(e,n,l,s,o,r)=>{let c,i=e;for(i.shadowRoot&&i.tagName===t&&(i=i.shadowRoot);o<=r;++o)s[o]&&(c=w(null,l,o),c&&(s[o].m=c,i.insertBefore(c,n)))},g=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.m,v(l),s.remove())},j=(e,t)=>e.h===t.h,M=(e,t)=>{const n=t.m=e.m,l=e.$,s=t.$,o=t.i;null===o?(b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,r=0,c=t.length-1,i=t[0],u=t[c],a=l.length-1,f=l[0],$=l[a];for(;o<=c&&r<=a;)null==i?i=t[++o]:null==u?u=t[--c]:null==f?f=l[++r]:null==$?$=l[--a]:j(i,f)?(M(i,f),i=t[++o],f=l[++r]):j(u,$)?(M(u,$),u=t[--c],$=l[--a]):j(i,$)?(M(i,$),e.insertBefore(i.m,u.m.nextSibling),i=t[++o],$=l[--a]):j(u,f)?(M(u,f),e.insertBefore(u.m,i.m),u=t[--c],f=l[++r]):(s=w(t&&t[r],n,r),f=l[++r],s&&i.m.parentNode.insertBefore(s,i.m));o>c?S(e,null==l[a+1]?null:l[a+1].m,n,l,r,a):r>a&&g(t,o,c)})(n,l,t,s):null!==s?(null!==e.i&&(n.textContent=""),S(n,null,t,s,0,s.length-1)):null!==l&&g(l,0,l.length-1)):e.i!==o&&(n.data=o)},v=e=>{e.u&&e.u.ref&&e.u.ref(null),e.$&&e.$.map(v)},k=(e,t,n)=>{const l=(e=>F(e).p)(e);return{emit:e=>C(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},C=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},O=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},P=(e,t)=>{if(e.t|=16,!(4&e.t))return O(e,e.g),ee((()=>x(e,t)));e.t|=512},x=(e,t)=>{const n=e.j;let l;return t&&(l=T(n,"componentWillLoad")),W(l,(()=>E(e,n,t)))},E=async(e,t,n)=>{const l=e.p,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.p,l=t.t,o=((e,t)=>{let n=u(t),l=I.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=i.get(e=e.head||e);o||i.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);L(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>N(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},L=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.p,o=n.M,r=n.v||d(null,null),c=(e=>e&&e.h===h)(l)?l:$(null,null,l);t=s.tagName,o.k&&(c.u=c.u||{},o.k.map((([e,t])=>c.u[t]=s[e]))),c.h=null,c.t|=4,n.v=c,c.m=r.m=s.shadowRoot||s,e=s["s-sc"],M(r,c)})(n,l)}catch(e){z(e,n.p)}return null},N=e=>{const t=e.p,n=e.g;T(e.j,"componentDidRender"),64&e.t||(e.t|=64,A(t),e.C(t),n||R()),e.S&&(e.S(),e.S=void 0),512&e.t&&Z((()=>P(e,!1))),e.t&=-517},R=()=>{A(s.documentElement),Z((()=>C(l,"appload",{detail:{namespace:"player-user-consents"}})))},T=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){z(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),A=e=>e.classList.add("hydrated"),U=(e,t,n)=>{if(t.O){e.watchers&&(t.P=e.watchers);const l=Object.entries(t.O),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>F(this).L.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=F(e),o=s.p,r=s.L.get(t),c=s.t,i=s.j;if(n=((e,t)=>null==e||f(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.O[t][0]),(!(8&c)||void 0===r)&&n!==r&&(!Number.isNaN(r)||!Number.isNaN(n))&&(s.L.set(t,n),i)){if(l.P&&128&c){const e=l.P[t];e&&e.map((e=>{try{i[e](n,r,t)}catch(e){z(e,o)}}))}2==(18&c)&&P(s,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.k.push([e,s]),s}))}}return e},q=(e,t={})=>{const n=[],r=t.exclude||[],i=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),$=s.createElement("style"),d=[];let h,y=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],o:t[1],O:t[2],N:t[3]};l.O=t[2],l.k=[],l.P={};const s=l.o,a=class extends HTMLElement{constructor(e){super(e),V(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){h&&(clearTimeout(h),h=null),y?d.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=F(e),n=t.M,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){O(t,t.g=n);break}}n.O&&Object.entries(n.O).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=G(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(n.P=s.watchers,U(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){z(e)}t.t&=-9,t.t|=128,e()}if(s.style){let e=s.style;const t=u(n);if(!I.has(t)){const l=()=>{};((e,t,n)=>{let l=I.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,I.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.g,r=()=>P(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>{}))}componentOnReady(){return F(this).R}};l.T=e[0],r.includes(s)||i.get(s)||(n.push(s),i.define(s,U(a,l,1)))}))})),$.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",$.setAttribute("data-styles",""),a.insertBefore($,f?f.nextSibling:a.firstChild),y=!1,d.length?d.map((e=>e.connectedCallback())):o.jmp((()=>h=setTimeout(R,30)))},D=new WeakMap,F=e=>D.get(e),H=(e,t)=>D.set(t.j=e,t),V=(e,t)=>{const n={t:0,p:e,M:t,L:new Map};return n.R=new Promise((e=>n.C=e)),e["s-p"]=[],e["s-rc"]=[],D.set(e,n)},_=(e,t)=>t in e,z=(e,t)=>(0,console.error)(e,t),B=new Map,G=e=>{const t=e.o.replace(/-/g,"_"),n=e.T,l=B.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(B.set(n,e),e[t])),z)},I=new Map,J=[],K=[],Q=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?Z(Y):o.raf(Y))},X=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){z(e)}e.length=0},Y=()=>{X(J),X(K),(n=J.length>0)&&o.raf(Y)},Z=e=>r().then(e),ee=Q(K,!0);export{q as b,k as c,$ as h,r as p,H as r}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as t,b as n}from"./p-b1139724.js";(()=>{const n=import.meta.url,e={};return""!==n&&(e.resourcesUrl=new URL(".",n).href),t(e)})().then((t=>n([["p-6a20deb9",[[1,"player-user-consents",{lang:[1537],queried:[516],consentType:[513,"consent-type"],mandatory:[516],consentTitle:[513,"consent-title"],clientStyling:[1,"client-styling"],translationUrl:[513,"translation-url"],textContent:[32],limitStylingAppends:[32]}]]]],t)));
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
export declare class PlayerUserConsents {
|
|
3
|
+
/**
|
|
4
|
+
* Language
|
|
5
|
+
*/
|
|
6
|
+
lang: string;
|
|
3
7
|
/**
|
|
4
8
|
* 'true' when parent expects component to emit it's current value
|
|
5
9
|
*/
|
|
@@ -16,18 +20,14 @@ export declare class PlayerUserConsents {
|
|
|
16
20
|
* the title of the consent to be displayed
|
|
17
21
|
*/
|
|
18
22
|
consentTitle: string;
|
|
19
|
-
/**
|
|
20
|
-
* link to the t&c page
|
|
21
|
-
*/
|
|
22
|
-
tcLink: string;
|
|
23
|
-
/**
|
|
24
|
-
* link to privacy policy page
|
|
25
|
-
*/
|
|
26
|
-
privacyLink: string;
|
|
27
23
|
/**
|
|
28
24
|
* Client custom styling via inline style
|
|
29
25
|
*/
|
|
30
26
|
clientStyling: string;
|
|
27
|
+
/**
|
|
28
|
+
* Translation url
|
|
29
|
+
*/
|
|
30
|
+
translationUrl: string;
|
|
31
31
|
/**
|
|
32
32
|
* the text content to be rendered by the component. Determined at runtime
|
|
33
33
|
*/
|
|
@@ -35,11 +35,14 @@ export declare class PlayerUserConsents {
|
|
|
35
35
|
private limitStylingAppends;
|
|
36
36
|
private checkboxInput;
|
|
37
37
|
private stylingContainer;
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
handleNewTranslations(): void;
|
|
39
|
+
componentWillLoad(): Promise<void>;
|
|
40
|
+
goToTermsAndConditions: () => void;
|
|
41
|
+
goToPrivacyPolicy: () => void;
|
|
40
42
|
userLegislationConsent: EventEmitter<object>;
|
|
41
43
|
userLegislationConsentHandler(): void;
|
|
42
44
|
componentDidRender(): void;
|
|
43
45
|
setClientStyling: () => void;
|
|
46
|
+
determineTextContent(): any;
|
|
44
47
|
render(): any;
|
|
45
48
|
}
|
|
@@ -20,21 +20,21 @@ export namespace Components {
|
|
|
20
20
|
*/
|
|
21
21
|
"consentType": string;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Language
|
|
24
24
|
*/
|
|
25
|
-
"
|
|
25
|
+
"lang": string;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* wether or not this consent is mandatory. Used for render details
|
|
28
28
|
*/
|
|
29
|
-
"
|
|
29
|
+
"mandatory": boolean;
|
|
30
30
|
/**
|
|
31
31
|
* 'true' when parent expects component to emit it's current value
|
|
32
32
|
*/
|
|
33
33
|
"queried": boolean;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Translation url
|
|
36
36
|
*/
|
|
37
|
-
"
|
|
37
|
+
"translationUrl": string;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
declare global {
|
|
@@ -62,23 +62,23 @@ declare namespace LocalJSX {
|
|
|
62
62
|
* the type of the consent, used to determine render details
|
|
63
63
|
*/
|
|
64
64
|
"consentType"?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Language
|
|
67
|
+
*/
|
|
68
|
+
"lang"?: string;
|
|
65
69
|
/**
|
|
66
70
|
* wether or not this consent is mandatory. Used for render details
|
|
67
71
|
*/
|
|
68
72
|
"mandatory"?: boolean;
|
|
69
73
|
"onUserLegislationConsent"?: (event: CustomEvent<object>) => void;
|
|
70
|
-
/**
|
|
71
|
-
* link to privacy policy page
|
|
72
|
-
*/
|
|
73
|
-
"privacyLink"?: string;
|
|
74
74
|
/**
|
|
75
75
|
* 'true' when parent expects component to emit it's current value
|
|
76
76
|
*/
|
|
77
77
|
"queried"?: boolean;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* Translation url
|
|
80
80
|
*/
|
|
81
|
-
"
|
|
81
|
+
"translationUrl"?: string;
|
|
82
82
|
}
|
|
83
83
|
interface IntrinsicElements {
|
|
84
84
|
"player-user-consents": PlayerUserConsents;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare const getTranslations: (url: string) => Promise<unknown>;
|
|
2
|
+
export declare const translate: (key: string, customLang?: any, values?: any) => string;
|