apxor-qe 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("apxor")):"function"==typeof define&&define.amd?define(["apxor"],t):(e=e||self)["apxor-qe"]=t(e.Apxor)}(this,(function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){s(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,v=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){v=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(v)throw r}}return s}}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function d(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=c(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function f(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var g=window.ApxorLogger,_=function(e){return void 0===e},h=function(e){return null===e},p=function(e){return void 0!==e&&!h(e)},m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function y(e,t){return Array.from(t).map((function(t,n){return String.fromCharCode(t^function(e,t){return e.charCodeAt(Math.floor(t%e.length))}(e,n))})).join("")}var b=function(e,t){return y(e,t=function(e){var t,n,i,r,o,a,s=0,l=[];if(!e)return e;e+="";do{t=(a=m.indexOf(e.charAt(s++))<<18|m.indexOf(e.charAt(s++))<<12|(r=m.indexOf(e.charAt(s++)))<<6|(o=m.indexOf(e.charAt(s++))))>>16&255,n=a>>8&255,i=255&a,l.push(t),64!==r&&(l.push(n),64!==o&&l.push(i))}while(s<e.length);return l}(t))},w=function(e){return p(e)&&!h(e)&&!isNaN(e)},z=function(e){switch(e){case"app_event":return"AE";case"client_event":return"CE";case"activity_time":case"activity_event":return"AE";case"apxor_event":return"AEV";case"customer_event":return"CEV";case"any_event":return"ANV";case"campaign_event":return"CNV";case"survey_event":return"SVE"}return"Unknown"},C=function(e){return e.toUpperCase()},A=function(e,t,n){switch(n){case"EQ":return e===t;case"GT":return e>t;case"GTE":return e>=t;case"LT":return e<t;case"LTE":return e<=t;case"NEQ":return e!==t;case"R":return E(t).test(e);default:return!1}},E=function(e){var t=e.replace(/.*\/([gimuy]*)$/,"$1");t===e&&(t="");var n=t?e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1"):e;return new RegExp(n,t)},x=function(){var e=new Date;return e.getDate()+"/"+e.getMonth()+"/"+e.getFullYear()},L=function(e,t,n){if("GT"===n){var i=e.split(":"),r=t.split(":");if(!(i[0]>=r[0]))return!1;if(i[0]>r[0])return!0;if(i[0]!=r[0])return!1;if(i[1]>=r[1])return!0}else if("LT"===n){var o=e.split(":"),a=t.split(":");if(!(o[0]<=a[0]))return!1;if(o[0]<a[0])return!0;if(o[0]!=a[0])return!1;if(o[1]<=a[1])return!0}},F=function(e,t){switch(e){case"second":return 1e3*t;case"minute":return 60*t*1e3;case"hour":return 60*t*60*1e3;case"day":return 24*t*60*60*1e3;default:return 1}},Q=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!t||!n)return!1;var r=n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),o=t.replace(new RegExp(r,"g"),"(.+)"),a=i?"^".concat(o):"".concat(o,"$"),s=new RegExp(a);return s.test(e)};function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,o=R(e,t);if(o){var a=function(){if(q(o)){return function(e){return I(e)}(o)}return g.info("Invalid target element. Width and height are 0 for element: ".concat(e,". Can't show tooltip")),!1};return a()}return n?(g.info("Not found yet. Rechecking the DOM."),K(r,i,e,t)):(g.info("Element with selector:".concat(e," not found.")),!1)}function K(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=setInterval((function(){var t=R(n,i);if(t){clearInterval(r);!function(){if(q()){I()}else g.info("Invalid target element. Width and height are 0 for element: ".concat(n,". Can't show tooltip"))}()}else(e-=1)<=0&&(clearInterval(r),console.warn("Element with selector:".concat(n," not found.")))}),t)}var R=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=document.getElementById(e);if(!i)try{i=document.querySelector(e)}catch(e){window.ApxorLogger.error("Error finding element in DOM:"+e)}(i||(i=D(e)),!i&&n.length>0)&&(i=null===(t=document.getElementById(n))||void 0===t||null===(t=t.contentWindow)||void 0===t||null===(t=t.document)||void 0===t?void 0:t.querySelector(e));return i},D=function(e){var t=e.indexOf("svg");-1!==t&&(e=e.substring(0,t)+"svg:svg");try{return document.Vhzk(e,document,(function(e){return"svg"===e?"http://www.w3.org/2000/svg":null}),XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}catch(e){window.ApxorLogger.error("Error finding element in DOM:"+e)}return null};function q(e){try{var t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!1}catch(e){return!1}return!0}function k(e,t){for(var n=0;n<e.length;n++)if(e[n].hasOwnProperty(t))return e[n];return null}function I(e){var t,n,i,r;return!!(n=(t=e).offsetHeight,i=t.offsetWidth,(r=t.getBoundingClientRect()).left>=-i&&r.top>=-n&&r.right<=(window.innerWidth||document.documentElement.clientWidth)+i&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)+n)}var T=function(e){!function(e){var t='\n <style> \n .apx-container{\n padding:10px;\n }\n </style>\n <div id="apx-innerElement" class="apx-container">\n <div id="close-button" style="cursor: pointer;position:absolute;top:9px;right:9px;"><svg width="11" height="11" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path opacity="0.5" d="M11.0962 9.07071L17.8586 15.8331L15.8331 17.8586L9.0707 11.0962L8.99999 11.0255L8.92928 11.0962L2.16693 17.8586L0.141421 15.8331L6.90379 9.07071L6.9745 9L6.90379 8.92929L0.141421 2.16694L2.16693 0.141422L8.92928 6.9038L8.99999 6.97451L9.0707 6.9038L15.8331 0.141422L17.8586 2.16694L11.0962 8.92929L11.0255 9L11.0962 9.07071Z" fill="white" stroke="#002845" stroke-width="0.2"/>\n </svg>\n </div>\n <div style="font-family: inherit;font-style: normal;font-weight: 600;font-size: 16px;line-height: 22px;\n color: #FFFFFF; display: flex; gap: 12px;"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-circle-check-filled" width="33" height="33" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff" fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="none" d="M0 0h24v24H0z" fill="none"/>\n <path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor" />\n</svg><div style = "align-self: center;padding-right:20px;">'.concat(e,"</div></div>\n </div>\n "),n=document.createElement("div");n.style="\n z-index:99999999;\n background:#16202f;\n position:fixed;\n top:1%;\n right:1%;\n border-radius: 12px;\n ",n.innerHTML=t,n.id="apx-container",document.body.appendChild(n)}(e);var t=document.getElementById("close-button"),n=function(){var e=document.getElementById("apx-container");null==e||e.remove()};null==t||t.addEventListener("click",n),window.setTimeout(n,2e4)},G=window.ApxorLogger,J=a((function t(){var n=this;r(this,t),s(this,"YnyK","ALL"),s(this,"OtlV",[]),s(this,"ixdq",[]),s(this,"userAttributesValidated",!0),s(this,"sessionAttributeValidated",!0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(n.YnyK=e.audience.audience_type,n.OtlV=e.audience.attributes.user,n.ixdq=e.audience.attributes.session,!Array.isArray(n.OtlV)||!Array.isArray(n.ixdq))return G.error("No attributes"),!1}catch(e){return G.error(e),!1}return!0})),s(this,"validate",(function(t,i){var r=!0;"FTU"===n.YnyK&&(r=e.getController().getSessionInfo().is_first_session);var o=n.LEzd(t,n.OtlV),a=n.LEzd(i,n.ixdq);return o||(n.userAttributesValidated=!1),a||(n.sessionAttributeValidated=!1),r&&o&&a})),s(this,"LEzd",(function(e,t){var n=t.length,i=!0;try{for(var r,o=function(){var n=t[a];if(_(e[n.name])||!1===i)return{v:!1};var r=n.operator,o=n.type,s=n.value.map((function(e){if("s"===o)return e;if("l"===o)return parseInt(e);if("f"===o)return parseFloat(e);if("b"===o)switch(e){case"true":return!0;case"false":return!1;default:return e}})),l=(Array.isArray(e[n.name])?e[n.name]:[e[n.name]]).some((function(e){return s.some((function(t){return"s"===o?e="".concat(e):"l"===o?e=parseInt(e):"f"===o?e=parseFloat(e):"b"===o&&(e=!!e),A(e,t,r)}))}));i=i&&l},a=0;a<n;a++)if(r=o())return r.v}catch(e){G.error(e),i=!1}return i}))})),S=a((function e(){var t=this;r(this,e),s(this,"KezF",""),s(this,"RmGv",{}),s(this,"KvQs",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{t.KezF=e.name,t.RmGv=e.additional_info,t.KvQs=null==e?void 0:e.path}catch(e){return!1}return!0}))})),V=a((function e(){var t=this;r(this,e),s(this,"DtFf",0),s(this,"tVTR",0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.DtFf=Number(e.lower),t.tVTR=Number(e.upper),isNaN(t.DtFf)||isNaN(t.tVTR))return!1}catch(e){return!1}return!0}))})),N=a((function e(){var t=this;r(this,e),s(this,"oGib",0),s(this,"wwnJ",""),s(this,"fGEZ",""),s(this,"sAgb",new S),s(this,"tkCM",new V),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.wwnJ=e.event_type,t.fGEZ=e.activity,t.sAgb.parse(e.details)&&t.tkCM.parse(e.time_bounds)}catch(e){return!1}}))})),j=window.ApxorLogger,H=a((function e(){var t=this;r(this,e),s(this,"oGib",0),s(this,"JiXE",-1),s(this,"Psxj",0),s(this,"djdu",""),s(this,"fGEZ",""),s(this,"wwnJ",""),s(this,"tkCM",new V),s(this,"sAgb",new S),s(this,"hBAL",new N),s(this,"IKic","AND"),s(this,"kMTt",!1),s(this,"YnyK",void 0),s(this,"FPgG",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;return t.JiXE=null==e?void 0:e.sequence,t._conditionType=null==e?void 0:e.condition_type,t._id=null==e?void 0:e._id,t._eventCategory=null!=e&&e.event_category?null==e?void 0:e.event_category:"specific_event",t.Psxj=null==e||null===(n=e.count_config)||void 0===n?void 0:n.count,t.djdu=null==e||null===(i=e.count_config)||void 0===i?void 0:i.operator,t.fGEZ=null==e?void 0:e.activity,t.wwnJ=null==e?void 0:e.event_type,t.IKic=e.combine_operator,t._timeEnabled=null==e?void 0:e.time_enabled,t._time=null==e?void 0:e.time,t.YnyK=null==e?void 0:e.type,t.FPgG=null==e?void 0:e.route,t.sAgb.parse(null==e?void 0:e.details)&&t.hBAL.parse(e.trigger)&&t.tkCM.parse(e.time_bounds)}catch(e){return j.error(e),!1}}))})),M=window.ApxorLogger,Y=a((function e(){var t=this;r(this,e),s(this,"Psxj",0),s(this,"djdu",""),s(this,"wwnJ",""),s(this,"tkCM",new V),s(this,"sAgb",new S),s(this,"IKic","AND"),s(this,"parse",(function(e){try{return t.Psxj=e.count_config.count,t.djdu=e.count_config.operator,t.wwnJ=e.event_type,t.IKic=e.combine_operator,t.sAgb.parse(e.details)&&t.tkCM.parse(e.time_bounds)}catch(e){return M.error(e),!1}}))})),U=window.ApxorLogger,P=function(){function t(){var n=this;r(this,t),s(this,"RexI",0),s(this,"HZiO",""),s(this,"vzQc",new H),s(this,"vJKT",new Y),s(this,"AXNR",!1),s(this,"KOzR",!1),s(this,"EXJl",0),s(this,"IKic","AND"),s(this,"JeVw","OR"),s(this,"pXyH",-1),s(this,"jzOu",[]),s(this,"sOQM",{}),s(this,"MyCf",!1),s(this,"VIsH",void 0),s(this,"xgAm",void 0),s(this,"DOoL",void 0),s(this,"azNd",void 0),s(this,"no_KPI_TriggerDetails",[]),s(this,"MRwJ",!1),s(this,"timerDidnt",void 0),s(this,"timerDid",void 0),s(this,"initialize",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",v=arguments.length>7&&void 0!==arguments[7]?arguments[7]:-1,c=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(n.HZiO=i,n.EXJl=r,n.jzOu=a,n.VIsH=o,n.childConditionIndex=v,n.across_sessions=s||!1,"termination"===l&&""!==l){n.vJKT.parse(t);return n.JeVw=n.vJKT.IKic,n.wvOI(),!0}var u=n.vzQc.parse(t);if(u){if(n.IKic=n.vzQc.IKic,n.vzQc.kMTt){var d=n.vzQc.sAgb.KezF;"APX_PAGE_OPENED"===d&&(d=n.vzQc.sAgb.RmGv.navigation_id,d=p(d)?d:n.vzQc.sAgb.KezF),n.pXyH=e.getController().getEventCount(d);var f=n.vzQc.Psxj,g=n.vzQc.djdu;if(n.KOzR=n.JMfV(n.pXyH-1,f,g,!1),n.AXNR=n.KOzR,n.KOzR&&"APX_PAGE_OPENED"===n.vzQc.sAgb.KezF)return!0}return!0===c&&(o&&0!==r&&"unordered"!==o||n.GrDR()),!0}return!1})),s(this,"GrDR",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1!=t&&(n.xgAm=t);var i=n.vzQc,r=null!=i&&i._eventCategory?null==i?void 0:i._eventCategory:"specific_event",o=i.hBAL,a=_e.getInstance();if("app_start"===o.wwnJ)if(n.AXNR=!0,null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var s=F(i._time.unit,i._time.value);if("didn't"==(null==i?void 0:i.YnyK)){if(n.MyCf=!1,n.timerDidnt=setTimeout((function(){n.MyCf||(n.KOzR=!0,n.KOzR&&(n.RexI+=1,n.KOzR=n.JMfV(n.RexI,n.vzQc.Psxj,n.vzQc.djdu),n.KOzR&&(n.vzQc.oGib=Date.now(),n.MyCf=!1,a.validate(n.HZiO,n.EXJl,n.xgAm))),"specific_event"===r?a.unregisterFromEvent(z(n.vzQc.wwnJ)+"___"+n.vzQc.sAgb.KezF,n.LGqh):n.ahmf(r),n.AXNR=!1)}),s),n.across_sessions){var l=F(i._time.unit,i._time.value),v=i._timeEnabled,c=i._id;n.bPyB(i.YnyK,i.sAgb.KezF,Date.now(),i.sAgb.RmGv,l,v,c)}"specific_event"===r?(a.registerForEvent(z(n.vzQc.wwnJ)+"___"+n.vzQc.sAgb.KezF,n.LGqh),n.azNd=n.vzQc):n.yamK(r)}else if("did"==(null==i?void 0:i.YnyK)){if(n.timerDid=setTimeout((function(){n.MRwJ||("specific_event"===r?a.unregisterFromEvent(z(n.vzQc.wwnJ)+"___"+n.vzQc.sAgb.KezF,n.CelA):n.OtLn(r))}),s),n.across_sessions){var u=F(i._time.unit,i._time.value),d=i._timeEnabled,f=i._id;n.bPyB(i.YnyK,i.sAgb.KezF,Date.now(),i.sAgb.RmGv,u,d,f)}"specific_event"===r?(a.registerForEvent(z(n.vzQc.wwnJ)+"___"+n.vzQc.sAgb.KezF,n.CelA),n.DOoL=n.vzQc):n.zFtC(r)}}}else"specific_event"===r?a.registerForEvent(z(i.wwnJ)+"___"+i.sAgb.KezF,n.AJoA):n.yCKs(r);else if(null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var g=F(i._time.unit,i._time.value);"didn't"==(null==i?void 0:i.YnyK)?(n.MyCf=!1,n.timerDidnt=setTimeout((function(){n.MyCf||(n.KOzR=!0,n.KOzR&&(n.RexI+=1,n.KOzR=n.JMfV(n.RexI,n.vzQc.Psxj,n.vzQc.djdu),n.KOzR&&(n.vzQc.oGib=Date.now(),n.MyCf=!1,a.validate(n.HZiO,n.EXJl)))),"specific_event"===r&&a.unregisterFromEvent(z(n.vzQc.wwnJ)+"___"+n.vzQc.sAgb.KezF,n.LGqh),n.AXNR=!1}),g),"specific_event"===r?(a.registerForEvent(z(n.vzQc.wwnJ)+"___"+n.vzQc.sAgb.KezF,n.LGqh),n.azNd=n.vzQc):n.yamK()):"did"==(null==i?void 0:i.YnyK)&&(n.timerDid=setTimeout((function(){n.MRwJ||"specific_event"===r&&a.unregisterFromEvent(z(n.vzQc.wwnJ)+"___"+n.vzQc.sAgb.KezF,n.CelA)}),g),"specific_event"===r&&a.registerForEvent(z(n.vzQc.wwnJ)+"___"+n.vzQc.sAgb.KezF,n.CelA))}}else"specific_event"===r&&a.registerForEvent(z(i.wwnJ)+"___"+o.sAgb.KezF,n.AJoA);null!==(e=window.ApxorRTM)&&void 0!==e&&e.badgesLists.includes(n.HZiO)&&a.registerForEvent(z(i.wwnJ)+"___"+"apxor-badge-container-".concat("-".concat(n.HZiO).replaceAll(" ","").replace(/[^\w\s]/gi,"")),n.AJoA)})),s(this,"yCKs",(function(e){var t=new _e;"apxor_event"===e?t.registerForEvent("apxor_event",(function(e,t,i,r){n.AJoA(z(n.vzQc.wwnJ),n.vzQc.sAgb.KezF,i,n.vzQc.sAgb.RmGv)})):"customer_event"===e?t.registerForEvent("customer_event",(function(e,t,i,r){n.AJoA(z(n.vzQc.wwnJ),n.vzQc.sAgb.KezF,i,n.vzQc.sAgb.RmGv)})):"any_event"===e?t.registerForEvent("any_event",(function(e,t,i,r){n.AJoA(z(n.vzQc.wwnJ),n.vzQc.sAgb.KezF,i,n.vzQc.sAgb.RmGv)})):"campaign_event"===e?t.registerForEvent("campaign_event",(function(e,t,i,r){n.AJoA(z(n.vzQc.wwnJ),n.vzQc.sAgb.KezF,i,n.vzQc.sAgb.RmGv)})):"survey_event"===e&&t.registerForEvent("survey_event",(function(e,t,i,r){n.AJoA(z(n.vzQc.wwnJ),n.vzQc.sAgb.KezF,i,n.vzQc.sAgb.RmGv)}))})),s(this,"ahmf",(function(e){var t=new _e,i=n.vzQc._eventCategory;"apxor_event"===i?t.unregisterFromEvent("apxor_event",n.LGqh):"customer_event"===i?t.unregisterFromEvent("customer_event",n.LGqh):"any_event"===i?t.unregisterFromEvent("any_event",n.LGqh):"campaign_event"===i?t.unregisterFromEvent("campaign_event",n.LGqh):"survey_event"===i&&t.unregisterFromEvent("survey_event",n.LGqh)})),s(this,"yamK",(function(){var e=new _e,t=n.vzQc._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.LGqh):"customer_event"===t?e.registerForEvent("customer_event",n.LGqh):"any_event"===t?e.registerForEvent("any_event",n.LGqh):"campaign_event"===t?e.registerForEvent("campaign_event",n.LGqh):"survey_event"===t&&e.registerForEvent("survey_event",n.LGqh)})),s(this,"zFtC",(function(){var e=new _e,t=n.vzQc._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.CelA):"customer_event"===t?e.registerForEvent("customer_event",n.CelA):"any_event"===t?e.registerForEvent("any_event",n.CelA):"campaign_event"===t?e.registerForEvent("campaign_event",n.CelA):"survey_event"===t&&e.registerForEvent("survey_event",n.CelA)})),s(this,"OtLn",(function(){var e=new _e,t=n.vzQc._eventCategory;"apxor_event"===t?e.unregisterFromEvent("apxor_event",n.CelA):"customer_event"===t?e.unregisterFromEvent("customer_event",n.CelA):"any_event"===t?e.unregisterFromEvent("any_event",n.CelA):"campaign_event"===t?e.unregisterFromEvent("campaign_event",n.CelA):"survey_event"===t&&e.unregisterFromEvent("survey_event",n.CelA)})),s(this,"wvOI",(function(){var e=n.vJKT,t=_e.getInstance();n.AXNR=!0,t.registerForEvent(z(e.wwnJ)+"___"+e.sAgb.KezF,n.dDEu)})),s(this,"mywK",(function(e,t,i,r){var o,a=(Date.now()-n.sOQM[t])/1e3;(null===(o=n.vzQc)||void 0===o||null===(o=o.sAgb)||void 0===o||null===(o=o.RmGv)||void 0===o?void 0:o.time)/1e3>a&&n._displayCampaign(i)})),s(this,"blEo",(function(e,t,i,r){var o,a;n.MyCf=!0;var s=Date.now(),l=null===(o=n.vzQc)||void 0===o||null===(o=o.hBAL)||void 0===o?void 0:o.sAgb.KezF,v=(s-n.sOQM[l])/1e3,c=null===(a=n.vzQc)||void 0===a||null===(a=a.sAgb)||void 0===a||null===(a=a.RmGv)||void 0===a?void 0:a.time;(c/=1e3)>v&&n._displayCampaign(i)})),s(this,"CelA",(function(){n.MRwJ=!0;var e=new _e;clearTimeout(n.timerDid),n.RexI+=1,n.KOzR=n.JMfV(n.RexI,n.vzQc.Psxj,n.vzQc.djdu),n.KOzR&&(e.unregisterFromEvent(z(n.DOoL.wwnJ)+"___"+n.DOoL.sAgb.KezF,n.CelA),n.MRwJ=!1,e.validate(n.HZiO,n.EXJl,n.xgAm))})),s(this,"LGqh",(function(e,t,i,r){n.MyCf=!0,clearTimeout(n.timerDidnt),(new _e).unregisterFromEvent(z(n.azNd.wwnJ)+"___"+n.azNd.sAgb.KezF,n.LGqh)})),s(this,"AJoA",(function(t,i,r,o){var a,s,l=_e.getInstance();if(n.AXNR){if(null!==(a=window.ApxorRTM)&&void 0!==a&&a.isBadgePresent&&null!==(s=window.ApxorRTM)&&void 0!==s&&s.badgesLists.includes(n.HZiO)&&e.getController().isBadgeTriggerSatisfied(n.HZiO))return n.KOzR=!0,n.vzQc.oGib=r,void l.validate(n.HZiO,n.EXJl);if(z(n.vzQc.wwnJ)===t&&n.TtKY(r-n.vzQc.hBAL.oGib,n.vzQc.tkCM)&&n.vzQc.sAgb.KezF===i&&n.RBbM(n.vzQc.sAgb.RmGv,o)&&(n.RexI+=1,n.KOzR=n.JMfV(n.RexI,n.vzQc.Psxj,n.vzQc.djdu),n.KOzR)){if(n.vzQc.oGib=r,n.across_sessions){var v=F(n.vzQc._time.unit,n.vzQc._time.value),c=n.vzQc._timeEnabled,u=n.vzQc._id,d=n.RexI;n.bPyB(n.vzQc.YnyK,i,r,o,v,c,u,d)}l.validate(n.HZiO,n.EXJl,n.xgAm)}}else if(n.AXNR=n.tOnf(t,i,r,o),n.AXNR){var f=n.vzQc,g=f.hBAL;if(g.oGib=r,"activity_time"===(null==f?void 0:f.wwnJ)){var _,h,p,m,y=null==f||null===(_=f.sAgb)||void 0===_||null===(_=_.RmGv)||void 0===_?void 0:_.time;(null==f||null===(h=f.FPgG)||void 0===h?void 0:h.length)>0?setTimeout((function(){var t;(null===(t=e.getController())||void 0===t?void 0:t._appEventsNoKpi).length<=2&&f.FPgG===location.pathname&&n._displayCampaign(r)}),y):(null==f||null===(p=f.sAgb)||void 0===p||null===(p=p.RmGv)||void 0===p?void 0:p.nkpi.length)>0?(setTimeout((function(){n.MyCf||(n.KOzR=!0,n.KOzR&&(n.RexI+=1,n.KOzR=n.JMfV(n.RexI,n.vzQc.Psxj,n.vzQc.djdu),n.KOzR&&(n.vzQc.oGib=r,n.MyCf=!1,l.validate(n.HZiO,n.EXJl)))),f.sAgb.RmGv.nkpi.map((function(e){l.unregisterFromEvent(C(f.sAgb.RmGv.et)+"___"+e,n),n.AXNR=!1}))}),y),f.sAgb.RmGv.nkpi.map((function(e){l.registerForEvent(C(f.sAgb.RmGv.et)+"___"+e,n.LGqh)}))):(null==f||null===(m=f.sAgb)||void 0===m||null===(m=m.RmGv)||void 0===m?void 0:m.kpi.length)>0&&(setTimeout((function(){f.sAgb.RmGv.kpi.map((function(e){l.unregisterFromEvent(C(f.sAgb.RmGv.et)+"___"+e,n)}))}),y),f.sAgb.RmGv.kpi.map((function(e){e===f.hBAL.sAgb.KezF?(l.unregisterFromEvent(z(g.wwnJ)+"___"+g.sAgb.KezF,n),l.registerForEvent(C(f.sAgb.RmGv.et)+"___"+e,n.mywK)):l.registerForEvent(C(f.sAgb.RmGv.et)+"___"+e,n.blEo)})))}else l.unregisterFromEvent(z(g.wwnJ)+"___"+g.sAgb.KezF,n),l.registerForEvent(z(f.wwnJ)+"___"+f.sAgb.KezF,n);n.sOQM[i]=Date.now()}})),s(this,"dDEu",(function(e,t,i,r){var o=_e.getInstance();z(n.vJKT.wwnJ)===e&&n.TtKY(i,n.vJKT.tkCM)&&n.vJKT.sAgb.KezF===t&&n.RBbM(n.vJKT.sAgb.RmGv,r)&&(n.RexI+=1,n.KOzR=n.JMfV(n.RexI,n.vJKT.Psxj,n.vJKT.djdu),n.KOzR&&(n.vJKT.oGib=i,o.validateForTermination(n.HZiO,n.EXJl)))})),s(this,"tOnf",(function(e,t,i,r){var o=n.vzQc.hBAL,a=z(o.wwnJ)===e&&o.sAgb.KezF===t&&n.TtKY(i,o.tkCM)&&n.RBbM(o.sAgb.RmGv,r);return a="APX_PAGE_OPENED"===t?a&&location.pathname===o.sAgb.KvQs:a})),s(this,"TtKY",(function(e,t){var n=Math.ceil(e);return n>t.DtFf&&n<t.tVTR})),s(this,"JMfV",(function(e,t,i){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(r&&n.vzQc.kMTt&&(e+=n.pXyH),i){case"EQ":return e===t;case"GT":return e>t;case"GTE":return e>=t;case"LT":return e<t;case"LTE":return e<=t;default:return!1}})),s(this,"RBbM",(function(e,t){var n=!0;try{var r,o=function(){if(!1===n)return{v:!1};if("object"===i(e[a])){var r,o,s,l=e[a].op,v=e[a].t;if("s"===v)s=e[a].val;else if("l"===v||"f"===v)s=parseFloat(e[a].val);else if("b"===v)switch(e[a].val){case"true":s=!0;break;case"false":s=!1;break;default:s=e[a].val}var c,u=(Array.isArray(t[a])?t[a]:[t[a]]).some((function(e){return"s"===v?e="".concat(e):"l"===v?e=parseInt(e):"f"===v?e=parseFloat(e):"b"===v&&(e=!!e),A(e,s,l)}));if(!(null===(r=e[a])||void 0===r||!r.present)&&(null===(o=e[a])||void 0===o?void 0:o.present))c=!!t.hasOwn(t,a),n=n&&c;n=n&&u}else n=n&&A(t[a],e[a],"EQ")};for(var a in e)if(r=o())return r.v}catch(e){U.error(e),n=!1}return n})),s(this,"bPyB",(function(t,i,r,o,a,s,l,v){var c,u=!1;n.no_KPI_TriggerDetails=e.getController().getFromStorage("apx_nokpi_triggerdetails"),null===n.no_KPI_TriggerDetails||void 0===n.no_KPI_TriggerDetails?n.no_KPI_TriggerDetails=[]:n.no_KPI_TriggerDetails=JSON.parse(n.no_KPI_TriggerDetails);var d,f=0;s&&(f=Date.now()+a);for(var g=0;g<n.no_KPI_TriggerDetails.length;g++)if(n.no_KPI_TriggerDetails[g].id===l){u=!0,c=n.no_KPI_TriggerDetails[g];break}u?c.satisfiedCount+=1:(d={id:l,type:t,time:r,name:i,additionalInfo:o,satisfiedCount:v,timeBased:s,finishTime:f},n.no_KPI_TriggerDetails.push(d)),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(n.no_KPI_TriggerDetails))})),s(this,"IgHd",(function(e){var t,i=new _e,r=d(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(1===(null==o?void 0:o.length)||void 0===(null==o?void 0:o.length))i.unregisterFromEvent(z(null==o?void 0:o.vzQc.wwnJ)+"___"+(null==o?void 0:o.vzQc.sAgb.KezF),n.AJoA);else{var a,s=d(o);try{for(s.s();!(a=s.n()).done;){var l,v=a.value;i.unregisterFromEvent(z(null==v?void 0:v.vzQc.wwnJ)+"___"+(null==v||null===(l=v.vzQc)||void 0===l?void 0:l.sAgb.KezF),n.AJoA)}}catch(e){s.e(e)}finally{s.f()}}}}catch(e){r.e(e)}finally{r.f()}}))}return a(t,[{key:"_displayCampaign",value:function(e){var t=_e.getInstance();this.KOzR=!0,this.KOzR&&(this.RexI+=1,this.KOzR=this.JMfV(this.RexI,this.vzQc.Psxj,this.vzQc.djdu),this.KOzR&&(this.vzQc.oGib=e,t.validate(this.HZiO,this.EXJl)))}}]),t}(),B=window.ApxorLogger,Z=a((function t(){var n=this;r(this,t),s(this,"Psxj",0),s(this,"GMOy",0),s(this,"RydK","SESSION"),s(this,"LyNa",0),s(this,"HWOF",0),s(this,"dnrC",0),s(this,"_enable_repetition_gap",void 0),s(this,"_enable_days_limit",void 0),s(this,"_enable_session_limit",void 0),s(this,"WJmN",void 0),s(this,"kWUo",void 0),s(this,"bJSv",void 0),s(this,"DSLimits",void 0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var i,r,o,a,s,l,v,c;if(n.HZiO=t._id,n.Cwrc=t.meta,n.Psxj=t.frequency.count,-1===n.Psxj&&(n.Psxj=9999999),n.dnrC=n.Psxj,n.GMOy=t.frequency.time_interval,n.RydK=t.frequency.validity,n.DSLimits=t.frequency.DSLimits,n.HWOF=t.frequency.ses_lmt,n._enable_session_limit=null===(i=t.frequency)||void 0===i?void 0:i.enable_session_limit,n._enable_session_limit)n.WJmN=null===(l=t.frequency)||void 0===l?void 0:l.session_count;if(n._dayCount=null!==(r=t.frequency)&&void 0!==r&&r.day_lmt?null===(o=t.frequency)||void 0===o?void 0:o.day_lmt:0,n._enable_repetition_gap=!!t.frequency.enable_repetition_gap&&t.frequency.enable_repetition_gap,n._enable_repetition_gap)n._repetitionValue=null===(v=t.frequency)||void 0===v?void 0:v.repetition_gap.val,n._repetitionUnit=null===(c=t.frequency)||void 0===c?void 0:c.repetition_gap.unit;n._enable_days_limit=!(null===(a=t.frequency)||void 0===a||!a.enable_days_limit)&&(null===(s=t.frequency)||void 0===s?void 0:s.enable_days_limit),n._enable_days_limit&&(n.bJSv=t.frequency.days_limit.days?t.frequency.days_limit.days:1,n.kWUo=t.frequency.days_limit.limit);var u=_e.getInstance().getQeState();if(!p(u)||!p(u[t._id]))return!0;if("SESSION"===n.RydK){if(n.Psxj=parseInt(n.Psxj)-parseInt(u[t._id].SESSION),n.Psxj<=0)return n.UJHf("Session limit reached"),console.warn("Max count limit reached for session:"+t._id),e.getController().isTestDevice()&&T("Maximum overall limit reached for campaign name ".concat(n.Cwrc.name)),!1}else{if("OVERALL"!==n.RydK)return B.info("Invalid config."),!1;if(n.Psxj=parseInt(n.Psxj)-parseInt(u[t._id].OVERALL),n.Psxj<=0)return n.UJHf("Overall limit reached"),console.warn("Max count limit reached for overall:"+t._id),e.getController().isTestDevice()&&T("Maximum overall limit reached for campaign name ".concat(n.Cwrc.name)),!1}}catch(e){return B.error(e),!1}return!0})),s(this,"JTks",(function(){n.Psxj=n.Psxj-1})),s(this,"getFrequencyCount",(function(){return n.Psxj})),s(this,"ovoh",(function(){"SESSION"===n.RydK&&(n.Psxj=n.dnrC,B.info("Campaign Limit reset"))})),s(this,"DJrV",(function(t){try{if(n.Psxj<=0)return"OVERALL"===n.RydK?(n.UJHf("Overall limit reached"),e.getController().isTestDevice()&&T("Maximum overall limit reached for campaign name ".concat(n.Cwrc.name))):"SESSION"===n.RydK&&(e.getController().isTestDevice()&&T("Maximum session limit reached for campaign name ".concat(n.Cwrc.name)),n.UJHf("Session limit reached")),!1;var i=_e.getInstance().getQeState();if(!p(i)||!p(i[t]))return!0;if(n._enable_session_limit)if(parseInt(n.WJmN)-parseInt(i[t].SESSION)<=0)return n.UJHf("Session limit reached"),e.getController().isTestDevice()&&T("Maximum session limit reached for campaign name ".concat(n.Cwrc.name)),!1;if(n._enable_repetition_gap)if("session"!=n._repetitionUnit){var r=e.getController().getFromStorage("apx-last-shown-times");if(r=JSON.parse(r),!h(k(r,n.HZiO))){var o=k(r,n.HZiO)[n.HZiO];if(Date.now()-o<F(n._repetitionUnit,n._repetitionValue))return n.UJHf("Config does not satisfy time difference "),e.getController().isTestDevice()&&T("Config does not satisfy time difference for campaign name ".concat(n.Cwrc.name)),!1}}else{var a=e.getController().getFromStorage("apx-last-shown-session");if(a=JSON.parse(a),!h(k(a,n.HZiO))){var s=k(a,n.HZiO)[n.HZiO];if(e.getController().getFromStorage("apx_retained_session")-s<parseInt(n._repetitionValue))return n.UJHf("Config does not satisfy session difference "),e.getController().isTestDevice()&&T("Config does not satisfy session difference for campaign name ".concat(n.Cwrc.name)),!1}}if(0!==n.HWOF&&n.DSLimits)if(parseInt(n.HWOF)-parseInt(i[t].SESSION)<=0)return n.UJHf("Session limit reached"),e.getController().isTestDevice()&&T("Session limit reached for campaign name ".concat(n.Cwrc.name)),!1;if(0!==n._dayCount){var l,v=x();if(parseInt(n._dayCount)-parseInt((null===(l=i[t])||void 0===l?void 0:l.DATES[v])||0)<=0)return n.UJHf("Day limit reached"),e.getController().isTestDevice()&&T("Day limit reached for campaign name ".concat(n.Cwrc.name)),!1}if(n.bJSv>0&&n._enable_days_limit){var c=n.bJSv,u=0;if(function(e){for(var t=[],n=new Date,i=0;i<e;i++){var r=new Date(n);r.setDate(n.getDate()-i);var o=String(r.getDate()),a=String(r.getMonth()),s=r.getFullYear();t.push(o+"/"+a+"/"+s)}return t}(c).forEach((function(e){var n;u+=parseInt((null===(n=i[t])||void 0===n?void 0:n.DATES[e])||0)})),u>n.kWUo)return B.info("Shown Limit Crossed"),e.getController().isTestDevice()&&T("Days limit reached for campaign name ".concat(n.Cwrc.name)),!1}}catch(e){n.UJHf("Error validating the frequency: ".concat(e)),B.error("Error validating the frequency:"+e)}return!0})),s(this,"UJHf",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.Cwrc.type?"survey":"campaign",apx_nudge_id:n.HZiO,apx_nudge_name:n.Cwrc.name,apx_variant_code:n.Cwrc.isExperiment||n.Cwrc.only_context?null===(i=n.Cwrc.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),X=window.ApxorLogger,W=a((function e(){var t=this;r(this,e),s(this,"XFsF",[]),s(this,"dFuJ",0),s(this,"afSl",!1),s(this,"zDYy",void 0),s(this,"initialize",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unordered",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];t.HZiO=n,t.EXJl=i,t.jzOu=o,t.VIsH=r,t.across_sessions=s;var l=[];t.dFuJ=e.length;try{if(null!=l)return r=null==e?void 0:e.sequence_type,l=t.Gmtw(e,t.dFuJ),"unordered"!==a&&0!==t.EXJl||t.GrDR(),t.XFsF}catch(e){return X.error(e),!1}})),s(this,"Gmtw",(function(e,n){for(var i=0;i<n;i++){t.zDYy=new P;try{t.zDYy.initialize(e[i],t.HZiO,t.EXJl,t.VIsH,t.pCID,t.across_sessions,"",-1,!1)&&(t.XFsF.push(t.zDYy),t.XFsF.sequence_type=t.VIsH)}catch(e){X.error(e)}}return t.XFsF})),s(this,"GrDR",(function(){if("ordered"===t.VIsH||"strictly_ordered"===t.VIsH)t.XFsF[0].GrDR(0);else{var e,n=d(t.XFsF);try{for(n.s();!(e=n.n()).done;){e.value.GrDR()}}catch(e){n.e(e)}finally{n.f()}}})),s(this,"IgHd",(function(e){t.zDYy.IgHd(e)}))})),$=a((function e(){var t=this;r(this,e),s(this,"KezF",""),s(this,"YnyK",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;t.KezF=e.meta.name,t.YnyK=e.meta.type,t._only_context=e.meta.only_context,t._attr=(null===(n=e.meta)||void 0===n?void 0:n.attr)||{},t._isExperiment=null===(i=e.meta)||void 0===i?void 0:i.isExperiment}catch(e){return window.ApxorLogger.error(e),!1}return!0}))})),ee=window.ApxorLogger,te=a((function t(){var n=this;r(this,t),s(this,"eVuR",[]),s(this,"_ret_day",{}),s(this,"Nsaw",{}),s(this,"lpRT",!1),s(this,"iTrW",!1),s(this,"retainedDaysValidated",!0),s(this,"retainedSessionValidated",!0),s(this,"eventDoneInLT",!1),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{n.eVuR=e.overall_cfg.events,n._ret_day=e.overall_cfg.ret_day,n.Nsaw=e.overall_cfg.session,n.lpRT=e.overall_cfg.toggleRetDay,n.iTrW=e.overall_cfg.toggleSession}catch(e){return ee.error(e),!1}return!0})),s(this,"validate",(function(){var t=parseInt(e.getController().getFromStorage("apx_retained_days")),i=parseInt(e.getController().getFromStorage("apx_retained_session"));if(n.lpRT&&!isNaN(t)&&!(t>=n._ret_day.from&&t<=n._ret_day.to))return n.retainedDaysValidated=!1,!1;if(n.iTrW&&!isNaN(i)&&!(i>=n.Nsaw.from&&i<=n.Nsaw.to))return n.retainedSessionValidated=!1,!1;try{for(var r=e.getController().getFromStorage("_apx_lt_count"),o=e.getSiteId(),a=JSON.parse((new TextDecoder).decode(function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return t}(b(o,r)))),s=0;s<n.eVuR.length;s++){if(a[n.eVuR[s].name.replace("'","").replace("’","")])return n.eventDoneInLT=!0,!1}}catch(e){ee.error("Failed to validate the lt count:"+e)}return!0}))})),ne=window.ApxorLogger,ie=a((function e(){var t=this;r(this,e),s(this,"OtlV",[]),s(this,"ixdq",[]),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.OtlV=e.attributes.user,t.ixdq=e.attributes.session,!Array.isArray(t.OtlV)||!Array.isArray(t.ixdq))return ne.error("No attributes"),!1}catch(e){return ne.error(e),!1}return!0})),s(this,"validate",(function(e,n){return t.LEzd(e,t.OtlV)&&t.LEzd(n,t.ixdq)})),s(this,"LEzd",(function(e,t){var n=t.length,i=!0;try{for(var r,o=function(){var n=t[a];if(!e[n.name]||!1===i)return{v:!1};var r=n.operator,o=n.type,s=n.value.map((function(e){return"s"===o?e:"l"===o?parseInt(e):"f"===o?parseFloat(e):void 0})),l=(Array.isArray(e[n.name])?e[n.name]:[e[n.name]]).some((function(e){return s.some((function(t){return A(e,t,r)}))}));i=i&&l},a=0;a<n;a++)if(r=o())return r.v}catch(e){ne.error(e),i=!1}return i}))})),re=a((function t(){var n=this;r(this,t),s(this,"VFVG",e.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"eLrt",1),s(this,"parse",(function(e){try{var t,i,r;if(n.YnyK=null===(t=e.terminate_info.time_based)||void 0===t?void 0:t.type,n._duration_seconds=null===(i=e.terminate_info)||void 0===i?void 0:i.time_based.duration_seconds,n.eLrt=null===(r=e.terminate_info.time_based)||void 0===r?void 0:r.days,n.jmAk(e._id))return n.VFVG.persistTerminationInfoLocally(e._id),!1}catch(e){return!1}return!0})),s(this,"jmAk",(function(e){var t,i=JSON.parse(n.VFVG.getFromStorage("apx_termination_ID"));if(!i[e]||null===(t=i[e])||void 0===t||!t.startDate)return!1;var r,o=new Date(i[e].startDate),a=new Date((r=new Date).getMonth()+"/"+r.getDate()+"/"+r.getFullYear()),s=parseInt((a-o)/864e5,10),l=function(){var e=new Date;return{hours:e.getHours(),mins:e.getMinutes()}}(),v=i[e].aPGV;return s===n.eLrt&&l.hours>=v.hours||s>n.eLrt||i[e].goalAcheived}))})),oe=a((function e(){var t=this;r(this,e),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"kfIW",new ie),s(this,"uDLj",new re),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i,r;if(t.enable_time_based=null==e||null===(n=e.terminate_info)||void 0===n?void 0:n.enable_time_based,t.enable_time_based&&!t.uDLj.parse(e))return!1;if(t.enable_goal_events=null==e||null===(i=e.terminate_info)||void 0===i?void 0:i.enable_goal_events,t.enable_attributes=null==e||null===(r=e.terminate_info)||void 0===r?void 0:r.enable_attributes,t.enable_attributes&&!t.kfIW.parse(e.terminate_info))return!1}catch(e){return window.ApxorLogger.error(e),!1}return!0})),s(this,"validate",(function(e,n){return t.kfIW.validate(e,n)}))})),ae=window.ApxorLogger,se=a((function t(){var n=this;r(this,t),s(this,"EdtB",-1),s(this,"QnYB",-1),s(this,"aPGV",-1),s(this,"mjEj",-1),s(this,"gVCe",-1),s(this,"jytr",-1),s(this,"_is_user_timezone",void 0),s(this,"mjqT",!1),s(this,"GBVo",!1),s(this,"_nudge_expired",!1),s(this,"_not_yet_active",!1),s(this,"_not_in_specified_time",!1),s(this,"_days_in_week",[]),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,i;if(n.HZiO=e._id,n.Cwrc=e.meta,isNaN(Date.parse(e.validity.start_date))||isNaN(Date.parse(e.validity.end_date))||!Array.isArray(e.validity.days_in_week))return ae.error("Not valid dates"),!1;if(n.EdtB=Date.parse(e.validity.start_date),n.QnYB=Date.parse(e.validity.end_date),n._days_in_week=null!==(t=e.validity)&&void 0!==t&&t.days_in_week?null===(i=e.validity)||void 0===i?void 0:i.days_in_week:[1,2,3,4,5,6,7],n._is_user_timezone=!e.is_user_timezone||e.is_user_timezone,p(e.at_specific_time)&&(n.mjqT=e.at_specific_time,n.mjqT&&p(e.time_limits)&&(n.aPGV=e.time_limits.start_time,n.mjEj=e.time_limits.end_time,w(n.aPGV)||w(n.mjEj))))return ae.error("Not valid times"),!1;if(p(e.time_excludes_in_day)&&(n.GBVo=e.time_excludes_in_day,n.GBVo&&p(e.time_excludes)&&(n.gVCe=e.time_excludes.start_time,n.jytr=e.time_excludes.end_time,w(n.gVCe)||w(n.jytr))))return ae.error("Not valid exclude times"),!1}catch(e){return ae.error(e),!1}return!0})),s(this,"validate",(function(){var t=Date.now(),i=(new Date).getDay()+1,r=function(e){var t=new Date,n=t.getHours(),i=t.getMinutes(),r=(n=(n<10?"0":"")+n)+":"+(i=(i<10?"0":"")+i);if(!e){var o=t.getUTCHours(),a=t.getUTCMinutes();r=(o=(o<10?"0":"")+o)+":"+(a=(a<10?"0":"")+a)}return r}(n._is_user_timezone);if(t>n.EdtB&&t<n.QnYB&&n._days_in_week.includes(i))return!n.mjqT||L(r,n.aPGV,"GT")&&L(r,n.mjEj,"LT")||(n._not_in_specified_time=!0),n.GBVo&&function(e,t,n){var i=l(e.split(":").map(Number),2),r=i[0],o=i[1],a=l(t.split(":").map(Number),2),s=a[0],v=a[1],c=l(n.split(":").map(Number),2),u=60*c[0]+c[1];return u>=60*r+o&&u<=60*s+v}(n.gVCe,n.jytr,r)?(n.UJHf("Exclude Time limits check failed"),e.getController().isTestDevice()&&T("Exclude Time Limits check failed for campaign name ".concat(n.Cwrc.name)),!1):!n.mjqT||L(r,n.aPGV,"GT")&&L(r,n.mjEj,"LT");if(t<n.EdtB)n._not_yet_active=!0;else if(t>n.QnYB)n._nudge_expired=!0;else if(!n._days_in_week.includes(i))return n.UJHf("Current week day did not match with Configured Week day"),e.getController().isTestDevice()&&T("Current week day did not match with Configured Week day for campaign name ".concat(n.Cwrc.name)),!1;return!1})),s(this,"UJHf",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.Cwrc.type?"survey":"campaign",apx_nudge_id:n.HZiO,apx_nudge_name:n.Cwrc.name,apx_variant_code:n.Cwrc.isExperiment||n.Cwrc.only_context?null===(i=n.Cwrc.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),le=a((function e(){var t=this;r(this,e),s(this,"DNou",""),s(this,"UZJK",""),s(this,"SGcD",""),s(this,"CdeV",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.DNou=null==e?void 0:e.screen_binding,!t.DNou||(t.UZJK=null==e?void 0:e.binding.url,t.SGcD=null==e?void 0:e.binding.var,t.CdeV=null==e?void 0:e.binding.operator,!0)}catch(e){return window.ApxorLogger.error(e),!1}})),s(this,"validate",(function(){var e=t.UZJK,n=t.SGcD,i=t.CdeV,r=window.location.href;return!t.DNou||("EQ"===i?e.includes(n)?!!Q(r,e,n,!1):r===e:"SW"===i?e.includes(n)?!!Q(r,e,n,!0):!!r.startsWith(e):void 0)}))})),ve=window.ApxorLogger,ce=a((function t(){var i=this;r(this,t),s(this,"Lbqk",[]),s(this,"pDYw",[]),s(this,"HZiO",""),s(this,"Cwrc",new $),s(this,"EdGF",new J),s(this,"RydK",new se),s(this,"zNfa",new Z),s(this,"kFaW",new te),s(this,"MysB",new oe),s(this,"pFiw",new le),s(this,"VIsH",!1),s(this,"pCID",[]),s(this,"_variant_code",""),s(this,"afSl",!1),s(this,"groupCombineOperator","OR"),s(this,"MyCf",!1),s(this,"CboV",!1),s(this,"pKnG",void 0),s(this,"timeForKPI",void 0),s(this,"kpiIndex",0),s(this,"MQhn",void 0),s(this,"_across_sessions",!1),s(this,"JsGT",void 0),s(this,"sVCV",!1),s(this,"pnVO",void 0),s(this,"tzvU",void 0),s(this,"PITd",void 0),s(this,"ULTA",void 0),s(this,"jDXU",void 0),s(this,"KQfN",void 0),s(this,"FoSx",void 0),s(this,"rzpc",void 0),s(this,"tYHj",void 0),s(this,"DDdA",void 0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,n;if(!p(e._id))return ve.error("No Id"),!1;if(!p(e.enabled)||!e.enabled)return ve.error("Not enabled"),!1;if(!(i.Cwrc.parse(e)&&i.RydK.parse(e)&&i.zNfa.parse(e)&&i.EdGF.parse(e)&&i.kFaW.parse(e)&&i.MysB.parse(e)&&i.pFiw.parse(e)))return!1;if(i._variant_code=i.Cwrc._isExperiment||i.Cwrc._only_context?null===(t=i.Cwrc._attr)||void 0===t?void 0:t.apx_variant_code:"TG",i._across_sessions=!(null==e||!e.across_sessions)&&(null==e?void 0:e.across_sessions),i.enable_conditions=null==e?void 0:e.enable_conditions,i.enable_conditions_v2=null==e?void 0:e.enable_conditions_v2,!p(e.conditions)||!Array.isArray(e.conditions))return ve.error("No valid conditions",e.conditions),!1;i.HZiO=e._id,i.VIsH=!!p(e.sequence_enabled)&&e.sequence_enabled,p(e.conditions_v2)&&i.enable_conditions_v2&&(i.VIsH=null==e?void 0:e.sequence_type),!0===i.VIsH&&e.conditions.sort((function(e,t){return e.sequence<t.sequence})),p(e.conditions_v2)&&i.enable_conditions_v2?(n=e.conditions_v2,i.sVCV=!0):n=e.conditions,i.JsGT=n;var r=n.length,o=null==e?void 0:e.no_context_enabled;if(0===r&&o&&setTimeout((function(){i.tUgG()}),10),i.DDdA=r,i.onbn(n,r),i.vcHj(),i.MysB.enable_goal_events)for(var a=e.terminate_info.goal_events.events,s=a.length,l=0;l<s;l++){var v=new P;v.initialize(a[l],i.HZiO,l,!0,[],i._across_sessions,"termination")&&i.pDYw.push(v)}return i.Lbqk.length>0}catch(e){return ve.error(e),!1}})),s(this,"onbn",(function(e,t){for(var n=function(){i.pCID=[];var t=e[r];if("group"===(null!=t&&t.condition_type?null==t?void 0:t.condition_type:"single")){var n=t.conditions_v2;i.groupCombineOperator=t.combine_operator;var o=null==t?void 0:t.sequence_type;i.tYHj=new W;var a=i.tYHj.initialize(n,i.HZiO,r,o,i.pCID,i.VIsH,i._across_sessions);i.Lbqk.push(a)}else{if("didn't"===t.type){var s,l={trigger_key:t.trigger.details.name,no_kpi_array:null==t||null===(s=t.details)||void 0===s||null===(s=s.additional_info)||void 0===s?void 0:s.nkpi,condition_id:null==t?void 0:t._id,time_bounds:t.time_bounds.upper};i.pCID=[].concat(v(i.pCID),[l])}if(i.tYHj=new P,i.tYHj.initialize(t,i.HZiO,r,i.VIsH,i.pCID,i._across_sessions)){i.Lbqk.push(i.tYHj);var c=(null==t?void 0:t.timeout)/(null==t?void 0:t.findinterval),u=(null==t?void 0:t.frameid)||"",d=null==t?void 0:t.url;window.location.href===d&&"view_visibility"===t.event_type&&!0===O(t.view_id,u,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,c)&&i.tUgG(!0),window.addEventListener("navigate",(function(e){var n=null==t?void 0:t.url;window.location.href===n&&"view_visibility"===t.event_type&&!0===O(t.view_id,u,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,c)&&i.tUgG(!0)}))}}},r=0;r<t;r++)n()})),s(this,"vcHj",(function(){if(i._across_sessions&&"ordered"===i.VIsH){var t=!1,n=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(n=JSON.parse(n))&&null!=n)for(var r=function(e){var r,o,a;if(null!==(r=i.Lbqk[e])&&void 0!==r&&null!==(r=r.vzQc)&&void 0!==r&&r._timeEnabled&&void 0===i.Lbqk[e].length){if("didn't"===i.Lbqk[e].vzQc.YnyK){var s=i.Lbqk[e].vzQc._id,l=i.doNY(s,n);if(l)if(Date.now()>l.finishTime)i.Lbqk[e].KOzR=!0,i.Lbqk[e].RexI=l.satisfiedCount,t=!0;else{var v=l.finishTime-Date.now(),c=i.Lbqk[e].vzQc._eventCategory?i.Lbqk[e].vzQc._eventCategory:"specific_event",u=new _e;"specific_event"===c?(u.registerForEvent(z(i.Lbqk[e].vzQc.wwnJ)+"___"+i.Lbqk[e].vzQc.sAgb.KezF,i.LGqh),i.jDXU=i.Lbqk[e]):i.yamK(c),setTimeout((function(){e!==i.Lbqk.length-1||i.MyCf||(i.Lbqk[e].KOzR=!0,i.Lbqk[e].RexI=l.satisfiedCount,t=!0,"specific_event"===c?u.unregisterFromEvent(z(i.Lbqk[e].vzQc.wwnJ)+"___"+i.Lbqk[e].vzQc.sAgb.KezF,i.LGqh):i.qdnR(i.Lbqk[e]),i.tUgG())}),v)}}if("did"===i.Lbqk[e].vzQc.YnyK){var d=i.Lbqk[e].vzQc._id,f=i.doNY(d,n);if(f)if(null==f.satisfiedCount){if(Date.now()<f.finishTime){i.PITd=f,i.tzvU=e;var g=f.finishTime-Date.now(),_=i.Lbqk[e].vzQc._eventCategory?i.Lbqk[e].vzQc._eventCategory:"specific_event",h=new _e;"specific_event"===_?h.registerForEvent(z(i.Lbqk[e].vzQc.wwnJ)+"___"+i.Lbqk[e].vzQc.sAgb.KezF,i.dDch):i.yamK(_),setTimeout((function(){"specific_event"===_?h.unregisterFromEvent(z(i.Lbqk[e].vzQc.wwnJ)+"___"+i.Lbqk[e].vzQc.sAgb.KezF,i.dDch):i.qdnR(i.Lbqk[e])}),g)}}else i.Lbqk[e].RexI=f.satisfiedCount,i.Lbqk[e].KOzR=!0}}else t=i.eMgY(e,n);t&&(null===(o=i.Lbqk[e])||void 0===o||null===(o=o.vzQc)||void 0===o||!o._timeEnabled||(null===(a=i.Lbqk[e])||void 0===a?void 0:a.length)>1)?e===i.Lbqk.length-1&&i.tUgG():t||void 0===!i.Lbqk[e].length&&i.Lbqk[e].GrDR()},o=0;o<i.Lbqk.length;o++)r(o)}else if(i._across_sessions&&"unordered"===i.VIsH){var a=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(a=JSON.parse(a))&&null!=a)for(var s=0;s<i.Lbqk.length;s++)i.eMgY(s,a)}})),s(this,"eMgY",(function(e,t){if(void 0===i.Lbqk[e].length||1===i.Lbqk[e].length){var n=i.Lbqk[e].vzQc._id,r=!1,o=i.doNY(n,t);if(o)i.pnVO=o,r=(new P).JMfV(o.satisfiedCount,i.Lbqk[e].vzQc.Psxj,i.Lbqk[e].vzQc.djdu),o&&(r?i.Lbqk[e].KOzR=!0:i.Lbqk[e].RexI=o.satisfiedCount);else i.Lbqk[e].GrDR();return r}if(i.Lbqk[e].length>=1){var a,s,l;if("ordered"===(s=null===(a=i.Lbqk[e])||void 0===a?void 0:a.sequence_type)||"strictly_ordered"===s){for(var v=0;v<i.Lbqk[e].length;v++){var c=i.Lbqk[e][v],u=c.vzQc._id;l=!1;var d=i.doNY(u,t);if(d){if(l=(new P).JMfV(d.satisfiedCount,c.vzQc.Psxj,c.vzQc.djdu),d)if(l){i.Lbqk[e][v].KOzR=!0;var f=v+1,g=i.Lbqk[e][v+1];void 0===g&&p(i.Lbqk[e+1])&&(i.Lbqk[e+1].GrDR(),l=!0),null!=g&&i.Lbqk[e][v+1].GrDR(f)}else i.Lbqk[e][v].RexI=d.satisfiedCount}else(p(i.Lbqk[e][v-1])&&!0===i.Lbqk[e][v].KOzR||_(i.Lbqk[e][v-1]))&&i.Lbqk[e][v].GrDR()}return l}for(var h,m=0;m<i.Lbqk[e].length;m++){var y=i.Lbqk[e][0].vzQc.IKic;h="OR"!==y;var b=i.Lbqk[e][m],w=b.vzQc._id;l=!1;var z=i.doNY(w,t);if(z)l=(new P).JMfV(z.satisfiedCount,b.vzQc.Psxj,b.vzQc.djdu),z&&(l?i.Lbqk[e][m].KOzR=!0:i.Lbqk[e][m].RexI=z.satisfiedCount);else b.GrDR();h="AND"===y?h&&l:h||l}return h}})),s(this,"doNY",(function(e,t){return t.find((function(t){return t.id===e}))})),s(this,"Vhzk",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=_e.getInstance();if(!(t<0)){var o=i.Lbqk[t],a="unordered";if((null==o?void 0:o.length)>1&&(a=null==o?void 0:o.sequence_type),!0===i.VIsH||"ordered"===i.VIsH||"strictly_ordered"===i.VIsH||"ordered"===a||"strictly_ordered"===a){i.kpiIndex=t+1;var s=i.Lbqk[t];if((null==s?void 0:s.length)>0){if(p(s))if("unordered"===i.VIsH&&"ordered"===a){var l=o[n-1];if(p(l))if(void 0===l.length||1==l.length){if(!l.KOzR)return}else if(l.length>1&&!i.WYtY(l))return;var v,c=o[n+1];if(p(c)){if(c.GrDR(n+1),"strictly_ordered"===i.VIsH){i._currentEventname=s[n].vzQc.sAgb.KezF;var u=e.getController();u.registerForEvent("APP_EVENT",i.oFUw),u.registerForEvent("CLIENT_EVENT",i.oFUw)}}else if("strictly_ordered"===a)1!=i.afSl&&i.tUgG();else(null===(v=o[n])||void 0===v?void 0:v.length)>0?i.WYtY(o)&&i.tUgG():i.tUgG()}else{var f,g=i.Lbqk[t-1];if(p(g))if(void 0===g.length||1==g.length){if(!g.KOzR)return}else if(g.length>1&&!i.WYtY(g))return;if(void 0===s.length||1===s.length?f=i.Lbqk[t+1]:s.length>1&&("ordered"===a||"strictly_ordered"===a?f=n===s.length-1?i.Lbqk[t+1]:i.Lbqk[t][n+1]:i.WYtY(s)&&(f=i.Lbqk[t+1])),p(f)){if(void 0===f.length||1===f.length)f.GrDR(n+1);else if(i.WYtY(s))if(void 0===f.length)f.GrDR();else if(f.length>1)if("unordered"===f.sequence_type)for(var _=0;_<f.length;_++)f[_].GrDR(_);else"ordered"!==f.sequence_type&&"strictly_ordered"!==f.sequence_type||f[0].GrDR(0);if("strictly_ordered"===i.VIsH){i._currentEventname=s[n].vzQc.sAgb.KezF;var h=e.getController();h.registerForEvent("APP_EVENT",i.oFUw),h.registerForEvent("CLIENT_EVENT",i.oFUw)}}else"strictly_ordered"===i.VIsH?1!=i.afSl&&i.tUgG():i.WYtY(s)&&i.tUgG()}}else if(p(s)&&s.KOzR){s.sOQM[s.vzQc.sAgb.KezF]=Date.now();var m=i.Lbqk[t-1];if(p(m))if(void 0===m.length||1==m.length){if(!m.KOzR)return}else if(m.length>1&&!i.WYtY(m))return;var y=i.Lbqk[t+1];if(p(y)){var b,w;if(null!=y&&null!==(b=y.vzQc)&&void 0!==b&&b._timeEnabled){if("session"!=(null===(w=y.vzQc)||void 0===w?void 0:w._time.unit)){var C,A,E=F(y.vzQc._time.unit,y.vzQc._time.value);if("didn't"==(null===(C=y.vzQc)||void 0===C?void 0:C.YnyK)){if(i.FoSx=setTimeout((function(){if(i.MyCf)i.MyCf=!1;else{if(i.MyCf=!1,y.KOzR=!0,y.KOzR){y.RexI+=1;var e=new P;if(y.KOzR=e.JMfV(y.RexI,y.vzQc.Psxj,y.vzQc.djdu),y.KOzR){y.vzQc.oGib=Date.now();var n=t+1,o=i.Lbqk[n+1];p(o)?o.GrDR():i.tUgG()}}r.unregisterFromEvent(z(y.vzQc.wwnJ)+"___"+y.vzQc.sAgb.KezF,i.LGqh),y.AXNR=!1}}),E),i._across_sessions){var x=F(y.vzQc._time.unit,y.vzQc._time.value),L=y.vzQc._timeEnabled,Q=y.vzQc._id,O=new P;O.bPyB(y.vzQc.YnyK,y.vzQc.sAgb.KezF,Date.now(),y.vzQc.sAgb.RmGv,x,L,Q)}"specific_event"===y.vzQc._eventCategory?(r.registerForEvent(z(y.vzQc.wwnJ)+"___"+y.vzQc.sAgb.KezF,i.LGqh),i.jDXU=y):i.yamK(y)}else if("did"==(null===(A=y.vzQc)||void 0===A?void 0:A.YnyK)&&(i.MyCf=!1,i.MQhn=y,p(i.Lbqk[t+2])&&i._across_sessions&&(i.ULTA=i.Lbqk[t+2]),i.rzpc=setTimeout((function(){i.MyCf?i.MyCf=!1:(i.MyCf=!1,r.unregisterFromEvent(z(y.vzQc.wwnJ)+"___"+y.vzQc.sAgb.KezF,i.blEo))}),E),i.pKnG=s,i.timeForKPI=E,r.registerForEvent(z(y.vzQc.wwnJ)+"___"+y.vzQc.sAgb.KezF,i.blEo),i.KQfN=y,i._across_sessions)){var K=F(y.vzQc._time.unit,y.vzQc._time.value),R=y.vzQc._timeEnabled,D=y.vzQc._id,q=new P;q.bPyB(y.vzQc.YnyK,y.vzQc.sAgb.KezF,Date.now(),y.vzQc.sAgb.RmGv,K,R,D)}}}else if(y.length>0)if("ordered"===y.sequence_type||"strictly_ordered"===y.sequence_type)y[0].GrDR(n+1);else{var k,I=d(y);try{for(I.s();!(k=I.n()).done;){var T=k.value;T.GrDR()}}catch(e){I.e(e)}finally{I.f()}}else y.GrDR();if("strictly_ordered"===i.VIsH){i._currentEventname=s.vzQc.sAgb.KezF;var G=e.getController();G.registerForEvent("APP_EVENT",i.oFUw),G.registerForEvent("CLIENT_EVENT",i.oFUw)}}else"strictly_ordered"===i.VIsH?1!=i.afSl&&i.tUgG():i.tUgG()}}else i.Ylla(),i.tUgG()}})),s(this,"oFUw",(function(e){e&&e.name!=i._currentEventname&&(i.afSl=!0)})),s(this,"yamK",(function(e){var t=new _e,n=e.vzQc._eventCategory;"apxor_event"===n?t.registerForEvent("apxor_event",i.LGqh):"customer_event"===n?t.registerForEvent("customer_event",i.LGqh):"any_event"===n?t.registerForEvent("any_event",i.LGqh):"campaign_event"===n?t.registerForEvent("campaign_event",i.LGqh):"survey_event"===n&&t.registerForEvent("survey_event",i.LGqh)})),s(this,"qdnR",(function(e){var t=new _e,n=e.vzQc._eventCategory;"apxor_event"===n?t.unregisterFromEvent("apxor_event",i.LGqh):"customer_event"===n?t.unregisterFromEvent("customer_event",i.LGqh):"any_event"===n?t.unregisterFromEvent("any_event",i.LGqh):"campaign_event"===n?t.unregisterFromEvent("campaign_event",i.LGqh):"survey_event"===n&&t.unregisterFromEvent("survey_event",i.LGqh)})),s(this,"LGqh",(function(){var e,t;i.FoSx&&(i.MyCf=!1,clearTimeout(i.FoSx));var n=new _e;i.MyCf=!0,i._across_sessions&&null!==localStorage.getItem("apx_nokpi_triggerdetails")&&localStorage.removeItem("apx_nokpi_triggerdetails"),n.unregisterFromEvent(z(null===(e=i.jDXU)||void 0===e||null===(e=e.vzQc)||void 0===e?void 0:e.wwnJ)+"___"+(null===(t=i.jDXU)||void 0===t||null===(t=t.vzQc)||void 0===t||null===(t=t.sAgb)||void 0===t?void 0:t.KezF),i.LGqh)})),s(this,"blEo",(function(){var t,n,r,o=new _e;i.MyCf=!0,i.rzpc&&clearTimeout(i.rzpc);var a=new P;if(i.MQhn.RexI+=1,i.MQhn.KOzR=a.JMfV(i.MQhn.RexI,i.MQhn.vzQc.Psxj,i.MQhn.vzQc.djdu),o.unregisterFromEvent(z(null===(t=i.KQfN)||void 0===t||null===(t=t.vzQc)||void 0===t?void 0:t.wwnJ)+"___"+(null===(n=i.KQfN)||void 0===n||null===(n=n.vzQc)||void 0===n?void 0:n.sAgb.KezF),i.blEo),i._across_sessions&&null!==(r=i.ULTA)&&void 0!==r&&r.vzQc._timeBased){var s,l,v,c=e.getController().getFromStorage("apx_nokpi_triggerdetails");c=null==c?[]:JSON.parse(c);for(var u=0;u<c.length;u++)if(i.no_KPI_TriggerDetails[u].id===i.ULTA.vzQc._id){s=!0,l=c[u];break}if(s)l.satisfiedCount+=1;else{var d=i.MQhn.vzQc._id,f=i.MQhn.vzQc.YnyK,g=i.MQhn.vzQc.sAgb.KezF,_=i.MQhn.vzQc.sAgb.RmGv;v={id:d,type:f,time:Date.now(),name:g,additionalInfo:_,satisfiedCount:i.MQhn.vzQc._timeEnabled,timeBased:i.MQhn.vzQc._timeEnabled},i.no_KPI_TriggerDetails.push(v)}}if(i.MQhn.KOzR){var h=i.Lbqk[i.kpiIndex+1];p(h)?h.GrDR():i.tUgG()}})),s(this,"dDch",(function(){if(i.tzvU===i.Lbqk.length-1){i.CboV=!0;i.Lbqk[i.tzvU]&&(i.Lbqk[i.tzvU].RexI=i.PITd.satisfiedCount,i.Lbqk[i.tzvU].KOzR=!0,i.tUgG())}else{var t,n,r=e.getController().getFromStorage("apx_nokpi_triggerdetails");r=null==r?[]:JSON.parse(r);for(var o=0;o<r.length;o++)if(r[o].id===i.tzvU){n=!0,t=r[o];break}if(n&&(t.satisfiedCount=1),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(r)),i.Lbqk[i.tzvU].RexI=i.PITd.satisfiedCount,i.Lbqk[i.tzvU].KOzR=!0,i.Lbqk[i.tzvU+1].vzQc._timeEnabled){var a=F(i.Lbqk[i.tzvU+1].vzQc._time.unit,i.Lbqk[i.tzvU+1].vzQc._time.value),s=i.Lbqk[i.tzvU+1].vzQc._timeEnabled,l=i.Lbqk[i.tzvU+1].vzQc._id,v=i.Lbqk[i.tzvU+1].RexI,c=i.Lbqk[i.tzvU+1].vzQc.sAgb.KezF,u=i.Lbqk[i.tzvU+1].sAgb.RmGv;(new P).bPyB(i.vzQc.YnyK,c,Date.now(),u,a,s,l,v)}}})),s(this,"Ylla",(function(){if(i._across_sessions&&i.sVCV){var t,n,r,o="single",a=!1,s=e.getController().getFromStorage("apx_nokpi_triggerdetails");if((s=JSON.parse(s)).length>0){var l,v=d(s);try{var c=function(){var e=l.value,s=e.id,v=e.satisfiedCount;if(t=i.Lbqk.find((function(e,t){if(1===(null==e?void 0:e.length)||void 0===(null==e?void 0:e.length)){if(e.vzQc._id===s)return o="single",n=t,!0}else if(e.length>0){var i=e.findIndex((function(e){return e.vzQc._id===s}));if(-1!==i)return n=t,r=i,o="group",!0}return!1})),"single"===o&&t){var c=new P;a=c.JMfV(v,t.vzQc.Psxj,t.vzQc.djdu);var u=i.Lbqk.findIndex((function(e){var t;return(null==e||null===(t=e.vzQc)||void 0===t?void 0:t._id)===s}));void 0===u&&(u=n),a&&(i.Lbqk[u].KOzR=!0)}else if("group"===o&&t){var d=new P;(a=d.JMfV(v,t[r].vzQc.Psxj,t[r].vzQc.djdu))&&(i.Lbqk[n][r].KOzR=!0)}};for(v.s();!(l=v.n()).done;)c()}catch(e){v.e(e)}finally{v.f()}}}})),s(this,"aKBV",(function(e){e<0||i.nUug()})),s(this,"tUgG",(function(){var t,r,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=e.getController().getUserAttributes(),s=e.getController().getSessionAttributes();if(null!==(t=window.ApxorRTM)&&void 0!==t&&t.isBadgePresent&&null!==(r=window.ApxorRTM)&&void 0!==r&&r.badgesLists.includes(i.HZiO)&&e.getController().isBadgeTriggerSatisfied(i.HZiO)||null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===i.Cwrc.YnyK?"survey":"campaign",apx_nudge_id:i.HZiO,apx_nudge_name:i.Cwrc.KezF,apx_variant_code:i.Cwrc._isExperiment||i.Cwrc._only_context?i.Cwrc._attr.apx_variant_code:"TG"}),!(i.RydK.validate()&&i.EdGF.validate(a,s)&&i.kFaW.validate()&&i.pFiw.validate())){i.Cwrc.YnyK;return i.kFaW.retainedDaysValidated?i.kFaW.retainedSessionValidated?i.kFaW.eventDoneInLT?void i.UJHf("Event done in life time"):i.EdGF.userAttributesValidated?i.EdGF.sessionAttributeValidated?i.RydK._not_in_specified_time?void i.UJHf("Time limits check failed"):i.RydK._not_yet_active?void i.UJHf("not in the scheduled time"):i.RydK._nudge_expired?void i.UJHf("nudge expired"):void 0:void i.UJHf("Session property filter not met"):void i.UJHf("User property filter not met"):void i.UJHf("User session criteria not met"):void i.UJHf("Retained day criteria not met")}var l=i.Lbqk.length,v=l<1,c="";0===l&&(v=!0);for(var u=0;u<l;u++){var f=void 0,g=i.Lbqk[u];if(g.length>1){var _=g[0].vzQc.IKic;f="AND"===_;for(var h=0;h<g.length;h++){var p=g[0].vzQc.IKic;f="AND"===p?f&&g[h].KOzR:f||g[h].KOzR}}else f=g.KOzR;if(""===c.trim())v=f;else switch(c){case"AND":v=v&&f;break;case"OR":v=v||f}c=g.length>1?i.groupCombineOperator:g.IKic}if(!0===o&&(v=!0),v){var m,y;if(console.debug("onCondition satisfied"),!i.zNfa.DJrV(i.HZiO))return void console.warn("Maximum limit reached",i.HZiO);if(!(null!==(m=window.ApxorRTM)&&void 0!==m&&m.isBadgePresent&&null!==(y=window.ApxorRTM)&&void 0!==y&&y.badgesLists.includes(i.HZiO)&&e.getController().isBadgeTriggerSatisfied(i.HZiO))){var b="SURVEY"===i.Cwrc.YnyK?"survey":"campaign";null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===i.Cwrc.YnyK?"survey":"campaign",apx_nudge_id:i.HZiO,apx_nudge_name:i.Cwrc.KezF,apx_variant_code:i.Cwrc._isExperiment||i.Cwrc._only_context?i.Cwrc._attr.apx_variant_code:"TG"},!1,"",b)}i._across_sessions&&localStorage.removeItem("apx_nokpi_triggerdetails");var w,z=d(i.Lbqk);try{for(z.s();!(w=z.n()).done;){var C=w.value;if(1===(null==C?void 0:C.length)||void 0===(null==C?void 0:C.length))C.KOzR=!1,C.RexI=0;else{var A,E=d(C);try{for(E.s();!(A=E.n()).done;){var x=A.value;x.KOzR=!1,x.RexI=0}}catch(e){E.e(e)}finally{E.f()}}}}catch(e){z.e(e)}finally{z.f()}if(i.tYHj.IgHd(i.Lbqk),i.Lbqk=[],i.onbn(i.JsGT,i.DDdA),!0===i.Cwrc._only_context){var L="SURVEY"===i.Cwrc.YnyK?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.Cwrc._attr),{},{message_name:i.Cwrc.KezF,id:i.HZiO}),!1,"",L)}e.getController().dispatchEvent(i.Cwrc.YnyK,{name:i.Cwrc.YnyK,additional_info:{uuid:i.HZiO,name:i.Cwrc.KezF}})}})),s(this,"nUug",(function(){for(var t=i.pDYw.length,r=t<1,o="",a=0;a<t;a++){var s=i.pDYw[a],l=s.KOzR;if(""===o.trim())r=l;else switch(o){case"AND":r=r&&l;break;case"OR":r=r||l}o=s.JeVw}if(r){if(e.getController().persistTerminationInfoLocally(i.HZiO),!0===i.Cwrc._only_context){var v="SURVEY"===i.Cwrc.YnyK?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.Cwrc._attr),{},{message_name:i.Cwrc.KezF,id:i.HZiO}),!1,"apxor",v)}e.getController().dispatchEvent(i.Cwrc.YnyK,{name:i.Cwrc.YnyK,additional_info:{uuid:i.HZiO,name:i.Cwrc.KezF}})}})),s(this,"validateForTerminationAttributes",(function(){var t=e.getController().getUserAttributes(),n=e.getController().getSessionAttributes();return i.MysB.validate(t,n)})),s(this,"JTks",(function(){i.zNfa.JTks()})),s(this,"getFrequencyCount",(function(){return i.zNfa.getFrequencyCount()})),s(this,"dmUH",(function(){return i.zNfa.ovoh()})),s(this,"WYtY",(function(e){var t;t="AND"===e[0].vzQc.IKic;for(var n=0;n<e.length;n++){t="AND"===e[0].vzQc.IKic?t&&e[n].KOzR:t||e[n].KOzR}return t})),s(this,"UJHf",(function(t){var n;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.Cwrc.YnyK?"survey":"campaign",apx_nudge_id:i.HZiO,apx_nudge_name:i.Cwrc.KezF,apx_variant_code:i.Cwrc._isExperiment||i.Cwrc._only_context?null===(n=i.Cwrc._attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),ue=a((function e(){var t=this;r(this,e),s(this,"oiDl",{}),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(p(e)&&p(e.configs)){var n=e.configs;if(!Array.isArray(n))return;n.sort((function(e,t){var n,i;return(null!==(n=e.prio)&&void 0!==n?n:-1)-(null!==(i=t.prio)&&void 0!==i?i:-1)}));for(var i=0;i<n.length;i++){var r=n[i],o=r._id,a=new ce;a.parse(r)?t.oiDl[o]=a:console.warn("Failed to parse cfg",o)}}})),s(this,"validate",(function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(t.oiDl[e]){var r=t.oiDl[e];r.Vhzk(n,i)}})),s(this,"getVariantCode",(function(e){return t.oiDl[e]?t.oiDl[e]._variant_code:""})),s(this,"validateForTermination",(function(e,n){t.oiDl[e]&&t.oiDl[e].aKBV(n)})),s(this,"validateForTerminationAttributes",(function(e){return!!t.oiDl[e]&&t.oiDl[e].validateForTerminationAttributes()})),s(this,"JTks",(function(e){t.oiDl[e].JTks()})),s(this,"getFrequencyCount",(function(e){var n=t.oiDl[e];if(null!=n)return n.getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var e=t.oiDl;for(var n in e)e[n].dmUH()})),s(this,"Cutc",(function(e){try{if(t.oiDl){var n=t.oiDl[e];if(n&&n.Cwrc)return n.Cwrc}}catch(e){console.log("Error in getting the campaign meta ".concat(e))}return{}}))})),de=window.ApxorLogger,fe=a((function t(){var n=this;r(this,t),s(this,"qOpx",{}),s(this,"NAfO",[]),s(this,"MpRk",!1),s(this,"initialize",(function(){var t=e.getController();t.registerForEvent("APP_EVENT",(function(e){return n.opho(e,"AE")})),t.registerForEvent("CLIENT_EVENT",(function(e){return n.opho(e,"CE")}))})),s(this,"izHC",(function(){var e,t=d(n.NAfO);try{for(t.s();!(e=t.n()).done;){var i=e.value;n.Gpts(i.event,i.key,i.type)}}catch(e){t.e(e)}finally{t.f()}n.MpRk=!0})),s(this,"YwuD",(function(e,t){var i;"function"==typeof t&&((i=n.qOpx[e]?n.qOpx[e]:[]).push(t),n.qOpx[e]=i,de.debug("Listeners list: ",n.qOpx))})),s(this,"unregisterFromEvent",(function(e,t){if(n.qOpx[e]){for(var i=n.qOpx[e],r=[],o=0;o<i.length;o++){var a=i[o];a!==t&&r.push(a)}n.qOpx[e]=r}})),s(this,"opho",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE";n.Gpts(e,"any_event",t),"apxor"===(null==e?void 0:e.loggedBy)?n.Gpts(e,"apxor_event",t):"customer"===(null==e?void 0:e.loggedBy)&&n.Gpts(e,"customer_event",t),"campaign"===(null==e?void 0:e.apx_nudge_type)?n.Gpts(e,"campaign_event",t):"survey"===(null==e?void 0:e.apx_nudge_type)&&n.Gpts(e,"survey_event",t);var i=t+"___"+e.name;n.Gpts(e,i,t)})),s(this,"Gpts",(function(t,i,r){if(n.MpRk){if(de.debug("Notifying listeners for event: "+t+", "+i,n.qOpx),n.qOpx[i])for(var o=n.qOpx[i],a=e.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(r,t.name,a,t.additional_info)}}else n.NAfO.push({event:t,key:i,type:r})}))})),ge=window.ApxorLogger,_e=function(){function t(){var n=this;return r(this,t),s(this,"FDnn",!1),s(this,"CJvL",null),s(this,"wOne",x()),s(this,"ccUz",new fe),s(this,"hTmp",e.getSiteId()),s(this,"QhBY",{}),s(this,"getQeState",(function(){try{var t=e.getController().getFromStorage("qe_state");return t?JSON.parse(b(n.hTmp,t)):(n.QhBY={},n.setQeState())}catch(e){return n.QhBY={},n.setQeState()}})),s(this,"setQeState",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{e.getController().persistToStorage("qe_state",n.QhBY,!0)}catch(i){""===t?n.QhBY={}:n.QhBY[t]={SESSION:0,OVERALL:0,DATES:{}},e.getController().persistToStorage("qe_state",n.QhBY,!0)}return n.QhBY})),s(this,"initialize",(function(){n.FDnn||(n.FDnn=!0,n.CJvL=new ue,n.ccUz.initialize(),n.QhBY=n.getQeState(),ge.info("QE Initialized.."))})),s(this,"parse",(function(e){n.KfZt()?(n.CJvL.parse(e),n.ccUz.izHC()):ge.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;n.KfZt()&&n.CJvL.validate(e,t,i)})),s(this,"getVariantCode",(function(e){return n.CJvL.getVariantCode(e)})),s(this,"validateForTermination",(function(e,t){n.KfZt()&&n.CJvL.validateForTermination(e,t)})),s(this,"validateForTerminationAttributes",(function(e,t){return n.CJvL.validateForTerminationAttributes(e,t)})),s(this,"updateCount",(function(e){try{p(n.QhBY[e])||n.createObjConfig(e),n.incrementFrequencies(e),n.setQeState(e),n.CJvL.JTks(e)}catch(e){console.log("Could not update the count config:".concat(e))}})),s(this,"resetFrequencyCounts",(function(){n.CJvL.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(e){return n.CJvL.getFrequencyCount(e)})),s(this,"registerForEvent",(function(e,t){n.ccUz.YwuD(e,t)})),s(this,"unregisterFromEvent",(function(e,t){n.ccUz.unregisterFromEvent(e,t)})),s(this,"notifyEventListener",(function(e){n.ccUz.opho(e)})),s(this,"fetch",(function(t,n,i,r){e.getController().fetchConfiguration(t,n,i,r)})),s(this,"KfZt",(function(){return n.FDnn})),s(this,"getCampaignMetaFromQueryEngine",(function(e){return n.CJvL.Cutc(e)})),s(this,"EcAB",(function(){return n.wOne})),t.instance||(t.instance=this),t.instance}return a(t,[{key:"createObjConfig",value:function(e){try{this.QhBY=this.getQeState(),p(this.QhBY[e])||(this.QhBY[e]={SESSION:0,OVERALL:0,DATES:{}},this.wOne&&(this.QhBY[e].DATES[this.wOne]=0),this.setQeState(e))}catch(e){ge.error("Can not create the frequency count object:"+e)}}},{key:"incrementFrequencies",value:function(e){this.QhBY=this.getQeState();var t=this.QhBY[e];t.SESSION=t.SESSION+1,t.OVERALL=t.OVERALL+1;var n=x();n===this.wOne&&t.DATES&&t.DATES[n]||(this.wOne=n,t.DATES={},t.DATES[this.wOne]=0),t.DATES[this.wOne]=t.DATES[this.wOne]+1}}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}}]),t}();s(_e,"instance",void 0),window.ceVersion=203;try{void 0===exports&&null===exports||(exports.default=_e,module.exports=exports.default)}catch(e){}return _e}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("apxor")):"function"==typeof define&&define.amd?define(["apxor"],t):(e=e||self)["apxor-qe"]=t(e.Apxor)}(this,(function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){s(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=d(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function f(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var h=window.ApxorLogger,g=function(e){return void 0===e},_=function(e){return null===e},m=function(e){return void 0!==e&&!_(e)},p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function b(e,t){return Array.from(t).map((function(t,n){return String.fromCharCode(t^function(e,t){return e.charCodeAt(Math.floor(t%e.length))}(e,n))})).join("")}var y=function(e,t){return b(e,t=function(e){var t,n,i,r,o,a,s=0,l=[];if(!e)return e;e+="";do{t=(a=p.indexOf(e.charAt(s++))<<18|p.indexOf(e.charAt(s++))<<12|(r=p.indexOf(e.charAt(s++)))<<6|(o=p.indexOf(e.charAt(s++))))>>16&255,n=a>>8&255,i=255&a,l.push(t),64!==r&&(l.push(n),64!==o&&l.push(i))}while(s<e.length);return l}(t))},D=function(e){return m(e)&&!_(e)&&!isNaN(e)},w=function(e){switch(e){case"app_event":return"AE";case"client_event":return"CE";case"activity_time":case"activity_event":return"AE";case"apxor_event":return"AEV";case"customer_event":return"CEV";case"any_event":return"ANV";case"campaign_event":return"CNV";case"survey_event":return"SVE"}return"Unknown"},x=function(e){return e.toUpperCase()},E=function(e,t,n){switch(n){case"EQ":return e===t;case"GT":return e>t;case"GTE":return e>=t;case"LT":return e<t;case"LTE":return e<=t;case"NEQ":return e!==t;case"R":return B(t).test(e);default:return!1}},B=function(e){var t=e.replace(/.*\/([gimuy]*)$/,"$1");t===e&&(t="");var n=t?e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1"):e;return new RegExp(n,t)},O=function(){var e=new Date;return e.getDate()+"/"+e.getMonth()+"/"+e.getFullYear()},S=function(e,t,n){if("GT"===n){var i=e.split(":"),r=t.split(":");if(!(i[0]>=r[0]))return!1;if(i[0]>r[0])return!0;if(i[0]!=r[0])return!1;if(i[1]>=r[1])return!0}else if("LT"===n){var o=e.split(":"),a=t.split(":");if(!(o[0]<=a[0]))return!1;if(o[0]<a[0])return!0;if(o[0]!=a[0])return!1;if(o[1]<=a[1])return!0}},F=function(e,t){switch(e){case"second":return 1e3*t;case"minute":return 60*t*1e3;case"hour":return 60*t*60*1e3;case"day":return 24*t*60*60*1e3;default:return 1}},L=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!t||!n)return!1;var r=n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),o=t.replace(new RegExp(r,"g"),"(.+)"),a=i?"^".concat(o):"".concat(o,"$"),s=new RegExp(a);return s.test(e)};function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,o=C(e,t);if(o){var a=function(){if(A(o)){return function(e){return P(e)}(o)}return h.info("Invalid target element. Width and height are 0 for element: ".concat(e,". Can't show tooltip")),!1};return a()}return n?(h.info("Not found yet. Rechecking the DOM."),T(r,i,e,t)):(h.info("Element with selector:".concat(e," not found.")),!1)}function T(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=setInterval((function(){var t=C(n,i);if(t){clearInterval(r);!function(){if(A()){P()}else h.info("Invalid target element. Width and height are 0 for element: ".concat(n,". Can't show tooltip"))}()}else(e-=1)<=0&&(clearInterval(r),console.warn("Element with selector:".concat(n," not found.")))}),t)}var C=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=document.getElementById(e);if(!i)try{i=document.querySelector(e)}catch(e){window.ApxorLogger.error("Error finding element in DOM:"+e)}(i||(i=U(e)),!i&&n.length>0)&&(i=null===(t=document.getElementById(n))||void 0===t||null===(t=t.contentWindow)||void 0===t||null===(t=t.document)||void 0===t?void 0:t.querySelector(e));return i},U=function(e){var t=e.indexOf("svg");-1!==t&&(e=e.substring(0,t)+"svg:svg");try{return document.blJQ(e,document,(function(e){return"svg"===e?"http://www.w3.org/2000/svg":null}),XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}catch(e){window.ApxorLogger.error("Error finding element in DOM:"+e)}return null};function A(e){try{var t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!1}catch(e){return!1}return!0}function z(e,t){for(var n=0;n<e.length;n++)if(e[n].hasOwnProperty(t))return e[n];return null}function P(e){var t,n,i,r;return!!(n=(t=e).offsetHeight,i=t.offsetWidth,(r=t.getBoundingClientRect()).left>=-i&&r.top>=-n&&r.right<=(window.innerWidth||document.documentElement.clientWidth)+i&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)+n)}var G=function(e){!function(e){var t='\n <style> \n .apx-container{\n padding:10px;\n }\n </style>\n <div id="apx-innerElement" class="apx-container">\n <div id="close-button" style="cursor: pointer;position:absolute;top:9px;right:9px;"><svg width="11" height="11" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path opacity="0.5" d="M11.0962 9.07071L17.8586 15.8331L15.8331 17.8586L9.0707 11.0962L8.99999 11.0255L8.92928 11.0962L2.16693 17.8586L0.141421 15.8331L6.90379 9.07071L6.9745 9L6.90379 8.92929L0.141421 2.16694L2.16693 0.141422L8.92928 6.9038L8.99999 6.97451L9.0707 6.9038L15.8331 0.141422L17.8586 2.16694L11.0962 8.92929L11.0255 9L11.0962 9.07071Z" fill="white" stroke="#002845" stroke-width="0.2"/>\n </svg>\n </div>\n <div style="font-family: inherit;font-style: normal;font-weight: 600;font-size: 16px;line-height: 22px;\n color: #FFFFFF; display: flex; gap: 12px;"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-circle-check-filled" width="33" height="33" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff" fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="none" d="M0 0h24v24H0z" fill="none"/>\n <path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor" />\n</svg><div style = "align-self: center;padding-right:20px;">'.concat(e,"</div></div>\n </div>\n "),n=document.createElement("div");n.style="\n z-index:99999999;\n background:#16202f;\n position:fixed;\n top:1%;\n right:1%;\n border-radius: 12px;\n ",n.innerHTML=t,n.id="apx-container",document.body.appendChild(n)}(e);var t=document.getElementById("close-button"),n=function(){var e=document.getElementById("apx-container");null==e||e.remove()};null==t||t.addEventListener("click",n),window.setTimeout(n,2e4)},J=window.ApxorLogger,N=a((function t(){var n=this;r(this,t),s(this,"ddJm","ALL"),s(this,"uJxy",[]),s(this,"exhh",[]),s(this,"userAttributesValidated",!0),s(this,"sessionAttributeValidated",!0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(n.ddJm=e.audience.audience_type,n.uJxy=e.audience.attributes.user,n.exhh=e.audience.attributes.session,!Array.isArray(n.uJxy)||!Array.isArray(n.exhh))return J.error("No attributes"),!1}catch(e){return J.error(e),!1}return!0})),s(this,"validate",(function(t,i){var r=!0;"FTU"===n.ddJm&&(r=e.getController().getSessionInfo().is_first_session);var o=n.soiz(t,n.uJxy),a=n.soiz(i,n.exhh);return o||(n.userAttributesValidated=!1),a||(n.sessionAttributeValidated=!1),r&&o&&a})),s(this,"soiz",(function(e,t){var n=t.length,i=!0;try{for(var r,o=function(){var n=t[a];if(g(e[n.name])||!1===i)return{v:!1};var r=n.operator,o=n.type,s=n.value.map((function(e){if("s"===o)return e;if("l"===o)return parseInt(e);if("f"===o)return parseFloat(e);if("b"===o)switch(e){case"true":return!0;case"false":return!1;default:return e}})),l=(Array.isArray(e[n.name])?e[n.name]:[e[n.name]]).some((function(e){return s.some((function(t){return"s"===o?e="".concat(e):"l"===o?e=parseInt(e):"f"===o?e=parseFloat(e):"b"===o&&(e=!!e),E(e,t,r)}))}));i=i&&l},a=0;a<n;a++)if(r=o())return r.v}catch(e){J.error(e),i=!1}return i}))})),q=a((function e(){var t=this;r(this,e),s(this,"nOGI",""),s(this,"vKdD",{}),s(this,"ynqP",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{t.nOGI=e.name,t.vKdD=e.additional_info,t.ynqP=null==e?void 0:e.path}catch(e){return!1}return!0}))})),V=a((function e(){var t=this;r(this,e),s(this,"OKbL",0),s(this,"znOt",0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.OKbL=Number(e.lower),t.znOt=Number(e.upper),isNaN(t.OKbL)||isNaN(t.znOt))return!1}catch(e){return!1}return!0}))})),R=a((function e(){var t=this;r(this,e),s(this,"lVrK",0),s(this,"aeLY",""),s(this,"eLZJ",""),s(this,"scdw",new q),s(this,"ieqc",new V),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.aeLY=e.event_type,t.eLZJ=e.activity,t.scdw.parse(e.details)&&t.ieqc.parse(e.time_bounds)}catch(e){return!1}}))})),k=window.ApxorLogger,Q=a((function e(){var t=this;r(this,e),s(this,"lVrK",0),s(this,"xNKz",-1),s(this,"xanH",0),s(this,"jHes",""),s(this,"eLZJ",""),s(this,"aeLY",""),s(this,"ieqc",new V),s(this,"scdw",new q),s(this,"aHxF",new R),s(this,"DViF","AND"),s(this,"zPuU",!1),s(this,"ddJm",void 0),s(this,"IkqP",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;return t.xNKz=null==e?void 0:e.sequence,t._conditionType=null==e?void 0:e.condition_type,t._id=null==e?void 0:e._id,t._eventCategory=null!=e&&e.event_category?null==e?void 0:e.event_category:"specific_event",t.xanH=null==e||null===(n=e.count_config)||void 0===n?void 0:n.count,t.jHes=null==e||null===(i=e.count_config)||void 0===i?void 0:i.operator,t.eLZJ=null==e?void 0:e.activity,t.aeLY=null==e?void 0:e.event_type,t.DViF=e.combine_operator,t._timeEnabled=null==e?void 0:e.time_enabled,t._time=null==e?void 0:e.time,t.ddJm=null==e?void 0:e.type,t.IkqP=null==e?void 0:e.route,t.scdw.parse(null==e?void 0:e.details)&&t.aHxF.parse(e.trigger)&&t.ieqc.parse(e.time_bounds)}catch(e){return k.error(e),!1}}))})),Y=window.ApxorLogger,K=a((function e(){var t=this;r(this,e),s(this,"xanH",0),s(this,"jHes",""),s(this,"aeLY",""),s(this,"ieqc",new V),s(this,"scdw",new q),s(this,"DViF","AND"),s(this,"parse",(function(e){try{return t.xanH=e.count_config.count,t.jHes=e.count_config.operator,t.aeLY=e.event_type,t.DViF=e.combine_operator,t.scdw.parse(e.details)&&t.ieqc.parse(e.time_bounds)}catch(e){return Y.error(e),!1}}))})),W=window.ApxorLogger,j=function(){function t(){var n=this;r(this,t),s(this,"Roxa",0),s(this,"bnsg",""),s(this,"BDlb",new Q),s(this,"zEag",new K),s(this,"NgfT",!1),s(this,"rcvu",!1),s(this,"gFVl",0),s(this,"DViF","AND"),s(this,"RYiy","OR"),s(this,"yWqu",-1),s(this,"wbcE",[]),s(this,"ACPj",{}),s(this,"WthB",!1),s(this,"eNrW",void 0),s(this,"PvRi",void 0),s(this,"tSNK",void 0),s(this,"mlZx",void 0),s(this,"no_KPI_TriggerDetails",[]),s(this,"oOhl",!1),s(this,"timerDidnt",void 0),s(this,"timerDid",void 0),s(this,"initialize",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:-1,d=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(n.bnsg=i,n.gFVl=r,n.wbcE=a,n.eNrW=o,n.childConditionIndex=u,n.across_sessions=s||!1,"termination"===l&&""!==l){n.zEag.parse(t);return n.RYiy=n.zEag.DViF,n.lsTi(),!0}var c=n.BDlb.parse(t);if(c){if(n.DViF=n.BDlb.DViF,n.BDlb.zPuU){var v=n.BDlb.scdw.nOGI;"APX_PAGE_OPENED"===v&&(v=n.BDlb.scdw.vKdD.navigation_id,v=m(v)?v:n.BDlb.scdw.nOGI),n.yWqu=e.getController().getEventCount(v);var f=n.BDlb.xanH,h=n.BDlb.jHes;if(n.rcvu=n.oapm(n.yWqu-1,f,h,!1),n.NgfT=n.rcvu,n.rcvu&&"APX_PAGE_OPENED"===n.BDlb.scdw.nOGI)return!0}return!0===d&&(o&&0!==r&&"unordered"!==o||n.DyGP()),!0}return!1})),s(this,"DyGP",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1!=t&&(n.PvRi=t);var i=n.BDlb,r=null!=i&&i._eventCategory?null==i?void 0:i._eventCategory:"specific_event",o=i.aHxF,a=ge.getInstance();if("app_start"===o.aeLY)if(n.NgfT=!0,null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var s=F(i._time.unit,i._time.value);if("didn't"==(null==i?void 0:i.ddJm)){if(n.WthB=!1,n.timerDidnt=setTimeout((function(){n.WthB||(n.rcvu=!0,n.rcvu&&(n.Roxa+=1,n.rcvu=n.oapm(n.Roxa,n.BDlb.xanH,n.BDlb.jHes),n.rcvu&&(n.BDlb.lVrK=Date.now(),n.WthB=!1,a.validate(n.bnsg,n.gFVl,n.PvRi))),"specific_event"===r?a.unregisterFromEvent(w(n.BDlb.aeLY)+"___"+n.BDlb.scdw.nOGI,n.JJye):n.gyYs(r),n.NgfT=!1)}),s),n.across_sessions){var l=F(i._time.unit,i._time.value),u=i._timeEnabled,d=i._id;n.wbRt(i.ddJm,i.scdw.nOGI,Date.now(),i.scdw.vKdD,l,u,d)}"specific_event"===r?(a.registerForEvent(w(n.BDlb.aeLY)+"___"+n.BDlb.scdw.nOGI,n.JJye),n.mlZx=n.BDlb):n.RQgw(r)}else if("did"==(null==i?void 0:i.ddJm)){if(n.timerDid=setTimeout((function(){n.oOhl||("specific_event"===r?a.unregisterFromEvent(w(n.BDlb.aeLY)+"___"+n.BDlb.scdw.nOGI,n.hRoU):n.Nswe(r))}),s),n.across_sessions){var c=F(i._time.unit,i._time.value),v=i._timeEnabled,f=i._id;n.wbRt(i.ddJm,i.scdw.nOGI,Date.now(),i.scdw.vKdD,c,v,f)}"specific_event"===r?(a.registerForEvent(w(n.BDlb.aeLY)+"___"+n.BDlb.scdw.nOGI,n.hRoU),n.tSNK=n.BDlb):n.LnLE(r)}}}else"specific_event"===r?a.registerForEvent(w(i.aeLY)+"___"+i.scdw.nOGI,n.MVgG):n.XVBb(r);else if(null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var h=F(i._time.unit,i._time.value);"didn't"==(null==i?void 0:i.ddJm)?(n.WthB=!1,n.timerDidnt=setTimeout((function(){n.WthB||(n.rcvu=!0,n.rcvu&&(n.Roxa+=1,n.rcvu=n.oapm(n.Roxa,n.BDlb.xanH,n.BDlb.jHes),n.rcvu&&(n.BDlb.lVrK=Date.now(),n.WthB=!1,a.validate(n.bnsg,n.gFVl)))),"specific_event"===r&&a.unregisterFromEvent(w(n.BDlb.aeLY)+"___"+n.BDlb.scdw.nOGI,n.JJye),n.NgfT=!1}),h),"specific_event"===r?(a.registerForEvent(w(n.BDlb.aeLY)+"___"+n.BDlb.scdw.nOGI,n.JJye),n.mlZx=n.BDlb):n.RQgw()):"did"==(null==i?void 0:i.ddJm)&&(n.timerDid=setTimeout((function(){n.oOhl||"specific_event"===r&&a.unregisterFromEvent(w(n.BDlb.aeLY)+"___"+n.BDlb.scdw.nOGI,n.hRoU)}),h),"specific_event"===r&&a.registerForEvent(w(n.BDlb.aeLY)+"___"+n.BDlb.scdw.nOGI,n.hRoU))}}else"specific_event"===r&&a.registerForEvent(w(i.aeLY)+"___"+o.scdw.nOGI,n.MVgG);null!==(e=window.ApxorRTM)&&void 0!==e&&e.badgesLists.includes(n.bnsg)&&a.registerForEvent(w(i.aeLY)+"___"+"apxor-badge-container-".concat("-".concat(n.bnsg).replaceAll(" ","").replace(/[^\w\s]/gi,"")),n.MVgG)})),s(this,"XVBb",(function(e){var t=new ge;"apxor_event"===e?t.registerForEvent("apxor_event",(function(e,t,i,r){n.MVgG(w(n.BDlb.aeLY),n.BDlb.scdw.nOGI,i,n.BDlb.scdw.vKdD)})):"customer_event"===e?t.registerForEvent("customer_event",(function(e,t,i,r){n.MVgG(w(n.BDlb.aeLY),n.BDlb.scdw.nOGI,i,n.BDlb.scdw.vKdD)})):"any_event"===e?t.registerForEvent("any_event",(function(e,t,i,r){n.MVgG(w(n.BDlb.aeLY),n.BDlb.scdw.nOGI,i,n.BDlb.scdw.vKdD)})):"campaign_event"===e?t.registerForEvent("campaign_event",(function(e,t,i,r){n.MVgG(w(n.BDlb.aeLY),n.BDlb.scdw.nOGI,i,n.BDlb.scdw.vKdD)})):"survey_event"===e&&t.registerForEvent("survey_event",(function(e,t,i,r){n.MVgG(w(n.BDlb.aeLY),n.BDlb.scdw.nOGI,i,n.BDlb.scdw.vKdD)}))})),s(this,"gyYs",(function(e){var t=new ge,i=n.BDlb._eventCategory;"apxor_event"===i?t.unregisterFromEvent("apxor_event",n.JJye):"customer_event"===i?t.unregisterFromEvent("customer_event",n.JJye):"any_event"===i?t.unregisterFromEvent("any_event",n.JJye):"campaign_event"===i?t.unregisterFromEvent("campaign_event",n.JJye):"survey_event"===i&&t.unregisterFromEvent("survey_event",n.JJye)})),s(this,"RQgw",(function(){var e=new ge,t=n.BDlb._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.JJye):"customer_event"===t?e.registerForEvent("customer_event",n.JJye):"any_event"===t?e.registerForEvent("any_event",n.JJye):"campaign_event"===t?e.registerForEvent("campaign_event",n.JJye):"survey_event"===t&&e.registerForEvent("survey_event",n.JJye)})),s(this,"LnLE",(function(){var e=new ge,t=n.BDlb._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.hRoU):"customer_event"===t?e.registerForEvent("customer_event",n.hRoU):"any_event"===t?e.registerForEvent("any_event",n.hRoU):"campaign_event"===t?e.registerForEvent("campaign_event",n.hRoU):"survey_event"===t&&e.registerForEvent("survey_event",n.hRoU)})),s(this,"Nswe",(function(){var e=new ge,t=n.BDlb._eventCategory;"apxor_event"===t?e.unregisterFromEvent("apxor_event",n.hRoU):"customer_event"===t?e.unregisterFromEvent("customer_event",n.hRoU):"any_event"===t?e.unregisterFromEvent("any_event",n.hRoU):"campaign_event"===t?e.unregisterFromEvent("campaign_event",n.hRoU):"survey_event"===t&&e.unregisterFromEvent("survey_event",n.hRoU)})),s(this,"lsTi",(function(){var e=n.zEag,t=ge.getInstance();n.NgfT=!0,t.registerForEvent(w(e.aeLY)+"___"+e.scdw.nOGI,n.Udfh)})),s(this,"isOp",(function(e,t,i,r){var o,a=(Date.now()-n.ACPj[t])/1e3;(null===(o=n.BDlb)||void 0===o||null===(o=o.scdw)||void 0===o||null===(o=o.vKdD)||void 0===o?void 0:o.time)/1e3>a&&n._displayCampaign(i)})),s(this,"OMck",(function(e,t,i,r){var o,a;n.WthB=!0;var s=Date.now(),l=null===(o=n.BDlb)||void 0===o||null===(o=o.aHxF)||void 0===o?void 0:o.scdw.nOGI,u=(s-n.ACPj[l])/1e3,d=null===(a=n.BDlb)||void 0===a||null===(a=a.scdw)||void 0===a||null===(a=a.vKdD)||void 0===a?void 0:a.time;(d/=1e3)>u&&n._displayCampaign(i)})),s(this,"hRoU",(function(){n.oOhl=!0;var e=new ge;clearTimeout(n.timerDid),n.Roxa+=1,n.rcvu=n.oapm(n.Roxa,n.BDlb.xanH,n.BDlb.jHes),n.rcvu&&(e.unregisterFromEvent(w(n.tSNK.aeLY)+"___"+n.tSNK.scdw.nOGI,n.hRoU),n.oOhl=!1,e.validate(n.bnsg,n.gFVl,n.PvRi))})),s(this,"JJye",(function(e,t,i,r){n.WthB=!0,clearTimeout(n.timerDidnt),(new ge).unregisterFromEvent(w(n.mlZx.aeLY)+"___"+n.mlZx.scdw.nOGI,n.JJye)})),s(this,"MVgG",(function(t,i,r,o){var a,s,l=ge.getInstance();if(n.NgfT){if(null!==(a=window.ApxorRTM)&&void 0!==a&&a.isBadgePresent&&null!==(s=window.ApxorRTM)&&void 0!==s&&s.badgesLists.includes(n.bnsg)&&e.getController().isBadgeTriggerSatisfied(n.bnsg))return n.rcvu=!0,n.BDlb.lVrK=r,void l.validate(n.bnsg,n.gFVl);if(w(n.BDlb.aeLY)===t&&n.lcOU(r-n.BDlb.aHxF.lVrK,n.BDlb.ieqc)&&n.BDlb.scdw.nOGI===i&&n.tMms(n.BDlb.scdw.vKdD,o)&&(n.Roxa+=1,n.rcvu=n.oapm(n.Roxa,n.BDlb.xanH,n.BDlb.jHes),n.rcvu)){if(n.BDlb.lVrK=r,n.across_sessions){var u=F(n.BDlb._time.unit,n.BDlb._time.value),d=n.BDlb._timeEnabled,c=n.BDlb._id,v=n.Roxa;n.wbRt(n.BDlb.ddJm,i,r,o,u,d,c,v)}l.validate(n.bnsg,n.gFVl,n.PvRi)}}else if(n.NgfT=n.vHsm(t,i,r,o),n.NgfT){var f=n.BDlb,h=f.aHxF;if(h.lVrK=r,"activity_time"===(null==f?void 0:f.aeLY)){var g,_,m,p,b=null==f||null===(g=f.scdw)||void 0===g||null===(g=g.vKdD)||void 0===g?void 0:g.time;(null==f||null===(_=f.IkqP)||void 0===_?void 0:_.length)>0?setTimeout((function(){var t;(null===(t=e.getController())||void 0===t?void 0:t._appEventsNoKpi).length<=2&&f.IkqP===location.pathname&&n._displayCampaign(r)}),b):(null==f||null===(m=f.scdw)||void 0===m||null===(m=m.vKdD)||void 0===m?void 0:m.nkpi.length)>0?(setTimeout((function(){n.WthB||(n.rcvu=!0,n.rcvu&&(n.Roxa+=1,n.rcvu=n.oapm(n.Roxa,n.BDlb.xanH,n.BDlb.jHes),n.rcvu&&(n.BDlb.lVrK=r,n.WthB=!1,l.validate(n.bnsg,n.gFVl)))),f.scdw.vKdD.nkpi.map((function(e){l.unregisterFromEvent(x(f.scdw.vKdD.et)+"___"+e,n),n.NgfT=!1}))}),b),f.scdw.vKdD.nkpi.map((function(e){l.registerForEvent(x(f.scdw.vKdD.et)+"___"+e,n.JJye)}))):(null==f||null===(p=f.scdw)||void 0===p||null===(p=p.vKdD)||void 0===p?void 0:p.kpi.length)>0&&(setTimeout((function(){f.scdw.vKdD.kpi.map((function(e){l.unregisterFromEvent(x(f.scdw.vKdD.et)+"___"+e,n)}))}),b),f.scdw.vKdD.kpi.map((function(e){e===f.aHxF.scdw.nOGI?(l.unregisterFromEvent(w(h.aeLY)+"___"+h.scdw.nOGI,n),l.registerForEvent(x(f.scdw.vKdD.et)+"___"+e,n.isOp)):l.registerForEvent(x(f.scdw.vKdD.et)+"___"+e,n.OMck)})))}else l.unregisterFromEvent(w(h.aeLY)+"___"+h.scdw.nOGI,n),l.registerForEvent(w(f.aeLY)+"___"+f.scdw.nOGI,n);n.ACPj[i]=Date.now()}})),s(this,"Udfh",(function(e,t,i,r){var o=ge.getInstance();w(n.zEag.aeLY)===e&&n.lcOU(i,n.zEag.ieqc)&&n.zEag.scdw.nOGI===t&&n.tMms(n.zEag.scdw.vKdD,r)&&(n.Roxa+=1,n.rcvu=n.oapm(n.Roxa,n.zEag.xanH,n.zEag.jHes),n.rcvu&&(n.zEag.lVrK=i,o.validateForTermination(n.bnsg,n.gFVl)))})),s(this,"vHsm",(function(e,t,i,r){var o=n.BDlb.aHxF,a=w(o.aeLY)===e&&o.scdw.nOGI===t&&n.lcOU(i,o.ieqc)&&n.tMms(o.scdw.vKdD,r);return a="APX_PAGE_OPENED"===t?a&&location.pathname===o.scdw.ynqP:a})),s(this,"lcOU",(function(e,t){var n=Math.ceil(e);return n>t.OKbL&&n<t.znOt})),s(this,"oapm",(function(e,t,i){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(r&&n.BDlb.zPuU&&(e+=n.yWqu),i){case"EQ":return e===t;case"GT":return e>t;case"GTE":return e>=t;case"LT":return e<t;case"LTE":return e<=t;default:return!1}})),s(this,"tMms",(function(e,t){var n=!0;try{var r,o=function(){if(!1===n)return{v:!1};if("object"===i(e[a])){var r,o,s,l=e[a].op,u=e[a].t;if("s"===u)s=e[a].val;else if("l"===u||"f"===u)s=parseFloat(e[a].val);else if("b"===u)switch(e[a].val){case"true":s=!0;break;case"false":s=!1;break;default:s=e[a].val}var d,c=(Array.isArray(t[a])?t[a]:[t[a]]).some((function(e){return"s"===u?e="".concat(e):"l"===u?e=parseInt(e):"f"===u?e=parseFloat(e):"b"===u&&(e=!!e),E(e,s,l)}));if(!(null===(r=e[a])||void 0===r||!r.present)&&(null===(o=e[a])||void 0===o?void 0:o.present))d=!!t.hasOwn(t,a),n=n&&d;n=n&&c}else n=n&&E(t[a],e[a],"EQ")};for(var a in e)if(r=o())return r.v}catch(e){W.error(e),n=!1}return n})),s(this,"wbRt",(function(t,i,r,o,a,s,l,u){var d,c=!1;n.no_KPI_TriggerDetails=e.getController().getFromStorage("apx_nokpi_triggerdetails"),null===n.no_KPI_TriggerDetails||void 0===n.no_KPI_TriggerDetails?n.no_KPI_TriggerDetails=[]:n.no_KPI_TriggerDetails=JSON.parse(n.no_KPI_TriggerDetails);var v,f=0;s&&(f=Date.now()+a);for(var h=0;h<n.no_KPI_TriggerDetails.length;h++)if(n.no_KPI_TriggerDetails[h].id===l){c=!0,d=n.no_KPI_TriggerDetails[h];break}c?d.satisfiedCount+=1:(v={id:l,type:t,time:r,name:i,additionalInfo:o,satisfiedCount:u,timeBased:s,finishTime:f},n.no_KPI_TriggerDetails.push(v)),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(n.no_KPI_TriggerDetails))})),s(this,"SlqH",(function(e){var t,i=new ge,r=v(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(1===(null==o?void 0:o.length)||void 0===(null==o?void 0:o.length))i.unregisterFromEvent(w(null==o?void 0:o.BDlb.aeLY)+"___"+(null==o?void 0:o.BDlb.scdw.nOGI),n.MVgG);else{var a,s=v(o);try{for(s.s();!(a=s.n()).done;){var l,u=a.value;i.unregisterFromEvent(w(null==u?void 0:u.BDlb.aeLY)+"___"+(null==u||null===(l=u.BDlb)||void 0===l?void 0:l.scdw.nOGI),n.MVgG)}}catch(e){s.e(e)}finally{s.f()}}}}catch(e){r.e(e)}finally{r.f()}}))}return a(t,[{key:"_displayCampaign",value:function(e){var t=ge.getInstance();this.rcvu=!0,this.rcvu&&(this.Roxa+=1,this.rcvu=this.oapm(this.Roxa,this.BDlb.xanH,this.BDlb.jHes),this.rcvu&&(this.BDlb.lVrK=e,t.validate(this.bnsg,this.gFVl)))}}]),t}(),H=window.ApxorLogger,Z=a((function t(){var n=this;r(this,t),s(this,"xanH",0),s(this,"ZAtR",0),s(this,"gXpW","SESSION"),s(this,"FxIq",0),s(this,"lnAE",0),s(this,"aLqY",0),s(this,"_enable_repetition_gap",void 0),s(this,"_enable_days_limit",void 0),s(this,"_enable_session_limit",void 0),s(this,"tGaY",void 0),s(this,"HEsa",void 0),s(this,"jzmv",void 0),s(this,"DSLimits",void 0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var i,r,o,a,s,l,u,d;if(n.bnsg=t._id,n.bzQi=t.meta,n.xanH=t.frequency.count,-1===n.xanH&&(n.xanH=9999999),n.aLqY=n.xanH,n.ZAtR=t.frequency.time_interval,n.gXpW=t.frequency.validity,n.DSLimits=t.frequency.DSLimits,n.lnAE=t.frequency.ses_lmt,n._enable_session_limit=null===(i=t.frequency)||void 0===i?void 0:i.enable_session_limit,n._enable_session_limit)n.tGaY=null===(l=t.frequency)||void 0===l?void 0:l.session_count;if(n._dayCount=null!==(r=t.frequency)&&void 0!==r&&r.day_lmt?null===(o=t.frequency)||void 0===o?void 0:o.day_lmt:0,n._enable_repetition_gap=!!t.frequency.enable_repetition_gap&&t.frequency.enable_repetition_gap,n._enable_repetition_gap)n._repetitionValue=null===(u=t.frequency)||void 0===u?void 0:u.repetition_gap.val,n._repetitionUnit=null===(d=t.frequency)||void 0===d?void 0:d.repetition_gap.unit;n._enable_days_limit=!(null===(a=t.frequency)||void 0===a||!a.enable_days_limit)&&(null===(s=t.frequency)||void 0===s?void 0:s.enable_days_limit),n._enable_days_limit&&(n.jzmv=t.frequency.days_limit.days?t.frequency.days_limit.days:1,n.HEsa=t.frequency.days_limit.limit);var c=ge.getInstance().getQeState();if(!m(c)||!m(c[t._id]))return!0;if("SESSION"===n.gXpW){if(n.xanH=parseInt(n.xanH)-parseInt(c[t._id].SESSION),n.xanH<=0)return n.qrSO("Session limit reached"),console.warn("Max count limit reached for session:"+t._id),e.getController().isTestDevice()&&G("Maximum overall limit reached for campaign name ".concat(n.bzQi.name)),!1}else{if("OVERALL"!==n.gXpW)return H.info("Invalid config."),!1;if(n.xanH=parseInt(n.xanH)-parseInt(c[t._id].OVERALL),n.xanH<=0)return n.qrSO("Overall limit reached"),console.warn("Max count limit reached for overall:"+t._id),e.getController().isTestDevice()&&G("Maximum overall limit reached for campaign name ".concat(n.bzQi.name)),!1}}catch(e){return H.error(e),!1}return!0})),s(this,"ePYT",(function(){n.xanH=n.xanH-1})),s(this,"getFrequencyCount",(function(){return n.xanH})),s(this,"KYjW",(function(){"SESSION"===n.gXpW&&(n.xanH=n.aLqY,H.info("Campaign Limit reset"))})),s(this,"hvzT",(function(t){try{if(n.xanH<=0)return"OVERALL"===n.gXpW?(n.qrSO("Overall limit reached"),e.getController().isTestDevice()&&G("Maximum overall limit reached for campaign name ".concat(n.bzQi.name))):"SESSION"===n.gXpW&&(e.getController().isTestDevice()&&G("Maximum session limit reached for campaign name ".concat(n.bzQi.name)),n.qrSO("Session limit reached")),!1;var i=ge.getInstance().getQeState();if(!m(i)||!m(i[t]))return!0;if(n._enable_session_limit)if(parseInt(n.tGaY)-parseInt(i[t].SESSION)<=0)return n.qrSO("Session limit reached"),e.getController().isTestDevice()&&G("Maximum session limit reached for campaign name ".concat(n.bzQi.name)),!1;if(n._enable_repetition_gap)if("session"!=n._repetitionUnit){var r=e.getController().getFromStorage("apx-last-shown-times");if(r=JSON.parse(r),!_(z(r,n.bnsg))){var o=z(r,n.bnsg)[n.bnsg];if(Date.now()-o<F(n._repetitionUnit,n._repetitionValue))return n.qrSO("Config does not satisfy time difference "),e.getController().isTestDevice()&&G("Config does not satisfy time difference for campaign name ".concat(n.bzQi.name)),!1}}else{var a=e.getController().getFromStorage("apx-last-shown-session");if(a=JSON.parse(a),!_(z(a,n.bnsg))){var s=z(a,n.bnsg)[n.bnsg];if(e.getController().getFromStorage("apx_retained_session")-s<parseInt(n._repetitionValue))return n.qrSO("Config does not satisfy session difference "),e.getController().isTestDevice()&&G("Config does not satisfy session difference for campaign name ".concat(n.bzQi.name)),!1}}if(0!==n.lnAE&&n.DSLimits)if(parseInt(n.lnAE)-parseInt(i[t].SESSION)<=0)return n.qrSO("Session limit reached"),e.getController().isTestDevice()&&G("Session limit reached for campaign name ".concat(n.bzQi.name)),!1;if(0!==n._dayCount){var l,u=O();if(parseInt(n._dayCount)-parseInt((null===(l=i[t])||void 0===l?void 0:l.DATES[u])||0)<=0)return n.qrSO("Day limit reached"),e.getController().isTestDevice()&&G("Day limit reached for campaign name ".concat(n.bzQi.name)),!1}if(n.jzmv>0&&n._enable_days_limit){var d=n.jzmv,c=0;if(function(e){for(var t=[],n=new Date,i=0;i<e;i++){var r=new Date(n);r.setDate(n.getDate()-i);var o=String(r.getDate()),a=String(r.getMonth()),s=r.getFullYear();t.push(o+"/"+a+"/"+s)}return t}(d).forEach((function(e){var n;c+=parseInt((null===(n=i[t])||void 0===n?void 0:n.DATES[e])||0)})),c>n.HEsa)return H.info("Shown Limit Crossed"),e.getController().isTestDevice()&&G("Days limit reached for campaign name ".concat(n.bzQi.name)),!1}}catch(e){n.qrSO("Error validating the frequency: ".concat(e)),H.error("Error validating the frequency:"+e)}return!0})),s(this,"qrSO",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.bzQi.type?"survey":"campaign",apx_nudge_id:n.bnsg,apx_nudge_name:n.bzQi.name,apx_variant_code:n.bzQi.isExperiment||n.bzQi.only_context?null===(i=n.bzQi.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),M=window.ApxorLogger,X=a((function e(){var t=this;r(this,e),s(this,"LSvD",[]),s(this,"qjms",0),s(this,"Lkgb",!1),s(this,"Muew",void 0),s(this,"initialize",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unordered",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];t.bnsg=n,t.gFVl=i,t.wbcE=o,t.eNrW=r,t.across_sessions=s;var l=[];t.qjms=e.length;try{if(null!=l)return r=null==e?void 0:e.sequence_type,l=t.QLlf(e,t.qjms),"unordered"!==a&&0!==t.gFVl||t.DyGP(),t.LSvD}catch(e){return M.error(e),!1}})),s(this,"QLlf",(function(e,n){for(var i=0;i<n;i++){t.Muew=new j;try{t.Muew.initialize(e[i],t.bnsg,t.gFVl,t.eNrW,t.jhcC,t.across_sessions,"",-1,!1)&&(t.LSvD.push(t.Muew),t.LSvD.sequence_type=t.eNrW)}catch(e){M.error(e)}}return t.LSvD})),s(this,"DyGP",(function(){if("ordered"===t.eNrW||"strictly_ordered"===t.eNrW)t.LSvD[0].DyGP(0);else{var e,n=v(t.LSvD);try{for(n.s();!(e=n.n()).done;){e.value.DyGP()}}catch(e){n.e(e)}finally{n.f()}}})),s(this,"SlqH",(function(e){t.Muew.SlqH(e)}))})),$=a((function e(){var t=this;r(this,e),s(this,"nOGI",""),s(this,"ddJm",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;t.nOGI=e.meta.name,t.ddJm=e.meta.type,t._only_context=e.meta.only_context,t._attr=(null===(n=e.meta)||void 0===n?void 0:n.attr)||{},t._isExperiment=null===(i=e.meta)||void 0===i?void 0:i.isExperiment}catch(e){return window.ApxorLogger.error(e),!1}return!0}))})),ee=window.ApxorLogger,te=a((function t(){var n=this;r(this,t),s(this,"yDfG",[]),s(this,"_ret_day",{}),s(this,"wKSq",{}),s(this,"kfKG",!1),s(this,"tGhs",!1),s(this,"retainedDaysValidated",!0),s(this,"retainedSessionValidated",!0),s(this,"eventDoneInLT",!1),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{n.yDfG=e.overall_cfg.events,n._ret_day=e.overall_cfg.ret_day,n.wKSq=e.overall_cfg.session,n.kfKG=e.overall_cfg.toggleRetDay,n.tGhs=e.overall_cfg.toggleSession}catch(e){return ee.error(e),!1}return!0})),s(this,"validate",(function(){var t=parseInt(e.getController().getFromStorage("apx_retained_days")),i=parseInt(e.getController().getFromStorage("apx_retained_session"));if(n.kfKG&&!isNaN(t)&&!(t>=n._ret_day.from&&t<=n._ret_day.to))return n.retainedDaysValidated=!1,!1;if(n.tGhs&&!isNaN(i)&&!(i>=n.wKSq.from&&i<=n.wKSq.to))return n.retainedSessionValidated=!1,!1;try{for(var r=e.getController().getFromStorage("_apx_lt_count"),o=e.getSiteId(),a=JSON.parse((new TextDecoder).decode(function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return t}(y(o,r)))),s=0;s<n.yDfG.length;s++){if(a[n.yDfG[s].name.replace("'","").replace("’","")])return n.eventDoneInLT=!0,!1}}catch(e){ee.error("Failed to validate the lt count:"+e)}return!0}))})),ne=window.ApxorLogger,ie=a((function e(){var t=this;r(this,e),s(this,"uJxy",[]),s(this,"exhh",[]),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.uJxy=e.attributes.user,t.exhh=e.attributes.session,!Array.isArray(t.uJxy)||!Array.isArray(t.exhh))return ne.error("No attributes"),!1}catch(e){return ne.error(e),!1}return!0})),s(this,"validate",(function(e,n){return t.soiz(e,t.uJxy)&&t.soiz(n,t.exhh)})),s(this,"soiz",(function(e,t){var n=t.length,i=!0;try{for(var r,o=function(){var n=t[a];if(!e[n.name]||!1===i)return{v:!1};var r=n.operator,o=n.type,s=n.value.map((function(e){return"s"===o?e:"l"===o?parseInt(e):"f"===o?parseFloat(e):void 0})),l=(Array.isArray(e[n.name])?e[n.name]:[e[n.name]]).some((function(e){return s.some((function(t){return E(e,t,r)}))}));i=i&&l},a=0;a<n;a++)if(r=o())return r.v}catch(e){ne.error(e),i=!1}return i}))})),re=a((function t(){var n=this;r(this,t),s(this,"DoVi",e.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"clFx",1),s(this,"parse",(function(e){try{var t,i,r;if(n.ddJm=null===(t=e.terminate_info.time_based)||void 0===t?void 0:t.type,n._duration_seconds=null===(i=e.terminate_info)||void 0===i?void 0:i.time_based.duration_seconds,n.clFx=null===(r=e.terminate_info.time_based)||void 0===r?void 0:r.days,n.IMSc(e._id))return n.DoVi.persistTerminationInfoLocally(e._id),!1}catch(e){return!1}return!0})),s(this,"IMSc",(function(e){var t,i=JSON.parse(n.DoVi.getFromStorage("apx_termination_ID"));if(!i[e]||null===(t=i[e])||void 0===t||!t.startDate)return!1;var r,o=new Date(i[e].startDate),a=new Date((r=new Date).getMonth()+"/"+r.getDate()+"/"+r.getFullYear()),s=parseInt((a-o)/864e5,10),l=function(){var e=new Date;return{hours:e.getHours(),mins:e.getMinutes()}}(),u=i[e].Islm;return s===n.clFx&&l.hours>=u.hours||s>n.clFx||i[e].goalAcheived}))})),oe=a((function e(){var t=this;r(this,e),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"igFd",new ie),s(this,"nDkI",new re),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i,r;if(t.enable_time_based=null==e||null===(n=e.terminate_info)||void 0===n?void 0:n.enable_time_based,t.enable_time_based&&!t.nDkI.parse(e))return!1;if(t.enable_goal_events=null==e||null===(i=e.terminate_info)||void 0===i?void 0:i.enable_goal_events,t.enable_attributes=null==e||null===(r=e.terminate_info)||void 0===r?void 0:r.enable_attributes,t.enable_attributes&&!t.igFd.parse(e.terminate_info))return!1}catch(e){return window.ApxorLogger.error(e),!1}return!0})),s(this,"validate",(function(e,n){return t.igFd.validate(e,n)}))})),ae=window.ApxorLogger,se=a((function t(){var n=this;r(this,t),s(this,"fJCw",-1),s(this,"GDny",-1),s(this,"Islm",-1),s(this,"loUE",-1),s(this,"JBQy",-1),s(this,"XHWy",-1),s(this,"_is_user_timezone",void 0),s(this,"QUaC",!1),s(this,"Oxyz",!1),s(this,"_nudge_expired",!1),s(this,"_not_yet_active",!1),s(this,"_not_in_specified_time",!1),s(this,"_days_in_week",[]),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,i;if(n.bnsg=e._id,n.bzQi=e.meta,isNaN(Date.parse(e.validity.start_date))||isNaN(Date.parse(e.validity.end_date))||!Array.isArray(e.validity.days_in_week))return ae.error("Not valid dates"),!1;if(n.fJCw=Date.parse(e.validity.start_date),n.GDny=Date.parse(e.validity.end_date),n._days_in_week=null!==(t=e.validity)&&void 0!==t&&t.days_in_week?null===(i=e.validity)||void 0===i?void 0:i.days_in_week:[1,2,3,4,5,6,7],n._is_user_timezone=!e.is_user_timezone||e.is_user_timezone,m(e.at_specific_time)&&(n.QUaC=e.at_specific_time,n.QUaC&&m(e.time_limits)&&(n.Islm=e.time_limits.start_time,n.loUE=e.time_limits.end_time,D(n.Islm)||D(n.loUE))))return ae.error("Not valid times"),!1;if(m(e.time_excludes_in_day)&&(n.Oxyz=e.time_excludes_in_day,n.Oxyz&&m(e.time_excludes)&&(n.JBQy=e.time_excludes.start_time,n.XHWy=e.time_excludes.end_time,D(n.JBQy)||D(n.XHWy))))return ae.error("Not valid exclude times"),!1}catch(e){return ae.error(e),!1}return!0})),s(this,"validate",(function(){var t=Date.now(),i=(new Date).getDay()+1,r=function(e){var t=new Date,n=t.getHours(),i=t.getMinutes(),r=(n=(n<10?"0":"")+n)+":"+(i=(i<10?"0":"")+i);if(!e){var o=t.getUTCHours(),a=t.getUTCMinutes();r=(o=(o<10?"0":"")+o)+":"+(a=(a<10?"0":"")+a)}return r}(n._is_user_timezone);if(t>n.fJCw&&t<n.GDny&&n._days_in_week.includes(i))return!n.QUaC||S(r,n.Islm,"GT")&&S(r,n.loUE,"LT")||(n._not_in_specified_time=!0),n.Oxyz&&function(e,t,n){var i=l(e.split(":").map(Number),2),r=i[0],o=i[1],a=l(t.split(":").map(Number),2),s=a[0],u=a[1],d=l(n.split(":").map(Number),2),c=60*d[0]+d[1];return c>=60*r+o&&c<=60*s+u}(n.JBQy,n.XHWy,r)?(n.qrSO("Exclude Time limits check failed"),e.getController().isTestDevice()&&G("Exclude Time Limits check failed for campaign name ".concat(n.bzQi.name)),!1):!n.QUaC||S(r,n.Islm,"GT")&&S(r,n.loUE,"LT");if(t<n.fJCw)n._not_yet_active=!0;else if(t>n.GDny)n._nudge_expired=!0;else if(!n._days_in_week.includes(i))return n.qrSO("Current week day did not match with Configured Week day"),e.getController().isTestDevice()&&G("Current week day did not match with Configured Week day for campaign name ".concat(n.bzQi.name)),!1;return!1})),s(this,"qrSO",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.bzQi.type?"survey":"campaign",apx_nudge_id:n.bnsg,apx_nudge_name:n.bzQi.name,apx_variant_code:n.bzQi.isExperiment||n.bzQi.only_context?null===(i=n.bzQi.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),le=a((function e(){var t=this;r(this,e),s(this,"tXzn",""),s(this,"PLSK",""),s(this,"RxWG",""),s(this,"MMeV",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.tXzn=null==e?void 0:e.screen_binding,!t.tXzn||(t.PLSK=null==e?void 0:e.binding.url,t.RxWG=null==e?void 0:e.binding.var,t.MMeV=null==e?void 0:e.binding.operator,!0)}catch(e){return window.ApxorLogger.error(e),!1}})),s(this,"validate",(function(){var e=t.PLSK,n=t.RxWG,i=t.MMeV,r=window.location.href;return!t.tXzn||("EQ"===i?e.includes(n)?!!L(r,e,n,!1):r===e:"SW"===i?e.includes(n)?!!L(r,e,n,!0):!!r.startsWith(e):void 0)}))})),ue=window.ApxorLogger,de=a((function t(){var i=this;r(this,t),s(this,"Udhu",[]),s(this,"VZlA",[]),s(this,"bnsg",""),s(this,"bzQi",new $),s(this,"zBTZ",new N),s(this,"gXpW",new se),s(this,"qZjs",new Z),s(this,"OiPN",new te),s(this,"EkPJ",new oe),s(this,"gQWT",new le),s(this,"eNrW",!1),s(this,"jhcC",[]),s(this,"_variant_code",""),s(this,"Lkgb",!1),s(this,"groupCombineOperator","OR"),s(this,"WthB",!1),s(this,"wdZH",!1),s(this,"mTfI",void 0),s(this,"timeForKPI",void 0),s(this,"kpiIndex",0),s(this,"qZOS",void 0),s(this,"_across_sessions",!1),s(this,"rfWN",void 0),s(this,"Iymt",!1),s(this,"VUms",void 0),s(this,"KxFw",void 0),s(this,"Amih",void 0),s(this,"oyLd",void 0),s(this,"Amiw",void 0),s(this,"CRdV",void 0),s(this,"DooL",void 0),s(this,"TPfd",void 0),s(this,"izmx",void 0),s(this,"LBSx",void 0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,n;if(!m(e._id))return ue.error("No Id"),!1;if(!m(e.enabled)||!e.enabled)return ue.error("Not enabled"),!1;if(!(i.bzQi.parse(e)&&i.gXpW.parse(e)&&i.qZjs.parse(e)&&i.zBTZ.parse(e)&&i.OiPN.parse(e)&&i.EkPJ.parse(e)&&i.gQWT.parse(e)))return!1;if(i._variant_code=i.bzQi._isExperiment||i.bzQi._only_context?null===(t=i.bzQi._attr)||void 0===t?void 0:t.apx_variant_code:"TG",i._across_sessions=!(null==e||!e.across_sessions)&&(null==e?void 0:e.across_sessions),i.enable_conditions=null==e?void 0:e.enable_conditions,i.enable_conditions_v2=null==e?void 0:e.enable_conditions_v2,!m(e.conditions)||!Array.isArray(e.conditions))return ue.error("No valid conditions",e.conditions),!1;i.bnsg=e._id,i.eNrW=!!m(e.sequence_enabled)&&e.sequence_enabled,m(e.conditions_v2)&&i.enable_conditions_v2&&(i.eNrW=null==e?void 0:e.sequence_type),!0===i.eNrW&&e.conditions.sort((function(e,t){return e.sequence<t.sequence})),m(e.conditions_v2)&&i.enable_conditions_v2?(n=e.conditions_v2,i.Iymt=!0):n=e.conditions,i.rfWN=n;var r=n.length,o=null==e?void 0:e.no_context_enabled;if(0===r&&o&&setTimeout((function(){i.ktae()}),10),i.LBSx=r,i.RZbo(n,r),i.rRoO(),i.EkPJ.enable_goal_events)for(var a=e.terminate_info.goal_events.events,s=a.length,l=0;l<s;l++){var u=new j;u.initialize(a[l],i.bnsg,l,!0,[],i._across_sessions,"termination")&&i.VZlA.push(u)}return i.Udhu.length>0}catch(e){return ue.error(e),!1}})),s(this,"RZbo",(function(e,t){for(var n=function(){i.jhcC=[];var t=e[r];if("group"===(null!=t&&t.condition_type?null==t?void 0:t.condition_type:"single")){var n=t.conditions_v2;i.groupCombineOperator=t.combine_operator;var o=null==t?void 0:t.sequence_type;i.izmx=new X;var a=i.izmx.initialize(n,i.bnsg,r,o,i.jhcC,i.eNrW,i._across_sessions);i.Udhu.push(a)}else{if("didn't"===t.type){var s,l={trigger_key:t.trigger.details.name,no_kpi_array:null==t||null===(s=t.details)||void 0===s||null===(s=s.additional_info)||void 0===s?void 0:s.nkpi,condition_id:null==t?void 0:t._id,time_bounds:t.time_bounds.upper};i.jhcC=[].concat(u(i.jhcC),[l])}if(i.izmx=new j,i.izmx.initialize(t,i.bnsg,r,i.eNrW,i.jhcC,i._across_sessions)){i.Udhu.push(i.izmx);var d=(null==t?void 0:t.timeout)/(null==t?void 0:t.findinterval),c=(null==t?void 0:t.frameid)||"",v=null==t?void 0:t.url;window.location.href===v&&"view_visibility"===t.event_type&&!0===I(t.view_id,c,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,d)&&i.ktae(!0),window.addEventListener("navigate",(function(e){var n=null==t?void 0:t.url;window.location.href===n&&"view_visibility"===t.event_type&&!0===I(t.view_id,c,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,d)&&i.ktae(!0)}))}}},r=0;r<t;r++)n()})),s(this,"rRoO",(function(){if(i._across_sessions&&"ordered"===i.eNrW){var t=!1,n=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(n=JSON.parse(n))&&null!=n)for(var r=function(e){var r,o,a;if(null!==(r=i.Udhu[e])&&void 0!==r&&null!==(r=r.BDlb)&&void 0!==r&&r._timeEnabled&&void 0===i.Udhu[e].length){if("didn't"===i.Udhu[e].BDlb.ddJm){var s=i.Udhu[e].BDlb._id,l=i.WzDI(s,n);if(l)if(Date.now()>l.finishTime)i.Udhu[e].rcvu=!0,i.Udhu[e].Roxa=l.satisfiedCount,t=!0;else{var u=l.finishTime-Date.now(),d=i.Udhu[e].BDlb._eventCategory?i.Udhu[e].BDlb._eventCategory:"specific_event",c=new ge;"specific_event"===d?(c.registerForEvent(w(i.Udhu[e].BDlb.aeLY)+"___"+i.Udhu[e].BDlb.scdw.nOGI,i.JJye),i.Amiw=i.Udhu[e]):i.RQgw(d),setTimeout((function(){e!==i.Udhu.length-1||i.WthB||(i.Udhu[e].rcvu=!0,i.Udhu[e].Roxa=l.satisfiedCount,t=!0,"specific_event"===d?c.unregisterFromEvent(w(i.Udhu[e].BDlb.aeLY)+"___"+i.Udhu[e].BDlb.scdw.nOGI,i.JJye):i.fpcf(i.Udhu[e]),i.ktae())}),u)}}if("did"===i.Udhu[e].BDlb.ddJm){var v=i.Udhu[e].BDlb._id,f=i.WzDI(v,n);if(f)if(null==f.satisfiedCount){if(Date.now()<f.finishTime){i.Amih=f,i.KxFw=e;var h=f.finishTime-Date.now(),g=i.Udhu[e].BDlb._eventCategory?i.Udhu[e].BDlb._eventCategory:"specific_event",_=new ge;"specific_event"===g?_.registerForEvent(w(i.Udhu[e].BDlb.aeLY)+"___"+i.Udhu[e].BDlb.scdw.nOGI,i.selm):i.RQgw(g),setTimeout((function(){"specific_event"===g?_.unregisterFromEvent(w(i.Udhu[e].BDlb.aeLY)+"___"+i.Udhu[e].BDlb.scdw.nOGI,i.selm):i.fpcf(i.Udhu[e])}),h)}}else i.Udhu[e].Roxa=f.satisfiedCount,i.Udhu[e].rcvu=!0}}else t=i.dLfC(e,n);t&&(null===(o=i.Udhu[e])||void 0===o||null===(o=o.BDlb)||void 0===o||!o._timeEnabled||(null===(a=i.Udhu[e])||void 0===a?void 0:a.length)>1)?e===i.Udhu.length-1&&i.ktae():t||void 0===!i.Udhu[e].length&&i.Udhu[e].DyGP()},o=0;o<i.Udhu.length;o++)r(o)}else if(i._across_sessions&&"unordered"===i.eNrW){var a=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(a=JSON.parse(a))&&null!=a)for(var s=0;s<i.Udhu.length;s++)i.dLfC(s,a)}})),s(this,"dLfC",(function(e,t){if(void 0===i.Udhu[e].length||1===i.Udhu[e].length){var n=i.Udhu[e].BDlb._id,r=!1,o=i.WzDI(n,t);if(o)i.VUms=o,r=(new j).oapm(o.satisfiedCount,i.Udhu[e].BDlb.xanH,i.Udhu[e].BDlb.jHes),o&&(r?i.Udhu[e].rcvu=!0:i.Udhu[e].Roxa=o.satisfiedCount);else i.Udhu[e].DyGP();return r}if(i.Udhu[e].length>=1){var a,s,l;if("ordered"===(s=null===(a=i.Udhu[e])||void 0===a?void 0:a.sequence_type)||"strictly_ordered"===s){for(var u=0;u<i.Udhu[e].length;u++){var d=i.Udhu[e][u],c=d.BDlb._id;l=!1;var v=i.WzDI(c,t);if(v){if(l=(new j).oapm(v.satisfiedCount,d.BDlb.xanH,d.BDlb.jHes),v)if(l){i.Udhu[e][u].rcvu=!0;var f=u+1,h=i.Udhu[e][u+1];void 0===h&&m(i.Udhu[e+1])&&(i.Udhu[e+1].DyGP(),l=!0),null!=h&&i.Udhu[e][u+1].DyGP(f)}else i.Udhu[e][u].Roxa=v.satisfiedCount}else(m(i.Udhu[e][u-1])&&!0===i.Udhu[e][u].rcvu||g(i.Udhu[e][u-1]))&&i.Udhu[e][u].DyGP()}return l}for(var _,p=0;p<i.Udhu[e].length;p++){var b=i.Udhu[e][0].BDlb.DViF;_="OR"!==b;var y=i.Udhu[e][p],D=y.BDlb._id;l=!1;var w=i.WzDI(D,t);if(w)l=(new j).oapm(w.satisfiedCount,y.BDlb.xanH,y.BDlb.jHes),w&&(l?i.Udhu[e][p].rcvu=!0:i.Udhu[e][p].Roxa=w.satisfiedCount);else y.DyGP();_="AND"===b?_&&l:_||l}return _}})),s(this,"WzDI",(function(e,t){return t.find((function(t){return t.id===e}))})),s(this,"blJQ",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=ge.getInstance();if(!(t<0)){var o=i.Udhu[t],a="unordered";if((null==o?void 0:o.length)>1&&(a=null==o?void 0:o.sequence_type),!0===i.eNrW||"ordered"===i.eNrW||"strictly_ordered"===i.eNrW||"ordered"===a||"strictly_ordered"===a){i.kpiIndex=t+1;var s=i.Udhu[t];if((null==s?void 0:s.length)>0){if(m(s))if("unordered"===i.eNrW&&"ordered"===a){var l=o[n-1];if(m(l))if(void 0===l.length||1==l.length){if(!l.rcvu)return}else if(l.length>1&&!i.LoGY(l))return;var u,d=o[n+1];if(m(d)){if(d.DyGP(n+1),"strictly_ordered"===i.eNrW){i._currentEventname=s[n].BDlb.scdw.nOGI;var c=e.getController();c.registerForEvent("APP_EVENT",i.picg),c.registerForEvent("CLIENT_EVENT",i.picg)}}else if("strictly_ordered"===a)1!=i.Lkgb&&i.ktae();else(null===(u=o[n])||void 0===u?void 0:u.length)>0?i.LoGY(o)&&i.ktae():i.ktae()}else{var f,h=i.Udhu[t-1];if(m(h))if(void 0===h.length||1==h.length){if(!h.rcvu)return}else if(h.length>1&&!i.LoGY(h))return;if(void 0===s.length||1===s.length?f=i.Udhu[t+1]:s.length>1&&("ordered"===a||"strictly_ordered"===a?f=n===s.length-1?i.Udhu[t+1]:i.Udhu[t][n+1]:i.LoGY(s)&&(f=i.Udhu[t+1])),m(f)){if(void 0===f.length||1===f.length)f.DyGP(n+1);else if(i.LoGY(s))if(void 0===f.length)f.DyGP();else if(f.length>1)if("unordered"===f.sequence_type)for(var g=0;g<f.length;g++)f[g].DyGP(g);else"ordered"!==f.sequence_type&&"strictly_ordered"!==f.sequence_type||f[0].DyGP(0);if("strictly_ordered"===i.eNrW){i._currentEventname=s[n].BDlb.scdw.nOGI;var _=e.getController();_.registerForEvent("APP_EVENT",i.picg),_.registerForEvent("CLIENT_EVENT",i.picg)}}else"strictly_ordered"===i.eNrW?1!=i.Lkgb&&i.ktae():i.LoGY(s)&&i.ktae()}}else if(m(s)&&s.rcvu){s.ACPj[s.BDlb.scdw.nOGI]=Date.now();var p=i.Udhu[t-1];if(m(p))if(void 0===p.length||1==p.length){if(!p.rcvu)return}else if(p.length>1&&!i.LoGY(p))return;var b=i.Udhu[t+1];if(m(b)){var y,D;if(null!=b&&null!==(y=b.BDlb)&&void 0!==y&&y._timeEnabled){if("session"!=(null===(D=b.BDlb)||void 0===D?void 0:D._time.unit)){var x,E,B=F(b.BDlb._time.unit,b.BDlb._time.value);if("didn't"==(null===(x=b.BDlb)||void 0===x?void 0:x.ddJm)){if(i.DooL=setTimeout((function(){if(i.WthB)i.WthB=!1;else{if(i.WthB=!1,b.rcvu=!0,b.rcvu){b.Roxa+=1;var e=new j;if(b.rcvu=e.oapm(b.Roxa,b.BDlb.xanH,b.BDlb.jHes),b.rcvu){b.BDlb.lVrK=Date.now();var n=t+1,o=i.Udhu[n+1];m(o)?o.DyGP():i.ktae()}}r.unregisterFromEvent(w(b.BDlb.aeLY)+"___"+b.BDlb.scdw.nOGI,i.JJye),b.NgfT=!1}}),B),i._across_sessions){var O=F(b.BDlb._time.unit,b.BDlb._time.value),S=b.BDlb._timeEnabled,L=b.BDlb._id,I=new j;I.wbRt(b.BDlb.ddJm,b.BDlb.scdw.nOGI,Date.now(),b.BDlb.scdw.vKdD,O,S,L)}"specific_event"===b.BDlb._eventCategory?(r.registerForEvent(w(b.BDlb.aeLY)+"___"+b.BDlb.scdw.nOGI,i.JJye),i.Amiw=b):i.RQgw(b)}else if("did"==(null===(E=b.BDlb)||void 0===E?void 0:E.ddJm)&&(i.WthB=!1,i.qZOS=b,m(i.Udhu[t+2])&&i._across_sessions&&(i.oyLd=i.Udhu[t+2]),i.TPfd=setTimeout((function(){i.WthB?i.WthB=!1:(i.WthB=!1,r.unregisterFromEvent(w(b.BDlb.aeLY)+"___"+b.BDlb.scdw.nOGI,i.OMck))}),B),i.mTfI=s,i.timeForKPI=B,r.registerForEvent(w(b.BDlb.aeLY)+"___"+b.BDlb.scdw.nOGI,i.OMck),i.CRdV=b,i._across_sessions)){var T=F(b.BDlb._time.unit,b.BDlb._time.value),C=b.BDlb._timeEnabled,U=b.BDlb._id,A=new j;A.wbRt(b.BDlb.ddJm,b.BDlb.scdw.nOGI,Date.now(),b.BDlb.scdw.vKdD,T,C,U)}}}else if(b.length>0)if("ordered"===b.sequence_type||"strictly_ordered"===b.sequence_type)b[0].DyGP(n+1);else{var z,P=v(b);try{for(P.s();!(z=P.n()).done;){var G=z.value;G.DyGP()}}catch(e){P.e(e)}finally{P.f()}}else b.DyGP();if("strictly_ordered"===i.eNrW){i._currentEventname=s.BDlb.scdw.nOGI;var J=e.getController();J.registerForEvent("APP_EVENT",i.picg),J.registerForEvent("CLIENT_EVENT",i.picg)}}else"strictly_ordered"===i.eNrW?1!=i.Lkgb&&i.ktae():i.ktae()}}else i.JgFf(),i.ktae()}})),s(this,"picg",(function(e){e&&e.name!=i._currentEventname&&(i.Lkgb=!0)})),s(this,"RQgw",(function(e){var t=new ge,n=e.BDlb._eventCategory;"apxor_event"===n?t.registerForEvent("apxor_event",i.JJye):"customer_event"===n?t.registerForEvent("customer_event",i.JJye):"any_event"===n?t.registerForEvent("any_event",i.JJye):"campaign_event"===n?t.registerForEvent("campaign_event",i.JJye):"survey_event"===n&&t.registerForEvent("survey_event",i.JJye)})),s(this,"fpcf",(function(e){var t=new ge,n=e.BDlb._eventCategory;"apxor_event"===n?t.unregisterFromEvent("apxor_event",i.JJye):"customer_event"===n?t.unregisterFromEvent("customer_event",i.JJye):"any_event"===n?t.unregisterFromEvent("any_event",i.JJye):"campaign_event"===n?t.unregisterFromEvent("campaign_event",i.JJye):"survey_event"===n&&t.unregisterFromEvent("survey_event",i.JJye)})),s(this,"JJye",(function(){var e,t;i.DooL&&(i.WthB=!1,clearTimeout(i.DooL));var n=new ge;i.WthB=!0,i._across_sessions&&null!==localStorage.getItem("apx_nokpi_triggerdetails")&&localStorage.removeItem("apx_nokpi_triggerdetails"),n.unregisterFromEvent(w(null===(e=i.Amiw)||void 0===e||null===(e=e.BDlb)||void 0===e?void 0:e.aeLY)+"___"+(null===(t=i.Amiw)||void 0===t||null===(t=t.BDlb)||void 0===t||null===(t=t.scdw)||void 0===t?void 0:t.nOGI),i.JJye)})),s(this,"OMck",(function(){var t,n,r,o=new ge;i.WthB=!0,i.TPfd&&clearTimeout(i.TPfd);var a=new j;if(i.qZOS.Roxa+=1,i.qZOS.rcvu=a.oapm(i.qZOS.Roxa,i.qZOS.BDlb.xanH,i.qZOS.BDlb.jHes),o.unregisterFromEvent(w(null===(t=i.CRdV)||void 0===t||null===(t=t.BDlb)||void 0===t?void 0:t.aeLY)+"___"+(null===(n=i.CRdV)||void 0===n||null===(n=n.BDlb)||void 0===n?void 0:n.scdw.nOGI),i.OMck),i._across_sessions&&null!==(r=i.oyLd)&&void 0!==r&&r.BDlb._timeBased){var s,l,u,d=e.getController().getFromStorage("apx_nokpi_triggerdetails");d=null==d?[]:JSON.parse(d);for(var c=0;c<d.length;c++)if(i.no_KPI_TriggerDetails[c].id===i.oyLd.BDlb._id){s=!0,l=d[c];break}if(s)l.satisfiedCount+=1;else{var v=i.qZOS.BDlb._id,f=i.qZOS.BDlb.ddJm,h=i.qZOS.BDlb.scdw.nOGI,g=i.qZOS.BDlb.scdw.vKdD;u={id:v,type:f,time:Date.now(),name:h,additionalInfo:g,satisfiedCount:i.qZOS.BDlb._timeEnabled,timeBased:i.qZOS.BDlb._timeEnabled},i.no_KPI_TriggerDetails.push(u)}}if(i.qZOS.rcvu){var _=i.Udhu[i.kpiIndex+1];m(_)?_.DyGP():i.ktae()}})),s(this,"selm",(function(){if(i.KxFw===i.Udhu.length-1){i.wdZH=!0;i.Udhu[i.KxFw]&&(i.Udhu[i.KxFw].Roxa=i.Amih.satisfiedCount,i.Udhu[i.KxFw].rcvu=!0,i.ktae())}else{var t,n,r=e.getController().getFromStorage("apx_nokpi_triggerdetails");r=null==r?[]:JSON.parse(r);for(var o=0;o<r.length;o++)if(r[o].id===i.KxFw){n=!0,t=r[o];break}if(n&&(t.satisfiedCount=1),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(r)),i.Udhu[i.KxFw].Roxa=i.Amih.satisfiedCount,i.Udhu[i.KxFw].rcvu=!0,i.Udhu[i.KxFw+1].BDlb._timeEnabled){var a=F(i.Udhu[i.KxFw+1].BDlb._time.unit,i.Udhu[i.KxFw+1].BDlb._time.value),s=i.Udhu[i.KxFw+1].BDlb._timeEnabled,l=i.Udhu[i.KxFw+1].BDlb._id,u=i.Udhu[i.KxFw+1].Roxa,d=i.Udhu[i.KxFw+1].BDlb.scdw.nOGI,c=i.Udhu[i.KxFw+1].scdw.vKdD;(new j).wbRt(i.BDlb.ddJm,d,Date.now(),c,a,s,l,u)}}})),s(this,"JgFf",(function(){if(i._across_sessions&&i.Iymt){var t,n,r,o="single",a=!1,s=e.getController().getFromStorage("apx_nokpi_triggerdetails");if((s=JSON.parse(s)).length>0){var l,u=v(s);try{var d=function(){var e=l.value,s=e.id,u=e.satisfiedCount;if(t=i.Udhu.find((function(e,t){if(1===(null==e?void 0:e.length)||void 0===(null==e?void 0:e.length)){if(e.BDlb._id===s)return o="single",n=t,!0}else if(e.length>0){var i=e.findIndex((function(e){return e.BDlb._id===s}));if(-1!==i)return n=t,r=i,o="group",!0}return!1})),"single"===o&&t){var d=new j;a=d.oapm(u,t.BDlb.xanH,t.BDlb.jHes);var c=i.Udhu.findIndex((function(e){var t;return(null==e||null===(t=e.BDlb)||void 0===t?void 0:t._id)===s}));void 0===c&&(c=n),a&&(i.Udhu[c].rcvu=!0)}else if("group"===o&&t){var v=new j;(a=v.oapm(u,t[r].BDlb.xanH,t[r].BDlb.jHes))&&(i.Udhu[n][r].rcvu=!0)}};for(u.s();!(l=u.n()).done;)d()}catch(e){u.e(e)}finally{u.f()}}}})),s(this,"dooa",(function(e){e<0||i.ZvBA()})),s(this,"ktae",(function(){var t,r,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=e.getController().getUserAttributes(),s=e.getController().getSessionAttributes();if(null!==(t=window.ApxorRTM)&&void 0!==t&&t.isBadgePresent&&null!==(r=window.ApxorRTM)&&void 0!==r&&r.badgesLists.includes(i.bnsg)&&e.getController().isBadgeTriggerSatisfied(i.bnsg)||null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===i.bzQi.ddJm?"survey":"campaign",apx_nudge_id:i.bnsg,apx_nudge_name:i.bzQi.nOGI,apx_variant_code:i.bzQi._isExperiment||i.bzQi._only_context?i.bzQi._attr.apx_variant_code:"TG"}),!(i.gXpW.validate()&&i.zBTZ.validate(a,s)&&i.OiPN.validate()&&i.gQWT.validate())){i.bzQi.ddJm;return i.OiPN.retainedDaysValidated?i.OiPN.retainedSessionValidated?i.OiPN.eventDoneInLT?void i.qrSO("Event done in life time"):i.zBTZ.userAttributesValidated?i.zBTZ.sessionAttributeValidated?i.gXpW._not_in_specified_time?void i.qrSO("Time limits check failed"):i.gXpW._not_yet_active?void i.qrSO("not in the scheduled time"):i.gXpW._nudge_expired?void i.qrSO("nudge expired"):void 0:void i.qrSO("Session property filter not met"):void i.qrSO("User property filter not met"):void i.qrSO("User session criteria not met"):void i.qrSO("Retained day criteria not met")}var l=i.Udhu.length,u=l<1,d="";0===l&&(u=!0);for(var c=0;c<l;c++){var f=void 0,h=i.Udhu[c];if(h.length>1){var g=h[0].BDlb.DViF;f="AND"===g;for(var _=0;_<h.length;_++){var m=h[0].BDlb.DViF;f="AND"===m?f&&h[_].rcvu:f||h[_].rcvu}}else f=h.rcvu;if(""===d.trim())u=f;else switch(d){case"AND":u=u&&f;break;case"OR":u=u||f}d=h.length>1?i.groupCombineOperator:h.DViF}if(!0===o&&(u=!0),u){var p,b;if(console.debug("onCondition satisfied"),!i.qZjs.hvzT(i.bnsg))return void console.warn("Maximum limit reached",i.bnsg);if(!(null!==(p=window.ApxorRTM)&&void 0!==p&&p.isBadgePresent&&null!==(b=window.ApxorRTM)&&void 0!==b&&b.badgesLists.includes(i.bnsg)&&e.getController().isBadgeTriggerSatisfied(i.bnsg))){var y="SURVEY"===i.bzQi.ddJm?"survey":"campaign";null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===i.bzQi.ddJm?"survey":"campaign",apx_nudge_id:i.bnsg,apx_nudge_name:i.bzQi.nOGI,apx_variant_code:i.bzQi._isExperiment||i.bzQi._only_context?i.bzQi._attr.apx_variant_code:"TG"},!1,"",y)}i._across_sessions&&localStorage.removeItem("apx_nokpi_triggerdetails");var D,w=v(i.Udhu);try{for(w.s();!(D=w.n()).done;){var x=D.value;if(1===(null==x?void 0:x.length)||void 0===(null==x?void 0:x.length))x.rcvu=!1,x.Roxa=0;else{var E,B=v(x);try{for(B.s();!(E=B.n()).done;){var O=E.value;O.rcvu=!1,O.Roxa=0}}catch(e){B.e(e)}finally{B.f()}}}}catch(e){w.e(e)}finally{w.f()}if(i.izmx.SlqH(i.Udhu),i.Udhu=[],i.RZbo(i.rfWN,i.LBSx),!0===i.bzQi._only_context){var S="SURVEY"===i.bzQi.ddJm?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.bzQi._attr),{},{message_name:i.bzQi.nOGI,id:i.bnsg}),!1,"",S)}e.getController().dispatchEvent(i.bzQi.ddJm,{name:i.bzQi.ddJm,additional_info:{uuid:i.bnsg,name:i.bzQi.nOGI}})}})),s(this,"ZvBA",(function(){for(var t=i.VZlA.length,r=t<1,o="",a=0;a<t;a++){var s=i.VZlA[a],l=s.rcvu;if(""===o.trim())r=l;else switch(o){case"AND":r=r&&l;break;case"OR":r=r||l}o=s.RYiy}if(r){if(e.getController().persistTerminationInfoLocally(i.bnsg),!0===i.bzQi._only_context){var u="SURVEY"===i.bzQi.ddJm?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.bzQi._attr),{},{message_name:i.bzQi.nOGI,id:i.bnsg}),!1,"apxor",u)}e.getController().dispatchEvent(i.bzQi.ddJm,{name:i.bzQi.ddJm,additional_info:{uuid:i.bnsg,name:i.bzQi.nOGI}})}})),s(this,"validateForTerminationAttributes",(function(){var t=e.getController().getUserAttributes(),n=e.getController().getSessionAttributes();return i.EkPJ.validate(t,n)})),s(this,"ePYT",(function(){i.qZjs.ePYT()})),s(this,"getFrequencyCount",(function(){return i.qZjs.getFrequencyCount()})),s(this,"dBMm",(function(){return i.qZjs.KYjW()})),s(this,"LoGY",(function(e){var t;t="AND"===e[0].BDlb.DViF;for(var n=0;n<e.length;n++){t="AND"===e[0].BDlb.DViF?t&&e[n].rcvu:t||e[n].rcvu}return t})),s(this,"qrSO",(function(t){var n;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.bzQi.ddJm?"survey":"campaign",apx_nudge_id:i.bnsg,apx_nudge_name:i.bzQi.nOGI,apx_variant_code:i.bzQi._isExperiment||i.bzQi._only_context?null===(n=i.bzQi._attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),ce=a((function e(){var t=this;r(this,e),s(this,"jBpZ",{}),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(m(e)&&m(e.configs)){var n=e.configs;if(!Array.isArray(n))return;n.sort((function(e,t){var n,i;return(null!==(n=e.prio)&&void 0!==n?n:-1)-(null!==(i=t.prio)&&void 0!==i?i:-1)}));for(var i=0;i<n.length;i++){var r=n[i],o=r._id,a=new de;a.parse(r)?t.jBpZ[o]=a:console.warn("Failed to parse cfg",o)}}})),s(this,"validate",(function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(t.jBpZ[e]){var r=t.jBpZ[e];r.blJQ(n,i)}})),s(this,"getVariantCode",(function(e){return t.jBpZ[e]?t.jBpZ[e]._variant_code:""})),s(this,"validateForTermination",(function(e,n){t.jBpZ[e]&&t.jBpZ[e].dooa(n)})),s(this,"validateForTerminationAttributes",(function(e){return!!t.jBpZ[e]&&t.jBpZ[e].validateForTerminationAttributes()})),s(this,"ePYT",(function(e){t.jBpZ[e].ePYT()})),s(this,"getFrequencyCount",(function(e){var n=t.jBpZ[e];if(null!=n)return n.getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var e=t.jBpZ;for(var n in e)e[n].dBMm()})),s(this,"yQkf",(function(e){try{if(t.jBpZ){var n=t.jBpZ[e];if(n&&n.bzQi)return n.bzQi}}catch(e){console.log("Error in getting the campaign meta ".concat(e))}return{}}))})),ve=window.ApxorLogger,fe=a((function t(){var n=this;r(this,t),s(this,"LPZw",{}),s(this,"ckvj",[]),s(this,"mgTt",!1),s(this,"initialize",(function(){var t=e.getController();t.registerForEvent("APP_EVENT",(function(e){return n.eAEz(e,"AE")})),t.registerForEvent("CLIENT_EVENT",(function(e){return n.eAEz(e,"CE")}))})),s(this,"dbVt",(function(){var e,t=v(n.ckvj);try{for(t.s();!(e=t.n()).done;){var i=e.value;n.ymGf(i.event,i.key,i.type)}}catch(e){t.e(e)}finally{t.f()}n.mgTt=!0})),s(this,"raYd",(function(e,t){var i;"function"==typeof t&&((i=n.LPZw[e]?n.LPZw[e]:[]).push(t),n.LPZw[e]=i,ve.debug("Listeners list: ",n.LPZw))})),s(this,"unregisterFromEvent",(function(e,t){if(n.LPZw[e]){for(var i=n.LPZw[e],r=[],o=0;o<i.length;o++){var a=i[o];a!==t&&r.push(a)}n.LPZw[e]=r}})),s(this,"eAEz",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE";n.ymGf(e,"any_event",t),"apxor"===(null==e?void 0:e.loggedBy)?n.ymGf(e,"apxor_event",t):"customer"===(null==e?void 0:e.loggedBy)&&n.ymGf(e,"customer_event",t),"campaign"===(null==e?void 0:e.apx_nudge_type)?n.ymGf(e,"campaign_event",t):"survey"===(null==e?void 0:e.apx_nudge_type)&&n.ymGf(e,"survey_event",t);var i=t+"___"+e.name;n.ymGf(e,i,t)})),s(this,"ymGf",(function(t,i,r){if(n.mgTt){if(ve.debug("Notifying listeners for event: "+t+", "+i,n.LPZw),n.LPZw[i])for(var o=n.LPZw[i],a=e.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(r,t.name,a,t.additional_info)}}else n.ckvj.push({event:t,key:i,type:r})}))})),he=window.ApxorLogger,ge=function(){function t(){var n=this;return r(this,t),s(this,"PWzt",!1),s(this,"ipPn",null),s(this,"Htod",O()),s(this,"cxZT",new fe),s(this,"RMSu",e.getSiteId()),s(this,"peYV",{}),s(this,"getQeState",(function(){try{var t=e.getController().getFromStorage("qe_state");return t?JSON.parse(y(n.RMSu,t)):(n.peYV={},n.setQeState())}catch(e){return n.peYV={},n.setQeState()}})),s(this,"setQeState",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{e.getController().persistToStorage("qe_state",n.peYV,!0)}catch(i){""===t?n.peYV={}:n.peYV[t]={SESSION:0,OVERALL:0,DATES:{}},e.getController().persistToStorage("qe_state",n.peYV,!0)}return n.peYV})),s(this,"initialize",(function(){n.PWzt||(n.PWzt=!0,n.ipPn=new ce,n.cxZT.initialize(),n.peYV=n.getQeState(),he.info("QE Initialized.."))})),s(this,"parse",(function(e){n.btaP()?(n.ipPn.parse(e),n.cxZT.dbVt()):he.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;n.btaP()&&n.ipPn.validate(e,t,i)})),s(this,"getVariantCode",(function(e){return n.ipPn.getVariantCode(e)})),s(this,"validateForTermination",(function(e,t){n.btaP()&&n.ipPn.validateForTermination(e,t)})),s(this,"validateForTerminationAttributes",(function(e,t){return n.ipPn.validateForTerminationAttributes(e,t)})),s(this,"updateCount",(function(e){try{m(n.peYV[e])||n.createObjConfig(e),n.incrementFrequencies(e),n.setQeState(e),n.ipPn.ePYT(e)}catch(e){console.log("Could not update the count config:".concat(e))}})),s(this,"resetFrequencyCounts",(function(){n.ipPn.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(e){return n.ipPn.getFrequencyCount(e)})),s(this,"registerForEvent",(function(e,t){n.cxZT.raYd(e,t)})),s(this,"unregisterFromEvent",(function(e,t){n.cxZT.unregisterFromEvent(e,t)})),s(this,"notifyEventListener",(function(e){n.cxZT.eAEz(e)})),s(this,"fetch",(function(t,n,i,r){e.getController().fetchConfiguration(t,n,i,r)})),s(this,"btaP",(function(){return n.PWzt})),s(this,"getCampaignMetaFromQueryEngine",(function(e){return n.ipPn.yQkf(e)})),s(this,"KZBr",(function(){return n.Htod})),t.instance||(t.instance=this),t.instance}return a(t,[{key:"createObjConfig",value:function(e){try{this.peYV=this.getQeState(),m(this.peYV[e])||(this.peYV[e]={SESSION:0,OVERALL:0,DATES:{}},this.Htod&&(this.peYV[e].DATES[this.Htod]=0),this.setQeState(e))}catch(e){he.error("Can not create the frequency count object:"+e)}}},{key:"incrementFrequencies",value:function(e){this.peYV=this.getQeState();var t=this.peYV[e];t.SESSION=t.SESSION+1,t.OVERALL=t.OVERALL+1;var n=O();n===this.Htod&&t.DATES&&t.DATES[n]||(this.Htod=n,t.DATES={},t.DATES[this.Htod]=0),t.DATES[this.Htod]=t.DATES[this.Htod]+1}}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}}]),t}();s(ge,"instance",void 0),window.ceVersion=204;try{void 0===exports&&null===exports||(exports.default=ge,module.exports=exports.default)}catch(e){}return ge}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apxor-qe",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "author": "Ravi Teja Akella <ravi.akella@apxor.com> (https://www.apxor.com)",
5
5
  "contributors": [
6
6
  {
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "jsdom": "^22.1.0",
70
- "apxor": "3.0.3"
70
+ "apxor": "3.0.4"
71
71
  },
72
72
  "engines": {
73
73
  "pnpm": ">=8",