@naturalcycles/internal-web-lib 1.4.0 → 1.5.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/bundle/conversionClient.js +165 -134
- package/bundle/conversionClient.js.map +1 -1
- package/bundle/cookieMonster.js +98 -96
- package/bundle/cookieMonster.js.map +1 -1
- package/dist/conversion/conversionClient.d.ts +1 -13
- package/dist/conversion/conversionClient.js +3 -10
- package/package.json +1 -1
package/bundle/cookieMonster.js
CHANGED
|
@@ -16,53 +16,64 @@ var i = r(e.replaceAll(":root", ":host")), a = r(n), o = r(t), s = "data:image/s
|
|
|
16
16
|
return e.DropdownOpen = "DropdownOpen", e;
|
|
17
17
|
}({}), f = /* @__PURE__ */ function(e) {
|
|
18
18
|
return e.explicit = "explicit", e.gpc = "gpc", e;
|
|
19
|
-
}({}), p = Object.keys
|
|
19
|
+
}({}), p = Object.keys;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.0_undici@8.11.2/node_modules/@naturalcycles/js-lib/dist/env.js
|
|
22
|
+
function m() {
|
|
23
|
+
return !h();
|
|
24
|
+
}
|
|
25
|
+
function h() {
|
|
26
|
+
return typeof window < "u" && !!window?.document;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region ../shared/dist/lang/langService.js
|
|
30
|
+
var g;
|
|
20
31
|
(function(e) {
|
|
21
32
|
e.en_US = "en-US", e.en_GB = "en-GB", e.es_US = "es-US", e.pt_BR = "pt-BR", e.sv_SE = "sv-SE", e.en_CA = "en-CA", e.de_DE = "de-DE", e.fr_FR = "fr-FR", e.it_IT = "it-IT", e.is_IS = "is-IS", e.da_DK = "da-DK", e.nl_NL = "nl-NL", e.no_NO = "no-NO", e.fi_FI = "fi-FI", e.el_GR = "el-GR", e.hr_HR = "hr-HR", e.ro_RO = "ro-RO", e.cs_CZ = "cs-CZ", e.sk_SK = "sk-SK", e.sl_SI = "sl-SI";
|
|
22
|
-
})(
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
],
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
},
|
|
65
|
-
label:
|
|
33
|
+
})(g ||= {});
|
|
34
|
+
var _ = g.en_US, v = [
|
|
35
|
+
g.en_US,
|
|
36
|
+
g.en_GB,
|
|
37
|
+
g.es_US,
|
|
38
|
+
g.pt_BR,
|
|
39
|
+
g.sv_SE,
|
|
40
|
+
g.de_DE,
|
|
41
|
+
g.fr_FR,
|
|
42
|
+
g.it_IT,
|
|
43
|
+
g.is_IS,
|
|
44
|
+
g.da_DK,
|
|
45
|
+
g.nl_NL,
|
|
46
|
+
g.no_NO,
|
|
47
|
+
g.fi_FI,
|
|
48
|
+
g.el_GR,
|
|
49
|
+
g.hr_HR,
|
|
50
|
+
g.ro_RO,
|
|
51
|
+
g.cs_CZ,
|
|
52
|
+
g.sk_SK,
|
|
53
|
+
g.sl_SI
|
|
54
|
+
], y = v, b = [...v, g.en_CA], x = {
|
|
55
|
+
[g.pt_BR]: "Português",
|
|
56
|
+
[g.en_US]: "English (US)",
|
|
57
|
+
[g.en_GB]: "English (GB)",
|
|
58
|
+
[g.sv_SE]: "Svenska",
|
|
59
|
+
[g.es_US]: "Español",
|
|
60
|
+
[g.en_CA]: "English (CA)",
|
|
61
|
+
[g.de_DE]: "Deutsch",
|
|
62
|
+
[g.fr_FR]: "Français",
|
|
63
|
+
[g.it_IT]: "Italiano",
|
|
64
|
+
[g.is_IS]: "Íslenska",
|
|
65
|
+
[g.da_DK]: "Dansk",
|
|
66
|
+
[g.nl_NL]: "Nederlands",
|
|
67
|
+
[g.no_NO]: "Norsk",
|
|
68
|
+
[g.fi_FI]: "Suomi",
|
|
69
|
+
[g.el_GR]: "Ελληνικά",
|
|
70
|
+
[g.hr_HR]: "Hrvatski",
|
|
71
|
+
[g.ro_RO]: "Română",
|
|
72
|
+
[g.cs_CZ]: "Čeština",
|
|
73
|
+
[g.sk_SK]: "Slovenčina",
|
|
74
|
+
[g.sl_SI]: "Slovenščina"
|
|
75
|
+
}, S = y.map((e) => ({
|
|
76
|
+
label: x[e],
|
|
66
77
|
value: e
|
|
67
78
|
})).concat([
|
|
68
79
|
{
|
|
@@ -93,39 +104,39 @@ var h = m.en_US, g = [
|
|
|
93
104
|
label: "Polski",
|
|
94
105
|
value: "pl-PL"
|
|
95
106
|
}
|
|
96
|
-
]),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
]),
|
|
104
|
-
LANG_DEFAULT =
|
|
105
|
-
SUPPORTED_APP_LANGUAGES =
|
|
106
|
-
SUPPORTED_WEBSIGNUP_LANGUAGES =
|
|
107
|
-
SUPPORTED_HELP_CENTER_LANGUAGES =
|
|
108
|
-
SUPPORTED_WEBSIGNUP_CONSENT_LANGUAGE_OPTIONS =
|
|
107
|
+
]), C = /* @__PURE__ */ new Set([
|
|
108
|
+
g.de_DE,
|
|
109
|
+
g.es_US,
|
|
110
|
+
g.fr_FR,
|
|
111
|
+
g.it_IT,
|
|
112
|
+
g.pt_BR,
|
|
113
|
+
g.sv_SE
|
|
114
|
+
]), w = new class {
|
|
115
|
+
LANG_DEFAULT = _;
|
|
116
|
+
SUPPORTED_APP_LANGUAGES = y;
|
|
117
|
+
SUPPORTED_WEBSIGNUP_LANGUAGES = b;
|
|
118
|
+
SUPPORTED_HELP_CENTER_LANGUAGES = C;
|
|
119
|
+
SUPPORTED_WEBSIGNUP_CONSENT_LANGUAGE_OPTIONS = S;
|
|
109
120
|
normalizeLang(e) {
|
|
110
121
|
if (!e || e.length < 2) return;
|
|
111
122
|
let t = e.slice(0, 2).toLowerCase();
|
|
112
123
|
return e.length < 5 ? t : [t, e.slice(3, 5).toUpperCase()].join("-");
|
|
113
124
|
}
|
|
114
125
|
toSupportedLang(e) {
|
|
115
|
-
return this.toSupportedLangOrUndefined(e) ||
|
|
126
|
+
return this.toSupportedLangOrUndefined(e) || _;
|
|
116
127
|
}
|
|
117
128
|
toSupportedLangOrUndefined(e) {
|
|
118
129
|
if (!e || e.length < 2) return;
|
|
119
130
|
let [t, n] = this.getLangStringParts(e);
|
|
120
|
-
return this.getMatchingLangOrUndefined(t, n,
|
|
131
|
+
return this.getMatchingLangOrUndefined(t, n, y);
|
|
121
132
|
}
|
|
122
133
|
toWebsignupLang(e) {
|
|
123
|
-
return this.toWebsignupLangOrUndefined(e) ||
|
|
134
|
+
return this.toWebsignupLangOrUndefined(e) || _;
|
|
124
135
|
}
|
|
125
136
|
toWebsignupLangOrUndefined(e) {
|
|
126
137
|
if (!e || e.length < 2) return;
|
|
127
138
|
let [t, n] = this.getLangStringParts(e);
|
|
128
|
-
return this.getMatchingLangOrUndefined(t, n,
|
|
139
|
+
return this.getMatchingLangOrUndefined(t, n, b);
|
|
129
140
|
}
|
|
130
141
|
toNCWebLangOrUndefined(e) {
|
|
131
142
|
return this.toWebsignupLangOrUndefined(e);
|
|
@@ -137,16 +148,7 @@ var h = m.en_US, g = [
|
|
|
137
148
|
let r = [e, t].join("-");
|
|
138
149
|
return n.includes(r) ? r : n.find((t) => t.startsWith(e));
|
|
139
150
|
}
|
|
140
|
-
}()
|
|
141
|
-
//#endregion
|
|
142
|
-
//#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.0_undici@8.11.2/node_modules/@naturalcycles/js-lib/dist/env.js
|
|
143
|
-
function C() {
|
|
144
|
-
return !w();
|
|
145
|
-
}
|
|
146
|
-
function w() {
|
|
147
|
-
return typeof window < "u" && !!window?.document;
|
|
148
|
-
}
|
|
149
|
-
var T = new class {
|
|
151
|
+
}(), T = new class {
|
|
150
152
|
getAllCookies() {
|
|
151
153
|
let e = {}, t = document.cookie.split("; ");
|
|
152
154
|
for (let n of t) {
|
|
@@ -377,25 +379,25 @@ var T = new class {
|
|
|
377
379
|
"heading-manage-cookie-settings": "Hantera cookie-inställningar:",
|
|
378
380
|
"text-cookies-usage": "Vi använder cookies för att analysera trafik och anpassa innehåll och annonser, men det är du som bestämmer och du kan hantera inställningarna nedan eller när som helst i vår {{ cookiePolicyLink }}."
|
|
379
381
|
}, O = {
|
|
380
|
-
[
|
|
381
|
-
[
|
|
382
|
-
[
|
|
383
|
-
[
|
|
384
|
-
[
|
|
385
|
-
[
|
|
386
|
-
[
|
|
387
|
-
[
|
|
388
|
-
[
|
|
389
|
-
[
|
|
390
|
-
[
|
|
382
|
+
[g.en_US]: te,
|
|
383
|
+
[g.en_GB]: ee,
|
|
384
|
+
[g.de_DE]: D,
|
|
385
|
+
[g.fr_FR]: ie,
|
|
386
|
+
[g.es_US]: ne,
|
|
387
|
+
[g.it_IT]: ae,
|
|
388
|
+
[g.pt_BR]: se,
|
|
389
|
+
[g.sv_SE]: ce,
|
|
390
|
+
[g.fi_FI]: re,
|
|
391
|
+
[g.da_DK]: E,
|
|
392
|
+
[g.no_NO]: oe
|
|
391
393
|
};
|
|
392
394
|
p(O);
|
|
393
|
-
var k = /* @__PURE__ */ new Set([
|
|
394
|
-
copy = O[
|
|
395
|
+
var k = /* @__PURE__ */ new Set([g.en_GB, g.en_CA]), A = new class {
|
|
396
|
+
copy = O[w.LANG_DEFAULT];
|
|
395
397
|
setLanguage(e) {
|
|
396
|
-
let t =
|
|
398
|
+
let t = w.toWebsignupLang(e), n = O[t] || O[w.LANG_DEFAULT];
|
|
397
399
|
this.copy = k.has(t) ? {
|
|
398
|
-
...O[
|
|
400
|
+
...O[w.LANG_DEFAULT],
|
|
399
401
|
...n
|
|
400
402
|
} : n;
|
|
401
403
|
}
|
|
@@ -698,7 +700,7 @@ var le = r(H), ue = class extends HTMLElement {
|
|
|
698
700
|
isScrollLocked = !1;
|
|
699
701
|
scrollY = 0;
|
|
700
702
|
static open(t) {
|
|
701
|
-
if (
|
|
703
|
+
if (m()) return;
|
|
702
704
|
if (document.readyState === "loading") {
|
|
703
705
|
document.addEventListener("DOMContentLoaded", () => e.open(t), { once: !0 });
|
|
704
706
|
return;
|
|
@@ -707,21 +709,21 @@ var le = r(H), ue = class extends HTMLElement {
|
|
|
707
709
|
t?.view === c.settings ? n.showSettings() : t?.view === c.banner && n.showBanner(), n.setAttribute("display", "true");
|
|
708
710
|
}
|
|
709
711
|
static close() {
|
|
710
|
-
|
|
712
|
+
m() || document.querySelector("cookie-monster")?.setAttribute("display", "false");
|
|
711
713
|
}
|
|
712
714
|
static getOrCreate(e) {
|
|
713
715
|
let t = document.querySelector("cookie-monster");
|
|
714
716
|
return t ||= document.createElement("cookie-monster"), e && t.setAttribute("language", e), t.isConnected || document.body.append(t), t;
|
|
715
717
|
}
|
|
716
718
|
constructor() {
|
|
717
|
-
super(), j(this.getAttribute("language") ||
|
|
719
|
+
super(), j(this.getAttribute("language") || w.LANG_DEFAULT), this.root = this.attachShadow({ mode: "open" }), this.root.adoptedStyleSheets = [
|
|
718
720
|
i,
|
|
719
721
|
a,
|
|
720
722
|
de
|
|
721
723
|
], this.container = document.createElement("div"), this.container.id = "CookieMonster", this.container.setAttribute("uid", "cookiemonster"), this.root.append(this.container), this.mainView = document.createElement("main-view"), this.container.append(this.mainView);
|
|
722
724
|
}
|
|
723
725
|
connectedCallback() {
|
|
724
|
-
j(this.getAttribute("language") ||
|
|
726
|
+
j(this.getAttribute("language") || w.LANG_DEFAULT), this.replaceMainView(), this.dispatchEvent(z(l.cookieMonsterOnMount)), this.attributeChangedCallback("display", null, this.getAttribute("display")), this.addEventListener(l.cookieMonsterOnClose, this.handleFinalDecision);
|
|
725
727
|
}
|
|
726
728
|
static get observedAttributes() {
|
|
727
729
|
return ["display", "language"];
|
|
@@ -733,7 +735,7 @@ var le = r(H), ue = class extends HTMLElement {
|
|
|
733
735
|
}
|
|
734
736
|
if (e === "language") {
|
|
735
737
|
if (t === n) return;
|
|
736
|
-
j(n ||
|
|
738
|
+
j(n || w.LANG_DEFAULT), this.replaceMainView();
|
|
737
739
|
}
|
|
738
740
|
}
|
|
739
741
|
disconnectedCallback() {
|
|
@@ -795,16 +797,16 @@ var le = r(H), ue = class extends HTMLElement {
|
|
|
795
797
|
this.versionProvider = e;
|
|
796
798
|
}
|
|
797
799
|
initConsent(e) {
|
|
798
|
-
|
|
800
|
+
m() || this.initialized || (this.initialized = !0, this.domain = e?.domain, this.isGpcActive() && this.persistConsent({ ...L }, e?.domain, void 0), globalThis.addEventListener(l.cookieMonsterOnClose, this.handleClose), X.readConsentCookie() || K.open({ language: e?.language }));
|
|
799
801
|
}
|
|
800
802
|
teardownConsent() {
|
|
801
|
-
|
|
803
|
+
m() || (globalThis.removeEventListener(l.cookieMonsterOnClose, this.handleClose), this.initialized = !1, this.domain = void 0);
|
|
802
804
|
}
|
|
803
805
|
getConsent() {
|
|
804
|
-
if (!
|
|
806
|
+
if (!m()) return X.readConsentCookie();
|
|
805
807
|
}
|
|
806
808
|
getConsentLog() {
|
|
807
|
-
if (
|
|
809
|
+
if (m()) return;
|
|
808
810
|
let e = X.getConsentLogEntries();
|
|
809
811
|
return e.length ? e : void 0;
|
|
810
812
|
}
|