apxor-qe 2.0.5 → 2.0.7

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 r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(e){return(r="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 i(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 r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}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=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(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 r,i,o,a,s=[],u=!0,v=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){v=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(v)throw i}}return s}}(e,t)||l(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 f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(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 l(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=l(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 c(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;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 _=window.ApxorLogger,h=function(e){return void 0===e},g=function(e){return null===e},y=function(e){return void 0!==e&&!g(e)},m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function p(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 D=function(e,t){return p(e,t=function(e){var t,n,r,i,o,a,s=0,u=[];if(!e)return e;e+="";do{t=(a=m.indexOf(e.charAt(s++))<<18|m.indexOf(e.charAt(s++))<<12|(i=m.indexOf(e.charAt(s++)))<<6|(o=m.indexOf(e.charAt(s++))))>>16&255,n=a>>8&255,r=255&a,u.push(t),64!==i&&(u.push(n),64!==o&&u.push(r))}while(s<e.length);return u}(t))},w=function(e){return y(e)&&!g(e)&&!isNaN(e)},b=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"},E=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 C(t).test(e);default:return!1}},C=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()},F=function(e,t,n){if("GT"===n){var r=e.split(":"),i=t.split(":");if(!(r[0]>=i[0]))return!1;if(r[0]>i[0])return!0;if(r[0]!=i[0])return!1;if(r[1]>=i[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}},X=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}},S=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!t||!n)return!1;var i=n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),o=t.replace(new RegExp(i,"g"),"(.+)"),a=r?"^".concat(o):"".concat(o,"$"),s=new RegExp(a);return s.test(e)};function T(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=I(e,t);if(o){var a=function(){if(G(o)){return function(e){return O(e)}(o)}return _.info("Invalid target element. Width and height are 0 for element: ".concat(e,". Can't show tooltip")),!1};return a()}return n?(_.info("Not found yet. Rechecking the DOM."),H(i,r,e,t)):(_.info("Element with selector:".concat(e," not found.")),!1)}function H(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=setInterval((function(){var t=I(n,r);if(t){clearInterval(i);!function(){if(G()){O()}else _.info("Invalid target element. Width and height are 0 for element: ".concat(n,". Can't show tooltip"))}()}else(e-=1)<=0&&(clearInterval(i),console.warn("Element with selector:".concat(n," not found.")))}),t)}var I=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=document.getElementById(e);if(!r)try{r=document.querySelector(e)}catch(e){window.ApxorLogger.error("Error finding element in DOM:"+e)}(r||(r=q(e)),!r&&n.length>0)&&(r=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 r},q=function(e){var t=e.indexOf("svg");-1!==t&&(e=e.substring(0,t)+"svg:svg");try{return document.ReXr(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 G(e){try{var t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!1}catch(e){return!1}return!0}function R(e,t){for(var n=0;n<e.length;n++)if(e[n].hasOwnProperty(t))return e[n];return null}function O(e){var t,n,r,i;return!!(n=(t=e).offsetHeight,r=t.offsetWidth,(i=t.getBoundingClientRect()).left>=-r&&i.top>=-n&&i.right<=(window.innerWidth||document.documentElement.clientWidth)+r&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)+n)}var k=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)},L=window.ApxorLogger,B=a((function t(){var n=this;i(this,t),s(this,"DFrC","ALL"),s(this,"jkhw",[]),s(this,"xsNZ",[]),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.DFrC=e.audience.audience_type,n.jkhw=e.audience.attributes.user,n.xsNZ=e.audience.attributes.session,!Array.isArray(n.jkhw)||!Array.isArray(n.xsNZ))return L.error("No attributes"),!1}catch(e){return L.error(e),!1}return!0})),s(this,"validate",(function(t,r){var i=!0;"FTU"===n.DFrC&&(i=e.getController().getSessionInfo().is_first_session);var o=n.ViXp(t,n.jkhw),a=n.ViXp(r,n.xsNZ);return o||(n.userAttributesValidated=!1),a||(n.sessionAttributeValidated=!1),i&&o&&a})),s(this,"ViXp",(function(e,t){var n=t.length,r=!0;try{for(var i,o=function(){var n=t[a];if(h(e[n.name])||!1===r)return{v:!1};var i=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}})),u=(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,i)}))}));r=r&&u},a=0;a<n;a++)if(i=o())return i.v}catch(e){L.error(e),r=!1}return r}))})),j=a((function e(){var t=this;i(this,e),s(this,"UGic",""),s(this,"cIhR",{}),s(this,"heYC",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{t.UGic=e.name,t.cIhR=e.additional_info,t.heYC=null==e?void 0:e.path}catch(e){return!1}return!0}))})),N=a((function e(){var t=this;i(this,e),s(this,"YSug",0),s(this,"HlwB",0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.YSug=Number(e.lower),t.HlwB=Number(e.upper),isNaN(t.YSug)||isNaN(t.HlwB))return!1}catch(e){return!1}return!0}))})),V=a((function e(){var t=this;i(this,e),s(this,"QQId",0),s(this,"vDdr",""),s(this,"hMhi",""),s(this,"uXsD",new j),s(this,"GHht",new N),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.vDdr=e.event_type,t.hMhi=e.activity,t.uXsD.parse(e.details)&&t.GHht.parse(e.time_bounds)}catch(e){return!1}}))})),U=window.ApxorLogger,Q=a((function e(){var t=this;i(this,e),s(this,"QQId",0),s(this,"HUHi",-1),s(this,"oBTS",0),s(this,"SGjX",""),s(this,"hMhi",""),s(this,"vDdr",""),s(this,"GHht",new N),s(this,"uXsD",new j),s(this,"xVLs",new V),s(this,"yztc","AND"),s(this,"BigG",!1),s(this,"DFrC",void 0),s(this,"QXzb",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,r;return t.HUHi=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.oBTS=null==e||null===(n=e.count_config)||void 0===n?void 0:n.count,t.SGjX=null==e||null===(r=e.count_config)||void 0===r?void 0:r.operator,t.hMhi=null==e?void 0:e.activity,t.vDdr=null==e?void 0:e.event_type,t.yztc=e.combine_operator,t._timeEnabled=null==e?void 0:e.time_enabled,t._time=null==e?void 0:e.time,t.DFrC=null==e?void 0:e.type,t.QXzb=null==e?void 0:e.route,t.uXsD.parse(null==e?void 0:e.details)&&t.xVLs.parse(e.trigger)&&t.GHht.parse(e.time_bounds)}catch(e){return U.error(e),!1}}))})),z=window.ApxorLogger,M=a((function e(){var t=this;i(this,e),s(this,"oBTS",0),s(this,"SGjX",""),s(this,"vDdr",""),s(this,"GHht",new N),s(this,"uXsD",new j),s(this,"yztc","AND"),s(this,"parse",(function(e){try{return t.oBTS=e.count_config.count,t.SGjX=e.count_config.operator,t.vDdr=e.event_type,t.yztc=e.combine_operator,t.uXsD.parse(e.details)&&t.GHht.parse(e.time_bounds)}catch(e){return z.error(e),!1}}))})),P=window.ApxorLogger,K=function(){function t(){var n=this;i(this,t),s(this,"XmsR",0),s(this,"ABDA",""),s(this,"fHuv",new Q),s(this,"suqg",new M),s(this,"zWyW",!1),s(this,"yoCa",!1),s(this,"SdOG",0),s(this,"yztc","AND"),s(this,"eMRD","OR"),s(this,"mMVK",-1),s(this,"gMeI",[]),s(this,"gwWN",{}),s(this,"xyKD",!1),s(this,"OwjD",void 0),s(this,"PgpX",void 0),s(this,"yevy",void 0),s(this,"vTHP",void 0),s(this,"no_KPI_TriggerDetails",[]),s(this,"VkyX",!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]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=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],u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",v=arguments.length>7&&void 0!==arguments[7]?arguments[7]:-1,l=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(n.ABDA=r,n.SdOG=i,n.gMeI=a,n.OwjD=o,n.childConditionIndex=v,n.across_sessions=s||!1,"termination"===u&&""!==u){n.suqg.parse(t);return n.eMRD=n.suqg.yztc,n.zgOY(),!0}var f=n.fHuv.parse(t);if(f){if(n.yztc=n.fHuv.yztc,n.fHuv.BigG){var d=n.fHuv.uXsD.UGic;"APX_PAGE_OPENED"===d&&(d=n.fHuv.uXsD.cIhR.navigation_id,d=y(d)?d:n.fHuv.uXsD.UGic),n.mMVK=e.getController().getEventCount(d);var c=n.fHuv.oBTS,_=n.fHuv.SGjX;if(n.yoCa=n.dZrw(n.mMVK-1,c,_,!1),n.zWyW=n.yoCa,n.yoCa&&"APX_PAGE_OPENED"===n.fHuv.uXsD.UGic)return!0}return!0===l&&(o&&0!==i&&"unordered"!==o||n.jRNn()),!0}return!1})),s(this,"jRNn",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1!=t&&(n.PgpX=t);var r=n.fHuv,i=null!=r&&r._eventCategory?null==r?void 0:r._eventCategory:"specific_event",o=r.xVLs,a=he.getInstance();if("app_start"===o.vDdr)if(n.zWyW=!0,null!=r&&r._timeEnabled){if("session"!=(null==r?void 0:r._time.unit)){var s=X(r._time.unit,r._time.value);if("didn't"==(null==r?void 0:r.DFrC)){if(n.xyKD=!1,n.timerDidnt=setTimeout((function(){n.xyKD||(n.yoCa=!0,n.yoCa&&(n.XmsR+=1,n.yoCa=n.dZrw(n.XmsR,n.fHuv.oBTS,n.fHuv.SGjX),n.yoCa&&(n.fHuv.QQId=Date.now(),n.xyKD=!1,a.validate(n.ABDA,n.SdOG,n.PgpX))),"specific_event"===i?a.unregisterFromEvent(b(n.fHuv.vDdr)+"___"+n.fHuv.uXsD.UGic,n.yLyk):n.qKoB(i),n.zWyW=!1)}),s),n.across_sessions){var u=X(r._time.unit,r._time.value),v=r._timeEnabled,l=r._id;n.rbcW(r.DFrC,r.uXsD.UGic,Date.now(),r.uXsD.cIhR,u,v,l)}"specific_event"===i?(a.registerForEvent(b(n.fHuv.vDdr)+"___"+n.fHuv.uXsD.UGic,n.yLyk),n.vTHP=n.fHuv):n.xrGZ(i)}else if("did"==(null==r?void 0:r.DFrC)){if(n.timerDid=setTimeout((function(){n.VkyX||("specific_event"===i?a.unregisterFromEvent(b(n.fHuv.vDdr)+"___"+n.fHuv.uXsD.UGic,n.erQr):n.wjhx(i))}),s),n.across_sessions){var f=X(r._time.unit,r._time.value),d=r._timeEnabled,c=r._id;n.rbcW(r.DFrC,r.uXsD.UGic,Date.now(),r.uXsD.cIhR,f,d,c)}"specific_event"===i?(a.registerForEvent(b(n.fHuv.vDdr)+"___"+n.fHuv.uXsD.UGic,n.erQr),n.yevy=n.fHuv):n.hcXm(i)}}}else"specific_event"===i?a.registerForEvent(b(r.vDdr)+"___"+r.uXsD.UGic,n.dkXM):n.rGmm(i);else if(null!=r&&r._timeEnabled){if("session"!=(null==r?void 0:r._time.unit)){var _=X(r._time.unit,r._time.value);"didn't"==(null==r?void 0:r.DFrC)?(n.xyKD=!1,n.timerDidnt=setTimeout((function(){n.xyKD||(n.yoCa=!0,n.yoCa&&(n.XmsR+=1,n.yoCa=n.dZrw(n.XmsR,n.fHuv.oBTS,n.fHuv.SGjX),n.yoCa&&(n.fHuv.QQId=Date.now(),n.xyKD=!1,a.validate(n.ABDA,n.SdOG)))),"specific_event"===i&&a.unregisterFromEvent(b(n.fHuv.vDdr)+"___"+n.fHuv.uXsD.UGic,n.yLyk),n.zWyW=!1}),_),"specific_event"===i?(a.registerForEvent(b(n.fHuv.vDdr)+"___"+n.fHuv.uXsD.UGic,n.yLyk),n.vTHP=n.fHuv):n.xrGZ()):"did"==(null==r?void 0:r.DFrC)&&(n.timerDid=setTimeout((function(){n.VkyX||"specific_event"===i&&a.unregisterFromEvent(b(n.fHuv.vDdr)+"___"+n.fHuv.uXsD.UGic,n.erQr)}),_),"specific_event"===i&&a.registerForEvent(b(n.fHuv.vDdr)+"___"+n.fHuv.uXsD.UGic,n.erQr))}}else"specific_event"===i&&a.registerForEvent(b(r.vDdr)+"___"+o.uXsD.UGic,n.dkXM);null!==(e=window.ApxorRTM)&&void 0!==e&&e.badgesLists.includes(n.ABDA)&&a.registerForEvent(b(r.vDdr)+"___"+"apxor-badge-container-".concat("-".concat(n.ABDA).replaceAll(" ","").replace(/[^\w\s]/gi,"")),n.dkXM)})),s(this,"rGmm",(function(e){var t=new he;"apxor_event"===e?t.registerForEvent("apxor_event",(function(e,t,r,i){n.dkXM(b(n.fHuv.vDdr),n.fHuv.uXsD.UGic,r,n.fHuv.uXsD.cIhR)})):"customer_event"===e?t.registerForEvent("customer_event",(function(e,t,r,i){n.dkXM(b(n.fHuv.vDdr),n.fHuv.uXsD.UGic,r,n.fHuv.uXsD.cIhR)})):"any_event"===e?t.registerForEvent("any_event",(function(e,t,r,i){n.dkXM(b(n.fHuv.vDdr),n.fHuv.uXsD.UGic,r,n.fHuv.uXsD.cIhR)})):"campaign_event"===e?t.registerForEvent("campaign_event",(function(e,t,r,i){n.dkXM(b(n.fHuv.vDdr),n.fHuv.uXsD.UGic,r,n.fHuv.uXsD.cIhR)})):"survey_event"===e&&t.registerForEvent("survey_event",(function(e,t,r,i){n.dkXM(b(n.fHuv.vDdr),n.fHuv.uXsD.UGic,r,n.fHuv.uXsD.cIhR)}))})),s(this,"qKoB",(function(e){var t=new he,r=n.fHuv._eventCategory;"apxor_event"===r?t.unregisterFromEvent("apxor_event",n.yLyk):"customer_event"===r?t.unregisterFromEvent("customer_event",n.yLyk):"any_event"===r?t.unregisterFromEvent("any_event",n.yLyk):"campaign_event"===r?t.unregisterFromEvent("campaign_event",n.yLyk):"survey_event"===r&&t.unregisterFromEvent("survey_event",n.yLyk)})),s(this,"xrGZ",(function(){var e=new he,t=n.fHuv._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.yLyk):"customer_event"===t?e.registerForEvent("customer_event",n.yLyk):"any_event"===t?e.registerForEvent("any_event",n.yLyk):"campaign_event"===t?e.registerForEvent("campaign_event",n.yLyk):"survey_event"===t&&e.registerForEvent("survey_event",n.yLyk)})),s(this,"hcXm",(function(){var e=new he,t=n.fHuv._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.erQr):"customer_event"===t?e.registerForEvent("customer_event",n.erQr):"any_event"===t?e.registerForEvent("any_event",n.erQr):"campaign_event"===t?e.registerForEvent("campaign_event",n.erQr):"survey_event"===t&&e.registerForEvent("survey_event",n.erQr)})),s(this,"wjhx",(function(){var e=new he,t=n.fHuv._eventCategory;"apxor_event"===t?e.unregisterFromEvent("apxor_event",n.erQr):"customer_event"===t?e.unregisterFromEvent("customer_event",n.erQr):"any_event"===t?e.unregisterFromEvent("any_event",n.erQr):"campaign_event"===t?e.unregisterFromEvent("campaign_event",n.erQr):"survey_event"===t&&e.unregisterFromEvent("survey_event",n.erQr)})),s(this,"zgOY",(function(){var e=n.suqg,t=he.getInstance();n.zWyW=!0,t.registerForEvent(b(e.vDdr)+"___"+e.uXsD.UGic,n.ISVV)})),s(this,"AwuV",(function(e,t,r,i){var o,a=(Date.now()-n.gwWN[t])/1e3;(null===(o=n.fHuv)||void 0===o||null===(o=o.uXsD)||void 0===o||null===(o=o.cIhR)||void 0===o?void 0:o.time)/1e3>a&&n._displayCampaign(r)})),s(this,"SLEo",(function(e,t,r,i){var o,a;n.xyKD=!0;var s=Date.now(),u=null===(o=n.fHuv)||void 0===o||null===(o=o.xVLs)||void 0===o?void 0:o.uXsD.UGic,v=(s-n.gwWN[u])/1e3,l=null===(a=n.fHuv)||void 0===a||null===(a=a.uXsD)||void 0===a||null===(a=a.cIhR)||void 0===a?void 0:a.time;(l/=1e3)>v&&n._displayCampaign(r)})),s(this,"erQr",(function(){n.VkyX=!0;var e=new he;clearTimeout(n.timerDid),n.XmsR+=1,n.yoCa=n.dZrw(n.XmsR,n.fHuv.oBTS,n.fHuv.SGjX),n.yoCa&&(e.unregisterFromEvent(b(n.yevy.vDdr)+"___"+n.yevy.uXsD.UGic,n.erQr),n.VkyX=!1,e.validate(n.ABDA,n.SdOG,n.PgpX))})),s(this,"yLyk",(function(e,t,r,i){n.xyKD=!0,clearTimeout(n.timerDidnt),(new he).unregisterFromEvent(b(n.vTHP.vDdr)+"___"+n.vTHP.uXsD.UGic,n.yLyk)})),s(this,"dkXM",(function(t,r,i,o){var a,s,u=he.getInstance();if(n.zWyW){if(null!==(a=window.ApxorRTM)&&void 0!==a&&a.isBadgePresent&&null!==(s=window.ApxorRTM)&&void 0!==s&&s.badgesLists.includes(n.ABDA)&&e.getController().isBadgeTriggerSatisfied(n.ABDA))return n.yoCa=!0,n.fHuv.QQId=i,void u.validate(n.ABDA,n.SdOG);if(b(n.fHuv.vDdr)===t&&n.nEoX(i-n.fHuv.xVLs.QQId,n.fHuv.GHht)&&n.fHuv.uXsD.UGic===r&&n.BxfC(n.fHuv.uXsD.cIhR,o)&&(n.XmsR+=1,n.yoCa=n.dZrw(n.XmsR,n.fHuv.oBTS,n.fHuv.SGjX),n.yoCa)){if(n.fHuv.QQId=i,n.across_sessions){var v=X(n.fHuv._time.unit,n.fHuv._time.value),l=n.fHuv._timeEnabled,f=n.fHuv._id,d=n.XmsR;n.rbcW(n.fHuv.DFrC,r,i,o,v,l,f,d)}u.validate(n.ABDA,n.SdOG,n.PgpX)}}else if(n.zWyW=n.KRGs(t,r,i,o),n.zWyW){var c=n.fHuv,_=c.xVLs;if(_.QQId=i,"activity_time"===(null==c?void 0:c.vDdr)){var h,g,y,m,p=null==c||null===(h=c.uXsD)||void 0===h||null===(h=h.cIhR)||void 0===h?void 0:h.time;(null==c||null===(g=c.QXzb)||void 0===g?void 0:g.length)>0?setTimeout((function(){var t;(null===(t=e.getController())||void 0===t?void 0:t._appEventsNoKpi).length<=2&&c.QXzb===location.pathname&&n._displayCampaign(i)}),p):(null==c||null===(y=c.uXsD)||void 0===y||null===(y=y.cIhR)||void 0===y?void 0:y.nkpi.length)>0?(setTimeout((function(){n.xyKD||(n.yoCa=!0,n.yoCa&&(n.XmsR+=1,n.yoCa=n.dZrw(n.XmsR,n.fHuv.oBTS,n.fHuv.SGjX),n.yoCa&&(n.fHuv.QQId=i,n.xyKD=!1,u.validate(n.ABDA,n.SdOG)))),c.uXsD.cIhR.nkpi.map((function(e){u.unregisterFromEvent(E(c.uXsD.cIhR.et)+"___"+e,n),n.zWyW=!1}))}),p),c.uXsD.cIhR.nkpi.map((function(e){u.registerForEvent(E(c.uXsD.cIhR.et)+"___"+e,n.yLyk)}))):(null==c||null===(m=c.uXsD)||void 0===m||null===(m=m.cIhR)||void 0===m?void 0:m.kpi.length)>0&&(setTimeout((function(){c.uXsD.cIhR.kpi.map((function(e){u.unregisterFromEvent(E(c.uXsD.cIhR.et)+"___"+e,n)}))}),p),c.uXsD.cIhR.kpi.map((function(e){e===c.xVLs.uXsD.UGic?(u.unregisterFromEvent(b(_.vDdr)+"___"+_.uXsD.UGic,n),u.registerForEvent(E(c.uXsD.cIhR.et)+"___"+e,n.AwuV)):u.registerForEvent(E(c.uXsD.cIhR.et)+"___"+e,n.SLEo)})))}else u.unregisterFromEvent(b(_.vDdr)+"___"+_.uXsD.UGic,n),u.registerForEvent(b(c.vDdr)+"___"+c.uXsD.UGic,n);n.gwWN[r]=Date.now()}})),s(this,"ISVV",(function(e,t,r,i){var o=he.getInstance();b(n.suqg.vDdr)===e&&n.nEoX(r,n.suqg.GHht)&&n.suqg.uXsD.UGic===t&&n.BxfC(n.suqg.uXsD.cIhR,i)&&(n.XmsR+=1,n.yoCa=n.dZrw(n.XmsR,n.suqg.oBTS,n.suqg.SGjX),n.yoCa&&(n.suqg.QQId=r,o.validateForTermination(n.ABDA,n.SdOG)))})),s(this,"KRGs",(function(e,t,r,i){var o=n.fHuv.xVLs,a=b(o.vDdr)===e&&o.uXsD.UGic===t&&n.nEoX(r,o.GHht)&&n.BxfC(o.uXsD.cIhR,i);return a="APX_PAGE_OPENED"===t?a&&location.pathname===o.uXsD.heYC:a})),s(this,"nEoX",(function(e,t){var n=Math.ceil(e);return n>t.YSug&&n<t.HlwB})),s(this,"dZrw",(function(e,t,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(i&&n.fHuv.BigG&&(e+=n.mMVK),r){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,"BxfC",(function(e,t){var n=!0;try{var i,o=function(){if(!1===n)return{v:!1};if("object"===r(e[a])){var i,o,s,u=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 l,f=(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,u)}));if(!(null===(i=e[a])||void 0===i||!i.present)&&(null===(o=e[a])||void 0===o?void 0:o.present))l=!!t.hasOwn(t,a),n=n&&l;n=n&&f}else n=n&&A(t[a],e[a],"EQ")};for(var a in e)if(i=o())return i.v}catch(e){P.error(e),n=!1}return n})),s(this,"rbcW",(function(t,r,i,o,a,s,u,v){var l,f=!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,c=0;s&&(c=Date.now()+a);for(var _=0;_<n.no_KPI_TriggerDetails.length;_++)if(n.no_KPI_TriggerDetails[_].id===u){f=!0,l=n.no_KPI_TriggerDetails[_];break}f?l.satisfiedCount+=1:(d={id:u,type:t,time:i,name:r,additionalInfo:o,satisfiedCount:v,timeBased:s,finishTime:c},n.no_KPI_TriggerDetails.push(d)),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(n.no_KPI_TriggerDetails))})),s(this,"oFex",(function(e){var t,r=new he,i=d(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;if(1===(null==o?void 0:o.length)||void 0===(null==o?void 0:o.length))r.unregisterFromEvent(b(null==o?void 0:o.fHuv.vDdr)+"___"+(null==o?void 0:o.fHuv.uXsD.UGic),n.dkXM);else{var a,s=d(o);try{for(s.s();!(a=s.n()).done;){var u,v=a.value;r.unregisterFromEvent(b(null==v?void 0:v.fHuv.vDdr)+"___"+(null==v||null===(u=v.fHuv)||void 0===u?void 0:u.uXsD.UGic),n.dkXM)}}catch(e){s.e(e)}finally{s.f()}}}}catch(e){i.e(e)}finally{i.f()}}))}return a(t,[{key:"_displayCampaign",value:function(e){var t=he.getInstance();this.yoCa=!0,this.yoCa&&(this.XmsR+=1,this.yoCa=this.dZrw(this.XmsR,this.fHuv.oBTS,this.fHuv.SGjX),this.yoCa&&(this.fHuv.QQId=e,t.validate(this.ABDA,this.SdOG)))}}]),t}(),Y=window.ApxorLogger,Z=a((function t(){var n=this;i(this,t),s(this,"oBTS",0),s(this,"WVfG",0),s(this,"AEyV","SESSION"),s(this,"Rcoc",0),s(this,"uIOV",0),s(this,"UhtC",0),s(this,"_enable_repetition_gap",void 0),s(this,"_enable_days_limit",void 0),s(this,"_enable_session_limit",void 0),s(this,"IbRb",void 0),s(this,"ErEX",void 0),s(this,"SQOs",void 0),s(this,"DSLimits",void 0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var r,i,o,a,s,u,v,l;if(n.ABDA=t._id,n.ofFb=t.meta,n.oBTS=t.frequency.count,-1===n.oBTS&&(n.oBTS=9999999),n.UhtC=n.oBTS,n.WVfG=t.frequency.time_interval,n.AEyV=t.frequency.validity,n.DSLimits=t.frequency.DSLimits,n.uIOV=t.frequency.ses_lmt,n._enable_session_limit=null===(r=t.frequency)||void 0===r?void 0:r.enable_session_limit,n._enable_session_limit)n.IbRb=null===(u=t.frequency)||void 0===u?void 0:u.session_count;if(n._dayCount=null!==(i=t.frequency)&&void 0!==i&&i.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===(l=t.frequency)||void 0===l?void 0:l.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.SQOs=t.frequency.days_limit.days?t.frequency.days_limit.days:1,n.ErEX=t.frequency.days_limit.limit);var f=he.getInstance().getQeState();if(!y(f)||!y(f[t._id]))return!0;if("SESSION"===n.AEyV){if(n.oBTS=parseInt(n.oBTS)-parseInt(f[t._id].SESSION),n.oBTS<=0)return n.IdAw("Session limit reached"),console.warn("Max count limit reached for session:"+t._id),e.getController().isTestDevice()&&k("Maximum overall limit reached for campaign name ".concat(n.ofFb.name)),!1}else{if("OVERALL"!==n.AEyV)return Y.info("Invalid config."),!1;if(n.oBTS=parseInt(n.oBTS)-parseInt(f[t._id].OVERALL),n.oBTS<=0)return n.IdAw("Overall limit reached"),console.warn("Max count limit reached for overall:"+t._id),e.getController().isTestDevice()&&k("Maximum overall limit reached for campaign name ".concat(n.ofFb.name)),!1}}catch(e){return Y.error(e),!1}return!0})),s(this,"RQvg",(function(){n.oBTS=n.oBTS-1})),s(this,"getFrequencyCount",(function(){return n.oBTS})),s(this,"TyZe",(function(){"SESSION"===n.AEyV&&(n.oBTS=n.UhtC,Y.info("Campaign Limit reset"))})),s(this,"Vsbc",(function(t){try{if(n.oBTS<=0)return"OVERALL"===n.AEyV?(n.IdAw("Overall limit reached"),e.getController().isTestDevice()&&k("Maximum overall limit reached for campaign name ".concat(n.ofFb.name))):"SESSION"===n.AEyV&&(e.getController().isTestDevice()&&k("Maximum session limit reached for campaign name ".concat(n.ofFb.name)),n.IdAw("Session limit reached")),!1;var r=he.getInstance().getQeState();if(!y(r)||!y(r[t]))return!0;if(n._enable_session_limit)if(parseInt(n.IbRb)-parseInt(r[t].SESSION)<=0)return n.IdAw("Session limit reached"),e.getController().isTestDevice()&&k("Maximum session limit reached for campaign name ".concat(n.ofFb.name)),!1;if(n._enable_repetition_gap)if("session"!=n._repetitionUnit){var i=e.getController().getFromStorage("apx-last-shown-times");if(i=JSON.parse(i),!g(R(i,n.ABDA))){var o=R(i,n.ABDA)[n.ABDA];if(Date.now()-o<X(n._repetitionUnit,n._repetitionValue))return n.IdAw("Config does not satisfy time difference "),e.getController().isTestDevice()&&k("Config does not satisfy time difference for campaign name ".concat(n.ofFb.name)),!1}}else{var a=e.getController().getFromStorage("apx-last-shown-session");if(a=JSON.parse(a),!g(R(a,n.ABDA))){var s=R(a,n.ABDA)[n.ABDA];if(e.getController().getFromStorage("apx_retained_session")-s<parseInt(n._repetitionValue))return n.IdAw("Config does not satisfy session difference "),e.getController().isTestDevice()&&k("Config does not satisfy session difference for campaign name ".concat(n.ofFb.name)),!1}}if(0!==n.uIOV&&n.DSLimits)if(parseInt(n.uIOV)-parseInt(r[t].SESSION)<=0)return n.IdAw("Session limit reached"),e.getController().isTestDevice()&&k("Session limit reached for campaign name ".concat(n.ofFb.name)),!1;if(0!==n._dayCount){var u,v=x();if(parseInt(n._dayCount)-parseInt((null===(u=r[t])||void 0===u?void 0:u.DATES[v])||0)<=0)return n.IdAw("Day limit reached"),e.getController().isTestDevice()&&k("Day limit reached for campaign name ".concat(n.ofFb.name)),!1}if(n.SQOs>0&&n._enable_days_limit){var l=n.SQOs,f=0;if(function(e){for(var t=[],n=new Date,r=0;r<e;r++){var i=new Date(n);i.setDate(n.getDate()-r);var o=String(i.getDate()),a=String(i.getMonth()),s=i.getFullYear();t.push(o+"/"+a+"/"+s)}return t}(l).forEach((function(e){var n;f+=parseInt((null===(n=r[t])||void 0===n?void 0:n.DATES[e])||0)})),f>n.ErEX)return Y.info("Shown Limit Crossed"),e.getController().isTestDevice()&&k("Days limit reached for campaign name ".concat(n.ofFb.name)),!1}}catch(e){n.IdAw("Error validating the frequency: ".concat(e)),Y.error("Error validating the frequency:"+e)}return!0})),s(this,"IdAw",(function(t){var r;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.ofFb.type?"survey":"campaign",apx_nudge_id:n.ABDA,apx_nudge_name:n.ofFb.name,message_name:n.ofFb.UGic,id:n.ABDA,apx_variant_code:n.ofFb.isExperiment||n.ofFb.only_context?null===(r=n.ofFb.attr)||void 0===r?void 0:r.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),W=window.ApxorLogger,J=a((function e(){var t=this;i(this,e),s(this,"OTPw",[]),s(this,"GbmE",0),s(this,"Zyiy",!1),s(this,"eEYX",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]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=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.ABDA=n,t.SdOG=r,t.gMeI=o,t.OwjD=i,t.across_sessions=s;var u=[];t.GbmE=e.length;try{if(null!=u)return i=null==e?void 0:e.sequence_type,u=t.tTRq(e,t.GbmE),"unordered"!==a&&0!==t.SdOG||t.jRNn(),t.OTPw}catch(e){return W.error(e),!1}})),s(this,"tTRq",(function(e,n){for(var r=0;r<n;r++){t.eEYX=new K;try{t.eEYX.initialize(e[r],t.ABDA,t.SdOG,t.OwjD,t.IyJN,t.across_sessions,"",-1,!1)&&(t.OTPw.push(t.eEYX),t.OTPw.sequence_type=t.OwjD)}catch(e){W.error(e)}}return t.OTPw})),s(this,"jRNn",(function(){if("ordered"===t.OwjD||"strictly_ordered"===t.OwjD)t.OTPw[0].jRNn(0);else{var e,n=d(t.OTPw);try{for(n.s();!(e=n.n()).done;){e.value.jRNn()}}catch(e){n.e(e)}finally{n.f()}}})),s(this,"oFex",(function(e){t.eEYX.oFex(e)}))})),$=a((function e(){var t=this;i(this,e),s(this,"UGic",""),s(this,"DFrC",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,r;t.UGic=e.meta.name,t.DFrC=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===(r=e.meta)||void 0===r?void 0:r.isExperiment}catch(e){return window.ApxorLogger.error(e),!1}return!0}))})),ee=window.ApxorLogger,te=a((function t(){var n=this;i(this,t),s(this,"zKQj",[]),s(this,"_ret_day",{}),s(this,"OFTf",{}),s(this,"IPPT",!1),s(this,"kTaF",!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.zKQj=e.overall_cfg.events,n._ret_day=e.overall_cfg.ret_day,n.OFTf=e.overall_cfg.session,n.IPPT=e.overall_cfg.toggleRetDay,n.kTaF=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")),r=parseInt(e.getController().getFromStorage("apx_retained_session"));if(n.IPPT&&!isNaN(t)&&!(t>=n._ret_day.from&&t<=n._ret_day.to))return n.retainedDaysValidated=!1,!1;if(n.kTaF&&!isNaN(r)&&!(r>=n.OFTf.from&&r<=n.OFTf.to))return n.retainedSessionValidated=!1,!1;try{for(var i=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),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return t}(D(o,i)))),s=0;s<n.zKQj.length;s++){if(a[n.zKQj[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,re=a((function e(){var t=this;i(this,e),s(this,"jkhw",[]),s(this,"xsNZ",[]),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.jkhw=e.attributes.user,t.xsNZ=e.attributes.session,!Array.isArray(t.jkhw)||!Array.isArray(t.xsNZ))return ne.error("No attributes"),!1}catch(e){return ne.error(e),!1}return!0})),s(this,"validate",(function(e,n){return t.ViXp(e,t.jkhw)&&t.ViXp(n,t.xsNZ)})),s(this,"ViXp",(function(e,t){var n=t.length,r=!0;try{for(var i,o=function(){var n=t[a];if(!e[n.name]||!1===r)return{v:!1};var i=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})),u=(Array.isArray(e[n.name])?e[n.name]:[e[n.name]]).some((function(e){return s.some((function(t){return A(e,t,i)}))}));r=r&&u},a=0;a<n;a++)if(i=o())return i.v}catch(e){ne.error(e),r=!1}return r}))})),ie=a((function t(){var n=this;i(this,t),s(this,"IGdf",e.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"DAMZ",1),s(this,"parse",(function(e){try{var t,r,i;if(n.DFrC=null===(t=e.terminate_info.time_based)||void 0===t?void 0:t.type,n._duration_seconds=null===(r=e.terminate_info)||void 0===r?void 0:r.time_based.duration_seconds,n.DAMZ=null===(i=e.terminate_info.time_based)||void 0===i?void 0:i.days,n.vRev(e._id))return n.IGdf.persistTerminationInfoLocally(e._id),!1}catch(e){return!1}return!0})),s(this,"vRev",(function(e){var t,r=JSON.parse(n.IGdf.getFromStorage("apx_termination_ID"));if(!r[e]||null===(t=r[e])||void 0===t||!t.startDate)return!1;var i,o=new Date(r[e].startDate),a=new Date((i=new Date).getMonth()+"/"+i.getDate()+"/"+i.getFullYear()),s=parseInt((a-o)/864e5,10),u=function(){var e=new Date;return{hours:e.getHours(),mins:e.getMinutes()}}(),v=r[e].nYTe;return s===n.DAMZ&&u.hours>=v.hours||s>n.DAMZ||r[e].goalAcheived}))})),oe=a((function e(){var t=this;i(this,e),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"oamw",new re),s(this,"wuBT",new ie),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,r,i;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.wuBT.parse(e))return!1;if(t.enable_goal_events=null==e||null===(r=e.terminate_info)||void 0===r?void 0:r.enable_goal_events,t.enable_attributes=null==e||null===(i=e.terminate_info)||void 0===i?void 0:i.enable_attributes,t.enable_attributes&&!t.oamw.parse(e.terminate_info))return!1}catch(e){return window.ApxorLogger.error(e),!1}return!0})),s(this,"validate",(function(e,n){return t.oamw.validate(e,n)}))})),ae=window.ApxorLogger,se=a((function t(){var n=this;i(this,t),s(this,"jjeA",-1),s(this,"vFlH",-1),s(this,"nYTe",-1),s(this,"iDwb",-1),s(this,"ycyp",-1),s(this,"dCIk",-1),s(this,"_is_user_timezone",void 0),s(this,"cfKb",!1),s(this,"fmrF",!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,r;if(n.ABDA=e._id,n.ofFb=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.jjeA=Date.parse(e.validity.start_date),n.vFlH=Date.parse(e.validity.end_date),n._days_in_week=null!==(t=e.validity)&&void 0!==t&&t.days_in_week?null===(r=e.validity)||void 0===r?void 0:r.days_in_week:[1,2,3,4,5,6,7],n._is_user_timezone=!e.is_user_timezone||e.is_user_timezone,y(e.at_specific_time)&&(n.cfKb=e.at_specific_time,n.cfKb&&y(e.time_limits)&&(n.nYTe=e.time_limits.start_time,n.iDwb=e.time_limits.end_time,w(n.nYTe)||w(n.iDwb))))return ae.error("Not valid times"),!1;if(y(e.time_excludes_in_day)&&(n.fmrF=e.time_excludes_in_day,n.fmrF&&y(e.time_excludes)&&(n.ycyp=e.time_excludes.start_time,n.dCIk=e.time_excludes.end_time,w(n.ycyp)||w(n.dCIk))))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(),r=(new Date).getDay()+1,i=function(e){var t=new Date,n=t.getHours(),r=t.getMinutes(),i=(n=(n<10?"0":"")+n)+":"+(r=(r<10?"0":"")+r);if(!e){var o=t.getUTCHours(),a=t.getUTCMinutes();i=(o=(o<10?"0":"")+o)+":"+(a=(a<10?"0":"")+a)}return i}(n._is_user_timezone);if(t>n.jjeA&&t<n.vFlH&&n._days_in_week.includes(r))return!n.cfKb||F(i,n.nYTe,"GT")&&F(i,n.iDwb,"LT")||(n._not_in_specified_time=!0),n.fmrF&&function(e,t,n){var r=u(e.split(":").map(Number),2),i=r[0],o=r[1],a=u(t.split(":").map(Number),2),s=a[0],v=a[1],l=u(n.split(":").map(Number),2),f=60*l[0]+l[1];return f>=60*i+o&&f<=60*s+v}(n.ycyp,n.dCIk,i)?(n.IdAw("Exclude Time limits check failed"),e.getController().isTestDevice()&&k("Exclude Time Limits check failed for campaign name ".concat(n.ofFb.name)),!1):!n.cfKb||F(i,n.nYTe,"GT")&&F(i,n.iDwb,"LT");if(t<n.jjeA)n._not_yet_active=!0;else if(t>n.vFlH)n._nudge_expired=!0;else if(!n._days_in_week.includes(r))return n.IdAw("Current week day did not match with Configured Week day"),e.getController().isTestDevice()&&k("Current week day did not match with Configured Week day for campaign name ".concat(n.ofFb.name)),!1;return!1})),s(this,"IdAw",(function(t){var r;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.ofFb.type?"survey":"campaign",apx_nudge_id:n.ABDA,apx_nudge_name:n.ofFb.name,message_name:n.ofFb.UGic,id:n.ABDA,apx_variant_code:n.ofFb.isExperiment||n.ofFb.only_context?null===(r=n.ofFb.attr)||void 0===r?void 0:r.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),ue=a((function e(){var t=this;i(this,e),s(this,"MLvn",""),s(this,"nLZR",""),s(this,"aCat",""),s(this,"qNPe",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.MLvn=null==e?void 0:e.screen_binding,!t.MLvn||(t.nLZR=null==e?void 0:e.binding.url,t.aCat=null==e?void 0:e.binding.var,t.qNPe=null==e?void 0:e.binding.operator,!0)}catch(e){return window.ApxorLogger.error(e),!1}})),s(this,"validate",(function(){var e=t.nLZR,n=t.aCat,r=t.qNPe,i=window.location.href;return!t.MLvn||("EQ"===r?e.includes(n)?!!S(i,e,n,!1):i===e:"SW"===r?e.includes(n)?!!S(i,e,n,!0):!!i.startsWith(e):void 0)}))})),ve=window.ApxorLogger,le=a((function t(){var r=this;i(this,t),s(this,"qfrr",[]),s(this,"vqdX",[]),s(this,"ABDA",""),s(this,"ofFb",new $),s(this,"Rtvw",new B),s(this,"AEyV",new se),s(this,"sqke",new Z),s(this,"Rlua",new te),s(this,"TAxm",new oe),s(this,"SXtO",new ue),s(this,"OwjD",!1),s(this,"IyJN",[]),s(this,"_variant_code",""),s(this,"Zyiy",!1),s(this,"groupCombineOperator","OR"),s(this,"xyKD",!1),s(this,"vtAp",!1),s(this,"sHdE",void 0),s(this,"timeForKPI",void 0),s(this,"kpiIndex",0),s(this,"jaQb",void 0),s(this,"_across_sessions",!1),s(this,"JWQI",void 0),s(this,"RlZB",!1),s(this,"JILc",void 0),s(this,"GGny",void 0),s(this,"vpAf",void 0),s(this,"YXfN",void 0),s(this,"bsQT",void 0),s(this,"FefJ",void 0),s(this,"DBxj",void 0),s(this,"MhIU",void 0),s(this,"qIOQ",void 0),s(this,"ymdm",void 0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,n;if(!y(e._id))return ve.error("No Id"),!1;if(!y(e.enabled)||!e.enabled)return ve.error("Not enabled"),!1;if(!(r.ofFb.parse(e)&&r.AEyV.parse(e)&&r.sqke.parse(e)&&r.Rtvw.parse(e)&&r.Rlua.parse(e)&&r.TAxm.parse(e)&&r.SXtO.parse(e)))return!1;if(r._variant_code=r.ofFb._isExperiment||r.ofFb._only_context?null===(t=r.ofFb._attr)||void 0===t?void 0:t.apx_variant_code:"TG",r._across_sessions=!(null==e||!e.across_sessions)&&(null==e?void 0:e.across_sessions),r.enable_conditions=null==e?void 0:e.enable_conditions,r.enable_conditions_v2=null==e?void 0:e.enable_conditions_v2,!y(e.conditions)||!Array.isArray(e.conditions))return ve.error("No valid conditions",e.conditions),!1;r.ABDA=e._id,r.OwjD=!!y(e.sequence_enabled)&&e.sequence_enabled,y(e.conditions_v2)&&r.enable_conditions_v2&&(r.OwjD=null==e?void 0:e.sequence_type),!0===r.OwjD&&e.conditions.sort((function(e,t){return e.sequence<t.sequence})),y(e.conditions_v2)&&r.enable_conditions_v2?(n=e.conditions_v2,r.RlZB=!0):n=e.conditions,r.JWQI=n;var i=n.length,o=null==e?void 0:e.no_context_enabled;if(0===i&&o&&setTimeout((function(){r.XvYs()}),10),r.ymdm=i,r.TNJX(n,i),r.pnkr(),r.TAxm.enable_goal_events)for(var a=e.terminate_info.goal_events.events,s=a.length,u=0;u<s;u++){var v=new K;v.initialize(a[u],r.ABDA,u,!0,[],r._across_sessions,"termination")&&r.vqdX.push(v)}return r.qfrr.length>0}catch(e){return ve.error(e),!1}})),s(this,"TNJX",(function(e,t){for(var n=function(){r.IyJN=[];var t=e[i];if("group"===(null!=t&&t.condition_type?null==t?void 0:t.condition_type:"single")){var n=t.conditions_v2;r.groupCombineOperator=t.combine_operator;var o=null==t?void 0:t.sequence_type;r.qIOQ=new J;var a=r.qIOQ.initialize(n,r.ABDA,i,o,r.IyJN,r.OwjD,r._across_sessions);r.qfrr.push(a)}else{if("didn't"===t.type){var s,u={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};r.IyJN=[].concat(v(r.IyJN),[u])}if(r.qIOQ=new K,r.qIOQ.initialize(t,r.ABDA,i,r.OwjD,r.IyJN,r._across_sessions)){r.qfrr.push(r.qIOQ);var l=(null==t?void 0:t.timeout)/(null==t?void 0:t.findinterval),f=(null==t?void 0:t.frameid)||"",d=null==t?void 0:t.url;window.location.href===d&&"view_visibility"===t.event_type&&!0===T(t.view_id,f,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,l)&&r.XvYs(!0),window.addEventListener("navigate",(function(e){var n=null==t?void 0:t.url;window.location.href===n&&"view_visibility"===t.event_type&&!0===T(t.view_id,f,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,l)&&r.XvYs(!0)}))}}},i=0;i<t;i++)n()})),s(this,"pnkr",(function(){if(r._across_sessions&&"ordered"===r.OwjD){var t=!1,n=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(n=JSON.parse(n))&&null!=n)for(var i=function(e){var i,o,a;if(null!==(i=r.qfrr[e])&&void 0!==i&&null!==(i=i.fHuv)&&void 0!==i&&i._timeEnabled&&void 0===r.qfrr[e].length){if("didn't"===r.qfrr[e].fHuv.DFrC){var s=r.qfrr[e].fHuv._id,u=r.ldkM(s,n);if(u)if(Date.now()>u.finishTime)r.qfrr[e].yoCa=!0,r.qfrr[e].XmsR=u.satisfiedCount,t=!0;else{var v=u.finishTime-Date.now(),l=r.qfrr[e].fHuv._eventCategory?r.qfrr[e].fHuv._eventCategory:"specific_event",f=new he;"specific_event"===l?(f.registerForEvent(b(r.qfrr[e].fHuv.vDdr)+"___"+r.qfrr[e].fHuv.uXsD.UGic,r.yLyk),r.bsQT=r.qfrr[e]):r.xrGZ(l),setTimeout((function(){e!==r.qfrr.length-1||r.xyKD||(r.qfrr[e].yoCa=!0,r.qfrr[e].XmsR=u.satisfiedCount,t=!0,"specific_event"===l?f.unregisterFromEvent(b(r.qfrr[e].fHuv.vDdr)+"___"+r.qfrr[e].fHuv.uXsD.UGic,r.yLyk):r.JoxB(r.qfrr[e]),r.XvYs())}),v)}}if("did"===r.qfrr[e].fHuv.DFrC){var d=r.qfrr[e].fHuv._id,c=r.ldkM(d,n);if(c)if(null==c.satisfiedCount){if(Date.now()<c.finishTime){r.vpAf=c,r.GGny=e;var _=c.finishTime-Date.now(),h=r.qfrr[e].fHuv._eventCategory?r.qfrr[e].fHuv._eventCategory:"specific_event",g=new he;"specific_event"===h?g.registerForEvent(b(r.qfrr[e].fHuv.vDdr)+"___"+r.qfrr[e].fHuv.uXsD.UGic,r.Daaj):r.xrGZ(h),setTimeout((function(){"specific_event"===h?g.unregisterFromEvent(b(r.qfrr[e].fHuv.vDdr)+"___"+r.qfrr[e].fHuv.uXsD.UGic,r.Daaj):r.JoxB(r.qfrr[e])}),_)}}else r.qfrr[e].XmsR=c.satisfiedCount,r.qfrr[e].yoCa=!0}}else t=r.BzBT(e,n);t&&(null===(o=r.qfrr[e])||void 0===o||null===(o=o.fHuv)||void 0===o||!o._timeEnabled||(null===(a=r.qfrr[e])||void 0===a?void 0:a.length)>1)?e===r.qfrr.length-1&&r.XvYs():t||void 0===!r.qfrr[e].length&&r.qfrr[e].jRNn()},o=0;o<r.qfrr.length;o++)i(o)}else if(r._across_sessions&&"unordered"===r.OwjD){var a=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(a=JSON.parse(a))&&null!=a)for(var s=0;s<r.qfrr.length;s++)r.BzBT(s,a)}})),s(this,"BzBT",(function(e,t){if(void 0===r.qfrr[e].length||1===r.qfrr[e].length){var n=r.qfrr[e].fHuv._id,i=!1,o=r.ldkM(n,t);if(o)r.JILc=o,i=(new K).dZrw(o.satisfiedCount,r.qfrr[e].fHuv.oBTS,r.qfrr[e].fHuv.SGjX),o&&(i?r.qfrr[e].yoCa=!0:r.qfrr[e].XmsR=o.satisfiedCount);else r.qfrr[e].jRNn();return i}if(r.qfrr[e].length>=1){var a,s,u;if("ordered"===(s=null===(a=r.qfrr[e])||void 0===a?void 0:a.sequence_type)||"strictly_ordered"===s){for(var v=0;v<r.qfrr[e].length;v++){var l=r.qfrr[e][v],f=l.fHuv._id;u=!1;var d=r.ldkM(f,t);if(d){if(u=(new K).dZrw(d.satisfiedCount,l.fHuv.oBTS,l.fHuv.SGjX),d)if(u){r.qfrr[e][v].yoCa=!0;var c=v+1,_=r.qfrr[e][v+1];void 0===_&&y(r.qfrr[e+1])&&(r.qfrr[e+1].jRNn(),u=!0),null!=_&&r.qfrr[e][v+1].jRNn(c)}else r.qfrr[e][v].XmsR=d.satisfiedCount}else(y(r.qfrr[e][v-1])&&!0===r.qfrr[e][v].yoCa||h(r.qfrr[e][v-1]))&&r.qfrr[e][v].jRNn()}return u}for(var g,m=0;m<r.qfrr[e].length;m++){var p=r.qfrr[e][0].fHuv.yztc;g="OR"!==p;var D=r.qfrr[e][m],w=D.fHuv._id;u=!1;var b=r.ldkM(w,t);if(b)u=(new K).dZrw(b.satisfiedCount,D.fHuv.oBTS,D.fHuv.SGjX),b&&(u?r.qfrr[e][m].yoCa=!0:r.qfrr[e][m].XmsR=b.satisfiedCount);else D.jRNn();g="AND"===p?g&&u:g||u}return g}})),s(this,"ldkM",(function(e,t){return t.find((function(t){return t.id===e}))})),s(this,"ReXr",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,i=he.getInstance();if(!(t<0)){var o=r.qfrr[t],a="unordered";if((null==o?void 0:o.length)>1&&(a=null==o?void 0:o.sequence_type),!0===r.OwjD||"ordered"===r.OwjD||"strictly_ordered"===r.OwjD||"ordered"===a||"strictly_ordered"===a){r.kpiIndex=t+1;var s=r.qfrr[t];if((null==s?void 0:s.length)>0){if(y(s))if("unordered"===r.OwjD&&"ordered"===a){var u=o[n-1];if(y(u))if(void 0===u.length||1==u.length){if(!u.yoCa)return}else if(u.length>1&&!r.yJXi(u))return;var v,l=o[n+1];if(y(l)){if(l.jRNn(n+1),"strictly_ordered"===r.OwjD){r._currentEventname=s[n].fHuv.uXsD.UGic;var f=e.getController();f.registerForEvent("APP_EVENT",r.nUlv),f.registerForEvent("CLIENT_EVENT",r.nUlv)}}else if("strictly_ordered"===a)1!=r.Zyiy&&r.XvYs();else(null===(v=o[n])||void 0===v?void 0:v.length)>0?r.yJXi(o)&&r.XvYs():r.XvYs()}else{var c,_=r.qfrr[t-1];if(y(_))if(void 0===_.length||1==_.length){if(!_.yoCa)return}else if(_.length>1&&!r.yJXi(_))return;if(void 0===s.length||1===s.length?c=r.qfrr[t+1]:s.length>1&&("ordered"===a||"strictly_ordered"===a?c=n===s.length-1?r.qfrr[t+1]:r.qfrr[t][n+1]:r.yJXi(s)&&(c=r.qfrr[t+1])),y(c)){if(void 0===c.length||1===c.length)c.jRNn(n+1);else if(r.yJXi(s))if(void 0===c.length)c.jRNn();else if(c.length>1)if("unordered"===c.sequence_type)for(var h=0;h<c.length;h++)c[h].jRNn(h);else"ordered"!==c.sequence_type&&"strictly_ordered"!==c.sequence_type||c[0].jRNn(0);if("strictly_ordered"===r.OwjD){r._currentEventname=s[n].fHuv.uXsD.UGic;var g=e.getController();g.registerForEvent("APP_EVENT",r.nUlv),g.registerForEvent("CLIENT_EVENT",r.nUlv)}}else"strictly_ordered"===r.OwjD?1!=r.Zyiy&&r.XvYs():r.yJXi(s)&&r.XvYs()}}else if(y(s)&&s.yoCa){s.gwWN[s.fHuv.uXsD.UGic]=Date.now();var m=r.qfrr[t-1];if(y(m))if(void 0===m.length||1==m.length){if(!m.yoCa)return}else if(m.length>1&&!r.yJXi(m))return;var p=r.qfrr[t+1];if(y(p)){var D,w;if(null!=p&&null!==(D=p.fHuv)&&void 0!==D&&D._timeEnabled){if("session"!=(null===(w=p.fHuv)||void 0===w?void 0:w._time.unit)){var E,A,C=X(p.fHuv._time.unit,p.fHuv._time.value);if("didn't"==(null===(E=p.fHuv)||void 0===E?void 0:E.DFrC)){if(r.DBxj=setTimeout((function(){if(r.xyKD)r.xyKD=!1;else{if(r.xyKD=!1,p.yoCa=!0,p.yoCa){p.XmsR+=1;var e=new K;if(p.yoCa=e.dZrw(p.XmsR,p.fHuv.oBTS,p.fHuv.SGjX),p.yoCa){p.fHuv.QQId=Date.now();var n=t+1,o=r.qfrr[n+1];y(o)?o.jRNn():r.XvYs()}}i.unregisterFromEvent(b(p.fHuv.vDdr)+"___"+p.fHuv.uXsD.UGic,r.yLyk),p.zWyW=!1}}),C),r._across_sessions){var x=X(p.fHuv._time.unit,p.fHuv._time.value),F=p.fHuv._timeEnabled,S=p.fHuv._id,T=new K;T.rbcW(p.fHuv.DFrC,p.fHuv.uXsD.UGic,Date.now(),p.fHuv.uXsD.cIhR,x,F,S)}"specific_event"===p.fHuv._eventCategory?(i.registerForEvent(b(p.fHuv.vDdr)+"___"+p.fHuv.uXsD.UGic,r.yLyk),r.bsQT=p):r.xrGZ(p)}else if("did"==(null===(A=p.fHuv)||void 0===A?void 0:A.DFrC)&&(r.xyKD=!1,r.jaQb=p,y(r.qfrr[t+2])&&r._across_sessions&&(r.YXfN=r.qfrr[t+2]),r.MhIU=setTimeout((function(){r.xyKD?r.xyKD=!1:(r.xyKD=!1,i.unregisterFromEvent(b(p.fHuv.vDdr)+"___"+p.fHuv.uXsD.UGic,r.SLEo))}),C),r.sHdE=s,r.timeForKPI=C,i.registerForEvent(b(p.fHuv.vDdr)+"___"+p.fHuv.uXsD.UGic,r.SLEo),r.FefJ=p,r._across_sessions)){var H=X(p.fHuv._time.unit,p.fHuv._time.value),I=p.fHuv._timeEnabled,q=p.fHuv._id,G=new K;G.rbcW(p.fHuv.DFrC,p.fHuv.uXsD.UGic,Date.now(),p.fHuv.uXsD.cIhR,H,I,q)}}}else if(p.length>0)if("ordered"===p.sequence_type||"strictly_ordered"===p.sequence_type)p[0].jRNn(n+1);else{var R,O=d(p);try{for(O.s();!(R=O.n()).done;){var k=R.value;k.jRNn()}}catch(e){O.e(e)}finally{O.f()}}else p.jRNn();if("strictly_ordered"===r.OwjD){r._currentEventname=s.fHuv.uXsD.UGic;var L=e.getController();L.registerForEvent("APP_EVENT",r.nUlv),L.registerForEvent("CLIENT_EVENT",r.nUlv)}}else"strictly_ordered"===r.OwjD?1!=r.Zyiy&&r.XvYs():r.XvYs()}}else r.iUCb(),r.XvYs()}})),s(this,"nUlv",(function(e){e&&e.name!=r._currentEventname&&(r.Zyiy=!0)})),s(this,"xrGZ",(function(e){var t=new he,n=e.fHuv._eventCategory;"apxor_event"===n?t.registerForEvent("apxor_event",r.yLyk):"customer_event"===n?t.registerForEvent("customer_event",r.yLyk):"any_event"===n?t.registerForEvent("any_event",r.yLyk):"campaign_event"===n?t.registerForEvent("campaign_event",r.yLyk):"survey_event"===n&&t.registerForEvent("survey_event",r.yLyk)})),s(this,"JoxB",(function(e){var t=new he,n=e.fHuv._eventCategory;"apxor_event"===n?t.unregisterFromEvent("apxor_event",r.yLyk):"customer_event"===n?t.unregisterFromEvent("customer_event",r.yLyk):"any_event"===n?t.unregisterFromEvent("any_event",r.yLyk):"campaign_event"===n?t.unregisterFromEvent("campaign_event",r.yLyk):"survey_event"===n&&t.unregisterFromEvent("survey_event",r.yLyk)})),s(this,"yLyk",(function(){var e,t;r.DBxj&&(r.xyKD=!1,clearTimeout(r.DBxj));var n=new he;r.xyKD=!0,r._across_sessions&&null!==localStorage.getItem("apx_nokpi_triggerdetails")&&localStorage.removeItem("apx_nokpi_triggerdetails"),n.unregisterFromEvent(b(null===(e=r.bsQT)||void 0===e||null===(e=e.fHuv)||void 0===e?void 0:e.vDdr)+"___"+(null===(t=r.bsQT)||void 0===t||null===(t=t.fHuv)||void 0===t||null===(t=t.uXsD)||void 0===t?void 0:t.UGic),r.yLyk)})),s(this,"SLEo",(function(){var t,n,i,o=new he;r.xyKD=!0,r.MhIU&&clearTimeout(r.MhIU);var a=new K;if(r.jaQb.XmsR+=1,r.jaQb.yoCa=a.dZrw(r.jaQb.XmsR,r.jaQb.fHuv.oBTS,r.jaQb.fHuv.SGjX),o.unregisterFromEvent(b(null===(t=r.FefJ)||void 0===t||null===(t=t.fHuv)||void 0===t?void 0:t.vDdr)+"___"+(null===(n=r.FefJ)||void 0===n||null===(n=n.fHuv)||void 0===n?void 0:n.uXsD.UGic),r.SLEo),r._across_sessions&&null!==(i=r.YXfN)&&void 0!==i&&i.fHuv._timeBased){var s,u,v,l=e.getController().getFromStorage("apx_nokpi_triggerdetails");l=null==l?[]:JSON.parse(l);for(var f=0;f<l.length;f++)if(r.no_KPI_TriggerDetails[f].id===r.YXfN.fHuv._id){s=!0,u=l[f];break}if(s)u.satisfiedCount+=1;else{var d=r.jaQb.fHuv._id,c=r.jaQb.fHuv.DFrC,_=r.jaQb.fHuv.uXsD.UGic,h=r.jaQb.fHuv.uXsD.cIhR;v={id:d,type:c,time:Date.now(),name:_,additionalInfo:h,satisfiedCount:r.jaQb.fHuv._timeEnabled,timeBased:r.jaQb.fHuv._timeEnabled},r.no_KPI_TriggerDetails.push(v)}}if(r.jaQb.yoCa){var g=r.qfrr[r.kpiIndex+1];y(g)?g.jRNn():r.XvYs()}})),s(this,"Daaj",(function(){if(r.GGny===r.qfrr.length-1){r.vtAp=!0;r.qfrr[r.GGny]&&(r.qfrr[r.GGny].XmsR=r.vpAf.satisfiedCount,r.qfrr[r.GGny].yoCa=!0,r.XvYs())}else{var t,n,i=e.getController().getFromStorage("apx_nokpi_triggerdetails");i=null==i?[]:JSON.parse(i);for(var o=0;o<i.length;o++)if(i[o].id===r.GGny){n=!0,t=i[o];break}if(n&&(t.satisfiedCount=1),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(i)),r.qfrr[r.GGny].XmsR=r.vpAf.satisfiedCount,r.qfrr[r.GGny].yoCa=!0,r.qfrr[r.GGny+1].fHuv._timeEnabled){var a=X(r.qfrr[r.GGny+1].fHuv._time.unit,r.qfrr[r.GGny+1].fHuv._time.value),s=r.qfrr[r.GGny+1].fHuv._timeEnabled,u=r.qfrr[r.GGny+1].fHuv._id,v=r.qfrr[r.GGny+1].XmsR,l=r.qfrr[r.GGny+1].fHuv.uXsD.UGic,f=r.qfrr[r.GGny+1].uXsD.cIhR;(new K).rbcW(r.fHuv.DFrC,l,Date.now(),f,a,s,u,v)}}})),s(this,"iUCb",(function(){if(r._across_sessions&&r.RlZB){var t,n,i,o="single",a=!1,s=e.getController().getFromStorage("apx_nokpi_triggerdetails");if((s=JSON.parse(s)).length>0){var u,v=d(s);try{var l=function(){var e=u.value,s=e.id,v=e.satisfiedCount;if(t=r.qfrr.find((function(e,t){if(1===(null==e?void 0:e.length)||void 0===(null==e?void 0:e.length)){if(e.fHuv._id===s)return o="single",n=t,!0}else if(e.length>0){var r=e.findIndex((function(e){return e.fHuv._id===s}));if(-1!==r)return n=t,i=r,o="group",!0}return!1})),"single"===o&&t){var l=new K;a=l.dZrw(v,t.fHuv.oBTS,t.fHuv.SGjX);var f=r.qfrr.findIndex((function(e){var t;return(null==e||null===(t=e.fHuv)||void 0===t?void 0:t._id)===s}));void 0===f&&(f=n),a&&(r.qfrr[f].yoCa=!0)}else if("group"===o&&t){var d=new K;(a=d.dZrw(v,t[i].fHuv.oBTS,t[i].fHuv.SGjX))&&(r.qfrr[n][i].yoCa=!0)}};for(v.s();!(u=v.n()).done;)l()}catch(e){v.e(e)}finally{v.f()}}}})),s(this,"cAjr",(function(e){e<0||r.hFnp()})),s(this,"XvYs",(function(){var t,i,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!==(i=window.ApxorRTM)&&void 0!==i&&i.badgesLists.includes(r.ABDA)&&e.getController().isBadgeTriggerSatisfied(r.ABDA)||null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===r.ofFb.DFrC?"survey":"campaign",apx_nudge_id:r.ABDA,apx_nudge_name:r.ofFb.UGic,message_name:r.ofFb.UGic,id:r.ABDA,apx_variant_code:r.ofFb._isExperiment||r.ofFb._only_context?r.ofFb._attr.apx_variant_code:"TG"}),!(r.AEyV.validate()&&r.Rtvw.validate(a,s)&&r.Rlua.validate()&&r.SXtO.validate())){r.ofFb.DFrC;return r.Rlua.retainedDaysValidated?r.Rlua.retainedSessionValidated?r.Rlua.eventDoneInLT?void r.IdAw("Event done in life time"):r.Rtvw.userAttributesValidated?r.Rtvw.sessionAttributeValidated?r.AEyV._not_in_specified_time?void r.IdAw("Time limits check failed"):r.AEyV._not_yet_active?void r.IdAw("not in the scheduled time"):r.AEyV._nudge_expired?void r.IdAw("nudge expired"):void 0:void r.IdAw("Session property filter not met"):void r.IdAw("User property filter not met"):void r.IdAw("User session criteria not met"):void r.IdAw("Retained day criteria not met")}var u=r.qfrr.length,v=u<1,l="";0===u&&(v=!0);for(var f=0;f<u;f++){var c=void 0,_=r.qfrr[f];if(_.length>1){var h=_[0].fHuv.yztc;c="AND"===h;for(var g=0;g<_.length;g++){var y=_[0].fHuv.yztc;c="AND"===y?c&&_[g].yoCa:c||_[g].yoCa}}else c=_.yoCa;if(""===l.trim())v=c;else switch(l){case"AND":v=v&&c;break;case"OR":v=v||c}l=_.length>1?r.groupCombineOperator:_.yztc}if(!0===o&&(v=!0),v){if(console.debug("onCondition satisfied"),!r.sqke.Vsbc(r.ABDA))return void console.warn("Maximum limit reached",r.ABDA);r._across_sessions&&localStorage.removeItem("apx_nokpi_triggerdetails");var m,p=d(r.qfrr);try{for(p.s();!(m=p.n()).done;){var D=m.value;if(1===(null==D?void 0:D.length)||void 0===(null==D?void 0:D.length))D.yoCa=!1,D.XmsR=0;else{var w,b=d(D);try{for(b.s();!(w=b.n()).done;){var E=w.value;E.yoCa=!1,E.XmsR=0}}catch(e){b.e(e)}finally{b.f()}}}}catch(e){p.e(e)}finally{p.f()}if(r.qIOQ.oFex(r.qfrr),r.qfrr=[],r.TNJX(r.JWQI,r.ymdm),!0===r.ofFb._only_context){var A="SURVEY"===r.ofFb.DFrC?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},r.ofFb._attr),{},{message_name:r.ofFb.UGic,apx_nudge_name:r.ofFb.UGic,apx_nudge_id:r.ABDA,id:r.ABDA}),!1,"",A)}e.getController().dispatchEvent(r.ofFb.DFrC,{name:r.ofFb.DFrC,additional_info:{uuid:r.ABDA,name:r.ofFb.UGic}})}})),s(this,"hFnp",(function(){for(var t=r.vqdX.length,i=t<1,o="",a=0;a<t;a++){var s=r.vqdX[a],u=s.yoCa;if(""===o.trim())i=u;else switch(o){case"AND":i=i&&u;break;case"OR":i=i||u}o=s.eMRD}if(i){if(e.getController().persistTerminationInfoLocally(r.ABDA),!0===r.ofFb._only_context){var v="SURVEY"===r.ofFb.DFrC?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},r.ofFb._attr),{},{message_name:r.ofFb.UGic,apx_nudge_name:r.ofFb.UGic,apx_nudge_id:r.ABDA,id:r.ABDA}),!1,"apxor",v)}e.getController().dispatchEvent(r.ofFb.DFrC,{name:r.ofFb.DFrC,additional_info:{uuid:r.ABDA,name:r.ofFb.UGic}})}})),s(this,"validateForTerminationAttributes",(function(){var t=e.getController().getUserAttributes(),n=e.getController().getSessionAttributes();return r.TAxm.validate(t,n)})),s(this,"RQvg",(function(){r.sqke.RQvg()})),s(this,"getFrequencyCount",(function(){return r.sqke.getFrequencyCount()})),s(this,"RVJD",(function(){return r.sqke.TyZe()})),s(this,"yJXi",(function(e){var t;t="AND"===e[0].fHuv.yztc;for(var n=0;n<e.length;n++){t="AND"===e[0].fHuv.yztc?t&&e[n].yoCa:t||e[n].yoCa}return t})),s(this,"IdAw",(function(t){var n;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===r.ofFb.DFrC?"survey":"campaign",apx_nudge_id:r.ABDA,apx_nudge_name:r.ofFb.UGic,message_name:r.ofFb.UGic,id:r.ABDA,apx_variant_code:r.ofFb._isExperiment||r.ofFb._only_context?null===(n=r.ofFb._attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),fe=a((function e(){var t=this;i(this,e),s(this,"zCLd",{}),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(y(e)&&y(e.configs)){var n=e.configs;if(!Array.isArray(n))return;n.sort((function(e,t){var n,r;return(null!==(n=e.prio)&&void 0!==n?n:-1)-(null!==(r=t.prio)&&void 0!==r?r:-1)}));for(var r=0;r<n.length;r++){var i=n[r],o=i._id,a=new le;a.parse(i)?t.zCLd[o]=a:console.warn("Failed to parse cfg",o)}}})),s(this,"validate",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(t.zCLd[e]){var i=t.zCLd[e];i.ReXr(n,r)}})),s(this,"getVariantCode",(function(e){return t.zCLd[e]?t.zCLd[e]._variant_code:""})),s(this,"validateForTermination",(function(e,n){t.zCLd[e]&&t.zCLd[e].cAjr(n)})),s(this,"validateForTerminationAttributes",(function(e){return!!t.zCLd[e]&&t.zCLd[e].validateForTerminationAttributes()})),s(this,"RQvg",(function(e){t.zCLd[e].RQvg()})),s(this,"getFrequencyCount",(function(e){var n=t.zCLd[e];if(null!=n)return n.getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var e=t.zCLd;for(var n in e)e[n].RVJD()})),s(this,"EAAe",(function(e){try{if(t.zCLd){var n=t.zCLd[e];if(n&&n.ofFb)return n.ofFb}}catch(e){console.log("Error in getting the campaign meta ".concat(e))}return{}}))})),de=window.ApxorLogger,ce=a((function t(){var n=this;i(this,t),s(this,"VhOV",{}),s(this,"VRqD",[]),s(this,"KSTc",!1),s(this,"initialize",(function(){var t=e.getController();t.registerForEvent("APP_EVENT",(function(e){return n.YXge(e,"AE")})),t.registerForEvent("CLIENT_EVENT",(function(e){return n.YXge(e,"CE")}))})),s(this,"nARi",(function(){var e,t=d(n.VRqD);try{for(t.s();!(e=t.n()).done;){var r=e.value;n.pMOK(r.event,r.key,r.type)}}catch(e){t.e(e)}finally{t.f()}n.KSTc=!0})),s(this,"zXsm",(function(e,t){var r;"function"==typeof t&&((r=n.VhOV[e]?n.VhOV[e]:[]).push(t),n.VhOV[e]=r,de.debug("Listeners list: ",n.VhOV))})),s(this,"unregisterFromEvent",(function(e,t){if(n.VhOV[e]){for(var r=n.VhOV[e],i=[],o=0;o<r.length;o++){var a=r[o];a!==t&&i.push(a)}n.VhOV[e]=i}})),s(this,"YXge",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE";n.pMOK(e,"any_event",t),"apxor"===(null==e?void 0:e.loggedBy)?n.pMOK(e,"apxor_event",t):"customer"===(null==e?void 0:e.loggedBy)&&n.pMOK(e,"customer_event",t),"campaign"===(null==e?void 0:e.apx_nudge_type)?n.pMOK(e,"campaign_event",t):"survey"===(null==e?void 0:e.apx_nudge_type)&&n.pMOK(e,"survey_event",t);var r=t+"___"+e.name;n.pMOK(e,r,t)})),s(this,"pMOK",(function(t,r,i){if(n.KSTc){if(de.debug("Notifying listeners for event: "+t+", "+r,n.VhOV),n.VhOV[r])for(var o=n.VhOV[r],a=e.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(i,t.name,a,t.additional_info)}}else n.VRqD.push({event:t,key:r,type:i})}))})),_e=window.ApxorLogger,he=function(){function t(){var n=this;return i(this,t),s(this,"Zogu",!1),s(this,"DCuT",null),s(this,"eElz",x()),s(this,"uUxG",new ce),s(this,"sNNK",e.getSiteId()),s(this,"kRBX",{}),s(this,"getQeState",(function(){try{var t=e.getController().getFromStorage("qe_state");return t?JSON.parse(D(n.sNNK,t)):(n.kRBX={},n.setQeState())}catch(e){return n.kRBX={},n.setQeState()}})),s(this,"setQeState",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{e.getController().persistToStorage("qe_state",n.kRBX,!0)}catch(r){""===t?n.kRBX={}:n.kRBX[t]={SESSION:0,OVERALL:0,DATES:{}},e.getController().persistToStorage("qe_state",n.kRBX,!0)}return n.kRBX})),s(this,"initialize",(function(){n.Zogu||(n.Zogu=!0,n.DCuT=new fe,n.uUxG.initialize(),n.kRBX=n.getQeState(),_e.info("QE Initialized.."))})),s(this,"parse",(function(e){n.iwiH()?(n.DCuT.parse(e),n.uUxG.nARi()):_e.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;n.iwiH()&&n.DCuT.validate(e,t,r)})),s(this,"getVariantCode",(function(e){return n.DCuT.getVariantCode(e)})),s(this,"validateForTermination",(function(e,t){n.iwiH()&&n.DCuT.validateForTermination(e,t)})),s(this,"validateForTerminationAttributes",(function(e,t){return n.DCuT.validateForTerminationAttributes(e,t)})),s(this,"updateCount",(function(e){try{y(n.kRBX[e])||n.createObjConfig(e),n.incrementFrequencies(e),n.setQeState(e),n.DCuT.RQvg(e)}catch(e){console.log("Could not update the count config:".concat(e))}})),s(this,"resetFrequencyCounts",(function(){n.DCuT.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(e){return n.DCuT.getFrequencyCount(e)})),s(this,"registerForEvent",(function(e,t){n.uUxG.zXsm(e,t)})),s(this,"unregisterFromEvent",(function(e,t){n.uUxG.unregisterFromEvent(e,t)})),s(this,"notifyEventListener",(function(e){n.uUxG.YXge(e)})),s(this,"fetch",(function(t,n,r,i){e.getController().fetchConfiguration(t,n,r,i)})),s(this,"iwiH",(function(){return n.Zogu})),s(this,"getCampaignMetaFromQueryEngine",(function(e){return n.DCuT.EAAe(e)})),s(this,"ihPs",(function(){return n.eElz})),t.instance||(t.instance=this),t.instance}return a(t,[{key:"createObjConfig",value:function(e){try{this.kRBX=this.getQeState(),y(this.kRBX[e])||(this.kRBX[e]={SESSION:0,OVERALL:0,DATES:{}},this.eElz&&(this.kRBX[e].DATES[this.eElz]=0),this.setQeState(e))}catch(e){_e.error("Can not create the frequency count object:"+e)}}},{key:"incrementFrequencies",value:function(e){this.kRBX=this.getQeState();var t=this.kRBX[e];t.SESSION=t.SESSION+1,t.OVERALL=t.OVERALL+1;var n=x();n===this.eElz&&t.DATES&&t.DATES[n]||(this.eElz=n,t.DATES={},t.DATES[this.eElz]=0),t.DATES[this.eElz]=t.DATES[this.eElz]+1}}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}}]),t}();s(he,"instance",void 0),window.ceVersion=205;try{void 0===exports&&null===exports||(exports.default=he,module.exports=exports.default)}catch(e){}return he}));
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 v(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 v(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)?v(e,t):void 0}}function v(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 c(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 m=window.ApxorLogger,_=function(e){return void 0===e},g=function(e){return null===e},h=function(e){return void 0!==e&&!g(e)},p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function x(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 x(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))},y=function(e){return h(e)&&!g(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"},E=function(e){return e.toUpperCase()},q=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 P(t).test(e);default:return!1}},P=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)},C=function(){var e=new Date;return e.getDate()+"/"+e.getMonth()+"/"+e.getFullYear()},N=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}},S=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}},J=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 F(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=B(e,t);if(o){var a=function(){if(A(o)){return function(e){return Q(e)}(o)}return m.info("Invalid target element. Width and height are 0 for element: ".concat(e,". Can't show tooltip")),!1};return a()}return n?(m.info("Not found yet. Rechecking the DOM."),D(r,i,e,t)):(m.info("Element with selector:".concat(e," not found.")),!1)}function D(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=setInterval((function(){var t=B(n,i);if(t){clearInterval(r);!function(){if(A()){Q()}else m.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 B=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=O(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},O=function(e){var t=e.indexOf("svg");-1!==t&&(e=e.substring(0,t)+"svg:svg");try{return document.Aucg(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 U(e,t){for(var n=0;n<e.length;n++)if(e[n].hasOwnProperty(t))return e[n];return null}function Q(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)},k=window.ApxorLogger,I=a((function t(){var n=this;r(this,t),s(this,"nsof","ALL"),s(this,"ulHm",[]),s(this,"CeJC",[]),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.nsof=e.audience.audience_type,n.ulHm=e.audience.attributes.user,n.CeJC=e.audience.attributes.session,!Array.isArray(n.ulHm)||!Array.isArray(n.CeJC))return k.error("No attributes"),!1}catch(e){return k.error(e),!1}return!0})),s(this,"validate",(function(t,i){var r=!0;"FTU"===n.nsof&&(r=e.getController().getSessionInfo().is_first_session);var o=n.jOrD(t,n.ulHm),a=n.jOrD(i,n.CeJC);return o||(n.userAttributesValidated=!1),a||(n.sessionAttributeValidated=!1),r&&o&&a})),s(this,"jOrD",(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),q(e,t,r)}))}));i=i&&l},a=0;a<n;a++)if(r=o())return r.v}catch(e){k.error(e),i=!1}return i}))})),z=a((function e(){var t=this;r(this,e),s(this,"xzwb",""),s(this,"dJmV",{}),s(this,"QyOe",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{t.xzwb=e.name,t.dJmV=e.additional_info,t.QyOe=null==e?void 0:e.path}catch(e){return!1}return!0}))})),H=a((function e(){var t=this;r(this,e),s(this,"TXQK",0),s(this,"CHsu",0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.TXQK=Number(e.lower),t.CHsu=Number(e.upper),isNaN(t.TXQK)||isNaN(t.CHsu))return!1}catch(e){return!1}return!0}))})),L=a((function e(){var t=this;r(this,e),s(this,"dOFY",0),s(this,"xSBr",""),s(this,"MkCy",""),s(this,"ibJq",new z),s(this,"Ntar",new H),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.xSBr=e.event_type,t.MkCy=e.activity,t.ibJq.parse(e.details)&&t.Ntar.parse(e.time_bounds)}catch(e){return!1}}))})),V=window.ApxorLogger,R=a((function e(){var t=this;r(this,e),s(this,"dOFY",0),s(this,"bixt",-1),s(this,"QFyt",0),s(this,"iRtE",""),s(this,"MkCy",""),s(this,"xSBr",""),s(this,"Ntar",new H),s(this,"ibJq",new z),s(this,"kjMu",new L),s(this,"AkEr","AND"),s(this,"rhwL",!1),s(this,"nsof",void 0),s(this,"CgVC",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;return t.bixt=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.QFyt=null==e||null===(n=e.count_config)||void 0===n?void 0:n.count,t.iRtE=null==e||null===(i=e.count_config)||void 0===i?void 0:i.operator,t.MkCy=null==e?void 0:e.activity,t.xSBr=null==e?void 0:e.event_type,t.AkEr=e.combine_operator,t._timeEnabled=null==e?void 0:e.time_enabled,t._time=null==e?void 0:e.time,t.nsof=null==e?void 0:e.type,t.CgVC=null==e?void 0:e.route,t.ibJq.parse(null==e?void 0:e.details)&&t.kjMu.parse(e.trigger)&&t.Ntar.parse(e.time_bounds)}catch(e){return V.error(e),!1}}))})),G=window.ApxorLogger,Y=a((function e(){var t=this;r(this,e),s(this,"QFyt",0),s(this,"iRtE",""),s(this,"xSBr",""),s(this,"Ntar",new H),s(this,"ibJq",new z),s(this,"AkEr","AND"),s(this,"parse",(function(e){try{return t.QFyt=e.count_config.count,t.iRtE=e.count_config.operator,t.xSBr=e.event_type,t.AkEr=e.combine_operator,t.ibJq.parse(e.details)&&t.Ntar.parse(e.time_bounds)}catch(e){return G.error(e),!1}}))})),K=window.ApxorLogger,M=function(){function t(){var n=this;r(this,t),s(this,"GzHO",0),s(this,"JoRn",""),s(this,"mexP",new R),s(this,"BVIn",new Y),s(this,"YxSd",!1),s(this,"aDKl",!1),s(this,"XbNi",0),s(this,"AkEr","AND"),s(this,"WEZq","OR"),s(this,"MYvF",-1),s(this,"mRoO",[]),s(this,"jLlv",{}),s(this,"HMAY",!1),s(this,"vMOr",void 0),s(this,"YVgd",void 0),s(this,"rcck",void 0),s(this,"nwtY",void 0),s(this,"no_KPI_TriggerDetails",[]),s(this,"CWjb",!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.JoRn=i,n.XbNi=r,n.mRoO=a,n.vMOr=o,n.childConditionIndex=u,n.across_sessions=s||!1,"termination"===l&&""!==l){n.BVIn.parse(t);return n.WEZq=n.BVIn.AkEr,n.Pish(),!0}var v=n.mexP.parse(t);if(v){if(n.AkEr=n.mexP.AkEr,n.mexP.rhwL){var c=n.mexP.ibJq.xzwb;"APX_PAGE_OPENED"===c&&(c=n.mexP.ibJq.dJmV.navigation_id,c=h(c)?c:n.mexP.ibJq.xzwb),n.MYvF=e.getController().getEventCount(c);var f=n.mexP.QFyt,m=n.mexP.iRtE;if(n.aDKl=n.HdGU(n.MYvF-1,f,m,!1),n.YxSd=n.aDKl,n.aDKl&&"APX_PAGE_OPENED"===n.mexP.ibJq.xzwb)return!0}return!0===d&&(o&&0!==r&&"unordered"!==o||n.FrQX()),!0}return!1})),s(this,"FrQX",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1!=t&&(n.YVgd=t);var i=n.mexP,r=null!=i&&i._eventCategory?null==i?void 0:i._eventCategory:"specific_event",o=i.kjMu,a=_e.getInstance();if("app_start"===o.xSBr)if(n.YxSd=!0,null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var s=S(i._time.unit,i._time.value);if("didn't"==(null==i?void 0:i.nsof)){if(n.HMAY=!1,n.timerDidnt=setTimeout((function(){n.HMAY||(n.aDKl=!0,n.aDKl&&(n.GzHO+=1,n.aDKl=n.HdGU(n.GzHO,n.mexP.QFyt,n.mexP.iRtE),n.aDKl&&(n.mexP.dOFY=Date.now(),n.HMAY=!1,a.validate(n.JoRn,n.XbNi,n.YVgd))),"specific_event"===r?a.unregisterFromEvent(w(n.mexP.xSBr)+"___"+n.mexP.ibJq.xzwb,n.rZPL):n.weks(r),n.YxSd=!1)}),s),n.across_sessions){var l=S(i._time.unit,i._time.value),u=i._timeEnabled,d=i._id;n.fNfw(i.nsof,i.ibJq.xzwb,Date.now(),i.ibJq.dJmV,l,u,d)}"specific_event"===r?(a.registerForEvent(w(n.mexP.xSBr)+"___"+n.mexP.ibJq.xzwb,n.rZPL),n.nwtY=n.mexP):n.ziqw(r)}else if("did"==(null==i?void 0:i.nsof)){if(n.timerDid=setTimeout((function(){n.CWjb||("specific_event"===r?a.unregisterFromEvent(w(n.mexP.xSBr)+"___"+n.mexP.ibJq.xzwb,n.CEGq):n.xgoC(r))}),s),n.across_sessions){var v=S(i._time.unit,i._time.value),c=i._timeEnabled,f=i._id;n.fNfw(i.nsof,i.ibJq.xzwb,Date.now(),i.ibJq.dJmV,v,c,f)}"specific_event"===r?(a.registerForEvent(w(n.mexP.xSBr)+"___"+n.mexP.ibJq.xzwb,n.CEGq),n.rcck=n.mexP):n.jMQp(r)}}}else"specific_event"===r?a.registerForEvent(w(i.xSBr)+"___"+i.ibJq.xzwb,n.lVwH):n.XYBa(r);else if(null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var m=S(i._time.unit,i._time.value);"didn't"==(null==i?void 0:i.nsof)?(n.HMAY=!1,n.timerDidnt=setTimeout((function(){n.HMAY||(n.aDKl=!0,n.aDKl&&(n.GzHO+=1,n.aDKl=n.HdGU(n.GzHO,n.mexP.QFyt,n.mexP.iRtE),n.aDKl&&(n.mexP.dOFY=Date.now(),n.HMAY=!1,a.validate(n.JoRn,n.XbNi)))),"specific_event"===r&&a.unregisterFromEvent(w(n.mexP.xSBr)+"___"+n.mexP.ibJq.xzwb,n.rZPL),n.YxSd=!1}),m),"specific_event"===r?(a.registerForEvent(w(n.mexP.xSBr)+"___"+n.mexP.ibJq.xzwb,n.rZPL),n.nwtY=n.mexP):n.ziqw()):"did"==(null==i?void 0:i.nsof)&&(n.timerDid=setTimeout((function(){n.CWjb||"specific_event"===r&&a.unregisterFromEvent(w(n.mexP.xSBr)+"___"+n.mexP.ibJq.xzwb,n.CEGq)}),m),"specific_event"===r&&a.registerForEvent(w(n.mexP.xSBr)+"___"+n.mexP.ibJq.xzwb,n.CEGq))}}else"specific_event"===r&&a.registerForEvent(w(i.xSBr)+"___"+o.ibJq.xzwb,n.lVwH);null!==(e=window.ApxorRTM)&&void 0!==e&&e.badgesLists.includes(n.JoRn)&&a.registerForEvent(w(i.xSBr)+"___"+"apxor-badge-container-".concat("-".concat(n.JoRn).replaceAll(" ","").replace(/[^\w\s]/gi,"")),n.lVwH)})),s(this,"XYBa",(function(e){var t=new _e;"apxor_event"===e?t.registerForEvent("apxor_event",(function(e,t,i,r){n.lVwH(w(n.mexP.xSBr),n.mexP.ibJq.xzwb,i,n.mexP.ibJq.dJmV)})):"customer_event"===e?t.registerForEvent("customer_event",(function(e,t,i,r){n.lVwH(w(n.mexP.xSBr),n.mexP.ibJq.xzwb,i,n.mexP.ibJq.dJmV)})):"any_event"===e?t.registerForEvent("any_event",(function(e,t,i,r){n.lVwH(w(n.mexP.xSBr),n.mexP.ibJq.xzwb,i,n.mexP.ibJq.dJmV)})):"campaign_event"===e?t.registerForEvent("campaign_event",(function(e,t,i,r){n.lVwH(w(n.mexP.xSBr),n.mexP.ibJq.xzwb,i,n.mexP.ibJq.dJmV)})):"survey_event"===e&&t.registerForEvent("survey_event",(function(e,t,i,r){n.lVwH(w(n.mexP.xSBr),n.mexP.ibJq.xzwb,i,n.mexP.ibJq.dJmV)}))})),s(this,"weks",(function(e){var t=new _e,i=n.mexP._eventCategory;"apxor_event"===i?t.unregisterFromEvent("apxor_event",n.rZPL):"customer_event"===i?t.unregisterFromEvent("customer_event",n.rZPL):"any_event"===i?t.unregisterFromEvent("any_event",n.rZPL):"campaign_event"===i?t.unregisterFromEvent("campaign_event",n.rZPL):"survey_event"===i&&t.unregisterFromEvent("survey_event",n.rZPL)})),s(this,"ziqw",(function(){var e=new _e,t=n.mexP._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.rZPL):"customer_event"===t?e.registerForEvent("customer_event",n.rZPL):"any_event"===t?e.registerForEvent("any_event",n.rZPL):"campaign_event"===t?e.registerForEvent("campaign_event",n.rZPL):"survey_event"===t&&e.registerForEvent("survey_event",n.rZPL)})),s(this,"jMQp",(function(){var e=new _e,t=n.mexP._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.CEGq):"customer_event"===t?e.registerForEvent("customer_event",n.CEGq):"any_event"===t?e.registerForEvent("any_event",n.CEGq):"campaign_event"===t?e.registerForEvent("campaign_event",n.CEGq):"survey_event"===t&&e.registerForEvent("survey_event",n.CEGq)})),s(this,"xgoC",(function(){var e=new _e,t=n.mexP._eventCategory;"apxor_event"===t?e.unregisterFromEvent("apxor_event",n.CEGq):"customer_event"===t?e.unregisterFromEvent("customer_event",n.CEGq):"any_event"===t?e.unregisterFromEvent("any_event",n.CEGq):"campaign_event"===t?e.unregisterFromEvent("campaign_event",n.CEGq):"survey_event"===t&&e.unregisterFromEvent("survey_event",n.CEGq)})),s(this,"Pish",(function(){var e=n.BVIn,t=_e.getInstance();n.YxSd=!0,t.registerForEvent(w(e.xSBr)+"___"+e.ibJq.xzwb,n.uPKN)})),s(this,"mHqK",(function(e,t,i,r){var o,a=(Date.now()-n.jLlv[t])/1e3;(null===(o=n.mexP)||void 0===o||null===(o=o.ibJq)||void 0===o||null===(o=o.dJmV)||void 0===o?void 0:o.time)/1e3>a&&n._displayCampaign(i)})),s(this,"uNpH",(function(e,t,i,r){var o,a;n.HMAY=!0;var s=Date.now(),l=null===(o=n.mexP)||void 0===o||null===(o=o.kjMu)||void 0===o?void 0:o.ibJq.xzwb,u=(s-n.jLlv[l])/1e3,d=null===(a=n.mexP)||void 0===a||null===(a=a.ibJq)||void 0===a||null===(a=a.dJmV)||void 0===a?void 0:a.time;(d/=1e3)>u&&n._displayCampaign(i)})),s(this,"CEGq",(function(){n.CWjb=!0;var e=new _e;clearTimeout(n.timerDid),n.GzHO+=1,n.aDKl=n.HdGU(n.GzHO,n.mexP.QFyt,n.mexP.iRtE),n.aDKl&&(e.unregisterFromEvent(w(n.rcck.xSBr)+"___"+n.rcck.ibJq.xzwb,n.CEGq),n.CWjb=!1,e.validate(n.JoRn,n.XbNi,n.YVgd))})),s(this,"rZPL",(function(e,t,i,r){n.HMAY=!0,clearTimeout(n.timerDidnt),(new _e).unregisterFromEvent(w(n.nwtY.xSBr)+"___"+n.nwtY.ibJq.xzwb,n.rZPL)})),s(this,"lVwH",(function(t,i,r,o){var a,s,l=_e.getInstance();if(n.YxSd){if(null!==(a=window.ApxorRTM)&&void 0!==a&&a.isBadgePresent&&null!==(s=window.ApxorRTM)&&void 0!==s&&s.badgesLists.includes(n.JoRn)&&e.getController().isBadgeTriggerSatisfied(n.JoRn))return n.aDKl=!0,n.mexP.dOFY=r,void l.validate(n.JoRn,n.XbNi);if(w(n.mexP.xSBr)===t&&n.RlLV(r-n.mexP.kjMu.dOFY,n.mexP.Ntar)&&n.mexP.ibJq.xzwb===i&&n.NJet(n.mexP.ibJq.dJmV,o)&&(n.GzHO+=1,n.aDKl=n.HdGU(n.GzHO,n.mexP.QFyt,n.mexP.iRtE),n.aDKl)){if(n.mexP.dOFY=r,n.across_sessions){var u=S(n.mexP._time.unit,n.mexP._time.value),d=n.mexP._timeEnabled,v=n.mexP._id,c=n.GzHO;n.fNfw(n.mexP.nsof,i,r,o,u,d,v,c)}l.validate(n.JoRn,n.XbNi,n.YVgd)}}else if(n.YxSd=n.hpjq(t,i,r,o),n.YxSd){var f=n.mexP,m=f.kjMu;if(m.dOFY=r,"activity_time"===(null==f?void 0:f.xSBr)){var _,g,h,p,x=null==f||null===(_=f.ibJq)||void 0===_||null===(_=_.dJmV)||void 0===_?void 0:_.time;(null==f||null===(g=f.CgVC)||void 0===g?void 0:g.length)>0?setTimeout((function(){var t;(null===(t=e.getController())||void 0===t?void 0:t._appEventsNoKpi).length<=2&&f.CgVC===location.pathname&&n._displayCampaign(r)}),x):(null==f||null===(h=f.ibJq)||void 0===h||null===(h=h.dJmV)||void 0===h?void 0:h.nkpi.length)>0?(setTimeout((function(){n.HMAY||(n.aDKl=!0,n.aDKl&&(n.GzHO+=1,n.aDKl=n.HdGU(n.GzHO,n.mexP.QFyt,n.mexP.iRtE),n.aDKl&&(n.mexP.dOFY=r,n.HMAY=!1,l.validate(n.JoRn,n.XbNi)))),f.ibJq.dJmV.nkpi.map((function(e){l.unregisterFromEvent(E(f.ibJq.dJmV.et)+"___"+e,n),n.YxSd=!1}))}),x),f.ibJq.dJmV.nkpi.map((function(e){l.registerForEvent(E(f.ibJq.dJmV.et)+"___"+e,n.rZPL)}))):(null==f||null===(p=f.ibJq)||void 0===p||null===(p=p.dJmV)||void 0===p?void 0:p.kpi.length)>0&&(setTimeout((function(){f.ibJq.dJmV.kpi.map((function(e){l.unregisterFromEvent(E(f.ibJq.dJmV.et)+"___"+e,n)}))}),x),f.ibJq.dJmV.kpi.map((function(e){e===f.kjMu.ibJq.xzwb?(l.unregisterFromEvent(w(m.xSBr)+"___"+m.ibJq.xzwb,n),l.registerForEvent(E(f.ibJq.dJmV.et)+"___"+e,n.mHqK)):l.registerForEvent(E(f.ibJq.dJmV.et)+"___"+e,n.uNpH)})))}else l.unregisterFromEvent(w(m.xSBr)+"___"+m.ibJq.xzwb,n),l.registerForEvent(w(f.xSBr)+"___"+f.ibJq.xzwb,n);n.jLlv[i]=Date.now()}})),s(this,"uPKN",(function(e,t,i,r){var o=_e.getInstance();w(n.BVIn.xSBr)===e&&n.RlLV(i,n.BVIn.Ntar)&&n.BVIn.ibJq.xzwb===t&&n.NJet(n.BVIn.ibJq.dJmV,r)&&(n.GzHO+=1,n.aDKl=n.HdGU(n.GzHO,n.BVIn.QFyt,n.BVIn.iRtE),n.aDKl&&(n.BVIn.dOFY=i,o.validateForTermination(n.JoRn,n.XbNi)))})),s(this,"hpjq",(function(e,t,i,r){var o=n.mexP.kjMu,a=w(o.xSBr)===e&&o.ibJq.xzwb===t&&n.RlLV(i,o.Ntar)&&n.NJet(o.ibJq.dJmV,r);return a="APX_PAGE_OPENED"===t?a&&location.pathname===o.ibJq.QyOe:a})),s(this,"RlLV",(function(e,t){var n=Math.ceil(e);return n>t.TXQK&&n<t.CHsu})),s(this,"HdGU",(function(e,t,i){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(r&&n.mexP.rhwL&&(e+=n.MYvF),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,"NJet",(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,v=(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),q(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&&v}else n=n&&q(t[a],e[a],"EQ")};for(var a in e)if(r=o())return r.v}catch(e){K.error(e),n=!1}return n})),s(this,"fNfw",(function(t,i,r,o,a,s,l,u){var d,v=!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 c,f=0;s&&(f=Date.now()+a);for(var m=0;m<n.no_KPI_TriggerDetails.length;m++)if(n.no_KPI_TriggerDetails[m].id===l){v=!0,d=n.no_KPI_TriggerDetails[m];break}v?d.satisfiedCount+=1:(c={id:l,type:t,time:r,name:i,additionalInfo:o,satisfiedCount:u,timeBased:s,finishTime:f},n.no_KPI_TriggerDetails.push(c)),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(n.no_KPI_TriggerDetails))})),s(this,"RBzD",(function(e){var t,i=new _e,r=c(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.mexP.xSBr)+"___"+(null==o?void 0:o.mexP.ibJq.xzwb),n.lVwH);else{var a,s=c(o);try{for(s.s();!(a=s.n()).done;){var l,u=a.value;i.unregisterFromEvent(w(null==u?void 0:u.mexP.xSBr)+"___"+(null==u||null===(l=u.mexP)||void 0===l?void 0:l.ibJq.xzwb),n.lVwH)}}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.aDKl=!0,this.aDKl&&(this.GzHO+=1,this.aDKl=this.HdGU(this.GzHO,this.mexP.QFyt,this.mexP.iRtE),this.aDKl&&(this.mexP.dOFY=e,t.validate(this.JoRn,this.XbNi)))}}]),t}(),W=window.ApxorLogger,j=a((function t(){var n=this;r(this,t),s(this,"QFyt",0),s(this,"ZQgj",0),s(this,"rkHu","SESSION"),s(this,"afEP",0),s(this,"WJaO",0),s(this,"qoOb",0),s(this,"_enable_repetition_gap",void 0),s(this,"_enable_days_limit",void 0),s(this,"_enable_session_limit",void 0),s(this,"suxn",void 0),s(this,"TwKd",void 0),s(this,"frrx",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.JoRn=t._id,n.UbQU=t.meta,n.QFyt=t.frequency.count,-1===n.QFyt&&(n.QFyt=9999999),n.qoOb=n.QFyt,n.ZQgj=t.frequency.time_interval,n.rkHu=t.frequency.validity,n.DSLimits=t.frequency.DSLimits,n.WJaO=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.suxn=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.frrx=t.frequency.days_limit.days?t.frequency.days_limit.days:1,n.TwKd=t.frequency.days_limit.limit);var v=_e.getInstance().getQeState();if(!h(v)||!h(v[t._id]))return!0;if("SESSION"===n.rkHu){if(n.QFyt=parseInt(n.QFyt)-parseInt(v[t._id].SESSION),n.QFyt<=0)return n.mOCb("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.UbQU.name)),!1}else{if("OVERALL"!==n.rkHu)return W.info("Invalid config."),!1;if(n.QFyt=parseInt(n.QFyt)-parseInt(v[t._id].OVERALL),n.QFyt<=0)return n.mOCb("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.UbQU.name)),!1}}catch(e){return W.error(e),!1}return!0})),s(this,"imeT",(function(){n.QFyt=n.QFyt-1})),s(this,"getFrequencyCount",(function(){return n.QFyt})),s(this,"qQlJ",(function(){"SESSION"===n.rkHu&&(n.QFyt=n.qoOb,W.info("Campaign Limit reset"))})),s(this,"cOVL",(function(t){try{if(n.QFyt<=0)return"OVERALL"===n.rkHu?(n.mOCb("Overall limit reached"),e.getController().isTestDevice()&&T("Maximum overall limit reached for campaign name ".concat(n.UbQU.name))):"SESSION"===n.rkHu&&(e.getController().isTestDevice()&&T("Maximum session limit reached for campaign name ".concat(n.UbQU.name)),n.mOCb("Session limit reached")),!1;var i=_e.getInstance().getQeState();if(!h(i)||!h(i[t]))return!0;if(n._enable_session_limit)if(parseInt(n.suxn)-parseInt(i[t].SESSION)<=0)return n.mOCb("Session limit reached"),e.getController().isTestDevice()&&T("Maximum session limit reached for campaign name ".concat(n.UbQU.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),!g(U(r,n.JoRn))){var o=U(r,n.JoRn)[n.JoRn];if(Date.now()-o<S(n._repetitionUnit,n._repetitionValue))return n.mOCb("Config does not satisfy time difference "),e.getController().isTestDevice()&&T("Config does not satisfy time difference for campaign name ".concat(n.UbQU.name)),!1}}else{var a=e.getController().getFromStorage("apx-last-shown-session");if(a=JSON.parse(a),!g(U(a,n.JoRn))){var s=U(a,n.JoRn)[n.JoRn];if(e.getController().getFromStorage("apx_retained_session")-s<parseInt(n._repetitionValue))return n.mOCb("Config does not satisfy session difference "),e.getController().isTestDevice()&&T("Config does not satisfy session difference for campaign name ".concat(n.UbQU.name)),!1}}if(0!==n.WJaO&&n.DSLimits)if(parseInt(n.WJaO)-parseInt(i[t].SESSION)<=0)return n.mOCb("Session limit reached"),e.getController().isTestDevice()&&T("Session limit reached for campaign name ".concat(n.UbQU.name)),!1;if(0!==n._dayCount){var l,u=C();if(parseInt(n._dayCount)-parseInt((null===(l=i[t])||void 0===l?void 0:l.DATES[u])||0)<=0)return n.mOCb("Day limit reached"),e.getController().isTestDevice()&&T("Day limit reached for campaign name ".concat(n.UbQU.name)),!1}if(n.frrx>0&&n._enable_days_limit){var d=n.frrx,v=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;v+=parseInt((null===(n=i[t])||void 0===n?void 0:n.DATES[e])||0)})),v>n.TwKd)return W.info("Shown Limit Crossed"),e.getController().isTestDevice()&&T("Days limit reached for campaign name ".concat(n.UbQU.name)),!1}}catch(e){n.mOCb("Error validating the frequency: ".concat(e)),W.error("Error validating the frequency:"+e)}return!0})),s(this,"mOCb",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.UbQU.type?"survey":"campaign",apx_nudge_id:n.JoRn,apx_nudge_name:n.UbQU.name,message_name:n.UbQU.xzwb,id:n.JoRn,apx_variant_code:n.UbQU.isExperiment||n.UbQU.only_context?null===(i=n.UbQU.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),X=window.ApxorLogger,Z=a((function e(){var t=this;r(this,e),s(this,"qSmZ",[]),s(this,"CRsP",0),s(this,"PTtO",!1),s(this,"pJVd",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.JoRn=n,t.XbNi=i,t.mRoO=o,t.vMOr=r,t.across_sessions=s;var l=[];t.CRsP=e.length;try{if(null!=l)return r=null==e?void 0:e.sequence_type,l=t.vIMZ(e,t.CRsP),"unordered"!==a&&0!==t.XbNi||t.FrQX(),t.qSmZ}catch(e){return X.error(e),!1}})),s(this,"vIMZ",(function(e,n){for(var i=0;i<n;i++){t.pJVd=new M;try{t.pJVd.initialize(e[i],t.JoRn,t.XbNi,t.vMOr,t.adSV,t.across_sessions,"",-1,!1)&&(t.qSmZ.push(t.pJVd),t.qSmZ.sequence_type=t.vMOr)}catch(e){X.error(e)}}return t.qSmZ})),s(this,"FrQX",(function(){if("ordered"===t.vMOr||"strictly_ordered"===t.vMOr)t.qSmZ[0].FrQX(0);else{var e,n=c(t.qSmZ);try{for(n.s();!(e=n.n()).done;){e.value.FrQX()}}catch(e){n.e(e)}finally{n.f()}}})),s(this,"RBzD",(function(e){t.pJVd.RBzD(e)}))})),$=a((function e(){var t=this;r(this,e),s(this,"xzwb",""),s(this,"nsof",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;t.xzwb=e.meta.name,t.nsof=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,"rSYQ",[]),s(this,"_ret_day",{}),s(this,"DcRZ",{}),s(this,"xVuQ",!1),s(this,"Abex",!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.rSYQ=e.overall_cfg.events,n._ret_day=e.overall_cfg.ret_day,n.DcRZ=e.overall_cfg.session,n.xVuQ=e.overall_cfg.toggleRetDay,n.Abex=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.xVuQ&&!isNaN(t)&&!(t>=n._ret_day.from&&t<=n._ret_day.to))return n.retainedDaysValidated=!1,!1;if(n.Abex&&!isNaN(i)&&!(i>=n.DcRZ.from&&i<=n.DcRZ.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.rSYQ.length;s++){if(a[n.rSYQ[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,"ulHm",[]),s(this,"CeJC",[]),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.ulHm=e.attributes.user,t.CeJC=e.attributes.session,!Array.isArray(t.ulHm)||!Array.isArray(t.CeJC))return ne.error("No attributes"),!1}catch(e){return ne.error(e),!1}return!0})),s(this,"validate",(function(e,n){return t.jOrD(e,t.ulHm)&&t.jOrD(n,t.CeJC)})),s(this,"jOrD",(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 q(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,"cWXg",e.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"GVPd",1),s(this,"parse",(function(e){try{var t,i,r;if(n.nsof=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.GVPd=null===(r=e.terminate_info.time_based)||void 0===r?void 0:r.days,n.kTkq(e._id))return n.cWXg.persistTerminationInfoLocally(e._id),!1}catch(e){return!1}return!0})),s(this,"kTkq",(function(e){var t,i=JSON.parse(n.cWXg.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].jxVK;return s===n.GVPd&&l.hours>=u.hours||s>n.GVPd||i[e].goalAcheived}))})),oe=a((function e(){var t=this;r(this,e),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"uXtl",new ie),s(this,"GOYR",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.GOYR.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.uXtl.parse(e.terminate_info))return!1}catch(e){return window.ApxorLogger.error(e),!1}return!0})),s(this,"validate",(function(e,n){return t.uXtl.validate(e,n)}))})),ae=window.ApxorLogger,se=a((function t(){var n=this;r(this,t),s(this,"qnKr",-1),s(this,"FWID",-1),s(this,"jxVK",-1),s(this,"YZQd",-1),s(this,"Jfma",-1),s(this,"CNBP",-1),s(this,"_is_user_timezone",void 0),s(this,"fqWG",!1),s(this,"koyw",!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.JoRn=e._id,n.UbQU=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.qnKr=Date.parse(e.validity.start_date),n.FWID=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,h(e.at_specific_time)&&(n.fqWG=e.at_specific_time,n.fqWG&&h(e.time_limits)&&(n.jxVK=e.time_limits.start_time,n.YZQd=e.time_limits.end_time,y(n.jxVK)||y(n.YZQd))))return ae.error("Not valid times"),!1;if(h(e.time_excludes_in_day)&&(n.koyw=e.time_excludes_in_day,n.koyw&&h(e.time_excludes)&&(n.Jfma=e.time_excludes.start_time,n.CNBP=e.time_excludes.end_time,y(n.Jfma)||y(n.CNBP))))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.qnKr&&t<n.FWID&&n._days_in_week.includes(i))return!n.fqWG||N(r,n.jxVK,"GT")&&N(r,n.YZQd,"LT")||(n._not_in_specified_time=!0),n.koyw&&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),v=60*d[0]+d[1];return v>=60*r+o&&v<=60*s+u}(n.Jfma,n.CNBP,r)?(n.mOCb("Exclude Time limits check failed"),e.getController().isTestDevice()&&T("Exclude Time Limits check failed for campaign name ".concat(n.UbQU.name)),!1):!n.fqWG||N(r,n.jxVK,"GT")&&N(r,n.YZQd,"LT");if(t<n.qnKr)n._not_yet_active=!0;else if(t>n.FWID)n._nudge_expired=!0;else if(!n._days_in_week.includes(i))return n.mOCb("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.UbQU.name)),!1;return!1})),s(this,"mOCb",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.UbQU.type?"survey":"campaign",apx_nudge_id:n.JoRn,apx_nudge_name:n.UbQU.name,message_name:n.UbQU.xzwb,id:n.JoRn,apx_variant_code:n.UbQU.isExperiment||n.UbQU.only_context?null===(i=n.UbQU.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),le=a((function e(){var t=this;r(this,e),s(this,"WBPs",""),s(this,"UniE",""),s(this,"YdWy",""),s(this,"Cnvm",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.WBPs=null==e?void 0:e.screen_binding,!t.WBPs||(t.UniE=null==e?void 0:e.binding.url,t.YdWy=null==e?void 0:e.binding.var,t.Cnvm=null==e?void 0:e.binding.operator,!0)}catch(e){return window.ApxorLogger.error(e),!1}})),s(this,"validate",(function(){var e=t.UniE,n=t.YdWy,i=t.Cnvm,r=window.location.href;return!t.WBPs||("EQ"===i?e.includes(n)?!!J(r,e,n,!1):r===e:"SW"===i?e.includes(n)?!!J(r,e,n,!0):!!r.startsWith(e):void 0)}))})),ue=window.ApxorLogger,de=a((function t(){var i=this;r(this,t),s(this,"qNBw",[]),s(this,"JDzL",[]),s(this,"JoRn",""),s(this,"UbQU",new $),s(this,"UnBf",new I),s(this,"rkHu",new se),s(this,"GGEl",new j),s(this,"xIfK",new te),s(this,"JsEc",new oe),s(this,"oILi",new le),s(this,"vMOr",!1),s(this,"adSV",[]),s(this,"_variant_code",""),s(this,"PTtO",!1),s(this,"groupCombineOperator","OR"),s(this,"HMAY",!1),s(this,"JOMf",!1),s(this,"ldZX",void 0),s(this,"timeForKPI",void 0),s(this,"kpiIndex",0),s(this,"Wekc",void 0),s(this,"_across_sessions",!1),s(this,"YXFX",void 0),s(this,"VZTq",!1),s(this,"wSEm",void 0),s(this,"nWAH",void 0),s(this,"mhIg",void 0),s(this,"sgcK",void 0),s(this,"SsJL",void 0),s(this,"NnKP",void 0),s(this,"oskm",void 0),s(this,"cCRY",void 0),s(this,"BQvw",void 0),s(this,"QvSD",void 0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,n;if(!h(e._id))return ue.error("No Id"),!1;if(!h(e.enabled)||!e.enabled)return ue.error("Not enabled"),!1;if(!(i.UbQU.parse(e)&&i.rkHu.parse(e)&&i.GGEl.parse(e)&&i.UnBf.parse(e)&&i.xIfK.parse(e)&&i.JsEc.parse(e)&&i.oILi.parse(e)))return!1;if(i._variant_code=i.UbQU._isExperiment||i.UbQU._only_context?null===(t=i.UbQU._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,!h(e.conditions)||!Array.isArray(e.conditions))return ue.error("No valid conditions",e.conditions),!1;i.JoRn=e._id,i.vMOr=!!h(e.sequence_enabled)&&e.sequence_enabled,h(e.conditions_v2)&&i.enable_conditions_v2&&(i.vMOr=null==e?void 0:e.sequence_type),!0===i.vMOr&&e.conditions.sort((function(e,t){return e.sequence<t.sequence})),h(e.conditions_v2)&&i.enable_conditions_v2?(n=e.conditions_v2,i.VZTq=!0):n=e.conditions,i.YXFX=n;var r=n.length,o=null==e?void 0:e.no_context_enabled;if(0===r&&o&&setTimeout((function(){i.jtud()}),10),i.QvSD=r,i.uhvC(n,r),i.AJBO(),i.JsEc.enable_goal_events)for(var a=e.terminate_info.goal_events.events,s=a.length,l=0;l<s;l++){var u=new M;u.initialize(a[l],i.JoRn,l,!0,[],i._across_sessions,"termination")&&i.JDzL.push(u)}return i.qNBw.length>0}catch(e){return ue.error(e),!1}})),s(this,"uhvC",(function(e,t){for(var n=function(){i.adSV=[];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.BQvw=new Z;var a=i.BQvw.initialize(n,i.JoRn,r,o,i.adSV,i.vMOr,i._across_sessions);i.qNBw.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.adSV=[].concat(u(i.adSV),[l])}if(i.BQvw=new M,i.BQvw.initialize(t,i.JoRn,r,i.vMOr,i.adSV,i._across_sessions)){i.qNBw.push(i.BQvw);var d=(null==t?void 0:t.timeout)/(null==t?void 0:t.findinterval),v=(null==t?void 0:t.frameid)||"",c=null==t?void 0:t.url;window.location.href===c&&"view_visibility"===t.event_type&&!0===F(t.view_id,v,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,d)&&i.jtud(!0),window.addEventListener("navigate",(function(e){var n=null==t?void 0:t.url;window.location.href===n&&"view_visibility"===t.event_type&&!0===F(t.view_id,v,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,d)&&i.jtud(!0)}))}}},r=0;r<t;r++)n()})),s(this,"AJBO",(function(){if(i._across_sessions&&"ordered"===i.vMOr){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.qNBw[e])&&void 0!==r&&null!==(r=r.mexP)&&void 0!==r&&r._timeEnabled&&void 0===i.qNBw[e].length){if("didn't"===i.qNBw[e].mexP.nsof){var s=i.qNBw[e].mexP._id,l=i.Hhsy(s,n);if(l)if(Date.now()>l.finishTime)i.qNBw[e].aDKl=!0,i.qNBw[e].GzHO=l.satisfiedCount,t=!0;else{var u=l.finishTime-Date.now(),d=i.qNBw[e].mexP._eventCategory?i.qNBw[e].mexP._eventCategory:"specific_event",v=new _e;"specific_event"===d?(v.registerForEvent(w(i.qNBw[e].mexP.xSBr)+"___"+i.qNBw[e].mexP.ibJq.xzwb,i.rZPL),i.SsJL=i.qNBw[e]):i.ziqw(d),setTimeout((function(){e!==i.qNBw.length-1||i.HMAY||(i.qNBw[e].aDKl=!0,i.qNBw[e].GzHO=l.satisfiedCount,t=!0,"specific_event"===d?v.unregisterFromEvent(w(i.qNBw[e].mexP.xSBr)+"___"+i.qNBw[e].mexP.ibJq.xzwb,i.rZPL):i.Xgsq(i.qNBw[e]),i.jtud())}),u)}}if("did"===i.qNBw[e].mexP.nsof){var c=i.qNBw[e].mexP._id,f=i.Hhsy(c,n);if(f)if(null==f.satisfiedCount){if(Date.now()<f.finishTime){i.mhIg=f,i.nWAH=e;var m=f.finishTime-Date.now(),_=i.qNBw[e].mexP._eventCategory?i.qNBw[e].mexP._eventCategory:"specific_event",g=new _e;"specific_event"===_?g.registerForEvent(w(i.qNBw[e].mexP.xSBr)+"___"+i.qNBw[e].mexP.ibJq.xzwb,i.ZPYb):i.ziqw(_),setTimeout((function(){"specific_event"===_?g.unregisterFromEvent(w(i.qNBw[e].mexP.xSBr)+"___"+i.qNBw[e].mexP.ibJq.xzwb,i.ZPYb):i.Xgsq(i.qNBw[e])}),m)}}else i.qNBw[e].GzHO=f.satisfiedCount,i.qNBw[e].aDKl=!0}}else t=i.TifI(e,n);t&&(null===(o=i.qNBw[e])||void 0===o||null===(o=o.mexP)||void 0===o||!o._timeEnabled||(null===(a=i.qNBw[e])||void 0===a?void 0:a.length)>1)?e===i.qNBw.length-1&&i.jtud():t||void 0===!i.qNBw[e].length&&i.qNBw[e].FrQX()},o=0;o<i.qNBw.length;o++)r(o)}else if(i._across_sessions&&"unordered"===i.vMOr){var a=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(a=JSON.parse(a))&&null!=a)for(var s=0;s<i.qNBw.length;s++)i.TifI(s,a)}})),s(this,"TifI",(function(e,t){if(void 0===i.qNBw[e].length||1===i.qNBw[e].length){var n=i.qNBw[e].mexP._id,r=!1,o=i.Hhsy(n,t);if(o)i.wSEm=o,r=(new M).HdGU(o.satisfiedCount,i.qNBw[e].mexP.QFyt,i.qNBw[e].mexP.iRtE),o&&(r?i.qNBw[e].aDKl=!0:i.qNBw[e].GzHO=o.satisfiedCount);else i.qNBw[e].FrQX();return r}if(i.qNBw[e].length>=1){var a,s,l;if("ordered"===(s=null===(a=i.qNBw[e])||void 0===a?void 0:a.sequence_type)||"strictly_ordered"===s){for(var u=0;u<i.qNBw[e].length;u++){var d=i.qNBw[e][u],v=d.mexP._id;l=!1;var c=i.Hhsy(v,t);if(c){if(l=(new M).HdGU(c.satisfiedCount,d.mexP.QFyt,d.mexP.iRtE),c)if(l){i.qNBw[e][u].aDKl=!0;var f=u+1,m=i.qNBw[e][u+1];void 0===m&&h(i.qNBw[e+1])&&(i.qNBw[e+1].FrQX(),l=!0),null!=m&&i.qNBw[e][u+1].FrQX(f)}else i.qNBw[e][u].GzHO=c.satisfiedCount}else(h(i.qNBw[e][u-1])&&!0===i.qNBw[e][u].aDKl||_(i.qNBw[e][u-1]))&&i.qNBw[e][u].FrQX()}return l}for(var g,p=0;p<i.qNBw[e].length;p++){var x=i.qNBw[e][0].mexP.AkEr;g="OR"!==x;var b=i.qNBw[e][p],y=b.mexP._id;l=!1;var w=i.Hhsy(y,t);if(w)l=(new M).HdGU(w.satisfiedCount,b.mexP.QFyt,b.mexP.iRtE),w&&(l?i.qNBw[e][p].aDKl=!0:i.qNBw[e][p].GzHO=w.satisfiedCount);else b.FrQX();g="AND"===x?g&&l:g||l}return g}})),s(this,"Hhsy",(function(e,t){return t.find((function(t){return t.id===e}))})),s(this,"Aucg",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=_e.getInstance();if(!(t<0)){var o=i.qNBw[t],a="unordered";if((null==o?void 0:o.length)>1&&(a=null==o?void 0:o.sequence_type),!0===i.vMOr||"ordered"===i.vMOr||"strictly_ordered"===i.vMOr||"ordered"===a||"strictly_ordered"===a){i.kpiIndex=t+1;var s=i.qNBw[t];if((null==s?void 0:s.length)>0){if(h(s))if("unordered"===i.vMOr&&"ordered"===a){var l=o[n-1];if(h(l))if(void 0===l.length||1==l.length){if(!l.aDKl)return}else if(l.length>1&&!i.Wpny(l))return;var u,d=o[n+1];if(h(d)){if(d.FrQX(n+1),"strictly_ordered"===i.vMOr){i._currentEventname=s[n].mexP.ibJq.xzwb;var v=e.getController();v.registerForEvent("APP_EVENT",i.XUvs),v.registerForEvent("CLIENT_EVENT",i.XUvs)}}else if("strictly_ordered"===a)1!=i.PTtO&&i.jtud();else(null===(u=o[n])||void 0===u?void 0:u.length)>0?i.Wpny(o)&&i.jtud():i.jtud()}else{var f,m=i.qNBw[t-1];if(h(m))if(void 0===m.length||1==m.length){if(!m.aDKl)return}else if(m.length>1&&!i.Wpny(m))return;if(void 0===s.length||1===s.length?f=i.qNBw[t+1]:s.length>1&&("ordered"===a||"strictly_ordered"===a?f=n===s.length-1?i.qNBw[t+1]:i.qNBw[t][n+1]:i.Wpny(s)&&(f=i.qNBw[t+1])),h(f)){if(void 0===f.length||1===f.length)f.FrQX(n+1);else if(i.Wpny(s))if(void 0===f.length)f.FrQX();else if(f.length>1)if("unordered"===f.sequence_type)for(var _=0;_<f.length;_++)f[_].FrQX(_);else"ordered"!==f.sequence_type&&"strictly_ordered"!==f.sequence_type||f[0].FrQX(0);if("strictly_ordered"===i.vMOr){i._currentEventname=s[n].mexP.ibJq.xzwb;var g=e.getController();g.registerForEvent("APP_EVENT",i.XUvs),g.registerForEvent("CLIENT_EVENT",i.XUvs)}}else"strictly_ordered"===i.vMOr?1!=i.PTtO&&i.jtud():i.Wpny(s)&&i.jtud()}}else if(h(s)&&s.aDKl){s.jLlv[s.mexP.ibJq.xzwb]=Date.now();var p=i.qNBw[t-1];if(h(p))if(void 0===p.length||1==p.length){if(!p.aDKl)return}else if(p.length>1&&!i.Wpny(p))return;var x=i.qNBw[t+1];if(h(x)){var b,y;if(null!=x&&null!==(b=x.mexP)&&void 0!==b&&b._timeEnabled){if("session"!=(null===(y=x.mexP)||void 0===y?void 0:y._time.unit)){var E,q,P=S(x.mexP._time.unit,x.mexP._time.value);if("didn't"==(null===(E=x.mexP)||void 0===E?void 0:E.nsof)){if(i.oskm=setTimeout((function(){if(i.HMAY)i.HMAY=!1;else{if(i.HMAY=!1,x.aDKl=!0,x.aDKl){x.GzHO+=1;var e=new M;if(x.aDKl=e.HdGU(x.GzHO,x.mexP.QFyt,x.mexP.iRtE),x.aDKl){x.mexP.dOFY=Date.now();var n=t+1,o=i.qNBw[n+1];h(o)?o.FrQX():i.jtud()}}r.unregisterFromEvent(w(x.mexP.xSBr)+"___"+x.mexP.ibJq.xzwb,i.rZPL),x.YxSd=!1}}),P),i._across_sessions){var C=S(x.mexP._time.unit,x.mexP._time.value),N=x.mexP._timeEnabled,J=x.mexP._id,F=new M;F.fNfw(x.mexP.nsof,x.mexP.ibJq.xzwb,Date.now(),x.mexP.ibJq.dJmV,C,N,J)}"specific_event"===x.mexP._eventCategory?(r.registerForEvent(w(x.mexP.xSBr)+"___"+x.mexP.ibJq.xzwb,i.rZPL),i.SsJL=x):i.ziqw(x)}else if("did"==(null===(q=x.mexP)||void 0===q?void 0:q.nsof)&&(i.HMAY=!1,i.Wekc=x,h(i.qNBw[t+2])&&i._across_sessions&&(i.sgcK=i.qNBw[t+2]),i.cCRY=setTimeout((function(){i.HMAY?i.HMAY=!1:(i.HMAY=!1,r.unregisterFromEvent(w(x.mexP.xSBr)+"___"+x.mexP.ibJq.xzwb,i.uNpH))}),P),i.ldZX=s,i.timeForKPI=P,r.registerForEvent(w(x.mexP.xSBr)+"___"+x.mexP.ibJq.xzwb,i.uNpH),i.NnKP=x,i._across_sessions)){var D=S(x.mexP._time.unit,x.mexP._time.value),B=x.mexP._timeEnabled,O=x.mexP._id,A=new M;A.fNfw(x.mexP.nsof,x.mexP.ibJq.xzwb,Date.now(),x.mexP.ibJq.dJmV,D,B,O)}}}else if(x.length>0)if("ordered"===x.sequence_type||"strictly_ordered"===x.sequence_type)x[0].FrQX(n+1);else{var U,Q=c(x);try{for(Q.s();!(U=Q.n()).done;){var T=U.value;T.FrQX()}}catch(e){Q.e(e)}finally{Q.f()}}else x.FrQX();if("strictly_ordered"===i.vMOr){i._currentEventname=s.mexP.ibJq.xzwb;var k=e.getController();k.registerForEvent("APP_EVENT",i.XUvs),k.registerForEvent("CLIENT_EVENT",i.XUvs)}}else"strictly_ordered"===i.vMOr?1!=i.PTtO&&i.jtud():i.jtud()}}else i.gIYn(),i.jtud()}})),s(this,"XUvs",(function(e){e&&e.name!=i._currentEventname&&(i.PTtO=!0)})),s(this,"ziqw",(function(e){var t=new _e,n=e.mexP._eventCategory;"apxor_event"===n?t.registerForEvent("apxor_event",i.rZPL):"customer_event"===n?t.registerForEvent("customer_event",i.rZPL):"any_event"===n?t.registerForEvent("any_event",i.rZPL):"campaign_event"===n?t.registerForEvent("campaign_event",i.rZPL):"survey_event"===n&&t.registerForEvent("survey_event",i.rZPL)})),s(this,"Xgsq",(function(e){var t=new _e,n=e.mexP._eventCategory;"apxor_event"===n?t.unregisterFromEvent("apxor_event",i.rZPL):"customer_event"===n?t.unregisterFromEvent("customer_event",i.rZPL):"any_event"===n?t.unregisterFromEvent("any_event",i.rZPL):"campaign_event"===n?t.unregisterFromEvent("campaign_event",i.rZPL):"survey_event"===n&&t.unregisterFromEvent("survey_event",i.rZPL)})),s(this,"rZPL",(function(){var e,t;i.oskm&&(i.HMAY=!1,clearTimeout(i.oskm));var n=new _e;i.HMAY=!0,i._across_sessions&&null!==localStorage.getItem("apx_nokpi_triggerdetails")&&localStorage.removeItem("apx_nokpi_triggerdetails"),n.unregisterFromEvent(w(null===(e=i.SsJL)||void 0===e||null===(e=e.mexP)||void 0===e?void 0:e.xSBr)+"___"+(null===(t=i.SsJL)||void 0===t||null===(t=t.mexP)||void 0===t||null===(t=t.ibJq)||void 0===t?void 0:t.xzwb),i.rZPL)})),s(this,"uNpH",(function(){var t,n,r,o=new _e;i.HMAY=!0,i.cCRY&&clearTimeout(i.cCRY);var a=new M;if(i.Wekc.GzHO+=1,i.Wekc.aDKl=a.HdGU(i.Wekc.GzHO,i.Wekc.mexP.QFyt,i.Wekc.mexP.iRtE),o.unregisterFromEvent(w(null===(t=i.NnKP)||void 0===t||null===(t=t.mexP)||void 0===t?void 0:t.xSBr)+"___"+(null===(n=i.NnKP)||void 0===n||null===(n=n.mexP)||void 0===n?void 0:n.ibJq.xzwb),i.uNpH),i._across_sessions&&null!==(r=i.sgcK)&&void 0!==r&&r.mexP._timeBased){var s,l,u,d=e.getController().getFromStorage("apx_nokpi_triggerdetails");d=null==d?[]:JSON.parse(d);for(var v=0;v<d.length;v++)if(i.no_KPI_TriggerDetails[v].id===i.sgcK.mexP._id){s=!0,l=d[v];break}if(s)l.satisfiedCount+=1;else{var c=i.Wekc.mexP._id,f=i.Wekc.mexP.nsof,m=i.Wekc.mexP.ibJq.xzwb,_=i.Wekc.mexP.ibJq.dJmV;u={id:c,type:f,time:Date.now(),name:m,additionalInfo:_,satisfiedCount:i.Wekc.mexP._timeEnabled,timeBased:i.Wekc.mexP._timeEnabled},i.no_KPI_TriggerDetails.push(u)}}if(i.Wekc.aDKl){var g=i.qNBw[i.kpiIndex+1];h(g)?g.FrQX():i.jtud()}})),s(this,"ZPYb",(function(){if(i.nWAH===i.qNBw.length-1){i.JOMf=!0;i.qNBw[i.nWAH]&&(i.qNBw[i.nWAH].GzHO=i.mhIg.satisfiedCount,i.qNBw[i.nWAH].aDKl=!0,i.jtud())}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.nWAH){n=!0,t=r[o];break}if(n&&(t.satisfiedCount=1),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(r)),i.qNBw[i.nWAH].GzHO=i.mhIg.satisfiedCount,i.qNBw[i.nWAH].aDKl=!0,i.qNBw[i.nWAH+1].mexP._timeEnabled){var a=S(i.qNBw[i.nWAH+1].mexP._time.unit,i.qNBw[i.nWAH+1].mexP._time.value),s=i.qNBw[i.nWAH+1].mexP._timeEnabled,l=i.qNBw[i.nWAH+1].mexP._id,u=i.qNBw[i.nWAH+1].GzHO,d=i.qNBw[i.nWAH+1].mexP.ibJq.xzwb,v=i.qNBw[i.nWAH+1].ibJq.dJmV;(new M).fNfw(i.mexP.nsof,d,Date.now(),v,a,s,l,u)}}})),s(this,"gIYn",(function(){if(i._across_sessions&&i.VZTq){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=c(s);try{var d=function(){var e=l.value,s=e.id,u=e.satisfiedCount;if(t=i.qNBw.find((function(e,t){if(1===(null==e?void 0:e.length)||void 0===(null==e?void 0:e.length)){if(e.mexP._id===s)return o="single",n=t,!0}else if(e.length>0){var i=e.findIndex((function(e){return e.mexP._id===s}));if(-1!==i)return n=t,r=i,o="group",!0}return!1})),"single"===o&&t){var d=new M;a=d.HdGU(u,t.mexP.QFyt,t.mexP.iRtE);var v=i.qNBw.findIndex((function(e){var t;return(null==e||null===(t=e.mexP)||void 0===t?void 0:t._id)===s}));void 0===v&&(v=n),a&&(i.qNBw[v].aDKl=!0)}else if("group"===o&&t){var c=new M;(a=c.HdGU(u,t[r].mexP.QFyt,t[r].mexP.iRtE))&&(i.qNBw[n][r].aDKl=!0)}};for(u.s();!(l=u.n()).done;)d()}catch(e){u.e(e)}finally{u.f()}}}})),s(this,"QpBI",(function(e){e<0||i.WUCf()})),s(this,"jtud",(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.JoRn)&&e.getController().isBadgeTriggerSatisfied(i.JoRn)||null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===i.UbQU.nsof?"survey":"campaign",apx_nudge_id:i.JoRn,apx_nudge_name:i.UbQU.xzwb,message_name:i.UbQU.xzwb,id:i.JoRn,apx_variant_code:i.UbQU._isExperiment||i.UbQU._only_context?i.UbQU._attr.apx_variant_code:"TG"}),!(i.rkHu.validate()&&i.UnBf.validate(a,s)&&i.xIfK.validate()&&i.oILi.validate())){i.UbQU.nsof;return i.xIfK.retainedDaysValidated?i.xIfK.retainedSessionValidated?i.xIfK.eventDoneInLT?void i.mOCb("Event done in life time"):i.UnBf.userAttributesValidated?i.UnBf.sessionAttributeValidated?i.rkHu._not_in_specified_time?void i.mOCb("Time limits check failed"):i.rkHu._not_yet_active?void i.mOCb("not in the scheduled time"):i.rkHu._nudge_expired?void i.mOCb("nudge expired"):void 0:void i.mOCb("Session property filter not met"):void i.mOCb("User property filter not met"):void i.mOCb("User session criteria not met"):void i.mOCb("Retained day criteria not met")}var l=i.qNBw.length,u=l<1,d="";0===l&&(u=!0);for(var v=0;v<l;v++){var f=void 0,m=i.qNBw[v];if(m.length>1){var _=m[0].mexP.AkEr;f="AND"===_;for(var g=0;g<m.length;g++){var h=m[0].mexP.AkEr;f="AND"===h?f&&m[g].aDKl:f||m[g].aDKl}}else f=m.aDKl;if(""===d.trim())u=f;else switch(d){case"AND":u=u&&f;break;case"OR":u=u||f}d=m.length>1?i.groupCombineOperator:m.AkEr}if(!0===o&&(u=!0),u){if(console.debug("onCondition satisfied"),!i.GGEl.cOVL(i.JoRn))return void console.warn("Maximum limit reached",i.JoRn);i._across_sessions&&localStorage.removeItem("apx_nokpi_triggerdetails");var p,x=c(i.qNBw);try{for(x.s();!(p=x.n()).done;){var b=p.value;if(1===(null==b?void 0:b.length)||void 0===(null==b?void 0:b.length))b.aDKl=!1,b.GzHO=0;else{var y,w=c(b);try{for(w.s();!(y=w.n()).done;){var E=y.value;E.aDKl=!1,E.GzHO=0}}catch(e){w.e(e)}finally{w.f()}}}}catch(e){x.e(e)}finally{x.f()}if(i.BQvw=new M,i.BQvw.RBzD(i.qNBw),i.qNBw=[],i.uhvC(i.YXFX,i.QvSD),!0===i.UbQU._only_context){var q="SURVEY"===i.UbQU.nsof?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.UbQU._attr),{},{message_name:i.UbQU.xzwb,apx_nudge_name:i.UbQU.xzwb,apx_nudge_id:i.JoRn,id:i.JoRn}),!1,"",q)}e.getController().dispatchEvent(i.UbQU.nsof,{name:i.UbQU.nsof,additional_info:{uuid:i.JoRn,name:i.UbQU.xzwb}})}})),s(this,"WUCf",(function(){for(var t=i.JDzL.length,r=t<1,o="",a=0;a<t;a++){var s=i.JDzL[a],l=s.aDKl;if(""===o.trim())r=l;else switch(o){case"AND":r=r&&l;break;case"OR":r=r||l}o=s.WEZq}if(r){if(e.getController().persistTerminationInfoLocally(i.JoRn),!0===i.UbQU._only_context){var u="SURVEY"===i.UbQU.nsof?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.UbQU._attr),{},{message_name:i.UbQU.xzwb,apx_nudge_name:i.UbQU.xzwb,apx_nudge_id:i.JoRn,id:i.JoRn}),!1,"apxor",u)}e.getController().dispatchEvent(i.UbQU.nsof,{name:i.UbQU.nsof,additional_info:{uuid:i.JoRn,name:i.UbQU.xzwb}})}})),s(this,"validateForTerminationAttributes",(function(){var t=e.getController().getUserAttributes(),n=e.getController().getSessionAttributes();return i.JsEc.validate(t,n)})),s(this,"imeT",(function(){i.GGEl.imeT()})),s(this,"getFrequencyCount",(function(){return i.GGEl.getFrequencyCount()})),s(this,"Mhls",(function(){return i.GGEl.qQlJ()})),s(this,"Wpny",(function(e){var t;t="AND"===e[0].mexP.AkEr;for(var n=0;n<e.length;n++){t="AND"===e[0].mexP.AkEr?t&&e[n].aDKl:t||e[n].aDKl}return t})),s(this,"mOCb",(function(t){var n;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.UbQU.nsof?"survey":"campaign",apx_nudge_id:i.JoRn,apx_nudge_name:i.UbQU.xzwb,message_name:i.UbQU.xzwb,id:i.JoRn,apx_variant_code:i.UbQU._isExperiment||i.UbQU._only_context?null===(n=i.UbQU._attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),ve=a((function e(){var t=this;r(this,e),s(this,"hfGA",{}),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(h(e)&&h(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.hfGA[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.hfGA[e]){var r=t.hfGA[e];r.Aucg(n,i)}})),s(this,"getVariantCode",(function(e){return t.hfGA[e]?t.hfGA[e]._variant_code:""})),s(this,"validateForTermination",(function(e,n){t.hfGA[e]&&t.hfGA[e].QpBI(n)})),s(this,"validateForTerminationAttributes",(function(e){return!!t.hfGA[e]&&t.hfGA[e].validateForTerminationAttributes()})),s(this,"imeT",(function(e){t.hfGA[e].imeT()})),s(this,"getFrequencyCount",(function(e){var n=t.hfGA[e];if(null!=n)return n.getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var e=t.hfGA;for(var n in e)e[n].Mhls()})),s(this,"EPDx",(function(e){try{if(t.hfGA){var n=t.hfGA[e];if(n&&n.UbQU)return n.UbQU}}catch(e){console.log("Error in getting the campaign meta ".concat(e))}return{}}))})),ce=window.ApxorLogger,fe=a((function t(){var n=this;r(this,t),s(this,"zRwJ",{}),s(this,"DcUs",[]),s(this,"vbEC",!1),s(this,"initialize",(function(){var t=e.getController();t.registerForEvent("APP_EVENT",(function(e){return n.bsop(e,"AE")})),t.registerForEvent("CLIENT_EVENT",(function(e){return n.bsop(e,"CE")}))})),s(this,"jeCt",(function(){var e,t=c(n.DcUs);try{for(t.s();!(e=t.n()).done;){var i=e.value;n.ShrN(i.event,i.key,i.type)}}catch(e){t.e(e)}finally{t.f()}n.vbEC=!0})),s(this,"Nhoo",(function(e,t){var i;"function"==typeof t&&((i=n.zRwJ[e]?n.zRwJ[e]:[]).push(t),n.zRwJ[e]=i,ce.debug("Listeners list: ",n.zRwJ))})),s(this,"unregisterFromEvent",(function(e,t){if(n.zRwJ[e]){for(var i=n.zRwJ[e],r=[],o=0;o<i.length;o++){var a=i[o];a!==t&&r.push(a)}n.zRwJ[e]=r}})),s(this,"bsop",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE";n.ShrN(e,"any_event",t),"apxor"===(null==e?void 0:e.loggedBy)?n.ShrN(e,"apxor_event",t):"customer"===(null==e?void 0:e.loggedBy)&&n.ShrN(e,"customer_event",t),"campaign"===(null==e?void 0:e.apx_nudge_type)?n.ShrN(e,"campaign_event",t):"survey"===(null==e?void 0:e.apx_nudge_type)&&n.ShrN(e,"survey_event",t);var i=t+"___"+e.name;n.ShrN(e,i,t)})),s(this,"ShrN",(function(t,i,r){if(n.vbEC){if(ce.debug("Notifying listeners for event: "+t+", "+i,n.zRwJ),n.zRwJ[i])for(var o=n.zRwJ[i],a=e.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(r,t.name,a,t.additional_info)}}else n.DcUs.push({event:t,key:i,type:r})}))})),me=window.ApxorLogger,_e=function(){function t(){var n=this;return r(this,t),s(this,"YkNd",!1),s(this,"fSEa",null),s(this,"IXWi",C()),s(this,"NpEJ",new fe),s(this,"oSov",e.getSiteId()),s(this,"YkCq",{}),s(this,"getQeState",(function(){try{var t=e.getController().getFromStorage("qe_state");return t?JSON.parse(b(n.oSov,t)):(n.YkCq={},n.setQeState())}catch(e){return n.YkCq={},n.setQeState()}})),s(this,"setQeState",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{e.getController().persistToStorage("qe_state",n.YkCq,!0)}catch(i){""===t?n.YkCq={}:n.YkCq[t]={SESSION:0,OVERALL:0,DATES:{}},e.getController().persistToStorage("qe_state",n.YkCq,!0)}return n.YkCq})),s(this,"initialize",(function(){n.YkNd||(n.YkNd=!0,n.fSEa=new ve,n.NpEJ.initialize(),n.YkCq=n.getQeState(),me.info("QE Initialized.."))})),s(this,"parse",(function(e){n.WaqG()?(n.fSEa.parse(e),n.NpEJ.jeCt()):me.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.WaqG()&&n.fSEa.validate(e,t,i)})),s(this,"getVariantCode",(function(e){return n.fSEa.getVariantCode(e)})),s(this,"validateForTermination",(function(e,t){n.WaqG()&&n.fSEa.validateForTermination(e,t)})),s(this,"validateForTerminationAttributes",(function(e,t){return n.fSEa.validateForTerminationAttributes(e,t)})),s(this,"updateCount",(function(e){try{var t;h(n.YkCq[e])||n.createObjConfig(e),n.incrementFrequencies(e),n.setQeState(e),null===(t=n.fSEa)||void 0===t||t.imeT(e)}catch(e){console.log("Could not update the count config:".concat(e))}})),s(this,"resetFrequencyCounts",(function(){n.fSEa.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(e){return n.fSEa.getFrequencyCount(e)})),s(this,"registerForEvent",(function(e,t){n.NpEJ.Nhoo(e,t)})),s(this,"unregisterFromEvent",(function(e,t){n.NpEJ.unregisterFromEvent(e,t)})),s(this,"notifyEventListener",(function(e){n.NpEJ.bsop(e)})),s(this,"fetch",(function(t,n,i,r){e.getController().fetchConfiguration(t,n,i,r)})),s(this,"WaqG",(function(){return n.YkNd})),s(this,"getCampaignMetaFromQueryEngine",(function(e){return n.fSEa.EPDx(e)})),s(this,"AmzX",(function(){return n.IXWi})),t.instance||(t.instance=this),t.instance}return a(t,[{key:"createObjConfig",value:function(e){try{this.YkCq=this.getQeState(),h(this.YkCq[e])||(this.YkCq[e]={SESSION:0,OVERALL:0,DATES:{}},this.IXWi&&(this.YkCq[e].DATES[this.IXWi]=0),this.setQeState(e))}catch(e){me.error("Can not create the frequency count object:"+e)}}},{key:"incrementFrequencies",value:function(e){this.YkCq=this.getQeState();var t=this.YkCq[e];t.SESSION=t.SESSION+1,t.OVERALL=t.OVERALL+1;var n=C();n===this.IXWi&&t.DATES&&t.DATES[n]||(this.IXWi=n,t.DATES={},t.DATES[this.IXWi]=0),t.DATES[this.IXWi]=t.DATES[this.IXWi]+1}}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}}]),t}();s(_e,"instance",void 0),window.ceVersion=207;try{void 0===exports&&null===exports||(exports.default=_e,module.exports=exports.default)}catch(e){}return _e}));
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "apxor-qe",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "author": "Ravi Teja Akella <ravi.akella@apxor.com> (https://www.apxor.com)",
5
5
  "contributors": [
6
+ {
7
+ "name": "Mahesh Pikki",
8
+ "email": "mahesh.pikki@apxor.com",
9
+ "url": "https://www.apxor.com"
10
+ },
6
11
  {
7
12
  "name": "Raavi Venkata Sai Chaitanya",
8
13
  "email": "saichaitanya.raavi@apxor.com",
@@ -67,7 +72,7 @@
67
72
  },
68
73
  "dependencies": {
69
74
  "jsdom": "^22.1.0",
70
- "apxor": "3.0.4"
75
+ "apxor": "3.1.1"
71
76
  },
72
77
  "engines": {
73
78
  "pnpm": ">=8",