forked from CleverTap/clevertap-web-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clevertap.min.js
1 lines (1 loc) · 126 KB
/
clevertap.min.js
1
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",U="$remove",F="$delete",q="WZRK_INBOX_CONFIG",V="WZRK_INBOX",W=1e3,K="wzrk_fetch",G=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],H=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return H(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e<i.length;e++){let o=i[e];for(;" "===o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return null}static _isLocalStorageSupported(){return"localStorage"in window&&null!==window.localStorage&&"function"==typeof window.localStorage.setItem}static saveToLSorCookie(e,t){if(null!=t)try{this._isLocalStorageSupported()?this.save(e,encodeURIComponent(JSON.stringify(t))):e===b?this.createCookie(e,encodeURIComponent(t),0,window.location.hostname):this.createCookie(e,encodeURIComponent(JSON.stringify(t)),0,window.location.hostname),le.globalCache[e]=t}catch(e){}}static readFromLSorCookie(e){let t;if(le.globalCache.hasOwnProperty(e))return le.globalCache[e];if(t=this._isLocalStorageSupported()?this.read(e):this.readCookie(e),null!=t&&("function"!=typeof t.trim||""!==t.trim())){let i;try{i=JSON.parse(decodeURIComponent(t))}catch(e){i=decodeURIComponent(t)}return le.globalCache[e]=i,i}}static createBroadCookie(e,t,i,o){if(o){let s=le.broadDomain;if(null==s){const r=o.split(".");let a="";for(let o=r.length-1;o>=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t<n.s)return;if(i(this,pe)[pe].debug("Cookie was ".concat(i(this,fe)[fe].gcookie," set to ").concat(e)),i(this,fe)[fe].gcookie=e,X(i(this,fe)[fe].gcookie)||ae.getAndClearMetaProp(_),e&&ae._isLocalStorageSupported()){null==le.LRU_CACHE&&(le.LRU_CACHE=new he(100));const t=ae.readFromLSorCookie(m);let n;null!=t&&t.id&&(n=le.LRU_CACHE.cache[t.id],o&&(n||(ae.saveToLSorCookie(D,!0),le.LRU_CACHE.set(t.id,e)))),ae.saveToLSorCookie(b,e);const s=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==s){const e=le.LRU_CACHE.cache[s];i(this,ge)[ge].unregisterTokenForGuid(e)}}ae.createBroadCookie(b,e,L,window.location.hostname),ae.saveToLSorCookie(b,e)}ae._isLocalStorageSupported()&&i(this,ve)[ve].manageSession(t);const l=i(this,ve)[ve].getSessionCookieObject();(void 0===l.s||l.s<=t)&&(l.s=t,l.t=oe(),i(this,ve)[ve].setSessionCookieObject(l)),X(i(this,fe)[fe].gcookie)&&(le.blockRequest=!1),!r&&!a||i(this,ge)[ge].processingBackup||i(this,ge)[ge].processBackupEvents(),le.globalCache.RESP_N=n}}var me=t("logger");class ye{constructor(e){let{logger:t}=e;Object.defineProperty(this,me,{writable:!0,value:void 0}),this.gcookie=void 0,i(this,me)[me]=t,this.gcookie=this.getGuid()}getGuid(){let e=null;if(X(this.gcookie))return this.gcookie;if(ae._isLocalStorageSupported()){const t=ae.read(b);if(X(t)){try{e=JSON.parse(decodeURIComponent(t))}catch(o){i(this,me)[me].debug("Cannot parse Gcookie from localstorage - must be encoded "+t),32===t.length?(e=t,ae.saveToLSorCookie(b,t)):i(this,me)[me].error("Illegal guid "+t)}X(e)&&ae.createBroadCookie(b,e,L,window.location.hostname)}}return X(e)||(e=ae.readCookie(b),!X(e)||0!==e.indexOf("%")&&0!==e.indexOf("'")&&0!==e.indexOf('"')||(e=null),X(e)&&ae.saveToLSorCookie(b,e)),e}}const we="This property has been ignored.",Ce="CleverTap error:",ke="".concat(Ce," Incorrect embed script."),xe="".concat(Ce," Event structure not valid. ").concat(we),Pe="".concat(Ce," Gender value should be either M or F. ").concat(we),Se="".concat(Ce," Employed value should be either Y or N. ").concat(we),Ie="".concat(Ce," Married value should be either Y or N. ").concat(we),Oe="".concat(Ce," Education value should be either School, College or Graduate. ").concat(we),_e="".concat(Ce," Age value should be a number. ").concat(we),Ee="".concat(Ce," DOB value should be a Date Object"),Ae="".concat(Ce," setEnum(value). value should be a string or a number"),Le="".concat(Ce," Phone number should be formatted as +[country code][number]");let Me;const Te=e=>{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(H(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Ue extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Fe}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,Ne)[Ne](t),0}_processOldValues(){i(this,De)[De]&&i(this,Ne)[Ne](i(this,De)[De]),i(this,De)[De]=null}getDetails(e){if(!i(this,Be)[Be]())return;if(void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C)),void 0===le.globalEventsMap)return;const t=le.globalEventsMap[e],o={};return void 0!==t?(o.firstTime=new Date(1e3*t[1]),o.lastTime=new Date(1e3*t[2]),o.count=t[0],o):void 0}}var Fe=function(e){if(Array.isArray(e))for(;e.length>0;){var t=e.shift();if(!H(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const qe=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},Ve=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),He(e)),Ge=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),He=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o<e.length;o+=1)if(r=e.charAt(o),Object.prototype.hasOwnProperty.call(n,r)||(n[r]=d++,s[r]=!0),a=l+r,Object.prototype.hasOwnProperty.call(n,a))l=a;else{if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t<h;t++)p<<=1,15==g?(g=0,u+=f(p),p=0):g++;for(i=l.charCodeAt(0),t=0;t<8;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1}else{for(i=1,t=0;t<h;t++)p=p<<1|i,15==g?(g=0,u+=f(p),p=0):g++,i=0;for(i=l.charCodeAt(0),t=0;t<16;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t<h;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t<h;t++)p<<=1,15==g?(g=0,u+=f(p),p=0):g++;for(i=l.charCodeAt(0),t=0;t<8;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1}else{for(i=1,t=0;t<h;t++)p=p<<1|i,15==g?(g=0,u+=f(p),p=0):g++,i=0;for(i=l.charCodeAt(0),t=0;t<16;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t<h;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t<h;t++)p=p<<1|1&i,15==g?(g=0,u+=f(p),p=0):g++,i>>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1<e.length?e.charCodeAt(c/2+1)>>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2<e.length?(i=e.charCodeAt((c+1)/2)>>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(s)+Ge.charAt(r)+Ge.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N<le.globalCache.REQ_N-1&&setTimeout((()=>{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N<le.globalCache.REQ_N-1&&t<200)return void setTimeout((()=>{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=Ve(e,"tries",t),e=i(this,$e)[$e](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&H(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),Ve(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return Ve(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?Ve(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o<e.length;o++){const n=e[o];if(null!=n.type){const e=n.type;if("Graduate School"===e)return"Graduate";"College"===e?t="1":"High School"===e&&(i="1")}}if("1"===t)return"College";if("1"===i)return"School"}}(e.education);null!=i&&(t.Education=i);const o=null!=e.work?e.work.length:0;if(t.Employed=o>0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t<e.emails.length;t++){const i=e.emails[t];"account"===i.type&&(o.Email=i.value)}if(null!=e.organizations){o.Employed="N";for(let t=0;t<e.organizations.length;t++){"work"===e.organizations[t].type&&(o.Employed="Y")}}if(null!=e.birthday){const t=e.birthday.split("-");o.DOB=se(t[0]+t[1]+t[2])}return null!=e.relationshipStatus&&(o.Married="N","married"===e.relationshipStatus&&(o.Married="Y")),i.debug("gplus usr profile "+JSON.stringify(o)),o},rt=(e,t)=>{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,pt)[pt](t),0}_processOldValues(){i(this,ht)[ht]&&i(this,pt)[pt](i(this,ht)[ht]),i(this,ht)[ht]=null}getAttribute(e){if(i(this,ut)[ut]())return null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)),null!=le.globalProfileMap?le.globalProfileMap[e]:void 0}_handleIncrementDecrementValue(e,t,o){var n;if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)),null!=le.globalProfileMap||(null===(n=le.globalProfileMap)||void 0===n?void 0:n.hasOwnProperty(e)))if(!t||"number"!=typeof t||t<=0)console.error("Value should be a number greater than 0");else{le.globalProfileMap[e]=o===B?le.globalProfileMap[e]+t:le.globalProfileMap[e]-t,ae.saveToLSorCookie(x,le.globalProfileMap);let n={};const s={};n.type="profile",s[e]={[o]:t},null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=s,n=i(this,ct)[ct].addSystemDataToObject(n,!0),i(this,ct)[ct].addFlags(n);const r=Ke(JSON.stringify(n),i(this,lt)[lt]);let a=i(this,dt)[dt].dataPostURL;a=Ve(a,"type",A),a=Ve(a,"d",r),i(this,ct)[ct].saveAndFireRequest(a,le.blockRequest)}else console.error("Kindly create profile with required proprty to increment/decrement.")}_handleMultiValueSet(e,t,i){const o=[];for(let e=0;e<t.length;e++)"number"!=typeof t[e]||o.includes(t[e])?"string"!=typeof t[e]||o.includes(t[e].toLowerCase())?console.error("array supports only string or number type values"):o.push(t[e].toLowerCase()):o.push(t[e]);var n;null==le.globalProfileMap&&(le.globalProfileMap=null!==(n=ae.readFromLSorCookie(x))&&void 0!==n?n:{});le.globalProfileMap[e]=o,ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,t,i)}_handleMultiValueAdd(e,t,i){var o=[];if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)||{}),"string"==typeof t||"number"==typeof t)le.globalProfileMap.hasOwnProperty(e)?(o=le.globalProfileMap[e]).push("number"==typeof t?t:t.toLowerCase()):le.globalProfileMap[e]=t;else{le.globalProfileMap.hasOwnProperty(e)&&(o=Array.isArray(le.globalProfileMap[e])?le.globalProfileMap[e]:[le.globalProfileMap[e]]);for(var n=0;n<t.length;n++)"number"!=typeof t[n]||o.includes(t[n])?"string"!=typeof t[n]||o.includes(t[n].toLowerCase())?"number"==typeof t[n]&&o.includes(t[n])||"string"==typeof t[n]&&o.includes(t[n].toLowerCase())?console.error("Values already included"):console.error("Array supports only string or number type values"):o.push(t[n].toLowerCase()):o.push(t[n]);le.globalProfileMap[e]=o}ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,t,i)}_handleMultiValueRemove(e,t,i){var o;if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)),null==le||null===(o=le.globalProfileMap)||void 0===o?void 0:o.hasOwnProperty(e))if("string"==typeof t||"number"==typeof t){var n=le.globalProfileMap[e].indexOf(t);-1!==n&&le.globalProfileMap[e].splice(n,1)}else for(var s=0;s<t.length;s++){var r=le.globalProfileMap[e].indexOf(t[s]);-1!==r&&le.globalProfileMap[e].splice(r,1)}else console.error("The property ".concat(e," does not exist."));ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,t,i)}_handleMultiValueDelete(e,t){var i;null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)),(null==le||null===(i=le.globalProfileMap)||void 0===i?void 0:i.hasOwnProperty(e))?delete le.globalProfileMap[e]:console.error("The property ".concat(e," does not exist.")),ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,null,t)}sendMultiValueData(e,t,o){let n={};const s={};n.type="profile",s[e]={[o]:o===F||t},null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=s,n=i(this,ct)[ct].addSystemDataToObject(n,!0),i(this,ct)[ct].addFlags(n);const r=Ke(JSON.stringify(n),i(this,lt)[lt]);let a=i(this,dt)[dt].dataPostURL;a=Ve(a,"type",A),a=Ve(a,"d",r),i(this,ct)[ct].saveAndFireRequest(a,le.blockRequest)}}var ft=function(e){if(Array.isArray(e)&&e.length>0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=Ve(t,"type",A),t=Ve(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,St)[St](t),0}_processOldValues(){i(this,wt)[wt]&&i(this,St)[St](i(this,wt)[wt]),i(this,wt)[wt]=null}}var Ot=function(e){let t=!0;ae.saveToLSorCookie(D,t);const o=e=>{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n <style type="text/css">\n .banner {\n position: relative;\n cursor: '.concat(this.details.onClick?"pointer":"","\n }\n img {\n height: ").concat(this.divHeight?this.divHeight:"auto",";\n width: 100%;\n }\n .wrapper:is(.left, .right, .center) {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: auto;\n top: 0;\n }\n ").concat(this.details.css?this.details.css:"",'\n </style>\n <div class="banner">\n <picture>\n <source media="(min-width:480px)" srcset="').concat(this.details.desktopImageURL,'">\n <source srcset="').concat(this.details.mobileImageURL,'">\n <img src="').concat(this.details.desktopImageURL,'" alt="Please upload a picture" style="width:100%;" part="banner__img">\n </picture>\n ').concat(this.details.html?this.details.html:"","\n </div>\n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n <style>\n .carousel {\n position: relative;\n }\n\n .carousel__item {\n display: none;\n background-repeat: no-repeat;\n background-size: cover;\n }\n\n ct-web-personalisation-banner::part(banner__img) {\n height: ".concat((null==this||null===(e=this.target)||void 0===e||null===(t=e.display)||void 0===t?void 0:t.divHeight)?this.target.display.divHeight:"auto",";\n width: 100%;\n transition: 2s;\n }\n\n .carousel__item--selected {\n display: block;\n }\n ").concat(this.display.navBtnsCss,"\n ").concat(this.display.navArrowsCss,"\n </style>\n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="<span>".concat(Wt(e.id.split("_")[1]),"<span>"),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(q)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl<i){if(e){const e=this.shadowRoot.getElementById(t[o].id);e&&e.remove(),t[o].viewed||(this.unviewedCounter--,this.updateUnviewedBadgeCounter())}delete t[o]}return t&&t.length>0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ut(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ut(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ut(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n <style id="webInboxStyles">\n #inbox {\n width: 100%;\n position: fixed;\n background-color: #fff; \n display: none; \n box-shadow: 0px 2px 10px 0px #d7d7d791;\n background-color: '.concat(t,"; \n border: 1px solid ").concat(i,";\n top: 0;\n left: 0;\n height: 100%;\n overflow: auto;\n z-index: 1;\n box-sizing: content-box;\n border-radius: 4px;\n }\n \n #emptyInboxMsg {\n display: block;\n padding: 10px;\n text-align: center;\n color: black;\n }\n \n #header {\n height: 36px; \n width: 100%; \n display: flex; \n justify-content: center; \n align-items: center; \n background-color: ").concat(o,"; \n background-color: var(--card-bg, ").concat(o,");\n color: ").concat(n,"\n }\n \n #closeInbox {\n font-size: 20px; \n margin-right: 12px; \n color: ").concat(s,"; \n cursor: pointer;\n }\n \n #headerTitle {\n font-size: 14px; \n line-height: 20px; \n flex-grow: 1; \n font-weight: 700; \n text-align: center;\n flex-grow: 1;\n text-align: center;\n }\n \n #categoriesContainer {\n padding: 16px 16px 0 16px; \n height: 32px; \n display: flex;\n scroll-behavior: smooth;\n position: relative;\n }\n\n #categoriesWrapper {\n height: 32px; \n overflow-x: scroll;\n display: flex;\n white-space: nowrap;\n scrollbar-width: none;\n }\n\n #categoriesWrapper::-webkit-scrollbar {\n display: none;\n }\n \n #leftArrow, #rightArrow {\n height: 32px;\n align-items: center;\n font-weight: 700;\n position: absolute;\n z-index: 2;\n pointer-events: auto;\n cursor: pointer;\n display: none;\n }\n\n #leftArrow {\n left: 0;\n padding-left: 4px;\n padding-right: 16px;\n background: linear-gradient(90deg, ").concat(t," 0%, ").concat(t,"99 80%, ").concat(t,"0d 100%);\n }\n\n #rightArrow {\n right: 0;\n padding-right: 4px;\n padding-left: 16px;\n background: linear-gradient(-90deg, ").concat(t," 0%, ").concat(t,"99 80%, ").concat(t,'0d 100%);\n }\n\n [id^="category-"] {\n display: flex; \n flex: 1 1 0; \n justify-content: center; \n align-items: center; \n font-size: 14px; \n line-height: 20px; \n background-color: ').concat(r,"; \n color: ").concat(a,"; \n cursor: pointer;\n padding: 6px 24px;\n margin: 0 3px;\n border-radius: 16px;\n border: ").concat(l?"1px solid "+l:"none",';\n }\n\n [id^="category-"][selected="true"] {\n background-color: ').concat(c,"; \n color: ").concat(d,"; \n border: ").concat(h?"1px solid "+h:"none","\n }\n \n #inboxCard {\n padding: 0 16px 0 16px;\n overflow-y: auto;\n box-sizing: border-box;\n margin-top: 16px;\n }\n\n @media only screen and (min-width: 480px) {\n #inbox {\n width: var(--inbox-width, 392px);\n height: var(--inbox-height, 546px);\n position: var(--inbox-position, fixed);\n right: var(--inbox-right, unset);\n bottom: var(--inbox-bottom, unset);\n top: var(--inbox-top, unset);\n left: var(--inbox-left, unset);\n }\n \n #inboxCard {\n height: calc(var(--inbox-height, 546px) - ").concat(u,"px); \n }\n \n }\n </style>\n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n <style id="messageStyles">\n ct-inbox-message::part(messageWrapper) {\n margin-bottom: 16px; \n }\n ct-inbox-message::part(message) {\n background-color: '.concat(t,"; \n border: 1px solid ").concat(i,";\n border-radius: 4px; \n overflow: hidden;\n min-height: 40px;\n }\n ct-inbox-message::part(message):hover {\n box-shadow: 0px 4px 8px rgb(0 0 0 / 10%);\n cursor: pointer;\n }\n ct-inbox-message::part(iconTitleDescWrapper) {\n display: flex; \n padding: 16px;\n }\n ct-inbox-message::part(titleDescWrapper) {\n display: flex; \n flex-direction: column;\n }\n ct-inbox-message::part(iconImgContainer) {\n display: flex; \n margin-right: 16px;\n }\n ct-inbox-message::part(mainImgContainer) {\n line-height: 0;\n }\n ct-inbox-message::part(mainImg) {\n width: 100%; \n background: #b2b1ae;\n }\n ct-inbox-message::part(iconImg) {\n height: 40px; \n width: 40px;\n }\n ct-inbox-message::part(title) {\n font-size: 14px !important; \n line-height: 20px; \n font-weight: 600; \n color: ").concat(o,"\n }\n ct-inbox-message::part(description) {\n font-size: 14px !important; \n line-height: 20px; \n font-weight: 400; \n color: ").concat(n,"\n }\n ct-inbox-message::part(button) {\n background-color: ").concat(s,"; \n color: ").concat(r,"; \n padding: 8px 16px; \n font-size: 12px; \n line-height: 16px; \n font-weight: 600; \n flex: 1; \n border-radius: 0px; \n text-transform: capitalize; \n cursor: pointer; \n border: none;\n }\n ct-inbox-message::part(buttonsContainer) {\n display: flex;\n position: relative;\n }\n ct-inbox-message::part(snackbar) {\n position: absolute;\n top: calc(-100% - 12px);\n left: 50%;\n transform: translate(-50%, 0px);\n font-size: 14px;\n font-weight: 400;\n background: #FFFFFF;\n border: 1px solid #ECEDF2;\n box-shadow: 0px 4px 8px rgb(0 0 0 / 6%), 0px 0px 2px rgb(0 0 0 / 4%);\n border-radius: 4px;\n z-index: 2;\n display: none;\n width: max-content;\n align-items: center;\n padding: 8px 16px;\n justify-content: center;\n }\n\n ct-inbox-message::part(snackbar-msg) {\n color: black;\n margin-left: 8px;\n }\n\n ct-inbox-message::part(timeStamp) {\n display: flex; \n justify-content: end; \n align-items: center; \n margin-top: 4px; \n font-size: 12px !important; \n line-height: 16px; \n color: black;\n }\n ct-inbox-message::part(unreadMarker) {\n height: 8px; \n width: 8px; \n border-radius: 50%; \n background-color: ").concat(a,"; \n margin-left: 8px;\n }\n @media only screen and (min-width: 420px) {\n ct-inbox-message::part(mainImg) {\n height: 180px;\n }\n }\n </style>\n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{qt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(V)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(V,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ut=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(V,i)},Ft=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(q)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),qt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,b<n?b=n:b+t>r&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,v<o?v=d+i<=s?d:o:v+i>s&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(q)||{}).length>0,Gt='<svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M0.258435 9.74751C-0.0478584 9.44825 -0.081891 8.98373 0.156337 8.64775L0.258435 8.52836L3.87106 5L0.258435 1.47164C-0.0478588 1.17239 -0.0818914 0.707867 0.156337 0.371887L0.258435 0.252494C0.564728 -0.0467585 1.04018 -0.0800085 1.38407 0.152743L1.50627 0.252494L5.74156 4.39042C6.04786 4.68968 6.08189 5.1542 5.84366 5.49018L5.74156 5.60957L1.50627 9.74751C1.16169 10.0842 0.603015 10.0842 0.258435 9.74751Z" fill="#63698F"/>\n</svg>\n',Ht='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16C12.4183 16 16 12.4183 16 8ZM9.6839 5.93602C9.97083 5.55698 10.503 5.48833 10.8725 5.78269C11.2135 6.0544 11.2968 6.54044 11.0819 6.91173L11.0219 7.00198L8.09831 10.864C7.80581 11.2504 7.26654 11.3086 6.90323 11.0122L6.82822 10.9433L5.04597 9.10191C4.71635 8.76136 4.71826 8.21117 5.05023 7.87303C5.35666 7.5609 5.83722 7.53855 6.16859 7.80482L6.24814 7.87739L7.35133 9.01717L9.6839 5.93602Z" fill="#03A387"/>\n</svg>\n',Jt="https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css",Zt=e=>{if(e.data&&function(e){try{const t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){{const t=new URL(e.data.originUrl).origin;if(e.origin!==t)return}var t,i;if("Dashboard"===e.data.message)$t(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{});else"Overlay"===e.data.message&&ei(e.data,!0)}},$t=(e,t,i)=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>Xt(e,t,i))):Xt(e,t,i)};let Yt,Qt=!1;function Xt(e,t,i){if(!Qt){document.body.innerHTML="",Yt=document.createElement("div"),Yt.id="overlayDiv",Yt.style.position="relative",Yt.style.display="flex",document.body.appendChild(Yt);(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:o}),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})("https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js",e,t,i).then((()=>{console.log("Overlay script loaded successfully."),Qt=!0})).catch((e=>{console.error("Error loading overlay script:",e)})),(o=document.createElement("link")).rel="stylesheet",o.type="text/css",o.href=Jt,document.head.appendChild(o),function(){const e={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},t=document.documentElement,i=setTimeout((function(){t.className=t.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),e.scriptTimeout),o=document.createElement("script");let n=!1;const s=document.getElementsByTagName("script")[0];let r;t.className+=" wf-loading",o.src="https://use.typekit.net/"+e.kitId+".js",o.async=!0,o.onload=o.onreadystatechange=function(){if(r=this.readyState,!(n||r&&"complete"!==r&&"loaded"!==r)){n=!0,clearTimeout(i);try{Typekit.load(e)}catch(e){}}},s.parentNode.insertBefore(o,s)}()}var o}const ei=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];let s=!1;if(o!==window.location.href.split("?")[0])return;const r=(t,i)=>{n[i].html?t.outerHTML=n[i].html:n[i].json?function(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot);null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}(e,n[i]):((e,t)=>{if(void 0!==t.style&&Object.keys(t.style).forEach((i=>{e.style.setProperty(i,t.style[i])})),void 0!==t.underline){const i=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(i," underline").trim():e.style.textDecoration=i.replace("underline","").trim()}if(void 0!==t.text&&(e.innerText=t.text),void 0!==t.clickDetails){const i=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?()=>window.open(i,"_blank").focus():()=>{window.location.href=i}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){const e=document.createElement("style");e.innerHTML=t.elementCss,document.head.appendChild(e)}})(t,n[i].form)};Object.keys(n).forEach((e=>{const t=document.querySelector(e);t?(r(t,e),s=!0):(e=>{let t=0;const i=setInterval((()=>{const o=document.querySelector(e);o?(r(o,e),clearInterval(i)):++t>=20&&(console.log("No element present on DOM with selector '".concat(e,"'.")),clearInterval(i))}),500)})(e)})),s&&!t&&window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot})};const ti=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(ti,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(He(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),i.preview&&i["custom-editor"]&&(u.sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='<style type="text/css">body{margin:0;padding:0;}#contentDiv.wzrk{overflow:hidden;padding:0;text-align:center;'+b+"}#contentDiv.wzrk td{padding:15px 10px;}.wzrkPPtitle{font-weight: bold;font-size: 16px;font-family:arial;padding-bottom:10px;word-break: break-word;}.wzrkPPdscr{font-size: 14px;font-family:arial;line-height:16px;word-break: break-word;display:inline-block;}.PL15{padding-left:15px;}.wzrkPPwarp{margin:20px 20px 0 5px;padding:0px;border-radius: "+p+"px;box-shadow: 1px 1px 5px #888888;}a.wzrkClose{cursor:pointer;position: absolute;top: 11px;right: 11px;z-index: 2147483647;font-size:19px;font-family:arial;font-weight:bold;text-decoration: none;width: 25px;/*height: 25px;*/text-align: center; -webkit-appearance: none; line-height: 25px;background: #353535;border: #fff 2px solid;border-radius: 100%;box-shadow: #777 2px 2px 2px;color:#fff;}a:hover.wzrkClose{background-color:#d1914a !important;color:#fff !important; -webkit-appearance: none;}td{vertical-align:top;}td.imgTd{border-top-left-radius:8px;border-bottom-left-radius:8px;}</style>";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="<td class='imgTd' style='background-color:"+a+"'><img src='"+e.msgContent.imageUrl+"' height='60' width='60'></td>");v=i+("<div class='wzrkPPwarp' style='color:"+s+";background-color:"+n+";'><a href='javascript:void(0);' onclick="+("parent.$WZRK_WR.closeIframe("+t+",'"+o+"');")+" class='wzrkClose' style='background-color:"+r+";color:"+l+"'>×</a><div id='contentDiv' class='wzrk'><table cellpadding='0' cellspacing='0' border='0'><tr>"+h+"<td style='vertical-align:top;'><div class='wzrkPPtitle' style='color:"+s+"'>"+c+"</div>")+("<div class='wzrkPPdscr' style='color:"+s+"'>"+d+"<div></td></tr></table></div>")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=new Event("CT_campaign_rendered");document.dispatchEvent(m),i["custom-editor"]&&(v=k(e,v)),u.srcdoc=v;const y=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},w=navigator.userAgent.toLowerCase();if(-1!==w.indexOf("safari"))if(w.indexOf("chrome")>-1)u.onload=()=>{y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document);const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),300)}else u.onload=()=>{y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i="<script>\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n <\/script>\n ");return t.replace(/(<\s*\/\s*body)/,"".concat(i,"\n$1"))};let x=!1;const S=e=>{let t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!x){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=u(),null!=i)return Qe.fireRequest(t),void p(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{f(e)},i(o),x=!0}}else if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,y(e),window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],n={};n.msgContent=e.msgContent,n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);var i=[];for(var o in e)if(o.startsWith(M)&&o!==T){const t={[o]:e[o]};i.push(t)}i.length>0&&(n.msgCTkv=i),null!=e.display.kv&&(n.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=j,i.evtData={[T]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(n)}};let I;const O=(e,t)=>{let i;if(null!=e&&e.clientY>0)return;if(i=null==t?I:t,le.dismissSpamControl&&0===i.display.wtarget_type&&null!=document.getElementById("intentPreview")&&null!=document.getElementById("intentOpacityDiv")){document.getElementById("intentPreview").remove(),document.getElementById("intentOpacityDiv").remove()}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent)))return;if(!1===h(i))return;const o=i.wzrk_id.split("_")[0];le.campaignDivMap[o]="intentPreview";let n=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const r=i.display.opacity||.7,a="rgba(0,0,0,".concat(r,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(a,";")),document.body.appendChild(s);const l=document.createElement("div");l.id="intentPreview",null==i.display.proto?(n=!0,l.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):l.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(l);const c=document.createElement("iframe"),d=!1===i.display.br?"0":"8";c.frameborder="0px",c.marginheight="0px",c.marginwidth="0px",c.scrolling="no",c.id="wiz-iframe-intent";const u=i.display.onClick;let p,f="";if(""!==u&&null!=u&&(f="cursor:pointer;"),i.display.preview&&i.display["custom-editor"]&&(c.sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"),1===i.msgContent.type)p=i.msgContent.html,p=p.replace(/##campaignId##/g,o),p=p.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='<style type="text/css">body{margin:0;padding:0;}#contentDiv.wzrk{overflow:hidden;padding:0 0 20px 0;text-align:center;'+f+"}#contentDiv.wzrk td{padding:15px 10px;}.wzrkPPtitle{font-weight: bold;font-size: 24px;font-family:arial;word-break: break-word;padding-top:20px;}.wzrkPPdscr{font-size: 14px;font-family:arial;line-height:16px;word-break: break-word;display:inline-block;padding:20px 20px 0 20px;line-height:20px;}.PL15{padding-left:15px;}.wzrkPPwarp{margin:20px 20px 0 5px;padding:0px;border-radius: "+d+"px;box-shadow: 1px 1px 5px #888888;}a.wzrkClose{cursor:pointer;position: absolute;top: 11px;right: 11px;z-index: 2147483647;font-size:19px;font-family:arial;font-weight:bold;text-decoration: none;width: 25px;/*height: 25px;*/text-align: center; -webkit-appearance: none; line-height: 25px;background: #353535;border: #fff 2px solid;border-radius: 100%;box-shadow: #777 2px 2px 2px;color:#fff;}a:hover.wzrkClose{background-color:#d1914a !important;color:#fff !important; -webkit-appearance: none;}#contentDiv .button{padding-top:20px;}#contentDiv .button a{font-size: 14px;font-weight:bold;font-family:arial;text-align:center;display:inline-block;text-decoration:none;padding:0 30px;height:40px;line-height:40px;background:#ea693b;color:#fff;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;}</style>";let t,n,s,r;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",s="#353535",r="#ffffff"):(t="#ffffff",n="#000000",s="#a5a6a6",r="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="<div class='button'><a href='#'>"+i.msgContent.ctaText+"</a></div>");let h="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(h="<div style='padding-top:20px;'><img src='"+i.msgContent.imageUrl+"' width='500' alt="+a+" /></div>");p=e+("<div class='wzrkPPwarp' style='color:"+n+";background-color:"+t+";'><a href='javascript:void(0);' onclick="+("parent.$WZRK_WR.closeIframe("+o+",'intentPreview');")+" class='wzrkClose' style='background-color:"+s+";color:"+r+"'>×</a><div id='contentDiv' class='wzrk'><div class='wzrkPPtitle' style='color:"+n+"'>"+a+"</div>")+("<div class='wzrkPPdscr' style='color:"+n+"'>"+l+"</div>"+h+c+"</div></div>")}c.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),l.appendChild(c);const v=new Event("CT_campaign_rendered");document.dispatchEvent(v),i.display["custom-editor"]&&(p=k(i,p)),c.srcdoc=p,c.onload=()=>{const e=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");g(u,i,e,0,n)}};if(!document.body)return void(d<6&&(d++,setTimeout(ti,1e3,e,{device:r,session:a,request:l,logger:c})));const _=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?v(e[t]):m(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i<e.inapp_notifs.length;i++){const o=e.inapp_notifs[i];if(null==o.display.wtarget_type||0===o.display.wtarget_type)S(o);else if(1===o.display.wtarget_type)I=o,window.document.body.onmouseleave=O;else if(2===o.display.wtarget_type)if(2===o.msgContent.type||3===o.msgContent.type){null!==(o.display.divId?document.getElementById(o.display.divId):document.querySelector(o.display.divSelector))?2===o.msgContent.type?v(o):m(o):t[o.wzrk_id.split("_")[0]]=o}else 4===o.msgContent.type?ei(o,!1):S(o)}Object.keys(t).length&&("complete"===document.readyState?_(t):(e=>{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{_(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const E=()=>{if(e.inbox_preview)Dt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i<e.inbox_notifs.length;i++)!1!==h(e.inbox_notifs[i])&&t.push(e.inbox_notifs[i]);Dt(t)}};if((e.webInboxSetting||null!=e.inbox_notifs)&&(Kt()&&qt(),null===le.inbox?(e.webInboxSetting&&function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=ae.readFromLSorCookie(q)||{};t?(le.inbox.inboxConfigForPreview=e,le.inbox.isPreview=!0,le.inbox&&le.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(ae.saveToLSorCookie(q,e),le.inbox&&le.inbox.init())}(e.webInboxSetting),Ft(c).then((()=>{E()})).catch((e=>{}))):E()),e.vars)return void le.variableStore.mergeVariables(e.vars);const A=(e,t)=>{const i=Xe(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],ae.read(w))){const o=JSON.parse(decodeURIComponent(ae.read(w))),n=JSON.parse(decodeURIComponent(ae.read(b)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],ae.save(w,encodeURIComponent(JSON.stringify(o))))}et(i)};if(ae._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=oe();ae.setMetaProp("lsTime",n),ae.setMetaProp("exTs",o),(e=>{if(null!=le.globalEventsMap||(le.globalEventsMap=ae.readFromLSorCookie(C),null!=le.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=le.globalEventsMap[t],o=e[t];null!=le.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(le.globalEventsMap[t]=o):le.globalEventsMap[t]=o}}else le.globalEventsMap=e})(t),ae.saveToLSorCookie(C,le.globalEventsMap),null==le.globalProfileMap?rt(i,!0):rt(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(ae._isLocalStorageSupported())try{let i=ae.readFromLSorCookie(P);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);ae.saveToLSorCookie(P,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&A(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&A(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var ii=t("isPersonalisationActive");class oi{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,ii,{writable:!0,value:void 0}),i(this,ii)[ii]=t}getTotalVisits(){if(!i(this,ii)[ii]())return;let e=ae.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,ii)[ii]())return;const e=ae.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const ni=1,si=2,ri=3,ai=4;var li=t("logLevel"),ci=t("log"),di=t("isLegacyDebug");class hi{constructor(e){Object.defineProperty(this,di,{get:pi,set:void 0}),Object.defineProperty(this,ci,{value:ui}),Object.defineProperty(this,li,{writable:!0,value:void 0}),this.wzrkError={},i(this,li)[li]=null==e?e:si,this.wzrkError={}}get logLevel(){return i(this,li)[li]}set logLevel(e){i(this,li)[li]=e}error(e){i(this,li)[li]>=ni&&i(this,ci)[ci]("error",e)}info(e){i(this,li)[li]>=si&&i(this,ci)[ci]("log",e)}debug(e){(i(this,li)[li]>=ri||i(this,di)[di])&&i(this,ci)[ci]("debug",e)}debugPE(e){i(this,li)[li]>=ai&&i(this,ci)[ci]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(Ce," ").concat(e,": ").concat(t))}}var ui=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},pi=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},gi=t("logger"),fi=t("sessionId"),vi=t("isPersonalisationActive");class bi{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,gi,{writable:!0,value:void 0}),Object.defineProperty(this,fi,{writable:!0,value:void 0}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=ae.getMetaProp("cs"),i(this,gi)[gi]=t,i(this,vi)[vi]=o}get sessionId(){return i(this,fi)[fi]}set sessionId(e){i(this,fi)[fi]=e}getSessionCookieObject(){let e=ae.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;oe()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);ae.createBroadCookie(this.cookieName,t,1200,We())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=ae.getMetaProp("cs");if(void 0===t)ae.setMetaProp("ps",e),ae.setMetaProp("cs",e),ae.setMetaProp("sc",1);else if(t!==e){ae.setMetaProp("ps",t),ae.setMetaProp("cs",e);let i=ae.getMetaProp("sc");void 0===i&&(i=0),ae.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,vi)[vi]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=oe();return Math.floor(t-e)}}getPageCount(){if(i(this,vi)[vi]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let mi=0,yi=0;var wi=t("logger"),Ci=t("account"),ki=t("device"),xi=t("session"),Pi=t("isPersonalisationActive"),Si=t("clearCookie"),Ii=t("addToLocalEventMap");class Oi{constructor(e){let{logger:t,account:o,device:n,session:s,isPersonalisationActive:r}=e;Object.defineProperty(this,Ii,{value:_i}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:void 0}),Object.defineProperty(this,ki,{writable:!0,value:void 0}),Object.defineProperty(this,xi,{writable:!0,value:void 0}),Object.defineProperty(this,Pi,{writable:!0,value:void 0}),Object.defineProperty(this,Si,{writable:!0,value:!1}),this.processingBackup=!1,i(this,wi)[wi]=t,i(this,Ci)[Ci]=o,i(this,ki)[ki]=n,i(this,xi)[xi]=s,i(this,Pi)[Pi]=r,Qe.logger=t,Qe.device=n,Qe.account=o}processBackupEvents(){const e=ae.readFromLSorCookie(S);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,wi)[wi].debug("Processing backup event : "+o.q),void 0!==o.q&&Qe.fireRequest(o.q),o.fired=!0)}ae.saveToLSorCookie(S,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=ee(e,i(this,wi)[wi])),$(i(this,wi)[wi].wzrkError)||(e.wzrk_error=i(this,wi)[wi].wzrkError,i(this,wi)[wi].wzrkError={}),e.id=i(this,Ci)[Ci].id,X(i(this,ki)[ki].gcookie)&&(e.g=i(this,ki)[ki].gcookie);const o=i(this,xi)[xi].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={...e.af,lib:"web-sdk-v1.9.1",protocol:n,...le.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,Si)[Si]=ae.getAndClearMetaProp(g),void 0!==i(this,Si)[Si]&&i(this,Si)[Si]&&(e.rc=!0,i(this,wi)[wi].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,Pi)[Pi]()){const t=ae.getMetaProp("lsTime"),i=ae.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i<oe()&&(e.dsync=!0)}}saveAndFireRequest(e,t,o,n){const s=oe(),r=(e=Ve(e,"rn",++le.globalCache.REQ_N))+"&i="+s+"&sn="+mi;ae.backupEvent(r,le.globalCache.REQ_N,i(this,wi)[wi]),le.offline||(t&&(void 0===i(this,Si)[Si]||!i(this,Si)[Si])||window.isOULInProgress?i(this,wi)[wi].debug("Not fired due to override - ".concat(le.blockRequest," or clearCookie - ").concat(i(this,Si)[Si]," or OUL request in progress - ").concat(window.isOULInProgress)):(s===yi?mi++:(yi=s,mi=0),window.oulReqN=le.globalCache.REQ_N,Qe.fireRequest(r,!1,o,n)))}unregisterTokenForGuid(e){const t=ae.readFromLSorCookie(z);if(t){const t={type:"data"};X(e)&&(t.g=e),t.action="unregister",t.id=i(this,Ci)[Ci].id;const o=i(this,xi)[xi].getSessionCookieObject();t.s=o.s;const n=Ke(JSON.stringify(t),i(this,wi)[wi]);let s=i(this,Ci)[Ci].dataPostURL;s=Ve(s,"type","data"),s=Ve(s,"d",n),Qe.fireRequest(s,!0),ae.saveToLSorCookie(D,!1)}this.registerToken(t)}registerToken(e){if(!e)return;e=this.addSystemDataToObject(e,!0),e=JSON.stringify(e);let t=i(this,Ci)[Ci].dataPostURL;t=Ve(t,"type","data"),t=Ve(t,"d",Ke(e,i(this,wi)[wi])),Qe.fireRequest(t),ae.save("WZRK_WPR","ok")}processEvent(e){i(this,Ii)[Ii](e.evtName),e=this.addSystemDataToObject(e,void 0),this.addFlags(e),e.WZRK_CAMP=it();const t=Ke(JSON.stringify(e),i(this,wi)[wi]);let o=i(this,Ci)[Ci].dataPostURL;o=Ve(o,"type",A),o=Ve(o,"d",t),this.saveAndFireRequest(o,le.blockRequest,!1,e.evtName)}post(e,t){return fetch(e,{method:"post",headers:{"Content-Type":"application/json"},body:t}).then((e=>{if(e.ok)return e.json();throw e})).then((e=>(i(this,wi)[wi].debug("Sync data successful",e),e))).catch((e=>{throw i(this,wi)[wi].debug("Error in syncing variables",e),e}))}}var _i=function(e){if(ae._isLocalStorageSupported()){void 0===le.globalEventsMap&&(le.globalEventsMap=ae.readFromLSorCookie(C),void 0===le.globalEventsMap&&(le.globalEventsMap={}));const t=oe();let i=le.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),le.globalEventsMap[e]=i,ae.saveToLSorCookie(C,le.globalEventsMap)}},Ei=t("request"),Ai=t("account"),Li=t("oldValues"),Mi=t("logger"),Ti=t("processPrivacyArray");class Ri extends Array{constructor(e,t){let{request:o,account:n,logger:s}=e;super(),Object.defineProperty(this,Ti,{value:ji}),Object.defineProperty(this,Ei,{writable:!0,value:void 0}),Object.defineProperty(this,Ai,{writable:!0,value:void 0}),Object.defineProperty(this,Li,{writable:!0,value:void 0}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),i(this,Mi)[Mi]=s,i(this,Ei)[Ei]=o,i(this,Ai)[Ai]=n,i(this,Li)[Li]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return le.isPrivacyArrPushed?i(this,Ti)[Ti](le.privacyArray.length>0?le.privacyArray:t):le.privacyArray.push(...t),0}_processOldValues(){i(this,Li)[Li]&&i(this,Ti)[Ti](i(this,Li)[Li]),i(this,Li)[Li]=null}}var ji=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const s={};var t=!1;if(o.hasOwnProperty(O)&&"boolean"==typeof(t=o.optOut)&&(s.ct_optout=t,le.isOptInRequest=!t),o.hasOwnProperty(_)){const e=o.useIP,t="boolean"==typeof e&&e;ae.setMetaProp(_,t)}if(!$(s)){n.type="profile",n.profile=s,n=i(this,Ei)[Ei].addSystemDataToObject(n,void 0);const o=Ke(JSON.stringify(n),i(this,Mi)[Mi]);let r=i(this,Ai)[Ai].dataPostURL;r=Ve(r,"type",A),r=Ve(r,"d",o),r=Ve(r,O,t?"true":"false"),i(this,Ei)[Ei].saveAndFireRequest(r,le.blockRequest),e.splice(0,e.length)}}},Di=t("oldValues"),zi=t("logger"),Bi=t("request"),Ni=t("account"),Ui=t("wizAlertJSPath"),Fi=t("fcmPublicKey"),qi=t("setUpWebPush"),Vi=t("setUpWebPushNotifications"),Wi=t("setApplicationServerKey"),Ki=t("setUpSafariNotifications"),Gi=t("setUpChromeFirefoxNotifications"),Hi=t("addWizAlertJS"),Ji=t("removeWizAlertJS"),Zi=t("handleNotificationRegistration");class $i extends Array{constructor(e,t){let{logger:o,session:n,request:s,account:r}=e;super(),Object.defineProperty(this,Zi,{value:no}),Object.defineProperty(this,Ji,{value:oo}),Object.defineProperty(this,Hi,{value:io}),Object.defineProperty(this,Gi,{value:to}),Object.defineProperty(this,Ki,{value:eo}),Object.defineProperty(this,Wi,{value:Xi}),Object.defineProperty(this,Vi,{value:Qi}),Object.defineProperty(this,qi,{value:Yi}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),Object.defineProperty(this,Bi,{writable:!0,value:void 0}),Object.defineProperty(this,Ni,{writable:!0,value:void 0}),Object.defineProperty(this,Ui,{writable:!0,value:void 0}),Object.defineProperty(this,Fi,{writable:!0,value:void 0}),i(this,Ui)[Ui]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,Fi)[Fi]=null,i(this,Di)[Di]=t,i(this,zi)[zi]=o,i(this,Bi)[Bi]=s,i(this,Ni)[Ni]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,qi)[qi](t),0}_processOldValues(){i(this,Di)[Di]&&i(this,qi)[qi](i(this,Di)[Di]),i(this,Di)[Di]=null}_enableWebPush(e,t){le.webPushEnabled=e,null!=t&&i(this,Wi)[Wi](t),le.webPushEnabled&&le.notifApi.notifEnabledFromApi?i(this,Zi)[Zi](le.notifApi.displayArgs):!le.webPushEnabled&&le.notifApi.notifEnabledFromApi&&i(this,zi)[zi].error("Ensure that web push notifications are fully enabled and integrated before requesting them")}}var Yi=function(e){le.webPushEnabled&&e.length>0?i(this,Zi)[Zi](e):null==le.webPushEnabled&&e.length>0?(le.notifApi.notifEnabledFromApi=!0,le.notifApi.displayArgs=e.slice()):!1===le.webPushEnabled&&e.length>0&&i(this,zi)[zi].error("Make sure push notifications are fully enabled and integrated")},Qi=function(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,Gi)[Gi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ki)[Ki](e,o,n)},Xi=function(e){i(this,Fi)[Fi]=e},eo=function(e,t,o){void 0===t&&i(this,zi)[zi].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,zi)[zi].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",ae.saveToLSorCookie(z,t),i(this,Bi)[Bi].registerToken(t),i(this,zi)[zi].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,zi)[zi].info("Error subscribing to Safari web push")}))},to=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,Fi)[Fi]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e<i.length;e++)o.push(i.charCodeAt(e));return new Uint8Array(o)})(i(this,Fi)[Fi])),t.pushManager.subscribe(n).then((t=>{i(this,zi)[zi].info("Service Worker registered. Endpoint: "+t.endpoint);const o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),ae.saveToLSorCookie(z,o),i(this,Bi)[Bi].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((e=>{i(this,zi)[zi].error("Error subscribing: "+e),t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,zi)[zi].info("Unsubscription successful")})).catch((e=>{i(this,zi)[zi].error("Error unsubscribing: "+e)}))}))}))})).catch((e=>{i(this,zi)[zi].error("error registering service worker: "+e)}))},io=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Ui)[Ui]),document.getElementsByTagName("body")[0].appendChild(e),e},oo=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},no=function(e){let t,o,n,s,r,a,l,c,d,h,u,p,g,f,v;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,s=i.rejectButtonText,r=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,h=i.subscriptionCallback,u=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,v=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],s=e[3],r=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==u&&(u="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const b=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!b)return void i(this,zi)[zi].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!b){if(null==Notification)return;if("granted"===Notification.permission)return void i(this,Vi)[Vi](h,u,f,v);if("denied"===Notification.permission)return;if(a)return void i(this,Vi)[Vi](h,u,f,v)}if(!(t&&o&&n&&s))return void i(this,zi)[zi].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=r&&r.match(/^#[a-f\d]{6}$/i)||(r="#f28046");const m=(new Date).getTime()/1e3;if(null==ae.getMetaProp("notif_last_time"))ae.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-ae.getMetaProp("notif_last_time")<l)return;ae.setMetaProp("notif_last_time",m)}if(b){const e=document.createElement("iframe");e.setAttribute("style","display:none;"),e.setAttribute("src",g),document.body.appendChild(e),window.addEventListener("message",(e=>{if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Hi)[Hi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Ji)[Ji]()}))})}}),!1)}else i(this,Hi)[Hi]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:r,rejectButtonText:s},(e=>{e?("function"==typeof c&&c(),i(this,Vi)[Vi](h,u,f,v)):"function"==typeof d&&d(),i(this,Ji)[Ji]()}))}},so=t("variableStore");class ro{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,so,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,so)[so]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const s=new ro({variableStore:i});try{s.name=e,s.defaultValue=t,s.value=t,s.type=o,i.registerVariable(s),s.update(t)}catch(e){console.error(e)}return s}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,so)[so].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,so)[so].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var ao=t("logger"),lo=t("account"),co=t("request"),ho=t("event"),uo=t("variables"),po=t("remoteVariables"),go=t("fetchCallback"),fo=t("variablesChangedCallbacks"),vo=t("oneTimeVariablesChangedCallbacks"),bo=t("hasVarsRequestCompleted"),mo=t("runVariablesChangedCallback");class yo{constructor(e){let{logger:t,request:o,account:n,event:s}=e;Object.defineProperty(this,mo,{value:wo}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,po,{writable:!0,value:void 0}),Object.defineProperty(this,go,{writable:!0,value:void 0}),Object.defineProperty(this,fo,{writable:!0,value:void 0}),Object.defineProperty(this,vo,{writable:!0,value:void 0}),Object.defineProperty(this,bo,{writable:!0,value:!1}),i(this,ao)[ao]=t,i(this,lo)[lo]=n,i(this,co)[co]=o,i(this,ho)[ho]=s,i(this,uo)[uo]={},i(this,po)[po]={},i(this,fo)[fo]=[],i(this,vo)[vo]=[],le.variableStore=this}registerVariable(e){const{name:t}=e;i(this,uo)[uo][t]=e,console.log("registerVariable",i(this,uo)[uo])}getVariable(e){return i(this,uo)[uo][e]}hasVarsRequestCompleted(){return i(this,bo)[bo]}syncVariables(e,t){if(!i(this,lo)[lo].token){const e="Account token is missing.";return i(this,ao)[ao].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,uo)[uo])o.vars[e]={defaultValue:i(this,uo)[uo][e].defaultValue,type:i(this,uo)[uo][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,ao)[ao].error(e),Promise.reject(new Error(e))}let n={};n=i(this,co)[co].addSystemDataToObject(n,void 0),n.tk=i(this,lo)[lo].token,n.type="meta";const s=JSON.stringify([n,o]),r=i(this,lo)[lo].dataPostPEURL;return i(this,co)[co].post(r,s).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,ao)[ao].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,ao)[ao].error("This is not a test profile"):i(this,ao)[ao].error("Sync variable failed"),e}))}fetchVariables(e){i(this,ho)[ho].push(K,{t:4}),e&&"function"==typeof e&&(i(this,go)[go]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,bo)[bo]=!0,ae.saveToLSorCookie("WZRK_PE",e),i(this,po)[po]=e;for(const t in i(this,uo)[uo])e.hasOwnProperty(t)&&i(this,uo)[uo][t].update(e[t]);i(this,go)[go]&&i(this,go)[go](),i(this,mo)[mo]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,fo)[fo].push(e),this.hasVarsRequestCompleted()&&e()):i(this,ao)[ao].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,vo)[vo].push(e))}removeVariablesChangedCallback(e){const t=i(this,fo)[fo].indexOf(e);-1!==t&&i(this,fo)[fo].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,vo)[vo].indexOf(e);-1!==t&&i(this,vo)[vo].splice(t,1)}}var wo=function(){for(var e of i(this,fo)[fo])e();for(var t of i(this,vo)[vo])t();i(this,vo)[vo].length=0},Co=t("logger"),ko=t("api"),xo=t("onloadcalled"),Po=t("device"),So=t("session"),Io=t("account"),Oo=t("request"),_o=t("variableStore"),Eo=t("isSpa"),Ao=t("previousUrl"),Lo=t("boundCheckPageChanged"),Mo=t("dismissSpamControl"),To=t("processOldValues"),Ro=t("debounce"),jo=t("checkPageChanged"),Do=t("pingRequest"),zo=t("isPingContinuous"),Bo=t("overrideDSyncFlag"),No=t("sendLocationData");var Uo=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},Fo=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},qo=function(){i(this,Ro)[Ro]((()=>{i(this,Ao)[Ao]!==location.href&&this.pageChanged()}))()},Vo=function(){let e=i(this,Io)[Io].dataPostURL,t={};t=i(this,Oo)[Oo].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ke(JSON.stringify(t),i(this,Co)[Co])),i(this,Oo)[Oo].saveAndFireRequest(e,le.blockRequest)},Wo=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},Ko=function(e){this._isPersonalisationActive()&&(e.dsync=!0)},Go=function(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}le.location&&(t.af={...t.af,...le.location}),t=i(this,Oo)[Oo].addSystemDataToObject(t,!0),i(this,Oo)[Oo].addFlags(t);const n=Ke(JSON.stringify(t),i(this,Co)[Co]);let s=i(this,Io)[Io].dataPostURL;s=Ve(s,"type",A),s=Ve(s,"d",n),i(this,Oo)[Oo].saveAndFireRequest(s,le.blockRequest)};const Ho=new class{get spa(){return i(this,Eo)[Eo]}set spa(e){const t=!0===e;i(this,Eo)[Eo]!==t&&1===i(this,xo)[xo]&&(t?document.addEventListener("click",i(this,Lo)[Lo]):document.removeEventListener("click",i(this,Lo)[Lo])),i(this,Eo)[Eo]=t}get dismissSpamControl(){return i(this,Mo)[Mo]}set dismissSpamControl(e){const t=!0===e;i(this,Mo)[Mo]=t,le.dismissSpamControl=t}constructor(){var e,t,o,n,s;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,No,{value:Go}),Object.defineProperty(this,Bo,{value:Ko}),Object.defineProperty(this,zo,{value:Wo}),Object.defineProperty(this,Do,{value:Vo}),Object.defineProperty(this,jo,{value:qo}),Object.defineProperty(this,Ro,{value:Fo}),Object.defineProperty(this,To,{value:Uo}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,Oo,{writable:!0,value:void 0}),Object.defineProperty(this,_o,{writable:!0,value:void 0}),Object.defineProperty(this,Eo,{writable:!0,value:void 0}),Object.defineProperty(this,Ao,{writable:!0,value:void 0}),Object.defineProperty(this,Lo,{writable:!0,value:i(this,jo)[jo].bind(this)}),Object.defineProperty(this,Mo,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,xo)[xo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,Co)[Co]=new hi(si),i(this,Io)[Io]=new d(null===(e=r.account)||void 0===e?void 0:e[0],r.region||(null===(t=r.account)||void 0===t?void 0:t[1]),r.targetDomain||(null===(o=r.account)||void 0===o?void 0:o[2]),r.token||(null===(n=r.account)||void 0===n?void 0:n[3])),i(this,Po)[Po]=new ye({logger:i(this,Co)[Co]}),i(this,Mo)[Mo]=r.dismissSpamControl||!1,this.shpfyProxyPath=r.shpfyProxyPath||"",i(this,So)[So]=new bi({logger:i(this,Co)[Co],isPersonalisationActive:this._isPersonalisationActive}),i(this,Oo)[Oo]=new Oi({logger:i(this,Co)[Co],account:i(this,Io)[Io],device:i(this,Po)[Po],session:i(this,So)[So],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=r.enablePersonalization||!1,this.event=new Ue({logger:i(this,Co)[Co],request:i(this,Oo)[Oo],isPersonalisationActive:this._isPersonalisationActive},r.event),this.profile=new gt({logger:i(this,Co)[Co],request:i(this,Oo)[Oo],account:i(this,Io)[Io],isPersonalisationActive:this._isPersonalisationActive},r.profile),this.onUserLogin=new It({request:i(this,Oo)[Oo],account:i(this,Io)[Io],session:i(this,So)[So],logger:i(this,Co)[Co],device:i(this,Po)[Po]},r.onUserLogin),this.privacy=new Ri({request:i(this,Oo)[Oo],account:i(this,Io)[Io],logger:i(this,Co)[Co]},r.privacy),this.notifications=new $i({logger:i(this,Co)[Co],request:i(this,Oo)[Oo],account:i(this,Io)[Io]},r.notifications),i(this,_o)[_o]=new yo({logger:i(this,Co)[Co],request:i(this,Oo)[Oo],account:i(this,Io)[Io],event:this.event}),i(this,ko)[ko]=new be({logger:i(this,Co)[Co],request:i(this,Oo)[Oo],device:i(this,Po)[Po],session:i(this,So)[So]}),this.spa=r.spa,this.dismissSpamControl=r.dismissSpamControl,this.user=new oi({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,So)[So].getTimeElapsed(),getPageCount:()=>i(this,So)[So].getPageCount()},this.logout=()=>{i(this,Co)[Co].debug("logout called"),ae.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,Po)[Po].getGuid(),this.getAccountID=()=>i(this,Io)[Io].id,this.getSCDomain=()=>i(this,Io)[Io].finalTargetDomain,this.setLibrary=(e,t)=>{le.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,Io)[Io].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,Io)[Io].scSDKVersion};let o=i(this,Io)[Io].dataPostURL;o=Ve(o,"type","page"),o=Ve(o,"d",Ke(JSON.stringify(t),i(this,Co)[Co])),i(this,Oo)[Oo].saveAndFireRequest(o,le.blockRequest)},Kt()&&(qt(),Ft(i(this,Co)[Co])),this.getInboxMessageCount=()=>{const e=Nt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(le.inbox)return le.inbox.unviewedCounter;i(this,Co)[Co].debug("No unread messages")},this.getAllInboxMessages=()=>Nt(),this.getUnreadInboxMessages=()=>{if(le.inbox)return le.inbox.unviewedMessages;i(this,Co)[Co].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Nt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,Co)[Co].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,Co)[Co].error("No message available for message Id "+e);else{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);0===t[e].viewed&&(le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],document.getElementById("unviewedBadge").innerText=le.inbox.unviewedCounter,document.getElementById("unviewedBadge").style.display=le.inbox.unviewedCounter>0?"flex":"none"),i&&i.remove(),delete t[e],Ut(t)}},this.markReadInboxMessage=e=>{const t=le.inbox.unviewedMessages,o=Nt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,Co)[Co].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);if(null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none"),o[e].viewed=1,document.getElementById("unviewedBadge")){var n=parseInt(document.getElementById("unviewedBadge").innerText)-1;document.getElementById("unviewedBadge").innerText=n,document.getElementById("unviewedBadge").style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),le.inbox.unviewedCounter--,delete le.inbox.unviewedMessages[e],Ut(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t<e.length;t++)this.markReadInboxMessage(e[t])},this.markReadAllInboxMessage=()=>{const e=le.inbox.unviewedMessages,t=Nt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox").shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none"),t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})})),document.getElementById("unviewedBadge").innerText=0,document.getElementById("unviewedBadge").style.display="none",Ut(t),le.inbox.unviewedCounter=0,le.inbox.unviewedMessages={}}else i(this,Co)[Co].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=le.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(R,e)},this.renderNotificationClicked=e=>{a(j,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[T]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(M)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,Oo)[Oo].processEvent(o)};this.setLogLevel=e=>{i(this,Co)[Co].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,B)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,N):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,U):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,U):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,F)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const s=qe(location.href),r=s.e,a=s.p,l=s.page_type;if(void 0!==r){const s={};s.id=o.id,s.unsubGroups=le.unsubGroups,le.updatedCategoryLong&&(s.cUsY=le.updatedCategoryLong);let c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",r),c=Ve(c,"d",Ke(JSON.stringify(s),n)),a&&(c=Ve(c,"p",a)),"-1"!==e&&(c=Ve(c,"sub",e)),l&&(le.globalUnsubscribe=l===I,c=Ve(c,"page_type",l)),Qe.fireRequest(c)}})(e,t,o,i(this,Io)[Io],i(this,Co)[Co])};function c(e){var t=e.coords.latitude,o=e.coords.longitude;le.location={Latitude:t,Longitude:o},i(this,No)[No]({Latitude:t,Longitude:o})}function h(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");le.location={Latitude:e,Longitude:t},i(this,No)[No]({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),h):console.log("Geolocation is not supported by this browser.")};const u=i(this,ko)[ko];u.logout=this.logout,u.clear=this.clear,u.closeIframe=(e,t)=>{at(e,0,i(this,So)[So].sessionId)},u.enableWebPush=(e,t)=>{this.notifications._enableWebPush(e,t)},u.tr=e=>{ti(e,{device:i(this,Po)[Po],session:i(this,So)[So],request:i(this,Oo)[Oo],logger:i(this,Co)[Co]})},u.setEnum=e=>{((e,t)=>{if(H(e)||Q(e))return"$E_"+e;t.error(Ae)})(e,i(this,Co)[Co])},u.is_onloadcalled=()=>1===i(this,xo)[xo],u.subEmail=e=>{l("1",e)},u.getEmail=(e,t)=>{l("-1",e,t)},u.unSubEmail=e=>{l("0",e)},u.unsubEmailGroups=e=>{le.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e<t.length;e++){const i=t[e];if(i.name){const e={name:i.name,isUnsubscribed:i.checked};le.unsubGroups.push(e)}}l("2",e)},u.setSubscriptionGroups=e=>{le.unsubGroups=e},u.getSubscriptionGroups=()=>le.unsubGroups,u.changeSubscriptionGroups=(e,t)=>{u.setSubscriptionGroups(t),l("2",e)},u.isGlobalUnsubscribe=()=>le.globalUnsubscribe,u.setIsGlobalUnsubscribe=e=>{le.globalUnsubscribe=e},u.setUpdatedCategoryLong=e=>{e.cUsY&&(le.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=u,(null===(s=r.account)||void 0===s?void 0:s[0].id)&&this.init()}init(e,t,o,n){if(1===i(this,xo)[xo])return;if((e=>{const t=window.location.search,i=window.opener;if("?ctBuilder"===t)return e.debug("open in visual builder mode"),window.addEventListener("message",Zt,!1),void(i&&i.postMessage({message:"builder",originUrl:window.location.href},"*"));"?ctBuilderPreview"===t&&(window.addEventListener("message",Zt,!1),i&&i.postMessage({message:"preview",originUrl:window.location.href},"*"))})(i(this,Co)[Co]),ae.removeCookie("WZRK_P",window.location.hostname),!i(this,Io)[Io].id){if(!e)return void i(this,Co)[Co].error(ke);i(this,Io)[Io].id=e}i(this,So)[So].cookieName="WZRK_S_"+i(this,Io)[Io].id,t&&(i(this,Io)[Io].region=t),o&&(i(this,Io)[Io].targetDomain=o),n&&(i(this,Io)[Io].token=n);const s=location.href,r=qe(s.toLowerCase());if(void 0!==r.e&&"0"==r.wzrk_ex)return;le.isPrivacyArrPushed=!0,le.privacyArray.length>0&&this.privacy.push(le.privacyArray),i(this,To)[To](),this.pageChanged();const a=setInterval((()=>{i(this,Po)[Po].gcookie&&(clearInterval(a),i(this,Oo)[Oo].processBackupEvents())}),3e3);i(this,Eo)[Eo]?document.addEventListener("click",i(this,Lo)[Lo]):document.removeEventListener("click",i(this,Lo)[Lo]),i(this,xo)[xo]=1}pageChanged(){const e=window.location.href,t=qe(e.toLowerCase()),o=i(this,So)[So].getSessionCookieObject();let n=void 0===o.p?0:o.p;o.p=++n,i(this,So)[So].setSessionCookieObject(o);let s={},r=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==r){const e=120;""!==r&&(r=r.length>e?r.substring(0,e):r,s.referrer=r);let i=t.utm_source||t.wzrk_source;void 0!==i&&(i=i.length>e?i.substring(0,e):i,s.us=i);let o=t.utm_medium||t.wzrk_medium;void 0!==o&&(o=o.length>e?o.substring(0,e):o,s.um=o);let n=t.utm_campaign||t.wzrk_campaign;if(void 0!==n&&(n=n.length>e?n.substring(0,e):n,s.uc=n),void 0!==t.wzrk_medium){const e=t.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(s.wm=e)}}s=i(this,Oo)[Oo].addSystemDataToObject(s,void 0),s.cpg=e,s.WZRK_CAMP=it();let a=i(this,Io)[Io].dataPostURL;i(this,Oo)[Oo].addFlags(s),1===parseInt(s.pg)&&i(this,Bo)[Bo](s),a=Ve(a,"type","page"),a=Ve(a,"d",Ke(JSON.stringify(s),i(this,Co)[Co])),i(this,Oo)[Oo].saveAndFireRequest(a,le.blockRequest),1===parseInt(s.pg)&&this.event.push(K,{t:4}),i(this,Ao)[Ao]=e,setTimeout((()=>{n<=3&&i(this,Do)[Do](),i(this,zo)[zo]()&&setInterval((()=>{i(this,Do)[Do]()}),3e5)}),12e4)}_isPersonalisationActive(){return ae._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}setOffline(e){"boolean"==typeof e?(le.offline=e,e||i(this,Oo)[Oo].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}getSDKVersion(){return"web-sdk-v1.9.1"}defineVariable(e,t){return ro.define(e,t,i(this,_o)[_o])}syncVariables(e,t){if(4===i(this,Co)[Co].logLevel)return i(this,_o)[_o].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,Co)[Co].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,_o)[_o].fetchVariables(e)}addVariablesChangedCallback(e){i(this,_o)[_o].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,_o)[_o].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=Ho,Ho}));