owtlab-tracking
Version:
A simple Tracking system
8 lines • 68.8 kB
JavaScript
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=47)}([function(e,t,n){"use strict";e.exports=function(e,t,n){var r=void 0;if(!e)return 0;if(n=n||e,e instanceof Array){for(r=0;r<e.length;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1}},function(e,t,n){"use strict";n.r(t),function(e){var t=n(20),r=n(5),o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("unable to locate global object")}();o.Promise?o.Promise.prototype.finally||(o.Promise.prototype.finally=r.a):o.Promise=t.a}.call(this,n(4))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.configDefault={queue:{capacity:5e3,interval:15},retry:{limit:10,initialDelay:200,retryOnResponseStatuses:[408,500,502,503,504]},unique:!1,cache:{dbName:"keenTracking",dbCollectionName:"events",dbCollectionKey:"hash",maxAge:6e4}};t.default=r},function(e,t,n){"use strict";e.exports=function(e){for(var t=1;t<arguments.length;t++)for(var n in arguments[t])e[n]=arguments[t][n];return e}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.a=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowProfile=function(){var e=void 0,t=void 0,n=void 0;if("undefined"==typeof document)return{};e=document.body||{},t=document.documentElement||{},n={height:"innerHeight"in window?window.innerHeight:document.documentElement.offsetHeight,width:"innerWidth"in window?window.innerWidth:document.documentElement.offsetWidth,scrollHeight:Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)||null},window.screen&&(n.ratio={height:window.screen.availHeight?parseFloat((window.innerHeight/window.screen.availHeight).toFixed(2)):null,width:window.screen.availWidth?parseFloat((window.innerWidth/window.screen.availWidth).toFixed(2)):null});return n},t.getDeviceContext=function(){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))return"mobile";return"desktop"}},function(e,t){!function(e){"use strict";if(!e.fetch){var t={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(t.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=function(e){return e&&DataView.prototype.isPrototypeOf(e)},o=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};l.prototype.append=function(e,t){e=s(e),t=u(t);var n=this.map[e];this.map[e]=n?n+","+t:t},l.prototype.delete=function(e){delete this.map[s(e)]},l.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},l.prototype.set=function(e,t){this.map[s(e)]=u(t)},l.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),c(e)},l.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),c(e)},l.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),c(e)},t.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var i=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},v.call(m.prototype),v.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},g.error=function(){var e=new g(null,{status:0,statusText:""});return e.type="error",e};var a=[301,302,303,307,308];g.redirect=function(e,t){if(-1===a.indexOf(t))throw new RangeError("Invalid status code");return new g(null,{status:t,headers:{location:e}})},e.Headers=l,e.Request=m,e.Response=g,e.fetch=function(e,n){return new Promise(function(r,o){var i=new m(e,n),a=new XMLHttpRequest;a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;r(new g(o,n))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.open(i.method,i.url,!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),i.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send(void 0===i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function l(e){this.map={},e instanceof l?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function p(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(t.arrayBuffer&&t.blob&&r(e))this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!t.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!o(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=h(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var e,t,n,r=f(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=d(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function m(e,t){var n,r,o=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),i.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function y(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function g(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:this)},function(e,t){e.exports=function(e){for(var t=1;t<arguments.length;t++)for(var n in arguments[t])e[n]=arguments[t][n];return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomNodePath=function(e){if(!e.nodeName)return"";var t=[];for(;null!=e.parentNode;){for(var n=0,r=0,o=0;o<e.parentNode.childNodes.length;o++){var i=e.parentNode.childNodes[o];i.nodeName==e.nodeName&&(i===e&&(r=n),n++)}e.hasAttribute("id")&&""!=e.id?t.unshift(e.nodeName.toLowerCase()+"#"+e.id):n>1?t.unshift(e.nodeName.toLowerCase()+":eq("+r+")"):t.unshift(e.nodeName.toLowerCase()),e=e.parentNode}return t.slice(1).join(" > ")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getScreenProfile=function(){var e=void 0,t=void 0;if("undefined"==typeof window||!window.screen)return{};e=["height","width","colorDepth","pixelDepth","availHeight","availWidth"],t={};for(var n=0;n<e.length;n++)t[e[n]]=window.screen[e[n]]?window.screen[e[n]]:null;return t.orientation={angle:window.screen.orientation?window.screen.orientation.angle:0,type:window.innerWidth>window.innerHeight?"landscape":"portrait"},t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomainName=function(e){var t=function(e){var t=void 0;t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0];return t=(t=t.split(":")[0]).split("?")[0]}(e),n=t.split("."),r=n.length;r>2&&(t=n[r-2]+"."+n[r-1],2==n[r-2].length&&2==n[r-1].length&&(t=n[r-3]+"."+t));return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.deepExtend=function e(t){for(var n=1;n<arguments.length;n++)if(t instanceof Array&&arguments[n]instanceof Array)for(var i=0;i<arguments[n].length;i++)t.indexOf(arguments[n][i])<0&&t.push(arguments[n][i]);else for(var a in arguments[n])void 0!==t[a]&&"object"===r(t[a])&&"object"===r(arguments[n][a])&&null!==arguments[n][a]?e(t[a],o(arguments[n][a])):void 0!==arguments[n][a]&&"function"!=typeof arguments[n][a]&&(t[a]=o(arguments[n][a]));return t};function o(e){return JSON.parse(JSON.stringify(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.extendEvent=function(e,t){if(2!==arguments.length||"string"!=typeof e||"object"!==(void 0===t?"undefined":r(t))&&"function"!=typeof t)return void u.call(this,"Incorrect arguments provided to #extendEvent method");return this.extensions.collections[e]=this.extensions.collections[e]||[],this.extensions.collections[e].push(t),this.emit("extendEvent",e,t),this},t.extendEvents=function(e){if(1!==arguments.length||"object"!==(void 0===e?"undefined":r(e))&&"function"!=typeof e)return void u.call(this,"Incorrect arguments provided to #extendEvents method");return this.extensions.events.push(e),this.emit("extendEvents",e),this},t.getExtendedEventBody=function(e,t){t&&t.length>0&&(0,s.default)(t,function(t,n){var r="function"==typeof t?t():t;(0,i.deepExtend)(e,r)});return e};var o,i=n(12),a=n(0),s=(o=a)&&o.__esModule?o:{default:o};function u(e){this.emit("error","Event(s) not extended: "+e)}},function(e){e.exports={name:"owtlab-tracking",version:"1.0.0-rc.3",description:"A simple Tracking system",main:"dist/node/owtlab-tracking.js",browser:"dist/owtlab-tracking.js",repository:{type:"git",url:"https://github.com/roykesserwani/owtlab-tracking.git"},scripts:{start:"NODE_ENV=development webpack-dev-server",test:"NODE_ENV=test jest && npm run test:node","test:node":"NODE_ENV=test TEST_ENV=node jest","test:watch":"NODE_ENV=test jest --watch","test:node:watch":"NODE_ENV=test TEST_ENV=node jest --watch",build:"NODE_ENV=production webpack -p && NODE_ENV=production OPTIMIZE_MINIMIZE=1 webpack -p && npm run build:node","build:node":"TARGET=node NODE_ENV=production webpack -p",profile:"webpack --profile --json > stats.json",analyze:"webpack-bundle-analyzer stats.json /dist",preversion:"npm run build:node && npm run test",version:"npm run build && git add .",postversion:"git push && git push --tags && npm publish",demo:"node ./test/demo/index.node.js"},bugs:"https://github.com/roykesserwani/owtlab-tracking/issues",keywords:["Tracking","Tracker","Event Tracker","Event tracking","Track events","Page tracking","User tracking","Analytics event tracking","Analytics events","Analytics tracking","Custom events","Analytics","Stats","Statistics","Monitoring","Metrics","Pageviews","Segmentation","Funnel","Conversion","Log","Logger","Logging","Javascript events","Universal tracking","Click analytics"],contributors:["Dustin Larimer <dustin@keen.io> (https://github.com/dustinlarimer)","Eric Anderson <eric@keen.io> (https://github.com/aroc)","Joe Wegner <joe@keen.io> (http://www.wegnerdesign.com)","Alex Kleissner <alex@keen.io> (https://github.com/hex337)","Adam Kasprowicz <adam.kasprowicz@keen.io> (https://github.com/adamkasprowicz)","Dariusz Łacheta <dariusz.lacheta@keen.io> (https://github.com/dariuszlacheta)"],license:"MIT",dependencies:{"component-emitter":"^1.2.0","eslint-plugin-react":"^7.20.6","js-cookie":"2.1.0","keen-core":"^0.1.3","promise-polyfill":"^8.0.0","whatwg-fetch":"^2.0.4"},devDependencies:{"babel-core":"^6.26.3","babel-jest":"^23.0.1","babel-loader":"^7.1.5","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1",eslint:"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-loader":"^2.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0",jest:"^22.4.3","jest-fetch-mock":"^1.6.5",merge:"^1.2.1",nock:"^9.2.6","regenerator-runtime":"^0.11.1","replace-in-file":"^3.4.0","url-parse":"^1.4.3",webpack:"^4.5.0","webpack-bundle-analyzer":"^3.3.2","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.14","xhr-mock":"^2.3.2"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isLocalStorageAvailable=function(){try{return localStorage.setItem("test","test"),localStorage.removeItem("test"),!0}catch(e){return!1}}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setOptOut=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!r.isLocalStorageAvailable)return;if(e)return void localStorage.setItem("optout",e);localStorage.removeItem("optout")};var r=n(15)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.queue=s;var o=a(n(18)),i=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this instanceof s==!1?new s(e):(this.capacity=0,this.config=r({},i.default.queue,e),this.events={},this.interval=0,this.timer=null,this)}(0,o.default)(s.prototype),s.prototype.check=function(){return function(e){if(e.capacity>0&&e.interval>=e.config.interval)return!0;if(e.capacity>=e.config.capacity)return!0;return!1}(this)&&this.flush(),0!==this.config.interval&&0!==this.capacity||this.pause(),this},s.prototype.flush=function(){return this.emit("flush"),this.interval=0,this},s.prototype.pause=function(){return this.timer&&(clearInterval(this.timer),this.timer=null),this},s.prototype.start=function(){var e=this;return e.pause(),e.timer=setInterval(function(){e.interval++,e.check()},1e3),e}},function(e,t,n){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t);return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(45)),o=n(17),i=n(16),a=s(n(14));function s(e){return e&&e.__esModule?e:{default:e}}r.default.helpers=r.default.helpers||{},r.default.prototype.observers=r.default.observers||{},r.default.on("client",function(e){e.extensions={events:[],collections:{}},e.config.respectDoNotTrack||(this.doNotTrack=!1),void 0!==e.config.optOut&&((0,i.setOptOut)(e.config.optOut),this.optedOut=e.config.optOut),e.queue=(0,o.queue)(e.config.queue),e.queue.on("flush",function(){e.recordDeferredEvents()})}),r.default.prototype.client_secret=function(e){return arguments.length?(this.config.client_secret=e?String(e):null,this):this.config.client_secret},r.default.prototype.referrerPolicy=function(e){return arguments.length?(this.config.referrerPolicy=e?String(e):null,this):this.config.referrerPolicy},r.default.prototype.setGlobalProperties=function(e){return r.default.log("This method has been removed. Check out #extendEvents: https://github.com/keen/keen-tracking.js#extend-events"),this},r.default.version=a.default.version,t.default=r.default},function(e,t,n){"use strict";(function(e){var r=n(5),o=setTimeout;function i(){}function a(e){if(!(this instanceof a))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function s(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,a._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void c(t.promise,e)}u(t.promise,r)}else(1===e._state?u:c)(t.promise,e._value)})):e._deferreds.push(t)}function u(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof a)return e._state=3,e._value=t,void l(e);if("function"==typeof n)return void f((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,l(e)}catch(t){c(e,t)}var r,o}function c(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&a._immediateFn(function(){e._handled||a._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)s(e,e._deferreds[t]);e._deferreds=null}function f(e,t){var n=!1;try{e(function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,c(t,e))})}catch(e){if(n)return;n=!0,c(t,e)}}a.prototype.catch=function(e){return this.then(null,e)},a.prototype.then=function(e,t){var n=new this.constructor(i);return s(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,n)),n},a.prototype.finally=r.a,a.all=function(e){return new a(function(t,n){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(t){i(e,t)},n)}r[e]=a,0==--o&&t(r)}catch(e){n(e)}}for(var a=0;a<r.length;a++)i(a,r[a])})},a.resolve=function(e){return e&&"object"==typeof e&&e.constructor===a?e:new a(function(t){t(e)})},a.reject=function(e){return new a(function(t,n){n(e)})},a.race=function(e){return new a(function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)})},a._immediateFn="function"==typeof e&&function(t){e(t)}||function(e){o(e,0)},a._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},t.a=a}).call(this,n(39).setImmediate)},function(e,t,n){"use strict";function r(e){return this instanceof r==!1?new r(e):(this.count=e||0,this)}Object.defineProperty(t,"__esModule",{value:!0}),t.timer=r,r.prototype.start=function(){var e=this;return this.pause(),this.interval=setInterval(function(){e.count++},1e3),this},r.prototype.pause=function(){return clearInterval(this.interval),this},r.prototype.value=function(){return this.count},r.prototype.clear=function(){return this.count=0,this}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.serializeForm=function(e,t){"object"!==(void 0===t?"undefined":r(t))?t={hash:!!t}:void 0===t.hash&&(t.hash=!0);for(var n=t.hash?{}:"",a=t.serializer||(t.hash?s:u),c=e&&e.elements?e.elements:[],l=Object.create(null),f=0;f<c.length;++f){var d=c[f];if(!(t.ignoreTypes&&t.ignoreTypes.indexOf(d.type)>-1)&&((t.disabled||!d.disabled)&&d.name&&i.test(d.nodeName)&&!o.test(d.type))){var p=d.name,h=d.value;if("checkbox"!==d.type&&"radio"!==d.type||d.checked||(h=void 0),t.empty){if("checkbox"!==d.type||d.checked||(h=""),"radio"===d.type&&(l[d.name]||d.checked?d.checked&&(l[d.name]=!0):l[d.name]=!1),void 0==h&&"radio"==d.type)continue}else if(!h)continue;if("select-multiple"!==d.type)n=a(n,p,h);else{h=[];for(var v=d.options,m=!1,y=0;y<v.length;++y){var g=v[y],b=t.empty&&!g.value,w=g.value||b;g.selected&&w&&(m=!0,n=t.hash&&"[]"!==p.slice(p.length-2)?a(n,p+"[]",g.value):a(n,p,g.value))}!m&&t.empty&&(n=a(n,p,""))}}}if(t.empty)for(var p in l)l[p]||(n=a(n,p,""));return n};var o=/^(?:submit|button|image|reset|file)$/i,i=/^(?:input|select|textarea|keygen)/i,a=/(\[[^\[\]]*\])/g;function s(e,t,n){if(t.match(a)){!function e(t,n,r){if(0===n.length)return t=r;var o=n.shift(),i=o.match(/^\[(.+?)\]$/);if("[]"===o)return t=t||[],Array.isArray(t)?t.push(e(null,n,r)):(t._values=t._values||[],t._values.push(e(null,n,r))),t;if(i){var a=i[1],s=+a;isNaN(s)?(t=t||{})[a]=e(t[a],n,r):(t=t||[])[s]=e(t[s],n,r)}else t[o]=e(t[o],n,r);return t}(e,function(e){var t=[],n=new RegExp(a),r=/^([^\[\]]*)/.exec(e);for(r[1]&&t.push(r[1]);null!==(r=n.exec(e));)t.push(r[1]);return t}(t),n)}else{var r=e[t];r?(Array.isArray(r)||(e[t]=[r]),e[t].push(n)):e[t]=n}return e}function u(e,t,n){return n=n.replace(/(\r)?\n/g,"\r\n"),n=(n=encodeURIComponent(n)).replace(/%20/g,"+"),e+(e?"&":"")+encodeURIComponent(t)+"="+n}},function(e,t,n){var r,o;
/*!
* JavaScript Cookie v2.1.0
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/void 0===(o="function"==typeof(r=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}return function t(n){function r(t,o,i){var a;if(arguments.length>1){if("number"==typeof(i=e({path:"/"},r.defaults,i)).expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*i.expires),i.expires=s}try{a=JSON.stringify(o),/^[\{\[]/.test(a)&&(o=a)}catch(e){}return o=n.write?n.write(o,t):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[t,"=",o,i.expires&&"; expires="+i.expires.toUTCString(),i.path&&"; path="+i.path,i.domain&&"; domain="+i.domain,i.secure?"; secure":""].join("")}t||(a={});for(var u=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,l=0;l<u.length;l++){var f=u[l].split("="),d=f[0].replace(c,decodeURIComponent),p=f.slice(1).join("=");'"'===p.charAt(0)&&(p=p.slice(1,-1));try{if(p=n.read?n.read(p,d):n(p,d)||p.replace(c,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(e){}if(t===d){a=p;break}t||(a[d]=p)}catch(e){}}return a}return r.get=r.set=r,r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,n){r(t,"",e(n,{expires:-1}))},r.withConverter=t,r}(function(){})})?r.call(t,n,t,e):r)||(e.exports=o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cookie=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=a(n(23)),i=a(n(8));function a(e){return e&&e.__esModule?e:{default:e}}var s=t.cookie=function e(t){if(arguments.length)return this instanceof e==!1?new e(t):(this.config={key:t,options:{expires:365}},this.data=this.get(),this)};s.prototype.get=function(e){var t={};return o.default.get(this.config.key)&&(t=o.default.getJSON(this.config.key)),e&&"object"===(void 0===t?"undefined":r(t))&&null!==typeof t?void 0!==t[e]?t[e]:null:t},s.prototype.set=function(e,t,n){return arguments.length&&this.enabled()?("string"==typeof e&&arguments.length>=2?this.data[e]=t||null:"object"===(void 0===e?"undefined":r(e))&&1===arguments.length&&(0,i.default)(this.data,e),o.default.set(this.config.key,this.data,(0,i.default)(this.config.options,n||{})),this):this},s.prototype.expire=function(e){return e?o.default.set(this.config.key,this.data,(0,i.default)(this.config.options,{expires:e})):(o.default.remove(this.config.key),this.data={}),this},s.prototype.options=function(e){return arguments.length?(this.config.options="object"===(void 0===e?"undefined":r(e))?e:{},this):this.config.options},s.prototype.enabled=function(){return navigator.cookieEnabled}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues)return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)});return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"==e?t:3&t|8;return n.toString(16)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getScrollState=function(e){var t="object"===(void 0===e?"undefined":r(e))?e:{},n=(0,a.default)({pixel:0,pixel_max:0,ratio:null,ratio_max:null},t);void 0===("undefined"==typeof window?"undefined":r(window))&&void 0===("undefined"==typeof document?"undefined":r(document))||(n.pixel=(void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)+(window.innerHeight||document.documentElement.clientHeight),n.pixel>n.pixel_max&&(n.pixel_max=n.pixel),n.ratio=parseFloat(Number(n.pixel/s()).toFixed(2)),n.ratio_max=parseFloat(Number(n.pixel_max/s()).toFixed(2)));return n};var o,i=n(8),a=(o=i)&&o.__esModule?o:{default:o};function s(){var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)||null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomNodeProfile=function(e){return{action:e.action,class:e.className,href:o(e,"href"),id:o(e,"id"),event_key:o(e,"data-event-key"),method:e.method,name:e.name,node_name:e.nodeName,selector:(0,r.getDomNodePath)(e),text:o(e,"text"),title:o(e,"title"),type:e.type,x_position:e.offsetLeft||e.clientLeft||null,y_position:e.offsetTop||e.clientTop||null}};var r=n(9);var o=function e(t,n){return t[n]?t[n]:t.hasAttribute&&t.hasAttribute(n)?t.getAttribute(n):t.parentNode?e(t.parentNode,n):null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDatetimeIndex=function(e){var t=e||new Date;return{hour_of_day:t.getHours(),day_of_week:parseInt(1+t.getDay()),day_of_month:t.getDate(),month:parseInt(1+t.getMonth()),year:t.getFullYear()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBrowserProfile=function(){return{cookies:void 0!==navigator.cookieEnabled&&navigator.cookieEnabled,codeName:navigator.appCodeName,description:function(){var e=void 0;document&&"function"==typeof document.querySelector&&(e=document.querySelector('meta[name="description"]'));return e?e.content:""}(),language:navigator.language,name:navigator.appName,online:navigator.onLine,platform:navigator.platform,useragent:navigator.userAgent,version:navigator.appVersion,doNotTrack:navigator.doNotTrack,screen:(0,r.getScreenProfile)(),window:(0,o.getWindowProfile)()}};var r=n(10),o=n(6)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.initAutoTrackingCore=function(e){return function(t){var n=this,o=e.helpers,i=e.utils,c=i.extend({ignoreDisabledFormFields:!1,ignoreFormFieldTypes:["password"],recordClicks:!0,recordClicksPositionPointer:!1,recordFormSubmits:!0,recordPageViews:!0,recordPageViewsOnExit:!1,recordScrollState:!0,shareUuidAcrossDomains:!1,collectIpAddress:!0,collectUuid:!0,recordElementViews:!0,catchError:void 0},t);if("beaconAPI"===n.config.requestType&&c.catchError)throw"You cannot use the BeaconAPI and catchError function in the same time, because BeaconAPI ignores errors. For requests with error handling - use requestType: 'fetch'";"jsonp"===n.config.requestType&&(c.catchError?n.config.requestType="fetch":n.config.requestType="beaconAPI");var l=new Date,f=0,d=0;if("undefined"!=typeof document){var p=void 0,h=void 0;void 0!==document.hidden?(p="hidden",h="visibilitychange"):void 0!==document.msHidden?(p="msHidden",h="msvisibilitychange"):void 0!==document.webkitHidden&&(p="webkitHidden",h="webkitvisibilitychange");void 0===document.addEventListener&&void 0===p||document.addEventListener(h,function(){if(document[p])return f+=s(l),void(d+=u(l));l=new Date},!1)}var v=new i.cookie("owtlab"),m=o.getDomainName(window.location.hostname),y=m&&c.shareUuidAcrossDomains?{domain:"."+m}:{},g=void 0;c.collectUuid&&((g=v.get("uuid"))||(g=o.getUniqueId(),v.set("uuid",g,y)));var b=v.get("initialReferrer");b||(b=document&&document.referrer||void 0,v.set("initialReferrer",b,y));var w={};c.recordScrollState&&(w=o.getScrollState(),i.listener("window").on("scroll",function(){w=o.getScrollState(w)}));var _=[{name:"owtlab:ua_parser",input:{ua_string:"user_agent"},output:"tech"},{name:"owtlab:url_parser",input:{url:"url.full"},output:"url.info"},{name:"owtlab:url_parser",input:{url:"referrer.full"},output:"referrer.info"},{name:"owtlab:date_time_parser",input:{date_time:"owtlab.timestamp"},output:"time.utc"},{name:"owtlab:date_time_parser",input:{date_time:"local_time_full"},output:"time.local"}];if(_.push({name:"owtlab:ip_to_geo",input:{ip:"ip_address",remove_ip_property:!c.collectIpAddress},output:"geo"}),n.extendEvents(function(){var e=o.getBrowserProfile();return{tracked_by:a.default.name+"-"+a.default.version,local_time_full:(new Date).toISOString(),user:{uuid:g},page:{title:document?document.title:null,description:e.description,scroll_state:w,time_on_page:f>0?f:s(l),time_on_page_ms:d>0?d:u(l)},ip_address:"${owtlab.ip}",geo:{},user_agent:"${owtlab.user_agent}",tech:{profile:e},url:{full:window?window.location.href:"",info:{}},referrer:{initial:b,full:document?document.referrer:"",info:{}},time:{local:{},utc:{}},owtlab:{timestamp:(new Date).toISOString(),addons:_}}}),!0===c.recordClicks&&i.listener("a, a *").on("click",function(e){var t=e.target,i={element:o.getDomNodeProfile(t),local_time_full:(new Date).toISOString()};if(!0===c.recordClicksPositionPointer){var a={x_position:e.pageX,y_position:e.pageY};i=r({},i,{pointer:a})}return c.catchError?n.recordEvent({collection:"clicks",event:i}).catch(function(e){c.catchError(e)}):n.recordEvent({collection:"clicks",event:i})}),!0===c.recordFormSubmits&&i.listener("form").on("submit",function(e){var t=e.target,r={disabled:c.ignoreDisabledFormFields,ignoreTypes:c.ignoreFormFieldTypes},a={form:{action:t.action,fields:i.serializeForm(t,r),method:t.method},element:o.getDomNodeProfile(t),local_time_full:(new Date).toISOString()};return c.catchError?n.recordEvent({collection:"form_submissions",event:a}).catch(function(e){c.catchError(e)}):n.recordEvent({collection:"form_submissions",event:a})}),!0!==c.recordPageViews||c.recordPageViewsOnExit||(c.catchError?n.recordEvent({collection:"pageviews"}).catch(function(e){c.catchError(e)}):n.recordEvent({collection:"pageviews"})),c.recordPageViewsOnExit&&"undefined"!=typeof window&&window.addEventListener("beforeunload",function(){n.config.requestType="beaconAPI",n.recordEvent({collection:"pageviews"})}),!0===c.recordElementViews&&"undefined"!=typeof IntersectionObserver){var x=new IntersectionObserver(function(e,t){e.forEach(function(e){if(e.isIntersecting){var t={element:o.getDomNodeProfile(e.target),local_time_full:(new Date).toISOString()};return c.catchError?n.recordEvent({collection:"element_views",event:t}).catch(function(e){c.catchError(e)}):n.recordEvent({collection:"element_views",event:t})}})},{threshold:1}),E=document.querySelectorAll(".track-element-view");E.forEach(function(e){x.observe(e)}),n.observers.IntersectionObserver=x}return n}};var o,i=n(14),a=(o=i)&&o.__esModule?o:{default:o};function s(e){return Math.round(u(e)/1e3)}function u(e){return(new Date).getTime()-e.getTime()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o="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};t.deferEvent=function(e,t){if(2!==arguments.length||"string"!=typeof e)return void c.call(this,"Incorrect arguments provided to #deferEvent method");this.queue.events[e]=this.queue.events[e]||[],this.queue.events[e].push(t),this.queue.capacity++,this.queue.timer||this.queue.start();return this.emit("deferEvent",e,t),this},t.deferEvents=function(e){var t=this;if(1!==arguments.length||"object"!==(void 0===e?"undefined":o(e)))return void c.call(this,"Incorrect arguments provided to #deferEvents method");return(0,s.default)(e,function(e,n){t.queue.events[n]=t.queue.events[n]||[],t.queue.events[n]=t.queue.events[n].concat(e),t.queue.capacity=t.queue.capacity+e.length,t.queue.timer||t.queue.start()}),t.emit("deferEvents",e),t},t.queueCapacity=function(e){return arguments.length?(this.queue.config.capacity=e?Number(e):0,this.queue.check(),this):this.queue.config.capacity},t.queueInterval=function(e){return arguments.length?(this.queue.config.interval=e?Number(e):0,this.queue.check(),this):this.queue.config.interval},t.recordDeferredEvents=function(){var e=this;if(e.queue.capacity>0){e.queue.pause();var t=r({},e.queue.config),n=r({},e.queue.events);e.queue=(0,u.queue)(),e.queue.config=t,e.queue.on("flush",function(){e.recordDeferredEvents()}),e.emit("recordDeferredEvents",n),e.recordEvents(n,function(t,r){t&&e.emit("recordDeferredEventsError",t,n)})}return e};var i,a=n(0),s=(i=a)&&i.__esModule?i:{default:i},u=n(17);function c(e){this.emit("error","Event(s) not deferred: "+e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFromCache=t.saveToCache=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n(1),n(7);var o,i=n(2),a=(o=i)&&o.__esModule?o:{default:o};"undefined"==typeof self&&console.log("IndexedDB is available only in Browser ENV");var s=!0;"undefined"!=typeof self&&"indexedDB"in self||(s=!1);var u=void 0,c=r({},a.default.cache);function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u?Promise.resolve():s?(c=r({},c,e),new Promise(function(e,t){var n=self.indexedDB.open(c.dbName);n.onerror=function(t){s=!1,e()},n.onupgradeneeded=function(e){var t=e.target.result.createObjectStore(c.dbCollectionName,{keyPath:c.dbCollectionKey});t.createIndex(c.dbCollectionKey,c.dbCollectionKey,{unique:!0}),t.createIndex("expiryTime","expiryTime",{unique:!1})},n.onsuccess=function(t){(u=t.target.result).onerror=function(e){s=!1},e(u)}})):Promise.resolve()}t.saveToCache=function(e){return l(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then(function(){var t=u.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).add({hash:e,expiryTime:Date.now()+c.maxAge});t.onsuccess=function(e){},t.onerror=function(e){s=!1}})},t.getFromCache=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(n).then(function(){return new Promise(function(r,o){if(!s)return r(null);var i=u.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).index("expiryTime"),a=IDBKeyRange.upperBound(Date.now(),!0);i.openCursor(a).onsuccess=function(e){var t=e.target.result;if(t){u.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).delete(e.target.result.value[c.dbCollectionKey]);t.continue()}};var l=u.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).index(c.dbCollectionKey).get(t);l.onsuccess=function(o){if(!o.target.result||o.target.result.expiryTime<Date.now()){if(o.target.result&&o.target.result.expiryTime<Date.now()){var i=u.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).delete(o.target.result[c.dbCollectionKey]);return i.onsuccess=function(o){r(e(t,n))},i.onerror=function(o){s=!1,r(e(t,n))},r(null)}return r(null)}return r(o.target.result)},l.onerror=function(o){s=!1,r(e(t,n))}})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.MD5=function(e){return function(e){for(var t,n="0123456789ABCDEF",r="",o=0;o<e.length;o++)t=e.charCodeAt(o),r+=n.charAt(t>>>4&15)+n.charAt(15&t);return r}(function(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>n%32&255);return t}(function(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n=1732584193,r=-271733879,o=-1732584194,l=271733878,f=0;f<e.length;f+=16){var d=n,p=r,h=o,v=l;r=u(r=u(r=u(r=u(r=s(r=s(r=s(r=s(r=a(r=a(r=a(r=a(r=i(r=i(r=i(r=i(r,o=i(o,l=i(l,n=i(n,r,o,l,e[f+0],7,-680876936),r,o,e[f+1],12,-389564586),n,r,e[f+2],17,606105819),l,n,e[f+3],22,-1044525330),o=i(o,l=i(l,n=i(n,r,o,l,e[f+4],7,-176418897),r,o,e[f+5],12,1200080426),n,r,e[f+6],17,-1473231341),l,n,e[f+7],22,-45705983),o=i(o,l=i(l,n=i(n,r,o,l,e[f+8],7,1770035416),r,o,e[f+9],12,-1958414417),n,r,e[f+10],17,-42063),l,n,e[f+11],22,-1990404162),o=i(o,l=i(l,n=i(n,r,o,l,e[f+12],7,1804603682),r,o,e[f+13],12,-40341101),n,r,e[f+14],17,-1502002290),l,n,e[f+15],22,1236535329),o=a(o,l=a(l,n=a(n,r,o,l,e[f+1],5,-165796510),r,o,e[f+6],9,-1069501632),n,r,e[f+11],14,643717713),l,n,e[f+0],20,-373897302),o=a(o,l=a(l,n=a(n,r,o,l,e[f+5],5,-701558691),r,o,e[f+10],9,38016083),n,r,e[f+15],14,-660478335),l,n,e[f+4],20,-405537848),o=a(o,l=a(l,n=a(n,r,o,l,e[f+9],5,568446438),r,o,e[f+14],9,-1019803690),n,r,e[f+3],14,-187363961),l,n,e[f+8],20,1163531501),o=a(o,l=a(l,n=a(n,r,o,l,e[f+13],5,-1444681467),r,o,e[f+2],9,-51403784),n,r,e[f+7],14,1735328473),l,n,e[f+12],20,-1926607734),o=s(o,l=s(l,n=s(n,r,o,l,e[f+5],4,-378558),r,o,e[f+8],11,-2022574463),n,r,e[f+11],16,1839030562),l,n,e[f+14],23,-35309556),o=s(o,l=s(l,n=s(n,r,o,l,e[f+1],4,-1530992060),r,o,e[f+4],11,1272893353),n,r,e[f+7],16,-155497632),l,n,e[f+10],23,-1094730640),o=s(o,l=s(l,n=s(n,r,o,l,e[f+13],4,681279174),r,o,e[f+0],11,-358537222),n,r,e[f+3],16,-722521979),l,n,e[f+6],23,76029189),o=s(o,l=s(l,n=s(n,r,o,l,e[f+9],4,-640364487),r,o,e[f+12],11,-421815835),n,r,e[f+15],16,530742520),l,n,e[f+2],23,-995338651),o=u(o,l=u(l,n=u(n,r,o,l,e[f+0],6,-198630844),r,o,e[f+7],10,1126891415),n,r,e[f+14],15,-1416354905),l,n,e[f+5],21,-57434055),o=u(o,l=u(l,n=u(n,r,o,l,e[f+12],6,1700485571),r,o,e[f+3],10,-1894986606),n,r,e[f+10],15,-1051523),l,n,e[f+1],21,-2054922799),o=u(o,l=u(l,n=u(n,r,o,l,e[f+8],6,1873313359),r,o,e[f+15],10,-30611744),n,r,e[f+6],15,-1560198380),l,n,e[f+13],21,1309151649),o=u(o,l=u(l,n=u(n,r,o,l,e[f+4],6,-145523070),r,o,e[f+11],10,-1120210379),n,r,e[f+2],15,718787259),l,n,e[f+9],21,-343485551),n=c(n,d),r=c(r,p),o=c(o,h),l=c(l,v)}return Array(n,r,o,l)}(function(e){for(var t=Array(e.length>>2),n=0;n<t.length;n++)t[n]=0;for(n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<n%32;return t}(e),8*e.length))).toLowerCase()};function o(e,t,n,r,o,i){return c(function(e,t){return e<<t|e>>>32-t}(c(c(t,e),c(r,i)),o),n)}function i(e,t,n,r,i,a,s){return o(t&n|~t&r,e,t,i,a,s)}function a(e,t,n,r,i,a,s){return o(t&r|n&~r,e,t,i,a,s)}function s(e,t,n,r,i,a,s){return o(t^n^r,e,t,i,a,s)}function u(e,t,n,r,i,a,s){return o(n^(t|~r),e,t,i,a,s)}function c(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUnique=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n(1);var o=s(n(33)),i=n(32),a=s(n(2));function s(e){return e&&e.__esModule?e:{default:e}}var u=[],c=t.isUnique=function(e,t){var n=r({},a.default.cache,e.cache),s=JSON.stringify(t),c=n.hashingMethod,l=c&&"md5"===c.toLowerCase()?(0,o.default)(s):s,f=n.maxAge?Date.now()+n.maxAge:void 0,d={hash:l,expiryTime:f};if(f){var p=Date.now();u=u.filter(function(e){return e.expiryTime>p})}var h=u.find(function(e){return e.hash===l});if(h){if(!(h.expiryTime&&h.expiryTime<Date.now()))return Promise.resolve(!1);u=u.filter(function(e){return e.hash!==l})}return u.push(d),n.storage&&"indexeddb"===n.storage.toLowerCase()?(0,i.getFromCache)(l,n).then(function(e){return!e&&((0,i.saveToCache)(l,n),!0)}):Promise.resolve(!0)};t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e,t){var n=r({},a.default,t.retry||{}),o=n.retry.limit,i=n.retry.initialDelay,s=n.retry.retryOnResponseStatuses,u=0;if(s&&!(s instanceof Array))throw{name:"ArgumentError",message:"retryOn property expects an array"};return new Promise(function(n,r){var a=function(o){fetch(e,t).then(function(e){-1===s.indexOf(e.status)?n(e):o>0?c():r(e)}).catch(function(e){o>0?c():r(e)})};function c(){u+=1,setTimeout(function(){a(o-u)},2^u*i)}a(o-u)})},n(1),n(7);var o,i=n(2),a=(o=i)&&o.__esModule?o:{default:o}},function(e,t,n){"use strict";e.exports={map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="",n=0,r=this.map,o=void 0,i=void 0,a=void 0,s=void 0,u=void 0,c=void 0,l=void 0;for(e=this.utf8.encode(e);n<e.length;)o=e.charCodeAt(n++),i=e.charCodeAt(n++),a=e.charCodeAt(n++),s=o>>2,u=(3&o)<<4|i>>4,c=isNaN(i)?64:(15&i)<<2|a>>6,l=isNaN(i)||isNaN(a)?64:63&a,t=t+r.charAt(s)+r.charAt(u)+r.charAt(c)+r.charAt(l);return t},decode:function(e){var t="",n=0,r=this.map,o=String.fromCharCode,i=void 0,a=void 0,s=void 0,u=void 0,c=void 0,l=void 0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");n<e.length;)i=r.indexOf(e.charAt(n++)),c=(15&(a=r.indexOf(e.charAt(n++))))<<4|(s=r.indexOf(e.charAt(n++)))>>2,l=(3&s)<<6|(u=r.indexOf(e.charAt(n++))),t=t+(o(i<<2|a>>4)+(64!=s?o(c):""))+(64!=u?o(l):"");return this.utf8.decode(t)},utf8:{encode:function(e){for(var t="",n=0,r=String.fromCharCode,o=void 0;n<e.length;)t+=(o=e.charCodeAt(n++))<128?r(o):o>127&&o<2048?r(o>>6|192)+r(63&o|128):r(o>>12|224)+r(o>>6&63|128)+r(63&o|128);return t},decode:function(e){for(var t="",n=0,r=String.fromCharCode,o=void 0;n<e.length;)t+=(o=e.charCodeAt(n))<128?[r(o),n++][0]:o>191&&o<224?[r((31&o)<<6|63&e.charCodeAt(n+1)),n+=2][0]:[r((15&o)<<12|(63&e.charCodeAt(n+1))<<6|63&(c3=e.charCodeAt(n+2))),n+=3][0];return t}}}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=s(d)