!function(){"use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}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},n(e)}function r(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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,i=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(u)throw o}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.params=t,this.siteParams=n,this.packageData=[],this.startSession=null,this.avgScrollSpeed={count:0,sumScrollSpeed:0,avgSpeed:0},this.countEvents={count:0,events:[]},this.bidId=null,this.scrollTicks=0,this.sumDelta=0,this.visibleLinks=[]}return u(e,[{key:"onHit",value:function(){var e=this,t=this.getMainEventData("hit");t.is_in_iframe=this.checkIfInIframe();var n=this.getAllLinksOnPage();this.onClickLinks(n.allLinks),n.hrefs&&(t.links=f(n.hrefs)),setTimeout((function(){var n;null!==(n=e.visibleLinks)&&void 0!==n&&n.length&&(t.visible_links=f(e.visibleLinks)),e.addToPackageData(t),e.send()}),100)}},{key:"checkIfInIframe",value:function(){return window.location!==window.parent.location?1:0}},{key:"onClick",value:function(){var e,t=this;document.addEventListener("click",(function(n){var r=n.target,a=t.getMainEventData("click");a.tag_name=r.tagName.toLowerCase(),t.onChange(r),clearTimeout(e),t.addToPackageData(a),e=setTimeout((function(){t.debounceSendData("send")}),200)}))}},{key:"onClickLinks",value:function(e){var t=this;if(null!=e&&e.length)try{!function(){var n,r,a=v(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;t.onVisibleLinks(o),o.addEventListener("click",(function(e){var r=e.currentTarget,a=t.getMainEventData("click");a.tag_name=r.tagName.toLowerCase(),a.redirect_url=r.href,clearTimeout(n),t.addToPackageData(a),n=setTimeout((function(){t.debounceSendData("send")}),200)}))}}catch(e){a.e(e)}finally{a.f()}}()}catch(e){console.error("onClickLinks: ",e)}}},{key:"onScroll",value:function(){var e,t,n,r=this;this.scrollTicks=0,this.sumDelta=0;var a=d((function(){var t,a=r.getMainEventData("scroll"),o=Math.round(r.sumDelta/r.scrollTicks);o=o>0?o:-o,a.avg_scroll_speed=o,a.scroll_ticks=r.scrollTicks,null!==(t=r.visibleLinks)&&void 0!==t&&t.length&&(a.visible_links=f(r.visibleLinks)),r.sumAvgScrollSpeed(o),e=n=r.sumDelta=r.scrollTicks=0,r.addToPackageData(a),r.debounceSendData("send")}),100);window.addEventListener("scroll",(function(){r.scrollTicks++,t=window.scrollY,e&&(n=t-e,r.sumDelta+=n),e=t,a()}))}},{key:"onChange",value:function(e){var t=this;if(-1!==["INPUT","TEXTAREA"].indexOf(e.tagName)){var n=function n(r){var a=t.getMainEventData("change");a.tag_name=e.tagName.toLowerCase(),t.addToPackageData(a),t.debounceSendData("send"),e.removeEventListener("change",n)};e.addEventListener("change",n),e.addEventListener("blur",(function t(r){e.removeEventListener("change",n),e.removeEventListener("blur",t)}))}}},{key:"onClose",value:function(){var e=this;window.addEventListener("visibilitychange",(function(){if("hidden"===document.visibilityState){var t=e.getMainEventData("close");t.session_time=e.getTimeSession(),t.event_count=e.countEvents.count,t.event_types=e.countEvents.events.join(","),t.avg_scroll_speed=e.avgScrollSpeed.avgSpeed,e.addToPackageData(t),e.controllerRequests("sendBeacon")}}))}},{key:"onVisibleLinks",value:function(e){var t=this;try{new IntersectionObserver((function(e,n){e.forEach((function(e){if(e.isIntersecting)t.visibleLinks.push(e.target.href);else{var n=t.visibleLinks.findIndex((function(t){return t===e.target.href}));-1!==n&&t.visibleLinks.splice(n,1)}}))}),{root:null,rootMargin:"0px",threshold:.5}).observe(e)}catch(e){console.error("onVisibleLinks: ",e)}}},{key:"getMainEventData",value:function(e){var t={};return this.setCountEvents(e),this.bidId&&(t.bid_id=this.bidId),t.event_type=e,t.time=this.siteParams.getTimeUtc(),t.domain=this.siteParams.getDomain(),t.page=this.siteParams.getPage(),this.params.pixel_key&&(t.pixel_id=this.params.pixel_key),this.params.duid&&(t.duid=this.params.duid),this.params.response.duid&&(t.duid=this.params.response.duid),t}},{key:"addToPackageData",value:function(e){this.packageData.push(e)}},{key:"sumAvgScrollSpeed",value:function(e){this.avgScrollSpeed.count++,this.avgScrollSpeed.sumScrollSpeed+=e,this.avgScrollSpeed.avgSpeed=Math.round(this.avgScrollSpeed.sumScrollSpeed/this.avgScrollSpeed.count)}},{key:"setCountEvents",value:function(e){this.countEvents.count+=1,this.countEvents.events.push(e)}},{key:"getTimeSession",value:function(){return Math.round((Date.now()-this.startSession)/1e3)}},{key:"getBidId",value:function(){var e,t=new URLSearchParams(this.siteParams.getLocationSearch()),n=v(t.keys());try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.includes("utm")){var a=t.get(r);y.test(a)&&(this.bidId=a)}}}catch(e){n.e(e)}finally{n.f()}}},{key:"controllerRequests",value:function(e){switch(e){case"send":this.send();break;case"sendBeacon":this.sendBeacon()}}},{key:"createRequestParams",value:function(){var e={url:s.ZX,data:f(this.packageData)};return this.packageData=[],e}},{key:"activateUrls",value:function(){var e,t,n;if(null!==(e=this.params)&&void 0!==e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.urls)&&void 0!==n&&n.length){var r,a=v(this.params.response.urls);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(o)(new Image).src=o}}catch(e){a.e(e)}finally{a.f()}}}},{key:"getAllLinksOnPage",value:function(){try{var e=f(document.querySelectorAll("a"));if(null!=e&&e.length){var t=e.filter((function(e){return null==e?void 0:e.href.includes("http")})).map((function(e){return e.href}));if(null!=t&&t.length)return{hrefs:t,allLinks:e}}}catch(e){console.error("getAllLinksOnPage: ",e)}return null}},{key:"send",value:function(){h.post(this.createRequestParams())}},{key:"sendBeacon",value:function(){h.sendBeacon(this.createRequestParams())}},{key:"addEvents",value:function(){this.getBidId(),this.onHit(),this.onScroll(),this.onClose()}},{key:"init",value:function(){this.debounceSendData=d(this.controllerRequests,1e3),this.startSession=Date.now(),this.addEvents(),this.activateUrls()}}]),e}(),m=function(){function e(){o(this,e)}return u(e,[{key:"getDomain",value:function(){return document.location.host}},{key:"getPage",value:function(){return document.location.href}},{key:"getLocationSearch",value:function(){return document.location.search}},{key:"getRef",value:function(){return document.referrer}},{key:"getConnection",value:function(){var e=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection;return e?{downlink:e.downlink,effectiveType:e.effectiveType,rtt:e.rtt,saveData:e.saveData}:null}},{key:"getCookieEnabled",value:function(){return this.getNavigatorData("cookieEnabled")}},{key:"getDeviceMemory",value:function(){return this.getNavigatorData("deviceMemory")}},{key:"getHardwareConcurrency",value:function(){return this.getNavigatorData("hardwareConcurrency")}},{key:"getLang",value:function(){return this.getNavigatorData("language")}},{key:"getLanguages",value:function(){return this.getNavigatorData("languages")}},{key:"getMaxTouchPoints",value:function(){return this.getNavigatorData("maxTouchPoints")}},{key:"getOs",value:function(){return this.getNavigatorData("platform")}},{key:"getUa",value:function(){return this.getNavigatorData("userAgent")}},{key:"getUaData",value:function(){if(!b())return null;var e=window.navigator.userAgentData;return e?{brands:e.brands,mobile:e.mobile,platform:e.platform}:null}},{key:"getVendor",value:function(){return this.getNavigatorData("vendor")}},{key:"getWebDriver",value:function(){return this.getNavigatorData("webdriver")}},{key:"getTimeUtc",value:function(){var e=new Date;return"".concat(k(e.getUTCHours()),":").concat(k(e.getMinutes()),":").concat(k(e.getSeconds()))}},{key:"getDateUtc",value:function(){var e=new Date,t={year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hours:e.getUTCHours(),minutes:e.getMinutes(),seconds:e.getSeconds()};return"".concat(t.year,"-").concat(k(t.month),"-").concat(k(t.day)," ").concat(k(t.hours),":").concat(k(t.minutes),":").concat(k(t.seconds))}},{key:"getNavigatorData",value:function(e){return function(e){return!b()||function(e){return void 0===window.navigator[e]}(e)||function(e){return""===window.navigator[e]}(e)||function(e){return"object"===n(window.navigator[e])&&0===Object.keys(window.navigator[e]).length}(e)}(e)?null:window.navigator[e]}}]),e}();function k(e){return e<10?"0".concat(e):e}function b(){return"navigator"in window}var w=new m;function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=a(e);if(t){var i=a(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return r(this,n)}}var T=new c,O=new m,P=function(){function e(){o(this,e)}return u(e,[{key:"sendGet",value:function(e){return T.get(e)}},{key:"sendPost",value:function(e){return T.post(e)}}]),e}(),E=function(n){!function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&t(e,n)}(a,n);var r=D(a);function a(){return o(this,a),r.apply(this,arguments)}return u(a,[{key:"init",value:function(){if(void 0!==window.ttf.pixelId){var t=window.ttf.pixelId;if(t){var n=function(t){for(var n=1;n