apxor-qe 1.7.0 → 2.0.0
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 +25 -5
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 p=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))},g=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)},w=function(){var t=new Date;return t.getDate()+"/"+t.getMonth()+"/"+t.getFullYear()},x=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 E(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(F(o)){return function(t){return C(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."),b(r,i,t,e)):(d.info("Element with selector:".concat(t," not found.")),!1)}function b(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(F()){C()}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=N(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},N=function(t){var e=t.indexOf("svg");-1!==e&&(t=t.substring(0,e)+"svg:svg");try{return document.oDyD(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 F(t){try{var e=t.getBoundingClientRect();if(0===e.width||0===e.height)return!1}catch(t){return!1}return!0}function C(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 S=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)},D=window.ApxorLogger,M=a((function e(){var n=this;r(this,e),s(this,"vQHr","ALL"),s(this,"EkUf",[]),s(this,"NGJy",[]),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.vQHr=t.audience.audience_type,n.EkUf=t.audience.attributes.user,n.NGJy=t.audience.attributes.session,!Array.isArray(n.EkUf)||!Array.isArray(n.NGJy))return D.error("No attributes"),!1}catch(t){return D.error(t),!1}return!0})),s(this,"validate",(function(e,i){var r=!0;"FTU"===n.vQHr&&(r=t.getController().getSessionInfo().is_first_session);var o=n.mewV(e,n.EkUf),a=n.mewV(i,n.NGJy);return o||(n.userAttributesValidated=!1),a||(n.sessionAttributeValidated=!1),r&&o&&a})),s(this,"mewV",(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){D.error(t),i=!1}return i}))})),k=window.ApxorLogger,L=a((function e(){var n=this;r(this,e),s(this,"zsDa",0),s(this,"Zbae",0),s(this,"pZvl","SESSION"),s(this,"EOKT",0),s(this,"ICpH",0),s(this,"VzBo",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{n.AoNu=t._id,n.jphx=t.meta,n.zsDa=t.frequency.count,-1===n.zsDa&&(n.zsDa=1e3),n.VzBo=n.zsDa,n.Zbae=t.frequency.time_interval,n.pZvl=t.frequency.validity,n.ICpH=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.pZvl){if(n.zsDa=parseInt(n.zsDa)-parseInt(e[t._id].SESSION),n.zsDa<=0)return n.zUZc("Session limit reached"),console.warn("Max count limit reached for session:"+t._id),!1}else{if("OVERALL"!==n.pZvl)return k.info("Invalid config."),!1;if(n.zsDa=parseInt(n.zsDa)-parseInt(e[t._id].OVERALL),n.zsDa<=0)return n.zUZc("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,"IwqI",(function(){n.zsDa=n.zsDa-1})),s(this,"getFrequencyCount",(function(){return n.zsDa})),s(this,"kPEn",(function(){"SESSION"===n.pZvl&&(n.zsDa=n.VzBo,k.info("Campaign Limit reset"))})),s(this,"mZDO",(function(t){try{if(n.zsDa<=0)return"OVERALL"===n.pZvl?n.zUZc("Overall limit reached"):"SESSION"===n.pZvl&&n.zUZc("Session limit reached"),!1;var e=rt.getInstance().getQeState();if(!v(e)||!v(e[t]))return!0;if(0!==n.ICpH)if(parseInt(n.ICpH)-parseInt(e[t].SESSION)<=0)return n.zUZc("Session limit reached"),!1;if(0!==n._dayCount){var i,r=w();if(parseInt(n._dayCount)-parseInt((null===(i=e[t])||void 0===i?void 0:i.DATES[r])||0)<=0)return n.zUZc("Day limit reached"),!1}}catch(t){n.zUZc("Error validating the frequency: ".concat(t)),k.error("Error validating the frequency:"+t)}return!0})),s(this,"zUZc",(function(e){var i;null==t||t.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.jphx.type?"survey":"campaign",apx_nudge_id:n.AoNu,apx_nudge_name:n.jphx.name,apx_variant_code:n.jphx.isExperiment||n.jphx.only_context?null===(i=n.jphx.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:e})}))})),W=a((function t(){var e=this;r(this,t),s(this,"gupk",""),s(this,"vQHr",""),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;e.gupk=t.meta.name,e.vQHr=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}))})),j=window.ApxorLogger,I=a((function t(){var e=this;r(this,t),s(this,"nrOa",-1),s(this,"qxkZ",-1),s(this,"FArj",-1),s(this,"olRt",-1),s(this,"VuyM",!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 j.error("Not valid dates"),!1;if(e.nrOa=Date.parse(t.validity.start_date),e.qxkZ=Date.parse(t.validity.end_date),v(t.at_specific_time)&&(e.VuyM=t.at_specific_time,e.VuyM&&v(t.time_limits))){var n=(new Date).toISOString().split("T")[0];if(e.FArj=Date.parse(n+"T"+t.time_limits.start_time+":00.000Z"),e.olRt=Date.parse(n+"T"+t.time_limits.end_time+":00.000Z"),isNaN(e.FArj)||isNaN(e.olRt))return j.error("Not valid times"),!1}}catch(t){return j.error(t),!1}return!0})),s(this,"validate",(function(){var t=Date.now();return t>e.nrOa&&t<e.qxkZ?(!e.VuyM||t>=e.FArj&&t<=e.olRt||(e._not_in_specified_time=!0),!e.VuyM||t>=e.FArj&&t<=e.olRt):(t<e.nrOa?e._not_yet_active=!0:t>e.qxkZ&&(e._nudge_expired=!0),!1)}))})),T=a((function t(){var e=this;r(this,t),s(this,"gupk",""),s(this,"KpkN",{}),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{e.gupk=t.name,e.KpkN=t.additional_info}catch(t){return!1}return!0}))})),O=a((function t(){var e=this;r(this,t),s(this,"yKaM",0),s(this,"vQpB",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.yKaM=Number(t.lower),e.vQpB=Number(t.upper),isNaN(e.yKaM)||isNaN(e.vQpB))return!1}catch(t){return!1}return!0}))})),z=a((function t(){var e=this;r(this,t),s(this,"OEsw",0),s(this,"WbUx",""),s(this,"OetQ",""),s(this,"CFvi",new T),s(this,"Wgfq",new O),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.WbUx=t.event_type,e.OetQ=t.activity,e.CFvi.parse(t.details)&&e.Wgfq.parse(t.time_bounds)}catch(t){return!1}}))})),U=window.ApxorLogger,q=a((function t(){var e=this;r(this,t),s(this,"OEsw",0),s(this,"BjRo",-1),s(this,"zsDa",0),s(this,"MswC",""),s(this,"OetQ",""),s(this,"WbUx",""),s(this,"Wgfq",new O),s(this,"CFvi",new T),s(this,"HNyi",new z),s(this,"FFrw","AND"),s(this,"WPkH",!1),s(this,"vQHr",void 0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.BjRo=t.sequence,e.zsDa=t.count_config.count,e.MswC=t.count_config.operator,e.OetQ=t.activity,e.WbUx=t.event_type,e.FFrw=t.combine_operator,e.vQHr=t.type,e.CFvi.parse(t.details)&&e.HNyi.parse(t.trigger)&&e.Wgfq.parse(t.time_bounds)}catch(t){return U.error(t),!1}}))})),Q=window.ApxorLogger,V=a((function t(){var e=this;r(this,t),s(this,"zsDa",0),s(this,"MswC",""),s(this,"WbUx",""),s(this,"Wgfq",new O),s(this,"CFvi",new T),s(this,"FFrw","AND"),s(this,"parse",(function(t){try{return e.zsDa=t.count_config.count,e.MswC=t.count_config.operator,e.WbUx=t.event_type,e.FFrw=t.combine_operator,e.CFvi.parse(t.details)&&e.Wgfq.parse(t.time_bounds)}catch(t){return Q.error(t),!1}}))})),B=window.ApxorLogger,R=function(){function e(){var n=this;r(this,e),s(this,"pNtt",0),s(this,"AoNu",""),s(this,"iMyo",new q),s(this,"DyWf",new V),s(this,"KdMS",!1),s(this,"fhfE",!1),s(this,"rcqQ",0),s(this,"FFrw","AND"),s(this,"eaiu","OR"),s(this,"LVWF",-1),s(this,"bwYu",[]),s(this,"yutB",{}),s(this,"PhyY",!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.AoNu=i,n.rcqQ=r,n.bwYu=a,"termination"===s&&""!==s){n.DyWf.parse(e);return n.eaiu=n.DyWf.FFrw,n.LxhK(),!0}var u=n.iMyo.parse(e);if(u){if(n.FFrw=n.iMyo.FFrw,n.iMyo.WPkH){var l=n.iMyo.CFvi.gupk;"APX_PAGE_OPENED"===l&&(l=n.iMyo.CFvi.KpkN.navigation_id,l=v(l)?l:n.iMyo.CFvi.gupk),n.LVWF=t.getController().getEventCount(l);var c=n.iMyo.zsDa,d=n.iMyo.MswC;if(n.fhfE=n.MLKC(n.LVWF-1,c,d,!1),n.KdMS=n.fhfE,n.fhfE&&"APX_PAGE_OPENED"===n.iMyo.CFvi.gupk)return!0}return o&&0!==r||n.YsUo(),!0}return!1})),s(this,"YsUo",(function(){var t,e=n.iMyo,i=e.HNyi,r=rt.getInstance();"app_start"===i.WbUx?(n.KdMS=!0,r.registerForEvent(g(e.WbUx)+"___"+e.CFvi.gupk,n.hHrw)):r.registerForEvent(g(e.WbUx)+"___"+i.CFvi.gupk,n.hHrw),null!==(t=window.ApxorRTM)&&void 0!==t&&t.badgesLists.includes(n.AoNu)&&r.registerForEvent(g(e.WbUx)+"___"+"apxor-badge-container-".concat("-".concat(n.AoNu).replaceAll(" ","").replace(/[^\w\s]/gi,"")),n.hHrw)})),s(this,"LxhK",(function(){var t=n.DyWf,e=rt.getInstance();n.KdMS=!0,e.registerForEvent(g(t.WbUx)+"___"+t.CFvi.gupk,n.genu)})),s(this,"IrBm",(function(t,e,i,r){var o,a=(Date.now()-n.yutB[e])/1e3;(null===(o=n.iMyo)||void 0===o||null===(o=o.CFvi)||void 0===o||null===(o=o.KpkN)||void 0===o?void 0:o.time)/1e3>a&&n._displayCampaign(i)})),s(this,"yYUn",(function(t,e,i,r){var o,a;n.PhyY=!0;var s=Date.now(),u=null===(o=n.iMyo)||void 0===o||null===(o=o.HNyi)||void 0===o?void 0:o.CFvi.gupk,l=(s-n.yutB[u])/1e3,c=null===(a=n.iMyo)||void 0===a||null===(a=a.CFvi)||void 0===a||null===(a=a.KpkN)||void 0===a?void 0:a.time;(c/=1e3)>l&&n._displayCampaign(i)})),s(this,"hHrw",(function(e,i,r,o){var a,s,u=rt.getInstance();if(n.KdMS){if(null!==(a=window.ApxorRTM)&&void 0!==a&&a.isBadgePresent&&null!==(s=window.ApxorRTM)&&void 0!==s&&s.badgesLists.includes(n.AoNu)&&t.getController().isBadgeTriggerSatisfied(n.AoNu))return n.fhfE=!0,n.iMyo.OEsw=r,void u.validate(n.AoNu,n.rcqQ);g(n.iMyo.WbUx)===e&&n.mail(r-n.iMyo.HNyi.OEsw,n.iMyo.Wgfq)&&n.iMyo.CFvi.gupk===i&&n.lIBK(n.iMyo.CFvi.KpkN,o)&&(n.pNtt+=1,n.fhfE=n.MLKC(n.pNtt,n.iMyo.zsDa,n.iMyo.MswC),n.fhfE&&(n.iMyo.OEsw=r,u.validate(n.AoNu,n.rcqQ)))}else if(n.KdMS=n.LkpV(e,i,r,o),n.KdMS){var l=n.iMyo,c=l.HNyi;if(c.OEsw=r,"activity_time"===(null==l?void 0:l.WbUx)){var d,v,f,h=null==l||null===(d=l.CFvi)||void 0===d||null===(d=d.KpkN)||void 0===d?void 0:d.time;(null==l||null===(v=l.CFvi)||void 0===v||null===(v=v.KpkN)||void 0===v?void 0:v.nkpi.length)>0&&(setTimeout((function(){n.PhyY||(n.fhfE=!0,n.fhfE&&(n.pNtt+=1,n.fhfE=n.MLKC(n.pNtt,n.iMyo.zsDa,n.iMyo.MswC),n.fhfE&&(n.iMyo.OEsw=r,u.validate(n.AoNu,n.rcqQ)))),l.CFvi.KpkN.nkpi.map((function(t){u.unregisterFromEvent(y(l.CFvi.KpkN.et)+"___"+t,n)}))}),h),l.CFvi.KpkN.nkpi.map((function(t){u.registerForEvent(y(l.CFvi.KpkN.et)+"___"+t,n.yYUn)}))),(null==l||null===(f=l.CFvi)||void 0===f||null===(f=f.KpkN)||void 0===f?void 0:f.kpi.length)>0&&(setTimeout((function(){l.CFvi.KpkN.kpi.map((function(t){u.unregisterFromEvent(y(l.CFvi.KpkN.et)+"___"+t,n)}))}),h),l.CFvi.KpkN.kpi.map((function(t){t===l.HNyi.CFvi.gupk?(u.unregisterFromEvent(g(c.WbUx)+"___"+c.CFvi.gupk,n),u.registerForEvent(y(l.CFvi.KpkN.et)+"___"+t,n.IrBm)):u.registerForEvent(y(l.CFvi.KpkN.et)+"___"+t,n.yYUn)})))}else u.unregisterFromEvent(g(c.WbUx)+"___"+c.CFvi.gupk,n),u.registerForEvent(g(l.WbUx)+"___"+l.CFvi.gupk,n);n.yutB[i]=Date.now()}})),s(this,"genu",(function(t,e,i,r){var o=rt.getInstance();g(n.DyWf.WbUx)===t&&n.mail(i,n.DyWf.Wgfq)&&n.DyWf.CFvi.gupk===e&&n.lIBK(n.DyWf.CFvi.KpkN,r)&&(n.pNtt+=1,n.fhfE=n.MLKC(n.pNtt,n.DyWf.zsDa,n.DyWf.MswC),n.fhfE&&(n.DyWf.OEsw=i,o.validateForTermination(n.AoNu,n.rcqQ)))})),s(this,"LkpV",(function(t,e,i,r){var o=n.iMyo.HNyi;return g(o.WbUx)===t&&o.CFvi.gupk===e&&n.mail(i,o.Wgfq)&&n.lIBK(o.CFvi.KpkN,r)})),s(this,"mail",(function(t,e){var n=Math.ceil(t);return n>e.yKaM&&n<e.vQpB})),s(this,"MLKC",(function(t,e,i){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(r&&n.iMyo.WPkH&&(t+=n.LVWF),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,"lIBK",(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){B.error(t),n=!1}return n}))}return a(e,[{key:"_displayCampaign",value:function(t){var e=rt.getInstance();this.fhfE=!0,this.fhfE&&(this.pNtt+=1,this.fhfE=this.MLKC(this.pNtt,this.iMyo.zsDa,this.iMyo.MswC),this.fhfE&&(this.iMyo.OEsw=t,e.validate(this.AoNu,this.rcqQ)))}}]),e}(),H=window.ApxorLogger,Z=a((function e(){var n=this;r(this,e),s(this,"QZJr",[]),s(this,"_ret_day",{}),s(this,"iruA",{}),s(this,"cSvr",!1),s(this,"KIXo",!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.QZJr=t.overall_cfg.events,n._ret_day=t.overall_cfg.ret_day,n.iruA=t.overall_cfg.session,n.cSvr=t.overall_cfg.toggleRetDay,n.KIXo=t.overall_cfg.toggleSession}catch(t){return H.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.cSvr&&!isNaN(e)&&!(e>=n._ret_day.from&&e<=n._ret_day.to))return n.retainedDaysValidated=!1,!1;if(n.KIXo&&!isNaN(i)&&!(i>=n.iruA.from&&i<=n.iruA.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}(p(o,r)))),s=0;s<n.QZJr.length;s++){if(a[n.QZJr[s].name.replace("'","").replace("’","")])return n.eventDoneInLT=!0,!1}}catch(t){H.error("Failed to validate the lt count:"+t)}return!0}))})),K=window.ApxorLogger,P=a((function t(){var e=this;r(this,t),s(this,"EkUf",[]),s(this,"NGJy",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.EkUf=t.attributes.user,e.NGJy=t.attributes.session,!Array.isArray(e.EkUf)||!Array.isArray(e.NGJy))return K.error("No attributes"),!1}catch(t){return K.error(t),!1}return!0})),s(this,"validate",(function(t,n){return e.mewV(t,e.EkUf)&&e.mewV(n,e.NGJy)})),s(this,"mewV",(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){K.error(t),i=!1}return i}))})),G=a((function e(){var n=this;r(this,e),s(this,"NFlA",t.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"Ndvf",1),s(this,"parse",(function(t){try{var e,i,r;if(n.vQHr=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.Ndvf=null===(r=t.terminate_info.time_based)||void 0===r?void 0:r.days,n.rCJW(t._id))return n.NFlA.persistTerminationInfoLocally(t._id),!1}catch(t){return!1}return!0})),s(this,"rCJW",(function(t){var e,i=JSON.parse(n.NFlA.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].FArj;return s===n.Ndvf&&u.hours>=l.hours||s>n.Ndvf||i[t].goalAcheived}))})),J=a((function t(){var e=this;r(this,t),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"pVMm",new P),s(this,"nZhZ",new G),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.nZhZ.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.pVMm.parse(t.terminate_info))return!1}catch(t){return window.ApxorLogger.error(t),!1}return!0})),s(this,"validate",(function(t,n){return e.pVMm.validate(t,n)}))})),Y=a((function t(){var e=this;r(this,t),s(this,"eEaP",""),s(this,"IEWp",""),s(this,"kMxy",""),s(this,"jAzF",""),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.eEaP=null==t?void 0:t.screen_binding,!e.eEaP||(e.IEWp=null==t?void 0:t.binding.url,e.kMxy=null==t?void 0:t.binding.var,e.jAzF=null==t?void 0:t.binding.operator,!0)}catch(t){return window.ApxorLogger.error(t),!1}})),s(this,"validate",(function(){var t=e.IEWp,n=e.kMxy,i=e.jAzF,r=window.location.href;return!e.eEaP||("EQ"===i?t.includes(n)?!!x(r,t,n,!1):r===t:"SW"===i?t.includes(n)?!!x(r,t,n,!0):!!r.startsWith(t):void 0)}))})),X=window.ApxorLogger,$=a((function e(){var i=this;r(this,e),s(this,"wRix",[]),s(this,"Gmqy",[]),s(this,"AoNu",""),s(this,"jphx",new W),s(this,"TYjL",new M),s(this,"pZvl",new I),s(this,"vQCW",new L),s(this,"iNsG",new Z),s(this,"puda",new J),s(this,"FDsA",new Y),s(this,"WoBx",!1),s(this,"LIOs",[]),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 X.error("No Id"),!1;if(!v(t.enabled)||!t.enabled)return X.error("Not enabled"),!1;if(!(i.jphx.parse(t)&&i.pZvl.parse(t)&&i.vQCW.parse(t)&&i.TYjL.parse(t)&&i.iNsG.parse(t)&&i.puda.parse(t)&&i.FDsA.parse(t)))return!1;if(i._variant_code=i.jphx._isExperiment||i.jphx._only_context?null===(e=i.jphx._attr)||void 0===e?void 0:e.apx_variant_code:"TG",!v(t.conditions)||!Array.isArray(t.conditions))return X.error("No valid conditions",t.conditions),!1;i.AoNu=t._id,i.WoBx=!!v(t.sequence_enabled)&&t.sequence_enabled,i.WoBx&&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.zThy()}),10);for(var a=function(){i.LIOs=[];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.LIOs=[].concat(u(i.LIOs),[r])}var o=new R;if(o.initialize(t,i.AoNu,s,i.WoBx,i.LIOs)){i.wRix.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===E(t.view_id,l,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,a)&&i.zThy(!0),window.addEventListener("navigate",(function(e){var n=null==t?void 0:t.url;window.location.href===n&&"view_visibility"===t.event_type&&!0===E(t.view_id,l,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,a)&&i.zThy(!0)}))}},s=0;s<r;s++)a();if(i.puda.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.AoNu,d,!0,[],"termination")&&i.Gmqy.push(f)}return i.wRix.length>0}catch(t){return X.error(t),!1}})),s(this,"oDyD",(function(t){if(!(t<0))if(i.WoBx){var e=i.wRix[t];if(v(e)&&e.fhfE){var n=i.wRix[t-1];if(v(n)&&!n.fhfE)return;var r=i.wRix[t+1];v(r)?r.YsUo():i.zThy()}}else i.zThy()})),s(this,"rdeg",(function(t){t<0||i.UkVP()})),s(this,"zThy",(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.AoNu)&&t.getController().isBadgeTriggerSatisfied(i.AoNu)||null==t||t.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===i.jphx.vQHr?"survey":"campaign",apx_nudge_id:i.AoNu,apx_nudge_name:i.jphx.gupk,apx_variant_code:i.jphx._isExperiment||i.jphx._only_context?i.jphx._attr.apx_variant_code:"TG"}),!(i.pZvl.validate()&&i.TYjL.validate(a,s)&&i.iNsG.validate()&&i.FDsA.validate()))return i.iNsG.retainedDaysValidated?i.iNsG.retainedSessionValidated?i.iNsG.eventDoneInLT?void i.zUZc("Event done in life time"):i.TYjL.userAttributesValidated?i.TYjL.sessionAttributeValidated?i.pZvl._not_in_specified_time?void i.zUZc("Time limits check failed"):i.pZvl._not_yet_active?void i.zUZc("not in the scheduled time"):i.pZvl._nudge_expired?void i.zUZc("nudge expired"):void 0:void i.zUZc("Session property filter not met"):void i.zUZc("User property filter not met"):void i.zUZc("User session criteria not met"):void i.zUZc("Retained day criteria not met");var u=i.wRix.length,l=u<1,c="";0===u&&(l=!0);for(var d=0;d<u;d++){var v=i.wRix[d],f=v.fhfE;if(""===c.trim())l=f;else switch(c){case"AND":l=l&&f;break;case"OR":l=l||f}c=v.FFrw}if(!0===o&&(l=!0),l){if(console.debug("onCondition satisfied"),!i.vQCW.mZDO(i.AoNu)){if(console.warn("Maximum limit reached",i.AoNu),t.getController().isTestDevice()){S("Maximum limit reached for campaign name ".concat(i.jphx.gupk));var h=document.getElementById("close-button"),p=function(){var t=document.getElementById("apx-container");null==t||t.remove()};null==h||h.addEventListener("click",p),window.setTimeout(p,2e4)}return}console.log("Dispatching event",i.jphx.vQHr),t.logEvent("apx_context_evaluated",n(n({apx_nudge_type:"SURVEY"===i.jphx.vQHr?"survey":"campaign",apx_nudge_id:i.AoNu,apx_nudge_name:i.jphx.gupk,apx_variant_code:i.jphx._isExperiment||i.jphx._only_context?i.jphx._attr.apx_variant_code:"TG"},i.jphx._attr),{},{message_name:i.jphx.gupk,id:i.AoNu})),t.getController().dispatchEvent(i.jphx.vQHr,{name:i.jphx.vQHr,additional_info:{uuid:i.AoNu,name:i.jphx.gupk}})}})),s(this,"UkVP",(function(){for(var e=i.Gmqy.length,r=e<1,o="",a=0;a<e;a++){var s=i.Gmqy[a],u=s.fhfE;if(""===o.trim())r=u;else switch(o){case"AND":r=r&&u;break;case"OR":r=r||u}o=s.eaiu}r&&(console.log("Dispatching event",i.jphx.vQHr),t.getController().persistTerminationInfoLocally(i.AoNu),!0===i.jphx._only_context&&t.logEvent("apx_context_evaluated",n(n({},i.jphx._attr),{},{message_name:i.jphx.gupk,id:i.AoNu})),t.getController().dispatchEvent(i.jphx.vQHr,{name:i.jphx.vQHr,additional_info:{uuid:i.AoNu,name:i.jphx.gupk}}))})),s(this,"validateForTerminationAttributes",(function(){var e=t.getController().getUserAttributes(),n=t.getController().getSessionAttributes();return i.puda.validate(e,n)})),s(this,"IwqI",(function(){i.vQCW.IwqI()})),s(this,"getFrequencyCount",(function(){return i.vQCW.getFrequencyCount()})),s(this,"HsUR",(function(){return i.vQCW.kPEn()})),s(this,"zUZc",(function(e){var n;null==t||t.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.jphx.vQHr?"survey":"campaign",apx_nudge_id:i.AoNu,apx_nudge_name:i.jphx.gupk,apx_variant_code:i.jphx._isExperiment||i.jphx._only_context?null===(n=i.jphx._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,"suWy",{}),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.suWy[o]=a:console.warn("Failed to parse cfg",o)}}})),s(this,"validate",(function(t,n){e.suWy[t]&&e.suWy[t].oDyD(n)})),s(this,"getVariantCode",(function(t){return e.suWy[t]?e.suWy[t]._variant_code:""})),s(this,"validateForTermination",(function(t,n){e.suWy[t]&&e.suWy[t].rdeg(n)})),s(this,"validateForTerminationAttributes",(function(t){return!!e.suWy[t]&&e.suWy[t].validateForTerminationAttributes()})),s(this,"IwqI",(function(t){e.suWy[t].IwqI()})),s(this,"getFrequencyCount",(function(t){var n=e.suWy[t];if(null!=n)return n.getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var t=e.suWy;for(var n in t)t[n].HsUR()})),s(this,"Bxsp",(function(t){try{if(e.suWy){var n=e.suWy[t];if(n&&n.jphx)return n.jphx}}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,"MTzy",{}),s(this,"SHsz",[]),s(this,"WFhi",!1),s(this,"initialize",(function(){var e=t.getController();e.registerForEvent("APP_EVENT",(function(t){return n.kJmP(t,"AE")})),e.registerForEvent("CLIENT_EVENT",(function(t){return n.kJmP(t,"CE")}))})),s(this,"XEHq",(function(){for(var t in n.SHsz)n.fxeJ(t.event,t.key,t.type);n.WFhi=!0})),s(this,"pUOV",(function(t,e){var i;"function"==typeof e&&((i=n.MTzy[t]?n.MTzy[t]:[]).push(e),n.MTzy[t]=i,et.debug("Listeners list: ",n.MTzy))})),s(this,"unregisterFromEvent",(function(t,e){if(n.MTzy[t]){for(var i=n.MTzy[t],r=[],o=0;o<i.length;o++){var a=i[o];a!==e&&r.push(a)}n.MTzy[t]=r}})),s(this,"kJmP",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE",i=e+"___"+t.name;n.fxeJ(t,i,e)})),s(this,"fxeJ",(function(e,i,r){if(n.WFhi){if(et.debug("Notifying listeners for event: "+e+", "+i,n.MTzy),n.MTzy[i])for(var o=n.MTzy[i],a=t.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(r,e.name,a,e.additional_info)}}else n.SHsz.push({event:e,key:i,type:r})}))})),it=window.ApxorLogger,rt=function(){function e(){var n=this;return r(this,e),s(this,"ELmN",!1),s(this,"MtjW",null),s(this,"tADd",w()),s(this,"oovS",new nt),s(this,"wPUv",t.getSiteId()),s(this,"oBpc",{}),s(this,"getQeState",(function(){try{var e=t.getController().getFromStorage("qe_state");return e?JSON.parse(p(n.wPUv,e)):(n.oBpc={},n.setQeState())}catch(t){return n.oBpc={},n.setQeState()}})),s(this,"setQeState",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{t.getController().persistToStorage("qe_state",n.oBpc,!0)}catch(i){""===e?n.oBpc={}:n.oBpc[e]={SESSION:0,OVERALL:0,DATES:{}},t.getController().persistToStorage("qe_state",n.oBpc,!0)}return n.oBpc})),s(this,"initialize",(function(){n.ELmN||(n.ELmN=!0,n.MtjW=new tt,n.oovS.initialize(),n.oBpc=n.getQeState(),it.info("QE Initialized.."))})),s(this,"parse",(function(t){n.cETX()?(n.MtjW.parse(t),n.oovS.XEHq()):it.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(t,e){n.cETX()&&n.MtjW.validate(t,e)})),s(this,"getVariantCode",(function(t){return n.MtjW.getVariantCode(t)})),s(this,"validateForTermination",(function(t,e){n.cETX()&&n.MtjW.validateForTermination(t,e)})),s(this,"validateForTerminationAttributes",(function(t,e){return n.MtjW.validateForTerminationAttributes(t,e)})),s(this,"updateCount",(function(t){try{v(n.oBpc[t])||n.createObjConfig(t),n.incrementFrequencies(t),n.setQeState(t),n.MtjW.IwqI(t)}catch(t){console.log("Could not update the count config:".concat(t))}})),s(this,"resetFrequencyCounts",(function(){n.MtjW.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(t){return n.MtjW.getFrequencyCount(t)})),s(this,"registerForEvent",(function(t,e){n.oovS.pUOV(t,e)})),s(this,"unregisterFromEvent",(function(t,e){n.oovS.unregisterFromEvent(t,e)})),s(this,"notifyEventListener",(function(t){n.oovS.kJmP(t)})),s(this,"fetch",(function(e,n,i,r){t.getController().fetchConfiguration(e,n,i,r)})),s(this,"cETX",(function(){return n.ELmN})),s(this,"getCampaignMetaFromQueryEngine",(function(t){return n.MtjW.Bxsp(t)})),s(this,"zjQc",(function(){return n.tADd})),e.instance||(e.instance=this),e.instance}return a(e,[{key:"createObjConfig",value:function(t){try{this.oBpc=this.getQeState(),v(this.oBpc[t])||(this.oBpc[t]={SESSION:0,OVERALL:0,DATES:{}},this.tADd&&(this.oBpc[t].DATES[this.tADd]=0),this.setQeState(t))}catch(t){it.error("Can not create the frequency count object:"+t)}}},{key:"incrementFrequencies",value:function(t){this.oBpc=this.getQeState();var e=this.oBpc[t];e.SESSION=e.SESSION+1,e.OVERALL=e.OVERALL+1;var n=w();n===this.tADd&&e.DATES&&e.DATES[n]||(this.tADd=n,e.DATES={},e.DATES[this.tADd]=0),e.DATES[this.tADd]=e.DATES[this.tADd]+1}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();s(rt,"instance",void 0),window.ceVersion=170;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 i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function i(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?t(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function n(e){return(n="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 i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h(n.key),n)}}function a(e,t,i){return t&&o(e.prototype,t),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,i){return(t=h(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,a,s=[],l=!0,u=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=i.return&&(a=i.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 d(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 d(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function c(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=v(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function h(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;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 f=window.ApxorLogger,m=function(e){return void 0===e},_=function(e){return null===e},g=function(e){return void 0!==e&&!_(e)},p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function y(e,t){return Array.from(t).map((function(t,i){return String.fromCharCode(t^function(e,t){return e.charCodeAt(Math.floor(t%e.length))}(e,i))})).join("")}var b=function(e,t){return y(e,t=function(e){var t,i,n,r,o,a,s=0,l=[];if(!e)return e;e+="";do{t=(a=p.indexOf(e.charAt(s++))<<18|p.indexOf(e.charAt(s++))<<12|(r=p.indexOf(e.charAt(s++)))<<6|(o=p.indexOf(e.charAt(s++))))>>16&255,i=a>>8&255,n=255&a,l.push(t),64!==r&&(l.push(i),64!==o&&l.push(n))}while(s<e.length);return l}(t))},E=function(e){return g(e)&&!_(e)&&!isNaN(e)},S=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"},q=function(e){return e.toUpperCase()},x=function(e,t,i){switch(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;case"NEQ":return e!==t;case"R":return w(t).test(e);default:return!1}},w=function(e){var t=e.replace(/.*\/([gimuy]*)$/,"$1");t===e&&(t="");var i=t?e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1"):e;return new RegExp(i,t)},T=function(){var e=new Date;return e.getDate()+"/"+e.getMonth()+"/"+e.getFullYear()},A=function(e,t,i){if("GT"===i){var n=e.split(":"),r=t.split(":");if(!(n[0]>=r[0]))return!1;if(n[0]>r[0])return!0;if(n[0]!=r[0])return!1;if(n[1]>=r[1])return!0}else if("LT"===i){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}},D=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}},U=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!t||!i)return!1;var r=i.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),o=t.replace(new RegExp(r,"g"),"(.+)"),a=n?"^".concat(o):"".concat(o,"$"),s=new RegExp(a);return s.test(e)};function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,o=V(e,t);if(o){var a=function(){if(k(o)){return function(e){return C(e)}(o)}return f.info("Invalid target element. Width and height are 0 for element: ".concat(e,". Can't show tooltip")),!1};return a()}return i?(f.info("Not found yet. Rechecking the DOM."),X(r,n,e,t)):(f.info("Element with selector:".concat(e," not found.")),!1)}function X(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=setInterval((function(){var t=V(i,n);if(t){clearInterval(r);!function(){if(k()){C()}else f.info("Invalid target element. Width and height are 0 for element: ".concat(i,". Can't show tooltip"))}()}else(e-=1)<=0&&(clearInterval(r),console.warn("Element with selector:".concat(i," not found.")))}),t)}var V=function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=document.getElementById(e);if(!n)try{n=document.querySelector(e)}catch(e){window.ApxorLogger.error("Error finding element in DOM:"+e)}(n||(n=L(e)),!n&&i.length>0)&&(n=null===(t=document.getElementById(i))||void 0===t||null===(t=t.contentWindow)||void 0===t||null===(t=t.document)||void 0===t?void 0:t.querySelector(e));return n},L=function(e){var t=e.indexOf("svg");-1!==t&&(e=e.substring(0,t)+"svg:svg");try{return document.IDxi(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 k(e){try{var t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!1}catch(e){return!1}return!0}function F(e,t){for(var i=0;i<e.length;i++)if(e[i].hasOwnProperty(t))return e[i];return null}function C(e){var t,i,n,r;return!!(i=(t=e).offsetHeight,n=t.offsetWidth,(r=t.getBoundingClientRect()).left>=-n&&r.top>=-i&&r.right<=(window.innerWidth||document.documentElement.clientWidth)+n&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)+i)}var Y=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 "),i=document.createElement("div");i.style="\n z-index:99999999;\n background:#16202f;\n position:fixed;\n top:1%;\n right:1%;\n border-radius: 12px;\n ",i.innerHTML=t,i.id="apx-container",document.body.appendChild(i)}(e);var t=document.getElementById("close-button"),i=function(){var e=document.getElementById("apx-container");null==e||e.remove()};null==t||t.addEventListener("click",i),window.setTimeout(i,2e4)},M=window.ApxorLogger,z=a((function t(){var i=this;r(this,t),s(this,"cTiq","ALL"),s(this,"zLkI",[]),s(this,"NPii",[]),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(i.cTiq=e.audience.audience_type,i.zLkI=e.audience.attributes.user,i.NPii=e.audience.attributes.session,!Array.isArray(i.zLkI)||!Array.isArray(i.NPii))return M.error("No attributes"),!1}catch(e){return M.error(e),!1}return!0})),s(this,"validate",(function(t,n){var r=!0;"FTU"===i.cTiq&&(r=e.getController().getSessionInfo().is_first_session);var o=i.uvln(t,i.zLkI),a=i.uvln(n,i.NPii);return o||(i.userAttributesValidated=!1),a||(i.sessionAttributeValidated=!1),r&&o&&a})),s(this,"uvln",(function(e,t){var i=t.length,n=!0;try{for(var r,o=function(){var i=t[a];if(m(e[i.name])||!1===n)return{v:!1};var r=i.operator,o=i.type,s=i.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[i.name])?e[i.name]:[e[i.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),x(e,t,r)}))}));n=n&&l},a=0;a<i;a++)if(r=o())return r.v}catch(e){M.error(e),n=!1}return n}))})),j=a((function e(){var t=this;r(this,e),s(this,"DUbs",""),s(this,"wLHD",{}),s(this,"VPDM",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{t.DUbs=e.name,t.wLHD=e.additional_info,t.VPDM=null==e?void 0:e.path}catch(e){return!1}return!0}))})),N=a((function e(){var t=this;r(this,e),s(this,"tAKC",0),s(this,"TvSz",0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.tAKC=Number(e.lower),t.TvSz=Number(e.upper),isNaN(t.tAKC)||isNaN(t.TvSz))return!1}catch(e){return!1}return!0}))})),I=a((function e(){var t=this;r(this,e),s(this,"Bnen",0),s(this,"ApYz",""),s(this,"xNqg",""),s(this,"XbMU",new j),s(this,"XDKy",new N),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.ApYz=e.event_type,t.xNqg=e.activity,t.XbMU.parse(e.details)&&t.XDKy.parse(e.time_bounds)}catch(e){return!1}}))})),O=window.ApxorLogger,P=a((function e(){var t=this;r(this,e),s(this,"Bnen",0),s(this,"WfCJ",-1),s(this,"pbmh",0),s(this,"kbAA",""),s(this,"xNqg",""),s(this,"ApYz",""),s(this,"XDKy",new N),s(this,"XbMU",new j),s(this,"jpTU",new I),s(this,"VnOY","AND"),s(this,"Cfql",!1),s(this,"cTiq",void 0),s(this,"ihbo",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var i,n;return t.WfCJ=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.pbmh=null==e||null===(i=e.count_config)||void 0===i?void 0:i.count,t.kbAA=null==e||null===(n=e.count_config)||void 0===n?void 0:n.operator,t.xNqg=null==e?void 0:e.activity,t.ApYz=null==e?void 0:e.event_type,t.VnOY=e.combine_operator,t._timeEnabled=null==e?void 0:e.time_enabled,t._time=null==e?void 0:e.time,t.cTiq=null==e?void 0:e.type,t.ihbo=null==e?void 0:e.route,t.XbMU.parse(null==e?void 0:e.details)&&t.jpTU.parse(e.trigger)&&t.XDKy.parse(e.time_bounds)}catch(e){return O.error(e),!1}}))})),Q=window.ApxorLogger,B=a((function e(){var t=this;r(this,e),s(this,"pbmh",0),s(this,"kbAA",""),s(this,"ApYz",""),s(this,"XDKy",new N),s(this,"XbMU",new j),s(this,"VnOY","AND"),s(this,"parse",(function(e){try{return t.pbmh=e.count_config.count,t.kbAA=e.count_config.operator,t.ApYz=e.event_type,t.VnOY=e.combine_operator,t.XbMU.parse(e.details)&&t.XDKy.parse(e.time_bounds)}catch(e){return Q.error(e),!1}}))})),K=window.ApxorLogger,R=function(){function t(){var i=this;r(this,t),s(this,"jHBh",0),s(this,"Hazg",""),s(this,"Siqm",new P),s(this,"HVKs",new B),s(this,"Lqob",!1),s(this,"HxYU",!1),s(this,"EAVr",0),s(this,"VnOY","AND"),s(this,"mOhQ","OR"),s(this,"BAXl",-1),s(this,"clsd",[]),s(this,"KhPZ",{}),s(this,"EVfa",!1),s(this,"Vnko",void 0),s(this,"PfDn",void 0),s(this,"fsXY",void 0),s(this,"mQvT",void 0),s(this,"no_KPI_TriggerDetails",[]),s(this,"KvTt",!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]:{},n=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(i.Hazg=n,i.EAVr=r,i.clsd=a,i.Vnko=o,i.childConditionIndex=u,i.across_sessions=s||!1,"termination"===l&&""!==l){i.HVKs.parse(t);return i.mOhQ=i.HVKs.VnOY,i.xATX(),!0}var d=i.Siqm.parse(t);if(d){if(i.VnOY=i.Siqm.VnOY,i.Siqm.Cfql){var c=i.Siqm.XbMU.DUbs;"APX_PAGE_OPENED"===c&&(c=i.Siqm.XbMU.wLHD.navigation_id,c=g(c)?c:i.Siqm.XbMU.DUbs),i.BAXl=e.getController().getEventCount(c);var h=i.Siqm.pbmh,f=i.Siqm.kbAA;if(i.HxYU=i.yHAo(i.BAXl-1,h,f,!1),i.Lqob=i.HxYU,i.HxYU&&"APX_PAGE_OPENED"===i.Siqm.XbMU.DUbs)return!0}return!0===v&&(o&&0!==r&&"unordered"!==o||i.rxvk()),!0}return!1})),s(this,"rxvk",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1!=t&&(i.PfDn=t);var n=i.Siqm,r=null!=n&&n._eventCategory?null==n?void 0:n._eventCategory:"specific_event",o=n.jpTU,a=me.getInstance();if("app_start"===o.ApYz)if(i.Lqob=!0,null!=n&&n._timeEnabled){if("session"!=(null==n?void 0:n._time.unit)){var s=D(n._time.unit,n._time.value);if("didn't"==(null==n?void 0:n.cTiq)){if(i.EVfa=!1,i.timerDidnt=setTimeout((function(){i.EVfa||(i.HxYU=!0,i.HxYU&&(i.jHBh+=1,i.HxYU=i.yHAo(i.jHBh,i.Siqm.pbmh,i.Siqm.kbAA),i.HxYU&&(i.Siqm.Bnen=Date.now(),i.EVfa=!1,a.validate(i.Hazg,i.EAVr,i.PfDn))),"specific_event"===r?a.unregisterFromEvent(S(i.Siqm.ApYz)+"___"+i.Siqm.XbMU.DUbs,i.spmy):i.cwdN(r),i.Lqob=!1)}),s),i.across_sessions){var l=D(n._time.unit,n._time.value),u=n._timeEnabled,v=n._id;i.kdvQ(n.cTiq,n.XbMU.DUbs,Date.now(),n.XbMU.wLHD,l,u,v)}"specific_event"===r?(a.registerForEvent(S(i.Siqm.ApYz)+"___"+i.Siqm.XbMU.DUbs,i.spmy),i.mQvT=i.Siqm):i.pSsI(r)}else if("did"==(null==n?void 0:n.cTiq)){if(i.timerDid=setTimeout((function(){i.KvTt||("specific_event"===r?a.unregisterFromEvent(S(i.Siqm.ApYz)+"___"+i.Siqm.XbMU.DUbs,i.WArq):i.uGas(r))}),s),i.across_sessions){var d=D(n._time.unit,n._time.value),c=n._timeEnabled,h=n._id;i.kdvQ(n.cTiq,n.XbMU.DUbs,Date.now(),n.XbMU.wLHD,d,c,h)}"specific_event"===r?(a.registerForEvent(S(i.Siqm.ApYz)+"___"+i.Siqm.XbMU.DUbs,i.WArq),i.fsXY=i.Siqm):i.rCaj(r)}}}else"specific_event"===r?a.registerForEvent(S(n.ApYz)+"___"+n.XbMU.DUbs,i.lMCD):i.meTs(r);else if(null!=n&&n._timeEnabled){if("session"!=(null==n?void 0:n._time.unit)){var f=D(n._time.unit,n._time.value);"didn't"==(null==n?void 0:n.cTiq)?(i.EVfa=!1,i.timerDidnt=setTimeout((function(){i.EVfa||(i.HxYU=!0,i.HxYU&&(i.jHBh+=1,i.HxYU=i.yHAo(i.jHBh,i.Siqm.pbmh,i.Siqm.kbAA),i.HxYU&&(i.Siqm.Bnen=Date.now(),i.EVfa=!1,a.validate(i.Hazg,i.EAVr)))),"specific_event"===r&&a.unregisterFromEvent(S(i.Siqm.ApYz)+"___"+i.Siqm.XbMU.DUbs,i.spmy),i.Lqob=!1}),f),"specific_event"===r?(a.registerForEvent(S(i.Siqm.ApYz)+"___"+i.Siqm.XbMU.DUbs,i.spmy),i.mQvT=i.Siqm):i.pSsI()):"did"==(null==n?void 0:n.cTiq)&&(i.timerDid=setTimeout((function(){i.KvTt||"specific_event"===r&&a.unregisterFromEvent(S(i.Siqm.ApYz)+"___"+i.Siqm.XbMU.DUbs,i.WArq)}),f),"specific_event"===r&&a.registerForEvent(S(i.Siqm.ApYz)+"___"+i.Siqm.XbMU.DUbs,i.WArq))}}else"specific_event"===r&&a.registerForEvent(S(n.ApYz)+"___"+o.XbMU.DUbs,i.lMCD);null!==(e=window.ApxorRTM)&&void 0!==e&&e.badgesLists.includes(i.Hazg)&&a.registerForEvent(S(n.ApYz)+"___"+"apxor-badge-container-".concat("-".concat(i.Hazg).replaceAll(" ","").replace(/[^\w\s]/gi,"")),i.lMCD)})),s(this,"meTs",(function(e){var t=new me;"apxor_event"===e?t.registerForEvent("apxor_event",(function(e,t,n,r){i.lMCD(S(i.Siqm.ApYz),i.Siqm.XbMU.DUbs,n,i.Siqm.XbMU.wLHD)})):"customer_event"===e?t.registerForEvent("customer_event",(function(e,t,n,r){i.lMCD(S(i.Siqm.ApYz),i.Siqm.XbMU.DUbs,n,i.Siqm.XbMU.wLHD)})):"any_event"===e?t.registerForEvent("any_event",(function(e,t,n,r){i.lMCD(S(i.Siqm.ApYz),i.Siqm.XbMU.DUbs,n,i.Siqm.XbMU.wLHD)})):"campaign_event"===e?t.registerForEvent("campaign_event",(function(e,t,n,r){i.lMCD(S(i.Siqm.ApYz),i.Siqm.XbMU.DUbs,n,i.Siqm.XbMU.wLHD)})):"survey_event"===e&&t.registerForEvent("survey_event",(function(e,t,n,r){i.lMCD(S(i.Siqm.ApYz),i.Siqm.XbMU.DUbs,n,i.Siqm.XbMU.wLHD)}))})),s(this,"cwdN",(function(e){var t=new me,n=i.Siqm._eventCategory;"apxor_event"===n?t.unregisterFromEvent("apxor_event",i.spmy):"customer_event"===n?t.unregisterFromEvent("customer_event",i.spmy):"any_event"===n?t.unregisterFromEvent("any_event",i.spmy):"campaign_event"===n?t.unregisterFromEvent("campaign_event",i.spmy):"survey_event"===n&&t.unregisterFromEvent("survey_event",i.spmy)})),s(this,"pSsI",(function(){var e=new me,t=i.Siqm._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",i.spmy):"customer_event"===t?e.registerForEvent("customer_event",i.spmy):"any_event"===t?e.registerForEvent("any_event",i.spmy):"campaign_event"===t?e.registerForEvent("campaign_event",i.spmy):"survey_event"===t&&e.registerForEvent("survey_event",i.spmy)})),s(this,"rCaj",(function(){var e=new me,t=i.Siqm._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",i.WArq):"customer_event"===t?e.registerForEvent("customer_event",i.WArq):"any_event"===t?e.registerForEvent("any_event",i.WArq):"campaign_event"===t?e.registerForEvent("campaign_event",i.WArq):"survey_event"===t&&e.registerForEvent("survey_event",i.WArq)})),s(this,"uGas",(function(){var e=new me,t=i.Siqm._eventCategory;"apxor_event"===t?e.unregisterFromEvent("apxor_event",i.WArq):"customer_event"===t?e.unregisterFromEvent("customer_event",i.WArq):"any_event"===t?e.unregisterFromEvent("any_event",i.WArq):"campaign_event"===t?e.unregisterFromEvent("campaign_event",i.WArq):"survey_event"===t&&e.unregisterFromEvent("survey_event",i.WArq)})),s(this,"xATX",(function(){var e=i.HVKs,t=me.getInstance();i.Lqob=!0,t.registerForEvent(S(e.ApYz)+"___"+e.XbMU.DUbs,i.ApRS)})),s(this,"vInL",(function(e,t,n,r){var o,a=(Date.now()-i.KhPZ[t])/1e3;(null===(o=i.Siqm)||void 0===o||null===(o=o.XbMU)||void 0===o||null===(o=o.wLHD)||void 0===o?void 0:o.time)/1e3>a&&i._displayCampaign(n)})),s(this,"WhKN",(function(e,t,n,r){var o,a;i.EVfa=!0;var s=Date.now(),l=null===(o=i.Siqm)||void 0===o||null===(o=o.jpTU)||void 0===o?void 0:o.XbMU.DUbs,u=(s-i.KhPZ[l])/1e3,v=null===(a=i.Siqm)||void 0===a||null===(a=a.XbMU)||void 0===a||null===(a=a.wLHD)||void 0===a?void 0:a.time;(v/=1e3)>u&&i._displayCampaign(n)})),s(this,"WArq",(function(){i.KvTt=!0;var e=new me;clearTimeout(i.timerDid),i.jHBh+=1,i.HxYU=i.yHAo(i.jHBh,i.Siqm.pbmh,i.Siqm.kbAA),i.HxYU&&(e.unregisterFromEvent(S(i.fsXY.ApYz)+"___"+i.fsXY.XbMU.DUbs,i.WArq),i.KvTt=!1,e.validate(i.Hazg,i.EAVr,i.PfDn))})),s(this,"spmy",(function(e,t,n,r){i.EVfa=!0,clearTimeout(i.timerDidnt),(new me).unregisterFromEvent(S(i.mQvT.ApYz)+"___"+i.mQvT.XbMU.DUbs,i.spmy)})),s(this,"lMCD",(function(t,n,r,o){var a,s,l=me.getInstance();if(i.Lqob){if(null!==(a=window.ApxorRTM)&&void 0!==a&&a.isBadgePresent&&null!==(s=window.ApxorRTM)&&void 0!==s&&s.badgesLists.includes(i.Hazg)&&e.getController().isBadgeTriggerSatisfied(i.Hazg))return i.HxYU=!0,i.Siqm.Bnen=r,void l.validate(i.Hazg,i.EAVr);if(S(i.Siqm.ApYz)===t&&i.kUup(r-i.Siqm.jpTU.Bnen,i.Siqm.XDKy)&&i.Siqm.XbMU.DUbs===n&&i.ZDpg(i.Siqm.XbMU.wLHD,o)&&(i.jHBh+=1,i.HxYU=i.yHAo(i.jHBh,i.Siqm.pbmh,i.Siqm.kbAA),i.HxYU)){if(i.Siqm.Bnen=r,i.across_sessions){var u=D(i.Siqm._time.unit,i.Siqm._time.value),v=i.Siqm._timeEnabled,d=i.Siqm._id,c=i.jHBh;i.kdvQ(i.Siqm.cTiq,n,r,o,u,v,d,c)}l.validate(i.Hazg,i.EAVr,i.PfDn)}}else if(i.Lqob=i.PvbP(t,n,r,o),i.Lqob){var h=i.Siqm,f=h.jpTU;if(f.Bnen=r,"activity_time"===(null==h?void 0:h.ApYz)){var m,_,g,p,y=null==h||null===(m=h.XbMU)||void 0===m||null===(m=m.wLHD)||void 0===m?void 0:m.time;(null==h||null===(_=h.ihbo)||void 0===_?void 0:_.length)>0?setTimeout((function(){var t;(null===(t=e.getController())||void 0===t?void 0:t._appEventsNoKpi).length<=2&&h.ihbo===location.pathname&&i._displayCampaign(r)}),y):(null==h||null===(g=h.XbMU)||void 0===g||null===(g=g.wLHD)||void 0===g?void 0:g.nkpi.length)>0?(setTimeout((function(){i.EVfa||(i.HxYU=!0,i.HxYU&&(i.jHBh+=1,i.HxYU=i.yHAo(i.jHBh,i.Siqm.pbmh,i.Siqm.kbAA),i.HxYU&&(i.Siqm.Bnen=r,i.EVfa=!1,l.validate(i.Hazg,i.EAVr)))),h.XbMU.wLHD.nkpi.map((function(e){l.unregisterFromEvent(q(h.XbMU.wLHD.et)+"___"+e,i),i.Lqob=!1}))}),y),h.XbMU.wLHD.nkpi.map((function(e){l.registerForEvent(q(h.XbMU.wLHD.et)+"___"+e,i.spmy)}))):(null==h||null===(p=h.XbMU)||void 0===p||null===(p=p.wLHD)||void 0===p?void 0:p.kpi.length)>0&&(setTimeout((function(){h.XbMU.wLHD.kpi.map((function(e){l.unregisterFromEvent(q(h.XbMU.wLHD.et)+"___"+e,i)}))}),y),h.XbMU.wLHD.kpi.map((function(e){e===h.jpTU.XbMU.DUbs?(l.unregisterFromEvent(S(f.ApYz)+"___"+f.XbMU.DUbs,i),l.registerForEvent(q(h.XbMU.wLHD.et)+"___"+e,i.vInL)):l.registerForEvent(q(h.XbMU.wLHD.et)+"___"+e,i.WhKN)})))}else l.unregisterFromEvent(S(f.ApYz)+"___"+f.XbMU.DUbs,i),l.registerForEvent(S(h.ApYz)+"___"+h.XbMU.DUbs,i);i.KhPZ[n]=Date.now()}})),s(this,"ApRS",(function(e,t,n,r){var o=me.getInstance();S(i.HVKs.ApYz)===e&&i.kUup(n,i.HVKs.XDKy)&&i.HVKs.XbMU.DUbs===t&&i.ZDpg(i.HVKs.XbMU.wLHD,r)&&(i.jHBh+=1,i.HxYU=i.yHAo(i.jHBh,i.HVKs.pbmh,i.HVKs.kbAA),i.HxYU&&(i.HVKs.Bnen=n,o.validateForTermination(i.Hazg,i.EAVr)))})),s(this,"PvbP",(function(e,t,n,r){var o=i.Siqm.jpTU,a=S(o.ApYz)===e&&o.XbMU.DUbs===t&&i.kUup(n,o.XDKy)&&i.ZDpg(o.XbMU.wLHD,r);return a="APX_PAGE_OPENED"===t?a&&location.pathname===o.XbMU.VPDM:a})),s(this,"kUup",(function(e,t){var i=Math.ceil(e);return i>t.tAKC&&i<t.TvSz})),s(this,"yHAo",(function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(r&&i.Siqm.Cfql&&(e+=i.BAXl),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;default:return!1}})),s(this,"ZDpg",(function(e,t){var i=!0;try{var r,o=function(){if(!1===i)return{v:!1};if("object"===n(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,d=(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),x(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),i=i&&v;i=i&&d}else i=i&&x(t[a],e[a],"EQ")};for(var a in e)if(r=o())return r.v}catch(e){K.error(e),i=!1}return i})),s(this,"kdvQ",(function(t,n,r,o,a,s,l,u){var v,d=!1;i.no_KPI_TriggerDetails=e.getController().getFromStorage("apx_nokpi_triggerdetails"),null===i.no_KPI_TriggerDetails||void 0===i.no_KPI_TriggerDetails?i.no_KPI_TriggerDetails=[]:i.no_KPI_TriggerDetails=JSON.parse(i.no_KPI_TriggerDetails);var c,h=0;s&&(h=Date.now()+a);for(var f=0;f<i.no_KPI_TriggerDetails.length;f++)if(i.no_KPI_TriggerDetails[f].id===l){d=!0,v=i.no_KPI_TriggerDetails[f];break}d?v.satisfiedCount+=1:(c={id:l,type:t,time:r,name:n,additionalInfo:o,satisfiedCount:u,timeBased:s,finishTime:h},i.no_KPI_TriggerDetails.push(c)),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(i.no_KPI_TriggerDetails))})),s(this,"wogz",(function(e){var t,n=new me,r=c(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(1===(null==o?void 0:o.length)||void 0===(null==o?void 0:o.length))n.unregisterFromEvent(S(null==o?void 0:o.Siqm.ApYz)+"___"+(null==o?void 0:o.Siqm.XbMU.DUbs),i.lMCD);else{var a,s=c(o);try{for(s.s();!(a=s.n()).done;){var l,u=a.value;n.unregisterFromEvent(S(null==u?void 0:u.Siqm.ApYz)+"___"+(null==u||null===(l=u.Siqm)||void 0===l?void 0:l.XbMU.DUbs),i.lMCD)}}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=me.getInstance();this.HxYU=!0,this.HxYU&&(this.jHBh+=1,this.HxYU=this.yHAo(this.jHBh,this.Siqm.pbmh,this.Siqm.kbAA),this.HxYU&&(this.Siqm.Bnen=e,t.validate(this.Hazg,this.EAVr)))}}]),t}(),W=window.ApxorLogger,J=a((function t(){var i=this;r(this,t),s(this,"pbmh",0),s(this,"Mjgx",0),s(this,"Dqwg","SESSION"),s(this,"lszB",0),s(this,"sMcD",0),s(this,"XmlV",0),s(this,"_enable_repetition_gap",void 0),s(this,"_enable_days_limit",void 0),s(this,"_enable_session_limit",void 0),s(this,"zBpL",void 0),s(this,"zOqp",void 0),s(this,"nczi",void 0),s(this,"DSLimits",void 0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,r,o,a,s,l,u,v;if(i.Hazg=t._id,i.Ereh=t.meta,i.pbmh=t.frequency.count,-1===i.pbmh&&(i.pbmh=9999999),i.XmlV=i.pbmh,i.Mjgx=t.frequency.time_interval,i.Dqwg=t.frequency.validity,i.DSLimits=t.frequency.DSLimits,i.sMcD=t.frequency.ses_lmt,i._enable_session_limit=null===(n=t.frequency)||void 0===n?void 0:n.enable_session_limit,i._enable_session_limit)i.zBpL=null===(l=t.frequency)||void 0===l?void 0:l.session_count;if(i._dayCount=null!==(r=t.frequency)&&void 0!==r&&r.day_lmt?null===(o=t.frequency)||void 0===o?void 0:o.day_lmt:0,i._enable_repetition_gap=!!t.frequency.enable_repetition_gap&&t.frequency.enable_repetition_gap,i._enable_repetition_gap)i._repetitionValue=null===(u=t.frequency)||void 0===u?void 0:u.repetition_gap.val,i._repetitionUnit=null===(v=t.frequency)||void 0===v?void 0:v.repetition_gap.unit;i._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),i._enable_days_limit&&(i.nczi=t.frequency.days_limit.days?t.frequency.days_limit.days:1,i.zOqp=t.frequency.days_limit.limit);var d=me.getInstance().getQeState();if(!g(d)||!g(d[t._id]))return!0;if("SESSION"===i.Dqwg){if(i.pbmh=parseInt(i.pbmh)-parseInt(d[t._id].SESSION),i.pbmh<=0)return i.sVnr("Session limit reached"),console.warn("Max count limit reached for session:"+t._id),e.getController().isTestDevice()&&Y("Maximum overall limit reached for campaign name ".concat(i.Ereh.name)),!1}else{if("OVERALL"!==i.Dqwg)return W.info("Invalid config."),!1;if(i.pbmh=parseInt(i.pbmh)-parseInt(d[t._id].OVERALL),i.pbmh<=0)return i.sVnr("Overall limit reached"),console.warn("Max count limit reached for overall:"+t._id),e.getController().isTestDevice()&&Y("Maximum overall limit reached for campaign name ".concat(i.Ereh.name)),!1}}catch(e){return W.error(e),!1}return!0})),s(this,"mfzx",(function(){i.pbmh=i.pbmh-1})),s(this,"getFrequencyCount",(function(){return i.pbmh})),s(this,"mDnO",(function(){"SESSION"===i.Dqwg&&(i.pbmh=i.XmlV,W.info("Campaign Limit reset"))})),s(this,"dhZT",(function(t){try{if(i.pbmh<=0)return"OVERALL"===i.Dqwg?(i.sVnr("Overall limit reached"),e.getController().isTestDevice()&&Y("Maximum overall limit reached for campaign name ".concat(i.Ereh.name))):"SESSION"===i.Dqwg&&(e.getController().isTestDevice()&&Y("Maximum session limit reached for campaign name ".concat(i.Ereh.name)),i.sVnr("Session limit reached")),!1;var n=me.getInstance().getQeState();if(!g(n)||!g(n[t]))return!0;if(i._enable_session_limit)if(parseInt(i.zBpL)-parseInt(n[t].SESSION)<=0)return i.sVnr("Session limit reached"),e.getController().isTestDevice()&&Y("Maximum session limit reached for campaign name ".concat(i.Ereh.name)),!1;if(i._enable_repetition_gap)if("session"!=i._repetitionUnit){var r=e.getController().getFromStorage("apx-last-shown-times");if(r=JSON.parse(r),!_(F(r,i.Hazg))){var o=F(r,i.Hazg)[i.Hazg];if(Date.now()-o<D(i._repetitionUnit,i._repetitionValue))return i.sVnr("Config does not satisfy time difference "),e.getController().isTestDevice()&&Y("Config does not satisfy time difference for campaign name ".concat(i.Ereh.name)),!1}}else{var a=e.getController().getFromStorage("apx-last-shown-session");if(a=JSON.parse(a),!_(F(a,i.Hazg))){var s=F(a,i.Hazg)[i.Hazg];if(e.getController().getFromStorage("apx_retained_session")-s<parseInt(i._repetitionValue))return i.sVnr("Config does not satisfy session difference "),e.getController().isTestDevice()&&Y("Config does not satisfy session difference for campaign name ".concat(i.Ereh.name)),!1}}if(0!==i.sMcD&&i.DSLimits)if(parseInt(i.sMcD)-parseInt(n[t].SESSION)<=0)return i.sVnr("Session limit reached"),e.getController().isTestDevice()&&Y("Session limit reached for campaign name ".concat(i.Ereh.name)),!1;if(0!==i._dayCount){var l,u=T();if(parseInt(i._dayCount)-parseInt((null===(l=n[t])||void 0===l?void 0:l.DATES[u])||0)<=0)return i.sVnr("Day limit reached"),e.getController().isTestDevice()&&Y("Day limit reached for campaign name ".concat(i.Ereh.name)),!1}if(i.nczi>0&&i._enable_days_limit){var v=i.nczi,d=0;if(function(e){for(var t=[],i=new Date,n=0;n<e;n++){var r=new Date(i);r.setDate(i.getDate()-n);var o=String(r.getDate()),a=String(r.getMonth()),s=r.getFullYear();t.push(o+"/"+a+"/"+s)}return t}(v).forEach((function(e){var i;d+=parseInt((null===(i=n[t])||void 0===i?void 0:i.DATES[e])||0)})),d>i.zOqp)return W.info("Shown Limit Crossed"),e.getController().isTestDevice()&&Y("Days limit reached for campaign name ".concat(i.Ereh.name)),!1}}catch(e){i.sVnr("Error validating the frequency: ".concat(e)),W.error("Error validating the frequency:"+e)}return!0})),s(this,"sVnr",(function(t){var n;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.Ereh.type?"survey":"campaign",apx_nudge_id:i.Hazg,apx_nudge_name:i.Ereh.name,apx_variant_code:i.Ereh.isExperiment||i.Ereh.only_context?null===(n=i.Ereh.attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),G=window.ApxorLogger,Z=a((function e(){var t=this;r(this,e),s(this,"trNx",[]),s(this,"VxYR",0),s(this,"fAbO",!1),s(this,"jQQw",void 0),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]:"",n=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.Hazg=i,t.EAVr=n,t.clsd=o,t.Vnko=r,t.across_sessions=s;var l=[];t.VxYR=e.length;try{if(null!=l)return r=null==e?void 0:e.sequence_type,l=t.RaJD(e,t.VxYR),"unordered"!==a&&0!==t.EAVr||t.rxvk(),t.trNx}catch(e){return G.error(e),!1}})),s(this,"RaJD",(function(e,i){for(var n=0;n<i;n++){t.jQQw=new R;try{t.jQQw.initialize(e[n],t.Hazg,t.EAVr,t.Vnko,t.XfJZ,t.across_sessions,"",-1,!1)&&(t.trNx.push(t.jQQw),t.trNx.sequence_type=t.Vnko)}catch(e){G.error(e)}}return t.trNx})),s(this,"rxvk",(function(){if("ordered"===t.Vnko||"strictly_ordered"===t.Vnko)t.trNx[0].rxvk(0);else{var e,i=c(t.trNx);try{for(i.s();!(e=i.n()).done;){e.value.rxvk()}}catch(e){i.e(e)}finally{i.f()}}})),s(this,"wogz",(function(e){t.jQQw.wogz(e)}))})),$=a((function e(){var t=this;r(this,e),s(this,"DUbs",""),s(this,"cTiq",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var i,n;t.DUbs=e.meta.name,t.cTiq=e.meta.type,t._only_context=e.meta.only_context,t._attr=(null===(i=e.meta)||void 0===i?void 0:i.attr)||{},t._isExperiment=null===(n=e.meta)||void 0===n?void 0:n.isExperiment}catch(e){return window.ApxorLogger.error(e),!1}return!0}))})),ee=window.ApxorLogger,te=a((function t(){var i=this;r(this,t),s(this,"sOpG",[]),s(this,"_ret_day",{}),s(this,"wQCq",{}),s(this,"Rlap",!1),s(this,"oepX",!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{i.sOpG=e.overall_cfg.events,i._ret_day=e.overall_cfg.ret_day,i.wQCq=e.overall_cfg.session,i.Rlap=e.overall_cfg.toggleRetDay,i.oepX=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")),n=parseInt(e.getController().getFromStorage("apx_retained_session"));if(i.Rlap&&!isNaN(t)&&!(t>=i._ret_day.from&&t<=i._ret_day.to))return i.retainedDaysValidated=!1,!1;if(i.oepX&&!isNaN(n)&&!(n>=i.wQCq.from&&n<=i.wQCq.to))return i.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),i=new Uint8Array(t),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return t}(b(o,r)))),s=0;s<i.sOpG.length;s++){if(a[i.sOpG[s].name.replace("'","").replace("’","")])return i.eventDoneInLT=!0,!1}}catch(e){ee.error("Failed to validate the lt count:"+e)}return!0}))})),ie=window.ApxorLogger,ne=a((function e(){var t=this;r(this,e),s(this,"zLkI",[]),s(this,"NPii",[]),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.zLkI=e.attributes.user,t.NPii=e.attributes.session,!Array.isArray(t.zLkI)||!Array.isArray(t.NPii))return ie.error("No attributes"),!1}catch(e){return ie.error(e),!1}return!0})),s(this,"validate",(function(e,i){return t.uvln(e,t.zLkI)&&t.uvln(i,t.NPii)})),s(this,"uvln",(function(e,t){var i=t.length,n=!0;try{for(var r,o=function(){var i=t[a];if(!e[i.name]||!1===n)return{v:!1};var r=i.operator,o=i.type,s=i.value.map((function(e){return"s"===o?e:"l"===o?parseInt(e):"f"===o?parseFloat(e):void 0})),l=(Array.isArray(e[i.name])?e[i.name]:[e[i.name]]).some((function(e){return s.some((function(t){return x(e,t,r)}))}));n=n&&l},a=0;a<i;a++)if(r=o())return r.v}catch(e){ie.error(e),n=!1}return n}))})),re=a((function t(){var i=this;r(this,t),s(this,"BRup",e.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"VJoQ",1),s(this,"parse",(function(e){try{var t,n,r;if(i.cTiq=null===(t=e.terminate_info.time_based)||void 0===t?void 0:t.type,i._duration_seconds=null===(n=e.terminate_info)||void 0===n?void 0:n.time_based.duration_seconds,i.VJoQ=null===(r=e.terminate_info.time_based)||void 0===r?void 0:r.days,i.VOPn(e._id))return i.BRup.persistTerminationInfoLocally(e._id),!1}catch(e){return!1}return!0})),s(this,"VOPn",(function(e){var t,n=JSON.parse(i.BRup.getFromStorage("apx_termination_ID"));if(!n[e]||null===(t=n[e])||void 0===t||!t.startDate)return!1;var r,o=new Date(n[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=n[e].WFNY;return s===i.VJoQ&&l.hours>=u.hours||s>i.VJoQ||n[e].goalAcheived}))})),oe=a((function e(){var t=this;r(this,e),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"nGPc",new ne),s(this,"Ayla",new re),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var i,n,r;if(t.enable_time_based=null==e||null===(i=e.terminate_info)||void 0===i?void 0:i.enable_time_based,t.enable_time_based&&!t.Ayla.parse(e))return!1;if(t.enable_goal_events=null==e||null===(n=e.terminate_info)||void 0===n?void 0:n.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.nGPc.parse(e.terminate_info))return!1}catch(e){return window.ApxorLogger.error(e),!1}return!0})),s(this,"validate",(function(e,i){return t.nGPc.validate(e,i)}))})),ae=window.ApxorLogger,se=a((function t(){var i=this;r(this,t),s(this,"YgQr",-1),s(this,"FdHW",-1),s(this,"WFNY",-1),s(this,"GBJY",-1),s(this,"Ngly",-1),s(this,"REwA",-1),s(this,"_is_user_timezone",void 0),s(this,"ezbU",!1),s(this,"Npsa",!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,n;if(i.Hazg=e._id,i.Ereh=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(i.YgQr=Date.parse(e.validity.start_date),i.FdHW=Date.parse(e.validity.end_date),i._days_in_week=null!==(t=e.validity)&&void 0!==t&&t.days_in_week?null===(n=e.validity)||void 0===n?void 0:n.days_in_week:[1,2,3,4,5,6,7],i._is_user_timezone=!e.is_user_timezone||e.is_user_timezone,g(e.at_specific_time)&&(i.ezbU=e.at_specific_time,i.ezbU&&g(e.time_limits)&&(i.WFNY=e.time_limits.start_time,i.GBJY=e.time_limits.end_time,E(i.WFNY)||E(i.GBJY))))return ae.error("Not valid times"),!1;if(g(e.time_excludes_in_day)&&(i.Npsa=e.time_excludes_in_day,i.Npsa&&g(e.time_excludes)&&(i.Ngly=e.time_excludes.start_time,i.REwA=e.time_excludes.end_time,E(i.Ngly)||E(i.REwA))))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(),n=(new Date).getDay()+1,r=function(e){var t=new Date,i=t.getHours(),n=t.getMinutes(),r=(i=(i<10?"0":"")+i)+":"+(n=(n<10?"0":"")+n);if(!e){var o=t.getUTCHours(),a=t.getUTCMinutes();r=(o=(o<10?"0":"")+o)+":"+(a=(a<10?"0":"")+a)}return r}(i._is_user_timezone);if(t>i.YgQr&&t<i.FdHW&&i._days_in_week.includes(n))return!i.ezbU||A(r,i.WFNY,"GT")&&A(r,i.GBJY,"LT")||(i._not_in_specified_time=!0),i.Npsa&&function(e,t,i){var n=l(e.split(":").map(Number),2),r=n[0],o=n[1],a=l(t.split(":").map(Number),2),s=a[0],u=a[1],v=l(i.split(":").map(Number),2),d=60*v[0]+v[1];return d>=60*r+o&&d<=60*s+u}(i.Ngly,i.REwA,r)?(i.sVnr("Exclude Time limits check failed"),e.getController().isTestDevice()&&Y("Exclude Time Limits check failed for campaign name ".concat(i.Ereh.name)),!1):!i.ezbU||A(r,i.WFNY,"GT")&&A(r,i.GBJY,"LT");if(t<i.YgQr)i._not_yet_active=!0;else if(t>i.FdHW)i._nudge_expired=!0;else if(!i._days_in_week.includes(n))return i.sVnr("Current week day did not match with Configured Week day"),e.getController().isTestDevice()&&Y("Current week day did not match with Configured Week day for campaign name ".concat(i.Ereh.name)),!1;return!1})),s(this,"sVnr",(function(t){var n;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.Ereh.type?"survey":"campaign",apx_nudge_id:i.Hazg,apx_nudge_name:i.Ereh.name,apx_variant_code:i.Ereh.isExperiment||i.Ereh.only_context?null===(n=i.Ereh.attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),le=a((function e(){var t=this;r(this,e),s(this,"gZtK",""),s(this,"Jgmn",""),s(this,"ZcgN",""),s(this,"iVwK",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.gZtK=null==e?void 0:e.screen_binding,!t.gZtK||(t.Jgmn=null==e?void 0:e.binding.url,t.ZcgN=null==e?void 0:e.binding.var,t.iVwK=null==e?void 0:e.binding.operator,!0)}catch(e){return window.ApxorLogger.error(e),!1}})),s(this,"validate",(function(){var e=t.Jgmn,i=t.ZcgN,n=t.iVwK,r=window.location.href;return!t.gZtK||("EQ"===n?e.includes(i)?!!U(r,e,i,!1):r===e:"SW"===n?e.includes(i)?!!U(r,e,i,!0):!!r.startsWith(e):void 0)}))})),ue=window.ApxorLogger,ve=a((function t(){var n=this;r(this,t),s(this,"TXth",[]),s(this,"OAcN",[]),s(this,"Hazg",""),s(this,"Ereh",new $),s(this,"xtma",new z),s(this,"Dqwg",new se),s(this,"YVWL",new J),s(this,"GLor",new te),s(this,"FpDf",new oe),s(this,"PlQx",new le),s(this,"Vnko",!1),s(this,"XfJZ",[]),s(this,"_variant_code",""),s(this,"fAbO",!1),s(this,"groupCombineOperator","OR"),s(this,"EVfa",!1),s(this,"IdSa",!1),s(this,"QKLq",void 0),s(this,"timeForKPI",void 0),s(this,"kpiIndex",0),s(this,"sVPQ",void 0),s(this,"_across_sessions",!1),s(this,"Oxkj",void 0),s(this,"znHr",!1),s(this,"gBkh",void 0),s(this,"jclx",void 0),s(this,"YeUq",void 0),s(this,"Mjec",void 0),s(this,"Qtoh",void 0),s(this,"USib",void 0),s(this,"OtEm",void 0),s(this,"piHE",void 0),s(this,"aGhL",void 0),s(this,"lIwH",void 0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,i;if(!g(e._id))return ue.error("No Id"),!1;if(!g(e.enabled)||!e.enabled)return ue.error("Not enabled"),!1;if(!(n.Ereh.parse(e)&&n.Dqwg.parse(e)&&n.YVWL.parse(e)&&n.xtma.parse(e)&&n.GLor.parse(e)&&n.FpDf.parse(e)&&n.PlQx.parse(e)))return!1;if(n._variant_code=n.Ereh._isExperiment||n.Ereh._only_context?null===(t=n.Ereh._attr)||void 0===t?void 0:t.apx_variant_code:"TG",n._across_sessions=!(null==e||!e.across_sessions)&&(null==e?void 0:e.across_sessions),n.enable_conditions=null==e?void 0:e.enable_conditions,n.enable_conditions_v2=null==e?void 0:e.enable_conditions_v2,!g(e.conditions)||!Array.isArray(e.conditions))return ue.error("No valid conditions",e.conditions),!1;n.Hazg=e._id,n.Vnko=!!g(e.sequence_enabled)&&e.sequence_enabled,g(e.conditions_v2)&&n.enable_conditions_v2&&(n.Vnko=null==e?void 0:e.sequence_type),!0===n.Vnko&&e.conditions.sort((function(e,t){return e.sequence<t.sequence})),g(e.conditions_v2)&&n.enable_conditions_v2?(i=e.conditions_v2,n.znHr=!0):i=e.conditions,n.Oxkj=i;var r=i.length,o=null==e?void 0:e.no_context_enabled;if(0===r&&o&&setTimeout((function(){n.LjPk()}),10),n.lIwH=r,n.svJa(i,r),n.RLRD(),n.FpDf.enable_goal_events)for(var a=e.terminate_info.goal_events.events,s=a.length,l=0;l<s;l++){var u=new R;u.initialize(a[l],n.Hazg,l,!0,[],n._across_sessions,"termination")&&n.OAcN.push(u)}return n.TXth.length>0}catch(e){return ue.error(e),!1}})),s(this,"svJa",(function(e,t){for(var i=function(){n.XfJZ=[];var t=e[r];if("group"===(null!=t&&t.condition_type?null==t?void 0:t.condition_type:"single")){var i=t.conditions_v2;n.groupCombineOperator=t.combine_operator;var o=null==t?void 0:t.sequence_type;n.aGhL=new Z;var a=n.aGhL.initialize(i,n.Hazg,r,o,n.XfJZ,n.Vnko,n._across_sessions);n.TXth.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};n.XfJZ=[].concat(u(n.XfJZ),[l])}if(n.aGhL=new R,n.aGhL.initialize(t,n.Hazg,r,n.Vnko,n.XfJZ,n._across_sessions)){n.TXth.push(n.aGhL);var v=(null==t?void 0:t.timeout)/(null==t?void 0:t.findinterval),d=(null==t?void 0:t.frameid)||"",c=null==t?void 0:t.url;window.location.href===c&&"view_visibility"===t.event_type&&!0===H(t.view_id,d,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,v)&&n.LjPk(!0),window.addEventListener("navigate",(function(e){var i=null==t?void 0:t.url;window.location.href===i&&"view_visibility"===t.event_type&&!0===H(t.view_id,d,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,v)&&n.LjPk(!0)}))}}},r=0;r<t;r++)i()})),s(this,"RLRD",(function(){if(n._across_sessions&&"ordered"===n.Vnko){var t=!1,i=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(i=JSON.parse(i))&&null!=i)for(var r=function(e){var r,o,a;if(null!==(r=n.TXth[e])&&void 0!==r&&null!==(r=r.Siqm)&&void 0!==r&&r._timeEnabled&&void 0===n.TXth[e].length){if("didn't"===n.TXth[e].Siqm.cTiq){var s=n.TXth[e].Siqm._id,l=n.PrdI(s,i);if(l)if(Date.now()>l.finishTime)n.TXth[e].HxYU=!0,n.TXth[e].jHBh=l.satisfiedCount,t=!0;else{var u=l.finishTime-Date.now(),v=n.TXth[e].Siqm._eventCategory?n.TXth[e].Siqm._eventCategory:"specific_event",d=new me;"specific_event"===v?(d.registerForEvent(S(n.TXth[e].Siqm.ApYz)+"___"+n.TXth[e].Siqm.XbMU.DUbs,n.spmy),n.Qtoh=n.TXth[e]):n.pSsI(v),setTimeout((function(){e!==n.TXth.length-1||n.EVfa||(n.TXth[e].HxYU=!0,n.TXth[e].jHBh=l.satisfiedCount,t=!0,"specific_event"===v?d.unregisterFromEvent(S(n.TXth[e].Siqm.ApYz)+"___"+n.TXth[e].Siqm.XbMU.DUbs,n.spmy):n.czAw(n.TXth[e]),n.LjPk())}),u)}}if("did"===n.TXth[e].Siqm.cTiq){var c=n.TXth[e].Siqm._id,h=n.PrdI(c,i);if(h)if(null==h.satisfiedCount){if(Date.now()<h.finishTime){n.YeUq=h,n.jclx=e;var f=h.finishTime-Date.now(),m=n.TXth[e].Siqm._eventCategory?n.TXth[e].Siqm._eventCategory:"specific_event",_=new me;"specific_event"===m?_.registerForEvent(S(n.TXth[e].Siqm.ApYz)+"___"+n.TXth[e].Siqm.XbMU.DUbs,n.XiMu):n.pSsI(m),setTimeout((function(){"specific_event"===m?_.unregisterFromEvent(S(n.TXth[e].Siqm.ApYz)+"___"+n.TXth[e].Siqm.XbMU.DUbs,n.XiMu):n.czAw(n.TXth[e])}),f)}}else n.TXth[e].jHBh=h.satisfiedCount,n.TXth[e].HxYU=!0}}else t=n.vbaL(e,i);t&&(null===(o=n.TXth[e])||void 0===o||null===(o=o.Siqm)||void 0===o||!o._timeEnabled||(null===(a=n.TXth[e])||void 0===a?void 0:a.length)>1)?e===n.TXth.length-1&&n.LjPk():t||void 0===!n.TXth[e].length&&n.TXth[e].rxvk()},o=0;o<n.TXth.length;o++)r(o)}else if(n._across_sessions&&"unordered"===n.Vnko){var a=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(a=JSON.parse(a))&&null!=a)for(var s=0;s<n.TXth.length;s++)n.vbaL(s,a)}})),s(this,"vbaL",(function(e,t){if(void 0===n.TXth[e].length||1===n.TXth[e].length){var i=n.TXth[e].Siqm._id,r=!1,o=n.PrdI(i,t);if(o)n.gBkh=o,r=(new R).yHAo(o.satisfiedCount,n.TXth[e].Siqm.pbmh,n.TXth[e].Siqm.kbAA),o&&(r?n.TXth[e].HxYU=!0:n.TXth[e].jHBh=o.satisfiedCount);else n.TXth[e].rxvk();return r}if(n.TXth[e].length>=1){var a,s,l;if("ordered"===(s=null===(a=n.TXth[e])||void 0===a?void 0:a.sequence_type)||"strictly_ordered"===s){for(var u=0;u<n.TXth[e].length;u++){var v=n.TXth[e][u],d=v.Siqm._id;l=!1;var c=n.PrdI(d,t);if(c){if(l=(new R).yHAo(c.satisfiedCount,v.Siqm.pbmh,v.Siqm.kbAA),c)if(l){n.TXth[e][u].HxYU=!0;var h=u+1,f=n.TXth[e][u+1];void 0===f&&g(n.TXth[e+1])&&(n.TXth[e+1].rxvk(),l=!0),null!=f&&n.TXth[e][u+1].rxvk(h)}else n.TXth[e][u].jHBh=c.satisfiedCount}else(g(n.TXth[e][u-1])&&!0===n.TXth[e][u].HxYU||m(n.TXth[e][u-1]))&&n.TXth[e][u].rxvk()}return l}for(var _,p=0;p<n.TXth[e].length;p++){var y=n.TXth[e][0].Siqm.VnOY;_="OR"!==y;var b=n.TXth[e][p],E=b.Siqm._id;l=!1;var S=n.PrdI(E,t);if(S)l=(new R).yHAo(S.satisfiedCount,b.Siqm.pbmh,b.Siqm.kbAA),S&&(l?n.TXth[e][p].HxYU=!0:n.TXth[e][p].jHBh=S.satisfiedCount);else b.rxvk();_="AND"===y?_&&l:_||l}return _}})),s(this,"PrdI",(function(e,t){return t.find((function(t){return t.id===e}))})),s(this,"IDxi",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=me.getInstance();if(!(t<0)){var o=n.TXth[t],a="unordered";if((null==o?void 0:o.length)>1&&(a=null==o?void 0:o.sequence_type),!0===n.Vnko||"ordered"===n.Vnko||"strictly_ordered"===n.Vnko||"ordered"===a||"strictly_ordered"===a){n.kpiIndex=t+1;var s=n.TXth[t];if((null==s?void 0:s.length)>0){if(g(s))if("unordered"===n.Vnko&&"ordered"===a){var l=o[i-1];if(g(l))if(void 0===l.length||1==l.length){if(!l.HxYU)return}else if(l.length>1&&!n.pDnJ(l))return;var u,v=o[i+1];if(g(v)){if(v.rxvk(i+1),"strictly_ordered"===n.Vnko){n._currentEventname=s[i].Siqm.XbMU.DUbs;var d=e.getController();d.registerForEvent("APP_EVENT",n.NaLQ),d.registerForEvent("CLIENT_EVENT",n.NaLQ)}}else if("strictly_ordered"===a)1!=n.fAbO&&n.LjPk();else(null===(u=o[i])||void 0===u?void 0:u.length)>0?n.pDnJ(o)&&n.LjPk():n.LjPk()}else{var h,f=n.TXth[t-1];if(g(f))if(void 0===f.length||1==f.length){if(!f.HxYU)return}else if(f.length>1&&!n.pDnJ(f))return;if(void 0===s.length||1===s.length?h=n.TXth[t+1]:s.length>1&&("ordered"===a||"strictly_ordered"===a?h=i===s.length-1?n.TXth[t+1]:n.TXth[t][i+1]:n.pDnJ(s)&&(h=n.TXth[t+1])),g(h)){if(void 0===h.length||1===h.length)h.rxvk(i+1);else if(n.pDnJ(s))if(void 0===h.length)h.rxvk();else if(h.length>1)if("unordered"===h.sequence_type)for(var m=0;m<h.length;m++)h[m].rxvk(m);else"ordered"!==h.sequence_type&&"strictly_ordered"!==h.sequence_type||h[0].rxvk(0);if("strictly_ordered"===n.Vnko){n._currentEventname=s[i].Siqm.XbMU.DUbs;var _=e.getController();_.registerForEvent("APP_EVENT",n.NaLQ),_.registerForEvent("CLIENT_EVENT",n.NaLQ)}}else"strictly_ordered"===n.Vnko?1!=n.fAbO&&n.LjPk():n.pDnJ(s)&&n.LjPk()}}else if(g(s)&&s.HxYU){s.KhPZ[s.Siqm.XbMU.DUbs]=Date.now();var p=n.TXth[t-1];if(g(p))if(void 0===p.length||1==p.length){if(!p.HxYU)return}else if(p.length>1&&!n.pDnJ(p))return;var y=n.TXth[t+1];if(g(y)){var b,E;if(null!=y&&null!==(b=y.Siqm)&&void 0!==b&&b._timeEnabled){if("session"!=(null===(E=y.Siqm)||void 0===E?void 0:E._time.unit)){var q,x,w=D(y.Siqm._time.unit,y.Siqm._time.value);if("didn't"==(null===(q=y.Siqm)||void 0===q?void 0:q.cTiq)){if(n.OtEm=setTimeout((function(){if(n.EVfa)n.EVfa=!1;else{if(n.EVfa=!1,y.HxYU=!0,y.HxYU){y.jHBh+=1;var e=new R;if(y.HxYU=e.yHAo(y.jHBh,y.Siqm.pbmh,y.Siqm.kbAA),y.HxYU){y.Siqm.Bnen=Date.now();var i=t+1,o=n.TXth[i+1];g(o)?o.rxvk():n.LjPk()}}r.unregisterFromEvent(S(y.Siqm.ApYz)+"___"+y.Siqm.XbMU.DUbs,n.spmy),y.Lqob=!1}}),w),n._across_sessions){var T=D(y.Siqm._time.unit,y.Siqm._time.value),A=y.Siqm._timeEnabled,U=y.Siqm._id,H=new R;H.kdvQ(y.Siqm.cTiq,y.Siqm.XbMU.DUbs,Date.now(),y.Siqm.XbMU.wLHD,T,A,U)}"specific_event"===y.Siqm._eventCategory?(r.registerForEvent(S(y.Siqm.ApYz)+"___"+y.Siqm.XbMU.DUbs,n.spmy),n.Qtoh=y):n.pSsI(y)}else if("did"==(null===(x=y.Siqm)||void 0===x?void 0:x.cTiq)&&(n.EVfa=!1,n.sVPQ=y,g(n.TXth[t+2])&&n._across_sessions&&(n.Mjec=n.TXth[t+2]),n.piHE=setTimeout((function(){n.EVfa?n.EVfa=!1:(n.EVfa=!1,r.unregisterFromEvent(S(y.Siqm.ApYz)+"___"+y.Siqm.XbMU.DUbs,n.WhKN))}),w),n.QKLq=s,n.timeForKPI=w,r.registerForEvent(S(y.Siqm.ApYz)+"___"+y.Siqm.XbMU.DUbs,n.WhKN),n.USib=y,n._across_sessions)){var X=D(y.Siqm._time.unit,y.Siqm._time.value),V=y.Siqm._timeEnabled,L=y.Siqm._id,k=new R;k.kdvQ(y.Siqm.cTiq,y.Siqm.XbMU.DUbs,Date.now(),y.Siqm.XbMU.wLHD,X,V,L)}}}else if(y.length>0)if("ordered"===y.sequence_type||"strictly_ordered"===y.sequence_type)y[0].rxvk(i+1);else{var F,C=c(y);try{for(C.s();!(F=C.n()).done;){var Y=F.value;Y.rxvk()}}catch(e){C.e(e)}finally{C.f()}}else y.rxvk();if("strictly_ordered"===n.Vnko){n._currentEventname=s.Siqm.XbMU.DUbs;var M=e.getController();M.registerForEvent("APP_EVENT",n.NaLQ),M.registerForEvent("CLIENT_EVENT",n.NaLQ)}}else"strictly_ordered"===n.Vnko?1!=n.fAbO&&n.LjPk():n.LjPk()}}else n.ghfw(),n.LjPk()}})),s(this,"NaLQ",(function(e){e&&e.name!=n._currentEventname&&(n.fAbO=!0)})),s(this,"pSsI",(function(e){var t=new me,i=e.Siqm._eventCategory;"apxor_event"===i?t.registerForEvent("apxor_event",n.spmy):"customer_event"===i?t.registerForEvent("customer_event",n.spmy):"any_event"===i?t.registerForEvent("any_event",n.spmy):"campaign_event"===i?t.registerForEvent("campaign_event",n.spmy):"survey_event"===i&&t.registerForEvent("survey_event",n.spmy)})),s(this,"czAw",(function(e){var t=new me,i=e.Siqm._eventCategory;"apxor_event"===i?t.unregisterFromEvent("apxor_event",n.spmy):"customer_event"===i?t.unregisterFromEvent("customer_event",n.spmy):"any_event"===i?t.unregisterFromEvent("any_event",n.spmy):"campaign_event"===i?t.unregisterFromEvent("campaign_event",n.spmy):"survey_event"===i&&t.unregisterFromEvent("survey_event",n.spmy)})),s(this,"spmy",(function(){var e,t;n.OtEm&&(n.EVfa=!1,clearTimeout(n.OtEm));var i=new me;n.EVfa=!0,n._across_sessions&&null!==localStorage.getItem("apx_nokpi_triggerdetails")&&localStorage.removeItem("apx_nokpi_triggerdetails"),i.unregisterFromEvent(S(null===(e=n.Qtoh)||void 0===e||null===(e=e.Siqm)||void 0===e?void 0:e.ApYz)+"___"+(null===(t=n.Qtoh)||void 0===t||null===(t=t.Siqm)||void 0===t||null===(t=t.XbMU)||void 0===t?void 0:t.DUbs),n.spmy)})),s(this,"WhKN",(function(){var t,i,r,o=new me;n.EVfa=!0,n.piHE&&clearTimeout(n.piHE);var a=new R;if(n.sVPQ.jHBh+=1,n.sVPQ.HxYU=a.yHAo(n.sVPQ.jHBh,n.sVPQ.Siqm.pbmh,n.sVPQ.Siqm.kbAA),o.unregisterFromEvent(S(null===(t=n.USib)||void 0===t||null===(t=t.Siqm)||void 0===t?void 0:t.ApYz)+"___"+(null===(i=n.USib)||void 0===i||null===(i=i.Siqm)||void 0===i?void 0:i.XbMU.DUbs),n.WhKN),n._across_sessions&&null!==(r=n.Mjec)&&void 0!==r&&r.Siqm._timeBased){var s,l,u,v=e.getController().getFromStorage("apx_nokpi_triggerdetails");v=null==v?[]:JSON.parse(v);for(var d=0;d<v.length;d++)if(n.no_KPI_TriggerDetails[d].id===n.Mjec.Siqm._id){s=!0,l=v[d];break}if(s)l.satisfiedCount+=1;else{var c=n.sVPQ.Siqm._id,h=n.sVPQ.Siqm.cTiq,f=n.sVPQ.Siqm.XbMU.DUbs,m=n.sVPQ.Siqm.XbMU.wLHD;u={id:c,type:h,time:Date.now(),name:f,additionalInfo:m,satisfiedCount:n.sVPQ.Siqm._timeEnabled,timeBased:n.sVPQ.Siqm._timeEnabled},n.no_KPI_TriggerDetails.push(u)}}if(n.sVPQ.HxYU){var _=n.TXth[n.kpiIndex+1];g(_)?_.rxvk():n.LjPk()}})),s(this,"XiMu",(function(){if(n.jclx===n.TXth.length-1){n.IdSa=!0;n.TXth[n.jclx]&&(n.TXth[n.jclx].jHBh=n.YeUq.satisfiedCount,n.TXth[n.jclx].HxYU=!0,n.LjPk())}else{var t,i,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===n.jclx){i=!0,t=r[o];break}if(i&&(t.satisfiedCount=1),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(r)),n.TXth[n.jclx].jHBh=n.YeUq.satisfiedCount,n.TXth[n.jclx].HxYU=!0,n.TXth[n.jclx+1].Siqm._timeEnabled){var a=D(n.TXth[n.jclx+1].Siqm._time.unit,n.TXth[n.jclx+1].Siqm._time.value),s=n.TXth[n.jclx+1].Siqm._timeEnabled,l=n.TXth[n.jclx+1].Siqm._id,u=n.TXth[n.jclx+1].jHBh,v=n.TXth[n.jclx+1].Siqm.XbMU.DUbs,d=n.TXth[n.jclx+1].XbMU.wLHD;(new R).kdvQ(n.Siqm.cTiq,v,Date.now(),d,a,s,l,u)}}})),s(this,"ghfw",(function(){if(n._across_sessions&&n.znHr){var t,i,r,o="single",a=!1,s=e.getController().getFromStorage("apx_nokpi_triggerdetails");if((s=JSON.parse(s)).length>0){var l,u=c(s);try{var v=function(){var e=l.value,s=e.id,u=e.satisfiedCount;if(t=n.TXth.find((function(e,t){if(1===(null==e?void 0:e.length)||void 0===(null==e?void 0:e.length)){if(e.Siqm._id===s)return o="single",i=t,!0}else if(e.length>0){var n=e.findIndex((function(e){return e.Siqm._id===s}));if(-1!==n)return i=t,r=n,o="group",!0}return!1})),"single"===o&&t){var v=new R;a=v.yHAo(u,t.Siqm.pbmh,t.Siqm.kbAA);var d=n.TXth.findIndex((function(e){var t;return(null==e||null===(t=e.Siqm)||void 0===t?void 0:t._id)===s}));void 0===d&&(d=i),a&&(n.TXth[d].HxYU=!0)}else if("group"===o&&t){var c=new R;(a=c.yHAo(u,t[r].Siqm.pbmh,t[r].Siqm.kbAA))&&(n.TXth[i][r].HxYU=!0)}};for(u.s();!(l=u.n()).done;)v()}catch(e){u.e(e)}finally{u.f()}}}})),s(this,"pCjf",(function(e){e<0||n.pVIH()})),s(this,"LjPk",(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(n.Hazg)&&e.getController().isBadgeTriggerSatisfied(n.Hazg)||null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===n.Ereh.cTiq?"survey":"campaign",apx_nudge_id:n.Hazg,apx_nudge_name:n.Ereh.DUbs,apx_variant_code:n.Ereh._isExperiment||n.Ereh._only_context?n.Ereh._attr.apx_variant_code:"TG"}),!(n.Dqwg.validate()&&n.xtma.validate(a,s)&&n.GLor.validate()&&n.PlQx.validate())){n.Ereh.cTiq;return n.GLor.retainedDaysValidated?n.GLor.retainedSessionValidated?n.GLor.eventDoneInLT?void n.sVnr("Event done in life time"):n.xtma.userAttributesValidated?n.xtma.sessionAttributeValidated?n.Dqwg._not_in_specified_time?void n.sVnr("Time limits check failed"):n.Dqwg._not_yet_active?void n.sVnr("not in the scheduled time"):n.Dqwg._nudge_expired?void n.sVnr("nudge expired"):void 0:void n.sVnr("Session property filter not met"):void n.sVnr("User property filter not met"):void n.sVnr("User session criteria not met"):void n.sVnr("Retained day criteria not met")}var l=n.TXth.length,u=l<1,v="";0===l&&(u=!0);for(var d=0;d<l;d++){var h=void 0,f=n.TXth[d];if(f.length>1){var m=f[0].Siqm.VnOY;h="AND"===m;for(var _=0;_<f.length;_++){var g=f[0].Siqm.VnOY;h="AND"===g?h&&f[_].HxYU:h||f[_].HxYU}}else h=f.HxYU;if(""===v.trim())u=h;else switch(v){case"AND":u=u&&h;break;case"OR":u=u||h}v=f.length>1?n.groupCombineOperator:f.VnOY}if(!0===o&&(u=!0),u){var p,y;if(console.debug("onCondition satisfied"),!n.YVWL.dhZT(n.Hazg))return void console.warn("Maximum limit reached",n.Hazg);if(!(null!==(p=window.ApxorRTM)&&void 0!==p&&p.isBadgePresent&&null!==(y=window.ApxorRTM)&&void 0!==y&&y.badgesLists.includes(n.Hazg)&&e.getController().isBadgeTriggerSatisfied(n.Hazg))){var b="SURVEY"===n.Ereh.cTiq?"survey":"campaign";null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===n.Ereh.cTiq?"survey":"campaign",apx_nudge_id:n.Hazg,apx_nudge_name:n.Ereh.DUbs,apx_variant_code:n.Ereh._isExperiment||n.Ereh._only_context?n.Ereh._attr.apx_variant_code:"TG"},!1,"",b)}n._across_sessions&&localStorage.removeItem("apx_nokpi_triggerdetails");var E,S=c(n.TXth);try{for(S.s();!(E=S.n()).done;){var q=E.value;if(1===(null==q?void 0:q.length)||void 0===(null==q?void 0:q.length))q.HxYU=!1,q.jHBh=0;else{var x,w=c(q);try{for(w.s();!(x=w.n()).done;){var T=x.value;T.HxYU=!1,T.jHBh=0}}catch(e){w.e(e)}finally{w.f()}}}}catch(e){S.e(e)}finally{S.f()}if(n.aGhL.wogz(n.TXth),n.TXth=[],n.svJa(n.Oxkj,n.lIwH),!0===n.Ereh._only_context){var A="SURVEY"===n.Ereh.cTiq?"survey":"campaign";e.logEvent("apx_context_evaluated",i(i({},n.Ereh._attr),{},{message_name:n.Ereh.DUbs,id:n.Hazg}),!1,"",A)}e.getController().dispatchEvent(n.Ereh.cTiq,{name:n.Ereh.cTiq,additional_info:{uuid:n.Hazg,name:n.Ereh.DUbs}})}})),s(this,"pVIH",(function(){for(var t=n.OAcN.length,r=t<1,o="",a=0;a<t;a++){var s=n.OAcN[a],l=s.HxYU;if(""===o.trim())r=l;else switch(o){case"AND":r=r&&l;break;case"OR":r=r||l}o=s.mOhQ}if(r){if(e.getController().persistTerminationInfoLocally(n.Hazg),!0===n.Ereh._only_context){var u="SURVEY"===n.Ereh.cTiq?"survey":"campaign";e.logEvent("apx_context_evaluated",i(i({},n.Ereh._attr),{},{message_name:n.Ereh.DUbs,id:n.Hazg}),!1,"apxor",u)}e.getController().dispatchEvent(n.Ereh.cTiq,{name:n.Ereh.cTiq,additional_info:{uuid:n.Hazg,name:n.Ereh.DUbs}})}})),s(this,"validateForTerminationAttributes",(function(){var t=e.getController().getUserAttributes(),i=e.getController().getSessionAttributes();return n.FpDf.validate(t,i)})),s(this,"mfzx",(function(){n.YVWL.mfzx()})),s(this,"getFrequencyCount",(function(){return n.YVWL.getFrequencyCount()})),s(this,"uurO",(function(){return n.YVWL.mDnO()})),s(this,"pDnJ",(function(e){var t;t="AND"===e[0].Siqm.VnOY;for(var i=0;i<e.length;i++){t="AND"===e[0].Siqm.VnOY?t&&e[i].HxYU:t||e[i].HxYU}return t})),s(this,"sVnr",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.Ereh.cTiq?"survey":"campaign",apx_nudge_id:n.Hazg,apx_nudge_name:n.Ereh.DUbs,apx_variant_code:n.Ereh._isExperiment||n.Ereh._only_context?null===(i=n.Ereh._attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_failure_type:"warn",apx_reason:t})}))})),de=a((function e(){var t=this;r(this,e),s(this,"FFaa",{}),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(g(e)&&g(e.configs)){var i=e.configs;if(!Array.isArray(i))return;i.sort((function(e,t){var i,n;return(null!==(i=e.prio)&&void 0!==i?i:-1)-(null!==(n=t.prio)&&void 0!==n?n:-1)}));for(var n=0;n<i.length;n++){var r=i[n],o=r._id,a=new ve;a.parse(r)?t.FFaa[o]=a:console.warn("Failed to parse cfg",o)}}})),s(this,"validate",(function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(t.FFaa[e]){var r=t.FFaa[e];r.IDxi(i,n)}})),s(this,"getVariantCode",(function(e){return t.FFaa[e]?t.FFaa[e]._variant_code:""})),s(this,"validateForTermination",(function(e,i){t.FFaa[e]&&t.FFaa[e].pCjf(i)})),s(this,"validateForTerminationAttributes",(function(e){return!!t.FFaa[e]&&t.FFaa[e].validateForTerminationAttributes()})),s(this,"mfzx",(function(e){t.FFaa[e].mfzx()})),s(this,"getFrequencyCount",(function(e){var i=t.FFaa[e];if(null!=i)return i.getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var e=t.FFaa;for(var i in e)e[i].uurO()})),s(this,"EdXf",(function(e){try{if(t.FFaa){var i=t.FFaa[e];if(i&&i.Ereh)return i.Ereh}}catch(e){console.log("Error in getting the campaign meta ".concat(e))}return{}}))})),ce=window.ApxorLogger,he=a((function t(){var i=this;r(this,t),s(this,"HpgQ",{}),s(this,"gaon",[]),s(this,"indb",!1),s(this,"initialize",(function(){var t=e.getController();t.registerForEvent("APP_EVENT",(function(e){return i.KJki(e,"AE")})),t.registerForEvent("CLIENT_EVENT",(function(e){return i.KJki(e,"CE")}))})),s(this,"hOGO",(function(){for(var e in i.gaon)i.dTHU(e.event,e.key,e.type);i.indb=!0})),s(this,"lNUe",(function(e,t){var n;"function"==typeof t&&((n=i.HpgQ[e]?i.HpgQ[e]:[]).push(t),i.HpgQ[e]=n,ce.debug("Listeners list: ",i.HpgQ))})),s(this,"unregisterFromEvent",(function(e,t){if(i.HpgQ[e]){for(var n=i.HpgQ[e],r=[],o=0;o<n.length;o++){var a=n[o];a!==t&&r.push(a)}i.HpgQ[e]=r}})),s(this,"KJki",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE";i.dTHU(e,"any_event",t),"apxor"===(null==e?void 0:e.loggedBy)?i.dTHU(e,"apxor_event",t):"customer"===(null==e?void 0:e.loggedBy)&&i.dTHU(e,"customer_event",t),"campaign"===(null==e?void 0:e.apx_nudge_type)?i.dTHU(e,"campaign_event",t):"survey"===(null==e?void 0:e.apx_nudge_type)&&i.dTHU(e,"survey_event",t);var n=t+"___"+e.name;i.dTHU(e,n,t)})),s(this,"dTHU",(function(t,n,r){if(i.indb){if(ce.debug("Notifying listeners for event: "+t+", "+n,i.HpgQ),i.HpgQ[n])for(var o=i.HpgQ[n],a=e.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(r,t.name,a,t.additional_info)}}else i.gaon.push({event:t,key:n,type:r})}))})),fe=window.ApxorLogger,me=function(){function t(){var i=this;return r(this,t),s(this,"akqR",!1),s(this,"wxWE",null),s(this,"nMjQ",T()),s(this,"jVuN",new he),s(this,"wPAI",e.getSiteId()),s(this,"raQj",{}),s(this,"getQeState",(function(){try{var t=e.getController().getFromStorage("qe_state");return t?JSON.parse(b(i.wPAI,t)):(i.raQj={},i.setQeState())}catch(e){return i.raQj={},i.setQeState()}})),s(this,"setQeState",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{e.getController().persistToStorage("qe_state",i.raQj,!0)}catch(n){""===t?i.raQj={}:i.raQj[t]={SESSION:0,OVERALL:0,DATES:{}},e.getController().persistToStorage("qe_state",i.raQj,!0)}return i.raQj})),s(this,"initialize",(function(){i.akqR||(i.akqR=!0,i.wxWE=new de,i.jVuN.initialize(),i.raQj=i.getQeState(),fe.info("QE Initialized.."))})),s(this,"parse",(function(e){i.Gpek()?(i.wxWE.parse(e),i.jVuN.hOGO()):fe.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;i.Gpek()&&i.wxWE.validate(e,t,n)})),s(this,"getVariantCode",(function(e){return i.wxWE.getVariantCode(e)})),s(this,"validateForTermination",(function(e,t){i.Gpek()&&i.wxWE.validateForTermination(e,t)})),s(this,"validateForTerminationAttributes",(function(e,t){return i.wxWE.validateForTerminationAttributes(e,t)})),s(this,"updateCount",(function(e){try{g(i.raQj[e])||i.createObjConfig(e),i.incrementFrequencies(e),i.setQeState(e),i.wxWE.mfzx(e)}catch(e){console.log("Could not update the count config:".concat(e))}})),s(this,"resetFrequencyCounts",(function(){i.wxWE.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(e){return i.wxWE.getFrequencyCount(e)})),s(this,"registerForEvent",(function(e,t){i.jVuN.lNUe(e,t)})),s(this,"unregisterFromEvent",(function(e,t){i.jVuN.unregisterFromEvent(e,t)})),s(this,"notifyEventListener",(function(e){i.jVuN.KJki(e)})),s(this,"fetch",(function(t,i,n,r){e.getController().fetchConfiguration(t,i,n,r)})),s(this,"Gpek",(function(){return i.akqR})),s(this,"getCampaignMetaFromQueryEngine",(function(e){return i.wxWE.EdXf(e)})),s(this,"AzVj",(function(){return i.nMjQ})),t.instance||(t.instance=this),t.instance}return a(t,[{key:"createObjConfig",value:function(e){try{this.raQj=this.getQeState(),g(this.raQj[e])||(this.raQj[e]={SESSION:0,OVERALL:0,DATES:{}},this.nMjQ&&(this.raQj[e].DATES[this.nMjQ]=0),this.setQeState(e))}catch(e){fe.error("Can not create the frequency count object:"+e)}}},{key:"incrementFrequencies",value:function(e){this.raQj=this.getQeState();var t=this.raQj[e];t.SESSION=t.SESSION+1,t.OVERALL=t.OVERALL+1;var i=T();i===this.nMjQ&&t.DATES&&t.DATES[i]||(this.nMjQ=i,t.DATES={},t.DATES[this.nMjQ]=0),t.DATES[this.nMjQ]=t.DATES[this.nMjQ]+1}}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}}]),t}();s(me,"instance",void 0),window.ceVersion=200;try{void 0===exports&&null===exports||(exports.default=me,module.exports=exports.default)}catch(e){}return me}));
|
package/package.json
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apxor-qe",
|
|
3
|
-
"version": "
|
|
4
|
-
"author": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"author": "Ravi Teja Akella <ravi.akella@apxor.com> (https://www.apxor.com)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
7
|
-
"name": "
|
|
8
|
-
"email": "
|
|
7
|
+
"name": "Raavi Venkata Sai Chaitanya",
|
|
8
|
+
"email": "saichaitanya.raavi@apxor.com",
|
|
9
|
+
"url": "https://www.apxor.com"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "Gautham Gokulakonda",
|
|
13
|
+
"email": "gautham.gokulakonda@apxor.com",
|
|
14
|
+
"url": "https://www.apxor.com"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "Taraka Swathi",
|
|
18
|
+
"email": "tarakaswathi.singamsetti@apxor.com",
|
|
19
|
+
"url": "https://www.apxor.com"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "Rahul SriRam",
|
|
23
|
+
"email": "rahul.kocherlakota@apxor.com",
|
|
9
24
|
"url": "https://www.apxor.com"
|
|
10
25
|
}
|
|
11
26
|
],
|
|
@@ -52,8 +67,13 @@
|
|
|
52
67
|
},
|
|
53
68
|
"dependencies": {
|
|
54
69
|
"jsdom": "^22.1.0",
|
|
55
|
-
"apxor": "
|
|
70
|
+
"apxor": "3.0.0"
|
|
71
|
+
},
|
|
72
|
+
"engines": {
|
|
73
|
+
"pnpm": ">=8",
|
|
74
|
+
"node": ">=20"
|
|
56
75
|
},
|
|
76
|
+
"packageManager": "pnpm@9.3.0",
|
|
57
77
|
"files": [
|
|
58
78
|
"dist"
|
|
59
79
|
],
|