rozmova-analytics 1.0.24 → 1.0.25
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/README.md +27 -14
- package/dist/cookieConsentBanner.d.ts +1 -1
- package/dist/helpers.d.ts +1 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.esm.js +22 -23
- package/dist/index.js +22 -23
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,60 +33,72 @@ import {
|
|
|
33
33
|
setUser,
|
|
34
34
|
trackEvent,
|
|
35
35
|
setLocale,
|
|
36
|
-
} from
|
|
36
|
+
} from "rozmova-analytics";
|
|
37
37
|
|
|
38
38
|
// Initialize the library
|
|
39
|
-
init(
|
|
39
|
+
init({ locale: "en", platform: "web", isClearly: true });
|
|
40
40
|
|
|
41
41
|
// Set user
|
|
42
|
-
setUser(
|
|
42
|
+
setUser("user-id-123", { email: "user@example.com", name: "John Doe" });
|
|
43
43
|
|
|
44
44
|
// Track an event
|
|
45
|
-
trackEvent(
|
|
45
|
+
trackEvent("button_click", { button_name: "Sign Up" });
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
Or use in browser:
|
|
49
49
|
|
|
50
50
|
```javascript
|
|
51
|
-
|
|
52
51
|
// Initialize the library
|
|
53
|
-
window.Analytics.init(
|
|
52
|
+
window.Analytics.init({ locale: "en", platform: "web" });
|
|
54
53
|
|
|
55
54
|
// Set user
|
|
56
|
-
window.Analytics.setUser(
|
|
55
|
+
window.Analytics.setUser("user-id-123", {
|
|
56
|
+
email: "user@example.com",
|
|
57
|
+
name: "John Doe",
|
|
58
|
+
});
|
|
57
59
|
|
|
58
60
|
// Track an event
|
|
59
|
-
window.Analytics.trackEvent(
|
|
61
|
+
window.Analytics.trackEvent("button_click", { button_name: "Sign Up" });
|
|
60
62
|
```
|
|
61
63
|
|
|
62
64
|
## API
|
|
63
65
|
|
|
64
|
-
### `init(locale?: string, platform?: string)`
|
|
66
|
+
### `init(initParams:{locale?: string, platform?: string})`
|
|
67
|
+
|
|
65
68
|
Initializes the analytics library, setting up Mixpanel and Google Analytics integrations. Optionally, set a locale and platform.
|
|
66
69
|
|
|
67
70
|
### `generateUserId()`
|
|
71
|
+
|
|
68
72
|
Generates a unique user ID, stores it in cookies and localStorage, and returns the ID.
|
|
69
73
|
|
|
70
74
|
### `getUserId()`
|
|
75
|
+
|
|
71
76
|
Retrieves the user ID from cookies, localStorage, or URL query parameters. If not found, generates a new one.
|
|
72
77
|
|
|
73
78
|
### `getCommonParams()`
|
|
79
|
+
|
|
74
80
|
Returns an object with common analytics parameters such as device, browser, referrer, and UTM parameters.
|
|
75
81
|
|
|
76
82
|
### `setLocale(newLocale: string)`
|
|
83
|
+
|
|
77
84
|
Sets the locale for analytics data.
|
|
78
85
|
|
|
79
86
|
### `setUser(userId: string, userParams: { email: string; name: string })`
|
|
87
|
+
|
|
80
88
|
Associates a user with the provided user ID and sets user properties in Mixpanel and Google Analytics.
|
|
81
89
|
|
|
82
90
|
### `resetUser()`
|
|
91
|
+
|
|
83
92
|
Resets the current user, generating a new user ID and reinitializing the library.
|
|
84
93
|
|
|
85
94
|
### `trackEvent(eventName: string, properties?: EventParams)`
|
|
95
|
+
|
|
86
96
|
Tracks an event with the specified name and optional properties.
|
|
87
97
|
|
|
88
98
|
## Browser Support
|
|
99
|
+
|
|
89
100
|
The package works on modern browsers and supports the following:
|
|
101
|
+
|
|
90
102
|
- Chrome
|
|
91
103
|
- Firefox
|
|
92
104
|
- Safari
|
|
@@ -95,24 +107,25 @@ The package works on modern browsers and supports the following:
|
|
|
95
107
|
## Example Integration
|
|
96
108
|
|
|
97
109
|
```javascript
|
|
98
|
-
import { init, trackEvent, setUser, resetUser } from
|
|
110
|
+
import { init, trackEvent, setUser, resetUser } from "rozmova-analytics";
|
|
99
111
|
|
|
100
112
|
// Initialize analytics
|
|
101
|
-
init(
|
|
113
|
+
init({ locale: "en", platform: "ios", isClearly: true });
|
|
102
114
|
|
|
103
115
|
// Track a page view event
|
|
104
|
-
trackEvent(
|
|
116
|
+
trackEvent("page_view", { page: "Home" });
|
|
105
117
|
|
|
106
118
|
// Set user details
|
|
107
|
-
setUser(
|
|
119
|
+
setUser("user-456", { email: "user456@example.com", name: "Jane Doe" });
|
|
108
120
|
|
|
109
121
|
// Reset the user
|
|
110
122
|
resetUser();
|
|
111
123
|
```
|
|
112
124
|
|
|
113
125
|
## Contributing
|
|
126
|
+
|
|
114
127
|
Contributions are welcome! Please fork the repository and create a pull request with your changes.
|
|
115
128
|
|
|
116
129
|
## License
|
|
117
|
-
This project is licensed under the MIT License.
|
|
118
130
|
|
|
131
|
+
This project is licensed under the MIT License.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const initCookieConsentBanner: (lng: string) => void;
|
|
1
|
+
export declare const initCookieConsentBanner: (lng: string, isClearly: boolean) => void;
|
package/dist/helpers.d.ts
CHANGED
|
@@ -10,5 +10,4 @@ export declare const getReferrer: () => string | null;
|
|
|
10
10
|
export declare function getSearchQueryFromReferrer(): string | null;
|
|
11
11
|
export declare const getGAClientId: () => string;
|
|
12
12
|
export declare function getGASessionId(): string | null;
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const getLocaleFromURL: () => string;
|
|
13
|
+
export declare const getLocaleFromURL: (isClearly?: boolean) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,11 @@ declare class Analytics {
|
|
|
4
4
|
private locale;
|
|
5
5
|
private platform;
|
|
6
6
|
private dataLayer;
|
|
7
|
-
init(locale
|
|
7
|
+
init({ locale, platform, isClearly, }?: {
|
|
8
|
+
locale?: string;
|
|
9
|
+
platform?: string;
|
|
10
|
+
isClearly?: boolean;
|
|
11
|
+
}): void;
|
|
8
12
|
trackEvent(eventName: string, properties?: EventParams): void;
|
|
9
13
|
setUser(userId: string, userParams: {
|
|
10
14
|
email: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -12077,14 +12077,13 @@ function getGASessionId() {
|
|
|
12077
12077
|
return parts[0];
|
|
12078
12078
|
return null;
|
|
12079
12079
|
}
|
|
12080
|
-
const
|
|
12081
|
-
const getLocaleFromURL = () => {
|
|
12080
|
+
const getLocaleFromURL = (isClearly) => {
|
|
12082
12081
|
const pathname = window.location.pathname;
|
|
12083
12082
|
const lng = pathname.split("/")[1];
|
|
12084
12083
|
if (SUPPORTED_LANGUAGES.includes(lng))
|
|
12085
12084
|
return lng;
|
|
12086
12085
|
else
|
|
12087
|
-
return isClearly
|
|
12086
|
+
return isClearly ? "en" : "uk";
|
|
12088
12087
|
};
|
|
12089
12088
|
|
|
12090
12089
|
function insertCustomerIOScript() {
|
|
@@ -12186,10 +12185,10 @@ const storeGeoParam = () => {
|
|
|
12186
12185
|
const e='opt-in',t='opt-out',o='show--consent',n='show--preferences',a='disable--interaction',s='data-category',c='div',r='button',i='aria-hidden',l='btn-group',d='click',f='data-role',_='consentModal',u='preferencesModal';class p{constructor(){this.t={mode:e,revision:0,autoShow:true,lazyHtmlGeneration:true,autoClearCookies:true,manageScriptTags:true,hideFromBots:true,cookie:{name:'cc_cookie',expiresAfterDays:182,domain:'',path:'/',sameSite:'Lax'}},this.o={i:{},l:'',_:{},u:{},p:{},m:[],v:false,h:null,C:null,S:null,M:'',D:true,T:false,k:false,A:false,N:false,H:[],V:false,I:true,L:[],j:false,F:'',P:false,O:[],R:[],B:[],G:[],J:false,U:false,$:false,q:[],K:[],W:[],X:{},Y:{},Z:{},ee:{},te:{},oe:[]},this.ne={ae:{},se:{}},this.ce={},this.re={ie:'cc:onFirstConsent',le:'cc:onConsent',de:'cc:onChange',fe:'cc:onModalShow',_e:'cc:onModalHide',ue:'cc:onModalReady'};}}const m=new p,g=(e,t)=>e.indexOf(t),b=(e,t)=>-1!==g(e,t),v=e=>Array.isArray(e),y=e=>'string'==typeof e,h=e=>!!e&&'object'==typeof e&&!v(e),C=e=>'function'==typeof e,w=e=>Object.keys(e),S=e=>Array.from(new Set(e)),x=()=>document.activeElement,M=e=>e.preventDefault(),D=(e,t)=>e.querySelectorAll(t),k=e=>{const t=document.createElement(e);return e===r&&(t.type=e),t},E=(e,t,o)=>e.setAttribute(t,o),A=(e,t,o)=>{e.removeAttribute(o?'data-'+t:t);},N=(e,t,o)=>e.getAttribute(o?'data-'+t:t),H=(e,t)=>e.appendChild(t),V=(e,t)=>e.classList.add(t),I=(e,t)=>V(e,'cm__'+t),L=(e,t)=>V(e,'pm__'+t),j=(e,t)=>e.classList.remove(t),F=e=>{if('object'!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());let t=Array.isArray(e)?[]:{};for(let o in e){let n=e[o];t[o]=F(n);}return t},O=(e,t)=>dispatchEvent(new CustomEvent(e,{detail:t})),R=(e,t,o,n)=>{e.addEventListener(t,o),n&&m.o.m.push({pe:e,me:t,ge:o});},B=()=>{const e=m.t.cookie.expiresAfterDays;return C(e)?e(m.o.F):e},G=(e,t)=>{const o=e||[],n=t||[];return o.filter((e=>!b(n,e))).concat(n.filter((e=>!b(o,e))))},J=e=>{m.o.R=S(e),m.o.F=(()=>{let e='custom';const{R:t,O:o,B:n}=m.o,a=t.length;return a===o.length?e='all':a===n.length&&(e='necessary'),e})();},U=(e,t,o,n)=>{const a='accept-',{show:s,showPreferences:c,hide:r,hidePreferences:i,acceptCategory:l}=t,f=e||document,_=e=>D(f,`[data-cc="${e}"]`),u=(e,t)=>{M(e),l(t),i(),r();},p=_('show-preferencesModal'),g=_('show-consentModal'),b=_(a+'all'),v=_(a+'necessary'),y=_(a+'custom'),h=m.t.lazyHtmlGeneration;for(const e of p)E(e,'aria-haspopup','dialog'),R(e,d,(e=>{M(e),c();})),h&&(R(e,'mouseenter',(e=>{M(e),m.o.N||o(t,n);}),true),R(e,'focus',(()=>{m.o.N||o(t,n);})));for(let e of g)E(e,'aria-haspopup','dialog'),R(e,d,(e=>{M(e),s(true);}),true);for(let e of b)R(e,d,(e=>{u(e,'all');}),true);for(let e of y)R(e,d,(e=>{u(e);}),true);for(let e of v)R(e,d,(e=>{u(e,[]);}),true);},$=(e,t)=>{e&&(t&&(e.tabIndex=-1),e.focus(),t&&e.removeAttribute('tabindex'));},z=(e,t)=>{const o=n=>{n.target.removeEventListener('transitionend',o),'opacity'===n.propertyName&&'1'===getComputedStyle(e).opacity&&$((e=>1===e?m.ne.be:m.ne.ve)(t));};R(e,'transitionend',o);};let q;const K=e=>{clearTimeout(q),e?V(m.ne.ye,a):q=setTimeout((()=>{j(m.ne.ye,a);}),500);},Q=['M 19.5 4.5 L 4.5 19.5 M 4.5 4.501 L 19.5 19.5','M 3.572 13.406 L 8.281 18.115 L 20.428 5.885','M 21.999 6.94 L 11.639 17.18 L 2.001 6.82 '],W=(e=0,t=1.5)=>`<svg viewBox="0 0 24 24" stroke-width="${t}"><path d="${Q[e]}"/></svg>`,X=e=>{const t=m.ne,o=m.o;(e=>{const n=e===t.he,a=o.i.disablePageInteraction?t.ye:n?t.Ce:t.ye;R(a,'keydown',(t=>{if('Tab'!==t.key||!(n?o.k&&!o.A:o.A))return;const a=x(),s=n?o.q:o.K;0!==s.length&&(t.shiftKey?a!==s[0]&&e.contains(a)||(M(t),$(s[1])):a!==s[1]&&e.contains(a)||(M(t),$(s[0])));}),true);})(e);},Y=['[href]',r,'input','details','[tabindex]'].map((e=>e+':not([tabindex="-1"])')).join(','),Z=e=>{const{o:t,ne:o}=m,n=(e,t)=>{const o=D(e,Y);t[0]=o[0],t[1]=o[o.length-1];};1===e&&t.T&&n(o.he,t.q),2===e&&t.N&&n(o.we,t.K);},ee=(e,t,o)=>{const{de:n,le:a,ie:s,_e:c,ue:r,fe:i}=m.ce,l=m.re;if(t){const n={modalName:t};return e===l.fe?C(i)&&i(n):e===l._e?C(c)&&c(n):(n.modal=o,C(r)&&r(n)),O(e,n)}const d={cookie:m.o.p};e===l.ie?C(s)&&s(F(d)):e===l.le?C(a)&&a(F(d)):(d.changedCategories=m.o.L,d.changedServices=m.o.ee,C(n)&&n(F(d))),O(e,F(d));},te=(e,t)=>{try{return e()}catch(e){return !t&&console.warn('CookieConsent:',e),false}},oe=e=>{const{Y:t,ee:o,O:n,X:a,oe:c,p:r,L:i}=m.o;for(const e of n){const n=o[e]||t[e]||[];for(const o of n){const n=a[e][o];if(!n)continue;const{onAccept:s,onReject:c}=n;!n.Se&&b(t[e],o)?(n.Se=true,C(s)&&s()):n.Se&&!b(t[e],o)&&(n.Se=false,C(c)&&c());}}if(!m.t.manageScriptTags)return;const l=c,d=e||r.categories||[],f=(e,n)=>{if(n>=e.length)return;const a=c[n];if(a.xe)return f(e,n+1);const r=a.Me,l=a.De,_=a.Te,u=b(d,l),p=!!_&&b(t[l],_);if(!_&&!a.ke&&u||!_&&a.ke&&!u&&b(i,l)||_&&!a.ke&&p||_&&a.ke&&!p&&b(o[l]||[],_)){a.xe=true;const t=N(r,'type',true);A(r,'type',!!t),A(r,s);let o=N(r,'src',true);o&&A(r,'src',true);const c=k('script');c.textContent=r.innerHTML;for(const{nodeName:e}of r.attributes)E(c,e,r[e]||N(r,e));t&&(c.type=t),o?c.src=o:o=r.src;const i=!!o&&(!t||['text/javascript','module'].includes(t));if(i&&(c.onload=c.onerror=()=>{f(e,++n);}),r.replaceWith(c),i)return}f(e,++n);};f(l,0);},ne='bottom',ae='left',se='center',ce='right',re='inline',ie='wide',le='pm--',de=['middle','top',ne],fe=[ae,se,ce],_e={box:{Ee:[ie,re],Ae:de,Ne:fe,He:ne,Ve:ce},cloud:{Ee:[re],Ae:de,Ne:fe,He:ne,Ve:se},bar:{Ee:[re],Ae:de.slice(1),Ne:[],He:ne,Ve:''}},ue={box:{Ee:[],Ae:[],Ne:[],He:'',Ve:''},bar:{Ee:[ie],Ae:[],Ne:[ae,ce],He:'',Ve:ae}},pe=e=>{const t=m.o.i.guiOptions,o=t&&t.consentModal,n=t&&t.preferencesModal;0===e&&me(m.ne.he,_e,o,'cm--','box','cm'),1===e&&me(m.ne.we,ue,n,le,'box','pm');},me=(e,t,o,n,a,s)=>{e.className=s;const c=o&&o.layout,r=o&&o.position,i=o&&o.flipButtons,l=!o||false!==o.equalWeightButtons,d=c&&c.split(' ')||[],f=d[0],_=d[1],u=f in t?f:a,p=t[u],g=b(p.Ee,_)&&_,v=r&&r.split(' ')||[],y=v[0],h=n===le?v[0]:v[1],C=b(p.Ae,y)?y:p.He,w=b(p.Ne,h)?h:p.Ve,S=t=>{t&&V(e,n+t);};S(u),S(g),S(C),S(w),i&&S('flip');const x=s+'__btn--secondary';if('cm'===s){const{Ie:e,Le:t}=m.ne;e&&(l?j(e,x):V(e,x)),t&&(l?j(t,x):V(t,x));}else {const{je:e}=m.ne;e&&(l?j(e,x):V(e,x));}},ge=(e,t)=>{const o=m.o,n=m.ne,{hide:a,hidePreferences:s,acceptCategory:_}=e,p=e=>{_(e),s(),a();},g=o.u&&o.u.preferencesModal;if(!g)return;const b=g.title,v=g.closeIconLabel,C=g.acceptAllBtn,S=g.acceptNecessaryBtn,x=g.savePreferencesBtn,M=g.sections||[],D=C||S||x;if(n.Fe)n.Pe=k(c),L(n.Pe,'body');else {n.Fe=k(c),V(n.Fe,'pm-wrapper');const e=k('div');V(e,'pm-overlay'),H(n.Fe,e),R(e,d,s),n.we=k(c),V(n.we,'pm'),E(n.we,'role','dialog'),E(n.we,i,true),E(n.we,'aria-modal',true),E(n.we,'aria-labelledby','pm__title'),R(n.ye,'keydown',(e=>{27===e.keyCode&&s();}),true),n.Oe=k(c),L(n.Oe,'header'),n.Re=k('h2'),L(n.Re,'title'),n.Re.id='pm__title',n.Be=k(r),L(n.Be,'close-btn'),E(n.Be,'aria-label',g.closeIconLabel||''),R(n.Be,d,s),n.Ge=k('span'),n.Ge.innerHTML=W(),H(n.Be,n.Ge),n.Je=k(c),L(n.Je,'body'),n.Ue=k(c),L(n.Ue,'footer');var T=k(c);V(T,'btns');var A=k(c),N=k(c);L(A,l),L(N,l),H(n.Ue,A),H(n.Ue,N),H(n.Oe,n.Re),H(n.Oe,n.Be),n.ve=k(c),E(n.ve,'tabIndex',-1),H(n.we,n.ve),H(n.we,n.Oe),H(n.we,n.Je),D&&H(n.we,n.Ue),H(n.Fe,n.we);}let I;b&&(n.Re.innerHTML=b,v&&E(n.Be,'aria-label',v)),M.forEach(((e,t)=>{const a=e.title,s=e.description,l=e.linkedCategory,f=l&&o.P[l],_=e.cookieTable,u=_&&_.body,p=_&&_.caption,m=u&&u.length>0,b=!!f,v=b&&o.X[l],C=h(v)&&w(v)||[],S=b&&(!!s||!!m||w(v).length>0);var x=k(c);if(L(x,'section'),S||s){var M=k(c);L(M,'section-desc-wrapper');}let D=C.length;if(S&&D>0){const e=k(c);L(e,'section-services');for(const t of C){const o=v[t],n=o&&o.label||t,a=k(c),s=k(c),r=k(c),i=k(c);L(a,'service'),L(i,'service-title'),L(s,'service-header'),L(r,'service-icon');const d=be(n,t,f,true,l);i.innerHTML=n,H(s,r),H(s,i),H(a,s),H(a,d),H(e,a);}H(M,e);}if(a){var T=k(c),A=k(b?r:c);if(L(T,'section-title-wrapper'),L(A,'section-title'),A.innerHTML=a,H(T,A),b){const e=k('span');e.innerHTML=W(2,3.5),L(e,'section-arrow'),H(T,e),x.className+='--toggle';const t=be(a,l,f);let o=g.serviceCounterLabel;if(D>0&&y(o)){let e=k('span');L(e,'badge'),L(e,'service-counter'),E(e,i,true),E(e,'data-servicecounter',D),o&&(o=o.split('|'),o=o.length>1&&D>1?o[1]:o[0],E(e,'data-counterlabel',o)),e.innerHTML=D+(o?' '+o:''),H(A,e);}if(S){L(x,'section--expandable');var N=l+'-desc';E(A,'aria-expanded',false),E(A,'aria-controls',N);}H(T,t);}else E(A,'role','heading'),E(A,'aria-level','3');H(x,T);}if(s){var F=k('p');L(F,'section-desc'),F.innerHTML=s,H(M,F);}if(S&&(E(M,i,'true'),M.id=N,((e,t,o)=>{R(A,d,(()=>{t.classList.contains('is-expanded')?(j(t,'is-expanded'),E(o,'aria-expanded','false'),E(e,i,'true')):(V(t,'is-expanded'),E(o,'aria-expanded','true'),E(e,i,'false'));}));})(M,x,A),m)){const e=k('table'),o=k('thead'),a=k('tbody');if(p){const t=k('caption');L(t,'table-caption'),t.innerHTML=p,e.appendChild(t);}L(e,'section-table'),L(o,'table-head'),L(a,'table-body');const s=_.headers,r=w(s),i=n.$e.createDocumentFragment(),l=k('tr');for(const e of r){const o=s[e],n=k('th');n.id='cc__row-'+o+t,E(n,'scope','col'),L(n,'table-th'),n.innerHTML=o,H(i,n);}H(l,i),H(o,l);const d=n.$e.createDocumentFragment();for(const e of u){const o=k('tr');L(o,'table-tr');for(const n of r){const a=s[n],r=e[n],i=k('td'),l=k(c);L(i,'table-td'),E(i,'data-column',a),E(i,'headers','cc__row-'+a+t),l.insertAdjacentHTML('beforeend',r),H(i,l),H(o,i);}H(d,o);}H(a,d),H(e,o),H(e,a),H(M,e);}(S||s)&&H(x,M);const P=n.Pe||n.Je;b?(I||(I=k(c),L(I,'section-toggles')),I.appendChild(x)):I=null,H(P,I||x);})),C&&(n.ze||(n.ze=k(r),L(n.ze,'btn'),E(n.ze,f,'all'),H(A,n.ze),R(n.ze,d,(()=>p('all')))),n.ze.innerHTML=C),S&&(n.je||(n.je=k(r),L(n.je,'btn'),E(n.je,f,'necessary'),H(A,n.je),R(n.je,d,(()=>p([])))),n.je.innerHTML=S),x&&(n.qe||(n.qe=k(r),L(n.qe,'btn'),L(n.qe,'btn--secondary'),E(n.qe,f,'save'),H(N,n.qe),R(n.qe,d,(()=>p()))),n.qe.innerHTML=x),n.Pe&&(n.we.replaceChild(n.Pe,n.Je),n.Je=n.Pe),pe(1),o.N||(o.N=true,ee(m.re.ue,u,n.we),t(e),H(n.Ce,n.Fe),X(n.we),setTimeout((()=>V(n.Fe,'cc--anim')),100)),Z(2);};function be(e,t,o,n,a){const c=m.o,r=m.ne,l=k('label'),f=k('input'),_=k('span'),u=k('span'),p=k('span'),g=k('span'),v=k('span');if(g.innerHTML=W(1,3),v.innerHTML=W(0,3),f.type='checkbox',V(l,'section__toggle-wrapper'),V(f,'section__toggle'),V(g,'toggle__icon-on'),V(v,'toggle__icon-off'),V(_,'toggle__icon'),V(u,'toggle__icon-circle'),V(p,'toggle__label'),E(_,i,'true'),n?(V(l,'toggle-service'),E(f,s,a),r.se[a][t]=f):r.ae[t]=f,n?(e=>{R(f,'change',(()=>{const t=r.se[e],o=r.ae[e];c.Z[e]=[];for(let o in t){const n=t[o];n.checked&&c.Z[e].push(n.value);}o.checked=c.Z[e].length>0;}));})(a):(e=>{R(f,d,(()=>{const t=r.se[e],o=f.checked;c.Z[e]=[];for(let n in t)t[n].checked=o,o&&c.Z[e].push(n);}));})(t),f.value=t,p.textContent=e.replace(/<.*>.*<\/.*>/gm,''),H(u,v),H(u,g),H(_,u),c.D)(o.readOnly||o.enabled)&&(f.checked=true);else if(n){const e=c.Y[a];f.checked=o.readOnly||b(e,t);}else b(c.R,t)&&(f.checked=true);return o.readOnly&&(f.disabled=true),H(l,f),H(l,_),H(l,p),l}const ve=()=>{const e=k('span');return m.ne.Ke||(m.ne.Ke=e),e},ye=(e,t)=>{const o=m.o,n=m.ne,{hide:a,showPreferences:s,acceptCategory:u}=e,p=o.u&&o.u.consentModal;if(!p)return;const g=p.acceptAllBtn,b=p.acceptNecessaryBtn,v=p.showPreferencesBtn,y=p.closeIconLabel,h=p.footer,C=p.label,w=p.title,S=e=>{a(),u(e);};if(!n.Qe){n.Qe=k(c),n.he=k(c),n.We=k(c),n.Xe=k(c),n.Ye=k(c),V(n.Qe,'cm-wrapper'),V(n.he,'cm'),I(n.We,'body'),I(n.Xe,'texts'),I(n.Ye,'btns'),E(n.he,'role','dialog'),E(n.he,'aria-modal','true'),E(n.he,i,'false'),E(n.he,'aria-describedby','cm__desc'),C?E(n.he,'aria-label',C):w&&E(n.he,'aria-labelledby','cm__title');const e='box',t=o.i.guiOptions,a=t&&t.consentModal,s=(a&&a.layout||e).split(' ')[0]===e;w&&y&&s&&(n.Le||(n.Le=k(r),n.Le.innerHTML=W(),I(n.Le,'btn'),I(n.Le,'btn--close'),R(n.Le,d,(()=>{S([]);})),H(n.We,n.Le)),E(n.Le,'aria-label',y)),H(n.We,n.Xe),(g||b||v)&&H(n.We,n.Ye),n.be=k(c),E(n.be,'tabIndex',-1),H(n.he,n.be),H(n.he,n.We),H(n.Qe,n.he);}w&&(n.Ze||(n.Ze=k('h2'),n.Ze.className=n.Ze.id='cm__title',H(n.Xe,n.Ze)),n.Ze.innerHTML=w);let x=p.description;if(x&&(o.V&&(x=x.replace('{{revisionMessage}}',o.I?'':p.revisionMessage||'')),n.et||(n.et=k('p'),n.et.className=n.et.id='cm__desc',H(n.Xe,n.et)),n.et.innerHTML=x),g&&(n.tt||(n.tt=k(r),H(n.tt,ve()),I(n.tt,'btn'),E(n.tt,f,'all'),R(n.tt,d,(()=>{S('all');}))),n.tt.firstElementChild.innerHTML=g),b&&(n.Ie||(n.Ie=k(r),H(n.Ie,ve()),I(n.Ie,'btn'),E(n.Ie,f,'necessary'),R(n.Ie,d,(()=>{S([]);}))),n.Ie.firstElementChild.innerHTML=b),v&&(n.ot||(n.ot=k(r),H(n.ot,ve()),I(n.ot,'btn'),I(n.ot,'btn--secondary'),E(n.ot,f,'show'),R(n.ot,'mouseenter',(()=>{o.N||ge(e,t);})),R(n.ot,d,s)),n.ot.firstElementChild.innerHTML=v),n.nt||(n.nt=k(c),I(n.nt,l),g&&H(n.nt,n.tt),b&&H(n.nt,n.Ie),(g||b)&&H(n.We,n.nt),H(n.Ye,n.nt)),n.ot&&!n.st&&(n.st=k(c),n.Ie&&n.tt?(I(n.st,l),H(n.st,n.ot),H(n.Ye,n.st)):(H(n.nt,n.ot),I(n.nt,l+'--uneven'))),h){if(!n.ct){let e=k(c),t=k(c);n.ct=k(c),I(e,'footer'),I(t,'links'),I(n.ct,'link-group'),H(t,n.ct),H(e,t),H(n.he,e);}n.ct.innerHTML=h;}pe(0),o.T||(o.T=true,ee(m.re.ue,_,n.he),t(e),H(n.Ce,n.Qe),X(n.he),setTimeout((()=>V(n.Qe,'cc--anim')),100)),Z(1),U(n.We,e,ge,t);},he=e=>{if(!y(e))return null;if(e in m.o._)return e;let t=e.slice(0,2);return t in m.o._?t:null},Ce=()=>m.o.l||m.o.i.language.default,we=e=>{e&&(m.o.l=e);},Se=async e=>{const t=m.o;let o=he(e)?e:Ce(),n=t._[o];return y(n)?n=await(async e=>{try{const t=await fetch(e);return await t.json()}catch(e){return console.error(e),false}})(n):C(n)&&(n=await n()),!!n&&(t.u=n,we(o),true)},xe=()=>{let e=m.o.i.language.rtl,t=m.ne.Ce;e&&t&&(v(e)||(e=[e]),b(e,m.o.l)?V(t,'cc--rtl'):j(t,'cc--rtl'));},Me=()=>{const e=m.ne;if(e.Ce)return;e.Ce=k(c),e.Ce.id='cc-main',e.Ce.setAttribute('data-nosnippet',''),xe();let t=m.o.i.root;t&&y(t)&&(t=document.querySelector(t)),(t||e.$e.body).appendChild(e.Ce);},De=e=>te((()=>localStorage.removeItem(e))),Te=(e,t)=>{if(t instanceof RegExp)return e.filter((e=>t.test(e)));{const o=g(e,t);return o>-1?[e[o]]:[]}},ke=e=>{const{hostname:t,protocol:o}=location,{name:n,path:a,domain:s,sameSite:c,useLocalStorage:r}=m.t.cookie,i=864e5*B(),l=new Date;l.setTime(l.getTime()+i),m.o.p.expirationTime=l.getTime();const d=JSON.stringify(m.o.p);let f=n+'='+encodeURIComponent(d)+(0!==i?'; expires='+l.toUTCString():'')+'; Path='+a+'; SameSite='+c;b(t,'.')&&(f+='; Domain='+s),'https:'===o&&(f+='; Secure'),r?((e,t)=>{te((()=>localStorage.setItem(e,t)));})(n,d):document.cookie=f,m.o.p;},Ee=(e,t,o)=>{if(0===e.length)return;const n=o||m.t.cookie.domain,a=t||m.t.cookie.path,s='www.'===n.slice(0,4),c=s&&n.substring(4),r=(e,t)=>{document.cookie=e+'=; path='+a+(t?'; domain=.'+t:'')+'; expires=Thu, 01 Jan 1970 00:00:01 GMT;';};for(const t of e)r(t),r(t,n),s&&r(t,c);},Ae=e=>{const t=m.t.cookie.name,o=m.t.cookie.useLocalStorage;return ((e,t)=>{let o;return o=te((()=>JSON.parse(t?e:decodeURIComponent(e))),true)||{},o})(o?(n=t,te((()=>localStorage.getItem(n)))||''):Ne(t),o);var n;},Ne=(e,t)=>{const o=document.cookie.match('(^|;)\\s*'+e+'\\s*=\\s*([^;]+)');return o?o.pop():''},He=e=>{const t=document.cookie.split(/;\s*/),o=[];for(const n of t){let t=n.split('=')[0];o.push(t);}return o},Ve=(o,n=[])=>{((e,t)=>{const{O:o,R:n,B:a,N:s,Z:c,G:r,X:i}=m.o;let l=[];if(e){v(e)?l.push(...e):y(e)&&(l='all'===e?o:[e]);for(const e of o)c[e]=b(l,e)?w(i[e]):[];}else l=[...n,...r],s&&(l=(()=>{const e=m.ne.ae;if(!e)return [];let t=[];for(let o in e)e[o].checked&&t.push(o);return t})());l=l.filter((e=>!b(o,e)||!b(t,e))),l.push(...a),J(l);})(o,n),(e=>{const t=m.o,{Z:o,B:n,Y:a,X:s,O:c}=t,r=c;t.te=F(a);for(const e of r){const c=s[e],r=w(c),i=o[e]&&o[e].length>0,l=b(n,e);if(0!==r.length){if(a[e]=[],l)a[e].push(...r);else if(i){const t=o[e];a[e].push(...t);}else a[e]=t.Z[e];a[e]=S(a[e]);}}})(),(()=>{const o=m.o;o.L=m.t.mode===t&&o.D?G(o.G,o.R):G(o.R,o.p.categories);let n=o.L.length>0,a=false;for(const e of o.O)o.ee[e]=G(o.Y[e],o.te[e]),o.ee[e].length>0&&(a=true);const s=m.ne.ae;for(const e in s)s[e].checked=b(o.R,e);for(const e of o.O){const t=m.ne.se[e],n=o.Y[e];for(const e in t)t[e].checked=b(n,e);}o.C||(o.C=new Date),o.M||(o.M=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))),o.p={categories:F(o.R),revision:m.t.revision,data:o.h,consentTimestamp:o.C.toISOString(),consentId:o.M,services:F(o.Y)};let c=false;const r=n||a;(o.D||r)&&(o.D&&(o.D=false,c=true),o.S=o.S?new Date:o.C,o.p.lastConsentTimestamp=o.S.toISOString(),ke(),m.t.autoClearCookies&&(c||r)&&(e=>{const t=m.o,o=He(),n=(e=>{const t=m.o;return (e?t.O:t.L).filter((e=>{const o=t.P[e];return !!o&&!o.readOnly&&!!o.autoClear}))})(e);for(const e in t.ee)for(const n of t.ee[e]){const a=t.X[e][n].cookies;if(!b(t.Y[e],n)&&a)for(const e of a){const t=Te(o,e.name);Ee(t,e.path,e.domain);}}for(const a of n){const n=t.P[a].autoClear,s=n&&n.cookies||[],c=b(t.L,a),r=!b(t.R,a),i=c&&r;if(e?r:i){n.reloadPage&&i&&(t.j=true);for(const e of s){const t=Te(o,e.name);Ee(t,e.path,e.domain);}}}})(c),oe()),c&&(ee(m.re.ie),ee(m.re.le),m.t.mode===e)||(r&&ee(m.re.de),o.j&&(o.j=false,location.reload()));})();},Ie=e=>{const t=m.o.D?[]:m.o.R;return b(t,e)},je=(e,t)=>{const o=m.o.D?[]:m.o.Y[t]||[];return b(o,e)},Oe=e=>{const{ne:t,o:n}=m;if(!n.k){if(!n.T){if(!e)return;ye(Je,Me);}n.k=true,n.U=x(),n.v&&K(true),z(t.he,1),V(t.ye,o),E(t.he,i,'false'),setTimeout((()=>{$(m.ne.be);}),100),ee(m.re.fe,_);}},Re=()=>{const{ne:e,o:t,re:n}=m;t.k&&(t.k=false,t.v&&K(),$(e.Ke,true),j(e.ye,o),E(e.he,i,'true'),$(t.U),t.U=null,ee(n._e,_));},Be=()=>{const e=m.o;e.A||(e.N||ge(Je,Me),e.A=true,e.k?e.$=x():e.U=x(),z(m.ne.we,2),V(m.ne.ye,n),E(m.ne.we,i,'false'),setTimeout((()=>{$(m.ne.ve);}),100),ee(m.re.fe,u));},Ge=()=>{const e=m.o;e.A&&(e.A=false,(()=>{const e=We(),t=m.o.P,o=m.ne.ae,n=m.ne.se,a=e=>b(m.o.G,e);for(const s in o){const c=!!t[s].readOnly;o[s].checked=c||(e?Ie(s):a(s));for(const t in n[s])n[s][t].checked=c||(e?je(t,s):a(s));}})(),$(m.ne.Ge,true),j(m.ne.ye,n),E(m.ne.we,i,'true'),e.k?($(e.$),e.$=null):($(e.U),e.U=null),ee(m.re._e,u));};var Je={show:Oe,hide:Re,showPreferences:Be,hidePreferences:Ge,acceptCategory:Ve};const We=()=>!m.o.D,Xe=async e=>{const{o:o,t:n,re:a}=m,c=window;if(!c._ccRun){if(c._ccRun=true,(e=>{const{ne:o,t:n,o:a}=m,c=n,r=a,{cookie:i}=c,l=m.ce,d=e.cookie,f=e.categories,_=w(f)||[],u=navigator,p=document;o.$e=p,o.ye=p.documentElement,i.domain=location.hostname,r.i=e,r.P=f,r.O=_,r._=e.language.translations,r.v=!!e.disablePageInteraction,l.ie=e.onFirstConsent,l.le=e.onConsent,l.de=e.onChange,l._e=e.onModalHide,l.fe=e.onModalShow,l.ue=e.onModalReady;const{mode:g,autoShow:v,lazyHtmlGeneration:y,autoClearCookies:C,revision:S,manageScriptTags:x,hideFromBots:M}=e;g===t&&(c.mode=g),'boolean'==typeof C&&(c.autoClearCookies=C),'boolean'==typeof x&&(c.manageScriptTags=x),'number'==typeof S&&S>=0&&(c.revision=S,r.V=true),'boolean'==typeof v&&(c.autoShow=v),'boolean'==typeof y&&(c.lazyHtmlGeneration=y),false===M&&(c.hideFromBots=false),true===c.hideFromBots&&u&&(r.J=u.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(u.userAgent)||u.webdriver),h(d)&&(c.cookie={...i,...d}),c.autoClearCookies,r.V,c.manageScriptTags,(e=>{const{P:t,X:o,Y:n,Z:a,B:s}=m.o;for(let c of e){const e=t[c],r=e.services||{},i=h(r)&&w(r)||[];o[c]={},n[c]=[],a[c]=[],e.readOnly&&(s.push(c),n[c]=i),m.ne.se[c]={};for(let e of i){const t=r[e];t.Se=false,o[c][e]=t;}}})(_),(()=>{if(!m.t.manageScriptTags)return;const e=m.o,t=D(document,'script['+s+']');for(const o of t){let t=N(o,s),n=o.dataset.service||'',a=false;if(t&&'!'===t.charAt(0)&&(t=t.slice(1),a=true),'!'===n.charAt(0)&&(n=n.slice(1),a=true),b(e.O,t)&&(e.oe.push({Me:o,xe:false,ke:a,De:t,Te:n}),n)){const o=e.X[t];o[n]||(o[n]={Se:false});}}})(),we((()=>{const e=m.o.i.language.autoDetect;if(e){const t={browser:navigator.language,document:document.documentElement.lang},o=he(t[e]);if(o)return o}return Ce()})());})(e),o.J)return;(()=>{const e=m.o,o=m.t,n=Ae(),{categories:a,services:s,consentId:c,consentTimestamp:r,lastConsentTimestamp:i,data:l,revision:d}=n,f=v(a);e.p=n,e.M=c;const _=!!c&&y(c);e.C=r,e.C&&(e.C=new Date(r)),e.S=i,e.S&&(e.S=new Date(i)),e.h=undefined!==l?l:null,e.V&&_&&d!==o.revision&&(e.I=false),e.D=!(_&&e.I&&e.C&&e.S&&f),o.cookie.useLocalStorage&&!e.D&&(e.D=(new Date).getTime()>(n.expirationTime||0),e.D&&De(o.cookie.name)),e.D,(()=>{const e=m.o;for(const o of e.O){const n=e.P[o];if(n.readOnly||n.enabled){e.G.push(o);const n=e.X[o]||{};for(let a in n)e.Z[o].push(a),e.i.mode===t&&e.Y[o].push(a);}}})(),e.D?o.mode===t&&(e.R=[...e.G]):(e.Z={...e.Y},e.Y={...e.Y,...s},J([...e.B,...a]));})();const i=We();if(!await Se())return false;if(U(null,r=Je,ge,Me),m.o.D&&ye(r,Me),m.t.lazyHtmlGeneration||ge(r,Me),n.autoShow&&!i&&Oe(true),i)return oe(),ee(a.le);n.mode===t&&oe(o.G);}var r;};
|
|
12187
12186
|
|
|
12188
12187
|
const cookieDomain = getDomain();
|
|
12189
|
-
const getCookieBannerConfig = (lng) => ({
|
|
12188
|
+
const getCookieBannerConfig = (lng, isClearly) => ({
|
|
12190
12189
|
language: {
|
|
12191
12190
|
default: lng,
|
|
12192
|
-
translations,
|
|
12191
|
+
translations: getTranslations(isClearly),
|
|
12193
12192
|
},
|
|
12194
12193
|
cookie: {
|
|
12195
12194
|
domain: cookieDomain,
|
|
@@ -12207,7 +12206,7 @@ const getCookieBannerConfig = (lng) => ({
|
|
|
12207
12206
|
ga: {
|
|
12208
12207
|
label: "Google Analytics",
|
|
12209
12208
|
onAccept: () => {
|
|
12210
|
-
gtag("consent", "
|
|
12209
|
+
gtag("consent", "update", {
|
|
12211
12210
|
ad_storage: "granted",
|
|
12212
12211
|
ad_user_data: "granted",
|
|
12213
12212
|
ad_personalization: "granted",
|
|
@@ -12215,11 +12214,11 @@ const getCookieBannerConfig = (lng) => ({
|
|
|
12215
12214
|
});
|
|
12216
12215
|
},
|
|
12217
12216
|
onReject: () => {
|
|
12218
|
-
gtag("consent", "
|
|
12219
|
-
ad_storage: "
|
|
12220
|
-
ad_user_data: "
|
|
12221
|
-
ad_personalization: "
|
|
12222
|
-
analytics_storage: "
|
|
12217
|
+
gtag("consent", "update", {
|
|
12218
|
+
ad_storage: "granted",
|
|
12219
|
+
ad_user_data: "granted",
|
|
12220
|
+
ad_personalization: "granted",
|
|
12221
|
+
analytics_storage: "granted",
|
|
12223
12222
|
});
|
|
12224
12223
|
},
|
|
12225
12224
|
},
|
|
@@ -12227,7 +12226,7 @@ const getCookieBannerConfig = (lng) => ({
|
|
|
12227
12226
|
},
|
|
12228
12227
|
},
|
|
12229
12228
|
});
|
|
12230
|
-
const
|
|
12229
|
+
const getTranslations = (isClearly) => ({
|
|
12231
12230
|
en: {
|
|
12232
12231
|
consentModal: {
|
|
12233
12232
|
title: "We use cookies",
|
|
@@ -12259,7 +12258,7 @@ const translations = {
|
|
|
12259
12258
|
},
|
|
12260
12259
|
{
|
|
12261
12260
|
title: "More information",
|
|
12262
|
-
description: `For any queries in relation to our policy on cookies and your choices, please <a href="mailto:${isClearly
|
|
12261
|
+
description: `For any queries in relation to our policy on cookies and your choices, please <a href="mailto:${isClearly ? "hello@clearly.help" : "hello@rozmova.me"}">contact us</a>`,
|
|
12263
12262
|
},
|
|
12264
12263
|
],
|
|
12265
12264
|
},
|
|
@@ -12295,7 +12294,7 @@ const translations = {
|
|
|
12295
12294
|
},
|
|
12296
12295
|
{
|
|
12297
12296
|
title: "Więcej informacji",
|
|
12298
|
-
description: `W przypadku pytań dotyczących naszej polityki plików cookie i Twoich wyborów, prosimy <a href="mailto:${isClearly
|
|
12297
|
+
description: `W przypadku pytań dotyczących naszej polityki plików cookie i Twoich wyborów, prosimy <a href="mailto:${isClearly ? "hello@clearly.help" : "hello@rozmova.me"}">skontaktować się z nami</a>.`,
|
|
12299
12298
|
},
|
|
12300
12299
|
],
|
|
12301
12300
|
},
|
|
@@ -12331,7 +12330,7 @@ const translations = {
|
|
|
12331
12330
|
},
|
|
12332
12331
|
{
|
|
12333
12332
|
title: "Más información",
|
|
12334
|
-
description: `Para cualquier consulta sobre nuestra política de cookies y tus elecciones, por favor <a href="mailto:${isClearly
|
|
12333
|
+
description: `Para cualquier consulta sobre nuestra política de cookies y tus elecciones, por favor <a href="mailto:${isClearly ? "hello@clearly.help" : "hello@rozmova.me"}">contáctanos</a>.`,
|
|
12335
12334
|
},
|
|
12336
12335
|
],
|
|
12337
12336
|
},
|
|
@@ -12367,13 +12366,13 @@ const translations = {
|
|
|
12367
12366
|
},
|
|
12368
12367
|
{
|
|
12369
12368
|
title: "Додаткова інформація",
|
|
12370
|
-
description: `Якщо у вас є запитання щодо нашої політики використання файлів cookie та ваших налаштувань, будь ласка, <a href="mailto:${isClearly
|
|
12369
|
+
description: `Якщо у вас є запитання щодо нашої політики використання файлів cookie та ваших налаштувань, будь ласка, <a href="mailto:${isClearly ? "hello@clearly.help" : "hello@rozmova.me"}">зв'яжіться з нами</a>.`,
|
|
12371
12370
|
},
|
|
12372
12371
|
],
|
|
12373
12372
|
},
|
|
12374
12373
|
},
|
|
12375
|
-
};
|
|
12376
|
-
const initCookieConsentBanner = (lng) => {
|
|
12374
|
+
});
|
|
12375
|
+
const initCookieConsentBanner = (lng, isClearly) => {
|
|
12377
12376
|
// CDN styles
|
|
12378
12377
|
const remoteStyle = document.createElement("link");
|
|
12379
12378
|
remoteStyle.rel = "stylesheet";
|
|
@@ -12393,7 +12392,7 @@ const initCookieConsentBanner = (lng) => {
|
|
|
12393
12392
|
}
|
|
12394
12393
|
`;
|
|
12395
12394
|
document.head.appendChild(style);
|
|
12396
|
-
Xe(getCookieBannerConfig(lng));
|
|
12395
|
+
Xe(getCookieBannerConfig(lng, isClearly));
|
|
12397
12396
|
};
|
|
12398
12397
|
|
|
12399
12398
|
class Analytics {
|
|
@@ -12401,7 +12400,7 @@ class Analytics {
|
|
|
12401
12400
|
locale = "uk";
|
|
12402
12401
|
platform = "web";
|
|
12403
12402
|
dataLayer = [];
|
|
12404
|
-
init(locale, platform) {
|
|
12403
|
+
init({ locale, platform, isClearly, } = {}) {
|
|
12405
12404
|
if (this.initialized)
|
|
12406
12405
|
return;
|
|
12407
12406
|
insertCustomerIOScript();
|
|
@@ -12413,11 +12412,11 @@ class Analytics {
|
|
|
12413
12412
|
if (locale)
|
|
12414
12413
|
this.locale = locale;
|
|
12415
12414
|
else
|
|
12416
|
-
this.locale = getLocaleFromURL();
|
|
12415
|
+
this.locale = getLocaleFromURL(isClearly);
|
|
12417
12416
|
if (platform)
|
|
12418
12417
|
this.platform = platform;
|
|
12419
|
-
if (this.platform === "web" && isClearly
|
|
12420
|
-
initCookieConsentBanner(this.locale);
|
|
12418
|
+
if (this.platform === "web" && isClearly)
|
|
12419
|
+
initCookieConsentBanner(this.locale, isClearly);
|
|
12421
12420
|
mixpanel.init(MIXPANEL_TOKEN, {
|
|
12422
12421
|
debug: false,
|
|
12423
12422
|
track_pageview: "url-with-path",
|
package/dist/index.js
CHANGED
|
@@ -12079,14 +12079,13 @@ function getGASessionId() {
|
|
|
12079
12079
|
return parts[0];
|
|
12080
12080
|
return null;
|
|
12081
12081
|
}
|
|
12082
|
-
const
|
|
12083
|
-
const getLocaleFromURL = () => {
|
|
12082
|
+
const getLocaleFromURL = (isClearly) => {
|
|
12084
12083
|
const pathname = window.location.pathname;
|
|
12085
12084
|
const lng = pathname.split("/")[1];
|
|
12086
12085
|
if (SUPPORTED_LANGUAGES.includes(lng))
|
|
12087
12086
|
return lng;
|
|
12088
12087
|
else
|
|
12089
|
-
return isClearly
|
|
12088
|
+
return isClearly ? "en" : "uk";
|
|
12090
12089
|
};
|
|
12091
12090
|
|
|
12092
12091
|
function insertCustomerIOScript() {
|
|
@@ -12188,10 +12187,10 @@ const storeGeoParam = () => {
|
|
|
12188
12187
|
const e='opt-in',t='opt-out',o='show--consent',n='show--preferences',a='disable--interaction',s='data-category',c='div',r='button',i='aria-hidden',l='btn-group',d='click',f='data-role',_='consentModal',u='preferencesModal';class p{constructor(){this.t={mode:e,revision:0,autoShow:true,lazyHtmlGeneration:true,autoClearCookies:true,manageScriptTags:true,hideFromBots:true,cookie:{name:'cc_cookie',expiresAfterDays:182,domain:'',path:'/',sameSite:'Lax'}},this.o={i:{},l:'',_:{},u:{},p:{},m:[],v:false,h:null,C:null,S:null,M:'',D:true,T:false,k:false,A:false,N:false,H:[],V:false,I:true,L:[],j:false,F:'',P:false,O:[],R:[],B:[],G:[],J:false,U:false,$:false,q:[],K:[],W:[],X:{},Y:{},Z:{},ee:{},te:{},oe:[]},this.ne={ae:{},se:{}},this.ce={},this.re={ie:'cc:onFirstConsent',le:'cc:onConsent',de:'cc:onChange',fe:'cc:onModalShow',_e:'cc:onModalHide',ue:'cc:onModalReady'};}}const m=new p,g=(e,t)=>e.indexOf(t),b=(e,t)=>-1!==g(e,t),v=e=>Array.isArray(e),y=e=>'string'==typeof e,h=e=>!!e&&'object'==typeof e&&!v(e),C=e=>'function'==typeof e,w=e=>Object.keys(e),S=e=>Array.from(new Set(e)),x=()=>document.activeElement,M=e=>e.preventDefault(),D=(e,t)=>e.querySelectorAll(t),k=e=>{const t=document.createElement(e);return e===r&&(t.type=e),t},E=(e,t,o)=>e.setAttribute(t,o),A=(e,t,o)=>{e.removeAttribute(o?'data-'+t:t);},N=(e,t,o)=>e.getAttribute(o?'data-'+t:t),H=(e,t)=>e.appendChild(t),V=(e,t)=>e.classList.add(t),I=(e,t)=>V(e,'cm__'+t),L=(e,t)=>V(e,'pm__'+t),j=(e,t)=>e.classList.remove(t),F=e=>{if('object'!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());let t=Array.isArray(e)?[]:{};for(let o in e){let n=e[o];t[o]=F(n);}return t},O=(e,t)=>dispatchEvent(new CustomEvent(e,{detail:t})),R=(e,t,o,n)=>{e.addEventListener(t,o),n&&m.o.m.push({pe:e,me:t,ge:o});},B=()=>{const e=m.t.cookie.expiresAfterDays;return C(e)?e(m.o.F):e},G=(e,t)=>{const o=e||[],n=t||[];return o.filter((e=>!b(n,e))).concat(n.filter((e=>!b(o,e))))},J=e=>{m.o.R=S(e),m.o.F=(()=>{let e='custom';const{R:t,O:o,B:n}=m.o,a=t.length;return a===o.length?e='all':a===n.length&&(e='necessary'),e})();},U=(e,t,o,n)=>{const a='accept-',{show:s,showPreferences:c,hide:r,hidePreferences:i,acceptCategory:l}=t,f=e||document,_=e=>D(f,`[data-cc="${e}"]`),u=(e,t)=>{M(e),l(t),i(),r();},p=_('show-preferencesModal'),g=_('show-consentModal'),b=_(a+'all'),v=_(a+'necessary'),y=_(a+'custom'),h=m.t.lazyHtmlGeneration;for(const e of p)E(e,'aria-haspopup','dialog'),R(e,d,(e=>{M(e),c();})),h&&(R(e,'mouseenter',(e=>{M(e),m.o.N||o(t,n);}),true),R(e,'focus',(()=>{m.o.N||o(t,n);})));for(let e of g)E(e,'aria-haspopup','dialog'),R(e,d,(e=>{M(e),s(true);}),true);for(let e of b)R(e,d,(e=>{u(e,'all');}),true);for(let e of y)R(e,d,(e=>{u(e);}),true);for(let e of v)R(e,d,(e=>{u(e,[]);}),true);},$=(e,t)=>{e&&(t&&(e.tabIndex=-1),e.focus(),t&&e.removeAttribute('tabindex'));},z=(e,t)=>{const o=n=>{n.target.removeEventListener('transitionend',o),'opacity'===n.propertyName&&'1'===getComputedStyle(e).opacity&&$((e=>1===e?m.ne.be:m.ne.ve)(t));};R(e,'transitionend',o);};let q;const K=e=>{clearTimeout(q),e?V(m.ne.ye,a):q=setTimeout((()=>{j(m.ne.ye,a);}),500);},Q=['M 19.5 4.5 L 4.5 19.5 M 4.5 4.501 L 19.5 19.5','M 3.572 13.406 L 8.281 18.115 L 20.428 5.885','M 21.999 6.94 L 11.639 17.18 L 2.001 6.82 '],W=(e=0,t=1.5)=>`<svg viewBox="0 0 24 24" stroke-width="${t}"><path d="${Q[e]}"/></svg>`,X=e=>{const t=m.ne,o=m.o;(e=>{const n=e===t.he,a=o.i.disablePageInteraction?t.ye:n?t.Ce:t.ye;R(a,'keydown',(t=>{if('Tab'!==t.key||!(n?o.k&&!o.A:o.A))return;const a=x(),s=n?o.q:o.K;0!==s.length&&(t.shiftKey?a!==s[0]&&e.contains(a)||(M(t),$(s[1])):a!==s[1]&&e.contains(a)||(M(t),$(s[0])));}),true);})(e);},Y=['[href]',r,'input','details','[tabindex]'].map((e=>e+':not([tabindex="-1"])')).join(','),Z=e=>{const{o:t,ne:o}=m,n=(e,t)=>{const o=D(e,Y);t[0]=o[0],t[1]=o[o.length-1];};1===e&&t.T&&n(o.he,t.q),2===e&&t.N&&n(o.we,t.K);},ee=(e,t,o)=>{const{de:n,le:a,ie:s,_e:c,ue:r,fe:i}=m.ce,l=m.re;if(t){const n={modalName:t};return e===l.fe?C(i)&&i(n):e===l._e?C(c)&&c(n):(n.modal=o,C(r)&&r(n)),O(e,n)}const d={cookie:m.o.p};e===l.ie?C(s)&&s(F(d)):e===l.le?C(a)&&a(F(d)):(d.changedCategories=m.o.L,d.changedServices=m.o.ee,C(n)&&n(F(d))),O(e,F(d));},te=(e,t)=>{try{return e()}catch(e){return !t&&console.warn('CookieConsent:',e),false}},oe=e=>{const{Y:t,ee:o,O:n,X:a,oe:c,p:r,L:i}=m.o;for(const e of n){const n=o[e]||t[e]||[];for(const o of n){const n=a[e][o];if(!n)continue;const{onAccept:s,onReject:c}=n;!n.Se&&b(t[e],o)?(n.Se=true,C(s)&&s()):n.Se&&!b(t[e],o)&&(n.Se=false,C(c)&&c());}}if(!m.t.manageScriptTags)return;const l=c,d=e||r.categories||[],f=(e,n)=>{if(n>=e.length)return;const a=c[n];if(a.xe)return f(e,n+1);const r=a.Me,l=a.De,_=a.Te,u=b(d,l),p=!!_&&b(t[l],_);if(!_&&!a.ke&&u||!_&&a.ke&&!u&&b(i,l)||_&&!a.ke&&p||_&&a.ke&&!p&&b(o[l]||[],_)){a.xe=true;const t=N(r,'type',true);A(r,'type',!!t),A(r,s);let o=N(r,'src',true);o&&A(r,'src',true);const c=k('script');c.textContent=r.innerHTML;for(const{nodeName:e}of r.attributes)E(c,e,r[e]||N(r,e));t&&(c.type=t),o?c.src=o:o=r.src;const i=!!o&&(!t||['text/javascript','module'].includes(t));if(i&&(c.onload=c.onerror=()=>{f(e,++n);}),r.replaceWith(c),i)return}f(e,++n);};f(l,0);},ne='bottom',ae='left',se='center',ce='right',re='inline',ie='wide',le='pm--',de=['middle','top',ne],fe=[ae,se,ce],_e={box:{Ee:[ie,re],Ae:de,Ne:fe,He:ne,Ve:ce},cloud:{Ee:[re],Ae:de,Ne:fe,He:ne,Ve:se},bar:{Ee:[re],Ae:de.slice(1),Ne:[],He:ne,Ve:''}},ue={box:{Ee:[],Ae:[],Ne:[],He:'',Ve:''},bar:{Ee:[ie],Ae:[],Ne:[ae,ce],He:'',Ve:ae}},pe=e=>{const t=m.o.i.guiOptions,o=t&&t.consentModal,n=t&&t.preferencesModal;0===e&&me(m.ne.he,_e,o,'cm--','box','cm'),1===e&&me(m.ne.we,ue,n,le,'box','pm');},me=(e,t,o,n,a,s)=>{e.className=s;const c=o&&o.layout,r=o&&o.position,i=o&&o.flipButtons,l=!o||false!==o.equalWeightButtons,d=c&&c.split(' ')||[],f=d[0],_=d[1],u=f in t?f:a,p=t[u],g=b(p.Ee,_)&&_,v=r&&r.split(' ')||[],y=v[0],h=n===le?v[0]:v[1],C=b(p.Ae,y)?y:p.He,w=b(p.Ne,h)?h:p.Ve,S=t=>{t&&V(e,n+t);};S(u),S(g),S(C),S(w),i&&S('flip');const x=s+'__btn--secondary';if('cm'===s){const{Ie:e,Le:t}=m.ne;e&&(l?j(e,x):V(e,x)),t&&(l?j(t,x):V(t,x));}else {const{je:e}=m.ne;e&&(l?j(e,x):V(e,x));}},ge=(e,t)=>{const o=m.o,n=m.ne,{hide:a,hidePreferences:s,acceptCategory:_}=e,p=e=>{_(e),s(),a();},g=o.u&&o.u.preferencesModal;if(!g)return;const b=g.title,v=g.closeIconLabel,C=g.acceptAllBtn,S=g.acceptNecessaryBtn,x=g.savePreferencesBtn,M=g.sections||[],D=C||S||x;if(n.Fe)n.Pe=k(c),L(n.Pe,'body');else {n.Fe=k(c),V(n.Fe,'pm-wrapper');const e=k('div');V(e,'pm-overlay'),H(n.Fe,e),R(e,d,s),n.we=k(c),V(n.we,'pm'),E(n.we,'role','dialog'),E(n.we,i,true),E(n.we,'aria-modal',true),E(n.we,'aria-labelledby','pm__title'),R(n.ye,'keydown',(e=>{27===e.keyCode&&s();}),true),n.Oe=k(c),L(n.Oe,'header'),n.Re=k('h2'),L(n.Re,'title'),n.Re.id='pm__title',n.Be=k(r),L(n.Be,'close-btn'),E(n.Be,'aria-label',g.closeIconLabel||''),R(n.Be,d,s),n.Ge=k('span'),n.Ge.innerHTML=W(),H(n.Be,n.Ge),n.Je=k(c),L(n.Je,'body'),n.Ue=k(c),L(n.Ue,'footer');var T=k(c);V(T,'btns');var A=k(c),N=k(c);L(A,l),L(N,l),H(n.Ue,A),H(n.Ue,N),H(n.Oe,n.Re),H(n.Oe,n.Be),n.ve=k(c),E(n.ve,'tabIndex',-1),H(n.we,n.ve),H(n.we,n.Oe),H(n.we,n.Je),D&&H(n.we,n.Ue),H(n.Fe,n.we);}let I;b&&(n.Re.innerHTML=b,v&&E(n.Be,'aria-label',v)),M.forEach(((e,t)=>{const a=e.title,s=e.description,l=e.linkedCategory,f=l&&o.P[l],_=e.cookieTable,u=_&&_.body,p=_&&_.caption,m=u&&u.length>0,b=!!f,v=b&&o.X[l],C=h(v)&&w(v)||[],S=b&&(!!s||!!m||w(v).length>0);var x=k(c);if(L(x,'section'),S||s){var M=k(c);L(M,'section-desc-wrapper');}let D=C.length;if(S&&D>0){const e=k(c);L(e,'section-services');for(const t of C){const o=v[t],n=o&&o.label||t,a=k(c),s=k(c),r=k(c),i=k(c);L(a,'service'),L(i,'service-title'),L(s,'service-header'),L(r,'service-icon');const d=be(n,t,f,true,l);i.innerHTML=n,H(s,r),H(s,i),H(a,s),H(a,d),H(e,a);}H(M,e);}if(a){var T=k(c),A=k(b?r:c);if(L(T,'section-title-wrapper'),L(A,'section-title'),A.innerHTML=a,H(T,A),b){const e=k('span');e.innerHTML=W(2,3.5),L(e,'section-arrow'),H(T,e),x.className+='--toggle';const t=be(a,l,f);let o=g.serviceCounterLabel;if(D>0&&y(o)){let e=k('span');L(e,'badge'),L(e,'service-counter'),E(e,i,true),E(e,'data-servicecounter',D),o&&(o=o.split('|'),o=o.length>1&&D>1?o[1]:o[0],E(e,'data-counterlabel',o)),e.innerHTML=D+(o?' '+o:''),H(A,e);}if(S){L(x,'section--expandable');var N=l+'-desc';E(A,'aria-expanded',false),E(A,'aria-controls',N);}H(T,t);}else E(A,'role','heading'),E(A,'aria-level','3');H(x,T);}if(s){var F=k('p');L(F,'section-desc'),F.innerHTML=s,H(M,F);}if(S&&(E(M,i,'true'),M.id=N,((e,t,o)=>{R(A,d,(()=>{t.classList.contains('is-expanded')?(j(t,'is-expanded'),E(o,'aria-expanded','false'),E(e,i,'true')):(V(t,'is-expanded'),E(o,'aria-expanded','true'),E(e,i,'false'));}));})(M,x,A),m)){const e=k('table'),o=k('thead'),a=k('tbody');if(p){const t=k('caption');L(t,'table-caption'),t.innerHTML=p,e.appendChild(t);}L(e,'section-table'),L(o,'table-head'),L(a,'table-body');const s=_.headers,r=w(s),i=n.$e.createDocumentFragment(),l=k('tr');for(const e of r){const o=s[e],n=k('th');n.id='cc__row-'+o+t,E(n,'scope','col'),L(n,'table-th'),n.innerHTML=o,H(i,n);}H(l,i),H(o,l);const d=n.$e.createDocumentFragment();for(const e of u){const o=k('tr');L(o,'table-tr');for(const n of r){const a=s[n],r=e[n],i=k('td'),l=k(c);L(i,'table-td'),E(i,'data-column',a),E(i,'headers','cc__row-'+a+t),l.insertAdjacentHTML('beforeend',r),H(i,l),H(o,i);}H(d,o);}H(a,d),H(e,o),H(e,a),H(M,e);}(S||s)&&H(x,M);const P=n.Pe||n.Je;b?(I||(I=k(c),L(I,'section-toggles')),I.appendChild(x)):I=null,H(P,I||x);})),C&&(n.ze||(n.ze=k(r),L(n.ze,'btn'),E(n.ze,f,'all'),H(A,n.ze),R(n.ze,d,(()=>p('all')))),n.ze.innerHTML=C),S&&(n.je||(n.je=k(r),L(n.je,'btn'),E(n.je,f,'necessary'),H(A,n.je),R(n.je,d,(()=>p([])))),n.je.innerHTML=S),x&&(n.qe||(n.qe=k(r),L(n.qe,'btn'),L(n.qe,'btn--secondary'),E(n.qe,f,'save'),H(N,n.qe),R(n.qe,d,(()=>p()))),n.qe.innerHTML=x),n.Pe&&(n.we.replaceChild(n.Pe,n.Je),n.Je=n.Pe),pe(1),o.N||(o.N=true,ee(m.re.ue,u,n.we),t(e),H(n.Ce,n.Fe),X(n.we),setTimeout((()=>V(n.Fe,'cc--anim')),100)),Z(2);};function be(e,t,o,n,a){const c=m.o,r=m.ne,l=k('label'),f=k('input'),_=k('span'),u=k('span'),p=k('span'),g=k('span'),v=k('span');if(g.innerHTML=W(1,3),v.innerHTML=W(0,3),f.type='checkbox',V(l,'section__toggle-wrapper'),V(f,'section__toggle'),V(g,'toggle__icon-on'),V(v,'toggle__icon-off'),V(_,'toggle__icon'),V(u,'toggle__icon-circle'),V(p,'toggle__label'),E(_,i,'true'),n?(V(l,'toggle-service'),E(f,s,a),r.se[a][t]=f):r.ae[t]=f,n?(e=>{R(f,'change',(()=>{const t=r.se[e],o=r.ae[e];c.Z[e]=[];for(let o in t){const n=t[o];n.checked&&c.Z[e].push(n.value);}o.checked=c.Z[e].length>0;}));})(a):(e=>{R(f,d,(()=>{const t=r.se[e],o=f.checked;c.Z[e]=[];for(let n in t)t[n].checked=o,o&&c.Z[e].push(n);}));})(t),f.value=t,p.textContent=e.replace(/<.*>.*<\/.*>/gm,''),H(u,v),H(u,g),H(_,u),c.D)(o.readOnly||o.enabled)&&(f.checked=true);else if(n){const e=c.Y[a];f.checked=o.readOnly||b(e,t);}else b(c.R,t)&&(f.checked=true);return o.readOnly&&(f.disabled=true),H(l,f),H(l,_),H(l,p),l}const ve=()=>{const e=k('span');return m.ne.Ke||(m.ne.Ke=e),e},ye=(e,t)=>{const o=m.o,n=m.ne,{hide:a,showPreferences:s,acceptCategory:u}=e,p=o.u&&o.u.consentModal;if(!p)return;const g=p.acceptAllBtn,b=p.acceptNecessaryBtn,v=p.showPreferencesBtn,y=p.closeIconLabel,h=p.footer,C=p.label,w=p.title,S=e=>{a(),u(e);};if(!n.Qe){n.Qe=k(c),n.he=k(c),n.We=k(c),n.Xe=k(c),n.Ye=k(c),V(n.Qe,'cm-wrapper'),V(n.he,'cm'),I(n.We,'body'),I(n.Xe,'texts'),I(n.Ye,'btns'),E(n.he,'role','dialog'),E(n.he,'aria-modal','true'),E(n.he,i,'false'),E(n.he,'aria-describedby','cm__desc'),C?E(n.he,'aria-label',C):w&&E(n.he,'aria-labelledby','cm__title');const e='box',t=o.i.guiOptions,a=t&&t.consentModal,s=(a&&a.layout||e).split(' ')[0]===e;w&&y&&s&&(n.Le||(n.Le=k(r),n.Le.innerHTML=W(),I(n.Le,'btn'),I(n.Le,'btn--close'),R(n.Le,d,(()=>{S([]);})),H(n.We,n.Le)),E(n.Le,'aria-label',y)),H(n.We,n.Xe),(g||b||v)&&H(n.We,n.Ye),n.be=k(c),E(n.be,'tabIndex',-1),H(n.he,n.be),H(n.he,n.We),H(n.Qe,n.he);}w&&(n.Ze||(n.Ze=k('h2'),n.Ze.className=n.Ze.id='cm__title',H(n.Xe,n.Ze)),n.Ze.innerHTML=w);let x=p.description;if(x&&(o.V&&(x=x.replace('{{revisionMessage}}',o.I?'':p.revisionMessage||'')),n.et||(n.et=k('p'),n.et.className=n.et.id='cm__desc',H(n.Xe,n.et)),n.et.innerHTML=x),g&&(n.tt||(n.tt=k(r),H(n.tt,ve()),I(n.tt,'btn'),E(n.tt,f,'all'),R(n.tt,d,(()=>{S('all');}))),n.tt.firstElementChild.innerHTML=g),b&&(n.Ie||(n.Ie=k(r),H(n.Ie,ve()),I(n.Ie,'btn'),E(n.Ie,f,'necessary'),R(n.Ie,d,(()=>{S([]);}))),n.Ie.firstElementChild.innerHTML=b),v&&(n.ot||(n.ot=k(r),H(n.ot,ve()),I(n.ot,'btn'),I(n.ot,'btn--secondary'),E(n.ot,f,'show'),R(n.ot,'mouseenter',(()=>{o.N||ge(e,t);})),R(n.ot,d,s)),n.ot.firstElementChild.innerHTML=v),n.nt||(n.nt=k(c),I(n.nt,l),g&&H(n.nt,n.tt),b&&H(n.nt,n.Ie),(g||b)&&H(n.We,n.nt),H(n.Ye,n.nt)),n.ot&&!n.st&&(n.st=k(c),n.Ie&&n.tt?(I(n.st,l),H(n.st,n.ot),H(n.Ye,n.st)):(H(n.nt,n.ot),I(n.nt,l+'--uneven'))),h){if(!n.ct){let e=k(c),t=k(c);n.ct=k(c),I(e,'footer'),I(t,'links'),I(n.ct,'link-group'),H(t,n.ct),H(e,t),H(n.he,e);}n.ct.innerHTML=h;}pe(0),o.T||(o.T=true,ee(m.re.ue,_,n.he),t(e),H(n.Ce,n.Qe),X(n.he),setTimeout((()=>V(n.Qe,'cc--anim')),100)),Z(1),U(n.We,e,ge,t);},he=e=>{if(!y(e))return null;if(e in m.o._)return e;let t=e.slice(0,2);return t in m.o._?t:null},Ce=()=>m.o.l||m.o.i.language.default,we=e=>{e&&(m.o.l=e);},Se=async e=>{const t=m.o;let o=he(e)?e:Ce(),n=t._[o];return y(n)?n=await(async e=>{try{const t=await fetch(e);return await t.json()}catch(e){return console.error(e),false}})(n):C(n)&&(n=await n()),!!n&&(t.u=n,we(o),true)},xe=()=>{let e=m.o.i.language.rtl,t=m.ne.Ce;e&&t&&(v(e)||(e=[e]),b(e,m.o.l)?V(t,'cc--rtl'):j(t,'cc--rtl'));},Me=()=>{const e=m.ne;if(e.Ce)return;e.Ce=k(c),e.Ce.id='cc-main',e.Ce.setAttribute('data-nosnippet',''),xe();let t=m.o.i.root;t&&y(t)&&(t=document.querySelector(t)),(t||e.$e.body).appendChild(e.Ce);},De=e=>te((()=>localStorage.removeItem(e))),Te=(e,t)=>{if(t instanceof RegExp)return e.filter((e=>t.test(e)));{const o=g(e,t);return o>-1?[e[o]]:[]}},ke=e=>{const{hostname:t,protocol:o}=location,{name:n,path:a,domain:s,sameSite:c,useLocalStorage:r}=m.t.cookie,i=864e5*B(),l=new Date;l.setTime(l.getTime()+i),m.o.p.expirationTime=l.getTime();const d=JSON.stringify(m.o.p);let f=n+'='+encodeURIComponent(d)+(0!==i?'; expires='+l.toUTCString():'')+'; Path='+a+'; SameSite='+c;b(t,'.')&&(f+='; Domain='+s),'https:'===o&&(f+='; Secure'),r?((e,t)=>{te((()=>localStorage.setItem(e,t)));})(n,d):document.cookie=f,m.o.p;},Ee=(e,t,o)=>{if(0===e.length)return;const n=o||m.t.cookie.domain,a=t||m.t.cookie.path,s='www.'===n.slice(0,4),c=s&&n.substring(4),r=(e,t)=>{document.cookie=e+'=; path='+a+(t?'; domain=.'+t:'')+'; expires=Thu, 01 Jan 1970 00:00:01 GMT;';};for(const t of e)r(t),r(t,n),s&&r(t,c);},Ae=e=>{const t=m.t.cookie.name,o=m.t.cookie.useLocalStorage;return ((e,t)=>{let o;return o=te((()=>JSON.parse(t?e:decodeURIComponent(e))),true)||{},o})(o?(n=t,te((()=>localStorage.getItem(n)))||''):Ne(t),o);var n;},Ne=(e,t)=>{const o=document.cookie.match('(^|;)\\s*'+e+'\\s*=\\s*([^;]+)');return o?o.pop():''},He=e=>{const t=document.cookie.split(/;\s*/),o=[];for(const n of t){let t=n.split('=')[0];o.push(t);}return o},Ve=(o,n=[])=>{((e,t)=>{const{O:o,R:n,B:a,N:s,Z:c,G:r,X:i}=m.o;let l=[];if(e){v(e)?l.push(...e):y(e)&&(l='all'===e?o:[e]);for(const e of o)c[e]=b(l,e)?w(i[e]):[];}else l=[...n,...r],s&&(l=(()=>{const e=m.ne.ae;if(!e)return [];let t=[];for(let o in e)e[o].checked&&t.push(o);return t})());l=l.filter((e=>!b(o,e)||!b(t,e))),l.push(...a),J(l);})(o,n),(e=>{const t=m.o,{Z:o,B:n,Y:a,X:s,O:c}=t,r=c;t.te=F(a);for(const e of r){const c=s[e],r=w(c),i=o[e]&&o[e].length>0,l=b(n,e);if(0!==r.length){if(a[e]=[],l)a[e].push(...r);else if(i){const t=o[e];a[e].push(...t);}else a[e]=t.Z[e];a[e]=S(a[e]);}}})(),(()=>{const o=m.o;o.L=m.t.mode===t&&o.D?G(o.G,o.R):G(o.R,o.p.categories);let n=o.L.length>0,a=false;for(const e of o.O)o.ee[e]=G(o.Y[e],o.te[e]),o.ee[e].length>0&&(a=true);const s=m.ne.ae;for(const e in s)s[e].checked=b(o.R,e);for(const e of o.O){const t=m.ne.se[e],n=o.Y[e];for(const e in t)t[e].checked=b(n,e);}o.C||(o.C=new Date),o.M||(o.M=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))),o.p={categories:F(o.R),revision:m.t.revision,data:o.h,consentTimestamp:o.C.toISOString(),consentId:o.M,services:F(o.Y)};let c=false;const r=n||a;(o.D||r)&&(o.D&&(o.D=false,c=true),o.S=o.S?new Date:o.C,o.p.lastConsentTimestamp=o.S.toISOString(),ke(),m.t.autoClearCookies&&(c||r)&&(e=>{const t=m.o,o=He(),n=(e=>{const t=m.o;return (e?t.O:t.L).filter((e=>{const o=t.P[e];return !!o&&!o.readOnly&&!!o.autoClear}))})(e);for(const e in t.ee)for(const n of t.ee[e]){const a=t.X[e][n].cookies;if(!b(t.Y[e],n)&&a)for(const e of a){const t=Te(o,e.name);Ee(t,e.path,e.domain);}}for(const a of n){const n=t.P[a].autoClear,s=n&&n.cookies||[],c=b(t.L,a),r=!b(t.R,a),i=c&&r;if(e?r:i){n.reloadPage&&i&&(t.j=true);for(const e of s){const t=Te(o,e.name);Ee(t,e.path,e.domain);}}}})(c),oe()),c&&(ee(m.re.ie),ee(m.re.le),m.t.mode===e)||(r&&ee(m.re.de),o.j&&(o.j=false,location.reload()));})();},Ie=e=>{const t=m.o.D?[]:m.o.R;return b(t,e)},je=(e,t)=>{const o=m.o.D?[]:m.o.Y[t]||[];return b(o,e)},Oe=e=>{const{ne:t,o:n}=m;if(!n.k){if(!n.T){if(!e)return;ye(Je,Me);}n.k=true,n.U=x(),n.v&&K(true),z(t.he,1),V(t.ye,o),E(t.he,i,'false'),setTimeout((()=>{$(m.ne.be);}),100),ee(m.re.fe,_);}},Re=()=>{const{ne:e,o:t,re:n}=m;t.k&&(t.k=false,t.v&&K(),$(e.Ke,true),j(e.ye,o),E(e.he,i,'true'),$(t.U),t.U=null,ee(n._e,_));},Be=()=>{const e=m.o;e.A||(e.N||ge(Je,Me),e.A=true,e.k?e.$=x():e.U=x(),z(m.ne.we,2),V(m.ne.ye,n),E(m.ne.we,i,'false'),setTimeout((()=>{$(m.ne.ve);}),100),ee(m.re.fe,u));},Ge=()=>{const e=m.o;e.A&&(e.A=false,(()=>{const e=We(),t=m.o.P,o=m.ne.ae,n=m.ne.se,a=e=>b(m.o.G,e);for(const s in o){const c=!!t[s].readOnly;o[s].checked=c||(e?Ie(s):a(s));for(const t in n[s])n[s][t].checked=c||(e?je(t,s):a(s));}})(),$(m.ne.Ge,true),j(m.ne.ye,n),E(m.ne.we,i,'true'),e.k?($(e.$),e.$=null):($(e.U),e.U=null),ee(m.re._e,u));};var Je={show:Oe,hide:Re,showPreferences:Be,hidePreferences:Ge,acceptCategory:Ve};const We=()=>!m.o.D,Xe=async e=>{const{o:o,t:n,re:a}=m,c=window;if(!c._ccRun){if(c._ccRun=true,(e=>{const{ne:o,t:n,o:a}=m,c=n,r=a,{cookie:i}=c,l=m.ce,d=e.cookie,f=e.categories,_=w(f)||[],u=navigator,p=document;o.$e=p,o.ye=p.documentElement,i.domain=location.hostname,r.i=e,r.P=f,r.O=_,r._=e.language.translations,r.v=!!e.disablePageInteraction,l.ie=e.onFirstConsent,l.le=e.onConsent,l.de=e.onChange,l._e=e.onModalHide,l.fe=e.onModalShow,l.ue=e.onModalReady;const{mode:g,autoShow:v,lazyHtmlGeneration:y,autoClearCookies:C,revision:S,manageScriptTags:x,hideFromBots:M}=e;g===t&&(c.mode=g),'boolean'==typeof C&&(c.autoClearCookies=C),'boolean'==typeof x&&(c.manageScriptTags=x),'number'==typeof S&&S>=0&&(c.revision=S,r.V=true),'boolean'==typeof v&&(c.autoShow=v),'boolean'==typeof y&&(c.lazyHtmlGeneration=y),false===M&&(c.hideFromBots=false),true===c.hideFromBots&&u&&(r.J=u.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(u.userAgent)||u.webdriver),h(d)&&(c.cookie={...i,...d}),c.autoClearCookies,r.V,c.manageScriptTags,(e=>{const{P:t,X:o,Y:n,Z:a,B:s}=m.o;for(let c of e){const e=t[c],r=e.services||{},i=h(r)&&w(r)||[];o[c]={},n[c]=[],a[c]=[],e.readOnly&&(s.push(c),n[c]=i),m.ne.se[c]={};for(let e of i){const t=r[e];t.Se=false,o[c][e]=t;}}})(_),(()=>{if(!m.t.manageScriptTags)return;const e=m.o,t=D(document,'script['+s+']');for(const o of t){let t=N(o,s),n=o.dataset.service||'',a=false;if(t&&'!'===t.charAt(0)&&(t=t.slice(1),a=true),'!'===n.charAt(0)&&(n=n.slice(1),a=true),b(e.O,t)&&(e.oe.push({Me:o,xe:false,ke:a,De:t,Te:n}),n)){const o=e.X[t];o[n]||(o[n]={Se:false});}}})(),we((()=>{const e=m.o.i.language.autoDetect;if(e){const t={browser:navigator.language,document:document.documentElement.lang},o=he(t[e]);if(o)return o}return Ce()})());})(e),o.J)return;(()=>{const e=m.o,o=m.t,n=Ae(),{categories:a,services:s,consentId:c,consentTimestamp:r,lastConsentTimestamp:i,data:l,revision:d}=n,f=v(a);e.p=n,e.M=c;const _=!!c&&y(c);e.C=r,e.C&&(e.C=new Date(r)),e.S=i,e.S&&(e.S=new Date(i)),e.h=undefined!==l?l:null,e.V&&_&&d!==o.revision&&(e.I=false),e.D=!(_&&e.I&&e.C&&e.S&&f),o.cookie.useLocalStorage&&!e.D&&(e.D=(new Date).getTime()>(n.expirationTime||0),e.D&&De(o.cookie.name)),e.D,(()=>{const e=m.o;for(const o of e.O){const n=e.P[o];if(n.readOnly||n.enabled){e.G.push(o);const n=e.X[o]||{};for(let a in n)e.Z[o].push(a),e.i.mode===t&&e.Y[o].push(a);}}})(),e.D?o.mode===t&&(e.R=[...e.G]):(e.Z={...e.Y},e.Y={...e.Y,...s},J([...e.B,...a]));})();const i=We();if(!await Se())return false;if(U(null,r=Je,ge,Me),m.o.D&&ye(r,Me),m.t.lazyHtmlGeneration||ge(r,Me),n.autoShow&&!i&&Oe(true),i)return oe(),ee(a.le);n.mode===t&&oe(o.G);}var r;};
|
|
12189
12188
|
|
|
12190
12189
|
const cookieDomain = getDomain();
|
|
12191
|
-
const getCookieBannerConfig = (lng) => ({
|
|
12190
|
+
const getCookieBannerConfig = (lng, isClearly) => ({
|
|
12192
12191
|
language: {
|
|
12193
12192
|
default: lng,
|
|
12194
|
-
translations,
|
|
12193
|
+
translations: getTranslations(isClearly),
|
|
12195
12194
|
},
|
|
12196
12195
|
cookie: {
|
|
12197
12196
|
domain: cookieDomain,
|
|
@@ -12209,7 +12208,7 @@ const getCookieBannerConfig = (lng) => ({
|
|
|
12209
12208
|
ga: {
|
|
12210
12209
|
label: "Google Analytics",
|
|
12211
12210
|
onAccept: () => {
|
|
12212
|
-
gtag("consent", "
|
|
12211
|
+
gtag("consent", "update", {
|
|
12213
12212
|
ad_storage: "granted",
|
|
12214
12213
|
ad_user_data: "granted",
|
|
12215
12214
|
ad_personalization: "granted",
|
|
@@ -12217,11 +12216,11 @@ const getCookieBannerConfig = (lng) => ({
|
|
|
12217
12216
|
});
|
|
12218
12217
|
},
|
|
12219
12218
|
onReject: () => {
|
|
12220
|
-
gtag("consent", "
|
|
12221
|
-
ad_storage: "
|
|
12222
|
-
ad_user_data: "
|
|
12223
|
-
ad_personalization: "
|
|
12224
|
-
analytics_storage: "
|
|
12219
|
+
gtag("consent", "update", {
|
|
12220
|
+
ad_storage: "granted",
|
|
12221
|
+
ad_user_data: "granted",
|
|
12222
|
+
ad_personalization: "granted",
|
|
12223
|
+
analytics_storage: "granted",
|
|
12225
12224
|
});
|
|
12226
12225
|
},
|
|
12227
12226
|
},
|
|
@@ -12229,7 +12228,7 @@ const getCookieBannerConfig = (lng) => ({
|
|
|
12229
12228
|
},
|
|
12230
12229
|
},
|
|
12231
12230
|
});
|
|
12232
|
-
const
|
|
12231
|
+
const getTranslations = (isClearly) => ({
|
|
12233
12232
|
en: {
|
|
12234
12233
|
consentModal: {
|
|
12235
12234
|
title: "We use cookies",
|
|
@@ -12261,7 +12260,7 @@ const translations = {
|
|
|
12261
12260
|
},
|
|
12262
12261
|
{
|
|
12263
12262
|
title: "More information",
|
|
12264
|
-
description: `For any queries in relation to our policy on cookies and your choices, please <a href="mailto:${isClearly
|
|
12263
|
+
description: `For any queries in relation to our policy on cookies and your choices, please <a href="mailto:${isClearly ? "hello@clearly.help" : "hello@rozmova.me"}">contact us</a>`,
|
|
12265
12264
|
},
|
|
12266
12265
|
],
|
|
12267
12266
|
},
|
|
@@ -12297,7 +12296,7 @@ const translations = {
|
|
|
12297
12296
|
},
|
|
12298
12297
|
{
|
|
12299
12298
|
title: "Więcej informacji",
|
|
12300
|
-
description: `W przypadku pytań dotyczących naszej polityki plików cookie i Twoich wyborów, prosimy <a href="mailto:${isClearly
|
|
12299
|
+
description: `W przypadku pytań dotyczących naszej polityki plików cookie i Twoich wyborów, prosimy <a href="mailto:${isClearly ? "hello@clearly.help" : "hello@rozmova.me"}">skontaktować się z nami</a>.`,
|
|
12301
12300
|
},
|
|
12302
12301
|
],
|
|
12303
12302
|
},
|
|
@@ -12333,7 +12332,7 @@ const translations = {
|
|
|
12333
12332
|
},
|
|
12334
12333
|
{
|
|
12335
12334
|
title: "Más información",
|
|
12336
|
-
description: `Para cualquier consulta sobre nuestra política de cookies y tus elecciones, por favor <a href="mailto:${isClearly
|
|
12335
|
+
description: `Para cualquier consulta sobre nuestra política de cookies y tus elecciones, por favor <a href="mailto:${isClearly ? "hello@clearly.help" : "hello@rozmova.me"}">contáctanos</a>.`,
|
|
12337
12336
|
},
|
|
12338
12337
|
],
|
|
12339
12338
|
},
|
|
@@ -12369,13 +12368,13 @@ const translations = {
|
|
|
12369
12368
|
},
|
|
12370
12369
|
{
|
|
12371
12370
|
title: "Додаткова інформація",
|
|
12372
|
-
description: `Якщо у вас є запитання щодо нашої політики використання файлів cookie та ваших налаштувань, будь ласка, <a href="mailto:${isClearly
|
|
12371
|
+
description: `Якщо у вас є запитання щодо нашої політики використання файлів cookie та ваших налаштувань, будь ласка, <a href="mailto:${isClearly ? "hello@clearly.help" : "hello@rozmova.me"}">зв'яжіться з нами</a>.`,
|
|
12373
12372
|
},
|
|
12374
12373
|
],
|
|
12375
12374
|
},
|
|
12376
12375
|
},
|
|
12377
|
-
};
|
|
12378
|
-
const initCookieConsentBanner = (lng) => {
|
|
12376
|
+
});
|
|
12377
|
+
const initCookieConsentBanner = (lng, isClearly) => {
|
|
12379
12378
|
// CDN styles
|
|
12380
12379
|
const remoteStyle = document.createElement("link");
|
|
12381
12380
|
remoteStyle.rel = "stylesheet";
|
|
@@ -12395,7 +12394,7 @@ const initCookieConsentBanner = (lng) => {
|
|
|
12395
12394
|
}
|
|
12396
12395
|
`;
|
|
12397
12396
|
document.head.appendChild(style);
|
|
12398
|
-
Xe(getCookieBannerConfig(lng));
|
|
12397
|
+
Xe(getCookieBannerConfig(lng, isClearly));
|
|
12399
12398
|
};
|
|
12400
12399
|
|
|
12401
12400
|
class Analytics {
|
|
@@ -12403,7 +12402,7 @@ class Analytics {
|
|
|
12403
12402
|
locale = "uk";
|
|
12404
12403
|
platform = "web";
|
|
12405
12404
|
dataLayer = [];
|
|
12406
|
-
init(locale, platform) {
|
|
12405
|
+
init({ locale, platform, isClearly, } = {}) {
|
|
12407
12406
|
if (this.initialized)
|
|
12408
12407
|
return;
|
|
12409
12408
|
insertCustomerIOScript();
|
|
@@ -12415,11 +12414,11 @@ class Analytics {
|
|
|
12415
12414
|
if (locale)
|
|
12416
12415
|
this.locale = locale;
|
|
12417
12416
|
else
|
|
12418
|
-
this.locale = getLocaleFromURL();
|
|
12417
|
+
this.locale = getLocaleFromURL(isClearly);
|
|
12419
12418
|
if (platform)
|
|
12420
12419
|
this.platform = platform;
|
|
12421
|
-
if (this.platform === "web" && isClearly
|
|
12422
|
-
initCookieConsentBanner(this.locale);
|
|
12420
|
+
if (this.platform === "web" && isClearly)
|
|
12421
|
+
initCookieConsentBanner(this.locale, isClearly);
|
|
12423
12422
|
mixpanel.init(MIXPANEL_TOKEN, {
|
|
12424
12423
|
debug: false,
|
|
12425
12424
|
track_pageview: "url-with-path",
|