apxor-qe 1.8.0 → 2.0.1
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 +2354 -750
- package/dist/apxor.qe.min.js +1 -1
- package/package.json +2 -2
package/dist/apxor.qe.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("apxor")):"function"==typeof define&&define.amd?define(["apxor"],e):(t=t||self)["apxor-qe"]=e(t.Apxor)}(this,(function(t){"use strict";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function n(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,c(i.key),i)}}function a(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t,e,n){return(e=c(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function c(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var d=window.ApxorLogger,v=function(t){return void 0!==t&&!function(t){return null===t}(t)},f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function h(t,e){return Array.from(e).map((function(e,n){return String.fromCharCode(e^function(t,e){return t.charCodeAt(Math.floor(e%t.length))}(t,n))})).join("")}var g=function(t,e){return h(t,e=function(t){var e,n,i,r,o,a,s=0,u=[];if(!t)return t;t+="";do{e=(a=f.indexOf(t.charAt(s++))<<18|f.indexOf(t.charAt(s++))<<12|(r=f.indexOf(t.charAt(s++)))<<6|(o=f.indexOf(t.charAt(s++))))>>16&255,n=a>>8&255,i=255&a,u.push(e),64!==r&&(u.push(n),64!==o&&u.push(i))}while(s<t.length);return u}(e))},p=function(t){switch(t){case"app_event":return"AE";case"client_event":return"CE";case"activity_time":case"activity_event":return"AE"}return"Unknown"},y=function(t){return t.toUpperCase()},_=function(t,e,n){switch(n){case"EQ":return t===e;case"GT":return t>e;case"GTE":return t>=e;case"LT":return t<e;case"LTE":return t<=e;case"NEQ":return t!==e;case"R":return m(e).test(t);default:return!1}},m=function(t){var e=t.replace(/.*\/([gimuy]*)$/,"$1");e===t&&(e="");var n=e?t.replace(new RegExp("^/(.*?)/"+e+"$"),"$1"):t;return new RegExp(n,e)},b=function(){var t=new Date;return t.getDate()+"/"+t.getMonth()+"/"+t.getFullYear()},F=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!t||!e||!n)return!1;var r=n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),o=e.replace(new RegExp(r,"g"),"(.+)"),a=i?"^".concat(o):"".concat(o,"$"),s=new RegExp(a);return s.test(t)};function T(t){var e=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=A(t,e);if(o){var a=function(){if(D(o)){return function(t){return x(t)}(o)}return d.info("Invalid target element. Width and height are 0 for element: ".concat(t,". Can't show tooltip")),!1};return a()}return n?(d.info("Not found yet. Rechecking the DOM."),w(r,i,t,e)):(d.info("Element with selector:".concat(t," not found.")),!1)}function w(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=setInterval((function(){var e=A(n,i);if(e){clearInterval(r);!function(){if(D()){x()}else d.info("Invalid target element. Width and height are 0 for element: ".concat(n,". Can't show tooltip"))}()}else(t-=1)<=0&&(clearInterval(r),console.warn("Element with selector:".concat(n," not found.")))}),e)}var A=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=document.getElementById(t);if(!i)try{i=document.querySelector(t)}catch(t){window.ApxorLogger.error("Error finding element in DOM:"+t)}(i||(i=S(t)),!i&&n.length>0)&&(i=null===(e=document.getElementById(n))||void 0===e||null===(e=e.contentWindow)||void 0===e||null===(e=e.document)||void 0===e?void 0:e.querySelector(t));return i},S=function(t){var e=t.indexOf("svg");-1!==e&&(t=t.substring(0,e)+"svg:svg");try{return document.WTJq(t,document,(function(t){return"svg"===t?"http://www.w3.org/2000/svg":null}),XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}catch(t){window.ApxorLogger.error("Error finding element in DOM:"+t)}return null};function D(t){try{var e=t.getBoundingClientRect();if(0===e.width||0===e.height)return!1}catch(t){return!1}return!0}function x(t){var e,n,i,r;return!!(n=(e=t).offsetHeight,i=e.offsetWidth,(r=e.getBoundingClientRect()).left>=-i&&r.top>=-n&&r.right<=(window.innerWidth||document.documentElement.clientWidth)+i&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)+n)}var O=function(t){var e='\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(t,"</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=e,n.id="apx-container",document.body.appendChild(n)},E=window.ApxorLogger,H=a((function e(){var n=this;r(this,e),s(this,"WBXT","ALL"),s(this,"fGzd",[]),s(this,"eYdP",[]),s(this,"userAttributesValidated",!0),s(this,"sessionAttributeValidated",!0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(n.WBXT=t.audience.audience_type,n.fGzd=t.audience.attributes.user,n.eYdP=t.audience.attributes.session,!Array.isArray(n.fGzd)||!Array.isArray(n.eYdP))return E.error("No attributes"),!1}catch(t){return E.error(t),!1}return!0})),s(this,"validate",(function(e,i){var r=!0;"FTU"===n.WBXT&&(r=t.getController().getSessionInfo().is_first_session);var o=n.WJGy(e,n.fGzd),a=n.WJGy(i,n.eYdP);return o||(n.userAttributesValidated=!1),a||(n.sessionAttributeValidated=!1),r&&o&&a})),s(this,"WJGy",(function(t,e){var n=e.length,i=!0;try{for(var r,o=function(){var n=e[a];if(void 0===t[n.name]||!1===i)return{v:!1};var r=n.operator,o=n.type,s=n.value.map((function(t){if("s"===o)return t;if("l"===o)return parseInt(t);if("f"===o)return parseFloat(t);if("b"===o)switch(t){case"true":return!0;case"false":return!1;default:return t}})),u=(Array.isArray(t[n.name])?t[n.name]:[t[n.name]]).some((function(t){return s.some((function(e){return"s"===o?t="".concat(t):"l"===o?t=parseInt(t):"f"===o?t=parseFloat(t):"b"===o&&(t=!!t),_(t,e,r)}))}));i=i&&u},a=0;a<n;a++)if(r=o())return r.v}catch(t){E.error(t),i=!1}return i}))})),k=window.ApxorLogger,X=a((function e(){var n=this;r(this,e),s(this,"MSzB",0),s(this,"EOhX",0),s(this,"kTyF","SESSION"),s(this,"JeZK",0),s(this,"ubBd",0),s(this,"ZJRP",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{n.tkvH=t._id,n.FaOX=t.meta,n.MSzB=t.frequency.count,-1===n.MSzB&&(n.MSzB=1e3),n.ZJRP=n.MSzB,n.EOhX=t.frequency.time_interval,n.kTyF=t.frequency.validity,n.ubBd=t.frequency.ses_lmt,n._dayCount=t.frequency.day_lmt;var e=rt.getInstance().getQeState();if(!v(e)||!v(e[t._id]))return!0;if("SESSION"===n.kTyF){if(n.MSzB=parseInt(n.MSzB)-parseInt(e[t._id].SESSION),n.MSzB<=0)return n.vYAT("Session limit reached"),console.warn("Max count limit reached for session:"+t._id),!1}else{if("OVERALL"!==n.kTyF)return k.info("Invalid config."),!1;if(n.MSzB=parseInt(n.MSzB)-parseInt(e[t._id].OVERALL),n.MSzB<=0)return n.vYAT("Overall limit reached"),console.warn("Max count limit reached for overall:"+t._id),!1}}catch(t){return k.error(t),!1}return!0})),s(this,"hJWa",(function(){n.MSzB=n.MSzB-1})),s(this,"getFrequencyCount",(function(){return n.MSzB})),s(this,"Hhtv",(function(){"SESSION"===n.kTyF&&(n.MSzB=n.ZJRP,k.info("Campaign Limit reset"))})),s(this,"tiom",(function(t){try{if(n.MSzB<=0)return"OVERALL"===n.kTyF?n.vYAT("Overall limit reached"):"SESSION"===n.kTyF&&n.vYAT("Session limit reached"),!1;var e=rt.getInstance().getQeState();if(!v(e)||!v(e[t]))return!0;if(0!==n.ubBd)if(parseInt(n.ubBd)-parseInt(e[t].SESSION)<=0)return n.vYAT("Session limit reached"),!1;if(0!==n._dayCount){var i,r=b();if(parseInt(n._dayCount)-parseInt((null===(i=e[t])||void 0===i?void 0:i.DATES[r])||0)<=0)return n.vYAT("Day limit reached"),!1}}catch(t){n.vYAT("Error validating the frequency: ".concat(t)),k.error("Error validating the frequency:"+t)}return!0})),s(this,"vYAT",(function(e){var i;null==t||t.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.FaOX.type?"survey":"campaign",apx_nudge_id:n.tkvH,apx_nudge_name:n.FaOX.name,apx_variant_code:n.FaOX.isExperiment||n.FaOX.only_context?null===(i=n.FaOX.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:e})}))})),B=a((function t(){var e=this;r(this,t),s(this,"FiDT",""),s(this,"WBXT",""),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;e.FiDT=t.meta.name,e.WBXT=t.meta.type,e._only_context=t.meta.only_context,e._attr=(null===(n=t.meta)||void 0===n?void 0:n.attr)||{},e._isExperiment=null===(i=t.meta)||void 0===i?void 0:i.isExperiment}catch(t){return window.ApxorLogger.error(t),!1}return!0}))})),I=window.ApxorLogger,N=a((function t(){var e=this;r(this,t),s(this,"QLwb",-1),s(this,"MNVx",-1),s(this,"ybQh",-1),s(this,"yFSG",-1),s(this,"GpDT",!1),s(this,"_nudge_expired",!1),s(this,"_not_yet_active",!1),s(this,"_not_in_specified_time",!1),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(isNaN(Date.parse(t.validity.start_date))||isNaN(Date.parse(t.validity.end_date)))return I.error("Not valid dates"),!1;if(e.QLwb=Date.parse(t.validity.start_date),e.MNVx=Date.parse(t.validity.end_date),v(t.at_specific_time)&&(e.GpDT=t.at_specific_time,e.GpDT&&v(t.time_limits))){var n=(new Date).toISOString().split("T")[0];if(e.ybQh=Date.parse(n+"T"+t.time_limits.start_time+":00.000Z"),e.yFSG=Date.parse(n+"T"+t.time_limits.end_time+":00.000Z"),isNaN(e.ybQh)||isNaN(e.yFSG))return I.error("Not valid times"),!1}}catch(t){return I.error(t),!1}return!0})),s(this,"validate",(function(){var t=Date.now();return t>e.QLwb&&t<e.MNVx?(!e.GpDT||t>=e.ybQh&&t<=e.yFSG||(e._not_in_specified_time=!0),!e.GpDT||t>=e.ybQh&&t<=e.yFSG):(t<e.QLwb?e._not_yet_active=!0:t>e.MNVx&&(e._nudge_expired=!0),!1)}))})),L=a((function t(){var e=this;r(this,t),s(this,"FiDT",""),s(this,"bFur",{}),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{e.FiDT=t.name,e.bFur=t.additional_info}catch(t){return!1}return!0}))})),C=a((function t(){var e=this;r(this,t),s(this,"xTRO",0),s(this,"qRLS",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.xTRO=Number(t.lower),e.qRLS=Number(t.upper),isNaN(e.xTRO)||isNaN(e.qRLS))return!1}catch(t){return!1}return!0}))})),U=a((function t(){var e=this;r(this,t),s(this,"XwIs",0),s(this,"PTXF",""),s(this,"UDkI",""),s(this,"yHbl",new L),s(this,"ECcI",new C),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.PTXF=t.event_type,e.UDkI=t.activity,e.yHbl.parse(t.details)&&e.ECcI.parse(t.time_bounds)}catch(t){return!1}}))})),G=window.ApxorLogger,P=a((function t(){var e=this;r(this,t),s(this,"XwIs",0),s(this,"CcMq",-1),s(this,"MSzB",0),s(this,"jxcB",""),s(this,"UDkI",""),s(this,"PTXF",""),s(this,"ECcI",new C),s(this,"yHbl",new L),s(this,"koaL",new U),s(this,"ZdyA","AND"),s(this,"cUqy",!1),s(this,"WBXT",void 0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.CcMq=t.sequence,e.MSzB=t.count_config.count,e.jxcB=t.count_config.operator,e.UDkI=t.activity,e.PTXF=t.event_type,e.ZdyA=t.combine_operator,e.WBXT=t.type,e.yHbl.parse(t.details)&&e.koaL.parse(t.trigger)&&e.ECcI.parse(t.time_bounds)}catch(t){return G.error(t),!1}}))})),q=window.ApxorLogger,M=a((function t(){var e=this;r(this,t),s(this,"MSzB",0),s(this,"jxcB",""),s(this,"PTXF",""),s(this,"ECcI",new C),s(this,"yHbl",new L),s(this,"ZdyA","AND"),s(this,"parse",(function(t){try{return e.MSzB=t.count_config.count,e.jxcB=t.count_config.operator,e.PTXF=t.event_type,e.ZdyA=t.combine_operator,e.yHbl.parse(t.details)&&e.ECcI.parse(t.time_bounds)}catch(t){return q.error(t),!1}}))})),K=window.ApxorLogger,R=function(){function e(){var n=this;r(this,e),s(this,"HUFK",0),s(this,"tkvH",""),s(this,"HBDN",new P),s(this,"vGYK",new M),s(this,"ZDcP",!1),s(this,"KUlF",!1),s(this,"SgFM",0),s(this,"ZdyA","AND"),s(this,"seqy","OR"),s(this,"TPiO",-1),s(this,"sHgA",[]),s(this,"HTsU",{}),s(this,"qHPA",!1),s(this,"initialize",(function(){var e=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]:"";if(n.tkvH=i,n.SgFM=r,n.sHgA=a,"termination"===s&&""!==s){n.vGYK.parse(e);return n.seqy=n.vGYK.ZdyA,n.BUIy(),!0}var u=n.HBDN.parse(e);if(u){if(n.ZdyA=n.HBDN.ZdyA,n.HBDN.cUqy){var l=n.HBDN.yHbl.FiDT;"APX_PAGE_OPENED"===l&&(l=n.HBDN.yHbl.bFur.navigation_id,l=v(l)?l:n.HBDN.yHbl.FiDT),n.TPiO=t.getController().getEventCount(l);var c=n.HBDN.MSzB,d=n.HBDN.jxcB;if(n.KUlF=n.tZfA(n.TPiO-1,c,d,!1),n.ZDcP=n.KUlF,n.KUlF&&"APX_PAGE_OPENED"===n.HBDN.yHbl.FiDT)return!0}return o&&0!==r||n.IyAK(),!0}return!1})),s(this,"IyAK",(function(){var t,e=n.HBDN,i=e.koaL,r=rt.getInstance();"app_start"===i.PTXF?(n.ZDcP=!0,r.registerForEvent(p(e.PTXF)+"___"+e.yHbl.FiDT,n.SeWP)):r.registerForEvent(p(e.PTXF)+"___"+i.yHbl.FiDT,n.SeWP),null!==(t=window.ApxorRTM)&&void 0!==t&&t.badgesLists.includes(n.tkvH)&&r.registerForEvent(p(e.PTXF)+"___"+"apxor-badge-container-".concat("-".concat(n.tkvH).replaceAll(" ","").replace(/[^\w\s]/gi,"")),n.SeWP)})),s(this,"BUIy",(function(){var t=n.vGYK,e=rt.getInstance();n.ZDcP=!0,e.registerForEvent(p(t.PTXF)+"___"+t.yHbl.FiDT,n.wgNe)})),s(this,"owSn",(function(t,e,i,r){var o,a=(Date.now()-n.HTsU[e])/1e3;(null===(o=n.HBDN)||void 0===o||null===(o=o.yHbl)||void 0===o||null===(o=o.bFur)||void 0===o?void 0:o.time)/1e3>a&&n._displayCampaign(i)})),s(this,"jrrY",(function(t,e,i,r){var o,a;n.qHPA=!0;var s=Date.now(),u=null===(o=n.HBDN)||void 0===o||null===(o=o.koaL)||void 0===o?void 0:o.yHbl.FiDT,l=(s-n.HTsU[u])/1e3,c=null===(a=n.HBDN)||void 0===a||null===(a=a.yHbl)||void 0===a||null===(a=a.bFur)||void 0===a?void 0:a.time;(c/=1e3)>l&&n._displayCampaign(i)})),s(this,"SeWP",(function(e,i,r,o){var a,s,u=rt.getInstance();if(n.ZDcP){if(null!==(a=window.ApxorRTM)&&void 0!==a&&a.isBadgePresent&&null!==(s=window.ApxorRTM)&&void 0!==s&&s.badgesLists.includes(n.tkvH)&&t.getController().isBadgeTriggerSatisfied(n.tkvH))return n.KUlF=!0,n.HBDN.XwIs=r,void u.validate(n.tkvH,n.SgFM);p(n.HBDN.PTXF)===e&&n.AYJW(r-n.HBDN.koaL.XwIs,n.HBDN.ECcI)&&n.HBDN.yHbl.FiDT===i&&n.bscd(n.HBDN.yHbl.bFur,o)&&(n.HUFK+=1,n.KUlF=n.tZfA(n.HUFK,n.HBDN.MSzB,n.HBDN.jxcB),n.KUlF&&(n.HBDN.XwIs=r,u.validate(n.tkvH,n.SgFM)))}else if(n.ZDcP=n.KRhD(e,i,r,o),n.ZDcP){var l=n.HBDN,c=l.koaL;if(c.XwIs=r,"activity_time"===(null==l?void 0:l.PTXF)){var d,v,f,h=null==l||null===(d=l.yHbl)||void 0===d||null===(d=d.bFur)||void 0===d?void 0:d.time;(null==l||null===(v=l.yHbl)||void 0===v||null===(v=v.bFur)||void 0===v?void 0:v.nkpi.length)>0&&(setTimeout((function(){n.qHPA||(n.KUlF=!0,n.KUlF&&(n.HUFK+=1,n.KUlF=n.tZfA(n.HUFK,n.HBDN.MSzB,n.HBDN.jxcB),n.KUlF&&(n.HBDN.XwIs=r,u.validate(n.tkvH,n.SgFM)))),l.yHbl.bFur.nkpi.map((function(t){u.unregisterFromEvent(y(l.yHbl.bFur.et)+"___"+t,n)}))}),h),l.yHbl.bFur.nkpi.map((function(t){u.registerForEvent(y(l.yHbl.bFur.et)+"___"+t,n.jrrY)}))),(null==l||null===(f=l.yHbl)||void 0===f||null===(f=f.bFur)||void 0===f?void 0:f.kpi.length)>0&&(setTimeout((function(){l.yHbl.bFur.kpi.map((function(t){u.unregisterFromEvent(y(l.yHbl.bFur.et)+"___"+t,n)}))}),h),l.yHbl.bFur.kpi.map((function(t){t===l.koaL.yHbl.FiDT?(u.unregisterFromEvent(p(c.PTXF)+"___"+c.yHbl.FiDT,n),u.registerForEvent(y(l.yHbl.bFur.et)+"___"+t,n.owSn)):u.registerForEvent(y(l.yHbl.bFur.et)+"___"+t,n.jrrY)})))}else u.unregisterFromEvent(p(c.PTXF)+"___"+c.yHbl.FiDT,n),u.registerForEvent(p(l.PTXF)+"___"+l.yHbl.FiDT,n);n.HTsU[i]=Date.now()}})),s(this,"wgNe",(function(t,e,i,r){var o=rt.getInstance();p(n.vGYK.PTXF)===t&&n.AYJW(i,n.vGYK.ECcI)&&n.vGYK.yHbl.FiDT===e&&n.bscd(n.vGYK.yHbl.bFur,r)&&(n.HUFK+=1,n.KUlF=n.tZfA(n.HUFK,n.vGYK.MSzB,n.vGYK.jxcB),n.KUlF&&(n.vGYK.XwIs=i,o.validateForTermination(n.tkvH,n.SgFM)))})),s(this,"KRhD",(function(t,e,i,r){var o=n.HBDN.koaL;return p(o.PTXF)===t&&o.yHbl.FiDT===e&&n.AYJW(i,o.ECcI)&&n.bscd(o.yHbl.bFur,r)})),s(this,"AYJW",(function(t,e){var n=Math.ceil(t);return n>e.xTRO&&n<e.qRLS})),s(this,"tZfA",(function(t,e,i){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(r&&n.HBDN.cUqy&&(t+=n.TPiO),i){case"EQ":return t===e;case"GT":return t>e;case"GTE":return t>=e;case"LT":return t<e;case"LTE":return t<=e;default:return!1}})),s(this,"bscd",(function(t,e){var n=!0;try{var r,o=function(){if(!1===n)return{v:!1};if("object"===i(t[a])){var r,o=t[a].op,s=t[a].t;if("s"===s)r=t[a].val;else if("l"===s||"f"===s)r=parseFloat(t[a].val);else if("b"===s)switch(t[a].val){case"true":r=!0;break;case"false":r=!1;break;default:r=t[a].val}var u=(Array.isArray(e[a])?e[a]:[e[a]]).some((function(t){return"s"===s?t="".concat(t):"l"===s?t=parseInt(t):"f"===s?t=parseFloat(t):"b"===s&&(t=!!t),_(t,r,o)}));n=n&&u}else n=n&&_(e[a],t[a],"EQ")};for(var a in t)if(r=o())return r.v}catch(t){K.error(t),n=!1}return n}))}return a(e,[{key:"_displayCampaign",value:function(t){var e=rt.getInstance();this.KUlF=!0,this.KUlF&&(this.HUFK+=1,this.KUlF=this.tZfA(this.HUFK,this.HBDN.MSzB,this.HBDN.jxcB),this.KUlF&&(this.HBDN.XwIs=t,e.validate(this.tkvH,this.SgFM)))}}]),e}(),Y=window.ApxorLogger,Q=a((function e(){var n=this;r(this,e),s(this,"yTgw",[]),s(this,"_ret_day",{}),s(this,"jJTV",{}),s(this,"oZvY",!1),s(this,"laSF",!1),s(this,"retainedDaysValidated",!0),s(this,"retainedSessionValidated",!0),s(this,"eventDoneInLT",!1),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{n.yTgw=t.overall_cfg.events,n._ret_day=t.overall_cfg.ret_day,n.jJTV=t.overall_cfg.session,n.oZvY=t.overall_cfg.toggleRetDay,n.laSF=t.overall_cfg.toggleSession}catch(t){return Y.error(t),!1}return!0})),s(this,"validate",(function(){var e=parseInt(t.getController().getFromStorage("apx_retained_days")),i=parseInt(t.getController().getFromStorage("apx_retained_session"));if(n.oZvY&&!isNaN(e)&&!(e>=n._ret_day.from&&e<=n._ret_day.to))return n.retainedDaysValidated=!1,!1;if(n.laSF&&!isNaN(i)&&!(i>=n.jJTV.from&&i<=n.jJTV.to))return n.retainedSessionValidated=!1,!1;try{for(var r=t.getController().getFromStorage("_apx_lt_count"),o=t.getSiteId(),a=JSON.parse((new TextDecoder).decode(function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return e}(g(o,r)))),s=0;s<n.yTgw.length;s++){if(a[n.yTgw[s].name.replace("'","").replace("’","")])return n.eventDoneInLT=!0,!1}}catch(t){Y.error("Failed to validate the lt count:"+t)}return!0}))})),V=window.ApxorLogger,z=a((function t(){var e=this;r(this,t),s(this,"fGzd",[]),s(this,"eYdP",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.fGzd=t.attributes.user,e.eYdP=t.attributes.session,!Array.isArray(e.fGzd)||!Array.isArray(e.eYdP))return V.error("No attributes"),!1}catch(t){return V.error(t),!1}return!0})),s(this,"validate",(function(t,n){return e.WJGy(t,e.fGzd)&&e.WJGy(n,e.eYdP)})),s(this,"WJGy",(function(t,e){var n=e.length,i=!0;try{for(var r,o=function(){var n=e[a];if(!t[n.name]||!1===i)return{v:!1};var r=n.operator,o=n.type,s=n.value.map((function(t){return"s"===o?t:"l"===o?parseInt(t):"f"===o?parseFloat(t):void 0})),u=(Array.isArray(t[n.name])?t[n.name]:[t[n.name]]).some((function(t){return s.some((function(e){return _(t,e,r)}))}));i=i&&u},a=0;a<n;a++)if(r=o())return r.v}catch(t){V.error(t),i=!1}return i}))})),W=a((function e(){var n=this;r(this,e),s(this,"lSAU",t.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"UCQR",1),s(this,"parse",(function(t){try{var e,i,r;if(n.WBXT=null===(e=t.terminate_info.time_based)||void 0===e?void 0:e.type,n._duration_seconds=null===(i=t.terminate_info)||void 0===i?void 0:i.time_based.duration_seconds,n.UCQR=null===(r=t.terminate_info.time_based)||void 0===r?void 0:r.days,n.StAu(t._id))return n.lSAU.persistTerminationInfoLocally(t._id),!1}catch(t){return!1}return!0})),s(this,"StAu",(function(t){var e,i=JSON.parse(n.lSAU.getFromStorage("apx_termination_ID"));if(!i[t]||null===(e=i[t])||void 0===e||!e.startDate)return!1;var r,o=new Date(i[t].startDate),a=new Date((r=new Date).getMonth()+"/"+r.getDate()+"/"+r.getFullYear()),s=parseInt((a-o)/864e5,10),u=function(){var t=new Date;return{hours:t.getHours(),mins:t.getMinutes()}}(),l=i[t].ybQh;return s===n.UCQR&&u.hours>=l.hours||s>n.UCQR||i[t].goalAcheived}))})),j=a((function t(){var e=this;r(this,t),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"MEqZ",new z),s(this,"ujNH",new W),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i,r;if(e.enable_time_based=null==t||null===(n=t.terminate_info)||void 0===n?void 0:n.enable_time_based,e.enable_time_based&&!e.ujNH.parse(t))return!1;if(e.enable_goal_events=null==t||null===(i=t.terminate_info)||void 0===i?void 0:i.enable_goal_events,e.enable_attributes=null==t||null===(r=t.terminate_info)||void 0===r?void 0:r.enable_attributes,e.enable_attributes&&!e.MEqZ.parse(t.terminate_info))return!1}catch(t){return window.ApxorLogger.error(t),!1}return!0})),s(this,"validate",(function(t,n){return e.MEqZ.validate(t,n)}))})),J=a((function t(){var e=this;r(this,t),s(this,"KdxM",""),s(this,"BOkL",""),s(this,"Trrq",""),s(this,"fqdK",""),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.KdxM=null==t?void 0:t.screen_binding,!e.KdxM||(e.BOkL=null==t?void 0:t.binding.url,e.Trrq=null==t?void 0:t.binding.var,e.fqdK=null==t?void 0:t.binding.operator,!0)}catch(t){return window.ApxorLogger.error(t),!1}})),s(this,"validate",(function(){var t=e.BOkL,n=e.Trrq,i=e.fqdK,r=window.location.href;return!e.KdxM||("EQ"===i?t.includes(n)?!!F(r,t,n,!1):r===t:"SW"===i?t.includes(n)?!!F(r,t,n,!0):!!r.startsWith(t):void 0)}))})),Z=window.ApxorLogger,$=a((function e(){var i=this;r(this,e),s(this,"TbxE",[]),s(this,"oJYY",[]),s(this,"tkvH",""),s(this,"FaOX",new B),s(this,"wdlK",new H),s(this,"kTyF",new N),s(this,"tsTs",new X),s(this,"aNwp",new Q),s(this,"smLy",new j),s(this,"VfRX",new J),s(this,"RJwC",!1),s(this,"eGzd",[]),s(this,"_variant_code",""),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var e;if(!v(t._id))return Z.error("No Id"),!1;if(!v(t.enabled)||!t.enabled)return Z.error("Not enabled"),!1;if(!(i.FaOX.parse(t)&&i.kTyF.parse(t)&&i.tsTs.parse(t)&&i.wdlK.parse(t)&&i.aNwp.parse(t)&&i.smLy.parse(t)&&i.VfRX.parse(t)))return!1;if(i._variant_code=i.FaOX._isExperiment||i.FaOX._only_context?null===(e=i.FaOX._attr)||void 0===e?void 0:e.apx_variant_code:"TG",!v(t.conditions)||!Array.isArray(t.conditions))return Z.error("No valid conditions",t.conditions),!1;i.tkvH=t._id,i.RJwC=!!v(t.sequence_enabled)&&t.sequence_enabled,i.RJwC&&t.conditions.sort((function(t,e){return t.sequence<e.sequence}));var n=t.conditions,r=n.length,o=null==t?void 0:t.no_context_enabled;0===r&&o&&setTimeout((function(){i.VHRs()}),10);for(var a=function(){i.eGzd=[];var t=n[s];if("didn't"===t.type){var e,r={trigger_key:t.trigger.details.name,no_kpi_array:null==t||null===(e=t.details)||void 0===e||null===(e=e.additional_info)||void 0===e?void 0:e.nkpi,condition_id:null==t?void 0:t._id,time_bounds:t.time_bounds.upper};i.eGzd=[].concat(u(i.eGzd),[r])}var o=new R;if(o.initialize(t,i.tkvH,s,i.RJwC,i.eGzd)){i.TbxE.push(o);var a=(null==t?void 0:t.timeout)/(null==t?void 0:t.findinterval),l=(null==t?void 0:t.frameid)||"",c=null==t?void 0:t.url;window.location.href===c&&"view_visibility"===t.event_type&&!0===T(t.view_id,l,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,a)&&i.VHRs(!0),window.addEventListener("navigate",(function(e){var n=null==t?void 0:t.url;window.location.href===n&&"view_visibility"===t.event_type&&!0===T(t.view_id,l,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,a)&&i.VHRs(!0)}))}},s=0;s<r;s++)a();if(i.smLy.enable_goal_events)for(var l=t.terminate_info.goal_events.events,c=l.length,d=0;d<c;d++){var f=new R;f.initialize(l[d],i.tkvH,d,!0,[],"termination")&&i.oJYY.push(f)}return i.TbxE.length>0}catch(t){return Z.error(t),!1}})),s(this,"WTJq",(function(t){if(!(t<0))if(i.RJwC){var e=i.TbxE[t];if(v(e)&&e.KUlF){var n=i.TbxE[t-1];if(v(n)&&!n.KUlF)return;var r=i.TbxE[t+1];v(r)?r.IyAK():i.VHRs()}}else i.VHRs()})),s(this,"zTfD",(function(t){t<0||i.PXuU()})),s(this,"VHRs",(function(){var e,r,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=t.getController().getUserAttributes(),s=t.getController().getSessionAttributes();if(null!==(e=window.ApxorRTM)&&void 0!==e&&e.isBadgePresent&&null!==(r=window.ApxorRTM)&&void 0!==r&&r.badgesLists.includes(i.tkvH)&&t.getController().isBadgeTriggerSatisfied(i.tkvH)||null==t||t.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===i.FaOX.WBXT?"survey":"campaign",apx_nudge_id:i.tkvH,apx_nudge_name:i.FaOX.FiDT,apx_variant_code:i.FaOX._isExperiment||i.FaOX._only_context?i.FaOX._attr.apx_variant_code:"TG"}),!(i.kTyF.validate()&&i.wdlK.validate(a,s)&&i.aNwp.validate()&&i.VfRX.validate()))return i.aNwp.retainedDaysValidated?i.aNwp.retainedSessionValidated?i.aNwp.eventDoneInLT?void i.vYAT("Event done in life time"):i.wdlK.userAttributesValidated?i.wdlK.sessionAttributeValidated?i.kTyF._not_in_specified_time?void i.vYAT("Time limits check failed"):i.kTyF._not_yet_active?void i.vYAT("not in the scheduled time"):i.kTyF._nudge_expired?void i.vYAT("nudge expired"):void 0:void i.vYAT("Session property filter not met"):void i.vYAT("User property filter not met"):void i.vYAT("User session criteria not met"):void i.vYAT("Retained day criteria not met");var u=i.TbxE.length,l=u<1,c="";0===u&&(l=!0);for(var d=0;d<u;d++){var v=i.TbxE[d],f=v.KUlF;if(""===c.trim())l=f;else switch(c){case"AND":l=l&&f;break;case"OR":l=l||f}c=v.ZdyA}if(!0===o&&(l=!0),l){if(console.debug("onCondition satisfied"),!i.tsTs.tiom(i.tkvH)){if(console.warn("Maximum limit reached",i.tkvH),t.getController().isTestDevice()){O("Maximum limit reached for campaign name ".concat(i.FaOX.FiDT));var h=document.getElementById("close-button"),g=function(){var t=document.getElementById("apx-container");null==t||t.remove()};null==h||h.addEventListener("click",g),window.setTimeout(g,2e4)}return}console.log("Dispatching event",i.FaOX.WBXT),t.logEvent("apx_context_evaluated",n(n({apx_nudge_type:"SURVEY"===i.FaOX.WBXT?"survey":"campaign",apx_nudge_id:i.tkvH,apx_nudge_name:i.FaOX.FiDT,apx_variant_code:i.FaOX._isExperiment||i.FaOX._only_context?i.FaOX._attr.apx_variant_code:"TG"},i.FaOX._attr),{},{message_name:i.FaOX.FiDT,id:i.tkvH})),t.getController().dispatchEvent(i.FaOX.WBXT,{name:i.FaOX.WBXT,additional_info:{uuid:i.tkvH,name:i.FaOX.FiDT}})}})),s(this,"PXuU",(function(){for(var e=i.oJYY.length,r=e<1,o="",a=0;a<e;a++){var s=i.oJYY[a],u=s.KUlF;if(""===o.trim())r=u;else switch(o){case"AND":r=r&&u;break;case"OR":r=r||u}o=s.seqy}r&&(console.log("Dispatching event",i.FaOX.WBXT),t.getController().persistTerminationInfoLocally(i.tkvH),!0===i.FaOX._only_context&&t.logEvent("apx_context_evaluated",n(n({},i.FaOX._attr),{},{message_name:i.FaOX.FiDT,id:i.tkvH})),t.getController().dispatchEvent(i.FaOX.WBXT,{name:i.FaOX.WBXT,additional_info:{uuid:i.tkvH,name:i.FaOX.FiDT}}))})),s(this,"validateForTerminationAttributes",(function(){var e=t.getController().getUserAttributes(),n=t.getController().getSessionAttributes();return i.smLy.validate(e,n)})),s(this,"hJWa",(function(){i.tsTs.hJWa()})),s(this,"getFrequencyCount",(function(){return i.tsTs.getFrequencyCount()})),s(this,"KlBp",(function(){return i.tsTs.Hhtv()})),s(this,"vYAT",(function(e){var n;null==t||t.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.FaOX.WBXT?"survey":"campaign",apx_nudge_id:i.tkvH,apx_nudge_name:i.FaOX.FiDT,apx_variant_code:i.FaOX._isExperiment||i.FaOX._only_context?null===(n=i.FaOX._attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:e})}))})),tt=a((function t(){var e=this;r(this,t),s(this,"UGOI",{}),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(v(t)&&v(t.configs)){var n=t.configs;if(!Array.isArray(n))return;n.sort((function(t,e){var n,i;return(null!==(n=t.prio)&&void 0!==n?n:-1)-(null!==(i=e.prio)&&void 0!==i?i:-1)}));for(var i=0;i<n.length;i++){var r=n[i],o=r._id,a=new $;a.parse(r)?e.UGOI[o]=a:console.warn("Failed to parse cfg",o)}}})),s(this,"validate",(function(t,n){e.UGOI[t]&&e.UGOI[t].WTJq(n)})),s(this,"getVariantCode",(function(t){return e.UGOI[t]?e.UGOI[t]._variant_code:""})),s(this,"validateForTermination",(function(t,n){e.UGOI[t]&&e.UGOI[t].zTfD(n)})),s(this,"validateForTerminationAttributes",(function(t){return!!e.UGOI[t]&&e.UGOI[t].validateForTerminationAttributes()})),s(this,"hJWa",(function(t){e.UGOI[t].hJWa()})),s(this,"getFrequencyCount",(function(t){var n=e.UGOI[t];if(null!=n)return n.getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var t=e.UGOI;for(var n in t)t[n].KlBp()})),s(this,"ZNQa",(function(t){try{if(e.UGOI){var n=e.UGOI[t];if(n&&n.FaOX)return n.FaOX}}catch(t){console.log("Error in getting the campaign meta ".concat(t))}return{}}))})),et=window.ApxorLogger,nt=a((function e(){var n=this;r(this,e),s(this,"kUGk",{}),s(this,"OKHG",[]),s(this,"oTBy",!1),s(this,"initialize",(function(){var e=t.getController();e.registerForEvent("APP_EVENT",(function(t){return n.bhnD(t,"AE")})),e.registerForEvent("CLIENT_EVENT",(function(t){return n.bhnD(t,"CE")}))})),s(this,"JJQh",(function(){for(var t in n.OKHG)n.sFoD(t.event,t.key,t.type);n.oTBy=!0})),s(this,"vWFx",(function(t,e){var i;"function"==typeof e&&((i=n.kUGk[t]?n.kUGk[t]:[]).push(e),n.kUGk[t]=i,et.debug("Listeners list: ",n.kUGk))})),s(this,"unregisterFromEvent",(function(t,e){if(n.kUGk[t]){for(var i=n.kUGk[t],r=[],o=0;o<i.length;o++){var a=i[o];a!==e&&r.push(a)}n.kUGk[t]=r}})),s(this,"bhnD",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE",i=e+"___"+t.name;n.sFoD(t,i,e)})),s(this,"sFoD",(function(e,i,r){if(n.oTBy){if(et.debug("Notifying listeners for event: "+e+", "+i,n.kUGk),n.kUGk[i])for(var o=n.kUGk[i],a=t.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(r,e.name,a,e.additional_info)}}else n.OKHG.push({event:e,key:i,type:r})}))})),it=window.ApxorLogger,rt=function(){function e(){var n=this;return r(this,e),s(this,"UnLY",!1),s(this,"sqeD",null),s(this,"OmCk",b()),s(this,"ymVO",new nt),s(this,"looJ",t.getSiteId()),s(this,"QmXA",{}),s(this,"getQeState",(function(){try{var e=t.getController().getFromStorage("qe_state");return e?JSON.parse(g(n.looJ,e)):(n.QmXA={},n.setQeState())}catch(t){return n.QmXA={},n.setQeState()}})),s(this,"setQeState",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{t.getController().persistToStorage("qe_state",n.QmXA,!0)}catch(i){""===e?n.QmXA={}:n.QmXA[e]={SESSION:0,OVERALL:0,DATES:{}},t.getController().persistToStorage("qe_state",n.QmXA,!0)}return n.QmXA})),s(this,"initialize",(function(){n.UnLY||(n.UnLY=!0,n.sqeD=new tt,n.ymVO.initialize(),n.QmXA=n.getQeState(),it.info("QE Initialized.."))})),s(this,"parse",(function(t){n.pHuQ()?(n.sqeD.parse(t),n.ymVO.JJQh()):it.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(t,e){n.pHuQ()&&n.sqeD.validate(t,e)})),s(this,"getVariantCode",(function(t){return n.sqeD.getVariantCode(t)})),s(this,"validateForTermination",(function(t,e){n.pHuQ()&&n.sqeD.validateForTermination(t,e)})),s(this,"validateForTerminationAttributes",(function(t,e){return n.sqeD.validateForTerminationAttributes(t,e)})),s(this,"updateCount",(function(t){try{v(n.QmXA[t])||n.createObjConfig(t),n.incrementFrequencies(t),n.setQeState(t),n.sqeD.hJWa(t)}catch(t){console.log("Could not update the count config:".concat(t))}})),s(this,"resetFrequencyCounts",(function(){n.sqeD.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(t){return n.sqeD.getFrequencyCount(t)})),s(this,"registerForEvent",(function(t,e){n.ymVO.vWFx(t,e)})),s(this,"unregisterFromEvent",(function(t,e){n.ymVO.unregisterFromEvent(t,e)})),s(this,"notifyEventListener",(function(t){n.ymVO.bhnD(t)})),s(this,"fetch",(function(e,n,i,r){t.getController().fetchConfiguration(e,n,i,r)})),s(this,"pHuQ",(function(){return n.UnLY})),s(this,"getCampaignMetaFromQueryEngine",(function(t){return n.sqeD.ZNQa(t)})),s(this,"cLOV",(function(){return n.OmCk})),e.instance||(e.instance=this),e.instance}return a(e,[{key:"createObjConfig",value:function(t){try{this.QmXA=this.getQeState(),v(this.QmXA[t])||(this.QmXA[t]={SESSION:0,OVERALL:0,DATES:{}},this.OmCk&&(this.QmXA[t].DATES[this.OmCk]=0),this.setQeState(t))}catch(t){it.error("Can not create the frequency count object:"+t)}}},{key:"incrementFrequencies",value:function(t){this.QmXA=this.getQeState();var e=this.QmXA[t];e.SESSION=e.SESSION+1,e.OVERALL=e.OVERALL+1;var n=b();n===this.OmCk&&e.DATES&&e.DATES[n]||(this.OmCk=n,e.DATES={},e.DATES[this.OmCk]=0),e.DATES[this.OmCk]=e.DATES[this.OmCk]+1}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();s(rt,"instance",void 0),window.ceVersion=180;try{void 0===exports&&null===exports||(exports.default=rt,module.exports=exports.default)}catch(t){}return rt}));
|
|
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)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(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 v(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function d(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=v(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function f(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var g=window.ApxorLogger,h=function(e){return void 0===e},_=function(e){return null===e},p=function(e){return void 0!==e&&!_(e)},y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function m(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 x=function(e,t){return m(e,t=function(e){var t,n,i,r,o,a,s=0,l=[];if(!e)return e;e+="";do{t=(a=y.indexOf(e.charAt(s++))<<18|y.indexOf(e.charAt(s++))<<12|(r=y.indexOf(e.charAt(s++)))<<6|(o=y.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))},A=function(e){return p(e)&&!_(e)&&!isNaN(e)},E=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"},w=function(e){return e.toUpperCase()},H=function(e,t,n){switch(n){case"EQ":return e===t;case"GT":return e>t;case"GTE":return e>=t;case"LT":return e<t;case"LTE":return e<=t;case"NEQ":return e!==t;case"R":return b(t).test(e);default:return!1}},b=function(e){var t=e.replace(/.*\/([gimuy]*)$/,"$1");t===e&&(t="");var n=t?e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1"):e;return new RegExp(n,t)},C=function(){var e=new Date;return e.getDate()+"/"+e.getMonth()+"/"+e.getFullYear()},Q=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}},q=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}},W=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 B(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=D(e,t);if(o){var a=function(){if(N(o)){return function(e){return F(e)}(o)}return g.info("Invalid target element. Width and height are 0 for element: ".concat(e,". Can't show tooltip")),!1};return a()}return n?(g.info("Not found yet. Rechecking the DOM."),S(r,i,e,t)):(g.info("Element with selector:".concat(e," not found.")),!1)}function S(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=setInterval((function(){var t=D(n,i);if(t){clearInterval(r);!function(){if(N()){F()}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 D=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=I(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},I=function(e){var t=e.indexOf("svg");-1!==t&&(e=e.substring(0,t)+"svg:svg");try{return document.ndZk(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 N(e){try{var t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!1}catch(e){return!1}return!0}function R(e,t){for(var n=0;n<e.length;n++)if(e[n].hasOwnProperty(t))return e[n];return null}function F(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 P=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)},T=window.ApxorLogger,O=a((function t(){var n=this;r(this,t),s(this,"OPHn","ALL"),s(this,"NlEC",[]),s(this,"bDYc",[]),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.OPHn=e.audience.audience_type,n.NlEC=e.audience.attributes.user,n.bDYc=e.audience.attributes.session,!Array.isArray(n.NlEC)||!Array.isArray(n.bDYc))return T.error("No attributes"),!1}catch(e){return T.error(e),!1}return!0})),s(this,"validate",(function(t,i){var r=!0;"FTU"===n.OPHn&&(r=e.getController().getSessionInfo().is_first_session);var o=n.erQo(t,n.NlEC),a=n.erQo(i,n.bDYc);return o||(n.userAttributesValidated=!1),a||(n.sessionAttributeValidated=!1),r&&o&&a})),s(this,"erQo",(function(e,t){var n=t.length,i=!0;try{for(var r,o=function(){var n=t[a];if(h(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),H(e,t,r)}))}));i=i&&l},a=0;a<n;a++)if(r=o())return r.v}catch(e){T.error(e),i=!1}return i}))})),L=a((function e(){var t=this;r(this,e),s(this,"rpCx",""),s(this,"tarQ",{}),s(this,"MPLc",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{t.rpCx=e.name,t.tarQ=e.additional_info,t.MPLc=null==e?void 0:e.path}catch(e){return!1}return!0}))})),U=a((function e(){var t=this;r(this,e),s(this,"yMJa",0),s(this,"OKRo",0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.yMJa=Number(e.lower),t.OKRo=Number(e.upper),isNaN(t.yMJa)||isNaN(t.OKRo))return!1}catch(e){return!1}return!0}))})),M=a((function e(){var t=this;r(this,e),s(this,"cbVg",0),s(this,"NIzW",""),s(this,"ErML",""),s(this,"Aylq",new L),s(this,"Ocbb",new U),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.NIzW=e.event_type,t.ErML=e.activity,t.Aylq.parse(e.details)&&t.Ocbb.parse(e.time_bounds)}catch(e){return!1}}))})),V=window.ApxorLogger,Z=a((function e(){var t=this;r(this,e),s(this,"cbVg",0),s(this,"eJeT",-1),s(this,"Ruyv",0),s(this,"NyLm",""),s(this,"ErML",""),s(this,"NIzW",""),s(this,"Ocbb",new U),s(this,"Aylq",new L),s(this,"NaPf",new M),s(this,"unUI","AND"),s(this,"eMFz",!1),s(this,"OPHn",void 0),s(this,"jQHK",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;return t.eJeT=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.Ruyv=null==e||null===(n=e.count_config)||void 0===n?void 0:n.count,t.NyLm=null==e||null===(i=e.count_config)||void 0===i?void 0:i.operator,t.ErML=null==e?void 0:e.activity,t.NIzW=null==e?void 0:e.event_type,t.unUI=e.combine_operator,t._timeEnabled=null==e?void 0:e.time_enabled,t._time=null==e?void 0:e.time,t.OPHn=null==e?void 0:e.type,t.jQHK=null==e?void 0:e.route,t.Aylq.parse(null==e?void 0:e.details)&&t.NaPf.parse(e.trigger)&&t.Ocbb.parse(e.time_bounds)}catch(e){return V.error(e),!1}}))})),k=window.ApxorLogger,j=a((function e(){var t=this;r(this,e),s(this,"Ruyv",0),s(this,"NyLm",""),s(this,"NIzW",""),s(this,"Ocbb",new U),s(this,"Aylq",new L),s(this,"unUI","AND"),s(this,"parse",(function(e){try{return t.Ruyv=e.count_config.count,t.NyLm=e.count_config.operator,t.NIzW=e.event_type,t.unUI=e.combine_operator,t.Aylq.parse(e.details)&&t.Ocbb.parse(e.time_bounds)}catch(e){return k.error(e),!1}}))})),z=window.ApxorLogger,J=function(){function t(){var n=this;r(this,t),s(this,"jPoW",0),s(this,"UMRB",""),s(this,"ehHx",new Z),s(this,"esOM",new j),s(this,"AzGT",!1),s(this,"qyAQ",!1),s(this,"qwaz",0),s(this,"unUI","AND"),s(this,"obcq","OR"),s(this,"MOya",-1),s(this,"xcrS",[]),s(this,"Tiwg",{}),s(this,"tqtJ",!1),s(this,"CosE",void 0),s(this,"HZQB",void 0),s(this,"yAUg",void 0),s(this,"EauS",void 0),s(this,"no_KPI_TriggerDetails",[]),s(this,"lXOQ",!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,v=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(n.UMRB=i,n.qwaz=r,n.xcrS=a,n.CosE=o,n.childConditionIndex=u,n.across_sessions=s||!1,"termination"===l&&""!==l){n.esOM.parse(t);return n.obcq=n.esOM.unUI,n.eSMJ(),!0}var c=n.ehHx.parse(t);if(c){if(n.unUI=n.ehHx.unUI,n.ehHx.eMFz){var d=n.ehHx.Aylq.rpCx;"APX_PAGE_OPENED"===d&&(d=n.ehHx.Aylq.tarQ.navigation_id,d=p(d)?d:n.ehHx.Aylq.rpCx),n.MOya=e.getController().getEventCount(d);var f=n.ehHx.Ruyv,g=n.ehHx.NyLm;if(n.qyAQ=n.eHRa(n.MOya-1,f,g,!1),n.AzGT=n.qyAQ,n.qyAQ&&"APX_PAGE_OPENED"===n.ehHx.Aylq.rpCx)return!0}return!0===v&&(o&&0!==r&&"unordered"!==o||n.AXfg()),!0}return!1})),s(this,"AXfg",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1!=t&&(n.HZQB=t);var i=n.ehHx,r=null!=i&&i._eventCategory?null==i?void 0:i._eventCategory:"specific_event",o=i.NaPf,a=he.getInstance();if("app_start"===o.NIzW)if(n.AzGT=!0,null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var s=q(i._time.unit,i._time.value);if("didn't"==(null==i?void 0:i.OPHn)){if(n.tqtJ=!1,n.timerDidnt=setTimeout((function(){n.tqtJ||(n.qyAQ=!0,n.qyAQ&&(n.jPoW+=1,n.qyAQ=n.eHRa(n.jPoW,n.ehHx.Ruyv,n.ehHx.NyLm),n.qyAQ&&(n.ehHx.cbVg=Date.now(),n.tqtJ=!1,a.validate(n.UMRB,n.qwaz,n.HZQB))),"specific_event"===r?a.unregisterFromEvent(E(n.ehHx.NIzW)+"___"+n.ehHx.Aylq.rpCx,n.UgQF):n.htnU(r),n.AzGT=!1)}),s),n.across_sessions){var l=q(i._time.unit,i._time.value),u=i._timeEnabled,v=i._id;n.CFWW(i.OPHn,i.Aylq.rpCx,Date.now(),i.Aylq.tarQ,l,u,v)}"specific_event"===r?(a.registerForEvent(E(n.ehHx.NIzW)+"___"+n.ehHx.Aylq.rpCx,n.UgQF),n.EauS=n.ehHx):n.NPJe(r)}else if("did"==(null==i?void 0:i.OPHn)){if(n.timerDid=setTimeout((function(){n.lXOQ||("specific_event"===r?a.unregisterFromEvent(E(n.ehHx.NIzW)+"___"+n.ehHx.Aylq.rpCx,n.PufD):n.ecdp(r))}),s),n.across_sessions){var c=q(i._time.unit,i._time.value),d=i._timeEnabled,f=i._id;n.CFWW(i.OPHn,i.Aylq.rpCx,Date.now(),i.Aylq.tarQ,c,d,f)}"specific_event"===r?(a.registerForEvent(E(n.ehHx.NIzW)+"___"+n.ehHx.Aylq.rpCx,n.PufD),n.yAUg=n.ehHx):n.HgGO(r)}}}else"specific_event"===r?a.registerForEvent(E(i.NIzW)+"___"+i.Aylq.rpCx,n.YVho):n.Oswb(r);else if(null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var g=q(i._time.unit,i._time.value);"didn't"==(null==i?void 0:i.OPHn)?(n.tqtJ=!1,n.timerDidnt=setTimeout((function(){n.tqtJ||(n.qyAQ=!0,n.qyAQ&&(n.jPoW+=1,n.qyAQ=n.eHRa(n.jPoW,n.ehHx.Ruyv,n.ehHx.NyLm),n.qyAQ&&(n.ehHx.cbVg=Date.now(),n.tqtJ=!1,a.validate(n.UMRB,n.qwaz)))),"specific_event"===r&&a.unregisterFromEvent(E(n.ehHx.NIzW)+"___"+n.ehHx.Aylq.rpCx,n.UgQF),n.AzGT=!1}),g),"specific_event"===r?(a.registerForEvent(E(n.ehHx.NIzW)+"___"+n.ehHx.Aylq.rpCx,n.UgQF),n.EauS=n.ehHx):n.NPJe()):"did"==(null==i?void 0:i.OPHn)&&(n.timerDid=setTimeout((function(){n.lXOQ||"specific_event"===r&&a.unregisterFromEvent(E(n.ehHx.NIzW)+"___"+n.ehHx.Aylq.rpCx,n.PufD)}),g),"specific_event"===r&&a.registerForEvent(E(n.ehHx.NIzW)+"___"+n.ehHx.Aylq.rpCx,n.PufD))}}else"specific_event"===r&&a.registerForEvent(E(i.NIzW)+"___"+o.Aylq.rpCx,n.YVho);null!==(e=window.ApxorRTM)&&void 0!==e&&e.badgesLists.includes(n.UMRB)&&a.registerForEvent(E(i.NIzW)+"___"+"apxor-badge-container-".concat("-".concat(n.UMRB).replaceAll(" ","").replace(/[^\w\s]/gi,"")),n.YVho)})),s(this,"Oswb",(function(e){var t=new he;"apxor_event"===e?t.registerForEvent("apxor_event",(function(e,t,i,r){n.YVho(E(n.ehHx.NIzW),n.ehHx.Aylq.rpCx,i,n.ehHx.Aylq.tarQ)})):"customer_event"===e?t.registerForEvent("customer_event",(function(e,t,i,r){n.YVho(E(n.ehHx.NIzW),n.ehHx.Aylq.rpCx,i,n.ehHx.Aylq.tarQ)})):"any_event"===e?t.registerForEvent("any_event",(function(e,t,i,r){n.YVho(E(n.ehHx.NIzW),n.ehHx.Aylq.rpCx,i,n.ehHx.Aylq.tarQ)})):"campaign_event"===e?t.registerForEvent("campaign_event",(function(e,t,i,r){n.YVho(E(n.ehHx.NIzW),n.ehHx.Aylq.rpCx,i,n.ehHx.Aylq.tarQ)})):"survey_event"===e&&t.registerForEvent("survey_event",(function(e,t,i,r){n.YVho(E(n.ehHx.NIzW),n.ehHx.Aylq.rpCx,i,n.ehHx.Aylq.tarQ)}))})),s(this,"htnU",(function(e){var t=new he,i=n.ehHx._eventCategory;"apxor_event"===i?t.unregisterFromEvent("apxor_event",n.UgQF):"customer_event"===i?t.unregisterFromEvent("customer_event",n.UgQF):"any_event"===i?t.unregisterFromEvent("any_event",n.UgQF):"campaign_event"===i?t.unregisterFromEvent("campaign_event",n.UgQF):"survey_event"===i&&t.unregisterFromEvent("survey_event",n.UgQF)})),s(this,"NPJe",(function(){var e=new he,t=n.ehHx._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.UgQF):"customer_event"===t?e.registerForEvent("customer_event",n.UgQF):"any_event"===t?e.registerForEvent("any_event",n.UgQF):"campaign_event"===t?e.registerForEvent("campaign_event",n.UgQF):"survey_event"===t&&e.registerForEvent("survey_event",n.UgQF)})),s(this,"HgGO",(function(){var e=new he,t=n.ehHx._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.PufD):"customer_event"===t?e.registerForEvent("customer_event",n.PufD):"any_event"===t?e.registerForEvent("any_event",n.PufD):"campaign_event"===t?e.registerForEvent("campaign_event",n.PufD):"survey_event"===t&&e.registerForEvent("survey_event",n.PufD)})),s(this,"ecdp",(function(){var e=new he,t=n.ehHx._eventCategory;"apxor_event"===t?e.unregisterFromEvent("apxor_event",n.PufD):"customer_event"===t?e.unregisterFromEvent("customer_event",n.PufD):"any_event"===t?e.unregisterFromEvent("any_event",n.PufD):"campaign_event"===t?e.unregisterFromEvent("campaign_event",n.PufD):"survey_event"===t&&e.unregisterFromEvent("survey_event",n.PufD)})),s(this,"eSMJ",(function(){var e=n.esOM,t=he.getInstance();n.AzGT=!0,t.registerForEvent(E(e.NIzW)+"___"+e.Aylq.rpCx,n.MANn)})),s(this,"mnkH",(function(e,t,i,r){var o,a=(Date.now()-n.Tiwg[t])/1e3;(null===(o=n.ehHx)||void 0===o||null===(o=o.Aylq)||void 0===o||null===(o=o.tarQ)||void 0===o?void 0:o.time)/1e3>a&&n._displayCampaign(i)})),s(this,"vNcG",(function(e,t,i,r){var o,a;n.tqtJ=!0;var s=Date.now(),l=null===(o=n.ehHx)||void 0===o||null===(o=o.NaPf)||void 0===o?void 0:o.Aylq.rpCx,u=(s-n.Tiwg[l])/1e3,v=null===(a=n.ehHx)||void 0===a||null===(a=a.Aylq)||void 0===a||null===(a=a.tarQ)||void 0===a?void 0:a.time;(v/=1e3)>u&&n._displayCampaign(i)})),s(this,"PufD",(function(){n.lXOQ=!0;var e=new he;clearTimeout(n.timerDid),n.jPoW+=1,n.qyAQ=n.eHRa(n.jPoW,n.ehHx.Ruyv,n.ehHx.NyLm),n.qyAQ&&(e.unregisterFromEvent(E(n.yAUg.NIzW)+"___"+n.yAUg.Aylq.rpCx,n.PufD),n.lXOQ=!1,e.validate(n.UMRB,n.qwaz,n.HZQB))})),s(this,"UgQF",(function(e,t,i,r){n.tqtJ=!0,clearTimeout(n.timerDidnt),(new he).unregisterFromEvent(E(n.EauS.NIzW)+"___"+n.EauS.Aylq.rpCx,n.UgQF)})),s(this,"YVho",(function(t,i,r,o){var a,s,l=he.getInstance();if(n.AzGT){if(null!==(a=window.ApxorRTM)&&void 0!==a&&a.isBadgePresent&&null!==(s=window.ApxorRTM)&&void 0!==s&&s.badgesLists.includes(n.UMRB)&&e.getController().isBadgeTriggerSatisfied(n.UMRB))return n.qyAQ=!0,n.ehHx.cbVg=r,void l.validate(n.UMRB,n.qwaz);if(E(n.ehHx.NIzW)===t&&n.KiCo(r-n.ehHx.NaPf.cbVg,n.ehHx.Ocbb)&&n.ehHx.Aylq.rpCx===i&&n.QHlW(n.ehHx.Aylq.tarQ,o)&&(n.jPoW+=1,n.qyAQ=n.eHRa(n.jPoW,n.ehHx.Ruyv,n.ehHx.NyLm),n.qyAQ)){if(n.ehHx.cbVg=r,n.across_sessions){var u=q(n.ehHx._time.unit,n.ehHx._time.value),v=n.ehHx._timeEnabled,c=n.ehHx._id,d=n.jPoW;n.CFWW(n.ehHx.OPHn,i,r,o,u,v,c,d)}l.validate(n.UMRB,n.qwaz,n.HZQB)}}else if(n.AzGT=n.dUjb(t,i,r,o),n.AzGT){var f=n.ehHx,g=f.NaPf;if(g.cbVg=r,"activity_time"===(null==f?void 0:f.NIzW)){var h,_,p,y,m=null==f||null===(h=f.Aylq)||void 0===h||null===(h=h.tarQ)||void 0===h?void 0:h.time;(null==f||null===(_=f.jQHK)||void 0===_?void 0:_.length)>0?setTimeout((function(){var t;(null===(t=e.getController())||void 0===t?void 0:t._appEventsNoKpi).length<=2&&f.jQHK===location.pathname&&n._displayCampaign(r)}),m):(null==f||null===(p=f.Aylq)||void 0===p||null===(p=p.tarQ)||void 0===p?void 0:p.nkpi.length)>0?(setTimeout((function(){n.tqtJ||(n.qyAQ=!0,n.qyAQ&&(n.jPoW+=1,n.qyAQ=n.eHRa(n.jPoW,n.ehHx.Ruyv,n.ehHx.NyLm),n.qyAQ&&(n.ehHx.cbVg=r,n.tqtJ=!1,l.validate(n.UMRB,n.qwaz)))),f.Aylq.tarQ.nkpi.map((function(e){l.unregisterFromEvent(w(f.Aylq.tarQ.et)+"___"+e,n),n.AzGT=!1}))}),m),f.Aylq.tarQ.nkpi.map((function(e){l.registerForEvent(w(f.Aylq.tarQ.et)+"___"+e,n.UgQF)}))):(null==f||null===(y=f.Aylq)||void 0===y||null===(y=y.tarQ)||void 0===y?void 0:y.kpi.length)>0&&(setTimeout((function(){f.Aylq.tarQ.kpi.map((function(e){l.unregisterFromEvent(w(f.Aylq.tarQ.et)+"___"+e,n)}))}),m),f.Aylq.tarQ.kpi.map((function(e){e===f.NaPf.Aylq.rpCx?(l.unregisterFromEvent(E(g.NIzW)+"___"+g.Aylq.rpCx,n),l.registerForEvent(w(f.Aylq.tarQ.et)+"___"+e,n.mnkH)):l.registerForEvent(w(f.Aylq.tarQ.et)+"___"+e,n.vNcG)})))}else l.unregisterFromEvent(E(g.NIzW)+"___"+g.Aylq.rpCx,n),l.registerForEvent(E(f.NIzW)+"___"+f.Aylq.rpCx,n);n.Tiwg[i]=Date.now()}})),s(this,"MANn",(function(e,t,i,r){var o=he.getInstance();E(n.esOM.NIzW)===e&&n.KiCo(i,n.esOM.Ocbb)&&n.esOM.Aylq.rpCx===t&&n.QHlW(n.esOM.Aylq.tarQ,r)&&(n.jPoW+=1,n.qyAQ=n.eHRa(n.jPoW,n.esOM.Ruyv,n.esOM.NyLm),n.qyAQ&&(n.esOM.cbVg=i,o.validateForTermination(n.UMRB,n.qwaz)))})),s(this,"dUjb",(function(e,t,i,r){var o=n.ehHx.NaPf,a=E(o.NIzW)===e&&o.Aylq.rpCx===t&&n.KiCo(i,o.Ocbb)&&n.QHlW(o.Aylq.tarQ,r);return a="APX_PAGE_OPENED"===t?a&&location.pathname===o.Aylq.MPLc:a})),s(this,"KiCo",(function(e,t){var n=Math.ceil(e);return n>t.yMJa&&n<t.OKRo})),s(this,"eHRa",(function(e,t,i){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(r&&n.ehHx.eMFz&&(e+=n.MOya),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,"QHlW",(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 v,c=(Array.isArray(t[a])?t[a]:[t[a]]).some((function(e){return"s"===u?e="".concat(e):"l"===u?e=parseInt(e):"f"===u?e=parseFloat(e):"b"===u&&(e=!!e),H(e,s,l)}));if(!(null===(r=e[a])||void 0===r||!r.present)&&(null===(o=e[a])||void 0===o?void 0:o.present))v=!!t.hasOwn(t,a),n=n&&v;n=n&&c}else n=n&&H(t[a],e[a],"EQ")};for(var a in e)if(r=o())return r.v}catch(e){z.error(e),n=!1}return n})),s(this,"CFWW",(function(t,i,r,o,a,s,l,u){var v,c=!1;n.no_KPI_TriggerDetails=e.getController().getFromStorage("apx_nokpi_triggerdetails"),null===n.no_KPI_TriggerDetails||void 0===n.no_KPI_TriggerDetails?n.no_KPI_TriggerDetails=[]:n.no_KPI_TriggerDetails=JSON.parse(n.no_KPI_TriggerDetails);var d,f=0;s&&(f=Date.now()+a);for(var g=0;g<n.no_KPI_TriggerDetails.length;g++)if(n.no_KPI_TriggerDetails[g].id===l){c=!0,v=n.no_KPI_TriggerDetails[g];break}c?v.satisfiedCount+=1:(d={id:l,type:t,time:r,name:i,additionalInfo:o,satisfiedCount:u,timeBased:s,finishTime:f},n.no_KPI_TriggerDetails.push(d)),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(n.no_KPI_TriggerDetails))})),s(this,"ognp",(function(e){var t,i=new he,r=d(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(1===(null==o?void 0:o.length)||void 0===(null==o?void 0:o.length))i.unregisterFromEvent(E(null==o?void 0:o.ehHx.NIzW)+"___"+(null==o?void 0:o.ehHx.Aylq.rpCx),n.YVho);else{var a,s=d(o);try{for(s.s();!(a=s.n()).done;){var l,u=a.value;i.unregisterFromEvent(E(null==u?void 0:u.ehHx.NIzW)+"___"+(null==u||null===(l=u.ehHx)||void 0===l?void 0:l.Aylq.rpCx),n.YVho)}}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=he.getInstance();this.qyAQ=!0,this.qyAQ&&(this.jPoW+=1,this.qyAQ=this.eHRa(this.jPoW,this.ehHx.Ruyv,this.ehHx.NyLm),this.qyAQ&&(this.ehHx.cbVg=e,t.validate(this.UMRB,this.qwaz)))}}]),t}(),X=window.ApxorLogger,G=a((function t(){var n=this;r(this,t),s(this,"Ruyv",0),s(this,"HmhU",0),s(this,"Aveo","SESSION"),s(this,"zOxW",0),s(this,"pBkj",0),s(this,"HBRw",0),s(this,"_enable_repetition_gap",void 0),s(this,"_enable_days_limit",void 0),s(this,"_enable_session_limit",void 0),s(this,"QNxl",void 0),s(this,"bbwH",void 0),s(this,"sPgA",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,v;if(n.UMRB=t._id,n.EgcZ=t.meta,n.Ruyv=t.frequency.count,-1===n.Ruyv&&(n.Ruyv=9999999),n.HBRw=n.Ruyv,n.HmhU=t.frequency.time_interval,n.Aveo=t.frequency.validity,n.DSLimits=t.frequency.DSLimits,n.pBkj=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.QNxl=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===(v=t.frequency)||void 0===v?void 0:v.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.sPgA=t.frequency.days_limit.days?t.frequency.days_limit.days:1,n.bbwH=t.frequency.days_limit.limit);var c=he.getInstance().getQeState();if(!p(c)||!p(c[t._id]))return!0;if("SESSION"===n.Aveo){if(n.Ruyv=parseInt(n.Ruyv)-parseInt(c[t._id].SESSION),n.Ruyv<=0)return n.agaL("Session limit reached"),console.warn("Max count limit reached for session:"+t._id),e.getController().isTestDevice()&&P("Maximum overall limit reached for campaign name ".concat(n.EgcZ.name)),!1}else{if("OVERALL"!==n.Aveo)return X.info("Invalid config."),!1;if(n.Ruyv=parseInt(n.Ruyv)-parseInt(c[t._id].OVERALL),n.Ruyv<=0)return n.agaL("Overall limit reached"),console.warn("Max count limit reached for overall:"+t._id),e.getController().isTestDevice()&&P("Maximum overall limit reached for campaign name ".concat(n.EgcZ.name)),!1}}catch(e){return X.error(e),!1}return!0})),s(this,"AkJS",(function(){n.Ruyv=n.Ruyv-1})),s(this,"getFrequencyCount",(function(){return n.Ruyv})),s(this,"sPjS",(function(){"SESSION"===n.Aveo&&(n.Ruyv=n.HBRw,X.info("Campaign Limit reset"))})),s(this,"QkgO",(function(t){try{if(n.Ruyv<=0)return"OVERALL"===n.Aveo?(n.agaL("Overall limit reached"),e.getController().isTestDevice()&&P("Maximum overall limit reached for campaign name ".concat(n.EgcZ.name))):"SESSION"===n.Aveo&&(e.getController().isTestDevice()&&P("Maximum session limit reached for campaign name ".concat(n.EgcZ.name)),n.agaL("Session limit reached")),!1;var i=he.getInstance().getQeState();if(!p(i)||!p(i[t]))return!0;if(n._enable_session_limit)if(parseInt(n.QNxl)-parseInt(i[t].SESSION)<=0)return n.agaL("Session limit reached"),e.getController().isTestDevice()&&P("Maximum session limit reached for campaign name ".concat(n.EgcZ.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),!_(R(r,n.UMRB))){var o=R(r,n.UMRB)[n.UMRB];if(Date.now()-o<q(n._repetitionUnit,n._repetitionValue))return n.agaL("Config does not satisfy time difference "),e.getController().isTestDevice()&&P("Config does not satisfy time difference for campaign name ".concat(n.EgcZ.name)),!1}}else{var a=e.getController().getFromStorage("apx-last-shown-session");if(a=JSON.parse(a),!_(R(a,n.UMRB))){var s=R(a,n.UMRB)[n.UMRB];if(e.getController().getFromStorage("apx_retained_session")-s<parseInt(n._repetitionValue))return n.agaL("Config does not satisfy session difference "),e.getController().isTestDevice()&&P("Config does not satisfy session difference for campaign name ".concat(n.EgcZ.name)),!1}}if(0!==n.pBkj&&n.DSLimits)if(parseInt(n.pBkj)-parseInt(i[t].SESSION)<=0)return n.agaL("Session limit reached"),e.getController().isTestDevice()&&P("Session limit reached for campaign name ".concat(n.EgcZ.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.agaL("Day limit reached"),e.getController().isTestDevice()&&P("Day limit reached for campaign name ".concat(n.EgcZ.name)),!1}if(n.sPgA>0&&n._enable_days_limit){var v=n.sPgA,c=0;if(function(e){for(var t=[],n=new Date,i=0;i<e;i++){var r=new Date(n);r.setDate(n.getDate()-i);var o=String(r.getDate()),a=String(r.getMonth()),s=r.getFullYear();t.push(o+"/"+a+"/"+s)}return t}(v).forEach((function(e){var n;c+=parseInt((null===(n=i[t])||void 0===n?void 0:n.DATES[e])||0)})),c>n.bbwH)return X.info("Shown Limit Crossed"),e.getController().isTestDevice()&&P("Days limit reached for campaign name ".concat(n.EgcZ.name)),!1}}catch(e){n.agaL("Error validating the frequency: ".concat(e)),X.error("Error validating the frequency:"+e)}return!0})),s(this,"agaL",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.EgcZ.type?"survey":"campaign",apx_nudge_id:n.UMRB,apx_nudge_name:n.EgcZ.name,apx_variant_code:n.EgcZ.isExperiment||n.EgcZ.only_context?null===(i=n.EgcZ.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),Y=window.ApxorLogger,K=a((function e(){var t=this;r(this,e),s(this,"OevR",[]),s(this,"WoLL",0),s(this,"bnfg",!1),s(this,"fgrG",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.UMRB=n,t.qwaz=i,t.xcrS=o,t.CosE=r,t.across_sessions=s;var l=[];t.WoLL=e.length;try{if(null!=l)return r=null==e?void 0:e.sequence_type,l=t.SBGu(e,t.WoLL),"unordered"!==a&&0!==t.qwaz||t.AXfg(),t.OevR}catch(e){return Y.error(e),!1}})),s(this,"SBGu",(function(e,n){for(var i=0;i<n;i++){t.fgrG=new J;try{t.fgrG.initialize(e[i],t.UMRB,t.qwaz,t.CosE,t.cTlZ,t.across_sessions,"",-1,!1)&&(t.OevR.push(t.fgrG),t.OevR.sequence_type=t.CosE)}catch(e){Y.error(e)}}return t.OevR})),s(this,"AXfg",(function(){if("ordered"===t.CosE||"strictly_ordered"===t.CosE)t.OevR[0].AXfg(0);else{var e,n=d(t.OevR);try{for(n.s();!(e=n.n()).done;){e.value.AXfg()}}catch(e){n.e(e)}finally{n.f()}}})),s(this,"ognp",(function(e){t.fgrG.ognp(e)}))})),$=a((function e(){var t=this;r(this,e),s(this,"rpCx",""),s(this,"OPHn",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;t.rpCx=e.meta.name,t.OPHn=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,"VZfI",[]),s(this,"_ret_day",{}),s(this,"nmAv",{}),s(this,"PlDG",!1),s(this,"oawY",!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.VZfI=e.overall_cfg.events,n._ret_day=e.overall_cfg.ret_day,n.nmAv=e.overall_cfg.session,n.PlDG=e.overall_cfg.toggleRetDay,n.oawY=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.PlDG&&!isNaN(t)&&!(t>=n._ret_day.from&&t<=n._ret_day.to))return n.retainedDaysValidated=!1,!1;if(n.oawY&&!isNaN(i)&&!(i>=n.nmAv.from&&i<=n.nmAv.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}(x(o,r)))),s=0;s<n.VZfI.length;s++){if(a[n.VZfI[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,"NlEC",[]),s(this,"bDYc",[]),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.NlEC=e.attributes.user,t.bDYc=e.attributes.session,!Array.isArray(t.NlEC)||!Array.isArray(t.bDYc))return ne.error("No attributes"),!1}catch(e){return ne.error(e),!1}return!0})),s(this,"validate",(function(e,n){return t.erQo(e,t.NlEC)&&t.erQo(n,t.bDYc)})),s(this,"erQo",(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 H(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,"FDyt",e.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"vmfD",1),s(this,"parse",(function(e){try{var t,i,r;if(n.OPHn=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.vmfD=null===(r=e.terminate_info.time_based)||void 0===r?void 0:r.days,n.tPTd(e._id))return n.FDyt.persistTerminationInfoLocally(e._id),!1}catch(e){return!1}return!0})),s(this,"tPTd",(function(e){var t,i=JSON.parse(n.FDyt.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].pakd;return s===n.vmfD&&l.hours>=u.hours||s>n.vmfD||i[e].goalAcheived}))})),oe=a((function e(){var t=this;r(this,e),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"xSTS",new ie),s(this,"moAT",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.moAT.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.xSTS.parse(e.terminate_info))return!1}catch(e){return window.ApxorLogger.error(e),!1}return!0})),s(this,"validate",(function(e,n){return t.xSTS.validate(e,n)}))})),ae=window.ApxorLogger,se=a((function t(){var n=this;r(this,t),s(this,"ZDDU",-1),s(this,"qLMk",-1),s(this,"pakd",-1),s(this,"wrcD",-1),s(this,"URXM",-1),s(this,"oAEi",-1),s(this,"_is_user_timezone",void 0),s(this,"SqXq",!1),s(this,"WNZS",!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.UMRB=e._id,n.EgcZ=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.ZDDU=Date.parse(e.validity.start_date),n.qLMk=Date.parse(e.validity.end_date),n._days_in_week=null!==(t=e.validity)&&void 0!==t&&t.days_in_week?null===(i=e.validity)||void 0===i?void 0:i.days_in_week:[1,2,3,4,5,6,7],n._is_user_timezone=!e.is_user_timezone||e.is_user_timezone,p(e.at_specific_time)&&(n.SqXq=e.at_specific_time,n.SqXq&&p(e.time_limits)&&(n.pakd=e.time_limits.start_time,n.wrcD=e.time_limits.end_time,A(n.pakd)||A(n.wrcD))))return ae.error("Not valid times"),!1;if(p(e.time_excludes_in_day)&&(n.WNZS=e.time_excludes_in_day,n.WNZS&&p(e.time_excludes)&&(n.URXM=e.time_excludes.start_time,n.oAEi=e.time_excludes.end_time,A(n.URXM)||A(n.oAEi))))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.ZDDU&&t<n.qLMk&&n._days_in_week.includes(i))return!n.SqXq||Q(r,n.pakd,"GT")&&Q(r,n.wrcD,"LT")||(n._not_in_specified_time=!0),n.WNZS&&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],v=l(n.split(":").map(Number),2),c=60*v[0]+v[1];return c>=60*r+o&&c<=60*s+u}(n.URXM,n.oAEi,r)?(n.agaL("Exclude Time limits check failed"),e.getController().isTestDevice()&&P("Exclude Time Limits check failed for campaign name ".concat(n.EgcZ.name)),!1):!n.SqXq||Q(r,n.pakd,"GT")&&Q(r,n.wrcD,"LT");if(t<n.ZDDU)n._not_yet_active=!0;else if(t>n.qLMk)n._nudge_expired=!0;else if(!n._days_in_week.includes(i))return n.agaL("Current week day did not match with Configured Week day"),e.getController().isTestDevice()&&P("Current week day did not match with Configured Week day for campaign name ".concat(n.EgcZ.name)),!1;return!1})),s(this,"agaL",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.EgcZ.type?"survey":"campaign",apx_nudge_id:n.UMRB,apx_nudge_name:n.EgcZ.name,apx_variant_code:n.EgcZ.isExperiment||n.EgcZ.only_context?null===(i=n.EgcZ.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),le=a((function e(){var t=this;r(this,e),s(this,"AHgi",""),s(this,"uIxc",""),s(this,"xcOn",""),s(this,"uPhW",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.AHgi=null==e?void 0:e.screen_binding,!t.AHgi||(t.uIxc=null==e?void 0:e.binding.url,t.xcOn=null==e?void 0:e.binding.var,t.uPhW=null==e?void 0:e.binding.operator,!0)}catch(e){return window.ApxorLogger.error(e),!1}})),s(this,"validate",(function(){var e=t.uIxc,n=t.xcOn,i=t.uPhW,r=window.location.href;return!t.AHgi||("EQ"===i?e.includes(n)?!!W(r,e,n,!1):r===e:"SW"===i?e.includes(n)?!!W(r,e,n,!0):!!r.startsWith(e):void 0)}))})),ue=window.ApxorLogger,ve=a((function t(){var i=this;r(this,t),s(this,"QfBW",[]),s(this,"sWqU",[]),s(this,"UMRB",""),s(this,"EgcZ",new $),s(this,"LpAl",new O),s(this,"Aveo",new se),s(this,"tWsf",new G),s(this,"EHDG",new te),s(this,"lDOg",new oe),s(this,"rNEC",new le),s(this,"CosE",!1),s(this,"cTlZ",[]),s(this,"_variant_code",""),s(this,"bnfg",!1),s(this,"groupCombineOperator","OR"),s(this,"tqtJ",!1),s(this,"vPed",!1),s(this,"WRdX",void 0),s(this,"timeForKPI",void 0),s(this,"kpiIndex",0),s(this,"ZuJR",void 0),s(this,"_across_sessions",!1),s(this,"FWVg",void 0),s(this,"XyBT",!1),s(this,"OfMt",void 0),s(this,"VDGB",void 0),s(this,"FAwt",void 0),s(this,"NUcf",void 0),s(this,"YTaA",void 0),s(this,"xlCr",void 0),s(this,"AfPH",void 0),s(this,"qaPg",void 0),s(this,"jsmS",void 0),s(this,"jfEs",void 0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,n;if(!p(e._id))return ue.error("No Id"),!1;if(!p(e.enabled)||!e.enabled)return ue.error("Not enabled"),!1;if(!(i.EgcZ.parse(e)&&i.Aveo.parse(e)&&i.tWsf.parse(e)&&i.LpAl.parse(e)&&i.EHDG.parse(e)&&i.lDOg.parse(e)&&i.rNEC.parse(e)))return!1;if(i._variant_code=i.EgcZ._isExperiment||i.EgcZ._only_context?null===(t=i.EgcZ._attr)||void 0===t?void 0:t.apx_variant_code:"TG",i._across_sessions=!(null==e||!e.across_sessions)&&(null==e?void 0:e.across_sessions),i.enable_conditions=null==e?void 0:e.enable_conditions,i.enable_conditions_v2=null==e?void 0:e.enable_conditions_v2,!p(e.conditions)||!Array.isArray(e.conditions))return ue.error("No valid conditions",e.conditions),!1;i.UMRB=e._id,i.CosE=!!p(e.sequence_enabled)&&e.sequence_enabled,p(e.conditions_v2)&&i.enable_conditions_v2&&(i.CosE=null==e?void 0:e.sequence_type),!0===i.CosE&&e.conditions.sort((function(e,t){return e.sequence<t.sequence})),p(e.conditions_v2)&&i.enable_conditions_v2?(n=e.conditions_v2,i.XyBT=!0):n=e.conditions,i.FWVg=n;var r=n.length,o=null==e?void 0:e.no_context_enabled;if(0===r&&o&&setTimeout((function(){i.Csks()}),10),i.jfEs=r,i.aEWV(n,r),i.KHmZ(),i.lDOg.enable_goal_events)for(var a=e.terminate_info.goal_events.events,s=a.length,l=0;l<s;l++){var u=new J;u.initialize(a[l],i.UMRB,l,!0,[],i._across_sessions,"termination")&&i.sWqU.push(u)}return i.QfBW.length>0}catch(e){return ue.error(e),!1}})),s(this,"aEWV",(function(e,t){for(var n=function(){i.cTlZ=[];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.jsmS=new K;var a=i.jsmS.initialize(n,i.UMRB,r,o,i.cTlZ,i.CosE,i._across_sessions);i.QfBW.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.cTlZ=[].concat(u(i.cTlZ),[l])}if(i.jsmS=new J,i.jsmS.initialize(t,i.UMRB,r,i.CosE,i.cTlZ,i._across_sessions)){i.QfBW.push(i.jsmS);var v=(null==t?void 0:t.timeout)/(null==t?void 0:t.findinterval),c=(null==t?void 0:t.frameid)||"",d=null==t?void 0:t.url;window.location.href===d&&"view_visibility"===t.event_type&&!0===B(t.view_id,c,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,v)&&i.Csks(!0),window.addEventListener("navigate",(function(e){var n=null==t?void 0:t.url;window.location.href===n&&"view_visibility"===t.event_type&&!0===B(t.view_id,c,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,v)&&i.Csks(!0)}))}}},r=0;r<t;r++)n()})),s(this,"KHmZ",(function(){if(i._across_sessions&&"ordered"===i.CosE){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.QfBW[e])&&void 0!==r&&null!==(r=r.ehHx)&&void 0!==r&&r._timeEnabled&&void 0===i.QfBW[e].length){if("didn't"===i.QfBW[e].ehHx.OPHn){var s=i.QfBW[e].ehHx._id,l=i.aIKR(s,n);if(l)if(Date.now()>l.finishTime)i.QfBW[e].qyAQ=!0,i.QfBW[e].jPoW=l.satisfiedCount,t=!0;else{var u=l.finishTime-Date.now(),v=i.QfBW[e].ehHx._eventCategory?i.QfBW[e].ehHx._eventCategory:"specific_event",c=new he;"specific_event"===v?(c.registerForEvent(E(i.QfBW[e].ehHx.NIzW)+"___"+i.QfBW[e].ehHx.Aylq.rpCx,i.UgQF),i.YTaA=i.QfBW[e]):i.NPJe(v),setTimeout((function(){e!==i.QfBW.length-1||i.tqtJ||(i.QfBW[e].qyAQ=!0,i.QfBW[e].jPoW=l.satisfiedCount,t=!0,"specific_event"===v?c.unregisterFromEvent(E(i.QfBW[e].ehHx.NIzW)+"___"+i.QfBW[e].ehHx.Aylq.rpCx,i.UgQF):i.mNlm(i.QfBW[e]),i.Csks())}),u)}}if("did"===i.QfBW[e].ehHx.OPHn){var d=i.QfBW[e].ehHx._id,f=i.aIKR(d,n);if(f)if(null==f.satisfiedCount){if(Date.now()<f.finishTime){i.FAwt=f,i.VDGB=e;var g=f.finishTime-Date.now(),h=i.QfBW[e].ehHx._eventCategory?i.QfBW[e].ehHx._eventCategory:"specific_event",_=new he;"specific_event"===h?_.registerForEvent(E(i.QfBW[e].ehHx.NIzW)+"___"+i.QfBW[e].ehHx.Aylq.rpCx,i.sGIM):i.NPJe(h),setTimeout((function(){"specific_event"===h?_.unregisterFromEvent(E(i.QfBW[e].ehHx.NIzW)+"___"+i.QfBW[e].ehHx.Aylq.rpCx,i.sGIM):i.mNlm(i.QfBW[e])}),g)}}else i.QfBW[e].jPoW=f.satisfiedCount,i.QfBW[e].qyAQ=!0}}else t=i.bnzx(e,n);t&&(null===(o=i.QfBW[e])||void 0===o||null===(o=o.ehHx)||void 0===o||!o._timeEnabled||(null===(a=i.QfBW[e])||void 0===a?void 0:a.length)>1)?e===i.QfBW.length-1&&i.Csks():t||void 0===!i.QfBW[e].length&&i.QfBW[e].AXfg()},o=0;o<i.QfBW.length;o++)r(o)}else if(i._across_sessions&&"unordered"===i.CosE){var a=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(a=JSON.parse(a))&&null!=a)for(var s=0;s<i.QfBW.length;s++)i.bnzx(s,a)}})),s(this,"bnzx",(function(e,t){if(void 0===i.QfBW[e].length||1===i.QfBW[e].length){var n=i.QfBW[e].ehHx._id,r=!1,o=i.aIKR(n,t);if(o)i.OfMt=o,r=(new J).eHRa(o.satisfiedCount,i.QfBW[e].ehHx.Ruyv,i.QfBW[e].ehHx.NyLm),o&&(r?i.QfBW[e].qyAQ=!0:i.QfBW[e].jPoW=o.satisfiedCount);else i.QfBW[e].AXfg();return r}if(i.QfBW[e].length>=1){var a,s,l;if("ordered"===(s=null===(a=i.QfBW[e])||void 0===a?void 0:a.sequence_type)||"strictly_ordered"===s){for(var u=0;u<i.QfBW[e].length;u++){var v=i.QfBW[e][u],c=v.ehHx._id;l=!1;var d=i.aIKR(c,t);if(d){if(l=(new J).eHRa(d.satisfiedCount,v.ehHx.Ruyv,v.ehHx.NyLm),d)if(l){i.QfBW[e][u].qyAQ=!0;var f=u+1,g=i.QfBW[e][u+1];void 0===g&&p(i.QfBW[e+1])&&(i.QfBW[e+1].AXfg(),l=!0),null!=g&&i.QfBW[e][u+1].AXfg(f)}else i.QfBW[e][u].jPoW=d.satisfiedCount}else(p(i.QfBW[e][u-1])&&!0===i.QfBW[e][u].qyAQ||h(i.QfBW[e][u-1]))&&i.QfBW[e][u].AXfg()}return l}for(var _,y=0;y<i.QfBW[e].length;y++){var m=i.QfBW[e][0].ehHx.unUI;_="OR"!==m;var x=i.QfBW[e][y],A=x.ehHx._id;l=!1;var E=i.aIKR(A,t);if(E)l=(new J).eHRa(E.satisfiedCount,x.ehHx.Ruyv,x.ehHx.NyLm),E&&(l?i.QfBW[e][y].qyAQ=!0:i.QfBW[e][y].jPoW=E.satisfiedCount);else x.AXfg();_="AND"===m?_&&l:_||l}return _}})),s(this,"aIKR",(function(e,t){return t.find((function(t){return t.id===e}))})),s(this,"ndZk",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=he.getInstance();if(!(t<0)){var o=i.QfBW[t],a="unordered";if((null==o?void 0:o.length)>1&&(a=null==o?void 0:o.sequence_type),!0===i.CosE||"ordered"===i.CosE||"strictly_ordered"===i.CosE||"ordered"===a||"strictly_ordered"===a){i.kpiIndex=t+1;var s=i.QfBW[t];if((null==s?void 0:s.length)>0){if(p(s))if("unordered"===i.CosE&&"ordered"===a){var l=o[n-1];if(p(l))if(void 0===l.length||1==l.length){if(!l.qyAQ)return}else if(l.length>1&&!i.Yjev(l))return;var u,v=o[n+1];if(p(v)){if(v.AXfg(n+1),"strictly_ordered"===i.CosE){i._currentEventname=s[n].ehHx.Aylq.rpCx;var c=e.getController();c.registerForEvent("APP_EVENT",i.MwXi),c.registerForEvent("CLIENT_EVENT",i.MwXi)}}else if("strictly_ordered"===a)1!=i.bnfg&&i.Csks();else(null===(u=o[n])||void 0===u?void 0:u.length)>0?i.Yjev(o)&&i.Csks():i.Csks()}else{var f,g=i.QfBW[t-1];if(p(g))if(void 0===g.length||1==g.length){if(!g.qyAQ)return}else if(g.length>1&&!i.Yjev(g))return;if(void 0===s.length||1===s.length?f=i.QfBW[t+1]:s.length>1&&("ordered"===a||"strictly_ordered"===a?f=n===s.length-1?i.QfBW[t+1]:i.QfBW[t][n+1]:i.Yjev(s)&&(f=i.QfBW[t+1])),p(f)){if(void 0===f.length||1===f.length)f.AXfg(n+1);else if(i.Yjev(s))if(void 0===f.length)f.AXfg();else if(f.length>1)if("unordered"===f.sequence_type)for(var h=0;h<f.length;h++)f[h].AXfg(h);else"ordered"!==f.sequence_type&&"strictly_ordered"!==f.sequence_type||f[0].AXfg(0);if("strictly_ordered"===i.CosE){i._currentEventname=s[n].ehHx.Aylq.rpCx;var _=e.getController();_.registerForEvent("APP_EVENT",i.MwXi),_.registerForEvent("CLIENT_EVENT",i.MwXi)}}else"strictly_ordered"===i.CosE?1!=i.bnfg&&i.Csks():i.Yjev(s)&&i.Csks()}}else if(p(s)&&s.qyAQ){s.Tiwg[s.ehHx.Aylq.rpCx]=Date.now();var y=i.QfBW[t-1];if(p(y))if(void 0===y.length||1==y.length){if(!y.qyAQ)return}else if(y.length>1&&!i.Yjev(y))return;var m=i.QfBW[t+1];if(p(m)){var x,A;if(null!=m&&null!==(x=m.ehHx)&&void 0!==x&&x._timeEnabled){if("session"!=(null===(A=m.ehHx)||void 0===A?void 0:A._time.unit)){var w,H,b=q(m.ehHx._time.unit,m.ehHx._time.value);if("didn't"==(null===(w=m.ehHx)||void 0===w?void 0:w.OPHn)){if(i.AfPH=setTimeout((function(){if(i.tqtJ)i.tqtJ=!1;else{if(i.tqtJ=!1,m.qyAQ=!0,m.qyAQ){m.jPoW+=1;var e=new J;if(m.qyAQ=e.eHRa(m.jPoW,m.ehHx.Ruyv,m.ehHx.NyLm),m.qyAQ){m.ehHx.cbVg=Date.now();var n=t+1,o=i.QfBW[n+1];p(o)?o.AXfg():i.Csks()}}r.unregisterFromEvent(E(m.ehHx.NIzW)+"___"+m.ehHx.Aylq.rpCx,i.UgQF),m.AzGT=!1}}),b),i._across_sessions){var C=q(m.ehHx._time.unit,m.ehHx._time.value),Q=m.ehHx._timeEnabled,W=m.ehHx._id,B=new J;B.CFWW(m.ehHx.OPHn,m.ehHx.Aylq.rpCx,Date.now(),m.ehHx.Aylq.tarQ,C,Q,W)}"specific_event"===m.ehHx._eventCategory?(r.registerForEvent(E(m.ehHx.NIzW)+"___"+m.ehHx.Aylq.rpCx,i.UgQF),i.YTaA=m):i.NPJe(m)}else if("did"==(null===(H=m.ehHx)||void 0===H?void 0:H.OPHn)&&(i.tqtJ=!1,i.ZuJR=m,p(i.QfBW[t+2])&&i._across_sessions&&(i.NUcf=i.QfBW[t+2]),i.qaPg=setTimeout((function(){i.tqtJ?i.tqtJ=!1:(i.tqtJ=!1,r.unregisterFromEvent(E(m.ehHx.NIzW)+"___"+m.ehHx.Aylq.rpCx,i.vNcG))}),b),i.WRdX=s,i.timeForKPI=b,r.registerForEvent(E(m.ehHx.NIzW)+"___"+m.ehHx.Aylq.rpCx,i.vNcG),i.xlCr=m,i._across_sessions)){var S=q(m.ehHx._time.unit,m.ehHx._time.value),D=m.ehHx._timeEnabled,I=m.ehHx._id,N=new J;N.CFWW(m.ehHx.OPHn,m.ehHx.Aylq.rpCx,Date.now(),m.ehHx.Aylq.tarQ,S,D,I)}}}else if(m.length>0)if("ordered"===m.sequence_type||"strictly_ordered"===m.sequence_type)m[0].AXfg(n+1);else{var R,F=d(m);try{for(F.s();!(R=F.n()).done;){var P=R.value;P.AXfg()}}catch(e){F.e(e)}finally{F.f()}}else m.AXfg();if("strictly_ordered"===i.CosE){i._currentEventname=s.ehHx.Aylq.rpCx;var T=e.getController();T.registerForEvent("APP_EVENT",i.MwXi),T.registerForEvent("CLIENT_EVENT",i.MwXi)}}else"strictly_ordered"===i.CosE?1!=i.bnfg&&i.Csks():i.Csks()}}else i.DyHS(),i.Csks()}})),s(this,"MwXi",(function(e){e&&e.name!=i._currentEventname&&(i.bnfg=!0)})),s(this,"NPJe",(function(e){var t=new he,n=e.ehHx._eventCategory;"apxor_event"===n?t.registerForEvent("apxor_event",i.UgQF):"customer_event"===n?t.registerForEvent("customer_event",i.UgQF):"any_event"===n?t.registerForEvent("any_event",i.UgQF):"campaign_event"===n?t.registerForEvent("campaign_event",i.UgQF):"survey_event"===n&&t.registerForEvent("survey_event",i.UgQF)})),s(this,"mNlm",(function(e){var t=new he,n=e.ehHx._eventCategory;"apxor_event"===n?t.unregisterFromEvent("apxor_event",i.UgQF):"customer_event"===n?t.unregisterFromEvent("customer_event",i.UgQF):"any_event"===n?t.unregisterFromEvent("any_event",i.UgQF):"campaign_event"===n?t.unregisterFromEvent("campaign_event",i.UgQF):"survey_event"===n&&t.unregisterFromEvent("survey_event",i.UgQF)})),s(this,"UgQF",(function(){var e,t;i.AfPH&&(i.tqtJ=!1,clearTimeout(i.AfPH));var n=new he;i.tqtJ=!0,i._across_sessions&&null!==localStorage.getItem("apx_nokpi_triggerdetails")&&localStorage.removeItem("apx_nokpi_triggerdetails"),n.unregisterFromEvent(E(null===(e=i.YTaA)||void 0===e||null===(e=e.ehHx)||void 0===e?void 0:e.NIzW)+"___"+(null===(t=i.YTaA)||void 0===t||null===(t=t.ehHx)||void 0===t||null===(t=t.Aylq)||void 0===t?void 0:t.rpCx),i.UgQF)})),s(this,"vNcG",(function(){var t,n,r,o=new he;i.tqtJ=!0,i.qaPg&&clearTimeout(i.qaPg);var a=new J;if(i.ZuJR.jPoW+=1,i.ZuJR.qyAQ=a.eHRa(i.ZuJR.jPoW,i.ZuJR.ehHx.Ruyv,i.ZuJR.ehHx.NyLm),o.unregisterFromEvent(E(null===(t=i.xlCr)||void 0===t||null===(t=t.ehHx)||void 0===t?void 0:t.NIzW)+"___"+(null===(n=i.xlCr)||void 0===n||null===(n=n.ehHx)||void 0===n?void 0:n.Aylq.rpCx),i.vNcG),i._across_sessions&&null!==(r=i.NUcf)&&void 0!==r&&r.ehHx._timeBased){var s,l,u,v=e.getController().getFromStorage("apx_nokpi_triggerdetails");v=null==v?[]:JSON.parse(v);for(var c=0;c<v.length;c++)if(i.no_KPI_TriggerDetails[c].id===i.NUcf.ehHx._id){s=!0,l=v[c];break}if(s)l.satisfiedCount+=1;else{var d=i.ZuJR.ehHx._id,f=i.ZuJR.ehHx.OPHn,g=i.ZuJR.ehHx.Aylq.rpCx,h=i.ZuJR.ehHx.Aylq.tarQ;u={id:d,type:f,time:Date.now(),name:g,additionalInfo:h,satisfiedCount:i.ZuJR.ehHx._timeEnabled,timeBased:i.ZuJR.ehHx._timeEnabled},i.no_KPI_TriggerDetails.push(u)}}if(i.ZuJR.qyAQ){var _=i.QfBW[i.kpiIndex+1];p(_)?_.AXfg():i.Csks()}})),s(this,"sGIM",(function(){if(i.VDGB===i.QfBW.length-1){i.vPed=!0;i.QfBW[i.VDGB]&&(i.QfBW[i.VDGB].jPoW=i.FAwt.satisfiedCount,i.QfBW[i.VDGB].qyAQ=!0,i.Csks())}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.VDGB){n=!0,t=r[o];break}if(n&&(t.satisfiedCount=1),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(r)),i.QfBW[i.VDGB].jPoW=i.FAwt.satisfiedCount,i.QfBW[i.VDGB].qyAQ=!0,i.QfBW[i.VDGB+1].ehHx._timeEnabled){var a=q(i.QfBW[i.VDGB+1].ehHx._time.unit,i.QfBW[i.VDGB+1].ehHx._time.value),s=i.QfBW[i.VDGB+1].ehHx._timeEnabled,l=i.QfBW[i.VDGB+1].ehHx._id,u=i.QfBW[i.VDGB+1].jPoW,v=i.QfBW[i.VDGB+1].ehHx.Aylq.rpCx,c=i.QfBW[i.VDGB+1].Aylq.tarQ;(new J).CFWW(i.ehHx.OPHn,v,Date.now(),c,a,s,l,u)}}})),s(this,"DyHS",(function(){if(i._across_sessions&&i.XyBT){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=d(s);try{var v=function(){var e=l.value,s=e.id,u=e.satisfiedCount;if(t=i.QfBW.find((function(e,t){if(1===(null==e?void 0:e.length)||void 0===(null==e?void 0:e.length)){if(e.ehHx._id===s)return o="single",n=t,!0}else if(e.length>0){var i=e.findIndex((function(e){return e.ehHx._id===s}));if(-1!==i)return n=t,r=i,o="group",!0}return!1})),"single"===o&&t){var v=new J;a=v.eHRa(u,t.ehHx.Ruyv,t.ehHx.NyLm);var c=i.QfBW.findIndex((function(e){var t;return(null==e||null===(t=e.ehHx)||void 0===t?void 0:t._id)===s}));void 0===c&&(c=n),a&&(i.QfBW[c].qyAQ=!0)}else if("group"===o&&t){var d=new J;(a=d.eHRa(u,t[r].ehHx.Ruyv,t[r].ehHx.NyLm))&&(i.QfBW[n][r].qyAQ=!0)}};for(u.s();!(l=u.n()).done;)v()}catch(e){u.e(e)}finally{u.f()}}}})),s(this,"VruW",(function(e){e<0||i.LaLj()})),s(this,"Csks",(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.UMRB)&&e.getController().isBadgeTriggerSatisfied(i.UMRB)||null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===i.EgcZ.OPHn?"survey":"campaign",apx_nudge_id:i.UMRB,apx_nudge_name:i.EgcZ.rpCx,apx_variant_code:i.EgcZ._isExperiment||i.EgcZ._only_context?i.EgcZ._attr.apx_variant_code:"TG"}),!(i.Aveo.validate()&&i.LpAl.validate(a,s)&&i.EHDG.validate()&&i.rNEC.validate())){i.EgcZ.OPHn;return i.EHDG.retainedDaysValidated?i.EHDG.retainedSessionValidated?i.EHDG.eventDoneInLT?void i.agaL("Event done in life time"):i.LpAl.userAttributesValidated?i.LpAl.sessionAttributeValidated?i.Aveo._not_in_specified_time?void i.agaL("Time limits check failed"):i.Aveo._not_yet_active?void i.agaL("not in the scheduled time"):i.Aveo._nudge_expired?void i.agaL("nudge expired"):void 0:void i.agaL("Session property filter not met"):void i.agaL("User property filter not met"):void i.agaL("User session criteria not met"):void i.agaL("Retained day criteria not met")}var l=i.QfBW.length,u=l<1,v="";0===l&&(u=!0);for(var c=0;c<l;c++){var f=void 0,g=i.QfBW[c];if(g.length>1){var h=g[0].ehHx.unUI;f="AND"===h;for(var _=0;_<g.length;_++){var p=g[0].ehHx.unUI;f="AND"===p?f&&g[_].qyAQ:f||g[_].qyAQ}}else f=g.qyAQ;if(""===v.trim())u=f;else switch(v){case"AND":u=u&&f;break;case"OR":u=u||f}v=g.length>1?i.groupCombineOperator:g.unUI}if(!0===o&&(u=!0),u){var y,m;if(console.debug("onCondition satisfied"),!i.tWsf.QkgO(i.UMRB))return void console.warn("Maximum limit reached",i.UMRB);if(!(null!==(y=window.ApxorRTM)&&void 0!==y&&y.isBadgePresent&&null!==(m=window.ApxorRTM)&&void 0!==m&&m.badgesLists.includes(i.UMRB)&&e.getController().isBadgeTriggerSatisfied(i.UMRB))){var x="SURVEY"===i.EgcZ.OPHn?"survey":"campaign";null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===i.EgcZ.OPHn?"survey":"campaign",apx_nudge_id:i.UMRB,apx_nudge_name:i.EgcZ.rpCx,apx_variant_code:i.EgcZ._isExperiment||i.EgcZ._only_context?i.EgcZ._attr.apx_variant_code:"TG"},!1,"",x)}i._across_sessions&&localStorage.removeItem("apx_nokpi_triggerdetails");var A,E=d(i.QfBW);try{for(E.s();!(A=E.n()).done;){var w=A.value;if(1===(null==w?void 0:w.length)||void 0===(null==w?void 0:w.length))w.qyAQ=!1,w.jPoW=0;else{var H,b=d(w);try{for(b.s();!(H=b.n()).done;){var C=H.value;C.qyAQ=!1,C.jPoW=0}}catch(e){b.e(e)}finally{b.f()}}}}catch(e){E.e(e)}finally{E.f()}if(i.jsmS.ognp(i.QfBW),i.QfBW=[],i.aEWV(i.FWVg,i.jfEs),!0===i.EgcZ._only_context){var Q="SURVEY"===i.EgcZ.OPHn?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.EgcZ._attr),{},{message_name:i.EgcZ.rpCx,id:i.UMRB}),!1,"",Q)}e.getController().dispatchEvent(i.EgcZ.OPHn,{name:i.EgcZ.OPHn,additional_info:{uuid:i.UMRB,name:i.EgcZ.rpCx}})}})),s(this,"LaLj",(function(){for(var t=i.sWqU.length,r=t<1,o="",a=0;a<t;a++){var s=i.sWqU[a],l=s.qyAQ;if(""===o.trim())r=l;else switch(o){case"AND":r=r&&l;break;case"OR":r=r||l}o=s.obcq}if(r){if(e.getController().persistTerminationInfoLocally(i.UMRB),!0===i.EgcZ._only_context){var u="SURVEY"===i.EgcZ.OPHn?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.EgcZ._attr),{},{message_name:i.EgcZ.rpCx,id:i.UMRB}),!1,"apxor",u)}e.getController().dispatchEvent(i.EgcZ.OPHn,{name:i.EgcZ.OPHn,additional_info:{uuid:i.UMRB,name:i.EgcZ.rpCx}})}})),s(this,"validateForTerminationAttributes",(function(){var t=e.getController().getUserAttributes(),n=e.getController().getSessionAttributes();return i.lDOg.validate(t,n)})),s(this,"AkJS",(function(){i.tWsf.AkJS()})),s(this,"getFrequencyCount",(function(){return i.tWsf.getFrequencyCount()})),s(this,"KIlN",(function(){return i.tWsf.sPjS()})),s(this,"Yjev",(function(e){var t;t="AND"===e[0].ehHx.unUI;for(var n=0;n<e.length;n++){t="AND"===e[0].ehHx.unUI?t&&e[n].qyAQ:t||e[n].qyAQ}return t})),s(this,"agaL",(function(t){var n;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.EgcZ.OPHn?"survey":"campaign",apx_nudge_id:i.UMRB,apx_nudge_name:i.EgcZ.rpCx,apx_variant_code:i.EgcZ._isExperiment||i.EgcZ._only_context?null===(n=i.EgcZ._attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),ce=a((function e(){var t=this;r(this,e),s(this,"SIio",{}),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(p(e)&&p(e.configs)){var n=e.configs;if(!Array.isArray(n))return;n.sort((function(e,t){var n,i;return(null!==(n=e.prio)&&void 0!==n?n:-1)-(null!==(i=t.prio)&&void 0!==i?i:-1)}));for(var i=0;i<n.length;i++){var r=n[i],o=r._id,a=new ve;a.parse(r)?t.SIio[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.SIio[e]){var r=t.SIio[e];r.ndZk(n,i)}})),s(this,"getVariantCode",(function(e){return t.SIio[e]?t.SIio[e]._variant_code:""})),s(this,"validateForTermination",(function(e,n){t.SIio[e]&&t.SIio[e].VruW(n)})),s(this,"validateForTerminationAttributes",(function(e){return!!t.SIio[e]&&t.SIio[e].validateForTerminationAttributes()})),s(this,"AkJS",(function(e){t.SIio[e].AkJS()})),s(this,"getFrequencyCount",(function(e){var n=t.SIio[e];if(null!=n)return n.getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var e=t.SIio;for(var n in e)e[n].KIlN()})),s(this,"KsSW",(function(e){try{if(t.SIio){var n=t.SIio[e];if(n&&n.EgcZ)return n.EgcZ}}catch(e){console.log("Error in getting the campaign meta ".concat(e))}return{}}))})),de=window.ApxorLogger,fe=a((function t(){var n=this;r(this,t),s(this,"uWAV",{}),s(this,"jgbV",[]),s(this,"EnQZ",!1),s(this,"initialize",(function(){var t=e.getController();t.registerForEvent("APP_EVENT",(function(e){return n.PnHj(e,"AE")})),t.registerForEvent("CLIENT_EVENT",(function(e){return n.PnHj(e,"CE")}))})),s(this,"KMED",(function(){for(var e in n.jgbV)n.oofL(e.event,e.key,e.type);n.EnQZ=!0})),s(this,"HMQn",(function(e,t){var i;"function"==typeof t&&((i=n.uWAV[e]?n.uWAV[e]:[]).push(t),n.uWAV[e]=i,de.debug("Listeners list: ",n.uWAV))})),s(this,"unregisterFromEvent",(function(e,t){if(n.uWAV[e]){for(var i=n.uWAV[e],r=[],o=0;o<i.length;o++){var a=i[o];a!==t&&r.push(a)}n.uWAV[e]=r}})),s(this,"PnHj",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE";n.oofL(e,"any_event",t),"apxor"===(null==e?void 0:e.loggedBy)?n.oofL(e,"apxor_event",t):"customer"===(null==e?void 0:e.loggedBy)&&n.oofL(e,"customer_event",t),"campaign"===(null==e?void 0:e.apx_nudge_type)?n.oofL(e,"campaign_event",t):"survey"===(null==e?void 0:e.apx_nudge_type)&&n.oofL(e,"survey_event",t);var i=t+"___"+e.name;n.oofL(e,i,t)})),s(this,"oofL",(function(t,i,r){if(n.EnQZ){if(de.debug("Notifying listeners for event: "+t+", "+i,n.uWAV),n.uWAV[i])for(var o=n.uWAV[i],a=e.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(r,t.name,a,t.additional_info)}}else n.jgbV.push({event:t,key:i,type:r})}))})),ge=window.ApxorLogger,he=function(){function t(){var n=this;return r(this,t),s(this,"xkuX",!1),s(this,"BYqI",null),s(this,"dVod",C()),s(this,"lZeb",new fe),s(this,"lWJF",e.getSiteId()),s(this,"vRXU",{}),s(this,"getQeState",(function(){try{var t=e.getController().getFromStorage("qe_state");return t?JSON.parse(x(n.lWJF,t)):(n.vRXU={},n.setQeState())}catch(e){return n.vRXU={},n.setQeState()}})),s(this,"setQeState",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{e.getController().persistToStorage("qe_state",n.vRXU,!0)}catch(i){""===t?n.vRXU={}:n.vRXU[t]={SESSION:0,OVERALL:0,DATES:{}},e.getController().persistToStorage("qe_state",n.vRXU,!0)}return n.vRXU})),s(this,"initialize",(function(){n.xkuX||(n.xkuX=!0,n.BYqI=new ce,n.lZeb.initialize(),n.vRXU=n.getQeState(),ge.info("QE Initialized.."))})),s(this,"parse",(function(e){n.Pccw()?(n.BYqI.parse(e),n.lZeb.KMED()):ge.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;n.Pccw()&&n.BYqI.validate(e,t,i)})),s(this,"getVariantCode",(function(e){return n.BYqI.getVariantCode(e)})),s(this,"validateForTermination",(function(e,t){n.Pccw()&&n.BYqI.validateForTermination(e,t)})),s(this,"validateForTerminationAttributes",(function(e,t){return n.BYqI.validateForTerminationAttributes(e,t)})),s(this,"updateCount",(function(e){try{p(n.vRXU[e])||n.createObjConfig(e),n.incrementFrequencies(e),n.setQeState(e),n.BYqI.AkJS(e)}catch(e){console.log("Could not update the count config:".concat(e))}})),s(this,"resetFrequencyCounts",(function(){n.BYqI.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(e){return n.BYqI.getFrequencyCount(e)})),s(this,"registerForEvent",(function(e,t){n.lZeb.HMQn(e,t)})),s(this,"unregisterFromEvent",(function(e,t){n.lZeb.unregisterFromEvent(e,t)})),s(this,"notifyEventListener",(function(e){n.lZeb.PnHj(e)})),s(this,"fetch",(function(t,n,i,r){e.getController().fetchConfiguration(t,n,i,r)})),s(this,"Pccw",(function(){return n.xkuX})),s(this,"getCampaignMetaFromQueryEngine",(function(e){return n.BYqI.KsSW(e)})),s(this,"KgiV",(function(){return n.dVod})),t.instance||(t.instance=this),t.instance}return a(t,[{key:"createObjConfig",value:function(e){try{this.vRXU=this.getQeState(),p(this.vRXU[e])||(this.vRXU[e]={SESSION:0,OVERALL:0,DATES:{}},this.dVod&&(this.vRXU[e].DATES[this.dVod]=0),this.setQeState(e))}catch(e){ge.error("Can not create the frequency count object:"+e)}}},{key:"incrementFrequencies",value:function(e){this.vRXU=this.getQeState();var t=this.vRXU[e];t.SESSION=t.SESSION+1,t.OVERALL=t.OVERALL+1;var n=C();n===this.dVod&&t.DATES&&t.DATES[n]||(this.dVod=n,t.DATES={},t.DATES[this.dVod]=0),t.DATES[this.dVod]=t.DATES[this.dVod]+1}}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}}]),t}();s(he,"instance",void 0),window.ceVersion=201;try{void 0===exports&&null===exports||(exports.default=he,module.exports=exports.default)}catch(e){}return he}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apxor-qe",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"author": "Ravi Teja Akella <ravi.akella@apxor.com> (https://www.apxor.com)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"jsdom": "^22.1.0",
|
|
70
|
-
"apxor": "
|
|
70
|
+
"apxor": "3.0.1"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|
|
73
73
|
"pnpm": ">=8",
|