UNPKG

@convivainc/conviva-js-agent-tracker

Version:

Conviva JavaScript Agent SDK to auto-collect events and track application-specific events and state changes.

103 lines (102 loc) 183 kB
/*! * Browser tracker for Conviva v1.3.0 (http://bit.ly/sp-js) * Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang * Licensed under BSD-3-Clause */ 'use strict';!function(ya,la){"object"==typeof exports&&"undefined"!=typeof module?la(exports):"function"==typeof define&&define.amd?define(["exports"],la):la((ya="undefined"!=typeof globalThis?globalThis:ya||self).convivaBrowserTracking={})}(this,function(ya){function la(a){return la="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},la(a)}function Eg(a, c,b,d){return new (b||(b=Promise))(function(e,g){function f(m){try{l(d.next(m))}catch(q){g(q)}}function h(m){try{l(d.throw(m))}catch(q){g(q)}}function l(m){var q;m.done?e(m.value):(q=m.value,q instanceof b?q:new b(function(p){p(q)})).then(f,h)}l((d=d.apply(a,c||[])).next())})}function Fg(a,c){function b(l){return function(m){return function(q){if(d)throw new TypeError("Generator is already executing.");for(;h&&(h=0,q[0]&&(f=0)),f;)try{if(d=1,e&&(g=2&q[0]?e.return:q[0]?e.throw||((g=e.return)&&g.call(e), 0):e.next)&&!(g=g.call(e,q[1])).done)return g;switch(e=0,g&&(q=[2&q[0],g.value]),q[0]){case 0:case 1:g=q;break;case 4:return f.label++,{value:q[1],done:!1};case 5:f.label++;e=q[1];q=[0];continue;case 7:q=f.ops.pop();f.trys.pop();continue;default:if(!(g=f.trys,(g=0<g.length&&g[g.length-1])||6!==q[0]&&2!==q[0])){f=0;continue}if(3===q[0]&&(!g||q[1]>g[0]&&q[1]<g[3]))f.label=q[1];else if(6===q[0]&&f.label<g[1])f.label=g[1],g=q;else if(g&&f.label<g[2])f.label=g[2],f.ops.push(q);else{g[2]&&f.ops.pop();f.trys.pop(); continue}}q=c.call(a,f)}catch(p){q=[6,p],e=0}finally{d=g=0}if(5&q[0])throw q[1];return{value:q[0]?q[1]:void 0,done:!0}}([l,m])}}var d,e,g,f={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]},h=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return h.next=b(0),h.throw=b(1),h.return=b(2),"function"==typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h}function Fa(a,c,b){if(b||2===arguments.length)for(var d,e=0,g=c.length;e<g;e++)!d&&e in c||(d|| (d=Array.prototype.slice.call(c,0,e)),d[e]=c[e]);return a.concat(d||Array.prototype.slice.call(c))}function Gg(a){if(!a)return a;switch(4-a.length%4){case 2:a+="==";break;case 3:a+="="}return function(c){var b,d,e,g=0,f=0,h="",l=[];if(!c)return c;c+="";do{var m=(b=Ya.indexOf(c.charAt(g++))<<18|Ya.indexOf(c.charAt(g++))<<12|(d=Ya.indexOf(c.charAt(g++)))<<6|(e=Ya.indexOf(c.charAt(g++))))>>16&255;var q=b>>8&255;b&=255;l[f++]=64===d?String.fromCharCode(m):64===e?String.fromCharCode(m,q):String.fromCharCode(m, q,b)}while(g<c.length);return h=l.join(""),function(p){return decodeURIComponent(p.split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(h.replace(/\0+$/,""))}(a.replace(/-/g,"+").replace(/_/g,"/"))}function wd(){var a,c={},b=[],d=[],e=[],g=function(f,h){null!=h&&""!==h&&(c[f]=h)};return{add:g,addDict:function(f){for(var h in f)Object.prototype.hasOwnProperty.call(f,h)&&g(h,f[h])},addJson:function(f,h,l){l&&Ge(l)&&(f={keyIfEncoded:f,keyIfNotEncoded:h,json:l}, d.push(f),b.push(f))},addContextEntity:function(f){e.push(f)},getPayload:function(){return c},getJson:function(){return b},withJsonProcessor:function(f){a=f},build:function(){return null==a||a(this,d,e),c}}}function Hg(a){return function(c,b,d){for(var e=function(m,q,p){m=JSON.stringify(m);if(a){p=c.add;if(m){var n,y=0,E=0,x=[];if(m){m=unescape(encodeURIComponent(m));do{var z=(n=m.charCodeAt(y++)<<16|m.charCodeAt(y++)<<8|m.charCodeAt(y++))>>18&63;var w=n>>12&63;var u=n>>6&63;n&=63;x[E++]=Ya.charAt(z)+ Ya.charAt(w)+Ya.charAt(u)+Ya.charAt(n)}while(y<m.length);z=x.join("");m=m.length%3;m=(m?z.slice(0,m-3):z)+"===".slice(m||3)}m=m.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}p.call(c,q,m)}else c.add(p,m)},g=function(m,q){m||(m=c.getPayload(),m=(a?m.cx:m.co)?JSON.parse(a?Gg(m.cx):m.co):void 0);return m?m.dt=m.dt.concat(q.dt):m=q,m},f=void 0,h=0;h<b.length;h++){var l=b[h];"cx"===l.keyIfEncoded?f=g(f,l.json):e(l.json,l.keyIfEncoded,l.keyIfNotEncoded)}(b.length=0,d.length)&&(f=g(f,{sc:"sp/ctx/1-0-0", dt:Fa([],d,!0)}),d.length=0);f&&e(f,"cx","co")}}function Ge(a){if(!He(a))return!1;for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c))return!0;return!1}function He(a){return null!=a&&(a.constructor==={}.constructor||a.constructor===[].constructor)}function Ig(){var a=[],c=[],b=function(d){var e=function(l){var m=0;for(l=l.getJson();m<l.length;m++){var q=l[m];if("ue_px"===q.keyIfEncoded&&"object"===la(q.json.data)&&(q=q.json.data.schema,"string"==typeof q))return q}return""}(d),g=function(l){l= l.getPayload().e;return"string"==typeof l?l:""}(d),f=[],h=xd(a,d,g,e);f.push.apply(f,h);d=function(l,m,q,p){var n;l=Ie(l).map(function(y){if((y=function(E,x,z,w){if(Je(E)){var u=E[0],t=!1;try{t=u({event:x.getPayload(),eventType:z,eventSchema:w})}catch(F){t=!1}if(!0===t)return xd(E[1],x,z,w)}else if(Ke(E)&&function(F,G){var Q=0,C=0,L=F.accept;Array.isArray(L)?F.accept.some(function(O){return Mc(O,G)})&&C++:"string"==typeof L&&Mc(L,G)&&C++;L=F.reject;Array.isArray(L)?F.reject.some(function(O){return Mc(O, G)})&&Q++:"string"==typeof L&&Mc(L,G)&&Q++;return 0<C&&0===Q?!0:!1}(E[0],w))return xd(E[1],x,z,w);return[]}(y,m,q,p))&&0!==y.length)return y});return(n=[]).concat.apply(n,l.filter(function(y){return null!=y&&y.filter(Boolean)}))}(c,d,g,e);return f.push.apply(f,d),f};return{getGlobalPrimitives:function(){return a},getConditionalProviders:function(){return c},addGlobalContexts:function(d){for(var e=[],g=[],f=0;f<d.length;f++){var h=d[f];Le(h)?e.push(h):Sb(h)&&g.push(h)}a=a.concat(g);c=c.concat(e)}, clearGlobalContexts:function(){c=[];a=[]},removeGlobalContexts:function(d){for(var e=function(f){Le(f)?c=c.filter(function(h){return JSON.stringify(h)!==JSON.stringify(f)}):Sb(f)&&(a=a.filter(function(h){return JSON.stringify(h)!==JSON.stringify(f)}))},g=0;g<d.length;g++)e(d[g])},getApplicableContexts:function(d){return b(d)}}}function Me(a){for(var c,b=[],d=1;d<arguments.length;d++)b[d-1]=arguments[d];return null!==(c=null==a?void 0:a.map(function(e){if("function"!=typeof e)return e;try{return e.apply(void 0, b)}catch(g){}}).filter(Boolean))&&void 0!==c?c:[]}function Ne(a){a=a.split(".");return!!(a&&1<a.length)&&function(c){if("*"===c[0]||"*"===c[1])return!1;if(0<c.slice(2).length){var b=!1,d=0;for(c=c.slice(2);d<c.length;d++)if("*"===c[d])b=!0;else if(b)return!1;return!0}return 2==c.length}(a)}function Oe(a){a=/^iglu:((?:(?:[a-zA-Z0-9-_]+|\*).)+(?:[a-zA-Z0-9-_]+|\*))\/([a-zA-Z0-9-_.]+|\*)\/jsonschema\/([1-9][0-9]*|\*)-(0|[1-9][0-9]*|\*)-(0|[1-9][0-9]*|\*)$/.exec(a);if(null!==a&&Ne(a[1]))return a.slice(1, 6)}function yd(a){if(a=Oe(a)){var c=a[0];return 5===a.length&&Ne(c)}return!1}function Pe(a){return function(c){return Array.isArray(c)&&c.every(function(b){return"string"==typeof b})}(a)?a.every(function(c){return yd(c)}):"string"==typeof a&&yd(a)}function fc(a){return!!(Ge(a)&&"sc"in a&&"dt"in a)&&"string"==typeof a.sc&&"object"===la(a.dt)}function Nc(a){return"function"==typeof a&&1>=a.length}function Sb(a){return Nc(a)||fc(a)}function Je(a){return!(!Array.isArray(a)||2!==a.length)&&(Array.isArray(a[1])? Nc(a[0])&&a[1].every(Sb):Nc(a[0])&&Sb(a[1]))}function Ke(a){return!(!Array.isArray(a)||2!==a.length)&&!!function(c){var b=0;if(null!=c&&"object"===la(c)&&!Array.isArray(c)){if(Object.prototype.hasOwnProperty.call(c,"accept")){if(!Pe(c.accept))return!1;b+=1}if(Object.prototype.hasOwnProperty.call(c,"reject")){if(!Pe(c.reject))return!1;b+=1}return 0<b&&2>=b}return!1}(a[0])&&(Array.isArray(a[1])?a[1].every(Sb):Sb(a[1]))}function Le(a){return Je(a)||Ke(a)}function Mc(a,c){if(!yd(a))return!1;a=Oe(a);c= function(d){d=/^iglu:([a-zA-Z0-9-_.]+)\/([a-zA-Z0-9-_]+)\/jsonschema\/([1-9][0-9]*)-(0|[1-9][0-9]*)-(0|[1-9][0-9]*)$/.exec(d);if(null!==d)return d.slice(1,6)}(c);if(a&&c){if(!function(d,e){e=e.split(".");d=d.split(".");if(e&&d){if(e.length!==d.length)return!1;for(var g=0;g<d.length;g++)if(!Qe(e[g],d[g]))return!1;return!0}return!1}(a[0],c[0]))return!1;for(var b=1;5>b;b++)if(!Qe(a[b],c[b]))return!1;return!0}return!1}function Qe(a,c){return a&&c&&"*"===a||a===c}function Ie(a){return Array.isArray(a)? a:[a]}function xd(a,c,b,d){var e;a=Ie(a).map(function(g){a:if(fc(g))g=[g];else{if(Nc(g)){b:{var f=void 0;try{var h=(f=g({event:c.getPayload(),eventType:b,eventSchema:d}),Array.isArray(f)&&f.every(fc)||fc(f)?f:void 0);break b}catch(l){}h=void 0}if(fc(h)){g=[h];break a}if(Array.isArray(h)){g=h;break a}}g=void 0}if(g&&0!==g.length)return g});return(e=[]).concat.apply(e,a.filter(function(g){return null!=g&&g.filter(Boolean)}))}function Jg(a){void 0===a&&(a={});var c=a.base64,b=a.corePlugins,d=null!=b? b:[];c=function(g,f,h){var l=function(n){return{addPluginContexts:function(y){var E=y?Fa([],y,!0):[];return n.forEach(function(x){try{x.contexts&&E.push.apply(E,x.contexts())}catch(z){ea.error("Error adding plugin contexts",z)}}),E}}}(f),m=Ig(),q=g,p={};return{track:function(n,y,E){n.withJsonProcessor(Hg(q));n.add("eid",sb.v4());n.addDict(p);E=function(z){return null==z?{type:"dtm",value:(new Date).getTime()}:"number"==typeof z?{type:"dtm",value:z}:"ttm"===z.type?{type:"ttm",value:z.value}:{type:"dtm", value:z.value||(new Date).getTime()}}(E);n.add(E.type,E.value.toString());y=function(z){if(z&&z.length)return{sc:"sp/ctx/1-0-0",dt:z}}(function(z,w){z=m.getApplicableContexts(z);var u=[];return w&&w.length&&u.push.apply(u,w),z&&z.length&&u.push.apply(u,z),u}(n,l.addPluginContexts(y)));void 0!==y&&n.addJson("cx","co",y);f.forEach(function(z){try{z.beforeTrack&&z.beforeTrack(n)}catch(w){ea.error("Plugin beforeTrack",w)}});"function"==typeof h&&h(n);var x=n.build();return f.forEach(function(z){try{z.afterTrack&& z.afterTrack(x)}catch(w){ea.error("Plugin afterTrack",w)}}),x},addPayloadPair:function(n,y){p[n]=y},configuration:a,getConfig:function(){return a},setConfig:function(n){n&&(void 0!==n.base64&&(a.base64=n.base64,q=n.base64),void 0!==n.lifecycleAutotracking&&(a.lifecycleAutotracking=n.lifecycleAutotracking),void 0!==n.cacheRefreshInterval&&(a.cacheRefreshInterval=n.cacheRefreshInterval),void 0!==n.exceptionAutotracking&&(a.exceptionAutotracking=n.exceptionAutotracking),void 0!==n.enablePeriodicHeartbeat&& (a.enablePeriodicHeartbeat=n.enablePeriodicHeartbeat),void 0!==n.periodicHeartbeatInterval&&(a.periodicHeartbeatInterval=n.periodicHeartbeatInterval),void 0!==n.enc&&(a.enc=n.enc),void 0!==n.mend&&(a.mend=n.mend),void 0!==n.maxLocalStorageQueueSize&&(a.maxLocalStorageQueueSize=n.maxLocalStorageQueueSize),void 0!==n.maxGetBytes&&(a.maxGetBytes=n.maxGetBytes),void 0!==n.bufferSize&&(a.bufferSize=n.bufferSize),void 0!==n.customEventTrackingConfiguration&&(a.customEventTrackingConfiguration=n.customEventTrackingConfiguration), void 0!==n.networkRequestTrackingConfiguration&&(a.networkRequestTrackingConfiguration=n.networkRequestTrackingConfiguration),void 0!==n.traceparentconfig&&(a.traceparentconfig=n.traceparentconfig),void 0!==n.metaTagsTrackingConfiguration&&(a.metaTagsTrackingConfiguration=n.metaTagsTrackingConfiguration),void 0!==n.evtStreamTrackingConfiguration&&(a.evtStreamTrackingConfiguration=n.evtStreamTrackingConfiguration),void 0!==n.performanceContextConfig&&(a.performanceContextConfig=n.performanceContextConfig), void 0!==n.configurationVersion&&(a.configurationVersion=n.configurationVersion),void 0!==n.catRcLastUpdatedTs&&(a.catRcLastUpdatedTs=n.catRcLastUpdatedTs),void 0!==n.endpoint&&(a.endpoint=n.endpoint),void 0!==n.controlIngestConfig&&(a.controlIngestConfig=n.controlIngestConfig),void 0!==n.applicationContext&&(a.applicationContext=n.applicationContext),void 0!==n.emitterConfiguration&&(a.emitterConfiguration=n.emitterConfiguration),void 0!==n.di&&(a.di=n.di),void 0!==n.clickcc&&(a.clickcc=n.clickcc), void 0!==n.collectionRateLimit&&(a.collectionRateLimit=n.collectionRateLimit),void 0!==n.pageUrlTrackingConfig?a.pageUrlTrackingConfig=n.pageUrlTrackingConfig:a.pageUrlTrackingConfig=null)},getBase64Encoding:function(){return q},setBase64Encoding:function(n){q=n},addPayloadDict:function(n){for(var y in n)Object.prototype.hasOwnProperty.call(n,y)&&(p[y]=n[y])},resetPayloadPairs:function(n){p=He(n)?n:{}},setTrackerVersion:function(n){p.tv=n},setTrackerNamespace:function(n){p.tna=n},setAppId:function(n){p.aid= n},setPlatform:function(n){p.p=n},setUserId:function(n){p.uid=n},setScreenResolution:function(n,y){p.res=n+"x"+y},setViewport:function(n,y){p.vp=n+"x"+y},setColorDepth:function(n){p.cd=n},setTimezone:function(n){p.tz=n},setLang:function(n){p.lang=n},setIpAddress:function(n){p.ip=n},setUseragent:function(n){p.ua=n},addGlobalContexts:function(n){m.addGlobalContexts(n)},clearGlobalContexts:function(){m.clearGlobalContexts()},removeGlobalContexts:function(n){m.removeGlobalContexts(n)}}}(null==c||c,d, a.callback);var e=ba(ba({},c),{addPlugin:function(g){var f,h;g=g.plugin;d.push(g);null===(f=g.logger)||void 0===f||f.call(g,ea);null===(h=g.activateCorePlugin)||void 0===h||h.call(g,e)}});return null==d||d.forEach(function(g){var f,h;null===(f=g.logger)||void 0===f||f.call(g,ea);null===(h=g.activateCorePlugin)||void 0===h||h.call(g,e)}),e}function Eb(a){var c=a.event;a=c.sc;var b=c.dt;c=wd();a={sc:"sp/ue/1-0-0",dt:{sc:a,dt:b}};return c.add("e","ue"),c.addJson("ue_px","ue_pr",a),c}function gc(a){return Eb({event:{sc:"cv/re/1-0-1", dt:Tb({name:a.name,data:a.data})}})}function Tb(a,c){void 0===c&&(c={});var b={},d;for(d in a)(c[d]||null!==a[d]&&void 0!==a[d])&&(b[d]=a[d]);return b}function Ub(a){for(var c=a.length;0<=--c;)a[c]=0}function zd(a,c,b,d,e){this.static_tree=a;this.extra_bits=c;this.extra_base=b;this.elems=d;this.max_length=e;this.has_stree=a&&a.length}function Ad(a,c){this.dyn_tree=a;this.max_code=0;this.stat_desc=c}function eb(a,c,b,d,e){this.good_length=a;this.max_lazy=c;this.nice_length=b;this.max_chain=d;this.func= e}function Kg(){this.strm=null;this.status=0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex=0;this.method=Oc;this.last_flush=-1;this.w_mask=this.w_bits=this.w_size=0;this.window=null;this.window_size=0;this.head=this.prev=null;this.nice_match=this.good_match=this.strategy=this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=this.lookahead=this.match_start=this.strstart=this.match_available=this.prev_match=this.match_length= this.block_start=this.hash_shift=this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new Uint16Array(1146);this.dyn_dtree=new Uint16Array(122);this.bl_tree=new Uint16Array(78);tb(this.dyn_ltree);tb(this.dyn_dtree);tb(this.bl_tree);this.bl_desc=this.d_desc=this.l_desc=null;this.bl_count=new Uint16Array(16);this.heap=new Uint16Array(573);tb(this.heap);this.heap_max=this.heap_len=0;this.depth=new Uint16Array(573);tb(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches= this.static_len=this.opt_len=this.sym_end=this.sym_next=this.lit_bufsize=this.sym_buf=0}function hc(a){a=this.options=Re({level:Lg,method:Mg,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ng},a||{});a.raw&&0<a.windowBits?a.windowBits=-a.windowBits:a.gzip&&0<a.windowBits&&16>a.windowBits&&(a.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new Se;this.strm.avail_out=0;var c=ic.deflateInit2(this.strm,a.level,a.method,a.windowBits,a.memLevel,a.strategy);if(c!==Pc)throw Error(Fb[c]); if(a.header&&ic.deflateSetHeader(this.strm,a.header),a.dictionary){var b;if(b="string"==typeof a.dictionary?Bd(a.dictionary):"[object ArrayBuffer]"===Te.call(a.dictionary)?new Uint8Array(a.dictionary):a.dictionary,(c=ic.deflateSetDictionary(this.strm,b))!==Pc)throw Error(Fb[c]);this._dict_set=!0}}function Cd(a,c){c=new hc(c);if(c.push(a,!0),c.err)throw c.msg||Fb[c.err];return c.result}function Og(){this.strm=null;this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax= this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new Uint16Array(320);this.work=new Uint16Array(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function jc(a){var c=this.options=Re({chunkSize:65536,windowBits:15,to:""},a||{});c.raw&&0<=c.windowBits&&16>c.windowBits&& (c.windowBits=-c.windowBits,0===c.windowBits&&(c.windowBits=-15));!(0<=c.windowBits&&16>c.windowBits)||a&&a.windowBits||(c.windowBits+=32);15<c.windowBits&&48>c.windowBits&&(15&c.windowBits||(c.windowBits|=15));this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new Se;this.strm.avail_out=0;a=kb.inflateInit2(this.strm,c.windowBits);if(a!==kc)throw Error(Fb[a]);if(this.header=new Pg,kb.inflateGetHeader(this.strm,this.header),c.dictionary&&("string"==typeof c.dictionary?c.dictionary=Bd(c.dictionary): "[object ArrayBuffer]"===Ue.call(c.dictionary)&&(c.dictionary=new Uint8Array(c.dictionary)),c.raw&&(a=kb.inflateSetDictionary(this.strm,c.dictionary))!==kc))throw Error(Fb[a]);}function Dd(a,c){c=new jc(c);if(c.push(a),c.err)throw c.msg||Fb[c.err];return c.result}function Ed(a){return!(!a||"string"!=typeof a.valueOf())}function lc(a){return Number.isInteger&&Number.isInteger(a)||"number"==typeof a&&isFinite(a)&&Math.floor(a)===a}function Fd(a){if(!Ed(a)){a=a.text||"";var c=document.getElementsByTagName("title"); c&&null!=c[0]&&(a=c[0].text)}return a}function Qc(a){var c=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(a);return c?c[1]:a}function Ve(a){var c=a.length;return"."===a.charAt(--c)&&(a=a.slice(0,c)),"*."===a.slice(0,2)&&(a=a.slice(1)),a}function Gd(a){var c=window,b=mc("referrer",c.location.href)||mc("referer",c.location.href);if(b)return b;if(a)return a;try{if(c.top)return c.top.document.referrer;if(c.parent)return c.parent.document.referrer}catch(d){}return document.referrer}function bb(a,c, b,d){return void 0!==a&&(a.addEventListener?(a.addEventListener(c,b,d),!0):a.attachEvent?a.attachEvent("on"+c,b):void(a["on"+c]=b))}function mc(a,c){return(a=(new RegExp("^[^#]*[?&]"+a+"=([^&#]*)")).exec(c))?decodeURIComponent(a[1].replace(/\+/g," ")):null}function Rc(a,c,b){void 0===b&&(b=63072E3);try{var d=window.localStorage,e=Date.now()+1E3*b;return d.setItem("".concat(a,".expires"),e.toString()),d.setItem(a,c),!0}catch(g){return!1}}function We(a){try{var c=window.localStorage;return c.removeItem(a), c.removeItem(a+".expires"),!0}catch(b){return!1}}function Za(a,c,b,d,e,g,f){return 1<arguments.length?document.cookie=a+"="+encodeURIComponent(null!=c?c:"")+(b?"; Expires="+(new Date(+new Date+1E3*b)).toUTCString():"")+(d?"; Path="+d:"")+(e?"; Domain="+e:"")+(g?"; SameSite="+g:"")+(f?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+a+"=")[1]||"").split(";")[0])}function Xe(a){try{var c=null===window||void 0===window?void 0:window.localStorage;return!!c&&(c.removeItem(a),!0)}catch(b){return!1}} function Sc(){"undefined"!=typeof window&&void 0!==window.localStorage&&localStorage.removeItem(H.SAMPLING_STORAGE_RANDOM_NUMBER_KEY)}function Hd(a,c){return void 0!==a.act&&void 0!==a.act[c]&&(a=a.act[c],void 0!==a)?a:H.DEFAULT_SAMPLING_ACTION[c]}function Na(a,c){return a.length<=c?a:a.slice(0,c-3)+"..."}function Ye(a,c,b,d){var e=[pa.request_body,pa.response_body,pa.request_headers,pa.response_headers,pa.request_query],g={};if(c&&0<c.length)for(var f=0;f<c.length;f++){var h=c[f],l=h.conditions; var m=void 0;var q=["conditions"],p={};for(m in h)Object.prototype.hasOwnProperty.call(h,m)&&0>q.indexOf(m)&&(p[m]=h[m]);if(null!=h&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(m=Object.getOwnPropertySymbols(h);n<m.length;n++)0>q.indexOf(m[n])&&Object.prototype.propertyIsEnumerable.call(h,m[n])&&(p[m[n]]=h[m[n]])}m=p;try{a:{h=a;try{for(q=0;q<l.length;q++){var y=l[q];p=!1;if(0<Object.keys(y).length){n=0;for(var E=Object.entries(y);n<E.length;n++){var x=E[n],z=x[1],w=h[x[0]];if(0<z.length){for(var u= 0,t=0,F=z;t<F.length;t++){var G=F[t],Q="contains",C=G;if("object"===la(G)&&G.length?(Q=G[1],C=G[0]):"boolean"!=typeof G&&null!==G||(Q="equal",C=G),Qg(w,Q,C)){p=!0;break}if(p=!1,u+1===z.length)break;u++}if(!1===p)break}}}if(p){var L=!0;break a}}}catch(Z){console.warn("Conviva App Tracker: Error in Applying nwreqConfig ".concat(Z))}L=!1}if(L){h=0;for(var O=Object.entries(a);h<O.length;h++){var T=O[h],S=T[0],ma=T[1];e.includes(S)||(g[S]=ma)}h=0;for(var V=Object.entries(m);h<V.length;h++){var ia=V[h]; S=ia[0];ma=ia[1];try{if(ma&&0<m[S].length){q=!1;S!==pa.response_headers&&S!==pa.request_headers||(q=!0);if(S===pa.request_body){Q=F=t=u=n=p=l=void 0;C=b;var U=a;void 0===C&&(C={});var na=Ze(null===(Q=null==C?void 0:C.requestDetails)||void 0===Q?void 0:Q.headers);if(void 0!==na&&(na.toLowerCase().includes("text/plain")||na.toLowerCase().includes("json")||na.toLowerCase().includes("text/javascript")||na.toLowerCase().includes("application/javascript")||na.toLowerCase().includes("text/html"))||void 0=== na)try{if("string"==typeof(null===(F=null==C?void 0:C.requestDetails)||void 0===F?void 0:F.body)&&10240>=(null===(t=null==C?void 0:C.requestDetails)||void 0===t?void 0:t.body.length))try{U[pa.request_body]=JSON.parse(null===(u=null==C?void 0:C.requestDetails)||void 0===u?void 0:u.body)}catch(Z){}else"object"===la(null===(n=null==C?void 0:C.requestDetails)||void 0===n?void 0:n.body)&&10240>=JSON.stringify(null===(p=null==C?void 0:C.requestDetails)||void 0===p?void 0:p.body).length&&(U[pa.request_body]= null===(l=null==C?void 0:C.requestDetails)||void 0===l?void 0:l.body)}catch(Z){}}if(S===pa.response_body){var oa=U=C=Q=F=t=u=n=p=l=void 0,ta=void 0,fa=void 0,X=void 0,N=b,za=a;void 0===N&&(N={});a:{var Oa=null===(X=null==N?void 0:N.responseDetails)||void 0===X?void 0:X.headers;try{X=void 0;var M=(null!=Oa&&(X=Oa["content-length"]||Oa["Content-Length"]||Oa["Content-length"]),null==X||isNaN(X)?X:Number(X));break a}catch(Z){}M=void 0}var P=Ze(null===(fa=null==N?void 0:N.responseDetails)||void 0===fa? void 0:fa.headers);if(void 0!==P&&(P.toLowerCase().includes("text/plain")||P.toLowerCase().includes("json")||P.toLowerCase().includes("text/javascript")||P.toLowerCase().includes("application/javascript")||P.toLowerCase().includes("text/html")))if(void 0!==M&&10240>=M)if("string"==typeof(null===(ta=null==N?void 0:N.responseDetails)||void 0===ta?void 0:ta.body))try{za[pa.response_body]=JSON.parse(null===(oa=null==N?void 0:N.responseDetails)||void 0===oa?void 0:oa.body)}catch(Z){}else"object"===la(null=== (U=null==N?void 0:N.responseDetails)||void 0===U?void 0:U.body)&&(za[pa.response_body]=null===(C=null==N?void 0:N.responseDetails)||void 0===C?void 0:C.body);else if(void 0===M)try{if("string"==typeof(null===(Q=null==N?void 0:N.responseDetails)||void 0===Q?void 0:Q.body)&&10240>=(null===(t=null===(F=null==N?void 0:N.responseDetails)||void 0===F?void 0:F.body)||void 0===t?void 0:t.length))try{za[pa.response_body]=JSON.parse(null===(u=null==N?void 0:N.responseDetails)||void 0===u?void 0:u.body)}catch(Z){}else"object"=== la(null===(n=null==N?void 0:N.responseDetails)||void 0===n?void 0:n.body)&&10240>=JSON.stringify(null===(p=null==N?void 0:N.responseDetails)||void 0===p?void 0:p.body).length&&(za[pa.response_body]=null===(l=null==N?void 0:N.responseDetails)||void 0===l?void 0:l.body)}catch(Z){}}S===pa.request_query&&Rg(a,d);var Y=Sg(a[S],m[S],q);0!==Object.keys(Y).length&&(g[S]=Y)}}catch(Z){g[S]=void 0}}return g}}catch(Z){console.warn("Conviva App Tracker: Error in collecting attributes nwreqConfig ".concat(Z))}}g= ba({},a);for(a=0;a<e.length;a++)c=e[a],null!=g&&g.hasOwnProperty(c)&&delete g[c];return g}function Qg(a,c,b){try{if("string"==typeof b&&"string"==typeof a&&"*"===b.trim())return!0;switch(c){case "==":case "equal":return a===b;case "!=":return a!==b;case ">":return a>b;case "<":return a<b;case ">=":return a>=b;case "<=":return a<=b;case "contains":return""!==b&&"string"==typeof a&&"string"==typeof b&&-1!==a.toLowerCase().indexOf(b.toLowerCase());default:return!1}}catch(d){return console.warn("Conviva App Tracker: Error in Compare values nwreq ".concat(d)), !1}}function Sg(a,c,b){var d={};try{for(var e=0;e<c.length;e++){var g=c[e],f=a,h=d;b&&(g=g.toLowerCase(),f=f&&Object.entries(f).reduce(function(p,n){var y=n[1];return p[n[0].toLowerCase()]=y,p},{}));for(var l=g.split("."),m=0;m<l.length;m++){var q=l[m];if(null==f||!f.hasOwnProperty(q))break;m===l.length-1?h[q]=f[q]:(h[q]=h[q]||{},f=f[q],h=h[q])}}}catch(p){console.warn("Conviva App Tracker: Error in filtering schema object nwreq ".concat(p))}return d}function Rg(a,c){try{var b=null==a?void 0:a.targetUrl; if(b&&"string"==typeof b&&b.includes("?")){var d=void 0;try{var e=b.indexOf("?");if(-1===e)return;var g=b.indexOf("#",e),f=-1!==g?b.substring(e+1,g):b.substring(e+1);if(!f||f.length>(c||10240))return;d="undefined"!=typeof URLSearchParams?new URLSearchParams(f):null}catch(y){return void console.warn("Conviva App Tracker: Error creating URLSearchParams: ".concat(y))}var h={};if(d instanceof URLSearchParams)d.forEach(function(y,E){h[E]=y});else{c=0;for(var l=b.substring(b.indexOf("?")+1).split("&");c< l.length;c++){var m=l[c];if(m){var q=m.indexOf("="),p=0<q?decodeURIComponent(m.substring(0,q)):decodeURIComponent(m);if(p){var n=0<q&&q<m.length-1?decodeURIComponent(m.substring(q+1)):"";h[p]=n}}}}0<Object.keys(h).length&&(a[pa.request_query]=h)}}catch(y){console.warn("Conviva App Tracker: Error parsing request query parameters: ".concat(y))}}function $e(a,c,b,d){for(var e={},g=0;g<c.length;g++){var f=c[g],h=f.req,l=f.opt;f=f.smb;try{var m=d([{req:h,opt:l}],[],a,b);if((null==m?0:m.result)&&f&&Array.isArray(f)){var q= Tg(a,f,!1);return 0<Object.keys(q).length&&Object.assign(e,q),e}}catch(p){console.warn("Conviva App Tracker: Error in collecting conditional SSE attributes ".concat(p))}}return e}function Tg(a,c,b){var d={};try{for(var e=0;e<c.length;e++){var g=c[e],f=a,h=d;b&&(g=g.toLowerCase(),f=f&&Object.entries(f).reduce(function(p,n){var y=n[1];return p[n[0].toLowerCase()]=y,p},{}));for(var l=g.split("."),m=0;m<l.length;m++){var q=l[m];if(null==f||!f.hasOwnProperty(q))break;if(m===l.length-1)h[q]=f[q];else{if(h[q]= h[q]||{},"string"==typeof(f=f[q])&&m<l.length-1)try{f=JSON.parse(f)}catch(p){}h=h[q]}}}}catch(p){console.warn("Conviva App Tracker: Error in filtering SSE object ".concat(p))}return d}function af(a,c,b){var d,e,g;return"translate.googleusercontent.com"===a?(""===b&&(b=c),a=Qc(c=null!==(e=c,d=(g=/^(?:https?|ftp)(?::\/*(?:[^?]+))([?][^#]+)/.exec(e))&&1<(null==g?void 0:g.length)?mc("u",g[1]):null)&&void 0!==d?d:"")):"cc.bingj.com"!==a&&"webcache.googleusercontent.com"!==a||(a=Qc(c=document.links[0].href)), [a,c,b]}function nc(a,c){void 0===c&&(c=1);"0"===a[0]?(a[7]=a[6],a[5]=a[4],a[3]++):a[3]=c;c=sb.v4();return a[6]=c,a[8]="",a[9]=void 0,c}function Id(a){a[4]=Math.round((new Date).getTime()/1E3)}function Tc(a){return{activateLCPObserver:function(){try{PerformanceObserver&&(new PerformanceObserver(function(c){try{c.getEntries().forEach(function(b){var d;if("largest-contentful-paint"===b.entryType){var e=null===performance||void 0===performance?void 0:performance.getEntriesByType("navigation"),g=void 0; e&&0<(null==e?void 0:e.length)&&(g=null===(d=e[0])||void 0===d?void 0:d.activationStart);va=ba(ba({},b.toJSON()),{performanceNavigationActivationStart:null!=g?g:0})}})}catch(b){console.warn("convivaAppTracker error in conviva lcp observer "+b)}})).observe({type:"largest-contentful-paint",buffered:!0})}catch(c){console.warn("convivaAppTracker conviva_lcp failed "+c)}},contexts:function(){try{switch(a){case H.PERFORMANCE_CONTEXT.DISABLED:return[];case H.PERFORMANCE_CONTEXT.PERFORMANCE_NAVIGATION_TIMING:return function(){var c, b,d;try{var e=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{};if(e.getEntriesByType){var g=e.getEntriesByType("navigation")[0],f=null!==(c=null==e?void 0:e.timeOrigin)&&void 0!==c?c:0;if(!g)return[];var h={st:Math.floor(f+g.startTime),dls:Math.floor(f+g.domainLookupStart),dle:Math.floor(f+g.domainLookupEnd),rss:Math.floor(f+g.responseStart),rse:Math.floor(f+g.responseEnd),le:Math.floor(f+g.loadEventEnd),dur:Math.floor(f+g.duration),as:Math.floor(f+g.activationStart)}; return(null==va?void 0:va.startTime)&&(h.lcp={rt:Math.floor(f+va.startTime),url:128<(null===(b=null==va?void 0:va.url)||void 0===b?void 0:b.length)?null===(d=null==va?void 0:va.url)||void 0===d?void 0:d.substring(0,128):va.url,sz:va.size}),[{sc:"cv/pc/1-0-1",dt:h}]}return[]}catch(l){return console.warn("ConvivaAppTracker: issue will getting performance Navigation timing context"),[]}}();default:return Fa(Fa([],function(){var c=window;c=c.performance||c.mozPerformance||c.msPerformance||c.webkitPerformance; var b=c.timing;return c?[{sc:"w3/pt/1-0-0",dt:{navigationStart:b.navigationStart,domainLookupStart:b.domainLookupStart,domainLookupEnd:b.domainLookupEnd,responseStart:b.responseStart,responseEnd:b.responseEnd,loadEventEnd:b.loadEventEnd}}]:[]}(),!0),function(){var c,b,d;try{if(void 0!==(null==va?void 0:va.startTime)&&"number"==typeof(null==va?void 0:va.startTime))return[{sc:"cv/lcp/1-0-0",dt:{lcp:Math.round(va.startTime)-(null!==(c=va.performanceNavigationActivationStart)&&void 0!==c?c:0),url:128< (null===(b=null==va?void 0:va.url)||void 0===b?void 0:b.length)?null===(d=null==va?void 0:va.url)||void 0===d?void 0:d.substring(0,128):va.url}}]}catch(e){}return[]}(),!0)}}catch(c){return console.warn("convivaAppTracker problem in perfromance context "+c),[]}}}}function Uc(a,c,b,d,e,g){var f;try{var h,l=null,m=null!==(f=g.url)&&void 0!==f?f:"";if(!m)return!0;if(Ug.some(function(y){return m.includes(y)}))return!1;var q=(h=new URL(m)).protocol.replace(":","");f=function(y,E){var x;y=bf(y,{scheme:q, host:h.hostname,path:decodeURIComponent(h.pathname)},fb.NETWORK_REQUEST);return y.matched?y.opt?ub(y.opt,{responseStatusCode:null!==(x=null==e?void 0:e.status)&&void 0!==x?x:0,duration:Date.now()-g.requestTimestamp},fb.NETWORK_REQUEST)===E:E:null};if(a&&null===l&&(l=f(a,!0)),c&&null===l&&(l=f(c,!1)),null===l){var p=(null==b?void 0:b.includes("*"))||(null==b?void 0:b.some(function(y){return!(!y||""===y)&&m.includes(y)})),n=null==d?void 0:d.some(function(y){return!(!y||""===y)&&m.includes(y)});l=!p|| n}return!0===l}catch(y){return!0}}function Vc(a,c,b,d){try{var e,g=null;d=null!=d?d:"";if(!d)return{result:!0};var f=(e=new URL(d)).protocol.replace(":","");d=function(h,l){var m;h=bf(h,ba({scheme:f,host:e.hostname,path:decodeURIComponent(e.pathname)},b),fb.SSE_EVENT);if(h.matched){if(h.opt){var q=ub(h.opt,b,fb.SSE_EVENT);return!0!==(null===(m=null==h?void 0:h.item)||void 0===m?void 0:m.count)||q?{result:q===l,matchedConfig:h.item,shouldSend:!0}:{result:h.matched===l,matchedConfig:h.item,shouldSend:!1}}return{result:l, matchedConfig:h.item,shouldSend:!1}}return null};return a&&null===g&&(g=d(a,!0)),c&&null===g&&(g=d(c,!1)),(!a||Array.isArray(a)&&0===a.length)&&null===g&&(g={result:!0}),g}catch(h){return{result:!0}}}function bf(a,c,b){try{for(var d=0;d<a.length;d++){var e=a[d],g=e.opt;if(ub(e.req,c,b))return{matched:!0,opt:g||null,item:e}}return{matched:!1,opt:null}}catch(f){return{matched:!1,opt:null}}}function ub(a,c,b){try{if(!a)return!1;if("and"===a.type){for(var d=0,e=a.cond;d<e.length;d++)if(!ub(e[d],c,b))return!1; return!0}if("or"===a.type){e=0;for(d=a.cond;e<d.length;e++)if(ub(d[e],c,b))return!0;return!1}return b===fb.NETWORK_REQUEST?function(g,f){var h=g.key,l=g.op;g=g.val;if(!h||!l)return!1;switch(h){case "sch":return!!f.scheme&&vb(f.scheme,l,g);case "host":return!!f.host&&vb(f.host,l,g);case "path":return!!f.path&&vb(f.path,l,g);case "dur":return!!f.duration&&Wc(f.duration,l,g);case "rsc":return void 0!==f.responseStatusCode&&0<=f.responseStatusCode&&Wc(f.responseStatusCode,l,g);default:return!1}}(a,c): b===fb.CUSTOM_EVENT?function(g,f){var h=g.key,l=g.op;g=g.val;if(!h||!l)return!1;if(void 0!==f[h]){if(Ed(f[h]))return vb(f[h],l,g);if("boolean"==typeof f[h])switch(f=f[h],l){case "!=":return f!==g;case "==":return f===g;default:return!1}if(Number.isInteger(f[h]))return Wc(f[h],l,g)}return!1}(a,c):b===fb.SSE_EVENT&&function(g,f){var h=g.key,l=g.op;g=g.val;if(!h||!l)return!1;switch(h){case "sch":return!!f.scheme&&vb(f.scheme,l,g);case "host":return!!f.host&&vb(f.host,l,g);case "path":return!!f.path&& vb(f.path,l,g);default:f=(m=f,(q=h)?q.split(".").reduce(function(p,n){if(null!=p){if("string"==typeof p)try{p=JSON.parse(p)}catch(y){}n=/^\d+$/.test(n)?Number(n):n;return null==p?void 0:p[n]}},m):m);if(null!=f){if("string"==typeof f)return vb(f,l,g);if("boolean"==typeof f)switch(l){case "!=":return f!==g;case "==":return f===g;default:return!1}if("number"==typeof f&&Number.isInteger(f))return Wc(f,l,g)}return!1}var m,q}(a,c)}catch(g){return!1}}function vb(a,c,b){var d;return"=="===c&&Array.isArray(b)? !!(d=b).includes("*")||d.some(function(e){return!(!e||""===e)&&a===e}):"contains"===c&&Array.isArray(b)?!!(d=b).includes("*")||d.some(function(e){return!(!e||""===e)&&a.includes(e)}):"sw"===c&&Array.isArray(b)?!!(d=b).includes("*")||d.some(function(e){return!(!e||""===e)&&a.startsWith(e)}):!("ew"!==c||!Array.isArray(b))&&(!!(d=b).includes("*")||d.some(function(e){return!(!e||""===e)&&a.endsWith(e)}))}function Wc(a,c,b){if("in"===c.toLowerCase()&&Array.isArray(b))return b.includes(a);if("range"=== c.toLowerCase()&&"object"===la(b)){c=b.min;var d=b.max,e=b.minExclusive;b=b.maxExclusive;return void 0!==c&&void 0!==d?a>=c&&a<=d:void 0!==e&&void 0!==b&&a>e&&a<b}if(lc(b))switch(c){case "!=":return a!==b;case ">":return a>b;case ">=":return a>=b;case "<":return a<b;case "<=":return a<=b;case "==":return a===b}return!1}function cf(a,c,b){var d=null;a:{for(var e=0;e<a.length;e++){var g=a[e];var f=g.opt;if(ub(g.req,c,b)){if(!f){a=!0;f=null;break a}if(ub(f,c,b)){a=!0;break a}}}a=!1;f=null}a&&(d=!f|| !!ub(f,c,b));return d}function Aa(a,c,b){var d,e;try{if(a&&c){var g=null==a?void 0:a.getConfig(),f=function(h,l,m){var q,p,n,y={message:""};try{var E=m.message,x=m.error,z=m.className,w=m.extraData;if(E)y.message=E;else if("string"==typeof x){if(!(0<x.trim().length))return ea.warn("Conviva Eco Sensor:: Mandatory field message is missing"),null;y.message=x}else"object"===la(x)&&("string"==typeof x.message&&0<x.message.trim().length&&(y.message=Na(x.message,H.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_MESSAGE_LENGTH)), "string"==typeof x.name&&0<x.name.trim().length&&(y.exceptionName=Na(x.name,H.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_EXCEPTION_NAME_LENGTH)),"string"==typeof x.stack&&0<x.stack.trim().length&&(y.stackTrace=Na(x.stack,H.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_STACK_LENGTH)));if(0===y.message.trim().length)return ea.warn("Conviva Eco Sensor:: Mandatory field message is missing"),null;"string"==typeof z&&0<z.trim().length&&(y.className=Na(z,H.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_CLASSNAME_LENGTH));null!=w&&(y.extraData=w); var u=null==h?void 0:h.getConfig();if((null==u?void 0:u.configurationVersion)&&(y.remoteConfigVersion=u.configurationVersion),(null==m?void 0:m.configAppliedTime)&&(y.configAppliedTime=null==m?void 0:m.configAppliedTime),(null==u?void 0:u.cacheRefreshInterval)&&(y.cacheRefreshInterval=u.cacheRefreshInterval),(null==m?void 0:m.configAppliedSrc)&&(y.configAppliedSrc=null==m?void 0:m.configAppliedSrc),localStorage){var t=localStorage.getItem(H.SAMPLING_STORAGE_RANDOM_NUMBER_KEY);null!=t&&(y.samplingRandomNumber= parseFloat(t))}"number"==typeof(null===(p=null===(q=null==u?void 0:u.controlIngestConfig)||void 0===q?void 0:q.sel)||void 0===p?void 0:p.pct)?(y.samplingPercentage=u.controlIngestConfig.sel.pct,y.samplingDecision=H.SAMPLING_STATUS.DERIVED,null!=la(null===(n=null==u?void 0:u.controlIngestConfig)||void 0===n?void 0:n.act)&&(y.extraData=ba(ba({},y.extraData),{samplingActionConfig:u.controlIngestConfig.act}))):y.samplingDecision=H.SAMPLING_STATUS.DEFAULT;"function"==typeof l&&"string"==typeof l()&&(y.samplingStatus= l()==H.SAMPLING_MODES.RCFG)}catch(F){return ea.warn("Error occurred while generating diagnostic object",F),null}return y}(a,c,b);f&&function(h){var l;try{var m=null==h?void 0:h.getConfig(),q=(null===(l=null==m?void 0:m.di)||void 0===l?void 0:l.lim)||10,p=Date.now();return 6E4<=p-df&&(ef=0,df=p),!(++ef>q)}catch(n){return ea.warn("Conviva Eco Sensor:: Error occured while checking diagnostic event is allowed",n),!1}}(a)&&("boolean"!=typeof(null===(d=null==g?void 0:g.di)||void 0===d?void 0:d.en)||!0!== (null===(e=null==g?void 0:g.di)||void 0===e?void 0:e.en)||null!=a&&a.track(Eb({event:{sc:"iglu:com.conviva/di/jsonschema/1-0-4",dt:Tb({msg:f.message,cn:f.className,st:f.stackTrace,en:f.exceptionName,ed:f.extraData,rcv:f.remoteConfigVersion,cat:f.configAppliedTime,cri:f.cacheRefreshInterval,csrc:f.configAppliedSrc,srn:f.samplingRandomNumber,spr:f.samplingPercentage,ss:f.samplingStatus,sd:f.samplingDecision})}})))}}catch(h){ea.warn("Conviva Eco Sensor:: Error occurred while sending reportDiagnosticError", h)}}function ff(){var a,c,b=null===(a=null==Ba?void 0:Ba.core)||void 0===a?void 0:a.getConfig();oc=(null==(oc=(null===(c=null==b?void 0:b.clickcc)||void 0===c?void 0:c.cssSelectorList)||oc)?void 0:oc.replace(/\s+/g,""))||""}function gf(a,c){if(!(a instanceof HTMLElement||a instanceof SVGElement))return null;var b=null==a?void 0:a.closest(hf);if(b)return b;if(b=null==a?void 0:a.closest(oc))return function(e,g){var f;e=e.querySelectorAll(hf);if(0===e.length)return null;if(1===e.length&&0<e[0].offsetWidth&& 0<e[0].offsetHeight)return e[0];var h=g.clientX;g=g.clientY;if(e.length<=("IntersectionObserver"in window&&"fetch"in window&&"Promise"in window?H.MAX_NATIVE_SCAN:H.MAX_NATIVE_SCAN_LEGACY))for(var l=0;l<e.length;l++){var m=null===(f=e[l])||void 0===f?void 0:f.getBoundingClientRect();if(m&&h>=m.left&&h<=m.right&&g>=m.top&&g<m.bottom)return e[l]}return null}(b,c)||b;c=a;b=0;var d=H.CLICK_MAX_DEPTH;if(function(e){if(e.style){if(e.style.visibility&&""!==e.style.visibility&&"hidden"==e.style.visibility|| e.style.pointerEvents&&""!==e.style.pointerEvents&&"none"==e.style.pointerEvents)return!1;if(e.style.cursor&&""!==e.style.cursor&&"pointer"==e.style.cursor)return!0}e=getComputedStyle(e);return"hidden"!==e.visibility&&"none"!==e.pointerEvents&&"pointer"===e.cursor}(c)){for(;c&&c!==document.documentElement&&(c instanceof HTMLElement||c instanceof SVGElement)&&b<d;){if("function"==typeof c.onclick)return c;c=c.parentElement;b++}return a.closest(Vg)||a}return null}function Wg(a){var c,b,d,e,g,f,h;try{var l= function(F,G){var Q,C;try{if(!Ba||!Ba.core||!F)return null;var L=Ba.core.getConfig();if(!0!==(null===(Q=null==L?void 0:L.clickcc)||void 0===Q?void 0:Q.en))return null;var O=null===(C=null==L?void 0:L.clickcc)||void 0===C?void 0:C.uiMode;return O===pc.RAW?F:O===pc.BOTH?gf(F,G)||F:gf(F,G)}catch(T){return ea.warn("Conviva App Tracker caused Exception in getTrackedElement method of user click tracking module",T),null}}(function(F){var G,Q,C;return(null===(G=F.target)||void 0===G?void 0:G.shadowRoot)&& (C=null===(Q=F.composedPath)||void 0===Q?void 0:Q.call(F)),C&&C[0]||F.target}(a),a);if(l&&(l instanceof HTMLElement||l instanceof HTMLInputElement)){a={};var m=H.CLICK_KEY_MAX_LENGTH;(null==l?0:l.id)&&(a.id=Na(l.id,m));(null==l?0:l.className)&&(a.class=Na(l.className,m));(null==l?0:l.tagName)&&(a.elementName=Na(l.tagName.toLowerCase(),m));(null===(c=null==l?void 0:l.innerText)||void 0===c?0:c.trim())&&(a.text=Na(l.innerText.trim(),m));(null==l?0:l.getAttribute("name"))&&(a.name=Na(l.getAttribute("name")|| "",m));(null==l?0:l.getAttribute("type"))&&(a.elementType=Na((null===(b=l.getAttribute("type"))||void 0===b?void 0:b.toLowerCase())||"",m));(null==l?0:l.placeholder)&&(a.placeholder=Na(l.placeholder,m));(null==l?0:l.getAttribute("type"))&&"password"!==(null==l?void 0:l.getAttribute("type"))&&l.value&&(a.value=Na(l.value,m));var q=null===(d=null==Ba?void 0:Ba.core)||void 0===d?void 0:d.getConfig(),p=null===(e=null==q?void 0:q.clickcc)||void 0===e?void 0:e.collectattr;if(p)for(c=0;c<p.length;c++){var n= p[c],y=null==l?void 0:l.getAttribute(n);y&&(a[n]=Na(y,m))}try{if("A"===l.tagName.toUpperCase()||"AREA"===l.tagName.toUpperCase()){if(null!=l.href){var E=l.hostname||Qc(l.href),x=E.toLowerCase(),z=l.href.replace(E,x);/^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto):/i.test(z)||(a.targetUrl=Na(decodeURIComponent(z),m))}l.target&&(a.target=Na(l.target,m))}}catch(F){ea.warn("Conviva App Tracker caused Exception in handleClick href setting",F)}var w=null===(g=l.querySelector("use"))|| void 0===g?void 0:g.getAttribute("xlink:href");w&&(a["xlink:href"]=Na(w,m));var u=null!==(f=null==q?void 0:q.clickcc)&&void 0!==f?f:{},t=function(F,G,Q){var C=F.collect,L=F.block;F=null;if(C&&(F=cf(C,G,Q)),L&&null===F)G=cf(L,G,Q),"boolean"==typeof G&&(F=!G);return null===F||F}({collect:u.collect,block:u.block},a,fb.CUSTOM_EVENT);if("boolean"!=typeof t||!1!==t)null===(h=null==Ba?void 0:Ba.core)||void 0===h||h.track(gc({name:"conviva_click",data:JSON.stringify(a)}))}}catch(F){return void ea.warn("Conviva App Tracker caused Exception in handleClick method of user click tracking module", F)}}function jf(a){try{var c=Date.now(),b=H.CLICK_DEBOUNCING_DELAY;null===Jd||c-Jd>=b?((Wg(a),0<Xc)&&Aa(Ba.core,Ba.getSamplingMode,{className:"clickTracking - droppedEvent",message:"total click events dropped to Avoid tracking spam from rapid clicks",extraData:{clickEventDropped:Xc}}),Xc=0):Xc++;Jd=c}catch(d){console.warn("Conviva App Tracker caused Exception in immediateClickHandler method of user click tracking module",d)}}function Xg(){try{qc||"undefined"==typeof document||(document.body?(Gb=jf, bb(document.body,"click",Gb,{signal:Ua,capture:!0,passive:!0}),qc=!0):document.addEventListener("DOMContentLoaded",function(){(null===document||void 0===document?0:document.body)&&(Gb=jf,bb(document.body,"click",Gb,{signal:Ua,capture:!0,passive:!0}),qc=!0)}),ff(),(null===window||void 0===window?void 0:window.addEventListener)&&window.addEventListener("RemoteConfigUpdateApplied",function(){ff()},{signal:Ua}))}catch(a){ea.warn("Conviva App Tracker caused Exception in enableUserClickTracking method of user click tracking module", a)}}function kf(){try{qc&&"undefined"!=typeof document&&document.body&&(Gb&&(document.body.removeEventListener("click",Gb),Gb=null),qc=!1)}catch(a){ea.warn("Conviva App Tracker caused Exception in disableUserClickTracking method of user click tracking module",a)}}function Yg(a){var c={data:""},b=0;for(a=a.split(/\n+/);b<a.length;b++){var d=a[b];if(d&&!d.startsWith(":")){var e=d.indexOf(":"),g=(-1===e?d:d.slice(0,e)).trim();d=-1===e?"":d.slice(e+1).replace(/^\s+/,"");switch(g){case "data":c.data+= (c.data?"\n":"")+d;break;case "event":c.event=d;break;case "id":c.id=d}}}return c.data?c:null}function Zg(){try{var a=!!window.localStorage}catch(b){a=!0}if(!a)return!1;try{var c=window.localStorage;return c.setItem("modernizr","modernizr"),c.removeItem("modernizr"),!0}catch(b){return!1}}function $g(a,c,b,d,e,g,f,h,l,m,q,p,n,y,E,x,z,w,u){function t(M){var P=Object.keys(M).map(function(Y){return[Y,M[Y]]}).reduce(function(Y,Z){return Y[Z[0]]=Z[1].toString(),Y},{});return{evt:P,bytes:F(JSON.stringify(P))}} function F(M){for(var P=0,Y=0;Y<M.length;Y++){var Z=M.charCodeAt(Y);127>=Z?P+=1:2047>=Z?P+=2:55296<=Z&&57343>=Z?(P+=4,Y++):P+=65535>Z?3:4}return P}function G(M,P){P=L(P,!0,!1);M=O(T([M.evt]));try{E().toLowerCase()!==lb.NONE&&(M=lf.gzip(M,{level:6}),P.setRequestHeader("Content-Encoding",lb.GZIP))}catch(Y){}u()!==H.SAMPLING_MODES.NONE&&P.send(M)}function Q(M){try{if("undefined"!=typeof window&&void 0!==window.__CONVIVA_VISUAL_ACTIVATION_EXTENSION__&&"function"==typeof window.__CONVIVA_VISUAL_ACTIVATION_EXTENSION__.postMessage){var P= O(T(M));window.__CONVIVA_VISUAL_ACTIVATION_EXTENSION__.postMessage(P)}}catch(Y){ea.warn("Error occured while sending message to Visual Labelling Extension",Y)}}function C(M){for(void 0===M&&(M=!1);U.length&&"string"!=typeof U[0]&&"object"!==la(U[0]);)U.shift();if(1>U.length)ia=!1;else{if(!Ed(ma))throw"No collector configured";if(ia=!0,window.clearTimeout(na),na=-1,fa){var P,Y=void 0,Z=void 0;"object"===la(U[0])?(P=L(Y=ma,!0,M),Z=function(sa){for(var Ca=0,mb=0;Ca<sa.length&&!((mb+=sa[Ca].bytes)>=z());)Ca+= 1;return Ca}(U)):(Y=S(U[0]),P=L(Y,!1,M),Z=1);var Ja=setTimeout(function(){P.abort();ia=!1},m);if(P.onreadystatechange=function(){4===P.readyState&&(clearTimeout(Ja),200<=P.status&&300>P.status?C():(ea.error("Status ".concat(P.status,", will not retry.")),ia=!1))},"object"===la(U[0])){var Pa=U.slice(0,Z);if(0<Pa.length){M=!1;Pa=Pa.map(function(sa){return sa.evt});if(ta){var Va=new Blob([O(T(Pa))],{type:"application/json"});try{M=navigator.sendBeacon(Y,Va)}catch(sa){M=!1}}if(!0===M)C();else{Y=O(T(Pa)); try{E().toLowerCase()!==lb.NONE&&(Y=lf.gzip(Y,{level:6}),P.setRequestHeader("Content-Encoding",lb.GZIP))}catch(sa){}try{u()!==H.SAMPLING_MODES.NONE&&P.send(Y)}catch(sa){}}}}else P.send();!function(sa){for(var Ca=0;Ca<sa;Ca++)U.shift();b&&Rc(za,JSON.stringify(U.slice(-1*l())))}(Z)}else if(q||"object"===la(U[0]))ia=!1;else{Z=new Image(1,1);var Da=!0;Z.onload=function(){Da&&(Da=!1,U.shift(),b&&Rc(za,JSON.stringify(U.slice(-1*l()))),C())};Z.onerror=function(){Da&&(Da=!1,ia=!1)};Z.src=S(U[0]);setTimeout(function(){Da&& ia&&(Da=!1,C())},m)}}}function L(M,P,Y){var Z=new XMLHttpRequest,Ja;for(Ja in P?(Z.open("POST",M,!Y),Z.setRequestHeader("Content-Type","application/json; charset=UTF-8")):Z.open("GET",M,!Y),Z.withCredentials=n,q&&Z.setRequestHeader("SP-Anonymous","*"),p)Object.prototype.hasOwnProperty.call(p,Ja)&&Z.setRequestHeader(Ja,p[Ja]);return Z}function O(M){return JSON.stringify({sc:"sp/pd/1-0-4",dt:M})}function T(M){for(var P=(new Date).getTime().toString(),Y=0;Y<M.length;Y++)M[Y].stm=P;return M}function S(M){return h? ma+M.replace("?","?stm="+(new Date).getTime()+"&"):ma+M}(null===window||void 0===window?0:window.addEventListener)&&window.addEventListener("RemoteConfigUpdateApplied",function(){C()},{signal:Ua});var ma,V,ia=!1,U=[],na=-1,oa=!0===(d="string"==typeof d?d.toLowerCase():d)||"beacon"===d||"true"===d,ta=!(!(oa&&window.navigator&&window.navigator.sendBeacon)||function(M,P){P=P.match(/\(iP.+; CPU .*OS (\d+)[_\d]*.*\) AppleWebKit\//);return!(!P||!P.length)&&parseInt(P[0])<=M}(13,V=window.navigator.userAgent)|| function(M,P,Y){Y=Y.match("(Macintosh;.*Mac OS X (\\d+)_(\\d+)[_\\d]*.*) AppleWebKit/");return!(!Y||!Y.length)&&(parseInt(Y[2])<=M||parseInt(Y[2])===M&&parseInt(Y[3])<=P)}(10,15,V)&&function(M){return/^(?!.*Chrome)(?!.*Chromium)(?!.*Edg)(?!.*OPR)(?=.*Safari)/.test(M)&&!/(Chrome|Chromium|Edg|OPR)/.test(M)}(V))&&oa,fa=!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),X="get"!==d&&fa&&("post"===d||oa),N=X?e:"/i";d="convivaOutQueue_".concat(a,"_").concat(X?"post2":"get");var za="convivaOutQueue_".concat(a, "_").concat(X?"post2":"get");if(Xe(d),Xe("".concat(d,".expires")),oa&&(p={}),g=b&&Zg()&&X&&g||1,b)try{var Oa=window.localStorage.getItem(za);U=Oa?JSON.parse(Oa):[]}catch(M){}Array.isArray(U)||(U=[]);c.outQueues.push(U);fa&&1<g&&c.bufferFlushers.push(function(M){ia||C(M)});return{enqueueRequest:function(M,P,Y){if(u()!=H.SAMPLING_MODES.NONE){ma=P+N;if(X){Q([(M=t(M)).evt]);P=z();if(M.bytes>=P)return ia||C(),ea.warn("Event ("+M.bytes+"B) too big, max is "+P),void G(M,ma);U.push(M)}else{var Z=function(sa){var Ca= "?",mb={co:!0,cx:!0},Vb=!0,nb;for(nb in sa)sa.hasOwnProperty(nb)&&!mb.hasOwnProperty(nb)&&(Vb?Vb=!1:Ca+="&",Ca+=encodeURIComponent(nb)+"="+encodeURIComponent(sa[nb]));for(var wb in mb)sa.hasOwnProperty(wb)&&mb.hasOwnProperty(wb)&&(Ca+="&"+wb+"="+encodeURIComponent(sa[wb]));return Ca}(M),Ja=f();if(0<Ja){var Pa=F(S(Z));if(Pa>=Ja){if(ea.warn("Event ("+Pa+"B) too big, max is "+Ja),fa)Q([(M=t(M)).evt]),G(M,P+e);return}}U.push(Z)}P=!1;b&&(P=Rc(za,JSON.stringify(U.slice(-1*l()))));!ia&&-1===na&&P&&(na=window.setTimeout(C, w()+(Da=y,Math.floor(Math.random()*Da))));ia||!(!P||!x()||X&&(Va=0,Va=X?U.reduce(function(sa,Ca){return sa+Ca.bytes},0):U.reduce(function(sa,Ca){return sa+Ca.length},0),Va>z())||U.length>g||Y)||C()}var Va,Da},executeQueue:function(){ia||C()},setUseLocalStorage:function(M){b=M},setAnonymousTracking:function(M){q=M},setCollectorUrl:function(M){ma=M+N},setBufferSize:function(M){g=M},setCustomHeaders:function(M){p=M}}}function ah(){(null===window||void 0===window?0:window.addEventListener)&&window.addEventListener("RemoteConfigUpdateApplied", function(){var a,c,b,d,e,g,f,h=null===(a=null==Sa?void 0:Sa.core)||void 0===a?void 0:a.getConfig();a=null===(b=null===(c=null==h?void 0:h.collectionRateLimit)||void 0===c?void 0:c.exceptionAutotracking)||void 0===b?void 0:b.maxEvents;c=null===(e=null===(d=null==h?void 0:h.collectionRateLimit)||void 0===d?void 0:d.exceptionAutotracking)||void 0===e?void 0:e.disconnectDuration;d=null===(f=null===(g=null==h?void 0:h.collectionRateLimit)||void 0===g?void 0:g.exceptionAutotracking)||void 0===f?void 0: f.timeWindow;null==Hb||Hb.updateErrortRateLimitConfig(a,c,d);!0},{signal:Ua})}function bh(a){try{Sa=a;var c,b,d,e,g,f,h;try{var l=null===(c=null==Sa?void 0:Sa.core)||void 0===c?void 0:c.getConfig(),m=null===(d=null===(b=null==l?void 0:l.collectionRateLimit)||void 0===b?void 0:b.exceptionAutotracking)||void 0===d?void 0:d.maxEvents,q=null===(g=null===(e=null==l?void 0:l.collectionRateLimit)||void 0===e?void 0:e.exceptionAutotracking)||void 0===g?void 0:g.disconnectDuration,p=null===(h=null===(f=null== l?void 0:l.collectionRateLimit)||void 0===f?void 0:f.exceptionAutotracking)||void 0===h?void 0:h.timeWindow;Hb=new ch(m,q,p,null==Sa?void 0:Sa.core,null==Sa?void 0:Sa.getSamplingMode)}catch(n){console.warn("Conviva App Tracker caused Exception in initialiseRateLimiter method of error tracking module",n)}ah();bb(window,"error",mf,!0);bb(window,"unhandledrejection",nf,!0)}catch(n){console.warn("Conviva App Tracker caused Exception in enableErrorTracking method of error tracking modul