@braze/web-sdk-no-amd
Version:
Braze SDK without AMD for web sites and other JS platforms.
104 lines • 195 kB
JavaScript
/*
* Braze Web SDK v3.5.1
* (c) Braze, Inc. 2022 - http://braze.com
* License available at https://github.com/Appboy/appboy-web-sdk/blob/master/LICENSE
* Compiled on 2022-03-24
*/
(function(){(function(b,a){if("object"===typeof module&&module.exports) {var e = a();module.exports=e;module.exports.default=e;}else if(b.appboy){var d=a(),c;for(c in d)b.appboy[c]=d[c]}else b.appboy=a()})("undefined"!==typeof self?self:this,function(){var appboyInterface={};var p;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function ba(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}var ca="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},da="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
function ea(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var fa=ea(this);function ha(a,b){if(b)a:{var c=fa;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&da(c,a,{configurable:!0,writable:!0,value:b})}}var ia;
if("function"==typeof Object.setPrototypeOf)ia=Object.setPrototypeOf;else{var ja;a:{var ka={Og:!0},la={};try{la.__proto__=ka;ja=la.Og;break a}catch(a){}ja=!1}ia=ja?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ma=ia;
function na(a,b){a.prototype=ca(b.prototype);a.prototype.constructor=a;if(ma)ma(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.gi=b.prototype}
ha("String.prototype.repeat",function(a){return a?a:function(b){if(null==this)throw new TypeError("The 'this' value for String.prototype.repeat must not be null or undefined");var c=this+"";if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var d="";b;)if(b&1&&(d+=c),b>>>=1)c+=c;return d}});
ha("Promise",function(a){function b(g){this.Ub=0;this.Rd=void 0;this.sb=[];var h=this.Ad();try{g(h.resolve,h.reject)}catch(l){h.reject(l)}}function c(){this.Ha=null}function d(g){return g instanceof b?g:new b(function(h){h(g)})}if(a)return a;c.prototype.Te=function(g){if(null==this.Ha){this.Ha=[];var h=this;this.Ue(function(){h.eh()})}this.Ha.push(g)};var e=fa.setTimeout;c.prototype.Ue=function(g){e(g,0)};c.prototype.eh=function(){for(;this.Ha&&this.Ha.length;){var g=this.Ha;this.Ha=[];for(var h=
0;h<g.length;++h){var l=g[h];g[h]=null;try{l()}catch(k){this.Sg(k)}}}this.Ha=null};c.prototype.Sg=function(g){this.Ue(function(){throw g;})};b.prototype.Ad=function(){function g(k){return function(m){l||(l=!0,k.call(h,m))}}var h=this,l=!1;return{resolve:g(this.uh),reject:g(this.Qd)}};b.prototype.uh=function(g){if(g===this)this.Qd(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof b)this.Kh(g);else{a:switch(typeof g){case "object":var h=null!=g;break a;case "function":h=!0;break a;
default:h=!1}h?this.sh(g):this.ef(g)}};b.prototype.sh=function(g){var h=void 0;try{h=g.then}catch(l){this.Qd(l);return}"function"==typeof h?this.Lh(h,g):this.ef(g)};b.prototype.Qd=function(g){this.qf(2,g)};b.prototype.ef=function(g){this.qf(1,g)};b.prototype.qf=function(g,h){if(0!=this.Ub)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.Ub);this.Ub=g;this.Rd=h;this.fh()};b.prototype.fh=function(){if(null!=this.sb){for(var g=0;g<this.sb.length;++g)f.Te(this.sb[g]);this.sb=
null}};var f=new c;b.prototype.Kh=function(g){var h=this.Ad();g.Cc(h.resolve,h.reject)};b.prototype.Lh=function(g,h){var l=this.Ad();try{g.call(h,l.resolve,l.reject)}catch(k){l.reject(k)}};b.prototype.then=function(g,h){function l(v,t){return"function"==typeof v?function(w){try{k(v(w))}catch(r){m(r)}}:t}var k,m,q=new b(function(v,t){k=v;m=t});this.Cc(l(g,k),l(h,m));return q};b.prototype.catch=function(g){return this.then(void 0,g)};b.prototype.Cc=function(g,h){function l(){switch(k.Ub){case 1:g(k.Rd);
break;case 2:h(k.Rd);break;default:throw Error("Unexpected state: "+k.Ub);}}var k=this;null==this.sb?f.Te(l):this.sb.push(l)};b.resolve=d;b.reject=function(g){return new b(function(h,l){l(g)})};b.race=function(g){return new b(function(h,l){for(var k=ba(g),m=k.next();!m.done;m=k.next())d(m.value).Cc(h,l)})};b.all=function(g){var h=ba(g),l=h.next();return l.done?d([]):new b(function(k,m){function q(w){return function(r){v[w]=r;t--;0==t&&k(v)}}var v=[],t=0;do v.push(void 0),t++,d(l.value).Cc(q(v.length-
1),m),l=h.next();while(!l.done)})};return b});var oa={Vh:function(a){var b="=".repeat((4-a.length%4)%4);a=(a+b).replace(/\-/g,"+").replace(/_/g,"/");a=atob(a);b=new Uint8Array(a.length);for(var c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}};var pa={Ia:function(){function a(b){var c=(Math.random().toString(16)+"000000000").substr(2,8);return b?"-"+c.substr(0,4)+"-"+c.substr(4,4):c}return a()+a(!0)+a(!0)+a()}};function qa(a){var b=x;this.Le="undefined"===typeof window?self:window;this.C=a;this.F=b}function ra(a){if("indexedDB"in a.Le)return a.Le.indexedDB}
function sa(a){try{if(null==ra(a))return!1;ra(a).open("Braze IndexedDB Support Test");if("undefined"!==typeof window){var b=window.bi||window.Ya||window.di;if(b&&b.wh&&b.wh.id)return a.F.info("Not using IndexedDB for storage because we are running inside an extension"),!1}return!0}catch(c){return a.F.info("Not using IndexedDB for storage due to following error: "+c),!1}}
function ta(a,b,c){var d=ra(a).open(a.C.P,a.C.VERSION);if(null==d)return"function"===typeof c&&c(),!1;d.onupgradeneeded=function(e){a.F.info("Upgrading indexedDB "+a.C.P+" to v"+a.C.VERSION+"...");e=e.target.result;for(var f in a.C.G)a.C.G.hasOwnProperty(f)&&!e.objectStoreNames.contains(a.C.G[f])&&e.createObjectStore(a.C.G[f])};d.onsuccess=function(e){var f=e.target.result;f.onversionchange=function(){f.close();"function"===typeof c&&c();a.F.error("Needed to close the database unexpectedly because of an upgrade in another tab")};
b(f)};d.onerror=function(e){a.F.info("Could not open indexedDB "+a.C.P+" v"+a.C.VERSION+": "+e.target.errorCode);"function"===typeof c&&c();return!0};return!0}
qa.prototype.setItem=function(a,b,c,d,e){if(!sa(this))return"function"===typeof e&&e(),!1;var f=this;return ta(this,function(g){g.objectStoreNames.contains(a)?(g=g.transaction([a],"readwrite").objectStore(a).put(c,b),g.onerror=function(){f.F.error("Could not store object "+b+" in "+a+" on indexedDB "+f.C.P);"function"===typeof e&&e()},g.onsuccess=function(){"function"===typeof d&&d()}):(f.F.error("Could not store object "+b+" in "+a+" on indexedDB "+f.C.P+" - "+a+" is not a valid objectStore"),"function"===
typeof e&&e())},e)};qa.prototype.getItem=function(a,b,c){if(!sa(this))return!1;var d=this;return ta(this,function(e){e.objectStoreNames.contains(a)?(e=e.transaction([a],"readonly").objectStore(a).get(b),e.onerror=function(){d.F.error("Could not retrieve object "+b+" in "+a+" on indexedDB "+d.C.P)},e.onsuccess=function(f){f=f.target.result;null!=f&&c(f)}):d.F.error("Could not retrieve object "+b+" in "+a+" on indexedDB "+d.C.P+" - "+a+" is not a valid objectStore")})};
function ua(a,b,c,d){sa(a)?ta(a,function(e){e.objectStoreNames.contains(b)?(e=e.transaction([b],"readonly").objectStore(b).openCursor(null,"prev"),e.onerror=function(){a.F.error("Could not open cursor for "+b+" on indexedDB "+a.C.P);"function"===typeof d&&d()},e.onsuccess=function(f){f=f.target.result;null!=f&&null!=f.value&&null!=f.key?c(f.key,f.value):"function"===typeof d&&d()}):(a.F.error("Could not retrieve last record from "+b+" on indexedDB "+a.C.P+" - "+b+" is not a valid objectStore"),"function"===
typeof d&&d())},d):"function"===typeof d&&d()}function va(a,b,c){sa(a)&&ta(a,function(d){d.objectStoreNames.contains(b)?d.transaction([b],"readwrite").objectStore(b)["delete"](c).onerror=function(){a.F.error("Could not delete record "+c+" from "+b+" on indexedDB "+a.C.P)}:a.F.error("Could not delete record "+c+" from "+b+" on indexedDB "+a.C.P+" - "+b+" is not a valid objectStore")})}
function wa(a,b,c){sa(a)&&ta(a,function(d){if(d.objectStoreNames.contains(b)){var e=d.transaction([b],"readwrite").objectStore(b);d=e.openCursor();var f=[];d.onerror=function(){0<f.length?(a.F.info("Cursor closed midway through for "+b+" on indexedDB "+a.C.P),c(f)):a.F.error("Could not open cursor for "+b+" on indexedDB "+a.C.P)};d.onsuccess=function(g){var h=g.target.result;null!=h?(null!=h.value&&null!=h.key&&(e["delete"](h.key).onsuccess=function(){f.push(h.value)}),h.continue()):0<f.length&&c(f)}}else a.F.error("Could not retrieve objects from "+
b+" on indexedDB "+a.C.P+" - "+b+" is not a valid objectStore")})}
qa.prototype.clearData=function(){if(!sa(this))return!1;var a=[],b;for(b in this.C.G)this.C.G.hasOwnProperty(b)&&this.C.G[b]!==this.C.G.xb&&a.push(this.C.G[b]);var c=this;return ta(this,function(d){d=d.transaction(a,"readwrite");for(var e=0;e<a.length;e++)d.objectStore(a[e]).clear().onerror=function(){c.F.error("Could not clear "+this.source.name+" on indexedDB "+c.C.P)};d.onerror=function(){c.F.error("Could not clear object stores on indexedDB "+c.C.P)}})};var xa={Gd:function(a){if(void 0!==a||void 0===xa.Ea)xa.Ea=!!a;xa.He||(xa.He=!0)},Jb:function(){xa.He=!1;xa.Ea=void 0;xa.F=void 0},Td:function(a){"function"!==typeof a?xa.info("Ignoring setLogger call since logger is not a function"):(xa.Gd(),xa.F=a)},Yd:function(){xa.Gd();xa.Ea?(console.log("Disabling Appboy logging"),xa.Ea=!1):(console.log("Enabled Appboy logging"),xa.Ea=!0)},info:function(a){xa.Ea&&(a="Appboy: "+a,null!=xa.F?xa.F(a):console.log(a))},warn:function(a){xa.Ea&&(a="Appboy SDK Warning: "+
a+" (v3.5.1)",null!=xa.F?xa.F(a):console.warn(a))},error:function(a){xa.Ea&&(a="Appboy SDK Error: "+a+" (v3.5.1)",null!=xa.F?xa.F(a):console.error(a))}};var z={CustomEvent:"ce",eg:"p",sg:"pc",$h:"ca",fg:"i",Yc:"ie",Jf:"cci",Lf:"ccic",Hf:"ccc",If:"ccd",ve:"ss",yg:"se",dg:"si",ke:"sc",je:"sbc",cg:"sfe",Mf:"iec",lg:"lr",Df:"uae",Gf:"ci",Ff:"cc",jg:"lcaa",kg:"lcar",Of:"inc",Nf:"add",Pf:"rem",Qf:"set",zg:"sgu"},ya={$f:"feed_displayed",Kf:"content_cards_displayed"},za={ba:{P:"AppboyServiceWorkerAsyncStorage",VERSION:6,G:{Rf:"data",oe:"pushClicks",gd:"pushSubscribed",Yh:"fallbackDevice",Ef:"cardUpdates",xb:"optOut",me:"pendingData",qe:"sdkAuthenticationSignature"},
kb:1}},x=xa,C={Af:"allowCrawlerActivity",Rc:"baseUrl",ng:"noCookies",ee:"devicePropertyAllowlist",Vc:"devicePropertyWhitelist",Wf:"disablePushTokenMaintenance",Yf:"enableLogging",Zf:"enableSdkAuthentication",mg:"manageServiceWorkerExternally",ag:"minimumIntervalBetweenTriggerActionsInSeconds",xg:"sessionTimeoutInSeconds",Cf:"appVersion",wg:"serviceWorkerLocation",ug:"safariWebsitePushId",cd:"localization",be:"contentSecurityNonce",fe:"enableHtmlInAppMessages",Zd:"allowUserSuppliedJavascript",bg:"inAppMessageZIndex",
pg:"openInAppMessagesInNewTab",qg:"openNewsFeedCardsInNewTab",tg:"requireExplicitInAppMessageDismissal",Xf:"doNotLoadFontAwesome",re:"sdkFlavor",$c:"language",og:"openCardsInNewTab"};function Aa(a,b,c,d){a=Ba(a);return-1===a.indexOf(b)?(x.error(c+" Valid values from "+d+' are "'+a.join('"/"')+'".'),!1):!0}function Ca(a){return Array.isArray?Array.isArray(a):"[object Array]"===Object.prototype.toString.call(a)}function Da(a){return"[object Date]"===Object.prototype.toString.call(a)}function Ea(a){return"[object Object]"===Object.prototype.toString.call(a)}
function Fa(a){null==a&&(a=[]);for(var b=[],c=arguments.length,d=0,e=a.length;d<e;d++){var f=a[d];if(-1===b.indexOf(f)){var g;for(g=1;g<c&&-1!==arguments[g].indexOf(f);g++);g===c&&b.push(f)}}return b}function Ga(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b}function Ba(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&void 0!==a[c]&&b.push(a[c]);return b}
function Ha(a,b){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;var c=a.toString();if(c!==b.toString())return!1;switch(c){case "[object RegExp]":case "[object String]":return""+a===""+b;case "[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case "[object Date]":case "[object Boolean]":return+a===+b}c="[object Array]"===c;if(!c){if("object"!==typeof a||"object"!==typeof b)return!1;var d=a.constructor,e=b.constructor;if(d!==e&&!("function"===typeof d&&d instanceof
d&&"function"===typeof e&&e instanceof e)&&"constructor"in a&&"constructor"in b)return!1}d=[];e=[];for(var f=d.length;f--;)if(d[f]===a)return e[f]===b;d.push(a);e.push(b);if(c){f=a.length;if(f!==b.length)return!1;for(;f--;)if(!Ha(a[f],b[f]))return!1}else{c=Ga(a);f=c.length;if(Ga(b).length!==f)return!1;for(;f--;){var g=c[f];if(!b.hasOwnProperty(g)||!Ha(a[g],b[g]))return!1}}d.pop();e.pop();return!0};function Ia(a,b){a/=1E3;b&&(a=Math.floor(a));return a}function Ja(a){var b=parseInt(a);return null==a||isNaN(b)?null:new Date(1E3*b)}function Ka(a){return null!=a&&Da(a)?a.toISOString().replace(/\.[0-9]{3}Z$/,""):a}function La(a){return null==a||""===a?null:new Date(a)};function E(a,b,c,d,e){this.gb=a;this.type=b;this.time=null==c||""===c?(new Date).valueOf():c;this.sessionId=d;this.data=e}E.prototype.Ac=function(){var a={name:this.type,time:Ia(this.time),data:this.data||{},session_id:this.sessionId};null!=this.gb&&(a.user_id=this.gb);return a};E.prototype.A=function(){return{u:this.gb,t:this.type,ts:this.time,s:this.sessionId,d:this.data}};function Ma(a){return null!=a&&Ea(a)&&null!=a.t&&""!==a.t}function Na(a){return new E(a.u,a.t,a.ts,a.s,a.d)};function Oa(a,b,c){null==a&&(a=pa.Ia());c=parseInt(c);if(isNaN(c)||0===c)c=(new Date).valueOf();this.ia=a;this.Ib=c;this.Ob=(new Date).valueOf();this.Cd=b}Oa.prototype.A=function(){return{g:this.ia,e:this.Cd,c:this.Ib,l:this.Ob}};function Pa(a){for(var b=a.length,c=a.length-1;0<=c;c--){var d=a.charCodeAt(c);127<d&&2047>=d?b++:2047<d&&65535>=d&&(b+=2);56320<=d&&57343>=d&&c--}return b};function Qa(a,b,c,d){(d="string"===typeof a||null===a&&d)||x.error("Cannot "+b+" because "+c+' "'+a+'" is invalid.');return d}function Ra(a,b,c){var d=null!=a&&"string"===typeof a&&(""===a||a.match(Sa));d||x.error("Cannot "+b+" because "+c+' "'+a+'" is invalid.');return d}
function Ta(a,b,c,d,e){null==a&&(a={});if("object"!==typeof a||Ca(a))return x.error(b+" requires that "+c+" be an object. Ignoring "+e+"."),[!1,null];b=JSON.stringify(a);if(Pa(b)>Ua)return x.error("Could not "+d+" because "+c+" was greater than the max size of "+Va+"."),[!1,null];try{var f=JSON.parse(b)}catch(k){return x.error("Could not "+d+" because "+c+" did not contain valid JSON."),[!1,null]}for(var g in a){if(!Ra(g,d,"the "+e+" property name"))return[!1,null];c=a[g];if(null==c)delete a[g],delete f[g];
else{Da(c)&&(f[g]=Ka(c));var h=d,l="the "+e+' property "'+g+'"';(b=Ea(c)||Ca(c)?Wa(c,f[g]):Ya(c))||x.error("Cannot "+h+" because "+l+' "'+c+'" is invalid.');if(!b)return[!1,null]}}return[!0,f]}function Wa(a,b){if(Ca(a)&&Ca(b))for(var c=0;c<a.length&&c<b.length;c++){if(Da(a[c])&&(b[c]=Ka(a[c])),!Wa(a[c],b[c]))return!1}else if(Ea(a)){c=ba(Ga(a));for(var d=c.next();!d.done;d=c.next())if(d=d.value,Da(a[d])&&(b[d]=Ka(a[d])),!Wa(a[d],b[d]))return!1}else return Ya(a);return!0}
function Ya(a){var b=typeof a;return null==a||"number"===b||"boolean"===b||Da(a)||"string"===b}var Sa=/^[^\x00-\x1F\x22]+$/,Za=new RegExp(/^.+@.+\..+$/),Ua=51200,Va="50KB";var J={};function K(a,b){this.f=a;this.H=b}p=K.prototype;p.o=function(a){null==a&&x.error("getUserId must be supplied with a callback. e.g., appboy.getUser().getUserId(function(userId) {console.log('the user id is ' + userId)})");"function"===typeof a&&a(this.f.o())};
p.Pg=function(a,b){if(!Qa(a,"add alias","the alias",!1)||0>=a.length)return x.error("addAlias requires a non-empty alias"),!1;if(!Qa(b,"add alias","the label",!1)||0>=b.length)return x.error("addAlias requires a non-empty label"),!1;var c=this.H,d=new $a,e=ab(c.D),f=z.Df;d.j.push(new E(c.f.o(),f,(new Date).valueOf(),e,{a:a,l:b}));d.h=bb(c.b,d.j);return d.h};p.Eh=function(a){return Qa(a,"set first name","the firstName",!0)?cb(this.f,"first_name",a):!1};
p.Ih=function(a){return Qa(a,"set last name","the lastName",!0)?cb(this.f,"last_name",a):!1};p.Ch=function(a){return null===a||"string"===typeof a&&null!=a.toLowerCase().match(Za)?cb(this.f,"email",a):(x.error('Cannot set email address - "'+a+'" did not pass RFC-5322 validation.'),!1)};p.Fh=function(a){"string"===typeof a&&(a=a.toLowerCase());return null===a||Aa(db,a,'Gender "'+a+'" is not a valid gender.',"User.Genders")?cb(this.f,"gender",a):!1};
p.Bh=function(a,b,c){if(null===a&&null===b&&null===c)return cb(this.f,"dob",null);a=parseInt(a);b=parseInt(b);c=parseInt(c);return isNaN(a)||isNaN(b)||isNaN(c)||12<b||1>b||31<c||1>c?(x.error("Cannot set date of birth - parameters should comprise a valid date e.g. setDateOfBirth(1776, 7, 4);"),!1):cb(this.f,"dob",""+a+"-"+b+"-"+c)};p.yh=function(a){return Qa(a,"set country","the country",!0)?cb(this.f,"country",a):!1};
p.Gh=function(a){return Qa(a,"set home city","the homeCity",!0)?cb(this.f,"home_city",a):!1};p.Hh=function(a){return Qa(a,"set language","the language",!0)?cb(this.f,"language",a):!1};p.Dh=function(a){return Aa(eb,a,'Email notification setting "'+a+'" is not a valid subscription type.',"User.NotificationSubscriptionTypes")?cb(this.f,"email_subscribe",a):!1};
p.Ud=function(a){return Aa(eb,a,'Push notification setting "'+a+'" is not a valid subscription type.',"User.NotificationSubscriptionTypes")?cb(this.f,"push_subscribe",a):!1};p.Jh=function(a){return Qa(a,"set phone number","the phoneNumber",!0)?null===a||a.match(fb)?cb(this.f,"phone",a):(x.error('Cannot set phone number - "'+a+'" did not pass validation.'),!1):!1};p.xh=function(a){return cb(this.f,"image_url",a)};
p.Oc=function(a,b,c,d,e){if(null==a||null==b)return x.error("Cannot set last-known location - latitude and longitude are required."),!1;a=parseFloat(a);b=parseFloat(b);null!=c&&(c=parseFloat(c));null!=d&&(d=parseFloat(d));null!=e&&(e=parseFloat(e));return isNaN(a)||isNaN(b)||null!=c&&isNaN(c)||null!=d&&isNaN(d)||null!=e&&isNaN(e)?(x.error("Cannot set last-known location - all supplied parameters must be numeric."),!1):90<a||-90>a||180<b||-180>b?(x.error("Cannot set last-known location - latitude and longitude are bounded by \u00b190 and \u00b1180 respectively."),
!1):null!=c&&0>c||null!=e&&0>e?(x.error("Cannot set last-known location - accuracy and altitudeAccuracy may not be negative."),!1):this.H.Oc(this.f.o(),a,b,d,c,e).h};
p.Sd=function(a,b){if(!Ra(a,"set custom user attribute","the given key"))return!1;var c=typeof b,d=Da(b),e=Ca(b);if("number"!==c&&"boolean"!==c&&!d&&!e&&null!==b&&!Ra(b,'set custom user attribute "'+a+'"',"the given value"))return!1;d&&(b=Ka(b));if(e){for(c=0;c<b.length;c++)if(!Ra(b[c],'set custom user attribute "'+a+'"',"the element in the given array"))return!1;return gb(this.H,z.Qf,a,b).h}return this.f.Sd(a,b)};
p.Qg=function(a,b){return!Ra(a,"add to custom user attribute array","the given key")||null!=b&&!Ra(b,"add to custom user attribute array","the given value")?!1:gb(this.H,z.Nf,a,b).h};p.qh=function(a,b){return!Ra(a,"remove from custom user attribute array","the given key")||null!=b&&!Ra(b,"remove from custom user attribute array","the given value")?!1:gb(this.H,z.Pf,a,b).h};
p.kh=function(a,b){if(!Ra(a,"increment custom user attribute","the given key"))return!1;null==b&&(b=1);var c=parseInt(b);return isNaN(c)||c!==parseFloat(b)?(x.error('Cannot increment custom user attribute because the given incrementValue "'+b+'" is not an integer.'),!1):gb(this.H,z.Of,a,c).h};p.Pd=function(a,b,c,d,e){this.f.Pd(a,b,c,d,e);hb(this.H)};p.Sb=function(a){this.f.Sb(a)};
p.Ah=function(a,b,c){if(!Ra(a,"set custom location attribute","the given key"))return!1;if(null!==b||null!==c)if(b=parseFloat(b),c=parseFloat(c),isNaN(b)||90<b||-90>b||isNaN(c)||180<c||-180>c)return x.error("Received invalid values for latitude and/or longitude. Latitude and longitude are bounded by \u00b190 and \u00b1180 respectively, or must both be null for removal."),!1;var d=this.H,e=c;c=new $a;if(ib(d.J,a))x.info('Custom Attribute "'+a+'" is blocklisted, ignoring.'),c.h=!1;else{var f=ab(d.D);
if(null===b&&null===e){var g=z.kg;a={key:a}}else g=z.jg,a={key:a,latitude:b,longitude:e};c.j.push(new E(d.f.o(),g,(new Date).valueOf(),f,a));c.h=bb(d.b,c.j)}return c.h};p.Rg=function(a){return!Qa(a,"add user to subscription group","subscription group ID",!1)||0>=a.length?(x.error("addToSubscriptionGroup requires a non-empty subscription group ID"),!1):jb(this.H,a,kb).h};
p.rh=function(a){return!Qa(a,"remove user from subscription group","subscription group ID",!1)||0>=a.length?(x.error("removeFromSubscriptionGroup requires a non-empty subscription group ID"),!1):jb(this.H,a,lb).h};var fb=/^[0-9 .\\(\\)\\+\\-]+$/,db={MALE:"m",FEMALE:"f",OTHER:"o",UNKNOWN:"u",NOT_APPLICABLE:"n",PREFER_NOT_TO_SAY:"p"},eb={OPTED_IN:"opted_in",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed"},kb="subscribed",lb="unsubscribed";J.User=K;J.User.Genders=db;
J.User.NotificationSubscriptionTypes=eb;J.User.prototype.getUserId=K.prototype.o;J.User.prototype.setFirstName=K.prototype.Eh;J.User.prototype.setLastName=K.prototype.Ih;J.User.prototype.setEmail=K.prototype.Ch;J.User.prototype.setGender=K.prototype.Fh;J.User.prototype.setDateOfBirth=K.prototype.Bh;J.User.prototype.setCountry=K.prototype.yh;J.User.prototype.setHomeCity=K.prototype.Gh;J.User.prototype.setLanguage=K.prototype.Hh;J.User.prototype.setEmailNotificationSubscriptionType=K.prototype.Dh;
J.User.prototype.setPushNotificationSubscriptionType=K.prototype.Ud;J.User.prototype.setPhoneNumber=K.prototype.Jh;J.User.prototype.setAvatarImageUrl=K.prototype.xh;J.User.prototype.setLastKnownLocation=K.prototype.Oc;J.User.prototype.setCustomUserAttribute=K.prototype.Sd;J.User.prototype.addToCustomAttributeArray=K.prototype.Qg;J.User.prototype.removeFromCustomAttributeArray=K.prototype.qh;J.User.prototype.incrementCustomUserAttribute=K.prototype.kh;J.User.prototype.addAlias=K.prototype.Pg;
J.User.prototype.setCustomLocationAttribute=K.prototype.Ah;J.User.prototype.addToSubscriptionGroup=K.prototype.Rg;J.User.prototype.removeFromSubscriptionGroup=K.prototype.rh;function mb(){}mb.prototype.Ed=function(){};mb.prototype.Fd=function(){};mb.prototype.qb=function(){};function nb(a,b){if(a&&b)if(a=a.toLowerCase(),Ca(b.O))for(var c=0;c<b.O.length;c++){if(-1!==a.indexOf(b.O[c].toLowerCase()))return b.S}else if(-1!==a.indexOf(b.O.toLowerCase()))return b.S};var ob={ae:"Chrome",Wc:"Edge",dc:"Internet Explorer",le:"Opera",hd:"Safari",Zh:"Firefox"};function pb(){if(this.userAgentData=navigator.userAgentData){var a=this.userAgentData.brands;if(a&&a.length){a=ba(a);for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=void 0,d=[];for(c in ob)ob[c]!==ob.dc&&d.push(ob[c]);if((c=b.brand.match(new RegExp("("+d.join("|")+")","i")))&&0<c.length){var e=c[0];var f=b.version;break}}}this.Ya=e||"Unknown Browser";this.version=f||"Unknown Version"}}na(pb,mb);pb.prototype.Ed=function(){return this.Ya};pb.prototype.Fd=function(){return this.version};
pb.prototype.qb=function(a){var b=this;return this.ga?Promise.resolve(this.ga):(this.userAgentData.getHighEntropyValues?this.userAgentData.getHighEntropyValues(["platform"]):Promise.reject()).then(function(c){c=c.platform;for(var d=0;d<a.length;d++){var e=nb(c,a[d]);if(e)return b.ga=e,b.ga}return c}).catch(function(){return navigator.platform})};function qb(){this.We=rb()}na(qb,mb);qb.prototype.Ed=function(){return this.We[0]||"Unknown Browser"};qb.prototype.Fd=function(){return this.We[1]||"Unknown Version"};qb.prototype.qb=function(a){for(var b=0;b<a.length;b++){var c=nb(a[b].U,a[b]);if(c)return"Mac"===c&&1<navigator.maxTouchPoints&&(c="iOS"),Promise.resolve(c)}return Promise.resolve(navigator.platform)};
function rb(){var a=navigator.userAgent||"",b=a.match(/(samsungbrowser|tizen|roku|konqueror|icab|crios|opera|ucbrowser|chrome|safari|firefox|camino|msie|trident(?=\/))\/?\s*(\.?\d+(\.\d+)*)/i)||[];if(/trident/i.test(b[1])){var c=/\brv[ :]+(\.?\d+(\.\d+)*)/g.exec(a)||[];return[ob.dc,c[1]||""]}if(-1!==a.indexOf("(Web0S; Linux/SmartTV)"))return["LG Smart TV",null];if(-1!==a.indexOf("CrKey"))return["Chromecast",null];if(-1!==a.indexOf("BRAVIA")||-1!==a.indexOf("SonyCEBrowser")||-1!==a.indexOf("SonyDTV"))return["Sony Smart TV",
null];if(-1!==a.indexOf("PhilipsTV"))return["Philips Smart TV",null];if(a.match(/\b(Roku)\b/))return["Roku",null];if(a.match(/\bAFTM\b/))return["Amazon Fire Stick",null];if(b[1]===ob.ae&&(c=a.match(/\b(OPR|Edge|EdgA|Edg|UCBrowser)\/(\.?\d+(\.\d+)*)/),null!=c))return c=c.slice(1),c[0]=c[0].replace("OPR",ob.le),c[0]=c[0].replace("EdgA",ob.Wc),"Edg"===c[0]&&(c[0]=ob.Wc),[c[0],c[1]];if(b[1]===ob.hd&&(c=a.match(/\b(EdgiOS)\/(\.?\d+(\.\d+)*)/),null!=c))return c=c.slice(1),c[0]=c[0].replace("EdgiOS",ob.Wc),
[c[0],c[1]];b=b[2]?[b[1],b[2]]:[null,null];b[0]===ob.hd&&null!=(c=a.match(/version\/(\.?\d+(\.\d+)*)/i))&&b.splice(1,1,c[1]);null!=(c=a.match(/\b(UCBrowser)\/(\.?\d+(\.\d+)*)/))&&b.splice(1,1,c[2]);if(b[0]===ob.le&&null!=(c=a.match(/mini\/(\.?\d+(\.\d+)*)/i)))return["Opera Mini",c[1]||""];b[0]&&(a=b[0].toLowerCase(),"msie"===a&&(b[0]=ob.dc),"crios"===a&&(b[0]=ob.ae),"tizen"===a&&(b[0]="Samsung Smart TV",b[1]=null),"samsungbrowser"===a&&(b[0]="Samsung Browser"));return b};function sb(){var a=this;this.Md=new (navigator.userAgentData?pb:qb);this.userAgent=navigator.userAgent;this.Ya=this.Md.Ed();this.version=this.Md.Fd();this.qb().then(function(b){return a.ga=b});this.language=(navigator.ji||navigator.language||navigator.browserLanguage||navigator.ii||"").toLowerCase();this.lh=tb(this.userAgent)}sb.prototype.qb=function(){var a=this;return this.ga?Promise.resolve(this.ga):this.Md.qb(ub).then(function(b){return a.ga=b})};
function tb(a){a=a.toLowerCase();for(var b="googlebot bingbot slurp duckduckbot baiduspider yandex facebookexternalhit sogou ia_archiver https://github.com/prerender/prerender aolbuild bingpreview msnbot adsbot mediapartners-google teoma".split(" "),c=0;c<b.length;c++)if(-1!==a.indexOf(b[c]))return!0;return!1}
var ub=[{U:navigator.platform,O:"Win",S:"Windows"},{U:navigator.platform,O:"Mac",S:"Mac"},{U:navigator.platform,O:"BlackBerry",S:"BlackBerry"},{U:navigator.platform,O:"FreeBSD",S:"FreeBSD"},{U:navigator.platform,O:"OpenBSD",S:"OpenBSD"},{U:navigator.platform,O:"Nintendo",S:"Nintendo"},{U:navigator.platform,O:"SunOS",S:"SunOS"},{U:navigator.platform,O:"PlayStation",S:"PlayStation"},{U:navigator.platform,O:"X11",S:"X11"},{U:navigator.userAgent,O:["iPhone","iPad","iPod"],S:"iOS"},{U:navigator.platform,
O:"Pike v",S:"iOS"},{U:navigator.userAgent,O:["Web0S"],S:"WebOS"},{U:navigator.platform,O:["Linux armv7l","Android"],S:"Android"},{U:navigator.userAgent,O:["Android"],S:"Android"},{U:navigator.platform,O:"Linux",S:"Linux"}],vb=new sb;function wb(a,b){this.rc=a;this.R=b}function xb(a,b,c){var d=c;null!=c&&c instanceof Oa&&(d=c.A());a.rc.store(b,d)}function yb(a,b){var c=zb(a,b);null!=c&&(c.Ob=(new Date).valueOf(),xb(a,b,c))}function zb(a,b){a=a.rc.Z(b);null==a||null==a.g?a=null:(b=new Oa(a.g,a.e,a.c),b.Ob=a.l,a=b);return a}function bb(a,b){if(null==b||0===b.length)return!1;Ca(b)||(b=[b]);var c=a.R.Z(M.Wb);null!=c&&Ca(c)||(c=[]);for(var d=0;d<b.length;d++)c.push(b[d].A());return a.R.store(M.Wb,c)}
function Ab(a){var b=a.R.Z(M.Wb);a.R.remove(M.Wb);null==b&&(b=[]);a=[];var c=!1,d=null;if(Ca(b))for(var e=0;e<b.length;e++)Ma(b[e])?a.push(Na(b[e])):d=e;else c=!0;if(c||null!=d)e="Stored events could not be deserialized as Events",c&&(e+=", was "+Object.prototype.toString.call(b)+" not an array"),null!=d&&(e+=", value at index "+d+" does not look like an event"),e+=", serialized values were of type "+typeof b+": "+JSON.stringify(b),a.push(new E(null,z.Yc,(new Date).valueOf(),null,{e:e}));return a}
function O(a,b,c){Aa(M,b,"StorageManager cannot store object.","StorageManager.KEYS.OBJECTS")&&a.R.store(b,c)}function S(a,b){return Aa(M,b,"StorageManager cannot retrieve object.","StorageManager.KEYS.OBJECTS")?a.R.Z(b):!1}function Bb(a,b){Aa(M,b,"StorageManager cannot remove object.","StorageManager.KEYS.OBJECTS")&&a.R.remove(b)}wb.prototype.clearData=function(){for(var a=Ga(Cb),b=Ga(M),c=0;c<a.length;c++)this.rc.remove(Cb[a[c]]);for(a=0;a<b.length;a++)this.R.remove(M[b[a]])};
function Eb(a,b){var c=a.R.Z(M.Qa);null==c&&(c={});var d=b.user_id||M.Qc,e;for(e in b)"user_id"===e||null!=c[d]&&null!=c[d][e]||Fb(a,b.user_id,e,b[e])}function Fb(a,b,c,d){var e=a.R.Z(M.Qa);null==e&&(e={});var f=b||M.Qc,g=e[f];null==g&&(g={},null!=b&&(g.user_id=b));if("custom"===c){null==g[c]&&(g[c]={});for(var h in d)g[c][h]=d[h]}else g[c]=d;e[f]=g;return a.R.store(M.Qa,e)}function Gb(a){var b=a.R.Z(M.Qa);a.R.remove(M.Qa);a=[];for(var c in b)null!=b[c]&&a.push(b[c]);return a}
var Cb={lc:"ab.storage.userId",Uc:"ab.storage.deviceId",Ta:"ab.storage.sessionId"},M={jd:"ab.test",Wb:"ab.storage.events",Qa:"ab.storage.attributes",Qc:"ab.storage.attributes.anonymous_user",cc:"ab.storage.device",se:"ab.storage.sdk_metadata",ue:"ab.storage.session_id_for_cached_metadata",kc:"ab.storage.pushToken",dd:"ab.storage.newsFeed",bd:"ab.storage.lastNewsFeedRefresh",vb:"ab.storage.cardImpressions",te:"ab.storage.serverConfig",kd:"ab.storage.triggers",md:"ab.storage.triggers.ts",hg:"ab.storage.lastTriggeredTime",
gg:"ab.storage.lastTriggeredTimesById",ig:"ab.storage.lastTriggerEventDataById",hc:"ab.storage.messagingSessionStart",wb:"ab.storage.cc",ac:"ab.storage.ccLastFullSync",$b:"ab.storage.ccLastCardUpdated",hb:"ab.storage.ccClicks",ib:"ab.storage.ccImpressions",ua:"ab.storage.ccDismissals",fc:"ab.storage.lastDisplayedTriggerTimesById",ad:"ab.storage.lastDisplayedTriggerTime",zb:"ab.storage.triggerFireInstancesById",jb:"ab.storage.signature"};function Hb(a){this.$=a;this.df=vb.Ya===ob.hd?3:10}
Hb.prototype.Xa=function(a){return a+"."+this.$};Hb.prototype.store=function(a,b){b={v:b};try{return localStorage.setItem(this.Xa(a),JSON.stringify(b)),!0}catch(c){return x.info("Storage failure: "+c.message),!1}};Hb.prototype.Z=function(a){try{var b=JSON.parse(localStorage.getItem(this.Xa(a)));return null==b?null:b.v}catch(c){return x.info("Storage retrieval failure: "+c.message),null}};
Hb.prototype.remove=function(a){try{localStorage.removeItem(this.Xa(a))}catch(b){return x.info("Storage removal failure: "+b.message),!1}};function Ib(a,b){this.$=a;a=0;for(var c=document.location.hostname,d=c.split(".");a<d.length-1&&-1===document.cookie.indexOf("ab._gd=ab._gd");)a++,c="."+d.slice(-1-a).join("."),document.cookie="ab._gd=ab._gd;domain="+c+";";document.cookie="ab._gd=;expires="+(new Date(0)).toGMTString()+";domain="+c+";";this.Me=c;this.Ee=525949;this.Qe=!!b}
Ib.prototype.Xa=function(a){return null!=this.$?a+"."+this.$:a};function Jb(a){var b=new Date;b.setTime(b.getTime()+6E4*a.Ee);return b.getFullYear()}
Ib.prototype.store=function(a,b){for(var c=Ba(Cb),d=document.cookie.split(";"),e=0;e<d.length;e++){for(var f=d[e];" "===f.charAt(0);)f=f.substring(1);for(var g=!1,h=0;h<c.length;h++)if(0===f.indexOf(c[h])){g=!0;break}g&&(f=f.split("=")[0],-1===f.indexOf("."+this.$)&&Kb(this,f))}c=new Date;c.setTime(c.getTime()+6E4*this.Ee);c="expires="+c.toUTCString();d="domain="+this.Me;b=this.Qe?b:encodeURIComponent(JSON.stringify(b));a=this.Xa(a)+"="+b+";"+c+";"+d+";path=/";if(4093<=a.length)return x.info("Storage failure: string is "+
a.length+" chars which is too large to store as a cookie."),!1;document.cookie=a;return!0};
Ib.prototype.Z=function(a){for(var b=[],c=this.Xa(a)+"=",d=document.cookie.split(";"),e=0;e<d.length;e++){for(var f=d[e];" "===f.charAt(0);)f=f.substring(1);if(0===f.indexOf(c))try{var g=void 0;g=this.Qe?f.substring(c.length,f.length):JSON.parse(decodeURIComponent(f.substring(c.length,f.length)));b.push(g)}catch(h){return x.info("Storage retrieval failure: "+h.message),this.remove(a),null}}return 0<b.length?b[b.length-1]:null};Ib.prototype.remove=function(a){Kb(this,this.Xa(a))};
function Kb(a,b){b=b+"=;expires="+(new Date(0)).toGMTString();document.cookie=b;document.cookie=b+";path=/";document.cookie=b+";path="+document.location.pathname;a=b+";domain="+a.Me;document.cookie=a;document.cookie=a+";path=/";document.cookie=a+";path="+document.location.pathname}function Lb(){this.ud={};this.Ke=5242880;this.df=3}
Lb.prototype.store=function(a,b){var c={value:b};var d=[];b=[b];for(var e=0;b.length;){var f=b.pop();if("boolean"===typeof f)e+=4;else if("string"===typeof f)e+=2*f.length;else if("number"===typeof f)e+=8;else if("object"===typeof f&&-1===d.indexOf(f)){d.push(f);for(var g in f)b.push(f[g])}}d=e;if(d>this.Ke)return x.info("Storage failure: object is \u2248"+d+" bytes which is greater than the max of "+this.Ke),!1;this.ud[a]=c;return!0};Lb.prototype.Z=function(a){a=this.ud[a];return null==a?null:a.value};
Lb.prototype.remove=function(a){this.ud[a]=null};function Mb(a,b,c){this.ma=[];b&&this.ma.push(new Ib(a));c&&this.ma.push(new Hb(a));this.ma.push(new Lb)}Mb.prototype.store=function(a,b){for(var c=!0,d=0;d<this.ma.length;d++)c=this.ma[d].store(a,b)&&c;return c};Mb.prototype.Z=function(a){for(var b=0;b<this.ma.length;b++){var c=this.ma[b].Z(a);if(null!=c)return c}return null};Mb.prototype.remove=function(a){for(var b=0;b<this.ma.length;b++)this.ma[b].remove(a)};function Nb(){this.Fb={}}function Ob(a,b){if("function"!==typeof b)return null;var c=pa.Ia();a.Fb[c]=b;return c}Nb.prototype.N=function(a){delete this.Fb[a]};Nb.prototype.K=function(){this.Fb={}};function Pb(a,b){var c=[],d;for(d in a.Fb)c.push(a.Fb[d](b))};function Qb(){if(null==Rb){Rb=!1;try{var a=Object.defineProperty({},"passive",{get:function(){Rb=!0}});window.addEventListener("testPassive",null,a);window.removeEventListener("testPassive",null,a)}catch(b){}}return Rb}function Sb(a,b,c){a.addEventListener(b,c,Qb()?{passive:!0}:!1)}
function Tb(a,b,c,d){if(null==a)return!1;b=b||!1;c=c||!1;a=a.getBoundingClientRect();return null==a?!1:(0<=a.top&&a.top<=(window.innerHeight||document.documentElement.clientHeight)||!b)&&(0<=a.left||!d)&&(0<=a.bottom&&a.bottom<=(window.innerHeight||document.documentElement.clientHeight)||!c)&&(a.right<=(window.innerWidth||document.documentElement.clientWidth)||!d)}function Ub(a){if(a.onclick){var b=document.createEvent("MouseEvents");b.initEvent("click",!0,!0);a.onclick.apply(a,[b])}}
function Vb(a,b,c){var d=null,e=null;Sb(a,"touchstart",function(f){d=f.touches[0].clientX;e=f.touches[0].clientY});Sb(a,"touchmove",function(f){if(null!=d&&null!=e){var g=d-f.touches[0].clientX,h=e-f.touches[0].clientY;Math.abs(g)>Math.abs(h)&&25<=Math.abs(g)?(0<g&&b===Wb?c(f):0>g&&b===Xb&&c(f),e=d=null):25<=Math.abs(h)&&(0<h&&b===Yb&&a.scrollTop===a.scrollHeight-a.offsetHeight?c(f):0>h&&b===Zb&&0===a.scrollTop&&c(f),e=d=null)}})}
function $b(a,b,c){var d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("viewBox",a);d.setAttribute("xmlns","http://www.w3.org/2000/svg");a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d",b);null!=c&&a.setAttribute("fill",c);d.appendChild(a);return d}var Rb=null,Yb="up",Zb="down",Wb="left",Xb="right";function ac(a,b,c){var d=document.createElement("button");d.setAttribute("aria-label",a);d.setAttribute("tabindex","0");d.setAttribute("role","button");Sb(d,"touchstart",function(){});d.className="ab-close-button";a=$b("0 0 15 15","M15 1.5L13.5 0l-6 6-6-6L0 1.5l6 6-6 6L1.5 15l6-6 6 6 1.5-1.5-6-6 6-6z",b);d.appendChild(a);d.addEventListener("keydown",function(e){if(32===e.keyCode||13===e.keyCode)c(),e.stopPropagation()});d.onclick=function(e){c();e.stopPropagation()};return d};var bc={nh:function(){return 600>=screen.width},hh:function(){if("orientation"in window)return 90===Math.abs(window.orientation)||270===window.orientation?bc.Sa.Zc:bc.Sa.jc;if("screen"in window){var a=window.screen.orientation||screen.ci||screen.ei;null!=a&&"object"===typeof a&&(a=a.type);if("landscape-primary"===a||"landscape-secondary"===a)return bc.Sa.Zc}return bc.Sa.jc},oh:function(a,b,c){c||null!=b&&b.metaKey?window.open(a):window.location=a},Sa:{jc:0,Zc:1}};J.WindowUtils=bc;
J.WindowUtils.openUri=bc.oh;function cc(a,b,c,d,e,f,g,h,l,k,m,q,v,t,w,r){this.id=a;this.viewed=b||!1;this.title=c||"";this.imageUrl=d;this.description=e||"";this.created=f||null;this.updated=g||null;this.categories=h||[];this.expiresAt=l||null;this.url=k;this.linkText=m;q=parseFloat(q);this.aspectRatio=isNaN(q)?null:q;this.extras=v;this.pinned=t||!1;this.dismissible=w||!1;this.dismissed=!1;this.clicked=r||!1;this.test=!1;this.pd=this.X=null}function dc(a){null==a.X&&(a.X=new Nb);return a.X}
function ec(a){null==a.pd&&(a.pd=new Nb);return a.pd}p=cc.prototype;p.Vb=function(a){return Ob(dc(this),a)};p.Wd=function(a){return Ob(ec(this),a)};p.N=function(a){dc(this).N(a);ec(this).N(a)};p.K=function(){dc(this).K();ec(this).K()};p.Od=function(){this.viewed=!0};p.fb=function(){this.clicked=this.viewed=!0;Pb(dc(this))};p.Nd=function(){return this.dismissible&&!this.dismissed?(this.dismissed=!0,Pb(ec(this)),!0):!1};
function fc(a,b){if(null==b||b[T.wa]!==a.id)return!0;if(b[T.pe])return!1;if(null!=b[T.ea]&&null!=a.updated&&b[T.ea]<Ia(a.updated.valueOf()))return!0;b[T.za]&&!a.viewed&&(a.viewed=!0);b[T.ta]&&!a.clicked&&(a.clicked=b[T.ta]);null!=b[T.Ua]&&(a.title=b[T.Ua]);null!=b[T.xa]&&(a.imageUrl=b[T.xa]);null!=b[T.Ra]&&(a.description=b[T.Ra]);if(null!=b[T.ea]){var c=Ja(b[T.ea]);null!=c&&(a.updated=c)}null!=b[T.ca]&&(a.expiresAt=b[T.ca]===gc?null:Ja(b[T.ca]));null!=b[T.URL]&&(a.url=b[T.URL]);null!=b[T.ya]&&(a.linkText=
b[T.ya]);null!=b[T.sa]&&(c=parseFloat(b[T.sa]),a.aspectRatio=isNaN(c)?null:c);null!=b[T.ka]&&(a.extras=b[T.ka]);null!=b[T.la]&&(a.pinned=b[T.la]);null!=b[T.va]&&(a.dismissible=b[T.va]);null!=b[T.V]&&(a.test=b[T.V]);return!0}
function hc(a){if(a[T.pe])return null;var b=a[T.wa],c=a[T.TYPE],d=a[T.za],e=a[T.Ua],f=a[T.xa],g=a[T.Ra],h=Ja(a[T.ea]);var l=a[T.ca]===gc?null:Ja(a[T.ca]);var k=a[T.URL],m=a[T.ya],q=a[T.sa],v=a[T.ka],t=a[T.la],w=a[T.va],r=a[T.ta];a=a[T.V]||!1;if(c===ic.xe||c===ic.ic)b=new jc(b,d,e,f,g,null,h,null,l,k,m,q,v,t,w,r);else if(c===ic.Yb)b=new kc(b,d,e,f,g,null,h,null,l,k,m,q,v,t,w,r);else if(c===ic.Xb)b=new lc(b,d,f,null,h,null,l,k,m,q,v,t,w,r);else if(c===ic.Sc)b=new mc(b,d,h,l,v,t);else return x.error("Ignoring card with unknown type "+
c),null;b.test=a;return b}function nc(a){var b=a[U.wa],c=a[U.TYPE],d=a[U.za],e=a[U.Ua],f=a[U.xa],g=a[U.Ra],h=La(a[U.bc]),l=La(a[U.ea]),k=a[U.Zb],m=La(a[U.ca]),q=a[U.URL],v=a[U.ya],t=a[U.sa],w=a[U.ka],r=a[U.la],F=a[U.va],D=a[U.ta];a=a[U.V]||!1;if(c===ic.ic)b=new jc(b,d,e,f,g,h,l,k,m,q,v,t,w,r,F,D);else if(c===ic.Yb)b=new kc(b,d,e,f,g,h,l,k,m,q,v,t,w,r,F,D);else if(c===ic.Xb)b=new lc(b,d,f,h,l,k,m,q,v,t,w,r,F,D);else if(c===ic.Sc)b=new mc(b,d,l,m,w,r);else return;b.test=a;return b}
function oc(a){null!=a&&(a=a.querySelectorAll(".ab-unread-indicator")[0],null!=a&&(a.className+=" read"))}
p.aa=function(a,b,c){function d(q){oc(f);g&&(a(e),bc.openUri(e.url,q,c));return!1}var e=this,f=document.createElement("div");f.className="ab-card ab-effect-card "+this.Dc;f.setAttribute("data-ab-card-id",this.id);f.setAttribute("role","article");f.setAttribute("tabindex","0");var g=this.url&&""!==this.url;if(this.pinned){var h=document.createElement("div");h.className="ab-pinned-indicator";var l=document.createElement("i");l.className="fa fa-star";h.appendChild(l);f.appendChild(h)}this.imageUrl&&
""!==this.imageUrl&&(h=document.createElement("div"),h.className="ab-image-area",l=document.createElement("img"),l.setAttribute("src",this.imageUrl),this.xc(l),h.appendChild(l),f.className+=" with-image",g&&!this.Gc?(l=document.createElement("a"),l.setAttribute("href",this.url),l.onclick=d,l.appendChild(h),f.appendChild(l)):f.appendChild(h));h=document.createElement("div");h.className="ab-card-body";if(this.dismissible){this.Je=b;var k=ac("Dismiss Card",void 0,this.bf.bind(this));f.appendChild(k);
Vb(h,Wb,function(q){f.className+=" ab-swiped-left";k.onclick(q)});Vb(h,Xb,function(q){f.className+=" ab-swiped-right";k.onclick(q)})}if(b=this.title&&""!==this.title){l=document.createElement("h1");l.className="ab-title";l.id=pa.Ia();f.setAttribute("aria-labelledby",l.id);if(g){var m=document.createElement("a");m.setAttribute("href",this.url);m.onclick=d;m.appendChild(document.createTextNode(this.title));l.appendChild(m)}else l.appendChild(document.createTextNode(this.title));h.appendChild(l)}l=document.createElement("div");
l.className=b?"ab-description":"ab-description ab-no-title";l.id=pa.Ia();f.setAttribute("aria-describedby",l.id);l.appendChild(document.createTextNode(this.description));g&&(b=document.createElement("div"),b.className="ab-url-area",m=document.createElement("a"),m.setAttribute("href",this.url),m.appendChild(document.createTextNode(this.linkText)),m.onclick=d,b.appendChild(m),l.appendChild(b));h.appendChild(l);f.appendChild(h);h=document.createElement("div");h.className="ab-unread-indicator";this.viewed&&
(h.className+=" read");f.appendChild(h);return this.Gg=f};p.xc=function(a){var b="";this.title||this.description||(b="Feed Image");a.setAttribute("alt",b)};p.bf=function(){if(this.dismissible&&!this.dismissed){this.Je&&this.Je(this);var a=this.Gg;a&&(a.style.height=a.offsetHeight+"px",a.className+=" ab-hide",setTimeout(function(){a&&a.parentNode&&(a.style.height="0",a.style.margin="0",setTimeout(function(){a&&a.parentNode&&a.parentNode.removeChild(a)},pc))},qc))}};
var gc=-1,ic={Yb:"captioned_image",xe:"text_announcement",ic:"short_news",Xb:"banner_image",Sc:"control"},T={wa:"id",za:"v",va:"db",pe:"r",ea:"ca",la:"p",ca:"ea",ka:"e",TYPE:"tp",xa:"i",Ua:"tt",Ra:"ds",URL:"u",ya:"dm",sa:"ar",ta:"cl",V:"t"},U={wa:"id",za:"v",va:"db",bc:"cr",ea:"ca",la:"p",Zb:"t",ca:"ea",ka:"e",TYPE:"tp",xa:"i",Ua:"tt",Ra:"ds",URL:"u",ya:"dm",sa:"ar",ta:"cl",V:"s"},pc=400;J.Card=cc;J.Card.fromContentCardsJson=hc;J.Card.prototype.dismissCard=cc.prototype.bf;
J.Card.prototype.subscribeToClickedEvent=cc.prototype.Vb;J.Card.prototype.subscribeToDismissedEvent=cc.prototype.Wd;J.Card.prototype.removeSubscription=cc.prototype.N;J.Card.prototype.removeAllSubscriptions=cc.prototype.K;function lc(a,b,c,d,e,f,g,h,l,k,m,q,v,t){cc.call(this,a,b,null,c,null,d,e,f,g,h,l,k,m,q,v,t);this.Dc="ab-banner";this.Gc=!1}na(lc,cc);lc.prototype.A=function(){var a={};a[U.TYPE]=ic.Xb;a[U.wa]=this.id;a[U.za]=this.viewed;a[U.xa]=this.imageUrl;a[U.ea]=this.updated;a[U.bc]=this.created;a[U.Zb]=this.categories;a[U.ca]=this.expiresAt;a[U.URL]=this.url;a[U.ya]=this.linkText;a[U.sa]=this.aspectRatio;a[U.ka]=this.extras;a[U.la]=this.pinned;a[U.va]=this.dismissible;a[U.ta]=this.clicked;a[U.V]=this.test;return a};
J.Banner=lc;function kc(a,b,c,d,e,f,g,h,l,k,m,q,v,t,w,r){cc.call(this,a,b,c,d,e,f,g,h,l,k,m,q,v,t,w,r);this.Dc="ab-captioned-image";this.Gc=!0}na(kc,cc);
kc.prototype.A=function(){var a={};a[U.TYPE]=ic.Yb;a[U.wa]=this.id;a[U.za]=this.viewed;a[U.Ua]=this.title;a[U.xa]=this.imageUrl;a[U.Ra]=this.description;a[U.ea]=this.updated;a[U.bc]=this.created;a[U.Zb]=this.categories;a[U.ca]=this.expiresAt;a[U.URL]=this.url;a[U.ya]=this.linkText;a[U.sa]=this.aspectRatio;a[U.ka]=this.extras;a[U.la]=this.pinned;a[U.va]=this.dismissible;a[U.ta]=this.clicked;a[U.V]=this.test;return a};J.CaptionedImage=kc;function jc(a,b,c,d,e,f,g,h,l,k,m,q,v,t,w,r){cc.call(this,a,b,c,d,e,f,g,h,l,k,m,q,v,t,w,r);this.Dc="ab-classic-card";this.Gc=!0}na(jc,cc);
jc.prototype.A=function(){var a={};a[U.TYPE]=ic.ic;a[U.wa]=this.id;a[U.za]=this.viewed;a[U.Ua]=this.title;a[U.xa]=this.imageUrl;a[U.Ra]=this.description;a[U.ea]=this.updated;a[U.bc]=this.created;a[U.Zb]=this.categories;a[U.ca]=this.expiresAt;a[U.URL]=this.url;a[U.ya]=this.linkText;a[U.sa]=this.aspectRatio;a[U.ka]=this.extras;a[U.la]=this.pinned;a[U.va]=this.dismissible;a[U.ta]=this.clicked;a[U.V]=this.test;return a};J.ClassicCard=jc;function mc(a,b,c,d,e,f){cc.call(this,a,b,null,null,null,null,c,null,d,null,null,null,e,f,null);this.Dc="ab-control-card";this.Gc=!1}na(mc,cc);mc.prototype.A=function(){var a={};a[U.TYPE]=ic.Sc;a[U.wa]=this.id;a[U.za]=this.viewed;a[U.ea]=this.updated;a[U.ca]=this.expiresAt;a[U.ka]=this.extras;a[U.la]=this.pinned;a[U.V]=this.test;return a};J.ControlCard=mc;function rc(a){a=parseInt(a);return!isNaN(a)&&0===(a&4278190080)>>>24}function sc(a){a=parseInt(a);if(isNaN(a))return"";var b=parseFloat(b);isNaN(b)&&(b=1);a>>>=0;var c=a&255,d=(a&65280)>>>8,e=(a&16711680)>>>16;return(vb.Ya===ob.dc?8<vb.version:1)?"rgba("+[e,d,c,((a&4278190080)>>>24)/255*b].join()+")":"rgb("+[e,d,c].join()+")"};function W(a,b,c,d,e,f,g,h,l,k,m,q,v,t,w,r,F,D,G,H,A,N,L,I,V,Q,n,u,y,B,P){this.message=a;this.messageAlignment=b||tc;this.duration=q||5E3;this.slideFrom=c||uc;this.extras=d||{};this.campaignId=e;this.cardId=f;this.triggerId=g;this.clickAction=h||vc;this.uri=l;this.openTarget=k||wc;this.dismissType=m||xc;this.icon=v;this.imageUrl=t;this.imageStyle=w||yc;this.iconColor=r||zc.nd;this.iconBackgroundColor=F||zc.$d;this.backgroundColor=D||zc.nd;this.textColor=G||zc.ce;this.closeButtonColor=H||zc.Sf;this.animateIn=
A;null==this.animateIn&&(this.animateIn=!0);this.animateOut=N;null==this.animateOut&&(this.animateOut=!0);this.header=L;this.headerAlignment=I||tc;this.headerTextColor=V||zc.ce;this.frameColor=Q||zc.vg;this.buttons=n||[];this.cropType=u||Ac;this.orientation=y;this.htmlId=B;this.css=P;this.Fe=this.Wa=this.Ge=!1;this.X=new Nb;this.nc=new Nb}p=W.prototype;p.Ja=function(){return!0};p.xf=function(){return this.Ja()};function Bc(a){return null!=a.htmlId&&4<a.htmlId.length}
function Cc(a){return Bc(a)&&null!=a.css&&0<a.css.length}function Dc(a){if(Bc(a)&&Cc(a))return a.htmlId+"-css"}p.Vb=function(a){return Ob(this.X,a)};p.Wd=function(a){return Ob(this.nc,a)};p.N=function(a){this.X.N(a);this.nc.N(a)};p.K=function(){this.X.K();this.nc.K()};p.Od=function(){return this.Ge?!1:this.Ge=!0};p.fb=function(){return this.Wa?!1:(this.Wa=!0,Pb(this.X),!0)};p.Nd=function(){return this.Fe?!1:(this.Fe=!0,Pb(this.nc),!0)};
function Ec(a){if(a.is_control)return new Fc(a.trigger_id);var b=a.type;null!=b&&(b=b.toUpperCase());var c=a.message,d=a.text_align_message,e=a.slide_from,f=a.extras,g=a.campaign_id,h=a.card_id,l=a.trigger_id,k=a.click_action,m=a.uri,q=a.open_target,v=a.message_close,t=a.duration,w=a.icon,r=a.image_url,F=a.image_style,D=a.icon_color,G=a.icon_bg_color,H=a.bg_color,A=a.text_color,N=a.close_btn_color,L=a.header,I=a.text_align_header,V=a.header_text_color,Q=a.frame_color,n=[],u=a.btns;null==u&&(u=[]);
for(var y=0;y<u.length;y++){var B=u[y];n.push(new Gc(B.text,B.bg_color,B.text_color,B.border_color,B.click_action,B.uri,B.id))}u=a.crop_type;y=a.orientation;B=a.animate_in;var P=a.animate_out,R=a.html_id,Y=a.css;if(null==R||""===R||null==Y||""===Y)Y=R=void 0;if(b===Hc||b===Ic)c=new Jc(c,d,f,g,h,l,k,m,q,v,t,w,r,F,D,G,H,A,N,B,P,L,I,V,Q,n,u,R,Y);else if(b===Kc)c=new Lc(c,d,f,g,h,l,k,m,q,v,t,w,r,F,D,G,H,A,N,B,P,L,I,V,Q,n,u,y,R,Y);else if(b===Mc)c=new Nc(c,d,e,f,g,h,l,k,m,q,v,t,w,r,D,G,H,A,N,B,P,R,Y);
else if(b===Oc||b===Pc)c=new Qc(c,f,g,h,l,v,t,B,P,Q,R,Y,a.message_fields),c.Th=a.trusted||!1;else{x.error("Ignoring message with unknown type "+b);return}c.nf=b;return c}function Rc(a,b){if(b&&b.parentNode){var c=b.closest(".ab-iam-root");null==c&&(c=b);a.Ja()&&null!=c.parentNode&&((b=c.parentNode.classList)&&b.contains(Sc)&&b.remove(Sc),document.body.removeEventListener("touchmove",Tc));c.className=c.className.replace(Uc,Vc)}return a.animateOut}
function Wc(a,b,c){if(null!=b){a.sc=null;var d=-1===b.className.indexOf("ab-in-app-message")?b.getElementsByClassName("ab-in-app-message")[0]:b;var e=!1;d&&(e=Rc(a,d));var f=document.body;if(null!=f)var g=f.scrollTop;d=function(){if(b&&b.parentNode){var h=b.closest(".ab-iam-root");null==h&&(h=b);h.parentNode&&h.parentNode.removeChild(h)}null!=Dc(a)&&(h=document.getElementById(Dc(a)))&&h.parentNode&&h.parentNode.removeChild(h);null!=f&&"Safari"===vb.Ya&&(f.scrollTop=g);c?c():a.Nd()};e?setTimeout(d,
Xc):d();a.tc&&a.tc.focus()}}p.Ye=function(){Wc(this,this.sc)};
p.aa=function(a,b,c,d,e){function f(){-1!==h.className.indexOf("ab-start-hidden")&&(h.className=h.className.replace("ab-start-hidden",""),c(h))}var g=this,h=document.createElement("div");h.className="ab-in-app-message ab-start-hidden ab-background";e&&(h.style.zIndex=e+1);this.Ja()&&(h.className+=" ab-modal-interactions",h.setAttribute("tabindex","-1"));Cc(this)||(h.style.color=sc(this.textColor),h.style.backgroundColor=sc(this.backgroundColor),rc(this.backgroundColor)&&(h.className+=" ab-no-shadow"));
this.imageStyle===Yc&&(h.className+=" graphic");this.orientation===Zc&&(h.className+=" landscape");0===this.buttons.length&&(this.clickAction!==vc&&(h.className+=" ab-clickable"),h.onclick=function(v){Wc(g,h,function(){a.Jc(g);g.clickAction===$c?bc.openUri(g.uri,v,d||g.openTarget===ad):g.clickAction===bd&&b()});v.stopPropagation();return!1});var l=ac("Close Message",Cc(this)?void 0:sc(this.closeButtonColor),function(){Wc(g,h)});h.appendChild(l);e&&(l.style.zIndex=e+2);e=document.createElement("div");
e.className="ab-message-text";e.className+=" "+(this.messageAlignment||this.Bd).toLowerCase()+"-aligned";l=!1;var k=document.createElement("div");k.className="ab-image-area";if(this.imageUrl){if(this.cropType===cd){var m=document.createElement("span");m.className="ab-center-cropped-img";m.style.backgroundImage="url("+this.imageUrl+")";m.setAttribute("role","img");m.setAttribute("aria-label","Modal Image");this.xc(m);k.appendChild(m)}else m=document.createElement("img"),m.setAttribute("src",this.imageUrl),
this.xc(m),l=!0,m.onload=f,setTimeout(f,1E3),k.appendChild(m);h.appendChild(k);e.className+=" ab-with-image"}else if(this.icon){k.className+=" ab-icon-area";m=document.createElement("span");m.className="ab-icon";Cc(this)||(m.style.backgroundColor=sc(this.iconBackgroundColor),m.style.color=sc(this.iconColor));var q=document.createElement("i");q.className="fa";q.appendChild(document.createTextNode(this.icon));q.setAttribute("aria-hidden",!0);m.appendChild(q);k.appendChild(m);h.appen