apxor-qe 2.0.6 → 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.
- package/dist/apxor.qe.js.bak +1034 -1033
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +7 -2
package/dist/apxor.qe.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("apxor")):"function"==typeof define&&define.amd?define(["apxor"],t):(e=e||self)["apxor-qe"]=t(e.Apxor)}(this,(function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){a(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 s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(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,s,a=[],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)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(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,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function f(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var g=window.ApxorLogger,_=function(e){return void 0===e},h=function(e){return null===e},m=function(e){return void 0!==e&&!h(e)},p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function y(e,t){return Array.from(t).map((function(t,n){return String.fromCharCode(t^function(e,t){return e.charCodeAt(Math.floor(t%e.length))}(e,n))})).join("")}var C=function(e,t){return y(e,t=function(e){var t,n,i,r,o,s,a=0,l=[];if(!e)return e;e+="";do{t=(s=p.indexOf(e.charAt(a++))<<18|p.indexOf(e.charAt(a++))<<12|(r=p.indexOf(e.charAt(a++)))<<6|(o=p.indexOf(e.charAt(a++))))>>16&255,n=s>>8&255,i=255&s,l.push(t),64!==r&&(l.push(n),64!==o&&l.push(i))}while(a<e.length);return l}(t))},N=function(e){return m(e)&&!h(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()},b=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 F(t).test(e);default:return!1}},F=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)},K=function(){var e=new Date;return e.getDate()+"/"+e.getMonth()+"/"+e.getFullYear()},S=function(e,t,n){if("GT"===n){var i=e.split(":"),r=t.split(":");if(!(i[0]>=r[0]))return!1;if(i[0]>r[0])return!0;if(i[0]!=r[0])return!1;if(i[1]>=r[1])return!0}else if("LT"===n){var o=e.split(":"),s=t.split(":");if(!(o[0]<=s[0]))return!1;if(o[0]<s[0])return!0;if(o[0]!=s[0])return!1;if(o[1]<=s[1])return!0}},W=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}},Y=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"),"(.+)"),s=i?"^".concat(o):"".concat(o,"$"),a=new RegExp(s);return a.test(e)};function x(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=q(e,t);if(o){var s=function(){if(T(o)){return function(e){return J(e)}(o)}return g.info("Invalid target element. Width and height are 0 for element: ".concat(e,". Can't show tooltip")),!1};return s()}return n?(g.info("Not found yet. Rechecking the DOM."),D(r,i,e,t)):(g.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=q(n,i);if(t){clearInterval(r);!function(){if(T()){J()}else g.info("Invalid target element. Width and height are 0 for element: ".concat(n,". Can't show tooltip"))}()}else(e-=1)<=0&&(clearInterval(r),console.warn("Element with selector:".concat(n," not found.")))}),t)}var q=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=A(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},A=function(e){var t=e.indexOf("svg");-1!==t&&(e=e.substring(0,t)+"svg:svg");try{return document.iMZf(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 T(e){try{var t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!1}catch(e){return!1}return!0}function H(e,t){for(var n=0;n<e.length;n++)if(e[n].hasOwnProperty(t))return e[n];return null}function J(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 L=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)},I=window.ApxorLogger,P=s((function t(){var n=this;r(this,t),a(this,"KlQa","ALL"),a(this,"vuUy",[]),a(this,"TvMJ",[]),a(this,"userAttributesValidated",!0),a(this,"sessionAttributeValidated",!0),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(n.KlQa=e.audience.audience_type,n.vuUy=e.audience.attributes.user,n.TvMJ=e.audience.attributes.session,!Array.isArray(n.vuUy)||!Array.isArray(n.TvMJ))return I.error("No attributes"),!1}catch(e){return I.error(e),!1}return!0})),a(this,"validate",(function(t,i){var r=!0;"FTU"===n.KlQa&&(r=e.getController().getSessionInfo().is_first_session);var o=n.KGxX(t,n.vuUy),s=n.KGxX(i,n.TvMJ);return o||(n.userAttributesValidated=!1),s||(n.sessionAttributeValidated=!1),r&&o&&s})),a(this,"KGxX",(function(e,t){var n=t.length,i=!0;try{for(var r,o=function(){var n=t[s];if(_(e[n.name])||!1===i)return{v:!1};var r=n.operator,o=n.type,a=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 a.some((function(t){return"s"===o?e="".concat(e):"l"===o?e=parseInt(e):"f"===o?e=parseFloat(e):"b"===o&&(e=!!e),b(e,t,r)}))}));i=i&&l},s=0;s<n;s++)if(r=o())return r.v}catch(e){I.error(e),i=!1}return i}))})),k=s((function e(){var t=this;r(this,e),a(this,"KyJY",""),a(this,"Sqrf",{}),a(this,"WgXw",""),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{t.KyJY=e.name,t.Sqrf=e.additional_info,t.WgXw=null==e?void 0:e.path}catch(e){return!1}return!0}))})),V=s((function e(){var t=this;r(this,e),a(this,"MREo",0),a(this,"Hllr",0),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.MREo=Number(e.lower),t.Hllr=Number(e.upper),isNaN(t.MREo)||isNaN(t.Hllr))return!1}catch(e){return!1}return!0}))})),G=s((function e(){var t=this;r(this,e),a(this,"SqYL",0),a(this,"HvGe",""),a(this,"FDiq",""),a(this,"lKqH",new k),a(this,"Gufw",new V),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.HvGe=e.event_type,t.FDiq=e.activity,t.lKqH.parse(e.details)&&t.Gufw.parse(e.time_bounds)}catch(e){return!1}}))})),B=window.ApxorLogger,O=s((function e(){var t=this;r(this,e),a(this,"SqYL",0),a(this,"DlWo",-1),a(this,"rZaN",0),a(this,"Yfhc",""),a(this,"FDiq",""),a(this,"HvGe",""),a(this,"Gufw",new V),a(this,"lKqH",new k),a(this,"uhVV",new G),a(this,"GWsZ","AND"),a(this,"DePE",!1),a(this,"KlQa",void 0),a(this,"bgZN",""),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;return t.DlWo=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.rZaN=null==e||null===(n=e.count_config)||void 0===n?void 0:n.count,t.Yfhc=null==e||null===(i=e.count_config)||void 0===i?void 0:i.operator,t.FDiq=null==e?void 0:e.activity,t.HvGe=null==e?void 0:e.event_type,t.GWsZ=e.combine_operator,t._timeEnabled=null==e?void 0:e.time_enabled,t._time=null==e?void 0:e.time,t.KlQa=null==e?void 0:e.type,t.bgZN=null==e?void 0:e.route,t.lKqH.parse(null==e?void 0:e.details)&&t.uhVV.parse(e.trigger)&&t.Gufw.parse(e.time_bounds)}catch(e){return B.error(e),!1}}))})),U=window.ApxorLogger,Q=s((function e(){var t=this;r(this,e),a(this,"rZaN",0),a(this,"Yfhc",""),a(this,"HvGe",""),a(this,"Gufw",new V),a(this,"lKqH",new k),a(this,"GWsZ","AND"),a(this,"parse",(function(e){try{return t.rZaN=e.count_config.count,t.Yfhc=e.count_config.operator,t.HvGe=e.event_type,t.GWsZ=e.combine_operator,t.lKqH.parse(e.details)&&t.Gufw.parse(e.time_bounds)}catch(e){return U.error(e),!1}}))})),z=window.ApxorLogger,R=function(){function t(){var n=this;r(this,t),a(this,"EVry",0),a(this,"bdFJ",""),a(this,"WClN",new O),a(this,"PRzK",new Q),a(this,"sqtm",!1),a(this,"YgKd",!1),a(this,"oSvu",0),a(this,"GWsZ","AND"),a(this,"jNho","OR"),a(this,"thKi",-1),a(this,"PHRJ",[]),a(this,"oFGe",{}),a(this,"scDF",!1),a(this,"mxgE",void 0),a(this,"YiPY",void 0),a(this,"AvID",void 0),a(this,"eCfL",void 0),a(this,"no_KPI_TriggerDetails",[]),a(this,"JUwB",!1),a(this,"timerDidnt",void 0),a(this,"timerDid",void 0),a(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],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=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.bdFJ=i,n.oSvu=r,n.PHRJ=s,n.mxgE=o,n.childConditionIndex=u,n.across_sessions=a||!1,"termination"===l&&""!==l){n.PRzK.parse(t);return n.jNho=n.PRzK.GWsZ,n.hrYw(),!0}var v=n.WClN.parse(t);if(v){if(n.GWsZ=n.WClN.GWsZ,n.WClN.DePE){var c=n.WClN.lKqH.KyJY;"APX_PAGE_OPENED"===c&&(c=n.WClN.lKqH.Sqrf.navigation_id,c=m(c)?c:n.WClN.lKqH.KyJY),n.thKi=e.getController().getEventCount(c);var f=n.WClN.rZaN,g=n.WClN.Yfhc;if(n.YgKd=n.FhUD(n.thKi-1,f,g,!1),n.sqtm=n.YgKd,n.YgKd&&"APX_PAGE_OPENED"===n.WClN.lKqH.KyJY)return!0}return!0===d&&(o&&0!==r&&"unordered"!==o||n.APPb()),!0}return!1})),a(this,"APPb",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1!=t&&(n.YiPY=t);var i=n.WClN,r=null!=i&&i._eventCategory?null==i?void 0:i._eventCategory:"specific_event",o=i.uhVV,s=_e.getInstance();if("app_start"===o.HvGe)if(n.sqtm=!0,null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var a=W(i._time.unit,i._time.value);if("didn't"==(null==i?void 0:i.KlQa)){if(n.scDF=!1,n.timerDidnt=setTimeout((function(){n.scDF||(n.YgKd=!0,n.YgKd&&(n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.WClN.rZaN,n.WClN.Yfhc),n.YgKd&&(n.WClN.SqYL=Date.now(),n.scDF=!1,s.validate(n.bdFJ,n.oSvu,n.YiPY))),"specific_event"===r?s.unregisterFromEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.tTcF):n.xWgh(r),n.sqtm=!1)}),a),n.across_sessions){var l=W(i._time.unit,i._time.value),u=i._timeEnabled,d=i._id;n.cYfS(i.KlQa,i.lKqH.KyJY,Date.now(),i.lKqH.Sqrf,l,u,d)}"specific_event"===r?(s.registerForEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.tTcF),n.eCfL=n.WClN):n.CUnC(r)}else if("did"==(null==i?void 0:i.KlQa)){if(n.timerDid=setTimeout((function(){n.JUwB||("specific_event"===r?s.unregisterFromEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.lvQw):n.Byhk(r))}),a),n.across_sessions){var v=W(i._time.unit,i._time.value),c=i._timeEnabled,f=i._id;n.cYfS(i.KlQa,i.lKqH.KyJY,Date.now(),i.lKqH.Sqrf,v,c,f)}"specific_event"===r?(s.registerForEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.lvQw),n.AvID=n.WClN):n.mRBf(r)}}}else"specific_event"===r?s.registerForEvent(w(i.HvGe)+"___"+i.lKqH.KyJY,n.EXBl):n.nrMH(r);else if(null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var g=W(i._time.unit,i._time.value);"didn't"==(null==i?void 0:i.KlQa)?(n.scDF=!1,n.timerDidnt=setTimeout((function(){n.scDF||(n.YgKd=!0,n.YgKd&&(n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.WClN.rZaN,n.WClN.Yfhc),n.YgKd&&(n.WClN.SqYL=Date.now(),n.scDF=!1,s.validate(n.bdFJ,n.oSvu)))),"specific_event"===r&&s.unregisterFromEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.tTcF),n.sqtm=!1}),g),"specific_event"===r?(s.registerForEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.tTcF),n.eCfL=n.WClN):n.CUnC()):"did"==(null==i?void 0:i.KlQa)&&(n.timerDid=setTimeout((function(){n.JUwB||"specific_event"===r&&s.unregisterFromEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.lvQw)}),g),"specific_event"===r&&s.registerForEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.lvQw))}}else"specific_event"===r&&s.registerForEvent(w(i.HvGe)+"___"+o.lKqH.KyJY,n.EXBl);null!==(e=window.ApxorRTM)&&void 0!==e&&e.badgesLists.includes(n.bdFJ)&&s.registerForEvent(w(i.HvGe)+"___"+"apxor-badge-container-".concat("-".concat(n.bdFJ).replaceAll(" ","").replace(/[^\w\s]/gi,"")),n.EXBl)})),a(this,"nrMH",(function(e){var t=new _e;"apxor_event"===e?t.registerForEvent("apxor_event",(function(e,t,i,r){n.EXBl(w(n.WClN.HvGe),n.WClN.lKqH.KyJY,i,n.WClN.lKqH.Sqrf)})):"customer_event"===e?t.registerForEvent("customer_event",(function(e,t,i,r){n.EXBl(w(n.WClN.HvGe),n.WClN.lKqH.KyJY,i,n.WClN.lKqH.Sqrf)})):"any_event"===e?t.registerForEvent("any_event",(function(e,t,i,r){n.EXBl(w(n.WClN.HvGe),n.WClN.lKqH.KyJY,i,n.WClN.lKqH.Sqrf)})):"campaign_event"===e?t.registerForEvent("campaign_event",(function(e,t,i,r){n.EXBl(w(n.WClN.HvGe),n.WClN.lKqH.KyJY,i,n.WClN.lKqH.Sqrf)})):"survey_event"===e&&t.registerForEvent("survey_event",(function(e,t,i,r){n.EXBl(w(n.WClN.HvGe),n.WClN.lKqH.KyJY,i,n.WClN.lKqH.Sqrf)}))})),a(this,"xWgh",(function(e){var t=new _e,i=n.WClN._eventCategory;"apxor_event"===i?t.unregisterFromEvent("apxor_event",n.tTcF):"customer_event"===i?t.unregisterFromEvent("customer_event",n.tTcF):"any_event"===i?t.unregisterFromEvent("any_event",n.tTcF):"campaign_event"===i?t.unregisterFromEvent("campaign_event",n.tTcF):"survey_event"===i&&t.unregisterFromEvent("survey_event",n.tTcF)})),a(this,"CUnC",(function(){var e=new _e,t=n.WClN._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.tTcF):"customer_event"===t?e.registerForEvent("customer_event",n.tTcF):"any_event"===t?e.registerForEvent("any_event",n.tTcF):"campaign_event"===t?e.registerForEvent("campaign_event",n.tTcF):"survey_event"===t&&e.registerForEvent("survey_event",n.tTcF)})),a(this,"mRBf",(function(){var e=new _e,t=n.WClN._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.lvQw):"customer_event"===t?e.registerForEvent("customer_event",n.lvQw):"any_event"===t?e.registerForEvent("any_event",n.lvQw):"campaign_event"===t?e.registerForEvent("campaign_event",n.lvQw):"survey_event"===t&&e.registerForEvent("survey_event",n.lvQw)})),a(this,"Byhk",(function(){var e=new _e,t=n.WClN._eventCategory;"apxor_event"===t?e.unregisterFromEvent("apxor_event",n.lvQw):"customer_event"===t?e.unregisterFromEvent("customer_event",n.lvQw):"any_event"===t?e.unregisterFromEvent("any_event",n.lvQw):"campaign_event"===t?e.unregisterFromEvent("campaign_event",n.lvQw):"survey_event"===t&&e.unregisterFromEvent("survey_event",n.lvQw)})),a(this,"hrYw",(function(){var e=n.PRzK,t=_e.getInstance();n.sqtm=!0,t.registerForEvent(w(e.HvGe)+"___"+e.lKqH.KyJY,n.ipby)})),a(this,"cwAa",(function(e,t,i,r){var o,s=(Date.now()-n.oFGe[t])/1e3;(null===(o=n.WClN)||void 0===o||null===(o=o.lKqH)||void 0===o||null===(o=o.Sqrf)||void 0===o?void 0:o.time)/1e3>s&&n._displayCampaign(i)})),a(this,"rZJt",(function(e,t,i,r){var o,s;n.scDF=!0;var a=Date.now(),l=null===(o=n.WClN)||void 0===o||null===(o=o.uhVV)||void 0===o?void 0:o.lKqH.KyJY,u=(a-n.oFGe[l])/1e3,d=null===(s=n.WClN)||void 0===s||null===(s=s.lKqH)||void 0===s||null===(s=s.Sqrf)||void 0===s?void 0:s.time;(d/=1e3)>u&&n._displayCampaign(i)})),a(this,"lvQw",(function(){n.JUwB=!0;var e=new _e;clearTimeout(n.timerDid),n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.WClN.rZaN,n.WClN.Yfhc),n.YgKd&&(e.unregisterFromEvent(w(n.AvID.HvGe)+"___"+n.AvID.lKqH.KyJY,n.lvQw),n.JUwB=!1,e.validate(n.bdFJ,n.oSvu,n.YiPY))})),a(this,"tTcF",(function(e,t,i,r){n.scDF=!0,clearTimeout(n.timerDidnt),(new _e).unregisterFromEvent(w(n.eCfL.HvGe)+"___"+n.eCfL.lKqH.KyJY,n.tTcF)})),a(this,"EXBl",(function(t,i,r,o){var s,a,l=_e.getInstance();if(n.sqtm){if(null!==(s=window.ApxorRTM)&&void 0!==s&&s.isBadgePresent&&null!==(a=window.ApxorRTM)&&void 0!==a&&a.badgesLists.includes(n.bdFJ)&&e.getController().isBadgeTriggerSatisfied(n.bdFJ))return n.YgKd=!0,n.WClN.SqYL=r,void l.validate(n.bdFJ,n.oSvu);if(w(n.WClN.HvGe)===t&&n.LYgL(r-n.WClN.uhVV.SqYL,n.WClN.Gufw)&&n.WClN.lKqH.KyJY===i&&n.esVc(n.WClN.lKqH.Sqrf,o)&&(n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.WClN.rZaN,n.WClN.Yfhc),n.YgKd)){if(n.WClN.SqYL=r,n.across_sessions){var u=W(n.WClN._time.unit,n.WClN._time.value),d=n.WClN._timeEnabled,v=n.WClN._id,c=n.EVry;n.cYfS(n.WClN.KlQa,i,r,o,u,d,v,c)}l.validate(n.bdFJ,n.oSvu,n.YiPY)}}else if(n.sqtm=n.YUkH(t,i,r,o),n.sqtm){var f=n.WClN,g=f.uhVV;if(g.SqYL=r,"activity_time"===(null==f?void 0:f.HvGe)){var _,h,m,p,y=null==f||null===(_=f.lKqH)||void 0===_||null===(_=_.Sqrf)||void 0===_?void 0:_.time;(null==f||null===(h=f.bgZN)||void 0===h?void 0:h.length)>0?setTimeout((function(){var t;(null===(t=e.getController())||void 0===t?void 0:t._appEventsNoKpi).length<=2&&f.bgZN===location.pathname&&n._displayCampaign(r)}),y):(null==f||null===(m=f.lKqH)||void 0===m||null===(m=m.Sqrf)||void 0===m?void 0:m.nkpi.length)>0?(setTimeout((function(){n.scDF||(n.YgKd=!0,n.YgKd&&(n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.WClN.rZaN,n.WClN.Yfhc),n.YgKd&&(n.WClN.SqYL=r,n.scDF=!1,l.validate(n.bdFJ,n.oSvu)))),f.lKqH.Sqrf.nkpi.map((function(e){l.unregisterFromEvent(E(f.lKqH.Sqrf.et)+"___"+e,n),n.sqtm=!1}))}),y),f.lKqH.Sqrf.nkpi.map((function(e){l.registerForEvent(E(f.lKqH.Sqrf.et)+"___"+e,n.tTcF)}))):(null==f||null===(p=f.lKqH)||void 0===p||null===(p=p.Sqrf)||void 0===p?void 0:p.kpi.length)>0&&(setTimeout((function(){f.lKqH.Sqrf.kpi.map((function(e){l.unregisterFromEvent(E(f.lKqH.Sqrf.et)+"___"+e,n)}))}),y),f.lKqH.Sqrf.kpi.map((function(e){e===f.uhVV.lKqH.KyJY?(l.unregisterFromEvent(w(g.HvGe)+"___"+g.lKqH.KyJY,n),l.registerForEvent(E(f.lKqH.Sqrf.et)+"___"+e,n.cwAa)):l.registerForEvent(E(f.lKqH.Sqrf.et)+"___"+e,n.rZJt)})))}else l.unregisterFromEvent(w(g.HvGe)+"___"+g.lKqH.KyJY,n),l.registerForEvent(w(f.HvGe)+"___"+f.lKqH.KyJY,n);n.oFGe[i]=Date.now()}})),a(this,"ipby",(function(e,t,i,r){var o=_e.getInstance();w(n.PRzK.HvGe)===e&&n.LYgL(i,n.PRzK.Gufw)&&n.PRzK.lKqH.KyJY===t&&n.esVc(n.PRzK.lKqH.Sqrf,r)&&(n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.PRzK.rZaN,n.PRzK.Yfhc),n.YgKd&&(n.PRzK.SqYL=i,o.validateForTermination(n.bdFJ,n.oSvu)))})),a(this,"YUkH",(function(e,t,i,r){var o=n.WClN.uhVV,s=w(o.HvGe)===e&&o.lKqH.KyJY===t&&n.LYgL(i,o.Gufw)&&n.esVc(o.lKqH.Sqrf,r);return s="APX_PAGE_OPENED"===t?s&&location.pathname===o.lKqH.WgXw:s})),a(this,"LYgL",(function(e,t){var n=Math.ceil(e);return n>t.MREo&&n<t.Hllr})),a(this,"FhUD",(function(e,t,i){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(r&&n.WClN.DePE&&(e+=n.thKi),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}})),a(this,"esVc",(function(e,t){var n=!0;try{var r,o=function(){if(!1===n)return{v:!1};if("object"===i(e[s])){var r,o,a,l=e[s].op,u=e[s].t;if("s"===u)a=e[s].val;else if("l"===u||"f"===u)a=parseFloat(e[s].val);else if("b"===u)switch(e[s].val){case"true":a=!0;break;case"false":a=!1;break;default:a=e[s].val}var d,v=(Array.isArray(t[s])?t[s]:[t[s]]).some((function(e){return"s"===u?e="".concat(e):"l"===u?e=parseInt(e):"f"===u?e=parseFloat(e):"b"===u&&(e=!!e),b(e,a,l)}));if(!(null===(r=e[s])||void 0===r||!r.present)&&(null===(o=e[s])||void 0===o?void 0:o.present))d=!!t.hasOwn(t,s),n=n&&d;n=n&&v}else n=n&&b(t[s],e[s],"EQ")};for(var s in e)if(r=o())return r.v}catch(e){z.error(e),n=!1}return n})),a(this,"cYfS",(function(t,i,r,o,s,a,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;a&&(f=Date.now()+s);for(var g=0;g<n.no_KPI_TriggerDetails.length;g++)if(n.no_KPI_TriggerDetails[g].id===l){v=!0,d=n.no_KPI_TriggerDetails[g];break}v?d.satisfiedCount+=1:(c={id:l,type:t,time:r,name:i,additionalInfo:o,satisfiedCount:u,timeBased:a,finishTime:f},n.no_KPI_TriggerDetails.push(c)),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(n.no_KPI_TriggerDetails))})),a(this,"ADTy",(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.WClN.HvGe)+"___"+(null==o?void 0:o.WClN.lKqH.KyJY),n.EXBl);else{var s,a=c(o);try{for(a.s();!(s=a.n()).done;){var l,u=s.value;i.unregisterFromEvent(w(null==u?void 0:u.WClN.HvGe)+"___"+(null==u||null===(l=u.WClN)||void 0===l?void 0:l.lKqH.KyJY),n.EXBl)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){r.e(e)}finally{r.f()}}))}return s(t,[{key:"_displayCampaign",value:function(e){var t=_e.getInstance();this.YgKd=!0,this.YgKd&&(this.EVry+=1,this.YgKd=this.FhUD(this.EVry,this.WClN.rZaN,this.WClN.Yfhc),this.YgKd&&(this.WClN.SqYL=e,t.validate(this.bdFJ,this.oSvu)))}}]),t}(),Z=window.ApxorLogger,M=s((function t(){var n=this;r(this,t),a(this,"rZaN",0),a(this,"vpQG",0),a(this,"sRWr","SESSION"),a(this,"nWdc",0),a(this,"dOdV",0),a(this,"aObU",0),a(this,"_enable_repetition_gap",void 0),a(this,"_enable_days_limit",void 0),a(this,"_enable_session_limit",void 0),a(this,"DWGK",void 0),a(this,"ClXk",void 0),a(this,"chzi",void 0),a(this,"DSLimits",void 0),a(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var i,r,o,s,a,l,u,d;if(n.bdFJ=t._id,n.Busn=t.meta,n.rZaN=t.frequency.count,-1===n.rZaN&&(n.rZaN=9999999),n.aObU=n.rZaN,n.vpQG=t.frequency.time_interval,n.sRWr=t.frequency.validity,n.DSLimits=t.frequency.DSLimits,n.dOdV=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.DWGK=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===(s=t.frequency)||void 0===s||!s.enable_days_limit)&&(null===(a=t.frequency)||void 0===a?void 0:a.enable_days_limit),n._enable_days_limit&&(n.chzi=t.frequency.days_limit.days?t.frequency.days_limit.days:1,n.ClXk=t.frequency.days_limit.limit);var v=_e.getInstance().getQeState();if(!m(v)||!m(v[t._id]))return!0;if("SESSION"===n.sRWr){if(n.rZaN=parseInt(n.rZaN)-parseInt(v[t._id].SESSION),n.rZaN<=0)return n.cwbp("Session limit reached"),console.warn("Max count limit reached for session:"+t._id),e.getController().isTestDevice()&&L("Maximum overall limit reached for campaign name ".concat(n.Busn.name)),!1}else{if("OVERALL"!==n.sRWr)return Z.info("Invalid config."),!1;if(n.rZaN=parseInt(n.rZaN)-parseInt(v[t._id].OVERALL),n.rZaN<=0)return n.cwbp("Overall limit reached"),console.warn("Max count limit reached for overall:"+t._id),e.getController().isTestDevice()&&L("Maximum overall limit reached for campaign name ".concat(n.Busn.name)),!1}}catch(e){return Z.error(e),!1}return!0})),a(this,"IAEG",(function(){n.rZaN=n.rZaN-1})),a(this,"getFrequencyCount",(function(){return n.rZaN})),a(this,"raNn",(function(){"SESSION"===n.sRWr&&(n.rZaN=n.aObU,Z.info("Campaign Limit reset"))})),a(this,"LJcq",(function(t){try{if(n.rZaN<=0)return"OVERALL"===n.sRWr?(n.cwbp("Overall limit reached"),e.getController().isTestDevice()&&L("Maximum overall limit reached for campaign name ".concat(n.Busn.name))):"SESSION"===n.sRWr&&(e.getController().isTestDevice()&&L("Maximum session limit reached for campaign name ".concat(n.Busn.name)),n.cwbp("Session limit reached")),!1;var i=_e.getInstance().getQeState();if(!m(i)||!m(i[t]))return!0;if(n._enable_session_limit)if(parseInt(n.DWGK)-parseInt(i[t].SESSION)<=0)return n.cwbp("Session limit reached"),e.getController().isTestDevice()&&L("Maximum session limit reached for campaign name ".concat(n.Busn.name)),!1;if(n._enable_repetition_gap)if("session"!=n._repetitionUnit){var r=e.getController().getFromStorage("apx-last-shown-times");if(r=JSON.parse(r),!h(H(r,n.bdFJ))){var o=H(r,n.bdFJ)[n.bdFJ];if(Date.now()-o<W(n._repetitionUnit,n._repetitionValue))return n.cwbp("Config does not satisfy time difference "),e.getController().isTestDevice()&&L("Config does not satisfy time difference for campaign name ".concat(n.Busn.name)),!1}}else{var s=e.getController().getFromStorage("apx-last-shown-session");if(s=JSON.parse(s),!h(H(s,n.bdFJ))){var a=H(s,n.bdFJ)[n.bdFJ];if(e.getController().getFromStorage("apx_retained_session")-a<parseInt(n._repetitionValue))return n.cwbp("Config does not satisfy session difference "),e.getController().isTestDevice()&&L("Config does not satisfy session difference for campaign name ".concat(n.Busn.name)),!1}}if(0!==n.dOdV&&n.DSLimits)if(parseInt(n.dOdV)-parseInt(i[t].SESSION)<=0)return n.cwbp("Session limit reached"),e.getController().isTestDevice()&&L("Session limit reached for campaign name ".concat(n.Busn.name)),!1;if(0!==n._dayCount){var l,u=K();if(parseInt(n._dayCount)-parseInt((null===(l=i[t])||void 0===l?void 0:l.DATES[u])||0)<=0)return n.cwbp("Day limit reached"),e.getController().isTestDevice()&&L("Day limit reached for campaign name ".concat(n.Busn.name)),!1}if(n.chzi>0&&n._enable_days_limit){var d=n.chzi,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()),s=String(r.getMonth()),a=r.getFullYear();t.push(o+"/"+s+"/"+a)}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.ClXk)return Z.info("Shown Limit Crossed"),e.getController().isTestDevice()&&L("Days limit reached for campaign name ".concat(n.Busn.name)),!1}}catch(e){n.cwbp("Error validating the frequency: ".concat(e)),Z.error("Error validating the frequency:"+e)}return!0})),a(this,"cwbp",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.Busn.type?"survey":"campaign",apx_nudge_id:n.bdFJ,apx_nudge_name:n.Busn.name,message_name:n.Busn.KyJY,id:n.bdFJ,apx_variant_code:n.Busn.isExperiment||n.Busn.only_context?null===(i=n.Busn.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),j=window.ApxorLogger,X=s((function e(){var t=this;r(this,e),a(this,"HygX",[]),a(this,"UYsF",0),a(this,"kfNs",!1),a(this,"sclT",void 0),a(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]:[],s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];t.bdFJ=n,t.oSvu=i,t.PHRJ=o,t.mxgE=r,t.across_sessions=a;var l=[];t.UYsF=e.length;try{if(null!=l)return r=null==e?void 0:e.sequence_type,l=t.onrv(e,t.UYsF),"unordered"!==s&&0!==t.oSvu||t.APPb(),t.HygX}catch(e){return j.error(e),!1}})),a(this,"onrv",(function(e,n){for(var i=0;i<n;i++){t.sclT=new R;try{t.sclT.initialize(e[i],t.bdFJ,t.oSvu,t.mxgE,t.YFCU,t.across_sessions,"",-1,!1)&&(t.HygX.push(t.sclT),t.HygX.sequence_type=t.mxgE)}catch(e){j.error(e)}}return t.HygX})),a(this,"APPb",(function(){if("ordered"===t.mxgE||"strictly_ordered"===t.mxgE)t.HygX[0].APPb(0);else{var e,n=c(t.HygX);try{for(n.s();!(e=n.n()).done;){e.value.APPb()}}catch(e){n.e(e)}finally{n.f()}}})),a(this,"ADTy",(function(e){t.sclT.ADTy(e)}))})),$=s((function e(){var t=this;r(this,e),a(this,"KyJY",""),a(this,"KlQa",""),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;t.KyJY=e.meta.name,t.KlQa=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=s((function t(){var n=this;r(this,t),a(this,"Fzfv",[]),a(this,"_ret_day",{}),a(this,"ypuj",{}),a(this,"noaz",!1),a(this,"jbkV",!1),a(this,"retainedDaysValidated",!0),a(this,"retainedSessionValidated",!0),a(this,"eventDoneInLT",!1),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{n.Fzfv=e.overall_cfg.events,n._ret_day=e.overall_cfg.ret_day,n.ypuj=e.overall_cfg.session,n.noaz=e.overall_cfg.toggleRetDay,n.jbkV=e.overall_cfg.toggleSession}catch(e){return ee.error(e),!1}return!0})),a(this,"validate",(function(){var t=parseInt(e.getController().getFromStorage("apx_retained_days")),i=parseInt(e.getController().getFromStorage("apx_retained_session"));if(n.noaz&&!isNaN(t)&&!(t>=n._ret_day.from&&t<=n._ret_day.to))return n.retainedDaysValidated=!1,!1;if(n.jbkV&&!isNaN(i)&&!(i>=n.ypuj.from&&i<=n.ypuj.to))return n.retainedSessionValidated=!1,!1;try{for(var r=e.getController().getFromStorage("_apx_lt_count"),o=e.getSiteId(),s=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}(C(o,r)))),a=0;a<n.Fzfv.length;a++){if(s[n.Fzfv[a].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=s((function e(){var t=this;r(this,e),a(this,"vuUy",[]),a(this,"TvMJ",[]),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.vuUy=e.attributes.user,t.TvMJ=e.attributes.session,!Array.isArray(t.vuUy)||!Array.isArray(t.TvMJ))return ne.error("No attributes"),!1}catch(e){return ne.error(e),!1}return!0})),a(this,"validate",(function(e,n){return t.KGxX(e,t.vuUy)&&t.KGxX(n,t.TvMJ)})),a(this,"KGxX",(function(e,t){var n=t.length,i=!0;try{for(var r,o=function(){var n=t[s];if(!e[n.name]||!1===i)return{v:!1};var r=n.operator,o=n.type,a=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 a.some((function(t){return b(e,t,r)}))}));i=i&&l},s=0;s<n;s++)if(r=o())return r.v}catch(e){ne.error(e),i=!1}return i}))})),re=s((function t(){var n=this;r(this,t),a(this,"yIng",e.getController()),a(this,"type",""),a(this,"_duration_seconds",0),a(this,"wIYn",1),a(this,"parse",(function(e){try{var t,i,r;if(n.KlQa=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.wIYn=null===(r=e.terminate_info.time_based)||void 0===r?void 0:r.days,n.ldZx(e._id))return n.yIng.persistTerminationInfoLocally(e._id),!1}catch(e){return!1}return!0})),a(this,"ldZx",(function(e){var t,i=JSON.parse(n.yIng.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),s=new Date((r=new Date).getMonth()+"/"+r.getDate()+"/"+r.getFullYear()),a=parseInt((s-o)/864e5,10),l=function(){var e=new Date;return{hours:e.getHours(),mins:e.getMinutes()}}(),u=i[e].dLHN;return a===n.wIYn&&l.hours>=u.hours||a>n.wIYn||i[e].goalAcheived}))})),oe=s((function e(){var t=this;r(this,e),a(this,"enable_goal_events",!1),a(this,"attributes",{}),a(this,"ErYc",new ie),a(this,"TVJQ",new re),a(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.TVJQ.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.ErYc.parse(e.terminate_info))return!1}catch(e){return window.ApxorLogger.error(e),!1}return!0})),a(this,"validate",(function(e,n){return t.ErYc.validate(e,n)}))})),se=window.ApxorLogger,ae=s((function t(){var n=this;r(this,t),a(this,"RuvQ",-1),a(this,"ZQoY",-1),a(this,"dLHN",-1),a(this,"UIpJ",-1),a(this,"OXLD",-1),a(this,"MinM",-1),a(this,"_is_user_timezone",void 0),a(this,"cIGW",!1),a(this,"KEdX",!1),a(this,"_nudge_expired",!1),a(this,"_not_yet_active",!1),a(this,"_not_in_specified_time",!1),a(this,"_days_in_week",[]),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,i;if(n.bdFJ=e._id,n.Busn=e.meta,isNaN(Date.parse(e.validity.start_date))||isNaN(Date.parse(e.validity.end_date))||!Array.isArray(e.validity.days_in_week))return se.error("Not valid dates"),!1;if(n.RuvQ=Date.parse(e.validity.start_date),n.ZQoY=Date.parse(e.validity.end_date),n._days_in_week=null!==(t=e.validity)&&void 0!==t&&t.days_in_week?null===(i=e.validity)||void 0===i?void 0:i.days_in_week:[1,2,3,4,5,6,7],n._is_user_timezone=!e.is_user_timezone||e.is_user_timezone,m(e.at_specific_time)&&(n.cIGW=e.at_specific_time,n.cIGW&&m(e.time_limits)&&(n.dLHN=e.time_limits.start_time,n.UIpJ=e.time_limits.end_time,N(n.dLHN)||N(n.UIpJ))))return se.error("Not valid times"),!1;if(m(e.time_excludes_in_day)&&(n.KEdX=e.time_excludes_in_day,n.KEdX&&m(e.time_excludes)&&(n.OXLD=e.time_excludes.start_time,n.MinM=e.time_excludes.end_time,N(n.OXLD)||N(n.MinM))))return se.error("Not valid exclude times"),!1}catch(e){return se.error(e),!1}return!0})),a(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(),s=t.getUTCMinutes();r=(o=(o<10?"0":"")+o)+":"+(s=(s<10?"0":"")+s)}return r}(n._is_user_timezone);if(t>n.RuvQ&&t<n.ZQoY&&n._days_in_week.includes(i))return!n.cIGW||S(r,n.dLHN,"GT")&&S(r,n.UIpJ,"LT")||(n._not_in_specified_time=!0),n.KEdX&&function(e,t,n){var i=l(e.split(":").map(Number),2),r=i[0],o=i[1],s=l(t.split(":").map(Number),2),a=s[0],u=s[1],d=l(n.split(":").map(Number),2),v=60*d[0]+d[1];return v>=60*r+o&&v<=60*a+u}(n.OXLD,n.MinM,r)?(n.cwbp("Exclude Time limits check failed"),e.getController().isTestDevice()&&L("Exclude Time Limits check failed for campaign name ".concat(n.Busn.name)),!1):!n.cIGW||S(r,n.dLHN,"GT")&&S(r,n.UIpJ,"LT");if(t<n.RuvQ)n._not_yet_active=!0;else if(t>n.ZQoY)n._nudge_expired=!0;else if(!n._days_in_week.includes(i))return n.cwbp("Current week day did not match with Configured Week day"),e.getController().isTestDevice()&&L("Current week day did not match with Configured Week day for campaign name ".concat(n.Busn.name)),!1;return!1})),a(this,"cwbp",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.Busn.type?"survey":"campaign",apx_nudge_id:n.bdFJ,apx_nudge_name:n.Busn.name,message_name:n.Busn.KyJY,id:n.bdFJ,apx_variant_code:n.Busn.isExperiment||n.Busn.only_context?null===(i=n.Busn.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),le=s((function e(){var t=this;r(this,e),a(this,"eHmB",""),a(this,"orYZ",""),a(this,"jewV",""),a(this,"kULT",""),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.eHmB=null==e?void 0:e.screen_binding,!t.eHmB||(t.orYZ=null==e?void 0:e.binding.url,t.jewV=null==e?void 0:e.binding.var,t.kULT=null==e?void 0:e.binding.operator,!0)}catch(e){return window.ApxorLogger.error(e),!1}})),a(this,"validate",(function(){var e=t.orYZ,n=t.jewV,i=t.kULT,r=window.location.href;return!t.eHmB||("EQ"===i?e.includes(n)?!!Y(r,e,n,!1):r===e:"SW"===i?e.includes(n)?!!Y(r,e,n,!0):!!r.startsWith(e):void 0)}))})),ue=window.ApxorLogger,de=s((function t(){var i=this;r(this,t),a(this,"slst",[]),a(this,"OakL",[]),a(this,"bdFJ",""),a(this,"Busn",new $),a(this,"PnhJ",new P),a(this,"sRWr",new ae),a(this,"jznt",new M),a(this,"lgot",new te),a(this,"poNk",new oe),a(this,"iJQR",new le),a(this,"mxgE",!1),a(this,"YFCU",[]),a(this,"_variant_code",""),a(this,"kfNs",!1),a(this,"groupCombineOperator","OR"),a(this,"scDF",!1),a(this,"nWvj",!1),a(this,"yOuv",void 0),a(this,"timeForKPI",void 0),a(this,"kpiIndex",0),a(this,"PVCi",void 0),a(this,"_across_sessions",!1),a(this,"ijiy",void 0),a(this,"Puvj",!1),a(this,"ztNO",void 0),a(this,"doLk",void 0),a(this,"LwyE",void 0),a(this,"tLbv",void 0),a(this,"YjoD",void 0),a(this,"kMGf",void 0),a(this,"MeLD",void 0),a(this,"SFmA",void 0),a(this,"wzIA",void 0),a(this,"MzoY",void 0),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,n;if(!m(e._id))return ue.error("No Id"),!1;if(!m(e.enabled)||!e.enabled)return ue.error("Not enabled"),!1;if(!(i.Busn.parse(e)&&i.sRWr.parse(e)&&i.jznt.parse(e)&&i.PnhJ.parse(e)&&i.lgot.parse(e)&&i.poNk.parse(e)&&i.iJQR.parse(e)))return!1;if(i._variant_code=i.Busn._isExperiment||i.Busn._only_context?null===(t=i.Busn._attr)||void 0===t?void 0:t.apx_variant_code:"TG",i._across_sessions=!(null==e||!e.across_sessions)&&(null==e?void 0:e.across_sessions),i.enable_conditions=null==e?void 0:e.enable_conditions,i.enable_conditions_v2=null==e?void 0:e.enable_conditions_v2,!m(e.conditions)||!Array.isArray(e.conditions))return ue.error("No valid conditions",e.conditions),!1;i.bdFJ=e._id,i.mxgE=!!m(e.sequence_enabled)&&e.sequence_enabled,m(e.conditions_v2)&&i.enable_conditions_v2&&(i.mxgE=null==e?void 0:e.sequence_type),!0===i.mxgE&&e.conditions.sort((function(e,t){return e.sequence<t.sequence})),m(e.conditions_v2)&&i.enable_conditions_v2?(n=e.conditions_v2,i.Puvj=!0):n=e.conditions,i.ijiy=n;var r=n.length,o=null==e?void 0:e.no_context_enabled;if(0===r&&o&&setTimeout((function(){i.gdmS()}),10),i.MzoY=r,i.Jhsx(n,r),i.fALS(),i.poNk.enable_goal_events)for(var s=e.terminate_info.goal_events.events,a=s.length,l=0;l<a;l++){var u=new R;u.initialize(s[l],i.bdFJ,l,!0,[],i._across_sessions,"termination")&&i.OakL.push(u)}return i.slst.length>0}catch(e){return ue.error(e),!1}})),a(this,"Jhsx",(function(e,t){for(var n=function(){i.YFCU=[];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.wzIA=new X;var s=i.wzIA.initialize(n,i.bdFJ,r,o,i.YFCU,i.mxgE,i._across_sessions);i.slst.push(s)}else{if("didn't"===t.type){var a,l={trigger_key:t.trigger.details.name,no_kpi_array:null==t||null===(a=t.details)||void 0===a||null===(a=a.additional_info)||void 0===a?void 0:a.nkpi,condition_id:null==t?void 0:t._id,time_bounds:t.time_bounds.upper};i.YFCU=[].concat(u(i.YFCU),[l])}if(i.wzIA=new R,i.wzIA.initialize(t,i.bdFJ,r,i.mxgE,i.YFCU,i._across_sessions)){i.slst.push(i.wzIA);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===x(t.view_id,v,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,d)&&i.gdmS(!0),window.addEventListener("navigate",(function(e){var n=null==t?void 0:t.url;window.location.href===n&&"view_visibility"===t.event_type&&!0===x(t.view_id,v,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,d)&&i.gdmS(!0)}))}}},r=0;r<t;r++)n()})),a(this,"fALS",(function(){if(i._across_sessions&&"ordered"===i.mxgE){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,s;if(null!==(r=i.slst[e])&&void 0!==r&&null!==(r=r.WClN)&&void 0!==r&&r._timeEnabled&&void 0===i.slst[e].length){if("didn't"===i.slst[e].WClN.KlQa){var a=i.slst[e].WClN._id,l=i.doSy(a,n);if(l)if(Date.now()>l.finishTime)i.slst[e].YgKd=!0,i.slst[e].EVry=l.satisfiedCount,t=!0;else{var u=l.finishTime-Date.now(),d=i.slst[e].WClN._eventCategory?i.slst[e].WClN._eventCategory:"specific_event",v=new _e;"specific_event"===d?(v.registerForEvent(w(i.slst[e].WClN.HvGe)+"___"+i.slst[e].WClN.lKqH.KyJY,i.tTcF),i.YjoD=i.slst[e]):i.CUnC(d),setTimeout((function(){e!==i.slst.length-1||i.scDF||(i.slst[e].YgKd=!0,i.slst[e].EVry=l.satisfiedCount,t=!0,"specific_event"===d?v.unregisterFromEvent(w(i.slst[e].WClN.HvGe)+"___"+i.slst[e].WClN.lKqH.KyJY,i.tTcF):i.FkGU(i.slst[e]),i.gdmS())}),u)}}if("did"===i.slst[e].WClN.KlQa){var c=i.slst[e].WClN._id,f=i.doSy(c,n);if(f)if(null==f.satisfiedCount){if(Date.now()<f.finishTime){i.LwyE=f,i.doLk=e;var g=f.finishTime-Date.now(),_=i.slst[e].WClN._eventCategory?i.slst[e].WClN._eventCategory:"specific_event",h=new _e;"specific_event"===_?h.registerForEvent(w(i.slst[e].WClN.HvGe)+"___"+i.slst[e].WClN.lKqH.KyJY,i.raUd):i.CUnC(_),setTimeout((function(){"specific_event"===_?h.unregisterFromEvent(w(i.slst[e].WClN.HvGe)+"___"+i.slst[e].WClN.lKqH.KyJY,i.raUd):i.FkGU(i.slst[e])}),g)}}else i.slst[e].EVry=f.satisfiedCount,i.slst[e].YgKd=!0}}else t=i.xUFw(e,n);t&&(null===(o=i.slst[e])||void 0===o||null===(o=o.WClN)||void 0===o||!o._timeEnabled||(null===(s=i.slst[e])||void 0===s?void 0:s.length)>1)?e===i.slst.length-1&&i.gdmS():t||void 0===!i.slst[e].length&&i.slst[e].APPb()},o=0;o<i.slst.length;o++)r(o)}else if(i._across_sessions&&"unordered"===i.mxgE){var s=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(s=JSON.parse(s))&&null!=s)for(var a=0;a<i.slst.length;a++)i.xUFw(a,s)}})),a(this,"xUFw",(function(e,t){if(void 0===i.slst[e].length||1===i.slst[e].length){var n=i.slst[e].WClN._id,r=!1,o=i.doSy(n,t);if(o)i.ztNO=o,r=(new R).FhUD(o.satisfiedCount,i.slst[e].WClN.rZaN,i.slst[e].WClN.Yfhc),o&&(r?i.slst[e].YgKd=!0:i.slst[e].EVry=o.satisfiedCount);else i.slst[e].APPb();return r}if(i.slst[e].length>=1){var s,a,l;if("ordered"===(a=null===(s=i.slst[e])||void 0===s?void 0:s.sequence_type)||"strictly_ordered"===a){for(var u=0;u<i.slst[e].length;u++){var d=i.slst[e][u],v=d.WClN._id;l=!1;var c=i.doSy(v,t);if(c){if(l=(new R).FhUD(c.satisfiedCount,d.WClN.rZaN,d.WClN.Yfhc),c)if(l){i.slst[e][u].YgKd=!0;var f=u+1,g=i.slst[e][u+1];void 0===g&&m(i.slst[e+1])&&(i.slst[e+1].APPb(),l=!0),null!=g&&i.slst[e][u+1].APPb(f)}else i.slst[e][u].EVry=c.satisfiedCount}else(m(i.slst[e][u-1])&&!0===i.slst[e][u].YgKd||_(i.slst[e][u-1]))&&i.slst[e][u].APPb()}return l}for(var h,p=0;p<i.slst[e].length;p++){var y=i.slst[e][0].WClN.GWsZ;h="OR"!==y;var C=i.slst[e][p],N=C.WClN._id;l=!1;var w=i.doSy(N,t);if(w)l=(new R).FhUD(w.satisfiedCount,C.WClN.rZaN,C.WClN.Yfhc),w&&(l?i.slst[e][p].YgKd=!0:i.slst[e][p].EVry=w.satisfiedCount);else C.APPb();h="AND"===y?h&&l:h||l}return h}})),a(this,"doSy",(function(e,t){return t.find((function(t){return t.id===e}))})),a(this,"iMZf",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=_e.getInstance();if(!(t<0)){var o=i.slst[t],s="unordered";if((null==o?void 0:o.length)>1&&(s=null==o?void 0:o.sequence_type),!0===i.mxgE||"ordered"===i.mxgE||"strictly_ordered"===i.mxgE||"ordered"===s||"strictly_ordered"===s){i.kpiIndex=t+1;var a=i.slst[t];if((null==a?void 0:a.length)>0){if(m(a))if("unordered"===i.mxgE&&"ordered"===s){var l=o[n-1];if(m(l))if(void 0===l.length||1==l.length){if(!l.YgKd)return}else if(l.length>1&&!i.EioD(l))return;var u,d=o[n+1];if(m(d)){if(d.APPb(n+1),"strictly_ordered"===i.mxgE){i._currentEventname=a[n].WClN.lKqH.KyJY;var v=e.getController();v.registerForEvent("APP_EVENT",i.XtWv),v.registerForEvent("CLIENT_EVENT",i.XtWv)}}else if("strictly_ordered"===s)1!=i.kfNs&&i.gdmS();else(null===(u=o[n])||void 0===u?void 0:u.length)>0?i.EioD(o)&&i.gdmS():i.gdmS()}else{var f,g=i.slst[t-1];if(m(g))if(void 0===g.length||1==g.length){if(!g.YgKd)return}else if(g.length>1&&!i.EioD(g))return;if(void 0===a.length||1===a.length?f=i.slst[t+1]:a.length>1&&("ordered"===s||"strictly_ordered"===s?f=n===a.length-1?i.slst[t+1]:i.slst[t][n+1]:i.EioD(a)&&(f=i.slst[t+1])),m(f)){if(void 0===f.length||1===f.length)f.APPb(n+1);else if(i.EioD(a))if(void 0===f.length)f.APPb();else if(f.length>1)if("unordered"===f.sequence_type)for(var _=0;_<f.length;_++)f[_].APPb(_);else"ordered"!==f.sequence_type&&"strictly_ordered"!==f.sequence_type||f[0].APPb(0);if("strictly_ordered"===i.mxgE){i._currentEventname=a[n].WClN.lKqH.KyJY;var h=e.getController();h.registerForEvent("APP_EVENT",i.XtWv),h.registerForEvent("CLIENT_EVENT",i.XtWv)}}else"strictly_ordered"===i.mxgE?1!=i.kfNs&&i.gdmS():i.EioD(a)&&i.gdmS()}}else if(m(a)&&a.YgKd){a.oFGe[a.WClN.lKqH.KyJY]=Date.now();var p=i.slst[t-1];if(m(p))if(void 0===p.length||1==p.length){if(!p.YgKd)return}else if(p.length>1&&!i.EioD(p))return;var y=i.slst[t+1];if(m(y)){var C,N;if(null!=y&&null!==(C=y.WClN)&&void 0!==C&&C._timeEnabled){if("session"!=(null===(N=y.WClN)||void 0===N?void 0:N._time.unit)){var E,b,F=W(y.WClN._time.unit,y.WClN._time.value);if("didn't"==(null===(E=y.WClN)||void 0===E?void 0:E.KlQa)){if(i.MeLD=setTimeout((function(){if(i.scDF)i.scDF=!1;else{if(i.scDF=!1,y.YgKd=!0,y.YgKd){y.EVry+=1;var e=new R;if(y.YgKd=e.FhUD(y.EVry,y.WClN.rZaN,y.WClN.Yfhc),y.YgKd){y.WClN.SqYL=Date.now();var n=t+1,o=i.slst[n+1];m(o)?o.APPb():i.gdmS()}}r.unregisterFromEvent(w(y.WClN.HvGe)+"___"+y.WClN.lKqH.KyJY,i.tTcF),y.sqtm=!1}}),F),i._across_sessions){var K=W(y.WClN._time.unit,y.WClN._time.value),S=y.WClN._timeEnabled,Y=y.WClN._id,x=new R;x.cYfS(y.WClN.KlQa,y.WClN.lKqH.KyJY,Date.now(),y.WClN.lKqH.Sqrf,K,S,Y)}"specific_event"===y.WClN._eventCategory?(r.registerForEvent(w(y.WClN.HvGe)+"___"+y.WClN.lKqH.KyJY,i.tTcF),i.YjoD=y):i.CUnC(y)}else if("did"==(null===(b=y.WClN)||void 0===b?void 0:b.KlQa)&&(i.scDF=!1,i.PVCi=y,m(i.slst[t+2])&&i._across_sessions&&(i.tLbv=i.slst[t+2]),i.SFmA=setTimeout((function(){i.scDF?i.scDF=!1:(i.scDF=!1,r.unregisterFromEvent(w(y.WClN.HvGe)+"___"+y.WClN.lKqH.KyJY,i.rZJt))}),F),i.yOuv=a,i.timeForKPI=F,r.registerForEvent(w(y.WClN.HvGe)+"___"+y.WClN.lKqH.KyJY,i.rZJt),i.kMGf=y,i._across_sessions)){var D=W(y.WClN._time.unit,y.WClN._time.value),q=y.WClN._timeEnabled,A=y.WClN._id,T=new R;T.cYfS(y.WClN.KlQa,y.WClN.lKqH.KyJY,Date.now(),y.WClN.lKqH.Sqrf,D,q,A)}}}else if(y.length>0)if("ordered"===y.sequence_type||"strictly_ordered"===y.sequence_type)y[0].APPb(n+1);else{var H,J=c(y);try{for(J.s();!(H=J.n()).done;){var L=H.value;L.APPb()}}catch(e){J.e(e)}finally{J.f()}}else y.APPb();if("strictly_ordered"===i.mxgE){i._currentEventname=a.WClN.lKqH.KyJY;var I=e.getController();I.registerForEvent("APP_EVENT",i.XtWv),I.registerForEvent("CLIENT_EVENT",i.XtWv)}}else"strictly_ordered"===i.mxgE?1!=i.kfNs&&i.gdmS():i.gdmS()}}else i.DSfp(),i.gdmS()}})),a(this,"XtWv",(function(e){e&&e.name!=i._currentEventname&&(i.kfNs=!0)})),a(this,"CUnC",(function(e){var t=new _e,n=e.WClN._eventCategory;"apxor_event"===n?t.registerForEvent("apxor_event",i.tTcF):"customer_event"===n?t.registerForEvent("customer_event",i.tTcF):"any_event"===n?t.registerForEvent("any_event",i.tTcF):"campaign_event"===n?t.registerForEvent("campaign_event",i.tTcF):"survey_event"===n&&t.registerForEvent("survey_event",i.tTcF)})),a(this,"FkGU",(function(e){var t=new _e,n=e.WClN._eventCategory;"apxor_event"===n?t.unregisterFromEvent("apxor_event",i.tTcF):"customer_event"===n?t.unregisterFromEvent("customer_event",i.tTcF):"any_event"===n?t.unregisterFromEvent("any_event",i.tTcF):"campaign_event"===n?t.unregisterFromEvent("campaign_event",i.tTcF):"survey_event"===n&&t.unregisterFromEvent("survey_event",i.tTcF)})),a(this,"tTcF",(function(){var e,t;i.MeLD&&(i.scDF=!1,clearTimeout(i.MeLD));var n=new _e;i.scDF=!0,i._across_sessions&&null!==localStorage.getItem("apx_nokpi_triggerdetails")&&localStorage.removeItem("apx_nokpi_triggerdetails"),n.unregisterFromEvent(w(null===(e=i.YjoD)||void 0===e||null===(e=e.WClN)||void 0===e?void 0:e.HvGe)+"___"+(null===(t=i.YjoD)||void 0===t||null===(t=t.WClN)||void 0===t||null===(t=t.lKqH)||void 0===t?void 0:t.KyJY),i.tTcF)})),a(this,"rZJt",(function(){var t,n,r,o=new _e;i.scDF=!0,i.SFmA&&clearTimeout(i.SFmA);var s=new R;if(i.PVCi.EVry+=1,i.PVCi.YgKd=s.FhUD(i.PVCi.EVry,i.PVCi.WClN.rZaN,i.PVCi.WClN.Yfhc),o.unregisterFromEvent(w(null===(t=i.kMGf)||void 0===t||null===(t=t.WClN)||void 0===t?void 0:t.HvGe)+"___"+(null===(n=i.kMGf)||void 0===n||null===(n=n.WClN)||void 0===n?void 0:n.lKqH.KyJY),i.rZJt),i._across_sessions&&null!==(r=i.tLbv)&&void 0!==r&&r.WClN._timeBased){var a,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.tLbv.WClN._id){a=!0,l=d[v];break}if(a)l.satisfiedCount+=1;else{var c=i.PVCi.WClN._id,f=i.PVCi.WClN.KlQa,g=i.PVCi.WClN.lKqH.KyJY,_=i.PVCi.WClN.lKqH.Sqrf;u={id:c,type:f,time:Date.now(),name:g,additionalInfo:_,satisfiedCount:i.PVCi.WClN._timeEnabled,timeBased:i.PVCi.WClN._timeEnabled},i.no_KPI_TriggerDetails.push(u)}}if(i.PVCi.YgKd){var h=i.slst[i.kpiIndex+1];m(h)?h.APPb():i.gdmS()}})),a(this,"raUd",(function(){if(i.doLk===i.slst.length-1){i.nWvj=!0;i.slst[i.doLk]&&(i.slst[i.doLk].EVry=i.LwyE.satisfiedCount,i.slst[i.doLk].YgKd=!0,i.gdmS())}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.doLk){n=!0,t=r[o];break}if(n&&(t.satisfiedCount=1),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(r)),i.slst[i.doLk].EVry=i.LwyE.satisfiedCount,i.slst[i.doLk].YgKd=!0,i.slst[i.doLk+1].WClN._timeEnabled){var s=W(i.slst[i.doLk+1].WClN._time.unit,i.slst[i.doLk+1].WClN._time.value),a=i.slst[i.doLk+1].WClN._timeEnabled,l=i.slst[i.doLk+1].WClN._id,u=i.slst[i.doLk+1].EVry,d=i.slst[i.doLk+1].WClN.lKqH.KyJY,v=i.slst[i.doLk+1].lKqH.Sqrf;(new R).cYfS(i.WClN.KlQa,d,Date.now(),v,s,a,l,u)}}})),a(this,"DSfp",(function(){if(i._across_sessions&&i.Puvj){var t,n,r,o="single",s=!1,a=e.getController().getFromStorage("apx_nokpi_triggerdetails");if((a=JSON.parse(a)).length>0){var l,u=c(a);try{var d=function(){var e=l.value,a=e.id,u=e.satisfiedCount;if(t=i.slst.find((function(e,t){if(1===(null==e?void 0:e.length)||void 0===(null==e?void 0:e.length)){if(e.WClN._id===a)return o="single",n=t,!0}else if(e.length>0){var i=e.findIndex((function(e){return e.WClN._id===a}));if(-1!==i)return n=t,r=i,o="group",!0}return!1})),"single"===o&&t){var d=new R;s=d.FhUD(u,t.WClN.rZaN,t.WClN.Yfhc);var v=i.slst.findIndex((function(e){var t;return(null==e||null===(t=e.WClN)||void 0===t?void 0:t._id)===a}));void 0===v&&(v=n),s&&(i.slst[v].YgKd=!0)}else if("group"===o&&t){var c=new R;(s=c.FhUD(u,t[r].WClN.rZaN,t[r].WClN.Yfhc))&&(i.slst[n][r].YgKd=!0)}};for(u.s();!(l=u.n()).done;)d()}catch(e){u.e(e)}finally{u.f()}}}})),a(this,"HScg",(function(e){e<0||i.NpcX()})),a(this,"gdmS",(function(){var t,r,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],s=e.getController().getUserAttributes(),a=e.getController().getSessionAttributes();if(null!==(t=window.ApxorRTM)&&void 0!==t&&t.isBadgePresent&&null!==(r=window.ApxorRTM)&&void 0!==r&&r.badgesLists.includes(i.bdFJ)&&e.getController().isBadgeTriggerSatisfied(i.bdFJ)||null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===i.Busn.KlQa?"survey":"campaign",apx_nudge_id:i.bdFJ,apx_nudge_name:i.Busn.KyJY,message_name:i.Busn.KyJY,id:i.bdFJ,apx_variant_code:i.Busn._isExperiment||i.Busn._only_context?i.Busn._attr.apx_variant_code:"TG"}),!(i.sRWr.validate()&&i.PnhJ.validate(s,a)&&i.lgot.validate()&&i.iJQR.validate())){i.Busn.KlQa;return i.lgot.retainedDaysValidated?i.lgot.retainedSessionValidated?i.lgot.eventDoneInLT?void i.cwbp("Event done in life time"):i.PnhJ.userAttributesValidated?i.PnhJ.sessionAttributeValidated?i.sRWr._not_in_specified_time?void i.cwbp("Time limits check failed"):i.sRWr._not_yet_active?void i.cwbp("not in the scheduled time"):i.sRWr._nudge_expired?void i.cwbp("nudge expired"):void 0:void i.cwbp("Session property filter not met"):void i.cwbp("User property filter not met"):void i.cwbp("User session criteria not met"):void i.cwbp("Retained day criteria not met")}var l=i.slst.length,u=l<1,d="";0===l&&(u=!0);for(var v=0;v<l;v++){var f=void 0,g=i.slst[v];if(g.length>1){var _=g[0].WClN.GWsZ;f="AND"===_;for(var h=0;h<g.length;h++){var m=g[0].WClN.GWsZ;f="AND"===m?f&&g[h].YgKd:f||g[h].YgKd}}else f=g.YgKd;if(""===d.trim())u=f;else switch(d){case"AND":u=u&&f;break;case"OR":u=u||f}d=g.length>1?i.groupCombineOperator:g.GWsZ}if(!0===o&&(u=!0),u){if(console.debug("onCondition satisfied"),!i.jznt.LJcq(i.bdFJ))return void console.warn("Maximum limit reached",i.bdFJ);i._across_sessions&&localStorage.removeItem("apx_nokpi_triggerdetails");var p,y=c(i.slst);try{for(y.s();!(p=y.n()).done;){var C=p.value;if(1===(null==C?void 0:C.length)||void 0===(null==C?void 0:C.length))C.YgKd=!1,C.EVry=0;else{var N,w=c(C);try{for(w.s();!(N=w.n()).done;){var E=N.value;E.YgKd=!1,E.EVry=0}}catch(e){w.e(e)}finally{w.f()}}}}catch(e){y.e(e)}finally{y.f()}if(i.wzIA.ADTy(i.slst),i.slst=[],i.Jhsx(i.ijiy,i.MzoY),!0===i.Busn._only_context){var b="SURVEY"===i.Busn.KlQa?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.Busn._attr),{},{message_name:i.Busn.KyJY,apx_nudge_name:i.Busn.KyJY,apx_nudge_id:i.bdFJ,id:i.bdFJ}),!1,"",b)}e.getController().dispatchEvent(i.Busn.KlQa,{name:i.Busn.KlQa,additional_info:{uuid:i.bdFJ,name:i.Busn.KyJY}})}})),a(this,"NpcX",(function(){for(var t=i.OakL.length,r=t<1,o="",s=0;s<t;s++){var a=i.OakL[s],l=a.YgKd;if(""===o.trim())r=l;else switch(o){case"AND":r=r&&l;break;case"OR":r=r||l}o=a.jNho}if(r){if(e.getController().persistTerminationInfoLocally(i.bdFJ),!0===i.Busn._only_context){var u="SURVEY"===i.Busn.KlQa?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.Busn._attr),{},{message_name:i.Busn.KyJY,apx_nudge_name:i.Busn.KyJY,apx_nudge_id:i.bdFJ,id:i.bdFJ}),!1,"apxor",u)}e.getController().dispatchEvent(i.Busn.KlQa,{name:i.Busn.KlQa,additional_info:{uuid:i.bdFJ,name:i.Busn.KyJY}})}})),a(this,"validateForTerminationAttributes",(function(){var t=e.getController().getUserAttributes(),n=e.getController().getSessionAttributes();return i.poNk.validate(t,n)})),a(this,"IAEG",(function(){i.jznt.IAEG()})),a(this,"getFrequencyCount",(function(){return i.jznt.getFrequencyCount()})),a(this,"kcZO",(function(){return i.jznt.raNn()})),a(this,"EioD",(function(e){var t;t="AND"===e[0].WClN.GWsZ;for(var n=0;n<e.length;n++){t="AND"===e[0].WClN.GWsZ?t&&e[n].YgKd:t||e[n].YgKd}return t})),a(this,"cwbp",(function(t){var n;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.Busn.KlQa?"survey":"campaign",apx_nudge_id:i.bdFJ,apx_nudge_name:i.Busn.KyJY,message_name:i.Busn.KyJY,id:i.bdFJ,apx_variant_code:i.Busn._isExperiment||i.Busn._only_context?null===(n=i.Busn._attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),ve=s((function e(){var t=this;r(this,e),a(this,"YeAl",{}),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(m(e)&&m(e.configs)){var n=e.configs;if(!Array.isArray(n))return;n.sort((function(e,t){var n,i;return(null!==(n=e.prio)&&void 0!==n?n:-1)-(null!==(i=t.prio)&&void 0!==i?i:-1)}));for(var i=0;i<n.length;i++){var r=n[i],o=r._id,s=new de;s.parse(r)?t.YeAl[o]=s:console.warn("Failed to parse cfg",o)}}})),a(this,"validate",(function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(t.YeAl[e]){var r=t.YeAl[e];r.iMZf(n,i)}})),a(this,"getVariantCode",(function(e){return t.YeAl[e]?t.YeAl[e]._variant_code:""})),a(this,"validateForTermination",(function(e,n){t.YeAl[e]&&t.YeAl[e].HScg(n)})),a(this,"validateForTerminationAttributes",(function(e){return!!t.YeAl[e]&&t.YeAl[e].validateForTerminationAttributes()})),a(this,"IAEG",(function(e){t.YeAl[e].IAEG()})),a(this,"getFrequencyCount",(function(e){var n=t.YeAl[e];if(null!=n)return n.getFrequencyCount()})),a(this,"resetFrequencyCounts",(function(){var e=t.YeAl;for(var n in e)e[n].kcZO()})),a(this,"ZzjC",(function(e){try{if(t.YeAl){var n=t.YeAl[e];if(n&&n.Busn)return n.Busn}}catch(e){console.log("Error in getting the campaign meta ".concat(e))}return{}}))})),ce=window.ApxorLogger,fe=s((function t(){var n=this;r(this,t),a(this,"Idml",{}),a(this,"nouG",[]),a(this,"CEfy",!1),a(this,"initialize",(function(){var t=e.getController();t.registerForEvent("APP_EVENT",(function(e){return n.xozT(e,"AE")})),t.registerForEvent("CLIENT_EVENT",(function(e){return n.xozT(e,"CE")}))})),a(this,"kQde",(function(){var e,t=c(n.nouG);try{for(t.s();!(e=t.n()).done;){var i=e.value;n.BpMO(i.event,i.key,i.type)}}catch(e){t.e(e)}finally{t.f()}n.CEfy=!0})),a(this,"wofl",(function(e,t){var i;"function"==typeof t&&((i=n.Idml[e]?n.Idml[e]:[]).push(t),n.Idml[e]=i,ce.debug("Listeners list: ",n.Idml))})),a(this,"unregisterFromEvent",(function(e,t){if(n.Idml[e]){for(var i=n.Idml[e],r=[],o=0;o<i.length;o++){var s=i[o];s!==t&&r.push(s)}n.Idml[e]=r}})),a(this,"xozT",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE";n.BpMO(e,"any_event",t),"apxor"===(null==e?void 0:e.loggedBy)?n.BpMO(e,"apxor_event",t):"customer"===(null==e?void 0:e.loggedBy)&&n.BpMO(e,"customer_event",t),"campaign"===(null==e?void 0:e.apx_nudge_type)?n.BpMO(e,"campaign_event",t):"survey"===(null==e?void 0:e.apx_nudge_type)&&n.BpMO(e,"survey_event",t);var i=t+"___"+e.name;n.BpMO(e,i,t)})),a(this,"BpMO",(function(t,i,r){if(n.CEfy){if(ce.debug("Notifying listeners for event: "+t+", "+i,n.Idml),n.Idml[i])for(var o=n.Idml[i],s=e.getController().getSDKRunningTimeInSec(),a=0;a<o.length;a++){(0,o[a])(r,t.name,s,t.additional_info)}}else n.nouG.push({event:t,key:i,type:r})}))})),ge=window.ApxorLogger,_e=function(){function t(){var n=this;return r(this,t),a(this,"xyDu",!1),a(this,"HyVs",null),a(this,"azNS",K()),a(this,"gWXS",new fe),a(this,"WBFQ",e.getSiteId()),a(this,"Cwkb",{}),a(this,"getQeState",(function(){try{var t=e.getController().getFromStorage("qe_state");return t?JSON.parse(C(n.WBFQ,t)):(n.Cwkb={},n.setQeState())}catch(e){return n.Cwkb={},n.setQeState()}})),a(this,"setQeState",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{e.getController().persistToStorage("qe_state",n.Cwkb,!0)}catch(i){""===t?n.Cwkb={}:n.Cwkb[t]={SESSION:0,OVERALL:0,DATES:{}},e.getController().persistToStorage("qe_state",n.Cwkb,!0)}return n.Cwkb})),a(this,"initialize",(function(){n.xyDu||(n.xyDu=!0,n.HyVs=new ve,n.gWXS.initialize(),n.Cwkb=n.getQeState(),ge.info("QE Initialized.."))})),a(this,"parse",(function(e){n.wPzN()?(n.HyVs.parse(e),n.gWXS.kQde()):ge.warn("Must call init first. Unable to proceed")})),a(this,"validate",(function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;n.wPzN()&&n.HyVs.validate(e,t,i)})),a(this,"getVariantCode",(function(e){return n.HyVs.getVariantCode(e)})),a(this,"validateForTermination",(function(e,t){n.wPzN()&&n.HyVs.validateForTermination(e,t)})),a(this,"validateForTerminationAttributes",(function(e,t){return n.HyVs.validateForTerminationAttributes(e,t)})),a(this,"updateCount",(function(e){try{m(n.Cwkb[e])||n.createObjConfig(e),n.incrementFrequencies(e),n.setQeState(e),n.HyVs.IAEG(e)}catch(e){console.log("Could not update the count config:".concat(e))}})),a(this,"resetFrequencyCounts",(function(){n.HyVs.resetFrequencyCounts()})),a(this,"getFrequencyCount",(function(e){return n.HyVs.getFrequencyCount(e)})),a(this,"registerForEvent",(function(e,t){n.gWXS.wofl(e,t)})),a(this,"unregisterFromEvent",(function(e,t){n.gWXS.unregisterFromEvent(e,t)})),a(this,"notifyEventListener",(function(e){n.gWXS.xozT(e)})),a(this,"fetch",(function(t,n,i,r){e.getController().fetchConfiguration(t,n,i,r)})),a(this,"wPzN",(function(){return n.xyDu})),a(this,"getCampaignMetaFromQueryEngine",(function(e){return n.HyVs.ZzjC(e)})),a(this,"TpGv",(function(){return n.azNS})),t.instance||(t.instance=this),t.instance}return s(t,[{key:"createObjConfig",value:function(e){try{this.Cwkb=this.getQeState(),m(this.Cwkb[e])||(this.Cwkb[e]={SESSION:0,OVERALL:0,DATES:{}},this.azNS&&(this.Cwkb[e].DATES[this.azNS]=0),this.setQeState(e))}catch(e){ge.error("Can not create the frequency count object:"+e)}}},{key:"incrementFrequencies",value:function(e){this.Cwkb=this.getQeState();var t=this.Cwkb[e];t.SESSION=t.SESSION+1,t.OVERALL=t.OVERALL+1;var n=K();n===this.azNS&&t.DATES&&t.DATES[n]||(this.azNS=n,t.DATES={},t.DATES[this.azNS]=0),t.DATES[this.azNS]=t.DATES[this.azNS]+1}}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}}]),t}();a(_e,"instance",void 0),window.ceVersion=205;try{void 0===exports&&null===exports||(exports.default=_e,module.exports=exports.default)}catch(e){}return _e}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("apxor")):"function"==typeof define&&define.amd?define(["apxor"],t):(e=e||self)["apxor-qe"]=t(e.Apxor)}(this,(function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){s(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return function(e){if(Array.isArray(e))return 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.
|
|
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.1.
|
|
75
|
+
"apxor": "3.1.1"
|
|
71
76
|
},
|
|
72
77
|
"engines": {
|
|
73
78
|
"pnpm": ">=8",
|