countly-sdk-web
Version:
Countly Web SDK
98 lines • 132 kB
JavaScript
/*
regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
(function(ab,xb){"object"===typeof exports&&"undefined"!==typeof module?xb(exports):"function"===typeof define&&define.amd?define(["exports"],xb):(ab="undefined"!==typeof globalThis?globalThis:ab||self,xb(ab.Countly=ab.Countly||{}))})(this,function(ab){function xb(p,r,v){if("function"==typeof p?p===r:p.has(r))return 3>arguments.length?r:v;throw new TypeError("Private element is not present on this object");}function zd(p,r,v,a,E,h,t){try{var c=p[h](t),d=c.value}catch(g){return void v(g)}c.done?r(d):
Promise.resolve(d).then(a,E)}function Xc(p){return function(){var r=this,v=arguments;return new Promise(function(a,E){function h(d){zd(c,a,E,h,t,"next",d)}function t(d){zd(c,a,E,h,t,"throw",d)}var c=p.apply(r,v);h(void 0)})}}function b(p,r){return p.get(xb(p,r))}function q(p,r,v){if(r.has(p))throw new TypeError("Cannot initialize the same private elements twice on an object");r.set(p,v)}function l(p,r,v){return p.set(xb(p,r),v),v}function Ad(p,r){for(var v=0;v<r.length;v++){var a=r[v];a.enumerable=
a.enumerable||!1;a.configurable=!0;"value"in a&&(a.writable=!0);Object.defineProperty(p,Bd(a.key),a)}}function y(p,r,v){return(r=Bd(r))in p?Object.defineProperty(p,r,{value:v,enumerable:!0,configurable:!0,writable:!0}):p[r]=v,p}function bb(){function p(m,u,x,C){u=Object.create((u&&u.prototype instanceof r?u:r).prototype);return ma(u,"_invoke",function(G,R,X){function J(A,N){K=A;aa=N;for(k=0;!W&&ia&&!ra&&k<Ha.length;k++){var ra,na=Ha[k],Yc=ba.p,jc=na[2];3<A?(ra=jc===N)&&(aa=na[(K=na[4])?5:(K=3,3)],
na[4]=na[5]=h):na[0]<=Yc&&((ra=2>A&&Yc<na[1])?(K=0,ba.v=N,ba.n=na[1]):Yc<jc&&(ra=3>A||na[0]>N||N>jc)&&(na[4]=A,na[5]=N,ba.n=jc,K=0))}if(ra||1<A)return g;throw W=!0,N;}var S,K,aa,ia=0,Ha=X||[],W=!1,ba={p:0,n:0,v:h,a:J,f:J.bind(h,4),d:function(A,N){return S=A,K=0,aa=h,ba.n=N,g}};return function(A,N,ra){if(1<ia)throw TypeError("Generator is already running");W&&1===N&&J(N,ra);K=N;for(aa=ra;(k=2>K?h:aa)||!W;){S||(K?3>K?(1<K&&(ba.n=-1),J(K,aa)):ba.n=aa:ba.v=aa);try{if(ia=2,S){if(K||(A="next"),k=S[A]){if(!(k=
k.call(S,aa)))throw TypeError("iterator result is not an object");if(!k.done)return k;aa=k.value;2>K&&(K=0)}else 1===K&&(k=S.return)&&k.call(S),2>K&&(aa=TypeError("The iterator does not provide a '"+A+"' method"),K=1);S=h}else if((k=(W=0>ba.n)?aa:G.call(R,ba))!==g)break}catch(na){S=h,K=1,aa=na}finally{ia=1}}return{value:k,done:W}}}(m,x,C),!0),u}function r(){}function v(){}function a(){}function E(m){return Object.setPrototypeOf?Object.setPrototypeOf(m,a):(m.__proto__=a,ma(m,d,"GeneratorFunction")),
m.prototype=Object.create(n),m}var h,t="function"==typeof Symbol?Symbol:{},c=t.iterator||"@@iterator",d=t.toStringTag||"@@toStringTag",g={};var k=Object.getPrototypeOf;t=[][c]?k(k([][c]())):(ma(k={},c,function(){return this}),k);var n=a.prototype=r.prototype=Object.create(t);return v.prototype=a,ma(n,"constructor",a),ma(a,"constructor",v),v.displayName="GeneratorFunction",ma(a,d,"GeneratorFunction"),ma(n),ma(n,d,"Generator"),ma(n,c,function(){return this}),ma(n,"toString",function(){return"[object Generator]"}),
(bb=function(){return{w:p,m:E}})()}function ma(p,r,v,a){var E=Object.defineProperty;try{E({},"",{})}catch(h){E=0}ma=function(h,t,c,d){function g(k,n){ma(h,k,function(m){return this._invoke(k,n,m)})}t?E?E(h,t,{value:c,enumerable:!d,configurable:!d,writable:!d}):h[t]=c:(g("next",0),g("throw",1),g("return",2))};ma(p,r,v,a)}function Bd(p){a:if("object"==typeof p&&p){var r=p[Symbol.toPrimitive];if(void 0!==r){p=r.call(p,"string");if("object"!=typeof p)break a;throw new TypeError("@@toPrimitive must return a primitive value.");
}p=String(p)}return"symbol"==typeof p?p:p+""}function T(p){"@babel/helpers - typeof";return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},T(p)}function Cd(p){var r=[];if("undefined"!==typeof p.options)for(var v=0;v<p.options.length;v++)p.options[v].selected&&r.push(p.options[v].value);return r.join(", ")}function Zc(){var p=Dd("xxxxxxxx","[x]");
var r=Date.now().toString();return p+r}function $c(){return Dd("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx","[xy]")}function Dd(p,r){var v=(new Date).getTime();return p.replace(new RegExp(r,"g"),function(a){var E=(v+16*Math.random())%16|0;return("x"===a?E:E&3|8).toString(16)})}function L(){return Math.floor((new Date).getTime()/1E3)}function yb(){var p=(new Date).getTime();kc>=p?kc++:kc=p;return kc}function z(p,r,v){if(r&&Object.keys(r).length){if("undefined"!==typeof r[p])return r[p]}else if("undefined"!==
typeof w[p])return w[p];return v}function ad(p,r,v){for(var a in w.i)w.i[a].tracking_crashes&&w.i[a].recordError(p,r,v)}function bd(p,r){for(var v=[],a=Object.keys(p||{}).sort(),E=0;E<a.length;E++){var h=a[E];v.push(h+"="+encodeURIComponent(p[h]))}var t=v.join("&");return r?Ed(t,r).then(function(c){return t+="&checksum256="+c.toUpperCase()}):Promise.resolve(t)}function cb(p){return"string"===typeof p&&"/"===p.substring(p.length-1)?p.substring(0,p.length-1):p}function Tb(p,r){for(var v={},a,E=0,h=
r.length;E<h;E++)a=r[E],"undefined"!==typeof p[a]&&(v[a]=p[a]);return v}function Ia(p,r,v,a,E,h){var t={};if(p){if(Object.keys(p).length>a){var c={},d=0,g;for(g in p)d<a&&(c[g]=p[g],d++);p=c}for(var k in p)a=I(k,r,E,h),c=I(p[k],v,E,h),t[a]=c}return t}function I(p,r,v,a){var E=p;"number"===typeof p&&(p=p.toString());"string"===typeof p&&p.length>r&&(E=p.substring(0,r),a(f.DEBUG,v+", Key: [ "+p+" ] is longer than accepted length. It will be truncated."));return E}function Ed(p,r){p=(new TextEncoder).encode(p+
r);return crypto.subtle.digest("SHA-256",p).then(function(v){return Array.from(new Uint8Array(v)).map(function(a){return a.toString(16).padStart(2,"0")}).join("").toUpperCase()})}function M(p,r,v){D&&(null===p||"undefined"===typeof p?lc()&&console.warn("[WARNING] [Countly] add_event_listener, Can't bind ["+r+"] event to nonexisting element"):"undefined"!==typeof p.addEventListener?p.addEventListener(r,v,!1):p.attachEvent("on"+r,v))}function mc(p){return p?"undefined"!==typeof p.target?p.target:p.srcElement:
window.event.srcElement}function db(p){if(p)return p;(p=navigator.userAgent)||(p=cd());return p}function cd(p){if(p)return p;p="";navigator.userAgentData&&(p=navigator.userAgentData.brands.map(function(r){return r.brand+":"+r.version}).join(),p+=navigator.userAgentData.mobile?" mobi ":" ",p+=navigator.userAgentData.platform);return p}function se(p){if("string"!==typeof p||!p)return null;p=parseInt(p.split(".")[0],10);return isNaN(p)?null:13<=p?"11":"10"}function dd(p){return p&&"function"===typeof p.getHighEntropyValues?
p.getHighEntropyValues("platform platformVersion architecture bitness model uaFullVersion fullVersionList".split(" ")).then(function(r){if(!r||"object"!==T(r))return null;var v=null,a=null,E=Array.isArray(r.fullVersionList)?r.fullVersionList:[],h=Array.isArray(p.brands)?p.brands:[],t=function(d){return"string"===typeof d?d.toLowerCase().replace(/[^a-z0-9]/g,""):""},c=function(d,g){return d.find(function(k){if(!k||!k.brand)return!1;var n=t(k.brand);return"notabrand"===n||"notabrand99"===n||0===n.indexOf("notabrand")||
!g&&"chromium"===t(k.brand)?!1:!0})};if(E=c(E,!1)||c(h,!1)||c(E,!0)||c(h,!0))v=E.brand||null,a=E.version||null;r={platform:r.platform||p.platform||null,platformVersion:r.platformVersion||null,architecture:r.architecture||null,bitness:r.bitness||null,model:r.model||null,uaFullVersion:r.uaFullVersion||null,fullVersionList:r.fullVersionList||null,browserName:v,browserVersion:a,windowsVersion:null};r.platform&&"windows"===r.platform.toLowerCase()&&(r.windowsVersion=se(r.platformVersion));return r})["catch"](function(){return null}):
Promise.resolve(null)}function te(p){return p?dd(p):nc?nc:D&&"undefined"!==typeof navigator&&navigator.userAgentData&&"function"===typeof navigator.userAgentData.getHighEntropyValues?nc=dd(navigator.userAgentData):Promise.resolve(null)}function oc(p){if(!p){if(navigator.userAgentData&&navigator.userAgentData.mobile)return"phone";p=db()}p=p.toLowerCase();var r="desktop",v=/(mobi|ipod|phone|blackberry|opera mini|fennec|minimo|symbian|psp|nintendo ds|archos|skyfire|puffin|blazer|bolt|gobrowser|iris|maemo|semc|teashark|uzard)/;
/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(p)?r="tablet":v.test(p)&&(r="phone");return r}function Fd(p){var r=/(CountlySiteBot|nuhk|Googlebot|GoogleSecurityScanner|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver|bingbot|Google Web Preview|Mediapartners-Google|AdsBot-Google|Baiduspider|Ezooms|YahooSeeker|AltaVista|AVSearch|Mercator|Scooter|InfoSeek|Ultraseek|Lycos|Wget|YandexBot|Yandex|YaDirectFetcher|SiteBot|Exabot|AhrefsBot|MJ12bot|TurnitinBot|magpie-crawler|Nutch Crawler|CMS Crawler|rogerbot|Domnutch|ssearch_bot|XoviBot|netseer|digincore|fr-crawler|wesee|AliasIO|contxbot|PingdomBot|BingPreview|HeadlessChrome|Lighthouse)/;
if(p)return r.test(p);p=r.test(db());r=r.test(cd());return p||r}function ed(p){"undefined"===typeof p.pageY&&"number"===typeof p.clientX&&document.documentElement&&(p.pageX=p.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,p.pageY=p.clientY+document.body.scrollTop+document.documentElement.scrollTop);return p}function pc(){var p=document;return Math.max(Math.max(p.body.scrollHeight,p.documentElement.scrollHeight),Math.max(p.body.offsetHeight,p.documentElement.offsetHeight),Math.max(p.body.clientHeight,
p.documentElement.clientHeight))}function fd(){var p=document;return Math.max(Math.max(p.body.scrollWidth,p.documentElement.scrollWidth),Math.max(p.body.offsetWidth,p.documentElement.offsetWidth),Math.max(p.body.clientWidth,p.documentElement.clientWidth))}function Gd(){var p=document;return Math.min(Math.min(p.body.clientHeight,p.documentElement.clientHeight),Math.min(p.body.offsetHeight,p.documentElement.offsetHeight),window.innerHeight)}function Hd(p,r,v,a,E,h){p=document.createElement(p);var t;
p.setAttribute(r,v);p.setAttribute(a,E);r=function(){t||h();t=!0};h&&(p.onreadystatechange=r,p.onload=r);document.getElementsByTagName("head")[0].appendChild(p)}function Id(p,r){Hd("script","type","text/javascript","src",p,r)}function qc(p,r){Hd("link","rel","stylesheet","href",p,r)}function Jd(){if(D){var p=document.getElementById("cly-loader");if(!p){var r=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=
"#cly-loader {height: 4px; width: 100%; position: absolute; z-index: 99999; overflow: hidden; background-color: #fff; top:0px; left:0px;}#cly-loader:before{display: block; position: absolute; content: ''; left: -200px; width: 200px; height: 4px; background-color: #2EB52B; animation: cly-loading 2s linear infinite;}@keyframes cly-loading { from {left: -200px; width: 30%;} 50% {width: 30%;} 70% {width: 70%;} 80% { left: 50%;} 95% {left: 120%;} to {left: 100%;}}":v.appendChild(document.createTextNode("#cly-loader {height: 4px; width: 100%; position: absolute; z-index: 99999; overflow: hidden; background-color: #fff; top:0px; left:0px;}#cly-loader:before{display: block; position: absolute; content: ''; left: -200px; width: 200px; height: 4px; background-color: #2EB52B; animation: cly-loading 2s linear infinite;}@keyframes cly-loading { from {left: -200px; width: 30%;} 50% {width: 30%;} 70% {width: 70%;} 80% { left: 50%;} 95% {left: 120%;} to {left: 100%;}}"));
r.appendChild(v);p=document.createElement("div");p.setAttribute("id","cly-loader");window.addEventListener("load",function(){if(w.showLoaderProtection)lc()&&console.warn("[WARNING] [Countly] showLoader, Loader is already on");else try{document.body.appendChild(p)}catch(a){lc()&&console.error("[ERROR] [Countly] showLoader, Body is not loaded for loader to append: "+a)}})}p.style.display="block"}}function lc(){return w&&w.debug&&"undefined"!==typeof console?!0:!1}function Kd(){if(D){w.showLoaderProtection=
!0;var p=document.getElementById("cly-loader");p&&(p.style.display="none")}}function ue(p){var r=document.createElement("script"),v=document.createElement("script");r.async=!0;v.async=!0;r.src=w.customSourceBoomerang||Ld.BOOMERANG_SRC;v.src=w.customSourceCountlyBoomerang||Ld.CLY_BOOMERANG_SRC;document.getElementsByTagName("head")[0].appendChild(r);document.getElementsByTagName("head")[0].appendChild(v);var a=!1,E=!1;r.onload=function(){a=!0};v.onload=function(){E=!0};var h=0,t=setInterval(function(){h+=
50;if(a&&E||1500<=h){if(w.debug){var c="BoomerangJS loaded:["+a+"], countly_boomerang loaded:["+E+"].";a&&E?console.log("[DEBUG] "+c):console.warn("[WARNING] "+c+" Initializing without APM.")}w.init(p);clearInterval(t)}},50)}var da={NPS:"[CLY]_nps",SURVEY:"[CLY]_survey",STAR_RATING:"[CLY]_star_rating",VIEW:"[CLY]_view",ORIENTATION:"[CLY]_orientation",ACTION:"[CLY]_action"},ve=Object.values(da),f={ERROR:"[ERROR] ",WARNING:"[WARNING] ",INFO:"[INFO] ",DEBUG:"[DEBUG] ",VERBOSE:"[VERBOSE] "},Ld={BOOMERANG_SRC:"https://cdn.jsdelivr.net/npm/countly-sdk-web@latest/plugin/boomerang/boomerang.min.js",
CLY_BOOMERANG_SRC:"https://cdn.jsdelivr.net/npm/countly-sdk-web@latest/plugin/boomerang/countly_boomerang.js"},ca=Object.freeze({errorCount:"cly_hc_error_count",warningCount:"cly_hc_warning_count",statusCode:"cly_hc_status_code",errorMessage:"cly_hc_error_message",backoffCount:"cly_hc_backoff_count",consecutiveBackoffCount:"cly_hc_consecutive_backoff_count"}),Md=/^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?::([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?::([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,
D="undefined"!==typeof window,w=globalThis.Countly||{},kc=0,nc=null;D&&"undefined"!==typeof navigator&&navigator.userAgentData&&"function"===typeof navigator.userAgentData.getHighEntropyValues&&(nc=dd(navigator.userAgentData));var Ub=new WeakMap,Nd=new WeakMap,zb=new WeakMap,oa=new WeakMap,Vb=new WeakMap,eb=new WeakMap,Ab=new WeakMap,H=new WeakMap,Y=new WeakMap,fa=new WeakMap,Ja=new WeakMap,sa=new WeakMap,ta=new WeakMap,Wb=new WeakMap,fb=new WeakMap,Ba=new WeakMap,Xb=new WeakMap,ja=new WeakMap,gb=
new WeakMap,hb=new WeakMap,Ua=new WeakMap,Bb=new WeakMap,ib=new WeakMap,Va=new WeakMap,Ca=new WeakMap,jb=new WeakMap,Ka=new WeakMap,Cb=new WeakMap,U=new WeakMap,ua=new WeakMap,La=new WeakMap,rc=new WeakMap,Ma=new WeakMap,Wa=new WeakMap,P=new WeakMap,kb=new WeakMap,lb=new WeakMap,Yb=new WeakMap,Na=new WeakMap,Db=new WeakMap,Da=new WeakMap,Ea=new WeakMap,va=new WeakMap,Zb=new WeakMap,V=new WeakMap,$b=new WeakMap,gd=new WeakMap,mb=new WeakMap,Eb=new WeakMap,nb=new WeakMap,Fb=new WeakMap,Oa=new WeakMap,
sc=new WeakMap,wa=new WeakMap,Xa=new WeakMap,ob=new WeakMap,Gb=new WeakMap,tc=new WeakMap,Hb=new WeakMap,Ib=new WeakMap,ac=new WeakMap,bc=new WeakMap,uc=new WeakMap,vc=new WeakMap,Jb=new WeakMap,pb=new WeakMap,wc=new WeakMap,Q=new WeakMap,O=new WeakMap,ka=new WeakMap,qb=new WeakMap,Pa=new WeakMap,Qa=new WeakMap,xc=new WeakMap,yc=new WeakMap,zc=new WeakMap,Ac=new WeakMap,Bc=new WeakMap,Kb=new WeakMap,Lb=new WeakMap,Mb=new WeakMap,Nb=new WeakMap,Ob=new WeakMap,Pb=new WeakMap,Cc=new WeakMap,Dc=new WeakMap,
Qb=new WeakMap,Ec=new WeakMap,Fc=new WeakMap,hd=new WeakMap,rb=new WeakMap,Ya=new WeakMap,Fa=new WeakMap,cc=new WeakMap,dc=new WeakMap,ec=new WeakMap,Gc=new WeakMap,fc=new WeakMap,gc=new WeakMap,sb=new WeakMap,tb=new WeakMap,Za=new WeakMap,ub=new WeakMap,Z=new WeakMap,Ra=new WeakMap,Hc=new WeakMap,xa=new WeakMap,Sa=new WeakMap,Ta=new WeakMap,Od=new WeakMap,Ic=new WeakMap,Jc=new WeakMap,Kc=new WeakMap,Pd=new WeakMap,id=new WeakMap,pa=new WeakMap,Qd=new WeakMap,Rd=new WeakMap,Rb=new WeakMap,jd=new WeakMap,
Sd=new WeakMap,kd=new WeakMap,Td=new WeakMap,Ud=new WeakMap,Vd=new WeakMap,Lc=new WeakMap,Wd=new WeakMap,ld=new WeakMap,ha=new WeakMap,Ga=new WeakMap,md=new WeakMap,nd=new WeakMap,Mc=new WeakMap,Nc=new WeakMap,Xd=new WeakMap,od=new WeakMap,$a=new WeakMap,Yd=new WeakMap,Oc=new WeakMap,Zd=new WeakMap,Pc=new WeakMap,$d=new WeakMap,ae=new WeakMap,hc=new WeakMap,ya=new WeakMap,Qc=new WeakMap,pd=new WeakMap,Rc=new WeakMap,be=new WeakMap,qd=new WeakMap,vb=new WeakMap,ea=new WeakMap,ic=new WeakMap,ce=new WeakMap,
de=new WeakMap,rd=new WeakMap,za=new WeakMap,Sc=new WeakMap,ee=new WeakMap,sd=new WeakMap,fe=new WeakMap,Sb=new WeakMap,wb=new WeakMap,Tc=new WeakMap,e=new WeakMap,qa=new WeakMap,td=new WeakMap,ge=new WeakMap,ud=new WeakMap,vd=new WeakMap,Uc=new WeakMap,Vc=new WeakMap,wd=new WeakMap,Wc=new WeakMap,he=new WeakMap,xd=new WeakMap,ie=new WeakMap,je=new WeakMap,ke=new WeakMap,le=new WeakMap,yd=new WeakMap,F=new WeakMap,B=new WeakMap,la=new WeakMap,me=new WeakMap,ne=new WeakMap,oe=new WeakMap,pe=new WeakMap,
Aa=new WeakMap,qe=function(p,r,v){return r&&Ad(p.prototype,r),v&&Ad(p,v),Object.defineProperty(p,"prototype",{writable:!1}),p}(function v(r){var a=this;if(!(this instanceof v))throw new TypeError("Cannot call a class as a function");q(this,Ub,void 0);q(this,Nd,void 0);q(this,zb,void 0);q(this,oa,void 0);q(this,Vb,void 0);q(this,eb,void 0);q(this,Ab,void 0);q(this,H,void 0);q(this,Y,void 0);q(this,fa,void 0);q(this,Ja,void 0);q(this,sa,void 0);q(this,ta,void 0);q(this,Wb,void 0);q(this,fb,void 0);
q(this,Ba,void 0);q(this,Xb,void 0);q(this,ja,void 0);q(this,gb,void 0);q(this,hb,void 0);q(this,Ua,void 0);q(this,Bb,void 0);q(this,ib,void 0);q(this,Va,void 0);q(this,Ca,void 0);q(this,jb,void 0);q(this,Ka,void 0);q(this,Cb,void 0);q(this,U,void 0);q(this,ua,void 0);q(this,La,void 0);q(this,rc,void 0);q(this,Ma,void 0);q(this,Wa,void 0);q(this,P,void 0);q(this,kb,void 0);q(this,lb,void 0);q(this,Yb,void 0);q(this,Na,void 0);q(this,Db,void 0);q(this,Da,void 0);q(this,Ea,void 0);q(this,va,void 0);
q(this,Zb,void 0);q(this,V,void 0);q(this,$b,void 0);q(this,gd,void 0);q(this,mb,void 0);q(this,Eb,void 0);q(this,nb,void 0);q(this,Fb,void 0);q(this,Oa,void 0);q(this,sc,void 0);q(this,wa,void 0);q(this,Xa,void 0);q(this,ob,void 0);q(this,Gb,void 0);q(this,tc,void 0);q(this,Hb,void 0);q(this,Ib,void 0);q(this,ac,void 0);q(this,bc,void 0);q(this,uc,void 0);q(this,vc,void 0);q(this,Jb,void 0);q(this,pb,void 0);q(this,wc,void 0);q(this,Q,void 0);q(this,O,void 0);q(this,ka,void 0);q(this,qb,void 0);
q(this,Pa,void 0);q(this,Qa,void 0);q(this,xc,void 0);q(this,yc,void 0);q(this,zc,void 0);q(this,Ac,void 0);q(this,Bc,void 0);q(this,Kb,void 0);q(this,Lb,void 0);q(this,Mb,void 0);q(this,Nb,void 0);q(this,Ob,void 0);q(this,Pb,void 0);q(this,Cc,void 0);q(this,Dc,void 0);q(this,Qb,void 0);q(this,Ec,void 0);q(this,Fc,void 0);q(this,hd,void 0);q(this,rb,void 0);q(this,Ya,void 0);q(this,Fa,void 0);q(this,cc,void 0);q(this,dc,void 0);q(this,ec,void 0);q(this,Gc,void 0);q(this,fc,void 0);q(this,gc,void 0);
q(this,sb,void 0);q(this,tb,void 0);q(this,Za,void 0);q(this,ub,void 0);q(this,Z,void 0);q(this,Ra,void 0);q(this,Hc,void 0);q(this,xa,void 0);q(this,Sa,void 0);q(this,Ta,void 0);q(this,Od,function(){if(D){var h=db(),t="undefined"!==typeof navigator&&!!navigator.userAgentData,c=t&&"function"===typeof navigator.userAgentData.getHighEntropyValues,d=t?navigator.userAgentData.platform:void 0,g=t?navigator.userAgentData.brands:void 0;b(e,a).call(a,f.DEBUG,"ua_logic, raw ua string:["+h+"]");b(e,a).call(a,
f.DEBUG,"ua_logic, userAgentData available:["+t+"], getHighEntropyValues available:["+c+"]");b(e,a).call(a,f.DEBUG,"ua_logic, userAgentData low-entropy platform:["+d+"], brands:["+JSON.stringify(g)+"]");l(Ra,a,"pending");l(xa,a,[]);l(Sa,a,setTimeout(function(){null!==b(xa,a)&&(b(e,a).call(a,f.WARNING,"ua_logic, client hints resolution timed out after 5s, flushing pending requests with available metrics"),b(Ic,a).call(a))},1E3));l(Hc,a,te().then(function(k){k&&"object"===T(k)?(l(Z,a,k),l(Ra,a,"resolved"),
b(e,a).call(a,f.DEBUG,"ua_logic, high-entropy hints resolved:["+JSON.stringify(k)+"]")):(l(Ra,a,"unavailable"),b(e,a).call(a,f.DEBUG,"ua_logic, high-entropy hints unavailable or not returned"))})["catch"](function(k){l(Z,a,null);l(Ra,a,"failed");b(e,a).call(a,f.DEBUG,"ua_logic, high-entropy hints fetch failed:["+k+"]")})["finally"](function(){b(Ic,a).call(a)}))}else l(Ra,a,"unavailable"),l(xa,a,null)});q(this,Ic,function(){b(Sa,a)&&(clearTimeout(b(Sa,a)),l(Sa,a,null));var h=b(xa,a);l(xa,a,null);if(h&&
0!==h.length){b(e,a).call(a,f.DEBUG,"ua_logic, flushing ["+h.length+"] pending request(s) after client hints resolution");for(var t=0;t<h.length;t++){var c=h[t];c.begin_session&&(c.metrics=JSON.stringify(b(Sb,a).call(a)));b(H,a).length>b(wa,a)&&b(H,a).shift();b(H,a).push(c)}b(B,a).call(a,"cly_queue",b(H,a),!0)}});q(this,Jc,function(){if("[CLY]_temp_id"===a.device_id)b(e,a).call(a,f.INFO,"server_config, Device ID is temporary, not fetching server config");else if(b(hd,a))b(e,a).call(a,f.INFO,"server_config, SDK behavior sync is disabled, not fetching server config");
else{b(e,a).call(a,f.INFO,"server_config, Fetching server config");var h={};h.app_key=a.app_key;h.device_id=a.device_id;h.sdk_version=b(va,a);h.sdk_name=b(Ea,a);h.t=b(P,a);h.timestamp=yb();var t=new Date;h.hour=t.getHours();h.dow=t.getDay();h.av=a.app_version;h.method="sc";b(qa,a).call(a,"server_config",a.url+b(eb,a),h,function(c,d,g){if(!c)try{var k=JSON.parse(g);b(e,a).call(a,f.INFO,"server_config, Config fetched successfully:["+JSON.stringify(k)+"]");k&&b(Kc,a).call(a,k);b(B,a).call(a,"cly_config",
JSON.stringify(k))}catch(n){b(e,a).call(a,f.ERROR,"server_config, Had an issue while parsing the response: "+n)}},!0,!0);setTimeout(function(){b(Jc,a).call(a)},36E5*b(tc,a))}});q(this,Kc,function(h){h&&h.c&&"object"===T(h.c)&&(h=h.c,h.hasOwnProperty("networking")&&l(sc,a,h.networking),h.hasOwnProperty("tracking")&&l(Hb,a,h.tracking),h.hasOwnProperty("rqs")&&l(wa,a,h.rqs),h.hasOwnProperty("eqs")&&l(Xa,a,h.eqs),h.hasOwnProperty("sui")&&l(ob,a,h.sui),h.hasOwnProperty("czi")&&14<h.czi&&l(Gb,a,1E3*h.czi),
h.hasOwnProperty("ecz")&&(l(Jb,a,h.ecz),!b(Ec,a)&&b(Jb,a)&&b($a,a).call(a)),h.hasOwnProperty("cr")&&l(pb,a,h.cr),h.hasOwnProperty("st")&&l(Ib,a,h.st),h.hasOwnProperty("crt")&&l(bc,a,h.crt),h.hasOwnProperty("vt")&&l(ac,a,h.vt),h.hasOwnProperty("cet")&&l(uc,a,h.cet),h.hasOwnProperty("lkl")&&l(Q,a,h.lkl),h.hasOwnProperty("lvs")&&l(O,a,h.lvs),h.hasOwnProperty("lsv")&&l(ka,a,h.lsv),h.hasOwnProperty("lbc")&&l(qb,a,h.lbc),h.hasOwnProperty("ltlpt")&&l(Pa,a,h.ltlpt),h.hasOwnProperty("ltl")&&l(Qa,a,h.ltl),
h.hasOwnProperty("scui")&&l(tc,a,Math.max(h.scui,4)),h.hasOwnProperty("lt")&&l(vc,a,h.lt),h.hasOwnProperty("rcz")&&l(wc,a,h.rcz),h.hasOwnProperty("bom")&&l(xc,a,h.bom),h.hasOwnProperty("bom_at")&&l(yc,a,h.bom_at),h.hasOwnProperty("bom_rqp")&&l(zc,a,h.bom_rqp),h.hasOwnProperty("bom_ra")&&l(Ac,a,h.bom_ra),h.hasOwnProperty("bom_d")&&l(Bc,a,h.bom_d),h.hasOwnProperty("eb")&&Array.isArray(h.eb)&&l(Kb,a,h.eb),h.hasOwnProperty("ew")&&Array.isArray(h.ew)&&l(Lb,a,h.ew),h.hasOwnProperty("upb")&&Array.isArray(h.upb)&&
l(Mb,a,h.upb),h.hasOwnProperty("upw")&&Array.isArray(h.upw)&&l(Nb,a,h.upw),h.hasOwnProperty("sb")&&Array.isArray(h.sb)&&l(Ob,a,h.sb),h.hasOwnProperty("sw")&&Array.isArray(h.sw)&&l(Pb,a,h.sw),h.hasOwnProperty("esb")&&h.esb&&"object"===T(h.esb)&&!Array.isArray(h.esb)&&l(Cc,a,h.esb),h.hasOwnProperty("esw")&&h.esw&&"object"===T(h.esw)&&!Array.isArray(h.esw)&&l(Dc,a,h.esw),h.hasOwnProperty("jte")&&Array.isArray(h.jte)&&l(Qb,a,h.jte))});q(this,Pd,function(h){l(ta,a,z("ignore_referrers",h,[]));l(Bb,a,z("fail_timeout",
h,60));l(ib,a,z("inactivity_time",h,20));l(Ca,a,z("use_session_cookie",h,!0));l(jb,a,z("session_cookie_timeout",h,30));l(U,a,z("offline_mode",h,!1));l(Ea,a,z("sdk_name",h,"javascript_native_web"));l(va,a,z("sdk_version",h,"26.1.2"));l(Ab,a,z("interval",h,500));a.getViewName=z("getViewName",h,w.getViewName);a.getViewUrl=z("getViewUrl",h,w.getViewUrl);a.getSearchQuery=z("getSearchQuery",h,w.getSearchQuery);a.DeviceIdType=w.DeviceIdType;a.namespace=z("namespace",h,"");a.clearStoredId=z("clear_stored_id",
h,!1);a.onload=z("onload",h,[]);a.utm=z("utm",h,{source:!0,medium:!0,campaign:!0,term:!0,content:!0});a.ignore_prefetch=z("ignore_prefetch",h,!0);a.rcAutoOptinAb=z("rc_automatic_optin_for_ab",h,!0);a.useExplicitRcApi=z("use_explicit_rc_api",h,!1);a.debug=z("debug",h,!1);a.test_mode=z("test_mode",h,!1);a.test_mode_eq=z("test_mode_eq",h,!1);a.metrics=z("metrics",h,{});a.headers=z("headers",h,{});a.app_version=z("app_version",h,"0.0");a.country_code=z("country_code",h,null);a.city=z("city",h,null);a.ip_address=
z("ip_address",h,null);a.ignore_bots=z("ignore_bots",h,!0);a.force_post=z("force_post",h,!0);a.remote_config=z("remote_config",h,!1);a.ignore_visitor=z("ignore_visitor",h,!1);a.track_domains=D?z("track_domains",h,!0):void 0;a.storage=z("storage",h,"default");a.enableOrientationTracking=D?z("enable_orientation_tracking",h,!0):void 0;a.heatmapWhitelist=z("heatmap_whitelist",h,[]);a.contentWhitelist=z("content_whitelist",h,[]);a.salt=z("salt",h,null);a.hcErrorCount=b(F,a).call(a,ca.errorCount)||0;a.hcWarningCount=
b(F,a).call(a,ca.warningCount)||0;a.hcStatusCode=b(F,a).call(a,ca.statusCode)||-1;a.hcErrorMessage=b(F,a).call(a,ca.errorMessage)||"";a.hcBackoffCount=b(F,a).call(a,ca.backoffCount)||0;a.hcConsecutiveBackoffCount=b(F,a).call(a,ca.consecutiveBackoffCount)||0;l(dc,a,!1);l(Fb,a,z("crash_filter_callback",h,null));"cookie"===a.storage&&l(Ma,a,!1);a.rcAutoOptinAb||a.useExplicitRcApi||(b(e,a).call(a,f.WARNING,"initialize, Auto opting is disabled, switching to explicit RC API"),a.useExplicitRcApi=!0);Array.isArray(b(ta,
a))||l(ta,a,[]);""===a.url&&(b(e,a).call(a,f.ERROR,"initialize, Please provide server URL"),a.ignore_visitor=!0);b(F,a).call(a,"cly_ignore")&&(a.ignore_visitor=!0);b(od,a).call(a);if(D)if(window.name&&0===window.name.indexOf("cly:"))try{a.passed_data=JSON.parse(window.name.replace("cly:",""))}catch(x){b(e,a).call(a,f.ERROR,"initialize, Could not parse name: "+window.name+", error: "+x)}else if(location.hash&&0===location.hash.indexOf("this.#cly:"))try{a.passed_data=JSON.parse(location.hash.replace("this.#cly:",
""))}catch(x){b(e,a).call(a,f.ERROR,"initialize, Could not parse hash: "+location.hash+", error: "+x)}Array.isArray(a.contentWhitelist)&&(a.contentWhitelist.push(a.url),a.contentWhitelist=a.contentWhitelist.map(function(x){return cb(x)}));if((a.passed_data&&a.passed_data.app_key&&a.passed_data.app_key===a.app_key||a.passed_data&&!a.passed_data.app_key&&b(zb,a))&&a.passed_data.token&&a.passed_data.purpose){a.passed_data.token!==b(F,a).call(a,"cly_old_token")&&(b(xd,a).call(a,a.passed_data.token),b(B,
a).call(a,"cly_old_token",a.passed_data.token));var t=[];Array.isArray(a.heatmapWhitelist)?(a.heatmapWhitelist.push(a.url),t=a.heatmapWhitelist.map(function(x){return cb(x)})):t=[a.url];t.includes(a.passed_data.url)&&"heatmap"===a.passed_data.purpose&&(a.ignore_visitor=!0,Jd(),Id(a.passed_data.url+"/views/heatmap.js",Kd))}if(a.ignore_visitor)b(e,a).call(a,f.WARNING,"initialize, ignore_visitor:["+a.ignore_visitor+"], this user will not be tracked");else{b(me,a).call(a);l(H,a,b(F,a).call(a,"cly_queue")||
[]);l(Y,a,b(F,a).call(a,"cly_event")||[]);l(fa,a,b(F,a).call(a,"cly_remote_configs")||{});t="[CLY]_temp_id"===b(F,a).call(a,"cly_id");a.clearStoredId&&(b(F,a).call(a,"cly_id")&&!t&&(a.device_id=b(F,a).call(a,"cly_id"),b(e,a).call(a,f.DEBUG,"initialize, temporarily using the previous device ID to flush existing events"),l(P,a,b(F,a).call(a,"cly_id_type")),b(P,a)||(b(e,a).call(a,f.DEBUG,"initialize, No device ID type info from the previous session, falling back to DEVELOPER_SUPPLIED, for event flushing"),
l(P,a,0)),b(ya,a).call(a),a.device_id=void 0,l(P,a,1)),b(e,a).call(a,f.INFO,"initialize, Clearing the device ID storage"),b(la,a).call(a,"cly_id"),b(la,a).call(a,"cly_id_type"),b(la,a).call(a,"cly_session"),t=!1);"javascript_native_web"===b(Ea,a)&&"26.1.2"===b(va,a)?b(e,a).call(a,f.DEBUG,"initialize, SDK name:["+b(Ea,a)+"], version:["+b(va,a)+"]"):b(e,a).call(a,f.DEBUG,"initialize, SDK name:["+b(Ea,a)+"], version:["+b(va,a)+"], default name:[javascript_native_web] and default version:[26.1.2]");b(e,
a).call(a,f.DEBUG,"initialize, stored server config:["+JSON.stringify(b(Oa,a))+"]");b(e,a).call(a,f.DEBUG,"initialize, app_key:["+a.app_key+"], url:["+a.url+"]");b(e,a).call(a,f.DEBUG,"initialize, device_id:["+z("device_id",h,void 0)+"]");b(e,a).call(a,f.DEBUG,"initialize, require_consent is enabled:["+b(pb,a)+"]");try{b(e,a).call(a,f.DEBUG,"initialize, metric override:["+JSON.stringify(a.metrics)+"]"),b(e,a).call(a,f.DEBUG,"initialize, header override:["+JSON.stringify(a.headers)+"]"),b(e,a).call(a,
f.DEBUG,"initialize, number of onload callbacks provided:["+a.onload.length+"]"),b(e,a).call(a,f.DEBUG,"initialize, utm tags:["+JSON.stringify(a.utm)+"]"),b(ta,a)&&b(e,a).call(a,f.DEBUG,"initialize, referrers to ignore :["+JSON.stringify(b(ta,a))+"]"),b(e,a).call(a,f.DEBUG,"initialize, salt given:["+!!a.salt+"]")}catch(x){b(e,a).call(a,f.ERROR,"initialize, Could not stringify some config object values")}b(e,a).call(a,f.DEBUG,"initialize, app_version:["+a.app_version+"]");b(e,a).call(a,f.DEBUG,"initialize, provided location info; country_code:["+
a.country_code+"], city:["+a.city+"], ip_address:["+a.ip_address+"]");""!==a.namespace&&b(e,a).call(a,f.DEBUG,"initialize, namespace given:["+a.namespace+"]");a.clearStoredId&&b(e,a).call(a,f.DEBUG,"initialize, clearStoredId flag set to:["+a.clearStoredId+"]");a.ignore_prefetch&&b(e,a).call(a,f.DEBUG,"initialize, ignoring pre-fetching and pre-rendering from counting as real website visits :["+a.ignore_prefetch+"]");a.test_mode&&b(e,a).call(a,f.WARNING,"initialize, test_mode:["+a.test_mode+"], request queue won't be processed");
a.test_mode_eq&&b(e,a).call(a,f.WARNING,"initialize, test_mode_eq:["+a.test_mode_eq+"], event queue won't be processed");a.heatmapWhitelist&&b(e,a).call(a,f.DEBUG,"initialize, heatmap whitelist:["+JSON.stringify(a.heatmapWhitelist)+"], these domains will be whitelisted");"default"!==a.storage&&b(e,a).call(a,f.DEBUG,"initialize, storage is set to:["+a.storage+"]");a.ignore_bots&&b(e,a).call(a,f.DEBUG,"initialize, ignore traffic from bots :["+a.ignore_bots+"]");a.force_post&&b(e,a).call(a,f.DEBUG,"initialize, forced post method for all requests:["+
a.force_post+"]");a.remote_config&&b(e,a).call(a,f.DEBUG,"initialize, remote_config callback provided:["+!!a.remote_config+"]");"boolean"===typeof a.rcAutoOptinAb&&b(e,a).call(a,f.DEBUG,"initialize, automatic RC optin is enabled:["+a.rcAutoOptinAb+"]");a.useExplicitRcApi||b(e,a).call(a,f.WARNING,"initialize, will use legacy RC API. Consider enabling new API during init with use_explicit_rc_api flag");a.track_domains&&b(e,a).call(a,f.DEBUG,"initialize, tracking domain info:["+a.track_domains+"]");
a.enableOrientationTracking&&b(e,a).call(a,f.DEBUG,"initialize, enableOrientationTracking:["+a.enableOrientationTracking+"]");b(Ca,a)||b(e,a).call(a,f.WARNING,"initialize, use_session_cookie is enabled:["+b(Ca,a)+"]");b(U,a)&&b(e,a).call(a,f.DEBUG,"initialize, offline_mode:["+b(U,a)+"], user info won't be send to the servers");b(fa,a)&&b(e,a).call(a,f.DEBUG,"initialize, stored remote configs:["+JSON.stringify(b(fa,a))+"]");b(Gb,a)&&b(e,a).call(a,f.DEBUG,"initialize, content_zone_timer_interval:["+
b(Gb,a)+"]");b(e,a).call(a,f.DEBUG,"initialize, 'getViewName' callback override provided:["+(a.getViewName!==w.getViewName)+"]");b(e,a).call(a,f.DEBUG,"initialize, 'getSearchQuery' callback override provided:["+(a.getSearchQuery!==w.getSearchQuery)+"]");128!==b(Q,a)&&b(e,a).call(a,f.DEBUG,"initialize, maxKeyLength set to:["+b(Q,a)+"] characters");256!==b(O,a)&&b(e,a).call(a,f.DEBUG,"initialize, maxValueSize set to:["+b(O,a)+"] characters");100!==b(ka,a)&&b(e,a).call(a,f.DEBUG,"initialize, maxSegmentationValues set to:["+
b(ka,a)+"] key/value pairs");100!==b(qb,a)&&b(e,a).call(a,f.DEBUG,"initialize, maxBreadcrumbCount for custom logs set to:["+b(qb,a)+"] entries");30!==b(Pa,a)&&b(e,a).call(a,f.DEBUG,"initialize, maxStackTraceLinesPerThread set to:["+b(Pa,a)+"] lines");200!==b(Qa,a)&&b(e,a).call(a,f.DEBUG,"initialize, maxStackTraceLineLength set to:["+b(Qa,a)+"] characters");500!==b(Ab,a)&&b(e,a).call(a,f.DEBUG,"initialize, interval for heartbeats set to:["+b(Ab,a)+"] milliseconds");1E3!==b(wa,a)&&b(e,a).call(a,f.DEBUG,
"initialize, queue_size set to:["+b(wa,a)+"] items max");60!==b(Bb,a)&&b(e,a).call(a,f.DEBUG,"initialize, fail_timeout set to:["+b(Bb,a)+"] seconds of wait time after a failed connection to server");20!==b(ib,a)&&b(e,a).call(a,f.DEBUG,"initialize, inactivity_time set to:["+b(ib,a)+"] minutes to consider a user as inactive after no observable action");60!==b(ob,a)&&b(e,a).call(a,f.DEBUG,"initialize, session_update set to:["+b(ob,a)+"] seconds to check if extending a session is needed while the user is active");
100!==b(Xa,a)&&b(e,a).call(a,f.DEBUG,"initialize, max_events set to:["+b(Xa,a)+"] events to send in one batch");30!==b(jb,a)&&b(e,a).call(a,f.DEBUG,"initialize, session_cookie_timeout set to:["+b(jb,a)+"] minutes to expire a cookies session");var c=null,d=a.getSearchQuery(),g=!1,k={};if(d){0===d.indexOf("?")&&(d=d.substring(1));d=d.split("&");for(var n=0;n<d.length;n++){var m=d[n].split("=");"cly_id"===m[0]?b(B,a).call(a,"cly_cmp_id",m[1]):"cly_uid"===m[0]?b(B,a).call(a,"cly_cmp_uid",m[1]):"cly_device_id"===
m[0]?c=m[1]:0===(m[0]+"").indexOf("utm_")&&a.utm[m[0].replace("utm_","")]&&(k[m[0].replace("utm_","")]=m[1],g=!0)}}d=z("device_id",h,void 0);"number"===typeof d&&(d=d.toString());b(F,a).call(a,"cly_id")&&!t?(a.device_id=b(F,a).call(a,"cly_id"),b(e,a).call(a,f.INFO,"initialize, Set the stored device ID"),l(P,a,b(F,a).call(a,"cly_id_type")),b(P,a)||(b(e,a).call(a,f.INFO,"initialize, No device ID type info from the previous session, falling back to DEVELOPER_SUPPLIED"),l(P,a,0)),l(U,a,!1)):null!==c?
(b(e,a).call(a,f.INFO,"initialize, Device ID set by URL"),a.device_id=c,l(P,a,3),l(U,a,!1)):d?(b(e,a).call(a,f.INFO,"initialize, Device ID set by developer"),a.device_id=d,h&&Object.keys(h).length?void 0!==h.device_id&&l(P,a,0):void 0!==w.device_id&&l(P,a,0),l(U,a,!1)):b(U,a)||t?(a.device_id="[CLY]_temp_id",l(P,a,2),b(U,a)&&t?b(e,a).call(a,f.INFO,"initialize, Temp ID set, continuing offline mode from previous app session"):b(U,a)&&!t?b(e,a).call(a,f.INFO,"initialize, Temp ID set, entering offline mode"):
(l(U,a,!0),b(e,a).call(a,f.INFO,"initialize, Temp ID set, enabling offline mode"))):(b(e,a).call(a,f.INFO,"initialize, Generating the device ID"),a.device_id=z("device_id",h,b(Sc,a).call(a)),h&&Object.keys(h).length?void 0!==h.device_id&&l(P,a,0):void 0!==w.device_id&&l(P,a,0));b(B,a).call(a,"cly_id",a.device_id);b(B,a).call(a,"cly_id_type",b(P,a));if(g){l(Da,a,{});for(var u in a.utm)k[u]?(a.userData.set("utm_"+u,k[u]),b(Da,a)[u]=k[u]):a.userData.unset("utm_"+u);a.userData.save()}b(Jc,a).call(a)}});
q(this,id,function(){b(Ub,a)&&(clearTimeout(b(Ub,a)),l(Ub,a,null));l(Ub,a,setTimeout(function(){for(var h={},t=0;t<w.features.length;t++)!0===b(V,a)[w.features[t]].optin?h[w.features[t]]=!0:h[w.features[t]]=!1;b(ea,a).call(a,{consent:JSON.stringify(h)});b(e,a).call(a,f.DEBUG,"Consent update request has been sent to the queue.")},1E3))});y(this,"halt",function(){b(e,a).call(a,f.WARNING,"halt, Resetting Countly");w.i=void 0;w.q=[];w.noHeartBeat=void 0;l(zb,a,!w.i);l(oa,a,!1);l(Vb,a,"/i");l(eb,a,"/o/sdk");
l(Ab,a,500);l(wa,a,1E3);l(H,a,[]);l(Y,a,[]);l(fa,a,{});l(Ja,a,[]);l(sa,a,{});l(ta,a,[]);l(Wb,a,null);l(fb,a,!0);l(Xb,a,0);l(ja,a,null);l(gb,a,0);l(hb,a,0);l(Ua,a,0);l(Bb,a,60);l(ib,a,20);l(Va,a,0);l(ob,a,60);l(Xa,a,100);l(Ca,a,!0);l(jb,a,30);l(Ka,a,!0);l(Cb,a,!1);l(U,a,!1);l(ua,a,{});l(La,a,!0);l(rc,a,L());l(Ma,a,!0);l(Wa,a,null);l(P,a,1);l(kb,a,!1);l(lb,a,0);l(Yb,a,!1);l(Na,a,null);l(Db,a,null);l(Da,a,null);l($b,a,[]);try{localStorage.setItem("cly_testLocal",!0),localStorage.removeItem("cly_testLocal"),
localStorage.removeItem("cly_old_token"),localStorage.removeItem("cly_cmp_id"),localStorage.removeItem("cly_cmp_uid"),localStorage.removeItem("cly_id"),localStorage.removeItem("cly_id_type"),localStorage.removeItem("cly_queue"),localStorage.removeItem("cly_session"),localStorage.removeItem("cly_remote_configs"),localStorage.removeItem("cly_event"),localStorage.removeItem("cly_ignore"),localStorage.removeItem("cly_fb_widgets"),localStorage.removeItem("cly_token"),localStorage.removeItem("cly_hc_error_count"),
localStorage.removeItem("cly_hc_warning_count"),localStorage.removeItem("cly_hc_status_code"),localStorage.removeItem("cly_hc_error_message"),localStorage.removeItem("cly_hc_backoff_count"),localStorage.removeItem("cly_hc_consecutive_backoff_count")}catch(t){b(e,a).call(a,f.ERROR,"halt, Local storage test failed, will fallback to cookies"),l(Ma,a,!1)}w.features="sessions events views scrolls clicks forms crashes attribution users star-rating location apm feedback remote-config".split(" ");l(V,a,{});
for(var h=0;h<w.features.length;h++)b(V,a)[w.features[h]]={};a.app_key=void 0;a.device_id=void 0;a.onload=void 0;a.utm=void 0;a.ignore_prefetch=void 0;a.debug=void 0;a.test_mode=void 0;a.test_mode_eq=void 0;a.metrics=void 0;a.headers=void 0;a.url=void 0;a.app_version=void 0;a.country_code=void 0;a.city=void 0;a.ip_address=void 0;a.ignore_bots=void 0;a.force_post=void 0;a.rcAutoOptinAb=void 0;a.useExplicitRcApi=void 0;a.remote_config=void 0;a.ignore_visitor=void 0;l(pb,a,void 0);a.track_domains=void 0;
a.storage=void 0;a.enableOrientationTracking=void 0;a.salt=void 0;l(Q,a,void 0);l(O,a,void 0);l(ka,a,void 0);l(qb,a,void 0);l(Pa,a,void 0);l(Qa,a,void 0);l(ub,a,void 0);l(sb,a,void 0);l(tb,a,void 0);l(Za,a,void 0);b(Sa,a)&&(clearTimeout(b(Sa,a)),l(Sa,a,null));b(Ta,a)&&(clearTimeout(b(Ta,a)),l(Ta,a,null));l(xa,a,null);l(Hc,a,null);l(Z,a,null);l(Ra,a,"not_started")});y(this,"sdk_version",function(){return b(va,a)});y(this,"sdk_name",function(){return b(Ea,a)});y(this,"group_features",function(h){b(e,
a).call(a,f.INFO,"group_features, Grouping features");if(h)for(var t in h)b(V,a)[t]?b(e,a).call(a,f.WARNING,"group_features, Feature name ["+t+"] is already reserved"):"string"===typeof h[t]?b(V,a)[t]={features:[h[t]]}:h[t]&&Array.isArray(h[t])&&h[t].length?b(V,a)[t]={features:h[t]}:b(e,a).call(a,f.ERROR,"group_features, Incorrect feature list for ["+t+"] value: ["+h[t]+"]");else b(e,a).call(a,f.ERROR,"group_features, Incorrect features:["+h+"]")});y(this,"check_consent",function(h){b(e,a).call(a,
f.INFO,"check_consent, Checking if consent is given for specific feature:["+h+"]");if(!b(pb,a))return b(e,a).call(a,f.INFO,"check_consent, require_consent is off, no consent is necessary"),!0;if(b(V,a)[h])return!(!b(V,a)[h]||!b(V,a)[h].optin);b(e,a).call(a,f.ERROR,"check_consent, No feature available for ["+h+"]");return!1});y(this,"get_device_id_type",function(){b(e,a).call(a,f.INFO,"check_device_id_type, Retrieving the current device id type.["+b(P,a)+"]");switch(b(P,a)){case 1:var h=a.DeviceIdType.SDK_GENERATED;
break;case 3:case 0:h=a.DeviceIdType.DEVELOPER_SUPPLIED;break;case 2:h=a.DeviceIdType.TEMPORARY_ID;break;default:h=-1}return h});y(this,"get_device_id",function(){b(e,a).call(a,f.INFO,"get_device_id, Retrieving the device id: ["+a.device_id+"]");return a.device_id});y(this,"check_any_consent",function(){b(e,a).call(a,f.INFO,"check_any_consent, Checking if any consent is given");if(!b(pb,a))return b(e,a).call(a,f.INFO,"check_any_consent, require_consent is off, no consent is necessary"),!0;for(var h in b(V,
a))if(b(V,a)[h]&&b(V,a)[h].optin)return!0;b(e,a).call(a,f.INFO,"check_any_consent, No consents given");return!1});y(this,"add_consent",function(h){b(e,a).call(a,f.INFO,"add_consent, Adding consent for ["+h+"]");if(Array.isArray(h))for(var t=0;t<h.length;t++)a.add_consent(h[t]);else b(V,a)[h]?b(V,a)[h].features?(b(V,a)[h].optin=!0,a.add_consent(b(V,a)[h].features)):!0!==b(V,a)[h].optin&&(b(V,a)[h].optin=!0,b(id,a).call(a),setTimeout(function(){"sessions"===h&&b(ua,a).begin_session?(a.begin_session.apply(a,
b(ua,a).begin_session),b(ua,a).begin_session=null):"views"===h&&b(ua,a).track_pageview&&(l(ja,a,null),a.track_pageview.apply(a,b(ua,a).track_pageview),b(ua,a).track_pageview=null)},1)):b(e,a).call(a,f.ERROR,"add_consent, No feature available for ["+h+"]")});y(this,"remove_consent",function(h){b(e,a).call(a,f.INFO,"remove_consent, Removing consent for ["+h+"]");a.remove_consent_internal(h,!0)});y(this,"remove_consent_internal",function(h,t){t=t||!1;if(Array.isArray(h))for(var c=0;c<h.length;c++)a.remove_consent_internal(h[c],
t);else b(V,a)[h]?b(V,a)[h].features?a.remove_consent_internal(b(V,a)[h].features,t):(b(V,a)[h].optin=!1,t&&!1!==b(V,a)[h].optin&&b(id,a).call(a)):b(e,a).call(a,f.WARNING,"remove_consent, No feature available for ["+h+"]")});y(this,"enable_offline_mode",function(){b(U,a)?b(e,a).call(a,f.WARNING,"enable_offline_mode, Countly is already in offline mode."):(b(e,a).call(a,f.INFO,"enable_offline_mode, Enabling offline mode"),a.remove_consent_internal(w.features,!1),l(U,a,!0),b(Oc,a).call(a),a.device_id=
"[CLY]_temp_id",l(P,a,2))});y(this,"disable_offline_mode",function(h){if(b(U,a)){b(e,a).call(a,f.INFO,"disable_offline_mode, Disabling offline mode");l(U,a,!1);h&&a.device_id!==h?(a.device_id=h,l(P,a,0),b(B,a).call(a,"cly_id",a.device_id),b(B,a).call(a,"cly_id_type",0),b(e,a).call(a,f.INFO,"disable_offline_mode, Changing id to: "+a.device_id)):(a.device_id=b(Sc,a).call(a),"[CLY]_temp_id"===a.device_id&&(a.device_id=$c()),a.device_id!==b(F,a).call(a,"cly_id")&&(b(B,a).call(a,"cly_id",a.device_id),
b(B,a).call(a,"cly_id_type",1)));h=!1;if(0<b(H,a).length)for(var t=0;t<b(H,a).length;t++)"[CLY]_temp_id"===b(H,a)[t].device_id&&(b(H,a)[t].device_id=a.device_id,b(H,a)[t].t=b(P,a),h=!0);h&&b(B,a).call(a,"cly_queue",b(H,a),!0);b(Zb,a)&&(b(Aa,a).sendInstantHCRequest(),l(Zb,a,!1));b(Jc,a).call(a);b(Jb,a)&&(b($a,a).call(a),l(Ec,a,!0))}else b(e,a).call(a,f.WARNING,"disable_offline_mode, Countly was not in offline mode.")});y(this,"begin_session",function(h,t){if(b(Ib,a))if(b(e,a).call(a,f.INFO,"begin_session, Starting the session. There was an ongoing session: ["+
b(oa,a)+"]"),h&&b(e,a).call(a,f.INFO,"begin_session, Heartbeats are disabled"),t&&b(e,a).call(a,f.INFO,"begin_session, Session starts irrespective of session cookie"),a.check_consent("sessions")){if(!b(oa,a)){if(a.enableOrientationTracking){b(ld,a).call(a);var c;M(window,"resize",function(){clearTimeout(c);c=setTimeout(function(){b(ld,a).call(a)},200)})}l(Ba,a,L());l(oa,a,!0);l(fb,a,!h);h=b(F,a).call(a,"cly_session");b(e,a).call(a,f.VERBOSE,"begin_session, Session state, forced: ["+t+"], useSessionCookie: ["+
b(Ca,a)+"], seconds to expire: ["+(h-b(Ba,a))+"], expired: ["+(parseInt(h)<=L())+"] ");if(t||!b(Ca,a)||!h||parseInt(h)<=L())b(e,a).call(a,f.INFO,"begin_session, Session started"),null===b(Wa,a)&&l(Wa,a,!0),t={begin_session:1},t.metrics=JSON.stringify(b(Sb,a).call(a)),a.userData.save(!0),b(ea,a).call(a,t);b(B,a).call(a,"cly_session",L()+60*b(jb,a))}}else b(ua,a).begin_session=[h,t];else b(e,a).call(a,f.INFO,"begin_session, Session tracking is disabled by server config")});y(this,"session_duration",
function(h){b(Ib,a)?(b(e,a).call(a,f.INFO,"session_duration, Reporting session duration: ["+h+"]"),a.check_consent("sessions")&&(b(oa,a)?(b(e,a).call(a,f.INFO,"session_duration, Session extended: ["+h+"]"),a.userData.save(!0),b(ea,a).call(a,{session_duration:h}),b(qd,a).call(a)):b(e,a).call(a,f.DEBUG,"session_duration, No session was started"))):b(e,a).call(a,f.INFO,"session_duration, Session tracking is disabled by server config")});y(this,"end_session",function(h,t){b(Ib,a)||t?(b(e,a).call(a,f.INFO,
"end_session, Ending the current session. There was an on going session:["+b(oa,a)+"]"),a.check_consent("sessions")&&b(oa,a)&&(h=h||L()-b(Ba,a),b(Rc,a).call(a),!b(Ca,a)||t?(b(e,a).call(a,f.INFO,"end_session, Session ended"),a.userData.save(!0),b(ea,a).call(a,{end_session:1,session_duration:h})):a.session_duration(h),l(oa,a,!1))):b(e,a).call(a,f.INFO,"end_session, Session tracking is disabled by server config")});y(this,"set_id",function(h){b(e,a).call(a,f.INFO,"set_id, Changing the device ID to:["+
h+"]");null==h||""===h?b(e,a).call(a,f.WARNING,"set_id, The provided device is not a valid ID"):0===b(P,a)?a.change_id(h,!1):a.change_id(h,!0)});y(this,"change_id",function(h,t){b(e,a).call(a,f.INFO,"change_id, Changing the device ID to: ["+h+"] with merge:["+t+"]");if(h&&"string"===typeof h&&0!==h.length)if(b(U,a))b(e,a).call(a,f.WARNING,"change_id, Offline mode was on, initiating disabling sequence instead."),a.disable_offline_mode(h);else if(a.device_id==h)b(e,a).call(a,f.DEBUG,"change_id, Provided device ID is equal to the current device ID. Aborting.");
else{t||(b(za,a).call(a),b(ya,a).call(a),a.end_session(null,!0),l(sa,a,{}),a.remove_consent_internal(w.features,!1));var c=a.device_id;a.device_id=h;a.device_id=a.device_id;l(P,a,0);b(B,a).call(a,"cly_id",a.device_id);b(B,a).call(a,"cly_id_type",0);b(e,a).call(a,f.INFO,"change_id, Changing ID from:["+c+"] to ["+h+"]");t?b(ea,a).call(a,{old_device_id:c}):a.begin_session(!b(fb,a),!0);a.remote_config&&(l(fa,a,{}),b(B,a).call(a,"cly_remote_configs",b(fa,a)),t?(b(Ta,a)&&clearTimeout(b(Ta,a)),l(Ta,a,setTimeout(function(){l(Ta,
a,null);a.fetch_remote_config(a.remote_config)},1E3))):a.fetch_remote_config(a.remote_config))}else b(e,a).call(a,f.WARNING,"change_id, The provided device ID is not a valid ID")});y(this,"add_event",function(h){b(e,a).call(a,f.INFO,"add_event, Adding event: ",h);switch(h.key){case da.NPS:var t=a.check_consent("feedback");break;case da.SURVEY:t=a.check_consent("feedback");break;case da.STAR_RATING:t=a.check_consent("star-rating");break;case da.VIEW:t=a.check_consent("views");break;case da.ORIENTATION:t=
a.check_consent("users");break;case da.ACTION:t=a.check_consent("clicks")||a.check_consent("scrolls");break;default:t=b(uc,a)?a.check_consent("events"):!1}t&&b(pa,a).call(a,h)});y(this,"attempt_to_send_stored_requests",function(){b(e,a).call(a,f.INFO,"attemptToSendStoredRequests, Attempting to send stored requests");b(za,a).call(a);b(ya,a).call(a)});y(this,"test_mode_rq",function(h){b(e,a).call(a,f.INFO,"test_mode_rq, Setting test mode to: ["+h+"]");a.test_mode=h});q(this,pa,function(h,t){if(a.ignore_visitor||
!b(Hb,a))b(e,a).call(a,f.WARNING,"Not adding the event. Tracking is disabled by the server config:["+!b(Hb,a)+"] or ignore_visitor is:["+a.ignore_visitor+"]");else if(h.key)if(b(gc,a)||a.userData.save(!0),h.count||(h.count=1),b(Qd,a).call(a,h.key)){var c=h.key;ve.includes(h.key)||(h.key=I(h.key,b(Q,a),"add_cly_event",b(e,a)));h.segmentation=b(Rd,a).call(a,h.key,h.segmentation);h.segmentation=Ia(h.segmentation,b(Q,a),b(O,a),b(ka,a),"add_cly_event",b(e,a));h=Tb(h,["key","count","sum","dur","segmentation"]);
h.timestamp=yb();var d=new Date;h.hour=d.getHours();h.dow=d.getDay();h.id=t||Zc();h.key===da.VIEW?h.pvid=b(Db,a)||"":h.cvid=b(Na,a)||"";b(Y,a).push(h);b(B,a).call(a,"cly_event",b(Y,a));b(e,a).call(a,f.INFO,"With event ID: ["+h.id+"], successfully adding the last event:",h);b(Sd,a).call(a,c,h.id)}else b(e,a).call(a,f.DEBUG,"add_cly_event, Event was filtered out by behavior settings: ["+h.key+"]");else b(e,a).call(a,f.ERROR,"Adding event failed. Event must have a key property")});q(this,Qd,function(h){return b(Kb,
a)&&0<b(Kb,a).length?-1===b(Kb,a).indexOf(h):b(Lb,a)&&0<b(Lb,a).length?-1!==b(Lb,a).indexOf(h):!0});q(this,Rd,function(h,t){if(!t||"object"!==T(t))return t;var c={},d;for(d in t)Object.prototype.hasOwnProperty.call(t,d)&&(c[d]=t[d]);if(b(Ob,a)&&0<b(Ob,a).length)b(Ob,a).forEach(function(n){delete c[n]});else if(b(Pb,a)&&0<b(Pb,a).length)for(var g in c)Object.prototype.hasOwnProperty.call(c,g)&&-1===b(Pb,a).indexOf(g)&&delete c[g];t=b(Cc,a)[h];if(Array.isArray(t)&&0<t.length)t.forEach(function(n){delete c[n]});
else if(h=b(Dc,a)[h],Array.isArray(h)&&0<h.length)for(var k in c)Object.prototype.hasOwnProperty.call(c,k)&&-1===h.indexOf(k)&&delete c[k];return c});q(this,Rb,function(h){return b(Mb,a)&&0<b(Mb,a).length?-1===b(Mb,a).indexOf(h):b(Nb,a)&&0<b(Nb,a).length?-1!==b(Nb,a).indexOf(h):!0});q(this,jd,function(h){if(!h||"object"!==T(h))return h;var t={},c;for(c in h)Object.prototype.hasOwnProperty.call(h,c)&&b(Rb,a).call(a,c)&&(t[c]=h[c]);return t});q(this,Sd,function(h,t){Array.isArray(b(Qb,a))&&0!==b(Qb,
a).length&&-1!==b(Qb,a).indexOf(h)&&(b(e,a).call(a,f.DEBUG,"journeyTrigger, Matched journey trigger event: ["+h+"]"),b(za,a).call(a),b(ya,a).call(a),t&&b(Za,a).add(t),b(sb,a)?(b(e,a).call(a,f.DEBUG,"journeyTrigger, Already processing, marking as pending"),l(tb,a,!0)):b(kd,a).call(a))});q(this,kd,Xc(bb().m(function t(){var c;return bb().w(function(d){for(;;)switch(d.p=d.n){case 0:if(!b(sb,a)){d.n=1;break}return d.a(2);case 1:return l(sb,a,!0),l(tb,a,!1),d.p=2,d.n=3,b(Td,a).call(a);case 3:(c=d.v)?b(Lc,
a).call(a):b(e,a).call(a,f.DEBUG,"journeyTrigger, Could not flush request queue before content refresh");case 4:return d.p=4,l(sb,a,!1),b(tb,a)&&(b(e,a).call(a,f.DEBUG,"journeyTrigger, Processing pending journey trigger"),l(tb,a,!1),setTimeout(function(){b(za,a).call(a);b(ya,a).call(a);b(kd,a).call(a)},0)),d.f(4);case 5:return d.a(2)}},t,null,[[2,,4,5]])})));q(this,Td,Xc(bb().m(function c(){var d,g,k;return bb().w(function(n){for(;;)switch(n.n){case 0:null!==b(xa,a)&&b(Ic,a).call(a);d=b(H,a).length;
if(0!==d){n.n=1;break}return n.a(2,!0);case 1:g=0;case 2:if(!(g<d)){n.n=6;break}n.n=3;return b(Ud,a).call(a);case 3:if(k=n.v){n.n=4;break}return n.a(2,!1);case 4:if(0!==b(H,a).length){n.n=5;break}return n.a(2,!0);case 5:g++;n.n=2;break;case 6:return n.a(2,0===b(H,a).length)}},c)})));q(this,Ud,function(){return new Promise(function(){var c=Xc(bb().m(function k(g){var n;return bb().w(function(m){for(;;)switch(m.n){case 0:if(!b(U,a)){m.n=1;break}g(!1);return m.a(2);case 1:if(0!==b(H,a).length){m.n=2;
break}g(!0);return m.a(2);case 2:n=0;case 3:if(!((!b(Ka,a)||b(Fa,a)||L()<=b(Ua,a))&&5>n)){m.n=5;break}n++;m.n=4;return b(Wd,a).call(a,500);case 4:m.n=3;break;case 5:if(!(!b(Ka,a)||b(Fa,a)||L()<=b(Ua,a))){m.n=6;break}g(!1);return m.a(2);case 6:b(rd,a).call(a,"journey_trigger_send_request",